diff --git a/dist/bigger-picture.cjs b/dist/bigger-picture.cjs index a773a37..f9d53a4 100644 --- a/dist/bigger-picture.cjs +++ b/dist/bigger-picture.cjs @@ -698,57 +698,36 @@ const defaultTweenOptions = (duration) => ({ /* src/components/loading.svelte generated by Svelte v3.47.0 */ -function create_if_block$2(ctx) { +function create_if_block_1$2(ctx) { let div; - let div_intro; + let span0; + let span1; let div_outro; let current; - let if_block = !/*$closing*/ ctx[2] && create_if_block_1$2(); return { c() { div = element("div"); - if (if_block) if_block.c(); + span0 = element("span"); + span1 = element("span"); + attr(span0, "class", "bp-bar"); + attr(span1, "class", "bp-o"); attr(div, "class", "bp-load"); - set_style(div, "background-image", "url(" + /*thumb*/ ctx[0] + ")"); + attr(div, "style", /*style*/ ctx[2]); }, m(target, anchor) { insert(target, div, anchor); - if (if_block) if_block.m(div, null); + append(div, span0); + append(div, span1); current = true; }, - p(new_ctx, dirty) { - ctx = new_ctx; - - if (!/*$closing*/ ctx[2]) { - if (if_block) ; else { - if_block = create_if_block_1$2(); - if_block.c(); - if_block.m(div, null); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - - if (!current || dirty & /*thumb*/ 1) { - set_style(div, "background-image", "url(" + /*thumb*/ ctx[0] + ")"); - } - }, + p: noop, i(local) { if (current) return; - - add_render_callback(() => { - if (div_outro) div_outro.end(1); - div_intro = create_in_transition(div, fly, { duration: /*loaded*/ ctx[1] ? 400 : 0 }); - div_intro.start(); - }); - + if (div_outro) div_outro.end(1); current = true; }, o(local) { - if (div_intro) div_intro.invalidate(); - if (local) { div_outro = create_out_transition(div, fly, { duration: 480 }); } @@ -757,103 +736,137 @@ function create_if_block$2(ctx) { }, d(detaching) { if (detaching) detach(div); - if (if_block) if_block.d(); if (detaching && div_outro) div_outro.end(); } }; } -// (12:2) {#if !$closing} -function create_if_block_1$2(ctx) { - let span0; - let span1; +// (9:140) {#if $closing} +function create_if_block$2(ctx) { + let div; + let div_intro; return { c() { - span0 = element("span"); - span1 = element("span"); - attr(span0, "class", "bp-bar"); - attr(span1, "class", "bp-o"); + div = element("div"); + attr(div, "class", "bp-load"); + attr(div, "style", /*style*/ ctx[2]); }, m(target, anchor) { - insert(target, span0, anchor); - insert(target, span1, anchor); + insert(target, div, anchor); + }, + p: noop, + i(local) { + if (!div_intro) { + add_render_callback(() => { + div_intro = create_in_transition(div, fly, { duration: 480 }); + div_intro.start(); + }); + } }, + o: noop, d(detaching) { - if (detaching) detach(span0); - if (detaching) detach(span1); + if (detaching) detach(div); } }; } function create_fragment$4(ctx) { - let if_block_anchor; - let if_block = (!/*loaded*/ ctx[1] || /*$closing*/ ctx[2]) && create_if_block$2(ctx); + let if_block0_anchor; + let if_block1_anchor; + let if_block0 = !/*loaded*/ ctx[0] && create_if_block_1$2(ctx); + let if_block1 = /*$closing*/ ctx[1] && create_if_block$2(ctx); return { c() { - if (if_block) if_block.c(); - if_block_anchor = empty(); + if (if_block0) if_block0.c(); + if_block0_anchor = empty(); + if (if_block1) if_block1.c(); + if_block1_anchor = empty(); }, m(target, anchor) { - if (if_block) if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); + if (if_block0) if_block0.m(target, anchor); + insert(target, if_block0_anchor, anchor); + if (if_block1) if_block1.m(target, anchor); + insert(target, if_block1_anchor, anchor); }, p(ctx, [dirty]) { - if (!/*loaded*/ ctx[1] || /*$closing*/ ctx[2]) { - if (if_block) { - if_block.p(ctx, dirty); + if (!/*loaded*/ ctx[0]) { + if (if_block0) { + if_block0.p(ctx, dirty); - if (dirty & /*loaded, $closing*/ 6) { - transition_in(if_block, 1); + if (dirty & /*loaded*/ 1) { + transition_in(if_block0, 1); } } else { - if_block = create_if_block$2(ctx); - if_block.c(); - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); + if_block0 = create_if_block_1$2(ctx); + if_block0.c(); + transition_in(if_block0, 1); + if_block0.m(if_block0_anchor.parentNode, if_block0_anchor); } - } else if (if_block) { + } else if (if_block0) { group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; + transition_out(if_block0, 1, 1, () => { + if_block0 = null; }); check_outros(); } + + if (/*$closing*/ ctx[1]) { + if (if_block1) { + if_block1.p(ctx, dirty); + + if (dirty & /*$closing*/ 2) { + transition_in(if_block1, 1); + } + } else { + if_block1 = create_if_block$2(ctx); + if_block1.c(); + transition_in(if_block1, 1); + if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); + } + } else if (if_block1) { + if_block1.d(1); + if_block1 = null; + } }, i(local) { - transition_in(if_block); + transition_in(if_block0); + transition_in(if_block1); }, o(local) { - transition_out(if_block); + transition_out(if_block0); }, d(detaching) { - if (if_block) if_block.d(detaching); - if (detaching) detach(if_block_anchor); + if (if_block0) if_block0.d(detaching); + if (detaching) detach(if_block0_anchor); + if (if_block1) if_block1.d(detaching); + if (detaching) detach(if_block1_anchor); } }; } function instance$4($$self, $$props, $$invalidate) { let $closing; - component_subscribe($$self, closing, $$value => $$invalidate(2, $closing = $$value)); + component_subscribe($$self, closing, $$value => $$invalidate(1, $closing = $$value)); let { thumb } = $$props; let { loaded } = $$props; + const style = `background-image:url(${thumb})`; $$self.$$set = $$props => { - if ('thumb' in $$props) $$invalidate(0, thumb = $$props.thumb); - if ('loaded' in $$props) $$invalidate(1, loaded = $$props.loaded); + if ('thumb' in $$props) $$invalidate(3, thumb = $$props.thumb); + if ('loaded' in $$props) $$invalidate(0, loaded = $$props.loaded); }; - return [thumb, loaded, $closing]; + return [loaded, $closing, style, thumb]; } class Loading extends SvelteComponent { constructor(options) { super(); - init(this, options, instance$4, create_fragment$4, not_equal, { thumb: 0, loaded: 1 }); + init(this, options, instance$4, create_fragment$4, not_equal, { thumb: 3, loaded: 0 }); } } @@ -1836,9 +1849,16 @@ function create_if_block(ctx) { current = true; }, o(local) { - div0_outro = create_out_transition(div0, fly, { duration: 480 }); + if (local) { + div0_outro = create_out_transition(div0, fly, { duration: 480 }); + } + transition_out(key_block); - div1_outro = create_out_transition(div1, fly, {}); + + if (local) { + div1_outro = create_out_transition(div1, fly, {}); + } + current = false; }, d(detaching) { @@ -2018,7 +2038,7 @@ function create_if_block_2(ctx) { }; } -// (308:37) {#key activeItem.i} +// (308:43) {#key activeItem.i} function create_key_block(ctx) { let div; let current_block_type_index; @@ -2149,7 +2169,7 @@ function create_key_block(ctx) { }; } -// (319:509) {#if items.length > 1} +// (319:522) {#if items.length > 1} function create_if_block_1(ctx) { let div; let raw_value = `${/*position*/ ctx[4] + 1} / ${/*items*/ ctx[0].length}` + ""; diff --git a/dist/bigger-picture.min.js b/dist/bigger-picture.min.js index fcab47a..8444527 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,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})}(); +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 y(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 w(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(n){let e,o,r,i,s;return{c(){e=g("div"),o=g("span"),r=g("span"),v(o,"class","bp-bar"),v(r,"class","bp-o"),v(e,"class","bp-load"),v(e,"style",n[2])},m(t,n){h(t,e,n),m(e,o),m(e,r),s=1},p:t,i(t){s||(i&&i.end(1),s=1)},o(t){t&&(i=V(e,it,{duration:480})),s=0},d(t){t&&b(e),t&&i&&i.end()}}}function mt(n){let e,o;return{c(){e=g("div"),v(e,"class","bp-load"),v(e,"style",n[2])},m(t,n){h(t,e,n)},p:t,i(t){o||R((()=>{o=U(e,it,{duration:480}),o.start()}))},o:t,d(t){t&&b(e)}}}function ht(t){let n,e,o=!t[0]&&dt(t),r=t[1]&&mt(t);return{c(){o&&o.c(),n=x(),r&&r.c(),e=x()},m(t,i){o&&o.m(t,i),h(t,n,i),r&&r.m(t,i),h(t,e,i)},p(t,[i]){t[0]?o&&(X(),H(o,1,1,(()=>{o=null})),Y()):o?(o.p(t,i),1&i&&G(o,1)):(o=dt(t),o.c(),G(o,1),o.m(n.parentNode,n)),t[1]?r?(r.p(t,i),2&i&&G(r,1)):(r=mt(t),r.c(),G(r,1),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i(t){G(o),G(r)},o(t){H(o)},d(t){o&&o.d(t),t&&b(n),r&&r.d(t),t&&b(e)}}}function bt(t,n,e){let o;c(t,at,(t=>e(1,o=t)));let{thumb:r}=n,{loaded:i}=n;const s=`background-image:url(${r})`;return t.$$set=t=>{"thumb"in t&&e(3,r=t.thumb),"loaded"in t&&e(0,i=t.loaded)},[i,o,s,r]}class gt extends ot{constructor(t){super(),et(this,t,bt,ht,s,{thumb:3,loaded:0})}}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=y(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 yt(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]&&yt(t);return{c(){n=g("div"),e=g("div"),l&&l.c(),o=x(),a&&a.c(),v(e,"class","bp-img"),w(e,"background-image","url("+t[7].thumb+")"),w(e,"width",t[0][0]+"px"),w(e,"height",t[0][1]+"px"),w(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)),y(n,"wheel",t[15]),y(n,"pointerdown",t[16]),y(n,"pointermove",t[17]),y(n,"pointerup",t[19]),y(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=yt(t),a.c(),G(a,1),a.m(e,null)):a&&(X(),H(a,1,1,(()=>{a=null})),Y()),(!i||1&r[0])&&w(e,"width",t[0][0]+"px"),(!i||1&r[0])&&w(e,"height",t[0][1]+"px"),(!i||65&r[0])&&w(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 wt(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,y,v,w,$,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}=y.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;w=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&&w&&!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(w){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);w=0,C.length=0}},t=>{y=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,wt,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"),w(n,"width",t[1][0]+"px"),w(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)),y(e,"load",t[5])],s=1)},p(t,[e]){const r={};1&e&&(r.loaded=t[0]),o.$set(r),(!i||2&e)&&w(n,"width",t[1][0]+"px"),(!i||2&e)&&w(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"),w(n,"width",t[1][0]+"px"),w(n,"height",t[1][1]+"px"),w(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)&&w(n,"width",t[1][0]+"px"),(!o||2&r)&&w(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&&y(e,"error",(t=>c.onError?.(u,s,t))),m(n,e)}};r("source",s.sources),r("track",s.tracks||[]),y(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,w=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=[y(l,"click",n[1]),u(p=n[14].call(null,e))],d=1)},p(n,o){64&o[0]&&s(w,w=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){t&&(i=V(o,it,{duration:480})),H(k),t&&(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=[y(n,"pointerdown",t[21]),y(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=[y(e,"click",t[2]),y(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 w=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&&w(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:w,zoomed:k,container:$}),t=>{let n,o;e(20,$.el=t,$),l.onOpen?.($.el,b),d||(n=y(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 8dc1776..ceaf6a3 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,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}; +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 y(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function w(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(n){let e,o,r,i,s;return{c(){e=g("div"),o=g("span"),r=g("span"),w(o,"class","bp-bar"),w(r,"class","bp-o"),w(e,"class","bp-load"),w(e,"style",n[2])},m(t,n){h(t,e,n),m(e,o),m(e,r),s=1},p:t,i(t){s||(i&&i.end(1),s=1)},o(t){t&&(i=V(e,it,{duration:480})),s=0},d(t){t&&b(e),t&&i&&i.end()}}}function mt(n){let e,o;return{c(){e=g("div"),w(e,"class","bp-load"),w(e,"style",n[2])},m(t,n){h(t,e,n)},p:t,i(t){o||R((()=>{o=U(e,it,{duration:480}),o.start()}))},o:t,d(t){t&&b(e)}}}function ht(t){let n,e,o=!t[0]&&dt(t),r=t[1]&&mt(t);return{c(){o&&o.c(),n=x(),r&&r.c(),e=x()},m(t,i){o&&o.m(t,i),h(t,n,i),r&&r.m(t,i),h(t,e,i)},p(t,[i]){t[0]?o&&(Y(),H(o,1,1,(()=>{o=null})),B()):o?(o.p(t,i),1&i&&G(o,1)):(o=dt(t),o.c(),G(o,1),o.m(n.parentNode,n)),t[1]?r?(r.p(t,i),2&i&&G(r,1)):(r=mt(t),r.c(),G(r,1),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i(t){G(o),G(r)},o(t){H(o)},d(t){o&&o.d(t),t&&b(n),r&&r.d(t),t&&b(e)}}}function bt(t,n,e){let o;c(t,at,(t=>e(1,o=t)));let{thumb:r}=n,{loaded:i}=n;const s=`background-image:url(${r})`;return t.$$set=t=>{"thumb"in t&&e(3,r=t.thumb),"loaded"in t&&e(0,i=t.loaded)},[i,o,s,r]}class gt extends ot{constructor(t){super(),et(this,t,bt,ht,s,{thumb:3,loaded:0})}}function xt(t){let n,e,o,r,i,s,c,u;return{c(){n=g("img"),w(n,"srcset",e=t[7].img),w(n,"sizes",o=t[8].sizes||t[1]+"px"),w(n,"alt",r=t[7].alt)},m(e,o){h(e,n,o),s=1,c||(u=y(n,"error",t[26]),c=1)},p(t,e){(!s||2&e[0]&&o!==(o=t[8].sizes||t[1]+"px"))&&w(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 yt(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 wt(t){let n,e,o,i,s,c,l=t[2]&&xt(t),a=t[3]&&yt(t);return{c(){n=g("div"),e=g("div"),l&&l.c(),o=x(),a&&a.c(),w(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]),w(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)),y(n,"wheel",t[15]),y(n,"pointerdown",t[16]),y(n,"pointermove",t[17]),y(n,"pointerup",t[19]),y(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=yt(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,y,w,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=w?r+(t-r)/10:r)>r+20&&e(4,w=f()):t=r:-r>t&&(l?-r-20>(t=w?-r-(-r-t)/10:-r)&&e(4,w=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}=y.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,w,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,w=1),N.set(t.pointerId,t),$=t.clientX,k=t.clientY,_=r[0],M=r[1])},t=>{if(N.size>1)return e(4,w=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(!w)return;let n=t.clientX,r=t.clientY;v=C.push({x:n,y:r})>2,n-=$,r-=k,o||(-90>r&&e(4,w=!p.noClose&&u.close()),30>Math.abs(r)&&(n>40&&e(4,w=f()),-40>n&&e(4,w=d()))),o&&v&&!i&&E.set(R([_+n,M+r]),{duration:0})},q,function(t){if(q(t),x&&(e(4,w=T=0),x=N.size?x:null),w){if(e(4,w=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=>{y=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,wt,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),w(e,"allow","autoplay; fullscreen"),w(e,"title",t[2].title),w(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)),y(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),w(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)w(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&&y(e,"error",(t=>c.onError?.(u,s,t))),m(n,e)}};r("source",s.sources),r("track",s.tracks||[]),y(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(),w(l,"class","bp-x"),w(l,"title","Close"),w(l,"aria-label","Close"),w(c,"class","bp-controls"),w(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=[y(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){t&&(i=V(o,it,{duration:480})),H(k),t&&(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"),w(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"),w(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(),w(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=[y(n,"pointerdown",t[21]),y(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"),w(n,"class","bp-count"),w(e,"class","bp-prev"),w(e,"title","Previous"),w(e,"aria-label","Previous"),w(o,"class","bp-next"),w(o,"title","Next"),w(o,"aria-label","Next")},m(r,u){h(r,n,u),n.innerHTML=c,h(r,e,u),h(r,o,u),i||(s=[y(e,"click",t[2]),y(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,w;const v=t=>w=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=y(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),w?.(),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 79a3f39..aca4a2f 100644 --- a/dist/bigger-picture.mjs +++ b/dist/bigger-picture.mjs @@ -698,57 +698,36 @@ const defaultTweenOptions = (duration) => ({ /* src/components/loading.svelte generated by Svelte v3.47.0 */ -function create_if_block$2(ctx) { +function create_if_block_1$2(ctx) { let div; - let div_intro; + let span0; + let span1; let div_outro; let current; - let if_block = !/*$closing*/ ctx[2] && create_if_block_1$2(); return { c() { div = element("div"); - if (if_block) if_block.c(); + span0 = element("span"); + span1 = element("span"); + attr(span0, "class", "bp-bar"); + attr(span1, "class", "bp-o"); attr(div, "class", "bp-load"); - set_style(div, "background-image", "url(" + /*thumb*/ ctx[0] + ")"); + attr(div, "style", /*style*/ ctx[2]); }, m(target, anchor) { insert(target, div, anchor); - if (if_block) if_block.m(div, null); + append(div, span0); + append(div, span1); current = true; }, - p(new_ctx, dirty) { - ctx = new_ctx; - - if (!/*$closing*/ ctx[2]) { - if (if_block) ; else { - if_block = create_if_block_1$2(); - if_block.c(); - if_block.m(div, null); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - - if (!current || dirty & /*thumb*/ 1) { - set_style(div, "background-image", "url(" + /*thumb*/ ctx[0] + ")"); - } - }, + p: noop, i(local) { if (current) return; - - add_render_callback(() => { - if (div_outro) div_outro.end(1); - div_intro = create_in_transition(div, fly, { duration: /*loaded*/ ctx[1] ? 400 : 0 }); - div_intro.start(); - }); - + if (div_outro) div_outro.end(1); current = true; }, o(local) { - if (div_intro) div_intro.invalidate(); - if (local) { div_outro = create_out_transition(div, fly, { duration: 480 }); } @@ -757,103 +736,137 @@ function create_if_block$2(ctx) { }, d(detaching) { if (detaching) detach(div); - if (if_block) if_block.d(); if (detaching && div_outro) div_outro.end(); } }; } -// (12:2) {#if !$closing} -function create_if_block_1$2(ctx) { - let span0; - let span1; +// (9:140) {#if $closing} +function create_if_block$2(ctx) { + let div; + let div_intro; return { c() { - span0 = element("span"); - span1 = element("span"); - attr(span0, "class", "bp-bar"); - attr(span1, "class", "bp-o"); + div = element("div"); + attr(div, "class", "bp-load"); + attr(div, "style", /*style*/ ctx[2]); }, m(target, anchor) { - insert(target, span0, anchor); - insert(target, span1, anchor); + insert(target, div, anchor); + }, + p: noop, + i(local) { + if (!div_intro) { + add_render_callback(() => { + div_intro = create_in_transition(div, fly, { duration: 480 }); + div_intro.start(); + }); + } }, + o: noop, d(detaching) { - if (detaching) detach(span0); - if (detaching) detach(span1); + if (detaching) detach(div); } }; } function create_fragment$4(ctx) { - let if_block_anchor; - let if_block = (!/*loaded*/ ctx[1] || /*$closing*/ ctx[2]) && create_if_block$2(ctx); + let if_block0_anchor; + let if_block1_anchor; + let if_block0 = !/*loaded*/ ctx[0] && create_if_block_1$2(ctx); + let if_block1 = /*$closing*/ ctx[1] && create_if_block$2(ctx); return { c() { - if (if_block) if_block.c(); - if_block_anchor = empty(); + if (if_block0) if_block0.c(); + if_block0_anchor = empty(); + if (if_block1) if_block1.c(); + if_block1_anchor = empty(); }, m(target, anchor) { - if (if_block) if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); + if (if_block0) if_block0.m(target, anchor); + insert(target, if_block0_anchor, anchor); + if (if_block1) if_block1.m(target, anchor); + insert(target, if_block1_anchor, anchor); }, p(ctx, [dirty]) { - if (!/*loaded*/ ctx[1] || /*$closing*/ ctx[2]) { - if (if_block) { - if_block.p(ctx, dirty); + if (!/*loaded*/ ctx[0]) { + if (if_block0) { + if_block0.p(ctx, dirty); - if (dirty & /*loaded, $closing*/ 6) { - transition_in(if_block, 1); + if (dirty & /*loaded*/ 1) { + transition_in(if_block0, 1); } } else { - if_block = create_if_block$2(ctx); - if_block.c(); - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); + if_block0 = create_if_block_1$2(ctx); + if_block0.c(); + transition_in(if_block0, 1); + if_block0.m(if_block0_anchor.parentNode, if_block0_anchor); } - } else if (if_block) { + } else if (if_block0) { group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; + transition_out(if_block0, 1, 1, () => { + if_block0 = null; }); check_outros(); } + + if (/*$closing*/ ctx[1]) { + if (if_block1) { + if_block1.p(ctx, dirty); + + if (dirty & /*$closing*/ 2) { + transition_in(if_block1, 1); + } + } else { + if_block1 = create_if_block$2(ctx); + if_block1.c(); + transition_in(if_block1, 1); + if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); + } + } else if (if_block1) { + if_block1.d(1); + if_block1 = null; + } }, i(local) { - transition_in(if_block); + transition_in(if_block0); + transition_in(if_block1); }, o(local) { - transition_out(if_block); + transition_out(if_block0); }, d(detaching) { - if (if_block) if_block.d(detaching); - if (detaching) detach(if_block_anchor); + if (if_block0) if_block0.d(detaching); + if (detaching) detach(if_block0_anchor); + if (if_block1) if_block1.d(detaching); + if (detaching) detach(if_block1_anchor); } }; } function instance$4($$self, $$props, $$invalidate) { let $closing; - component_subscribe($$self, closing, $$value => $$invalidate(2, $closing = $$value)); + component_subscribe($$self, closing, $$value => $$invalidate(1, $closing = $$value)); let { thumb } = $$props; let { loaded } = $$props; + const style = `background-image:url(${thumb})`; $$self.$$set = $$props => { - if ('thumb' in $$props) $$invalidate(0, thumb = $$props.thumb); - if ('loaded' in $$props) $$invalidate(1, loaded = $$props.loaded); + if ('thumb' in $$props) $$invalidate(3, thumb = $$props.thumb); + if ('loaded' in $$props) $$invalidate(0, loaded = $$props.loaded); }; - return [thumb, loaded, $closing]; + return [loaded, $closing, style, thumb]; } class Loading extends SvelteComponent { constructor(options) { super(); - init(this, options, instance$4, create_fragment$4, not_equal, { thumb: 0, loaded: 1 }); + init(this, options, instance$4, create_fragment$4, not_equal, { thumb: 3, loaded: 0 }); } } @@ -1836,9 +1849,16 @@ function create_if_block(ctx) { current = true; }, o(local) { - div0_outro = create_out_transition(div0, fly, { duration: 480 }); + if (local) { + div0_outro = create_out_transition(div0, fly, { duration: 480 }); + } + transition_out(key_block); - div1_outro = create_out_transition(div1, fly, {}); + + if (local) { + div1_outro = create_out_transition(div1, fly, {}); + } + current = false; }, d(detaching) { @@ -2018,7 +2038,7 @@ function create_if_block_2(ctx) { }; } -// (308:37) {#key activeItem.i} +// (308:43) {#key activeItem.i} function create_key_block(ctx) { let div; let current_block_type_index; @@ -2149,7 +2169,7 @@ function create_key_block(ctx) { }; } -// (319:509) {#if items.length > 1} +// (319:522) {#if items.length > 1} function create_if_block_1(ctx) { let div; let raw_value = `${/*position*/ ctx[4] + 1} / ${/*items*/ ctx[0].length}` + ""; diff --git a/dist/bigger-picture.umd.js b/dist/bigger-picture.umd.js index 1f3604e..6767451 100644 --- a/dist/bigger-picture.umd.js +++ b/dist/bigger-picture.umd.js @@ -703,57 +703,36 @@ /* src/components/loading.svelte generated by Svelte v3.47.0 */ - function create_if_block$2(ctx) { + function create_if_block_1$2(ctx) { let div; - let div_intro; + let span0; + let span1; let div_outro; let current; - let if_block = !/*$closing*/ ctx[2] && create_if_block_1$2(); return { c() { div = element("div"); - if (if_block) if_block.c(); + span0 = element("span"); + span1 = element("span"); + attr(span0, "class", "bp-bar"); + attr(span1, "class", "bp-o"); attr(div, "class", "bp-load"); - set_style(div, "background-image", "url(" + /*thumb*/ ctx[0] + ")"); + attr(div, "style", /*style*/ ctx[2]); }, m(target, anchor) { insert(target, div, anchor); - if (if_block) if_block.m(div, null); + append(div, span0); + append(div, span1); current = true; }, - p(new_ctx, dirty) { - ctx = new_ctx; - - if (!/*$closing*/ ctx[2]) { - if (if_block) ; else { - if_block = create_if_block_1$2(); - if_block.c(); - if_block.m(div, null); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - - if (!current || dirty & /*thumb*/ 1) { - set_style(div, "background-image", "url(" + /*thumb*/ ctx[0] + ")"); - } - }, + p: noop, i(local) { if (current) return; - - add_render_callback(() => { - if (div_outro) div_outro.end(1); - div_intro = create_in_transition(div, fly, { duration: /*loaded*/ ctx[1] ? 400 : 0 }); - div_intro.start(); - }); - + if (div_outro) div_outro.end(1); current = true; }, o(local) { - if (div_intro) div_intro.invalidate(); - if (local) { div_outro = create_out_transition(div, fly, { duration: 480 }); } @@ -762,103 +741,137 @@ }, d(detaching) { if (detaching) detach(div); - if (if_block) if_block.d(); if (detaching && div_outro) div_outro.end(); } }; } - // (12:2) {#if !$closing} - function create_if_block_1$2(ctx) { - let span0; - let span1; + // (9:140) {#if $closing} + function create_if_block$2(ctx) { + let div; + let div_intro; return { c() { - span0 = element("span"); - span1 = element("span"); - attr(span0, "class", "bp-bar"); - attr(span1, "class", "bp-o"); + div = element("div"); + attr(div, "class", "bp-load"); + attr(div, "style", /*style*/ ctx[2]); }, m(target, anchor) { - insert(target, span0, anchor); - insert(target, span1, anchor); + insert(target, div, anchor); + }, + p: noop, + i(local) { + if (!div_intro) { + add_render_callback(() => { + div_intro = create_in_transition(div, fly, { duration: 480 }); + div_intro.start(); + }); + } }, + o: noop, d(detaching) { - if (detaching) detach(span0); - if (detaching) detach(span1); + if (detaching) detach(div); } }; } function create_fragment$4(ctx) { - let if_block_anchor; - let if_block = (!/*loaded*/ ctx[1] || /*$closing*/ ctx[2]) && create_if_block$2(ctx); + let if_block0_anchor; + let if_block1_anchor; + let if_block0 = !/*loaded*/ ctx[0] && create_if_block_1$2(ctx); + let if_block1 = /*$closing*/ ctx[1] && create_if_block$2(ctx); return { c() { - if (if_block) if_block.c(); - if_block_anchor = empty(); + if (if_block0) if_block0.c(); + if_block0_anchor = empty(); + if (if_block1) if_block1.c(); + if_block1_anchor = empty(); }, m(target, anchor) { - if (if_block) if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); + if (if_block0) if_block0.m(target, anchor); + insert(target, if_block0_anchor, anchor); + if (if_block1) if_block1.m(target, anchor); + insert(target, if_block1_anchor, anchor); }, p(ctx, [dirty]) { - if (!/*loaded*/ ctx[1] || /*$closing*/ ctx[2]) { - if (if_block) { - if_block.p(ctx, dirty); + if (!/*loaded*/ ctx[0]) { + if (if_block0) { + if_block0.p(ctx, dirty); - if (dirty & /*loaded, $closing*/ 6) { - transition_in(if_block, 1); + if (dirty & /*loaded*/ 1) { + transition_in(if_block0, 1); } } else { - if_block = create_if_block$2(ctx); - if_block.c(); - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); + if_block0 = create_if_block_1$2(ctx); + if_block0.c(); + transition_in(if_block0, 1); + if_block0.m(if_block0_anchor.parentNode, if_block0_anchor); } - } else if (if_block) { + } else if (if_block0) { group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; + transition_out(if_block0, 1, 1, () => { + if_block0 = null; }); check_outros(); } + + if (/*$closing*/ ctx[1]) { + if (if_block1) { + if_block1.p(ctx, dirty); + + if (dirty & /*$closing*/ 2) { + transition_in(if_block1, 1); + } + } else { + if_block1 = create_if_block$2(ctx); + if_block1.c(); + transition_in(if_block1, 1); + if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); + } + } else if (if_block1) { + if_block1.d(1); + if_block1 = null; + } }, i(local) { - transition_in(if_block); + transition_in(if_block0); + transition_in(if_block1); }, o(local) { - transition_out(if_block); + transition_out(if_block0); }, d(detaching) { - if (if_block) if_block.d(detaching); - if (detaching) detach(if_block_anchor); + if (if_block0) if_block0.d(detaching); + if (detaching) detach(if_block0_anchor); + if (if_block1) if_block1.d(detaching); + if (detaching) detach(if_block1_anchor); } }; } function instance$4($$self, $$props, $$invalidate) { let $closing; - component_subscribe($$self, closing, $$value => $$invalidate(2, $closing = $$value)); + component_subscribe($$self, closing, $$value => $$invalidate(1, $closing = $$value)); let { thumb } = $$props; let { loaded } = $$props; + const style = `background-image:url(${thumb})`; $$self.$$set = $$props => { - if ('thumb' in $$props) $$invalidate(0, thumb = $$props.thumb); - if ('loaded' in $$props) $$invalidate(1, loaded = $$props.loaded); + if ('thumb' in $$props) $$invalidate(3, thumb = $$props.thumb); + if ('loaded' in $$props) $$invalidate(0, loaded = $$props.loaded); }; - return [thumb, loaded, $closing]; + return [loaded, $closing, style, thumb]; } class Loading extends SvelteComponent { constructor(options) { super(); - init(this, options, instance$4, create_fragment$4, not_equal, { thumb: 0, loaded: 1 }); + init(this, options, instance$4, create_fragment$4, not_equal, { thumb: 3, loaded: 0 }); } } @@ -1841,9 +1854,16 @@ current = true; }, o(local) { - div0_outro = create_out_transition(div0, fly, { duration: 480 }); + if (local) { + div0_outro = create_out_transition(div0, fly, { duration: 480 }); + } + transition_out(key_block); - div1_outro = create_out_transition(div1, fly, {}); + + if (local) { + div1_outro = create_out_transition(div1, fly, {}); + } + current = false; }, d(detaching) { @@ -2023,7 +2043,7 @@ }; } - // (308:37) {#key activeItem.i} + // (308:43) {#key activeItem.i} function create_key_block(ctx) { let div; let current_block_type_index; @@ -2154,7 +2174,7 @@ }; } - // (319:509) {#if items.length > 1} + // (319:522) {#if items.length > 1} function create_if_block_1(ctx) { let div; let raw_value = `${/*position*/ ctx[4] + 1} / ${/*items*/ ctx[0].length}` + ""; diff --git a/package.json b/package.json index 10eae29..cf14d5d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bigger-picture", - "version": "1.1.11", + "version": "1.1.12", "type": "module", "exports": { ".": {