import{G as e,M as t,P as n,Q as r,V as i,Y as a,a as o,b as s,et as c,ft as l,it as u,l as d,n as f,nt as p,ot as m,q as h,r as g,st as _,t as v,w as y}from"../../client.js";import{_ as b,h as x}from"../../components.js";import S from"../iconbutton/IconButton.js";var C=n(`<div><div class="mc-carousel__header svelte-10qqjzd"><div class="mc-carousel__headings svelte-10qqjzd"><!></div> <div class="mc-carousel__controls svelte-10qqjzd"><!> <!></div></div> <div class="mc-carousel__content svelte-10qqjzd"><!></div></div>`),w={hash:`svelte-10qqjzd`,code:`/**
 * Do not edit directly, this file was auto-generated.
 */.mt-title.svelte-10qqjzd {font-weight:var(--font-accent, 600);}.mt-title--l.svelte-10qqjzd {font-size:var(--font-title-l, 1.75rem);line-height:calc(var(--font-title-l, 1.75rem) * var(--line-height-s, 1.3));}.mt-title--m.svelte-10qqjzd {font-size:var(--font-title-m, 1.5rem);line-height:calc(var(--font-title-m, 1.5rem) * var(--line-height-s, 1.3));}.mt-title--s.svelte-10qqjzd {font-size:var(--font-title-s, 1.125rem);line-height:calc(var(--font-title-s, 1.125rem) * var(--line-height-s, 1.3));}.mc-carousel.svelte-10qqjzd {display:flex;flex-direction:column;row-gap:1rem;}.mc-carousel__header.svelte-10qqjzd {display:flex;align-items:flex-start;}.mc-carousel__headings.svelte-10qqjzd {display:flex;flex-direction:column;row-gap:0.25rem;flex:1;align-items:flex-start;color:var(--color-text-primary, #000000);}.mc-carousel__controls.svelte-10qqjzd {display:flex;column-gap:0.5rem;margin:0.25rem 0.25rem 0 0;}.mc-carousel__content.svelte-10qqjzd {display:flex;overflow-x:auto;scroll-snap-type:x mandatory;}.mc-carousel__content.svelte-10qqjzd > :where(.svelte-10qqjzd) {scroll-snap-align:start;}::slotted(*) {scroll-snap-align:start;}::slotted(.mc-carousel__title) {margin:0;}::slotted(.mc-carousel__sub-title) {margin:0;}`};function T(n,v){_(v,!0),s(n,w);let T=f(v,`previousButtonAriaLabel`,7,`previous`),E=f(v,`nextButtonAriaLabel`,7,`next`),D=f(v,`class`,7),O=g(v,[`$$slots`,`$$events`,`$$legacy`,`$$host`,`previousButtonAriaLabel`,`nextButtonAriaLabel`,`class`]),k=c(0),A=null,j=null,M={behavior:`smooth`,block:`nearest`,inline:`center`};function N(){if(!A)return[];let e=A.querySelector(`slot`);return e?e.assignedElements({flatten:!0}):[]}function P(e){N()[e]?.scrollIntoView(M)}function F(){i(k)>0&&P(i(k)-1)}function I(){let e=N();i(k)<e.length-1&&P(i(k)+1)}e(()=>{if(A)return j=new IntersectionObserver(e=>{let t=e.find(e=>e.isIntersecting);t&&r(k,N().findIndex(e=>e===t.target),!0)},{root:A,threshold:.9}),N().forEach(e=>j.observe(e)),()=>j?.disconnect()});let L=p(()=>i(k)===0),R=p(()=>i(k)===N().length-1);var z={get previousButtonAriaLabel(){return T()},set previousButtonAriaLabel(e=`previous`){T(e),u()},get nextButtonAriaLabel(){return E()},set nextButtonAriaLabel(e=`next`){E(e),u()},get class(){return D()},set class(e){D(e),u()}},B=C();d(B,()=>({class:[`mc-carousel`,D()],role:`group`,"aria-roledescription":`carousel`,"aria-labelledby":`mc-carousel__title`,...O}),void 0,void 0,void 0,`svelte-10qqjzd`);var V=h(B),H=h(V);y(h(H),v,`header`,{},null),l(H);var U=a(H,2),W=h(U);S(W,{size:`s`,outlined:!0,onclick:F,get disabled(){return i(L)},get"aria-label"(){return T()},$$slots:{icon:(e,t)=>{x(e,{slot:`icon`})}}}),S(a(W,2),{size:`s`,outlined:!0,onclick:I,get disabled(){return i(R)},get"aria-label"(){return E()},$$slots:{icon:(e,t)=>{b(e,{slot:`icon`})}}}),l(U),l(V);var G=a(V,2);return y(h(G),v,`default`,{},null),l(G),o(G,e=>A=e,()=>A),l(B),t(n,B),m(z)}customElements.define(`m-carousel`,v(T,{previousButtonAriaLabel:{},nextButtonAriaLabel:{},class:{}},[`header`,`default`],[],{mode:`open`}));
//# sourceMappingURL=Carousel.js.map