vistaview 0.3.6 → 0.3.8
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 +6 -6
- package/dist/lib/defaults.d.ts.map +1 -1
- package/dist/lib/vista-view.d.ts +4 -3
- package/dist/lib/vista-view.d.ts.map +1 -1
- package/dist/vistaview.cjs +4 -4
- package/dist/vistaview.css +1 -1
- package/dist/vistaview.js +206 -207
- package/dist/vistaview.umd.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -290,23 +290,23 @@ dist/svelte.js 0.54 kB │ gzip: 0.27 kB
|
|
|
290
290
|
dist/solid.js 1.11 kB │ gzip: 0.52 kB
|
|
291
291
|
dist/vue.js 1.29 kB │ gzip: 0.56 kB
|
|
292
292
|
dist/react.js 1.54 kB │ gzip: 0.57 kB
|
|
293
|
-
dist/vistaview.js
|
|
294
|
-
[vite:dts] Declaration files built in
|
|
293
|
+
dist/vistaview.js 37.52 kB │ gzip: 9.32 kB
|
|
294
|
+
[vite:dts] Declaration files built in 660ms.
|
|
295
295
|
|
|
296
296
|
dist/vistaview.css 9.76 kB │ gzip: 1.69 kB
|
|
297
297
|
dist/svelte.cjs 0.48 kB │ gzip: 0.29 kB
|
|
298
298
|
dist/solid.cjs 0.92 kB │ gzip: 0.50 kB
|
|
299
299
|
dist/vue.cjs 1.00 kB │ gzip: 0.51 kB
|
|
300
300
|
dist/react.cjs 1.25 kB │ gzip: 0.52 kB
|
|
301
|
-
dist/vistaview.cjs
|
|
302
|
-
✓ built in
|
|
301
|
+
dist/vistaview.cjs 29.74 kB │ gzip: 8.28 kB
|
|
302
|
+
✓ built in 772ms
|
|
303
303
|
vite v6.4.1 building for production...
|
|
304
304
|
✓ 6 modules transformed.
|
|
305
305
|
|
|
306
306
|
[vite:dts] Start generate declaration files...
|
|
307
307
|
dist/vistaview.css 9.76 kB │ gzip: 1.69 kB
|
|
308
|
-
dist/vistaview.umd.js
|
|
309
|
-
[vite:dts] Declaration files built in
|
|
308
|
+
dist/vistaview.umd.js 29.89 kB │ gzip: 8.38 kB
|
|
309
|
+
[vite:dts] Declaration files built in 653ms.
|
|
310
310
|
|
|
311
311
|
✓ built in 740ms
|
|
312
312
|
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/lib/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAU9C,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/lib/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAU9C,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAoJ1D;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAQ7D;AAMD,eAAO,MAAM,WAAW,GAAI,WAAW,SAAS,SAE/C,CAAC;AAKF,eAAO,MAAM,YAAY,EAAE,sBAsB1B,CAAC;AAIF,eAAO,MAAM,iBAAiB,EAAE,2BAwG/B,CAAC;AAKF,eAAO,MAAM,YAAY,EAAE,sBAK1B,CAAC"}
|
package/dist/lib/vista-view.d.ts
CHANGED
|
@@ -54,12 +54,13 @@ export declare class VistaView {
|
|
|
54
54
|
private onZoomedPointerDown;
|
|
55
55
|
private onZoomedPointerMove;
|
|
56
56
|
private onZoomedPointerUp;
|
|
57
|
-
private
|
|
57
|
+
private transitionAbortControllers;
|
|
58
58
|
constructor(elements: NodeListOf<HTMLElement> | VistaViewImage[], options?: VistaViewOptions);
|
|
59
|
+
private loadImageTimeout;
|
|
59
60
|
private swap;
|
|
60
61
|
private setZoomed;
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
zoomIn(): void;
|
|
63
|
+
zoomOut(): void;
|
|
63
64
|
private clearZoom;
|
|
64
65
|
private getImages;
|
|
65
66
|
private setInitialDimPos;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vista-view.d.ts","sourceRoot":"","sources":["../../src/lib/vista-view.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAIV,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAEjB,MAAM,SAAS,CAAC;AAIjB,qBAAa,+BAAgC,SAAQ,KAAK;gBAC5C,OAAO,EAAE,MAAM;CAI5B;AAED,eAAO,MAAM,cAAc;;;;;;;;;cAepB,gBAAgB,CAAC,UAAU,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE;IAAE,eAAe,EAAE,SAAS,GAAG,IAAI,CAAA;CAEjE,CAAC;AAEF,qBAAa,SAAS;IACpB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,cAAc,EAAE,CAAC;IACrD,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY;gBACM,MAAM,GAAG,IAAI;oBACT,SAAS,GAAG,IAAI;;;;;
|
|
1
|
+
{"version":3,"file":"vista-view.d.ts","sourceRoot":"","sources":["../../src/lib/vista-view.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAIV,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAEjB,MAAM,SAAS,CAAC;AAIjB,qBAAa,+BAAgC,SAAQ,KAAK;gBAC5C,OAAO,EAAE,MAAM;CAI5B;AAED,eAAO,MAAM,cAAc;;;;;;;;;cAepB,gBAAgB,CAAC,UAAU,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE;IAAE,eAAe,EAAE,SAAS,GAAG,IAAI,CAAA;CAEjE,CAAC;AAEF,qBAAa,SAAS;IACpB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,cAAc,EAAE,CAAC;IACrD,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY;gBACM,MAAM,GAAG,IAAI;oBACT,SAAS,GAAG,IAAI;;;;;qBAUvB,MAAM,GAAG,IAAI;qBARb,MAAM;aAcR;YAAE,IAAI,EAAE,OAAO,CAAC;YAAC,IAAI,EAAE,OAAO,CAAA;SAAE;MAG3C;IAEF,OAAO,EAAE,WAAW,GAAG,IAAI,CAAQ;IACnC,iBAAiB,EAAE,WAAW,GAAG,IAAI,CAAQ;IAC7C,cAAc,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,sBAAsB,CAAA;KAAE,CAAM;IAC/D,aAAa,EAAE,qBAAqB,EAAE,GAAG,IAAI,CAAQ;IACrD,YAAY,EAAE,cAAc,EAAE,GAAG,IAAI,CAAQ;IAC7C,SAAS,UAAQ;IACjB,QAAQ,EAAE,gBAAgB,GAAG,KAAK,CAAS;IAE3C,OAAO,CAAC,eAAe,CAIrB;IACF,OAAO,CAAC,qBAAqB,CAAwD;IAErF,OAAO,CAAC,eAAe,CAA6B;IACpD,OAAO,CAAC,SAAS,CAA6C;IAE9D,OAAO,CAAC,SAAS,CAAwC;IACzD,OAAO,CAAC,cAAc,CAAkD;IACxE,OAAO,CAAC,SAAS,CAAwC;IACzD,OAAO,CAAC,QAAQ,CAAsC;IAEtD,OAAO,CAAC,mBAAmB,CAA4C;IACvE,OAAO,CAAC,mBAAmB,CAA4C;IACvE,OAAO,CAAC,iBAAiB,CAA4C;IAErE,OAAO,CAAC,0BAA0B,CAA0C;gBAEhE,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,cAAc,EAAE,EAAE,OAAO,CAAC,EAAE,gBAAgB;IA2C5F,OAAO,CAAC,gBAAgB,CAA8C;YAExD,IAAI;IA4FlB,OAAO,CAAC,SAAS;IAiGjB,MAAM,IAAI,IAAI;IAsCd,OAAO,IAAI,IAAI;IA2Df,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,SAAS;IAwBjB,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,2BAA2B;IAqCnC,OAAO,CAAC,UAAU;IAyFlB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,qBAAqB;IAK7B,OAAO,CAAC,iBAAiB;IA2BzB,OAAO,CAAC,oBAAoB;IA6B5B,OAAO,CAAC,kBAAkB;IAqB1B,IAAI,CAAC,UAAU,GAAE,MAAU,GAAG,IAAI;IA6J5B,KAAK,CAAC,IAAI,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAqEvC,OAAO,IAAI,IAAI;IAWf,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;IAYnE,IAAI,IAAI,IAAI;IAKZ,IAAI,IAAI,IAAI;IAKZ,eAAe,IAAI,MAAM;CAG1B"}
|
package/dist/vistaview.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var N=Object.defineProperty;var U=(s,t,i)=>t in s?N(s,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[t]=i;var w=(s,t,i)=>U(s,typeof t!="symbol"?t+"":t,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";var N=Object.defineProperty;var U=(s,t,i)=>t in s?N(s,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[t]=i;var w=(s,t,i)=>U(s,typeof t!="symbol"?t+"":t,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function R(s){const t=getComputedStyle(s),i=s.getBoundingClientRect();return{objectFit:t.objectFit,borderRadius:t.borderRadius,objectPosition:t.objectPosition,overflow:t.overflow,top:i.top,left:i.left,width:i.width,height:i.height,naturalWidth:s.naturalWidth,naturalHeight:s.naturalHeight}}let P=null;function K(){return P||(window.trustedTypes||(window.trustedTypes={createPolicy:(s,t)=>t}),P=window.trustedTypes.createPolicy("vistaView-policy",{createHTML:s=>s,createScript:()=>{throw new Error("Not implemented")},createScriptURL:()=>{throw new Error("Not implemented")}}),P)}function O(s){const i=K().createHTML(s),n=document.createElement("template");n.innerHTML=i;const e=n.content;return n.remove(),e}function H(s){return s&&!/^0(px|%|r?em|vw|vh|vmin|vmax|cm|mm|in|pt|pc|ex|ch)?$/i.test(s.trim())&&s}function j(s){const i=window.getComputedStyle(s).objectFit||"",{width:n,height:e}=s.getBoundingClientRect(),r=s.naturalWidth,d=s.naturalHeight;if(!i)return{width:n,height:e};if(!r||!d)return{width:n,height:e};const o=r/d,a=n/e;switch(i){case"fill":return{width:n,height:e};case"none":return{width:r,height:d};case"contain":return o>a?{width:n,height:n/o}:{width:e*o,height:e};case"cover":return o<a?{width:n,height:n/o}:{width:e*o,height:e};case"scale-down":{const h={width:r,height:d},l=o>a?{width:n,height:n/o}:{width:e*o,height:e};return l.width<=h.width&&l.height<=h.height?l:h}}return{width:n,height:e}}function q(s){const t=window.innerWidth,i=window.innerHeight,n=s.naturalWidth,e=s.naturalHeight;if(!n||!e)throw console.error("Error",s),new Error("Image natural dimensions are zero");if(n<t&&e<i)return{width:n,height:e};const r=n/e,d=t/i;let o,a;return r>d?(o=t,a=t/r):(a=i,o=i*r),{width:o,height:a}}function k(s,t){const i=window.innerHeight,n=window.innerWidth,e=s,r=t,d=Math.max(0,(e-n)/2)+n/2,o=Math.max(0,(r-i)/2)+i/2,a=-d,h=-o;return{maxDiffX:d,minDiffY:h,maxDiffY:o,minDiffX:a}}const G='<svg viewBox="0 0 24 24"><path d="m15 18-6-6 6-6"/></svg>',J='<svg viewBox="0 0 24 24"><path d="m9 18 6-6-6-6"/></svg>',Q='<svg viewBox="0 0 24 24"><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>',tt='<svg viewBox="0 0 24 24"><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>',et='<svg viewBox="0 0 24 24"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',it='<svg viewBox="0 0 24 24"><path d="M12 15V3"/><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m7 10 5 5 5-5"/></svg>';function V(){return{name:"download",icon:it,onClick:async s=>{var r;const t=await fetch(s.src),i=await t.blob(),n=t.url,e=document.createElement("a");e.href=URL.createObjectURL(i),e.download=((r=n.split("/").pop())==null?void 0:r.split("?")[0].split("#")[0])||"download",document.body.appendChild(e),e.click(),document.body.removeChild(e)}}}function nt(s){if(typeof s=="string")switch(s){case"zoomIn":return`<button class="vistaview-zoom-in-btn">${Q}</button>`;case"zoomOut":return`<button disabled class="vistaview-zoom-out-btn">${tt}</button>`;case"close":return`<button class="vistaview-close-btn">${et}</button>`;case"indexDisplay":return'<div class="vistaview-index-display"></div>';case"description":return'<div class="vistaview-description"></div>';default:return""}return`<button data-vistaview-custom-control="${s.name}">${s.icon}</button>`}function W(s,t){var l,c;const i=s.imageElm?getComputedStyle(s.imageElm):null,n=(i==null?void 0:i.objectFit)||"",e=((l=s.imageElm)==null?void 0:l.naturalWidth)||"",r=((c=s.imageElm)==null?void 0:c.naturalHeight)||"",d=(i==null?void 0:i.width)||"",o=(i==null?void 0:i.height)||"",a=document.createElement("div");a.className="vistaview-item",a.dataset.vistaviewPos=`${t!==void 0?t:""}`,a.dataset.vistaviewIndex=s.index.toString();const h=O(`<img class="vistaview-image-lowres"
|
|
2
2
|
style="${n?`object-fit:${n};`:""}${d?`width:${d};`:""}${o?`height:${o};`:""}"
|
|
3
3
|
src="${s.thumb||s.src}"
|
|
4
4
|
alt="${s.alt||""}"
|
|
5
5
|
${e?`width="${e}"`:""}
|
|
6
|
-
${
|
|
6
|
+
${r?`height="${r}"`:""}
|
|
7
7
|
/>
|
|
8
|
-
<img class="vistaview-image-highres" src="${s.src}" alt="${s.alt||""}" />`);return
|
|
8
|
+
<img class="vistaview-image-highres" src="${s.src}" alt="${s.alt||""}" />`);return a.appendChild(h),a}function st({controls:s,isReducedMotion:t}){const i=e=>e?e.map(nt).join(""):"";return O(`<div class="vistaview-root${t?" vistaview--reduced-motion":""}" id="vistaview-root">
|
|
9
9
|
<div class="vistaview-container">
|
|
10
10
|
<div class="vistaview-image-container"></div>
|
|
11
11
|
<div class="vistaview-top-bar vistaview-ui"><div>${i(s==null?void 0:s.topLeft)}</div><div>${i(s==null?void 0:s.topCenter)}</div><div>${i(s==null?void 0:s.topRight)}</div></div>
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
<div class="vistaview-prev-btn vistaview-ui"><button>${G}</button></div>
|
|
14
14
|
<div class="vistaview-next-btn vistaview-ui"><button>${J}</button></div>
|
|
15
15
|
</div>
|
|
16
|
-
</div>`)}let P=null,$=null,M=null,Z=null;function X(s){R(s);const t=s.imageContainerElm,i=s.elements.length;if(!t)return;let n=0,e=0,a=0,d=0,o=null,l=0,c=!1;P=r=>{r.preventDefault(),r.stopPropagation(),s.isZoomed===!1&&(c=!0,n=r.pageX,e=r.pageY,a=r.pageX,d=r.pageY,l=Date.now(),o=null,t.setPointerCapture(r.pointerId))},$=r=>{if(r.preventDefault(),r.stopPropagation(),s.isZoomed!==!1||!c)return;const h=r.pageX-n,m=r.pageY-e;a=r.pageX,d=r.pageY,Math.abs(h)>=Math.abs(m)&&(o===null||o===!0)?(t.style.setProperty("--vistaview-pointer-diff-x",`${h}px`),o=!0):Math.abs(m)>Math.abs(h)&&(o===null||o===!1)&&(t.style.setProperty("--vistaview-pointer-diff-y",`${m}px`),o=!1)},Z=r=>{if(r.preventDefault(),r.stopPropagation(),t.releasePointerCapture(r.pointerId),s.isZoomed!==!1||!c)return;c=!1,o=null;const h=Array.from(t.querySelectorAll(".vistaview-item"));t.style.removeProperty("--vistaview-pointer-diff-x"),t.style.removeProperty("--vistaview-pointer-diff-y"),h.forEach(m=>{m.style.transition="",m.style.translate=""})},M=r=>{if(r.preventDefault(),r.stopPropagation(),t.releasePointerCapture(r.pointerId),s.isZoomed!==!1||!c)return;c=!1;const h=Array.from(t.querySelectorAll(".vistaview-item")),m=a-n,f=d-e,u=Date.now()-l,v=m/u,y=f/u,p=s.options.touchSpeedThreshold||.5,b=h.find(E=>E.dataset.vistaviewPos==="0"),x=Number(b.dataset.vistaviewIndex);function g(){h[0].removeEventListener("transitionend",g),t.style.removeProperty("--vistaview-pointer-diff-x"),t.style.removeProperty("--vistaview-pointer-diff-y"),h.forEach(E=>{E.style.transition="",E.style.translate=""})}function I(E="0%",L="0%"){h.forEach(S=>{S.style.transition=`translate ${s.options.animationDurationBase*.5}ms ease-out`,S.style.translate=`${E} ${L}`})}if(v<-p||v>p){let E=function(){h[0].removeEventListener("transitionend",E),setTimeout(()=>{const L=s.isReducedMotion;s.isReducedMotion=!0,g(),s.view(v<-p?(x+1)%i:(x-1+i)%i,{next:v<-p,prev:v>p}),s.isReducedMotion=L},100)};I(v<-p?"-100%":"100%"),h[0].addEventListener("transitionend",E)}else y<-p||y>p?(s.close(),I("0%","0%")):(h[0].addEventListener("transitionend",g),I("0%"))},t.addEventListener("pointermove",$),t.addEventListener("pointerup",M),t.addEventListener("pointerdown",P),t.addEventListener("pointercancel",Z)}function R(s){const t=s.imageContainerElm;t&&($&&t.removeEventListener("pointermove",$),M&&t.removeEventListener("pointerup",M),P&&t.removeEventListener("pointerdown",P),Z&&t.removeEventListener("pointercancel",Z))}const Y=s=>{X(s)},B=({htmlElements:{to:s},index:{to:t},elements:i})=>{i instanceof NodeList&&t!==null&&(i.forEach(n=>n.style.opacity="1"),i[t].style.opacity="0"),s&&s.forEach(n=>{const e=Number(n.dataset.vistaviewPos);e!==0?(n.style.zIndex="1",n.style.left=100*e+"%"):n.style.zIndex="2"})},_=async({htmlElements:{from:s,to:t},images:{to:i},via:{next:n,prev:e},options:a,isReducedMotion:d},o)=>{if(console.log("defaultTransition called"),!i)throw new Error("VistaView: images is null in defaultTransition()");const l=s.filter(c=>c.dataset.vistaviewPos==="0"||(n?c.dataset.vistaviewPos==="1":c.dataset.vistaviewPos==="-1"));if(d){console.log("reduced motion, no transition");return}await new Promise((c,r)=>{let h=0;if(o.aborted){console.log("transition aborted before start"),r(new D("Transition aborted"));return}const m=f=>{if(o.aborted){console.log("transition aborted before start"),r(new D("Transition aborted"));return}if(f.currentTarget.removeEventListener("transitionend",m),h++,h<l.length)return;const u=t==null?void 0:t.find(g=>g.dataset.vistaviewPos==="0"),v=u?Number(u.dataset.vistaviewIndex):0,y=l.find(g=>Number(g.dataset.vistaviewIndex)===v),p=y==null?void 0:y.querySelector(".vistaview-image-highres");if(!p){r(new Error("current image element not found"));return}if(!p.classList.contains("vistaview-image-loaded")){console.log("current image not loaded yet"),c(0);return}if(u==null||u.classList.add("vistaview-image-loaded"),p.classList.contains("vistaview-image-settled")){console.log("current image already settled"),u==null||u.classList.add("vistaview-image-settled"),c(0);return}let b=0;console.log("waiting for image to be settled...");const x=setInterval(()=>{if(o.aborted){console.log("transition aborted during wait"),clearInterval(x),r(new D("Transition aborted"));return}if(b++,b>a.animationDurationBase/20*1.5){console.log("timeout waiting for image to be settled"),clearInterval(x),c(0);return}p.classList.contains("vistaview-image-settled")&&(console.log("image settled"),u==null||u.classList.add("vistaview-image-settled"),clearInterval(x),c(0))},20)};l.forEach(f=>{f.style.transition=`translate ${a.animationDurationBase*.5}ms ease-out`,f.style.translate=n?"-100%":e?"100%":"0%",f.addEventListener("transitionend",m)})})},F=s=>{s.elements instanceof NodeList&&s.elements.forEach(t=>t.style.opacity="1"),R(s)};class D extends Error{constructor(t){super(t),this.name="VistaViewTransitionAbortedError"}}const z={detectReducedMotion:!0,animationDurationBase:333,zoomStep:500,maxZoomLevel:2,touchSpeedThreshold:.5,preloads:1,keyboardListeners:!0,arrowOnSmallScreens:!1,controls:{topLeft:["indexDisplay"],topRight:["zoomIn","zoomOut",V(),"close"],bottomCenter:["description"]}},C={somethingOpened:null};class ot{constructor(t,i){w(this,"options");w(this,"elements");w(this,"isReducedMotion");w(this,"currentIndex",{_value:null,_vistaView:null,_via:{next:!1,prev:!1},set value(t){var n;const i=this._value;this._value=t,(n=this._vistaView)==null||n.swap(i,this._value)},get value(){return this._value},get via(){return this._via},set via(t){this._via=t}});w(this,"rootElm",null);w(this,"imageContainerElm",null);w(this,"customControls",{});w(this,"currentImages",null);w(this,"currentItems",null);w(this,"navActive",!0);w(this,"isZoomed",!1);w(this,"onClickElements",t=>{t.preventDefault();const i=t.currentTarget;i.dataset.vistaviewIndex&&this.open(parseInt(i.dataset.vistaviewIndex))});w(this,"defaultOnClickHandler",t=>t.preventDefault());w(this,"onResizeHandler",null);w(this,"onKeyDown",null);w(this,"userSetup",B);w(this,"userTransition",_);w(this,"userClose",F);w(this,"userInit",Y);w(this,"onZoomedPointerDown",null);w(this,"onZoomedPointerMove",null);w(this,"onZoomedPointerUp",null);w(this,"transitionAbortController",null);this.elements=t,this.currentIndex._vistaView=this,this.options={...z,...i||{},controls:{...z.controls,...(i==null?void 0:i.controls)||{}}},this.options.initFunction&&(this.userInit=this.options.initFunction),this.options.transitionFunction&&(this.userTransition=this.options.transitionFunction),this.options.closeFunction&&(this.userClose=this.options.closeFunction),this.options.initFunction&&(this.userInit=this.options.initFunction),this.isReducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.elements instanceof NodeList&&this.elements.forEach((n,e)=>{n.dataset.vistaviewIndex=e.toString(),n.addEventListener("click",this.defaultOnClickHandler),n.addEventListener("pointerup",this.onClickElements)})}async swap(t,i){var l,c;if(!C.somethingOpened||t===i||t===null)return;if(console.log("Swapping from",t,"to",i),this.transitionAbortController&&this.transitionAbortController.abort(),!this.imageContainerElm)throw new Error("VistaView: imageContainerElm is null in swap()");this.setIndexDisplay(),this.clearZoom();const{images:n,positions:e}=this.getCurrentIndexes(i),a=this.getImages(n),d=a.map((r,h)=>W(r,e[h]));console.log("swap prepared");const o={htmlElements:{from:this.currentItems,to:d},images:{from:this.currentImages,to:a},index:{from:t,to:i},via:this.currentIndex.via,container:this.imageContainerElm,elements:this.elements,isReducedMotion:this.isReducedMotion,navActive:this.navActive,isZoomed:this.isZoomed,options:this.options};this.userSetup(o),this.transitionAbortController=new AbortController;try{await this.userTransition(o,this.transitionAbortController.signal)}catch(r){r instanceof D||console.error(r)}console.log("swap completed"),this.imageContainerElm.innerHTML="",d.forEach(r=>{const h=r.dataset.vistaviewPos,m=r.dataset.vistaviewIndex;if(h==="0"){const f=this.currentItems.find(y=>y.dataset.vistaviewIndex===m),u=r.querySelector(".vistaview-image-highres"),v=f==null?void 0:f.querySelector(".vistaview-image-highres");v&&(u.setAttribute("class",v.getAttribute("class")||""),u.setAttribute("style",v.getAttribute("style")||"")),this.imageContainerElm.appendChild(r)}else this.imageContainerElm.appendChild(r)}),this.setInitialDimPos(),this.currentImages=a,this.currentItems=d,this.loadImages(),this.setCurrentDescription(),this.updateZoomButtonsVisibility(),(c=(l=this.options).onImageView)==null||c.call(l,o)}setZoomed(t){var i,n,e,a,d,o;if(this.isZoomed!==t){if(this.isZoomed){let l=this.isZoomed;if(l.classList.remove("vistaview-image--zooming"),this.onZoomedPointerDown&&((i=l.parentElement)==null||i.removeEventListener("pointerdown",this.onZoomedPointerDown),this.onZoomedPointerDown=null),this.onZoomedPointerMove&&((n=l.parentElement)==null||n.removeEventListener("pointermove",this.onZoomedPointerMove),this.onZoomedPointerMove=null),this.onZoomedPointerUp&&((e=l.parentElement)==null||e.removeEventListener("pointerup",this.onZoomedPointerUp),this.onZoomedPointerUp=null),l==null||l.style.removeProperty("--pointer-diff-x"),l==null||l.style.removeProperty("--pointer-diff-y"),setTimeout(()=>{l==null||l.classList.remove("vistaview-image--zooming")},500),this.isZoomed=!1,!t)return}if(t){this.isZoomed=t,t.classList.add("vistaview-image--zooming"),t==null||t.style.setProperty("--pointer-diff-x","0px"),t==null||t.style.setProperty("--pointer-diff-y","0px");let l=!1,c=0,r=0,h=0,m=0,f=0,u=0;this.onZoomedPointerDown=v=>{v.preventDefault(),v.stopPropagation(),l=!0,c=v.pageX,r=v.pageY,t.setPointerCapture(v.pointerId)},this.onZoomedPointerMove=v=>{if(!l)return;v.preventDefault(),f=v.pageX-c,u=v.pageY-r;const y=parseInt((t==null?void 0:t.dataset.vistaviewCurrentWidth)||"0"),p=parseInt((t==null?void 0:t.dataset.vistaviewCurrentHeight)||"0"),{maxDiffX:b,minDiffY:x,maxDiffY:g,minDiffX:I}=k(y,p),E=Math.min(b,Math.max(I,h+f)),L=Math.min(g,Math.max(x,m+u));f=E-h,u=L-m,t==null||t.style.setProperty("--pointer-diff-x",`${E}px`),t==null||t.style.setProperty("--pointer-diff-y",`${L}px`)},this.onZoomedPointerUp=v=>{l=!1,t.releasePointerCapture(v.pointerId),h+=f,m+=u,f=0,u=0},(a=t==null?void 0:t.parentElement)==null||a.addEventListener("pointerdown",this.onZoomedPointerDown),(d=t==null?void 0:t.parentElement)==null||d.addEventListener("pointermove",this.onZoomedPointerMove),(o=t==null?void 0:t.parentElement)==null||o.addEventListener("pointerup",this.onZoomedPointerUp);return}}}zoomIn(){var a,d,o,l,c;const t=(a=this.rootElm)==null?void 0:a.querySelector('[data-vistaview-pos="0"] .vistaview-image-highres'),i=t.width,n=t.height;t.dataset.vistaviewInitialWidth||(t.dataset.vistaviewInitialWidth=i.toString()),t.dataset.vistaviewInitialHeight||(t.dataset.vistaviewInitialHeight=n.toString()),this.setZoomed(t);const e=(t.naturalWidth||0)*this.options.maxZoomLevel;if(i&&e&&i<e){const r=Math.min(i+this.options.zoomStep,e);t.style.width=`${r}px`;const h=r/i*n;t.style.height=`${h}px`,(o=(d=this.rootElm)==null?void 0:d.querySelector("button.vistaview-zoom-out-btn"))==null||o.removeAttribute("disabled"),t.dataset.vistaviewCurrentWidth=r.toString(),t.dataset.vistaviewCurrentHeight=h.toString(),r===e&&((c=(l=this.rootElm)==null?void 0:l.querySelector("button.vistaview-zoom-in-btn"))==null||c.setAttribute("disabled","true"))}}zoomOut(){var d,o,l,c,r;const t=(d=this.rootElm)==null?void 0:d.querySelector('[data-vistaview-pos="0"] .vistaview-image-highres'),i=t.width,n=t.height,e=t.dataset.vistaviewInitialWidth?parseInt(t.dataset.vistaviewInitialWidth):0,a=h=>{h.target===t&&(t.classList.remove("vistaview-image--zooming-out"),t.removeEventListener("transitionend",a))};if(t.addEventListener("transitionend",a),t.classList.add("vistaview-image--zooming-out"),i&&e&&i>e){const h=Math.max(i-this.options.zoomStep,e);t.style.width=`${h}px`;const m=h/i*n;t.style.height=`${m}px`,(l=(o=this.rootElm)==null?void 0:o.querySelector("button.vistaview-zoom-in-btn"))==null||l.removeAttribute("disabled"),t.dataset.vistaviewCurrentWidth=h.toString(),t.dataset.vistaviewCurrentHeight=m.toString();const{maxDiffX:f,minDiffY:u,maxDiffY:v,minDiffX:y}=k(h,m);let p=parseInt((t==null?void 0:t.style.getPropertyValue("--pointer-diff-x").replace("px",""))||"0"),b=parseInt((t==null?void 0:t.style.getPropertyValue("--pointer-diff-y").replace("px",""))||"0");p=Math.min(f,Math.max(y,p)),b=Math.min(v,Math.max(u,b)),t==null||t.style.setProperty("--pointer-diff-x",`${p}px`),t==null||t.style.setProperty("--pointer-diff-y",`${b}px`),h===e&&((r=(c=this.rootElm)==null?void 0:c.querySelector("button.vistaview-zoom-out-btn"))==null||r.setAttribute("disabled","true"),t.removeAttribute("data-vistaview-current-width"),t.removeAttribute("data-vistaview-current-height"),t.removeAttribute("data-vistaview-initial-width"),t.removeAttribute("data-vistaview-initial-height"),this.setZoomed(!1))}}clearZoom(){}getImages(t){return t.map((i,n)=>{const e=this.elements[i];if(e instanceof HTMLElement){const a=e.querySelector("img"),d=e.getAttribute("href")||"",o=e.getAttribute("src")||"",l=e.dataset.vistaviewSrc||d||o||(a==null?void 0:a.src)||"",c=e.dataset.vistaviewAlt||e.getAttribute("alt")||(a==null?void 0:a.alt)||"",r=e.dataset.vistaviewThumb||(a==null?void 0:a.src)||d||o||"";return{index:t[n],src:l,alt:c,thumb:r,imageElm:e instanceof HTMLImageElement?e:a,anchorElm:e instanceof HTMLAnchorElement?e:void 0}}else return{index:t[n],...e}})}setInitialDimPos(){var c,r;if(!this.rootElm)return;const t=(c=this.rootElm.querySelector('[data-vistaview-pos="0"]'))==null?void 0:c.dataset.vistaviewIndex,i=((r=this.currentImages)==null?void 0:r.find(h=>h.index===Number(t)))||null;if(!i)return;const n=i.imageElm?T(i.imageElm):void 0,e=i.anchorElm?T(i.anchorElm):void 0,a=(e==null?void 0:e.width)||(n==null?void 0:n.width)||0,d=(e==null?void 0:e.height)||(n==null?void 0:n.height)||0,o=((e==null?void 0:e.left)||(n==null?void 0:n.left)||0)+a/2,l=((e==null?void 0:e.top)||(n==null?void 0:n.top)||0)+d/2;this.rootElm.style.setProperty("--vistaview-container-initial-width",a+"px"),this.rootElm.style.setProperty("--vistaview-container-initial-height",d+"px"),this.rootElm.style.setProperty("--vistaview-container-initial-top",l+"px"),this.rootElm.style.setProperty("--vistaview-container-initial-left",o+"px"),this.rootElm.style.setProperty("--vistaview-image-border-radius",H(e==null?void 0:e.borderRadius)||H(n==null?void 0:n.borderRadius)||"0px")}updateZoomButtonsVisibility(){var e;const t=(e=this.rootElm)==null?void 0:e.querySelector('[data-vistaview-pos="0"] img.vistaview-image-highres');if(!t)return;const i=this;function n(){var r,h;const a=(r=i.rootElm)==null?void 0:r.querySelector("button.vistaview-zoom-in-btn"),d=(h=i.rootElm)==null?void 0:h.querySelector("button.vistaview-zoom-out-btn"),o=parseInt(t.style.width)||t.width,l=t.naturalWidth*i.options.maxZoomLevel,c=o<l&&l>0;a&&(a.style.display=c?"":"none"),d&&(d.style.display=c?"":"none")}t.complete&&t.naturalWidth>0?n():t.addEventListener("load",n)}loadImages(){if(!this.rootElm)return;this.rootElm.querySelectorAll(".vistaview-image-highres:not(.vistaview-image-loaded)").forEach((i,n)=>{const e=i,d=this.currentImages[n].imageElm,o={w:0,h:0};if(d){const{width:c,height:r}=K(d);o.w=Math.min(d.width,c),o.h=Math.min(d.height,r)}const l=()=>{var r;const c=()=>{var h;o.w&&o.h&&(e.style.width=`${o.w}px`,e.style.height=`${o.h}px`,e.style.setProperty("--vistaview-fitted-width",`${o.w}px`),e.style.setProperty("--vistaview-fitted-height",`${o.h}px`)),e.classList.add("vistaview-image-loaded"),e.width=e.naturalWidth,e.height=e.naturalHeight,setTimeout(()=>{var y,p;let m=0;const f=()=>{var b,x;m++,!(m<3)&&(e.removeEventListener("transitionend",f),(x=(b=e.parentElement)==null?void 0:b.querySelector(".vistaview-image-lowres"))==null||x.classList.add("vistaview-image--hidden"),e.classList.add("vistaview-image-settled"))};e.addEventListener("transitionend",f);const{width:u,height:v}=q(e);e.style.width=`${u}px`,e.style.height=`${v}px`,o.w&&o.h&&u===o.w&&v===o.h?((p=(y=e.parentElement)==null?void 0:y.querySelector(".vistaview-image-lowres"))==null||p.classList.add("vistaview-image--hidden"),e.classList.add("vistaview-image-settled")):(e.style.width=`${u}px`,e.style.height=`${v}px`)},100),(h=i.parentElement)!=null&&h.matches('[data-vistaview-pos="0"]')&&this.updateZoomButtonsVisibility()};if((r=this.rootElm)!=null&&r.classList.contains("vistaview--opened"))c();else{const h=setInterval(()=>{var m;(m=this.rootElm)!=null&&m.classList.contains("vistaview--opened")&&(clearInterval(h),c())},50)}};e.complete&&e.naturalWidth>0?l():e.onload=l})}setIndexDisplay(){this.elements.length!==1&&(this.rootElm.querySelector(".vistaview-index-display").textContent=`${this.currentIndex.value+1} / ${this.elements.length}`)}setCurrentDescription(){this.rootElm.querySelector(".vistaview-description").textContent=(this.currentImages[1]||this.currentImages[0]).alt||""}getCurrentIndexes(t){const i=this.options.preloads,n=this.elements.length,e=n<1||!i?[t]:[...new Set([...Array.from({length:i},(d,o)=>((t-i+o)%n+n)%n),t,...Array.from({length:i},(d,o)=>(t+1+o)%n)])],a=n<1||!i?[0]:e.map((d,o)=>o-Math.floor(e.length/2));return{images:e,positions:a}}setKeyboardListeners(){this.onKeyDown=t=>{switch(t.key){case"ArrowLeft":t.preventDefault(),this.prev();break;case"ArrowRight":t.preventDefault(),this.next();break;case"ArrowUp":t.preventDefault(),this.zoomIn();break;case"ArrowDown":t.preventDefault(),this.zoomOut();break;case"Escape":t.preventDefault(),this.close();break}},window.addEventListener("keydown",this.onKeyDown)}setResizeListeners(){this.onResizeHandler=()=>{var i;this.setInitialDimPos();const t=(i=this.rootElm)==null?void 0:i.querySelectorAll(".vistaview-image-highres.vistaview-image-loaded");t==null||t.forEach(n=>{const e=n,{width:a,height:d}=q(e);e.classList.contains("vistaview-image--zooming")?(e.dataset.vistaviewInitialWidth=a.toString(),e.dataset.vistaviewInitialHeight=d.toString()):(e.style.width=`${a}px`,e.style.height=`${d}px`)})},window.addEventListener("resize",this.onResizeHandler)}open(t=0){var o,l,c,r,h,m,f,u,v,y,p,b,x;if(C.somethingOpened){console.error("VistaView: another instance is already opened. Returning.");return}if(C.somethingOpened=this,this.currentIndex._value=t,document.body.prepend(st({controls:this.options.controls,isReducedMotion:this.isReducedMotion})),this.rootElm=document.querySelector("#vistaview-root"),this.imageContainerElm=((o=this.rootElm)==null?void 0:o.querySelector(".vistaview-image-container"))||null,!this.rootElm||!this.imageContainerElm)throw C.somethingOpened=null,new Error("Failed to create VistaView element");this.options.arrowOnSmallScreens||this.rootElm.classList.add("vistaview-no-arrows-sm");const{images:i,positions:n}=this.getCurrentIndexes(t);this.currentImages=this.getImages(i);const e=this.currentImages.map((g,I)=>W(g,n[I]));this.currentItems=e;const a={htmlElements:{from:null,to:this.currentItems},images:{from:null,to:this.currentImages},index:{from:null,to:t},via:this.currentIndex.via,container:this.imageContainerElm,elements:this.elements,isReducedMotion:this.isReducedMotion,navActive:this.navActive,isZoomed:this.isZoomed,options:this.options};this.userSetup(a),this.imageContainerElm.innerHTML="",this.currentItems.forEach(g=>{this.imageContainerElm.appendChild(g)});let d=0;this.rootElm.addEventListener("animationend",g=>{var I;g.currentTarget===this.rootElm&&(d++,d>=2&&((I=this.rootElm)==null||I.classList.add("vistaview--opened")))}),(l=this.rootElm.querySelector(".vistaview-close-btn"))==null||l.addEventListener("click",()=>this.close()),(c=this.rootElm.querySelector(".vistaview-zoom-in-btn"))==null||c.addEventListener("click",()=>this.zoomIn()),(r=this.rootElm.querySelector(".vistaview-zoom-out-btn"))==null||r.addEventListener("click",()=>this.zoomOut()),(h=this.rootElm.querySelector(".vistaview-prev-btn>button"))==null||h.addEventListener("click",()=>this.prev()),(m=this.rootElm.querySelector(".vistaview-next-btn>button"))==null||m.addEventListener("click",()=>this.next()),[...this.options.controls.topLeft||[],...this.options.controls.topRight||[],...this.options.controls.topCenter||[],...this.options.controls.bottomCenter||[],...this.options.controls.bottomLeft||[],...this.options.controls.bottomRight||[]].forEach(g=>{typeof g!="string"&&(this.customControls[g.name]=g)}),this.rootElm.querySelectorAll("button[data-vistaview-custom-control]").forEach(g=>{g.addEventListener("click",I=>{const E=this.customControls[I.currentTarget.dataset.vistaviewCustomControl],L=this.currentImages.find(S=>S.index===this.currentIndex.value);E&&L&&(E.onClick.constructor.name==="AsyncFunction"?(g.classList.add("vistaview-button--loading"),E.onClick(L).finally(()=>{g.classList.remove("vistaview-button--loading")})):E.onClick(L))})}),this.options.animationDurationBase&&this.rootElm.style.setProperty("--vistaview-animation-duration",`${this.options.animationDurationBase}`),this.options.initialZIndex!==void 0&&this.rootElm.style.setProperty("--vistaview-initial-z-index",`${this.options.initialZIndex}`),this.setInitialDimPos(),this.setResizeListeners(),this.options.keyboardListeners&&this.setKeyboardListeners(),this.elements.length===1&&((f=this.rootElm.querySelector(".vistaview-prev-btn"))==null||f.classList.add("vistaview-ui--none"),(u=this.rootElm.querySelector(".vistaview-next-btn"))==null||u.classList.add("vistaview-ui--none"),(v=this.rootElm.querySelector(".vistaview-index-display"))==null||v.classList.add("vistaview-ui--none")),this.rootElm&&this.rootElm.classList.add("vistaview--initialized"),this.loadImages(),this.setCurrentDescription(),this.setIndexDisplay(),this.userInit(this),(p=(y=this.options).onOpen)==null||p.call(y,a),(x=(b=this.options).onImageView)==null||x.call(b,a)}async close(t=!0){var n,e,a;if(C.somethingOpened!==this)return;t&&((n=this.rootElm)==null||n.classList.add("vistaview--closing"),await new Promise(d=>{var l;let o;(l=this.rootElm)==null||l.addEventListener("transitionend",c=>{c.currentTarget===this.rootElm&&(o&&clearTimeout(o),o=setTimeout(()=>{d()},333))})}));const i={htmlElements:{from:this.currentItems,to:null},images:{from:this.currentImages,to:null},index:{from:this.currentIndex.value,to:null},container:this.imageContainerElm,elements:this.elements,via:{prev:!1,next:!1},isReducedMotion:this.isReducedMotion,navActive:this.navActive,isZoomed:this.isZoomed,options:this.options};this.userClose(this),(a=(e=this.options).onClose)==null||a.call(e,i),document.body.removeChild(this.rootElm),this.currentIndex._value=null,this.currentIndex._via={next:!1,prev:!1},this.rootElm=null,this.imageContainerElm=null,this.currentImages=null,this.currentItems=null,this.navActive=!0,this.onResizeHandler&&(window.removeEventListener("resize",this.onResizeHandler),this.onResizeHandler=null),this.onKeyDown&&(window.removeEventListener("keydown",this.onKeyDown),this.onKeyDown=null),(this.onZoomedPointerDown||this.onZoomedPointerMove||this.onZoomedPointerUp)&&(this.setZoomed(!1),this.onZoomedPointerDown=null,this.onZoomedPointerMove=null,this.onZoomedPointerUp=null),this.transitionAbortController&&(this.transitionAbortController.abort(),this.transitionAbortController=null),C.somethingOpened=null}destroy(){this.close(!1),this.elements instanceof NodeList&&this.elements.forEach(t=>{t.dataset.vistaviewIndex&&delete t.dataset.vistaviewIndex,t.removeEventListener("click",this.defaultOnClickHandler),t.removeEventListener("pointerup",this.onClickElements)})}view(t,i){C.somethingOpened===this&&this.navActive&&(t<0&&(t=this.elements.length-1),t>=this.elements.length&&(t=0),this.currentIndex.via=i||{next:!1,prev:!1},this.currentIndex.value=t)}next(){C.somethingOpened===this&&this.view(this.currentIndex.value+1,{next:!0,prev:!1})}prev(){C.somethingOpened===this&&this.view(this.currentIndex.value-1,{next:!1,prev:!0})}getCurrentIndex(){return C.somethingOpened===this?this.currentIndex.value:-1}}function rt(s){let t=null;if(typeof s=="string"?t=document.querySelectorAll(s):s instanceof NodeList&&(t=s),t)for(let i=0;i<t.length;i++){const n=t[i];if(!(n.dataset.vistaviewSrc||n.getAttribute("href")||n.getAttribute("src")||""))return`Element at index ${i} is missing 'src' / 'data-vistaview-src' / 'href' attribute.`}else{const i=s;for(let n=0;n<i.length;n++)if(!i[n].src)return`Element at index ${n} is missing 'src' attribute.`}return t||s}function at({elements:s,...t}){if(!s)throw new Error("No elements");let i=rt(s);if(typeof i=="string")return console.error(i),console.warn("VistaView: silently returning."),null;const n=new ot(i,t);return{open:(e=0)=>n.open(e),close:()=>n.close(),next:()=>n.next(),prev:()=>n.prev(),destroy:()=>n.destroy(),getCurrentIndex:()=>n.getCurrentIndex(),view:e=>{n.view(e)}}}exports.DefaultOptions=z;exports.VistaViewTransitionAbortedError=D;exports.defaultClose=F;exports.defaultInit=Y;exports.defaultSetup=B;exports.defaultTransition=_;exports.removeTouchActions=R;exports.setTouchActions=X;exports.vistaView=at;exports.vistaViewDownload=V;
|
|
16
|
+
</div>`)}let A=null,M=null,$=null,Z=null;function X(s){T(s);const t=s.imageContainerElm,i=s.elements.length;if(!t)return;let n=0,e=0,r=0,d=0,o=null,a=0,h=!1;A=l=>{l.preventDefault(),l.stopPropagation(),s.isZoomed===!1&&(h=!0,n=l.pageX,e=l.pageY,r=l.pageX,d=l.pageY,a=Date.now(),o=null,t.setPointerCapture(l.pointerId))},M=l=>{if(l.preventDefault(),l.stopPropagation(),s.isZoomed!==!1||!h)return;const c=l.pageX-n,v=l.pageY-e;r=l.pageX,d=l.pageY,Math.abs(c)>=Math.abs(v)&&(o===null||o===!0)?(t.style.setProperty("--vistaview-pointer-diff-x",`${c}px`),o=!0):Math.abs(v)>Math.abs(c)&&(o===null||o===!1)&&(t.style.setProperty("--vistaview-pointer-diff-y",`${v}px`),o=!1)},Z=l=>{if(l.preventDefault(),l.stopPropagation(),t.releasePointerCapture(l.pointerId),s.isZoomed!==!1||!h)return;h=!1,o=null;const c=Array.from(t.querySelectorAll(".vistaview-item"));t.style.removeProperty("--vistaview-pointer-diff-x"),t.style.removeProperty("--vistaview-pointer-diff-y"),c.forEach(v=>{v.style.transition="",v.style.translate=""})},$=l=>{if(l.preventDefault(),l.stopPropagation(),t.releasePointerCapture(l.pointerId),s.isZoomed!==!1||!h)return;h=!1;const c=Array.from(t.querySelectorAll(".vistaview-item")),v=r-n,m=d-e,f=Date.now()-a,u=v/f,y=m/f,p=s.options.touchSpeedThreshold||.5,b=c.find(E=>E.dataset.vistaviewPos==="0"),x=Number(b.dataset.vistaviewIndex);function g(){c[0].removeEventListener("transitionend",g),t.style.removeProperty("--vistaview-pointer-diff-x"),t.style.removeProperty("--vistaview-pointer-diff-y"),c.forEach(E=>{E.style.transition="",E.style.translate=""})}function I(E="0%",L="0%"){c.forEach(S=>{S.style.transition=`translate ${s.options.animationDurationBase*.5}ms ease-out`,S.style.translate=`${E} ${L}`})}if(u<-p||u>p){let E=function(){c[0].removeEventListener("transitionend",E),setTimeout(()=>{const L=s.isReducedMotion;s.isReducedMotion=!0,g(),s.view(u<-p?(x+1)%i:(x-1+i)%i,{next:u<-p,prev:u>p}),s.isReducedMotion=L},100)};I(u<-p?"-100%":"100%"),c[0].addEventListener("transitionend",E)}else y<-p||y>p?(s.close(),I("0%","0%")):(c[0].addEventListener("transitionend",g),I("0%"),u===0&&y===0&&s.zoomIn())},t.addEventListener("pointermove",M),t.addEventListener("pointerup",$),t.addEventListener("pointerdown",A),t.addEventListener("pointercancel",Z)}function T(s){const t=s.imageContainerElm;t&&(M&&t.removeEventListener("pointermove",M),$&&t.removeEventListener("pointerup",$),A&&t.removeEventListener("pointerdown",A),Z&&t.removeEventListener("pointercancel",Z))}const Y=s=>{X(s)},_=({htmlElements:{to:s},index:{to:t},elements:i})=>{i instanceof NodeList&&t!==null&&(i.forEach(n=>n.style.opacity="1"),i[t].style.opacity="0"),s&&s.forEach(n=>{const e=Number(n.dataset.vistaviewPos);e!==0?(n.style.zIndex="1",n.style.left=100*e+"%"):n.style.zIndex="2"})},B=async({htmlElements:{from:s,to:t},images:{to:i},via:{next:n,prev:e},options:r,isReducedMotion:d},o)=>{if(!i)throw new Error("VistaView: images is null in defaultTransition()");if(d)return;const a=s.filter(h=>h.dataset.vistaviewPos==="0"||(n?h.dataset.vistaviewPos==="1":h.dataset.vistaviewPos==="-1"));await new Promise((h,l)=>{let c=0;if(o.aborted){l(new D("Transition aborted"));return}const v=m=>{if(o.aborted)return l(new D("Transition aborted"));if(m.currentTarget.removeEventListener("transitionend",v),c++,c<a.length)return;const f=t==null?void 0:t.find(g=>g.dataset.vistaviewPos==="0"),u=f?Number(f.dataset.vistaviewIndex):0,y=a.find(g=>Number(g.dataset.vistaviewIndex)===u),p=y==null?void 0:y.querySelector(".vistaview-image-highres");if(!p)return l(new Error("current image element not found"));if(!p.classList.contains("vistaview-image-loaded")||p.classList.contains("vistaview-image-settled"))return h(0);let b=0;const x=setInterval(()=>{if(o.aborted)return clearInterval(x),l(new D("Transition aborted"));if(b++,b>r.animationDurationBase/20*1.5)return clearInterval(x),h(0);if(p.classList.contains("vistaview-image-settled"))return f==null||f.classList.add("vistaview-image-settled"),clearInterval(x),h(0)},20)};a.forEach(m=>{m.style.transition=`translate ${r.animationDurationBase*.5}ms ease-out`,m.style.translate=n?"-100%":e?"100%":"0%",m.addEventListener("transitionend",v)})})},F=s=>{s.elements instanceof NodeList&&s.elements.forEach(t=>t.style.opacity="1"),T(s)};class D extends Error{constructor(t){super(t),this.name="VistaViewTransitionAbortedError"}}const z={detectReducedMotion:!0,animationDurationBase:333,zoomStep:500,maxZoomLevel:2,touchSpeedThreshold:.5,preloads:1,keyboardListeners:!0,arrowOnSmallScreens:!1,controls:{topLeft:["indexDisplay"],topRight:["zoomIn","zoomOut",V(),"close"],bottomCenter:["description"]}},C={somethingOpened:null};class ot{constructor(t,i){w(this,"options");w(this,"elements");w(this,"isReducedMotion");w(this,"currentIndex",{_value:null,_vistaView:null,_via:{next:!1,prev:!1},set value(t){var n,e,r;const i=this._value;this._value=t;for(const d in(n=this._vistaView)==null?void 0:n.transitionAbortControllers)(e=this._vistaView)==null||e.transitionAbortControllers[d].abort();(r=this._vistaView)==null||r.swap(i,this._value)},get value(){return this._value},get via(){return this._via},set via(t){this._via=t}});w(this,"rootElm",null);w(this,"imageContainerElm",null);w(this,"customControls",{});w(this,"currentImages",null);w(this,"currentItems",null);w(this,"navActive",!0);w(this,"isZoomed",!1);w(this,"onClickElements",t=>{t.preventDefault();const i=t.currentTarget;i.dataset.vistaviewIndex&&this.open(parseInt(i.dataset.vistaviewIndex))});w(this,"defaultOnClickHandler",t=>t.preventDefault());w(this,"onResizeHandler",null);w(this,"onKeyDown",null);w(this,"userSetup",_);w(this,"userTransition",B);w(this,"userClose",F);w(this,"userInit",Y);w(this,"onZoomedPointerDown",null);w(this,"onZoomedPointerMove",null);w(this,"onZoomedPointerUp",null);w(this,"transitionAbortControllers",{});w(this,"loadImageTimeout",null);this.elements=t,this.currentIndex._vistaView=this,this.options={...z,...i||{},controls:{...z.controls,...(i==null?void 0:i.controls)||{}}},this.options.initFunction&&(this.userInit=this.options.initFunction),this.options.transitionFunction&&(this.userTransition=this.options.transitionFunction),this.options.closeFunction&&(this.userClose=this.options.closeFunction),this.options.initFunction&&(this.userInit=this.options.initFunction),this.isReducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.elements instanceof NodeList&&this.elements.forEach((n,e)=>{n.dataset.vistaviewIndex=e.toString(),n.addEventListener("click",this.defaultOnClickHandler),n.addEventListener("pointerup",this.onClickElements)})}async swap(t,i){var l,c;if(!C.somethingOpened||t===i||t===null)return;if(!this.imageContainerElm)throw new Error("VistaView: imageContainerElm is null in swap()");this.setIndexDisplay(),this.clearZoom();const{images:n,positions:e}=this.getCurrentIndexes(i),r=this.getImages(n),d=r.map((v,m)=>W(v,e[m])),o={htmlElements:{from:this.currentItems,to:d},images:{from:this.currentImages,to:r},index:{from:t,to:i},via:this.currentIndex.via,container:this.imageContainerElm,elements:this.elements,isReducedMotion:this.isReducedMotion,navActive:this.navActive,isZoomed:this.isZoomed,options:this.options};this.userSetup(o);const a=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);this.transitionAbortControllers[a]=new AbortController;try{await this.userTransition(o,this.transitionAbortControllers[a].signal)}catch(v){v instanceof D||console.warn(v)}delete this.transitionAbortControllers[a];const h=d.find(v=>v.dataset.vistaviewPos==="0");if(h){const v=h.dataset.vistaviewIndex,m=this.currentItems.find(u=>u.dataset.vistaviewIndex===v),f=m==null?void 0:m.querySelector(".vistaview-image-highres");if(f){const u=h.querySelector(".vistaview-image-highres");u.setAttribute("class",f.getAttribute("class")||""),u.setAttribute("style",f.getAttribute("style")||""),u.classList.remove("vistaview-image--zooming"),u.classList.remove("vistaview-image-settled")}}this.imageContainerElm.innerHTML="",d.forEach(v=>{this.imageContainerElm.appendChild(v)}),this.setInitialDimPos(),this.currentImages=r,this.currentItems=d,this.setCurrentDescription(),this.updateZoomButtonsVisibility(),(c=(l=this.options).onImageView)==null||c.call(l,o),this.loadImageTimeout&&clearTimeout(this.loadImageTimeout),this.loadImageTimeout=setTimeout(()=>{this.loadImages()},333)}setZoomed(t){var i,n,e,r,d,o;if(this.isZoomed!==t){if(this.isZoomed){let a=this.isZoomed;if(a.classList.remove("vistaview-image--zooming"),this.onZoomedPointerDown&&((i=a.parentElement)==null||i.removeEventListener("pointerdown",this.onZoomedPointerDown),this.onZoomedPointerDown=null),this.onZoomedPointerMove&&((n=a.parentElement)==null||n.removeEventListener("pointermove",this.onZoomedPointerMove),this.onZoomedPointerMove=null),this.onZoomedPointerUp&&((e=a.parentElement)==null||e.removeEventListener("pointerup",this.onZoomedPointerUp),this.onZoomedPointerUp=null),a==null||a.style.removeProperty("--pointer-diff-x"),a==null||a.style.removeProperty("--pointer-diff-y"),setTimeout(()=>{a==null||a.classList.remove("vistaview-image--zooming")},500),this.isZoomed=!1,!t)return}if(t){this.isZoomed=t,t.classList.add("vistaview-image--zooming"),t==null||t.style.setProperty("--pointer-diff-x","0px"),t==null||t.style.setProperty("--pointer-diff-y","0px");let a=!1,h=0,l=0,c=0,v=0,m=0,f=0;this.onZoomedPointerDown=u=>{u.preventDefault(),u.stopPropagation(),a=!0,h=u.pageX,l=u.pageY,t.setPointerCapture(u.pointerId)},this.onZoomedPointerMove=u=>{if(!a)return;u.preventDefault(),m=u.pageX-h,f=u.pageY-l;const y=parseInt((t==null?void 0:t.dataset.vistaviewCurrentWidth)||"0"),p=parseInt((t==null?void 0:t.dataset.vistaviewCurrentHeight)||"0"),{maxDiffX:b,minDiffY:x,maxDiffY:g,minDiffX:I}=k(y,p),E=Math.min(b,Math.max(I,c+m)),L=Math.min(g,Math.max(x,v+f));m=E-c,f=L-v,t==null||t.style.setProperty("--pointer-diff-x",`${E}px`),t==null||t.style.setProperty("--pointer-diff-y",`${L}px`)},this.onZoomedPointerUp=u=>{a=!1,t.releasePointerCapture(u.pointerId),c+=m,v+=f,m=0,f=0},(r=t==null?void 0:t.parentElement)==null||r.addEventListener("pointerdown",this.onZoomedPointerDown),(d=t==null?void 0:t.parentElement)==null||d.addEventListener("pointermove",this.onZoomedPointerMove),(o=t==null?void 0:t.parentElement)==null||o.addEventListener("pointerup",this.onZoomedPointerUp);return}}}zoomIn(){var r,d,o,a,h;const t=(r=this.rootElm)==null?void 0:r.querySelector('[data-vistaview-pos="0"] .vistaview-image-highres'),i=t.width,n=t.height;t.dataset.vistaviewInitialWidth||(t.dataset.vistaviewInitialWidth=i.toString()),t.dataset.vistaviewInitialHeight||(t.dataset.vistaviewInitialHeight=n.toString()),this.setZoomed(t);const e=(t.naturalWidth||0)*this.options.maxZoomLevel;if(i&&e&&i<e){const l=Math.min(i+this.options.zoomStep,e);t.style.width=`${l}px`;const c=l/i*n;t.style.height=`${c}px`,(o=(d=this.rootElm)==null?void 0:d.querySelector("button.vistaview-zoom-out-btn"))==null||o.removeAttribute("disabled"),t.dataset.vistaviewCurrentWidth=l.toString(),t.dataset.vistaviewCurrentHeight=c.toString(),l===e&&((h=(a=this.rootElm)==null?void 0:a.querySelector("button.vistaview-zoom-in-btn"))==null||h.setAttribute("disabled","true"))}}zoomOut(){var d,o,a,h,l;const t=(d=this.rootElm)==null?void 0:d.querySelector('[data-vistaview-pos="0"] .vistaview-image-highres'),i=t.width,n=t.height,e=t.dataset.vistaviewInitialWidth?parseInt(t.dataset.vistaviewInitialWidth):0,r=c=>{c.target===t&&(t.classList.remove("vistaview-image--zooming-out"),t.removeEventListener("transitionend",r))};if(t.addEventListener("transitionend",r),t.classList.add("vistaview-image--zooming-out"),i&&e&&i>e){const c=Math.max(i-this.options.zoomStep,e);t.style.width=`${c}px`;const v=c/i*n;t.style.height=`${v}px`,(a=(o=this.rootElm)==null?void 0:o.querySelector("button.vistaview-zoom-in-btn"))==null||a.removeAttribute("disabled"),t.dataset.vistaviewCurrentWidth=c.toString(),t.dataset.vistaviewCurrentHeight=v.toString();const{maxDiffX:m,minDiffY:f,maxDiffY:u,minDiffX:y}=k(c,v);let p=parseInt((t==null?void 0:t.style.getPropertyValue("--pointer-diff-x").replace("px",""))||"0"),b=parseInt((t==null?void 0:t.style.getPropertyValue("--pointer-diff-y").replace("px",""))||"0");p=Math.min(m,Math.max(y,p)),b=Math.min(u,Math.max(f,b)),t==null||t.style.setProperty("--pointer-diff-x",`${p}px`),t==null||t.style.setProperty("--pointer-diff-y",`${b}px`),c===e&&((l=(h=this.rootElm)==null?void 0:h.querySelector("button.vistaview-zoom-out-btn"))==null||l.setAttribute("disabled","true"),t.removeAttribute("data-vistaview-current-width"),t.removeAttribute("data-vistaview-current-height"),t.removeAttribute("data-vistaview-initial-width"),t.removeAttribute("data-vistaview-initial-height"),this.setZoomed(!1))}}clearZoom(){}getImages(t){return t.map((i,n)=>{const e=this.elements[i];if(e instanceof HTMLElement){const r=e.querySelector("img"),d=e.getAttribute("href")||"",o=e.getAttribute("src")||"",a=e.dataset.vistaviewSrc||d||o||(r==null?void 0:r.src)||"",h=e.dataset.vistaviewAlt||e.getAttribute("alt")||(r==null?void 0:r.alt)||"",l=e.dataset.vistaviewThumb||(r==null?void 0:r.src)||d||o||"";return{index:t[n],src:a,alt:h,thumb:l,imageElm:e instanceof HTMLImageElement?e:r,anchorElm:e instanceof HTMLAnchorElement?e:void 0}}else return{index:t[n],...e}})}setInitialDimPos(){var h,l;if(!this.rootElm)return;const t=(h=this.rootElm.querySelector('[data-vistaview-pos="0"]'))==null?void 0:h.dataset.vistaviewIndex,i=((l=this.currentImages)==null?void 0:l.find(c=>c.index===Number(t)))||null;if(!i)return;const n=i.imageElm?R(i.imageElm):void 0,e=i.anchorElm?R(i.anchorElm):void 0,r=(e==null?void 0:e.width)||(n==null?void 0:n.width)||0,d=(e==null?void 0:e.height)||(n==null?void 0:n.height)||0,o=((e==null?void 0:e.left)||(n==null?void 0:n.left)||0)+r/2,a=((e==null?void 0:e.top)||(n==null?void 0:n.top)||0)+d/2;this.rootElm.style.setProperty("--vistaview-container-initial-width",r+"px"),this.rootElm.style.setProperty("--vistaview-container-initial-height",d+"px"),this.rootElm.style.setProperty("--vistaview-container-initial-top",a+"px"),this.rootElm.style.setProperty("--vistaview-container-initial-left",o+"px"),this.rootElm.style.setProperty("--vistaview-image-border-radius",H(e==null?void 0:e.borderRadius)||H(n==null?void 0:n.borderRadius)||"0px")}updateZoomButtonsVisibility(){var e;const t=(e=this.rootElm)==null?void 0:e.querySelector('[data-vistaview-pos="0"] img.vistaview-image-highres');if(!t)return;const i=this;function n(){var l,c;const r=(l=i.rootElm)==null?void 0:l.querySelector("button.vistaview-zoom-in-btn"),d=(c=i.rootElm)==null?void 0:c.querySelector("button.vistaview-zoom-out-btn"),o=parseInt(t.style.width)||t.width,a=t.naturalWidth*i.options.maxZoomLevel,h=o<a&&a>0;r&&(r.style.display=h?"":"none"),d&&(d.style.display=h?"":"none")}t.complete&&t.naturalWidth>0?n():t.addEventListener("load",n)}loadImages(){if(!this.rootElm)return;this.rootElm.querySelectorAll(".vistaview-image-highres:not(.vistaview-image-loaded)").forEach((i,n)=>{const e=i,d=this.currentImages[n].imageElm,o={w:0,h:0};if(d){const{width:h,height:l}=j(d);o.w=Math.min(d.width,h),o.h=Math.min(d.height,l)}const a=()=>{var l;const h=()=>{var c;o.w&&o.h&&(e.style.width=`${o.w}px`,e.style.height=`${o.h}px`,e.style.setProperty("--vistaview-fitted-width",`${o.w}px`),e.style.setProperty("--vistaview-fitted-height",`${o.h}px`)),e.classList.add("vistaview-image-loaded"),e.width=e.naturalWidth,e.height=e.naturalHeight,setTimeout(()=>{var y,p;let v=0;const m=()=>{var b,x;v++,!(v<3)&&(e.removeEventListener("transitionend",m),(x=(b=e.parentElement)==null?void 0:b.querySelector(".vistaview-image-lowres"))==null||x.classList.add("vistaview-image--hidden"),e.classList.add("vistaview-image-settled"))};e.addEventListener("transitionend",m);const{width:f,height:u}=q(e);e.style.width=`${f}px`,e.style.height=`${u}px`,o.w&&o.h&&f===o.w&&u===o.h?((p=(y=e.parentElement)==null?void 0:y.querySelector(".vistaview-image-lowres"))==null||p.classList.add("vistaview-image--hidden"),e.classList.add("vistaview-image-settled")):(e.style.width=`${f}px`,e.style.height=`${u}px`)},100),(c=i.parentElement)!=null&&c.matches('[data-vistaview-pos="0"]')&&this.updateZoomButtonsVisibility()};if((l=this.rootElm)!=null&&l.classList.contains("vistaview--opened"))h();else{const c=setInterval(()=>{var v;(v=this.rootElm)!=null&&v.classList.contains("vistaview--opened")&&(clearInterval(c),h())},50)}};e.complete&&e.naturalWidth>0?a():e.onload=a})}setIndexDisplay(){this.elements.length!==1&&(this.rootElm.querySelector(".vistaview-index-display").textContent=`${this.currentIndex.value+1} / ${this.elements.length}`)}setCurrentDescription(){this.rootElm.querySelector(".vistaview-description").textContent=(this.currentImages[1]||this.currentImages[0]).alt||""}getCurrentIndexes(t){const i=this.options.preloads,n=this.elements.length,e=n<1||!i?[t]:[...new Set([...Array.from({length:i},(d,o)=>((t-i+o)%n+n)%n),t,...Array.from({length:i},(d,o)=>(t+1+o)%n)])],r=n<1||!i?[0]:e.map((d,o)=>o-Math.floor(e.length/2));return{images:e,positions:r}}setKeyboardListeners(){this.onKeyDown=t=>{switch(t.key){case"ArrowLeft":t.preventDefault(),this.prev();break;case"ArrowRight":t.preventDefault(),this.next();break;case"ArrowUp":t.preventDefault(),this.zoomIn();break;case"ArrowDown":t.preventDefault(),this.zoomOut();break;case"Escape":t.preventDefault(),this.close();break}},window.addEventListener("keydown",this.onKeyDown)}setResizeListeners(){this.onResizeHandler=()=>{var i;this.setInitialDimPos();const t=(i=this.rootElm)==null?void 0:i.querySelectorAll(".vistaview-image-highres.vistaview-image-loaded");t==null||t.forEach(n=>{const e=n,{width:r,height:d}=q(e);e.classList.contains("vistaview-image--zooming")?(e.dataset.vistaviewInitialWidth=r.toString(),e.dataset.vistaviewInitialHeight=d.toString()):(e.style.width=`${r}px`,e.style.height=`${d}px`)})},window.addEventListener("resize",this.onResizeHandler)}open(t=0){var o,a,h,l,c,v,m,f,u,y,p,b,x;if(C.somethingOpened){console.error("VistaView: another instance is already opened. Returning.");return}if(C.somethingOpened=this,this.currentIndex._value=t,document.body.prepend(st({controls:this.options.controls,isReducedMotion:this.isReducedMotion})),this.rootElm=document.querySelector("#vistaview-root"),this.imageContainerElm=((o=this.rootElm)==null?void 0:o.querySelector(".vistaview-image-container"))||null,!this.rootElm||!this.imageContainerElm)throw C.somethingOpened=null,new Error("Failed to create VistaView element");this.options.arrowOnSmallScreens||this.rootElm.classList.add("vistaview-no-arrows-sm");const{images:i,positions:n}=this.getCurrentIndexes(t);this.currentImages=this.getImages(i);const e=this.currentImages.map((g,I)=>W(g,n[I]));this.currentItems=e;const r={htmlElements:{from:null,to:this.currentItems},images:{from:null,to:this.currentImages},index:{from:null,to:t},via:this.currentIndex.via,container:this.imageContainerElm,elements:this.elements,isReducedMotion:this.isReducedMotion,navActive:this.navActive,isZoomed:this.isZoomed,options:this.options};this.userSetup(r),this.imageContainerElm.innerHTML="",this.currentItems.forEach(g=>{this.imageContainerElm.appendChild(g)});let d=0;this.rootElm.addEventListener("animationend",g=>{var I;g.currentTarget===this.rootElm&&(d++,d>=2&&((I=this.rootElm)==null||I.classList.add("vistaview--opened")))}),(a=this.rootElm.querySelector(".vistaview-close-btn"))==null||a.addEventListener("click",()=>this.close()),(h=this.rootElm.querySelector(".vistaview-zoom-in-btn"))==null||h.addEventListener("click",()=>this.zoomIn()),(l=this.rootElm.querySelector(".vistaview-zoom-out-btn"))==null||l.addEventListener("click",()=>this.zoomOut()),(c=this.rootElm.querySelector(".vistaview-prev-btn>button"))==null||c.addEventListener("click",()=>this.prev()),(v=this.rootElm.querySelector(".vistaview-next-btn>button"))==null||v.addEventListener("click",()=>this.next()),[...this.options.controls.topLeft||[],...this.options.controls.topRight||[],...this.options.controls.topCenter||[],...this.options.controls.bottomCenter||[],...this.options.controls.bottomLeft||[],...this.options.controls.bottomRight||[]].forEach(g=>{typeof g!="string"&&(this.customControls[g.name]=g)}),this.rootElm.querySelectorAll("button[data-vistaview-custom-control]").forEach(g=>{g.addEventListener("click",I=>{const E=this.customControls[I.currentTarget.dataset.vistaviewCustomControl],L=this.currentImages.find(S=>S.index===this.currentIndex.value);E&&L&&(E.onClick.constructor.name==="AsyncFunction"?(g.classList.add("vistaview-button--loading"),E.onClick(L).finally(()=>{g.classList.remove("vistaview-button--loading")})):E.onClick(L))})}),this.options.animationDurationBase&&this.rootElm.style.setProperty("--vistaview-animation-duration",`${this.options.animationDurationBase}`),this.options.initialZIndex!==void 0&&this.rootElm.style.setProperty("--vistaview-initial-z-index",`${this.options.initialZIndex}`),this.setInitialDimPos(),this.setResizeListeners(),this.options.keyboardListeners&&this.setKeyboardListeners(),this.elements.length===1&&((m=this.rootElm.querySelector(".vistaview-prev-btn"))==null||m.classList.add("vistaview-ui--none"),(f=this.rootElm.querySelector(".vistaview-next-btn"))==null||f.classList.add("vistaview-ui--none"),(u=this.rootElm.querySelector(".vistaview-index-display"))==null||u.classList.add("vistaview-ui--none")),this.rootElm&&this.rootElm.classList.add("vistaview--initialized"),this.loadImages(),this.setCurrentDescription(),this.setIndexDisplay(),this.userInit(this),(p=(y=this.options).onOpen)==null||p.call(y,r),(x=(b=this.options).onImageView)==null||x.call(b,r)}async close(t=!0){var n,e,r;if(C.somethingOpened!==this)return;t&&((n=this.rootElm)==null||n.classList.add("vistaview--closing"),await new Promise(d=>{var a;let o;(a=this.rootElm)==null||a.addEventListener("transitionend",h=>{h.currentTarget===this.rootElm&&(o&&clearTimeout(o),o=setTimeout(()=>{d()},333))})}));const i={htmlElements:{from:this.currentItems,to:null},images:{from:this.currentImages,to:null},index:{from:this.currentIndex.value,to:null},container:this.imageContainerElm,elements:this.elements,via:{prev:!1,next:!1},isReducedMotion:this.isReducedMotion,navActive:this.navActive,isZoomed:this.isZoomed,options:this.options};this.userClose(this),(r=(e=this.options).onClose)==null||r.call(e,i),document.body.removeChild(this.rootElm),this.currentIndex._value=null,this.currentIndex._via={next:!1,prev:!1},this.rootElm=null,this.imageContainerElm=null,this.currentImages=null,this.currentItems=null,this.navActive=!0,this.onResizeHandler&&(window.removeEventListener("resize",this.onResizeHandler),this.onResizeHandler=null),this.onKeyDown&&(window.removeEventListener("keydown",this.onKeyDown),this.onKeyDown=null),(this.onZoomedPointerDown||this.onZoomedPointerMove||this.onZoomedPointerUp)&&(this.setZoomed(!1),this.onZoomedPointerDown=null,this.onZoomedPointerMove=null,this.onZoomedPointerUp=null);for(const d in this.transitionAbortControllers)this.transitionAbortControllers[d].abort();this.transitionAbortControllers={},C.somethingOpened=null}destroy(){this.close(!1),this.elements instanceof NodeList&&this.elements.forEach(t=>{t.dataset.vistaviewIndex&&delete t.dataset.vistaviewIndex,t.removeEventListener("click",this.defaultOnClickHandler),t.removeEventListener("pointerup",this.onClickElements)})}view(t,i){C.somethingOpened===this&&this.navActive&&(t<0&&(t=this.elements.length-1),t>=this.elements.length&&(t=0),this.currentIndex.via=i||{next:!1,prev:!1},this.currentIndex.value=t)}next(){C.somethingOpened===this&&this.view(this.currentIndex.value+1,{next:!0,prev:!1})}prev(){C.somethingOpened===this&&this.view(this.currentIndex.value-1,{next:!1,prev:!0})}getCurrentIndex(){return C.somethingOpened===this?this.currentIndex.value:-1}}function rt(s){let t=null;if(typeof s=="string"?t=document.querySelectorAll(s):s instanceof NodeList&&(t=s),t)for(let i=0;i<t.length;i++){const n=t[i];if(!(n.dataset.vistaviewSrc||n.getAttribute("href")||n.getAttribute("src")||""))return`Element at index ${i} is missing 'src' / 'data-vistaview-src' / 'href' attribute.`}else{const i=s;for(let n=0;n<i.length;n++)if(!i[n].src)return`Element at index ${n} is missing 'src' attribute.`}return t||s}function at({elements:s,...t}){if(!s)throw new Error("No elements");let i=rt(s);if(typeof i=="string")return console.error(i),console.warn("VistaView: silently returning."),null;const n=new ot(i,t);return{open:(e=0)=>n.open(e),close:()=>n.close(),next:()=>n.next(),prev:()=>n.prev(),destroy:()=>n.destroy(),getCurrentIndex:()=>n.getCurrentIndex(),view:e=>{n.view(e)}}}exports.DefaultOptions=z;exports.VistaViewTransitionAbortedError=D;exports.defaultClose=F;exports.defaultInit=Y;exports.defaultSetup=_;exports.defaultTransition=B;exports.removeTouchActions=T;exports.setTouchActions=X;exports.vistaView=at;exports.vistaViewDownload=V;
|
package/dist/vistaview.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--vistaview-bg-color: #000000;--vistaview-text-color: #ffffff;--vistaview-background-blur: 10px;--vistaview-background-opacity: .8;--vistaview-initial-z-index: 1;--vistaview-destination-z-index: 2147483647;--vistaview-animation-duration: 333;--vistaview-center-x: 50%;--vistaview-center-y: 50%;--vistaview-container-initial-width: 0;--vistaview-container-initial-height: 0;--vistaview-container-initial-top: 0;--vistaview-container-initial-left: 0;--vistaview-image-border-radius: 0px;--vistaview-current-index: 0;--vistaview-number-elements: 0}@keyframes vistaview-pos-in{0%{top:var(--vistaview-container-initial-top);left:var(--vistaview-container-initial-left)}to{top:var(--vistaview-center-y);left:var(--vistaview-center-x)}}@keyframes vistaview-pos-out{0%{top:var(--vistaview-center-y);left:var(--vistaview-center-x)}to{top:var(--vistaview-container-initial-top);left:var(--vistaview-container-initial-left)}}@keyframes vistaview-anim-in{0%{width:var(--vistaview-container-initial-width);height:var(--vistaview-container-initial-height);background:rgb(from var(--vistaview-bg-color) r g b / 0);-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px);border-radius:var(--vistaview-image-border-radius);z-index:var(--vistaview-initial-z-index)}50%{width:var(--vistaview-container-initial-width);height:var(--vistaview-container-initial-height);background:rgb(from var(--vistaview-bg-color) r g b / 0);-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px);border-radius:0;z-index:var(--vistaview-initial-z-index)}to{z-index:var(--vistaview-destination-z-index);width:100%;height:100%;background:rgb(from var(--vistaview-bg-color) r g b / var(--vistaview-background-opacity));-webkit-backdrop-filter:blur(var(--vistaview-background-blur));backdrop-filter:blur(var(--vistaview-background-blur));border-radius:0}}@keyframes vistaview-anim-out{0%{z-index:var(--vistaview-destination-z-index);width:100%;height:100%;background:rgb(from var(--vistaview-bg-color) r g b / var(--vistaview-background-opacity));-webkit-backdrop-filter:blur(var(--vistaview-background-blur));backdrop-filter:blur(var(--vistaview-background-blur));border-radius:0}50%{width:var(--vistaview-container-initial-width);height:var(--vistaview-container-initial-height);background:rgb(from var(--vistaview-bg-color) r g b / 0);-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px);border-radius:var(--vistaview-image-border-radius);z-index:var(--vistaview-initial-z-index)}to{width:var(--vistaview-container-initial-width);height:var(--vistaview-container-initial-height);background:rgb(from var(--vistaview-bg-color) r g b / 0);-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px);border-radius:var(--vistaview-image-border-radius);z-index:var(--vistaview-initial-z-index)}}@keyframes vistaview-ui-anim-in{0%{opacity:0}50%{opacity:0}to{opacity:1}}@keyframes vistaview-ui-anim-out{0%{opacity:1}50%{opacity:1}to{opacity:0}}@keyframes vistaview-pulse{0%{opacity:1;border-radius:3px;scale:1}50%{opacity:.7;border-radius:7px;scale:.99}to{opacity:1;border-radius:3px;scale:1}}@keyframes vistaview-simple-pulse{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.vistaview-root{position:fixed;display:none;isolation:isolate;overflow:hidden;translate:-50% -50%;width:var(--vistaview-container-initial-width);height:var(--vistaview-container-initial-height);top:var(--vistaview-container-initial-top);left:var(--vistaview-container-initial-left);border-radius:var(--vistaview-image-border-radius)}.vistaview-container{position:relative;width:100%;height:100%;overflow:hidden;box-sizing:border-box;margin:0;padding:0}.vistaview-image-container{--vistaview-pointer-diff-x: 0px;--vistaview-pointer-diff-y: 0px;position:relative;top:0;left:0;margin:0;padding:0;width:100%;height:100%;overflow:hidden;touch-action:none}.vistaview-item{position:absolute;width:100%;height:100%;top:0;left:0;margin:0;padding:0;translate:var(--vistaview-pointer-diff-x) var(--vistaview-pointer-diff-y)}.vistaview-item img.vistaview-image-lowres{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.vistaview-item img.vistaview-image-lowres:has(+img.vistaview-image-loaded){animation:none}.vistaview-item img.vistaview-image-lowres.vistaview-image--hidden{opacity:0}.vistaview-item img.vistaview-image-highres{--pointer-diff-x: 0px;--pointer-diff-y: 0px;cursor:zoom-in;display:block;position:absolute;top:calc(50% + var(--pointer-diff-y));left:calc(50% + var(--pointer-diff-x));translate:-50% -50%;object-fit:cover;opacity:0;transition:width calc(var(--vistaview-animation-duration) * 1ms) ease calc(var(--vistaview-animation-duration) * .3ms),height calc(var(--vistaview-animation-duration) * 1ms) ease calc(var(--vistaview-animation-duration) * .3ms),opacity calc(var(--vistaview-animation-duration) * 1ms) ease 0ms;max-width:100%;max-height:100%}.vistaview-item img.vistaview-image-highres.vistaview-image--zooming{transition:width calc(var(--vistaview-animation-duration) * 1ms) ease 0s,height calc(var(--vistaview-animation-duration) * 1ms) ease 0s,opacity calc(var(--vistaview-animation-duration) * 1ms) ease 0s;max-width:unset;max-height:unset;cursor:grab}.vistaview-item img.vistaview-image-highres.vistaview-image--zooming:active{cursor:grabbing}.vistaview-item img.vistaview-image-highres.vistaview-image--zooming-out{transition:width calc(var(--vistaview-animation-duration) * 1ms) ease 0s,height calc(var(--vistaview-animation-duration) * 1ms) ease 0s,opacity calc(var(--vistaview-animation-duration) * 1ms) ease 0s,top .3s ease 0s,left .3s ease 0s}.vistaview-item img.vistaview-image-highres.vistaview-image-loaded{opacity:1}.vistaview-ui{opacity:0}.vistaview-ui button{background:none;color:inherit;border:none;font:inherit;cursor:pointer;outline:inherit;box-sizing:border-box;margin:0;padding:8px;border-radius:0;display:flex;align-items:center;justify-content:center;background-color:var(--vistaview-bg-color);color:var(--vistaview-text-color)}.vistaview-ui button:disabled{color:rgb(from var(--vistaview-text-color) r g b / .5);cursor:not-allowed}.vistaview-ui button:hover{background-color:hsl(from var(--vistaview-bg-color) h s calc(l + 20))}.vistaview-ui button:active{background-color:hsl(from var(--vistaview-bg-color) h s calc(l + 40))}.vistaview-ui button.vistaview-button--loading{animation:vistaview-simple-pulse .5s ease-in-out infinite}.vistaview-ui button svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.vistaview-ui.vistaview-prev-btn{position:absolute;top:50%;left:0;translate:0 -50%;display:flex;align-items:center;justify-content:center;z-index:2}.vistaview-ui.vistaview-next-btn{position:absolute;top:50%;right:0;translate:0 -50%;display:flex;align-items:center;justify-content:center;z-index:2}.vistaview-ui.vistaview-top-bar,.vistaview-ui.vistaview-bottom-bar{position:absolute;top:0;right:0;width:100%;z-index:2;display:flex;align-items:center;justify-content:space-between}.vistaview-ui.vistaview-top-bar>div,.vistaview-ui.vistaview-bottom-bar>div{display:flex}.vistaview-ui.vistaview-top-bar .vistaview-index-display,.vistaview-ui.vistaview-bottom-bar .vistaview-index-display{font-size:16px;padding:8px;background-color:var(--vistaview-bg-color);color:var(--vistaview-text-color)}.vistaview-ui.vistaview-top-bar .vistaview-description,.vistaview-ui.vistaview-bottom-bar .vistaview-description{font-size:14px;padding:8px 15px;background-color:var(--vistaview-bg-color);color:var(--vistaview-text-color);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vistaview-ui.vistaview-bottom-bar{bottom:0;top:unset}.vistaview-root.vistaview-no-arrows-sm .vistaview-ui.vistaview-prev-btn,.vistaview-root.vistaview-no-arrows-sm .vistaview-ui.vistaview-next-btn{display:none}@media screen and (min-width:768px){.vistaview-root.vistaview-no-arrows-sm .vistaview-ui.vistaview-prev-btn,.vistaview-root.vistaview-no-arrows-sm .vistaview-ui.vistaview-next-btn{display:flex}}.vistaview-root.vistaview--initialized{display:block;animation:vistaview-anim-in calc(var(--vistaview-animation-duration) * 1ms) ease-in forwards,vistaview-pos-in calc(var(--vistaview-animation-duration) * .6ms) ease-out forwards}.vistaview-root.vistaview--initialized .vistaview-ui{animation:vistaview-ui-anim-in calc(var(--vistaview-animation-duration) * 1ms) ease-out calc(var(--vistaview-animation-duration) * 1ms) forwards}.vistaview-root.vistaview--closing{animation:vistaview-pos-out calc(var(--vistaview-animation-duration) * .8ms) cubic-bezier(.7,-.4,.8,.6) forwards,vistaview-anim-out calc(var(--vistaview-animation-duration) * 1ms) ease-out forwards}.vistaview-root.vistaview--closing .vistaview-ui,.vistaview-root.vistaview--closing .vistaview-ui.vistaview-prev-btn,.vistaview-root.vistaview--closing .vistaview-ui.vistaview-next-btn{display:none}.vistaview-root.vistaview--closing img.vistaview-image-lowres{border-radius:var(--vistaview-image-border-radius)}.vistaview-root.vistaview--closing img.vistaview-image-lowres.vistaview-image--hidden{opacity:1}.vistaview-root.vistaview--closing img.vistaview-image-highres{width:var(--vistaview-fitted-width)!important;height:var(--vistaview-fitted-height)!important;transition:width calc(var(--vistaview-animation-duration) * .5ms) ease 0ms,height calc(var(--vistaview-animation-duration) * .5ms) ease 0ms,opacity calc(var(--vistaview-animation-duration) * .5ms) ease calc(var(--vistaview-animation-duration) * .5ms)}.vistaview-root.vistaview--closing img.vistaview-image-highres.vistaview-image-loaded{opacity:0}.vistaview--none{display:none!important}.vistaview--reduced-motion,.vistaview--reduced-motion *{--vistaview-animation-duration: 0;animation-name:none!important;animation-duration:0ms!important;transition-duration:0ms!important}
|
|
1
|
+
:root{--vistaview-bg-color: #000000;--vistaview-text-color: #ffffff;--vistaview-background-blur: 10px;--vistaview-background-opacity: .8;--vistaview-initial-z-index: 1;--vistaview-destination-z-index: 2147483647;--vistaview-animation-duration: 333;--vistaview-center-x: 50%;--vistaview-center-y: 50%;--vistaview-container-initial-width: 0;--vistaview-container-initial-height: 0;--vistaview-container-initial-top: 0;--vistaview-container-initial-left: 0;--vistaview-image-border-radius: 0px;--vistaview-current-index: 0;--vistaview-number-elements: 0}@keyframes vistaview-pos-in{0%{top:var(--vistaview-container-initial-top);left:var(--vistaview-container-initial-left)}to{top:var(--vistaview-center-y);left:var(--vistaview-center-x)}}@keyframes vistaview-pos-out{0%{top:var(--vistaview-center-y);left:var(--vistaview-center-x)}to{top:var(--vistaview-container-initial-top);left:var(--vistaview-container-initial-left)}}@keyframes vistaview-anim-in{0%{width:var(--vistaview-container-initial-width);height:var(--vistaview-container-initial-height);background:rgb(from var(--vistaview-bg-color) r g b / 0);-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px);border-radius:var(--vistaview-image-border-radius);z-index:var(--vistaview-initial-z-index)}50%{width:var(--vistaview-container-initial-width);height:var(--vistaview-container-initial-height);background:rgb(from var(--vistaview-bg-color) r g b / 0);-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px);border-radius:0;z-index:var(--vistaview-initial-z-index)}to{z-index:var(--vistaview-destination-z-index);width:100%;height:100%;background:rgb(from var(--vistaview-bg-color) r g b / var(--vistaview-background-opacity));-webkit-backdrop-filter:blur(var(--vistaview-background-blur));backdrop-filter:blur(var(--vistaview-background-blur));border-radius:0}}@keyframes vistaview-anim-out{0%{z-index:var(--vistaview-destination-z-index);width:100%;height:100%;background:rgb(from var(--vistaview-bg-color) r g b / var(--vistaview-background-opacity));-webkit-backdrop-filter:blur(var(--vistaview-background-blur));backdrop-filter:blur(var(--vistaview-background-blur));border-radius:0}50%{width:var(--vistaview-container-initial-width);height:var(--vistaview-container-initial-height);background:rgb(from var(--vistaview-bg-color) r g b / 0);-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px);border-radius:var(--vistaview-image-border-radius);z-index:var(--vistaview-initial-z-index)}to{width:var(--vistaview-container-initial-width);height:var(--vistaview-container-initial-height);background:rgb(from var(--vistaview-bg-color) r g b / 0);-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px);border-radius:var(--vistaview-image-border-radius);z-index:var(--vistaview-initial-z-index)}}@keyframes vistaview-ui-anim-in{0%{opacity:0}50%{opacity:0}to{opacity:1}}@keyframes vistaview-ui-anim-out{0%{opacity:1}50%{opacity:1}to{opacity:0}}@keyframes vistaview-pulse{0%{opacity:1;border-radius:3px;scale:1}50%{opacity:.7;border-radius:7px;scale:.99}to{opacity:1;border-radius:3px;scale:1}}@keyframes vistaview-simple-pulse{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.vistaview-root{position:fixed;display:none;isolation:isolate;overflow:hidden;translate:-50% -50%;width:var(--vistaview-container-initial-width);height:var(--vistaview-container-initial-height);top:var(--vistaview-container-initial-top);left:var(--vistaview-container-initial-left);border-radius:var(--vistaview-image-border-radius)}.vistaview-container{position:relative;width:100%;height:100%;overflow:hidden;box-sizing:border-box;margin:0;padding:0}.vistaview-image-container{--vistaview-pointer-diff-x: 0px;--vistaview-pointer-diff-y: 0px;position:relative;top:0;left:0;margin:0;padding:0;width:100%;height:100%;overflow:hidden;touch-action:none}.vistaview-item{position:absolute;width:100%;height:100%;top:0;left:0;margin:0;padding:0;translate:var(--vistaview-pointer-diff-x) var(--vistaview-pointer-diff-y)}.vistaview-item img.vistaview-image-lowres{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);animation:vistaview-pulse 1s ease-in-out infinite}.vistaview-item img.vistaview-image-lowres:has(+img.vistaview-image-loaded){animation:none}.vistaview-item img.vistaview-image-lowres.vistaview-image--hidden{opacity:0}.vistaview-item img.vistaview-image-highres{--pointer-diff-x: 0px;--pointer-diff-y: 0px;cursor:zoom-in;display:block;position:absolute;top:calc(50% + var(--pointer-diff-y));left:calc(50% + var(--pointer-diff-x));translate:-50% -50%;object-fit:cover;opacity:0;transition:width calc(var(--vistaview-animation-duration) * 1ms) ease calc(var(--vistaview-animation-duration) * .3ms),height calc(var(--vistaview-animation-duration) * 1ms) ease calc(var(--vistaview-animation-duration) * .3ms),opacity calc(var(--vistaview-animation-duration) * 1ms) ease 0ms;max-width:100%;max-height:100%}.vistaview-item img.vistaview-image-highres.vistaview-image--zooming{transition:width calc(var(--vistaview-animation-duration) * 1ms) ease 0s,height calc(var(--vistaview-animation-duration) * 1ms) ease 0s,opacity calc(var(--vistaview-animation-duration) * 1ms) ease 0s;max-width:unset;max-height:unset;cursor:grab}.vistaview-item img.vistaview-image-highres.vistaview-image--zooming:active{cursor:grabbing}.vistaview-item img.vistaview-image-highres.vistaview-image--zooming-out{transition:width calc(var(--vistaview-animation-duration) * 1ms) ease 0s,height calc(var(--vistaview-animation-duration) * 1ms) ease 0s,opacity calc(var(--vistaview-animation-duration) * 1ms) ease 0s,top .3s ease 0s,left .3s ease 0s}.vistaview-item img.vistaview-image-highres.vistaview-image-loaded{opacity:1}.vistaview-ui{opacity:0}.vistaview-ui button{background:none;color:inherit;border:none;font:inherit;cursor:pointer;outline:inherit;box-sizing:border-box;margin:0;padding:8px;border-radius:0;display:flex;align-items:center;justify-content:center;background-color:var(--vistaview-bg-color);color:var(--vistaview-text-color)}.vistaview-ui button:disabled{color:rgb(from var(--vistaview-text-color) r g b / .5);cursor:not-allowed}.vistaview-ui button:hover{background-color:hsl(from var(--vistaview-bg-color) h s calc(l + 20))}.vistaview-ui button:active{background-color:hsl(from var(--vistaview-bg-color) h s calc(l + 40))}.vistaview-ui button.vistaview-button--loading{animation:vistaview-simple-pulse .5s ease-in-out infinite}.vistaview-ui button svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.vistaview-ui.vistaview-prev-btn{position:absolute;top:50%;left:0;translate:0 -50%;display:flex;align-items:center;justify-content:center;z-index:2}.vistaview-ui.vistaview-next-btn{position:absolute;top:50%;right:0;translate:0 -50%;display:flex;align-items:center;justify-content:center;z-index:2}.vistaview-ui.vistaview-top-bar,.vistaview-ui.vistaview-bottom-bar{position:absolute;top:0;right:0;width:100%;z-index:2;display:flex;align-items:center;justify-content:space-between}.vistaview-ui.vistaview-top-bar>div,.vistaview-ui.vistaview-bottom-bar>div{display:flex}.vistaview-ui.vistaview-top-bar .vistaview-index-display,.vistaview-ui.vistaview-bottom-bar .vistaview-index-display{font-size:16px;padding:8px;background-color:var(--vistaview-bg-color);color:var(--vistaview-text-color)}.vistaview-ui.vistaview-top-bar .vistaview-description,.vistaview-ui.vistaview-bottom-bar .vistaview-description{font-size:14px;padding:8px 15px;background-color:var(--vistaview-bg-color);color:var(--vistaview-text-color);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vistaview-ui.vistaview-bottom-bar{bottom:0;top:unset}.vistaview-root.vistaview-no-arrows-sm .vistaview-ui.vistaview-prev-btn,.vistaview-root.vistaview-no-arrows-sm .vistaview-ui.vistaview-next-btn{display:none}@media screen and (min-width:768px){.vistaview-root.vistaview-no-arrows-sm .vistaview-ui.vistaview-prev-btn,.vistaview-root.vistaview-no-arrows-sm .vistaview-ui.vistaview-next-btn{display:flex}}.vistaview-root.vistaview--initialized{display:block;animation:vistaview-anim-in calc(var(--vistaview-animation-duration) * 1ms) ease-in forwards,vistaview-pos-in calc(var(--vistaview-animation-duration) * .6ms) ease-out forwards}.vistaview-root.vistaview--initialized .vistaview-ui{animation:vistaview-ui-anim-in calc(var(--vistaview-animation-duration) * 1ms) ease-out calc(var(--vistaview-animation-duration) * 1ms) forwards}.vistaview-root.vistaview--closing{animation:vistaview-pos-out calc(var(--vistaview-animation-duration) * .8ms) cubic-bezier(.7,-.4,.8,.6) forwards,vistaview-anim-out calc(var(--vistaview-animation-duration) * 1ms) ease-out forwards}.vistaview-root.vistaview--closing .vistaview-ui,.vistaview-root.vistaview--closing .vistaview-ui.vistaview-prev-btn,.vistaview-root.vistaview--closing .vistaview-ui.vistaview-next-btn{display:none}.vistaview-root.vistaview--closing img.vistaview-image-lowres{border-radius:var(--vistaview-image-border-radius)}.vistaview-root.vistaview--closing img.vistaview-image-lowres.vistaview-image--hidden{opacity:1}.vistaview-root.vistaview--closing img.vistaview-image-highres{width:var(--vistaview-fitted-width)!important;height:var(--vistaview-fitted-height)!important;transition:width calc(var(--vistaview-animation-duration) * .5ms) ease 0ms,height calc(var(--vistaview-animation-duration) * .5ms) ease 0ms,opacity calc(var(--vistaview-animation-duration) * .5ms) ease calc(var(--vistaview-animation-duration) * .5ms)}.vistaview-root.vistaview--closing img.vistaview-image-highres.vistaview-image-loaded{opacity:0}.vistaview--none{display:none!important}.vistaview--reduced-motion,.vistaview--reduced-motion *{--vistaview-animation-duration: 0;animation-name:none!important;animation-duration:0ms!important;transition-duration:0ms!important}
|