js-cloudimage-360-view 4.4.0 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- var CI360=function(){"use strict";var dn=Object.defineProperty;var pn=(Q,z,rt)=>z in Q?dn(Q,z,{enumerable:!0,configurable:!0,writable:!0,value:rt}):Q[z]=rt;var ai=(Q,z,rt)=>pn(Q,typeof z!="symbol"?z+"":z,rt);var Q=document.createElement("style");Q.textContent=`:root{--ci360-button-bg: rgba(255, 255, 255, .9);--ci360-button-bg-hover: rgba(255, 255, 255, 1);--ci360-button-size: 40px;--ci360-button-border-radius: 6px;--ci360-button-shadow: 0 2px 8px rgba(0, 0, 0, .15);--ci360-icon-color: #505050;--ci360-icon-color-hover: #333333;--ci360-icon-size: 20px;--ci360-initial-icon-bg: transparent;--ci360-initial-icon-color: #ffffff;--ci360-initial-icon-size: 100px;--ci360-initial-icon-shadow: none;--ci360-spinner-color: rgba(0, 0, 0, .2);--ci360-spinner-accent: #505050;--ci360-spinner-size: 30px;--ci360-fullscreen-bg: #ffffff;--ci360-magnifier-size: 250px;--ci360-magnifier-border: 2px solid rgba(0, 0, 0, .2);--ci360-magnifier-shadow: 0 8px 16px rgba(0, 0, 0, .3);--ci360-focus-color: #0066cc;--ci360-overlay-bg: rgba(255, 255, 255, 1);--ci360-hotspot-color: #00aaff;--ci360-hotspot-border: 2px solid #fff;--ci360-hotspot-size: 18px;--ci360-popper-bg: #ffffff;--ci360-popper-color: #1a1a1a;--ci360-popper-border: 1px solid rgba(0, 0, 0, .1);--ci360-popper-border-radius: 12px;--ci360-popper-shadow: 0 8px 32px rgba(0, 0, 0, .12);--ci360-popper-padding: 16px;--ci360-popper-max-width: 320px;--ci360-popper-font-size: 14px;--ci360-popper-line-height: 1.5;--ci360-popper-title-font-size: 16px;--ci360-popper-title-font-weight: 600;--ci360-popper-title-color: #1a1a1a;--ci360-popper-price-color: #2d8c3c;--ci360-popper-price-font-size: 18px;--ci360-popper-price-font-weight: 700;--ci360-popper-original-price-color: #999999;--ci360-popper-description-color: #666666;--ci360-popper-cta-bg: #0058a3;--ci360-popper-cta-color: #fff;--ci360-popper-cta-border-radius: 8px;--ci360-popper-cta-padding: 8px 16px;--ci360-hints-bg: rgba(255, 255, 255, .9);--ci360-hints-color: #333333;--ci360-hints-font-size: 13px;--ci360-hints-border-radius: 20px;--ci360-hints-shadow: 0 2px 12px rgba(0, 0, 0, .1);--ci360-circle-color: #888888;--ci360-timeline-height: 6px;--ci360-timeline-track-bg: rgba(255, 255, 255, .4);--ci360-timeline-dot-size: 18px;--ci360-timeline-dot-color: var(--ci360-hotspot-color);--ci360-timeline-dot-border: 2px solid #fff;--ci360-timeline-indicator-size: 12px;--ci360-timeline-indicator-color: #333333;--ci360-timeline-tooltip-bg: rgba(255, 255, 255, .95);--ci360-timeline-tooltip-color: #333333}.ci360-theme-dark{--ci360-button-bg: rgba(40, 40, 45, .9);--ci360-button-bg-hover: rgba(55, 55, 60, .95);--ci360-button-shadow: 0 2px 8px rgba(0, 0, 0, .4);--ci360-icon-color: #e0e0e0;--ci360-icon-color-hover: #ffffff;--ci360-initial-icon-bg: transparent;--ci360-initial-icon-color: #ffffff;--ci360-initial-icon-shadow: none;--ci360-spinner-color: rgba(255, 255, 255, .2);--ci360-spinner-accent: #e0e0e0;--ci360-fullscreen-bg: #1a1a1f;--ci360-overlay-bg: rgba(26, 26, 31, 1);--ci360-magnifier-border: 2px solid rgba(255, 255, 255, .2);--ci360-magnifier-shadow: 0 8px 16px rgba(0, 0, 0, .5);--ci360-popper-bg: #1a1a1a;--ci360-popper-color: #f0f0f0;--ci360-popper-border: 1px solid rgba(255, 255, 255, .1);--ci360-popper-shadow: 0 8px 32px rgba(0, 0, 0, .4);--ci360-popper-title-color: #f0f0f0;--ci360-popper-description-color: #aaaaaa;--ci360-popper-original-price-color: #777777;--ci360-hints-bg: rgba(40, 40, 45, .9);--ci360-hints-color: #e0e0e0;--ci360-hints-shadow: 0 2px 12px rgba(0, 0, 0, .3);--ci360-circle-color: #b0b0b0;--ci360-timeline-track-bg: rgba(255, 255, 255, .4);--ci360-timeline-dot-border: 2px solid rgba(255, 255, 255, .9);--ci360-timeline-indicator-color: #e0e0e0;--ci360-timeline-tooltip-bg: rgba(40, 40, 45, .95);--ci360-timeline-tooltip-color: #e0e0e0;--ci360-loader-bg: rgba(40, 40, 45, .9);--ci360-loader-color: #e0e0e0;--ci360-loader-shadow: 0 4px 20px rgba(0, 0, 0, .4)}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.cloudimage-360{width:100%;position:relative}.cloudimage-360-inner-box{width:100%;height:100%;position:relative}.cloudimage-360-icons-container{position:absolute;display:flex;top:15px;right:10px;height:100%;flex-direction:column;align-items:center;z-index:100;gap:8px}.cloudimage-360-transition-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--ci360-overlay-bg);opacity:0;transition:all 1s ease-out;z-index:10}.cloudimage-360-button{width:var(--ci360-button-size);height:var(--ci360-button-size);cursor:pointer;transition:transform .15s ease-out,background-color .15s ease-out,box-shadow .15s ease-out;display:flex;align-items:center;justify-content:center;border-radius:var(--ci360-button-border-radius);border:none;background-color:var(--ci360-button-bg);box-shadow:var(--ci360-button-shadow);padding:6px;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}.cloudimage-360-button:hover{transform:scale(1.05);background-color:var(--ci360-button-bg-hover)}.cloudimage-360-button:focus{outline:none}.cloudimage-360-button:focus-visible{outline:2px solid var(--ci360-focus-color);outline-offset:2px}.cloudimage-360-button svg{width:var(--ci360-icon-size);height:var(--ci360-icon-size);stroke:var(--ci360-icon-color);transition:stroke .15s ease-out}.cloudimage-360-button:hover svg{stroke:var(--ci360-icon-color-hover)}.cloudimage-initial-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--ci360-initial-icon-size);aspect-ratio:150 / 87;border-radius:var(--ci360-initial-icon-border-radius, 0);background-color:var(--ci360-initial-icon-bg);box-shadow:var(--ci360-initial-icon-shadow);transition:all .3s ease;color:var(--ci360-initial-icon-color);display:flex;align-items:center;justify-content:center;z-index:2;-webkit-user-select:none;-moz-user-select:none;user-select:none}.cloudimage-initial-icon svg{width:100%;height:auto;color:var(--ci360-initial-icon-color);fill:var(--ci360-initial-icon-color);filter:drop-shadow(0 2px 4px rgba(0,0,0,.4))}.cloudimage-initial-icon:hover{transform:translate(-50%,-50%) scale(1.08)}.cloudimage-360-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--ci360-loader-size, 70px);height:var(--ci360-loader-size, 70px);border-radius:50%;background-color:var(--ci360-loader-bg, rgba(255, 255, 255, .9));box-shadow:var(--ci360-loader-shadow, 0 4px 20px rgba(0, 0, 0, .15));transition:all .3s ease;color:var(--ci360-loader-color, #505050);display:flex;align-items:center;justify-content:center;z-index:2;-webkit-user-select:none;-moz-user-select:none;user-select:none;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);font-family:system-ui,-apple-system,sans-serif;font-size:14px;font-weight:600}.cloudimage-loading-spinner{width:var(--ci360-spinner-size);height:var(--ci360-spinner-size);transform:translate(-50%,-50%);border:3px solid var(--ci360-spinner-color);position:absolute;top:15px;left:15px;border-bottom-color:var(--ci360-spinner-accent);border-radius:50%;display:inline-block;box-sizing:border-box;opacity:0;animation:rotation .7s linear infinite}.cloudimage-360-view-360-circle{position:absolute;left:0;bottom:0;width:100%;height:auto;margin:auto;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:.2s all;z-index:2;color:var(--ci360-circle-color)}.cloudimage-360-view-360-circle svg{display:block;width:100%;height:auto}.cloudimage-360-fullscreen-modal{position:fixed;top:0;bottom:0;left:0;right:0;width:100%;height:100%;z-index:999;background-color:var(--ci360-fullscreen-bg)}.cloudimage-360-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.cloudimage-360-hints-overlay{position:absolute;bottom:0;left:0;width:100%;display:flex;align-items:flex-end;justify-content:center;padding-bottom:16px;z-index:50;pointer-events:none;opacity:0;transition:opacity .3s ease}.cloudimage-360-hints-overlay.visible{opacity:1}.cloudimage-360-hints-overlay.hiding{opacity:0}.cloudimage-360-hints-container{display:flex;flex-direction:row;gap:20px;padding:10px 20px;background:var(--ci360-hints-bg);border-radius:var(--ci360-hints-border-radius);box-shadow:var(--ci360-hints-shadow);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}.cloudimage-360-hint-item{display:flex;align-items:center;gap:8px;color:var(--ci360-hints-color);font-size:var(--ci360-hints-font-size);font-family:system-ui,-apple-system,sans-serif;white-space:nowrap}.cloudimage-360-hint-item svg{width:16px;height:16px;flex-shrink:0;stroke:var(--ci360-hints-color)}.cloudimage-360-hint-item span{opacity:.9}@media (max-width: 480px){.cloudimage-360-hints-container{flex-direction:column;gap:8px;padding:12px 16px;border-radius:12px}.cloudimage-360-hint-item{font-size:12px}.cloudimage-360-hint-item svg{width:14px;height:14px}.cloudimage-360-initial-icon{width:calc(var(--ci360-initial-icon-size) * .8);height:calc(var(--ci360-initial-icon-size) * .8)}}.cloudimage-360-inner-box.has-hotspot-timeline .cloudimage-360-hints-overlay{padding-bottom:56px}.cloudimage-360-img-magnifier-glass{background-color:#fff;background-image:radial-gradient(circle at center,#fffc,#f0f0f0e6);background-repeat:no-repeat;position:absolute;border:var(--ci360-magnifier-border);border-radius:50%;line-height:200px;text-align:center;z-index:1000;width:var(--ci360-magnifier-size);height:var(--ci360-magnifier-size);top:-75px;right:-85px;box-shadow:var(--ci360-magnifier-shadow);transition:box-shadow .2s ease;overflow:hidden;pointer-events:none}.cloudimage-360-hotspot-timeline{position:absolute;bottom:0;left:0;right:0;width:100%;padding:20px;opacity:0;transition:opacity .3s ease;pointer-events:none;z-index:30;background:linear-gradient(to top,rgba(0,0,0,.45) 0%,rgba(0,0,0,.2) 60%,transparent 100%)}.cloudimage-360-hotspot-timeline.visible{opacity:1;pointer-events:auto}.cloudimage-360-hotspot-timeline-track{position:relative;width:100%;max-width:500px;margin:0 auto;height:var(--ci360-timeline-height);background:var(--ci360-timeline-track-bg);border-radius:calc(var(--ci360-timeline-height) / 2)}.cloudimage-360-hotspot-timeline-indicator{position:absolute;top:50%;left:0;width:var(--ci360-timeline-indicator-size);height:var(--ci360-timeline-indicator-size);background:var(--ci360-timeline-indicator-color);border-radius:50%;transform:translate(-50%,-50%);transition:left .1s ease-out;pointer-events:none;box-shadow:0 2px 4px #0003}.cloudimage-360-hotspot-timeline-dot{position:absolute;top:50%;width:var(--ci360-timeline-dot-size);height:var(--ci360-timeline-dot-size);background:var(--ci360-timeline-dot-color);border:var(--ci360-timeline-dot-border);border-radius:50%;transform:translate(-50%,-50%);cursor:pointer;transition:transform .15s ease,box-shadow .15s ease;box-shadow:0 2px 6px #00000040;padding:0;font:inherit;outline:none}.cloudimage-360-hotspot-timeline-dot:hover{transform:translate(-50%,-50%) scale(1.25);box-shadow:0 3px 10px #0000004d}.cloudimage-360-hotspot-timeline-dot:focus-visible{outline:2px solid var(--ci360-focus-color);outline-offset:2px}.cloudimage-360-hotspot-timeline-tooltip{position:absolute;bottom:calc(100% + 10px);left:50%;transform:translate(-50%);background:var(--ci360-timeline-tooltip-bg);color:var(--ci360-timeline-tooltip-color);padding:6px 12px;border-radius:6px;font-size:13px;font-weight:500;white-space:nowrap;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease;pointer-events:none;box-shadow:0 2px 8px #00000026;z-index:10}.cloudimage-360-hotspot-timeline-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:6px solid transparent;border-top-color:var(--ci360-timeline-tooltip-bg)}.cloudimage-360-hotspot-timeline-tooltip.visible{opacity:1;visibility:visible}@media (max-width: 480px){.cloudimage-360-hotspot-timeline{padding:14px 16px}}.cloudimage-360-fullscreen-modal .cloudimage-360-hotspot-timeline{padding:24px 40px 20px;background:linear-gradient(to top,rgba(0,0,0,.6) 0%,rgba(0,0,0,.3) 60%,transparent 100%)}.cloudimage-360-fullscreen-modal .cloudimage-360-hotspot-timeline-track{max-width:600px;background:#ffffff4d}.cloudimage-360-fullscreen-modal .cloudimage-360-hotspot-timeline-indicator{background:#fff;box-shadow:0 2px 6px #0006}.cloudimage-360-fullscreen-modal .cloudimage-360-hotspot-timeline-dot{border-color:#fff;box-shadow:0 2px 8px #0006}.cloudimage-360-fullscreen-modal .cloudimage-360-hotspot-timeline-tooltip{bottom:calc(100% + 20px)}.cloudimage-360-fullscreen-modal .cloudimage-360-inner-box.has-hotspot-timeline .cloudimage-360-hints-overlay{padding-bottom:64px}.cloudimage-360-hotspot-container{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:20}.cloudimage-360-popper{opacity:1;transition:opacity .2s ease-in-out}.cloudimage-360-hotspot{display:inline-block;position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-50%,-50%);background:var(--ci360-hotspot-color);border:var(--ci360-hotspot-border);border-radius:50%;height:var(--ci360-hotspot-size);width:var(--ci360-hotspot-size);box-shadow:0 0 #0af9,0 2px 6px #0003;opacity:0;animation:pulse 2s infinite;transition:transform .2s ease,box-shadow .2s ease;padding:0;cursor:pointer;font:inherit;outline:none}.cloudimage-360-hotspot:focus-visible{outline:2px solid var(--ci360-focus-color, #0066cc);outline-offset:2px;animation:none}.cloudimage-360-hotspot.visible{opacity:1}@keyframes pulse{0%{transform:scale(1);box-shadow:0 0 #0af9,0 0 0 10px #0af6,0 0 0 20px #0af3}50%{transform:scale(1.1);box-shadow:0 0 0 10px #0af0,0 0 0 20px #00aaff1a,0 0 0 30px #0af0}to{transform:scale(1);box-shadow:0 0 #0af0,0 0 0 10px #0af0,0 0 0 20px #0af0}}.cloudimage-360-hotspot:hover{transform:scale(1.2);box-shadow:0 0 0 5px #00aaff80,0 4px 12px #0000004d}.cloudimage-360-popper{background:var(--ci360-popper-bg);color:var(--ci360-popper-color);border:var(--ci360-popper-border);padding:var(--ci360-popper-padding);border-radius:var(--ci360-popper-border-radius);box-shadow:var(--ci360-popper-shadow);font-family:system-ui,-apple-system,sans-serif;font-size:var(--ci360-popper-font-size);line-height:var(--ci360-popper-line-height);max-width:var(--ci360-popper-max-width);z-index:9999;text-align:left;transition:opacity .2s ease;opacity:0}.cloudimage-360-popper[data-show]{opacity:1}.ci360-popper-image-wrapper{aspect-ratio:16 / 9;overflow:hidden;border-radius:calc(var(--ci360-popper-border-radius) - 4px) calc(var(--ci360-popper-border-radius) - 4px) 0 0;margin:calc(var(--ci360-popper-padding) * -1);margin-bottom:12px;width:calc(100% + var(--ci360-popper-padding) * 2)}.ci360-popper-image{display:block;width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.ci360-popper-body{line-height:1.5;text-align:left}.ci360-popper-title{margin:0 0 4px;font-size:var(--ci360-popper-title-font-size);font-weight:var(--ci360-popper-title-font-weight);color:var(--ci360-popper-title-color);line-height:1.3}.ci360-popper-price-row{display:inline-flex;align-items:baseline;gap:6px;margin-bottom:8px;flex-wrap:wrap}.ci360-popper-price{font-size:var(--ci360-popper-price-font-size);font-weight:var(--ci360-popper-price-font-weight);color:var(--ci360-popper-price-color)}.ci360-popper-price-row .ci360-popper-price{margin-bottom:0}.ci360-popper-original-price{font-size:calc(var(--ci360-popper-price-font-size) - 2px);font-weight:500;color:var(--ci360-popper-original-price-color);text-decoration:line-through}.ci360-popper-description{margin:0 0 12px;color:var(--ci360-popper-description-color)}.ci360-popper-cta{display:inline-block;padding:var(--ci360-popper-cta-padding);background:var(--ci360-popper-cta-bg);color:var(--ci360-popper-cta-color);border-radius:var(--ci360-popper-cta-border-radius);text-decoration:none;font-weight:600;font-size:14px;transition:opacity .2s ease}.ci360-popper-cta:hover{opacity:.9}
2
- /*$vite$:1*/`,document.head.appendChild(Q);var z=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ue="Expected a function",me=NaN,li="[object Symbol]",ci=/^\s+|\s+$/g,hi=/^[-+]0x[0-9a-f]+$/i,di=/^0b[01]+$/i,pi=/^0o[0-7]+$/i,ui=parseInt,mi=typeof z=="object"&&z&&z.Object===Object&&z,fi=typeof self=="object"&&self&&self.Object===Object&&self,gi=mi||fi||Function("return this")(),vi=Object.prototype,bi=vi.toString,yi=Math.max,wi=Math.min,_t=function(){return gi.Date.now()};function xi(e,t,i){var o,s,n,a,r,l,c=0,h=!1,p=!1,f=!0;if(typeof e!="function")throw new TypeError(ue);t=fe(t)||0,Rt(i)&&(h=!!i.leading,p="maxWait"in i,n=p?yi(fe(i.maxWait)||0,t):n,f="trailing"in i?!!i.trailing:f);function u(m){var v=o,I=s;return o=s=void 0,c=m,a=e.apply(I,v),a}function x(m){return c=m,r=setTimeout(O,t),h?u(m):a}function y(m){var v=m-l,I=m-c,E=t-v;return p?wi(E,n-I):E}function g(m){var v=m-l,I=m-c;return l===void 0||v>=t||v<0||p&&I>=n}function O(){var m=_t();if(g(m))return k(m);r=setTimeout(O,y(m))}function k(m){return r=void 0,f&&o?u(m):(o=s=void 0,a)}function w(){r!==void 0&&clearTimeout(r),c=0,o=l=s=r=void 0}function b(){return r===void 0?a:k(_t())}function C(){var m=_t(),v=g(m);if(o=arguments,s=this,l=m,v){if(r===void 0)return x(l);if(p)return r=setTimeout(O,t),u(l)}return r===void 0&&(r=setTimeout(O,t)),a}return C.cancel=w,C.flush=b,C}function Ii(e,t,i){var o=!0,s=!0;if(typeof e!="function")throw new TypeError(ue);return Rt(i)&&(o="leading"in i?!!i.leading:o,s="trailing"in i?!!i.trailing:s),xi(e,t,{leading:o,maxWait:t,trailing:s})}function Rt(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Ci(e){return!!e&&typeof e=="object"}function Oi(e){return typeof e=="symbol"||Ci(e)&&bi.call(e)==li}function fe(e){if(typeof e=="number")return e;if(Oi(e))return me;if(Rt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Rt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(ci,"");var i=di.test(e);return i||pi.test(e)?ui(e.slice(2),i?2:8):hi.test(e)?me:+e}var ki=Ii;const ge=rt(ki),R={SPIN_X:"spin-x",SPIN_Y:"spin-y",SPIN_XY:"spin-xy",SPIN_YX:"spin-yx"},Ei=[!1,0,null,void 0,"false","0","null","undefined"],M={X:"x-axis",Y:"y-axis"},Ai=[37,39],Si=[38,40],ve=typeof navigator<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?32:10,Ti=150,Xt=800,Li=150,Mi=200,be=50,Pi=50,Yi=5,ye=5,d={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:R.SPIN_X,playOnce:!1,autoplayReverse:!1,pointerZoom:0,pointerZoomTrigger:"dblclick",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,hotspotTrigger:"hover",hide360Logo:!1,logoSrc:null,inertia:!1,pinchZoom:!0,hints:!0,theme:null,hotspotTimelineOnClick:!0,aspectRatio:null,onReady:null,onLoad:null,onSpin:null,onAutoplayStart:null,onAutoplayStop:null,onFullscreenOpen:null,onFullscreenClose:null,onZoomIn:null,onZoomOut:null,onDragStart:null,onDragEnd:null},Ri=e=>({folder:S(e,"folder",d.folder),apiVersion:S(e,"api-version",d.apiVersion),filenameX:S(e,"filename")||S(e,"filename-x")||d.filenameX,filenameY:S(e,"filename-y",d.filenameY),imageListX:S(e,"image-list-x",d.imageListX),imageListY:S(e,"image-list-y",d.imageListY),indexZeroBase:parseInt(S(e,"index-zero-base",d.indexZeroBase),10),amountX:parseInt(S(e,"amount-x",d.amountX),10),amountY:parseInt(S(e,"amount-y",d.amountY),10),speed:parseInt(S(e,"speed",d.speed),10),dragSpeed:parseInt(S(e,"drag-speed",d.dragSpeed),10),draggable:P(e,"draggable",d.draggable),swipeable:P(e,"swipeable",d.swipeable),keys:P(e,"keys",d.keys),keysReverse:P(e,"keys-reverse",d.keysReverse),autoplay:P(e,"autoplay",d.autoplay),autoplayBehavior:S(e,"autoplay-behavior",d.autoplayBehavior),playOnce:P(e,"play-once",d.playOnce),autoplayReverse:P(e,"autoplay-reverse",d.autoplayReverse),pointerZoom:parseFloat(S(e,"pointer-zoom",d.pointerZoom)),pointerZoomTrigger:S(e,"pointer-zoom-trigger",d.pointerZoomTrigger),fullscreen:P(e,"fullscreen")||P(e,"full-screen",d.fullscreen),magnifier:parseFloat(S(e,"magnifier",d.magnifier)),bottomCircleOffset:parseInt(S(e,"bottom-circle-offset",d.bottomCircleOffset),10),ciToken:S(e,"responsive",d.ciToken),ciFilters:S(e,"filters",d.ciFilters),ciTransformation:S(e,"transformation",d.ciTransformation),lazyload:P(e,"lazyload",d.lazyload),dragReverse:P(e,"drag-reverse",d.dragReverse),stopAtEdges:P(e,"stop-at-edges",d.stopAtEdges),imageInfo:P(e,"info",d.imageInfo),initialIconShown:!Ht(e,"initial-icon"),bottomCircle:!Ht(e,"bottom-circle"),hide360Logo:P(e,"hide-360-logo",d.hide360Logo),logoSrc:S(e,"logo-src",d.logoSrc),inertia:P(e,"inertia",d.inertia),pinchZoom:P(e,"pinch-zoom",d.pinchZoom),hints:!Ht(e,"hints"),theme:S(e,"theme",d.theme),hotspotTrigger:S(e,"hotspot-trigger",d.hotspotTrigger),hotspotTimelineOnClick:!Ht(e,"hotspot-timeline-on-click"),aspectRatio:S(e,"aspect-ratio",d.aspectRatio)}),Xi=e=>{const t=[];e.amountX!==void 0&&e.amountX<0&&t.push("amountX should be a positive number"),e.amountY!==void 0&&e.amountY<0&&t.push("amountY should be a positive number"),e.speed!==void 0&&e.speed<=0&&t.push("speed should be a positive number"),e.dragSpeed!==void 0&&e.dragSpeed<=0&&t.push("dragSpeed should be a positive number"),e.pointerZoom!==void 0&&e.pointerZoom!==0&&(e.pointerZoom<1||e.pointerZoom>5)&&t.push("pointerZoom should be between 1 and 5 (or 0 to disable)"),e.magnifier!==void 0&&e.magnifier!==null&&e.magnifier!==0&&(e.magnifier<1||e.magnifier>5)&&t.push("magnifier should be between 1 and 5 (or 0/null to disable)"),!e.folder&&!e.imageListX&&!e.imageListY&&t.push("Either folder or imageListX/imageListY is required"),e.folder&&!e.amountX&&!e.imageListX&&t.push("amountX is required when using folder (unless imageListX is provided)");const i=["spin-x","spin-y","spin-xy","spin-yx"];return e.autoplayBehavior&&!i.includes(e.autoplayBehavior)&&t.push(`autoplayBehavior should be one of: ${i.join(", ")}`),t.forEach(o=>{console.warn(`CloudImage 360: ${o}`)}),t.length===0},Hi=e=>(Xi(e),{folder:e.folder||d.folder,apiVersion:e.apiVersion||d.apiVersion,filenameX:e.filenameX||e.filename||d.filenameX,filenameY:e.filenameY||d.filenameY,imageListX:e.imageListX||d.imageListX,imageListY:e.imageListY||d.imageListY,indexZeroBase:parseInt(e.indexZeroBase??d.indexZeroBase,10),amountX:parseInt(e.amountX??d.amountX,10),amountY:parseInt(e.amountY??d.amountY,10),speed:parseInt(e.speed??d.speed,10),draggable:e.draggable??d.draggable,swipeable:e.swipeable??d.swipeable,dragSpeed:parseInt(e.dragSpeed??d.dragSpeed,10),keys:e.keys??d.keys,keysReverse:e.keysReverse??d.keysReverse,autoplay:e.autoplay??d.autoplay,autoplayBehavior:e.autoplayBehavior||d.autoplayBehavior,playOnce:e.playOnce??d.playOnce,autoplayReverse:e.autoplayReverse??d.autoplayReverse,pointerZoom:parseFloat(e.pointerZoom??d.pointerZoom),pointerZoomTrigger:e.pointerZoomTrigger||d.pointerZoomTrigger,fullscreen:e.fullscreen??d.fullscreen,magnifier:parseFloat(e.magnifier??d.magnifier),bottomCircleOffset:parseInt(e.bottomCircleOffset??d.bottomCircleOffset,10),ciToken:e.ciToken||d.ciToken,ciFilters:e.ciFilters||d.ciFilters,ciTransformation:e.ciTransformation||d.ciTransformation,lazyload:e.lazyload??d.lazyload,dragReverse:e.dragReverse??d.dragReverse,stopAtEdges:e.stopAtEdges??d.stopAtEdges,imageInfo:e.imageInfo??d.imageInfo,initialIconShown:e.initialIconShown??d.initialIconShown,bottomCircle:e.bottomCircle??d.bottomCircle,hotspots:e.hotspots??d.hotspots,hotspotTrigger:e.hotspotTrigger||d.hotspotTrigger,hide360Logo:e.hide360Logo??d.hide360Logo,logoSrc:e.logoSrc||d.logoSrc,inertia:e.inertia??d.inertia,pinchZoom:e.pinchZoom??d.pinchZoom,hints:e.hints??d.hints,theme:e.theme||d.theme,hotspotTimelineOnClick:e.hotspotTimelineOnClick??d.hotspotTimelineOnClick,aspectRatio:e.aspectRatio||d.aspectRatio,onReady:e.onReady??d.onReady,onLoad:e.onLoad??d.onLoad,onSpin:e.onSpin??d.onSpin,onAutoplayStart:e.onAutoplayStart??d.onAutoplayStart,onAutoplayStop:e.onAutoplayStop??d.onAutoplayStop,onFullscreenOpen:e.onFullscreenOpen??d.onFullscreenOpen,onFullscreenClose:e.onFullscreenClose??d.onFullscreenClose,onZoomIn:e.onZoomIn??d.onZoomIn,onZoomOut:e.onZoomOut??d.onZoomOut,onDragStart:e.onDragStart??d.onDragStart,onDragEnd:e.onDragEnd??d.onDragEnd}),S=(e,t,i)=>e.getAttribute(t)||e.getAttribute(`data-${t}`)||i,P=(e,t,i)=>{if(!(e.hasAttribute(t)||e.hasAttribute(`data-${t}`)))return i;const s=S(e,t,null);return s!=="false"&&s!=="0"},Ht=(e,t)=>S(e,t,null)==="false",Zi=(e=1)=>{const t=Math.round(window.devicePixelRatio||1);return parseInt(e)*t},Di=(e,t,i)=>new URL(e).origin.includes("cloudimg")?e:`https://${t}.cloudimg.io/${i}${e}`,Bi=({ciTransformation:e,responsiveWidth:t,ciFilters:i})=>{const o=`width=${t}`,s=e||o,n=i?`&f=${i}`:"";return`${s}${n}`},xt=(e,t)=>{const{folder:i,apiVersion:o,filename:s="",ciParams:n}=e,{ciToken:a,ciFilters:r,ciTransformation:l}=n||{},c=`${i}${s}`;if(!a||!t)return c;const h=Ei.includes(o)?null:o,p=h?`${h}/`:"",f=Zi(t),u=Di(c,a,p),x=Bi({ciTransformation:l,responsiveWidth:f,ciFilters:r});return`${u}${x?"?":""}${x}`},zi=(e,t,i)=>{const[o,s]=e.split("?"),n=`${t}=${encodeURIComponent(i)}`;if(!s)return`${o}?${n}`;const a=new URLSearchParams(s);return a.set(t,i),`${o}?${a.toString()}`},Wi=(e,t)=>zi(e,"width",t),we=(e,t=0)=>(e+="",e.length>=t?e:new Array(t-e.length+1).join("0")+e),Fi=(e,{amount:t=0,indexZeroBase:i=0}={})=>Array.from({length:t},(o,s)=>e.replace("{index}",we(s+1,i))),Vi=typeof navigator<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?3:6,Ni=({imagesUrls:e,onFirstImageLoad:t,onImageLoad:i,onAllImagesLoad:o,onError:s,autoplayReverse:n})=>{let a=0,r=0;const l=e.length,c=[],h=[];let p=0,f=0;const u=[],x=(m,v,I=!1)=>{const E={message:`Failed to load image: ${m}`,url:m,index:v,isFirstImage:I};h.push(E),r++,s==null||s({error:E,errorCount:r,totalImages:l,errors:h})},y=()=>{a===l&&(o==null||o(c,{errorCount:r,errors:h}))},g=()=>{for(;p<Vi&&f<u.length;){const m=u[f];f++,O(e[m],m)}},O=(m,v)=>{p++;const I=new Image;I.crossOrigin="anonymous",I.src=m,I.onload=async()=>{try{const E=await createImageBitmap(I),A={src:m,bitmapImage:E,naturalWidth:I.naturalWidth,naturalHeight:I.naturalHeight};I.onload=null,I.onerror=null,I.src="",a++,p--,c[v]=A,i==null||i(A,v),y(),g()}catch{I.onload=null,I.onerror=null,I.src="",a++,p--,x(m,v),y(),g()}},I.onerror=()=>{I.onload=null,I.onerror=null,I.src="",a++,p--,x(m,v),y(),g()}},k=m=>{for(let v=0;v<e.length;v++)v!==m&&u.push(v);f=0,g()},w=new Image,b=n?e.length-1:0,C=e[b];w.crossOrigin="anonymous",w.src=C,w.onload=async()=>{try{const m=await createImageBitmap(w),v={src:C,bitmapImage:m,naturalWidth:w.naturalWidth,naturalHeight:w.naturalHeight};w.onload=null,w.onerror=null,w.src="",c[b]=v,a++,t==null||t(v),i==null||i(v,b),l===1?y():k(b)}catch{w.onload=null,w.onerror=null,w.src="",a++,x(C,b,!0),l===1?y():k(b)}},w.onerror=()=>{w.onload=null,w.onerror=null,w.src="",a++,x(C,b,!0),l===1?y():k(b)}},xe=({cdnPathX:e,cdnPathY:t,configX:i,configY:o,onFirstImageLoad:s,onImageLoad:n,onAllImagesLoad:a,onError:r})=>{let l={x:!1,y:!1},c=[],h=[],p={errorCount:0,errors:[]},f={errorCount:0,errors:[]};const u=e||i.imageList.length,x=t||o.imageList.length,y=()=>{if(l.x&&l.y){const O={errorCount:p.errorCount+f.errorCount,errors:[...p.errors,...f.errors]};a==null||a(c,h,O)}},g=({cdnPath:O,config:k,orientation:w,loadedImages:b,loadStats:C,onFirstImageLoad:m})=>{const v=w===M.X,I=k.imageList.length?k.imageList:Fi(O,k);Ni({imagesUrls:I,onFirstImageLoad:m,onImageLoad:(E,A)=>{n==null||n(E,A,w),b[A]=E},onError:E=>{r==null||r({...E,orientation:w})},onAllImagesLoad:(E,A)=>{b.length=0,E.forEach((T,X)=>{T&&(b[X]=T)}),C.errorCount=A.errorCount,C.errors=A.errors.map(T=>({...T,orientation:w})),l[v?"x":"y"]=!0,y()},autoplayReverse:k.autoplayReverse})};u?g({cdnPath:e,config:i,orientation:M.X,loadedImages:c,loadStats:p,onFirstImageLoad:s}):l.x=!0,x?g({cdnPath:t,config:o,orientation:M.Y,loadedImages:h,loadStats:f,onFirstImageLoad:u?void 0:s}):l.y=!0,!u&&!x&&y()},$i=`
1
+ var CI360=function(){"use strict";var un=Object.defineProperty;var mn=(Q,B,rt)=>B in Q?un(Q,B,{enumerable:!0,configurable:!0,writable:!0,value:rt}):Q[B]=rt;var ci=(Q,B,rt)=>mn(Q,typeof B!="symbol"?B+"":B,rt);var Q=document.createElement("style");Q.textContent=`:root{--ci360-button-bg: rgba(255, 255, 255, .9);--ci360-button-bg-hover: rgba(255, 255, 255, 1);--ci360-button-size: 40px;--ci360-button-border-radius: 6px;--ci360-button-shadow: 0 2px 8px rgba(0, 0, 0, .15);--ci360-icon-color: #505050;--ci360-icon-color-hover: #333333;--ci360-icon-size: 20px;--ci360-initial-icon-bg: transparent;--ci360-initial-icon-color: #ffffff;--ci360-initial-icon-size: 100px;--ci360-initial-icon-shadow: none;--ci360-spinner-color: rgba(0, 0, 0, .2);--ci360-spinner-accent: #505050;--ci360-spinner-size: 30px;--ci360-fullscreen-bg: #ffffff;--ci360-magnifier-size: 250px;--ci360-magnifier-border: 2px solid rgba(0, 0, 0, .2);--ci360-magnifier-shadow: 0 8px 16px rgba(0, 0, 0, .3);--ci360-focus-color: #0066cc;--ci360-overlay-bg: rgba(255, 255, 255, 1);--ci360-hotspot-marker-size: 24px;--ci360-hotspot-marker-bg: rgba(255, 255, 255, .8);--ci360-hotspot-marker-color: #1a1a1a;--ci360-hotspot-marker-border-width: 2px;--ci360-hotspot-marker-border-color: rgba(255, 255, 255, .4);--ci360-hotspot-marker-border: var(--ci360-hotspot-marker-border-width) solid var(--ci360-hotspot-marker-border-color);--ci360-hotspot-marker-shadow: 0 2px 8px rgba(0, 0, 0, .15);--ci360-hotspot-pulse-color: rgba(0, 0, 0, .15);--ci360-hotspot-pulse-size: 40px;--ci360-hotspot-pulse-duration: 1.8s;--ci360-hotspot-brand-color: #00aaff;--ci360-popper-bg: #ffffff;--ci360-popper-color: #1a1a1a;--ci360-popper-border: 1px solid rgba(0, 0, 0, .1);--ci360-popper-border-radius: 12px;--ci360-popper-shadow: 0 8px 32px rgba(0, 0, 0, .12);--ci360-popper-padding: 16px;--ci360-popper-max-width: 320px;--ci360-popper-font-size: 14px;--ci360-popper-line-height: 1.5;--ci360-popper-title-font-size: 16px;--ci360-popper-title-font-weight: 600;--ci360-popper-title-color: #1a1a1a;--ci360-popper-price-color: #2d8c3c;--ci360-popper-price-font-size: 18px;--ci360-popper-price-font-weight: 700;--ci360-popper-original-price-color: #999999;--ci360-popper-description-color: #666666;--ci360-popper-cta-bg: #0058a3;--ci360-popper-cta-color: #fff;--ci360-popper-cta-border-radius: 8px;--ci360-popper-cta-padding: 8px 16px;--ci360-hints-bg: rgba(255, 255, 255, .9);--ci360-hints-color: #333333;--ci360-hints-font-size: 13px;--ci360-hints-border-radius: 20px;--ci360-hints-shadow: 0 2px 12px rgba(0, 0, 0, .1);--ci360-circle-color: #888888;--ci360-timeline-height: 6px;--ci360-timeline-track-bg: rgba(255, 255, 255, .4);--ci360-timeline-dot-size: 18px;--ci360-timeline-dot-color: var(--ci360-hotspot-marker-bg);--ci360-timeline-dot-active-color: var(--ci360-hotspot-brand-color);--ci360-timeline-dot-border: 2px solid #fff;--ci360-timeline-indicator-size: 12px;--ci360-timeline-indicator-color: var(--ci360-hotspot-brand-color);--ci360-timeline-tooltip-bg: rgba(255, 255, 255, .95);--ci360-timeline-tooltip-color: #333333}.ci360-theme-dark{--ci360-button-bg: rgba(40, 40, 45, .9);--ci360-button-bg-hover: rgba(55, 55, 60, .95);--ci360-button-shadow: 0 2px 8px rgba(0, 0, 0, .4);--ci360-icon-color: #e0e0e0;--ci360-icon-color-hover: #ffffff;--ci360-initial-icon-bg: transparent;--ci360-initial-icon-color: #ffffff;--ci360-initial-icon-shadow: none;--ci360-spinner-color: rgba(255, 255, 255, .2);--ci360-spinner-accent: #e0e0e0;--ci360-fullscreen-bg: #1a1a1f;--ci360-overlay-bg: rgba(26, 26, 31, 1);--ci360-magnifier-border: 2px solid rgba(255, 255, 255, .2);--ci360-magnifier-shadow: 0 8px 16px rgba(0, 0, 0, .5);--ci360-popper-bg: #1a1a1a;--ci360-popper-color: #f0f0f0;--ci360-popper-border: 1px solid rgba(255, 255, 255, .1);--ci360-popper-shadow: 0 8px 32px rgba(0, 0, 0, .4);--ci360-popper-title-color: #f0f0f0;--ci360-popper-description-color: #aaaaaa;--ci360-popper-original-price-color: #777777;--ci360-hints-bg: rgba(40, 40, 45, .9);--ci360-hints-color: #e0e0e0;--ci360-hints-shadow: 0 2px 12px rgba(0, 0, 0, .3);--ci360-circle-color: #b0b0b0;--ci360-timeline-track-bg: rgba(255, 255, 255, .4);--ci360-timeline-dot-border: 2px solid rgba(255, 255, 255, .9);--ci360-timeline-indicator-color: var(--ci360-hotspot-brand-color);--ci360-timeline-tooltip-bg: rgba(40, 40, 45, .95);--ci360-timeline-tooltip-color: #e0e0e0;--ci360-loader-bg: rgba(40, 40, 45, .9);--ci360-loader-color: #e0e0e0;--ci360-loader-shadow: 0 4px 20px rgba(0, 0, 0, .4);--ci360-hotspot-marker-bg: rgba(0, 0, 0, .6);--ci360-hotspot-marker-color: #ffffff;--ci360-hotspot-marker-border-color: rgba(255, 255, 255, .6);--ci360-hotspot-pulse-color: rgba(255, 255, 255, .15);--ci360-timeline-dot-color: var(--ci360-hotspot-marker-bg)}.ci360-hotspot-marker-inverted{--ci360-hotspot-marker-bg: rgba(0, 0, 0, .6);--ci360-hotspot-marker-color: #ffffff;--ci360-hotspot-marker-border-color: rgba(255, 255, 255, .8);--ci360-hotspot-marker-shadow: 0 2px 8px rgba(0, 0, 0, .3);--ci360-hotspot-pulse-color: rgba(0, 0, 0, .2)}.ci360-theme-dark.ci360-hotspot-marker-inverted{--ci360-hotspot-marker-bg: rgba(255, 255, 255, .8);--ci360-hotspot-marker-color: #1a1a1a;--ci360-hotspot-marker-border-color: rgba(255, 255, 255, .4);--ci360-hotspot-pulse-color: rgba(255, 255, 255, .2)}.ci360-hotspot-marker-brand{--ci360-hotspot-marker-bg: var(--ci360-hotspot-brand-color);--ci360-hotspot-marker-color: #ffffff;--ci360-hotspot-marker-border-color: rgba(255, 255, 255, .9);--ci360-hotspot-marker-shadow: 0 2px 8px rgba(0, 0, 0, .25);--ci360-hotspot-pulse-color: var(--ci360-hotspot-brand-color)}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.cloudimage-360{width:100%;position:relative}.cloudimage-360-inner-box{width:100%;position:relative;overflow:hidden}.cloudimage-360-icons-container{position:absolute;display:flex;top:15px;right:10px;height:100%;flex-direction:column;align-items:center;z-index:100;gap:8px}.cloudimage-360-transition-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--ci360-overlay-bg);opacity:0;transition:all 1s ease-out;z-index:10}.cloudimage-360-button{width:var(--ci360-button-size);height:var(--ci360-button-size);cursor:pointer;transition:transform .15s ease-out,background-color .15s ease-out,box-shadow .15s ease-out;display:flex;align-items:center;justify-content:center;border-radius:var(--ci360-button-border-radius);border:none;background-color:var(--ci360-button-bg);box-shadow:var(--ci360-button-shadow);padding:6px;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}.cloudimage-360-button:hover{transform:scale(1.05);background-color:var(--ci360-button-bg-hover)}.cloudimage-360-button:focus{outline:none}.cloudimage-360-button:focus-visible{outline:2px solid var(--ci360-focus-color);outline-offset:2px}.cloudimage-360-button svg{width:var(--ci360-icon-size);height:var(--ci360-icon-size);stroke:var(--ci360-icon-color);transition:stroke .15s ease-out}.cloudimage-360-button:hover svg{stroke:var(--ci360-icon-color-hover)}.cloudimage-initial-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--ci360-initial-icon-size);aspect-ratio:150 / 87;border-radius:var(--ci360-initial-icon-border-radius, 0);background-color:var(--ci360-initial-icon-bg);box-shadow:var(--ci360-initial-icon-shadow);transition:all .3s ease;color:var(--ci360-initial-icon-color);display:flex;align-items:center;justify-content:center;z-index:2;-webkit-user-select:none;-moz-user-select:none;user-select:none}.cloudimage-initial-icon svg{width:100%;height:auto;color:var(--ci360-initial-icon-color);fill:var(--ci360-initial-icon-color);filter:drop-shadow(0 2px 4px rgba(0,0,0,.4))}.cloudimage-initial-icon:hover{transform:translate(-50%,-50%) scale(1.08)}.cloudimage-360-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--ci360-loader-size, 70px);height:var(--ci360-loader-size, 70px);border-radius:50%;background-color:var(--ci360-loader-bg, rgba(255, 255, 255, .9));box-shadow:var(--ci360-loader-shadow, 0 4px 20px rgba(0, 0, 0, .15));transition:all .3s ease;color:var(--ci360-loader-color, #505050);display:flex;align-items:center;justify-content:center;z-index:2;-webkit-user-select:none;-moz-user-select:none;user-select:none;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);font-family:system-ui,-apple-system,sans-serif;font-size:14px;font-weight:600}.cloudimage-loading-spinner{width:var(--ci360-spinner-size);height:var(--ci360-spinner-size);transform:translate(-50%,-50%);border:3px solid var(--ci360-spinner-color);position:absolute;top:15px;left:15px;border-bottom-color:var(--ci360-spinner-accent);border-radius:50%;display:inline-block;box-sizing:border-box;opacity:0;animation:rotation .7s linear infinite}.cloudimage-360-view-360-circle{position:absolute;left:0;bottom:0;width:100%;height:auto;margin:auto;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:.2s all;z-index:2;color:var(--ci360-circle-color)}.cloudimage-360-view-360-circle svg{display:block;width:100%;height:auto}.cloudimage-360-fullscreen-modal{position:fixed;top:0;bottom:0;left:0;right:0;width:100%;height:100%;z-index:999;background-color:var(--ci360-fullscreen-bg)}.cloudimage-360-fullscreen-modal .cloudimage-360-inner-box{height:100%}.cloudimage-360-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.cloudimage-360-hints-overlay{position:absolute;bottom:0;left:0;width:100%;display:flex;align-items:flex-end;justify-content:center;padding-bottom:16px;z-index:50;pointer-events:none;opacity:0;transition:opacity .3s ease}.cloudimage-360-hints-overlay.visible{opacity:1}.cloudimage-360-hints-overlay.hiding{opacity:0}.cloudimage-360-hints-container{display:flex;flex-direction:row;gap:20px;padding:10px 20px;background:var(--ci360-hints-bg);border-radius:var(--ci360-hints-border-radius);box-shadow:var(--ci360-hints-shadow);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}.cloudimage-360-hint-item{display:flex;align-items:center;gap:8px;color:var(--ci360-hints-color);font-size:var(--ci360-hints-font-size);font-family:system-ui,-apple-system,sans-serif;white-space:nowrap}.cloudimage-360-hint-item svg{width:16px;height:16px;flex-shrink:0;stroke:var(--ci360-hints-color)}.cloudimage-360-hint-item span{opacity:.9}@media (max-width: 480px){.cloudimage-360-hints-container{flex-direction:column;gap:8px;padding:12px 16px;border-radius:12px}.cloudimage-360-hint-item{font-size:12px}.cloudimage-360-hint-item svg{width:14px;height:14px}.cloudimage-360-initial-icon{width:calc(var(--ci360-initial-icon-size) * .8);height:calc(var(--ci360-initial-icon-size) * .8)}}.cloudimage-360-inner-box.has-hotspot-timeline .cloudimage-360-hints-overlay{padding-bottom:56px}.cloudimage-360-img-magnifier-glass{background-color:#fff;background-image:radial-gradient(circle at center,#fffc,#f0f0f0e6);background-repeat:no-repeat;position:absolute;border:var(--ci360-magnifier-border);border-radius:50%;line-height:200px;text-align:center;z-index:1000;width:var(--ci360-magnifier-size);height:var(--ci360-magnifier-size);top:-75px;right:-85px;box-shadow:var(--ci360-magnifier-shadow);transition:box-shadow .2s ease;overflow:hidden;pointer-events:none}.cloudimage-360-hotspot-timeline{position:absolute;bottom:0;left:0;right:0;width:100%;padding:20px;opacity:0;transition:opacity .3s ease;pointer-events:none;z-index:30;background:linear-gradient(to top,rgba(0,0,0,.45) 0%,rgba(0,0,0,.2) 60%,transparent 100%)}.cloudimage-360-hotspot-timeline.visible{opacity:1;pointer-events:auto}.cloudimage-360-hotspot-timeline-track{position:relative;width:100%;max-width:500px;margin:0 auto;height:var(--ci360-timeline-height);background:var(--ci360-timeline-track-bg);border-radius:calc(var(--ci360-timeline-height) / 2)}.cloudimage-360-hotspot-timeline-indicator{position:absolute;top:50%;left:0;width:var(--ci360-timeline-indicator-size);height:var(--ci360-timeline-indicator-size);background:var(--ci360-timeline-indicator-color);border-radius:50%;transform:translate(-50%,-50%);transition:left .1s ease-out;pointer-events:none;box-shadow:0 2px 4px #0003}.cloudimage-360-hotspot-timeline-dot{position:absolute;top:50%;width:var(--ci360-timeline-dot-size);height:var(--ci360-timeline-dot-size);background:var(--ci360-timeline-dot-color);border:var(--ci360-timeline-dot-border);border-radius:50%;transform:translate(-50%,-50%);cursor:pointer;transition:transform .15s ease,background .2s ease,box-shadow .2s ease;box-shadow:0 1px 4px #00000026;padding:0;font:inherit;outline:none}.cloudimage-360-hotspot-timeline-dot:hover{transform:translate(-50%,-50%) scale(1.15);box-shadow:0 2px 8px #0003}.cloudimage-360-hotspot-timeline-dot.active{background:var(--ci360-timeline-dot-color);box-shadow:0 1px 4px #00000026}.cloudimage-360-hotspot-timeline-dot:focus-visible{outline:2px solid var(--ci360-focus-color);outline-offset:2px}.cloudimage-360-hotspot-timeline-tooltip{position:absolute;bottom:calc(100% + 10px);left:50%;transform:translate(-50%);background:var(--ci360-timeline-tooltip-bg);color:var(--ci360-timeline-tooltip-color);padding:6px 12px;border-radius:6px;font-size:13px;font-weight:500;white-space:nowrap;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease;pointer-events:none;box-shadow:0 2px 8px #00000026;z-index:10}.cloudimage-360-hotspot-timeline-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:6px solid transparent;border-top-color:var(--ci360-timeline-tooltip-bg)}.cloudimage-360-hotspot-timeline-tooltip.visible{opacity:1;visibility:visible}@media (max-width: 480px){.cloudimage-360-hotspot-timeline{padding:14px 16px}}.cloudimage-360-fullscreen-modal .cloudimage-360-hotspot-timeline{padding:24px 40px 20px;background:linear-gradient(to top,rgba(0,0,0,.6) 0%,rgba(0,0,0,.3) 60%,transparent 100%)}.cloudimage-360-fullscreen-modal .cloudimage-360-hotspot-timeline-track{max-width:600px;background:#ffffff4d}.cloudimage-360-fullscreen-modal .cloudimage-360-hotspot-timeline-indicator{background:var(--ci360-hotspot-brand-color);box-shadow:0 2px 6px #0006}.cloudimage-360-fullscreen-modal .cloudimage-360-hotspot-timeline-dot{background:var(--ci360-timeline-dot-color);border-color:#fff;box-shadow:0 1px 6px #0000004d}.cloudimage-360-fullscreen-modal .cloudimage-360-hotspot-timeline-tooltip{bottom:calc(100% + 20px)}.cloudimage-360-fullscreen-modal .cloudimage-360-inner-box.has-hotspot-timeline .cloudimage-360-hints-overlay{padding-bottom:64px}.cloudimage-360-hotspot-container{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:20}.cloudimage-360-popper{opacity:1;transition:opacity .2s ease-in-out}.cloudimage-360-hotspot{display:inline-block;position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-50%,-50%);background:var(--ci360-hotspot-marker-bg);border:var(--ci360-hotspot-marker-border);border-radius:50%;height:var(--ci360-hotspot-marker-size);width:var(--ci360-hotspot-marker-size);box-shadow:var(--ci360-hotspot-marker-shadow);opacity:0;transition:transform .2s ease,box-shadow .2s ease;padding:0;cursor:pointer;font:inherit;outline:none}.cloudimage-360-hotspot:focus-visible{outline:2px solid var(--ci360-focus-color, #0066cc);outline-offset:2px}.cloudimage-360-hotspot.visible{opacity:1}.cloudimage-360-hotspot--pulse{overflow:visible}.cloudimage-360-hotspot--pulse:before{content:"";position:absolute;top:50%;left:50%;width:var(--ci360-hotspot-pulse-size);height:var(--ci360-hotspot-pulse-size);border-radius:50%;background:var(--ci360-hotspot-pulse-color);transform:translate(-50%,-50%) scale(1);animation:ci360-pulse-ring var(--ci360-hotspot-pulse-duration) ease-out infinite;pointer-events:none}@keyframes ci360-pulse-ring{0%{transform:translate(-50%,-50%) scale(1);opacity:1}to{transform:translate(-50%,-50%) scale(1.8);opacity:0}}.cloudimage-360-hotspot--pulse{animation:ci360-breathe 2.4s ease-in-out infinite}@keyframes ci360-breathe{0%,to{transform:translate(-50%,-50%) scale(1)}50%{transform:translate(-50%,-50%) scale(1.15)}}.cloudimage-360-hotspot--pulse:hover,.cloudimage-360-hotspot--pulse:focus-visible{animation:none}.cloudimage-360-hotspot--dot-label{animation:none}.cloudimage-360-hotspot-label{position:absolute;left:calc(50% + var(--ci360-hotspot-marker-size) / 2 + 4px);top:50%;transform:translateY(-50%);padding:3px 10px;font-size:11px;font-weight:600;white-space:nowrap;color:var(--ci360-hotspot-marker-color);background:var(--ci360-hotspot-marker-bg);border:var(--ci360-hotspot-marker-border);border-radius:100px;box-shadow:var(--ci360-hotspot-marker-shadow);pointer-events:none}.cloudimage-360-hotspot--dot-label:hover{transform:translate(-50%,-50%);box-shadow:0 4px 12px #0006}.cloudimage-360-hotspot:hover{transform:translate(-50%,-50%) scale(1.2);box-shadow:0 4px 12px #0006}@media (prefers-reduced-motion: reduce){.cloudimage-360-hotspot--pulse{animation:none}.cloudimage-360-hotspot--pulse:before{animation:none}}.cloudimage-360-popper{background:var(--ci360-popper-bg);color:var(--ci360-popper-color);border:var(--ci360-popper-border);padding:var(--ci360-popper-padding);border-radius:var(--ci360-popper-border-radius);box-shadow:var(--ci360-popper-shadow);font-family:system-ui,-apple-system,sans-serif;font-size:var(--ci360-popper-font-size);line-height:var(--ci360-popper-line-height);max-width:var(--ci360-popper-max-width);z-index:9999;text-align:left;transition:opacity .2s ease;opacity:0}.cloudimage-360-popper[data-show]{opacity:1}.ci360-popper-image-wrapper{aspect-ratio:16 / 9;overflow:hidden;border-radius:calc(var(--ci360-popper-border-radius) - 4px) calc(var(--ci360-popper-border-radius) - 4px) 0 0;margin:calc(var(--ci360-popper-padding) * -1);margin-bottom:12px;width:calc(100% + var(--ci360-popper-padding) * 2)}.ci360-popper-image{display:block;width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.ci360-popper-body{line-height:1.5;text-align:left}.ci360-popper-title{margin:0 0 4px;font-size:var(--ci360-popper-title-font-size);font-weight:var(--ci360-popper-title-font-weight);color:var(--ci360-popper-title-color);line-height:1.3}.ci360-popper-price-row{display:inline-flex;align-items:baseline;gap:6px;margin-bottom:8px;flex-wrap:wrap}.ci360-popper-price{font-size:var(--ci360-popper-price-font-size);font-weight:var(--ci360-popper-price-font-weight);color:var(--ci360-popper-price-color)}.ci360-popper-price-row .ci360-popper-price{margin-bottom:0}.ci360-popper-original-price{font-size:calc(var(--ci360-popper-price-font-size) - 2px);font-weight:500;color:var(--ci360-popper-original-price-color);text-decoration:line-through}.ci360-popper-description{margin:0 0 12px;color:var(--ci360-popper-description-color)}.ci360-popper-cta{display:inline-block;padding:var(--ci360-popper-cta-padding);background:var(--ci360-popper-cta-bg);color:var(--ci360-popper-cta-color);border-radius:var(--ci360-popper-cta-border-radius);text-decoration:none;font-weight:600;font-size:14px;transition:opacity .2s ease}.ci360-popper-cta:hover{opacity:.9}
2
+ /*$vite$:1*/`,document.head.appendChild(Q);var B=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ue="Expected a function",me=NaN,hi="[object Symbol]",di=/^\s+|\s+$/g,pi=/^[-+]0x[0-9a-f]+$/i,ui=/^0b[01]+$/i,mi=/^0o[0-7]+$/i,fi=parseInt,gi=typeof B=="object"&&B&&B.Object===Object&&B,vi=typeof self=="object"&&self&&self.Object===Object&&self,bi=gi||vi||Function("return this")(),yi=Object.prototype,wi=yi.toString,xi=Math.max,Ci=Math.min,Gt=function(){return bi.Date.now()};function Ii(e,t,i){var o,s,n,l,a,r,c=0,h=!1,p=!1,f=!0;if(typeof e!="function")throw new TypeError(ue);t=fe(t)||0,Rt(i)&&(h=!!i.leading,p="maxWait"in i,n=p?xi(fe(i.maxWait)||0,t):n,f="trailing"in i?!!i.trailing:f);function u(m){var v=o,C=s;return o=s=void 0,c=m,l=e.apply(C,v),l}function x(m){return c=m,a=setTimeout(k,t),h?u(m):l}function y(m){var v=m-r,C=m-c,E=t-v;return p?Ci(E,n-C):E}function g(m){var v=m-r,C=m-c;return r===void 0||v>=t||v<0||p&&C>=n}function k(){var m=Gt();if(g(m))return O(m);a=setTimeout(k,y(m))}function O(m){return a=void 0,f&&o?u(m):(o=s=void 0,l)}function w(){a!==void 0&&clearTimeout(a),c=0,o=r=s=a=void 0}function b(){return a===void 0?l:O(Gt())}function I(){var m=Gt(),v=g(m);if(o=arguments,s=this,r=m,v){if(a===void 0)return x(r);if(p)return a=setTimeout(k,t),u(r)}return a===void 0&&(a=setTimeout(k,t)),l}return I.cancel=w,I.flush=b,I}function ki(e,t,i){var o=!0,s=!0;if(typeof e!="function")throw new TypeError(ue);return Rt(i)&&(o="leading"in i?!!i.leading:o,s="trailing"in i?!!i.trailing:s),Ii(e,t,{leading:o,maxWait:t,trailing:s})}function Rt(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Oi(e){return!!e&&typeof e=="object"}function Ei(e){return typeof e=="symbol"||Oi(e)&&wi.call(e)==hi}function fe(e){if(typeof e=="number")return e;if(Ei(e))return me;if(Rt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Rt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(di,"");var i=ui.test(e);return i||mi.test(e)?fi(e.slice(2),i?2:8):pi.test(e)?me:+e}var Ai=ki;const ge=rt(Ai),R={SPIN_X:"spin-x",SPIN_Y:"spin-y",SPIN_XY:"spin-xy",SPIN_YX:"spin-yx"},Si=[!1,0,null,void 0,"false","0","null","undefined"],P={X:"x-axis",Y:"y-axis"},Ti=[37,39],Li=[38,40],ve=typeof navigator<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?32:10,Pi=150,Xt=800,Mi=150,Yi=200,be=50,Ri=50,Xi=5,ye=5,d={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:R.SPIN_X,playOnce:!1,autoplayReverse:!1,pointerZoom:0,pointerZoomTrigger:"dblclick",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,hotspotTrigger:"hover",hide360Logo:!1,logoSrc:null,inertia:!1,pinchZoom:!0,hints:!0,theme:null,markerTheme:null,brandColor:null,hotspotTimelineOnClick:!0,aspectRatio:null,onReady:null,onLoad:null,onSpin:null,onAutoplayStart:null,onAutoplayStop:null,onFullscreenOpen:null,onFullscreenClose:null,onZoomIn:null,onZoomOut:null,onDragStart:null,onDragEnd:null},Hi=e=>({folder:S(e,"folder",d.folder),apiVersion:S(e,"api-version",d.apiVersion),filenameX:S(e,"filename")||S(e,"filename-x")||d.filenameX,filenameY:S(e,"filename-y",d.filenameY),imageListX:S(e,"image-list-x",d.imageListX),imageListY:S(e,"image-list-y",d.imageListY),indexZeroBase:parseInt(S(e,"index-zero-base",d.indexZeroBase),10),amountX:parseInt(S(e,"amount-x",d.amountX),10),amountY:parseInt(S(e,"amount-y",d.amountY),10),speed:parseInt(S(e,"speed",d.speed),10),dragSpeed:parseInt(S(e,"drag-speed",d.dragSpeed),10),draggable:M(e,"draggable",d.draggable),swipeable:M(e,"swipeable",d.swipeable),keys:M(e,"keys",d.keys),keysReverse:M(e,"keys-reverse",d.keysReverse),autoplay:M(e,"autoplay",d.autoplay),autoplayBehavior:S(e,"autoplay-behavior",d.autoplayBehavior),playOnce:M(e,"play-once",d.playOnce),autoplayReverse:M(e,"autoplay-reverse",d.autoplayReverse),pointerZoom:parseFloat(S(e,"pointer-zoom",d.pointerZoom)),pointerZoomTrigger:S(e,"pointer-zoom-trigger",d.pointerZoomTrigger),fullscreen:M(e,"fullscreen")||M(e,"full-screen",d.fullscreen),magnifier:parseFloat(S(e,"magnifier",d.magnifier)),bottomCircleOffset:parseInt(S(e,"bottom-circle-offset",d.bottomCircleOffset),10),ciToken:S(e,"responsive",d.ciToken),ciFilters:S(e,"filters",d.ciFilters),ciTransformation:S(e,"transformation",d.ciTransformation),lazyload:M(e,"lazyload",d.lazyload),dragReverse:M(e,"drag-reverse",d.dragReverse),stopAtEdges:M(e,"stop-at-edges",d.stopAtEdges),imageInfo:M(e,"info",d.imageInfo),initialIconShown:!Ht(e,"initial-icon"),bottomCircle:!Ht(e,"bottom-circle"),hide360Logo:M(e,"hide-360-logo",d.hide360Logo),logoSrc:S(e,"logo-src",d.logoSrc),inertia:M(e,"inertia",d.inertia),pinchZoom:M(e,"pinch-zoom",d.pinchZoom),hints:!Ht(e,"hints"),theme:S(e,"theme",d.theme),markerTheme:S(e,"marker-theme",d.markerTheme),brandColor:S(e,"brand-color",d.brandColor),hotspotTrigger:S(e,"hotspot-trigger",d.hotspotTrigger),hotspotTimelineOnClick:!Ht(e,"hotspot-timeline-on-click"),aspectRatio:S(e,"aspect-ratio",d.aspectRatio)}),Zi=e=>{const t=[];e.amountX!==void 0&&e.amountX<0&&t.push("amountX should be a positive number"),e.amountY!==void 0&&e.amountY<0&&t.push("amountY should be a positive number"),e.speed!==void 0&&e.speed<=0&&t.push("speed should be a positive number"),e.dragSpeed!==void 0&&e.dragSpeed<=0&&t.push("dragSpeed should be a positive number"),e.pointerZoom!==void 0&&e.pointerZoom!==0&&(e.pointerZoom<1||e.pointerZoom>5)&&t.push("pointerZoom should be between 1 and 5 (or 0 to disable)"),e.magnifier!==void 0&&e.magnifier!==null&&e.magnifier!==0&&(e.magnifier<1||e.magnifier>5)&&t.push("magnifier should be between 1 and 5 (or 0/null to disable)"),!e.folder&&!e.imageListX&&!e.imageListY&&t.push("Either folder or imageListX/imageListY is required"),e.folder&&!e.amountX&&!e.imageListX&&t.push("amountX is required when using folder (unless imageListX is provided)");const i=["spin-x","spin-y","spin-xy","spin-yx"];return e.autoplayBehavior&&!i.includes(e.autoplayBehavior)&&t.push(`autoplayBehavior should be one of: ${i.join(", ")}`),t.forEach(o=>{console.warn(`CloudImage 360: ${o}`)}),t.length===0},Di=e=>(Zi(e),{folder:e.folder||d.folder,apiVersion:e.apiVersion||d.apiVersion,filenameX:e.filenameX||e.filename||d.filenameX,filenameY:e.filenameY||d.filenameY,imageListX:e.imageListX||d.imageListX,imageListY:e.imageListY||d.imageListY,indexZeroBase:parseInt(e.indexZeroBase??d.indexZeroBase,10),amountX:parseInt(e.amountX??d.amountX,10),amountY:parseInt(e.amountY??d.amountY,10),speed:parseInt(e.speed??d.speed,10),draggable:e.draggable??d.draggable,swipeable:e.swipeable??d.swipeable,dragSpeed:parseInt(e.dragSpeed??d.dragSpeed,10),keys:e.keys??d.keys,keysReverse:e.keysReverse??d.keysReverse,autoplay:e.autoplay??d.autoplay,autoplayBehavior:e.autoplayBehavior||d.autoplayBehavior,playOnce:e.playOnce??d.playOnce,autoplayReverse:e.autoplayReverse??d.autoplayReverse,pointerZoom:parseFloat(e.pointerZoom??d.pointerZoom),pointerZoomTrigger:e.pointerZoomTrigger||d.pointerZoomTrigger,fullscreen:e.fullscreen??d.fullscreen,magnifier:parseFloat(e.magnifier??d.magnifier),bottomCircleOffset:parseInt(e.bottomCircleOffset??d.bottomCircleOffset,10),ciToken:e.ciToken||d.ciToken,ciFilters:e.ciFilters||d.ciFilters,ciTransformation:e.ciTransformation||d.ciTransformation,lazyload:e.lazyload??d.lazyload,dragReverse:e.dragReverse??d.dragReverse,stopAtEdges:e.stopAtEdges??d.stopAtEdges,imageInfo:e.imageInfo??d.imageInfo,initialIconShown:e.initialIconShown??d.initialIconShown,bottomCircle:e.bottomCircle??d.bottomCircle,hotspots:e.hotspots??d.hotspots,hotspotTrigger:e.hotspotTrigger||d.hotspotTrigger,hide360Logo:e.hide360Logo??d.hide360Logo,logoSrc:e.logoSrc||d.logoSrc,inertia:e.inertia??d.inertia,pinchZoom:e.pinchZoom??d.pinchZoom,hints:e.hints??d.hints,theme:e.theme||d.theme,markerTheme:e.markerTheme||d.markerTheme,brandColor:e.brandColor||d.brandColor,hotspotTimelineOnClick:e.hotspotTimelineOnClick??d.hotspotTimelineOnClick,aspectRatio:e.aspectRatio||d.aspectRatio,onReady:e.onReady??d.onReady,onLoad:e.onLoad??d.onLoad,onSpin:e.onSpin??d.onSpin,onAutoplayStart:e.onAutoplayStart??d.onAutoplayStart,onAutoplayStop:e.onAutoplayStop??d.onAutoplayStop,onFullscreenOpen:e.onFullscreenOpen??d.onFullscreenOpen,onFullscreenClose:e.onFullscreenClose??d.onFullscreenClose,onZoomIn:e.onZoomIn??d.onZoomIn,onZoomOut:e.onZoomOut??d.onZoomOut,onDragStart:e.onDragStart??d.onDragStart,onDragEnd:e.onDragEnd??d.onDragEnd}),S=(e,t,i)=>e.getAttribute(t)||e.getAttribute(`data-${t}`)||i,M=(e,t,i)=>{if(!(e.hasAttribute(t)||e.hasAttribute(`data-${t}`)))return i;const s=S(e,t,null);return s!=="false"&&s!=="0"},Ht=(e,t)=>S(e,t,null)==="false",zi=(e=1)=>{const t=Math.round(window.devicePixelRatio||1);return parseInt(e)*t},Bi=(e,t,i)=>new URL(e).origin.includes("cloudimg")?e:`https://${t}.cloudimg.io/${i}${e}`,Wi=({ciTransformation:e,responsiveWidth:t,ciFilters:i})=>{const o=`width=${t}`,s=e||o,n=i?`&f=${i}`:"";return`${s}${n}`},wt=(e,t)=>{const{folder:i,apiVersion:o,filename:s="",ciParams:n}=e,{ciToken:l,ciFilters:a,ciTransformation:r}=n||{},c=`${i}${s}`;if(!l||!t)return c;const h=Si.includes(o)?null:o,p=h?`${h}/`:"",f=zi(t),u=Bi(c,l,p),x=Wi({ciTransformation:r,responsiveWidth:f,ciFilters:a});return`${u}${x?"?":""}${x}`},Fi=(e,t,i)=>{const[o,s]=e.split("?"),n=`${t}=${encodeURIComponent(i)}`;if(!s)return`${o}?${n}`;const l=new URLSearchParams(s);return l.set(t,i),`${o}?${l.toString()}`},Vi=(e,t)=>Fi(e,"width",t),we=(e,t=0)=>(e+="",e.length>=t?e:new Array(t-e.length+1).join("0")+e),Ni=(e,{amount:t=0,indexZeroBase:i=0}={})=>Array.from({length:t},(o,s)=>e.replace("{index}",we(s+1,i))),$i=typeof navigator<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?3:6,ji=({imagesUrls:e,onFirstImageLoad:t,onImageLoad:i,onAllImagesLoad:o,onError:s,autoplayReverse:n})=>{let l=0,a=0;const r=e.length,c=[],h=[];let p=0,f=0;const u=[],x=(m,v,C=!1)=>{const E={message:`Failed to load image: ${m}`,url:m,index:v,isFirstImage:C};h.push(E),a++,s==null||s({error:E,errorCount:a,totalImages:r,errors:h})},y=()=>{l===r&&(o==null||o(c,{errorCount:a,errors:h}))},g=()=>{for(;p<$i&&f<u.length;){const m=u[f];f++,k(e[m],m)}},k=(m,v)=>{p++;const C=new Image;C.crossOrigin="anonymous",C.src=m,C.onload=async()=>{try{const E=await createImageBitmap(C),A={src:m,bitmapImage:E,naturalWidth:C.naturalWidth,naturalHeight:C.naturalHeight};C.onload=null,C.onerror=null,C.src="",l++,p--,c[v]=A,i==null||i(A,v),y(),g()}catch{C.onload=null,C.onerror=null,C.src="",l++,p--,x(m,v),y(),g()}},C.onerror=()=>{C.onload=null,C.onerror=null,C.src="",l++,p--,x(m,v),y(),g()}},O=m=>{for(let v=0;v<e.length;v++)v!==m&&u.push(v);f=0,g()},w=new Image,b=n?e.length-1:0,I=e[b];w.crossOrigin="anonymous",w.src=I,w.onload=async()=>{try{const m=await createImageBitmap(w),v={src:I,bitmapImage:m,naturalWidth:w.naturalWidth,naturalHeight:w.naturalHeight};w.onload=null,w.onerror=null,w.src="",c[b]=v,l++,t==null||t(v),i==null||i(v,b),r===1?y():O(b)}catch{w.onload=null,w.onerror=null,w.src="",l++,x(I,b,!0),r===1?y():O(b)}},w.onerror=()=>{w.onload=null,w.onerror=null,w.src="",l++,x(I,b,!0),r===1?y():O(b)}},xe=({cdnPathX:e,cdnPathY:t,configX:i,configY:o,onFirstImageLoad:s,onImageLoad:n,onAllImagesLoad:l,onError:a})=>{let r={x:!1,y:!1},c=[],h=[],p={errorCount:0,errors:[]},f={errorCount:0,errors:[]};const u=e||i.imageList.length,x=t||o.imageList.length,y=()=>{if(r.x&&r.y){const k={errorCount:p.errorCount+f.errorCount,errors:[...p.errors,...f.errors]};l==null||l(c,h,k)}},g=({cdnPath:k,config:O,orientation:w,loadedImages:b,loadStats:I,onFirstImageLoad:m})=>{const v=w===P.X,C=O.imageList.length?O.imageList:Ni(k,O);ji({imagesUrls:C,onFirstImageLoad:m,onImageLoad:(E,A)=>{n==null||n(E,A,w),b[A]=E},onError:E=>{a==null||a({...E,orientation:w})},onAllImagesLoad:(E,A)=>{b.length=0,E.forEach((T,X)=>{T&&(b[X]=T)}),I.errorCount=A.errorCount,I.errors=A.errors.map(T=>({...T,orientation:w})),r[v?"x":"y"]=!0,y()},autoplayReverse:O.autoplayReverse})};u?g({cdnPath:e,config:i,orientation:P.X,loadedImages:c,loadStats:p,onFirstImageLoad:s}):r.x=!0,x?g({cdnPath:t,config:o,orientation:P.Y,loadedImages:h,loadStats:f,onFirstImageLoad:u?void 0:s}):r.y=!0,!u&&!x&&y()},_i=`
3
3
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1052 156" aria-hidden="true">
4
4
  <path fill="currentColor" d="M409.9,145.6c-42.7-1.7-85.5-4.4-128.1-8.4c-21.3-2-42.6-4.3-63.8-7.1c-21.2-2.8-42.4-5.9-63.4-9.7c-21.1-3.8-42-8.2-62.7-13.7c-10.3-2.8-20.6-5.8-30.7-9.4c-10.1-3.5-20.1-7.6-29.5-12.7c-4.7-2.6-9.3-5.4-13.5-8.8c-2.1-1.7-4-3.6-5.8-5.6c-1.8-2-3.3-4.3-4.3-6.8c-1.1-2.5-1.6-5.3-1.4-8c0.2-2.7,1.1-5.4,2.4-7.7c2.7-4.8,6.7-8.5,11-11.7c8.6-6.4,18.4-10.9,28.3-15c9.9-4,20.1-7.3,30.4-10.3c-10.2,3.1-20.4,6.5-30.3,10.5c-9.8,4.1-19.6,8.7-28.1,15.1c-4.2,3.2-8.2,6.9-10.7,11.6c-1.2,2.3-2.1,4.8-2.3,7.5c-0.1,2.6,0.4,5.2,1.4,7.6c2.1,4.8,5.9,8.7,10,12.1c4.1,3.3,8.7,6.1,13.4,8.6c9.4,5,19.4,8.9,29.4,12.4c10.1,3.5,20.4,6.4,30.7,9.1c20.7,5.3,41.6,9.5,62.7,13.2c21,3.6,42.2,6.6,63.4,9.2c21.2,2.6,42.5,4.8,63.7,6.6c42.6,3.7,85.2,6,127.9,7.4L409.9,145.6z"/>
5
5
  <path fill="currentColor" d="M977.1,11.6c13.8,4.1,27.4,8.8,40.4,15.2c6.4,3.2,12.7,6.9,18.3,11.5c2.7,2.4,5.3,5,7.3,8c2,3,3.3,6.6,3.3,10.3c0,3.7-1.4,7.2-3.3,10.3c-2,3.1-4.5,5.7-7.3,8.1c-2.7,2.4-5.7,4.4-8.8,6.3c-1.6,0.9-3.1,1.9-4.7,2.7l-2.4,1.3l-2.4,1.2C1004.5,93,990.8,97.8,977,102c-6.9,2.1-13.8,4-20.8,5.8c-7,1.8-14,3.5-21,5c-14.1,3.1-28.2,5.9-42.4,8.3c-28.4,4.9-57,8.8-85.6,12c-57.3,6.4-114.8,10.2-172.4,12.2c-57.6,2-115.2,2.3-172.9,0.8l0.1-4c57.5,1.8,115.1,1.9,172.6,0.2c57.5-1.7,115-5.2,172.3-11.2c28.6-3.1,57.2-6.7,85.6-11.5c14.2-2.4,28.3-5,42.4-8.1c7-1.5,14-3.1,21-4.9c7-1.7,13.9-3.6,20.8-5.7c13.8-4.1,27.4-8.8,40.3-15.2l2.4-1.2l2.4-1.3c1.6-0.8,3.1-1.8,4.7-2.7c3-1.9,6-3.9,8.7-6.2c2.7-2.3,5.2-4.9,7.2-7.9c1.9-3,3.2-6.4,3.3-10c0-3.6-1.2-7-3.1-10c-1.9-3-4.4-5.6-7.1-8c-5.5-4.7-11.7-8.3-18.1-11.6C1004.5,20.6,990.8,15.8,977.1,11.6z"/>
@@ -10,7 +10,7 @@ var CI360=function(){"use strict";var dn=Object.defineProperty;var pn=(Q,z,rt)=>
10
10
  <path fill="currentColor" d="M10.9,9.7c0-1.1-0.8-2-2.5-2.5c1.3-0.5,1.9-1.3,1.9-2.3c0-1.7-1.7-2.8-4.6-2.8c-1.5,0-2.7,0.3-3.6,0.8v1.7c0.9-0.4,2.3-0.7,3.4-0.7C7,3.9,8,4.4,8,5.1c0,0.8-0.7,1.3-2.4,1.3H4.3v1.6h1.3c2,0,2.9,0.8,2.9,1.6c0,0.8-1,1.5-2.8,1.5c-1.5,0-2.8-0.3-3.7-0.6v1.7c0.9,0.3,2.1,0.6,3.8,0.6C9.2,12.8,10.9,11.4,10.9,9.7"/>
11
11
  </g>
12
12
  </svg>
13
- `,ji=e=>{const t=document.createElement("div");return t.innerHTML=$i,t.style.bottom=`${e}%`,t.className="cloudimage-360-view-360-circle",t},_i=`
13
+ `,Gi=e=>{const t=document.createElement("div");return t.innerHTML=_i,t.style.bottom=`${e}%`,t.className="cloudimage-360-view-360-circle",t},Ui=`
14
14
  <svg width="150" height="87" viewBox="0 0 150 87" xmlns="http://www.w3.org/2000/svg">
15
15
  <g clip-path="url(#clip0_751_188)">
16
16
  <g filter="url(#filter0_d_751_188)">
@@ -51,10 +51,10 @@ var CI360=function(){"use strict";var dn=Object.defineProperty;var pn=(Q,z,rt)=>
51
51
  </clipPath>
52
52
  </defs>
53
53
  </svg>
54
- `,Gi=e=>{const t=document.createElement("div");return t.className="cloudimage-initial-icon",t.setAttribute("aria-label","360 degree view - drag to rotate"),e?(t.style.backgroundImage=`url('${e}')`,t.style.backgroundPosition="50% 50%",t.style.backgroundSize="contain",t.style.backgroundRepeat="no-repeat"):t.innerHTML=_i,t},Ui=(e,t)=>{const{width:i,height:o}=t,s=document.createElement("canvas");return s.width=i,s.height=o,s.style.width="100%",s.style.height="auto",e.appendChild(s),s},Ki=()=>{const e=document.createElement("button");return e.className="cloudimage-360-button cloudimage-360-close-icon",e.setAttribute("aria-label","Close fullscreen"),e.setAttribute("type","button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',e},qi=()=>{const e=document.createElement("button");return e.className="cloudimage-360-button cloudimage-360-fullscreen-button",e.setAttribute("aria-label","View fullscreen"),e.setAttribute("type","button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/></svg>',e},Ie=e=>{const t=document.createElement("div");return t.className="cloudimage-360-icons-container",e.appendChild(t),t},Ji=e=>{const t=document.createElement("div");return t.className="cloudimage-360-inner-box",t.setAttribute("role","img"),t.setAttribute("aria-label","360 degree product view. Use mouse drag or arrow keys to rotate."),e.appendChild(t),t},Qi=()=>{const e=document.createElement("button");return e.className="cloudimage-360-button cloudimage-360-magnifier-button",e.setAttribute("aria-label","Magnify image"),e.setAttribute("type","button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/><path d="M11 8v6"/><path d="M8 11h6"/></svg>',e},to=()=>{const e=document.createElement("button");return e.className="cloudimage-360-button cloudimage-360-zoom-out-button",e.setAttribute("aria-label","Zoom out"),e.setAttribute("type","button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/><path d="M8 11h6"/></svg>',e},eo=e=>{const t=document.createElement("div");t.className="cloudimage-360-loader";const i=document.createElement("span");return i.className="percentage",i.innerText="0%",t.appendChild(i),e.appendChild(t),t},io=e=>{const t=document.createElement("div");t.className="cloudimage-360-fullscreen-modal";const i=e.cloneNode();return i.style.width="100%",i.style.maxWidth="100%",i.style.height="100vh",i.style.maxHeight="100%",t.appendChild(i),window.document.body.appendChild(t),i},Gt=(e,t)=>{const i=e.querySelector(t);i&&i.parentNode.removeChild(i)},oo=()=>{const e=document.createElement("div");return e.className="cloudimage-loading-spinner",e},so=()=>{const e=document.createElement("div");return e.className="cloudimage-360-transition-overlay",e},no=e=>{const t=document.createElement("div");return t.className="cloudimage-360-hotspot-container",e.appendChild(t),t},ro=e=>{const t=document.createElement("div");return t.className="cloudimage-360-sr-only",t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),e.appendChild(t),t},ao=(e,t)=>{e&&(e.textContent="",setTimeout(()=>{e.textContent=t},50))},Ce={drag:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2"/><path d="M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2"/><path d="M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8"/><path d="M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"/></svg>',swipe:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m18 16 4-4-4-4"/><path d="m6 8-4 4 4 4"/><path d="M8 12h8"/></svg>',click:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 9 5 12 1.8-5.2L21 14Z"/><path d="M7.2 2.2 8 5.1"/><path d="m5.1 8-2.9-.8"/><path d="M14 4.1 12 6"/><path d="m6 12-1.9 2"/></svg>',pinch:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 6l4 4"/><path d="M18 6l-4 4"/><path d="M6 18l4-4"/><path d="M18 18l-4-4"/><circle cx="12" cy="12" r="2"/></svg>',keys:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="20" height="16" x="2" y="4" rx="2"/><path d="m9 10 3 3 3-3"/></svg>',fullscreen:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/></svg>'},Oe={drag:"Drag to rotate",swipe:"Swipe to rotate",click:"Click to zoom",dblclick:"Double-click to zoom",pinch:"Pinch to zoom",keys:"Use arrow keys",fullscreen:"Click for fullscreen"},lo=(e,t={})=>{const i=document.createElement("div");i.className="cloudimage-360-hint-item";let o=Oe[e];return e==="click"&&t.pointerZoomTrigger==="dblclick"&&(o=Oe.dblclick),i.innerHTML=`
55
- ${Ce[e]}
54
+ `,Ki=e=>{const t=document.createElement("div");return t.className="cloudimage-initial-icon",t.setAttribute("aria-label","360 degree view - drag to rotate"),e?(t.style.backgroundImage=`url('${e}')`,t.style.backgroundPosition="50% 50%",t.style.backgroundSize="contain",t.style.backgroundRepeat="no-repeat"):t.innerHTML=Ui,t},qi=(e,t)=>{const{width:i,height:o}=t,s=document.createElement("canvas");return s.width=i,s.height=o,s.style.width="100%",s.style.height="auto",e.appendChild(s),s},Ji=()=>{const e=document.createElement("button");return e.className="cloudimage-360-button cloudimage-360-close-icon",e.setAttribute("aria-label","Close fullscreen"),e.setAttribute("type","button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',e},Qi=()=>{const e=document.createElement("button");return e.className="cloudimage-360-button cloudimage-360-fullscreen-button",e.setAttribute("aria-label","View fullscreen"),e.setAttribute("type","button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/></svg>',e},Ce=e=>{const t=document.createElement("div");return t.className="cloudimage-360-icons-container",e.appendChild(t),t},to=e=>{const t=document.createElement("div");return t.className="cloudimage-360-inner-box",t.setAttribute("role","img"),t.setAttribute("aria-label","360 degree product view. Use mouse drag or arrow keys to rotate."),e.appendChild(t),t},eo=()=>{const e=document.createElement("button");return e.className="cloudimage-360-button cloudimage-360-magnifier-button",e.setAttribute("aria-label","Magnify image"),e.setAttribute("type","button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/><path d="M11 8v6"/><path d="M8 11h6"/></svg>',e},io=()=>{const e=document.createElement("button");return e.className="cloudimage-360-button cloudimage-360-zoom-out-button",e.setAttribute("aria-label","Zoom out"),e.setAttribute("type","button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/><path d="M8 11h6"/></svg>',e},oo=e=>{const t=document.createElement("div");t.className="cloudimage-360-loader";const i=document.createElement("span");return i.className="percentage",i.innerText="0%",t.appendChild(i),e.appendChild(t),t},so=e=>{const t=document.createElement("div");t.className="cloudimage-360-fullscreen-modal";const i=e.cloneNode();return i.style.width="100%",i.style.maxWidth="100%",i.style.height="100vh",i.style.maxHeight="100%",t.appendChild(i),window.document.body.appendChild(t),i},Ut=(e,t)=>{const i=e.querySelector(t);i&&i.parentNode.removeChild(i)},no=()=>{const e=document.createElement("div");return e.className="cloudimage-loading-spinner",e},ro=()=>{const e=document.createElement("div");return e.className="cloudimage-360-transition-overlay",e},ao=e=>{const t=document.createElement("div");return t.className="cloudimage-360-hotspot-container",e.appendChild(t),t},lo=e=>{const t=document.createElement("div");return t.className="cloudimage-360-sr-only",t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),e.appendChild(t),t},co=(e,t)=>{e&&(e.textContent="",setTimeout(()=>{e.textContent=t},50))},Ie={drag:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2"/><path d="M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2"/><path d="M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8"/><path d="M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"/></svg>',swipe:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m18 16 4-4-4-4"/><path d="m6 8-4 4 4 4"/><path d="M8 12h8"/></svg>',click:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 9 5 12 1.8-5.2L21 14Z"/><path d="M7.2 2.2 8 5.1"/><path d="m5.1 8-2.9-.8"/><path d="M14 4.1 12 6"/><path d="m6 12-1.9 2"/></svg>',pinch:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 6l4 4"/><path d="M18 6l-4 4"/><path d="M6 18l4-4"/><path d="M18 18l-4-4"/><circle cx="12" cy="12" r="2"/></svg>',keys:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="20" height="16" x="2" y="4" rx="2"/><path d="m9 10 3 3 3-3"/></svg>',fullscreen:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/></svg>'},ke={drag:"Drag to rotate",swipe:"Swipe to rotate",click:"Click to zoom",dblclick:"Double-click to zoom",pinch:"Pinch to zoom",keys:"Use arrow keys",fullscreen:"Click for fullscreen"},ho=(e,t={})=>{const i=document.createElement("div");i.className="cloudimage-360-hint-item";let o=ke[e];return e==="click"&&t.pointerZoomTrigger==="dblclick"&&(o=ke.dblclick),i.innerHTML=`
55
+ ${Ie[e]}
56
56
  <span>${o}</span>
57
- `,i},ke=(e,t=[],i={})=>{if(!t||t.length===0)return null;const o=document.createElement("div");o.className="cloudimage-360-hints-overlay",o.setAttribute("role","tooltip"),o.setAttribute("aria-label","Interaction hints");const s=document.createElement("div");return s.className="cloudimage-360-hints-container",t.forEach(n=>{Ce[n]&&s.appendChild(lo(n,i))}),o.appendChild(s),e.appendChild(o),o},Ee=(e,t)=>t?["swipe","pinch"]:["drag","click"],Ae=e=>{e&&e.classList.add("visible")},co=e=>{e&&(e.classList.remove("visible"),e.classList.add("hiding"),setTimeout(()=>{e.classList.remove("hiding")},300))},ho=e=>{if(!e||typeof e!="object")return null;const t=Object.keys(e).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)).sort((o,s)=>o-s);if(t.length===0)return null;const i=Math.floor(t.length/2);return t[i]},po=e=>{const t=[];return!e||!Array.isArray(e)||e.forEach((i,o)=>{const s=ho(i.positions);s!==null&&t.push({id:i.id||`hotspot-${o}`,frame:s,label:i.label||null})}),t},uo=400,mo=(e,t,i,o)=>{const s=document.createElement("button");s.className="cloudimage-360-hotspot-timeline-dot",s.setAttribute("type","button"),s.setAttribute("aria-label",o||`Go to hotspot at frame ${t+1}`),s.setAttribute("data-frame",t.toString()),s.setAttribute("data-hotspot-id",e);const n=i>1?t/(i-1)*100:0;if(s.style.left=`${n}%`,o){const a=document.createElement("span");a.className="cloudimage-360-hotspot-timeline-tooltip",a.textContent=o,s.appendChild(a);let r=null;s.addEventListener("mouseenter",()=>{r=setTimeout(()=>{a.classList.add("visible")},uo)}),s.addEventListener("mouseleave",()=>{r&&(clearTimeout(r),r=null),a.classList.remove("visible")}),s.addEventListener("click",()=>{r&&(clearTimeout(r),r=null),a.classList.remove("visible")})}return s},fo=(e,t,i)=>{const o=po(i);if(o.length===0)return null;const s=document.createElement("div");s.className="cloudimage-360-hotspot-timeline",s.setAttribute("role","navigation"),s.setAttribute("aria-label","Hotspot timeline navigation");const n=document.createElement("div");n.className="cloudimage-360-hotspot-timeline-track";const a=document.createElement("div");return a.className="cloudimage-360-hotspot-timeline-indicator",o.forEach(({id:r,frame:l,label:c})=>{const h=mo(r,l,t,c);n.appendChild(h)}),n.appendChild(a),s.appendChild(n),e.appendChild(s),{element:s,indicator:a,hotspotFrames:o}},go=(e,t,i)=>{if(!e)return;const o=i>1?t/(i-1)*100:0;e.style.left=`${o}%`},vo=e=>{e&&e.classList.add("visible")},bo=e=>{e&&e.classList.remove("visible")},Ut=(e,t=[])=>{if(!e)return t;if(Array.isArray(e))return e;try{return JSON.parse(e)}catch(i){return console.warn("CloudImage 360: Failed to parse JSON:",i.message),t}},yo=(e,t)=>{const[i,o]=e.split("?");if(!o)return e;const s=new RegExp(`^${t}=|&${t}=`),n=o.split("&").filter(a=>!s.test(a)).join("&");return n?`${i}?${n}`:i},wo=e=>{const t=yo(e,"width"),i=t.includes("?")?"&":"?";return`${t}${i}width=${150*devicePixelRatio}`},xo=e=>{const t={root:null,rootMargin:"0px",threshold:.1},i=s=>{const n=s.getAttribute("data-src");n&&(s.src=n)};new IntersectionObserver((s,n)=>{s.forEach(a=>{a.isIntersecting&&(i(a.target),n.unobserve(a.target))})},t).observe(e)},Io=(e,t)=>{const i=we(1,t);return e.replace("{index}",i)},Co=(e,t)=>{const[i]=e,o=/(https?):\/\//i.test(i);return xt({...t,folder:o?"":t.folder,filename:i})},Oo=(e,t)=>{const{imageList:i,indexZeroBase:o}=t;if(i.length){const s=Ut(i,null);if(s)return Co(s,t)}return Io(e,o)},Se=(e,t,i)=>{const o=new Image;return o.setAttribute(t?"data-src":"src",e),o.className=i,o.style.cssText=`
57
+ `,i},Oe=(e,t=[],i={})=>{if(!t||t.length===0)return null;const o=document.createElement("div");o.className="cloudimage-360-hints-overlay",o.setAttribute("role","tooltip"),o.setAttribute("aria-label","Interaction hints");const s=document.createElement("div");return s.className="cloudimage-360-hints-container",t.forEach(n=>{Ie[n]&&s.appendChild(ho(n,i))}),o.appendChild(s),e.appendChild(o),o},Ee=(e,t)=>t?["swipe","pinch"]:["drag","click"],Ae=e=>{e&&e.classList.add("visible")},po=e=>{e&&(e.classList.remove("visible"),e.classList.add("hiding"),setTimeout(()=>{e.classList.remove("hiding")},300))},uo=e=>{if(!e||typeof e!="object")return null;const t=Object.keys(e).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)).sort((o,s)=>o-s);if(t.length===0)return null;const i=Math.floor(t.length/2);return t[i]},mo=e=>{const t=[];return!e||!Array.isArray(e)||e.forEach((i,o)=>{const s=uo(i.positions);s!==null&&t.push({id:i.id||`hotspot-${o}`,frame:s,label:i.label||null})}),t},fo=400,go=(e,t,i,o)=>{const s=document.createElement("button");s.className="cloudimage-360-hotspot-timeline-dot",s.setAttribute("type","button"),s.setAttribute("aria-label",o||`Go to hotspot at frame ${t+1}`),s.setAttribute("data-frame",t.toString()),s.setAttribute("data-hotspot-id",e);const n=i>1?t/(i-1)*100:0;if(s.style.left=`${n}%`,o){const l=document.createElement("span");l.className="cloudimage-360-hotspot-timeline-tooltip",l.textContent=o,s.appendChild(l);let a=null;s.addEventListener("mouseenter",()=>{a=setTimeout(()=>{l.classList.add("visible")},fo)}),s.addEventListener("mouseleave",()=>{a&&(clearTimeout(a),a=null),l.classList.remove("visible")}),s.addEventListener("click",()=>{a&&(clearTimeout(a),a=null),l.classList.remove("visible")})}return s},vo=(e,t,i)=>{const o=mo(i);if(o.length===0)return null;const s=document.createElement("div");s.className="cloudimage-360-hotspot-timeline",s.setAttribute("role","navigation"),s.setAttribute("aria-label","Hotspot timeline navigation");const n=document.createElement("div");n.className="cloudimage-360-hotspot-timeline-track";const l=document.createElement("div");return l.className="cloudimage-360-hotspot-timeline-indicator",o.forEach(({id:a,frame:r,label:c})=>{const h=go(a,r,t,c);n.appendChild(h)}),n.appendChild(l),s.appendChild(n),e.appendChild(s),{element:s,indicator:l,hotspotFrames:o}},bo=(e,t,i)=>{if(!e)return;const o=i>1?t/(i-1)*100:0;e.style.left=`${o}%`},yo=e=>{e&&e.classList.add("visible")},wo=e=>{e&&e.classList.remove("visible")},Kt=(e,t=[])=>{if(!e)return t;if(Array.isArray(e))return e;try{return JSON.parse(e)}catch(i){return console.warn("CloudImage 360: Failed to parse JSON:",i.message),t}},xo=(e,t)=>{const[i,o]=e.split("?");if(!o)return e;const s=new RegExp(`^${t}=|&${t}=`),n=o.split("&").filter(l=>!s.test(l)).join("&");return n?`${i}?${n}`:i},Co=e=>{const t=xo(e,"width"),i=t.includes("?")?"&":"?";return`${t}${i}width=${150*devicePixelRatio}`},Io=e=>{const t={root:null,rootMargin:"0px",threshold:.1},i=s=>{const n=s.getAttribute("data-src");n&&(s.src=n)};new IntersectionObserver((s,n)=>{s.forEach(l=>{l.isIntersecting&&(i(l.target),n.unobserve(l.target))})},t).observe(e)},ko=(e,t)=>{const i=we(1,t);return e.replace("{index}",i)},Oo=(e,t)=>{const[i]=e,o=/(https?):\/\//i.test(i);return wt({...t,folder:o?"":t.folder,filename:i})},Eo=(e,t)=>{const{imageList:i,indexZeroBase:o}=t;if(i.length){const s=Kt(i,null);if(s)return Oo(s,t)}return ko(e,o)},Se=(e,t,i)=>{const o=new Image;return o.setAttribute(t?"data-src":"src",e),o.className=i,o.style.cssText=`
58
58
  position: ${t?"absolute":"static"};
59
59
  width: 100%;
60
60
  inset: 0;
@@ -62,4 +62,4 @@ var CI360=function(){"use strict";var dn=Object.defineProperty;var pn=(Q,z,rt)=>
62
62
  object-fit: contain;
63
63
  object-position: center;
64
64
  filter: blur(10px);
65
- `,o},Te=(e,t,i)=>{const{innerBox:o,imageList:s,lazyload:n}=t||{},[a]=s,r=a||Oo(e,t),l=wo(r),c=Se(l,n,"cloudimage-lazy"),h=Se(l,!1,"cloudimage-360-placeholder"),p=f=>{Gt(o,".cloudimage-lazy"),i&&i({event:f,width:c.width,height:c.height,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight,src:l})};c.onload=p,o.appendChild(c),o.appendChild(h),xo(c)},ko=(e,t,i)=>{const o=new Image;o.src=e,o.onload=s=>{t&&t({event:s,width:o.width,height:o.height,naturalWidth:o.naturalWidth,naturalHeight:o.naturalHeight,src:e})},o.onerror=s=>{const n=new Error(`Failed to load image: ${e}`);n.url=e,n.event=s,i?i(n):console.error(n.message)}},Eo=(e,t)=>{const i=t.getBoundingClientRect(),o=e.touches?e.touches[0].clientX:e.clientX,s=e.touches?e.touches[0].clientY:e.clientY;return{x:o-i.left,y:s-i.top}},Kt=(e,t,i)=>{const{container:o,w:s,h:n,zoom:a,bw:r,offsetX:l,offsetY:c}=t,h=Eo(e,o);let p=h.x,f=h.y;p=Math.max(s/a,Math.min(p,o.offsetWidth-s/a)),f=Math.max(n/a,Math.min(f,o.offsetHeight-n/a)),i.style.left=`${p-s}px`,i.style.top=`${f-n}px`;const u=(p-l)*a-s+r,x=(f-c)*a-n+r;i.style.backgroundPosition=`-${u}px -${x}px`},Ao=(e,t,i,o,s,n)=>{const{x:a=0,y:r=0}=i||{},l=(t.offsetWidth-a*2)*n,c=(t.offsetHeight-r*2)*n;if(!s)return;s.setAttribute("class","cloudimage-360-img-magnifier-glass"),t.prepend(s),s.style.backgroundImage=`url('${o.src}')`,s.style.backgroundSize=`${l}px ${c}px`;const h=3,p=s.offsetWidth/2,f=s.offsetHeight/2,u={container:t,w:p,h:f,zoom:n,bw:h,offsetX:a,offsetY:r};Kt(e,u,s);const x=g=>{Kt(g,u,s)},y=g=>{g.preventDefault(),Kt(g,u,s)};s.addEventListener("mousemove",x),t.addEventListener("mousemove",x),t.addEventListener("touchmove",y)},So=(e,t,i)=>{const{clientX:o,clientY:s}=e,n=t.getBoundingClientRect(),a=t.width/(n.width*i),r=t.height/(n.height*i),l=(o-n.left)*a,c=(s-n.top)*r;return{offsetX:l,offsetY:c}},To=(e,t,i)=>{const o=e/i,s=t/i;return{zoomedWidth:o,zoomedHeight:s}},Lo=({pointerX:e,pointerY:t,imageData:i,zoomedWidth:o,zoomedHeight:s,drawWidth:n,drawHeight:a})=>{const{naturalWidth:r,naturalHeight:l}=i;let c=e/n*r-o/2,h=t/a*l-s/2;const p=Math.max(0,r-o),f=Math.max(0,l-s);return c=Math.max(0,Math.min(c,p)),h=Math.max(0,Math.min(h,f)),{zoomOffsetX:c,zoomOffsetY:h}},Le=(e,{bottom:t,top:i})=>{e?t():i()},Me=(e,{left:t,right:i})=>{e?t():i()},Mo=({autoplayBehavior:e,spinY:t,reversed:i,loopTriggers:o})=>{switch(e){case R.SPIN_XY:case R.SPIN_YX:t?Le(i,o):Me(i,o);break;case R.SPIN_Y:Le(i,o);break;case R.SPIN_X:default:Me(i,o)}},Po=({autoplayBehavior:e,activeImageX:t,activeImageY:i,amountX:o,amountY:s,autoplayReverse:n})=>{const a=(r,l)=>{const c=l-1;return n?r===0:r===c};switch(e){case R.SPIN_XY:case R.SPIN_Y:return a(i,s);case R.SPIN_X:case R.SPIN_YX:default:return a(t,o)}},Yo=({autoplayBehavior:e,activeImageX:t,activeImageY:i,amountX:o,amountY:s,autoplayReverse:n,spinDirection:a})=>{const r=t===(n?0:o-1),l=i===(n?0:s-1);return e===R.SPIN_XY||e===R.SPIN_YX?a==="x"&&r||a==="y"&&l:!1},Ro=(e,t,i)=>{if(!i)return"x";if(!t)return"y";switch(e){case R.SPIN_XY:return"x";case R.SPIN_YX:return"y";case R.SPIN_Y:return"y";case R.SPIN_X:default:return"x"}},Xo=e=>e==="x"?"y":"x",Pe=(e,t)=>{const i=[...Ai];return t?[...i,...Si].includes(e):i.includes(e)},Ye=({deltaX:e,deltaY:t,reversed:i,allowSpinX:o,allowSpinY:s,threshold:n=0})=>{const a=o&&!s||s&&!o?0:n,r=Math.abs(e),l=Math.abs(t);return o&&r-a>l?i?e>0?"left":"right":e>0?"right":"left":s&&l-a>r?i?t>0?"up":"down":t>0?"down":"up":null},Ho=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,Zo=(e,t=150)=>{let i;return function(...o){clearTimeout(i),i=setTimeout(()=>{e.apply(this,o)},t)}},Re="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHY9KHQsYSxlKT0+e2NvbnN0IHM9dC9lLG49YS9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sej0oe3BvaW50ZXJYOnQscG9pbnRlclk6YSxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOmcsbmF0dXJhbEhlaWdodDp1fT1lO2xldCBmPXQvaSpnLXMvMixtPWEvYyp1LW4vMjtjb25zdCB4PU1hdGgubWF4KDAsZy1zKSxPPU1hdGgubWF4KDAsdS1uKTtyZXR1cm4gZj1NYXRoLm1heCgwLE1hdGgubWluKGYseCkpLG09TWF0aC5tYXgoMCxNYXRoLm1pbihtLE8pKSx7em9vbU9mZnNldFg6Zix6b29tT2Zmc2V0WTptfX07bGV0IG8saCxyLGQsbCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIHQ9Pntjb25zdHthY3Rpb246YSxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpnLGltYWdlQXNwZWN0UmF0aW86dSxjb250YWluZXJXaWR0aDpmLGNvbnRhaW5lckhlaWdodDptfT10LmRhdGE7c3dpdGNoKGEpe2Nhc2UiaW5pdENhbnZhcyI6QyhlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjpwKHUsZixtKTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpJKG4saSxjLGcpO2JyZWFrfX07Y29uc3QgQz0odCxhKT0+e289dCxoPW8uZ2V0Q29udGV4dCgiMmQiKSxyPWF9LHA9KHQsYSxlKT0+e2NvbnN0IHM9YS9lO3c9dD5zLG8ud2lkdGg9YSpyLG8uaGVpZ2h0PWUqcixoLnNjYWxlKHIsciksdz8oZD1hLGw9YS90KToobD1lLGQ9ZSp0KSxoLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxoLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEk9KHQ9e30sYT0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09dDtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L3ItbCkvMik6KGk9KG8ud2lkdGgvci1kKS8yLGM9MCksaC5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLGEhPT0xKXtjb25zdHtuYXR1cmFsV2lkdGg6ZyxuYXR1cmFsSGVpZ2h0OnV9PXQse3pvb21lZFdpZHRoOmYsem9vbWVkSGVpZ2h0Om19PXYoZyx1LGEpLHt6b29tT2Zmc2V0WDp4LHpvb21PZmZzZXRZOk99PXooe3BvaW50ZXJYOmUscG9pbnRlclk6cyxpbWFnZURhdGE6dCx6b29tZWRXaWR0aDpmLHpvb21lZEhlaWdodDptLGRyYXdXaWR0aDpkLGRyYXdIZWlnaHQ6bH0pO2guZHJhd0ltYWdlKG4seCxPLGYsbSxpLGMsZCxsKX1lbHNlIGguZHJhd0ltYWdlKG4saSxjLGQsbCl9fSkoKTsK",Do=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),Xe=typeof self<"u"&&self.Blob&&new Blob([Do(Re)],{type:"text/javascript;charset=utf-8"});function Bo(e){let t;try{if(t=Xe&&(self.URL||self.webkitURL).createObjectURL(Xe),!t)throw"";const i=new Worker(t,{name:e==null?void 0:e.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),i}catch{return new Worker("data:text/javascript;base64,"+Re,{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class zo{constructor(){this.canvas=null,this.ctx=null,this.dpr=1,this.drawWidth=0,this.drawHeight=0,this.wideImage=!1}postMessage(t){const{action:i,offscreen:o,devicePixelRatio:s,imageData:n,zoomScale:a,pointerX:r,pointerY:l,imageAspectRatio:c,containerWidth:h,containerHeight:p}=t;switch(i){case"initCanvas":this.initCanvas(o,s);break;case"adaptCanvasSize":this.adaptCanvasSize(c,h,p);break;case"drawImageOnCanvas":this.drawImageOnCanvas(n,a,r,l);break}}terminate(){var t,i;this.ctx&&this.ctx.clearRect(0,0,((t=this.canvas)==null?void 0:t.width)||0,((i=this.canvas)==null?void 0:i.height)||0),this.canvas=null,this.ctx=null}initCanvas(t,i){this.canvas=t,this.ctx=t.getContext("2d"),this.dpr=i}adaptCanvasSize(t,i,o){if(!this.canvas||!this.ctx)return;const s=i/o;this.wideImage=t>s,this.canvas.width=i*this.dpr,this.canvas.height=o*this.dpr,this.ctx.scale(this.dpr,this.dpr),this.wideImage?(this.drawWidth=i,this.drawHeight=i/t):(this.drawHeight=o,this.drawWidth=o*t),this.ctx.imageSmoothingEnabled=!0,this.ctx.imageSmoothingQuality="high"}drawImageOnCanvas(t={},i=1,o=0,s=0){const{bitmapImage:n}=t;if(!this.canvas||!this.ctx||!n)return;let a,r;if(this.wideImage?(a=0,r=(this.canvas.height/this.dpr-this.drawHeight)/2):(a=(this.canvas.width/this.dpr-this.drawWidth)/2,r=0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),i!==1){const{naturalWidth:l,naturalHeight:c}=t,{zoomedWidth:h,zoomedHeight:p}=To(l,c,i),{zoomOffsetX:f,zoomOffsetY:u}=Lo({pointerX:o,pointerY:s,imageData:t,zoomedWidth:h,zoomedHeight:p,drawWidth:this.drawWidth,drawHeight:this.drawHeight});this.ctx.drawImage(n,f,u,h,p,a,r,this.drawWidth,this.drawHeight)}else this.ctx.drawImage(n,a,r,this.drawWidth,this.drawHeight)}}const Wo=new Set(["p","span","div","br","hr","strong","em","b","i","u","s","h1","h2","h3","h4","h5","h6","ul","ol","li","a","img","button","table","thead","tbody","tr","th","td","blockquote","pre","code","label","input","select","option","textarea","svg","path","circle","rect","line","polyline","polygon","ellipse","g","text","tspan","defs","use","symbol","clippath","mask","lineargradient","radialgradient","stop"]),He={a:["href","title","target","rel"],img:["src","alt","title","width","height"],button:["type","disabled","name","value"],input:["type","name","value","placeholder","disabled","readonly","checked","min","max","step"],select:["name","disabled","multiple"],option:["value","disabled","selected"],textarea:["name","placeholder","disabled","readonly","rows","cols"],label:["for"],svg:["viewbox","width","height","fill","stroke","xmlns","preserveaspectratio"],path:["d","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","transform"],circle:["cx","cy","r","fill","stroke","stroke-width"],rect:["x","y","width","height","rx","ry","fill","stroke","stroke-width"],line:["x1","y1","x2","y2","stroke","stroke-width"],polyline:["points","fill","stroke","stroke-width"],polygon:["points","fill","stroke","stroke-width"],ellipse:["cx","cy","rx","ry","fill","stroke","stroke-width"],g:["transform","fill","stroke"],text:["x","y","dx","dy","text-anchor","fill","font-size","font-family","font-weight"],tspan:["x","y","dx","dy"],use:["href","xlink:href","x","y","width","height"],lineargradient:["id","x1","y1","x2","y2","gradientunits"],radialgradient:["id","cx","cy","r","fx","fy","gradientunits"],stop:["offset","stop-color","stop-opacity"],clippath:["id"],mask:["id"],"*":["class","id","style"]},Fo=[/javascript:/gi,/vbscript:/gi,/data:/gi,/on\w+\s*=/gi],Vo=e=>{if(typeof e!="string")return"";const t=document.createElement("template");t.innerHTML=e;const i=o=>{if(Array.from(o.childNodes).forEach(i),o.nodeType===Node.ELEMENT_NODE){const n=o.tagName.toLowerCase();if(!Wo.has(n)){if(n==="script"||n==="style"){o.remove();return}const l=document.createTextNode(o.textContent);o.parentNode.replaceChild(l,o);return}const a=[...He[n]||[],...He["*"]||[]];if(Array.from(o.attributes).forEach(l=>{const c=l.name.toLowerCase();if(c.startsWith("on")){o.removeAttribute(l.name);return}if(!a.includes(c)){o.removeAttribute(l.name);return}let h=l.value;Fo.forEach(p=>{p.test(h)&&o.removeAttribute(l.name)})}),n==="a"){const l=o.getAttribute("href");l&&(/^(https?:|mailto:|tel:|#|\/)/i.test(l.trim())||o.removeAttribute("href")),o.getAttribute("target")==="_blank"&&o.setAttribute("rel","noopener noreferrer")}if(n==="img"){const l=o.getAttribute("src");l&&(/^(https?:|\/|data:image\/)/i.test(l.trim())||o.removeAttribute("src"))}}};return i(t.content),t.innerHTML},No=e=>e==="x"?M.X:M.Y,$o=(e,t,i)=>e.filter(o=>No(o.orientation)===i&&t in o.positions),jo=(e,t)=>{const i=document.createElement("button");return i.id=e,i.className="cloudimage-360-hotspot",i.dataset.hotspotId=e,i.setAttribute("type","button"),i.setAttribute("aria-label",t||`Hotspot ${e}`),i.setAttribute("aria-haspopup","true"),i.setAttribute("aria-expanded","false"),i},_o=e=>{const t=Object.entries(e).sort(([n],[a])=>Number(n)-Number(a));let i=null,o=null;const s={};for(const[n,a]of t)if(!a)s[n]={x:i,y:o};else{const{x:r,y:l}=a;r!=null&&(i=r),l!=null&&(o=l),s[n]={x:r||i,y:l||o}}return s},Go=e=>({placement:"top",modifiers:[{name:"offset",options:{offset:[0,10]}},{name:"preventOverflow",options:{boundary:e}},{name:"flip",options:{boundary:e,fallbackPlacements:["bottom","right","left"]}}]}),Uo=(e,t)=>{const i=document.createElement("div");return i.className="cloudimage-360-popper",i.id=`cloudimage-360-popper-${t}`,i.dataset.popperId=t,i.setAttribute("role","tooltip"),i.setAttribute("aria-hidden","false"),typeof e=="string"&&/<\/?[a-z][\s\S]*>/i.test(e)?i.innerHTML=Vo(e):i.textContent=e,document.body.appendChild(i),i},Ko=e=>{const t=[...e];return t.forEach((i,o)=>{const s={..._o(i.positions)};t[o].initialPositions=s,t[o].positions=s}),t},qo=({newWidth:e,newHeight:t,initialContainerSize:i,imageAspectRatio:o,hotspotsConfig:s})=>{const[n,a]=i;let r=e,l=t,c=0,h=0;const p=e/t;o>p?(l=e/o,h=(t-l)/2):(r=t*o,c=(e-r)/2);const u=r/n,x=l/a;return s.map(y=>{const g={};return Object.entries(y.initialPositions).forEach(([O,k])=>{g[O]={x:k.x*u+c,y:k.y*x+h}}),{...y,positions:g}})};function Jo(e){const t=[];e.image&&t.push(`<div class="ci360-popper-image-wrapper"><img class="ci360-popper-image" src="${qt(e.image)}" alt="${qt(e.title||"")}"></div>`);const i=[];if(e.title&&i.push(`<h3 class="ci360-popper-title">${It(e.title)}</h3>`),e.originalPrice||e.price){let o="";e.originalPrice&&(o+=`<span class="ci360-popper-original-price">${It(e.originalPrice)}</span>`),e.price&&(o+=`<span class="ci360-popper-price">${It(e.price)}</span>`),i.push(`<div class="ci360-popper-price-row">${o}</div>`)}if(e.description&&i.push(`<p class="ci360-popper-description">${It(e.description)}</p>`),e.url&&Qo(e.url)){const o=e.ctaText||"View details";i.push(`<a class="ci360-popper-cta" href="${qt(e.url)}">${It(String(o))}</a>`)}return i.length>0&&t.push(`<div class="ci360-popper-body">${i.join("")}</div>`),t.join("")}function Ze(e){return e.content?e.content:e.data?Jo(e.data):""}function It(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function qt(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Qo(e){const t=e.replace(/[\s\x00-\x1f]/g,"");return/^https?:\/\//i.test(t)||/^\/(?!\/)/.test(t)||/^#/.test(t)}var H="top",W="bottom",F="right",Z="left",Jt="auto",Ct=[H,W,F,Z],at="start",Ot="end",ts="clippingParents",De="viewport",kt="popper",es="reference",Be=Ct.reduce(function(e,t){return e.concat([t+"-"+at,t+"-"+Ot])},[]),ze=[].concat(Ct,[Jt]).reduce(function(e,t){return e.concat([t,t+"-"+at,t+"-"+Ot])},[]),is="beforeRead",os="read",ss="afterRead",ns="beforeMain",rs="main",as="afterMain",ls="beforeWrite",cs="write",hs="afterWrite",ds=[is,os,ss,ns,rs,as,ls,cs,hs];function N(e){return e?(e.nodeName||"").toLowerCase():null}function D(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function it(e){var t=D(e).Element;return e instanceof t||e instanceof Element}function V(e){var t=D(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Qt(e){if(typeof ShadowRoot>"u")return!1;var t=D(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function ps(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var o=t.styles[i]||{},s=t.attributes[i]||{},n=t.elements[i];!V(n)||!N(n)||(Object.assign(n.style,o),Object.keys(s).forEach(function(a){var r=s[a];r===!1?n.removeAttribute(a):n.setAttribute(a,r===!0?"":r)}))})}function us(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(o){var s=t.elements[o],n=t.attributes[o]||{},a=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:i[o]),r=a.reduce(function(l,c){return l[c]="",l},{});!V(s)||!N(s)||(Object.assign(s.style,r),Object.keys(n).forEach(function(l){s.removeAttribute(l)}))})}}const ms={name:"applyStyles",enabled:!0,phase:"write",fn:ps,effect:us,requires:["computeStyles"]};function $(e){return e.split("-")[0]}var ot=Math.max,Zt=Math.min,lt=Math.round;function te(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function We(){return!/^((?!chrome|android).)*safari/i.test(te())}function ct(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var o=e.getBoundingClientRect(),s=1,n=1;t&&V(e)&&(s=e.offsetWidth>0&&lt(o.width)/e.offsetWidth||1,n=e.offsetHeight>0&&lt(o.height)/e.offsetHeight||1);var a=it(e)?D(e):window,r=a.visualViewport,l=!We()&&i,c=(o.left+(l&&r?r.offsetLeft:0))/s,h=(o.top+(l&&r?r.offsetTop:0))/n,p=o.width/s,f=o.height/n;return{width:p,height:f,top:h,right:c+p,bottom:h+f,left:c,x:c,y:h}}function ee(e){var t=ct(e),i=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:o}}function Fe(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&Qt(i)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function _(e){return D(e).getComputedStyle(e)}function fs(e){return["table","td","th"].indexOf(N(e))>=0}function tt(e){return((it(e)?e.ownerDocument:e.document)||window.document).documentElement}function Dt(e){return N(e)==="html"?e:e.assignedSlot||e.parentNode||(Qt(e)?e.host:null)||tt(e)}function Ve(e){return!V(e)||_(e).position==="fixed"?null:e.offsetParent}function gs(e){var t=/firefox/i.test(te()),i=/Trident/i.test(te());if(i&&V(e)){var o=_(e);if(o.position==="fixed")return null}var s=Dt(e);for(Qt(s)&&(s=s.host);V(s)&&["html","body"].indexOf(N(s))<0;){var n=_(s);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||t&&n.willChange==="filter"||t&&n.filter&&n.filter!=="none")return s;s=s.parentNode}return null}function Et(e){for(var t=D(e),i=Ve(e);i&&fs(i)&&_(i).position==="static";)i=Ve(i);return i&&(N(i)==="html"||N(i)==="body"&&_(i).position==="static")?t:i||gs(e)||t}function ie(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function At(e,t,i){return ot(e,Zt(t,i))}function vs(e,t,i){var o=At(e,t,i);return o>i?i:o}function Ne(){return{top:0,right:0,bottom:0,left:0}}function $e(e){return Object.assign({},Ne(),e)}function je(e,t){return t.reduce(function(i,o){return i[o]=e,i},{})}var bs=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,$e(typeof t!="number"?t:je(t,Ct))};function ys(e){var t,i=e.state,o=e.name,s=e.options,n=i.elements.arrow,a=i.modifiersData.popperOffsets,r=$(i.placement),l=ie(r),c=[Z,F].indexOf(r)>=0,h=c?"height":"width";if(!(!n||!a)){var p=bs(s.padding,i),f=ee(n),u=l==="y"?H:Z,x=l==="y"?W:F,y=i.rects.reference[h]+i.rects.reference[l]-a[l]-i.rects.popper[h],g=a[l]-i.rects.reference[l],O=Et(n),k=O?l==="y"?O.clientHeight||0:O.clientWidth||0:0,w=y/2-g/2,b=p[u],C=k-f[h]-p[x],m=k/2-f[h]/2+w,v=At(b,m,C),I=l;i.modifiersData[o]=(t={},t[I]=v,t.centerOffset=v-m,t)}}function ws(e){var t=e.state,i=e.options,o=i.element,s=o===void 0?"[data-popper-arrow]":o;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||Fe(t.elements.popper,s)&&(t.elements.arrow=s))}const xs={name:"arrow",enabled:!0,phase:"main",fn:ys,effect:ws,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ht(e){return e.split("-")[1]}var Is={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Cs(e,t){var i=e.x,o=e.y,s=t.devicePixelRatio||1;return{x:lt(i*s)/s||0,y:lt(o*s)/s||0}}function _e(e){var t,i=e.popper,o=e.popperRect,s=e.placement,n=e.variation,a=e.offsets,r=e.position,l=e.gpuAcceleration,c=e.adaptive,h=e.roundOffsets,p=e.isFixed,f=a.x,u=f===void 0?0:f,x=a.y,y=x===void 0?0:x,g=typeof h=="function"?h({x:u,y}):{x:u,y};u=g.x,y=g.y;var O=a.hasOwnProperty("x"),k=a.hasOwnProperty("y"),w=Z,b=H,C=window;if(c){var m=Et(i),v="clientHeight",I="clientWidth";if(m===D(i)&&(m=tt(i),_(m).position!=="static"&&r==="absolute"&&(v="scrollHeight",I="scrollWidth")),m=m,s===H||(s===Z||s===F)&&n===Ot){b=W;var E=p&&m===C&&C.visualViewport?C.visualViewport.height:m[v];y-=E-o.height,y*=l?1:-1}if(s===Z||(s===H||s===W)&&n===Ot){w=F;var A=p&&m===C&&C.visualViewport?C.visualViewport.width:m[I];u-=A-o.width,u*=l?1:-1}}var T=Object.assign({position:r},c&&Is),X=h===!0?Cs({x:u,y},D(i)):{x:u,y};if(u=X.x,y=X.y,l){var L;return Object.assign({},T,(L={},L[b]=k?"0":"",L[w]=O?"0":"",L.transform=(C.devicePixelRatio||1)<=1?"translate("+u+"px, "+y+"px)":"translate3d("+u+"px, "+y+"px, 0)",L))}return Object.assign({},T,(t={},t[b]=k?y+"px":"",t[w]=O?u+"px":"",t.transform="",t))}function Os(e){var t=e.state,i=e.options,o=i.gpuAcceleration,s=o===void 0?!0:o,n=i.adaptive,a=n===void 0?!0:n,r=i.roundOffsets,l=r===void 0?!0:r,c={placement:$(t.placement),variation:ht(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,_e(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,_e(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ks={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Os,data:{}};var Bt={passive:!0};function Es(e){var t=e.state,i=e.instance,o=e.options,s=o.scroll,n=s===void 0?!0:s,a=o.resize,r=a===void 0?!0:a,l=D(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return n&&c.forEach(function(h){h.addEventListener("scroll",i.update,Bt)}),r&&l.addEventListener("resize",i.update,Bt),function(){n&&c.forEach(function(h){h.removeEventListener("scroll",i.update,Bt)}),r&&l.removeEventListener("resize",i.update,Bt)}}const As={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Es,data:{}};var Ss={left:"right",right:"left",bottom:"top",top:"bottom"};function zt(e){return e.replace(/left|right|bottom|top/g,function(t){return Ss[t]})}var Ts={start:"end",end:"start"};function Ge(e){return e.replace(/start|end/g,function(t){return Ts[t]})}function oe(e){var t=D(e),i=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:i,scrollTop:o}}function se(e){return ct(tt(e)).left+oe(e).scrollLeft}function Ls(e,t){var i=D(e),o=tt(e),s=i.visualViewport,n=o.clientWidth,a=o.clientHeight,r=0,l=0;if(s){n=s.width,a=s.height;var c=We();(c||!c&&t==="fixed")&&(r=s.offsetLeft,l=s.offsetTop)}return{width:n,height:a,x:r+se(e),y:l}}function Ms(e){var t,i=tt(e),o=oe(e),s=(t=e.ownerDocument)==null?void 0:t.body,n=ot(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),a=ot(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),r=-o.scrollLeft+se(e),l=-o.scrollTop;return _(s||i).direction==="rtl"&&(r+=ot(i.clientWidth,s?s.clientWidth:0)-n),{width:n,height:a,x:r,y:l}}function ne(e){var t=_(e),i=t.overflow,o=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+o)}function Ue(e){return["html","body","#document"].indexOf(N(e))>=0?e.ownerDocument.body:V(e)&&ne(e)?e:Ue(Dt(e))}function St(e,t){var i;t===void 0&&(t=[]);var o=Ue(e),s=o===((i=e.ownerDocument)==null?void 0:i.body),n=D(o),a=s?[n].concat(n.visualViewport||[],ne(o)?o:[]):o,r=t.concat(a);return s?r:r.concat(St(Dt(a)))}function re(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ps(e,t){var i=ct(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function Ke(e,t,i){return t===De?re(Ls(e,i)):it(t)?Ps(t,i):re(Ms(tt(e)))}function Ys(e){var t=St(Dt(e)),i=["absolute","fixed"].indexOf(_(e).position)>=0,o=i&&V(e)?Et(e):e;return it(o)?t.filter(function(s){return it(s)&&Fe(s,o)&&N(s)!=="body"}):[]}function Rs(e,t,i,o){var s=t==="clippingParents"?Ys(e):[].concat(t),n=[].concat(s,[i]),a=n[0],r=n.reduce(function(l,c){var h=Ke(e,c,o);return l.top=ot(h.top,l.top),l.right=Zt(h.right,l.right),l.bottom=Zt(h.bottom,l.bottom),l.left=ot(h.left,l.left),l},Ke(e,a,o));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function qe(e){var t=e.reference,i=e.element,o=e.placement,s=o?$(o):null,n=o?ht(o):null,a=t.x+t.width/2-i.width/2,r=t.y+t.height/2-i.height/2,l;switch(s){case H:l={x:a,y:t.y-i.height};break;case W:l={x:a,y:t.y+t.height};break;case F:l={x:t.x+t.width,y:r};break;case Z:l={x:t.x-i.width,y:r};break;default:l={x:t.x,y:t.y}}var c=s?ie(s):null;if(c!=null){var h=c==="y"?"height":"width";switch(n){case at:l[c]=l[c]-(t[h]/2-i[h]/2);break;case Ot:l[c]=l[c]+(t[h]/2-i[h]/2);break}}return l}function Tt(e,t){t===void 0&&(t={});var i=t,o=i.placement,s=o===void 0?e.placement:o,n=i.strategy,a=n===void 0?e.strategy:n,r=i.boundary,l=r===void 0?ts:r,c=i.rootBoundary,h=c===void 0?De:c,p=i.elementContext,f=p===void 0?kt:p,u=i.altBoundary,x=u===void 0?!1:u,y=i.padding,g=y===void 0?0:y,O=$e(typeof g!="number"?g:je(g,Ct)),k=f===kt?es:kt,w=e.rects.popper,b=e.elements[x?k:f],C=Rs(it(b)?b:b.contextElement||tt(e.elements.popper),l,h,a),m=ct(e.elements.reference),v=qe({reference:m,element:w,placement:s}),I=re(Object.assign({},w,v)),E=f===kt?I:m,A={top:C.top-E.top+O.top,bottom:E.bottom-C.bottom+O.bottom,left:C.left-E.left+O.left,right:E.right-C.right+O.right},T=e.modifiersData.offset;if(f===kt&&T){var X=T[s];Object.keys(A).forEach(function(L){var G=[F,W].indexOf(L)>=0?1:-1,U=[H,W].indexOf(L)>=0?"y":"x";A[L]+=X[U]*G})}return A}function Xs(e,t){t===void 0&&(t={});var i=t,o=i.placement,s=i.boundary,n=i.rootBoundary,a=i.padding,r=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?ze:l,h=ht(o),p=h?r?Be:Be.filter(function(x){return ht(x)===h}):Ct,f=p.filter(function(x){return c.indexOf(x)>=0});f.length===0&&(f=p);var u=f.reduce(function(x,y){return x[y]=Tt(e,{placement:y,boundary:s,rootBoundary:n,padding:a})[$(y)],x},{});return Object.keys(u).sort(function(x,y){return u[x]-u[y]})}function Hs(e){if($(e)===Jt)return[];var t=zt(e);return[Ge(e),t,Ge(t)]}function Zs(e){var t=e.state,i=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var s=i.mainAxis,n=s===void 0?!0:s,a=i.altAxis,r=a===void 0?!0:a,l=i.fallbackPlacements,c=i.padding,h=i.boundary,p=i.rootBoundary,f=i.altBoundary,u=i.flipVariations,x=u===void 0?!0:u,y=i.allowedAutoPlacements,g=t.options.placement,O=$(g),k=O===g,w=l||(k||!x?[zt(g)]:Hs(g)),b=[g].concat(w).reduce(function(et,j){return et.concat($(j)===Jt?Xs(t,{placement:j,boundary:h,rootBoundary:p,padding:c,flipVariations:x,allowedAutoPlacements:y}):j)},[]),C=t.rects.reference,m=t.rects.popper,v=new Map,I=!0,E=b[0],A=0;A<b.length;A++){var T=b[A],X=$(T),L=ht(T)===at,G=[H,W].indexOf(X)>=0,U=G?"width":"height",Y=Tt(t,{placement:T,boundary:h,rootBoundary:p,altBoundary:f,padding:c}),B=G?L?F:Z:L?W:H;C[U]>m[U]&&(B=zt(B));var dt=zt(B),K=[];if(n&&K.push(Y[X]<=0),r&&K.push(Y[B]<=0,Y[dt]<=0),K.every(function(et){return et})){E=T,I=!1;break}v.set(T,K)}if(I)for(var pt=x?3:1,Lt=function(j){var nt=b.find(function(mt){var q=v.get(mt);if(q)return q.slice(0,j).every(function(ft){return ft})});if(nt)return E=nt,"break"},st=pt;st>0;st--){var ut=Lt(st);if(ut==="break")break}t.placement!==E&&(t.modifiersData[o]._skip=!0,t.placement=E,t.reset=!0)}}const Ds={name:"flip",enabled:!0,phase:"main",fn:Zs,requiresIfExists:["offset"],data:{_skip:!1}};function Je(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function Qe(e){return[H,F,W,Z].some(function(t){return e[t]>=0})}function Bs(e){var t=e.state,i=e.name,o=t.rects.reference,s=t.rects.popper,n=t.modifiersData.preventOverflow,a=Tt(t,{elementContext:"reference"}),r=Tt(t,{altBoundary:!0}),l=Je(a,o),c=Je(r,s,n),h=Qe(l),p=Qe(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":p})}const zs={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Bs};function Ws(e,t,i){var o=$(e),s=[Z,H].indexOf(o)>=0?-1:1,n=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,a=n[0],r=n[1];return a=a||0,r=(r||0)*s,[Z,F].indexOf(o)>=0?{x:r,y:a}:{x:a,y:r}}function Fs(e){var t=e.state,i=e.options,o=e.name,s=i.offset,n=s===void 0?[0,0]:s,a=ze.reduce(function(h,p){return h[p]=Ws(p,t.rects,n),h},{}),r=a[t.placement],l=r.x,c=r.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[o]=a}const Vs={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Fs};function Ns(e){var t=e.state,i=e.name;t.modifiersData[i]=qe({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const $s={name:"popperOffsets",enabled:!0,phase:"read",fn:Ns,data:{}};function js(e){return e==="x"?"y":"x"}function _s(e){var t=e.state,i=e.options,o=e.name,s=i.mainAxis,n=s===void 0?!0:s,a=i.altAxis,r=a===void 0?!1:a,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,p=i.padding,f=i.tether,u=f===void 0?!0:f,x=i.tetherOffset,y=x===void 0?0:x,g=Tt(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:h}),O=$(t.placement),k=ht(t.placement),w=!k,b=ie(O),C=js(b),m=t.modifiersData.popperOffsets,v=t.rects.reference,I=t.rects.popper,E=typeof y=="function"?y(Object.assign({},t.rects,{placement:t.placement})):y,A=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,X={x:0,y:0};if(m){if(n){var L,G=b==="y"?H:Z,U=b==="y"?W:F,Y=b==="y"?"height":"width",B=m[b],dt=B+g[G],K=B-g[U],pt=u?-I[Y]/2:0,Lt=k===at?v[Y]:I[Y],st=k===at?-I[Y]:-v[Y],ut=t.elements.arrow,et=u&&ut?ee(ut):{width:0,height:0},j=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ne(),nt=j[G],mt=j[U],q=At(0,v[Y],et[Y]),ft=w?v[Y]/2-pt-q-nt-A.mainAxis:Lt-q-nt-A.mainAxis,ae=w?-v[Y]/2+pt+q+mt+A.mainAxis:st+q+mt+A.mainAxis,gt=t.elements.arrow&&Et(t.elements.arrow),le=gt?b==="y"?gt.clientTop||0:gt.clientLeft||0:0,Ft=(L=T==null?void 0:T[b])!=null?L:0,ce=B+ft-Ft-le,he=B+ae-Ft,Vt=At(u?Zt(dt,ce):dt,B,u?ot(K,he):K);m[b]=Vt,X[b]=Vt-B}if(r){var Nt,de=b==="x"?H:Z,pe=b==="x"?W:F,J=m[C],vt=C==="y"?"height":"width",$t=J+g[de],jt=J-g[pe],bt=[H,Z].indexOf(O)!==-1,yt=(Nt=T==null?void 0:T[C])!=null?Nt:0,wt=bt?$t:J-v[vt]-I[vt]-yt+A.altAxis,Mt=bt?J+v[vt]+I[vt]-yt-A.altAxis:jt,Pt=u&&bt?vs(wt,J,Mt):At(u?wt:$t,J,u?Mt:jt);m[C]=Pt,X[C]=Pt-J}t.modifiersData[o]=X}}const Gs={name:"preventOverflow",enabled:!0,phase:"main",fn:_s,requiresIfExists:["offset"]};function Us(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ks(e){return e===D(e)||!V(e)?oe(e):Us(e)}function qs(e){var t=e.getBoundingClientRect(),i=lt(t.width)/e.offsetWidth||1,o=lt(t.height)/e.offsetHeight||1;return i!==1||o!==1}function Js(e,t,i){i===void 0&&(i=!1);var o=V(t),s=V(t)&&qs(t),n=tt(t),a=ct(e,s,i),r={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(o||!o&&!i)&&((N(t)!=="body"||ne(n))&&(r=Ks(t)),V(t)?(l=ct(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):n&&(l.x=se(n))),{x:a.left+r.scrollLeft-l.x,y:a.top+r.scrollTop-l.y,width:a.width,height:a.height}}function Qs(e){var t=new Map,i=new Set,o=[];e.forEach(function(n){t.set(n.name,n)});function s(n){i.add(n.name);var a=[].concat(n.requires||[],n.requiresIfExists||[]);a.forEach(function(r){if(!i.has(r)){var l=t.get(r);l&&s(l)}}),o.push(n)}return e.forEach(function(n){i.has(n.name)||s(n)}),o}function tn(e){var t=Qs(e);return ds.reduce(function(i,o){return i.concat(t.filter(function(s){return s.phase===o}))},[])}function en(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function on(e){var t=e.reduce(function(i,o){var s=i[o.name];return i[o.name]=s?Object.assign({},s,o,{options:Object.assign({},s.options,o.options),data:Object.assign({},s.data,o.data)}):o,i},{});return Object.keys(t).map(function(i){return t[i]})}var ti={placement:"bottom",modifiers:[],strategy:"absolute"};function ei(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function sn(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,o=i===void 0?[]:i,s=t.defaultOptions,n=s===void 0?ti:s;return function(r,l,c){c===void 0&&(c=n);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},ti,n),modifiersData:{},elements:{reference:r,popper:l},attributes:{},styles:{}},p=[],f=!1,u={state:h,setOptions:function(O){var k=typeof O=="function"?O(h.options):O;y(),h.options=Object.assign({},n,h.options,k),h.scrollParents={reference:it(r)?St(r):r.contextElement?St(r.contextElement):[],popper:St(l)};var w=tn(on([].concat(o,h.options.modifiers)));return h.orderedModifiers=w.filter(function(b){return b.enabled}),x(),u.update()},forceUpdate:function(){if(!f){var O=h.elements,k=O.reference,w=O.popper;if(ei(k,w)){h.rects={reference:Js(k,Et(w),h.options.strategy==="fixed"),popper:ee(w)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(A){return h.modifiersData[A.name]=Object.assign({},A.data)});for(var b=0;b<h.orderedModifiers.length;b++){if(h.reset===!0){h.reset=!1,b=-1;continue}var C=h.orderedModifiers[b],m=C.fn,v=C.options,I=v===void 0?{}:v,E=C.name;typeof m=="function"&&(h=m({state:h,options:I,name:E,instance:u})||h)}}}},update:en(function(){return new Promise(function(g){u.forceUpdate(),g(h)})}),destroy:function(){y(),f=!0}};if(!ei(r,l))return u;u.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function x(){h.orderedModifiers.forEach(function(g){var O=g.name,k=g.options,w=k===void 0?{}:k,b=g.effect;if(typeof b=="function"){var C=b({state:h,name:O,instance:u,options:w}),m=function(){};p.push(C||m)}})}function y(){p.forEach(function(g){return g()}),p=[]}return u}}var nn=[As,$s,ks,ms,Vs,Ds,Gs,xs,zs],rn=sn({defaultModifiers:nn});class an{constructor(t,i,o,s={}){ai(this,"updateHotspotPosition",(t,i)=>{this.currentActiveIndex=t,this.currentOrientation=i;const o=$o(this.hotspotsConfig,t,i);this.hideHotspots(),o.forEach(s=>this.updateAndShowHotspot(s,t))});this.container=i,this.popper=null,this.popperInstance=null,this.hotspotsContainer=no(this.container),this.hotspotsConfig=Ko(t),this.shouldHidePopper=!0,this.hidePopper=this.hidePopper.bind(this),this.forceHidePopper=this.forceHidePopper.bind(this),this.imageAspectRatio=o,this.hotspotElements=new Map,this.popperListeners=[],this.trigger=s.trigger||"hover";const{containerSize:n}=t[0];this.initialContainerSize=n||[i.offsetWidth,i.offsetHeight],this.initHotspots(),this.observeContainerResize()}observeContainerResize(){this.resizeObserver=new ResizeObserver(()=>{const t=this.container.offsetWidth,i=this.container.offsetHeight;this.updateHotspotsForResize(t,i)}),this.resizeObserver.observe(this.container)}updateHotspotsForResize(t,i){this.hotspotsConfig=qo({newWidth:t,newHeight:i,initialContainerSize:this.initialContainerSize,imageAspectRatio:this.imageAspectRatio,hotspotsConfig:this.hotspotsConfig}),this.updateHotspotPosition(this.currentActiveIndex,this.currentOrientation)}cleanupPopperListeners(){this.popperListeners.forEach(({element:t,event:i,handler:o})=>{t.removeEventListener(i,o)}),this.popperListeners=[]}showPopper({hotspotElement:t,content:i,id:o,keepOpen:s}){this.popperInstance&&this.hidePopper();const n=Go(this.container);this.popper=Uo(i,o),this.popper.setAttribute("data-show",""),this.currentHotspotElement=t,t.setAttribute("aria-expanded","true"),t.setAttribute("aria-describedby",`cloudimage-360-popper-${o}`);const a=()=>{this.shouldHidePopper=!1},r=()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()},l=()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()},c=()=>{this.shouldHidePopper=!1,this.hidePopperTimeout&&clearTimeout(this.hidePopperTimeout)};this.popper.addEventListener("mouseenter",a),this.popper.addEventListener("mouseleave",r),t.addEventListener("mouseleave",l),t.addEventListener("mouseenter",c),this.popperListeners.push({element:this.popper,event:"mouseenter",handler:a},{element:this.popper,event:"mouseleave",handler:r},{element:t,event:"mouseleave",handler:l},{element:t,event:"mouseenter",handler:c}),this.popperInstance={...rn(t,this.popper,n),keepOpen:s,instanceId:o}}checkAndHidePopper(){var t;this.shouldHidePopper&&!((t=this.popperInstance)!=null&&t.keepOpen)&&(this.hidePopperTimeout=setTimeout(()=>{this.shouldHidePopper&&this.hidePopper()},Li))}hidePopper(){if(this.hidePopperTimeout&&(clearTimeout(this.hidePopperTimeout),this.hidePopperTimeout=null),this.cleanupPopperListeners(),this.currentHotspotElement&&(this.currentHotspotElement.setAttribute("aria-expanded","false"),this.currentHotspotElement.removeAttribute("aria-describedby"),this.currentHotspotElement=null),this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null),this.popper){this.popper.removeAttribute("data-show"),this.popper.setAttribute("aria-hidden","true");const t=this.popper;this.popper=null,setTimeout(()=>{t.remove()},Mi)}this.shouldHidePopper=!0}forceHidePopper(){this.shouldHidePopper=!0,this.popperInstance&&(this.popperInstance.keepOpen=!1),this.hidePopper()}createHotspot(t){const{id:i,keepOpen:o,onClick:s,label:n}=t,a=Ze(t),r=jo(i,n);(s||a&&this.trigger==="click")&&(r.style.cursor="pointer"),r.onclick=l=>{var c;l.stopPropagation(),a&&this.trigger==="click"&&(((c=this.popperInstance)==null?void 0:c.instanceId)===i?this.hidePopper():this.showPopper({hotspotElement:r,content:a,id:i,keepOpen:o})),s==null||s(l,this.popperInstance,i)},a&&(this.trigger==="hover"&&(r.addEventListener("mouseenter",()=>this.showPopper({hotspotElement:r,content:a,id:i,keepOpen:o})),r.addEventListener("mouseleave",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()})),r.addEventListener("focus",()=>this.showPopper({hotspotElement:r,content:a,id:i,keepOpen:o})),r.addEventListener("blur",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()})),this.hotspotsContainer.appendChild(r)}hideHotspots(){this.hotspotsContainer.querySelectorAll(".cloudimage-360-hotspot").forEach(t=>{t.style.opacity=0,t.style.pointerEvents="none"})}updateAndShowHotspot(t,i){const{positions:o,id:s}=t,{x:n,y:a}=o[i]??{},r=this.hotspotsContainer.querySelector(`[data-hotspot-id="${s}"]`);r&&(r.style.translate=`${n}px ${a}px`,r.style.opacity=1,r.style.pointerEvents="all")}showHotspotById(t){const i=this.hotspotsConfig.find(n=>n.id===t);if(!i)return;const o=Ze(i);if(!o)return;const s=this.hotspotsContainer.querySelector(`[data-hotspot-id="${t}"]`);s&&s.style.opacity==="1"&&this.showPopper({hotspotElement:s,content:o,id:t,keepOpen:i.keepOpen})}createAllHotspots(){this.hotspotsConfig.forEach(t=>this.createHotspot(t))}initHotspots(){this.createAllHotspots()}destroy(){this.hidePopperTimeout&&clearTimeout(this.hidePopperTimeout),this.resizeObserver.disconnect(),this.hidePopper(),this.hotspotElements.clear(),this.hotspotsContainer.innerHTML=""}}const ii=typeof navigator<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);class Wt{constructor(t,i,o){this.container=t,this.isClicked=!1,this.fullscreenView=!!o,this.imagesX=[],this.imagesY=[];const s=Math.round(window.devicePixelRatio||1);this.devicePixelRatio=ii?Math.min(s,2):s,this.id=t.id,this.movementStart={x:0,y:0},this.draggingDirection=null,this.isReady=!1,this.velocityX=0,this.velocityY=0,this.lastDragTime=0,this.lastDragX=0,this.lastDragY=0,this.inertiaAnimationId=null,this.hasInteracted=!1,this.currentZoomScale=1,this.touchDevice=Ho(),this.dragJustEnded=!1,this.isPinching=!1,this.initialPinchDistance=0,this.pinchZoomLevel=1,this.pinchZoomEmitted=!1,this.lastEmittedZoom=1,this.panOffsetX=0,this.panOffsetY=0,this.useMainThreadCanvas=ii,this.canvasWorker=this.useMainThreadCanvas?new zo:new Bo,this.hotspotTimeline=null,this.hotspotTimelineIndicator=null,this.isAnimatingToFrame=!1,this.onMoveHandler=this.onMoveHandler.bind(this),this.destroy=this.destroy.bind(this),this.init(this.container,i)}closeImageBitmaps(t){!t||!Array.isArray(t)||t.forEach(i=>{var o;(o=i==null?void 0:i.bitmapImage)!=null&&o.close&&i.bitmapImage.close()})}emit(t,i={}){const o=this[t];typeof o=="function"&&o({...i,viewerId:this.id})}announce(t){ao(this.ariaLiveRegion,t)}mouseDown(t){if(!this.isReady||this.glass)return;const i=t.target;if(i&&i.closest&&(i.closest(".cloudimage-360-button")||i.closest(".cloudimage-360-hotspot-timeline")||i.closest(".cloudimage-360-hotspot")))return;const{pageX:o,pageY:s}=t;this.hideHints(),this.hideHotspotPopper(),this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null),this.autoplayJustStopped=!1,(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1,this.autoplayJustStopped=!0),this.movementStart={x:o,y:s},this.isClicked=!0,this.isDragging=!1,this.inertia&&(this.velocityX=0,this.velocityY=0,this.lastDragTime=performance.now(),this.lastDragX=o,this.lastDragY=s)}mouseUp(){this.isReady&&(!this.isZoomed&&!this.autoplayJustStopped&&this.showAllIcons(),this.inertia&&this.isDragging&&(Math.abs(this.velocityX)>.1||Math.abs(this.velocityY)>.1)&&this.startInertia(),this.isDragging&&(this.emit("onDragEnd"),this.dragJustEnded=!0),this.movementStart={x:0,y:0},this.isClicked=!1,this.isDragging=!1,this.innerBox.style.cursor="grab")}startInertia(){const o=this.fullscreenView?document.body:this.container,s=this.dragSpeed/be,n=s*(this.amountX/o.offsetWidth),a=s*(this.amountY/o.offsetHeight),r=()=>{if(this.velocityX*=.95,this.velocityY*=.95,Math.abs(this.velocityX)<.01&&Math.abs(this.velocityY)<.01){this.inertiaAnimationId=null;return}const l=this.velocityX*16,c=this.velocityY*16,h=Ye({deltaX:l,deltaY:c,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY});if(h){const p=this.allowSpinX?Math.max(1,Math.abs(Math.round(l*n))):0,f=this.allowSpinY?Math.max(1,Math.abs(Math.round(c*a))):0;(p>0||f>0)&&this.onMoveHandler(h,p,f)}this.inertiaAnimationId=requestAnimationFrame(r)};this.inertiaAnimationId=requestAnimationFrame(r)}drag(t,i){if(!this.isReady||!this.isClicked)return;const o=t-this.movementStart.x,s=i-this.movementStart.y;if(this.inertia){const f=performance.now(),u=f-this.lastDragTime;u>0&&u<100&&(this.velocityX=(t-this.lastDragX)/u,this.velocityY=(i-this.lastDragY)/u),this.lastDragTime=f,this.lastDragX=t,this.lastDragY=i}this.draggingDirection=Ye({deltaX:o,deltaY:s,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY})||this.draggingDirection;const n=this.fullscreenView?document.body:this.container,a=this.dragSpeed/be,r=a*(this.amountX/n.offsetWidth),l=a*(this.amountY/n.offsetHeight),c=this.allowSpinX?Math.abs(Math.round(o*r)):0,h=this.allowSpinY?Math.abs(Math.round(s*l)):0;(this.allowSpinX&&c!==0||this.allowSpinY&&h!==0)&&(this.hasInteracted=!0,this.hideHotspotPopper(),this.onMoveHandler(this.draggingDirection,c,h),this.movementStart={x:t,y:i},setTimeout(()=>{this.isDragging||(this.isDragging=!0,this.emit("onDragStart"))},Ti))}mouseMove(t){!this.isReady||!this.isClicked&&!this.isZoomed||this.glass||(this.isZoomed||this.hideAllIcons(),this.drag(t.pageX,t.pageY),this.isZoomed&&this.applyZoom(t))}mouseClick(t){if(!this.isReady||this.isDragging)return;const i=t.target;if(!(i&&i.closest&&(i.closest(".cloudimage-360-button")||i.closest(".cloudimage-360-hotspot-timeline")||i.closest(".cloudimage-360-hotspot")))){if(this.dragJustEnded){this.dragJustEnded=!1;return}if(this.autoplayJustStopped){this.autoplayJustStopped=!1;return}if(this.glass&&this.magnified){this.removeGlass();return}this.pointerZoomTrigger==="click"&&this.pointerZoom&&!this.glass&&!this.touchDevice&&this.toggleZoom(t)}}mouseDblClick(t){if(!this.isReady)return;const i=t.target;i&&i.closest&&(i.closest(".cloudimage-360-button")||i.closest(".cloudimage-360-hotspot-timeline")||i.closest(".cloudimage-360-hotspot"))||this.pointerZoomTrigger==="dblclick"&&this.pointerZoom&&!this.glass&&!this.touchDevice&&this.toggleZoom(t)}loadHigherQualityImages(t,i){const o=xt(this.srcXConfig,t),s=this.allowSpinY?xt(this.srcYConfig,t):null;xe({cdnPathX:o,cdnPathY:s,configX:this.srcXConfig,configY:this.srcYConfig,onAllImagesLoad:(n,a)=>{this.closeImageBitmaps(this.imagesX),this.closeImageBitmaps(this.imagesY),this.imagesX=n,this.imagesY=a,i()},onError:n=>this.emit("onError",n)})}hideHotspots(){this.hotspotsInstance&&this.hotspotsInstance.hideHotspots()}hideHotspotPopper(){this.hotspotsInstance&&this.hotspotsInstance.forceHidePopper()}toggleZoom(t){if(this.isZoomed)this.showTransitionOverlay(),setTimeout(()=>{this.removeZoom()},Xt);else{let i=(this.fullscreenView||this.pointerZoom?document.body:this.container).offsetWidth;this.hideHotspots(),this.showLoadingSpinner(),this.loadHigherQualityImages(i,()=>{this.showTransitionOverlay(),setTimeout(()=>{this.applyZoom(t)},Xt)})}}removeZoom(){this.isZoomed=!1,this.updateView(),this.showAllIcons(),this.hideZoomOutIcon(),this.hideTransitionOverlay(),this.emit("onZoomOut"),this.announce("Zoomed out")}zoomIn(t){if(this.isZoomed||!this.pointerZoom)return;t==null||t.stopPropagation();let i=(this.fullscreenView||this.pointerZoom?document.body:this.container).offsetWidth;this.hideHotspots(),this.hideAllIcons(),this.showLoadingSpinner(),this.loadHigherQualityImages(i,()=>{this.showTransitionOverlay(),setTimeout(()=>{this.applyZoom(t)},Xt)})}zoomOut(t){this.isZoomed&&(t==null||t.stopPropagation(),this.showTransitionOverlay(),setTimeout(()=>{this.removeZoom()},Xt))}mouseLeave(){this.isZoomed&&this.removeZoom()}applyZoom(t){const{offsetX:i,offsetY:o}=So(t,this.canvas,this.devicePixelRatio);this.isZoomed||(this.isZoomed=!0,this.hideAllIcons(),this.hideLoadingSpinner(),this.hideTransitionOverlay(),this.showZoomOutIcon(),this.emit("onZoomIn",{zoomLevel:this.pointerZoom}),this.announce("Zoomed in. Move mouse to pan. Click to zoom out.")),this.updateView(this.pointerZoom,i,o)}touchOutside(t){if(!this.glass)return;!this.canvas.contains(t.target)&&this.removeGlass()}touchStart(t){if(!this.isReady||this.glass||!t.touches||!t.touches.length)return;const i=t.target;if(i&&i.closest&&(i.closest(".cloudimage-360-button")||i.closest(".cloudimage-360-hotspot-timeline")||i.closest(".cloudimage-360-hotspot")))return;if(this.hideHints(),t.touches.length===2&&this.pinchZoom&&!this.isDragging){t.preventDefault(),this.isPinching=!0,this.isClicked=!1,this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null);const n=t.touches[0],a=t.touches[1];if(this.initialPinchDistance=this.getPinchDistance(n,a),(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),!this.isZoomed&&this.pinchZoomLevel===1){const r=(this.fullscreenView?document.body:this.container).offsetWidth;this.hideHotspots(),this.loadHigherQualityImages(r,()=>{})}return}if(t.touches.length>1)return;const{pageX:o,pageY:s}=t.touches[0];this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null),(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),this.hideAllIcons(),this.hideHotspotPopper(),this.movementStart={x:o,y:s},this.isClicked=!0,this.isDragging=!1,this.inertia&&(this.velocityX=0,this.velocityY=0,this.lastDragTime=performance.now(),this.lastDragX=o,this.lastDragY=s)}getPinchDistance(t,i){const o=t.pageX-i.pageX,s=t.pageY-i.pageY;return Math.sqrt(o*o+s*s)}getPinchCenter(t,i){return{x:(t.pageX+i.pageX)/2,y:(t.pageY+i.pageY)/2}}touchEnd(t){if(this.isReady){if(this.isPinching){if(!t.touches||t.touches.length<2){if(this.isPinching=!1,this.initialPinchDistance=0,this.pinchZoomLevel<=1){const i=this.pinchZoomEmitted;this.pinchZoomLevel=1,this.pinchZoomEmitted=!1,this.lastEmittedZoom=1,this.isZoomed=!1,this.panOffsetX=0,this.panOffsetY=0,this.showAllIcons(),this.updateView(),i&&this.emit("onZoomOut")}else if(this.canvas){const i=this.canvas.getBoundingClientRect();this.panOffsetX=i.width/2*this.devicePixelRatio,this.panOffsetY=i.height/2*this.devicePixelRatio}}return}this.showAllIcons(),this.inertia&&this.isDragging&&(Math.abs(this.velocityX)>.1||Math.abs(this.velocityY)>.1)&&this.startInertia(),this.movementStart={x:0,y:0},this.isClicked=!1,this.isDragging=!1}}touchMove(t){if(!this.isReady||this.glass)return;if(this.isPinching&&t.touches.length===2){t.preventDefault();const s=t.touches[0],n=t.touches[1],a=this.getPinchDistance(s,n);if(this.initialPinchDistance===0){this.initialPinchDistance=a;return}const r=a/this.initialPinchDistance,l=Math.max(1,Math.min(this.pinchZoomLevel*r,ye));if(this.initialPinchDistance=a,this.pinchZoomLevel=l,!this.canvas)return;const c=this.canvas.getBoundingClientRect(),h=c.width/2*this.devicePixelRatio,p=c.height/2*this.devicePixelRatio;l>1?(this.isZoomed=!0,this.hideAllIcons(),this.updateView(l,h,p),(!this.pinchZoomEmitted||l>this.lastEmittedZoom)&&(this.emit("onZoomIn",{zoomLevel:l}),this.pinchZoomEmitted=!0,this.lastEmittedZoom=l)):(this.isZoomed=!1,this.panOffsetX=0,this.panOffsetY=0,this.updateView());return}if(!this.isClicked||!t.touches||!t.touches[0])return;const{pageX:i,pageY:o}=t.touches[0];if(t.preventDefault(),this.isZoomed&&this.pinchZoomLevel>1){const s=i-this.movementStart.x,n=o-this.movementStart.y;this.panOffsetX-=s*this.devicePixelRatio,this.panOffsetY-=n*this.devicePixelRatio,this.movementStart={x:i,y:o},this.updateView(this.pinchZoomLevel,this.panOffsetX,this.panOffsetY);return}this.drag(i,o)}keyDown(t){if(!this.isReady)return;const{keyCode:i}=t,o=this.keysReverse;switch(this.autoplay&&this.stopAutoplay(),Pe(i,this.allowSpinY)&&(this.hasInteracted=!0,this.hideAllIcons(),this.hideHints()),i){case 37:o?this.moveLeft():this.moveRight();break;case 39:o?this.moveRight():this.moveLeft();break;case 38:this.allowSpinY&&(t.preventDefault(),o?this.moveTop():this.moveBottom());break;case 40:this.allowSpinY&&(t.preventDefault(),o?this.moveBottom():this.moveTop());break}}keyUp(t){const{keyCode:i}=t;Pe(i,this.allowSpinY)&&this.showAllIcons()}moveActiveXIndexUp(t){this.orientation=M.X,this.activeImageX=(this.activeImageX+t)%this.amountX}moveActiveXIndexDown(t){this.orientation=M.X,this.activeImageX=(this.activeImageX-t+this.amountX)%this.amountX}moveActiveYIndexUp(t){this.orientation=M.Y,this.activeImageY=(this.activeImageY+t)%this.amountY}moveActiveYIndexDown(t){this.orientation=M.Y,this.activeImageY=(this.activeImageY-t+this.amountY)%this.amountY}moveRight(t,i=1){t&&this.activeImageX>=this.imagesX.length-1||(this.moveActiveXIndexUp(i),this.isZoomed||this.updateView())}moveLeft(t,i=1){t&&this.activeImageX<=0||(this.moveActiveXIndexDown(i),this.isZoomed||this.updateView())}moveTop(t,i=1){t&&this.activeImageY>=this.imagesY.length-1||(this.moveActiveYIndexUp(i),this.isZoomed||this.updateView())}moveBottom(t,i=1){t&&this.activeImageY<=0||(this.moveActiveYIndexDown(i),this.isZoomed||this.updateView())}onMoveHandler(t,i=1,o=1){t==="right"?this.moveRight(this.stopAtEdges,i):t==="left"?this.moveLeft(this.stopAtEdges,i):t==="up"?this.moveTop(this.stopAtEdges,o):t==="down"&&this.moveBottom(this.stopAtEdges,o),this.emit("onSpin",{direction:t,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY})}updateView(t,i,o){const s=this.orientation===M.X?this.activeImageX:this.activeImageY,n=this.orientation===M.X?this.imagesX[this.activeImageX]:this.imagesY[this.activeImageY];this.hotspotsInstance&&!this.isZoomed&&!this.autoplay&&this.hotspotsInstance.updateHotspotPosition(s,this.orientation),this.hotspotTimelineIndicator&&this.orientation===M.X&&this.updateHotspotTimelinePosition(),this.drawImageOnCanvas(n,t,i,o)}updatePercentageInLoader(t=0){this.loader&&(this.loader.innerText=t+"%")}adaptCanvasSize(t){const{naturalWidth:i,naturalHeight:o}=t;this.imageAspectRatio=i/o;const s=this.fullscreenView?window.innerWidth:this.canvas.clientWidth,n=this.fullscreenView?window.innerHeight:this.canvas.clientHeight;this.canvasWorker.postMessage({action:"adaptCanvasSize",devicePixelRatio:this.devicePixelRatio,imageAspectRatio:this.imageAspectRatio,containerWidth:s,containerHeight:n})}drawImageOnCanvas(t,i=1,o=0,s=0){this.pendingDrawData={imageData:t,zoomScale:i,pointerX:o,pointerY:s},this.drawFrameRequested||(this.drawFrameRequested=!0,requestAnimationFrame(()=>{if(this.drawFrameRequested=!1,this.pendingDrawData){const{imageData:n,zoomScale:a,pointerX:r,pointerY:l}=this.pendingDrawData;this.canvasWorker.postMessage({action:"drawImageOnCanvas",imageData:n,zoomScale:a,pointerX:r,pointerY:l})}}))}pushImageToSet(t,i,o){o===M.X?this.imagesX[i]=t:this.imagesY[i]=t}calculatePercentage(){const t=this.amountX+this.amountY,i=this.imagesX.length+this.imagesY.length;return Math.round(i/t*100)}onImageLoad(t,i,o){this.pushImageToSet(t,i,o),this.updatePercentageInLoader(this.calculatePercentage())}onFirstImageLoaded(t,i){this.createContainers(t),this.adaptCanvasSize(i),this.drawImageOnCanvas(i)}onAllImagesLoaded(){if(this.addAllIcons(),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.hotspots&&(this.hotspotsInstance=new an(this.hotspots,this.innerBox,this.imageAspectRatio,{trigger:this.hotspotTrigger}),this.hotspotsInstance.updateHotspotPosition(this.activeImageX,this.orientation),this.addHotspotTimeline(),this.showHotspotTimeline()),this.emit("onLoad",{imagesX:this.imagesX.length,imagesY:this.imagesY.length}),this.emit("onReady"),this.announce("360 degree view loaded. Use mouse drag or arrow keys to rotate."),this.hints!==!1&&!this.autoplay){const t=this.hints===!0||this.hints===void 0?Ee(this.viewerConfig,this.touchDevice):this.hints;t&&t.length>0&&(this.hintsOverlay=ke(this.innerBox,t,{pointerZoomTrigger:this.pointerZoomTrigger}),Ae(this.hintsOverlay))}this.autoplay&&(this.hideAllIcons(),Zo(this.play.bind(this))())}magnify(t){t.stopPropagation();const{src:i}=this.orientation===M.Y?this.imagesY[this.activeImageY]:this.imagesX[this.activeImageX],s=(this.fullscreenView?document.body:this.container).offsetWidth*this.magnifier,n=Wi(i,s);this.showLoadingSpinner(),this.createGlass(),ko(n,l=>{this.hideLoadingSpinner(),this.magnified=!0,Ao(t,this.innerBox,this.offset,l,this.glass,this.magnifier)},l=>{this.hideLoadingSpinner(),this.removeGlass(),this.emit("onError",{error:{message:l.message,url:l.url},errorCount:1,totalImages:1,errors:[{message:l.message,url:l.url}]})})}openFullscreenModal(t){t.stopPropagation(),this.hideHotspotPopper(),this.releaseMemory(),window.document.body.style.overflow="hidden";const i=io(this.container);this.fullscreenInstance=new Wt(i,this.viewerConfig,!0),this.fullscreenInstance.originalViewer=this,this.boundResizeHandler=()=>{this.fullscreenInstance&&this.closeFullscreenModal(new Event("resize"))},window.addEventListener("resize",this.boundResizeHandler),this.emit("onFullscreenOpen"),this.announce("Opened fullscreen mode. Press Escape to exit.")}closeFullscreenModal(t){t.stopPropagation();const i=this.originalViewer||this,o=this.fullscreenView?this:i.fullscreenInstance;if(i.boundResizeHandler&&(window.removeEventListener("resize",i.boundResizeHandler),i.boundResizeHandler=null),o){o.hideHotspotPopper();const s=o.container.parentNode;s&&s.parentNode&&s.parentNode.removeChild(s),o.destroy(),i.fullscreenInstance&&(i.fullscreenInstance=null)}window.document.body.style.overflow="visible",i.reloadImages(),i.emit("onFullscreenClose"),i.announce("Exited fullscreen mode")}play(){if(this.isClicked)return;this.hide360ViewCircleIcon(),this.emit("onAutoplayStart");const t=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&&Po({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse})){this.stopAutoplay();return}Yo({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse,spinDirection:this.spinDirection})&&(this.spinDirection=Xo(this.spinDirection));const n=this.spinDirection==="y";Mo({autoplayBehavior:this.autoplayBehavior,spinY:n,reversed:this.autoplayReverse,loopTriggers:i})},t)}stopAutoplay(){if(this.showAllIcons(),this.autoplay=!1,window.clearTimeout(this.loopTimeoutId),this.loopTimeoutId=null,this.emit("onAutoplayStop"),this.hints!==!1&&!this.hintsOverlay&&!this.hintsHidden){const t=this.hints===!0?Ee(this.viewerConfig,this.touchDevice):this.hints;t&&t.length>0&&(this.hintsOverlay=ke(this.innerBox,t,{pointerZoomTrigger:this.pointerZoomTrigger}),Ae(this.hintsOverlay))}}destroy(){this.stopAutoplay(),this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null),this.removeEvents(),this.closeImageBitmaps(this.imagesX),this.closeImageBitmaps(this.imagesY),this.imagesX=[],this.imagesY=[],this.canvasWorker&&(this.canvasWorker.terminate(),this.canvasWorker=null),this.hotspotsInstance&&this.hotspotsInstance.destroy(),this.hintsOverlay&&this.hintsOverlay.parentNode&&(this.hintsOverlay.parentNode.removeChild(this.hintsOverlay),this.hintsOverlay=null),this.hotspotTimeline&&this.hotspotTimeline.parentNode&&(this.hotspotTimeline.parentNode.removeChild(this.hotspotTimeline),this.hotspotTimeline=null,this.hotspotTimelineIndicator=null),this.innerBox&&this.innerBox.classList.remove("has-hotspot-timeline"),this.container&&(this.container.classList.remove("ci360-theme-dark"),this.container.innerHTML="")}releaseMemory(){this.stopAutoplay(),this.closeImageBitmaps(this.imagesX),this.closeImageBitmaps(this.imagesY),this.imagesX=[],this.imagesY=[],this.isMemoryReleased=!0}reloadImages(){if(!this.isMemoryReleased)return;this.isMemoryReleased=!1;const t=this.container.offsetWidth;this.loadHigherQualityImages(t,()=>{this.updateView()})}addInitialIcon(){this.initialIcon||this.hide360Logo||(this.initialIcon=Gi(this.logoSrc),this.innerBox.appendChild(this.initialIcon))}showInitialIcon(){!this.initialIcon||this.hasInteracted||(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.pointerZoom&&(this.magnifierIcon=Qi(),this.magnifierIcon.onclick=this.zoomIn.bind(this),this.iconsContainer.appendChild(this.magnifierIcon),this.zoomOutIcon=to(),this.zoomOutIcon.onclick=this.zoomOut.bind(this),this.zoomOutIcon.style.display="none",this.iconsContainer.appendChild(this.zoomOutIcon))}showMagnifierIcon(){this.magnifierIcon&&(this.magnifierIcon.style.display="",this.magnifierIcon.style.visibility="visible",this.magnifierIcon.style.opacity=1)}hideMagnifierIcon(){this.magnifierIcon&&(this.magnifierIcon.style.display="none",this.magnifierIcon.style.visibility="hidden",this.magnifierIcon.style.opacity=0)}showZoomOutIcon(){this.zoomOutIcon&&(this.zoomOutIcon.style.display="",this.zoomOutIcon.style.visibility="visible",this.zoomOutIcon.style.opacity=1)}hideZoomOutIcon(){this.zoomOutIcon&&(this.zoomOutIcon.style.display="none",this.zoomOutIcon.style.visibility="hidden",this.zoomOutIcon.style.opacity=0)}addFullscreenIcon(){this.fullscreen&&(this.fullscreenIcon=qi(),this.fullscreenIcon.onclick=this.openFullscreenModal.bind(this),this.iconsContainer.appendChild(this.fullscreenIcon))}addCloseFullscreenIcon(){this.fullscreenCloseIcon=Ki(),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=ji(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=oo(),this.innerBox.appendChild(this.loadingSpinner)}showLoadingSpinner(){this.loadingSpinner&&(this.hideAllIcons(),this.loadingSpinner.style.opacity=1)}createTransitionOverlay(){this.transitionOverlay=so(),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)}hideHints(){!this.hintsOverlay||this.hintsHidden||(this.hintsHidden=!0,co(this.hintsOverlay))}addHotspotTimeline(){if(!this.hotspots||this.hotspotTimeline)return;const t=fo(this.innerBox,this.amountX,this.hotspots);if(!t)return;this.hotspotTimeline=t.element,this.hotspotTimelineIndicator=t.indicator,this.innerBox.classList.add("has-hotspot-timeline"),this.hotspotTimeline.querySelectorAll(".cloudimage-360-hotspot-timeline-dot").forEach(o=>{o.addEventListener("click",s=>{s.stopPropagation(),this.hideAllIcons(),this.hideHints();const n=parseInt(o.getAttribute("data-frame"),10),a=o.getAttribute("data-hotspot-id");isNaN(n)||this.animateToFrame(n,a)})}),this.updateHotspotTimelinePosition()}showHotspotTimeline(){vo(this.hotspotTimeline)}hideHotspotTimeline(){bo(this.hotspotTimeline)}updateHotspotTimelinePosition(){go(this.hotspotTimelineIndicator,this.activeImageX,this.amountX)}animateToFrame(t,i){if(this.hotspotsInstance&&this.hotspotsInstance.hidePopper(),this.isAnimatingToFrame||t===this.activeImageX){t===this.activeImageX&&i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&this.hotspotsInstance.showHotspotById(i);return}this.isAnimatingToFrame=!0,this.hasInteracted=!0,(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null);const o=this.activeImageX,s=(t-o+this.amountX)%this.amountX,n=(o-t+this.amountX)%this.amountX,a=s<=n,r=a?s:n;if(r===0){this.isAnimatingToFrame=!1;return}const l=30;let c=r;const h=()=>{if(c<=0){this.isAnimatingToFrame=!1,i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&setTimeout(()=>{this.hotspotsInstance.showHotspotById(i)},50);return}a?this.moveRight():this.moveLeft(),c--,c>0?setTimeout(h,l):(this.isAnimatingToFrame=!1,i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&setTimeout(()=>{this.hotspotsInstance.showHotspotById(i)},50))};h()}remove360ViewCircleIcon(){this.view360CircleIcon&&(this.innerBox.removeChild(this.view360CircleIcon),this.view360CircleIcon=null)}addAllIcons(){this.removeLoader(),this.iconsContainer&&(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(),this.showHotspotTimeline()}hideAllIcons(){this.hideInitialIcon(),this.hide360ViewCircleIcon(),this.hideMagnifierIcon(),this.hideZoomOutIcon(),this.hideFullscreenIcon()}removeLoader(){this.loader&&(this.innerBox.removeChild(this.loader),this.loader=null)}attachEvents(t,i,o){t&&this.addMouseEvents(),i&&this.addTouchEvents(),o&&this.addKeyboardEvents(),this.addEscKeyHandler()}removeEvents(){this.removeMouseEvents(),this.removeTouchEvents(),this.removeKeyboardEvents(),this.removeEscKeyHandler()}addMouseEvents(){this.boundMouseClick=this.mouseClick.bind(this),this.boundMouseDblClick=this.mouseDblClick.bind(this),this.boundMouseDown=this.mouseDown.bind(this),this.boundMouseMove=ge(this.mouseMove.bind(this),ve),this.boundMouseUp=this.mouseUp.bind(this),this.boundMouseLeave=this.mouseLeave.bind(this),this.innerBox.addEventListener("click",this.boundMouseClick),this.innerBox.addEventListener("dblclick",this.boundMouseDblClick),this.innerBox.addEventListener("mousedown",this.boundMouseDown),this.innerBox.addEventListener("mouseleave",this.boundMouseLeave),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=ge(this.touchMove.bind(this),ve),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)}addEscKeyHandler(){this.boundEscHandler=t=>{t.keyCode===27&&(this.fullscreenView?this.closeFullscreenModal(t):this.isZoomed?this.removeZoom():this.glass&&this.removeGlass())},document.addEventListener("keydown",this.boundEscHandler)}removeEscKeyHandler(){document.removeEventListener("keydown",this.boundEscHandler)}removeMouseEvents(){this.innerBox.removeEventListener("click",this.boundMouseClick),this.innerBox.removeEventListener("dblclick",this.boundMouseDblClick),this.innerBox.removeEventListener("mousedown",this.boundMouseDown),this.innerBox.removeEventListener("mouseleave",this.boundMouseLeave),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(t){if(this.iconsContainer=Ie(this.innerBox),this.canvas=Ui(this.innerBox,t),this.loader=eo(this.innerBox),this.ariaLiveRegion=ro(this.innerBox),this.useMainThreadCanvas)this.canvasWorker.postMessage({action:"initCanvas",offscreen:this.canvas,devicePixelRatio:this.devicePixelRatio});else{const i=this.canvas.transferControlToOffscreen();this.canvasWorker.postMessage({action:"initCanvas",offscreen:i,devicePixelRatio:this.devicePixelRatio},[i])}this.fullscreenView&&this.addCloseFullscreenIcon(),Gt(this.innerBox,".cloudimage-360-placeholder")}update(t){this.isReady&&(this.stopAutoplay(),Gt(this.innerBox,".cloudimage-360-icons-container"),this.init(this.container,t,!0),this.iconsContainer=Ie(this.innerBox),this.onAllImagesLoaded())}init(t,i,o){const s=i?Hi(i):Ri(t),{folder:n,apiVersion:a,filenameX:r,filenameY:l,imageListX:c,imageListY:h,indexZeroBase:p,amountX:f,amountY:u,draggable:x=!0,swipeable:y=!0,keys:g,keysReverse:O,bottomCircleOffset:k,autoplay:w,autoplayBehavior:b,playOnce:C,speed:m,autoplayReverse:v,fullscreen:I,magnifier:E,ciToken:A,ciFilters:T,ciTransformation:X,lazyload:L,dragSpeed:G,stopAtEdges:U,pointerZoom:Y,pointerZoomTrigger:B="dblclick",imageInfo:dt="black",initialIconShown:K,bottomCircle:pt,hotspots:Lt,hotspotTrigger:st="hover",dragReverse:ut,hide360Logo:et,logoSrc:j,inertia:nt,pinchZoom:mt,hints:q,theme:ft,hotspotTimelineOnClick:ae=!0,aspectRatio:gt,onReady:le,onLoad:Ft,onSpin:ce,onAutoplayStart:he,onAutoplayStop:Vt,onFullscreenOpen:Nt,onFullscreenClose:de,onZoomIn:pe,onZoomOut:J,onDragStart:vt,onDragEnd:$t,onError:jt}=s,bt={ciToken:A,ciFilters:T,ciTransformation:X},yt=Ut(c,[]),wt=Ut(h,[]);if(this.viewerConfig=s,this.amountX=yt.length||f,this.amountY=wt.length||u,this.allowSpinX=!!this.amountX,this.allowSpinY=!!this.amountY,this.activeImageX=v?this.amountX-1:0,this.activeImageY=v?this.amountY-1:0,this.bottomCircleOffset=k,this.autoplay=w,this.autoplayBehavior=b,this.playOnce=C,this.speed=m,this.autoplayReverse=v,this.fullscreen=I,this.magnifier=E>1?Math.min(E,Yi):0,this.dragSpeed=Math.max(G,Pi),this.stopAtEdges=U,this.ciParams=bt,this.apiVersion=a,this.pointerZoom=Y>1?Math.min(Y,ye):null,this.pointerZoomTrigger=B,this.keysReverse=O,this.info=dt,this.keys=g,this.innerBox=this.innerBox??Ji(this.container),gt&&(this.container.style.aspectRatio=gt),this.initialIconShown=K,this.bottomCircle=pt,this.spinDirection=Ro(this.autoplayBehavior,this.allowSpinX,this.allowSpinY),this.dragReverse=ut,this.hotspots=Lt,this.hotspotTrigger=st,this.hide360Logo=et,this.logoSrc=j,this.inertia=nt,this.pinchZoom=mt,this.hints=q,this.hotspotTimelineOnClick=ae,ft==="dark"?this.container.classList.add("ci360-theme-dark"):ft==="light"&&this.container.classList.remove("ci360-theme-dark"),this.onReady=le,this.onLoad=Ft,this.onSpin=ce,this.onAutoplayStart=he,this.onAutoplayStop=Vt,this.onFullscreenOpen=Nt,this.onFullscreenClose=de,this.onZoomIn=pe,this.onZoomOut=J,this.onDragStart=vt,this.onDragEnd=$t,this.onError=jt,this.srcXConfig={folder:n,filename:r,imageList:yt,container:t,innerBox:this.innerBox,apiVersion:a,ciParams:bt,lazyload:L,amount:this.amountX,indexZeroBase:p,autoplayReverse:v,orientation:M.X},this.srcYConfig={...this.srcXConfig,filename:l,imageList:wt,orientation:M.Y,amount:this.amountY},o&&this.removeEvents(),this.attachEvents(x,y,g),o)return;const Mt=(this.fullscreenView?document.body:this.container).offsetWidth,Pt=this.allowSpinX&&!yt.length?xt(this.srcXConfig,Mt):null,ni=this.allowSpinY&&!wt.length?xt(this.srcYConfig,Mt):null,ri=ln=>{xe({cdnPathX:Pt,cdnPathY:ni,configX:this.srcXConfig,configY:this.srcYConfig,onImageLoad:(Yt,cn,hn)=>this.onImageLoad(Yt,cn,hn),onFirstImageLoad:Yt=>this.onFirstImageLoaded(ln,Yt),onAllImagesLoad:this.onAllImagesLoaded.bind(this),onError:Yt=>this.emit("onError",Yt)})};this.allowSpinX?Te(Pt,this.srcXConfig,ri):this.allowSpinY&&Te(ni,this.srcYConfig,ri)}}const oi=typeof navigator<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);class si{constructor(){this.views=new Map,this.initAll=this.initAll.bind(this),this.getViews=this.getViews.bind(this),this.memoryObserver=null,this.memoryManagementAutoEnabled=!1}generateId(){return`ci360-${Math.random().toString(36).slice(2,11)}`}init(t,i,o){if(!t)return;const s=t.id||this.generateId();t.id||(t.id=s);const n=new Wt(t,i,o);return this.views.set(s,n),oi&&!this.memoryManagementAutoEnabled&&(this.memoryManagementAutoEnabled=!0,setTimeout(()=>this.enableMemoryManagement(),100)),n}initAll(t="cloudimage-360"){[...document.querySelectorAll(`.${t}`)].filter(Boolean).forEach(o=>{const s=o.id||this.generateId();o.id||(o.id=s);const n=new Wt(o);this.views.set(s,n)}),oi&&!this.memoryManagementAutoEnabled&&this.views.size>0&&(this.memoryManagementAutoEnabled=!0,setTimeout(()=>this.enableMemoryManagement(),100))}destroy(t){const i=this.getViewById(t);i&&(i.destroy(),this.views.delete(t))}destroyAll(){this.views.forEach(t=>{t.destroy()}),this.views.clear()}getViewById(t){return this.views.get(t)}getViews(){return Array.from(this.views.values())}updateView(t,i){const o=this.getViewById(t);if(!o)return null;const s={...o.viewerConfig,...i};o.destroy();const n=document.getElementById(t);return this.init(n,s)}enableMemoryManagement(t={}){this.memoryObserver&&this.memoryObserver.disconnect();const i=t.rootMargin||"200px";this.memoryObserver=new IntersectionObserver(o=>{o.forEach(s=>{const n=this.getViewById(s.target.id);n&&(s.isIntersecting?n.isMemoryReleased&&n.reloadImages():!n.isMemoryReleased&&n.isReady&&n.releaseMemory())})},{rootMargin:i}),this.views.forEach((o,s)=>{const n=document.getElementById(s);n&&this.memoryObserver.observe(n)}),this.boundVisibilityHandler=()=>{document.hidden?this.views.forEach(o=>{!o.isMemoryReleased&&o.isReady&&o.releaseMemory()}):this.views.forEach((o,s)=>{if(o.isMemoryReleased){const n=document.getElementById(s);if(n){const a=n.getBoundingClientRect();a.top<window.innerHeight&&a.bottom>0&&o.reloadImages()}}})},document.addEventListener("visibilitychange",this.boundVisibilityHandler)}disableMemoryManagement(){this.memoryObserver&&(this.memoryObserver.disconnect(),this.memoryObserver=null),this.boundVisibilityHandler&&(document.removeEventListener("visibilitychange",this.boundVisibilityHandler),this.boundVisibilityHandler=null)}}return window.CI360=si,si}();
65
+ `,o},Te=(e,t,i)=>{const{innerBox:o,imageList:s,lazyload:n}=t||{},[l]=s,a=l||Eo(e,t),r=Co(a),c=Se(r,n,"cloudimage-lazy"),h=Se(r,!1,"cloudimage-360-placeholder"),p=f=>{Ut(o,".cloudimage-lazy"),i&&i({event:f,width:c.width,height:c.height,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight,src:r})};c.onload=p,o.appendChild(c),o.appendChild(h),Io(c)},Ao=(e,t,i)=>{const o=new Image;o.src=e,o.onload=s=>{t&&t({event:s,width:o.width,height:o.height,naturalWidth:o.naturalWidth,naturalHeight:o.naturalHeight,src:e})},o.onerror=s=>{const n=new Error(`Failed to load image: ${e}`);n.url=e,n.event=s,i?i(n):console.error(n.message)}},So=(e,t)=>{const i=t.getBoundingClientRect(),o=e.touches?e.touches[0].clientX:e.clientX,s=e.touches?e.touches[0].clientY:e.clientY;return{x:o-i.left,y:s-i.top}},qt=(e,t,i)=>{const{container:o,w:s,h:n,zoom:l,bw:a,offsetX:r,offsetY:c}=t,h=So(e,o);let p=h.x,f=h.y;p=Math.max(s/l,Math.min(p,o.offsetWidth-s/l)),f=Math.max(n/l,Math.min(f,o.offsetHeight-n/l)),i.style.left=`${p-s}px`,i.style.top=`${f-n}px`;const u=(p-r)*l-s+a,x=(f-c)*l-n+a;i.style.backgroundPosition=`-${u}px -${x}px`},To=(e,t,i,o,s,n)=>{const{x:l=0,y:a=0}=i||{},r=(t.offsetWidth-l*2)*n,c=(t.offsetHeight-a*2)*n;if(!s)return;s.setAttribute("class","cloudimage-360-img-magnifier-glass"),t.prepend(s),s.style.backgroundImage=`url('${o.src}')`,s.style.backgroundSize=`${r}px ${c}px`;const h=3,p=s.offsetWidth/2,f=s.offsetHeight/2,u={container:t,w:p,h:f,zoom:n,bw:h,offsetX:l,offsetY:a};qt(e,u,s);const x=g=>{qt(g,u,s)},y=g=>{g.preventDefault(),qt(g,u,s)};s.addEventListener("mousemove",x),t.addEventListener("mousemove",x),t.addEventListener("touchmove",y)},Lo=(e,t,i)=>{const{clientX:o,clientY:s}=e,n=t.getBoundingClientRect(),l=t.width/(n.width*i),a=t.height/(n.height*i),r=(o-n.left)*l,c=(s-n.top)*a;return{offsetX:r,offsetY:c}},Po=(e,t,i)=>{const o=e/i,s=t/i;return{zoomedWidth:o,zoomedHeight:s}},Mo=({pointerX:e,pointerY:t,imageData:i,zoomedWidth:o,zoomedHeight:s,drawWidth:n,drawHeight:l})=>{const{naturalWidth:a,naturalHeight:r}=i;let c=e/n*a-o/2,h=t/l*r-s/2;const p=Math.max(0,a-o),f=Math.max(0,r-s);return c=Math.max(0,Math.min(c,p)),h=Math.max(0,Math.min(h,f)),{zoomOffsetX:c,zoomOffsetY:h}},Le=(e,{bottom:t,top:i})=>{e?t():i()},Pe=(e,{left:t,right:i})=>{e?t():i()},Yo=({autoplayBehavior:e,spinY:t,reversed:i,loopTriggers:o})=>{switch(e){case R.SPIN_XY:case R.SPIN_YX:t?Le(i,o):Pe(i,o);break;case R.SPIN_Y:Le(i,o);break;case R.SPIN_X:default:Pe(i,o)}},Ro=({autoplayBehavior:e,activeImageX:t,activeImageY:i,amountX:o,amountY:s,autoplayReverse:n})=>{const l=(a,r)=>{const c=r-1;return n?a===0:a===c};switch(e){case R.SPIN_XY:case R.SPIN_Y:return l(i,s);case R.SPIN_X:case R.SPIN_YX:default:return l(t,o)}},Xo=({autoplayBehavior:e,activeImageX:t,activeImageY:i,amountX:o,amountY:s,autoplayReverse:n,spinDirection:l})=>{const a=t===(n?0:o-1),r=i===(n?0:s-1);return e===R.SPIN_XY||e===R.SPIN_YX?l==="x"&&a||l==="y"&&r:!1},Ho=(e,t,i)=>{if(!i)return"x";if(!t)return"y";switch(e){case R.SPIN_XY:return"x";case R.SPIN_YX:return"y";case R.SPIN_Y:return"y";case R.SPIN_X:default:return"x"}},Zo=e=>e==="x"?"y":"x",Me=(e,t)=>{const i=[...Ti];return t?[...i,...Li].includes(e):i.includes(e)},Ye=({deltaX:e,deltaY:t,reversed:i,allowSpinX:o,allowSpinY:s,threshold:n=0})=>{const l=o&&!s||s&&!o?0:n,a=Math.abs(e),r=Math.abs(t);return o&&a-l>r?i?e>0?"left":"right":e>0?"right":"left":s&&r-l>a?i?t>0?"up":"down":t>0?"down":"up":null},Do=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,zo=(e,t=150)=>{let i;return function(...o){clearTimeout(i),i=setTimeout(()=>{e.apply(this,o)},t)}},Re="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHY9KHQsYSxlKT0+e2NvbnN0IHM9dC9lLG49YS9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sej0oe3BvaW50ZXJYOnQscG9pbnRlclk6YSxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOmcsbmF0dXJhbEhlaWdodDp1fT1lO2xldCBmPXQvaSpnLXMvMixtPWEvYyp1LW4vMjtjb25zdCB4PU1hdGgubWF4KDAsZy1zKSxPPU1hdGgubWF4KDAsdS1uKTtyZXR1cm4gZj1NYXRoLm1heCgwLE1hdGgubWluKGYseCkpLG09TWF0aC5tYXgoMCxNYXRoLm1pbihtLE8pKSx7em9vbU9mZnNldFg6Zix6b29tT2Zmc2V0WTptfX07bGV0IG8saCxyLGQsbCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIHQ9Pntjb25zdHthY3Rpb246YSxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpnLGltYWdlQXNwZWN0UmF0aW86dSxjb250YWluZXJXaWR0aDpmLGNvbnRhaW5lckhlaWdodDptfT10LmRhdGE7c3dpdGNoKGEpe2Nhc2UiaW5pdENhbnZhcyI6QyhlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjpwKHUsZixtKTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpJKG4saSxjLGcpO2JyZWFrfX07Y29uc3QgQz0odCxhKT0+e289dCxoPW8uZ2V0Q29udGV4dCgiMmQiKSxyPWF9LHA9KHQsYSxlKT0+e2NvbnN0IHM9YS9lO3c9dD5zLG8ud2lkdGg9YSpyLG8uaGVpZ2h0PWUqcixoLnNjYWxlKHIsciksdz8oZD1hLGw9YS90KToobD1lLGQ9ZSp0KSxoLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxoLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEk9KHQ9e30sYT0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09dDtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L3ItbCkvMik6KGk9KG8ud2lkdGgvci1kKS8yLGM9MCksaC5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLGEhPT0xKXtjb25zdHtuYXR1cmFsV2lkdGg6ZyxuYXR1cmFsSGVpZ2h0OnV9PXQse3pvb21lZFdpZHRoOmYsem9vbWVkSGVpZ2h0Om19PXYoZyx1LGEpLHt6b29tT2Zmc2V0WDp4LHpvb21PZmZzZXRZOk99PXooe3BvaW50ZXJYOmUscG9pbnRlclk6cyxpbWFnZURhdGE6dCx6b29tZWRXaWR0aDpmLHpvb21lZEhlaWdodDptLGRyYXdXaWR0aDpkLGRyYXdIZWlnaHQ6bH0pO2guZHJhd0ltYWdlKG4seCxPLGYsbSxpLGMsZCxsKX1lbHNlIGguZHJhd0ltYWdlKG4saSxjLGQsbCl9fSkoKTsK",Bo=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),Xe=typeof self<"u"&&self.Blob&&new Blob([Bo(Re)],{type:"text/javascript;charset=utf-8"});function Wo(e){let t;try{if(t=Xe&&(self.URL||self.webkitURL).createObjectURL(Xe),!t)throw"";const i=new Worker(t,{name:e==null?void 0:e.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),i}catch{return new Worker("data:text/javascript;base64,"+Re,{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Fo{constructor(){this.canvas=null,this.ctx=null,this.dpr=1,this.drawWidth=0,this.drawHeight=0,this.wideImage=!1}postMessage(t){const{action:i,offscreen:o,devicePixelRatio:s,imageData:n,zoomScale:l,pointerX:a,pointerY:r,imageAspectRatio:c,containerWidth:h,containerHeight:p}=t;switch(i){case"initCanvas":this.initCanvas(o,s);break;case"adaptCanvasSize":this.adaptCanvasSize(c,h,p);break;case"drawImageOnCanvas":this.drawImageOnCanvas(n,l,a,r);break}}terminate(){var t,i;this.ctx&&this.ctx.clearRect(0,0,((t=this.canvas)==null?void 0:t.width)||0,((i=this.canvas)==null?void 0:i.height)||0),this.canvas=null,this.ctx=null}initCanvas(t,i){this.canvas=t,this.ctx=t.getContext("2d"),this.dpr=i}adaptCanvasSize(t,i,o){if(!this.canvas||!this.ctx)return;const s=i/o;this.wideImage=t>s,this.canvas.width=i*this.dpr,this.canvas.height=o*this.dpr,this.ctx.scale(this.dpr,this.dpr),this.wideImage?(this.drawWidth=i,this.drawHeight=i/t):(this.drawHeight=o,this.drawWidth=o*t),this.ctx.imageSmoothingEnabled=!0,this.ctx.imageSmoothingQuality="high"}drawImageOnCanvas(t={},i=1,o=0,s=0){const{bitmapImage:n}=t;if(!this.canvas||!this.ctx||!n)return;let l,a;if(this.wideImage?(l=0,a=(this.canvas.height/this.dpr-this.drawHeight)/2):(l=(this.canvas.width/this.dpr-this.drawWidth)/2,a=0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),i!==1){const{naturalWidth:r,naturalHeight:c}=t,{zoomedWidth:h,zoomedHeight:p}=Po(r,c,i),{zoomOffsetX:f,zoomOffsetY:u}=Mo({pointerX:o,pointerY:s,imageData:t,zoomedWidth:h,zoomedHeight:p,drawWidth:this.drawWidth,drawHeight:this.drawHeight});this.ctx.drawImage(n,f,u,h,p,l,a,this.drawWidth,this.drawHeight)}else this.ctx.drawImage(n,l,a,this.drawWidth,this.drawHeight)}}const Vo=new Set(["p","span","div","br","hr","strong","em","b","i","u","s","h1","h2","h3","h4","h5","h6","ul","ol","li","a","img","button","table","thead","tbody","tr","th","td","blockquote","pre","code","label","input","select","option","textarea","svg","path","circle","rect","line","polyline","polygon","ellipse","g","text","tspan","defs","use","symbol","clippath","mask","lineargradient","radialgradient","stop"]),He={a:["href","title","target","rel"],img:["src","alt","title","width","height"],button:["type","disabled","name","value"],input:["type","name","value","placeholder","disabled","readonly","checked","min","max","step"],select:["name","disabled","multiple"],option:["value","disabled","selected"],textarea:["name","placeholder","disabled","readonly","rows","cols"],label:["for"],svg:["viewbox","width","height","fill","stroke","xmlns","preserveaspectratio"],path:["d","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","transform"],circle:["cx","cy","r","fill","stroke","stroke-width"],rect:["x","y","width","height","rx","ry","fill","stroke","stroke-width"],line:["x1","y1","x2","y2","stroke","stroke-width"],polyline:["points","fill","stroke","stroke-width"],polygon:["points","fill","stroke","stroke-width"],ellipse:["cx","cy","rx","ry","fill","stroke","stroke-width"],g:["transform","fill","stroke"],text:["x","y","dx","dy","text-anchor","fill","font-size","font-family","font-weight"],tspan:["x","y","dx","dy"],use:["href","xlink:href","x","y","width","height"],lineargradient:["id","x1","y1","x2","y2","gradientunits"],radialgradient:["id","cx","cy","r","fx","fy","gradientunits"],stop:["offset","stop-color","stop-opacity"],clippath:["id"],mask:["id"],"*":["class","id","style"]},No=[/javascript:/gi,/vbscript:/gi,/data:/gi,/on\w+\s*=/gi],$o=e=>{if(typeof e!="string")return"";const t=document.createElement("template");t.innerHTML=e;const i=o=>{if(Array.from(o.childNodes).forEach(i),o.nodeType===Node.ELEMENT_NODE){const n=o.tagName.toLowerCase();if(!Vo.has(n)){if(n==="script"||n==="style"){o.remove();return}const r=document.createTextNode(o.textContent);o.parentNode.replaceChild(r,o);return}const l=[...He[n]||[],...He["*"]||[]];if(Array.from(o.attributes).forEach(r=>{const c=r.name.toLowerCase();if(c.startsWith("on")){o.removeAttribute(r.name);return}if(!l.includes(c)){o.removeAttribute(r.name);return}let h=r.value;No.forEach(p=>{p.test(h)&&o.removeAttribute(r.name)})}),n==="a"){const r=o.getAttribute("href");r&&(/^(https?:|mailto:|tel:|#|\/)/i.test(r.trim())||o.removeAttribute("href")),o.getAttribute("target")==="_blank"&&o.setAttribute("rel","noopener noreferrer")}if(n==="img"){const r=o.getAttribute("src");r&&(/^(https?:|\/|data:image\/)/i.test(r.trim())||o.removeAttribute("src"))}}};return i(t.content),t.innerHTML},jo=e=>e==="y"?P.Y:P.X,_o=(e,t,i)=>e.filter(o=>jo(o.orientation)===i&&t in o.positions),Go=(e,t,i)=>{const o=document.createElement("button");if(o.id=e,o.className="cloudimage-360-hotspot cloudimage-360-hotspot--pulse",o.dataset.hotspotId=e,o.setAttribute("type","button"),o.setAttribute("aria-label",t||`Hotspot ${e}`),o.setAttribute("aria-haspopup","true"),o.setAttribute("aria-expanded","false"),i==="dot-label"&&t){o.classList.add("cloudimage-360-hotspot--dot-label");const s=document.createElement("span");s.className="cloudimage-360-hotspot-label",s.textContent=t,o.appendChild(s)}return o},Uo=e=>{const t=Object.entries(e).sort(([n],[l])=>Number(n)-Number(l));let i=null,o=null;const s={};for(const[n,l]of t)if(!l)s[n]={x:i,y:o};else{const{x:a,y:r}=l;a!=null&&(i=a),r!=null&&(o=r),s[n]={x:a||i,y:r||o}}return s},Ko=e=>({placement:"top",modifiers:[{name:"offset",options:{offset:[0,10]}},{name:"preventOverflow",options:{boundary:e}},{name:"flip",options:{boundary:e,fallbackPlacements:["bottom","right","left"]}}]}),qo=(e,t)=>{const i=document.createElement("div");return i.className="cloudimage-360-popper",i.id=`cloudimage-360-popper-${t}`,i.dataset.popperId=t,i.setAttribute("role","tooltip"),i.setAttribute("aria-hidden","false"),typeof e=="string"&&/<\/?[a-z][\s\S]*>/i.test(e)?i.innerHTML=$o(e):i.textContent=e,document.body.appendChild(i),i},Jo=e=>{const t=[...e];return t.forEach((i,o)=>{const s={...Uo(i.positions)};t[o].initialPositions=s,t[o].positions=s}),t},Qo=({newWidth:e,newHeight:t,initialContainerSize:i,imageAspectRatio:o,hotspotsConfig:s})=>{const[n,l]=i;let a=e,r=t,c=0,h=0;const p=e/t;o>p?(r=e/o,h=(t-r)/2):(a=t*o,c=(e-a)/2);const u=a/n,x=r/l;return s.map(y=>{const g={};return Object.entries(y.initialPositions).forEach(([k,O])=>{g[k]={x:O.x*u+c,y:O.y*x+h}}),{...y,positions:g}})};function ts(e){const t=[];e.image&&t.push(`<div class="ci360-popper-image-wrapper"><img class="ci360-popper-image" src="${Jt(e.image)}" alt="${Jt(e.title||"")}"></div>`);const i=[];if(e.title&&i.push(`<h3 class="ci360-popper-title">${xt(e.title)}</h3>`),e.originalPrice||e.price){let o="";e.originalPrice&&(o+=`<span class="ci360-popper-original-price">${xt(e.originalPrice)}</span>`),e.price&&(o+=`<span class="ci360-popper-price">${xt(e.price)}</span>`),i.push(`<div class="ci360-popper-price-row">${o}</div>`)}if(e.description&&i.push(`<p class="ci360-popper-description">${xt(e.description)}</p>`),e.url&&es(e.url)){const o=e.ctaText||"View details";i.push(`<a class="ci360-popper-cta" href="${Jt(e.url)}">${xt(String(o))}</a>`)}return i.length>0&&t.push(`<div class="ci360-popper-body">${i.join("")}</div>`),t.join("")}function Ze(e){return e.content?e.content:e.data?ts(e.data):""}function xt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Jt(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function es(e){const t=e.replace(/[\s\x00-\x1f]/g,"");return/^https?:\/\//i.test(t)||/^\/(?!\/)/.test(t)||/^#/.test(t)}var H="top",W="bottom",F="right",Z="left",Qt="auto",Ct=[H,W,F,Z],at="start",It="end",is="clippingParents",De="viewport",kt="popper",os="reference",ze=Ct.reduce(function(e,t){return e.concat([t+"-"+at,t+"-"+It])},[]),Be=[].concat(Ct,[Qt]).reduce(function(e,t){return e.concat([t,t+"-"+at,t+"-"+It])},[]),ss="beforeRead",ns="read",rs="afterRead",as="beforeMain",ls="main",cs="afterMain",hs="beforeWrite",ds="write",ps="afterWrite",us=[ss,ns,rs,as,ls,cs,hs,ds,ps];function N(e){return e?(e.nodeName||"").toLowerCase():null}function D(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function it(e){var t=D(e).Element;return e instanceof t||e instanceof Element}function V(e){var t=D(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function te(e){if(typeof ShadowRoot>"u")return!1;var t=D(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function ms(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var o=t.styles[i]||{},s=t.attributes[i]||{},n=t.elements[i];!V(n)||!N(n)||(Object.assign(n.style,o),Object.keys(s).forEach(function(l){var a=s[l];a===!1?n.removeAttribute(l):n.setAttribute(l,a===!0?"":a)}))})}function fs(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(o){var s=t.elements[o],n=t.attributes[o]||{},l=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:i[o]),a=l.reduce(function(r,c){return r[c]="",r},{});!V(s)||!N(s)||(Object.assign(s.style,a),Object.keys(n).forEach(function(r){s.removeAttribute(r)}))})}}const gs={name:"applyStyles",enabled:!0,phase:"write",fn:ms,effect:fs,requires:["computeStyles"]};function $(e){return e.split("-")[0]}var ot=Math.max,Zt=Math.min,lt=Math.round;function ee(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function We(){return!/^((?!chrome|android).)*safari/i.test(ee())}function ct(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var o=e.getBoundingClientRect(),s=1,n=1;t&&V(e)&&(s=e.offsetWidth>0&&lt(o.width)/e.offsetWidth||1,n=e.offsetHeight>0&&lt(o.height)/e.offsetHeight||1);var l=it(e)?D(e):window,a=l.visualViewport,r=!We()&&i,c=(o.left+(r&&a?a.offsetLeft:0))/s,h=(o.top+(r&&a?a.offsetTop:0))/n,p=o.width/s,f=o.height/n;return{width:p,height:f,top:h,right:c+p,bottom:h+f,left:c,x:c,y:h}}function ie(e){var t=ct(e),i=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:o}}function Fe(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&te(i)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function _(e){return D(e).getComputedStyle(e)}function vs(e){return["table","td","th"].indexOf(N(e))>=0}function tt(e){return((it(e)?e.ownerDocument:e.document)||window.document).documentElement}function Dt(e){return N(e)==="html"?e:e.assignedSlot||e.parentNode||(te(e)?e.host:null)||tt(e)}function Ve(e){return!V(e)||_(e).position==="fixed"?null:e.offsetParent}function bs(e){var t=/firefox/i.test(ee()),i=/Trident/i.test(ee());if(i&&V(e)){var o=_(e);if(o.position==="fixed")return null}var s=Dt(e);for(te(s)&&(s=s.host);V(s)&&["html","body"].indexOf(N(s))<0;){var n=_(s);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||t&&n.willChange==="filter"||t&&n.filter&&n.filter!=="none")return s;s=s.parentNode}return null}function Ot(e){for(var t=D(e),i=Ve(e);i&&vs(i)&&_(i).position==="static";)i=Ve(i);return i&&(N(i)==="html"||N(i)==="body"&&_(i).position==="static")?t:i||bs(e)||t}function oe(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Et(e,t,i){return ot(e,Zt(t,i))}function ys(e,t,i){var o=Et(e,t,i);return o>i?i:o}function Ne(){return{top:0,right:0,bottom:0,left:0}}function $e(e){return Object.assign({},Ne(),e)}function je(e,t){return t.reduce(function(i,o){return i[o]=e,i},{})}var ws=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,$e(typeof t!="number"?t:je(t,Ct))};function xs(e){var t,i=e.state,o=e.name,s=e.options,n=i.elements.arrow,l=i.modifiersData.popperOffsets,a=$(i.placement),r=oe(a),c=[Z,F].indexOf(a)>=0,h=c?"height":"width";if(!(!n||!l)){var p=ws(s.padding,i),f=ie(n),u=r==="y"?H:Z,x=r==="y"?W:F,y=i.rects.reference[h]+i.rects.reference[r]-l[r]-i.rects.popper[h],g=l[r]-i.rects.reference[r],k=Ot(n),O=k?r==="y"?k.clientHeight||0:k.clientWidth||0:0,w=y/2-g/2,b=p[u],I=O-f[h]-p[x],m=O/2-f[h]/2+w,v=Et(b,m,I),C=r;i.modifiersData[o]=(t={},t[C]=v,t.centerOffset=v-m,t)}}function Cs(e){var t=e.state,i=e.options,o=i.element,s=o===void 0?"[data-popper-arrow]":o;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||Fe(t.elements.popper,s)&&(t.elements.arrow=s))}const Is={name:"arrow",enabled:!0,phase:"main",fn:xs,effect:Cs,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ht(e){return e.split("-")[1]}var ks={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Os(e,t){var i=e.x,o=e.y,s=t.devicePixelRatio||1;return{x:lt(i*s)/s||0,y:lt(o*s)/s||0}}function _e(e){var t,i=e.popper,o=e.popperRect,s=e.placement,n=e.variation,l=e.offsets,a=e.position,r=e.gpuAcceleration,c=e.adaptive,h=e.roundOffsets,p=e.isFixed,f=l.x,u=f===void 0?0:f,x=l.y,y=x===void 0?0:x,g=typeof h=="function"?h({x:u,y}):{x:u,y};u=g.x,y=g.y;var k=l.hasOwnProperty("x"),O=l.hasOwnProperty("y"),w=Z,b=H,I=window;if(c){var m=Ot(i),v="clientHeight",C="clientWidth";if(m===D(i)&&(m=tt(i),_(m).position!=="static"&&a==="absolute"&&(v="scrollHeight",C="scrollWidth")),m=m,s===H||(s===Z||s===F)&&n===It){b=W;var E=p&&m===I&&I.visualViewport?I.visualViewport.height:m[v];y-=E-o.height,y*=r?1:-1}if(s===Z||(s===H||s===W)&&n===It){w=F;var A=p&&m===I&&I.visualViewport?I.visualViewport.width:m[C];u-=A-o.width,u*=r?1:-1}}var T=Object.assign({position:a},c&&ks),X=h===!0?Os({x:u,y},D(i)):{x:u,y};if(u=X.x,y=X.y,r){var L;return Object.assign({},T,(L={},L[b]=O?"0":"",L[w]=k?"0":"",L.transform=(I.devicePixelRatio||1)<=1?"translate("+u+"px, "+y+"px)":"translate3d("+u+"px, "+y+"px, 0)",L))}return Object.assign({},T,(t={},t[b]=O?y+"px":"",t[w]=k?u+"px":"",t.transform="",t))}function Es(e){var t=e.state,i=e.options,o=i.gpuAcceleration,s=o===void 0?!0:o,n=i.adaptive,l=n===void 0?!0:n,a=i.roundOffsets,r=a===void 0?!0:a,c={placement:$(t.placement),variation:ht(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,_e(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:r})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,_e(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:r})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const As={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Es,data:{}};var zt={passive:!0};function Ss(e){var t=e.state,i=e.instance,o=e.options,s=o.scroll,n=s===void 0?!0:s,l=o.resize,a=l===void 0?!0:l,r=D(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return n&&c.forEach(function(h){h.addEventListener("scroll",i.update,zt)}),a&&r.addEventListener("resize",i.update,zt),function(){n&&c.forEach(function(h){h.removeEventListener("scroll",i.update,zt)}),a&&r.removeEventListener("resize",i.update,zt)}}const Ts={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Ss,data:{}};var Ls={left:"right",right:"left",bottom:"top",top:"bottom"};function Bt(e){return e.replace(/left|right|bottom|top/g,function(t){return Ls[t]})}var Ps={start:"end",end:"start"};function Ge(e){return e.replace(/start|end/g,function(t){return Ps[t]})}function se(e){var t=D(e),i=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:i,scrollTop:o}}function ne(e){return ct(tt(e)).left+se(e).scrollLeft}function Ms(e,t){var i=D(e),o=tt(e),s=i.visualViewport,n=o.clientWidth,l=o.clientHeight,a=0,r=0;if(s){n=s.width,l=s.height;var c=We();(c||!c&&t==="fixed")&&(a=s.offsetLeft,r=s.offsetTop)}return{width:n,height:l,x:a+ne(e),y:r}}function Ys(e){var t,i=tt(e),o=se(e),s=(t=e.ownerDocument)==null?void 0:t.body,n=ot(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),l=ot(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-o.scrollLeft+ne(e),r=-o.scrollTop;return _(s||i).direction==="rtl"&&(a+=ot(i.clientWidth,s?s.clientWidth:0)-n),{width:n,height:l,x:a,y:r}}function re(e){var t=_(e),i=t.overflow,o=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+o)}function Ue(e){return["html","body","#document"].indexOf(N(e))>=0?e.ownerDocument.body:V(e)&&re(e)?e:Ue(Dt(e))}function At(e,t){var i;t===void 0&&(t=[]);var o=Ue(e),s=o===((i=e.ownerDocument)==null?void 0:i.body),n=D(o),l=s?[n].concat(n.visualViewport||[],re(o)?o:[]):o,a=t.concat(l);return s?a:a.concat(At(Dt(l)))}function ae(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Rs(e,t){var i=ct(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function Ke(e,t,i){return t===De?ae(Ms(e,i)):it(t)?Rs(t,i):ae(Ys(tt(e)))}function Xs(e){var t=At(Dt(e)),i=["absolute","fixed"].indexOf(_(e).position)>=0,o=i&&V(e)?Ot(e):e;return it(o)?t.filter(function(s){return it(s)&&Fe(s,o)&&N(s)!=="body"}):[]}function Hs(e,t,i,o){var s=t==="clippingParents"?Xs(e):[].concat(t),n=[].concat(s,[i]),l=n[0],a=n.reduce(function(r,c){var h=Ke(e,c,o);return r.top=ot(h.top,r.top),r.right=Zt(h.right,r.right),r.bottom=Zt(h.bottom,r.bottom),r.left=ot(h.left,r.left),r},Ke(e,l,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function qe(e){var t=e.reference,i=e.element,o=e.placement,s=o?$(o):null,n=o?ht(o):null,l=t.x+t.width/2-i.width/2,a=t.y+t.height/2-i.height/2,r;switch(s){case H:r={x:l,y:t.y-i.height};break;case W:r={x:l,y:t.y+t.height};break;case F:r={x:t.x+t.width,y:a};break;case Z:r={x:t.x-i.width,y:a};break;default:r={x:t.x,y:t.y}}var c=s?oe(s):null;if(c!=null){var h=c==="y"?"height":"width";switch(n){case at:r[c]=r[c]-(t[h]/2-i[h]/2);break;case It:r[c]=r[c]+(t[h]/2-i[h]/2);break}}return r}function St(e,t){t===void 0&&(t={});var i=t,o=i.placement,s=o===void 0?e.placement:o,n=i.strategy,l=n===void 0?e.strategy:n,a=i.boundary,r=a===void 0?is:a,c=i.rootBoundary,h=c===void 0?De:c,p=i.elementContext,f=p===void 0?kt:p,u=i.altBoundary,x=u===void 0?!1:u,y=i.padding,g=y===void 0?0:y,k=$e(typeof g!="number"?g:je(g,Ct)),O=f===kt?os:kt,w=e.rects.popper,b=e.elements[x?O:f],I=Hs(it(b)?b:b.contextElement||tt(e.elements.popper),r,h,l),m=ct(e.elements.reference),v=qe({reference:m,element:w,placement:s}),C=ae(Object.assign({},w,v)),E=f===kt?C:m,A={top:I.top-E.top+k.top,bottom:E.bottom-I.bottom+k.bottom,left:I.left-E.left+k.left,right:E.right-I.right+k.right},T=e.modifiersData.offset;if(f===kt&&T){var X=T[s];Object.keys(A).forEach(function(L){var G=[F,W].indexOf(L)>=0?1:-1,U=[H,W].indexOf(L)>=0?"y":"x";A[L]+=X[U]*G})}return A}function Zs(e,t){t===void 0&&(t={});var i=t,o=i.placement,s=i.boundary,n=i.rootBoundary,l=i.padding,a=i.flipVariations,r=i.allowedAutoPlacements,c=r===void 0?Be:r,h=ht(o),p=h?a?ze:ze.filter(function(x){return ht(x)===h}):Ct,f=p.filter(function(x){return c.indexOf(x)>=0});f.length===0&&(f=p);var u=f.reduce(function(x,y){return x[y]=St(e,{placement:y,boundary:s,rootBoundary:n,padding:l})[$(y)],x},{});return Object.keys(u).sort(function(x,y){return u[x]-u[y]})}function Ds(e){if($(e)===Qt)return[];var t=Bt(e);return[Ge(e),t,Ge(t)]}function zs(e){var t=e.state,i=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var s=i.mainAxis,n=s===void 0?!0:s,l=i.altAxis,a=l===void 0?!0:l,r=i.fallbackPlacements,c=i.padding,h=i.boundary,p=i.rootBoundary,f=i.altBoundary,u=i.flipVariations,x=u===void 0?!0:u,y=i.allowedAutoPlacements,g=t.options.placement,k=$(g),O=k===g,w=r||(O||!x?[Bt(g)]:Ds(g)),b=[g].concat(w).reduce(function(et,j){return et.concat($(j)===Qt?Zs(t,{placement:j,boundary:h,rootBoundary:p,padding:c,flipVariations:x,allowedAutoPlacements:y}):j)},[]),I=t.rects.reference,m=t.rects.popper,v=new Map,C=!0,E=b[0],A=0;A<b.length;A++){var T=b[A],X=$(T),L=ht(T)===at,G=[H,W].indexOf(X)>=0,U=G?"width":"height",Y=St(t,{placement:T,boundary:h,rootBoundary:p,altBoundary:f,padding:c}),z=G?L?F:Z:L?W:H;I[U]>m[U]&&(z=Bt(z));var dt=Bt(z),K=[];if(n&&K.push(Y[X]<=0),a&&K.push(Y[z]<=0,Y[dt]<=0),K.every(function(et){return et})){E=T,C=!1;break}v.set(T,K)}if(C)for(var pt=x?3:1,Tt=function(j){var nt=b.find(function(mt){var q=v.get(mt);if(q)return q.slice(0,j).every(function(ft){return ft})});if(nt)return E=nt,"break"},st=pt;st>0;st--){var ut=Tt(st);if(ut==="break")break}t.placement!==E&&(t.modifiersData[o]._skip=!0,t.placement=E,t.reset=!0)}}const Bs={name:"flip",enabled:!0,phase:"main",fn:zs,requiresIfExists:["offset"],data:{_skip:!1}};function Je(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function Qe(e){return[H,F,W,Z].some(function(t){return e[t]>=0})}function Ws(e){var t=e.state,i=e.name,o=t.rects.reference,s=t.rects.popper,n=t.modifiersData.preventOverflow,l=St(t,{elementContext:"reference"}),a=St(t,{altBoundary:!0}),r=Je(l,o),c=Je(a,s,n),h=Qe(r),p=Qe(c);t.modifiersData[i]={referenceClippingOffsets:r,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":p})}const Fs={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ws};function Vs(e,t,i){var o=$(e),s=[Z,H].indexOf(o)>=0?-1:1,n=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,l=n[0],a=n[1];return l=l||0,a=(a||0)*s,[Z,F].indexOf(o)>=0?{x:a,y:l}:{x:l,y:a}}function Ns(e){var t=e.state,i=e.options,o=e.name,s=i.offset,n=s===void 0?[0,0]:s,l=Be.reduce(function(h,p){return h[p]=Vs(p,t.rects,n),h},{}),a=l[t.placement],r=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=r,t.modifiersData.popperOffsets.y+=c),t.modifiersData[o]=l}const $s={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ns};function js(e){var t=e.state,i=e.name;t.modifiersData[i]=qe({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const _s={name:"popperOffsets",enabled:!0,phase:"read",fn:js,data:{}};function Gs(e){return e==="x"?"y":"x"}function Us(e){var t=e.state,i=e.options,o=e.name,s=i.mainAxis,n=s===void 0?!0:s,l=i.altAxis,a=l===void 0?!1:l,r=i.boundary,c=i.rootBoundary,h=i.altBoundary,p=i.padding,f=i.tether,u=f===void 0?!0:f,x=i.tetherOffset,y=x===void 0?0:x,g=St(t,{boundary:r,rootBoundary:c,padding:p,altBoundary:h}),k=$(t.placement),O=ht(t.placement),w=!O,b=oe(k),I=Gs(b),m=t.modifiersData.popperOffsets,v=t.rects.reference,C=t.rects.popper,E=typeof y=="function"?y(Object.assign({},t.rects,{placement:t.placement})):y,A=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,X={x:0,y:0};if(m){if(n){var L,G=b==="y"?H:Z,U=b==="y"?W:F,Y=b==="y"?"height":"width",z=m[b],dt=z+g[G],K=z-g[U],pt=u?-C[Y]/2:0,Tt=O===at?v[Y]:C[Y],st=O===at?-C[Y]:-v[Y],ut=t.elements.arrow,et=u&&ut?ie(ut):{width:0,height:0},j=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ne(),nt=j[G],mt=j[U],q=Et(0,v[Y],et[Y]),ft=w?v[Y]/2-pt-q-nt-A.mainAxis:Tt-q-nt-A.mainAxis,Ft=w?-v[Y]/2+pt+q+mt+A.mainAxis:st+q+mt+A.mainAxis,gt=t.elements.arrow&&Ot(t.elements.arrow),le=gt?b==="y"?gt.clientTop||0:gt.clientLeft||0:0,Lt=(L=T==null?void 0:T[b])!=null?L:0,ce=z+ft-Lt-le,he=z+Ft-Lt,Vt=Et(u?Zt(dt,ce):dt,z,u?ot(K,he):K);m[b]=Vt,X[b]=Vt-z}if(a){var Nt,de=b==="x"?H:Z,pe=b==="x"?W:F,J=m[I],vt=I==="y"?"height":"width",$t=J+g[de],jt=J-g[pe],Pt=[H,Z].indexOf(k)!==-1,_t=(Nt=T==null?void 0:T[I])!=null?Nt:0,Mt=Pt?$t:J-v[vt]-C[vt]-_t+A.altAxis,bt=Pt?J+v[vt]+C[vt]-_t-A.altAxis:jt,yt=u&&Pt?ys(Mt,J,bt):Et(u?Mt:$t,J,u?bt:jt);m[I]=yt,X[I]=yt-J}t.modifiersData[o]=X}}const Ks={name:"preventOverflow",enabled:!0,phase:"main",fn:Us,requiresIfExists:["offset"]};function qs(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Js(e){return e===D(e)||!V(e)?se(e):qs(e)}function Qs(e){var t=e.getBoundingClientRect(),i=lt(t.width)/e.offsetWidth||1,o=lt(t.height)/e.offsetHeight||1;return i!==1||o!==1}function tn(e,t,i){i===void 0&&(i=!1);var o=V(t),s=V(t)&&Qs(t),n=tt(t),l=ct(e,s,i),a={scrollLeft:0,scrollTop:0},r={x:0,y:0};return(o||!o&&!i)&&((N(t)!=="body"||re(n))&&(a=Js(t)),V(t)?(r=ct(t,!0),r.x+=t.clientLeft,r.y+=t.clientTop):n&&(r.x=ne(n))),{x:l.left+a.scrollLeft-r.x,y:l.top+a.scrollTop-r.y,width:l.width,height:l.height}}function en(e){var t=new Map,i=new Set,o=[];e.forEach(function(n){t.set(n.name,n)});function s(n){i.add(n.name);var l=[].concat(n.requires||[],n.requiresIfExists||[]);l.forEach(function(a){if(!i.has(a)){var r=t.get(a);r&&s(r)}}),o.push(n)}return e.forEach(function(n){i.has(n.name)||s(n)}),o}function on(e){var t=en(e);return us.reduce(function(i,o){return i.concat(t.filter(function(s){return s.phase===o}))},[])}function sn(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function nn(e){var t=e.reduce(function(i,o){var s=i[o.name];return i[o.name]=s?Object.assign({},s,o,{options:Object.assign({},s.options,o.options),data:Object.assign({},s.data,o.data)}):o,i},{});return Object.keys(t).map(function(i){return t[i]})}var ti={placement:"bottom",modifiers:[],strategy:"absolute"};function ei(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function rn(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,o=i===void 0?[]:i,s=t.defaultOptions,n=s===void 0?ti:s;return function(a,r,c){c===void 0&&(c=n);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},ti,n),modifiersData:{},elements:{reference:a,popper:r},attributes:{},styles:{}},p=[],f=!1,u={state:h,setOptions:function(k){var O=typeof k=="function"?k(h.options):k;y(),h.options=Object.assign({},n,h.options,O),h.scrollParents={reference:it(a)?At(a):a.contextElement?At(a.contextElement):[],popper:At(r)};var w=on(nn([].concat(o,h.options.modifiers)));return h.orderedModifiers=w.filter(function(b){return b.enabled}),x(),u.update()},forceUpdate:function(){if(!f){var k=h.elements,O=k.reference,w=k.popper;if(ei(O,w)){h.rects={reference:tn(O,Ot(w),h.options.strategy==="fixed"),popper:ie(w)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(A){return h.modifiersData[A.name]=Object.assign({},A.data)});for(var b=0;b<h.orderedModifiers.length;b++){if(h.reset===!0){h.reset=!1,b=-1;continue}var I=h.orderedModifiers[b],m=I.fn,v=I.options,C=v===void 0?{}:v,E=I.name;typeof m=="function"&&(h=m({state:h,options:C,name:E,instance:u})||h)}}}},update:sn(function(){return new Promise(function(g){u.forceUpdate(),g(h)})}),destroy:function(){y(),f=!0}};if(!ei(a,r))return u;u.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function x(){h.orderedModifiers.forEach(function(g){var k=g.name,O=g.options,w=O===void 0?{}:O,b=g.effect;if(typeof b=="function"){var I=b({state:h,name:k,instance:u,options:w}),m=function(){};p.push(I||m)}})}function y(){p.forEach(function(g){return g()}),p=[]}return u}}var an=[Ts,_s,As,gs,$s,Bs,Ks,Is,Fs],ln=rn({defaultModifiers:an});class cn{constructor(t,i,o,s={}){ci(this,"updateHotspotPosition",(t,i)=>{this.currentActiveIndex=t,this.currentOrientation=i;const o=_o(this.hotspotsConfig,t,i);this.hideHotspots(),o.forEach(s=>this.updateAndShowHotspot(s,t))});this.container=i,this.popper=null,this.popperInstance=null,this.hotspotsContainer=ao(this.container),this.hotspotsConfig=Jo(t),this.shouldHidePopper=!0,this.hidePopper=this.hidePopper.bind(this),this.forceHidePopper=this.forceHidePopper.bind(this),this.imageAspectRatio=o,this.hotspotElements=new Map,this.popperListeners=[],this.trigger=s.trigger||"hover";const{containerSize:n}=t[0];this.initialContainerSize=n||[i.offsetWidth,i.offsetHeight],this.initHotspots(),this.updateHotspotsForResize(i.offsetWidth,i.offsetHeight),this.observeContainerResize()}observeContainerResize(){this.resizeObserver=new ResizeObserver(()=>{const t=this.container.offsetWidth,i=this.container.offsetHeight;this.updateHotspotsForResize(t,i)}),this.resizeObserver.observe(this.container)}updateHotspotsForResize(t,i){this.hotspotsConfig=Qo({newWidth:t,newHeight:i,initialContainerSize:this.initialContainerSize,imageAspectRatio:this.imageAspectRatio,hotspotsConfig:this.hotspotsConfig}),this.updateHotspotPosition(this.currentActiveIndex,this.currentOrientation)}cleanupPopperListeners(){this.popperListeners.forEach(({element:t,event:i,handler:o})=>{t.removeEventListener(i,o)}),this.popperListeners=[]}showPopper({hotspotElement:t,content:i,id:o,keepOpen:s}){this.popperInstance&&this.hidePopper();const n=Ko(this.container);this.popper=qo(i,o),this.popper.setAttribute("data-show",""),this.currentHotspotElement=t,t.setAttribute("aria-expanded","true"),t.setAttribute("aria-describedby",`cloudimage-360-popper-${o}`);const l=()=>{this.shouldHidePopper=!1},a=()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()},r=()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()},c=()=>{this.shouldHidePopper=!1,this.hidePopperTimeout&&clearTimeout(this.hidePopperTimeout)};this.popper.addEventListener("mouseenter",l),this.popper.addEventListener("mouseleave",a),t.addEventListener("mouseleave",r),t.addEventListener("mouseenter",c),this.popperListeners.push({element:this.popper,event:"mouseenter",handler:l},{element:this.popper,event:"mouseleave",handler:a},{element:t,event:"mouseleave",handler:r},{element:t,event:"mouseenter",handler:c}),this.popperInstance={...ln(t,this.popper,n),keepOpen:s,instanceId:o}}checkAndHidePopper(){var t;this.shouldHidePopper&&!((t=this.popperInstance)!=null&&t.keepOpen)&&(this.hidePopperTimeout=setTimeout(()=>{this.shouldHidePopper&&this.hidePopper()},Mi))}hidePopper(){if(this.hidePopperTimeout&&(clearTimeout(this.hidePopperTimeout),this.hidePopperTimeout=null),this.cleanupPopperListeners(),this.currentHotspotElement&&(this.currentHotspotElement.setAttribute("aria-expanded","false"),this.currentHotspotElement.removeAttribute("aria-describedby"),this.currentHotspotElement=null),this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null),this.popper){this.popper.removeAttribute("data-show"),this.popper.setAttribute("aria-hidden","true");const t=this.popper;this.popper=null,setTimeout(()=>{t.remove()},Yi)}this.shouldHidePopper=!0}forceHidePopper(){this.shouldHidePopper=!0,this.popperInstance&&(this.popperInstance.keepOpen=!1),this.hidePopper()}createHotspot(t){const{id:i,keepOpen:o,onClick:s,label:n,markerStyle:l}=t,a=Ze(t),r=Go(i,n,l);(s||a&&this.trigger==="click")&&(r.style.cursor="pointer"),r.onclick=c=>{var h;c.stopPropagation(),a&&this.trigger==="click"&&(((h=this.popperInstance)==null?void 0:h.instanceId)===i?this.hidePopper():this.showPopper({hotspotElement:r,content:a,id:i,keepOpen:o})),s==null||s(c,this.popperInstance,i)},a&&this.trigger==="hover"&&(r.addEventListener("mouseenter",()=>this.showPopper({hotspotElement:r,content:a,id:i,keepOpen:o})),r.addEventListener("mouseleave",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()}),r.addEventListener("focus",()=>this.showPopper({hotspotElement:r,content:a,id:i,keepOpen:o})),r.addEventListener("blur",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()})),this.hotspotsContainer.appendChild(r)}hideHotspots(){this.hotspotsContainer.querySelectorAll(".cloudimage-360-hotspot").forEach(t=>{t.style.opacity=0,t.style.pointerEvents="none"})}updateAndShowHotspot(t,i){const{positions:o,id:s}=t,{x:n,y:l}=o[i]??{},a=this.hotspotsContainer.querySelector(`[data-hotspot-id="${s}"]`);a&&(a.style.translate=`${n}px ${l}px`,a.style.opacity=1,a.style.pointerEvents="all")}showHotspotById(t){const i=this.hotspotsConfig.find(n=>n.id===t);if(!i)return;const o=Ze(i);if(!o)return;const s=this.hotspotsContainer.querySelector(`[data-hotspot-id="${t}"]`);s&&s.style.opacity==="1"&&this.showPopper({hotspotElement:s,content:o,id:t,keepOpen:i.keepOpen})}createAllHotspots(){this.hotspotsConfig.forEach(t=>this.createHotspot(t))}initHotspots(){this.createAllHotspots()}destroy(){this.hidePopperTimeout&&clearTimeout(this.hidePopperTimeout),this.resizeObserver.disconnect(),this.hidePopper(),this.hotspotElements.clear(),this.hotspotsContainer.innerHTML=""}}const ii=typeof navigator<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);class Wt{constructor(t,i,o){this.container=t,this.isClicked=!1,this.fullscreenView=!!o,this.imagesX=[],this.imagesY=[];const s=Math.round(window.devicePixelRatio||1);this.devicePixelRatio=ii?Math.min(s,2):s,this.id=t.id,this.movementStart={x:0,y:0},this.draggingDirection=null,this.isReady=!1,this.velocityX=0,this.velocityY=0,this.lastDragTime=0,this.lastDragX=0,this.lastDragY=0,this.inertiaAnimationId=null,this.hasInteracted=!1,this.currentZoomScale=1,this.touchDevice=Do(),this.dragJustEnded=!1,this.isPinching=!1,this.initialPinchDistance=0,this.pinchZoomLevel=1,this.pinchZoomEmitted=!1,this.lastEmittedZoom=1,this.panOffsetX=0,this.panOffsetY=0,this.useMainThreadCanvas=ii,this.canvasWorker=this.useMainThreadCanvas?new Fo:new Wo,this.hotspotTimeline=null,this.hotspotTimelineIndicator=null,this.isAnimatingToFrame=!1,this.onMoveHandler=this.onMoveHandler.bind(this),this.destroy=this.destroy.bind(this),this.init(this.container,i)}closeImageBitmaps(t){!t||!Array.isArray(t)||t.forEach(i=>{var o;(o=i==null?void 0:i.bitmapImage)!=null&&o.close&&i.bitmapImage.close()})}emit(t,i={}){const o=this[t];typeof o=="function"&&o({...i,viewerId:this.id})}announce(t){co(this.ariaLiveRegion,t)}mouseDown(t){if(!this.isReady||this.glass)return;const i=t.target;if(i&&i.closest&&(i.closest(".cloudimage-360-button")||i.closest(".cloudimage-360-hotspot-timeline")||i.closest(".cloudimage-360-hotspot")))return;const{pageX:o,pageY:s}=t;this.hideHints(),this.hideHotspotPopper(),this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null),this.autoplayJustStopped=!1,(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1,this.autoplayJustStopped=!0),this.movementStart={x:o,y:s},this.isClicked=!0,this.isDragging=!1,this.inertia&&(this.velocityX=0,this.velocityY=0,this.lastDragTime=performance.now(),this.lastDragX=o,this.lastDragY=s)}mouseUp(){this.isReady&&(!this.isZoomed&&!this.autoplayJustStopped&&this.showAllIcons(),this.inertia&&this.isDragging&&(Math.abs(this.velocityX)>.1||Math.abs(this.velocityY)>.1)&&this.startInertia(),this.isDragging&&(this.emit("onDragEnd"),this.dragJustEnded=!0),this.movementStart={x:0,y:0},this.isClicked=!1,this.isDragging=!1,this.innerBox.style.cursor="grab")}startInertia(){const o=this.fullscreenView?document.body:this.container,s=this.dragSpeed/be,n=s*(this.amountX/o.offsetWidth),l=s*(this.amountY/o.offsetHeight),a=()=>{if(this.velocityX*=.95,this.velocityY*=.95,Math.abs(this.velocityX)<.01&&Math.abs(this.velocityY)<.01){this.inertiaAnimationId=null;return}const r=this.velocityX*16,c=this.velocityY*16,h=Ye({deltaX:r,deltaY:c,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY});if(h){const p=this.allowSpinX?Math.max(1,Math.abs(Math.round(r*n))):0,f=this.allowSpinY?Math.max(1,Math.abs(Math.round(c*l))):0;(p>0||f>0)&&this.onMoveHandler(h,p,f)}this.inertiaAnimationId=requestAnimationFrame(a)};this.inertiaAnimationId=requestAnimationFrame(a)}drag(t,i){if(!this.isReady||!this.isClicked)return;const o=t-this.movementStart.x,s=i-this.movementStart.y;if(this.inertia){const f=performance.now(),u=f-this.lastDragTime;u>0&&u<100&&(this.velocityX=(t-this.lastDragX)/u,this.velocityY=(i-this.lastDragY)/u),this.lastDragTime=f,this.lastDragX=t,this.lastDragY=i}this.draggingDirection=Ye({deltaX:o,deltaY:s,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY})||this.draggingDirection;const n=this.fullscreenView?document.body:this.container,l=this.dragSpeed/be,a=l*(this.amountX/n.offsetWidth),r=l*(this.amountY/n.offsetHeight),c=this.allowSpinX?Math.abs(Math.round(o*a)):0,h=this.allowSpinY?Math.abs(Math.round(s*r)):0;(this.allowSpinX&&c!==0||this.allowSpinY&&h!==0)&&(this.hasInteracted=!0,this.hideHotspotPopper(),this.onMoveHandler(this.draggingDirection,c,h),this.movementStart={x:t,y:i},setTimeout(()=>{this.isDragging||(this.isDragging=!0,this.emit("onDragStart"))},Pi))}mouseMove(t){!this.isReady||!this.isClicked&&!this.isZoomed||this.glass||(this.isZoomed||this.hideAllIcons(),this.drag(t.pageX,t.pageY),this.isZoomed&&this.applyZoom(t))}mouseClick(t){if(!this.isReady||this.isDragging)return;const i=t.target;if(!(i&&i.closest&&(i.closest(".cloudimage-360-button")||i.closest(".cloudimage-360-hotspot-timeline")||i.closest(".cloudimage-360-hotspot")))){if(this.dragJustEnded){this.dragJustEnded=!1;return}if(this.autoplayJustStopped){this.autoplayJustStopped=!1;return}if(this.glass&&this.magnified){this.removeGlass();return}this.pointerZoomTrigger==="click"&&this.pointerZoom&&!this.glass&&!this.touchDevice&&this.toggleZoom(t)}}mouseDblClick(t){if(!this.isReady)return;const i=t.target;i&&i.closest&&(i.closest(".cloudimage-360-button")||i.closest(".cloudimage-360-hotspot-timeline")||i.closest(".cloudimage-360-hotspot"))||this.pointerZoomTrigger==="dblclick"&&this.pointerZoom&&!this.glass&&!this.touchDevice&&this.toggleZoom(t)}loadHigherQualityImages(t,i){const o=wt(this.srcXConfig,t),s=this.allowSpinY?wt(this.srcYConfig,t):null;xe({cdnPathX:o,cdnPathY:s,configX:this.srcXConfig,configY:this.srcYConfig,onAllImagesLoad:(n,l)=>{this.closeImageBitmaps(this.imagesX),this.closeImageBitmaps(this.imagesY),this.imagesX=n,this.imagesY=l,i()},onError:n=>this.emit("onError",n)})}hideHotspots(){this.hotspotsInstance&&this.hotspotsInstance.hideHotspots()}hideHotspotPopper(){this.hotspotsInstance&&this.hotspotsInstance.forceHidePopper()}toggleZoom(t){if(this.isZoomed)this.showTransitionOverlay(),setTimeout(()=>{this.removeZoom()},Xt);else{let i=(this.fullscreenView||this.pointerZoom?document.body:this.container).offsetWidth;this.hideHotspots(),this.showLoadingSpinner(),this.loadHigherQualityImages(i,()=>{this.showTransitionOverlay(),setTimeout(()=>{this.applyZoom(t)},Xt)})}}removeZoom(){this.isZoomed=!1,this.updateView(),this.showAllIcons(),this.hideZoomOutIcon(),this.hideTransitionOverlay(),this.emit("onZoomOut"),this.announce("Zoomed out")}zoomIn(t){if(this.isZoomed||!this.pointerZoom)return;t==null||t.stopPropagation();let i=(this.fullscreenView||this.pointerZoom?document.body:this.container).offsetWidth;this.hideHotspots(),this.hideAllIcons(),this.showLoadingSpinner(),this.loadHigherQualityImages(i,()=>{this.showTransitionOverlay(),setTimeout(()=>{this.applyZoom(t)},Xt)})}zoomOut(t){this.isZoomed&&(t==null||t.stopPropagation(),this.showTransitionOverlay(),setTimeout(()=>{this.removeZoom()},Xt))}mouseLeave(){this.isZoomed&&this.removeZoom()}applyZoom(t){const{offsetX:i,offsetY:o}=Lo(t,this.canvas,this.devicePixelRatio);this.isZoomed||(this.isZoomed=!0,this.hideAllIcons(),this.hideLoadingSpinner(),this.hideTransitionOverlay(),this.showZoomOutIcon(),this.emit("onZoomIn",{zoomLevel:this.pointerZoom}),this.announce("Zoomed in. Move mouse to pan. Click to zoom out.")),this.updateView(this.pointerZoom,i,o)}touchOutside(t){if(!this.glass)return;!this.canvas.contains(t.target)&&this.removeGlass()}touchStart(t){if(!this.isReady||this.glass||!t.touches||!t.touches.length)return;const i=t.target;if(i&&i.closest&&(i.closest(".cloudimage-360-button")||i.closest(".cloudimage-360-hotspot-timeline")||i.closest(".cloudimage-360-hotspot")))return;if(this.hideHints(),t.touches.length===2&&this.pinchZoom&&!this.isDragging){t.preventDefault(),this.isPinching=!0,this.isClicked=!1,this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null);const n=t.touches[0],l=t.touches[1];if(this.initialPinchDistance=this.getPinchDistance(n,l),(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),!this.isZoomed&&this.pinchZoomLevel===1){const a=(this.fullscreenView?document.body:this.container).offsetWidth;this.hideHotspots(),this.loadHigherQualityImages(a,()=>{})}return}if(t.touches.length>1)return;const{pageX:o,pageY:s}=t.touches[0];this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null),(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),this.hideAllIcons(),this.hideHotspotPopper(),this.movementStart={x:o,y:s},this.isClicked=!0,this.isDragging=!1,this.inertia&&(this.velocityX=0,this.velocityY=0,this.lastDragTime=performance.now(),this.lastDragX=o,this.lastDragY=s)}getPinchDistance(t,i){const o=t.pageX-i.pageX,s=t.pageY-i.pageY;return Math.sqrt(o*o+s*s)}getPinchCenter(t,i){return{x:(t.pageX+i.pageX)/2,y:(t.pageY+i.pageY)/2}}touchEnd(t){if(this.isReady){if(this.isPinching){if(!t.touches||t.touches.length<2){if(this.isPinching=!1,this.initialPinchDistance=0,this.pinchZoomLevel<=1){const i=this.pinchZoomEmitted;this.pinchZoomLevel=1,this.pinchZoomEmitted=!1,this.lastEmittedZoom=1,this.isZoomed=!1,this.panOffsetX=0,this.panOffsetY=0,this.showAllIcons(),this.updateView(),i&&this.emit("onZoomOut")}else if(this.canvas){const i=this.canvas.getBoundingClientRect();this.panOffsetX=i.width/2*this.devicePixelRatio,this.panOffsetY=i.height/2*this.devicePixelRatio}}return}this.showAllIcons(),this.inertia&&this.isDragging&&(Math.abs(this.velocityX)>.1||Math.abs(this.velocityY)>.1)&&this.startInertia(),this.movementStart={x:0,y:0},this.isClicked=!1,this.isDragging=!1}}touchMove(t){if(!this.isReady||this.glass)return;if(this.isPinching&&t.touches.length===2){t.preventDefault();const s=t.touches[0],n=t.touches[1],l=this.getPinchDistance(s,n);if(this.initialPinchDistance===0){this.initialPinchDistance=l;return}const a=l/this.initialPinchDistance,r=Math.max(1,Math.min(this.pinchZoomLevel*a,ye));if(this.initialPinchDistance=l,this.pinchZoomLevel=r,!this.canvas)return;const c=this.canvas.getBoundingClientRect(),h=c.width/2*this.devicePixelRatio,p=c.height/2*this.devicePixelRatio;r>1?(this.isZoomed=!0,this.hideAllIcons(),this.updateView(r,h,p),(!this.pinchZoomEmitted||r>this.lastEmittedZoom)&&(this.emit("onZoomIn",{zoomLevel:r}),this.pinchZoomEmitted=!0,this.lastEmittedZoom=r)):(this.isZoomed=!1,this.panOffsetX=0,this.panOffsetY=0,this.updateView());return}if(!this.isClicked||!t.touches||!t.touches[0])return;const{pageX:i,pageY:o}=t.touches[0];if(t.preventDefault(),this.isZoomed&&this.pinchZoomLevel>1){const s=i-this.movementStart.x,n=o-this.movementStart.y;this.panOffsetX-=s*this.devicePixelRatio,this.panOffsetY-=n*this.devicePixelRatio,this.movementStart={x:i,y:o},this.updateView(this.pinchZoomLevel,this.panOffsetX,this.panOffsetY);return}this.drag(i,o)}keyDown(t){if(!this.isReady)return;const{keyCode:i}=t,o=this.keysReverse;switch(this.autoplay&&this.stopAutoplay(),Me(i,this.allowSpinY)&&(this.hasInteracted=!0,this.hideAllIcons(),this.hideHints()),i){case 37:o?this.moveLeft():this.moveRight();break;case 39:o?this.moveRight():this.moveLeft();break;case 38:this.allowSpinY&&(t.preventDefault(),o?this.moveTop():this.moveBottom());break;case 40:this.allowSpinY&&(t.preventDefault(),o?this.moveBottom():this.moveTop());break}}keyUp(t){const{keyCode:i}=t;Me(i,this.allowSpinY)&&this.showAllIcons()}moveActiveXIndexUp(t){this.orientation=P.X,this.activeImageX=(this.activeImageX+t)%this.amountX}moveActiveXIndexDown(t){this.orientation=P.X,this.activeImageX=(this.activeImageX-t+this.amountX)%this.amountX}moveActiveYIndexUp(t){this.orientation=P.Y,this.activeImageY=(this.activeImageY+t)%this.amountY}moveActiveYIndexDown(t){this.orientation=P.Y,this.activeImageY=(this.activeImageY-t+this.amountY)%this.amountY}moveRight(t,i=1){t&&this.activeImageX>=this.imagesX.length-1||(this.moveActiveXIndexUp(i),this.isZoomed||this.updateView())}moveLeft(t,i=1){t&&this.activeImageX<=0||(this.moveActiveXIndexDown(i),this.isZoomed||this.updateView())}moveTop(t,i=1){t&&this.activeImageY>=this.imagesY.length-1||(this.moveActiveYIndexUp(i),this.isZoomed||this.updateView())}moveBottom(t,i=1){t&&this.activeImageY<=0||(this.moveActiveYIndexDown(i),this.isZoomed||this.updateView())}onMoveHandler(t,i=1,o=1){t==="right"?this.moveRight(this.stopAtEdges,i):t==="left"?this.moveLeft(this.stopAtEdges,i):t==="up"?this.moveTop(this.stopAtEdges,o):t==="down"&&this.moveBottom(this.stopAtEdges,o),this.emit("onSpin",{direction:t,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY})}updateView(t,i,o){const s=this.orientation===P.X?this.activeImageX:this.activeImageY,n=this.orientation===P.X?this.imagesX[this.activeImageX]:this.imagesY[this.activeImageY];this.hotspotsInstance&&!this.isZoomed&&!this.autoplay&&this.hotspotsInstance.updateHotspotPosition(s,this.orientation),this.hotspotTimelineIndicator&&this.orientation===P.X&&this.updateHotspotTimelinePosition(),this.drawImageOnCanvas(n,t,i,o)}updatePercentageInLoader(t=0){this.loader&&(this.loader.innerText=t+"%")}adaptCanvasSize(t){const{naturalWidth:i,naturalHeight:o}=t;this.imageAspectRatio=i/o;const s=this.fullscreenView?window.innerWidth:this.canvas.clientWidth,n=this.fullscreenView?window.innerHeight:this.canvas.clientHeight;this.canvasWorker.postMessage({action:"adaptCanvasSize",devicePixelRatio:this.devicePixelRatio,imageAspectRatio:this.imageAspectRatio,containerWidth:s,containerHeight:n})}drawImageOnCanvas(t,i=1,o=0,s=0){this.pendingDrawData={imageData:t,zoomScale:i,pointerX:o,pointerY:s},this.drawFrameRequested||(this.drawFrameRequested=!0,requestAnimationFrame(()=>{if(this.drawFrameRequested=!1,this.pendingDrawData){const{imageData:n,zoomScale:l,pointerX:a,pointerY:r}=this.pendingDrawData;this.canvasWorker.postMessage({action:"drawImageOnCanvas",imageData:n,zoomScale:l,pointerX:a,pointerY:r})}}))}pushImageToSet(t,i,o){o===P.X?this.imagesX[i]=t:this.imagesY[i]=t}calculatePercentage(){const t=this.amountX+this.amountY,i=this.imagesX.length+this.imagesY.length;return Math.round(i/t*100)}onImageLoad(t,i,o){this.pushImageToSet(t,i,o),this.updatePercentageInLoader(this.calculatePercentage())}onFirstImageLoaded(t,i){this.createContainers(t),this.adaptCanvasSize(i),this.drawImageOnCanvas(i)}onAllImagesLoaded(){if(this.addAllIcons(),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.hotspots&&(this.hotspotsInstance=new cn(this.hotspots,this.innerBox,this.imageAspectRatio,{trigger:this.hotspotTrigger}),this.hotspotsInstance.updateHotspotPosition(this.activeImageX,this.orientation),this.addHotspotTimeline(),this.showHotspotTimeline()),this.emit("onLoad",{imagesX:this.imagesX.length,imagesY:this.imagesY.length}),this.emit("onReady"),this.announce("360 degree view loaded. Use mouse drag or arrow keys to rotate."),this.hints!==!1&&!this.autoplay){const t=this.hints===!0||this.hints===void 0?Ee(this.viewerConfig,this.touchDevice):this.hints;t&&t.length>0&&(this.hintsOverlay=Oe(this.innerBox,t,{pointerZoomTrigger:this.pointerZoomTrigger}),Ae(this.hintsOverlay))}this.autoplay&&(this.hideAllIcons(),zo(this.play.bind(this))())}magnify(t){t.stopPropagation();const{src:i}=this.orientation===P.Y?this.imagesY[this.activeImageY]:this.imagesX[this.activeImageX],s=(this.fullscreenView?document.body:this.container).offsetWidth*this.magnifier,n=Vi(i,s);this.showLoadingSpinner(),this.createGlass(),Ao(n,r=>{this.hideLoadingSpinner(),this.magnified=!0,To(t,this.innerBox,this.offset,r,this.glass,this.magnifier)},r=>{this.hideLoadingSpinner(),this.removeGlass(),this.emit("onError",{error:{message:r.message,url:r.url},errorCount:1,totalImages:1,errors:[{message:r.message,url:r.url}]})})}openFullscreenModal(t){t.stopPropagation(),this.hideHotspotPopper(),this.releaseMemory(),window.document.body.style.overflow="hidden";const i=so(this.container);this.fullscreenInstance=new Wt(i,this.viewerConfig,!0),this.fullscreenInstance.originalViewer=this,this.boundResizeHandler=()=>{this.fullscreenInstance&&this.closeFullscreenModal(new Event("resize"))},window.addEventListener("resize",this.boundResizeHandler),this.emit("onFullscreenOpen"),this.announce("Opened fullscreen mode. Press Escape to exit.")}closeFullscreenModal(t){t.stopPropagation();const i=this.originalViewer||this,o=this.fullscreenView?this:i.fullscreenInstance;if(i.boundResizeHandler&&(window.removeEventListener("resize",i.boundResizeHandler),i.boundResizeHandler=null),o){o.hideHotspotPopper();const s=o.container.parentNode;s&&s.parentNode&&s.parentNode.removeChild(s),o.destroy(),i.fullscreenInstance&&(i.fullscreenInstance=null)}window.document.body.style.overflow="visible",i.reloadImages(),i.emit("onFullscreenClose"),i.announce("Exited fullscreen mode")}play(){if(this.isClicked)return;this.hide360ViewCircleIcon(),this.emit("onAutoplayStart");const t=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&&Ro({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse})){this.stopAutoplay();return}Xo({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse,spinDirection:this.spinDirection})&&(this.spinDirection=Zo(this.spinDirection));const n=this.spinDirection==="y";Yo({autoplayBehavior:this.autoplayBehavior,spinY:n,reversed:this.autoplayReverse,loopTriggers:i})},t)}stopAutoplay(){if(this.showAllIcons(),this.autoplay=!1,window.clearTimeout(this.loopTimeoutId),this.loopTimeoutId=null,this.emit("onAutoplayStop"),this.hints!==!1&&!this.hintsOverlay&&!this.hintsHidden){const t=this.hints===!0?Ee(this.viewerConfig,this.touchDevice):this.hints;t&&t.length>0&&(this.hintsOverlay=Oe(this.innerBox,t,{pointerZoomTrigger:this.pointerZoomTrigger}),Ae(this.hintsOverlay))}}destroy(){this.stopAutoplay(),this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null),this.removeEvents(),this.closeImageBitmaps(this.imagesX),this.closeImageBitmaps(this.imagesY),this.imagesX=[],this.imagesY=[],this.canvasWorker&&(this.canvasWorker.terminate(),this.canvasWorker=null),this.hotspotsInstance&&this.hotspotsInstance.destroy(),this.hintsOverlay&&this.hintsOverlay.parentNode&&(this.hintsOverlay.parentNode.removeChild(this.hintsOverlay),this.hintsOverlay=null),this.hotspotTimeline&&this.hotspotTimeline.parentNode&&(this.hotspotTimeline.parentNode.removeChild(this.hotspotTimeline),this.hotspotTimeline=null,this.hotspotTimelineIndicator=null),this.innerBox&&this.innerBox.classList.remove("has-hotspot-timeline"),this.container&&(this.container.classList.remove("ci360-theme-dark","ci360-hotspot-marker-inverted","ci360-hotspot-marker-brand"),this.container.style.removeProperty("--ci360-hotspot-brand-color"),this.container.innerHTML="")}releaseMemory(){this.stopAutoplay(),this.closeImageBitmaps(this.imagesX),this.closeImageBitmaps(this.imagesY),this.imagesX=[],this.imagesY=[],this.isMemoryReleased=!0}reloadImages(){if(!this.isMemoryReleased)return;this.isMemoryReleased=!1;const t=this.container.offsetWidth;this.loadHigherQualityImages(t,()=>{this.updateView()})}addInitialIcon(){this.initialIcon||this.hide360Logo||(this.initialIcon=Ki(this.logoSrc),this.innerBox.appendChild(this.initialIcon))}showInitialIcon(){!this.initialIcon||this.hasInteracted||(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.pointerZoom&&(this.magnifierIcon=eo(),this.magnifierIcon.onclick=this.zoomIn.bind(this),this.iconsContainer.appendChild(this.magnifierIcon),this.zoomOutIcon=io(),this.zoomOutIcon.onclick=this.zoomOut.bind(this),this.zoomOutIcon.style.display="none",this.iconsContainer.appendChild(this.zoomOutIcon))}showMagnifierIcon(){this.magnifierIcon&&(this.magnifierIcon.style.display="",this.magnifierIcon.style.visibility="visible",this.magnifierIcon.style.opacity=1)}hideMagnifierIcon(){this.magnifierIcon&&(this.magnifierIcon.style.display="none",this.magnifierIcon.style.visibility="hidden",this.magnifierIcon.style.opacity=0)}showZoomOutIcon(){this.zoomOutIcon&&(this.zoomOutIcon.style.display="",this.zoomOutIcon.style.visibility="visible",this.zoomOutIcon.style.opacity=1)}hideZoomOutIcon(){this.zoomOutIcon&&(this.zoomOutIcon.style.display="none",this.zoomOutIcon.style.visibility="hidden",this.zoomOutIcon.style.opacity=0)}addFullscreenIcon(){this.fullscreen&&(this.fullscreenIcon=Qi(),this.fullscreenIcon.onclick=this.openFullscreenModal.bind(this),this.iconsContainer.appendChild(this.fullscreenIcon))}addCloseFullscreenIcon(){this.fullscreenCloseIcon=Ji(),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=Gi(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=no(),this.innerBox.appendChild(this.loadingSpinner)}showLoadingSpinner(){this.loadingSpinner&&(this.hideAllIcons(),this.loadingSpinner.style.opacity=1)}createTransitionOverlay(){this.transitionOverlay=ro(),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)}hideHints(){!this.hintsOverlay||this.hintsHidden||(this.hintsHidden=!0,po(this.hintsOverlay))}addHotspotTimeline(){if(!this.hotspots||this.hotspotTimeline)return;const t=vo(this.innerBox,this.amountX,this.hotspots);if(!t)return;this.hotspotTimeline=t.element,this.hotspotTimelineIndicator=t.indicator,this.innerBox.classList.add("has-hotspot-timeline"),this.hotspotTimeline.querySelectorAll(".cloudimage-360-hotspot-timeline-dot").forEach(o=>{o.addEventListener("click",s=>{s.stopPropagation(),this.hideAllIcons(),this.hideHints();const n=parseInt(o.getAttribute("data-frame"),10),l=o.getAttribute("data-hotspot-id");isNaN(n)||this.animateToFrame(n,l)})}),this.updateHotspotTimelinePosition()}showHotspotTimeline(){yo(this.hotspotTimeline)}hideHotspotTimeline(){wo(this.hotspotTimeline)}updateHotspotTimelinePosition(){bo(this.hotspotTimelineIndicator,this.activeImageX,this.amountX)}animateToFrame(t,i){if(this.hotspotsInstance&&this.hotspotsInstance.hidePopper(),this.isAnimatingToFrame||t===this.activeImageX){t===this.activeImageX&&i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&this.hotspotsInstance.showHotspotById(i);return}this.isAnimatingToFrame=!0,this.hasInteracted=!0,(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null);const o=this.activeImageX,s=(t-o+this.amountX)%this.amountX,n=(o-t+this.amountX)%this.amountX,l=s<=n,a=l?s:n;if(a===0){this.isAnimatingToFrame=!1;return}const r=30;let c=a;const h=()=>{if(c<=0){this.isAnimatingToFrame=!1,i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&setTimeout(()=>{this.hotspotsInstance.showHotspotById(i)},50);return}l?this.moveRight():this.moveLeft(),c--,c>0?setTimeout(h,r):(this.isAnimatingToFrame=!1,i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&setTimeout(()=>{this.hotspotsInstance.showHotspotById(i)},50))};h()}remove360ViewCircleIcon(){this.view360CircleIcon&&(this.innerBox.removeChild(this.view360CircleIcon),this.view360CircleIcon=null)}addAllIcons(){this.removeLoader(),this.iconsContainer&&(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(),this.showHotspotTimeline()}hideAllIcons(){this.hideInitialIcon(),this.hide360ViewCircleIcon(),this.hideMagnifierIcon(),this.hideZoomOutIcon(),this.hideFullscreenIcon()}removeLoader(){this.loader&&(this.innerBox.removeChild(this.loader),this.loader=null)}attachEvents(t,i,o){t&&this.addMouseEvents(),i&&this.addTouchEvents(),o&&this.addKeyboardEvents(),this.addEscKeyHandler()}removeEvents(){this.removeMouseEvents(),this.removeTouchEvents(),this.removeKeyboardEvents(),this.removeEscKeyHandler()}addMouseEvents(){this.boundMouseClick=this.mouseClick.bind(this),this.boundMouseDblClick=this.mouseDblClick.bind(this),this.boundMouseDown=this.mouseDown.bind(this),this.boundMouseMove=ge(this.mouseMove.bind(this),ve),this.boundMouseUp=this.mouseUp.bind(this),this.boundMouseLeave=this.mouseLeave.bind(this),this.innerBox.addEventListener("click",this.boundMouseClick),this.innerBox.addEventListener("dblclick",this.boundMouseDblClick),this.innerBox.addEventListener("mousedown",this.boundMouseDown),this.innerBox.addEventListener("mouseleave",this.boundMouseLeave),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=ge(this.touchMove.bind(this),ve),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)}addEscKeyHandler(){this.boundEscHandler=t=>{t.keyCode===27&&(this.fullscreenView?this.closeFullscreenModal(t):this.isZoomed?this.removeZoom():this.glass&&this.removeGlass())},document.addEventListener("keydown",this.boundEscHandler)}removeEscKeyHandler(){document.removeEventListener("keydown",this.boundEscHandler)}removeMouseEvents(){this.innerBox.removeEventListener("click",this.boundMouseClick),this.innerBox.removeEventListener("dblclick",this.boundMouseDblClick),this.innerBox.removeEventListener("mousedown",this.boundMouseDown),this.innerBox.removeEventListener("mouseleave",this.boundMouseLeave),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(t){if(this.iconsContainer=Ce(this.innerBox),this.canvas=qi(this.innerBox,t),this.loader=oo(this.innerBox),this.ariaLiveRegion=lo(this.innerBox),this.useMainThreadCanvas)this.canvasWorker.postMessage({action:"initCanvas",offscreen:this.canvas,devicePixelRatio:this.devicePixelRatio});else{const i=this.canvas.transferControlToOffscreen();this.canvasWorker.postMessage({action:"initCanvas",offscreen:i,devicePixelRatio:this.devicePixelRatio},[i])}this.fullscreenView&&this.addCloseFullscreenIcon(),Ut(this.innerBox,".cloudimage-360-placeholder")}update(t){this.isReady&&(this.stopAutoplay(),Ut(this.innerBox,".cloudimage-360-icons-container"),this.init(this.container,t,!0),this.iconsContainer=Ce(this.innerBox),this.onAllImagesLoaded())}init(t,i,o){const s=i?Di(i):Hi(t),{folder:n,apiVersion:l,filenameX:a,filenameY:r,imageListX:c,imageListY:h,indexZeroBase:p,amountX:f,amountY:u,draggable:x=!0,swipeable:y=!0,keys:g,keysReverse:k,bottomCircleOffset:O,autoplay:w,autoplayBehavior:b,playOnce:I,speed:m,autoplayReverse:v,fullscreen:C,magnifier:E,ciToken:A,ciFilters:T,ciTransformation:X,lazyload:L,dragSpeed:G,stopAtEdges:U,pointerZoom:Y,pointerZoomTrigger:z="dblclick",imageInfo:dt="black",initialIconShown:K,bottomCircle:pt,hotspots:Tt,hotspotTrigger:st="hover",dragReverse:ut,hide360Logo:et,logoSrc:j,inertia:nt,pinchZoom:mt,hints:q,theme:ft,markerTheme:Ft,brandColor:gt,hotspotTimelineOnClick:le=!0,aspectRatio:Lt,onReady:ce,onLoad:he,onSpin:Vt,onAutoplayStart:Nt,onAutoplayStop:de,onFullscreenOpen:pe,onFullscreenClose:J,onZoomIn:vt,onZoomOut:$t,onDragStart:jt,onDragEnd:Pt,onError:_t}=s,Mt={ciToken:A,ciFilters:T,ciTransformation:X},bt=Kt(c,[]),yt=Kt(h,[]);if(this.viewerConfig=s,this.amountX=bt.length||f,this.amountY=yt.length||u,this.allowSpinX=!!this.amountX,this.allowSpinY=!!this.amountY,this.activeImageX=v?this.amountX-1:0,this.activeImageY=v?this.amountY-1:0,this.bottomCircleOffset=O,this.autoplay=w,this.autoplayBehavior=b,this.playOnce=I,this.speed=m,this.autoplayReverse=v,this.fullscreen=C,this.magnifier=E>1?Math.min(E,Xi):0,this.dragSpeed=Math.max(G,Ri),this.stopAtEdges=U,this.ciParams=Mt,this.apiVersion=l,this.pointerZoom=Y>1?Math.min(Y,ye):null,this.pointerZoomTrigger=z,this.keysReverse=k,this.info=dt,this.keys=g,this.innerBox=this.innerBox??to(this.container),Lt&&(this.container.style.aspectRatio=Lt),this.initialIconShown=K,this.bottomCircle=pt,this.spinDirection=Ho(this.autoplayBehavior,this.allowSpinX,this.allowSpinY),this.dragReverse=ut,this.hotspots=Tt,this.hotspotTrigger=st,this.hide360Logo=et,this.logoSrc=j,this.inertia=nt,this.pinchZoom=mt,this.hints=q,this.hotspotTimelineOnClick=le,ft==="dark"?this.container.classList.add("ci360-theme-dark"):ft==="light"&&this.container.classList.remove("ci360-theme-dark"),this.container.classList.remove("ci360-hotspot-marker-inverted","ci360-hotspot-marker-brand"),Ft==="inverted"?this.container.classList.add("ci360-hotspot-marker-inverted"):Ft==="brand"&&(this.container.classList.add("ci360-hotspot-marker-brand"),gt&&this.container.style.setProperty("--ci360-hotspot-brand-color",gt)),this.onReady=ce,this.onLoad=he,this.onSpin=Vt,this.onAutoplayStart=Nt,this.onAutoplayStop=de,this.onFullscreenOpen=pe,this.onFullscreenClose=J,this.onZoomIn=vt,this.onZoomOut=$t,this.onDragStart=jt,this.onDragEnd=Pt,this.onError=_t,this.srcXConfig={folder:n,filename:a,imageList:bt,container:t,innerBox:this.innerBox,apiVersion:l,ciParams:Mt,lazyload:L,amount:this.amountX,indexZeroBase:p,autoplayReverse:v,orientation:P.X},this.srcYConfig={...this.srcXConfig,filename:r,imageList:yt,orientation:P.Y,amount:this.amountY},o&&this.removeEvents(),this.attachEvents(x,y,g),o)return;const ni=(this.fullscreenView?document.body:this.container).offsetWidth,ri=this.allowSpinX&&!bt.length?wt(this.srcXConfig,ni):null,ai=this.allowSpinY&&!yt.length?wt(this.srcYConfig,ni):null,li=hn=>{xe({cdnPathX:ri,cdnPathY:ai,configX:this.srcXConfig,configY:this.srcYConfig,onImageLoad:(Yt,dn,pn)=>this.onImageLoad(Yt,dn,pn),onFirstImageLoad:Yt=>this.onFirstImageLoaded(hn,Yt),onAllImagesLoad:this.onAllImagesLoaded.bind(this),onError:Yt=>this.emit("onError",Yt)})};this.allowSpinX?Te(ri,this.srcXConfig,li):this.allowSpinY&&Te(ai,this.srcYConfig,li)}}const oi=typeof navigator<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);class si{constructor(){this.views=new Map,this.initAll=this.initAll.bind(this),this.getViews=this.getViews.bind(this),this.memoryObserver=null,this.memoryManagementAutoEnabled=!1}generateId(){return`ci360-${Math.random().toString(36).slice(2,11)}`}init(t,i,o){if(!t)return;const s=t.id||this.generateId();t.id||(t.id=s);const n=new Wt(t,i,o);return this.views.set(s,n),oi&&!this.memoryManagementAutoEnabled&&(this.memoryManagementAutoEnabled=!0,setTimeout(()=>this.enableMemoryManagement(),100)),n}initAll(t="cloudimage-360"){[...document.querySelectorAll(`.${t}`)].filter(Boolean).forEach(o=>{const s=o.id||this.generateId();o.id||(o.id=s);const n=new Wt(o);this.views.set(s,n)}),oi&&!this.memoryManagementAutoEnabled&&this.views.size>0&&(this.memoryManagementAutoEnabled=!0,setTimeout(()=>this.enableMemoryManagement(),100))}destroy(t){const i=this.getViewById(t);i&&(i.destroy(),this.views.delete(t))}destroyAll(){this.views.forEach(t=>{t.destroy()}),this.views.clear()}getViewById(t){return this.views.get(t)}getViews(){return Array.from(this.views.values())}updateView(t,i){const o=this.getViewById(t);if(!o)return null;const s={...o.viewerConfig,...i};o.destroy();const n=document.getElementById(t);return this.init(n,s)}enableMemoryManagement(t={}){this.memoryObserver&&this.memoryObserver.disconnect();const i=t.rootMargin||"200px";this.memoryObserver=new IntersectionObserver(o=>{o.forEach(s=>{const n=this.getViewById(s.target.id);n&&(s.isIntersecting?n.isMemoryReleased&&n.reloadImages():!n.isMemoryReleased&&n.isReady&&n.releaseMemory())})},{rootMargin:i}),this.views.forEach((o,s)=>{const n=document.getElementById(s);n&&this.memoryObserver.observe(n)}),this.boundVisibilityHandler=()=>{document.hidden?this.views.forEach(o=>{!o.isMemoryReleased&&o.isReady&&o.releaseMemory()}):this.views.forEach((o,s)=>{if(o.isMemoryReleased){const n=document.getElementById(s);if(n){const l=n.getBoundingClientRect();l.top<window.innerHeight&&l.bottom>0&&o.reloadImages()}}})},document.addEventListener("visibilitychange",this.boundVisibilityHandler)}disableMemoryManagement(){this.memoryObserver&&(this.memoryObserver.disconnect(),this.memoryObserver=null),this.boundVisibilityHandler&&(document.removeEventListener("visibilitychange",this.boundVisibilityHandler),this.boundVisibilityHandler=null)}}return window.CI360=si,si}();