js-cloudimage-360-view 4.9.2 → 4.9.3
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.
- package/README.md +3 -3
- package/dist/js-cloudimage-360-view.min.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ Add the library via CDN and create your first 360 viewer in seconds:
|
|
|
101
101
|
|
|
102
102
|
```html
|
|
103
103
|
<!-- Add the library (CSS is auto-injected) -->
|
|
104
|
-
<script src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/4.9.
|
|
104
|
+
<script src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/4.9.3/js-cloudimage-360-view.min.js?vh=997be0&func=proxy"></script>
|
|
105
105
|
|
|
106
106
|
<!-- Create a container with data attributes -->
|
|
107
107
|
<div
|
|
@@ -125,7 +125,7 @@ Add the library via CDN and create your first 360 viewer in seconds:
|
|
|
125
125
|
### Option 1: CDN (Recommended for Quick Setup)
|
|
126
126
|
|
|
127
127
|
```html
|
|
128
|
-
<script src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/4.9.
|
|
128
|
+
<script src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/4.9.3/js-cloudimage-360-view.min.js?vh=997be0&func=proxy"></script>
|
|
129
129
|
```
|
|
130
130
|
|
|
131
131
|
> **Note:** CSS is automatically injected by the script - no separate stylesheet needed.
|
|
@@ -506,7 +506,7 @@ All options can be set via JavaScript config or HTML data attributes.
|
|
|
506
506
|
| `zoomControls` | `data-zoom-controls` | `true` | Show zoom control buttons (zoom in, zoom out, reset) |
|
|
507
507
|
| `zoomControlsPosition` | `data-zoom-controls-position` | `'bottom-right'` | Position of zoom controls toolbar. Values: `'top-left'`, `'top-center'`, `'top-right'`, `'bottom-left'`, `'bottom-center'`, `'bottom-right'` |
|
|
508
508
|
| `scrollHint` | `data-scroll-hint` | `true` | Show "Ctrl + scroll to zoom" hint on scroll |
|
|
509
|
-
| `bottomCircle` | `data-bottom-circle` | `
|
|
509
|
+
| `bottomCircle` | `data-bottom-circle` | `false` | Show 360° progress indicator |
|
|
510
510
|
| `bottomCircleOffset` | `data-bottom-circle-offset` | `5` | Progress indicator offset (px) |
|
|
511
511
|
| `initialIconShown` | `data-initial-icon` | `true` | Show 360° icon on load |
|
|
512
512
|
| `lazyload` | `data-lazyload` | `true` | Enable lazy loading |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var CI360=function(){"use strict";var Mn=Object.defineProperty;var On=(it,B,pt)=>B in it?Mn(it,B,{enumerable:!0,configurable:!0,writable:!0,value:pt}):it[B]=pt;var bi=(it,B,pt)=>On(it,typeof B!="symbol"?B+"":B,pt);var it=document.createElement("style");it.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: rgba(255, 255, 255, .15);--ci360-initial-icon-color: #ffffff;--ci360-initial-icon-size: 100px;--ci360-initial-icon-shadow: 0 2px 16px rgba(0, 0, 0, .08);--ci360-initial-icon-border-radius: 16px;--ci360-spinner-color: rgba(0, 0, 0, .2);--ci360-spinner-accent: #505050;--ci360-spinner-size: 30px;--ci360-fullscreen-bg: #ffffff;--ci360-zoom-controls-border-radius: 8px;--ci360-scroll-hint-bg: rgba(0, 0, 0, .7);--ci360-scroll-hint-color: #ffffff;--ci360-scroll-hint-border-radius: 20px;--ci360-focus-color: #0066cc;--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-spinner-color: rgba(255, 255, 255, .2);--ci360-spinner-accent: #e0e0e0;--ci360-fullscreen-bg: #1a1a1f;--ci360-zoom-controls-bg: rgba(40, 40, 45, .9);--ci360-zoom-controls-bg-hover: rgba(55, 55, 60, .95);--ci360-zoom-controls-color: #e0e0e0;--ci360-zoom-controls-color-hover: #ffffff;--ci360-zoom-controls-shadow: 0 2px 8px rgba(0, 0, 0, .4);--ci360-scroll-hint-bg: rgba(255, 255, 255, .15);--ci360-scroll-hint-color: #e0e0e0;--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-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);background-color:var(--ci360-initial-icon-bg);box-shadow:var(--ci360-initial-icon-shadow);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);transition:all .3s ease;color:var(--ci360-initial-icon-color);display:flex;align-items:center;justify-content:center;z-index:21;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:12px 16px}.cloudimage-initial-icon svg{width:100%;height:auto;color:var(--ci360-initial-icon-color);fill:var(--ci360-initial-icon-color)}.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{width:100%;height:100%;background-color:var(--ci360-fullscreen-bg)}.cloudimage-360--fullscreen .cloudimage-360-inner-box{height:100%;display:flex;justify-content:center;align-items:center}.cloudimage-360--fullscreen canvas{width:auto!important;max-width:100%;max-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-zoom-controls{position:absolute;display:flex;flex-direction:row;gap:4px;z-index:100;opacity:0;pointer-events:none;transition:opacity .2s ease;background:var(--ci360-zoom-controls-bg, var(--ci360-button-bg));border-radius:var(--ci360-zoom-controls-border-radius);box-shadow:var(--ci360-zoom-controls-shadow, var(--ci360-button-shadow));padding:4px;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}.cloudimage-360-zoom-controls.visible{opacity:1;pointer-events:auto}.cloudimage-360-zoom-controls[data-position=bottom-left]{bottom:12px;left:12px}.cloudimage-360-zoom-controls[data-position=bottom-right]{bottom:12px;right:12px}.cloudimage-360-zoom-controls[data-position=top-left]{top:12px;left:12px}.cloudimage-360-zoom-controls[data-position=top-right]{top:12px;right:12px}.cloudimage-360-zoom-controls[data-position=top-center]{top:12px;left:50%;transform:translate(-50%)}.cloudimage-360-zoom-controls[data-position=bottom-center]{bottom:12px;left:50%;transform:translate(-50%)}.cloudimage-360-zoom-btn{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;border-radius:calc(var(--ci360-zoom-controls-border-radius) - 2px);cursor:pointer;padding:0;color:var(--ci360-zoom-controls-color, var(--ci360-icon-color));transition:background-color .15s ease,color .15s ease}.cloudimage-360-zoom-btn:hover:not(:disabled){background:var(--ci360-zoom-controls-bg-hover, var(--ci360-button-bg-hover));color:var(--ci360-zoom-controls-color-hover, var(--ci360-icon-color-hover))}.cloudimage-360-zoom-btn:disabled{opacity:.3;cursor:default}.cloudimage-360-zoom-btn:focus{outline:none}.cloudimage-360-zoom-btn:focus-visible{outline:2px solid var(--ci360-focus-color);outline-offset:-2px}.cloudimage-360-zoom-btn svg{width:18px;height:18px;stroke:currentColor}.cloudimage-360-zoom-separator{width:1px;align-self:stretch;margin:6px 0;background:#80808033}.cloudimage-360-scroll-hint{position:absolute;bottom:50%;left:50%;transform:translate(-50%,50%);background:var(--ci360-scroll-hint-bg);color:var(--ci360-scroll-hint-color);padding:8px 16px;border-radius:var(--ci360-scroll-hint-border-radius);font-size:13px;font-family:system-ui,-apple-system,sans-serif;font-weight:500;white-space:nowrap;pointer-events:none;z-index:200;opacity:0;transition:opacity .3s ease;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}.cloudimage-360-scroll-hint.visible{opacity:1}.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 .cloudimage-360-hotspot-timeline{bottom:0}.cloudimage-360--fullscreen .cloudimage-360-hints-overlay{padding-bottom:32px}.cloudimage-360--fullscreen .cloudimage-360-zoom-controls[data-position^=bottom]{bottom:38px}.cloudimage-360--fullscreen .cloudimage-360-inner-box.has-hotspot-timeline .cloudimage-360-hints-overlay{padding-bottom:72px}.cloudimage-360--fullscreen .cloudimage-360-inner-box.has-hotspot-timeline .cloudimage-360-zoom-controls[data-position^=bottom]{bottom:72px}.cloudimage-360-hotspot-container{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:20}.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--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--navigate{display:inline-flex;align-items:center;justify-content:center;background:var(--ci360-hotspot-navigate-bg, #6366f1);border-color:var(--ci360-hotspot-navigate-border-color, rgba(255, 255, 255, .9))}.ci360-navigate-icon{width:14px;height:14px;color:#fff;pointer-events:none}.cloudimage-360-hotspot--navigate.cloudimage-360-hotspot--pulse{animation:none}.cloudimage-360-hotspot--navigate:hover,.cloudimage-360-hotspot--navigate:focus-visible{transform:translate(-50%,-50%) scale(1.15);box-shadow:0 0 0 3px #6366f166}.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}button.ci360-popper-cta{cursor:pointer;border:none;font:inherit;width:100%}.ci360-popper-cta:focus-visible{outline:3px solid var(--ci360-focus-color, #0066cc);outline-offset:2px}
|
|
1
|
+
var _CI360_iife=function(){"use strict";var Ln=Object.defineProperty;var Mn=(it,B,pt)=>B in it?Ln(it,B,{enumerable:!0,configurable:!0,writable:!0,value:pt}):it[B]=pt;var bi=(it,B,pt)=>Mn(it,typeof B!="symbol"?B+"":B,pt);var it=document.createElement("style");it.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: rgba(255, 255, 255, .15);--ci360-initial-icon-color: #ffffff;--ci360-initial-icon-size: 100px;--ci360-initial-icon-shadow: 0 2px 16px rgba(0, 0, 0, .08);--ci360-initial-icon-border-radius: 16px;--ci360-spinner-color: rgba(0, 0, 0, .2);--ci360-spinner-accent: #505050;--ci360-spinner-size: 30px;--ci360-fullscreen-bg: #ffffff;--ci360-zoom-controls-border-radius: 8px;--ci360-scroll-hint-bg: rgba(0, 0, 0, .7);--ci360-scroll-hint-color: #ffffff;--ci360-scroll-hint-border-radius: 20px;--ci360-focus-color: #0066cc;--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-spinner-color: rgba(255, 255, 255, .2);--ci360-spinner-accent: #e0e0e0;--ci360-fullscreen-bg: #1a1a1f;--ci360-zoom-controls-bg: rgba(40, 40, 45, .9);--ci360-zoom-controls-bg-hover: rgba(55, 55, 60, .95);--ci360-zoom-controls-color: #e0e0e0;--ci360-zoom-controls-color-hover: #ffffff;--ci360-zoom-controls-shadow: 0 2px 8px rgba(0, 0, 0, .4);--ci360-scroll-hint-bg: rgba(255, 255, 255, .15);--ci360-scroll-hint-color: #e0e0e0;--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-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);background-color:var(--ci360-initial-icon-bg);box-shadow:var(--ci360-initial-icon-shadow);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);transition:all .3s ease;color:var(--ci360-initial-icon-color);display:flex;align-items:center;justify-content:center;z-index:21;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:12px 16px}.cloudimage-initial-icon svg{width:100%;height:auto;color:var(--ci360-initial-icon-color);fill:var(--ci360-initial-icon-color)}.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{width:100%;height:100%;background-color:var(--ci360-fullscreen-bg)}.cloudimage-360--fullscreen .cloudimage-360-inner-box{height:100%;display:flex;justify-content:center;align-items:center}.cloudimage-360--fullscreen canvas{width:auto!important;max-width:100%;max-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-zoom-controls{position:absolute;display:flex;flex-direction:row;gap:4px;z-index:100;opacity:0;pointer-events:none;transition:opacity .2s ease;background:var(--ci360-zoom-controls-bg, var(--ci360-button-bg));border-radius:var(--ci360-zoom-controls-border-radius);box-shadow:var(--ci360-zoom-controls-shadow, var(--ci360-button-shadow));padding:4px;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}.cloudimage-360-zoom-controls.visible{opacity:1;pointer-events:auto}.cloudimage-360-zoom-controls[data-position=bottom-left]{bottom:12px;left:12px}.cloudimage-360-zoom-controls[data-position=bottom-right]{bottom:12px;right:12px}.cloudimage-360-zoom-controls[data-position=top-left]{top:12px;left:12px}.cloudimage-360-zoom-controls[data-position=top-right]{top:12px;right:12px}.cloudimage-360-zoom-controls[data-position=top-center]{top:12px;left:50%;transform:translate(-50%)}.cloudimage-360-zoom-controls[data-position=bottom-center]{bottom:12px;left:50%;transform:translate(-50%)}.cloudimage-360-zoom-btn{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border:none;background:transparent;border-radius:calc(var(--ci360-zoom-controls-border-radius) - 2px);cursor:pointer;padding:0;color:var(--ci360-zoom-controls-color, var(--ci360-icon-color));transition:background-color .15s ease,color .15s ease}.cloudimage-360-zoom-btn:hover:not(:disabled){background:var(--ci360-zoom-controls-bg-hover, var(--ci360-button-bg-hover));color:var(--ci360-zoom-controls-color-hover, var(--ci360-icon-color-hover))}.cloudimage-360-zoom-btn:disabled{opacity:.3;cursor:default}.cloudimage-360-zoom-btn:focus{outline:none}.cloudimage-360-zoom-btn:focus-visible{outline:2px solid var(--ci360-focus-color);outline-offset:-2px}.cloudimage-360-zoom-btn svg{width:18px;height:18px;stroke:currentColor}.cloudimage-360-zoom-separator{width:1px;align-self:stretch;margin:6px 0;background:#80808033}.cloudimage-360-scroll-hint{position:absolute;bottom:50%;left:50%;transform:translate(-50%,50%);background:var(--ci360-scroll-hint-bg);color:var(--ci360-scroll-hint-color);padding:8px 16px;border-radius:var(--ci360-scroll-hint-border-radius);font-size:13px;font-family:system-ui,-apple-system,sans-serif;font-weight:500;white-space:nowrap;pointer-events:none;z-index:200;opacity:0;transition:opacity .3s ease;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}.cloudimage-360-scroll-hint.visible{opacity:1}.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 .cloudimage-360-hotspot-timeline{bottom:0}.cloudimage-360--fullscreen .cloudimage-360-hints-overlay{padding-bottom:32px}.cloudimage-360--fullscreen .cloudimage-360-zoom-controls[data-position^=bottom]{bottom:38px}.cloudimage-360--fullscreen .cloudimage-360-inner-box.has-hotspot-timeline .cloudimage-360-hints-overlay{padding-bottom:72px}.cloudimage-360--fullscreen .cloudimage-360-inner-box.has-hotspot-timeline .cloudimage-360-zoom-controls[data-position^=bottom]{bottom:72px}.cloudimage-360-hotspot-container{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:20}.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--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--navigate{display:inline-flex;align-items:center;justify-content:center;background:var(--ci360-hotspot-navigate-bg, #6366f1);border-color:var(--ci360-hotspot-navigate-border-color, rgba(255, 255, 255, .9))}.ci360-navigate-icon{width:14px;height:14px;color:#fff;pointer-events:none}.cloudimage-360-hotspot--navigate.cloudimage-360-hotspot--pulse{animation:none}.cloudimage-360-hotspot--navigate:hover,.cloudimage-360-hotspot--navigate:focus-visible{transform:translate(-50%,-50%) scale(1.15);box-shadow:0 0 0 3px #6366f166}.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}button.ci360-popper-cta{cursor:pointer;border:none;font:inherit;width:100%}.ci360-popper-cta:focus-visible{outline:3px solid var(--ci360-focus-color, #0066cc);outline-offset:2px}
|
|
2
2
|
/*$vite$:1*/`,document.head.appendChild(it);var B=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ke="Expected a function",Pe=NaN,yi="[object Symbol]",wi=/^\s+|\s+$/g,xi=/^[-+]0x[0-9a-f]+$/i,Ci=/^0b[01]+$/i,Ii=/^0o[0-7]+$/i,ki=parseInt,Pi=typeof B=="object"&&B&&B.Object===Object&&B,Ei=typeof self=="object"&&self&&self.Object===Object&&self,zi=Pi||Ei||Function("return this")(),Ti=Object.prototype,Ai=Ti.toString,Xi=Math.max,Si=Math.min,ie=function(){return zi.Date.now()};function Yi(e,t,i){var o,s,n,r,a,l,h=0,c=!1,p=!1,m=!0;if(typeof e!="function")throw new TypeError(ke);t=Ee(t)||0,Rt(i)&&(c=!!i.leading,p="maxWait"in i,n=p?Xi(Ee(i.maxWait)||0,t):n,m="trailing"in i?!!i.trailing:m);function u(f){var b=o,C=s;return o=s=void 0,h=f,r=e.apply(C,b),r}function x(f){return h=f,a=setTimeout(I,t),c?u(f):r}function v(f){var b=f-l,C=f-h,E=t-b;return p?Si(E,n-C):E}function y(f){var b=f-l,C=f-h;return l===void 0||b>=t||b<0||p&&C>=n}function I(){var f=ie();if(y(f))return k(f);a=setTimeout(I,v(f))}function k(f){return a=void 0,m&&o?u(f):(o=s=void 0,r)}function w(){a!==void 0&&clearTimeout(a),h=0,o=l=s=a=void 0}function g(){return a===void 0?r:k(ie())}function P(){var f=ie(),b=y(f);if(o=arguments,s=this,l=f,b){if(a===void 0)return x(l);if(p)return a=setTimeout(I,t),u(l)}return a===void 0&&(a=setTimeout(I,t)),r}return P.cancel=w,P.flush=g,P}function Li(e,t,i){var o=!0,s=!0;if(typeof e!="function")throw new TypeError(ke);return Rt(i)&&(o="leading"in i?!!i.leading:o,s="trailing"in i?!!i.trailing:s),Yi(e,t,{leading:o,maxWait:t,trailing:s})}function Rt(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Mi(e){return!!e&&typeof e=="object"}function Oi(e){return typeof e=="symbol"||Mi(e)&&Ai.call(e)==yi}function Ee(e){if(typeof e=="number")return e;if(Oi(e))return Pe;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(wi,"");var i=Ci.test(e);return i||Ii.test(e)?ki(e.slice(2),i?2:8):xi.test(e)?Pe:+e}var Hi=Li;const ze=pt(Hi),X={SPIN_X:"spin-x",SPIN_Y:"spin-y",SPIN_XY:"spin-xy",SPIN_YX:"spin-yx"},Ri=[!1,0,null,void 0,"false","0","null","undefined"],Y={X:"x-axis",Y:"y-axis"},Zi=[37,39],Di=[38,40],Te=typeof navigator<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?32:10,Bi=150,Gi=150,_i=200,Ae=50,Fi=50,Ni=50,d={folder:"/",apiVersion:"v7",filenameX:"image-{index}.jpg",filenameY:null,imageListX:null,imageListY:null,filenameGrid:null,imageListGrid:null,indexZeroBase:0,amountX:0,amountY:0,speed:80,dragSpeed:150,draggable:!0,swipeable:!0,keys:!1,keysReverse:!1,autoplay:!1,autoplayBehavior:X.SPIN_X,playOnce:!1,autoplayReverse:!1,pointerZoom:0,pointerZoomTrigger:"dblclick",fullscreen:!1,zoomMax:5,zoomStep:.5,zoomControls:!0,zoomControlsPosition:"bottom-right",scrollHint:!0,bottomCircle:!1,bottomCircleOffset:5,ciToken:null,ciFilters:null,ciTransformation:null,lazyload:!0,dragReverse:!1,stopAtEdges:!1,stopAtEdgesX:null,stopAtEdgesY:null,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,cropAspectRatio:null,cropGravity:null,onReady:null,onLoad:null,onSpin:null,onAutoplayStart:null,onAutoplayStop:null,onFullscreenOpen:null,onFullscreenClose:null,onZoomIn:null,onZoomOut:null,onDragStart:null,onDragEnd:null,onHotspotOpen:null,onHotspotClose:null,onProductClick:null,onNavigate:null,onError:null},Wi=e=>({folder:z(e,"folder",d.folder),apiVersion:z(e,"api-version",d.apiVersion),filenameX:z(e,"filename")||z(e,"filename-x")||d.filenameX,filenameY:z(e,"filename-y",d.filenameY),imageListX:z(e,"image-list-x",d.imageListX),imageListY:z(e,"image-list-y",d.imageListY),filenameGrid:z(e,"filename-grid",d.filenameGrid),imageListGrid:z(e,"image-list-grid",d.imageListGrid),indexZeroBase:parseInt(z(e,"index-zero-base",d.indexZeroBase),10),amountX:parseInt(z(e,"amount-x",d.amountX),10),amountY:parseInt(z(e,"amount-y",d.amountY),10),speed:parseInt(z(e,"speed",d.speed),10),dragSpeed:parseInt(z(e,"drag-speed",d.dragSpeed),10),draggable:S(e,"draggable",d.draggable),swipeable:S(e,"swipeable",d.swipeable),keys:S(e,"keys",d.keys),keysReverse:S(e,"keys-reverse",d.keysReverse),autoplay:S(e,"autoplay",d.autoplay),autoplayBehavior:z(e,"autoplay-behavior",d.autoplayBehavior),playOnce:S(e,"play-once",d.playOnce),autoplayReverse:S(e,"autoplay-reverse",d.autoplayReverse),pointerZoom:parseFloat(z(e,"pointer-zoom",d.pointerZoom)),pointerZoomTrigger:z(e,"pointer-zoom-trigger",d.pointerZoomTrigger),fullscreen:S(e,"fullscreen")||S(e,"full-screen",d.fullscreen),magnifier:z(e,"magnifier",null)!=null?parseFloat(z(e,"magnifier",null)):null,zoomMax:parseFloat(z(e,"zoom-max",d.zoomMax)),zoomStep:parseFloat(z(e,"zoom-step",d.zoomStep)),zoomControls:!It(e,"zoom-controls"),zoomControlsPosition:z(e,"zoom-controls-position",d.zoomControlsPosition),scrollHint:!It(e,"scroll-hint"),bottomCircleOffset:parseInt(z(e,"bottom-circle-offset",d.bottomCircleOffset),10),ciToken:z(e,"responsive",d.ciToken),ciFilters:z(e,"filters",d.ciFilters),ciTransformation:z(e,"transformation",d.ciTransformation),lazyload:S(e,"lazyload",d.lazyload),dragReverse:S(e,"drag-reverse",d.dragReverse),stopAtEdges:S(e,"stop-at-edges",d.stopAtEdges),stopAtEdgesX:z(e,"stop-at-edges-x",null)!==null?S(e,"stop-at-edges-x",null):null,stopAtEdgesY:z(e,"stop-at-edges-y",null)!==null?S(e,"stop-at-edges-y",null):null,imageInfo:S(e,"info",d.imageInfo),initialIconShown:!It(e,"initial-icon"),bottomCircle:S(e,"bottom-circle",d.bottomCircle),hide360Logo:S(e,"hide-360-logo",d.hide360Logo),logoSrc:z(e,"logo-src",d.logoSrc),inertia:S(e,"inertia",d.inertia),pinchZoom:S(e,"pinch-zoom",d.pinchZoom),hints:!It(e,"hints"),theme:z(e,"theme",d.theme),markerTheme:z(e,"marker-theme",d.markerTheme),brandColor:z(e,"brand-color",d.brandColor),hotspotTrigger:z(e,"hotspot-trigger",d.hotspotTrigger),hotspotTimelineOnClick:!It(e,"hotspot-timeline-on-click"),aspectRatio:z(e,"aspect-ratio",d.aspectRatio),cropAspectRatio:z(e,"crop-aspect-ratio",d.cropAspectRatio),cropGravity:z(e,"crop-gravity",d.cropGravity)}),Vi=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&&t.push("magnifier option is deprecated and will be ignored. Use zoomMax instead."),e.pointerZoomTrigger==="click"&&t.push('pointerZoomTrigger: "click" is deprecated. Zoom is now always triggered by double-click. Use dblclick trigger or the new zoom controls.');const i=!!(e.filenameGrid||e.imageListGrid);if(!i&&!e.folder&&!e.imageListX&&!e.imageListY&&t.push("Either folder or imageListX/imageListY is required"),!i&&e.folder&&!e.amountX&&!e.imageListX&&t.push("amountX is required when using folder (unless imageListX is provided)"),e.filenameGrid&&(!e.amountX||e.amountX<=0||!e.amountY||e.amountY<=0)&&t.push("filenameGrid requires both amountX > 0 and amountY > 0"),e.imageListGrid){(!e.amountX||e.amountX<=0||!e.amountY||e.amountY<=0)&&t.push("imageListGrid requires both amountX > 0 and amountY > 0");const s=Array.isArray(e.imageListGrid)?e.imageListGrid.flat():[];s.length&&e.amountX&&e.amountY&&s.length!==e.amountX*e.amountY&&t.push(`imageListGrid length (${s.length}) does not match amountX * amountY (${e.amountX*e.amountY})`)}const o=["spin-x","spin-y","spin-xy","spin-yx"];return e.autoplayBehavior&&!o.includes(e.autoplayBehavior)&&t.push(`autoplayBehavior should be one of: ${o.join(", ")}`),t.forEach(s=>{console.warn(`CloudImage 360: ${s}`)}),t.length===0},ji=e=>(Vi(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,filenameGrid:e.filenameGrid||d.filenameGrid,imageListGrid:e.imageListGrid||d.imageListGrid,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:e.magnifier!=null?parseFloat(e.magnifier):null,zoomMax:parseFloat(e.zoomMax??d.zoomMax),zoomStep:parseFloat(e.zoomStep??d.zoomStep),zoomControls:e.zoomControls??d.zoomControls,zoomControlsPosition:e.zoomControlsPosition||d.zoomControlsPosition,scrollHint:e.scrollHint??d.scrollHint,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,stopAtEdgesX:e.stopAtEdgesX??d.stopAtEdgesX,stopAtEdgesY:e.stopAtEdgesY??d.stopAtEdgesY,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,cropAspectRatio:e.cropAspectRatio||d.cropAspectRatio,cropGravity:e.cropGravity||d.cropGravity,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,onHotspotOpen:e.onHotspotOpen??d.onHotspotOpen,onHotspotClose:e.onHotspotClose??d.onHotspotClose,onProductClick:e.onProductClick??d.onProductClick,onNavigate:e.onNavigate??d.onNavigate,onError:e.onError??d.onError}),z=(e,t,i)=>e.getAttribute(t)||e.getAttribute(`data-${t}`)||i,S=(e,t,i)=>{if(!(e.hasAttribute(t)||e.hasAttribute(`data-${t}`)))return i;const s=z(e,t,null);return s!=="false"&&s!=="0"},It=(e,t)=>z(e,t,null)==="false",$i=(e=1)=>{const t=Math.round(window.devicePixelRatio||1);return parseInt(e)*t},Ui=(e,t,i)=>{try{if(new URL(e).origin.includes("cloudimg"))return e}catch{}const o=e.startsWith("/")?e.slice(1):e;return`https://${t}.cloudimg.io/${i}${o}`},Xe=(e,t)=>e?`ar=${e}&gravity=${t||"auto"}`:"",Ki=({ciTransformation:e,responsiveWidth:t,ciFilters:i})=>{const o=`width=${t}`,s=e||o,n=i?`&f=${i}`:"";return`${s}${n}`},rt=(e,t)=>{const{folder:i,apiVersion:o,filename:s="",ciParams:n}=e,{ciToken:r,ciFilters:a,ciTransformation:l,cropAspectRatio:h,cropGravity:c}=n||{},p=`${i}${s}`;if(!r||!t){const w=Xe(h,c);if(!w)return p;const g=p.includes("?")?"&":"?";return`${p}${g}${w}`}const m=Ri.includes(o)?null:o,u=m?`${m}/`:"",x=$i(t),v=Ui(p,r,u),y=Ki({ciTransformation:l,responsiveWidth:x,ciFilters:a}),I=Xe(h,c),k=[y,I].filter(Boolean).join("&");return`${v}${k?"?":""}${k}`},Zt=(e,t=0)=>(e+="",e.length>=t?e:new Array(t-e.length+1).join("0")+e),qi=(e,{amount:t=0,indexZeroBase:i=0}={})=>Array.from({length:t},(o,s)=>e.replace("{index}",Zt(s+1,i))),Ji=(e,{amountX:t=0,amountY:i=0,indexZeroBase:o=0}={})=>{const s=[];for(let n=0;n<i;n++)for(let r=0;r<t;r++)s.push(e.replace("{indexX}",Zt(r+1,o)).replace("{indexY}",Zt(n+1,o)));return s},Qi=typeof navigator<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?3:6,Se=({imagesUrls:e,onFirstImageLoad:t,onImageLoad:i,onAllImagesLoad:o,onError:s,autoplayReverse:n})=>{let r=0,a=0;const l=e.length,h=[],c=[];let p=0,m=0;const u=[],x=(f,b,C=!1)=>{const E={message:`Failed to load image: ${f}`,url:f,index:b,isFirstImage:C};c.push(E),a++,s==null||s({error:E,errorCount:a,totalImages:l,errors:c})},v=()=>{r===l&&(o==null||o(h,{errorCount:a,errors:c}))},y=()=>{for(;p<Qi&&m<u.length;){const f=u[m];m++,I(e[f],f)}},I=(f,b)=>{p++;const C=new Image;C.crossOrigin="anonymous",C.src=f,C.onload=async()=>{try{const E=await createImageBitmap(C),T={src:f,bitmapImage:E,naturalWidth:C.naturalWidth,naturalHeight:C.naturalHeight};C.onload=null,C.onerror=null,C.src="",r++,p--,h[b]=T,i==null||i(T,b),v(),y()}catch{C.onload=null,C.onerror=null,C.src="",r++,p--,x(f,b),v(),y()}},C.onerror=()=>{C.onload=null,C.onerror=null,C.src="",r++,p--,x(f,b),v(),y()}},k=f=>{for(let b=0;b<e.length;b++)b!==f&&u.push(b);m=0,y()},w=new Image,g=n?e.length-1:0,P=e[g];w.crossOrigin="anonymous",w.src=P,w.onload=async()=>{try{const f=await createImageBitmap(w),b={src:P,bitmapImage:f,naturalWidth:w.naturalWidth,naturalHeight:w.naturalHeight};w.onload=null,w.onerror=null,w.src="",h[g]=b,r++,t==null||t(b),i==null||i(b,g),l===1?v():k(g)}catch{w.onload=null,w.onerror=null,w.src="",r++,x(P,g,!0),l===1?v():k(g)}},w.onerror=()=>{w.onload=null,w.onerror=null,w.src="",r++,x(P,g,!0),l===1?v():k(g)}},Ye=({cdnPathX:e,cdnPathY:t,configX:i,configY:o,onFirstImageLoad:s,onImageLoad:n,onAllImagesLoad:r,onError:a})=>{let l={x:!1,y:!1},h=[],c=[],p={errorCount:0,errors:[]},m={errorCount:0,errors:[]};const u=e||i.imageList.length,x=t||o.imageList.length,v=()=>{if(l.x&&l.y){const I={errorCount:p.errorCount+m.errorCount,errors:[...p.errors,...m.errors]};r==null||r(h,c,I)}},y=({cdnPath:I,config:k,orientation:w,loadedImages:g,loadStats:P,onFirstImageLoad:f})=>{const b=w===Y.X,C=k.imageList.length?k.imageList:qi(I,k);Se({imagesUrls:C,onFirstImageLoad:f,onImageLoad:(E,T)=>{n==null||n(E,T,w),g[T]=E},onError:E=>{a==null||a({...E,orientation:w})},onAllImagesLoad:(E,T)=>{g.length=0,E.forEach((A,M)=>{A&&(g[M]=A)}),P.errorCount=T.errorCount,P.errors=T.errors.map(A=>({...A,orientation:w})),l[b?"x":"y"]=!0,v()},autoplayReverse:k.autoplayReverse})};u?y({cdnPath:e,config:i,orientation:Y.X,loadedImages:h,loadStats:p,onFirstImageLoad:s}):l.x=!0,x?y({cdnPath:t,config:o,orientation:Y.Y,loadedImages:c,loadStats:m,onFirstImageLoad:u?void 0:s}):l.y=!0,!u&&!x&&v()},Le=({cdnPath:e,config:t,onFirstImageLoad:i,onImageLoad:o,onAllImagesLoad:s,onError:n})=>{const r=t.imageList&&t.imageList.length?t.imageList:Ji(e,t);Se({imagesUrls:r,onFirstImageLoad:i,onImageLoad:(a,l)=>{o==null||o(a,l)},onAllImagesLoad:(a,l)=>{s==null||s(a,l)},onError:a=>{n==null||n(a)},autoplayReverse:t.autoplayReverse})},to=`
|
|
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"/>
|
|
@@ -62,4 +62,4 @@ var CI360=function(){"use strict";var Mn=Object.defineProperty;var On=(it,B,pt)=
|
|
|
62
62
|
object-fit: contain;
|
|
63
63
|
object-position: center;
|
|
64
64
|
filter: blur(10px);
|
|
65
|
-
`,o},se=(e,t,i)=>{const{innerBox:o,imageList:s,lazyload:n}=t||{},[r]=s,a=r||Xo(e,t),l=Eo(a),h=Ge(l,n,"cloudimage-lazy"),c=Ge(l,!1,"cloudimage-360-placeholder"),p=m=>{oe(o,".cloudimage-lazy"),i&&i({event:m,width:h.width,height:h.height,naturalWidth:h.naturalWidth,naturalHeight:h.naturalHeight,src:l})};h.onload=p,o.appendChild(h),o.appendChild(c),zo(h)},So=(e,t,i)=>{const o=e/i,s=t/i;return{zoomedWidth:o,zoomedHeight:s}},Yo=({pointerX:e,pointerY:t,imageData:i,zoomedWidth:o,zoomedHeight:s,drawWidth:n,drawHeight:r})=>{const{naturalWidth:a,naturalHeight:l}=i;let h=e/n*a-o/2,c=t/r*l-s/2;const p=Math.max(0,a-o),m=Math.max(0,l-s);return h=Math.max(0,Math.min(h,p)),c=Math.max(0,Math.min(c,m)),{zoomOffsetX:h,zoomOffsetY:c}},_e=(e,{bottom:t,top:i})=>{e?t():i()},Fe=(e,{left:t,right:i})=>{e?t():i()},Lo=({autoplayBehavior:e,spinY:t,reversed:i,loopTriggers:o})=>{switch(e){case X.SPIN_XY:case X.SPIN_YX:t?_e(i,o):Fe(i,o);break;case X.SPIN_Y:_e(i,o);break;case X.SPIN_X:default:Fe(i,o)}},Mo=({autoplayBehavior:e,activeImageX:t,activeImageY:i,amountX:o,amountY:s,autoplayReverse:n,isGridMode:r=!1})=>{const a=(l,h)=>{const c=h-1;return n?l===0:l===c};if(r)switch(e){case X.SPIN_X:return a(t,o);case X.SPIN_Y:return a(i,s);case X.SPIN_XY:case X.SPIN_YX:default:return a(t,o)&&a(i,s)}switch(e){case X.SPIN_XY:case X.SPIN_Y:return a(i,s);case X.SPIN_X:case X.SPIN_YX:default:return a(t,o)}},Oo=({autoplayBehavior:e,activeImageX:t,activeImageY:i,amountX:o,amountY:s,autoplayReverse:n,spinDirection:r,isGridMode:a=!1})=>{if(a)return!1;const l=t===(n?0:o-1),h=i===(n?0:s-1);return e===X.SPIN_XY||e===X.SPIN_YX?r==="x"&&l||r==="y"&&h:!1},Ho=(e,t,i)=>{if(!i)return"x";if(!t)return"y";switch(e){case X.SPIN_XY:return"x";case X.SPIN_YX:return"y";case X.SPIN_Y:return"y";case X.SPIN_X:default:return"x"}},Ro=e=>e==="x"?"y":"x",Ne=(e,t)=>{const i=[...Zi];return t?[...i,...Di].includes(e):i.includes(e)},We=({deltaX:e,deltaY:t,reversed:i,allowSpinX:o,allowSpinY:s,threshold:n=0})=>{const r=o&&!s||s&&!o?0:n,a=Math.abs(e),l=Math.abs(t);return o&&a-r>l?i?e>0?"left":"right":e>0?"right":"left":s&&l-r>a?i?t>0?"up":"down":t>0?"down":"up":null},Zo=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,Do=(e,t=150)=>{let i;return function(...o){clearTimeout(i),i=setTimeout(()=>{e.apply(this,o)},t)}},Bo=()=>document.fullscreenEnabled||document.webkitFullscreenEnabled,ne=()=>document.fullscreenElement||document.webkitFullscreenElement,Go=e=>e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():Promise.reject(new Error("Fullscreen API not supported")),Ve=()=>document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():Promise.reject(new Error("Fullscreen API not supported")),W=1;class _o{constructor(t,{zoomMax:i=5,zoomStep:o=.5,onZoomChange:s}={}){this.container=t,this.zoomMax=i,this.zoomStep=o,this.onZoomChange=s,this.zoom=1,this.panX=0,this.panY=0,this.drawWidth=0,this.drawHeight=0,this.isPanning=!1,this.panStartX=0,this.panStartY=0,this._onWheel=this._onWheel.bind(this),this._onDblClick=this._onDblClick.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onGestureStart=this._onGestureStart.bind(this),this._onGestureChange=this._onGestureChange.bind(this),this._onGestureEnd=this._onGestureEnd.bind(this),this._gestureBaseZoom=1,this._attach()}setDrawSize(t,i,o=!1){const s=this.drawWidth,n=this.drawHeight;this.drawWidth=t,this.drawHeight=i,o&&s&&n?(this.panX=this.panX/s*t,this.panY=this.panY/n*i,this._clampPan()):(this.panX=t/2,this.panY=i/2)}_attach(){this.container.addEventListener("wheel",this._onWheel,{passive:!1}),this.container.addEventListener("dblclick",this._onDblClick),typeof GestureEvent<"u"&&(this.container.addEventListener("gesturestart",this._onGestureStart),this.container.addEventListener("gesturechange",this._onGestureChange),this.container.addEventListener("gestureend",this._onGestureEnd))}destroy(){this.container.removeEventListener("wheel",this._onWheel),this.container.removeEventListener("dblclick",this._onDblClick),this._stopPanListeners(),typeof GestureEvent<"u"&&(this.container.removeEventListener("gesturestart",this._onGestureStart),this.container.removeEventListener("gesturechange",this._onGestureChange),this.container.removeEventListener("gestureend",this._onGestureEnd))}zoomIn(){this._applyZoom(this.zoom+this.zoomStep)}zoomOut(){this._applyZoom(this.zoom-this.zoomStep)}resetZoom(){this._applyZoom(W)}setZoom(t){this._applyZoom(t)}zoomTowardPoint(t,i,o){this._zoomTowardPoint(t,i,o)}getZoom(){return this.zoom}isZoomed(){return this.zoom>W}startPan(t,i){return this.zoom<=W?!1:(this.isPanning=!0,this.panStartX=t,this.panStartY=i,document.addEventListener("mousemove",this._onMouseMove),document.addEventListener("mouseup",this._onMouseUp),!0)}_stopPanListeners(){document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp)}_onMouseMove(t){if(!this.isPanning)return;const i=t.pageX-this.panStartX,o=t.pageY-this.panStartY;this.panStartX=t.pageX,this.panStartY=t.pageY,this._applyPan(this.panX-i,this.panY-o)}_onMouseUp(){this.isPanning=!1,this._stopPanListeners()}_onWheel(t){if(!t.ctrlKey&&!t.metaKey)return;t.preventDefault();let i=-t.deltaY;t.deltaMode===1&&(i*=40),t.deltaMode===2&&(i*=800);const o=Math.pow(2,i/300),s=this.zoom*o;this._zoomTowardPoint(s,t.clientX,t.clientY)}_onDblClick(t){t.target&&t.target.closest&&(t.target.closest(".cloudimage-360-button")||t.target.closest(".cloudimage-360-hotspot-timeline")||t.target.closest(".cloudimage-360-hotspot")||t.target.closest(".cloudimage-360-zoom-controls"))||(this.zoom>W?this._applyZoom(W):this._zoomTowardPoint(2,t.clientX,t.clientY))}_onGestureStart(t){t.preventDefault(),this._gestureBaseZoom=this.zoom}_onGestureChange(t){t.preventDefault();const i=this._gestureBaseZoom*t.scale;this._zoomTowardPoint(i,t.clientX,t.clientY)}_onGestureEnd(t){t.preventDefault()}handleKeyZoom(t){return t===187||t===107?(this.zoomIn(),!0):t===189||t===109?(this.zoomOut(),!0):t===48||t===96?(this.resetZoom(),!0):!1}handleKeyPan(t,i=50){if(this.zoom<=W)return!1;let o=0,s=0;switch(t){case 37:o=-i;break;case 39:o=i;break;case 38:s=-i;break;case 40:s=i;break;default:return!1}return this._applyPan(this.panX+o,this.panY+s),!0}applyTouchPan(t,i){this.zoom<=W||this._applyPan(this.panX-t,this.panY-i)}applyTouchZoom(t){this._applyZoom(t)}_zoomTowardPoint(t,i,o){var r;const s=Math.max(W,Math.min(t,this.zoomMax));if(s===this.zoom)return;const n=(r=this.container.querySelector("canvas"))==null?void 0:r.getBoundingClientRect();if(n){const a=(i-n.left)/n.width*this.drawWidth,l=(o-n.top)/n.height*this.drawHeight,h=s/this.zoom;this.panX=a+(this.panX-a)*h,this.panY=l+(this.panY-l)*h}this.zoom=s,this._clampPan(),this._emit()}_applyZoom(t){const i=Math.max(W,Math.min(t,this.zoomMax));i!==this.zoom&&(this.zoom=i,this.zoom<=W&&(this.panX=this.drawWidth/2,this.panY=this.drawHeight/2),this._clampPan(),this._emit())}_applyPan(t,i){this.panX=t,this.panY=i,this._clampPan(),this._emit()}_clampPan(){if(this.zoom<=W||!this.drawWidth||!this.drawHeight)return;const t=this.drawWidth/(2*this.zoom),i=this.drawHeight/(2*this.zoom);this.panX=Math.max(t,Math.min(this.panX,this.drawWidth-t)),this.panY=Math.max(i,Math.min(this.panY,this.drawHeight-i))}_emit(){typeof this.onZoomChange=="function"&&this.onZoomChange(this.zoom,this.panX,this.panY)}}class Fo{constructor(t,{onPinchZoom:i,onPan:o,onDoubleTap:s,getZoom:n,zoomMax:r=5}={}){this.container=t,this.onPinchZoom=i,this.onPan=o,this.onDoubleTap=s,this.getZoom=n,this.zoomMax=r,this.isPinching=!1,this.initialPinchDistance=0,this.pinchBaseZoom=1,this.lastTouchX=0,this.lastTouchY=0,this.lastTapTime=0,this.lastTapX=0,this.lastTapY=0,this._onTouchStart=this._onTouchStart.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._attach()}_attach(){this.container.addEventListener("touchstart",this._onTouchStart,{passive:!1}),this.container.addEventListener("touchmove",this._onTouchMove,{passive:!1}),this.container.addEventListener("touchend",this._onTouchEnd,{passive:!1})}destroy(){this.container.removeEventListener("touchstart",this._onTouchStart),this.container.removeEventListener("touchmove",this._onTouchMove),this.container.removeEventListener("touchend",this._onTouchEnd)}_getPinchDistance(t,i){const o=t.pageX-i.pageX,s=t.pageY-i.pageY;return Math.sqrt(o*o+s*s)}_onTouchStart(t){if(t.touches){if(t.touches.length===2){t.preventDefault(),this.isPinching=!0,this.initialPinchDistance=this._getPinchDistance(t.touches[0],t.touches[1]),this.pinchBaseZoom=typeof this.getZoom=="function"?this.getZoom():1;return}if(t.touches.length===1){const i=t.touches[0];this.lastTouchX=i.pageX,this.lastTouchY=i.pageY;const o=Date.now(),s=o-this.lastTapTime,n=Math.abs(i.pageX-this.lastTapX),r=Math.abs(i.pageY-this.lastTapY);if(s<300&&n<30&&r<30){t.preventDefault(),t.stopPropagation(),this.lastTapTime=0,typeof this.onDoubleTap=="function"&&this.onDoubleTap(i.clientX,i.clientY);return}this.lastTapTime=o,this.lastTapX=i.pageX,this.lastTapY=i.pageY}}}_onTouchMove(t){if(t.touches){if(this.isPinching&&t.touches.length===2){t.preventDefault();const i=this._getPinchDistance(t.touches[0],t.touches[1]);if(this.initialPinchDistance===0){this.initialPinchDistance=i;return}const o=i/this.initialPinchDistance,s=Math.max(1,Math.min(this.pinchBaseZoom*o,this.zoomMax)),n=(t.touches[0].clientX+t.touches[1].clientX)/2,r=(t.touches[0].clientY+t.touches[1].clientY)/2;typeof this.onPinchZoom=="function"&&this.onPinchZoom(s,n,r);return}if(t.touches.length===1){if((typeof this.getZoom=="function"?this.getZoom():1)<=1)return;t.preventDefault();const o=t.touches[0],s=o.pageX-this.lastTouchX,n=o.pageY-this.lastTouchY;this.lastTouchX=o.pageX,this.lastTouchY=o.pageY,typeof this.onPan=="function"&&this.onPan(s,n)}}}_onTouchEnd(t){this.isPinching&&(!t.touches||t.touches.length<2)&&(this.isPinching=!1,this.initialPinchDistance=0,t.touches&&t.touches.length===1&&(this.lastTouchX=t.touches[0].pageX,this.lastTouchY=t.touches[0].pageY))}}const No='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" 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"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="11" x2="11" y1="8" y2="14"/><line x1="8" x2="14" y1="11" y2="11"/></svg>',Wo='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" 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"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="8" x2="14" y1="11" y2="11"/></svg>',Vo='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></svg>',jo=(e,{position:t="bottom-right",onZoomIn:i,onZoomOut:o,onReset:s,zoomMax:n=5}={})=>{const r=document.createElement("div");r.className="cloudimage-360-zoom-controls",r.setAttribute("data-position",t),r.setAttribute("role","toolbar"),r.setAttribute("aria-label","Zoom controls");const a=document.createElement("button");a.className="cloudimage-360-zoom-btn cloudimage-360-zoom-btn-in",a.setAttribute("aria-label","Zoom in"),a.innerHTML=No,a.addEventListener("click",p=>{p.stopPropagation(),typeof i=="function"&&i()});const l=document.createElement("button");l.className="cloudimage-360-zoom-btn cloudimage-360-zoom-btn-out",l.setAttribute("aria-label","Zoom out"),l.innerHTML=Wo,l.disabled=!0,l.addEventListener("click",p=>{p.stopPropagation(),typeof o=="function"&&o()});const h=document.createElement("button");h.className="cloudimage-360-zoom-btn cloudimage-360-zoom-btn-reset",h.setAttribute("aria-label","Reset zoom"),h.innerHTML=Vo,h.disabled=!0,h.addEventListener("click",p=>{p.stopPropagation(),typeof s=="function"&&s()});const c=document.createElement("span");return c.className="cloudimage-360-zoom-separator",r.appendChild(a),r.appendChild(l),r.appendChild(c),r.appendChild(h),e.appendChild(r),{element:r,updateState(p){a.disabled=p>=n,l.disabled=p<=1,h.disabled=p<=1},show(){r.classList.add("visible")},hide(){r.classList.remove("visible")},destroy(){r.parentNode&&r.parentNode.removeChild(r)}}},je="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHY9KHQsYSxlKT0+e2NvbnN0IHM9dC9lLG49YS9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sej0oe3BvaW50ZXJYOnQscG9pbnRlclk6YSxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOmcsbmF0dXJhbEhlaWdodDp1fT1lO2xldCBmPXQvaSpnLXMvMixtPWEvYyp1LW4vMjtjb25zdCB4PU1hdGgubWF4KDAsZy1zKSxPPU1hdGgubWF4KDAsdS1uKTtyZXR1cm4gZj1NYXRoLm1heCgwLE1hdGgubWluKGYseCkpLG09TWF0aC5tYXgoMCxNYXRoLm1pbihtLE8pKSx7em9vbU9mZnNldFg6Zix6b29tT2Zmc2V0WTptfX07bGV0IG8saCxyLGQsbCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIHQ9Pntjb25zdHthY3Rpb246YSxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpnLGltYWdlQXNwZWN0UmF0aW86dSxjb250YWluZXJXaWR0aDpmLGNvbnRhaW5lckhlaWdodDptfT10LmRhdGE7c3dpdGNoKGEpe2Nhc2UiaW5pdENhbnZhcyI6QyhlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjpwKHUsZixtKTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpJKG4saSxjLGcpO2JyZWFrfX07Y29uc3QgQz0odCxhKT0+e289dCxoPW8uZ2V0Q29udGV4dCgiMmQiKSxyPWF9LHA9KHQsYSxlKT0+e2NvbnN0IHM9YS9lO3c9dD5zLG8ud2lkdGg9YSpyLG8uaGVpZ2h0PWUqcixoLnNjYWxlKHIsciksdz8oZD1hLGw9YS90KToobD1lLGQ9ZSp0KSxoLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxoLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEk9KHQ9e30sYT0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09dDtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L3ItbCkvMik6KGk9KG8ud2lkdGgvci1kKS8yLGM9MCksaC5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLGEhPT0xKXtjb25zdHtuYXR1cmFsV2lkdGg6ZyxuYXR1cmFsSGVpZ2h0OnV9PXQse3pvb21lZFdpZHRoOmYsem9vbWVkSGVpZ2h0Om19PXYoZyx1LGEpLHt6b29tT2Zmc2V0WDp4LHpvb21PZmZzZXRZOk99PXooe3BvaW50ZXJYOmUscG9pbnRlclk6cyxpbWFnZURhdGE6dCx6b29tZWRXaWR0aDpmLHpvb21lZEhlaWdodDptLGRyYXdXaWR0aDpkLGRyYXdIZWlnaHQ6bH0pO2guZHJhd0ltYWdlKG4seCxPLGYsbSxpLGMsZCxsKX1lbHNlIGguZHJhd0ltYWdlKG4saSxjLGQsbCl9fSkoKTsK",$o=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),$e=typeof self<"u"&&self.Blob&&new Blob([$o(je)],{type:"text/javascript;charset=utf-8"});function Uo(e){let t;try{if(t=$e&&(self.URL||self.webkitURL).createObjectURL($e),!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,"+je,{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Ko{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:r,pointerX:a,pointerY:l,imageAspectRatio:h,containerWidth:c,containerHeight:p}=t;switch(i){case"initCanvas":this.initCanvas(o,s);break;case"adaptCanvasSize":this.adaptCanvasSize(h,c,p);break;case"drawImageOnCanvas":this.drawImageOnCanvas(n,r,a,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 r,a;if(this.wideImage?(r=0,a=(this.canvas.height/this.dpr-this.drawHeight)/2):(r=(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:l,naturalHeight:h}=t,{zoomedWidth:c,zoomedHeight:p}=So(l,h,i),{zoomOffsetX:m,zoomOffsetY:u}=Yo({pointerX:o,pointerY:s,imageData:t,zoomedWidth:c,zoomedHeight:p,drawWidth:this.drawWidth,drawHeight:this.drawHeight});this.ctx.drawImage(n,m,u,c,p,r,a,this.drawWidth,this.drawHeight)}else this.ctx.drawImage(n,r,a,this.drawWidth,this.drawHeight)}}const qo=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"]),Ue={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"]},Jo=[/javascript:/i,/vbscript:/i,/on\w+\s*=/i],Qo=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(!qo.has(n)){if(n==="script"||n==="style"){o.remove();return}const l=document.createTextNode(o.textContent);o.parentNode.replaceChild(l,o);return}const r=[...Ue[n]||[],...Ue["*"]||[]];if(Array.from(o.attributes).forEach(l=>{const h=l.name.toLowerCase();if(h.startsWith("on")){o.removeAttribute(l.name);return}if(!r.includes(h)){o.removeAttribute(l.name);return}let c=l.value;Jo.forEach(p=>{p.test(c)&&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},ts=e=>e==="y"?Y.Y:Y.X,es=(e,t,i)=>e.filter(o=>t in o.positions?i==="grid"?!0:ts(o.orientation)===i:!1),is=(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},os=e=>{const t=Object.entries(e).sort(([n],[r])=>Number(n)-Number(r));let i=null,o=null;const s={};for(const[n,r]of t)if(!r)s[n]={x:i,y:o};else{const{x:a,y:l}=r;a!=null&&(i=a),l!=null&&(o=l),s[n]={x:a??i,y:l??o}}return s},ss=e=>({placement:"top",modifiers:[{name:"offset",options:{offset:[0,10]}},{name:"preventOverflow",options:{boundary:e}},{name:"flip",options:{boundary:e,fallbackPlacements:["bottom","right","left"]}}]}),ns=(e,t,i)=>{const o=document.createElement("div");return o.className="cloudimage-360-popper",o.id=`cloudimage-360-popper-${t}`,o.dataset.popperId=t,o.setAttribute("role","tooltip"),o.setAttribute("aria-hidden","false"),typeof e=="string"&&/<\/?[a-z][\s\S]*>/i.test(e)?o.innerHTML=Qo(e):o.textContent=e,(i||document.body).appendChild(o),o},rs=e=>e.map(t=>{const i={...os(t.positions)};return{...t,initialPositions:i,positions:i}}),as=({newWidth:e,newHeight:t,initialContainerSize:i,imageAspectRatio:o,hotspotsConfig:s})=>{const[n,r]=i;let a=e,l=t,h=0,c=0;const p=e/t;o>p?(l=e/o,c=(t-l)/2):(a=t*o,h=(e-a)/2);const u=a/n,x=l/r;return s.map(v=>{const y={};return Object.entries(v.initialPositions).forEach(([I,k])=>{y[I]={x:k.x*u+h,y:k.y*x+c}}),{...v,positions:y}})};function ls(e){const t=[];e.image&&t.push(`<div class="ci360-popper-image-wrapper"><img class="ci360-popper-image" src="${kt(e.image)}" alt="${kt(e.title||"")}"></div>`);const i=[];if(e.title&&i.push(`<h3 class="ci360-popper-title">${ut(e.title)}</h3>`),e.originalPrice||e.price){let o="";e.originalPrice&&(o+=`<span class="ci360-popper-original-price">${ut(e.originalPrice)}</span>`),e.price&&(o+=`<span class="ci360-popper-price">${ut(e.price)}</span>`),i.push(`<div class="ci360-popper-price-row">${o}</div>`)}if(e.description&&i.push(`<p class="ci360-popper-description">${ut(e.description)}</p>`),e.url&&cs(e.url)){const o=e.ctaText||"View details",s=e.id?` data-product-id="${kt(e.id)}"`:"";i.push(`<a class="ci360-popper-cta" href="${kt(e.url)}" target="_top"${s}>${ut(String(o))}</a>`)}else if(e.id){const o=e.ctaText||"View details";i.push(`<button class="ci360-popper-cta" data-product-id="${kt(e.id)}">${ut(String(o))}</button>`)}return i.length>0&&t.push(`<div class="ci360-popper-body">${i.join("")}</div>`),t.join("")}function re(e){return e.content?e.content:e.data?ls(e.data):""}function ut(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function kt(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function cs(e){const t=e.replace(/[\s\x00-\x1f]/g,"");return/^https?:\/\//i.test(t)||/^\/(?!\/)/.test(t)||/^#/.test(t)}var H="top",G="bottom",_="right",R="left",ae="auto",Pt=[H,G,_,R],mt="start",Et="end",hs="clippingParents",Ke="viewport",zt="popper",ds="reference",qe=Pt.reduce(function(e,t){return e.concat([t+"-"+mt,t+"-"+Et])},[]),Je=[].concat(Pt,[ae]).reduce(function(e,t){return e.concat([t,t+"-"+mt,t+"-"+Et])},[]),ps="beforeRead",us="read",ms="afterRead",fs="beforeMain",gs="main",vs="afterMain",bs="beforeWrite",ys="write",ws="afterWrite",xs=[ps,us,ms,fs,gs,vs,bs,ys,ws];function V(e){return e?(e.nodeName||"").toLowerCase():null}function Z(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function at(e){var t=Z(e).Element;return e instanceof t||e instanceof Element}function F(e){var t=Z(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function le(e){if(typeof ShadowRoot>"u")return!1;var t=Z(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Cs(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];!F(n)||!V(n)||(Object.assign(n.style,o),Object.keys(s).forEach(function(r){var a=s[r];a===!1?n.removeAttribute(r):n.setAttribute(r,a===!0?"":a)}))})}function Is(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]||{},r=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:i[o]),a=r.reduce(function(l,h){return l[h]="",l},{});!F(s)||!V(s)||(Object.assign(s.style,a),Object.keys(n).forEach(function(l){s.removeAttribute(l)}))})}}const ks={name:"applyStyles",enabled:!0,phase:"write",fn:Cs,effect:Is,requires:["computeStyles"]};function j(e){return e.split("-")[0]}var lt=Math.max,Bt=Math.min,ft=Math.round;function ce(){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 Qe(){return!/^((?!chrome|android).)*safari/i.test(ce())}function gt(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var o=e.getBoundingClientRect(),s=1,n=1;t&&F(e)&&(s=e.offsetWidth>0&&ft(o.width)/e.offsetWidth||1,n=e.offsetHeight>0&&ft(o.height)/e.offsetHeight||1);var r=at(e)?Z(e):window,a=r.visualViewport,l=!Qe()&&i,h=(o.left+(l&&a?a.offsetLeft:0))/s,c=(o.top+(l&&a?a.offsetTop:0))/n,p=o.width/s,m=o.height/n;return{width:p,height:m,top:c,right:h+p,bottom:c+m,left:h,x:h,y:c}}function he(e){var t=gt(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 ti(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&le(i)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function U(e){return Z(e).getComputedStyle(e)}function Ps(e){return["table","td","th"].indexOf(V(e))>=0}function ot(e){return((at(e)?e.ownerDocument:e.document)||window.document).documentElement}function Gt(e){return V(e)==="html"?e:e.assignedSlot||e.parentNode||(le(e)?e.host:null)||ot(e)}function ei(e){return!F(e)||U(e).position==="fixed"?null:e.offsetParent}function Es(e){var t=/firefox/i.test(ce()),i=/Trident/i.test(ce());if(i&&F(e)){var o=U(e);if(o.position==="fixed")return null}var s=Gt(e);for(le(s)&&(s=s.host);F(s)&&["html","body"].indexOf(V(s))<0;){var n=U(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 Tt(e){for(var t=Z(e),i=ei(e);i&&Ps(i)&&U(i).position==="static";)i=ei(i);return i&&(V(i)==="html"||V(i)==="body"&&U(i).position==="static")?t:i||Es(e)||t}function de(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function At(e,t,i){return lt(e,Bt(t,i))}function zs(e,t,i){var o=At(e,t,i);return o>i?i:o}function ii(){return{top:0,right:0,bottom:0,left:0}}function oi(e){return Object.assign({},ii(),e)}function si(e,t){return t.reduce(function(i,o){return i[o]=e,i},{})}var Ts=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,oi(typeof t!="number"?t:si(t,Pt))};function As(e){var t,i=e.state,o=e.name,s=e.options,n=i.elements.arrow,r=i.modifiersData.popperOffsets,a=j(i.placement),l=de(a),h=[R,_].indexOf(a)>=0,c=h?"height":"width";if(!(!n||!r)){var p=Ts(s.padding,i),m=he(n),u=l==="y"?H:R,x=l==="y"?G:_,v=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],y=r[l]-i.rects.reference[l],I=Tt(n),k=I?l==="y"?I.clientHeight||0:I.clientWidth||0:0,w=v/2-y/2,g=p[u],P=k-m[c]-p[x],f=k/2-m[c]/2+w,b=At(g,f,P),C=l;i.modifiersData[o]=(t={},t[C]=b,t.centerOffset=b-f,t)}}function Xs(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)||ti(t.elements.popper,s)&&(t.elements.arrow=s))}const Ss={name:"arrow",enabled:!0,phase:"main",fn:As,effect:Xs,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function vt(e){return e.split("-")[1]}var Ys={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ls(e,t){var i=e.x,o=e.y,s=t.devicePixelRatio||1;return{x:ft(i*s)/s||0,y:ft(o*s)/s||0}}function ni(e){var t,i=e.popper,o=e.popperRect,s=e.placement,n=e.variation,r=e.offsets,a=e.position,l=e.gpuAcceleration,h=e.adaptive,c=e.roundOffsets,p=e.isFixed,m=r.x,u=m===void 0?0:m,x=r.y,v=x===void 0?0:x,y=typeof c=="function"?c({x:u,y:v}):{x:u,y:v};u=y.x,v=y.y;var I=r.hasOwnProperty("x"),k=r.hasOwnProperty("y"),w=R,g=H,P=window;if(h){var f=Tt(i),b="clientHeight",C="clientWidth";if(f===Z(i)&&(f=ot(i),U(f).position!=="static"&&a==="absolute"&&(b="scrollHeight",C="scrollWidth")),f=f,s===H||(s===R||s===_)&&n===Et){g=G;var E=p&&f===P&&P.visualViewport?P.visualViewport.height:f[b];v-=E-o.height,v*=l?1:-1}if(s===R||(s===H||s===G)&&n===Et){w=_;var T=p&&f===P&&P.visualViewport?P.visualViewport.width:f[C];u-=T-o.width,u*=l?1:-1}}var A=Object.assign({position:a},h&&Ys),M=c===!0?Ls({x:u,y:v},Z(i)):{x:u,y:v};if(u=M.x,v=M.y,l){var L;return Object.assign({},A,(L={},L[g]=k?"0":"",L[w]=I?"0":"",L.transform=(P.devicePixelRatio||1)<=1?"translate("+u+"px, "+v+"px)":"translate3d("+u+"px, "+v+"px, 0)",L))}return Object.assign({},A,(t={},t[g]=k?v+"px":"",t[w]=I?u+"px":"",t.transform="",t))}function Ms(e){var t=e.state,i=e.options,o=i.gpuAcceleration,s=o===void 0?!0:o,n=i.adaptive,r=n===void 0?!0:n,a=i.roundOffsets,l=a===void 0?!0:a,h={placement:j(t.placement),variation:vt(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,ni(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ni(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Os={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ms,data:{}};var _t={passive:!0};function Hs(e){var t=e.state,i=e.instance,o=e.options,s=o.scroll,n=s===void 0?!0:s,r=o.resize,a=r===void 0?!0:r,l=Z(t.elements.popper),h=[].concat(t.scrollParents.reference,t.scrollParents.popper);return n&&h.forEach(function(c){c.addEventListener("scroll",i.update,_t)}),a&&l.addEventListener("resize",i.update,_t),function(){n&&h.forEach(function(c){c.removeEventListener("scroll",i.update,_t)}),a&&l.removeEventListener("resize",i.update,_t)}}const Rs={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Hs,data:{}};var Zs={left:"right",right:"left",bottom:"top",top:"bottom"};function Ft(e){return e.replace(/left|right|bottom|top/g,function(t){return Zs[t]})}var Ds={start:"end",end:"start"};function ri(e){return e.replace(/start|end/g,function(t){return Ds[t]})}function pe(e){var t=Z(e),i=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:i,scrollTop:o}}function ue(e){return gt(ot(e)).left+pe(e).scrollLeft}function Bs(e,t){var i=Z(e),o=ot(e),s=i.visualViewport,n=o.clientWidth,r=o.clientHeight,a=0,l=0;if(s){n=s.width,r=s.height;var h=Qe();(h||!h&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:n,height:r,x:a+ue(e),y:l}}function Gs(e){var t,i=ot(e),o=pe(e),s=(t=e.ownerDocument)==null?void 0:t.body,n=lt(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=lt(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-o.scrollLeft+ue(e),l=-o.scrollTop;return U(s||i).direction==="rtl"&&(a+=lt(i.clientWidth,s?s.clientWidth:0)-n),{width:n,height:r,x:a,y:l}}function me(e){var t=U(e),i=t.overflow,o=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+o)}function ai(e){return["html","body","#document"].indexOf(V(e))>=0?e.ownerDocument.body:F(e)&&me(e)?e:ai(Gt(e))}function Xt(e,t){var i;t===void 0&&(t=[]);var o=ai(e),s=o===((i=e.ownerDocument)==null?void 0:i.body),n=Z(o),r=s?[n].concat(n.visualViewport||[],me(o)?o:[]):o,a=t.concat(r);return s?a:a.concat(Xt(Gt(r)))}function fe(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _s(e,t){var i=gt(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 li(e,t,i){return t===Ke?fe(Bs(e,i)):at(t)?_s(t,i):fe(Gs(ot(e)))}function Fs(e){var t=Xt(Gt(e)),i=["absolute","fixed"].indexOf(U(e).position)>=0,o=i&&F(e)?Tt(e):e;return at(o)?t.filter(function(s){return at(s)&&ti(s,o)&&V(s)!=="body"}):[]}function Ns(e,t,i,o){var s=t==="clippingParents"?Fs(e):[].concat(t),n=[].concat(s,[i]),r=n[0],a=n.reduce(function(l,h){var c=li(e,h,o);return l.top=lt(c.top,l.top),l.right=Bt(c.right,l.right),l.bottom=Bt(c.bottom,l.bottom),l.left=lt(c.left,l.left),l},li(e,r,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ci(e){var t=e.reference,i=e.element,o=e.placement,s=o?j(o):null,n=o?vt(o):null,r=t.x+t.width/2-i.width/2,a=t.y+t.height/2-i.height/2,l;switch(s){case H:l={x:r,y:t.y-i.height};break;case G:l={x:r,y:t.y+t.height};break;case _:l={x:t.x+t.width,y:a};break;case R:l={x:t.x-i.width,y:a};break;default:l={x:t.x,y:t.y}}var h=s?de(s):null;if(h!=null){var c=h==="y"?"height":"width";switch(n){case mt:l[h]=l[h]-(t[c]/2-i[c]/2);break;case Et:l[h]=l[h]+(t[c]/2-i[c]/2);break}}return l}function St(e,t){t===void 0&&(t={});var i=t,o=i.placement,s=o===void 0?e.placement:o,n=i.strategy,r=n===void 0?e.strategy:n,a=i.boundary,l=a===void 0?hs:a,h=i.rootBoundary,c=h===void 0?Ke:h,p=i.elementContext,m=p===void 0?zt:p,u=i.altBoundary,x=u===void 0?!1:u,v=i.padding,y=v===void 0?0:v,I=oi(typeof y!="number"?y:si(y,Pt)),k=m===zt?ds:zt,w=e.rects.popper,g=e.elements[x?k:m],P=Ns(at(g)?g:g.contextElement||ot(e.elements.popper),l,c,r),f=gt(e.elements.reference),b=ci({reference:f,element:w,placement:s}),C=fe(Object.assign({},w,b)),E=m===zt?C:f,T={top:P.top-E.top+I.top,bottom:E.bottom-P.bottom+I.bottom,left:P.left-E.left+I.left,right:E.right-P.right+I.right},A=e.modifiersData.offset;if(m===zt&&A){var M=A[s];Object.keys(T).forEach(function(L){var K=[_,G].indexOf(L)>=0?1:-1,q=[H,G].indexOf(L)>=0?"y":"x";T[L]+=M[q]*K})}return T}function Ws(e,t){t===void 0&&(t={});var i=t,o=i.placement,s=i.boundary,n=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,h=l===void 0?Je:l,c=vt(o),p=c?a?qe:qe.filter(function(x){return vt(x)===c}):Pt,m=p.filter(function(x){return h.indexOf(x)>=0});m.length===0&&(m=p);var u=m.reduce(function(x,v){return x[v]=St(e,{placement:v,boundary:s,rootBoundary:n,padding:r})[j(v)],x},{});return Object.keys(u).sort(function(x,v){return u[x]-u[v]})}function Vs(e){if(j(e)===ae)return[];var t=Ft(e);return[ri(e),t,ri(t)]}function js(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,r=i.altAxis,a=r===void 0?!0:r,l=i.fallbackPlacements,h=i.padding,c=i.boundary,p=i.rootBoundary,m=i.altBoundary,u=i.flipVariations,x=u===void 0?!0:u,v=i.allowedAutoPlacements,y=t.options.placement,I=j(y),k=I===y,w=l||(k||!x?[Ft(y)]:Vs(y)),g=[y].concat(w).reduce(function(nt,$){return nt.concat(j($)===ae?Ws(t,{placement:$,boundary:c,rootBoundary:p,padding:h,flipVariations:x,allowedAutoPlacements:v}):$)},[]),P=t.rects.reference,f=t.rects.popper,b=new Map,C=!0,E=g[0],T=0;T<g.length;T++){var A=g[T],M=j(A),L=vt(A)===mt,K=[H,G].indexOf(M)>=0,q=K?"width":"height",O=St(t,{placement:A,boundary:c,rootBoundary:p,altBoundary:m,padding:h}),D=K?L?_:R:L?G:H;P[q]>f[q]&&(D=Ft(D));var bt=Ft(D),J=[];if(n&&J.push(O[M]<=0),a&&J.push(O[D]<=0,O[bt]<=0),J.every(function(nt){return nt})){E=A,C=!1;break}b.set(A,J)}if(C)for(var yt=x?3:1,wt=function($){var ht=g.find(function(xt){var Q=b.get(xt);if(Q)return Q.slice(0,$).every(function(Yt){return Yt})});if(ht)return E=ht,"break"},ct=yt;ct>0;ct--){var st=wt(ct);if(st==="break")break}t.placement!==E&&(t.modifiersData[o]._skip=!0,t.placement=E,t.reset=!0)}}const $s={name:"flip",enabled:!0,phase:"main",fn:js,requiresIfExists:["offset"],data:{_skip:!1}};function hi(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 di(e){return[H,_,G,R].some(function(t){return e[t]>=0})}function Us(e){var t=e.state,i=e.name,o=t.rects.reference,s=t.rects.popper,n=t.modifiersData.preventOverflow,r=St(t,{elementContext:"reference"}),a=St(t,{altBoundary:!0}),l=hi(r,o),h=hi(a,s,n),c=di(l),p=di(h);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:h,isReferenceHidden:c,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":p})}const Ks={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Us};function qs(e,t,i){var o=j(e),s=[R,H].indexOf(o)>=0?-1:1,n=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,r=n[0],a=n[1];return r=r||0,a=(a||0)*s,[R,_].indexOf(o)>=0?{x:a,y:r}:{x:r,y:a}}function Js(e){var t=e.state,i=e.options,o=e.name,s=i.offset,n=s===void 0?[0,0]:s,r=Je.reduce(function(c,p){return c[p]=qs(p,t.rects,n),c},{}),a=r[t.placement],l=a.x,h=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=h),t.modifiersData[o]=r}const Qs={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Js};function tn(e){var t=e.state,i=e.name;t.modifiersData[i]=ci({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const en={name:"popperOffsets",enabled:!0,phase:"read",fn:tn,data:{}};function on(e){return e==="x"?"y":"x"}function sn(e){var t=e.state,i=e.options,o=e.name,s=i.mainAxis,n=s===void 0?!0:s,r=i.altAxis,a=r===void 0?!1:r,l=i.boundary,h=i.rootBoundary,c=i.altBoundary,p=i.padding,m=i.tether,u=m===void 0?!0:m,x=i.tetherOffset,v=x===void 0?0:x,y=St(t,{boundary:l,rootBoundary:h,padding:p,altBoundary:c}),I=j(t.placement),k=vt(t.placement),w=!k,g=de(I),P=on(g),f=t.modifiersData.popperOffsets,b=t.rects.reference,C=t.rects.popper,E=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,T=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(f){if(n){var L,K=g==="y"?H:R,q=g==="y"?G:_,O=g==="y"?"height":"width",D=f[g],bt=D+y[K],J=D-y[q],yt=u?-C[O]/2:0,wt=k===mt?b[O]:C[O],ct=k===mt?-C[O]:-b[O],st=t.elements.arrow,nt=u&&st?he(st):{width:0,height:0},$=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:ii(),ht=$[K],xt=$[q],Q=At(0,b[O],nt[O]),Yt=w?b[O]/2-yt-Q-ht-T.mainAxis:wt-Q-ht-T.mainAxis,ge=w?-b[O]/2+yt+Q+xt+T.mainAxis:ct+Q+xt+T.mainAxis,Lt=t.elements.arrow&&Tt(t.elements.arrow),ve=Lt?g==="y"?Lt.clientTop||0:Lt.clientLeft||0:0,Nt=(L=A==null?void 0:A[g])!=null?L:0,be=D+Yt-Nt-ve,ye=D+ge-Nt,Wt=At(u?Bt(bt,be):bt,D,u?lt(J,ye):J);f[g]=Wt,M[g]=Wt-D}if(a){var Mt,Vt=g==="x"?H:R,jt=g==="x"?G:_,tt=f[P],Ct=P==="y"?"height":"width",$t=tt+y[Vt],Ut=tt-y[jt],Ot=[H,R].indexOf(I)!==-1,Kt=(Mt=A==null?void 0:A[P])!=null?Mt:0,qt=Ot?$t:tt-b[Ct]-C[Ct]-Kt+T.altAxis,Jt=Ot?tt+b[Ct]+C[Ct]-Kt-T.altAxis:Ut,Qt=u&&Ot?zs(qt,tt,Jt):At(u?qt:$t,tt,u?Jt:Ut);f[P]=Qt,M[P]=Qt-tt}t.modifiersData[o]=M}}const nn={name:"preventOverflow",enabled:!0,phase:"main",fn:sn,requiresIfExists:["offset"]};function rn(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function an(e){return e===Z(e)||!F(e)?pe(e):rn(e)}function ln(e){var t=e.getBoundingClientRect(),i=ft(t.width)/e.offsetWidth||1,o=ft(t.height)/e.offsetHeight||1;return i!==1||o!==1}function cn(e,t,i){i===void 0&&(i=!1);var o=F(t),s=F(t)&&ln(t),n=ot(t),r=gt(e,s,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(o||!o&&!i)&&((V(t)!=="body"||me(n))&&(a=an(t)),F(t)?(l=gt(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):n&&(l.x=ue(n))),{x:r.left+a.scrollLeft-l.x,y:r.top+a.scrollTop-l.y,width:r.width,height:r.height}}function hn(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 r=[].concat(n.requires||[],n.requiresIfExists||[]);r.forEach(function(a){if(!i.has(a)){var l=t.get(a);l&&s(l)}}),o.push(n)}return e.forEach(function(n){i.has(n.name)||s(n)}),o}function dn(e){var t=hn(e);return xs.reduce(function(i,o){return i.concat(t.filter(function(s){return s.phase===o}))},[])}function pn(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function un(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 pi={placement:"bottom",modifiers:[],strategy:"absolute"};function ui(){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 mn(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,o=i===void 0?[]:i,s=t.defaultOptions,n=s===void 0?pi:s;return function(a,l,h){h===void 0&&(h=n);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},pi,n),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},p=[],m=!1,u={state:c,setOptions:function(I){var k=typeof I=="function"?I(c.options):I;v(),c.options=Object.assign({},n,c.options,k),c.scrollParents={reference:at(a)?Xt(a):a.contextElement?Xt(a.contextElement):[],popper:Xt(l)};var w=dn(un([].concat(o,c.options.modifiers)));return c.orderedModifiers=w.filter(function(g){return g.enabled}),x(),u.update()},forceUpdate:function(){if(!m){var I=c.elements,k=I.reference,w=I.popper;if(ui(k,w)){c.rects={reference:cn(k,Tt(w),c.options.strategy==="fixed"),popper:he(w)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(T){return c.modifiersData[T.name]=Object.assign({},T.data)});for(var g=0;g<c.orderedModifiers.length;g++){if(c.reset===!0){c.reset=!1,g=-1;continue}var P=c.orderedModifiers[g],f=P.fn,b=P.options,C=b===void 0?{}:b,E=P.name;typeof f=="function"&&(c=f({state:c,options:C,name:E,instance:u})||c)}}}},update:pn(function(){return new Promise(function(y){u.forceUpdate(),y(c)})}),destroy:function(){v(),m=!0}};if(!ui(a,l))return u;u.setOptions(h).then(function(y){!m&&h.onFirstUpdate&&h.onFirstUpdate(y)});function x(){c.orderedModifiers.forEach(function(y){var I=y.name,k=y.options,w=k===void 0?{}:k,g=y.effect;if(typeof g=="function"){var P=g({state:c,name:I,instance:u,options:w}),f=function(){};p.push(P||f)}})}function v(){p.forEach(function(y){return y()}),p=[]}return u}}var fn=[Rs,en,Os,ks,Qs,$s,nn,Ss,Ks],gn=mn({defaultModifiers:fn});const vn='<svg class="ci360-navigate-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6"/></svg>';class bn{constructor(t,i,o,s={}){bi(this,"updateHotspotPosition",(t,i)=>{this.currentActiveIndex=t,this.currentOrientation=i;const o=es(this.hotspotsConfig,t,i);this.hideHotspots(),o.forEach(s=>this.updateAndShowHotspot(s,t))});this.container=i,this.popper=null,this.popperInstance=null,this.hotspotsContainer=po(this.container),this.hotspotsConfig=rs(t),this.shouldHidePopper=!0,this.hidePopper=this.hidePopper.bind(this),this.forceHidePopper=this.forceHidePopper.bind(this),this.imageAspectRatio=o,this.popperListeners=[],this.trigger=s.trigger||"hover",this.onOpen=s.onOpen||null,this.onClose=s.onClose||null,this.onProductClick=s.onProductClick||null,this.onNavigate=s.onNavigate||null;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=as({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}){var p;this.popperInstance&&this.hidePopper();const n=ss(this.container);this.popper=ns(i,o,this.container.parentElement),this.currentHotspotElement=t,t.setAttribute("aria-expanded","true"),t.setAttribute("aria-describedby",`cloudimage-360-popper-${o}`);const r=()=>{this.shouldHidePopper=!1},a=()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()},l=()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()},h=()=>{this.shouldHidePopper=!1,this.hidePopperTimeout&&clearTimeout(this.hidePopperTimeout)};if(this.popper.addEventListener("mouseenter",r),this.popper.addEventListener("mouseleave",a),t.addEventListener("mouseleave",l),t.addEventListener("mouseenter",h),this.popperListeners.push({element:this.popper,event:"mouseenter",handler:r},{element:this.popper,event:"mouseleave",handler:a},{element:t,event:"mouseleave",handler:l},{element:t,event:"mouseenter",handler:h}),this.onProductClick){const m=this.onProductClick,u=x=>{const v=x.target.closest(".ci360-popper-cta");v&&m(v.dataset.productId??"",o)};this.popper.addEventListener("click",u),this.popperListeners.push({element:this.popper,event:"click",handler:u})}const c=gn(t,this.popper,n);c.forceUpdate(),this.popper.setAttribute("data-show",""),this.shouldHidePopper=!1,this.popperInstance={...c,keepOpen:s,instanceId:o};try{(p=this.onOpen)==null||p.call(this,o)}catch(m){console.warn("onHotspotOpen callback error:",m)}}checkAndHidePopper(){var t;this.shouldHidePopper&&!((t=this.popperInstance)!=null&&t.keepOpen)&&(this.hidePopperTimeout&&clearTimeout(this.hidePopperTimeout),this.hidePopperTimeout=setTimeout(()=>{this.shouldHidePopper&&this.hidePopper()},Gi))}hidePopper(){var o,s;this.hidePopperTimeout&&(clearTimeout(this.hidePopperTimeout),this.hidePopperTimeout=null);const t=(o=this.popperInstance)==null?void 0:o.instanceId;this.cleanupPopperListeners(),this.currentHotspotElement&&(this.currentHotspotElement.setAttribute("aria-expanded","false"),this.currentHotspotElement.removeAttribute("aria-describedby"),this.currentHotspotElement=null);const i=this.popperInstance;if(this.popperInstance=null,t!=null)try{(s=this.onClose)==null||s.call(this,t)}catch(n){console.warn("onHotspotClose callback error:",n)}if(this.popper){this.popper.removeAttribute("data-show"),this.popper.setAttribute("aria-hidden","true");const n=this.popper;this.popper=null,setTimeout(()=>{i==null||i.destroy(),n.remove()},_i)}else i==null||i.destroy();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:r,navigateTo:a}=t,l=typeof a=="string"?a.trim():void 0,h=re(t),c=is(i,n,r);if(l){c.classList.add("cloudimage-360-hotspot--navigate"),c.innerHTML=vn;const p=n||l;c.setAttribute("role","button"),c.setAttribute("aria-label",`Navigate to ${p}`),c.setAttribute("aria-roledescription","navigation hotspot"),c.style.cursor="pointer";const m=h||(n?re({data:{title:n}}):"");m?(c.setAttribute("aria-haspopup","true"),c.addEventListener("mouseenter",()=>this.showPopper({hotspotElement:c,content:m,id:i,keepOpen:!1})),c.addEventListener("mouseleave",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()}),c.addEventListener("focus",()=>this.showPopper({hotspotElement:c,content:m,id:i,keepOpen:!1})),c.addEventListener("blur",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()})):(c.removeAttribute("aria-haspopup"),c.removeAttribute("aria-expanded"));const u=()=>{this.hidePopper(),this.onNavigate?this.onNavigate(l):console.warn(`[ci360] navigateTo hotspot "${i}" clicked but no onNavigate callback is configured.`)};c.onclick=x=>{x.stopPropagation(),u()},c.addEventListener("keydown",x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),u())}),this.hotspotsContainer.appendChild(c);return}(s||h&&this.trigger==="click")&&(c.style.cursor="pointer"),c.onclick=p=>{var m;p.stopPropagation(),h&&this.trigger==="click"&&(((m=this.popperInstance)==null?void 0:m.instanceId)===i?this.hidePopper():this.showPopper({hotspotElement:c,content:h,id:i,keepOpen:o})),s==null||s(p,this.popperInstance,i)},h&&this.trigger==="hover"&&(c.addEventListener("mouseenter",()=>this.showPopper({hotspotElement:c,content:h,id:i,keepOpen:o})),c.addEventListener("mouseleave",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()}),c.addEventListener("focus",()=>this.showPopper({hotspotElement:c,content:h,id:i,keepOpen:o})),c.addEventListener("blur",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()})),this.hotspotsContainer.appendChild(c)}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:r}=o[i]??{},a=this.hotspotsContainer.querySelector(`[data-hotspot-id="${s}"]`);a&&(a.style.translate=`${n}px ${r}px`,a.style.opacity=1,a.style.pointerEvents="all")}showHotspotById(t){const i=this.hotspotsConfig.find(n=>n.id===t);if(!i||i.navigateTo)return;const o=re(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.hotspotsContainer.innerHTML=""}}const mi=typeof navigator<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);class fi{constructor(t,i){this.container=t,this.isClicked=!1,this.imagesX=[],this.imagesY=[],this.imagesGrid=[],this.isGridMode=!1;const o=Math.round(window.devicePixelRatio||1);this.devicePixelRatio=mi?Math.min(o,2):o,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.touchDevice=Zo(),this.dragJustEnded=!1,this.zoomPan=null,this.gestureRecognizer=null,this.zoomControlsUI=null,this.scrollHintUI=null,this.highResLoaded=!1,this.useMainThreadCanvas=mi,this.canvasWorker=this.useMainThreadCanvas?new Ko:new Uo,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){mo(this.ariaLiveRegion,t)}mouseDown(t){if(!this.isReady)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")||i.closest(".cloudimage-360-zoom-controls")))return;const{pageX:o,pageY:s}=t;if(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.isZoomed&&this.zoomPan){this.zoomPan.startPan(o,s);return}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.dragSpeed/Ae,s=o*(this.amountX/this.container.offsetWidth),n=o*(this.amountY/this.container.offsetHeight),r=()=>{if(this.velocityX*=.95,this.velocityY*=.95,Math.abs(this.velocityX)<.01&&Math.abs(this.velocityY)<.01){this.inertiaAnimationId=null;return}const a=this.velocityX*16,l=this.velocityY*16,h=We({deltaX:a,deltaY:l,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY});if(h){const c=this.allowSpinX?Math.max(1,Math.abs(Math.round(a*s))):0,p=this.allowSpinY?Math.max(1,Math.abs(Math.round(l*n))):0;(c>0||p>0)&&this.onMoveHandler(h,c,p)}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 p=performance.now(),m=p-this.lastDragTime;m>0&&m<100&&(this.velocityX=(t-this.lastDragX)/m,this.velocityY=(i-this.lastDragY)/m),this.lastDragTime=p,this.lastDragX=t,this.lastDragY=i}this.draggingDirection=We({deltaX:o,deltaY:s,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY})||this.draggingDirection;const n=this.dragSpeed/Ae,r=n*(this.amountX/this.container.offsetWidth),a=n*(this.amountY/this.container.offsetHeight),l=this.allowSpinX?Math.abs(Math.round(o*r)):0,h=this.allowSpinY?Math.abs(Math.round(s*a)):0;(this.allowSpinX&&l!==0||this.allowSpinY&&h!==0)&&(this.hasInteracted=!0,this.hideHotspotPopper(),this.onMoveHandler(this.draggingDirection,l,h),this.movementStart={x:t,y:i},setTimeout(()=>{this.isDragging||(this.isDragging=!0,this.emit("onDragStart"))},Bi))}mouseMove(t){!this.isReady||!this.isClicked||this.isZoomed||(this.hideAllIcons(),this.drag(t.pageX,t.pageY))}mouseClick(){this.dragJustEnded=!1,this.autoplayJustStopped=!1}loadHigherQualityImages(t,i){if(this.isGridMode){const n=rt(this.srcGridConfig,t);Le({cdnPath:n,config:this.srcGridConfig,onAllImagesLoad:r=>{this.closeImageBitmaps(this.imagesGrid),this.imagesGrid=r,i()},onError:r=>this.emit("onError",r)});return}const o=rt(this.srcXConfig,t),s=this.allowSpinY?rt(this.srcYConfig,t):null;Ye({cdnPathX:o,cdnPathY:s,configX:this.srcXConfig,configY:this.srcYConfig,onAllImagesLoad:(n,r)=>{this.closeImageBitmaps(this.imagesX),this.closeImageBitmaps(this.imagesY),this.imagesX=n,this.imagesY=r,i()},onError:n=>this.emit("onError",n)})}hideHotspots(){this.hotspotsInstance&&this.hotspotsInstance.hideHotspots()}hideHotspotPopper(){this.hotspotsInstance&&this.hotspotsInstance.forceHidePopper()}getDrawDimensions(){if(!this.canvas||!this.imageAspectRatio)return null;const t=this.canvas.clientWidth,i=t/this.imageAspectRatio,o=t/i;return this.imageAspectRatio>o?{drawWidth:t,drawHeight:t/this.imageAspectRatio}:{drawWidth:i*this.imageAspectRatio,drawHeight:i}}initZoom(){const t=this.zoomMax||5,i=this.zoomStep||.5;this.zoomPan=new _o(this.innerBox,{zoomMax:t,zoomStep:i,onZoomChange:(s,n,r)=>this.onZoomChange(s,n,r)});const o=this.getDrawDimensions();o&&this.zoomPan.setDrawSize(o.drawWidth,o.drawHeight),this.touchDevice&&this.pinchZoom!==!1&&(this.gestureRecognizer=new Fo(this.innerBox,{zoomMax:t,getZoom:()=>this.zoomPan?this.zoomPan.getZoom():1,onPinchZoom:(s,n,r)=>{this.zoomPan&&(n!==void 0?this.zoomPan.zoomTowardPoint(s,n,r):this.zoomPan.applyTouchZoom(s))},onPan:(s,n)=>{this.zoomPan&&this.zoomPan.applyTouchPan(s,n)},onDoubleTap:(s,n)=>{this.zoomPan&&(this.zoomPan.isZoomed()?this.zoomPan.resetZoom():this.zoomPan.zoomTowardPoint(2,s,n))}})),this.zoomControls&&!this.touchDevice&&(this.zoomControlsUI=jo(this.innerBox,{position:this.zoomControlsPosition||"bottom-left",zoomMax:t,onZoomIn:()=>this.zoomPan&&this.zoomPan.zoomIn(),onZoomOut:()=>this.zoomPan&&this.zoomPan.zoomOut(),onReset:()=>this.zoomPan&&this.zoomPan.resetZoom()}))}onZoomChange(t,i,o){this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null);const s=this.isZoomed;if(this.isZoomed=t>1,this.isZoomed&&!s){if(this.hideAllIcons(),this.hideHotspots(),this.zoomControlsUI&&this.zoomControlsUI.show(),!this.highResLoaded){this.highResLoaded=!0;const n=document.body.offsetWidth;this.loadHigherQualityImages(n,()=>{this.zoomPan&&this.updateView(this.zoomPan.getZoom(),this.zoomPan.panX,this.zoomPan.panY)})}this.emit("onZoomIn",{zoomLevel:t}),this.announce("Zoomed in. Use mouse drag or arrow keys to pan. Double-click or press 0 to reset.")}!this.isZoomed&&s&&(this.showAllIcons(),this.emit("onZoomOut"),this.announce("Zoomed out")),this.zoomControlsUI&&this.zoomControlsUI.updateState(t),this.updateView(t,i,o)}removeZoom(){this.zoomPan&&this.zoomPan.resetZoom()}toggleZoom(){this.zoomPan&&(this.isZoomed?this.zoomPan.resetZoom():this.zoomPan.setZoom(2))}touchStart(t){if(!this.isReady||!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")||i.closest(".cloudimage-360-zoom-controls")))return;if(this.hideHints(),t.touches.length>1){this.isClicked=!1;return}if(this.isZoomed)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)}touchEnd(t){this.isReady&&(this.isZoomed||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.isZoomed||t.touches&&t.touches.length>1||!this.isClicked||!t.touches||!t.touches[0])return;const{pageX:i,pageY:o}=t.touches[0];t.preventDefault(),this.drag(i,o)}keyDown(t){if(!this.isReady)return;const i=t.target&&t.target.tagName;if(i==="INPUT"||i==="TEXTAREA"||t.target&&t.target.isContentEditable)return;const{keyCode:o}=t,s=this.keysReverse;if(this.autoplay&&this.stopAutoplay(),this.zoomPan&&this.zoomPan.handleKeyZoom(o)){t.preventDefault(),this.hideHints();return}if(this.isZoomed&&this.zoomPan&&this.zoomPan.handleKeyPan(o,Ni)){t.preventDefault();return}switch(Ne(o,this.allowSpinY)&&(this.hasInteracted=!0,this.hideAllIcons(),this.hideHints()),o){case 37:s?this.moveLeft():this.moveRight();break;case 39:s?this.moveRight():this.moveLeft();break;case 38:this.allowSpinY&&(t.preventDefault(),s?this.moveTop():this.moveBottom());break;case 40:this.allowSpinY&&(t.preventDefault(),s?this.moveBottom():this.moveTop());break}}keyUp(t){const{keyCode:i}=t;Ne(i,this.allowSpinY)&&this.showAllIcons()}moveActiveXIndexUp(t){this.isGridMode||(this.orientation=Y.X),this.activeImageX=(this.activeImageX+t)%this.amountX}moveActiveXIndexDown(t){this.isGridMode||(this.orientation=Y.X),this.activeImageX=(this.activeImageX-t+this.amountX)%this.amountX}moveActiveYIndexUp(t){this.isGridMode||(this.orientation=Y.Y),this.activeImageY=(this.activeImageY+t)%this.amountY}moveActiveYIndexDown(t){this.isGridMode||(this.orientation=Y.Y),this.activeImageY=(this.activeImageY-t+this.amountY)%this.amountY}moveRight(t,i=1){const o=this.isGridMode?this.amountX-1:this.imagesX.length-1;t&&this.activeImageX>=o||(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){const o=this.isGridMode?this.amountY-1:this.imagesY.length-1;t&&this.activeImageY>=o||(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.stopAtEdgesX,i):t==="left"?this.moveLeft(this.stopAtEdgesX,i):t==="up"?this.moveTop(this.stopAtEdgesY,o):t==="down"&&this.moveBottom(this.stopAtEdgesY,o),this.emit("onSpin",{direction:t,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,isGridMode:this.isGridMode})}updateView(t,i,o){let s;if(this.isGridMode){const r=this.activeImageY*this.amountX+this.activeImageX;s=this.imagesGrid[r]}else s=this.orientation===Y.X?this.imagesX[this.activeImageX]:this.imagesY[this.activeImageY];const n=this.isGridMode?this.activeImageY*this.amountX+this.activeImageX:this.orientation===Y.X?this.activeImageX:this.activeImageY;this.hotspotsInstance&&!this.isZoomed&&!this.autoplay&&this.hotspotsInstance.updateHotspotPosition(n,this.isGridMode?"grid":this.orientation),this.hotspotTimelineIndicator&&(this.isGridMode||this.orientation===Y.X)&&this.updateHotspotTimelinePosition(),this.drawImageOnCanvas(s,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.canvas.clientWidth,n=s/this.imageAspectRatio;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:r,pointerX:a,pointerY:l}=this.pendingDrawData;this.canvasWorker.postMessage({action:"drawImageOnCanvas",imageData:n,zoomScale:r,pointerX:a,pointerY:l})}}))}pushImageToSet(t,i,o){o==="grid"?this.imagesGrid[i]=t:o===Y.X?this.imagesX[i]=t:this.imagesY[i]=t}calculatePercentage(){if(this.isGridMode){const o=this.amountX*this.amountY,s=this.imagesGrid.filter(Boolean).length;return Math.round(s/o*100)}const t=this.amountX+this.amountY,i=this.imagesX.filter(Boolean).length+this.imagesY.filter(Boolean).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),this.setupResizeObserver()}setupResizeObserver(){if(this.resizeObserver||!this.container)return;let t=this.container.offsetWidth;this.resizeObserver=new ResizeObserver(i=>{const o=i[0];if(!o)return;const s=Math.round(o.contentRect.width);s===t||s===0||(t=s,requestAnimationFrame(()=>{let n;if(this.isGridMode?n=this.imagesGrid[this.activeImageY*this.amountX+this.activeImageX]:this.orientation===Y.Y&&this.imagesY.length>0?n=this.imagesY[this.activeImageY]:n=this.imagesX[this.activeImageX],n){if(this.adaptCanvasSize(n),this.zoomPan){const r=this.getDrawDimensions();r&&this.zoomPan.setDrawSize(r.drawWidth,r.drawHeight,!0)}this.updateView()}}))}),this.resizeObserver.observe(this.container)}onAllImagesLoaded(){if(this.addAllIcons(),this.isReady=!0,this.isGridMode||(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)if(this.hotspotsInstance=new bn(this.hotspots,this.innerBox,this.imageAspectRatio,{trigger:this.hotspotTrigger,onOpen:this.onHotspotOpen,onClose:this.onHotspotClose,onProductClick:this.onProductClick,onNavigate:this.onNavigate}),this.addHotspotTimeline(),this.autoplay)this.hotspotsInstance.hideHotspots(),this.hideHotspotTimeline();else{const t=this.isGridMode?this.activeImageY*this.amountX+this.activeImageX:this.activeImageX,i=this.isGridMode?"grid":this.orientation;this.hotspotsInstance.updateHotspotPosition(t,i),this.showHotspotTimeline()}if(this.emit("onLoad",{imagesX:this.isGridMode?this.amountX:this.imagesX.length,imagesY:this.isGridMode?this.amountY:this.imagesY.length,...this.isGridMode&&{imagesGrid:this.imagesGrid.filter(Boolean).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?Ze(this.viewerConfig,this.touchDevice):this.hints;t&&t.length>0&&(this.hintsOverlay=Re(this.innerBox,t),De(this.hintsOverlay))}this.autoplay&&(this.hideAllIcons(),Do(this.play.bind(this))())}toggleFullscreen(t){t.stopPropagation(),this.hideHotspotPopper(),ne()?Ve():Go(this.container)}onFullscreenChange(){const t=ne()===this.container,i=this.container.classList.contains("cloudimage-360--fullscreen");t!==i&&(this.container.classList.toggle("cloudimage-360--fullscreen",t),ao(this.fullscreenIcon,t),t?(this.emit("onFullscreenOpen"),this.announce("Opened fullscreen mode. Press Escape to exit.")):(this.emit("onFullscreenClose"),this.announce("Exited fullscreen mode")))}play(){if(this.isClicked)return;this.hide360ViewCircleIcon(),this.emit("onAutoplayStart");let t;if(this.isGridMode){const s=this.autoplayBehavior;s==="spin-x"?t=this.amountX:s==="spin-y"?t=this.amountY:t=Math.max(this.amountX,this.amountY)}else t=this.amountX+this.amountY;const i=this.speed*36/t,o={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&&Mo({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse,isGridMode:this.isGridMode})){this.stopAutoplay();return}if(this.isGridMode){this.gridAutoplayTick(o);return}Oo({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse,spinDirection:this.spinDirection})&&(this.spinDirection=Ro(this.spinDirection));const r=this.spinDirection==="y";Lo({autoplayBehavior:this.autoplayBehavior,spinY:r,reversed:this.autoplayReverse,loopTriggers:o})},i)}gridAutoplayTick(t){const i=this.autoplayReverse,o=this.autoplayBehavior;if(o==="spin-x"){i?t.left():t.right();return}if(o==="spin-y"){i?t.bottom():t.top();return}if(o==="spin-xy"){const s=i?0:this.amountX-1,n=this.activeImageX===s;i?this.activeImageX=(this.activeImageX-1+this.amountX)%this.amountX:this.activeImageX=(this.activeImageX+1)%this.amountX,n&&(i?this.activeImageY=(this.activeImageY-1+this.amountY)%this.amountY:this.activeImageY=(this.activeImageY+1)%this.amountY),this.isZoomed||this.updateView(),this.emit("onSpin",{direction:i?"left":"right",activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,isGridMode:!0});return}if(o==="spin-yx"){const s=i?0:this.amountY-1,n=this.activeImageY===s;i?this.activeImageY=(this.activeImageY-1+this.amountY)%this.amountY:this.activeImageY=(this.activeImageY+1)%this.amountY,n&&(i?this.activeImageX=(this.activeImageX-1+this.amountX)%this.amountX:this.activeImageX=(this.activeImageX+1)%this.amountX),this.isZoomed||this.updateView(),this.emit("onSpin",{direction:i?"down":"up",activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,isGridMode:!0})}}stopAutoplay(){if(this.showAllIcons(),this.autoplay=!1,window.clearInterval(this.loopTimeoutId),this.loopTimeoutId=null,this.emit("onAutoplayStop"),this.hotspotsInstance){const t=this.isGridMode?this.activeImageY*this.amountX+this.activeImageX:this.activeImageX,i=this.isGridMode?"grid":this.orientation;this.hotspotsInstance.updateHotspotPosition(t,i),this.showHotspotTimeline()}if(this.hints!==!1&&!this.hintsOverlay&&!this.hintsHidden){const t=this.hints===!0?Ze(this.viewerConfig,this.touchDevice):this.hints;t&&t.length>0&&(this.hintsOverlay=Re(this.innerBox,t),De(this.hintsOverlay))}}destroy(){this.stopAutoplay(),this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null),this.removeEvents(),this.zoomPan&&(this.zoomPan.destroy(),this.zoomPan=null),this.gestureRecognizer&&(this.gestureRecognizer.destroy(),this.gestureRecognizer=null),this.zoomControlsUI&&(this.zoomControlsUI.destroy(),this.zoomControlsUI=null),this.scrollHintUI&&(this.scrollHintUI.destroy(),this.scrollHintUI=null),this.closeImageBitmaps(this.imagesX),this.closeImageBitmaps(this.imagesY),this.closeImageBitmaps(this.imagesGrid),this.imagesX=[],this.imagesY=[],this.imagesGrid=[],this.isGridMode=!1,this.isReady=!1,this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),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"),ne()===this.container&&Ve(),this.container&&(this.container.classList.remove("ci360-theme-dark","ci360-hotspot-marker-inverted","ci360-hotspot-marker-brand","cloudimage-360--fullscreen"),this.container.style.removeProperty("--ci360-hotspot-brand-color"),this.container.innerHTML="")}releaseMemory(){this.stopAutoplay(),this.closeImageBitmaps(this.imagesX),this.closeImageBitmaps(this.imagesY),this.closeImageBitmaps(this.imagesGrid),this.imagesX=[],this.imagesY=[],this.imagesGrid=[],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=oo(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)}addFullscreenIcon(){!this.fullscreen||!Bo()||(this.fullscreenIcon=ro(),this.fullscreenIcon.onclick=this.toggleFullscreen.bind(this),this.iconsContainer.appendChild(this.fullscreenIcon))}showFullscreenIcon(){this.fullscreenIcon&&(this.fullscreenIcon.style.opacity=1)}hideFullscreenIcon(){this.fullscreenIcon&&(this.fullscreenIcon.style.opacity=0)}add360ViewCircleIcon(){this.view360CircleIcon||(this.view360CircleIcon=eo(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=ho(),this.innerBox.appendChild(this.loadingSpinner)}showLoadingSpinner(){this.loadingSpinner&&(this.hideAllIcons(),this.loadingSpinner.style.opacity=1)}hideLoadingSpinner(){this.loadingSpinner&&(this.loadingSpinner.style.opacity=0)}hideHints(){!this.hintsOverlay||this.hintsHidden||(this.hintsHidden=!0,vo(this.hintsOverlay))}addHotspotTimeline(){if(!this.hotspots||this.hotspotTimeline)return;const t=this.isGridMode?this.amountX*this.amountY:this.amountX,i=Co(this.innerBox,t,this.hotspots);if(!i)return;this.hotspotTimeline=i.element,this.hotspotTimelineIndicator=i.indicator,this.innerBox.classList.add("has-hotspot-timeline"),this.hotspotTimeline.querySelectorAll(".cloudimage-360-hotspot-timeline-dot").forEach(s=>{s.addEventListener("click",n=>{n.stopPropagation(),this.hideAllIcons(),this.hideHints();const r=parseInt(s.getAttribute("data-frame"),10),a=s.getAttribute("data-hotspot-id");isNaN(r)||this.animateToFrame(r,a)})}),this.updateHotspotTimelinePosition()}showHotspotTimeline(){Io(this.hotspotTimeline)}hideHotspotTimeline(){ko(this.hotspotTimeline)}updateHotspotTimelinePosition(){if(this.isGridMode){const t=this.activeImageY*this.amountX+this.activeImageX;Be(this.hotspotTimelineIndicator,t,this.amountX*this.amountY)}else Be(this.hotspotTimelineIndicator,this.activeImageX,this.amountX)}animateToFrame(t,i){this.hotspotsInstance&&this.hotspotsInstance.hidePopper();const o=this.isGridMode?this.activeImageY*this.amountX+this.activeImageX:this.activeImageX;if(this.isAnimatingToFrame||t===o){t===o&&i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&this.hotspotsInstance.showHotspotById(i);return}if(this.isAnimatingToFrame=!0,this.hasInteracted=!0,(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null),this.isGridMode){const m=this.amountX*this.amountY,u=Math.max(0,Math.min(t,m-1));this.activeImageY=Math.floor(u/this.amountX),this.activeImageX=u%this.amountX,this.isZoomed||this.updateView(),this.emit("onSpin",{direction:u>o?"right":"left",activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,isGridMode:!0}),this.isAnimatingToFrame=!1,i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&setTimeout(()=>{this.hotspotsInstance.showHotspotById(i)},50);return}const s=this.activeImageX,n=(t-s+this.amountX)%this.amountX,r=(s-t+this.amountX)%this.amountX,a=n<=r,l=a?n:r;if(l===0){this.isAnimatingToFrame=!1;return}const h=30;let c=l;const p=()=>{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(p,h):(this.isAnimatingToFrame=!1,i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&setTimeout(()=>{this.hotspotsInstance.showHotspotById(i)},50))};p()}remove360ViewCircleIcon(){this.view360CircleIcon&&(this.innerBox.removeChild(this.view360CircleIcon),this.view360CircleIcon=null)}addAllIcons(){this.removeLoader(),this.iconsContainer&&(this.innerBox.style.cursor="grab",this.addLoadingSpinner(),this.addFullscreenIcon(),this.initialIconShown&&this.addInitialIcon(),this.bottomCircle&&this.add360ViewCircleIcon(),this.initZoom())}showAllIcons(){this.showInitialIcon(),this.show360ViewCircleIcon(),this.showFullscreenIcon(),this.showHotspotTimeline(),this.zoomControlsUI&&this.zoomControlsUI.show()}hideAllIcons(){this.hideInitialIcon(),this.hide360ViewCircleIcon(),this.hideFullscreenIcon(),this.zoomControlsUI&&this.zoomControlsUI.hide()}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(),this.addFullscreenChangeHandler()}removeEvents(){this.removeMouseEvents(),this.removeTouchEvents(),this.removeKeyboardEvents(),this.removeEscKeyHandler(),this.removeFullscreenChangeHandler()}addMouseEvents(){this.boundMouseClick=this.mouseClick.bind(this),this.boundMouseDown=this.mouseDown.bind(this),this.boundMouseMove=ze(this.mouseMove.bind(this),Te),this.boundMouseUp=this.mouseUp.bind(this),this.innerBox.addEventListener("click",this.boundMouseClick),this.innerBox.addEventListener("mousedown",this.boundMouseDown),document.addEventListener("mousemove",this.boundMouseMove),document.addEventListener("mouseup",this.boundMouseUp)}addTouchEvents(){this.boundTouchStart=this.touchStart.bind(this),this.boundTouchEnd=this.touchEnd.bind(this),this.boundTouchMove=ze(this.touchMove.bind(this),Te),this.container.addEventListener("touchstart",this.boundTouchStart,{passive:!1}),this.container.addEventListener("touchend",this.boundTouchEnd),this.container.addEventListener("touchmove",this.boundTouchMove,{passive:!1})}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.isZoomed&&this.removeZoom()},document.addEventListener("keydown",this.boundEscHandler)}removeEscKeyHandler(){document.removeEventListener("keydown",this.boundEscHandler)}addFullscreenChangeHandler(){this.boundFullscreenChange=this.onFullscreenChange.bind(this),document.addEventListener("fullscreenchange",this.boundFullscreenChange),document.addEventListener("webkitfullscreenchange",this.boundFullscreenChange)}removeFullscreenChangeHandler(){document.removeEventListener("fullscreenchange",this.boundFullscreenChange),document.removeEventListener("webkitfullscreenchange",this.boundFullscreenChange)}removeMouseEvents(){this.innerBox.removeEventListener("click",this.boundMouseClick),this.innerBox.removeEventListener("mousedown",this.boundMouseDown),document.removeEventListener("mousemove",this.boundMouseMove),document.removeEventListener("mouseup",this.boundMouseUp)}removeTouchEvents(){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=Oe(this.innerBox),this.canvas=so(this.innerBox,t),this.loader=co(this.innerBox),this.ariaLiveRegion=uo(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])}oe(this.innerBox,".cloudimage-360-placeholder")}update(t){this.isReady&&(this.stopAutoplay(),this.zoomPan&&(this.zoomPan.destroy(),this.zoomPan=null),this.gestureRecognizer&&(this.gestureRecognizer.destroy(),this.gestureRecognizer=null),this.zoomControlsUI&&(this.zoomControlsUI.destroy(),this.zoomControlsUI=null),this.scrollHintUI&&(this.scrollHintUI.destroy(),this.scrollHintUI=null),this.isZoomed=!1,this.highResLoaded=!1,this.hotspotsInstance&&(this.hotspotsInstance.destroy(),this.hotspotsInstance=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.hintsOverlay&&this.hintsOverlay.parentNode&&(this.hintsOverlay.parentNode.removeChild(this.hintsOverlay),this.hintsOverlay=null),this.hintsHidden=!1,oe(this.innerBox,".cloudimage-360-icons-container"),this.init(this.container,t,!0),this.iconsContainer=Oe(this.innerBox),this.onAllImagesLoaded())}init(t,i,o){const s=i?ji(i):Wi(t),{folder:n,apiVersion:r,filenameX:a,filenameY:l,filenameGrid:h,imageListX:c,imageListY:p,imageListGrid:m,indexZeroBase:u,amountX:x,amountY:v,draggable:y=!0,swipeable:I=!0,keys:k,keysReverse:w,bottomCircleOffset:g,autoplay:P,autoplayBehavior:f,playOnce:b,speed:C,autoplayReverse:E,fullscreen:T,magnifier:A,pointerZoom:M,zoomMax:L,zoomStep:K,zoomControls:q,zoomControlsPosition:O,scrollHint:D,ciToken:bt,ciFilters:J,ciTransformation:yt,lazyload:wt,dragSpeed:ct,stopAtEdges:st,stopAtEdgesX:nt,stopAtEdgesY:$,imageInfo:ht="black",initialIconShown:xt,bottomCircle:Q,hotspots:Yt,hotspotTrigger:ge="hover",dragReverse:Lt,hide360Logo:ve,logoSrc:Nt,inertia:be,pinchZoom:ye,hints:Wt,theme:Mt,markerTheme:Vt,brandColor:jt,hotspotTimelineOnClick:tt=!0,aspectRatio:Ct,cropAspectRatio:$t,cropGravity:Ut,onReady:Ot,onLoad:Kt,onSpin:qt,onAutoplayStart:Jt,onAutoplayStop:Qt,onFullscreenOpen:wn,onFullscreenClose:xn,onZoomIn:Cn,onZoomOut:In,onDragStart:kn,onDragEnd:Pn,onHotspotOpen:En,onHotspotClose:zn,onProductClick:Tn,onNavigate:An,onError:Xn}=s,we={ciToken:bt,ciFilters:J,ciTransformation:yt,cropAspectRatio:$t,cropGravity:Ut},xe=Dt(c,[]),Ce=Dt(p,[]);let dt=Dt(m,[]);dt.length&&Array.isArray(dt[0])&&(dt=dt.flat()),this.isGridMode=!!(h||dt.length);const Sn=s.zoomMax===5&&M>1?Math.min(M,5):L||5;if(this.viewerConfig=s,this.amountX=xe.length||x,this.amountY=Ce.length||v,this.allowSpinX=!!this.amountX,this.allowSpinY=!!this.amountY,this.isGridMode&&(this.allowSpinX=!0,this.allowSpinY=!0),this.orientation=this.allowSpinX?Y.X:Y.Y,this.activeImageX=E?this.amountX-1:0,this.activeImageY=E?this.amountY-1:0,this.bottomCircleOffset=g,this.autoplay=P,this.autoplayBehavior=f,this.playOnce=b,this.speed=C,this.autoplayReverse=E,this.fullscreen=T,this.zoomMax=Sn,this.zoomStep=K||.5,this.zoomControls=q??!0,this.zoomControlsPosition=O||"bottom-left",this.scrollHint=D??!0,this.dragSpeed=Math.max(ct,Fi),this.stopAtEdges=st,this.stopAtEdgesX=nt??st,this.stopAtEdgesY=$??st,this.ciParams=we,this.apiVersion=r,this.keysReverse=w,this.info=ht,this.keys=k,this.innerBox=this.innerBox??lo(this.container),this.container.style.aspectRatio=Ct||"",this.initialIconShown=xt,this.bottomCircle=Q,this.spinDirection=Ho(this.autoplayBehavior,this.allowSpinX,this.allowSpinY),this.dragReverse=Lt,this.hotspots=Yt,this.hotspotTrigger=ge,this.onHotspotOpen=En,this.onHotspotClose=zn,this.onProductClick=Tn,this.onNavigate=An,this.hide360Logo=ve,this.logoSrc=Nt,this.inertia=be,this.pinchZoom=ye,this.hints=Wt,this.hotspotTimelineOnClick=tt,Mt==="dark"?this.container.classList.add("ci360-theme-dark"):Mt==="light"&&this.container.classList.remove("ci360-theme-dark"),this.container.classList.remove("ci360-hotspot-marker-inverted","ci360-hotspot-marker-brand"),Vt==="inverted"?this.container.classList.add("ci360-hotspot-marker-inverted"):Vt==="brand"&&(this.container.classList.add("ci360-hotspot-marker-brand"),jt&&this.container.style.setProperty("--ci360-hotspot-brand-color",jt)),this.onReady=Ot,this.onLoad=Kt,this.onSpin=qt,this.onAutoplayStart=Jt,this.onAutoplayStop=Qt,this.onFullscreenOpen=wn,this.onFullscreenClose=xn,this.onZoomIn=Cn,this.onZoomOut=In,this.onDragStart=kn,this.onDragEnd=Pn,this.onError=Xn,this.srcXConfig={folder:n,filename:a,imageList:xe,container:t,innerBox:this.innerBox,apiVersion:r,ciParams:we,lazyload:wt,amount:this.amountX,indexZeroBase:u,autoplayReverse:E,orientation:Y.X},this.srcYConfig={...this.srcXConfig,filename:l,imageList:Ce,orientation:Y.Y,amount:this.amountY},this.srcGridConfig={folder:n,filename:h,imageList:dt,container:t,innerBox:this.innerBox,apiVersion:r,ciParams:we,lazyload:wt,amount:this.amountX*this.amountY,amountX:this.amountX,amountY:this.amountY,indexZeroBase:u,autoplayReverse:E},o&&this.removeEvents(),this.attachEvents(y,I,k),o)return;const Ie=this.container.offsetWidth;if(this.isGridMode){const Ht=dt.length?null:rt(this.srcGridConfig,Ie),te=ee=>{Le({cdnPath:Ht,config:this.srcGridConfig,onImageLoad:(et,N)=>{this.pushImageToSet(et,N,"grid"),this.updatePercentageInLoader(this.calculatePercentage())},onFirstImageLoad:et=>this.onFirstImageLoaded(ee,et),onAllImagesLoad:(et,N)=>{this.imagesGrid=et,N&&N.errorCount>0&&this.emit("onError",{errorCount:N.errorCount,errors:N.errors,totalImages:this.amountX*this.amountY}),this.onAllImagesLoaded()},onError:et=>this.emit("onError",et)})};se(Ht,this.srcGridConfig,te)}else{const Ht=this.allowSpinX&&!xe.length?rt(this.srcXConfig,Ie):null,te=this.allowSpinY&&!Ce.length?rt(this.srcYConfig,Ie):null,ee=et=>{Ye({cdnPathX:Ht,cdnPathY:te,configX:this.srcXConfig,configY:this.srcYConfig,onImageLoad:(N,Yn,Ln)=>this.onImageLoad(N,Yn,Ln),onFirstImageLoad:N=>this.onFirstImageLoaded(et,N),onAllImagesLoad:this.onAllImagesLoaded.bind(this),onError:N=>this.emit("onError",N)})};this.allowSpinX?se(Ht,this.srcXConfig,ee):this.allowSpinY&&se(te,this.srcYConfig,ee)}}}const gi=typeof navigator<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);let yn=class{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){if(!t)return;const o=t.id||this.generateId();t.id||(t.id=o);const s=new fi(t,i);return this.views.set(o,s),gi&&!this.memoryManagementAutoEnabled&&(this.memoryManagementAutoEnabled=!0,setTimeout(()=>this.enableMemoryManagement(),100)),s}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 fi(o);this.views.set(s,n)}),gi&&!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 r=n.getBoundingClientRect();r.top<window.innerHeight&&r.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)}};const vi=new yn;return window.CI360=vi,vi}();
|
|
65
|
+
`,o},se=(e,t,i)=>{const{innerBox:o,imageList:s,lazyload:n}=t||{},[r]=s,a=r||Xo(e,t),l=Eo(a),h=Ge(l,n,"cloudimage-lazy"),c=Ge(l,!1,"cloudimage-360-placeholder"),p=m=>{oe(o,".cloudimage-lazy"),i&&i({event:m,width:h.width,height:h.height,naturalWidth:h.naturalWidth,naturalHeight:h.naturalHeight,src:l})};h.onload=p,o.appendChild(h),o.appendChild(c),zo(h)},So=(e,t,i)=>{const o=e/i,s=t/i;return{zoomedWidth:o,zoomedHeight:s}},Yo=({pointerX:e,pointerY:t,imageData:i,zoomedWidth:o,zoomedHeight:s,drawWidth:n,drawHeight:r})=>{const{naturalWidth:a,naturalHeight:l}=i;let h=e/n*a-o/2,c=t/r*l-s/2;const p=Math.max(0,a-o),m=Math.max(0,l-s);return h=Math.max(0,Math.min(h,p)),c=Math.max(0,Math.min(c,m)),{zoomOffsetX:h,zoomOffsetY:c}},_e=(e,{bottom:t,top:i})=>{e?t():i()},Fe=(e,{left:t,right:i})=>{e?t():i()},Lo=({autoplayBehavior:e,spinY:t,reversed:i,loopTriggers:o})=>{switch(e){case X.SPIN_XY:case X.SPIN_YX:t?_e(i,o):Fe(i,o);break;case X.SPIN_Y:_e(i,o);break;case X.SPIN_X:default:Fe(i,o)}},Mo=({autoplayBehavior:e,activeImageX:t,activeImageY:i,amountX:o,amountY:s,autoplayReverse:n,isGridMode:r=!1})=>{const a=(l,h)=>{const c=h-1;return n?l===0:l===c};if(r)switch(e){case X.SPIN_X:return a(t,o);case X.SPIN_Y:return a(i,s);case X.SPIN_XY:case X.SPIN_YX:default:return a(t,o)&&a(i,s)}switch(e){case X.SPIN_XY:case X.SPIN_Y:return a(i,s);case X.SPIN_X:case X.SPIN_YX:default:return a(t,o)}},Oo=({autoplayBehavior:e,activeImageX:t,activeImageY:i,amountX:o,amountY:s,autoplayReverse:n,spinDirection:r,isGridMode:a=!1})=>{if(a)return!1;const l=t===(n?0:o-1),h=i===(n?0:s-1);return e===X.SPIN_XY||e===X.SPIN_YX?r==="x"&&l||r==="y"&&h:!1},Ho=(e,t,i)=>{if(!i)return"x";if(!t)return"y";switch(e){case X.SPIN_XY:return"x";case X.SPIN_YX:return"y";case X.SPIN_Y:return"y";case X.SPIN_X:default:return"x"}},Ro=e=>e==="x"?"y":"x",Ne=(e,t)=>{const i=[...Zi];return t?[...i,...Di].includes(e):i.includes(e)},We=({deltaX:e,deltaY:t,reversed:i,allowSpinX:o,allowSpinY:s,threshold:n=0})=>{const r=o&&!s||s&&!o?0:n,a=Math.abs(e),l=Math.abs(t);return o&&a-r>l?i?e>0?"left":"right":e>0?"right":"left":s&&l-r>a?i?t>0?"up":"down":t>0?"down":"up":null},Zo=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,Do=(e,t=150)=>{let i;return function(...o){clearTimeout(i),i=setTimeout(()=>{e.apply(this,o)},t)}},Bo=()=>document.fullscreenEnabled||document.webkitFullscreenEnabled,ne=()=>document.fullscreenElement||document.webkitFullscreenElement,Go=e=>e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():Promise.reject(new Error("Fullscreen API not supported")),Ve=()=>document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():Promise.reject(new Error("Fullscreen API not supported")),W=1;class _o{constructor(t,{zoomMax:i=5,zoomStep:o=.5,onZoomChange:s}={}){this.container=t,this.zoomMax=i,this.zoomStep=o,this.onZoomChange=s,this.zoom=1,this.panX=0,this.panY=0,this.drawWidth=0,this.drawHeight=0,this.isPanning=!1,this.panStartX=0,this.panStartY=0,this._onWheel=this._onWheel.bind(this),this._onDblClick=this._onDblClick.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onGestureStart=this._onGestureStart.bind(this),this._onGestureChange=this._onGestureChange.bind(this),this._onGestureEnd=this._onGestureEnd.bind(this),this._gestureBaseZoom=1,this._attach()}setDrawSize(t,i,o=!1){const s=this.drawWidth,n=this.drawHeight;this.drawWidth=t,this.drawHeight=i,o&&s&&n?(this.panX=this.panX/s*t,this.panY=this.panY/n*i,this._clampPan()):(this.panX=t/2,this.panY=i/2)}_attach(){this.container.addEventListener("wheel",this._onWheel,{passive:!1}),this.container.addEventListener("dblclick",this._onDblClick),typeof GestureEvent<"u"&&(this.container.addEventListener("gesturestart",this._onGestureStart),this.container.addEventListener("gesturechange",this._onGestureChange),this.container.addEventListener("gestureend",this._onGestureEnd))}destroy(){this.container.removeEventListener("wheel",this._onWheel),this.container.removeEventListener("dblclick",this._onDblClick),this._stopPanListeners(),typeof GestureEvent<"u"&&(this.container.removeEventListener("gesturestart",this._onGestureStart),this.container.removeEventListener("gesturechange",this._onGestureChange),this.container.removeEventListener("gestureend",this._onGestureEnd))}zoomIn(){this._applyZoom(this.zoom+this.zoomStep)}zoomOut(){this._applyZoom(this.zoom-this.zoomStep)}resetZoom(){this._applyZoom(W)}setZoom(t){this._applyZoom(t)}zoomTowardPoint(t,i,o){this._zoomTowardPoint(t,i,o)}getZoom(){return this.zoom}isZoomed(){return this.zoom>W}startPan(t,i){return this.zoom<=W?!1:(this.isPanning=!0,this.panStartX=t,this.panStartY=i,document.addEventListener("mousemove",this._onMouseMove),document.addEventListener("mouseup",this._onMouseUp),!0)}_stopPanListeners(){document.removeEventListener("mousemove",this._onMouseMove),document.removeEventListener("mouseup",this._onMouseUp)}_onMouseMove(t){if(!this.isPanning)return;const i=t.pageX-this.panStartX,o=t.pageY-this.panStartY;this.panStartX=t.pageX,this.panStartY=t.pageY,this._applyPan(this.panX-i,this.panY-o)}_onMouseUp(){this.isPanning=!1,this._stopPanListeners()}_onWheel(t){if(!t.ctrlKey&&!t.metaKey)return;t.preventDefault();let i=-t.deltaY;t.deltaMode===1&&(i*=40),t.deltaMode===2&&(i*=800);const o=Math.pow(2,i/300),s=this.zoom*o;this._zoomTowardPoint(s,t.clientX,t.clientY)}_onDblClick(t){t.target&&t.target.closest&&(t.target.closest(".cloudimage-360-button")||t.target.closest(".cloudimage-360-hotspot-timeline")||t.target.closest(".cloudimage-360-hotspot")||t.target.closest(".cloudimage-360-zoom-controls"))||(this.zoom>W?this._applyZoom(W):this._zoomTowardPoint(2,t.clientX,t.clientY))}_onGestureStart(t){t.preventDefault(),this._gestureBaseZoom=this.zoom}_onGestureChange(t){t.preventDefault();const i=this._gestureBaseZoom*t.scale;this._zoomTowardPoint(i,t.clientX,t.clientY)}_onGestureEnd(t){t.preventDefault()}handleKeyZoom(t){return t===187||t===107?(this.zoomIn(),!0):t===189||t===109?(this.zoomOut(),!0):t===48||t===96?(this.resetZoom(),!0):!1}handleKeyPan(t,i=50){if(this.zoom<=W)return!1;let o=0,s=0;switch(t){case 37:o=-i;break;case 39:o=i;break;case 38:s=-i;break;case 40:s=i;break;default:return!1}return this._applyPan(this.panX+o,this.panY+s),!0}applyTouchPan(t,i){this.zoom<=W||this._applyPan(this.panX-t,this.panY-i)}applyTouchZoom(t){this._applyZoom(t)}_zoomTowardPoint(t,i,o){var r;const s=Math.max(W,Math.min(t,this.zoomMax));if(s===this.zoom)return;const n=(r=this.container.querySelector("canvas"))==null?void 0:r.getBoundingClientRect();if(n){const a=(i-n.left)/n.width*this.drawWidth,l=(o-n.top)/n.height*this.drawHeight,h=s/this.zoom;this.panX=a+(this.panX-a)*h,this.panY=l+(this.panY-l)*h}this.zoom=s,this._clampPan(),this._emit()}_applyZoom(t){const i=Math.max(W,Math.min(t,this.zoomMax));i!==this.zoom&&(this.zoom=i,this.zoom<=W&&(this.panX=this.drawWidth/2,this.panY=this.drawHeight/2),this._clampPan(),this._emit())}_applyPan(t,i){this.panX=t,this.panY=i,this._clampPan(),this._emit()}_clampPan(){if(this.zoom<=W||!this.drawWidth||!this.drawHeight)return;const t=this.drawWidth/(2*this.zoom),i=this.drawHeight/(2*this.zoom);this.panX=Math.max(t,Math.min(this.panX,this.drawWidth-t)),this.panY=Math.max(i,Math.min(this.panY,this.drawHeight-i))}_emit(){typeof this.onZoomChange=="function"&&this.onZoomChange(this.zoom,this.panX,this.panY)}}class Fo{constructor(t,{onPinchZoom:i,onPan:o,onDoubleTap:s,getZoom:n,zoomMax:r=5}={}){this.container=t,this.onPinchZoom=i,this.onPan=o,this.onDoubleTap=s,this.getZoom=n,this.zoomMax=r,this.isPinching=!1,this.initialPinchDistance=0,this.pinchBaseZoom=1,this.lastTouchX=0,this.lastTouchY=0,this.lastTapTime=0,this.lastTapX=0,this.lastTapY=0,this._onTouchStart=this._onTouchStart.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._attach()}_attach(){this.container.addEventListener("touchstart",this._onTouchStart,{passive:!1}),this.container.addEventListener("touchmove",this._onTouchMove,{passive:!1}),this.container.addEventListener("touchend",this._onTouchEnd,{passive:!1})}destroy(){this.container.removeEventListener("touchstart",this._onTouchStart),this.container.removeEventListener("touchmove",this._onTouchMove),this.container.removeEventListener("touchend",this._onTouchEnd)}_getPinchDistance(t,i){const o=t.pageX-i.pageX,s=t.pageY-i.pageY;return Math.sqrt(o*o+s*s)}_onTouchStart(t){if(t.touches){if(t.touches.length===2){t.preventDefault(),this.isPinching=!0,this.initialPinchDistance=this._getPinchDistance(t.touches[0],t.touches[1]),this.pinchBaseZoom=typeof this.getZoom=="function"?this.getZoom():1;return}if(t.touches.length===1){const i=t.touches[0];this.lastTouchX=i.pageX,this.lastTouchY=i.pageY;const o=Date.now(),s=o-this.lastTapTime,n=Math.abs(i.pageX-this.lastTapX),r=Math.abs(i.pageY-this.lastTapY);if(s<300&&n<30&&r<30){t.preventDefault(),t.stopPropagation(),this.lastTapTime=0,typeof this.onDoubleTap=="function"&&this.onDoubleTap(i.clientX,i.clientY);return}this.lastTapTime=o,this.lastTapX=i.pageX,this.lastTapY=i.pageY}}}_onTouchMove(t){if(t.touches){if(this.isPinching&&t.touches.length===2){t.preventDefault();const i=this._getPinchDistance(t.touches[0],t.touches[1]);if(this.initialPinchDistance===0){this.initialPinchDistance=i;return}const o=i/this.initialPinchDistance,s=Math.max(1,Math.min(this.pinchBaseZoom*o,this.zoomMax)),n=(t.touches[0].clientX+t.touches[1].clientX)/2,r=(t.touches[0].clientY+t.touches[1].clientY)/2;typeof this.onPinchZoom=="function"&&this.onPinchZoom(s,n,r);return}if(t.touches.length===1){if((typeof this.getZoom=="function"?this.getZoom():1)<=1)return;t.preventDefault();const o=t.touches[0],s=o.pageX-this.lastTouchX,n=o.pageY-this.lastTouchY;this.lastTouchX=o.pageX,this.lastTouchY=o.pageY,typeof this.onPan=="function"&&this.onPan(s,n)}}}_onTouchEnd(t){this.isPinching&&(!t.touches||t.touches.length<2)&&(this.isPinching=!1,this.initialPinchDistance=0,t.touches&&t.touches.length===1&&(this.lastTouchX=t.touches[0].pageX,this.lastTouchY=t.touches[0].pageY))}}const No='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" 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"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="11" x2="11" y1="8" y2="14"/><line x1="8" x2="14" y1="11" y2="11"/></svg>',Wo='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" 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"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="8" x2="14" y1="11" y2="11"/></svg>',Vo='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></svg>',jo=(e,{position:t="bottom-right",onZoomIn:i,onZoomOut:o,onReset:s,zoomMax:n=5}={})=>{const r=document.createElement("div");r.className="cloudimage-360-zoom-controls",r.setAttribute("data-position",t),r.setAttribute("role","toolbar"),r.setAttribute("aria-label","Zoom controls");const a=document.createElement("button");a.className="cloudimage-360-zoom-btn cloudimage-360-zoom-btn-in",a.setAttribute("aria-label","Zoom in"),a.innerHTML=No,a.addEventListener("click",p=>{p.stopPropagation(),typeof i=="function"&&i()});const l=document.createElement("button");l.className="cloudimage-360-zoom-btn cloudimage-360-zoom-btn-out",l.setAttribute("aria-label","Zoom out"),l.innerHTML=Wo,l.disabled=!0,l.addEventListener("click",p=>{p.stopPropagation(),typeof o=="function"&&o()});const h=document.createElement("button");h.className="cloudimage-360-zoom-btn cloudimage-360-zoom-btn-reset",h.setAttribute("aria-label","Reset zoom"),h.innerHTML=Vo,h.disabled=!0,h.addEventListener("click",p=>{p.stopPropagation(),typeof s=="function"&&s()});const c=document.createElement("span");return c.className="cloudimage-360-zoom-separator",r.appendChild(a),r.appendChild(l),r.appendChild(c),r.appendChild(h),e.appendChild(r),{element:r,updateState(p){a.disabled=p>=n,l.disabled=p<=1,h.disabled=p<=1},show(){r.classList.add("visible")},hide(){r.classList.remove("visible")},destroy(){r.parentNode&&r.parentNode.removeChild(r)}}},je="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHY9KHQsYSxlKT0+e2NvbnN0IHM9dC9lLG49YS9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sej0oe3BvaW50ZXJYOnQscG9pbnRlclk6YSxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOmcsbmF0dXJhbEhlaWdodDp1fT1lO2xldCBmPXQvaSpnLXMvMixtPWEvYyp1LW4vMjtjb25zdCB4PU1hdGgubWF4KDAsZy1zKSxPPU1hdGgubWF4KDAsdS1uKTtyZXR1cm4gZj1NYXRoLm1heCgwLE1hdGgubWluKGYseCkpLG09TWF0aC5tYXgoMCxNYXRoLm1pbihtLE8pKSx7em9vbU9mZnNldFg6Zix6b29tT2Zmc2V0WTptfX07bGV0IG8saCxyLGQsbCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIHQ9Pntjb25zdHthY3Rpb246YSxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpnLGltYWdlQXNwZWN0UmF0aW86dSxjb250YWluZXJXaWR0aDpmLGNvbnRhaW5lckhlaWdodDptfT10LmRhdGE7c3dpdGNoKGEpe2Nhc2UiaW5pdENhbnZhcyI6QyhlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjpwKHUsZixtKTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpJKG4saSxjLGcpO2JyZWFrfX07Y29uc3QgQz0odCxhKT0+e289dCxoPW8uZ2V0Q29udGV4dCgiMmQiKSxyPWF9LHA9KHQsYSxlKT0+e2NvbnN0IHM9YS9lO3c9dD5zLG8ud2lkdGg9YSpyLG8uaGVpZ2h0PWUqcixoLnNjYWxlKHIsciksdz8oZD1hLGw9YS90KToobD1lLGQ9ZSp0KSxoLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxoLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEk9KHQ9e30sYT0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09dDtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L3ItbCkvMik6KGk9KG8ud2lkdGgvci1kKS8yLGM9MCksaC5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLGEhPT0xKXtjb25zdHtuYXR1cmFsV2lkdGg6ZyxuYXR1cmFsSGVpZ2h0OnV9PXQse3pvb21lZFdpZHRoOmYsem9vbWVkSGVpZ2h0Om19PXYoZyx1LGEpLHt6b29tT2Zmc2V0WDp4LHpvb21PZmZzZXRZOk99PXooe3BvaW50ZXJYOmUscG9pbnRlclk6cyxpbWFnZURhdGE6dCx6b29tZWRXaWR0aDpmLHpvb21lZEhlaWdodDptLGRyYXdXaWR0aDpkLGRyYXdIZWlnaHQ6bH0pO2guZHJhd0ltYWdlKG4seCxPLGYsbSxpLGMsZCxsKX1lbHNlIGguZHJhd0ltYWdlKG4saSxjLGQsbCl9fSkoKTsK",$o=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),$e=typeof self<"u"&&self.Blob&&new Blob([$o(je)],{type:"text/javascript;charset=utf-8"});function Uo(e){let t;try{if(t=$e&&(self.URL||self.webkitURL).createObjectURL($e),!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,"+je,{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Ko{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:r,pointerX:a,pointerY:l,imageAspectRatio:h,containerWidth:c,containerHeight:p}=t;switch(i){case"initCanvas":this.initCanvas(o,s);break;case"adaptCanvasSize":this.adaptCanvasSize(h,c,p);break;case"drawImageOnCanvas":this.drawImageOnCanvas(n,r,a,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 r,a;if(this.wideImage?(r=0,a=(this.canvas.height/this.dpr-this.drawHeight)/2):(r=(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:l,naturalHeight:h}=t,{zoomedWidth:c,zoomedHeight:p}=So(l,h,i),{zoomOffsetX:m,zoomOffsetY:u}=Yo({pointerX:o,pointerY:s,imageData:t,zoomedWidth:c,zoomedHeight:p,drawWidth:this.drawWidth,drawHeight:this.drawHeight});this.ctx.drawImage(n,m,u,c,p,r,a,this.drawWidth,this.drawHeight)}else this.ctx.drawImage(n,r,a,this.drawWidth,this.drawHeight)}}const qo=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"]),Ue={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"]},Jo=[/javascript:/i,/vbscript:/i,/on\w+\s*=/i],Qo=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(!qo.has(n)){if(n==="script"||n==="style"){o.remove();return}const l=document.createTextNode(o.textContent);o.parentNode.replaceChild(l,o);return}const r=[...Ue[n]||[],...Ue["*"]||[]];if(Array.from(o.attributes).forEach(l=>{const h=l.name.toLowerCase();if(h.startsWith("on")){o.removeAttribute(l.name);return}if(!r.includes(h)){o.removeAttribute(l.name);return}let c=l.value;Jo.forEach(p=>{p.test(c)&&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},ts=e=>e==="y"?Y.Y:Y.X,es=(e,t,i)=>e.filter(o=>t in o.positions?i==="grid"?!0:ts(o.orientation)===i:!1),is=(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},os=e=>{const t=Object.entries(e).sort(([n],[r])=>Number(n)-Number(r));let i=null,o=null;const s={};for(const[n,r]of t)if(!r)s[n]={x:i,y:o};else{const{x:a,y:l}=r;a!=null&&(i=a),l!=null&&(o=l),s[n]={x:a??i,y:l??o}}return s},ss=e=>({placement:"top",modifiers:[{name:"offset",options:{offset:[0,10]}},{name:"preventOverflow",options:{boundary:e}},{name:"flip",options:{boundary:e,fallbackPlacements:["bottom","right","left"]}}]}),ns=(e,t,i)=>{const o=document.createElement("div");return o.className="cloudimage-360-popper",o.id=`cloudimage-360-popper-${t}`,o.dataset.popperId=t,o.setAttribute("role","tooltip"),o.setAttribute("aria-hidden","false"),typeof e=="string"&&/<\/?[a-z][\s\S]*>/i.test(e)?o.innerHTML=Qo(e):o.textContent=e,(i||document.body).appendChild(o),o},rs=e=>e.map(t=>{const i={...os(t.positions)};return{...t,initialPositions:i,positions:i}}),as=({newWidth:e,newHeight:t,initialContainerSize:i,imageAspectRatio:o,hotspotsConfig:s})=>{const[n,r]=i;let a=e,l=t,h=0,c=0;const p=e/t;o>p?(l=e/o,c=(t-l)/2):(a=t*o,h=(e-a)/2);const u=a/n,x=l/r;return s.map(v=>{const y={};return Object.entries(v.initialPositions).forEach(([I,k])=>{y[I]={x:k.x*u+h,y:k.y*x+c}}),{...v,positions:y}})};function ls(e){const t=[];e.image&&t.push(`<div class="ci360-popper-image-wrapper"><img class="ci360-popper-image" src="${kt(e.image)}" alt="${kt(e.title||"")}"></div>`);const i=[];if(e.title&&i.push(`<h3 class="ci360-popper-title">${ut(e.title)}</h3>`),e.originalPrice||e.price){let o="";e.originalPrice&&(o+=`<span class="ci360-popper-original-price">${ut(e.originalPrice)}</span>`),e.price&&(o+=`<span class="ci360-popper-price">${ut(e.price)}</span>`),i.push(`<div class="ci360-popper-price-row">${o}</div>`)}if(e.description&&i.push(`<p class="ci360-popper-description">${ut(e.description)}</p>`),e.url&&cs(e.url)){const o=e.ctaText||"View details",s=e.id?` data-product-id="${kt(e.id)}"`:"";i.push(`<a class="ci360-popper-cta" href="${kt(e.url)}" target="_top"${s}>${ut(String(o))}</a>`)}else if(e.id){const o=e.ctaText||"View details";i.push(`<button class="ci360-popper-cta" data-product-id="${kt(e.id)}">${ut(String(o))}</button>`)}return i.length>0&&t.push(`<div class="ci360-popper-body">${i.join("")}</div>`),t.join("")}function re(e){return e.content?e.content:e.data?ls(e.data):""}function ut(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function kt(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function cs(e){const t=e.replace(/[\s\x00-\x1f]/g,"");return/^https?:\/\//i.test(t)||/^\/(?!\/)/.test(t)||/^#/.test(t)}var H="top",G="bottom",_="right",R="left",ae="auto",Pt=[H,G,_,R],mt="start",Et="end",hs="clippingParents",Ke="viewport",zt="popper",ds="reference",qe=Pt.reduce(function(e,t){return e.concat([t+"-"+mt,t+"-"+Et])},[]),Je=[].concat(Pt,[ae]).reduce(function(e,t){return e.concat([t,t+"-"+mt,t+"-"+Et])},[]),ps="beforeRead",us="read",ms="afterRead",fs="beforeMain",gs="main",vs="afterMain",bs="beforeWrite",ys="write",ws="afterWrite",xs=[ps,us,ms,fs,gs,vs,bs,ys,ws];function V(e){return e?(e.nodeName||"").toLowerCase():null}function Z(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function at(e){var t=Z(e).Element;return e instanceof t||e instanceof Element}function F(e){var t=Z(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function le(e){if(typeof ShadowRoot>"u")return!1;var t=Z(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Cs(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];!F(n)||!V(n)||(Object.assign(n.style,o),Object.keys(s).forEach(function(r){var a=s[r];a===!1?n.removeAttribute(r):n.setAttribute(r,a===!0?"":a)}))})}function Is(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]||{},r=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:i[o]),a=r.reduce(function(l,h){return l[h]="",l},{});!F(s)||!V(s)||(Object.assign(s.style,a),Object.keys(n).forEach(function(l){s.removeAttribute(l)}))})}}const ks={name:"applyStyles",enabled:!0,phase:"write",fn:Cs,effect:Is,requires:["computeStyles"]};function j(e){return e.split("-")[0]}var lt=Math.max,Bt=Math.min,ft=Math.round;function ce(){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 Qe(){return!/^((?!chrome|android).)*safari/i.test(ce())}function gt(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var o=e.getBoundingClientRect(),s=1,n=1;t&&F(e)&&(s=e.offsetWidth>0&&ft(o.width)/e.offsetWidth||1,n=e.offsetHeight>0&&ft(o.height)/e.offsetHeight||1);var r=at(e)?Z(e):window,a=r.visualViewport,l=!Qe()&&i,h=(o.left+(l&&a?a.offsetLeft:0))/s,c=(o.top+(l&&a?a.offsetTop:0))/n,p=o.width/s,m=o.height/n;return{width:p,height:m,top:c,right:h+p,bottom:c+m,left:h,x:h,y:c}}function he(e){var t=gt(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 ti(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&le(i)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function U(e){return Z(e).getComputedStyle(e)}function Ps(e){return["table","td","th"].indexOf(V(e))>=0}function ot(e){return((at(e)?e.ownerDocument:e.document)||window.document).documentElement}function Gt(e){return V(e)==="html"?e:e.assignedSlot||e.parentNode||(le(e)?e.host:null)||ot(e)}function ei(e){return!F(e)||U(e).position==="fixed"?null:e.offsetParent}function Es(e){var t=/firefox/i.test(ce()),i=/Trident/i.test(ce());if(i&&F(e)){var o=U(e);if(o.position==="fixed")return null}var s=Gt(e);for(le(s)&&(s=s.host);F(s)&&["html","body"].indexOf(V(s))<0;){var n=U(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 Tt(e){for(var t=Z(e),i=ei(e);i&&Ps(i)&&U(i).position==="static";)i=ei(i);return i&&(V(i)==="html"||V(i)==="body"&&U(i).position==="static")?t:i||Es(e)||t}function de(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function At(e,t,i){return lt(e,Bt(t,i))}function zs(e,t,i){var o=At(e,t,i);return o>i?i:o}function ii(){return{top:0,right:0,bottom:0,left:0}}function oi(e){return Object.assign({},ii(),e)}function si(e,t){return t.reduce(function(i,o){return i[o]=e,i},{})}var Ts=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,oi(typeof t!="number"?t:si(t,Pt))};function As(e){var t,i=e.state,o=e.name,s=e.options,n=i.elements.arrow,r=i.modifiersData.popperOffsets,a=j(i.placement),l=de(a),h=[R,_].indexOf(a)>=0,c=h?"height":"width";if(!(!n||!r)){var p=Ts(s.padding,i),m=he(n),u=l==="y"?H:R,x=l==="y"?G:_,v=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],y=r[l]-i.rects.reference[l],I=Tt(n),k=I?l==="y"?I.clientHeight||0:I.clientWidth||0:0,w=v/2-y/2,g=p[u],P=k-m[c]-p[x],f=k/2-m[c]/2+w,b=At(g,f,P),C=l;i.modifiersData[o]=(t={},t[C]=b,t.centerOffset=b-f,t)}}function Xs(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)||ti(t.elements.popper,s)&&(t.elements.arrow=s))}const Ss={name:"arrow",enabled:!0,phase:"main",fn:As,effect:Xs,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function vt(e){return e.split("-")[1]}var Ys={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ls(e,t){var i=e.x,o=e.y,s=t.devicePixelRatio||1;return{x:ft(i*s)/s||0,y:ft(o*s)/s||0}}function ni(e){var t,i=e.popper,o=e.popperRect,s=e.placement,n=e.variation,r=e.offsets,a=e.position,l=e.gpuAcceleration,h=e.adaptive,c=e.roundOffsets,p=e.isFixed,m=r.x,u=m===void 0?0:m,x=r.y,v=x===void 0?0:x,y=typeof c=="function"?c({x:u,y:v}):{x:u,y:v};u=y.x,v=y.y;var I=r.hasOwnProperty("x"),k=r.hasOwnProperty("y"),w=R,g=H,P=window;if(h){var f=Tt(i),b="clientHeight",C="clientWidth";if(f===Z(i)&&(f=ot(i),U(f).position!=="static"&&a==="absolute"&&(b="scrollHeight",C="scrollWidth")),f=f,s===H||(s===R||s===_)&&n===Et){g=G;var E=p&&f===P&&P.visualViewport?P.visualViewport.height:f[b];v-=E-o.height,v*=l?1:-1}if(s===R||(s===H||s===G)&&n===Et){w=_;var T=p&&f===P&&P.visualViewport?P.visualViewport.width:f[C];u-=T-o.width,u*=l?1:-1}}var A=Object.assign({position:a},h&&Ys),M=c===!0?Ls({x:u,y:v},Z(i)):{x:u,y:v};if(u=M.x,v=M.y,l){var L;return Object.assign({},A,(L={},L[g]=k?"0":"",L[w]=I?"0":"",L.transform=(P.devicePixelRatio||1)<=1?"translate("+u+"px, "+v+"px)":"translate3d("+u+"px, "+v+"px, 0)",L))}return Object.assign({},A,(t={},t[g]=k?v+"px":"",t[w]=I?u+"px":"",t.transform="",t))}function Ms(e){var t=e.state,i=e.options,o=i.gpuAcceleration,s=o===void 0?!0:o,n=i.adaptive,r=n===void 0?!0:n,a=i.roundOffsets,l=a===void 0?!0:a,h={placement:j(t.placement),variation:vt(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,ni(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ni(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Os={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ms,data:{}};var _t={passive:!0};function Hs(e){var t=e.state,i=e.instance,o=e.options,s=o.scroll,n=s===void 0?!0:s,r=o.resize,a=r===void 0?!0:r,l=Z(t.elements.popper),h=[].concat(t.scrollParents.reference,t.scrollParents.popper);return n&&h.forEach(function(c){c.addEventListener("scroll",i.update,_t)}),a&&l.addEventListener("resize",i.update,_t),function(){n&&h.forEach(function(c){c.removeEventListener("scroll",i.update,_t)}),a&&l.removeEventListener("resize",i.update,_t)}}const Rs={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Hs,data:{}};var Zs={left:"right",right:"left",bottom:"top",top:"bottom"};function Ft(e){return e.replace(/left|right|bottom|top/g,function(t){return Zs[t]})}var Ds={start:"end",end:"start"};function ri(e){return e.replace(/start|end/g,function(t){return Ds[t]})}function pe(e){var t=Z(e),i=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:i,scrollTop:o}}function ue(e){return gt(ot(e)).left+pe(e).scrollLeft}function Bs(e,t){var i=Z(e),o=ot(e),s=i.visualViewport,n=o.clientWidth,r=o.clientHeight,a=0,l=0;if(s){n=s.width,r=s.height;var h=Qe();(h||!h&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:n,height:r,x:a+ue(e),y:l}}function Gs(e){var t,i=ot(e),o=pe(e),s=(t=e.ownerDocument)==null?void 0:t.body,n=lt(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=lt(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-o.scrollLeft+ue(e),l=-o.scrollTop;return U(s||i).direction==="rtl"&&(a+=lt(i.clientWidth,s?s.clientWidth:0)-n),{width:n,height:r,x:a,y:l}}function me(e){var t=U(e),i=t.overflow,o=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+o)}function ai(e){return["html","body","#document"].indexOf(V(e))>=0?e.ownerDocument.body:F(e)&&me(e)?e:ai(Gt(e))}function Xt(e,t){var i;t===void 0&&(t=[]);var o=ai(e),s=o===((i=e.ownerDocument)==null?void 0:i.body),n=Z(o),r=s?[n].concat(n.visualViewport||[],me(o)?o:[]):o,a=t.concat(r);return s?a:a.concat(Xt(Gt(r)))}function fe(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _s(e,t){var i=gt(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 li(e,t,i){return t===Ke?fe(Bs(e,i)):at(t)?_s(t,i):fe(Gs(ot(e)))}function Fs(e){var t=Xt(Gt(e)),i=["absolute","fixed"].indexOf(U(e).position)>=0,o=i&&F(e)?Tt(e):e;return at(o)?t.filter(function(s){return at(s)&&ti(s,o)&&V(s)!=="body"}):[]}function Ns(e,t,i,o){var s=t==="clippingParents"?Fs(e):[].concat(t),n=[].concat(s,[i]),r=n[0],a=n.reduce(function(l,h){var c=li(e,h,o);return l.top=lt(c.top,l.top),l.right=Bt(c.right,l.right),l.bottom=Bt(c.bottom,l.bottom),l.left=lt(c.left,l.left),l},li(e,r,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ci(e){var t=e.reference,i=e.element,o=e.placement,s=o?j(o):null,n=o?vt(o):null,r=t.x+t.width/2-i.width/2,a=t.y+t.height/2-i.height/2,l;switch(s){case H:l={x:r,y:t.y-i.height};break;case G:l={x:r,y:t.y+t.height};break;case _:l={x:t.x+t.width,y:a};break;case R:l={x:t.x-i.width,y:a};break;default:l={x:t.x,y:t.y}}var h=s?de(s):null;if(h!=null){var c=h==="y"?"height":"width";switch(n){case mt:l[h]=l[h]-(t[c]/2-i[c]/2);break;case Et:l[h]=l[h]+(t[c]/2-i[c]/2);break}}return l}function St(e,t){t===void 0&&(t={});var i=t,o=i.placement,s=o===void 0?e.placement:o,n=i.strategy,r=n===void 0?e.strategy:n,a=i.boundary,l=a===void 0?hs:a,h=i.rootBoundary,c=h===void 0?Ke:h,p=i.elementContext,m=p===void 0?zt:p,u=i.altBoundary,x=u===void 0?!1:u,v=i.padding,y=v===void 0?0:v,I=oi(typeof y!="number"?y:si(y,Pt)),k=m===zt?ds:zt,w=e.rects.popper,g=e.elements[x?k:m],P=Ns(at(g)?g:g.contextElement||ot(e.elements.popper),l,c,r),f=gt(e.elements.reference),b=ci({reference:f,element:w,placement:s}),C=fe(Object.assign({},w,b)),E=m===zt?C:f,T={top:P.top-E.top+I.top,bottom:E.bottom-P.bottom+I.bottom,left:P.left-E.left+I.left,right:E.right-P.right+I.right},A=e.modifiersData.offset;if(m===zt&&A){var M=A[s];Object.keys(T).forEach(function(L){var K=[_,G].indexOf(L)>=0?1:-1,q=[H,G].indexOf(L)>=0?"y":"x";T[L]+=M[q]*K})}return T}function Ws(e,t){t===void 0&&(t={});var i=t,o=i.placement,s=i.boundary,n=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,h=l===void 0?Je:l,c=vt(o),p=c?a?qe:qe.filter(function(x){return vt(x)===c}):Pt,m=p.filter(function(x){return h.indexOf(x)>=0});m.length===0&&(m=p);var u=m.reduce(function(x,v){return x[v]=St(e,{placement:v,boundary:s,rootBoundary:n,padding:r})[j(v)],x},{});return Object.keys(u).sort(function(x,v){return u[x]-u[v]})}function Vs(e){if(j(e)===ae)return[];var t=Ft(e);return[ri(e),t,ri(t)]}function js(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,r=i.altAxis,a=r===void 0?!0:r,l=i.fallbackPlacements,h=i.padding,c=i.boundary,p=i.rootBoundary,m=i.altBoundary,u=i.flipVariations,x=u===void 0?!0:u,v=i.allowedAutoPlacements,y=t.options.placement,I=j(y),k=I===y,w=l||(k||!x?[Ft(y)]:Vs(y)),g=[y].concat(w).reduce(function(nt,$){return nt.concat(j($)===ae?Ws(t,{placement:$,boundary:c,rootBoundary:p,padding:h,flipVariations:x,allowedAutoPlacements:v}):$)},[]),P=t.rects.reference,f=t.rects.popper,b=new Map,C=!0,E=g[0],T=0;T<g.length;T++){var A=g[T],M=j(A),L=vt(A)===mt,K=[H,G].indexOf(M)>=0,q=K?"width":"height",O=St(t,{placement:A,boundary:c,rootBoundary:p,altBoundary:m,padding:h}),D=K?L?_:R:L?G:H;P[q]>f[q]&&(D=Ft(D));var bt=Ft(D),J=[];if(n&&J.push(O[M]<=0),a&&J.push(O[D]<=0,O[bt]<=0),J.every(function(nt){return nt})){E=A,C=!1;break}b.set(A,J)}if(C)for(var yt=x?3:1,wt=function($){var ht=g.find(function(xt){var Q=b.get(xt);if(Q)return Q.slice(0,$).every(function(Yt){return Yt})});if(ht)return E=ht,"break"},ct=yt;ct>0;ct--){var st=wt(ct);if(st==="break")break}t.placement!==E&&(t.modifiersData[o]._skip=!0,t.placement=E,t.reset=!0)}}const $s={name:"flip",enabled:!0,phase:"main",fn:js,requiresIfExists:["offset"],data:{_skip:!1}};function hi(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 di(e){return[H,_,G,R].some(function(t){return e[t]>=0})}function Us(e){var t=e.state,i=e.name,o=t.rects.reference,s=t.rects.popper,n=t.modifiersData.preventOverflow,r=St(t,{elementContext:"reference"}),a=St(t,{altBoundary:!0}),l=hi(r,o),h=hi(a,s,n),c=di(l),p=di(h);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:h,isReferenceHidden:c,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":p})}const Ks={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Us};function qs(e,t,i){var o=j(e),s=[R,H].indexOf(o)>=0?-1:1,n=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,r=n[0],a=n[1];return r=r||0,a=(a||0)*s,[R,_].indexOf(o)>=0?{x:a,y:r}:{x:r,y:a}}function Js(e){var t=e.state,i=e.options,o=e.name,s=i.offset,n=s===void 0?[0,0]:s,r=Je.reduce(function(c,p){return c[p]=qs(p,t.rects,n),c},{}),a=r[t.placement],l=a.x,h=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=h),t.modifiersData[o]=r}const Qs={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Js};function tn(e){var t=e.state,i=e.name;t.modifiersData[i]=ci({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const en={name:"popperOffsets",enabled:!0,phase:"read",fn:tn,data:{}};function on(e){return e==="x"?"y":"x"}function sn(e){var t=e.state,i=e.options,o=e.name,s=i.mainAxis,n=s===void 0?!0:s,r=i.altAxis,a=r===void 0?!1:r,l=i.boundary,h=i.rootBoundary,c=i.altBoundary,p=i.padding,m=i.tether,u=m===void 0?!0:m,x=i.tetherOffset,v=x===void 0?0:x,y=St(t,{boundary:l,rootBoundary:h,padding:p,altBoundary:c}),I=j(t.placement),k=vt(t.placement),w=!k,g=de(I),P=on(g),f=t.modifiersData.popperOffsets,b=t.rects.reference,C=t.rects.popper,E=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,T=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(f){if(n){var L,K=g==="y"?H:R,q=g==="y"?G:_,O=g==="y"?"height":"width",D=f[g],bt=D+y[K],J=D-y[q],yt=u?-C[O]/2:0,wt=k===mt?b[O]:C[O],ct=k===mt?-C[O]:-b[O],st=t.elements.arrow,nt=u&&st?he(st):{width:0,height:0},$=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:ii(),ht=$[K],xt=$[q],Q=At(0,b[O],nt[O]),Yt=w?b[O]/2-yt-Q-ht-T.mainAxis:wt-Q-ht-T.mainAxis,ge=w?-b[O]/2+yt+Q+xt+T.mainAxis:ct+Q+xt+T.mainAxis,Lt=t.elements.arrow&&Tt(t.elements.arrow),ve=Lt?g==="y"?Lt.clientTop||0:Lt.clientLeft||0:0,Nt=(L=A==null?void 0:A[g])!=null?L:0,be=D+Yt-Nt-ve,ye=D+ge-Nt,Wt=At(u?Bt(bt,be):bt,D,u?lt(J,ye):J);f[g]=Wt,M[g]=Wt-D}if(a){var Mt,Vt=g==="x"?H:R,jt=g==="x"?G:_,tt=f[P],Ct=P==="y"?"height":"width",$t=tt+y[Vt],Ut=tt-y[jt],Ot=[H,R].indexOf(I)!==-1,Kt=(Mt=A==null?void 0:A[P])!=null?Mt:0,qt=Ot?$t:tt-b[Ct]-C[Ct]-Kt+T.altAxis,Jt=Ot?tt+b[Ct]+C[Ct]-Kt-T.altAxis:Ut,Qt=u&&Ot?zs(qt,tt,Jt):At(u?qt:$t,tt,u?Jt:Ut);f[P]=Qt,M[P]=Qt-tt}t.modifiersData[o]=M}}const nn={name:"preventOverflow",enabled:!0,phase:"main",fn:sn,requiresIfExists:["offset"]};function rn(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function an(e){return e===Z(e)||!F(e)?pe(e):rn(e)}function ln(e){var t=e.getBoundingClientRect(),i=ft(t.width)/e.offsetWidth||1,o=ft(t.height)/e.offsetHeight||1;return i!==1||o!==1}function cn(e,t,i){i===void 0&&(i=!1);var o=F(t),s=F(t)&&ln(t),n=ot(t),r=gt(e,s,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(o||!o&&!i)&&((V(t)!=="body"||me(n))&&(a=an(t)),F(t)?(l=gt(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):n&&(l.x=ue(n))),{x:r.left+a.scrollLeft-l.x,y:r.top+a.scrollTop-l.y,width:r.width,height:r.height}}function hn(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 r=[].concat(n.requires||[],n.requiresIfExists||[]);r.forEach(function(a){if(!i.has(a)){var l=t.get(a);l&&s(l)}}),o.push(n)}return e.forEach(function(n){i.has(n.name)||s(n)}),o}function dn(e){var t=hn(e);return xs.reduce(function(i,o){return i.concat(t.filter(function(s){return s.phase===o}))},[])}function pn(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function un(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 pi={placement:"bottom",modifiers:[],strategy:"absolute"};function ui(){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 mn(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,o=i===void 0?[]:i,s=t.defaultOptions,n=s===void 0?pi:s;return function(a,l,h){h===void 0&&(h=n);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},pi,n),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},p=[],m=!1,u={state:c,setOptions:function(I){var k=typeof I=="function"?I(c.options):I;v(),c.options=Object.assign({},n,c.options,k),c.scrollParents={reference:at(a)?Xt(a):a.contextElement?Xt(a.contextElement):[],popper:Xt(l)};var w=dn(un([].concat(o,c.options.modifiers)));return c.orderedModifiers=w.filter(function(g){return g.enabled}),x(),u.update()},forceUpdate:function(){if(!m){var I=c.elements,k=I.reference,w=I.popper;if(ui(k,w)){c.rects={reference:cn(k,Tt(w),c.options.strategy==="fixed"),popper:he(w)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(T){return c.modifiersData[T.name]=Object.assign({},T.data)});for(var g=0;g<c.orderedModifiers.length;g++){if(c.reset===!0){c.reset=!1,g=-1;continue}var P=c.orderedModifiers[g],f=P.fn,b=P.options,C=b===void 0?{}:b,E=P.name;typeof f=="function"&&(c=f({state:c,options:C,name:E,instance:u})||c)}}}},update:pn(function(){return new Promise(function(y){u.forceUpdate(),y(c)})}),destroy:function(){v(),m=!0}};if(!ui(a,l))return u;u.setOptions(h).then(function(y){!m&&h.onFirstUpdate&&h.onFirstUpdate(y)});function x(){c.orderedModifiers.forEach(function(y){var I=y.name,k=y.options,w=k===void 0?{}:k,g=y.effect;if(typeof g=="function"){var P=g({state:c,name:I,instance:u,options:w}),f=function(){};p.push(P||f)}})}function v(){p.forEach(function(y){return y()}),p=[]}return u}}var fn=[Rs,en,Os,ks,Qs,$s,nn,Ss,Ks],gn=mn({defaultModifiers:fn});const vn='<svg class="ci360-navigate-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6"/></svg>';class bn{constructor(t,i,o,s={}){bi(this,"updateHotspotPosition",(t,i)=>{this.currentActiveIndex=t,this.currentOrientation=i;const o=es(this.hotspotsConfig,t,i);this.hideHotspots(),o.forEach(s=>this.updateAndShowHotspot(s,t))});this.container=i,this.popper=null,this.popperInstance=null,this.hotspotsContainer=po(this.container),this.hotspotsConfig=rs(t),this.shouldHidePopper=!0,this.hidePopper=this.hidePopper.bind(this),this.forceHidePopper=this.forceHidePopper.bind(this),this.imageAspectRatio=o,this.popperListeners=[],this.trigger=s.trigger||"hover",this.onOpen=s.onOpen||null,this.onClose=s.onClose||null,this.onProductClick=s.onProductClick||null,this.onNavigate=s.onNavigate||null;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=as({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}){var p;this.popperInstance&&this.hidePopper();const n=ss(this.container);this.popper=ns(i,o,this.container.parentElement),this.currentHotspotElement=t,t.setAttribute("aria-expanded","true"),t.setAttribute("aria-describedby",`cloudimage-360-popper-${o}`);const r=()=>{this.shouldHidePopper=!1},a=()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()},l=()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()},h=()=>{this.shouldHidePopper=!1,this.hidePopperTimeout&&clearTimeout(this.hidePopperTimeout)};if(this.popper.addEventListener("mouseenter",r),this.popper.addEventListener("mouseleave",a),t.addEventListener("mouseleave",l),t.addEventListener("mouseenter",h),this.popperListeners.push({element:this.popper,event:"mouseenter",handler:r},{element:this.popper,event:"mouseleave",handler:a},{element:t,event:"mouseleave",handler:l},{element:t,event:"mouseenter",handler:h}),this.onProductClick){const m=this.onProductClick,u=x=>{const v=x.target.closest(".ci360-popper-cta");v&&m(v.dataset.productId??"",o)};this.popper.addEventListener("click",u),this.popperListeners.push({element:this.popper,event:"click",handler:u})}const c=gn(t,this.popper,n);c.forceUpdate(),this.popper.setAttribute("data-show",""),this.shouldHidePopper=!1,this.popperInstance={...c,keepOpen:s,instanceId:o};try{(p=this.onOpen)==null||p.call(this,o)}catch(m){console.warn("onHotspotOpen callback error:",m)}}checkAndHidePopper(){var t;this.shouldHidePopper&&!((t=this.popperInstance)!=null&&t.keepOpen)&&(this.hidePopperTimeout&&clearTimeout(this.hidePopperTimeout),this.hidePopperTimeout=setTimeout(()=>{this.shouldHidePopper&&this.hidePopper()},Gi))}hidePopper(){var o,s;this.hidePopperTimeout&&(clearTimeout(this.hidePopperTimeout),this.hidePopperTimeout=null);const t=(o=this.popperInstance)==null?void 0:o.instanceId;this.cleanupPopperListeners(),this.currentHotspotElement&&(this.currentHotspotElement.setAttribute("aria-expanded","false"),this.currentHotspotElement.removeAttribute("aria-describedby"),this.currentHotspotElement=null);const i=this.popperInstance;if(this.popperInstance=null,t!=null)try{(s=this.onClose)==null||s.call(this,t)}catch(n){console.warn("onHotspotClose callback error:",n)}if(this.popper){this.popper.removeAttribute("data-show"),this.popper.setAttribute("aria-hidden","true");const n=this.popper;this.popper=null,setTimeout(()=>{i==null||i.destroy(),n.remove()},_i)}else i==null||i.destroy();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:r,navigateTo:a}=t,l=typeof a=="string"?a.trim():void 0,h=re(t),c=is(i,n,r);if(l){c.classList.add("cloudimage-360-hotspot--navigate"),c.innerHTML=vn;const p=n||l;c.setAttribute("role","button"),c.setAttribute("aria-label",`Navigate to ${p}`),c.setAttribute("aria-roledescription","navigation hotspot"),c.style.cursor="pointer";const m=h||(n?re({data:{title:n}}):"");m?(c.setAttribute("aria-haspopup","true"),c.addEventListener("mouseenter",()=>this.showPopper({hotspotElement:c,content:m,id:i,keepOpen:!1})),c.addEventListener("mouseleave",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()}),c.addEventListener("focus",()=>this.showPopper({hotspotElement:c,content:m,id:i,keepOpen:!1})),c.addEventListener("blur",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()})):(c.removeAttribute("aria-haspopup"),c.removeAttribute("aria-expanded"));const u=()=>{this.hidePopper(),this.onNavigate?this.onNavigate(l):console.warn(`[ci360] navigateTo hotspot "${i}" clicked but no onNavigate callback is configured.`)};c.onclick=x=>{x.stopPropagation(),u()},c.addEventListener("keydown",x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),u())}),this.hotspotsContainer.appendChild(c);return}(s||h&&this.trigger==="click")&&(c.style.cursor="pointer"),c.onclick=p=>{var m;p.stopPropagation(),h&&this.trigger==="click"&&(((m=this.popperInstance)==null?void 0:m.instanceId)===i?this.hidePopper():this.showPopper({hotspotElement:c,content:h,id:i,keepOpen:o})),s==null||s(p,this.popperInstance,i)},h&&this.trigger==="hover"&&(c.addEventListener("mouseenter",()=>this.showPopper({hotspotElement:c,content:h,id:i,keepOpen:o})),c.addEventListener("mouseleave",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()}),c.addEventListener("focus",()=>this.showPopper({hotspotElement:c,content:h,id:i,keepOpen:o})),c.addEventListener("blur",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()})),this.hotspotsContainer.appendChild(c)}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:r}=o[i]??{},a=this.hotspotsContainer.querySelector(`[data-hotspot-id="${s}"]`);a&&(a.style.translate=`${n}px ${r}px`,a.style.opacity=1,a.style.pointerEvents="all")}showHotspotById(t){const i=this.hotspotsConfig.find(n=>n.id===t);if(!i||i.navigateTo)return;const o=re(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.hotspotsContainer.innerHTML=""}}const mi=typeof navigator<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);class fi{constructor(t,i){this.container=t,this.isClicked=!1,this.imagesX=[],this.imagesY=[],this.imagesGrid=[],this.isGridMode=!1;const o=Math.round(window.devicePixelRatio||1);this.devicePixelRatio=mi?Math.min(o,2):o,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.touchDevice=Zo(),this.dragJustEnded=!1,this.zoomPan=null,this.gestureRecognizer=null,this.zoomControlsUI=null,this.scrollHintUI=null,this.highResLoaded=!1,this.useMainThreadCanvas=mi,this.canvasWorker=this.useMainThreadCanvas?new Ko:new Uo,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){mo(this.ariaLiveRegion,t)}mouseDown(t){if(!this.isReady)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")||i.closest(".cloudimage-360-zoom-controls")))return;const{pageX:o,pageY:s}=t;if(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.isZoomed&&this.zoomPan){this.zoomPan.startPan(o,s);return}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.dragSpeed/Ae,s=o*(this.amountX/this.container.offsetWidth),n=o*(this.amountY/this.container.offsetHeight),r=()=>{if(this.velocityX*=.95,this.velocityY*=.95,Math.abs(this.velocityX)<.01&&Math.abs(this.velocityY)<.01){this.inertiaAnimationId=null;return}const a=this.velocityX*16,l=this.velocityY*16,h=We({deltaX:a,deltaY:l,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY});if(h){const c=this.allowSpinX?Math.max(1,Math.abs(Math.round(a*s))):0,p=this.allowSpinY?Math.max(1,Math.abs(Math.round(l*n))):0;(c>0||p>0)&&this.onMoveHandler(h,c,p)}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 p=performance.now(),m=p-this.lastDragTime;m>0&&m<100&&(this.velocityX=(t-this.lastDragX)/m,this.velocityY=(i-this.lastDragY)/m),this.lastDragTime=p,this.lastDragX=t,this.lastDragY=i}this.draggingDirection=We({deltaX:o,deltaY:s,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY})||this.draggingDirection;const n=this.dragSpeed/Ae,r=n*(this.amountX/this.container.offsetWidth),a=n*(this.amountY/this.container.offsetHeight),l=this.allowSpinX?Math.abs(Math.round(o*r)):0,h=this.allowSpinY?Math.abs(Math.round(s*a)):0;(this.allowSpinX&&l!==0||this.allowSpinY&&h!==0)&&(this.hasInteracted=!0,this.hideHotspotPopper(),this.onMoveHandler(this.draggingDirection,l,h),this.movementStart={x:t,y:i},setTimeout(()=>{this.isDragging||(this.isDragging=!0,this.emit("onDragStart"))},Bi))}mouseMove(t){!this.isReady||!this.isClicked||this.isZoomed||(this.hideAllIcons(),this.drag(t.pageX,t.pageY))}mouseClick(){this.dragJustEnded=!1,this.autoplayJustStopped=!1}loadHigherQualityImages(t,i){if(this.isGridMode){const n=rt(this.srcGridConfig,t);Le({cdnPath:n,config:this.srcGridConfig,onAllImagesLoad:r=>{this.closeImageBitmaps(this.imagesGrid),this.imagesGrid=r,i()},onError:r=>this.emit("onError",r)});return}const o=rt(this.srcXConfig,t),s=this.allowSpinY?rt(this.srcYConfig,t):null;Ye({cdnPathX:o,cdnPathY:s,configX:this.srcXConfig,configY:this.srcYConfig,onAllImagesLoad:(n,r)=>{this.closeImageBitmaps(this.imagesX),this.closeImageBitmaps(this.imagesY),this.imagesX=n,this.imagesY=r,i()},onError:n=>this.emit("onError",n)})}hideHotspots(){this.hotspotsInstance&&this.hotspotsInstance.hideHotspots()}hideHotspotPopper(){this.hotspotsInstance&&this.hotspotsInstance.forceHidePopper()}getDrawDimensions(){if(!this.canvas||!this.imageAspectRatio)return null;const t=this.canvas.clientWidth,i=t/this.imageAspectRatio,o=t/i;return this.imageAspectRatio>o?{drawWidth:t,drawHeight:t/this.imageAspectRatio}:{drawWidth:i*this.imageAspectRatio,drawHeight:i}}initZoom(){const t=this.zoomMax||5,i=this.zoomStep||.5;this.zoomPan=new _o(this.innerBox,{zoomMax:t,zoomStep:i,onZoomChange:(s,n,r)=>this.onZoomChange(s,n,r)});const o=this.getDrawDimensions();o&&this.zoomPan.setDrawSize(o.drawWidth,o.drawHeight),this.touchDevice&&this.pinchZoom!==!1&&(this.gestureRecognizer=new Fo(this.innerBox,{zoomMax:t,getZoom:()=>this.zoomPan?this.zoomPan.getZoom():1,onPinchZoom:(s,n,r)=>{this.zoomPan&&(n!==void 0?this.zoomPan.zoomTowardPoint(s,n,r):this.zoomPan.applyTouchZoom(s))},onPan:(s,n)=>{this.zoomPan&&this.zoomPan.applyTouchPan(s,n)},onDoubleTap:(s,n)=>{this.zoomPan&&(this.zoomPan.isZoomed()?this.zoomPan.resetZoom():this.zoomPan.zoomTowardPoint(2,s,n))}})),this.zoomControls&&!this.touchDevice&&(this.zoomControlsUI=jo(this.innerBox,{position:this.zoomControlsPosition||"bottom-left",zoomMax:t,onZoomIn:()=>this.zoomPan&&this.zoomPan.zoomIn(),onZoomOut:()=>this.zoomPan&&this.zoomPan.zoomOut(),onReset:()=>this.zoomPan&&this.zoomPan.resetZoom()}))}onZoomChange(t,i,o){this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null);const s=this.isZoomed;if(this.isZoomed=t>1,this.isZoomed&&!s){if(this.hideAllIcons(),this.hideHotspots(),this.zoomControlsUI&&this.zoomControlsUI.show(),!this.highResLoaded){this.highResLoaded=!0;const n=document.body.offsetWidth;this.loadHigherQualityImages(n,()=>{this.zoomPan&&this.updateView(this.zoomPan.getZoom(),this.zoomPan.panX,this.zoomPan.panY)})}this.emit("onZoomIn",{zoomLevel:t}),this.announce("Zoomed in. Use mouse drag or arrow keys to pan. Double-click or press 0 to reset.")}!this.isZoomed&&s&&(this.showAllIcons(),this.emit("onZoomOut"),this.announce("Zoomed out")),this.zoomControlsUI&&this.zoomControlsUI.updateState(t),this.updateView(t,i,o)}removeZoom(){this.zoomPan&&this.zoomPan.resetZoom()}toggleZoom(){this.zoomPan&&(this.isZoomed?this.zoomPan.resetZoom():this.zoomPan.setZoom(2))}touchStart(t){if(!this.isReady||!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")||i.closest(".cloudimage-360-zoom-controls")))return;if(this.hideHints(),t.touches.length>1){this.isClicked=!1;return}if(this.isZoomed)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)}touchEnd(t){this.isReady&&(this.isZoomed||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.isZoomed||t.touches&&t.touches.length>1||!this.isClicked||!t.touches||!t.touches[0])return;const{pageX:i,pageY:o}=t.touches[0];t.preventDefault(),this.drag(i,o)}keyDown(t){if(!this.isReady)return;const i=t.target&&t.target.tagName;if(i==="INPUT"||i==="TEXTAREA"||t.target&&t.target.isContentEditable)return;const{keyCode:o}=t,s=this.keysReverse;if(this.autoplay&&this.stopAutoplay(),this.zoomPan&&this.zoomPan.handleKeyZoom(o)){t.preventDefault(),this.hideHints();return}if(this.isZoomed&&this.zoomPan&&this.zoomPan.handleKeyPan(o,Ni)){t.preventDefault();return}switch(Ne(o,this.allowSpinY)&&(this.hasInteracted=!0,this.hideAllIcons(),this.hideHints()),o){case 37:s?this.moveLeft():this.moveRight();break;case 39:s?this.moveRight():this.moveLeft();break;case 38:this.allowSpinY&&(t.preventDefault(),s?this.moveTop():this.moveBottom());break;case 40:this.allowSpinY&&(t.preventDefault(),s?this.moveBottom():this.moveTop());break}}keyUp(t){const{keyCode:i}=t;Ne(i,this.allowSpinY)&&this.showAllIcons()}moveActiveXIndexUp(t){this.isGridMode||(this.orientation=Y.X),this.activeImageX=(this.activeImageX+t)%this.amountX}moveActiveXIndexDown(t){this.isGridMode||(this.orientation=Y.X),this.activeImageX=(this.activeImageX-t+this.amountX)%this.amountX}moveActiveYIndexUp(t){this.isGridMode||(this.orientation=Y.Y),this.activeImageY=(this.activeImageY+t)%this.amountY}moveActiveYIndexDown(t){this.isGridMode||(this.orientation=Y.Y),this.activeImageY=(this.activeImageY-t+this.amountY)%this.amountY}moveRight(t,i=1){const o=this.isGridMode?this.amountX-1:this.imagesX.length-1;t&&this.activeImageX>=o||(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){const o=this.isGridMode?this.amountY-1:this.imagesY.length-1;t&&this.activeImageY>=o||(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.stopAtEdgesX,i):t==="left"?this.moveLeft(this.stopAtEdgesX,i):t==="up"?this.moveTop(this.stopAtEdgesY,o):t==="down"&&this.moveBottom(this.stopAtEdgesY,o),this.emit("onSpin",{direction:t,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,isGridMode:this.isGridMode})}updateView(t,i,o){let s;if(this.isGridMode){const r=this.activeImageY*this.amountX+this.activeImageX;s=this.imagesGrid[r]}else s=this.orientation===Y.X?this.imagesX[this.activeImageX]:this.imagesY[this.activeImageY];const n=this.isGridMode?this.activeImageY*this.amountX+this.activeImageX:this.orientation===Y.X?this.activeImageX:this.activeImageY;this.hotspotsInstance&&!this.isZoomed&&!this.autoplay&&this.hotspotsInstance.updateHotspotPosition(n,this.isGridMode?"grid":this.orientation),this.hotspotTimelineIndicator&&(this.isGridMode||this.orientation===Y.X)&&this.updateHotspotTimelinePosition(),this.drawImageOnCanvas(s,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.canvas.clientWidth,n=s/this.imageAspectRatio;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:r,pointerX:a,pointerY:l}=this.pendingDrawData;this.canvasWorker.postMessage({action:"drawImageOnCanvas",imageData:n,zoomScale:r,pointerX:a,pointerY:l})}}))}pushImageToSet(t,i,o){o==="grid"?this.imagesGrid[i]=t:o===Y.X?this.imagesX[i]=t:this.imagesY[i]=t}calculatePercentage(){if(this.isGridMode){const o=this.amountX*this.amountY,s=this.imagesGrid.filter(Boolean).length;return Math.round(s/o*100)}const t=this.amountX+this.amountY,i=this.imagesX.filter(Boolean).length+this.imagesY.filter(Boolean).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),this.setupResizeObserver()}setupResizeObserver(){if(this.resizeObserver||!this.container)return;let t=this.container.offsetWidth;this.resizeObserver=new ResizeObserver(i=>{const o=i[0];if(!o)return;const s=Math.round(o.contentRect.width);s===t||s===0||(t=s,requestAnimationFrame(()=>{let n;if(this.isGridMode?n=this.imagesGrid[this.activeImageY*this.amountX+this.activeImageX]:this.orientation===Y.Y&&this.imagesY.length>0?n=this.imagesY[this.activeImageY]:n=this.imagesX[this.activeImageX],n){if(this.adaptCanvasSize(n),this.zoomPan){const r=this.getDrawDimensions();r&&this.zoomPan.setDrawSize(r.drawWidth,r.drawHeight,!0)}this.updateView()}}))}),this.resizeObserver.observe(this.container)}onAllImagesLoaded(){if(this.addAllIcons(),this.isReady=!0,this.isGridMode||(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)if(this.hotspotsInstance=new bn(this.hotspots,this.innerBox,this.imageAspectRatio,{trigger:this.hotspotTrigger,onOpen:this.onHotspotOpen,onClose:this.onHotspotClose,onProductClick:this.onProductClick,onNavigate:this.onNavigate}),this.addHotspotTimeline(),this.autoplay)this.hotspotsInstance.hideHotspots(),this.hideHotspotTimeline();else{const t=this.isGridMode?this.activeImageY*this.amountX+this.activeImageX:this.activeImageX,i=this.isGridMode?"grid":this.orientation;this.hotspotsInstance.updateHotspotPosition(t,i),this.showHotspotTimeline()}if(this.emit("onLoad",{imagesX:this.isGridMode?this.amountX:this.imagesX.length,imagesY:this.isGridMode?this.amountY:this.imagesY.length,...this.isGridMode&&{imagesGrid:this.imagesGrid.filter(Boolean).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?Ze(this.viewerConfig,this.touchDevice):this.hints;t&&t.length>0&&(this.hintsOverlay=Re(this.innerBox,t),De(this.hintsOverlay))}this.autoplay&&(this.hideAllIcons(),Do(this.play.bind(this))())}toggleFullscreen(t){t.stopPropagation(),this.hideHotspotPopper(),ne()?Ve():Go(this.container)}onFullscreenChange(){const t=ne()===this.container,i=this.container.classList.contains("cloudimage-360--fullscreen");t!==i&&(this.container.classList.toggle("cloudimage-360--fullscreen",t),ao(this.fullscreenIcon,t),t?(this.emit("onFullscreenOpen"),this.announce("Opened fullscreen mode. Press Escape to exit.")):(this.emit("onFullscreenClose"),this.announce("Exited fullscreen mode")))}play(){if(this.isClicked)return;this.hide360ViewCircleIcon(),this.emit("onAutoplayStart");let t;if(this.isGridMode){const s=this.autoplayBehavior;s==="spin-x"?t=this.amountX:s==="spin-y"?t=this.amountY:t=Math.max(this.amountX,this.amountY)}else t=this.amountX+this.amountY;const i=this.speed*36/t,o={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&&Mo({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse,isGridMode:this.isGridMode})){this.stopAutoplay();return}if(this.isGridMode){this.gridAutoplayTick(o);return}Oo({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse,spinDirection:this.spinDirection})&&(this.spinDirection=Ro(this.spinDirection));const r=this.spinDirection==="y";Lo({autoplayBehavior:this.autoplayBehavior,spinY:r,reversed:this.autoplayReverse,loopTriggers:o})},i)}gridAutoplayTick(t){const i=this.autoplayReverse,o=this.autoplayBehavior;if(o==="spin-x"){i?t.left():t.right();return}if(o==="spin-y"){i?t.bottom():t.top();return}if(o==="spin-xy"){const s=i?0:this.amountX-1,n=this.activeImageX===s;i?this.activeImageX=(this.activeImageX-1+this.amountX)%this.amountX:this.activeImageX=(this.activeImageX+1)%this.amountX,n&&(i?this.activeImageY=(this.activeImageY-1+this.amountY)%this.amountY:this.activeImageY=(this.activeImageY+1)%this.amountY),this.isZoomed||this.updateView(),this.emit("onSpin",{direction:i?"left":"right",activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,isGridMode:!0});return}if(o==="spin-yx"){const s=i?0:this.amountY-1,n=this.activeImageY===s;i?this.activeImageY=(this.activeImageY-1+this.amountY)%this.amountY:this.activeImageY=(this.activeImageY+1)%this.amountY,n&&(i?this.activeImageX=(this.activeImageX-1+this.amountX)%this.amountX:this.activeImageX=(this.activeImageX+1)%this.amountX),this.isZoomed||this.updateView(),this.emit("onSpin",{direction:i?"down":"up",activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,isGridMode:!0})}}stopAutoplay(){if(this.showAllIcons(),this.autoplay=!1,window.clearInterval(this.loopTimeoutId),this.loopTimeoutId=null,this.emit("onAutoplayStop"),this.hotspotsInstance){const t=this.isGridMode?this.activeImageY*this.amountX+this.activeImageX:this.activeImageX,i=this.isGridMode?"grid":this.orientation;this.hotspotsInstance.updateHotspotPosition(t,i),this.showHotspotTimeline()}if(this.hints!==!1&&!this.hintsOverlay&&!this.hintsHidden){const t=this.hints===!0?Ze(this.viewerConfig,this.touchDevice):this.hints;t&&t.length>0&&(this.hintsOverlay=Re(this.innerBox,t),De(this.hintsOverlay))}}destroy(){this.stopAutoplay(),this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null),this.removeEvents(),this.zoomPan&&(this.zoomPan.destroy(),this.zoomPan=null),this.gestureRecognizer&&(this.gestureRecognizer.destroy(),this.gestureRecognizer=null),this.zoomControlsUI&&(this.zoomControlsUI.destroy(),this.zoomControlsUI=null),this.scrollHintUI&&(this.scrollHintUI.destroy(),this.scrollHintUI=null),this.closeImageBitmaps(this.imagesX),this.closeImageBitmaps(this.imagesY),this.closeImageBitmaps(this.imagesGrid),this.imagesX=[],this.imagesY=[],this.imagesGrid=[],this.isGridMode=!1,this.isReady=!1,this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),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"),ne()===this.container&&Ve(),this.container&&(this.container.classList.remove("ci360-theme-dark","ci360-hotspot-marker-inverted","ci360-hotspot-marker-brand","cloudimage-360--fullscreen"),this.container.style.removeProperty("--ci360-hotspot-brand-color"),this.container.innerHTML="")}releaseMemory(){this.stopAutoplay(),this.closeImageBitmaps(this.imagesX),this.closeImageBitmaps(this.imagesY),this.closeImageBitmaps(this.imagesGrid),this.imagesX=[],this.imagesY=[],this.imagesGrid=[],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=oo(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)}addFullscreenIcon(){!this.fullscreen||!Bo()||(this.fullscreenIcon=ro(),this.fullscreenIcon.onclick=this.toggleFullscreen.bind(this),this.iconsContainer.appendChild(this.fullscreenIcon))}showFullscreenIcon(){this.fullscreenIcon&&(this.fullscreenIcon.style.opacity=1)}hideFullscreenIcon(){this.fullscreenIcon&&(this.fullscreenIcon.style.opacity=0)}add360ViewCircleIcon(){this.view360CircleIcon||(this.view360CircleIcon=eo(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=ho(),this.innerBox.appendChild(this.loadingSpinner)}showLoadingSpinner(){this.loadingSpinner&&(this.hideAllIcons(),this.loadingSpinner.style.opacity=1)}hideLoadingSpinner(){this.loadingSpinner&&(this.loadingSpinner.style.opacity=0)}hideHints(){!this.hintsOverlay||this.hintsHidden||(this.hintsHidden=!0,vo(this.hintsOverlay))}addHotspotTimeline(){if(!this.hotspots||this.hotspotTimeline)return;const t=this.isGridMode?this.amountX*this.amountY:this.amountX,i=Co(this.innerBox,t,this.hotspots);if(!i)return;this.hotspotTimeline=i.element,this.hotspotTimelineIndicator=i.indicator,this.innerBox.classList.add("has-hotspot-timeline"),this.hotspotTimeline.querySelectorAll(".cloudimage-360-hotspot-timeline-dot").forEach(s=>{s.addEventListener("click",n=>{n.stopPropagation(),this.hideAllIcons(),this.hideHints();const r=parseInt(s.getAttribute("data-frame"),10),a=s.getAttribute("data-hotspot-id");isNaN(r)||this.animateToFrame(r,a)})}),this.updateHotspotTimelinePosition()}showHotspotTimeline(){Io(this.hotspotTimeline)}hideHotspotTimeline(){ko(this.hotspotTimeline)}updateHotspotTimelinePosition(){if(this.isGridMode){const t=this.activeImageY*this.amountX+this.activeImageX;Be(this.hotspotTimelineIndicator,t,this.amountX*this.amountY)}else Be(this.hotspotTimelineIndicator,this.activeImageX,this.amountX)}animateToFrame(t,i){this.hotspotsInstance&&this.hotspotsInstance.hidePopper();const o=this.isGridMode?this.activeImageY*this.amountX+this.activeImageX:this.activeImageX;if(this.isAnimatingToFrame||t===o){t===o&&i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&this.hotspotsInstance.showHotspotById(i);return}if(this.isAnimatingToFrame=!0,this.hasInteracted=!0,(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null),this.isGridMode){const m=this.amountX*this.amountY,u=Math.max(0,Math.min(t,m-1));this.activeImageY=Math.floor(u/this.amountX),this.activeImageX=u%this.amountX,this.isZoomed||this.updateView(),this.emit("onSpin",{direction:u>o?"right":"left",activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,isGridMode:!0}),this.isAnimatingToFrame=!1,i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&setTimeout(()=>{this.hotspotsInstance.showHotspotById(i)},50);return}const s=this.activeImageX,n=(t-s+this.amountX)%this.amountX,r=(s-t+this.amountX)%this.amountX,a=n<=r,l=a?n:r;if(l===0){this.isAnimatingToFrame=!1;return}const h=30;let c=l;const p=()=>{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(p,h):(this.isAnimatingToFrame=!1,i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&setTimeout(()=>{this.hotspotsInstance.showHotspotById(i)},50))};p()}remove360ViewCircleIcon(){this.view360CircleIcon&&(this.innerBox.removeChild(this.view360CircleIcon),this.view360CircleIcon=null)}addAllIcons(){this.removeLoader(),this.iconsContainer&&(this.innerBox.style.cursor="grab",this.addLoadingSpinner(),this.addFullscreenIcon(),this.initialIconShown&&this.addInitialIcon(),this.bottomCircle&&this.add360ViewCircleIcon(),this.initZoom())}showAllIcons(){this.showInitialIcon(),this.show360ViewCircleIcon(),this.showFullscreenIcon(),this.showHotspotTimeline(),this.zoomControlsUI&&this.zoomControlsUI.show()}hideAllIcons(){this.hideInitialIcon(),this.hide360ViewCircleIcon(),this.hideFullscreenIcon(),this.zoomControlsUI&&this.zoomControlsUI.hide()}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(),this.addFullscreenChangeHandler()}removeEvents(){this.removeMouseEvents(),this.removeTouchEvents(),this.removeKeyboardEvents(),this.removeEscKeyHandler(),this.removeFullscreenChangeHandler()}addMouseEvents(){this.boundMouseClick=this.mouseClick.bind(this),this.boundMouseDown=this.mouseDown.bind(this),this.boundMouseMove=ze(this.mouseMove.bind(this),Te),this.boundMouseUp=this.mouseUp.bind(this),this.innerBox.addEventListener("click",this.boundMouseClick),this.innerBox.addEventListener("mousedown",this.boundMouseDown),document.addEventListener("mousemove",this.boundMouseMove),document.addEventListener("mouseup",this.boundMouseUp)}addTouchEvents(){this.boundTouchStart=this.touchStart.bind(this),this.boundTouchEnd=this.touchEnd.bind(this),this.boundTouchMove=ze(this.touchMove.bind(this),Te),this.container.addEventListener("touchstart",this.boundTouchStart,{passive:!1}),this.container.addEventListener("touchend",this.boundTouchEnd),this.container.addEventListener("touchmove",this.boundTouchMove,{passive:!1})}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.isZoomed&&this.removeZoom()},document.addEventListener("keydown",this.boundEscHandler)}removeEscKeyHandler(){document.removeEventListener("keydown",this.boundEscHandler)}addFullscreenChangeHandler(){this.boundFullscreenChange=this.onFullscreenChange.bind(this),document.addEventListener("fullscreenchange",this.boundFullscreenChange),document.addEventListener("webkitfullscreenchange",this.boundFullscreenChange)}removeFullscreenChangeHandler(){document.removeEventListener("fullscreenchange",this.boundFullscreenChange),document.removeEventListener("webkitfullscreenchange",this.boundFullscreenChange)}removeMouseEvents(){this.innerBox.removeEventListener("click",this.boundMouseClick),this.innerBox.removeEventListener("mousedown",this.boundMouseDown),document.removeEventListener("mousemove",this.boundMouseMove),document.removeEventListener("mouseup",this.boundMouseUp)}removeTouchEvents(){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=Oe(this.innerBox),this.canvas=so(this.innerBox,t),this.loader=co(this.innerBox),this.ariaLiveRegion=uo(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])}oe(this.innerBox,".cloudimage-360-placeholder")}update(t){this.isReady&&(this.stopAutoplay(),this.zoomPan&&(this.zoomPan.destroy(),this.zoomPan=null),this.gestureRecognizer&&(this.gestureRecognizer.destroy(),this.gestureRecognizer=null),this.zoomControlsUI&&(this.zoomControlsUI.destroy(),this.zoomControlsUI=null),this.scrollHintUI&&(this.scrollHintUI.destroy(),this.scrollHintUI=null),this.isZoomed=!1,this.highResLoaded=!1,this.hotspotsInstance&&(this.hotspotsInstance.destroy(),this.hotspotsInstance=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.hintsOverlay&&this.hintsOverlay.parentNode&&(this.hintsOverlay.parentNode.removeChild(this.hintsOverlay),this.hintsOverlay=null),this.hintsHidden=!1,oe(this.innerBox,".cloudimage-360-icons-container"),this.init(this.container,t,!0),this.iconsContainer=Oe(this.innerBox),this.onAllImagesLoaded())}init(t,i,o){const s=i?ji(i):Wi(t),{folder:n,apiVersion:r,filenameX:a,filenameY:l,filenameGrid:h,imageListX:c,imageListY:p,imageListGrid:m,indexZeroBase:u,amountX:x,amountY:v,draggable:y=!0,swipeable:I=!0,keys:k,keysReverse:w,bottomCircleOffset:g,autoplay:P,autoplayBehavior:f,playOnce:b,speed:C,autoplayReverse:E,fullscreen:T,magnifier:A,pointerZoom:M,zoomMax:L,zoomStep:K,zoomControls:q,zoomControlsPosition:O,scrollHint:D,ciToken:bt,ciFilters:J,ciTransformation:yt,lazyload:wt,dragSpeed:ct,stopAtEdges:st,stopAtEdgesX:nt,stopAtEdgesY:$,imageInfo:ht="black",initialIconShown:xt,bottomCircle:Q,hotspots:Yt,hotspotTrigger:ge="hover",dragReverse:Lt,hide360Logo:ve,logoSrc:Nt,inertia:be,pinchZoom:ye,hints:Wt,theme:Mt,markerTheme:Vt,brandColor:jt,hotspotTimelineOnClick:tt=!0,aspectRatio:Ct,cropAspectRatio:$t,cropGravity:Ut,onReady:Ot,onLoad:Kt,onSpin:qt,onAutoplayStart:Jt,onAutoplayStop:Qt,onFullscreenOpen:yn,onFullscreenClose:wn,onZoomIn:xn,onZoomOut:Cn,onDragStart:In,onDragEnd:kn,onHotspotOpen:Pn,onHotspotClose:En,onProductClick:zn,onNavigate:Tn,onError:An}=s,we={ciToken:bt,ciFilters:J,ciTransformation:yt,cropAspectRatio:$t,cropGravity:Ut},xe=Dt(c,[]),Ce=Dt(p,[]);let dt=Dt(m,[]);dt.length&&Array.isArray(dt[0])&&(dt=dt.flat()),this.isGridMode=!!(h||dt.length);const Xn=s.zoomMax===5&&M>1?Math.min(M,5):L||5;if(this.viewerConfig=s,this.amountX=xe.length||x,this.amountY=Ce.length||v,this.allowSpinX=!!this.amountX,this.allowSpinY=!!this.amountY,this.isGridMode&&(this.allowSpinX=!0,this.allowSpinY=!0),this.orientation=this.allowSpinX?Y.X:Y.Y,this.activeImageX=E?this.amountX-1:0,this.activeImageY=E?this.amountY-1:0,this.bottomCircleOffset=g,this.autoplay=P,this.autoplayBehavior=f,this.playOnce=b,this.speed=C,this.autoplayReverse=E,this.fullscreen=T,this.zoomMax=Xn,this.zoomStep=K||.5,this.zoomControls=q??!0,this.zoomControlsPosition=O||"bottom-left",this.scrollHint=D??!0,this.dragSpeed=Math.max(ct,Fi),this.stopAtEdges=st,this.stopAtEdgesX=nt??st,this.stopAtEdgesY=$??st,this.ciParams=we,this.apiVersion=r,this.keysReverse=w,this.info=ht,this.keys=k,this.innerBox=this.innerBox??lo(this.container),this.container.style.aspectRatio=Ct||"",this.initialIconShown=xt,this.bottomCircle=Q,this.spinDirection=Ho(this.autoplayBehavior,this.allowSpinX,this.allowSpinY),this.dragReverse=Lt,this.hotspots=Yt,this.hotspotTrigger=ge,this.onHotspotOpen=Pn,this.onHotspotClose=En,this.onProductClick=zn,this.onNavigate=Tn,this.hide360Logo=ve,this.logoSrc=Nt,this.inertia=be,this.pinchZoom=ye,this.hints=Wt,this.hotspotTimelineOnClick=tt,Mt==="dark"?this.container.classList.add("ci360-theme-dark"):Mt==="light"&&this.container.classList.remove("ci360-theme-dark"),this.container.classList.remove("ci360-hotspot-marker-inverted","ci360-hotspot-marker-brand"),Vt==="inverted"?this.container.classList.add("ci360-hotspot-marker-inverted"):Vt==="brand"&&(this.container.classList.add("ci360-hotspot-marker-brand"),jt&&this.container.style.setProperty("--ci360-hotspot-brand-color",jt)),this.onReady=Ot,this.onLoad=Kt,this.onSpin=qt,this.onAutoplayStart=Jt,this.onAutoplayStop=Qt,this.onFullscreenOpen=yn,this.onFullscreenClose=wn,this.onZoomIn=xn,this.onZoomOut=Cn,this.onDragStart=In,this.onDragEnd=kn,this.onError=An,this.srcXConfig={folder:n,filename:a,imageList:xe,container:t,innerBox:this.innerBox,apiVersion:r,ciParams:we,lazyload:wt,amount:this.amountX,indexZeroBase:u,autoplayReverse:E,orientation:Y.X},this.srcYConfig={...this.srcXConfig,filename:l,imageList:Ce,orientation:Y.Y,amount:this.amountY},this.srcGridConfig={folder:n,filename:h,imageList:dt,container:t,innerBox:this.innerBox,apiVersion:r,ciParams:we,lazyload:wt,amount:this.amountX*this.amountY,amountX:this.amountX,amountY:this.amountY,indexZeroBase:u,autoplayReverse:E},o&&this.removeEvents(),this.attachEvents(y,I,k),o)return;const Ie=this.container.offsetWidth;if(this.isGridMode){const Ht=dt.length?null:rt(this.srcGridConfig,Ie),te=ee=>{Le({cdnPath:Ht,config:this.srcGridConfig,onImageLoad:(et,N)=>{this.pushImageToSet(et,N,"grid"),this.updatePercentageInLoader(this.calculatePercentage())},onFirstImageLoad:et=>this.onFirstImageLoaded(ee,et),onAllImagesLoad:(et,N)=>{this.imagesGrid=et,N&&N.errorCount>0&&this.emit("onError",{errorCount:N.errorCount,errors:N.errors,totalImages:this.amountX*this.amountY}),this.onAllImagesLoaded()},onError:et=>this.emit("onError",et)})};se(Ht,this.srcGridConfig,te)}else{const Ht=this.allowSpinX&&!xe.length?rt(this.srcXConfig,Ie):null,te=this.allowSpinY&&!Ce.length?rt(this.srcYConfig,Ie):null,ee=et=>{Ye({cdnPathX:Ht,cdnPathY:te,configX:this.srcXConfig,configY:this.srcYConfig,onImageLoad:(N,Sn,Yn)=>this.onImageLoad(N,Sn,Yn),onFirstImageLoad:N=>this.onFirstImageLoaded(et,N),onAllImagesLoad:this.onAllImagesLoaded.bind(this),onError:N=>this.emit("onError",N)})};this.allowSpinX?se(Ht,this.srcXConfig,ee):this.allowSpinY&&se(te,this.srcYConfig,ee)}}}const gi=typeof navigator<"u"&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);class vi{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){if(!t)return;const o=t.id||this.generateId();t.id||(t.id=o);const s=new fi(t,i);return this.views.set(o,s),gi&&!this.memoryManagementAutoEnabled&&(this.memoryManagementAutoEnabled=!0,setTimeout(()=>this.enableMemoryManagement(),100)),s}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 fi(o);this.views.set(s,n)}),gi&&!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 r=n.getBoundingClientRect();r.top<window.innerHeight&&r.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=new vi,vi}();
|