import{A as e,Bt as t,F as n,G as r,L as i,N as a,Nt as o,O as s,Pt as c,U as l,Vt as u,W as d,X as f,ft as p,j as m,mt as h,o as g,ot as _,pt as v,q as y,v as b,w as x,x as S,z as C}from"./xY0c-UfG.js";import"./xihTtKlq.js";import{n as w}from"./D8BnezyQ.js";import{i as T}from"./4ickW77P2.js";import{n as E,t as D}from"./vYSZoUpd2.js";var O=C(`<div class="cell-headline svelte-1ud4k9l"><span class="svelte-1ud4k9l"> </span></div> <div class="svelte-1ud4k9l"></div>`,1),k=C(`<img loading="lazy" decoding="async" draggable="false" class="svelte-1ud4k9l"/>`),A=C(`<span class="cell-doc svelte-1ud4k9l"><!></span>`),j=C(`<span class="cell-doc svelte-1ud4k9l"><!></span>`),M=C(`<div class="cell-image svelte-1ud4k9l"><!></div> <span> </span>`,1),N=C(`<span><span class="cell-tag-text svelte-1ud4k9l"> </span></span>`),P=C(`<span class="cell-slot-overlay svelte-1ud4k9l"><!></span>`),F=C(`<button type="button"><!> <span class="cell-checkbox-chip svelte-1ud4k9l"><!></span></button>`),I=C(`<span class="cell-slot-static svelte-1ud4k9l" aria-hidden="true"><!></span>`),L=C(`<div role="button" tabindex="0"><!> <div class="cell-tags svelte-1ud4k9l"></div> <!></div>`);function R(l,C){c(C,!0);let R=g(C,`caption`,3,`wrap`),z=g(C,`chips`,19,()=>[]),B=g(C,`variant`,3,`flush`),V=g(C,`lastCol`,3,!1),H=g(C,`firstRow`,3,!1),U=g(C,`selectable`,3,!1),W=g(C,`selected`,3,!1),G=g(C,`draggable`,3,!1),K=g(C,`dropActive`,3,!1);var q=L();let J;var Y=p(q),X=e=>{var r=O(),a=v(r),o=p(a),s=p(o,!0);u(o),x(o,e=>T?.(e)),u(a),t(2),_(()=>n(s,C.title)),i(e,r)},Z=e=>{var t=M(),o=v(t),s=p(o),c=e=>{var t=k();_(()=>{b(t,`src`,C.media.url),b(t,`alt`,C.title)}),r(`error`,t,e=>{e.currentTarget.style.visibility=`hidden`}),y(t),i(e,t)},l=e=>{var t=A();D(p(t),{size:28}),u(t),i(e,t)},d=e=>{var t=j();E(p(t),{size:28}),u(t),i(e,t)};a(s,e=>{C.media.kind===`image`?e(c):C.media.glyph===`font`?e(l,1):e(d,-1)}),u(o);var f=h(o,2),m=p(f,!0);u(f),x(f,e=>T?.(e)),_(()=>{S(f,1,`cell-title cap-${R()??``}`,`svelte-1ud4k9l`),b(f,`title`,C.title),n(m,C.title)}),i(e,t)};a(Y,e=>{C.media.kind===`none`?e(X):e(Z,-1)});var Q=h(Y,2);e(Q,21,z,m,(e,t)=>{var r=N();let a;var o=p(r),s=p(o,!0);u(o),x(o,e=>T?.(e)),u(r),_(()=>{a=S(r,1,`cell-tag svelte-1ud4k9l`,null,a,{"cell-tag-outline":f(t).variant===`outline`,"cell-tag-cap":f(t).cap}),b(r,`title`,f(t).title??f(t).label),n(s,f(t).label)}),i(e,r)}),u(Q);var $=h(Q,2),ee=e=>{var t=F();let n;var r=p(t),o=e=>{var t=P();s(p(t),()=>C.slotOverlay),u(t),i(e,t)};a(r,e=>{C.slotOverlay&&!W()&&e(o)});var c=h(r,2);w(p(c),{get checked(){return W()},tabindex:-1}),u(c),u(t),_(()=>{n=S(t,1,`cell-select-slot svelte-1ud4k9l`,null,n,{"has-presence":!!C.slotOverlay}),b(t,`aria-label`,C.selectAriaLabel)}),d(`click`,t,e=>{e.stopPropagation(),C.onToggleSelect?.(e)}),i(e,t)},te=e=>{var t=I();s(p(t),()=>C.slotIcon),u(t),i(e,t)};a($,e=>{U()&&C.onToggleSelect?e(ee):C.slotIcon&&e(te,1)}),u(q),_(()=>{J=S(q,1,`gallery-cell svelte-1ud4k9l`,null,J,{"cell-card":B()===`card`,"cell-selected":W(),"cell-last-col":V(),"cell-first-row":H(),"drop-target":K()}),b(q,`aria-label`,C.ariaLabel),b(q,`draggable`,G()),b(q,`data-drop-path`,C.dataDropPath)}),d(`click`,q,e=>C.onActivate?.(e)),d(`keydown`,q,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),C.onActivate?.(e))}),r(`dragstart`,q,function(...e){C.onDragStart?.apply(this,e)}),r(`dragend`,q,function(...e){C.onDragEnd?.apply(this,e)}),d(`touchstart`,q,function(...e){C.onTouchStart?.apply(this,e)},void 0,!0),r(`dragover`,q,function(...e){C.onDragOver?.apply(this,e)}),r(`dragleave`,q,function(...e){C.onDragLeave?.apply(this,e)}),r(`drop`,q,function(...e){C.onDrop?.apply(this,e)}),i(l,q),o()}l([`click`,`keydown`,`touchstart`]);export{R as t};