From 8f6bc550d023bed103ced6da5ada0321e13137d1 Mon Sep 17 00:00:00 2001 From: Henry Dollman Date: Sat, 5 Aug 2023 14:17:29 -0500 Subject: [PATCH] release 1.1.9 --- dist/bigger-picture.cjs | 46 +++++++++++++++++++++---------------- dist/bigger-picture.css | 8 ++++--- dist/bigger-picture.min.js | 2 +- dist/bigger-picture.min.mjs | 2 +- dist/bigger-picture.mjs | 46 +++++++++++++++++++++---------------- dist/bigger-picture.scss | 12 +++++----- dist/bigger-picture.umd.js | 46 +++++++++++++++++++++---------------- package.json | 2 +- 8 files changed, 92 insertions(+), 72 deletions(-) diff --git a/dist/bigger-picture.cjs b/dist/bigger-picture.cjs index 1e0c749..a773a37 100644 --- a/dist/bigger-picture.cjs +++ b/dist/bigger-picture.cjs @@ -881,7 +881,7 @@ function create_if_block_1$1(ctx) { current = true; if (!mounted) { - dispose = listen(img, "error", /*error_handler*/ ctx[24]); + dispose = listen(img, "error", /*error_handler*/ ctx[26]); mounted = true; } }, @@ -908,7 +908,7 @@ function create_if_block_1$1(ctx) { }; } -// (375:10) {#if showLoader} +// (374:10) {#if showLoader} function create_if_block$1(ctx) { let loading; let current; @@ -970,8 +970,9 @@ function create_fragment$3(ctx) { set_style(div0, "width", /*$imageDimensions*/ ctx[0][0] + "px"); set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px"); set_style(div0, "transform", "translate3d(" + (/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]) + "px, " + (/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]) + "px, 0)"); + toggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]); + toggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]); attr(div1, "class", "bp-img-wrap"); - toggle_class(div1, "bp-drag", /*pointerDown*/ ctx[4]); toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]); }, m(target, anchor) { @@ -984,12 +985,12 @@ function create_fragment$3(ctx) { if (!mounted) { dispose = [ - action_destroyer(/*onMount*/ ctx[18].call(null, div0)), - listen(div1, "wheel", /*onWheel*/ ctx[13]), - listen(div1, "pointerdown", /*onPointerDown*/ ctx[14]), - listen(div1, "pointermove", /*onPointerMove*/ ctx[15]), - listen(div1, "pointerup", /*onPointerUp*/ ctx[17]), - listen(div1, "pointercancel", /*removeEventFromCache*/ ctx[16]) + action_destroyer(/*onMount*/ ctx[20].call(null, div0)), + listen(div1, "wheel", /*onWheel*/ ctx[15]), + listen(div1, "pointerdown", /*onPointerDown*/ ctx[16]), + listen(div1, "pointermove", /*onPointerMove*/ ctx[17]), + listen(div1, "pointerup", /*onPointerUp*/ ctx[19]), + listen(div1, "pointercancel", /*removeEventFromCache*/ ctx[18]) ]; mounted = true; @@ -1055,7 +1056,11 @@ function create_fragment$3(ctx) { } if (dirty[0] & /*pointerDown*/ 16) { - toggle_class(div1, "bp-drag", /*pointerDown*/ ctx[4]); + toggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]); + } + + if (dirty[0] & /*maxZoom, $imageDimensions, naturalWidth*/ 6145) { + toggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]); } if (dirty[0] & /*closingWhileZoomed*/ 32) { @@ -1088,11 +1093,11 @@ function instance$3($$self, $$props, $$invalidate) { let $zoomDragTranslate; let $closing; let $imageDimensions; - component_subscribe($$self, closing, $$value => $$invalidate(23, $closing = $$value)); + component_subscribe($$self, closing, $$value => $$invalidate(25, $closing = $$value)); let { props } = $$props; let { smallScreen } = $$props; let { activeItem, opts, prev, next, zoomed, container } = props; - component_subscribe($$self, zoomed, value => $$invalidate(22, $zoomed = value)); + component_subscribe($$self, zoomed, value => $$invalidate(24, $zoomed = value)); let maxZoom = activeItem.maxZoom || opts.maxZoom || 10; let calculatedDimensions = props.calculateDimensions(activeItem); @@ -1199,9 +1204,8 @@ function instance$3($$self, $$props, $$invalidate) { } const maxWidth = calculatedDimensions[0] * maxZoom; - const [currentImageWidth, currentImageHeight] = $imageDimensions; - let newWidth = currentImageWidth + currentImageWidth * amt; - let newHeight = currentImageHeight + currentImageHeight * amt; + let newWidth = $imageDimensions[0] + $imageDimensions[0] * amt; + let newHeight = $imageDimensions[1] + $imageDimensions[1] * amt; if (amt > 0) { if (newWidth > maxWidth) { @@ -1408,7 +1412,7 @@ function instance$3($$self, $$props, $$invalidate) { // handle globalThis resize props.setResizeFunc(() => { - $$invalidate(21, calculatedDimensions = props.calculateDimensions(activeItem)); + $$invalidate(23, calculatedDimensions = props.calculateDimensions(activeItem)); // adjust image size / zoom on resize, but not on mobile because // some browsers (ios safari 15) constantly resize screen on drag @@ -1437,15 +1441,15 @@ function instance$3($$self, $$props, $$invalidate) { $$self.$$set = $$props => { - if ('smallScreen' in $$props) $$invalidate(20, smallScreen = $$props.smallScreen); + if ('smallScreen' in $$props) $$invalidate(22, smallScreen = $$props.smallScreen); }; $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*$imageDimensions, calculatedDimensions*/ 2097153) { + if ($$self.$$.dirty[0] & /*$imageDimensions, calculatedDimensions*/ 8388609) { zoomed.set($imageDimensions[0] - 10 > calculatedDimensions[0]); } - if ($$self.$$.dirty[0] & /*$closing, $zoomed, calculatedDimensions*/ 14680064) { + if ($$self.$$.dirty[0] & /*$closing, $zoomed, calculatedDimensions*/ 58720256) { // if zoomed while closing, zoom out image and add class // to change contain value on .bp-wrap to avoid cropping if ($closing && $zoomed && !opts.intro) { @@ -1469,6 +1473,8 @@ function instance$3($$self, $$props, $$invalidate) { opts, zoomed, container, + maxZoom, + naturalWidth, imageDimensions, zoomDragTranslate, onWheel, @@ -1489,7 +1495,7 @@ function instance$3($$self, $$props, $$invalidate) { class Image extends SvelteComponent { constructor(options) { super(); - init(this, options, instance$3, create_fragment$3, not_equal, { props: 19, smallScreen: 20 }, null, [-1, -1]); + init(this, options, instance$3, create_fragment$3, not_equal, { props: 21, smallScreen: 22 }, null, [-1, -1]); } } diff --git a/dist/bigger-picture.css b/dist/bigger-picture.css index 594f0a8..31d4e6a 100644 --- a/dist/bigger-picture.css +++ b/dist/bigger-picture.css @@ -77,7 +77,10 @@ position: absolute; contain: strict; } -.bp-img-wrap.bp-drag .bp-img { +.bp-img-wrap .bp-canzoom { + cursor: zoom-in; +} +.bp-img-wrap .bp-drag { cursor: grabbing; } @@ -90,7 +93,6 @@ top: 50%; left: 50%; user-select: none; - cursor: zoom-in; background-size: 100% 100%; } .bp-img img, @@ -105,7 +107,7 @@ display: none; } -.bp-zoomed .bp-img { +.bp-zoomed .bp-img:not(.bp-drag) { cursor: grab; } .bp-zoomed .bp-cap { diff --git a/dist/bigger-picture.min.js b/dist/bigger-picture.min.js index f86a395..fcab47a 100644 --- a/dist/bigger-picture.min.js +++ b/dist/bigger-picture.min.js @@ -1 +1 @@ -var BiggerPicture=function(){function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(t){t.forEach(o)}function i(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n}function c(n,e,o){n.$$.on_destroy.push(((n,...e)=>{if(null==n)return t;const o=n.subscribe(...e);return o.unsubscribe?()=>o.unsubscribe():o})(e,o))}function u(n){return n&&i(n.destroy)?n.destroy:t}let l=()=>globalThis.performance.now(),a=t=>requestAnimationFrame(t);const p=new Set;function f(t){p.forEach((n=>{n.c(t)||(p.delete(n),n.f())})),0!==p.size&&a(f)}function d(t){let n;return 0===p.size&&a(f),{promise:new Promise((e=>{p.add(n={c:t,f:e})})),abort(){p.delete(n)}}}function m(t,n){t.appendChild(n)}function h(t,n,e){t.insertBefore(n,e||null)}function b(t){t.parentNode.removeChild(t)}function g(t){return document.createElement(t)}function x(){return document.createTextNode("")}function w(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function v(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function y(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e)}function $(t,n,e){t.classList[e?"add":"remove"](n)}let k,_,M=0,S={};function P(t,n,e,o,r,i,s,c=0){const u=16.666/o;let l="{\n";for(let t=0;1>=t;t+=u){const o=n+(e-n)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,p=`_bp_${Math.round(1e9*Math.random())}_${c}`;if(!S[p]){if(!k){const t=g("style");document.head.appendChild(t),k=t.sheet}S[p]=1,k.insertRule(`@keyframes ${p} ${a}`,k.cssRules.length)}const f=t.style.animation||"";return t.style.animation=`${f?f+", ":""}${p} ${o}ms linear ${r}ms 1 both`,M+=1,p}function z(t,n){t.style.animation=(t.style.animation||"").split(", ").filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("_bp")).join(", "),n&&!--M&&a((()=>{if(M)return;let t=k.cssRules.length;for(;t--;)k.deleteRule(t);S={}}))}function A(t){_=t}const T=[],I=[],C=[],N=[],O=Promise.resolve();let E=0;function R(t){C.push(t)}const j=new Set;let q,F=0;function B(){const t=_;do{for(;T.length>F;){const t=T[F];F++,A(t),D(t.$$)}for(A(null),T.length=0,F=0;I.length;)I.pop()();for(let t=0;C.length>t;t+=1){const n=C[t];j.has(n)||(j.add(n),n())}C.length=0}while(T.length);for(;N.length;)N.pop()();E=0,j.clear(),A(t)}function D(t){if(null!==t.t){t.update(),r(t.before_update);const n=t.u;t.u=[-1],t.t&&t.t.p(t.ctx,n),t.after_update.forEach(R)}}function J(){return q||(q=Promise.resolve(),q.then((()=>{q=null}))),q}function K(t,n,e){t.dispatchEvent(((t,n,e=0)=>{const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e,0,n),o})(`${n?"intro":"outro"}${e}`))}const L=new Set;let W;function X(){W={r:0,c:[],p:W}}function Y(){W.r||r(W.c),W=W.p}function G(t,n){t&&t.i&&(L.delete(t),t.i(n))}function H(t,n,e,o){if(t&&t.o){if(L.has(t))return;L.add(t),W.c.push((()=>{L.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const Q={duration:0};function U(e,o,r){let s,c,u=o(e,r),a=0,p=0;function f(){s&&z(e,s)}function m(){const{delay:o=0,duration:r=300,l:i=n,g:m=t,css:h}=u||Q;h&&(s=P(e,0,1,r,o,i,h,p++)),m(0,1);const b=l()+o,g=b+r;c&&c.abort(),a=1,R((()=>K(e,1,"start"))),c=d((t=>{if(a){if(t>=g)return m(1,0),K(e,1,"end"),f(),a=0;if(t>=b){const n=i((t-b)/r);m(n,1-n)}}return a}))}let h=0;return{start(){h||(h=1,z(e),i(u)?(u=u(),J().then(m)):m())},invalidate(){h=0},end(){a&&(f(),a=0)}}}function V(e,o,s){let c,u=o(e,s),a=1;const p=W;function f(){const{delay:o=0,duration:i=300,l:s=n,g:f=t,css:m}=u||Q;m&&(c=P(e,1,0,i,o,s,m));const h=l()+o,b=h+i;R((()=>K(e,0,"start"))),d((t=>{if(a){if(t>=b)return f(0,1),K(e,0,"end"),--p.r||r(p.c),0;if(t>=h){const n=s((t-h)/i);f(1-n,n)}}return a}))}return p.r+=1,i(u)?J().then((()=>{u=u(),f()})):f(),{end(t){t&&u.g&&u.g(1,0),a&&(c&&z(e,c),a=0)}}}function Z(t){t&&t.c()}function tt(t,n,e,s){const{t:c,on_mount:u,on_destroy:l,after_update:a}=t.$$;c&&c.m(n,e),s||R((()=>{const n=u.map(o).filter(i);l?l.push(...n):r(n),t.$$.on_mount=[]})),a.forEach(R)}function nt(t,n){const e=t.$$;null!==e.t&&(r(e.on_destroy),e.t&&e.t.d(n),e.on_destroy=e.t=null,e.ctx=[])}function et(n,e,o,i,s,c,u,l=[-1]){const a=_;A(n);const p=n.$$={t:null,ctx:null,v:c,update:t,not_equal:s,bound:{},on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:{},u:l,skip_bound:0,root:e.target||a.$$.root};u&&u(p.root);let f=0;p.ctx=o?o(n,e.v||{},((t,e,...o)=>{const r=o.length?o[0]:e;return p.ctx&&s(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),f&&((t,n)=>{-1===t.$$.u[0]&&(T.push(t),E||(E=1,O.then(B)),t.$$.u.fill(0)),t.$$.u[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){this.$$set&&0!==Object.keys(t).length&&(this.$$.skip_bound=1,this.$$set(t),this.$$.skip_bound=0)}}function rt(t){const n=t-1;return n*n*n+1}function it(t,{delay:n=0,duration:e=400,l:o=rt,x:r=0,y:i=0,opacity:s=0}={}){const c=getComputedStyle(t),u=+c.opacity,l="none"===c.transform?"":c.transform,a=u*(1-s);return{delay:n,duration:e,l:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*r}px, ${(1-t)*i}px);\n\t\t\topacity: ${u-a*n}`}}}const st=[];function ct(n,e=t){let o;const r=new Set;function i(t){if(s(n,t)&&(n=t,o)){const t=!st.length;for(const t of r)t[1](),st.push(t,n);if(t){for(let t=0;st.length>t;t+=2)st[t][0](st[t+1]);st.length=0}}}return{set:i,update(t){i(t(n))},subscribe(s,c=t){const u=[s,c];return r.add(u),1===r.size&&(o=e(i)||t),s(n),()=>{r.delete(u),0===r.size&&(o(),o=null)}}}}function ut(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>ut(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function lt(t,o={}){const r=ct(t);let i,s=t;function c(c,u){if(null==t)return r.set(t=c),Promise.resolve();s=c;let a=i,p=0,{delay:f=0,duration:m=400,l:h=n,interpolate:b=ut}=e(e({},o),u);if(0===m)return a&&(a.abort(),a=null),r.set(t=s),Promise.resolve();const g=l()+f;let x;return i=d((n=>{if(g>n)return 1;p||(x=b(t,c),"function"==typeof m&&(m=m(t,c)),p=1),a&&(a.abort(),a=null);const e=n-g;return e>m?(r.set(t=c),0):(r.set(t=x(h(e/m))),1)})),i.promise}return{set:c,update(n,e){return c(n(s,t),e)},subscribe:r.subscribe}}const at=ct(0),pt=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches,ft=t=>({l:rt,duration:pt?0:t});function dt(t){let n,e,o,r,i=!t[2]&&mt();return{c(){n=g("div"),i&&i.c(),v(n,"class","bp-load"),y(n,"background-image","url("+t[0]+")")},m(t,e){h(t,n,e),i&&i.m(n,null),r=1},p(e,o){(t=e)[2]?i&&(i.d(1),i=null):i||(i=mt(),i.c(),i.m(n,null)),(!r||1&o)&&y(n,"background-image","url("+t[0]+")")},i(i){r||(R((()=>{o&&o.end(1),e=U(n,it,{duration:t[1]?400:0}),e.start()})),r=1)},o(t){e&&e.invalidate(),t&&(o=V(n,it,{duration:480})),r=0},d(t){t&&b(n),i&&i.d(),t&&o&&o.end()}}}function mt(t){let n,e;return{c(){n=g("span"),e=g("span"),v(n,"class","bp-bar"),v(e,"class","bp-o")},m(t,o){h(t,n,o),h(t,e,o)},d(t){t&&b(n),t&&b(e)}}}function ht(t){let n,e=(!t[1]||t[2])&&dt(t);return{c(){e&&e.c(),n=x()},m(t,o){e&&e.m(t,o),h(t,n,o)},p(t,[o]){!t[1]||t[2]?e?(e.p(t,o),6&o&&G(e,1)):(e=dt(t),e.c(),G(e,1),e.m(n.parentNode,n)):e&&(X(),H(e,1,1,(()=>{e=null})),Y())},i(t){G(e)},o(t){H(e)},d(t){e&&e.d(t),t&&b(n)}}}function bt(t,n,e){let o;c(t,at,(t=>e(2,o=t)));let{thumb:r}=n,{loaded:i}=n;return t.$$set=t=>{"thumb"in t&&e(0,r=t.thumb),"loaded"in t&&e(1,i=t.loaded)},[r,i,o]}class gt extends ot{constructor(t){super(),et(this,t,bt,ht,s,{thumb:0,loaded:1})}}function xt(t){let n,e,o,r,i,s,c,u;return{c(){n=g("img"),v(n,"srcset",e=t[7].img),v(n,"sizes",o=t[8].sizes||t[1]+"px"),v(n,"alt",r=t[7].alt)},m(e,o){h(e,n,o),s=1,c||(u=w(n,"error",t[24]),c=1)},p(t,e){(!s||2&e[0]&&o!==(o=t[8].sizes||t[1]+"px"))&&v(n,"sizes",o)},i(t){s||(i&&i.end(1),s=1)},o(t){i=V(n,it,{}),s=0},d(t){t&&b(n),t&&i&&i.end(),c=0,u()}}}function wt(t){let n,e;return n=new gt({v:{thumb:t[7].thumb,loaded:t[2]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};4&e[0]&&(o.loaded=t[2]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function vt(t){let n,e,o,i,s,c,l=t[2]&&xt(t),a=t[3]&&wt(t);return{c(){n=g("div"),e=g("div"),l&&l.c(),o=x(),a&&a.c(),v(e,"class","bp-img"),y(e,"background-image","url("+t[7].thumb+")"),y(e,"width",t[0][0]+"px"),y(e,"height",t[0][1]+"px"),y(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),v(n,"class","bp-img-wrap"),$(n,"bp-drag",t[4]),$(n,"bp-close",t[5])},m(r,p){h(r,n,p),m(n,e),l&&l.m(e,null),m(e,o),a&&a.m(e,null),i=1,s||(c=[u(t[18].call(null,e)),w(n,"wheel",t[13]),w(n,"pointerdown",t[14]),w(n,"pointermove",t[15]),w(n,"pointerup",t[17]),w(n,"pointercancel",t[16])],s=1)},p(t,r){t[2]?l?(l.p(t,r),4&r[0]&&G(l,1)):(l=xt(t),l.c(),G(l,1),l.m(e,o)):l&&(X(),H(l,1,1,(()=>{l=null})),Y()),t[3]?a?(a.p(t,r),8&r[0]&&G(a,1)):(a=wt(t),a.c(),G(a,1),a.m(e,null)):a&&(X(),H(a,1,1,(()=>{a=null})),Y()),(!i||1&r[0])&&y(e,"width",t[0][0]+"px"),(!i||1&r[0])&&y(e,"height",t[0][1]+"px"),(!i||65&r[0])&&y(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),16&r[0]&&$(n,"bp-drag",t[4]),32&r[0]&&$(n,"bp-close",t[5])},i(t){i||(G(l),G(a),i=1)},o(t){H(l),H(a),i=0},d(t){t&&b(n),l&&l.d(),a&&a.d(),s=0,r(c)}}}function yt(t,n,e){let o,r,i,s;c(t,at,(t=>e(23,i=t)));let{v:u}=n,{$:l}=n,{k:a,_:p,M:f,next:d,zoomed:m,container:h}=u;c(t,m,(t=>e(22,o=t)));let b,g,x,w,v,y,$,k,_,M,S,P=a.maxZoom||p.maxZoom||10,z=u.S(a),A=z[0],T=0;const I=+a.width,C=[],N=new Map,O=lt(z,ft(400));c(t,O,(t=>e(0,s=t)));const E=lt([0,0],ft(400));c(t,E,(t=>e(6,r=t)));const R=([t,n],o=s)=>{const r=(o[0]-h.w)/2,i=(o[1]-h.h)/2;return 0>r?t=0:t>r?l?(t=v?r+(t-r)/10:r)>r+20&&e(4,v=f()):t=r:-r>t&&(l?-r-20>(t=v?-r-(-r-t)/10:-r)&&e(4,v=d()):t=-r),0>i?n=0:n>i?n=i:-i>n&&(n=-i),[t,n]};function j(t=P,n){if(i)return;const o=z[0]*P,[c,u]=s;let l=c+c*t,p=u+u*t;if(t>0)l>o&&(l=o,p=z[1]*P),l>I&&(l=I,p=+a.height);else if(z[0]>l)return O.set(z),E.set([0,0]);let{x:f,y:d,width:m,height:h}=w.getBoundingClientRect();const b=n?n.clientX-f-m/2:0,g=n?n.clientY-d-h/2:0;f=l/m*-b+b,d=p/h*-g+g;const x=[l,p];O.set(x).then((()=>{e(1,A=Math.round(Math.max(A,l)))})),E.set(R([r[0]+f,r[1]+d],x))}Object.defineProperty(a,"zoom",{configurable:1,get(){return o},set(t){return j(t?P:-P)}});const q=t=>N.delete(t.pointerId);return t.$$set=t=>{"$"in t&&e(20,l=t.$)},t.$$.update=()=>{if(2097153&t.$$.u[0]&&m.set(s[0]-10>z[0]),14680064&t.$$.u[0]&&i&&o&&!p.intro){const t=ft(480);E.set([0,0],t),O.set(z,t),e(5,S=1)}},[s,A,b,g,v,S,r,a,p,m,h,O,E,t=>{p.inline&&!o||(t.preventDefault(),j(t.deltaY/-300,t))},t=>{2!==t.button&&(t.preventDefault(),e(4,v=1),N.set(t.pointerId,t),$=t.clientX,k=t.clientY,_=r[0],M=r[1])},t=>{if(N.size>1)return e(4,v=0),p.noPinch?.(h.el)||(t=>{const[n,e]=N.set(t.pointerId,t).values(),o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);x=x||{clientX:(n.clientX+e.clientX)/2,clientY:(n.clientY+e.clientY)/2},j(((T||o)-o)/-35,x),T=o})(t);if(!v)return;let n=t.clientX,r=t.clientY;y=C.push({x:n,y:r})>2,n-=$,r-=k,o||(-90>r&&e(4,v=!p.noClose&&u.close()),30>Math.abs(r)&&(n>40&&e(4,v=f()),-40>n&&e(4,v=d()))),o&&y&&!i&&E.set(R([_+n,M+r]),{duration:0})},q,function(t){if(q(t),x&&(e(4,v=T=0),x=N.size?x:null),v){if(e(4,v=0),t.target===this&&!p.noClose)return u.close();if(y){const[t,n,e]=C.slice(-3);Math.hypot(n.x-e.x,n.y-e.y)>5&&E.set(R([r[0]-5*(t.x-e.x),r[1]-5*(t.y-e.y)]))}else p.onImageClick?.(h.el,a)||j(o?-P:P,t);y=0,C.length=0}},t=>{w=t,u.P((()=>{e(21,z=u.S(a)),!p.inline&&l||(O.set(z),E.set([0,0]))})),u.A(a).then((()=>{e(2,b=1),u.T()})),setTimeout((()=>{e(3,g=!b)}),250)},u,l,z,o,i,t=>p.onError?.(h,a,t)]}class $t extends ot{constructor(t){super(),et(this,t,yt,vt,s,{v:19,$:20},null,[-1,-1])}}function kt(t){let n,e,o,i,s,c;return o=new gt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=g("div"),e=g("iframe"),Z(o.$$.t),v(e,"allow","autoplay; fullscreen"),v(e,"title",t[2].title),v(n,"class","bp-if"),y(n,"width",t[1][0]+"px"),y(n,"height",t[1][1]+"px")},m(r,l){h(r,n,l),m(n,e),tt(o,n,null),i=1,s||(c=[u(t[3].call(null,e)),w(e,"load",t[5])],s=1)},p(t,[e]){const r={};1&e&&(r.loaded=t[0]),o.$set(r),(!i||2&e)&&y(n,"width",t[1][0]+"px"),(!i||2&e)&&y(n,"height",t[1][1]+"px")},i(t){i||(G(o.$$.t,t),i=1)},o(t){H(o.$$.t,t),i=0},d(t){t&&b(n),nt(o),s=0,r(c)}}}function _t(t,n,e){let o,r,{v:i}=n;const{k:s}=i,c=()=>e(1,r=i.S(s));return c(),i.P(c),[o,r,s,t=>t.src=s.iframe,i,()=>e(0,o=1)]}class Mt extends ot{constructor(t){super(),et(this,t,_t,kt,s,{v:4})}}function St(t){let n,e,o,r,i;return e=new gt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=g("div"),Z(e.$$.t),v(n,"class","bp-vid"),y(n,"width",t[1][0]+"px"),y(n,"height",t[1][1]+"px"),y(n,"background-image","url("+t[2].thumb+")")},m(s,c){h(s,n,c),tt(e,n,null),o=1,r||(i=u(t[3].call(null,n)),r=1)},p(t,[r]){const i={};1&r&&(i.loaded=t[0]),e.$set(i),(!o||2&r)&&y(n,"width",t[1][0]+"px"),(!o||2&r)&&y(n,"height",t[1][1]+"px")},i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){t&&b(n),nt(e),r=0,i()}}}function Pt(t,n,e){let o,r,{v:i}=n;const{k:s,_:c,container:u}=i,l=()=>e(1,r=i.S(s));l(),i.P(l);const a=(t,n)=>{for(const e in n)v(t,e,n[e])};return[o,r,s,t=>{let n;const r=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e));for(const o of e){n||(n=g(o.type?.includes("audio")?"audio":"video"),a(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"}));const e=g(t);a(e,o),"source"==t&&w(e,"error",(t=>c.onError?.(u,s,t))),m(n,e)}};r("source",s.sources),r("track",s.tracks||[]),w(n,"canplay",(()=>e(0,o=1))),m(t,n)},i]}class zt extends ot{constructor(t){super(),et(this,t,Pt,St,s,{v:4})}}function At(n){let e,o,i,c,l,a,p,f,d,x,y=n[6].i,k=Et(n),_=n[0].length>1&&Rt(n);return{c(){e=g("div"),o=g("div"),k.c(),c=g("div"),l=g("button"),_&&_.c(),v(l,"class","bp-x"),v(l,"title","Close"),v(l,"aria-label","Close"),v(c,"class","bp-controls"),v(e,"class","bp-wrap"),$(e,"bp-zoomed",n[10]),$(e,"bp-inline",n[8]),$(e,"bp-small",n[7]),$(e,"bp-noclose",n[5].noClose)},m(t,r){h(t,e,r),m(e,o),k.m(e,null),m(e,c),m(c,l),_&&_.m(c,null),f=1,d||(x=[w(l,"click",n[1]),u(p=n[14].call(null,e))],d=1)},p(n,o){64&o[0]&&s(y,y=n[6].i)?(X(),H(k,1,1,t),Y(),k=Et(n),k.c(),G(k),k.m(e,c)):k.p(n,o),n[0].length>1?_?_.p(n,o):(_=Rt(n),_.c(),_.m(c,null)):_&&(_.d(1),_=null),1024&o[0]&&$(e,"bp-zoomed",n[10]),256&o[0]&&$(e,"bp-inline",n[8]),128&o[0]&&$(e,"bp-small",n[7]),32&o[0]&&$(e,"bp-noclose",n[5].noClose)},i(t){f||(i&&i.end(1),G(k),a&&a.end(1),f=1)},o(t){i=V(o,it,{duration:480}),H(k),a=V(c,it,{}),f=0},d(t){t&&b(e),t&&i&&i.end(),k.d(t),_&&_.d(),t&&a&&a.end(),d=0,r(x)}}}function Tt(n){let e,o=n[6].html+"";return{c(){e=g("div"),v(e,"class","bp-html")},m(t,n){h(t,e,n),e.innerHTML=o},p(t,n){64&n[0]&&o!==(o=t[6].html+"")&&(e.innerHTML=o)},i:t,o:t,d(t){t&&b(e)}}}function It(n){let e,o;return e=new Mt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Ct(n){let e,o;return e=new zt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Nt(t){let n,e;return n=new $t({v:{v:t[13](),$:t[7]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.$=t[7]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function Ot(t){let n,e,o,r=t[6].caption+"";return{c(){n=g("div"),v(n,"class","bp-cap")},m(t,e){h(t,n,e),n.innerHTML=r,o=1},p(t,e){(!o||64&e[0])&&r!==(r=t[6].caption+"")&&(n.innerHTML=r)},i(t){o||(e&&e.end(1),o=1)},o(t){e=V(n,it,{duration:200}),o=0},d(t){t&&b(n),t&&e&&e.end()}}}function Et(t){let n,e,o,i,s,c,u,l,a;const p=[Nt,Ct,It,Tt],f=[];function d(t,n){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}e=d(t),o=f[e]=p[e](t);let m=t[6].caption&&Ot(t);return{c(){n=g("div"),o.c(),m&&m.c(),c=x(),v(n,"class","bp-inner")},m(o,r){h(o,n,r),f[e].m(n,null),m&&m.m(o,r),h(o,c,r),u=1,l||(a=[w(n,"pointerdown",t[21]),w(n,"pointerup",t[22])],l=1)},p(t,r){let i=e;e=d(t),e===i?f[e].p(t,r):(X(),H(f[i],1,1,(()=>{f[i]=null})),Y(),o=f[e],o?o.p(t,r):(o=f[e]=p[e](t),o.c()),G(o,1),o.m(n,null)),t[6].caption?m?(m.p(t,r),64&r[0]&&G(m,1)):(m=Ot(t),m.c(),G(m,1),m.m(c.parentNode,c)):m&&(X(),H(m,1,1,(()=>{m=null})),Y())},i(e){u||(G(o),R((()=>{s&&s.end(1),i=U(n,t[12],1),i.start()})),G(m),u=1)},o(e){H(o),i&&i.invalidate(),s=V(n,t[12],0),H(m),u=0},d(t){t&&b(n),f[e].d(),t&&s&&s.end(),m&&m.d(t),t&&b(c),l=0,r(a)}}}function Rt(t){let n,e,o,i,s,c=`${t[4]+1} / ${t[0].length}`;return{c(){n=g("div"),e=g("button"),o=g("button"),v(n,"class","bp-count"),v(e,"class","bp-prev"),v(e,"title","Previous"),v(e,"aria-label","Previous"),v(o,"class","bp-next"),v(o,"title","Next"),v(o,"aria-label","Next")},m(r,u){h(r,n,u),n.innerHTML=c,h(r,e,u),h(r,o,u),i||(s=[w(e,"click",t[2]),w(o,"click",t[3])],i=1)},p(t,e){17&e[0]&&c!==(c=`${t[4]+1} / ${t[0].length}`)&&(n.innerHTML=c)},d(t){t&&b(n),t&&b(e),t&&b(o),i=0,r(s)}}}function jt(t){let n,e,o=t[0]&&At(t);return{c(){o&&o.c(),n=x()},m(t,r){o&&o.m(t,r),h(t,n,r),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&G(o,1)):(o=At(t),o.c(),G(o,1),o.m(n.parentNode,n)):o&&(X(),H(o,1,1,(()=>{o=null})),Y())},i(t){e||(G(o),e=1)},o(t){H(o),e=0},d(t){o&&o.d(t),t&&b(n)}}}function qt(t,n,e){let o,{items:r}=n,{target:i}=n;const s=document.documentElement;let u,l,a,p,f,d,m,h,b,x,v;const y=t=>v=t,$={},k=ct(0);c(t,k,(t=>e(10,o=t)));const _=()=>{l.onClose?.($.el,b),at.set(1),e(0,r=null),p?.focus({preventScroll:1})},M=()=>P(u-1),S=()=>P(u+1),P=t=>{m=t-u,e(4,u=z(t))},z=t=>(t+r.length)%r.length,A=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)!l.noClose&&_();else if("ArrowRight"===n)S();else if("ArrowLeft"===n)M();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const{focusWrap:o=$.el}=l,r=[...o.querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=r.indexOf(n);i+=r.length+(e?-1:1),r[i%r.length].focus()}}},T=({width:t=1920,height:n=1080})=>{const{scale:e=.99}=l,o=Math.min(1,$.w/t*e,$.h/n*e);return[Math.round(t*o),Math.round(n*o)]},I=()=>{if(r){const t=r[z(u+1)],n=r[z(u-1)];!t.preload&&C(t),!n.preload&&C(n)}},C=t=>{if(t.img){const n=g("img");return n.sizes=l.sizes||T(t)[0]+"px",n.srcset=t.img,t.preload=1,n.decode().catch((t=>{}))}};return t.$$set=t=>{"items"in t&&e(0,r=t.items),"target"in t&&e(15,i=t.target)},t.$$.update=()=>{1835121&t.$$.u[0]&&r&&(e(6,b=r[u]),e(19,x=b.hasOwnProperty("html")),a&&(x&&y(null),l.onUpdate?.($.el,b)))},[r,_,M,S,u,l,b,f,d,h,o,k,(t,n)=>a&&r?it(t,{x:(m>0?20:-20)*(n?1:-1),duration:250}):(e(18,a=n),l.intro?it(t,{y:n?10:-10}):(t=>{let n;if(x){const e=t.firstChild.firstChild;n=[e.clientWidth,e.clientHeight]}else n=T(b);const e=(b.element||p).getBoundingClientRect(),o=e.left-($.w-e.width)/2,r=e.top-($.h-e.height)/2,i=e.width/n[0],s=e.height/n[1];return{duration:480,l:rt,css:(t,n)=>`transform:translate3d(${o*n}px, ${r*n}px, 0) scale3d(${i+t*(1-i)}, ${s+t*(1-s)}, 1)`}})(t)),()=>({k:b,S:T,A:C,T:I,_:l,M,next:S,close:_,P:y,zoomed:k,container:$}),t=>{let n,o;e(20,$.el=t,$),l.onOpen?.($.el,b),d||(n=w(globalThis,"keydown",A));const r=new ResizeObserver((t=>{o&&(e(20,$.w=t[0].contentRect.width,$),e(20,$.h=t[0].contentRect.height,$),e(7,f=769>$.w),v?.(),l.onResize?.($.el,b)),o=1}));return r.observe(t),{destroy(){r.disconnect(),n?.(),at.set(0),s.classList.remove("bp-lock"),l.onClosed?.()}}},i,t=>{e(5,l=t),e(8,d=l.inline);const n=l.items;!d&&s.scrollHeight>s.clientHeight&&s.classList.add("bp-lock"),p=document.activeElement,e(20,$.w=i.offsetWidth,$),e(20,$.h=i===document.body?globalThis.innerHeight:i.clientHeight,$),e(7,f=769>$.w),e(4,u=l.position||0),e(0,r=Array.isArray(n)?n.map(((t,n)=>(l.el&&l.el===t.element&&e(4,u=n),{i:n,...t}))):(n.length?[...n]:[n]).map(((t,n)=>(l.el===t&&e(4,u=n),{element:t,i:n,...t.dataset}))))},P,a,x,$,t=>e(9,h=t.target),function(t){2!==t.button&&t.target===this&&h===this&&!l.noClose&&_()}]}class Ft extends ot{constructor(t){super(),et(this,t,qt,jt,s,{items:0,target:15,open:16,close:1,M:2,next:3,setPosition:17},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[15]}get open(){return this.$$.ctx[16]}get close(){return this.$$.ctx[1]}get M(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[17]}}return t=>new Ft({...t,v:t})}(); +var BiggerPicture=function(){function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(t){t.forEach(o)}function i(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n}function c(n,e,o){n.$$.on_destroy.push(((n,...e)=>{if(null==n)return t;const o=n.subscribe(...e);return o.unsubscribe?()=>o.unsubscribe():o})(e,o))}function u(n){return n&&i(n.destroy)?n.destroy:t}let l=()=>globalThis.performance.now(),a=t=>requestAnimationFrame(t);const p=new Set;function f(t){p.forEach((n=>{n.c(t)||(p.delete(n),n.f())})),0!==p.size&&a(f)}function d(t){let n;return 0===p.size&&a(f),{promise:new Promise((e=>{p.add(n={c:t,f:e})})),abort(){p.delete(n)}}}function m(t,n){t.appendChild(n)}function h(t,n,e){t.insertBefore(n,e||null)}function b(t){t.parentNode.removeChild(t)}function g(t){return document.createElement(t)}function x(){return document.createTextNode("")}function w(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function v(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function y(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e)}function $(t,n,e){t.classList[e?"add":"remove"](n)}let k,_,M=0,z={};function S(t,n,e,o,r,i,s,c=0){const u=16.666/o;let l="{\n";for(let t=0;1>=t;t+=u){const o=n+(e-n)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,p=`_bp_${Math.round(1e9*Math.random())}_${c}`;if(!z[p]){if(!k){const t=g("style");document.head.appendChild(t),k=t.sheet}z[p]=1,k.insertRule(`@keyframes ${p} ${a}`,k.cssRules.length)}const f=t.style.animation||"";return t.style.animation=`${f?f+", ":""}${p} ${o}ms linear ${r}ms 1 both`,M+=1,p}function P(t,n){t.style.animation=(t.style.animation||"").split(", ").filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("_bp")).join(", "),n&&!--M&&a((()=>{if(M)return;let t=k.cssRules.length;for(;t--;)k.deleteRule(t);z={}}))}function A(t){_=t}const T=[],I=[],C=[],N=[],O=Promise.resolve();let E=0;function R(t){C.push(t)}const j=new Set;let q,F=0;function B(){const t=_;do{for(;T.length>F;){const t=T[F];F++,A(t),D(t.$$)}for(A(null),T.length=0,F=0;I.length;)I.pop()();for(let t=0;C.length>t;t+=1){const n=C[t];j.has(n)||(j.add(n),n())}C.length=0}while(T.length);for(;N.length;)N.pop()();E=0,j.clear(),A(t)}function D(t){if(null!==t.t){t.update(),r(t.before_update);const n=t.u;t.u=[-1],t.t&&t.t.p(t.ctx,n),t.after_update.forEach(R)}}function J(){return q||(q=Promise.resolve(),q.then((()=>{q=null}))),q}function K(t,n,e){t.dispatchEvent(((t,n,e=0)=>{const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e,0,n),o})(`${n?"intro":"outro"}${e}`))}const L=new Set;let W;function X(){W={r:0,c:[],p:W}}function Y(){W.r||r(W.c),W=W.p}function G(t,n){t&&t.i&&(L.delete(t),t.i(n))}function H(t,n,e,o){if(t&&t.o){if(L.has(t))return;L.add(t),W.c.push((()=>{L.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const Q={duration:0};function U(e,o,r){let s,c,u=o(e,r),a=0,p=0;function f(){s&&P(e,s)}function m(){const{delay:o=0,duration:r=300,l:i=n,g:m=t,css:h}=u||Q;h&&(s=S(e,0,1,r,o,i,h,p++)),m(0,1);const b=l()+o,g=b+r;c&&c.abort(),a=1,R((()=>K(e,1,"start"))),c=d((t=>{if(a){if(t>=g)return m(1,0),K(e,1,"end"),f(),a=0;if(t>=b){const n=i((t-b)/r);m(n,1-n)}}return a}))}let h=0;return{start(){h||(h=1,P(e),i(u)?(u=u(),J().then(m)):m())},invalidate(){h=0},end(){a&&(f(),a=0)}}}function V(e,o,s){let c,u=o(e,s),a=1;const p=W;function f(){const{delay:o=0,duration:i=300,l:s=n,g:f=t,css:m}=u||Q;m&&(c=S(e,1,0,i,o,s,m));const h=l()+o,b=h+i;R((()=>K(e,0,"start"))),d((t=>{if(a){if(t>=b)return f(0,1),K(e,0,"end"),--p.r||r(p.c),0;if(t>=h){const n=s((t-h)/i);f(1-n,n)}}return a}))}return p.r+=1,i(u)?J().then((()=>{u=u(),f()})):f(),{end(t){t&&u.g&&u.g(1,0),a&&(c&&P(e,c),a=0)}}}function Z(t){t&&t.c()}function tt(t,n,e,s){const{t:c,on_mount:u,on_destroy:l,after_update:a}=t.$$;c&&c.m(n,e),s||R((()=>{const n=u.map(o).filter(i);l?l.push(...n):r(n),t.$$.on_mount=[]})),a.forEach(R)}function nt(t,n){const e=t.$$;null!==e.t&&(r(e.on_destroy),e.t&&e.t.d(n),e.on_destroy=e.t=null,e.ctx=[])}function et(n,e,o,i,s,c,u,l=[-1]){const a=_;A(n);const p=n.$$={t:null,ctx:null,v:c,update:t,not_equal:s,bound:{},on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:{},u:l,skip_bound:0,root:e.target||a.$$.root};u&&u(p.root);let f=0;p.ctx=o?o(n,e.v||{},((t,e,...o)=>{const r=o.length?o[0]:e;return p.ctx&&s(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),f&&((t,n)=>{-1===t.$$.u[0]&&(T.push(t),E||(E=1,O.then(B)),t.$$.u.fill(0)),t.$$.u[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){this.$$set&&0!==Object.keys(t).length&&(this.$$.skip_bound=1,this.$$set(t),this.$$.skip_bound=0)}}function rt(t){const n=t-1;return n*n*n+1}function it(t,{delay:n=0,duration:e=400,l:o=rt,x:r=0,y:i=0,opacity:s=0}={}){const c=getComputedStyle(t),u=+c.opacity,l="none"===c.transform?"":c.transform,a=u*(1-s);return{delay:n,duration:e,l:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*r}px, ${(1-t)*i}px);\n\t\t\topacity: ${u-a*n}`}}}const st=[];function ct(n,e=t){let o;const r=new Set;function i(t){if(s(n,t)&&(n=t,o)){const t=!st.length;for(const t of r)t[1](),st.push(t,n);if(t){for(let t=0;st.length>t;t+=2)st[t][0](st[t+1]);st.length=0}}}return{set:i,update(t){i(t(n))},subscribe(s,c=t){const u=[s,c];return r.add(u),1===r.size&&(o=e(i)||t),s(n),()=>{r.delete(u),0===r.size&&(o(),o=null)}}}}function ut(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>ut(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function lt(t,o={}){const r=ct(t);let i,s=t;function c(c,u){if(null==t)return r.set(t=c),Promise.resolve();s=c;let a=i,p=0,{delay:f=0,duration:m=400,l:h=n,interpolate:b=ut}=e(e({},o),u);if(0===m)return a&&(a.abort(),a=null),r.set(t=s),Promise.resolve();const g=l()+f;let x;return i=d((n=>{if(g>n)return 1;p||(x=b(t,c),"function"==typeof m&&(m=m(t,c)),p=1),a&&(a.abort(),a=null);const e=n-g;return e>m?(r.set(t=c),0):(r.set(t=x(h(e/m))),1)})),i.promise}return{set:c,update(n,e){return c(n(s,t),e)},subscribe:r.subscribe}}const at=ct(0),pt=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches,ft=t=>({l:rt,duration:pt?0:t});function dt(t){let n,e,o,r,i=!t[2]&&mt();return{c(){n=g("div"),i&&i.c(),v(n,"class","bp-load"),y(n,"background-image","url("+t[0]+")")},m(t,e){h(t,n,e),i&&i.m(n,null),r=1},p(e,o){(t=e)[2]?i&&(i.d(1),i=null):i||(i=mt(),i.c(),i.m(n,null)),(!r||1&o)&&y(n,"background-image","url("+t[0]+")")},i(i){r||(R((()=>{o&&o.end(1),e=U(n,it,{duration:t[1]?400:0}),e.start()})),r=1)},o(t){e&&e.invalidate(),t&&(o=V(n,it,{duration:480})),r=0},d(t){t&&b(n),i&&i.d(),t&&o&&o.end()}}}function mt(t){let n,e;return{c(){n=g("span"),e=g("span"),v(n,"class","bp-bar"),v(e,"class","bp-o")},m(t,o){h(t,n,o),h(t,e,o)},d(t){t&&b(n),t&&b(e)}}}function ht(t){let n,e=(!t[1]||t[2])&&dt(t);return{c(){e&&e.c(),n=x()},m(t,o){e&&e.m(t,o),h(t,n,o)},p(t,[o]){!t[1]||t[2]?e?(e.p(t,o),6&o&&G(e,1)):(e=dt(t),e.c(),G(e,1),e.m(n.parentNode,n)):e&&(X(),H(e,1,1,(()=>{e=null})),Y())},i(t){G(e)},o(t){H(e)},d(t){e&&e.d(t),t&&b(n)}}}function bt(t,n,e){let o;c(t,at,(t=>e(2,o=t)));let{thumb:r}=n,{loaded:i}=n;return t.$$set=t=>{"thumb"in t&&e(0,r=t.thumb),"loaded"in t&&e(1,i=t.loaded)},[r,i,o]}class gt extends ot{constructor(t){super(),et(this,t,bt,ht,s,{thumb:0,loaded:1})}}function xt(t){let n,e,o,r,i,s,c,u;return{c(){n=g("img"),v(n,"srcset",e=t[7].img),v(n,"sizes",o=t[8].sizes||t[1]+"px"),v(n,"alt",r=t[7].alt)},m(e,o){h(e,n,o),s=1,c||(u=w(n,"error",t[26]),c=1)},p(t,e){(!s||2&e[0]&&o!==(o=t[8].sizes||t[1]+"px"))&&v(n,"sizes",o)},i(t){s||(i&&i.end(1),s=1)},o(t){i=V(n,it,{}),s=0},d(t){t&&b(n),t&&i&&i.end(),c=0,u()}}}function wt(t){let n,e;return n=new gt({v:{thumb:t[7].thumb,loaded:t[2]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};4&e[0]&&(o.loaded=t[2]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function vt(t){let n,e,o,i,s,c,l=t[2]&&xt(t),a=t[3]&&wt(t);return{c(){n=g("div"),e=g("div"),l&&l.c(),o=x(),a&&a.c(),v(e,"class","bp-img"),y(e,"background-image","url("+t[7].thumb+")"),y(e,"width",t[0][0]+"px"),y(e,"height",t[0][1]+"px"),y(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),$(e,"bp-drag",t[4]),$(e,"bp-canzoom",t[11]>1&&t[12]>t[0][0]),v(n,"class","bp-img-wrap"),$(n,"bp-close",t[5])},m(r,p){h(r,n,p),m(n,e),l&&l.m(e,null),m(e,o),a&&a.m(e,null),i=1,s||(c=[u(t[20].call(null,e)),w(n,"wheel",t[15]),w(n,"pointerdown",t[16]),w(n,"pointermove",t[17]),w(n,"pointerup",t[19]),w(n,"pointercancel",t[18])],s=1)},p(t,r){t[2]?l?(l.p(t,r),4&r[0]&&G(l,1)):(l=xt(t),l.c(),G(l,1),l.m(e,o)):l&&(X(),H(l,1,1,(()=>{l=null})),Y()),t[3]?a?(a.p(t,r),8&r[0]&&G(a,1)):(a=wt(t),a.c(),G(a,1),a.m(e,null)):a&&(X(),H(a,1,1,(()=>{a=null})),Y()),(!i||1&r[0])&&y(e,"width",t[0][0]+"px"),(!i||1&r[0])&&y(e,"height",t[0][1]+"px"),(!i||65&r[0])&&y(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),16&r[0]&&$(e,"bp-drag",t[4]),6145&r[0]&&$(e,"bp-canzoom",t[11]>1&&t[12]>t[0][0]),32&r[0]&&$(n,"bp-close",t[5])},i(t){i||(G(l),G(a),i=1)},o(t){H(l),H(a),i=0},d(t){t&&b(n),l&&l.d(),a&&a.d(),s=0,r(c)}}}function yt(t,n,e){let o,r,i,s;c(t,at,(t=>e(25,i=t)));let{v:u}=n,{$:l}=n,{k:a,_:p,M:f,next:d,zoomed:m,container:h}=u;c(t,m,(t=>e(24,o=t)));let b,g,x,w,v,y,$,k,_,M,z,S=a.maxZoom||p.maxZoom||10,P=u.S(a),A=P[0],T=0;const I=+a.width,C=[],N=new Map,O=lt(P,ft(400));c(t,O,(t=>e(0,s=t)));const E=lt([0,0],ft(400));c(t,E,(t=>e(6,r=t)));const R=([t,n],o=s)=>{const r=(o[0]-h.w)/2,i=(o[1]-h.h)/2;return 0>r?t=0:t>r?l?(t=v?r+(t-r)/10:r)>r+20&&e(4,v=f()):t=r:-r>t&&(l?-r-20>(t=v?-r-(-r-t)/10:-r)&&e(4,v=d()):t=-r),0>i?n=0:n>i?n=i:-i>n&&(n=-i),[t,n]};function j(t=S,n){if(i)return;const o=P[0]*S;let c=s[0]+s[0]*t,u=s[1]+s[1]*t;if(t>0)c>o&&(c=o,u=P[1]*S),c>I&&(c=I,u=+a.height);else if(P[0]>c)return O.set(P),E.set([0,0]);let{x:l,y:p,width:f,height:d}=w.getBoundingClientRect();const m=n?n.clientX-l-f/2:0,h=n?n.clientY-p-d/2:0;l=c/f*-m+m,p=u/d*-h+h;const b=[c,u];O.set(b).then((()=>{e(1,A=Math.round(Math.max(A,c)))})),E.set(R([r[0]+l,r[1]+p],b))}Object.defineProperty(a,"zoom",{configurable:1,get(){return o},set(t){return j(t?S:-S)}});const q=t=>N.delete(t.pointerId);return t.$$set=t=>{"$"in t&&e(22,l=t.$)},t.$$.update=()=>{if(8388609&t.$$.u[0]&&m.set(s[0]-10>P[0]),58720256&t.$$.u[0]&&i&&o&&!p.intro){const t=ft(480);E.set([0,0],t),O.set(P,t),e(5,z=1)}},[s,A,b,g,v,z,r,a,p,m,h,S,I,O,E,t=>{p.inline&&!o||(t.preventDefault(),j(t.deltaY/-300,t))},t=>{2!==t.button&&(t.preventDefault(),e(4,v=1),N.set(t.pointerId,t),$=t.clientX,k=t.clientY,_=r[0],M=r[1])},t=>{if(N.size>1)return e(4,v=0),p.noPinch?.(h.el)||(t=>{const[n,e]=N.set(t.pointerId,t).values(),o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);x=x||{clientX:(n.clientX+e.clientX)/2,clientY:(n.clientY+e.clientY)/2},j(((T||o)-o)/-35,x),T=o})(t);if(!v)return;let n=t.clientX,r=t.clientY;y=C.push({x:n,y:r})>2,n-=$,r-=k,o||(-90>r&&e(4,v=!p.noClose&&u.close()),30>Math.abs(r)&&(n>40&&e(4,v=f()),-40>n&&e(4,v=d()))),o&&y&&!i&&E.set(R([_+n,M+r]),{duration:0})},q,function(t){if(q(t),x&&(e(4,v=T=0),x=N.size?x:null),v){if(e(4,v=0),t.target===this&&!p.noClose)return u.close();if(y){const[t,n,e]=C.slice(-3);Math.hypot(n.x-e.x,n.y-e.y)>5&&E.set(R([r[0]-5*(t.x-e.x),r[1]-5*(t.y-e.y)]))}else p.onImageClick?.(h.el,a)||j(o?-S:S,t);y=0,C.length=0}},t=>{w=t,u.P((()=>{e(23,P=u.S(a)),!p.inline&&l||(O.set(P),E.set([0,0]))})),u.A(a).then((()=>{e(2,b=1),u.T()})),setTimeout((()=>{e(3,g=!b)}),250)},u,l,P,o,i,t=>p.onError?.(h,a,t)]}class $t extends ot{constructor(t){super(),et(this,t,yt,vt,s,{v:21,$:22},null,[-1,-1])}}function kt(t){let n,e,o,i,s,c;return o=new gt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=g("div"),e=g("iframe"),Z(o.$$.t),v(e,"allow","autoplay; fullscreen"),v(e,"title",t[2].title),v(n,"class","bp-if"),y(n,"width",t[1][0]+"px"),y(n,"height",t[1][1]+"px")},m(r,l){h(r,n,l),m(n,e),tt(o,n,null),i=1,s||(c=[u(t[3].call(null,e)),w(e,"load",t[5])],s=1)},p(t,[e]){const r={};1&e&&(r.loaded=t[0]),o.$set(r),(!i||2&e)&&y(n,"width",t[1][0]+"px"),(!i||2&e)&&y(n,"height",t[1][1]+"px")},i(t){i||(G(o.$$.t,t),i=1)},o(t){H(o.$$.t,t),i=0},d(t){t&&b(n),nt(o),s=0,r(c)}}}function _t(t,n,e){let o,r,{v:i}=n;const{k:s}=i,c=()=>e(1,r=i.S(s));return c(),i.P(c),[o,r,s,t=>t.src=s.iframe,i,()=>e(0,o=1)]}class Mt extends ot{constructor(t){super(),et(this,t,_t,kt,s,{v:4})}}function zt(t){let n,e,o,r,i;return e=new gt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=g("div"),Z(e.$$.t),v(n,"class","bp-vid"),y(n,"width",t[1][0]+"px"),y(n,"height",t[1][1]+"px"),y(n,"background-image","url("+t[2].thumb+")")},m(s,c){h(s,n,c),tt(e,n,null),o=1,r||(i=u(t[3].call(null,n)),r=1)},p(t,[r]){const i={};1&r&&(i.loaded=t[0]),e.$set(i),(!o||2&r)&&y(n,"width",t[1][0]+"px"),(!o||2&r)&&y(n,"height",t[1][1]+"px")},i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){t&&b(n),nt(e),r=0,i()}}}function St(t,n,e){let o,r,{v:i}=n;const{k:s,_:c,container:u}=i,l=()=>e(1,r=i.S(s));l(),i.P(l);const a=(t,n)=>{for(const e in n)v(t,e,n[e])};return[o,r,s,t=>{let n;const r=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e));for(const o of e){n||(n=g(o.type?.includes("audio")?"audio":"video"),a(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"}));const e=g(t);a(e,o),"source"==t&&w(e,"error",(t=>c.onError?.(u,s,t))),m(n,e)}};r("source",s.sources),r("track",s.tracks||[]),w(n,"canplay",(()=>e(0,o=1))),m(t,n)},i]}class Pt extends ot{constructor(t){super(),et(this,t,St,zt,s,{v:4})}}function At(n){let e,o,i,c,l,a,p,f,d,x,y=n[6].i,k=Et(n),_=n[0].length>1&&Rt(n);return{c(){e=g("div"),o=g("div"),k.c(),c=g("div"),l=g("button"),_&&_.c(),v(l,"class","bp-x"),v(l,"title","Close"),v(l,"aria-label","Close"),v(c,"class","bp-controls"),v(e,"class","bp-wrap"),$(e,"bp-zoomed",n[10]),$(e,"bp-inline",n[8]),$(e,"bp-small",n[7]),$(e,"bp-noclose",n[5].noClose)},m(t,r){h(t,e,r),m(e,o),k.m(e,null),m(e,c),m(c,l),_&&_.m(c,null),f=1,d||(x=[w(l,"click",n[1]),u(p=n[14].call(null,e))],d=1)},p(n,o){64&o[0]&&s(y,y=n[6].i)?(X(),H(k,1,1,t),Y(),k=Et(n),k.c(),G(k),k.m(e,c)):k.p(n,o),n[0].length>1?_?_.p(n,o):(_=Rt(n),_.c(),_.m(c,null)):_&&(_.d(1),_=null),1024&o[0]&&$(e,"bp-zoomed",n[10]),256&o[0]&&$(e,"bp-inline",n[8]),128&o[0]&&$(e,"bp-small",n[7]),32&o[0]&&$(e,"bp-noclose",n[5].noClose)},i(t){f||(i&&i.end(1),G(k),a&&a.end(1),f=1)},o(t){i=V(o,it,{duration:480}),H(k),a=V(c,it,{}),f=0},d(t){t&&b(e),t&&i&&i.end(),k.d(t),_&&_.d(),t&&a&&a.end(),d=0,r(x)}}}function Tt(n){let e,o=n[6].html+"";return{c(){e=g("div"),v(e,"class","bp-html")},m(t,n){h(t,e,n),e.innerHTML=o},p(t,n){64&n[0]&&o!==(o=t[6].html+"")&&(e.innerHTML=o)},i:t,o:t,d(t){t&&b(e)}}}function It(n){let e,o;return e=new Mt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Ct(n){let e,o;return e=new Pt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Nt(t){let n,e;return n=new $t({v:{v:t[13](),$:t[7]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.$=t[7]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function Ot(t){let n,e,o,r=t[6].caption+"";return{c(){n=g("div"),v(n,"class","bp-cap")},m(t,e){h(t,n,e),n.innerHTML=r,o=1},p(t,e){(!o||64&e[0])&&r!==(r=t[6].caption+"")&&(n.innerHTML=r)},i(t){o||(e&&e.end(1),o=1)},o(t){e=V(n,it,{duration:200}),o=0},d(t){t&&b(n),t&&e&&e.end()}}}function Et(t){let n,e,o,i,s,c,u,l,a;const p=[Nt,Ct,It,Tt],f=[];function d(t,n){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}e=d(t),o=f[e]=p[e](t);let m=t[6].caption&&Ot(t);return{c(){n=g("div"),o.c(),m&&m.c(),c=x(),v(n,"class","bp-inner")},m(o,r){h(o,n,r),f[e].m(n,null),m&&m.m(o,r),h(o,c,r),u=1,l||(a=[w(n,"pointerdown",t[21]),w(n,"pointerup",t[22])],l=1)},p(t,r){let i=e;e=d(t),e===i?f[e].p(t,r):(X(),H(f[i],1,1,(()=>{f[i]=null})),Y(),o=f[e],o?o.p(t,r):(o=f[e]=p[e](t),o.c()),G(o,1),o.m(n,null)),t[6].caption?m?(m.p(t,r),64&r[0]&&G(m,1)):(m=Ot(t),m.c(),G(m,1),m.m(c.parentNode,c)):m&&(X(),H(m,1,1,(()=>{m=null})),Y())},i(e){u||(G(o),R((()=>{s&&s.end(1),i=U(n,t[12],1),i.start()})),G(m),u=1)},o(e){H(o),i&&i.invalidate(),s=V(n,t[12],0),H(m),u=0},d(t){t&&b(n),f[e].d(),t&&s&&s.end(),m&&m.d(t),t&&b(c),l=0,r(a)}}}function Rt(t){let n,e,o,i,s,c=`${t[4]+1} / ${t[0].length}`;return{c(){n=g("div"),e=g("button"),o=g("button"),v(n,"class","bp-count"),v(e,"class","bp-prev"),v(e,"title","Previous"),v(e,"aria-label","Previous"),v(o,"class","bp-next"),v(o,"title","Next"),v(o,"aria-label","Next")},m(r,u){h(r,n,u),n.innerHTML=c,h(r,e,u),h(r,o,u),i||(s=[w(e,"click",t[2]),w(o,"click",t[3])],i=1)},p(t,e){17&e[0]&&c!==(c=`${t[4]+1} / ${t[0].length}`)&&(n.innerHTML=c)},d(t){t&&b(n),t&&b(e),t&&b(o),i=0,r(s)}}}function jt(t){let n,e,o=t[0]&&At(t);return{c(){o&&o.c(),n=x()},m(t,r){o&&o.m(t,r),h(t,n,r),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&G(o,1)):(o=At(t),o.c(),G(o,1),o.m(n.parentNode,n)):o&&(X(),H(o,1,1,(()=>{o=null})),Y())},i(t){e||(G(o),e=1)},o(t){H(o),e=0},d(t){o&&o.d(t),t&&b(n)}}}function qt(t,n,e){let o,{items:r}=n,{target:i}=n;const s=document.documentElement;let u,l,a,p,f,d,m,h,b,x,v;const y=t=>v=t,$={},k=ct(0);c(t,k,(t=>e(10,o=t)));const _=()=>{l.onClose?.($.el,b),at.set(1),e(0,r=null),p?.focus({preventScroll:1})},M=()=>S(u-1),z=()=>S(u+1),S=t=>{m=t-u,e(4,u=P(t))},P=t=>(t+r.length)%r.length,A=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)!l.noClose&&_();else if("ArrowRight"===n)z();else if("ArrowLeft"===n)M();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const{focusWrap:o=$.el}=l,r=[...o.querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=r.indexOf(n);i+=r.length+(e?-1:1),r[i%r.length].focus()}}},T=({width:t=1920,height:n=1080})=>{const{scale:e=.99}=l,o=Math.min(1,$.w/t*e,$.h/n*e);return[Math.round(t*o),Math.round(n*o)]},I=()=>{if(r){const t=r[P(u+1)],n=r[P(u-1)];!t.preload&&C(t),!n.preload&&C(n)}},C=t=>{if(t.img){const n=g("img");return n.sizes=l.sizes||T(t)[0]+"px",n.srcset=t.img,t.preload=1,n.decode().catch((t=>{}))}};return t.$$set=t=>{"items"in t&&e(0,r=t.items),"target"in t&&e(15,i=t.target)},t.$$.update=()=>{1835121&t.$$.u[0]&&r&&(e(6,b=r[u]),e(19,x=b.hasOwnProperty("html")),a&&(x&&y(null),l.onUpdate?.($.el,b)))},[r,_,M,z,u,l,b,f,d,h,o,k,(t,n)=>a&&r?it(t,{x:(m>0?20:-20)*(n?1:-1),duration:250}):(e(18,a=n),l.intro?it(t,{y:n?10:-10}):(t=>{let n;if(x){const e=t.firstChild.firstChild;n=[e.clientWidth,e.clientHeight]}else n=T(b);const e=(b.element||p).getBoundingClientRect(),o=e.left-($.w-e.width)/2,r=e.top-($.h-e.height)/2,i=e.width/n[0],s=e.height/n[1];return{duration:480,l:rt,css:(t,n)=>`transform:translate3d(${o*n}px, ${r*n}px, 0) scale3d(${i+t*(1-i)}, ${s+t*(1-s)}, 1)`}})(t)),()=>({k:b,S:T,A:C,T:I,_:l,M,next:z,close:_,P:y,zoomed:k,container:$}),t=>{let n,o;e(20,$.el=t,$),l.onOpen?.($.el,b),d||(n=w(globalThis,"keydown",A));const r=new ResizeObserver((t=>{o&&(e(20,$.w=t[0].contentRect.width,$),e(20,$.h=t[0].contentRect.height,$),e(7,f=769>$.w),v?.(),l.onResize?.($.el,b)),o=1}));return r.observe(t),{destroy(){r.disconnect(),n?.(),at.set(0),s.classList.remove("bp-lock"),l.onClosed?.()}}},i,t=>{e(5,l=t),e(8,d=l.inline);const n=l.items;!d&&s.scrollHeight>s.clientHeight&&s.classList.add("bp-lock"),p=document.activeElement,e(20,$.w=i.offsetWidth,$),e(20,$.h=i===document.body?globalThis.innerHeight:i.clientHeight,$),e(7,f=769>$.w),e(4,u=l.position||0),e(0,r=Array.isArray(n)?n.map(((t,n)=>(l.el&&l.el===t.element&&e(4,u=n),{i:n,...t}))):(n.length?[...n]:[n]).map(((t,n)=>(l.el===t&&e(4,u=n),{element:t,i:n,...t.dataset}))))},S,a,x,$,t=>e(9,h=t.target),function(t){2!==t.button&&t.target===this&&h===this&&!l.noClose&&_()}]}class Ft extends ot{constructor(t){super(),et(this,t,qt,jt,s,{items:0,target:15,open:16,close:1,M:2,next:3,setPosition:17},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[15]}get open(){return this.$$.ctx[16]}get close(){return this.$$.ctx[1]}get M(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[17]}}return t=>new Ft({...t,v:t})}(); diff --git a/dist/bigger-picture.min.mjs b/dist/bigger-picture.min.mjs index 2dbcb8d..8dc1776 100644 --- a/dist/bigger-picture.min.mjs +++ b/dist/bigger-picture.min.mjs @@ -1 +1 @@ -function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(t){t.forEach(o)}function i(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n}function c(n,e,o){n.$$.on_destroy.push(((n,...e)=>{if(null==n)return t;const o=n.subscribe(...e);return o.unsubscribe?()=>o.unsubscribe():o})(e,o))}function u(n){return n&&i(n.destroy)?n.destroy:t}let l=()=>globalThis.performance.now(),a=t=>requestAnimationFrame(t);const p=new Set;function f(t){p.forEach((n=>{n.c(t)||(p.delete(n),n.f())})),0!==p.size&&a(f)}function d(t){let n;return 0===p.size&&a(f),{promise:new Promise((e=>{p.add(n={c:t,f:e})})),abort(){p.delete(n)}}}function m(t,n){t.appendChild(n)}function h(t,n,e){t.insertBefore(n,e||null)}function b(t){t.parentNode.removeChild(t)}function g(t){return document.createElement(t)}function x(){return document.createTextNode("")}function w(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function y(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function v(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e)}function $(t,n,e){t.classList[e?"add":"remove"](n)}let k,_,M=0,S={};function z(t,n,e,o,r,i,s,c=0){const u=16.666/o;let l="{\n";for(let t=0;1>=t;t+=u){const o=n+(e-n)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,p=`_bp_${Math.round(1e9*Math.random())}_${c}`;if(!S[p]){if(!k){const t=g("style");document.head.appendChild(t),k=t.sheet}S[p]=1,k.insertRule(`@keyframes ${p} ${a}`,k.cssRules.length)}const f=t.style.animation||"";return t.style.animation=`${f?f+", ":""}${p} ${o}ms linear ${r}ms 1 both`,M+=1,p}function P(t,n){t.style.animation=(t.style.animation||"").split(", ").filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("_bp")).join(", "),n&&!--M&&a((()=>{if(M)return;let t=k.cssRules.length;for(;t--;)k.deleteRule(t);S={}}))}function A(t){_=t}const T=[],I=[],C=[],N=[],O=Promise.resolve();let E=0;function R(t){C.push(t)}const j=new Set;let q,F=0;function D(){const t=_;do{for(;T.length>F;){const t=T[F];F++,A(t),J(t.$$)}for(A(null),T.length=0,F=0;I.length;)I.pop()();for(let t=0;C.length>t;t+=1){const n=C[t];j.has(n)||(j.add(n),n())}C.length=0}while(T.length);for(;N.length;)N.pop()();E=0,j.clear(),A(t)}function J(t){if(null!==t.t){t.update(),r(t.before_update);const n=t.u;t.u=[-1],t.t&&t.t.p(t.ctx,n),t.after_update.forEach(R)}}function K(){return q||(q=Promise.resolve(),q.then((()=>{q=null}))),q}function L(t,n,e){t.dispatchEvent(((t,n,e=0)=>{const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e,0,n),o})(`${n?"intro":"outro"}${e}`))}const W=new Set;let X;function Y(){X={r:0,c:[],p:X}}function B(){X.r||r(X.c),X=X.p}function G(t,n){t&&t.i&&(W.delete(t),t.i(n))}function H(t,n,e,o){if(t&&t.o){if(W.has(t))return;W.add(t),X.c.push((()=>{W.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const Q={duration:0};function U(e,o,r){let s,c,u=o(e,r),a=0,p=0;function f(){s&&P(e,s)}function m(){const{delay:o=0,duration:r=300,l:i=n,g:m=t,css:h}=u||Q;h&&(s=z(e,0,1,r,o,i,h,p++)),m(0,1);const b=l()+o,g=b+r;c&&c.abort(),a=1,R((()=>L(e,1,"start"))),c=d((t=>{if(a){if(t>=g)return m(1,0),L(e,1,"end"),f(),a=0;if(t>=b){const n=i((t-b)/r);m(n,1-n)}}return a}))}let h=0;return{start(){h||(h=1,P(e),i(u)?(u=u(),K().then(m)):m())},invalidate(){h=0},end(){a&&(f(),a=0)}}}function V(e,o,s){let c,u=o(e,s),a=1;const p=X;function f(){const{delay:o=0,duration:i=300,l:s=n,g:f=t,css:m}=u||Q;m&&(c=z(e,1,0,i,o,s,m));const h=l()+o,b=h+i;R((()=>L(e,0,"start"))),d((t=>{if(a){if(t>=b)return f(0,1),L(e,0,"end"),--p.r||r(p.c),0;if(t>=h){const n=s((t-h)/i);f(1-n,n)}}return a}))}return p.r+=1,i(u)?K().then((()=>{u=u(),f()})):f(),{end(t){t&&u.g&&u.g(1,0),a&&(c&&P(e,c),a=0)}}}function Z(t){t&&t.c()}function tt(t,n,e,s){const{t:c,on_mount:u,on_destroy:l,after_update:a}=t.$$;c&&c.m(n,e),s||R((()=>{const n=u.map(o).filter(i);l?l.push(...n):r(n),t.$$.on_mount=[]})),a.forEach(R)}function nt(t,n){const e=t.$$;null!==e.t&&(r(e.on_destroy),e.t&&e.t.d(n),e.on_destroy=e.t=null,e.ctx=[])}function et(n,e,o,i,s,c,u,l=[-1]){const a=_;A(n);const p=n.$$={t:null,ctx:null,v:c,update:t,not_equal:s,bound:{},on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:{},u:l,skip_bound:0,root:e.target||a.$$.root};u&&u(p.root);let f=0;p.ctx=o?o(n,e.v||{},((t,e,...o)=>{const r=o.length?o[0]:e;return p.ctx&&s(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),f&&((t,n)=>{-1===t.$$.u[0]&&(T.push(t),E||(E=1,O.then(D)),t.$$.u.fill(0)),t.$$.u[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){this.$$set&&0!==Object.keys(t).length&&(this.$$.skip_bound=1,this.$$set(t),this.$$.skip_bound=0)}}function rt(t){const n=t-1;return n*n*n+1}function it(t,{delay:n=0,duration:e=400,l:o=rt,x:r=0,y:i=0,opacity:s=0}={}){const c=getComputedStyle(t),u=+c.opacity,l="none"===c.transform?"":c.transform,a=u*(1-s);return{delay:n,duration:e,l:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*r}px, ${(1-t)*i}px);\n\t\t\topacity: ${u-a*n}`}}}const st=[];function ct(n,e=t){let o;const r=new Set;function i(t){if(s(n,t)&&(n=t,o)){const t=!st.length;for(const t of r)t[1](),st.push(t,n);if(t){for(let t=0;st.length>t;t+=2)st[t][0](st[t+1]);st.length=0}}}return{set:i,update(t){i(t(n))},subscribe(s,c=t){const u=[s,c];return r.add(u),1===r.size&&(o=e(i)||t),s(n),()=>{r.delete(u),0===r.size&&(o(),o=null)}}}}function ut(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>ut(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function lt(t,o={}){const r=ct(t);let i,s=t;function c(c,u){if(null==t)return r.set(t=c),Promise.resolve();s=c;let a=i,p=0,{delay:f=0,duration:m=400,l:h=n,interpolate:b=ut}=e(e({},o),u);if(0===m)return a&&(a.abort(),a=null),r.set(t=s),Promise.resolve();const g=l()+f;let x;return i=d((n=>{if(g>n)return 1;p||(x=b(t,c),"function"==typeof m&&(m=m(t,c)),p=1),a&&(a.abort(),a=null);const e=n-g;return e>m?(r.set(t=c),0):(r.set(t=x(h(e/m))),1)})),i.promise}return{set:c,update(n,e){return c(n(s,t),e)},subscribe:r.subscribe}}const at=ct(0),pt=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches,ft=t=>({l:rt,duration:pt?0:t});function dt(t){let n,e,o,r,i=!t[2]&&mt();return{c(){n=g("div"),i&&i.c(),y(n,"class","bp-load"),v(n,"background-image","url("+t[0]+")")},m(t,e){h(t,n,e),i&&i.m(n,null),r=1},p(e,o){(t=e)[2]?i&&(i.d(1),i=null):i||(i=mt(),i.c(),i.m(n,null)),(!r||1&o)&&v(n,"background-image","url("+t[0]+")")},i(i){r||(R((()=>{o&&o.end(1),e=U(n,it,{duration:t[1]?400:0}),e.start()})),r=1)},o(t){e&&e.invalidate(),t&&(o=V(n,it,{duration:480})),r=0},d(t){t&&b(n),i&&i.d(),t&&o&&o.end()}}}function mt(t){let n,e;return{c(){n=g("span"),e=g("span"),y(n,"class","bp-bar"),y(e,"class","bp-o")},m(t,o){h(t,n,o),h(t,e,o)},d(t){t&&b(n),t&&b(e)}}}function ht(t){let n,e=(!t[1]||t[2])&&dt(t);return{c(){e&&e.c(),n=x()},m(t,o){e&&e.m(t,o),h(t,n,o)},p(t,[o]){!t[1]||t[2]?e?(e.p(t,o),6&o&&G(e,1)):(e=dt(t),e.c(),G(e,1),e.m(n.parentNode,n)):e&&(Y(),H(e,1,1,(()=>{e=null})),B())},i(t){G(e)},o(t){H(e)},d(t){e&&e.d(t),t&&b(n)}}}function bt(t,n,e){let o;c(t,at,(t=>e(2,o=t)));let{thumb:r}=n,{loaded:i}=n;return t.$$set=t=>{"thumb"in t&&e(0,r=t.thumb),"loaded"in t&&e(1,i=t.loaded)},[r,i,o]}class gt extends ot{constructor(t){super(),et(this,t,bt,ht,s,{thumb:0,loaded:1})}}function xt(t){let n,e,o,r,i,s,c,u;return{c(){n=g("img"),y(n,"srcset",e=t[7].img),y(n,"sizes",o=t[8].sizes||t[1]+"px"),y(n,"alt",r=t[7].alt)},m(e,o){h(e,n,o),s=1,c||(u=w(n,"error",t[24]),c=1)},p(t,e){(!s||2&e[0]&&o!==(o=t[8].sizes||t[1]+"px"))&&y(n,"sizes",o)},i(t){s||(i&&i.end(1),s=1)},o(t){i=V(n,it,{}),s=0},d(t){t&&b(n),t&&i&&i.end(),c=0,u()}}}function wt(t){let n,e;return n=new gt({v:{thumb:t[7].thumb,loaded:t[2]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};4&e[0]&&(o.loaded=t[2]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function yt(t){let n,e,o,i,s,c,l=t[2]&&xt(t),a=t[3]&&wt(t);return{c(){n=g("div"),e=g("div"),l&&l.c(),o=x(),a&&a.c(),y(e,"class","bp-img"),v(e,"background-image","url("+t[7].thumb+")"),v(e,"width",t[0][0]+"px"),v(e,"height",t[0][1]+"px"),v(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),y(n,"class","bp-img-wrap"),$(n,"bp-drag",t[4]),$(n,"bp-close",t[5])},m(r,p){h(r,n,p),m(n,e),l&&l.m(e,null),m(e,o),a&&a.m(e,null),i=1,s||(c=[u(t[18].call(null,e)),w(n,"wheel",t[13]),w(n,"pointerdown",t[14]),w(n,"pointermove",t[15]),w(n,"pointerup",t[17]),w(n,"pointercancel",t[16])],s=1)},p(t,r){t[2]?l?(l.p(t,r),4&r[0]&&G(l,1)):(l=xt(t),l.c(),G(l,1),l.m(e,o)):l&&(Y(),H(l,1,1,(()=>{l=null})),B()),t[3]?a?(a.p(t,r),8&r[0]&&G(a,1)):(a=wt(t),a.c(),G(a,1),a.m(e,null)):a&&(Y(),H(a,1,1,(()=>{a=null})),B()),(!i||1&r[0])&&v(e,"width",t[0][0]+"px"),(!i||1&r[0])&&v(e,"height",t[0][1]+"px"),(!i||65&r[0])&&v(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),16&r[0]&&$(n,"bp-drag",t[4]),32&r[0]&&$(n,"bp-close",t[5])},i(t){i||(G(l),G(a),i=1)},o(t){H(l),H(a),i=0},d(t){t&&b(n),l&&l.d(),a&&a.d(),s=0,r(c)}}}function vt(t,n,e){let o,r,i,s;c(t,at,(t=>e(23,i=t)));let{v:u}=n,{$:l}=n,{k:a,_:p,M:f,next:d,zoomed:m,container:h}=u;c(t,m,(t=>e(22,o=t)));let b,g,x,w,y,v,$,k,_,M,S,z=a.maxZoom||p.maxZoom||10,P=u.S(a),A=P[0],T=0;const I=+a.width,C=[],N=new Map,O=lt(P,ft(400));c(t,O,(t=>e(0,s=t)));const E=lt([0,0],ft(400));c(t,E,(t=>e(6,r=t)));const R=([t,n],o=s)=>{const r=(o[0]-h.w)/2,i=(o[1]-h.h)/2;return 0>r?t=0:t>r?l?(t=y?r+(t-r)/10:r)>r+20&&e(4,y=f()):t=r:-r>t&&(l?-r-20>(t=y?-r-(-r-t)/10:-r)&&e(4,y=d()):t=-r),0>i?n=0:n>i?n=i:-i>n&&(n=-i),[t,n]};function j(t=z,n){if(i)return;const o=P[0]*z,[c,u]=s;let l=c+c*t,p=u+u*t;if(t>0)l>o&&(l=o,p=P[1]*z),l>I&&(l=I,p=+a.height);else if(P[0]>l)return O.set(P),E.set([0,0]);let{x:f,y:d,width:m,height:h}=w.getBoundingClientRect();const b=n?n.clientX-f-m/2:0,g=n?n.clientY-d-h/2:0;f=l/m*-b+b,d=p/h*-g+g;const x=[l,p];O.set(x).then((()=>{e(1,A=Math.round(Math.max(A,l)))})),E.set(R([r[0]+f,r[1]+d],x))}Object.defineProperty(a,"zoom",{configurable:1,get(){return o},set(t){return j(t?z:-z)}});const q=t=>N.delete(t.pointerId);return t.$$set=t=>{"$"in t&&e(20,l=t.$)},t.$$.update=()=>{if(2097153&t.$$.u[0]&&m.set(s[0]-10>P[0]),14680064&t.$$.u[0]&&i&&o&&!p.intro){const t=ft(480);E.set([0,0],t),O.set(P,t),e(5,S=1)}},[s,A,b,g,y,S,r,a,p,m,h,O,E,t=>{p.inline&&!o||(t.preventDefault(),j(t.deltaY/-300,t))},t=>{2!==t.button&&(t.preventDefault(),e(4,y=1),N.set(t.pointerId,t),$=t.clientX,k=t.clientY,_=r[0],M=r[1])},t=>{if(N.size>1)return e(4,y=0),p.noPinch?.(h.el)||(t=>{const[n,e]=N.set(t.pointerId,t).values(),o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);x=x||{clientX:(n.clientX+e.clientX)/2,clientY:(n.clientY+e.clientY)/2},j(((T||o)-o)/-35,x),T=o})(t);if(!y)return;let n=t.clientX,r=t.clientY;v=C.push({x:n,y:r})>2,n-=$,r-=k,o||(-90>r&&e(4,y=!p.noClose&&u.close()),30>Math.abs(r)&&(n>40&&e(4,y=f()),-40>n&&e(4,y=d()))),o&&v&&!i&&E.set(R([_+n,M+r]),{duration:0})},q,function(t){if(q(t),x&&(e(4,y=T=0),x=N.size?x:null),y){if(e(4,y=0),t.target===this&&!p.noClose)return u.close();if(v){const[t,n,e]=C.slice(-3);Math.hypot(n.x-e.x,n.y-e.y)>5&&E.set(R([r[0]-5*(t.x-e.x),r[1]-5*(t.y-e.y)]))}else p.onImageClick?.(h.el,a)||j(o?-z:z,t);v=0,C.length=0}},t=>{w=t,u.P((()=>{e(21,P=u.S(a)),!p.inline&&l||(O.set(P),E.set([0,0]))})),u.A(a).then((()=>{e(2,b=1),u.T()})),setTimeout((()=>{e(3,g=!b)}),250)},u,l,P,o,i,t=>p.onError?.(h,a,t)]}class $t extends ot{constructor(t){super(),et(this,t,vt,yt,s,{v:19,$:20},null,[-1,-1])}}function kt(t){let n,e,o,i,s,c;return o=new gt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=g("div"),e=g("iframe"),Z(o.$$.t),y(e,"allow","autoplay; fullscreen"),y(e,"title",t[2].title),y(n,"class","bp-if"),v(n,"width",t[1][0]+"px"),v(n,"height",t[1][1]+"px")},m(r,l){h(r,n,l),m(n,e),tt(o,n,null),i=1,s||(c=[u(t[3].call(null,e)),w(e,"load",t[5])],s=1)},p(t,[e]){const r={};1&e&&(r.loaded=t[0]),o.$set(r),(!i||2&e)&&v(n,"width",t[1][0]+"px"),(!i||2&e)&&v(n,"height",t[1][1]+"px")},i(t){i||(G(o.$$.t,t),i=1)},o(t){H(o.$$.t,t),i=0},d(t){t&&b(n),nt(o),s=0,r(c)}}}function _t(t,n,e){let o,r,{v:i}=n;const{k:s}=i,c=()=>e(1,r=i.S(s));return c(),i.P(c),[o,r,s,t=>t.src=s.iframe,i,()=>e(0,o=1)]}class Mt extends ot{constructor(t){super(),et(this,t,_t,kt,s,{v:4})}}function St(t){let n,e,o,r,i;return e=new gt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=g("div"),Z(e.$$.t),y(n,"class","bp-vid"),v(n,"width",t[1][0]+"px"),v(n,"height",t[1][1]+"px"),v(n,"background-image","url("+t[2].thumb+")")},m(s,c){h(s,n,c),tt(e,n,null),o=1,r||(i=u(t[3].call(null,n)),r=1)},p(t,[r]){const i={};1&r&&(i.loaded=t[0]),e.$set(i),(!o||2&r)&&v(n,"width",t[1][0]+"px"),(!o||2&r)&&v(n,"height",t[1][1]+"px")},i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){t&&b(n),nt(e),r=0,i()}}}function zt(t,n,e){let o,r,{v:i}=n;const{k:s,_:c,container:u}=i,l=()=>e(1,r=i.S(s));l(),i.P(l);const a=(t,n)=>{for(const e in n)y(t,e,n[e])};return[o,r,s,t=>{let n;const r=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e));for(const o of e){n||(n=g(o.type?.includes("audio")?"audio":"video"),a(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"}));const e=g(t);a(e,o),"source"==t&&w(e,"error",(t=>c.onError?.(u,s,t))),m(n,e)}};r("source",s.sources),r("track",s.tracks||[]),w(n,"canplay",(()=>e(0,o=1))),m(t,n)},i]}class Pt extends ot{constructor(t){super(),et(this,t,zt,St,s,{v:4})}}function At(n){let e,o,i,c,l,a,p,f,d,x,v=n[6].i,k=Et(n),_=n[0].length>1&&Rt(n);return{c(){e=g("div"),o=g("div"),k.c(),c=g("div"),l=g("button"),_&&_.c(),y(l,"class","bp-x"),y(l,"title","Close"),y(l,"aria-label","Close"),y(c,"class","bp-controls"),y(e,"class","bp-wrap"),$(e,"bp-zoomed",n[10]),$(e,"bp-inline",n[8]),$(e,"bp-small",n[7]),$(e,"bp-noclose",n[5].noClose)},m(t,r){h(t,e,r),m(e,o),k.m(e,null),m(e,c),m(c,l),_&&_.m(c,null),f=1,d||(x=[w(l,"click",n[1]),u(p=n[14].call(null,e))],d=1)},p(n,o){64&o[0]&&s(v,v=n[6].i)?(Y(),H(k,1,1,t),B(),k=Et(n),k.c(),G(k),k.m(e,c)):k.p(n,o),n[0].length>1?_?_.p(n,o):(_=Rt(n),_.c(),_.m(c,null)):_&&(_.d(1),_=null),1024&o[0]&&$(e,"bp-zoomed",n[10]),256&o[0]&&$(e,"bp-inline",n[8]),128&o[0]&&$(e,"bp-small",n[7]),32&o[0]&&$(e,"bp-noclose",n[5].noClose)},i(t){f||(i&&i.end(1),G(k),a&&a.end(1),f=1)},o(t){i=V(o,it,{duration:480}),H(k),a=V(c,it,{}),f=0},d(t){t&&b(e),t&&i&&i.end(),k.d(t),_&&_.d(),t&&a&&a.end(),d=0,r(x)}}}function Tt(n){let e,o=n[6].html+"";return{c(){e=g("div"),y(e,"class","bp-html")},m(t,n){h(t,e,n),e.innerHTML=o},p(t,n){64&n[0]&&o!==(o=t[6].html+"")&&(e.innerHTML=o)},i:t,o:t,d(t){t&&b(e)}}}function It(n){let e,o;return e=new Mt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Ct(n){let e,o;return e=new Pt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Nt(t){let n,e;return n=new $t({v:{v:t[13](),$:t[7]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.$=t[7]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function Ot(t){let n,e,o,r=t[6].caption+"";return{c(){n=g("div"),y(n,"class","bp-cap")},m(t,e){h(t,n,e),n.innerHTML=r,o=1},p(t,e){(!o||64&e[0])&&r!==(r=t[6].caption+"")&&(n.innerHTML=r)},i(t){o||(e&&e.end(1),o=1)},o(t){e=V(n,it,{duration:200}),o=0},d(t){t&&b(n),t&&e&&e.end()}}}function Et(t){let n,e,o,i,s,c,u,l,a;const p=[Nt,Ct,It,Tt],f=[];function d(t,n){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}e=d(t),o=f[e]=p[e](t);let m=t[6].caption&&Ot(t);return{c(){n=g("div"),o.c(),m&&m.c(),c=x(),y(n,"class","bp-inner")},m(o,r){h(o,n,r),f[e].m(n,null),m&&m.m(o,r),h(o,c,r),u=1,l||(a=[w(n,"pointerdown",t[21]),w(n,"pointerup",t[22])],l=1)},p(t,r){let i=e;e=d(t),e===i?f[e].p(t,r):(Y(),H(f[i],1,1,(()=>{f[i]=null})),B(),o=f[e],o?o.p(t,r):(o=f[e]=p[e](t),o.c()),G(o,1),o.m(n,null)),t[6].caption?m?(m.p(t,r),64&r[0]&&G(m,1)):(m=Ot(t),m.c(),G(m,1),m.m(c.parentNode,c)):m&&(Y(),H(m,1,1,(()=>{m=null})),B())},i(e){u||(G(o),R((()=>{s&&s.end(1),i=U(n,t[12],1),i.start()})),G(m),u=1)},o(e){H(o),i&&i.invalidate(),s=V(n,t[12],0),H(m),u=0},d(t){t&&b(n),f[e].d(),t&&s&&s.end(),m&&m.d(t),t&&b(c),l=0,r(a)}}}function Rt(t){let n,e,o,i,s,c=`${t[4]+1} / ${t[0].length}`;return{c(){n=g("div"),e=g("button"),o=g("button"),y(n,"class","bp-count"),y(e,"class","bp-prev"),y(e,"title","Previous"),y(e,"aria-label","Previous"),y(o,"class","bp-next"),y(o,"title","Next"),y(o,"aria-label","Next")},m(r,u){h(r,n,u),n.innerHTML=c,h(r,e,u),h(r,o,u),i||(s=[w(e,"click",t[2]),w(o,"click",t[3])],i=1)},p(t,e){17&e[0]&&c!==(c=`${t[4]+1} / ${t[0].length}`)&&(n.innerHTML=c)},d(t){t&&b(n),t&&b(e),t&&b(o),i=0,r(s)}}}function jt(t){let n,e,o=t[0]&&At(t);return{c(){o&&o.c(),n=x()},m(t,r){o&&o.m(t,r),h(t,n,r),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&G(o,1)):(o=At(t),o.c(),G(o,1),o.m(n.parentNode,n)):o&&(Y(),H(o,1,1,(()=>{o=null})),B())},i(t){e||(G(o),e=1)},o(t){H(o),e=0},d(t){o&&o.d(t),t&&b(n)}}}function qt(t,n,e){let o,{items:r}=n,{target:i}=n;const s=document.documentElement;let u,l,a,p,f,d,m,h,b,x,y;const v=t=>y=t,$={},k=ct(0);c(t,k,(t=>e(10,o=t)));const _=()=>{l.onClose?.($.el,b),at.set(1),e(0,r=null),p?.focus({preventScroll:1})},M=()=>z(u-1),S=()=>z(u+1),z=t=>{m=t-u,e(4,u=P(t))},P=t=>(t+r.length)%r.length,A=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)!l.noClose&&_();else if("ArrowRight"===n)S();else if("ArrowLeft"===n)M();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const{focusWrap:o=$.el}=l,r=[...o.querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=r.indexOf(n);i+=r.length+(e?-1:1),r[i%r.length].focus()}}},T=({width:t=1920,height:n=1080})=>{const{scale:e=.99}=l,o=Math.min(1,$.w/t*e,$.h/n*e);return[Math.round(t*o),Math.round(n*o)]},I=()=>{if(r){const t=r[P(u+1)],n=r[P(u-1)];!t.preload&&C(t),!n.preload&&C(n)}},C=t=>{if(t.img){const n=g("img");return n.sizes=l.sizes||T(t)[0]+"px",n.srcset=t.img,t.preload=1,n.decode().catch((t=>{}))}};return t.$$set=t=>{"items"in t&&e(0,r=t.items),"target"in t&&e(15,i=t.target)},t.$$.update=()=>{1835121&t.$$.u[0]&&r&&(e(6,b=r[u]),e(19,x=b.hasOwnProperty("html")),a&&(x&&v(null),l.onUpdate?.($.el,b)))},[r,_,M,S,u,l,b,f,d,h,o,k,(t,n)=>a&&r?it(t,{x:(m>0?20:-20)*(n?1:-1),duration:250}):(e(18,a=n),l.intro?it(t,{y:n?10:-10}):(t=>{let n;if(x){const e=t.firstChild.firstChild;n=[e.clientWidth,e.clientHeight]}else n=T(b);const e=(b.element||p).getBoundingClientRect(),o=e.left-($.w-e.width)/2,r=e.top-($.h-e.height)/2,i=e.width/n[0],s=e.height/n[1];return{duration:480,l:rt,css:(t,n)=>`transform:translate3d(${o*n}px, ${r*n}px, 0) scale3d(${i+t*(1-i)}, ${s+t*(1-s)}, 1)`}})(t)),()=>({k:b,S:T,A:C,T:I,_:l,M,next:S,close:_,P:v,zoomed:k,container:$}),t=>{let n,o;e(20,$.el=t,$),l.onOpen?.($.el,b),d||(n=w(globalThis,"keydown",A));const r=new ResizeObserver((t=>{o&&(e(20,$.w=t[0].contentRect.width,$),e(20,$.h=t[0].contentRect.height,$),e(7,f=769>$.w),y?.(),l.onResize?.($.el,b)),o=1}));return r.observe(t),{destroy(){r.disconnect(),n?.(),at.set(0),s.classList.remove("bp-lock"),l.onClosed?.()}}},i,t=>{e(5,l=t),e(8,d=l.inline);const n=l.items;!d&&s.scrollHeight>s.clientHeight&&s.classList.add("bp-lock"),p=document.activeElement,e(20,$.w=i.offsetWidth,$),e(20,$.h=i===document.body?globalThis.innerHeight:i.clientHeight,$),e(7,f=769>$.w),e(4,u=l.position||0),e(0,r=Array.isArray(n)?n.map(((t,n)=>(l.el&&l.el===t.element&&e(4,u=n),{i:n,...t}))):(n.length?[...n]:[n]).map(((t,n)=>(l.el===t&&e(4,u=n),{element:t,i:n,...t.dataset}))))},z,a,x,$,t=>e(9,h=t.target),function(t){2!==t.button&&t.target===this&&h===this&&!l.noClose&&_()}]}class Ft extends ot{constructor(t){super(),et(this,t,qt,jt,s,{items:0,target:15,open:16,close:1,M:2,next:3,setPosition:17},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[15]}get open(){return this.$$.ctx[16]}get close(){return this.$$.ctx[1]}get M(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[17]}}function Dt(t){return new Ft({...t,v:t})}export{Dt as default}; +function t(){}const n=t=>t;function e(t,n){for(const e in n)t[e]=n[e];return t}function o(t){return t()}function r(t){t.forEach(o)}function i(t){return"function"==typeof t}function s(t,n){return t!=t?n==n:t!==n}function c(n,e,o){n.$$.on_destroy.push(((n,...e)=>{if(null==n)return t;const o=n.subscribe(...e);return o.unsubscribe?()=>o.unsubscribe():o})(e,o))}function u(n){return n&&i(n.destroy)?n.destroy:t}let l=()=>globalThis.performance.now(),a=t=>requestAnimationFrame(t);const p=new Set;function f(t){p.forEach((n=>{n.c(t)||(p.delete(n),n.f())})),0!==p.size&&a(f)}function d(t){let n;return 0===p.size&&a(f),{promise:new Promise((e=>{p.add(n={c:t,f:e})})),abort(){p.delete(n)}}}function m(t,n){t.appendChild(n)}function h(t,n,e){t.insertBefore(n,e||null)}function b(t){t.parentNode.removeChild(t)}function g(t){return document.createElement(t)}function x(){return document.createTextNode("")}function w(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function y(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function v(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e)}function $(t,n,e){t.classList[e?"add":"remove"](n)}let k,_,M=0,z={};function S(t,n,e,o,r,i,s,c=0){const u=16.666/o;let l="{\n";for(let t=0;1>=t;t+=u){const o=n+(e-n)*i(t);l+=100*t+`%{${s(o,1-o)}}\n`}const a=l+`100% {${s(e,1-e)}}\n}`,p=`_bp_${Math.round(1e9*Math.random())}_${c}`;if(!z[p]){if(!k){const t=g("style");document.head.appendChild(t),k=t.sheet}z[p]=1,k.insertRule(`@keyframes ${p} ${a}`,k.cssRules.length)}const f=t.style.animation||"";return t.style.animation=`${f?f+", ":""}${p} ${o}ms linear ${r}ms 1 both`,M+=1,p}function P(t,n){t.style.animation=(t.style.animation||"").split(", ").filter(n?t=>0>t.indexOf(n):t=>-1===t.indexOf("_bp")).join(", "),n&&!--M&&a((()=>{if(M)return;let t=k.cssRules.length;for(;t--;)k.deleteRule(t);z={}}))}function A(t){_=t}const T=[],I=[],C=[],N=[],O=Promise.resolve();let E=0;function R(t){C.push(t)}const j=new Set;let q,F=0;function D(){const t=_;do{for(;T.length>F;){const t=T[F];F++,A(t),J(t.$$)}for(A(null),T.length=0,F=0;I.length;)I.pop()();for(let t=0;C.length>t;t+=1){const n=C[t];j.has(n)||(j.add(n),n())}C.length=0}while(T.length);for(;N.length;)N.pop()();E=0,j.clear(),A(t)}function J(t){if(null!==t.t){t.update(),r(t.before_update);const n=t.u;t.u=[-1],t.t&&t.t.p(t.ctx,n),t.after_update.forEach(R)}}function K(){return q||(q=Promise.resolve(),q.then((()=>{q=null}))),q}function L(t,n,e){t.dispatchEvent(((t,n,e=0)=>{const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e,0,n),o})(`${n?"intro":"outro"}${e}`))}const W=new Set;let X;function Y(){X={r:0,c:[],p:X}}function B(){X.r||r(X.c),X=X.p}function G(t,n){t&&t.i&&(W.delete(t),t.i(n))}function H(t,n,e,o){if(t&&t.o){if(W.has(t))return;W.add(t),X.c.push((()=>{W.delete(t),o&&(e&&t.d(1),o())})),t.o(n)}}const Q={duration:0};function U(e,o,r){let s,c,u=o(e,r),a=0,p=0;function f(){s&&P(e,s)}function m(){const{delay:o=0,duration:r=300,l:i=n,g:m=t,css:h}=u||Q;h&&(s=S(e,0,1,r,o,i,h,p++)),m(0,1);const b=l()+o,g=b+r;c&&c.abort(),a=1,R((()=>L(e,1,"start"))),c=d((t=>{if(a){if(t>=g)return m(1,0),L(e,1,"end"),f(),a=0;if(t>=b){const n=i((t-b)/r);m(n,1-n)}}return a}))}let h=0;return{start(){h||(h=1,P(e),i(u)?(u=u(),K().then(m)):m())},invalidate(){h=0},end(){a&&(f(),a=0)}}}function V(e,o,s){let c,u=o(e,s),a=1;const p=X;function f(){const{delay:o=0,duration:i=300,l:s=n,g:f=t,css:m}=u||Q;m&&(c=S(e,1,0,i,o,s,m));const h=l()+o,b=h+i;R((()=>L(e,0,"start"))),d((t=>{if(a){if(t>=b)return f(0,1),L(e,0,"end"),--p.r||r(p.c),0;if(t>=h){const n=s((t-h)/i);f(1-n,n)}}return a}))}return p.r+=1,i(u)?K().then((()=>{u=u(),f()})):f(),{end(t){t&&u.g&&u.g(1,0),a&&(c&&P(e,c),a=0)}}}function Z(t){t&&t.c()}function tt(t,n,e,s){const{t:c,on_mount:u,on_destroy:l,after_update:a}=t.$$;c&&c.m(n,e),s||R((()=>{const n=u.map(o).filter(i);l?l.push(...n):r(n),t.$$.on_mount=[]})),a.forEach(R)}function nt(t,n){const e=t.$$;null!==e.t&&(r(e.on_destroy),e.t&&e.t.d(n),e.on_destroy=e.t=null,e.ctx=[])}function et(n,e,o,i,s,c,u,l=[-1]){const a=_;A(n);const p=n.$$={t:null,ctx:null,v:c,update:t,not_equal:s,bound:{},on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:{},u:l,skip_bound:0,root:e.target||a.$$.root};u&&u(p.root);let f=0;p.ctx=o?o(n,e.v||{},((t,e,...o)=>{const r=o.length?o[0]:e;return p.ctx&&s(p.ctx[t],p.ctx[t]=r)&&(!p.skip_bound&&p.bound[t]&&p.bound[t](r),f&&((t,n)=>{-1===t.$$.u[0]&&(T.push(t),E||(E=1,O.then(D)),t.$$.u.fill(0)),t.$$.u[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){this.$$set&&0!==Object.keys(t).length&&(this.$$.skip_bound=1,this.$$set(t),this.$$.skip_bound=0)}}function rt(t){const n=t-1;return n*n*n+1}function it(t,{delay:n=0,duration:e=400,l:o=rt,x:r=0,y:i=0,opacity:s=0}={}){const c=getComputedStyle(t),u=+c.opacity,l="none"===c.transform?"":c.transform,a=u*(1-s);return{delay:n,duration:e,l:o,css(t,n){return`\n\t\t\ttransform: ${l} translate(${(1-t)*r}px, ${(1-t)*i}px);\n\t\t\topacity: ${u-a*n}`}}}const st=[];function ct(n,e=t){let o;const r=new Set;function i(t){if(s(n,t)&&(n=t,o)){const t=!st.length;for(const t of r)t[1](),st.push(t,n);if(t){for(let t=0;st.length>t;t+=2)st[t][0](st[t+1]);st.length=0}}}return{set:i,update(t){i(t(n))},subscribe(s,c=t){const u=[s,c];return r.add(u),1===r.size&&(o=e(i)||t),s(n),()=>{r.delete(u),0===r.size&&(o(),o=null)}}}}function ut(t,n){if(t===n||t!=t)return()=>t;const e=typeof t;if(Array.isArray(t)){const e=n.map(((n,e)=>ut(t[e],n)));return t=>e.map((n=>n(t)))}if("number"===e){const e=n-t;return n=>t+n*e}}function lt(t,o={}){const r=ct(t);let i,s=t;function c(c,u){if(null==t)return r.set(t=c),Promise.resolve();s=c;let a=i,p=0,{delay:f=0,duration:m=400,l:h=n,interpolate:b=ut}=e(e({},o),u);if(0===m)return a&&(a.abort(),a=null),r.set(t=s),Promise.resolve();const g=l()+f;let x;return i=d((n=>{if(g>n)return 1;p||(x=b(t,c),"function"==typeof m&&(m=m(t,c)),p=1),a&&(a.abort(),a=null);const e=n-g;return e>m?(r.set(t=c),0):(r.set(t=x(h(e/m))),1)})),i.promise}return{set:c,update(n,e){return c(n(s,t),e)},subscribe:r.subscribe}}const at=ct(0),pt=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches,ft=t=>({l:rt,duration:pt?0:t});function dt(t){let n,e,o,r,i=!t[2]&&mt();return{c(){n=g("div"),i&&i.c(),y(n,"class","bp-load"),v(n,"background-image","url("+t[0]+")")},m(t,e){h(t,n,e),i&&i.m(n,null),r=1},p(e,o){(t=e)[2]?i&&(i.d(1),i=null):i||(i=mt(),i.c(),i.m(n,null)),(!r||1&o)&&v(n,"background-image","url("+t[0]+")")},i(i){r||(R((()=>{o&&o.end(1),e=U(n,it,{duration:t[1]?400:0}),e.start()})),r=1)},o(t){e&&e.invalidate(),t&&(o=V(n,it,{duration:480})),r=0},d(t){t&&b(n),i&&i.d(),t&&o&&o.end()}}}function mt(t){let n,e;return{c(){n=g("span"),e=g("span"),y(n,"class","bp-bar"),y(e,"class","bp-o")},m(t,o){h(t,n,o),h(t,e,o)},d(t){t&&b(n),t&&b(e)}}}function ht(t){let n,e=(!t[1]||t[2])&&dt(t);return{c(){e&&e.c(),n=x()},m(t,o){e&&e.m(t,o),h(t,n,o)},p(t,[o]){!t[1]||t[2]?e?(e.p(t,o),6&o&&G(e,1)):(e=dt(t),e.c(),G(e,1),e.m(n.parentNode,n)):e&&(Y(),H(e,1,1,(()=>{e=null})),B())},i(t){G(e)},o(t){H(e)},d(t){e&&e.d(t),t&&b(n)}}}function bt(t,n,e){let o;c(t,at,(t=>e(2,o=t)));let{thumb:r}=n,{loaded:i}=n;return t.$$set=t=>{"thumb"in t&&e(0,r=t.thumb),"loaded"in t&&e(1,i=t.loaded)},[r,i,o]}class gt extends ot{constructor(t){super(),et(this,t,bt,ht,s,{thumb:0,loaded:1})}}function xt(t){let n,e,o,r,i,s,c,u;return{c(){n=g("img"),y(n,"srcset",e=t[7].img),y(n,"sizes",o=t[8].sizes||t[1]+"px"),y(n,"alt",r=t[7].alt)},m(e,o){h(e,n,o),s=1,c||(u=w(n,"error",t[26]),c=1)},p(t,e){(!s||2&e[0]&&o!==(o=t[8].sizes||t[1]+"px"))&&y(n,"sizes",o)},i(t){s||(i&&i.end(1),s=1)},o(t){i=V(n,it,{}),s=0},d(t){t&&b(n),t&&i&&i.end(),c=0,u()}}}function wt(t){let n,e;return n=new gt({v:{thumb:t[7].thumb,loaded:t[2]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};4&e[0]&&(o.loaded=t[2]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function yt(t){let n,e,o,i,s,c,l=t[2]&&xt(t),a=t[3]&&wt(t);return{c(){n=g("div"),e=g("div"),l&&l.c(),o=x(),a&&a.c(),y(e,"class","bp-img"),v(e,"background-image","url("+t[7].thumb+")"),v(e,"width",t[0][0]+"px"),v(e,"height",t[0][1]+"px"),v(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),$(e,"bp-drag",t[4]),$(e,"bp-canzoom",t[11]>1&&t[12]>t[0][0]),y(n,"class","bp-img-wrap"),$(n,"bp-close",t[5])},m(r,p){h(r,n,p),m(n,e),l&&l.m(e,null),m(e,o),a&&a.m(e,null),i=1,s||(c=[u(t[20].call(null,e)),w(n,"wheel",t[15]),w(n,"pointerdown",t[16]),w(n,"pointermove",t[17]),w(n,"pointerup",t[19]),w(n,"pointercancel",t[18])],s=1)},p(t,r){t[2]?l?(l.p(t,r),4&r[0]&&G(l,1)):(l=xt(t),l.c(),G(l,1),l.m(e,o)):l&&(Y(),H(l,1,1,(()=>{l=null})),B()),t[3]?a?(a.p(t,r),8&r[0]&&G(a,1)):(a=wt(t),a.c(),G(a,1),a.m(e,null)):a&&(Y(),H(a,1,1,(()=>{a=null})),B()),(!i||1&r[0])&&v(e,"width",t[0][0]+"px"),(!i||1&r[0])&&v(e,"height",t[0][1]+"px"),(!i||65&r[0])&&v(e,"transform","translate3d("+(t[0][0]/-2+t[6][0])+"px, "+(t[0][1]/-2+t[6][1])+"px, 0)"),16&r[0]&&$(e,"bp-drag",t[4]),6145&r[0]&&$(e,"bp-canzoom",t[11]>1&&t[12]>t[0][0]),32&r[0]&&$(n,"bp-close",t[5])},i(t){i||(G(l),G(a),i=1)},o(t){H(l),H(a),i=0},d(t){t&&b(n),l&&l.d(),a&&a.d(),s=0,r(c)}}}function vt(t,n,e){let o,r,i,s;c(t,at,(t=>e(25,i=t)));let{v:u}=n,{$:l}=n,{k:a,_:p,M:f,next:d,zoomed:m,container:h}=u;c(t,m,(t=>e(24,o=t)));let b,g,x,w,y,v,$,k,_,M,z,S=a.maxZoom||p.maxZoom||10,P=u.S(a),A=P[0],T=0;const I=+a.width,C=[],N=new Map,O=lt(P,ft(400));c(t,O,(t=>e(0,s=t)));const E=lt([0,0],ft(400));c(t,E,(t=>e(6,r=t)));const R=([t,n],o=s)=>{const r=(o[0]-h.w)/2,i=(o[1]-h.h)/2;return 0>r?t=0:t>r?l?(t=y?r+(t-r)/10:r)>r+20&&e(4,y=f()):t=r:-r>t&&(l?-r-20>(t=y?-r-(-r-t)/10:-r)&&e(4,y=d()):t=-r),0>i?n=0:n>i?n=i:-i>n&&(n=-i),[t,n]};function j(t=S,n){if(i)return;const o=P[0]*S;let c=s[0]+s[0]*t,u=s[1]+s[1]*t;if(t>0)c>o&&(c=o,u=P[1]*S),c>I&&(c=I,u=+a.height);else if(P[0]>c)return O.set(P),E.set([0,0]);let{x:l,y:p,width:f,height:d}=w.getBoundingClientRect();const m=n?n.clientX-l-f/2:0,h=n?n.clientY-p-d/2:0;l=c/f*-m+m,p=u/d*-h+h;const b=[c,u];O.set(b).then((()=>{e(1,A=Math.round(Math.max(A,c)))})),E.set(R([r[0]+l,r[1]+p],b))}Object.defineProperty(a,"zoom",{configurable:1,get(){return o},set(t){return j(t?S:-S)}});const q=t=>N.delete(t.pointerId);return t.$$set=t=>{"$"in t&&e(22,l=t.$)},t.$$.update=()=>{if(8388609&t.$$.u[0]&&m.set(s[0]-10>P[0]),58720256&t.$$.u[0]&&i&&o&&!p.intro){const t=ft(480);E.set([0,0],t),O.set(P,t),e(5,z=1)}},[s,A,b,g,y,z,r,a,p,m,h,S,I,O,E,t=>{p.inline&&!o||(t.preventDefault(),j(t.deltaY/-300,t))},t=>{2!==t.button&&(t.preventDefault(),e(4,y=1),N.set(t.pointerId,t),$=t.clientX,k=t.clientY,_=r[0],M=r[1])},t=>{if(N.size>1)return e(4,y=0),p.noPinch?.(h.el)||(t=>{const[n,e]=N.set(t.pointerId,t).values(),o=Math.hypot(n.clientX-e.clientX,n.clientY-e.clientY);x=x||{clientX:(n.clientX+e.clientX)/2,clientY:(n.clientY+e.clientY)/2},j(((T||o)-o)/-35,x),T=o})(t);if(!y)return;let n=t.clientX,r=t.clientY;v=C.push({x:n,y:r})>2,n-=$,r-=k,o||(-90>r&&e(4,y=!p.noClose&&u.close()),30>Math.abs(r)&&(n>40&&e(4,y=f()),-40>n&&e(4,y=d()))),o&&v&&!i&&E.set(R([_+n,M+r]),{duration:0})},q,function(t){if(q(t),x&&(e(4,y=T=0),x=N.size?x:null),y){if(e(4,y=0),t.target===this&&!p.noClose)return u.close();if(v){const[t,n,e]=C.slice(-3);Math.hypot(n.x-e.x,n.y-e.y)>5&&E.set(R([r[0]-5*(t.x-e.x),r[1]-5*(t.y-e.y)]))}else p.onImageClick?.(h.el,a)||j(o?-S:S,t);v=0,C.length=0}},t=>{w=t,u.P((()=>{e(23,P=u.S(a)),!p.inline&&l||(O.set(P),E.set([0,0]))})),u.A(a).then((()=>{e(2,b=1),u.T()})),setTimeout((()=>{e(3,g=!b)}),250)},u,l,P,o,i,t=>p.onError?.(h,a,t)]}class $t extends ot{constructor(t){super(),et(this,t,vt,yt,s,{v:21,$:22},null,[-1,-1])}}function kt(t){let n,e,o,i,s,c;return o=new gt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=g("div"),e=g("iframe"),Z(o.$$.t),y(e,"allow","autoplay; fullscreen"),y(e,"title",t[2].title),y(n,"class","bp-if"),v(n,"width",t[1][0]+"px"),v(n,"height",t[1][1]+"px")},m(r,l){h(r,n,l),m(n,e),tt(o,n,null),i=1,s||(c=[u(t[3].call(null,e)),w(e,"load",t[5])],s=1)},p(t,[e]){const r={};1&e&&(r.loaded=t[0]),o.$set(r),(!i||2&e)&&v(n,"width",t[1][0]+"px"),(!i||2&e)&&v(n,"height",t[1][1]+"px")},i(t){i||(G(o.$$.t,t),i=1)},o(t){H(o.$$.t,t),i=0},d(t){t&&b(n),nt(o),s=0,r(c)}}}function _t(t,n,e){let o,r,{v:i}=n;const{k:s}=i,c=()=>e(1,r=i.S(s));return c(),i.P(c),[o,r,s,t=>t.src=s.iframe,i,()=>e(0,o=1)]}class Mt extends ot{constructor(t){super(),et(this,t,_t,kt,s,{v:4})}}function zt(t){let n,e,o,r,i;return e=new gt({v:{thumb:t[2].thumb,loaded:t[0]}}),{c(){n=g("div"),Z(e.$$.t),y(n,"class","bp-vid"),v(n,"width",t[1][0]+"px"),v(n,"height",t[1][1]+"px"),v(n,"background-image","url("+t[2].thumb+")")},m(s,c){h(s,n,c),tt(e,n,null),o=1,r||(i=u(t[3].call(null,n)),r=1)},p(t,[r]){const i={};1&r&&(i.loaded=t[0]),e.$set(i),(!o||2&r)&&v(n,"width",t[1][0]+"px"),(!o||2&r)&&v(n,"height",t[1][1]+"px")},i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){t&&b(n),nt(e),r=0,i()}}}function St(t,n,e){let o,r,{v:i}=n;const{k:s,_:c,container:u}=i,l=()=>e(1,r=i.S(s));l(),i.P(l);const a=(t,n)=>{for(const e in n)y(t,e,n[e])};return[o,r,s,t=>{let n;const r=(t,e)=>{Array.isArray(e)||(e=JSON.parse(e));for(const o of e){n||(n=g(o.type?.includes("audio")?"audio":"video"),a(n,{controls:1,autoplay:1,playsinline:1,tabindex:"0"}));const e=g(t);a(e,o),"source"==t&&w(e,"error",(t=>c.onError?.(u,s,t))),m(n,e)}};r("source",s.sources),r("track",s.tracks||[]),w(n,"canplay",(()=>e(0,o=1))),m(t,n)},i]}class Pt extends ot{constructor(t){super(),et(this,t,St,zt,s,{v:4})}}function At(n){let e,o,i,c,l,a,p,f,d,x,v=n[6].i,k=Et(n),_=n[0].length>1&&Rt(n);return{c(){e=g("div"),o=g("div"),k.c(),c=g("div"),l=g("button"),_&&_.c(),y(l,"class","bp-x"),y(l,"title","Close"),y(l,"aria-label","Close"),y(c,"class","bp-controls"),y(e,"class","bp-wrap"),$(e,"bp-zoomed",n[10]),$(e,"bp-inline",n[8]),$(e,"bp-small",n[7]),$(e,"bp-noclose",n[5].noClose)},m(t,r){h(t,e,r),m(e,o),k.m(e,null),m(e,c),m(c,l),_&&_.m(c,null),f=1,d||(x=[w(l,"click",n[1]),u(p=n[14].call(null,e))],d=1)},p(n,o){64&o[0]&&s(v,v=n[6].i)?(Y(),H(k,1,1,t),B(),k=Et(n),k.c(),G(k),k.m(e,c)):k.p(n,o),n[0].length>1?_?_.p(n,o):(_=Rt(n),_.c(),_.m(c,null)):_&&(_.d(1),_=null),1024&o[0]&&$(e,"bp-zoomed",n[10]),256&o[0]&&$(e,"bp-inline",n[8]),128&o[0]&&$(e,"bp-small",n[7]),32&o[0]&&$(e,"bp-noclose",n[5].noClose)},i(t){f||(i&&i.end(1),G(k),a&&a.end(1),f=1)},o(t){i=V(o,it,{duration:480}),H(k),a=V(c,it,{}),f=0},d(t){t&&b(e),t&&i&&i.end(),k.d(t),_&&_.d(),t&&a&&a.end(),d=0,r(x)}}}function Tt(n){let e,o=n[6].html+"";return{c(){e=g("div"),y(e,"class","bp-html")},m(t,n){h(t,e,n),e.innerHTML=o},p(t,n){64&n[0]&&o!==(o=t[6].html+"")&&(e.innerHTML=o)},i:t,o:t,d(t){t&&b(e)}}}function It(n){let e,o;return e=new Mt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Ct(n){let e,o;return e=new Pt({v:{v:n[13]()}}),{c(){Z(e.$$.t)},m(t,n){tt(e,t,n),o=1},p:t,i(t){o||(G(e.$$.t,t),o=1)},o(t){H(e.$$.t,t),o=0},d(t){nt(e,t)}}}function Nt(t){let n,e;return n=new $t({v:{v:t[13](),$:t[7]}}),{c(){Z(n.$$.t)},m(t,o){tt(n,t,o),e=1},p(t,e){const o={};128&e[0]&&(o.$=t[7]),n.$set(o)},i(t){e||(G(n.$$.t,t),e=1)},o(t){H(n.$$.t,t),e=0},d(t){nt(n,t)}}}function Ot(t){let n,e,o,r=t[6].caption+"";return{c(){n=g("div"),y(n,"class","bp-cap")},m(t,e){h(t,n,e),n.innerHTML=r,o=1},p(t,e){(!o||64&e[0])&&r!==(r=t[6].caption+"")&&(n.innerHTML=r)},i(t){o||(e&&e.end(1),o=1)},o(t){e=V(n,it,{duration:200}),o=0},d(t){t&&b(n),t&&e&&e.end()}}}function Et(t){let n,e,o,i,s,c,u,l,a;const p=[Nt,Ct,It,Tt],f=[];function d(t,n){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}e=d(t),o=f[e]=p[e](t);let m=t[6].caption&&Ot(t);return{c(){n=g("div"),o.c(),m&&m.c(),c=x(),y(n,"class","bp-inner")},m(o,r){h(o,n,r),f[e].m(n,null),m&&m.m(o,r),h(o,c,r),u=1,l||(a=[w(n,"pointerdown",t[21]),w(n,"pointerup",t[22])],l=1)},p(t,r){let i=e;e=d(t),e===i?f[e].p(t,r):(Y(),H(f[i],1,1,(()=>{f[i]=null})),B(),o=f[e],o?o.p(t,r):(o=f[e]=p[e](t),o.c()),G(o,1),o.m(n,null)),t[6].caption?m?(m.p(t,r),64&r[0]&&G(m,1)):(m=Ot(t),m.c(),G(m,1),m.m(c.parentNode,c)):m&&(Y(),H(m,1,1,(()=>{m=null})),B())},i(e){u||(G(o),R((()=>{s&&s.end(1),i=U(n,t[12],1),i.start()})),G(m),u=1)},o(e){H(o),i&&i.invalidate(),s=V(n,t[12],0),H(m),u=0},d(t){t&&b(n),f[e].d(),t&&s&&s.end(),m&&m.d(t),t&&b(c),l=0,r(a)}}}function Rt(t){let n,e,o,i,s,c=`${t[4]+1} / ${t[0].length}`;return{c(){n=g("div"),e=g("button"),o=g("button"),y(n,"class","bp-count"),y(e,"class","bp-prev"),y(e,"title","Previous"),y(e,"aria-label","Previous"),y(o,"class","bp-next"),y(o,"title","Next"),y(o,"aria-label","Next")},m(r,u){h(r,n,u),n.innerHTML=c,h(r,e,u),h(r,o,u),i||(s=[w(e,"click",t[2]),w(o,"click",t[3])],i=1)},p(t,e){17&e[0]&&c!==(c=`${t[4]+1} / ${t[0].length}`)&&(n.innerHTML=c)},d(t){t&&b(n),t&&b(e),t&&b(o),i=0,r(s)}}}function jt(t){let n,e,o=t[0]&&At(t);return{c(){o&&o.c(),n=x()},m(t,r){o&&o.m(t,r),h(t,n,r),e=1},p(t,e){t[0]?o?(o.p(t,e),1&e[0]&&G(o,1)):(o=At(t),o.c(),G(o,1),o.m(n.parentNode,n)):o&&(Y(),H(o,1,1,(()=>{o=null})),B())},i(t){e||(G(o),e=1)},o(t){H(o),e=0},d(t){o&&o.d(t),t&&b(n)}}}function qt(t,n,e){let o,{items:r}=n,{target:i}=n;const s=document.documentElement;let u,l,a,p,f,d,m,h,b,x,y;const v=t=>y=t,$={},k=ct(0);c(t,k,(t=>e(10,o=t)));const _=()=>{l.onClose?.($.el,b),at.set(1),e(0,r=null),p?.focus({preventScroll:1})},M=()=>S(u-1),z=()=>S(u+1),S=t=>{m=t-u,e(4,u=P(t))},P=t=>(t+r.length)%r.length,A=t=>{const{key:n,shiftKey:e}=t;if("Escape"===n)!l.noClose&&_();else if("ArrowRight"===n)z();else if("ArrowLeft"===n)M();else if("Tab"===n){const{activeElement:n}=document;if(e||!n.controls){t.preventDefault();const{focusWrap:o=$.el}=l,r=[...o.querySelectorAll("*")].filter((t=>t.tabIndex>=0));let i=r.indexOf(n);i+=r.length+(e?-1:1),r[i%r.length].focus()}}},T=({width:t=1920,height:n=1080})=>{const{scale:e=.99}=l,o=Math.min(1,$.w/t*e,$.h/n*e);return[Math.round(t*o),Math.round(n*o)]},I=()=>{if(r){const t=r[P(u+1)],n=r[P(u-1)];!t.preload&&C(t),!n.preload&&C(n)}},C=t=>{if(t.img){const n=g("img");return n.sizes=l.sizes||T(t)[0]+"px",n.srcset=t.img,t.preload=1,n.decode().catch((t=>{}))}};return t.$$set=t=>{"items"in t&&e(0,r=t.items),"target"in t&&e(15,i=t.target)},t.$$.update=()=>{1835121&t.$$.u[0]&&r&&(e(6,b=r[u]),e(19,x=b.hasOwnProperty("html")),a&&(x&&v(null),l.onUpdate?.($.el,b)))},[r,_,M,z,u,l,b,f,d,h,o,k,(t,n)=>a&&r?it(t,{x:(m>0?20:-20)*(n?1:-1),duration:250}):(e(18,a=n),l.intro?it(t,{y:n?10:-10}):(t=>{let n;if(x){const e=t.firstChild.firstChild;n=[e.clientWidth,e.clientHeight]}else n=T(b);const e=(b.element||p).getBoundingClientRect(),o=e.left-($.w-e.width)/2,r=e.top-($.h-e.height)/2,i=e.width/n[0],s=e.height/n[1];return{duration:480,l:rt,css:(t,n)=>`transform:translate3d(${o*n}px, ${r*n}px, 0) scale3d(${i+t*(1-i)}, ${s+t*(1-s)}, 1)`}})(t)),()=>({k:b,S:T,A:C,T:I,_:l,M,next:z,close:_,P:v,zoomed:k,container:$}),t=>{let n,o;e(20,$.el=t,$),l.onOpen?.($.el,b),d||(n=w(globalThis,"keydown",A));const r=new ResizeObserver((t=>{o&&(e(20,$.w=t[0].contentRect.width,$),e(20,$.h=t[0].contentRect.height,$),e(7,f=769>$.w),y?.(),l.onResize?.($.el,b)),o=1}));return r.observe(t),{destroy(){r.disconnect(),n?.(),at.set(0),s.classList.remove("bp-lock"),l.onClosed?.()}}},i,t=>{e(5,l=t),e(8,d=l.inline);const n=l.items;!d&&s.scrollHeight>s.clientHeight&&s.classList.add("bp-lock"),p=document.activeElement,e(20,$.w=i.offsetWidth,$),e(20,$.h=i===document.body?globalThis.innerHeight:i.clientHeight,$),e(7,f=769>$.w),e(4,u=l.position||0),e(0,r=Array.isArray(n)?n.map(((t,n)=>(l.el&&l.el===t.element&&e(4,u=n),{i:n,...t}))):(n.length?[...n]:[n]).map(((t,n)=>(l.el===t&&e(4,u=n),{element:t,i:n,...t.dataset}))))},S,a,x,$,t=>e(9,h=t.target),function(t){2!==t.button&&t.target===this&&h===this&&!l.noClose&&_()}]}class Ft extends ot{constructor(t){super(),et(this,t,qt,jt,s,{items:0,target:15,open:16,close:1,M:2,next:3,setPosition:17},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[15]}get open(){return this.$$.ctx[16]}get close(){return this.$$.ctx[1]}get M(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[17]}}function Dt(t){return new Ft({...t,v:t})}export{Dt as default}; diff --git a/dist/bigger-picture.mjs b/dist/bigger-picture.mjs index e8fe10f..79a3f39 100644 --- a/dist/bigger-picture.mjs +++ b/dist/bigger-picture.mjs @@ -881,7 +881,7 @@ function create_if_block_1$1(ctx) { current = true; if (!mounted) { - dispose = listen(img, "error", /*error_handler*/ ctx[24]); + dispose = listen(img, "error", /*error_handler*/ ctx[26]); mounted = true; } }, @@ -908,7 +908,7 @@ function create_if_block_1$1(ctx) { }; } -// (375:10) {#if showLoader} +// (374:10) {#if showLoader} function create_if_block$1(ctx) { let loading; let current; @@ -970,8 +970,9 @@ function create_fragment$3(ctx) { set_style(div0, "width", /*$imageDimensions*/ ctx[0][0] + "px"); set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px"); set_style(div0, "transform", "translate3d(" + (/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]) + "px, " + (/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]) + "px, 0)"); + toggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]); + toggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]); attr(div1, "class", "bp-img-wrap"); - toggle_class(div1, "bp-drag", /*pointerDown*/ ctx[4]); toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]); }, m(target, anchor) { @@ -984,12 +985,12 @@ function create_fragment$3(ctx) { if (!mounted) { dispose = [ - action_destroyer(/*onMount*/ ctx[18].call(null, div0)), - listen(div1, "wheel", /*onWheel*/ ctx[13]), - listen(div1, "pointerdown", /*onPointerDown*/ ctx[14]), - listen(div1, "pointermove", /*onPointerMove*/ ctx[15]), - listen(div1, "pointerup", /*onPointerUp*/ ctx[17]), - listen(div1, "pointercancel", /*removeEventFromCache*/ ctx[16]) + action_destroyer(/*onMount*/ ctx[20].call(null, div0)), + listen(div1, "wheel", /*onWheel*/ ctx[15]), + listen(div1, "pointerdown", /*onPointerDown*/ ctx[16]), + listen(div1, "pointermove", /*onPointerMove*/ ctx[17]), + listen(div1, "pointerup", /*onPointerUp*/ ctx[19]), + listen(div1, "pointercancel", /*removeEventFromCache*/ ctx[18]) ]; mounted = true; @@ -1055,7 +1056,11 @@ function create_fragment$3(ctx) { } if (dirty[0] & /*pointerDown*/ 16) { - toggle_class(div1, "bp-drag", /*pointerDown*/ ctx[4]); + toggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]); + } + + if (dirty[0] & /*maxZoom, $imageDimensions, naturalWidth*/ 6145) { + toggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]); } if (dirty[0] & /*closingWhileZoomed*/ 32) { @@ -1088,11 +1093,11 @@ function instance$3($$self, $$props, $$invalidate) { let $zoomDragTranslate; let $closing; let $imageDimensions; - component_subscribe($$self, closing, $$value => $$invalidate(23, $closing = $$value)); + component_subscribe($$self, closing, $$value => $$invalidate(25, $closing = $$value)); let { props } = $$props; let { smallScreen } = $$props; let { activeItem, opts, prev, next, zoomed, container } = props; - component_subscribe($$self, zoomed, value => $$invalidate(22, $zoomed = value)); + component_subscribe($$self, zoomed, value => $$invalidate(24, $zoomed = value)); let maxZoom = activeItem.maxZoom || opts.maxZoom || 10; let calculatedDimensions = props.calculateDimensions(activeItem); @@ -1199,9 +1204,8 @@ function instance$3($$self, $$props, $$invalidate) { } const maxWidth = calculatedDimensions[0] * maxZoom; - const [currentImageWidth, currentImageHeight] = $imageDimensions; - let newWidth = currentImageWidth + currentImageWidth * amt; - let newHeight = currentImageHeight + currentImageHeight * amt; + let newWidth = $imageDimensions[0] + $imageDimensions[0] * amt; + let newHeight = $imageDimensions[1] + $imageDimensions[1] * amt; if (amt > 0) { if (newWidth > maxWidth) { @@ -1408,7 +1412,7 @@ function instance$3($$self, $$props, $$invalidate) { // handle globalThis resize props.setResizeFunc(() => { - $$invalidate(21, calculatedDimensions = props.calculateDimensions(activeItem)); + $$invalidate(23, calculatedDimensions = props.calculateDimensions(activeItem)); // adjust image size / zoom on resize, but not on mobile because // some browsers (ios safari 15) constantly resize screen on drag @@ -1437,15 +1441,15 @@ function instance$3($$self, $$props, $$invalidate) { $$self.$$set = $$props => { - if ('smallScreen' in $$props) $$invalidate(20, smallScreen = $$props.smallScreen); + if ('smallScreen' in $$props) $$invalidate(22, smallScreen = $$props.smallScreen); }; $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*$imageDimensions, calculatedDimensions*/ 2097153) { + if ($$self.$$.dirty[0] & /*$imageDimensions, calculatedDimensions*/ 8388609) { zoomed.set($imageDimensions[0] - 10 > calculatedDimensions[0]); } - if ($$self.$$.dirty[0] & /*$closing, $zoomed, calculatedDimensions*/ 14680064) { + if ($$self.$$.dirty[0] & /*$closing, $zoomed, calculatedDimensions*/ 58720256) { // if zoomed while closing, zoom out image and add class // to change contain value on .bp-wrap to avoid cropping if ($closing && $zoomed && !opts.intro) { @@ -1469,6 +1473,8 @@ function instance$3($$self, $$props, $$invalidate) { opts, zoomed, container, + maxZoom, + naturalWidth, imageDimensions, zoomDragTranslate, onWheel, @@ -1489,7 +1495,7 @@ function instance$3($$self, $$props, $$invalidate) { class Image extends SvelteComponent { constructor(options) { super(); - init(this, options, instance$3, create_fragment$3, not_equal, { props: 19, smallScreen: 20 }, null, [-1, -1]); + init(this, options, instance$3, create_fragment$3, not_equal, { props: 21, smallScreen: 22 }, null, [-1, -1]); } } diff --git a/dist/bigger-picture.scss b/dist/bigger-picture.scss index eea4e74..a503e7b 100644 --- a/dist/bigger-picture.scss +++ b/dist/bigger-picture.scss @@ -74,10 +74,11 @@ @include bpfillall; position: absolute; contain: strict; - &.bp-drag { - .bp-img { - cursor: grabbing; - } + .bp-canzoom { + cursor: zoom-in; + } + .bp-drag { + cursor: grabbing; } } @@ -91,7 +92,6 @@ top: 50%; left: 50%; user-select: none; - cursor: zoom-in; background-size: 100% 100%; img, div { @@ -103,7 +103,7 @@ } } .bp-zoomed { - .bp-img { + .bp-img:not(.bp-drag) { cursor: grab; } .bp-cap { diff --git a/dist/bigger-picture.umd.js b/dist/bigger-picture.umd.js index c231c7e..1f3604e 100644 --- a/dist/bigger-picture.umd.js +++ b/dist/bigger-picture.umd.js @@ -886,7 +886,7 @@ current = true; if (!mounted) { - dispose = listen(img, "error", /*error_handler*/ ctx[24]); + dispose = listen(img, "error", /*error_handler*/ ctx[26]); mounted = true; } }, @@ -913,7 +913,7 @@ }; } - // (375:10) {#if showLoader} + // (374:10) {#if showLoader} function create_if_block$1(ctx) { let loading; let current; @@ -975,8 +975,9 @@ set_style(div0, "width", /*$imageDimensions*/ ctx[0][0] + "px"); set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px"); set_style(div0, "transform", "translate3d(" + (/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]) + "px, " + (/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]) + "px, 0)"); + toggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]); + toggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]); attr(div1, "class", "bp-img-wrap"); - toggle_class(div1, "bp-drag", /*pointerDown*/ ctx[4]); toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]); }, m(target, anchor) { @@ -989,12 +990,12 @@ if (!mounted) { dispose = [ - action_destroyer(/*onMount*/ ctx[18].call(null, div0)), - listen(div1, "wheel", /*onWheel*/ ctx[13]), - listen(div1, "pointerdown", /*onPointerDown*/ ctx[14]), - listen(div1, "pointermove", /*onPointerMove*/ ctx[15]), - listen(div1, "pointerup", /*onPointerUp*/ ctx[17]), - listen(div1, "pointercancel", /*removeEventFromCache*/ ctx[16]) + action_destroyer(/*onMount*/ ctx[20].call(null, div0)), + listen(div1, "wheel", /*onWheel*/ ctx[15]), + listen(div1, "pointerdown", /*onPointerDown*/ ctx[16]), + listen(div1, "pointermove", /*onPointerMove*/ ctx[17]), + listen(div1, "pointerup", /*onPointerUp*/ ctx[19]), + listen(div1, "pointercancel", /*removeEventFromCache*/ ctx[18]) ]; mounted = true; @@ -1060,7 +1061,11 @@ } if (dirty[0] & /*pointerDown*/ 16) { - toggle_class(div1, "bp-drag", /*pointerDown*/ ctx[4]); + toggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]); + } + + if (dirty[0] & /*maxZoom, $imageDimensions, naturalWidth*/ 6145) { + toggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]); } if (dirty[0] & /*closingWhileZoomed*/ 32) { @@ -1093,11 +1098,11 @@ let $zoomDragTranslate; let $closing; let $imageDimensions; - component_subscribe($$self, closing, $$value => $$invalidate(23, $closing = $$value)); + component_subscribe($$self, closing, $$value => $$invalidate(25, $closing = $$value)); let { props } = $$props; let { smallScreen } = $$props; let { activeItem, opts, prev, next, zoomed, container } = props; - component_subscribe($$self, zoomed, value => $$invalidate(22, $zoomed = value)); + component_subscribe($$self, zoomed, value => $$invalidate(24, $zoomed = value)); let maxZoom = activeItem.maxZoom || opts.maxZoom || 10; let calculatedDimensions = props.calculateDimensions(activeItem); @@ -1204,9 +1209,8 @@ } const maxWidth = calculatedDimensions[0] * maxZoom; - const [currentImageWidth, currentImageHeight] = $imageDimensions; - let newWidth = currentImageWidth + currentImageWidth * amt; - let newHeight = currentImageHeight + currentImageHeight * amt; + let newWidth = $imageDimensions[0] + $imageDimensions[0] * amt; + let newHeight = $imageDimensions[1] + $imageDimensions[1] * amt; if (amt > 0) { if (newWidth > maxWidth) { @@ -1413,7 +1417,7 @@ // handle globalThis resize props.setResizeFunc(() => { - $$invalidate(21, calculatedDimensions = props.calculateDimensions(activeItem)); + $$invalidate(23, calculatedDimensions = props.calculateDimensions(activeItem)); // adjust image size / zoom on resize, but not on mobile because // some browsers (ios safari 15) constantly resize screen on drag @@ -1442,15 +1446,15 @@ $$self.$$set = $$props => { - if ('smallScreen' in $$props) $$invalidate(20, smallScreen = $$props.smallScreen); + if ('smallScreen' in $$props) $$invalidate(22, smallScreen = $$props.smallScreen); }; $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*$imageDimensions, calculatedDimensions*/ 2097153) { + if ($$self.$$.dirty[0] & /*$imageDimensions, calculatedDimensions*/ 8388609) { zoomed.set($imageDimensions[0] - 10 > calculatedDimensions[0]); } - if ($$self.$$.dirty[0] & /*$closing, $zoomed, calculatedDimensions*/ 14680064) { + if ($$self.$$.dirty[0] & /*$closing, $zoomed, calculatedDimensions*/ 58720256) { // if zoomed while closing, zoom out image and add class // to change contain value on .bp-wrap to avoid cropping if ($closing && $zoomed && !opts.intro) { @@ -1474,6 +1478,8 @@ opts, zoomed, container, + maxZoom, + naturalWidth, imageDimensions, zoomDragTranslate, onWheel, @@ -1494,7 +1500,7 @@ class Image extends SvelteComponent { constructor(options) { super(); - init(this, options, instance$3, create_fragment$3, not_equal, { props: 19, smallScreen: 20 }, null, [-1, -1]); + init(this, options, instance$3, create_fragment$3, not_equal, { props: 21, smallScreen: 22 }, null, [-1, -1]); } } diff --git a/package.json b/package.json index 842ae74..8917978 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bigger-picture", - "version": "1.1.8", + "version": "1.1.9", "type": "module", "exports": { ".": {