@cntrl-site/components 1.0.116-alpha.0 → 1.0.116

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/{Burger-DyORh_vF.mjs → Burger-BkVgNMGU.mjs} +1 -1
  2. package/dist/{Burger-B4kXX9aY.js → Burger-C3yVbQcq.js} +1 -1
  3. package/dist/Chronicles-BNvvaFYY.mjs +744 -0
  4. package/dist/Chronicles-Dj1gvNjE.js +196 -0
  5. package/dist/{ChroniclesComponent-jh4v7wp6.mjs → ChroniclesComponent-0ZWBPdbh.mjs} +542 -491
  6. package/dist/ChroniclesComponent-D4_6w8f7.js +1 -0
  7. package/dist/Components/Chronicles/Chronicles.d.ts +7 -1
  8. package/dist/Components/Chronicles/ChroniclesComponent.d.ts +26 -2
  9. package/dist/Components/LightboxJournal/LightboxJournal.d.ts +1 -0
  10. package/dist/Components/LightboxStrip/LightboxStrip.d.ts +1 -0
  11. package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +0 -7
  12. package/dist/{ControlSlider-DB4nbVLT.js → ControlSlider-C8ckUIDm.js} +1 -1
  13. package/dist/{ControlSlider-3w-bHQEg.mjs → ControlSlider-DqKfaKMG.mjs} +1 -1
  14. package/dist/{FAQ-GmiwRdFq.mjs → FAQ-CJHCMSBa.mjs} +1 -1
  15. package/dist/{FAQ-7HEkaoU6.js → FAQ-DLh63Utr.js} +1 -1
  16. package/dist/{Grid-BzarI5Mc.js → Grid-OvzWvUW9.js} +1 -1
  17. package/dist/{Grid-Z2JZyUdC.mjs → Grid-t07NDMzY.mjs} +1 -1
  18. package/dist/{Hive-34KvKNsa.js → Hive-CzabuuCc.js} +1 -1
  19. package/dist/{Hive-7xHXyMM1.mjs → Hive-DyxYd5eg.mjs} +1 -1
  20. package/dist/{HiveLightboxTitles-BCoL46-V.mjs → HiveLightboxTitles-DhEeFKWs.mjs} +1 -1
  21. package/dist/{HiveLightboxTitles-DEeyQGcf.js → HiveLightboxTitles-DlyptAaK.js} +1 -1
  22. package/dist/{Lightbox-DzPqgKP4.mjs → Lightbox-BY99NS14.mjs} +1 -1
  23. package/dist/{Lightbox-Cb7lyaNt.js → Lightbox-DZckgBzK.js} +1 -1
  24. package/dist/LightboxJournal-Bmw2zm4t.js +549 -0
  25. package/dist/{LightboxJournal-C_q7_s-B.mjs → LightboxJournal-gePVKQJ4.mjs} +429 -403
  26. package/dist/{LightboxStrip-BrNj7ipX.mjs → LightboxStrip-BPQiQhd3.mjs} +461 -435
  27. package/dist/LightboxStrip-CTxRwLYk.js +412 -0
  28. package/dist/{Mercury-BmhtFYOw.js → Mercury-B-s2Kvuq.js} +1 -1
  29. package/dist/{Mercury-Q788wrYQ.mjs → Mercury-CCW0Es-s.mjs} +1 -1
  30. package/dist/{OnelinerForm-D8WIB9Qy.mjs → OnelinerForm-BEu7_sho.mjs} +1 -1
  31. package/dist/{OnelinerForm-CUmY-bXL.js → OnelinerForm-C2Y_XMCY.js} +1 -1
  32. package/dist/{SimpleButton-DTpzfmb6.mjs → SimpleButton-C-o2W9bS.mjs} +1 -1
  33. package/dist/{SimpleButton-DtaCYa3y.js → SimpleButton-nGEcO2gB.js} +1 -1
  34. package/dist/{Slider20-q0iGgnE3.js → Slider20-BOmjDRf2.js} +1 -1
  35. package/dist/{Slider20-CKngROrc.mjs → Slider20-DUi6qwnd.mjs} +1 -1
  36. package/dist/SvgImage-B5mR9y6q.mjs +51 -0
  37. package/dist/SvgImage-DFlmxAoL.js +1 -0
  38. package/dist/{TestimonialSingle-CpEUendN.js → TestimonialSingle-BORQom3u.js} +1 -1
  39. package/dist/{TestimonialSingle-Bax71Hyo.mjs → TestimonialSingle-DrnyReim.mjs} +1 -1
  40. package/dist/{Waterfall-znaoynn5.mjs → Waterfall-3kKioKh2.mjs} +1 -1
  41. package/dist/{Waterfall-B9YWMhrg.js → Waterfall-DII4-WV5.js} +1 -1
  42. package/dist/components-B8MjlzLL.js +1 -0
  43. package/dist/{components-C9Fu28pp.mjs → components-BQjon_-7.mjs} +29 -653
  44. package/dist/elements.js +1 -1
  45. package/dist/elements.mjs +23 -24
  46. package/dist/elements.node.js +1 -1
  47. package/dist/elements.node.mjs +1 -1
  48. package/dist/index.d.ts +2 -4
  49. package/dist/index.js +1 -1
  50. package/dist/index.mjs +38 -61
  51. package/dist/loadSvgMaskUrl-DfF7ay6h.js +1 -0
  52. package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +20 -0
  53. package/dist/sources.js +124 -25
  54. package/dist/sources.mjs +131 -32
  55. package/dist/types/Component.d.ts +0 -7
  56. package/dist/types/SchemaV1.d.ts +3 -3
  57. package/package.json +1 -1
  58. package/dist/Chronicles-Cy2h3jlZ.mjs +0 -724
  59. package/dist/Chronicles-D0ojQzOP.js +0 -196
  60. package/dist/ChroniclesComponent-DYPJBI3d.js +0 -1
  61. package/dist/Components/PopupMenu/PopupMenu.d.ts +0 -73
  62. package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +0 -594
  63. package/dist/Components/PopupMenu/popupMenuLayout.d.ts +0 -203
  64. package/dist/Components/PopupMenu/popupMenuSnap.d.ts +0 -61
  65. package/dist/LightboxJournal-BFF5aKRz.js +0 -523
  66. package/dist/LightboxStrip-CC2e0_9A.js +0 -386
  67. package/dist/PopupMenu-CYdDyzEt.mjs +0 -1372
  68. package/dist/PopupMenu-Di1fHgho.js +0 -409
  69. package/dist/SvgImage-CwRq9-ec.mjs +0 -56
  70. package/dist/SvgImage-_QN8ngad.js +0 -1
  71. package/dist/components-6QFLq5OI.js +0 -1
  72. package/dist/loadSvgMaskUrl-B6kHUyof.js +0 -1
  73. package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +0 -39
@@ -0,0 +1,549 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),o=require("react"),Lt=require("react-dom"),fi=require("./useScopedStyles-Bf6yohVQ.js"),G=require("./useLightboxSwipeDismiss-Br9uE5G0.js"),ct=require("./scalingValue-CSHYgTZl.js"),mi=require("./SvgImage-DFlmxAoL.js"),gi=require("./useLightboxScrollLock-Hf16Eq4g.js"),l=require("./utils-033j3qNL.js"),xi=({prefix:e,entries:E,settings:I,isEditor:w,isEditMode:f,isPreviewMode:ee,initialSlideIndex:U=0,enableUrlSync:j=!1,journalItemId:k=null,onBeforeClose:V,onClose:q})=>{const{type:C,coverFit:te,backgroundColor:Ae,imageGap:Ee,maxWidth:Je,maxHeight:H,textTransition:J,title1Width:ie,title2Width:re,title3Width:X,title1MarginLeft:R=0,title2MarginLeft:L=0,title3MarginLeft:pe=0,titleRowMarginBottom:$=0,titleHeaderLayout:Fe="single-row",countCloseGap:ze=0,closeIcon:ve,closeIconMaxWidth:b,closeIconColor:_,closeIconHoverColor:F,contentMarginTop:we=0,iconMarginRight:_t=0}=I,m=o.useCallback(t=>ct.scalingValue(t,w??!1),[w]),Oe=m(Ee??0),Mt=`${Je}%`,Dt=`${H}%`,ye=m(ze),At=m(we),dt=m(_t),ne=l.journalTextFieldsToCss("title1",l.resolveJournalTextFields(I,"title1"),w),ae=l.journalTextFieldsToCss("title2",l.resolveJournalTextFields(I,"title2"),w),ce=l.journalTextFieldsToCss("title3",l.resolveJournalTextFields(I,"title3"),w),Et=l.journalTextFieldsToCss("count",l.resolveJournalTextFields(I,"count"),w),p=Fe==="mobile",z=!w||!!ee,Jt=!f&&(!w||!!ee),u=o.useMemo(()=>l.buildJournalSlides(E,C),[E,C]),[y,Be]=o.useState(U),de=u[y],h=de==null?void 0:de.entry,[ut,ht]=o.useState(!1),[ft,ue]=o.useState(null),[T,he]=o.useState(!1),[mt,Ke]=o.useState(null),[gt,Ge]=o.useState(!1),[Ue,xt]=o.useState(0),[oe,fe]=o.useState(),[be,me]=o.useState(),[$e,Te]=o.useState(null),Z=o.useRef(null),Se=o.useRef(0),Ie=o.useRef(0),pt=o.useRef(0),vt=o.useRef(!1),Ve=o.useRef(null),qe=o.useRef(null),O=o.useRef(null),B=o.useRef(null),Xe=o.useRef(null),wt=o.useRef(null),je=o.useRef(null),yt=o.useCallback(()=>{const t=qe.current;if(!t)return;const n=t.closest(`.${e}-lightbox-content-area`);if(!n)return t.getBoundingClientRect().width;const a=Array.from(n.children).reduce((s,r)=>!(r instanceof HTMLElement)||r.contains(t)?s:s+r.getBoundingClientRect().width,0);return n.getBoundingClientRect().width-a},[e]),Y=o.useCallback(()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)},[]),Ft=o.useCallback(t=>{t===Se.current&&(Ke(null),Ge(!1))},[]),ge=o.useCallback(()=>{f||vt.current||(vt.current=!0,V==null||V(),ht(!1),Ve.current=setTimeout(()=>{q()},300))},[f,V,q]),zt=o.useCallback(t=>!!(t.closest("[data-controls]")||t.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ze,backdropStyle:Ot,mediaAreaStyle:Bt,overlayContentStyle:Kt,swipeHandlers:Gt,dismissAreaStyle:Ut}=G.useLightboxSwipeDismiss({enabled:Jt,onClose:ge,animMs:300,isBlockedTarget:zt}),bt=o.useCallback(t=>{j&&l.setJournalUrlParam(t+1,k,!0)},[j,k]),Ye=o.useCallback(t=>{if(t)return t.getBoundingClientRect().height},[]),le=o.useCallback(t=>{if(u.length===0)return;const n=(t%u.length+u.length)%u.length;if(n===y)return;const a=u[y],s=u[n];Se.current+=1;const r=Se.current,d=J==="fade"&&l.getEntryTitleKey(a==null?void 0:a.entry)!==l.getEntryTitleKey(s==null?void 0:s.entry),x=Ye(O.current),c=d?(()=>{const N=yt();Lt.flushSync(()=>{Te(s.entry)}),O.current&&N&&(O.current.style.width=`${N}px`);const _e=Ye(O.current);return O.current&&(O.current.style.width=""),{measuredIncomingTitlesHeight:_e,incomingTitlesMeasureWidth:N}})():void 0,S=Math.max(x??0,(c==null?void 0:c.measuredIncomingTitlesHeight)??0)||void 0;xt(r),Ke(y),Ge(!0),Be(n),bt(n),pt.current=n,d?(Y(),S&&fe(S),c!=null&&c.incomingTitlesMeasureWidth&&me(c.incomingTitlesMeasureWidth),ue((a==null?void 0:a.entryIndex)??null),he(!0),Ie.current=s.entryIndex,Z.current=setTimeout(()=>{ue(null),he(!1),fe(void 0),me(void 0),Te(null),Z.current=null},400)):(Y(),ue(null),he(!1),fe(void 0),me(void 0),Te(null),Ie.current=s.entryIndex)},[y,Y,yt,Ye,u,bt,J]),xe=o.useCallback(()=>{je.current=null},[]),Vt=o.useCallback(t=>{!z||u.length<=1||t.pointerType==="mouse"&&t.button!==0||t.target.closest("[data-controls]")||(je.current={startX:t.clientX,startY:t.clientY,pointerId:t.pointerId})},[z,u.length]),qt=o.useCallback(t=>{var N;if(!z||u.length<=1||t.pointerType==="mouse"&&t.button!==0)return;if(Ze){xe();return}const n=je.current;if(!n||n.pointerId!==t.pointerId||(xe(),t.target.closest("[data-controls]")))return;const s=t.clientX-n.startX,r=t.clientY-n.startY,d=Math.abs(s),x=Math.abs(r);if(d>=l.STRIP_NAV_SWIPE_MIN_PX&&d>x){le(s>0?y-1:y+1);return}if(d>l.STRIP_NAV_TAP_MAX_PX||x>l.STRIP_NAV_TAP_MAX_PX)return;const c=(N=B.current)==null?void 0:N.getBoundingClientRect(),S=c?c.left+c.width/2:window.innerWidth/2;le(t.clientX<S?y-1:y+1)},[y,z,le,Ze,xe,u.length]),Xt=o.useCallback(t=>{const n=je.current;(n==null?void 0:n.pointerId)===t.pointerId&&xe()},[xe]);gi.useLightboxScrollLock(),o.useEffect(()=>{wt.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const t=requestAnimationFrame(()=>{ht(!0),requestAnimationFrame(()=>{Xe.current?Xe.current.focus():B.current&&B.current.focus()})});return()=>{cancelAnimationFrame(t),Ve.current&&clearTimeout(Ve.current),Z.current&&clearTimeout(Z.current);const n=wt.current;n&&document.contains(n)&&n.focus({preventScroll:!0})}},[]),o.useEffect(()=>{var t;J!=="fade"&&(Ie.current=((t=u[y])==null?void 0:t.entryIndex)??0,Y(),ue(null),he(!1),fe(void 0),me(void 0))},[y,Y,u,J]),o.useEffect(()=>{const t=n=>{if(n.key==="Escape"){ge();return}if(n.key==="ArrowLeft"&&u.length>1){le(y-1);return}if(n.key==="ArrowRight"&&u.length>1){le(y+1);return}if(n.key==="Tab"&&B.current){const a=B.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),s=Array.from(a).filter(c=>!c.closest('[aria-hidden="true"]'));if(s.length===0)return;const r=s[0],d=s[s.length-1],x=document.activeElement;n.shiftKey?(x===r||!B.current.contains(x))&&(n.preventDefault(),d.focus()):(x===d||!B.current.contains(x))&&(n.preventDefault(),r.focus())}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[le,ge,y,u.length]),o.useLayoutEffect(()=>{Y(),Se.current=0,xt(0),Ke(null),Ge(!1),ue(null),he(!1),fe(void 0),me(void 0),Te(null),Be(t=>{const n=Math.max(0,u.length-1);return Math.min(t,n)})},[Y,E.length,C,u.length]),o.useLayoutEffect(()=>{var a;const t=Math.max(0,u.length-1),n=Math.min(Math.max(0,U),t);pt.current=n,Ie.current=((a=u[n])==null?void 0:a.entryIndex)??0,Be(n)},[U]);const g=ft!==null?E[ft]:null,$t=mt!==null?u[mt]:null,Re=(h==null?void 0:h.title1)||(h==null?void 0:h.title2)||(h==null?void 0:h.title3)||(g==null?void 0:g.title1)||(g==null?void 0:g.title2)||(g==null?void 0:g.title3),Q=l.shouldShowCounter(C,u,E),se=ve!==null,Zt=Re||Q||se,Yt=Q&&se?{gap:ye}:void 0,We=`${e}-titles-stack${p?` ${e}-titles-stack-stacked`:""}`,Tt=`${e}-titles-layer-out${p?` ${e}-titles-layer-out-stacked`:""}`,Qt=`${e}-titles-layer-out`,Qe=(R??0)>0||f,Pt=m($),W=o.useMemo(()=>({title1Width:ie??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title1Width,title2Width:re??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title2Width,title3Width:X??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title3Width}),[ie,re,X]),M=o.useMemo(()=>({title2MarginLeft:L,title3MarginLeft:pe}),[L,pe]),v=o.useMemo(()=>h?l.buildJournalTitleSlots(e,h,ne,ae,ce):[],[e,h,ne,ae,ce]),Ne=o.useMemo(()=>v.map(t=>W[t.widthKey]),[v,W]),D=o.useMemo(()=>l.resolveJournalTitleWidths(v.length,Ne),[v.length,Ne]),St=o.useMemo(()=>l.getEffectiveJournalTitleWidths(v.length,Ne),[v.length,Ne]),ke=o.useMemo(()=>v.filter(t=>t.prefix==="title1"),[v]),A=o.useMemo(()=>v.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[v]),Ce=o.useMemo(()=>l.getRowScopedJournalTitleWidths(ke,W),[ke,W]),K=o.useMemo(()=>l.getRowScopedJournalTitleWidths(A,W),[A,W]),Pe=o.useCallback((t,n)=>{const a=v.findIndex(r=>r.prefix===t.prefix);if(!p||n==="single-row")return{effectiveWidth:St[a]??0,resolvedWidth:D[a]??0,maxWidth:l.getJournalTitleMaxWidth(a,D)};if(n==="two-row-top"){const r=ke.findIndex(d=>d.prefix===t.prefix);return{effectiveWidth:Ce.effective[r]??0,resolvedWidth:Ce.resolved[r]??0,maxWidth:l.getJournalTitleMaxWidth(r,Ce.resolved)}}const s=A.findIndex(r=>r.prefix===t.prefix);return{effectiveWidth:K.effective[s]??0,resolvedWidth:K.resolved[s]??0,maxWidth:l.getJournalTitleMaxWidth(s,K.resolved)}},[v,A,K,St,D,ke,Ce,p]),ei=o.useCallback(t=>l.getJournalTitleBoundaryOffset(v,D,M,t)+(p?0:R??0),[v,D,M,p,R]),ti=o.useCallback(()=>p?0:R??0,[p,R]),et=o.useCallback(t=>A.slice(0,t).reduce((n,a,s)=>n+(a.marginLeftKey?M[a.marginLeftKey]??0:0)+(K.resolved[s]??0),0),[A,K.resolved,M]),ii=o.useCallback(t=>{const n=A[t];return et(t)+(n.marginLeftKey?M[n.marginLeftKey]??0:0)+(K.resolved[t]??0)},[A,K.resolved,et,M]),tt=o.useCallback((t,n,a)=>{if(!p||a==="single-row"){const c=t.findIndex(P=>P.prefix===n.prefix),S=t.map(P=>W[P.widthKey]),N=l.resolveJournalTitleWidths(t.length,S);return{effectiveWidth:l.getEffectiveJournalTitleWidths(t.length,S)[c]??0,resolvedWidth:N[c]??0,maxWidth:l.getJournalTitleMaxWidth(c,N)}}if(a==="two-row-top"){const c=t.filter(P=>P.prefix==="title1"),S=c.findIndex(P=>P.prefix===n.prefix),{resolved:N,effective:_e}=l.getRowScopedJournalTitleWidths(c,W);return{effectiveWidth:_e[S]??0,resolvedWidth:N[S]??0,maxWidth:l.getJournalTitleMaxWidth(S,N)}}const s=t.filter(c=>c.prefix==="title2"||c.prefix==="title3"),r=s.findIndex(c=>c.prefix===n.prefix),{resolved:d,effective:x}=l.getRowScopedJournalTitleWidths(s,W);return{effectiveWidth:x[r]??0,resolvedWidth:d[r]??0,maxWidth:l.getJournalTitleMaxWidth(r,d)}},[W,p]),it=(t,n,a)=>{const s=t.marginLeftKey?M[t.marginLeftKey]??0:0,{effectiveWidth:r,resolvedWidth:d,maxWidth:x}=a??Pe(t,n),c=Math.max(s,l.TITLE_PADDING_HANDLE_WIDTH),S=f&&n==="two-row-top";return i.jsxs("div",{className:`${e}-title-cell`,"data-title":t.prefix,style:{width:m(r),...s>0?{marginLeft:m(s)}:{}},children:[i.jsx("p",{className:t.className,style:t.style,children:t.text}),S&&t.marginLeftKey?i.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(d),style:{position:"absolute",top:0,left:m(-s),width:m(c),height:"100%",pointerEvents:"auto"}}):null,S?i.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:m(-l.TITLE_RESIZE_HANDLE_WIDTH/2),width:m(l.TITLE_RESIZE_HANDLE_WIDTH),height:"100%",pointerEvents:"auto"}}):null]},t.className)},nt=(t="two-row")=>{const n=v.findIndex(r=>r.prefix==="title1"),a=n>=0?D[n]:W.title1Width,s=t==="two-row"&&f;return i.jsx("div",{...s?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(a)}:{},style:{width:m(R??0),flexShrink:0,alignSelf:"stretch",...s?{pointerEvents:"auto"}:{}}})},ot=()=>i.jsx("span",{className:`${e}-titles-baseline-strut`,style:ne,"aria-hidden":"true",children:" "}),It=()=>i.jsx("span",{className:`${e}-entry-counter`,style:Et,"aria-live":"polite","aria-atomic":"true",children:l.formatSlideCounter(u,y,C,E)}),ni=()=>Q?f&&se?i.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[It(),i.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${l.getGapControlSize(ye)} + ${ye}))`,width:l.getGapControlSize(ye),height:"100%",pointerEvents:"auto",zIndex:3}})]}):It():null,lt=()=>!Q&&!se?null:i.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Yt,children:[ni(),se?si():null]}),oi=()=>i.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Q||Re?ot():null,Qe?nt("single-row"):null,Rt(h),i.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),lt(),at()]}),li=()=>i.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Q||Re?ot():null,Qe?nt("single-row"):null,i.jsxs("div",{className:`${e}-titles-row-titles`,style:T&&oe?{minHeight:oe}:void 0,children:[i.jsx("div",{ref:O,className:We,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:He($e||h)}),i.jsxs("div",{ref:qe,className:We,style:{position:T?"absolute":"relative",inset:T?0:void 0,width:"100%",...T&&be?{width:be,maxWidth:"100%"}:void 0},children:[g&&T?i.jsx("div",{className:`${Tt} ${e}-titles-fade-out`,children:He(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${T?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:He(h)})]})]}),lt(),at()]}),si=()=>i.jsxs("div",{className:`${e}-close-icon`,style:{width:ct.scalingValue(b??0,w),height:ct.scalingValue(b??0,w),marginRight:dt,"--close-icon-hover-color":F},children:[i.jsx("button",{ref:Xe,type:"button",className:`${e}-close-icon-inner`,onClick:ge,"aria-label":"Close",children:i.jsx(mi.SvgImage,{url:ve??"",fill:_,hoverFill:w&&!ee?_:F,className:`${e}-close-icon-img`})}),f&&i.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:dt,height:"100%",pointerEvents:"auto"}})]}),jt=(t,n)=>i.jsxs("div",{className:`${e}-titles-row-top`,children:[Q||Re?ot():null,Qe?nt("two-row"):null,n!==void 0?i.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:n},children:t}):i.jsxs(i.Fragment,{children:[t,i.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),lt()]}),Rt=t=>{if(!t)return null;const n=l.buildJournalTitleSlots(e,t,ne,ae,ce);return i.jsx(i.Fragment,{children:n.map(a=>it(a,"single-row",tt(n,a,"single-row")))})},st=t=>{if(!t)return null;const n=l.buildJournalTitleSlots(e,t,ne,ae,ce),a=n.find(s=>s.prefix==="title1");return a?it(a,"two-row-top",tt(n,a,"two-row-top")):null},rt=(t,n=!1)=>{const a=t?l.buildJournalTitleSlots(e,t,ne,ae,ce):[],s=a.filter(x=>x.prefix==="title2"||x.prefix==="title3"),r=f&&n;return s.length>0||r||($??0)>0?i.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[s.length>0?i.jsxs("div",{className:`${e}-titles-row-bottom`,children:[s.map(x=>it(x,"two-row-bottom",tt(a,x,"two-row-bottom"))),n&&f?i.jsxs(i.Fragment,{children:[ci(),di()]}):null]}):null,($??0)>0||r?i.jsx("div",{"data-controls":r?"titleRowMarginBottom":void 0,"data-controls-axis":r?"y":void 0,"data-controls-reverse":r?"":void 0,className:r?`${e}-control`:void 0,style:{height:Pt,width:"100%",flexShrink:0,pointerEvents:r?"auto":"none"}}):null]}):null},Le=(t,n=!1)=>i.jsxs(i.Fragment,{children:[jt(st(t)),rt(t,n)]}),He=t=>p?i.jsx("div",{className:`${e}-titles-row-two-row`,children:Le(t)}):t?i.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Rt(t)}):null,ri=()=>{const t=p?-1:v.findIndex(s=>s.prefix==="title1"),n=!p&&(f||(R??0)>0)?(()=>{const s=R??0,r=t>=0?D[t]:W.title1Width,d=Math.max(s,l.TITLE_PADDING_HANDLE_WIDTH);return i.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(r),style:{position:"absolute",top:0,left:0,width:m(d),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,a=v.flatMap((s,r)=>{if(!s.marginLeftKey)return[];const d=M[s.marginLeftKey]??0,x=l.getJournalTitleOffsetBeforeSlot(v,D,M,r)+ti(),c=Math.max(d,l.TITLE_PADDING_HANDLE_WIDTH);return i.jsx("div",{"data-controls":s.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(D[r]),style:{position:"absolute",top:0,left:m(x),width:m(c),height:"100%",pointerEvents:"auto"}},s.marginLeftKey)});return n?[n,...a]:a},ai=()=>v.map((t,n)=>{const a=l.getJournalTitleMaxWidth(n,D),r=ei(n)-l.TITLE_RESIZE_HANDLE_WIDTH/2;return i.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:i.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(a),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:m(r),width:m(l.TITLE_RESIZE_HANDLE_WIDTH),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),ci=()=>A.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const a=M[t.marginLeftKey]??0,s=et(n),r=Math.max(a,l.TITLE_PADDING_HANDLE_WIDTH),{resolvedWidth:d}=Pe(t,"two-row-bottom");return i.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(d),style:{position:"absolute",top:0,left:m(s),width:m(r),height:"100%",pointerEvents:"auto"}},t.marginLeftKey)}),di=()=>A.map((t,n)=>{const{maxWidth:a}=Pe(t,"two-row-bottom"),r=ii(n)-l.TITLE_RESIZE_HANDLE_WIDTH/2;return i.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:i.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(a),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:m(r),width:m(l.TITLE_RESIZE_HANDLE_WIDTH),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),at=()=>!f||p?null:i.jsxs(i.Fragment,{children:[ri(),ai()]}),Wt=t=>{const n=!t.objectFit&&G.isImageRatioCover(te);return{className:`${e}-slide-image-cell${n?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:Mt,maxHeight:Dt,...n?{"--image-aspect-ratio":G.getAspectRatio(te)}:{}}}},Nt=t=>t.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":t.objectFit}}:G.isImageRatioCover(te)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},kt=t=>{if(t.length===0)return null;const n=t.length>1,a=l.getGapControlSize(Oe),s=`calc(-0.5 * (${a} + ${Oe}))`;if(t.length===1){const r=t[0];return i.jsx("div",{...Wt(r),children:i.jsx("img",{...Nt(r),src:r.assetId,alt:r.name??"",draggable:!1})})}return i.jsx("div",{className:`${e}-slide-inner`,style:n?{gap:Oe}:void 0,children:t.map((r,d)=>i.jsxs("div",{...Wt(r),children:[i.jsx("img",{...Nt(r),src:r.assetId,alt:r.name??"",draggable:!1}),f&&n&&d<t.length-1&&i.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:s,width:a,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${r.assetId}-${d}`))})},Ct=!!(h!=null&&h.title2||h!=null&&h.title3||g!=null&&g.title2||g!=null&&g.title3||($??0)>0||f),ui=()=>i.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[i.jsx("div",{ref:O,className:We,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Le($e||h)}),i.jsxs("div",{ref:qe,className:`${e}-titles-row-two-row`,style:{...T&&oe?{minHeight:oe}:void 0,...T&&be?{width:be,maxWidth:"100%"}:void 0},children:[jt(i.jsxs("div",{className:We,style:{position:T?"absolute":"relative",inset:T?0:void 0,width:"100%"},children:[g&&T?i.jsx("div",{className:`${Qt} ${e}-titles-fade-out`,children:st(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${T?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:st(h)})]}),T&&oe?oe:void 0),Ct?i.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[g&&T?i.jsx("div",{className:`${Tt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:rt(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${T?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${p?` ${e}-titles-layer-in-stacked`:""}`,children:rt(h,!0)})]}):null]})]}),hi=()=>{const t=Ct;return i.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...t?{flex:1,height:"100%"}:{}},children:[i.jsx("div",{className:`${e}-titles-row-two-row`,style:t?void 0:{flex:"0 0 auto",height:"auto"},children:Le(h,!0)}),at()]})};return i.jsxs("div",{ref:B,"data-selection":"none",className:`${e}-lightbox${w?` ${e}-lightbox-editor`:""}${f?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ze||ge()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:se?void 0:-1,style:{opacity:ut?1:0,transition:"opacity 300ms ease",pointerEvents:ut?"auto":"none"},children:[i.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:Ae,...Ot}}),i.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ut,...Gt,children:[i.jsx("div",{className:`${e}-lightbox-content`,style:Bt,onClick:t=>t.stopPropagation(),children:i.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":z&&u.length>1?"true":"false",onPointerDown:z?Vt:void 0,onPointerUp:z?qt:void 0,onPointerCancel:z?Xt:void 0,children:i.jsxs("div",{className:`${e}-slide-stack`,children:[$t&&gt?i.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:t=>{t.target===t.currentTarget&&Ft(Ue)},children:i.jsx("div",{className:`${e}-slide-area`,children:kt($t.images)})},`slide-out-${Ue}`):null,i.jsx("div",{className:`${e}-slide-layer-in${gt?` ${e}-slide-fade-in`:""}`,children:i.jsx("div",{className:`${e}-slide-area`,children:de?kt(de.images):null})},`slide-in-${Ue}-${y}`)]})})}),i.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Kt,children:[i.jsx("div",{"data-controls":f?"contentMarginTop":void 0,className:f?`${e}-control`:void 0,style:{height:At,width:"100%"}}),i.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...p?{flex:1,minHeight:0}:{}},children:i.jsx("div",{className:`${e}-lightbox-content-area${p?` ${e}-lightbox-content-area-stacked`:""}`,children:Zt&&i.jsx("div",{className:`${e}-text-bar-cell${p?` ${e}-text-bar-cell-stacked`:""}`,style:p?void 0:{flex:1,minWidth:0,width:"100%"},children:p?J==="fade"?ui():hi():J==="fade"?li():oi()})})})]})]})]})},Me=400,De="cubic-bezier(0.25, 0.1, 0.25, 1)",Ht=1.1,pi=`${((1-1/Ht)/2*100).toFixed(4)}%`;function vi(e){return`
2
+ .${e}-wrapper {
3
+ position: relative;
4
+ width: 100%;
5
+ height: 100%;
6
+ }
7
+
8
+ .${e}-cover {
9
+ position: relative;
10
+ width: 100%;
11
+ height: 100%;
12
+ cursor: pointer;
13
+ pointer-events: auto;
14
+ }
15
+
16
+ .${e}-ratio-wrapper-cover {
17
+ aspect-ratio: var(--image-aspect-ratio);
18
+ height: auto;
19
+ overflow: hidden;
20
+ width: 100%;
21
+ }
22
+
23
+ .${e}-ratio-wrapper-fit {
24
+ height: 100%;
25
+ width: 100%;
26
+ }
27
+
28
+ .${e}-cover-image {
29
+ display: block;
30
+ }
31
+
32
+ .${e}-cover-image-cover {
33
+ object-fit: cover;
34
+ width: 100%;
35
+ height: 100%;
36
+ max-width: 100%;
37
+ }
38
+
39
+ .${e}-cover-image-fit {
40
+ object-fit: contain;
41
+ width: auto;
42
+ height: auto;
43
+ max-width: 100%;
44
+ }
45
+
46
+ .${e}-hover-zoom-in .${e}-cover-image {
47
+ clip-path: inset(0);
48
+ transition: transform ${Me}ms ${De}, clip-path ${Me}ms ${De};
49
+ }
50
+
51
+ .${e}-hover-scale-down .${e}-cover-image {
52
+ transition: transform ${Me}ms ${De};
53
+ }
54
+
55
+ .${e}-hover-greyscale .${e}-cover-image {
56
+ transition: filter ${Me}ms ${De};
57
+ }
58
+
59
+ @media (hover: hover) {
60
+ .${e}-hover-zoom-in .${e}-cover:hover .${e}-cover-image {
61
+ transform: scale(${Ht});
62
+ clip-path: inset(${pi});
63
+ }
64
+ .${e}-hover-scale-down .${e}-cover:hover .${e}-cover-image {
65
+ transform: scale(0.9);
66
+ }
67
+ .${e}-hover-greyscale .${e}-cover:hover .${e}-cover-image {
68
+ filter: grayscale(1);
69
+ }
70
+ }
71
+
72
+ .${e}-lightbox {
73
+ position: fixed;
74
+ inset: 0;
75
+ z-index: 9997;
76
+ display: flex;
77
+ flex-direction: column;
78
+ align-items: center;
79
+ justify-content: center;
80
+ overscroll-behavior: none;
81
+ }
82
+
83
+ .${e}-lightbox-editor {
84
+ inset: auto;
85
+ top: var(--cntrl-article-top, 0);
86
+ left: var(--cntrl-article-left, 0);
87
+ width: var(--cntrl-article-width, 100vw) !important;
88
+ height: var(--cntrl-viewport-height, 100vh) !important;
89
+ }
90
+
91
+ .${e}-lightbox-edit-mode {
92
+ z-index: 1;
93
+ }
94
+
95
+ .${e}-lightbox-content {
96
+ position: relative;
97
+ z-index: 1;
98
+ display: flex;
99
+ flex-direction: column;
100
+ align-items: center;
101
+ justify-content: center;
102
+ width: 100%;
103
+ height: 100%;
104
+ box-sizing: border-box;
105
+ }
106
+
107
+ .${e}-lightbox-backdrop {
108
+ position: absolute;
109
+ inset: 0;
110
+ pointer-events: none;
111
+ }
112
+
113
+ .${e}-lightbox-dismiss-area {
114
+ position: relative;
115
+ width: 100%;
116
+ height: 100%;
117
+ }
118
+
119
+ .${e}-lightbox-strip {
120
+ position: relative;
121
+ flex: 1;
122
+ width: 100%;
123
+ min-height: 0;
124
+ display: flex;
125
+ align-items: center;
126
+ justify-content: center;
127
+ max-width: 100%;
128
+ overflow: hidden;
129
+ box-sizing: border-box;
130
+ }
131
+
132
+ .${e}-lightbox-strip[data-desktop-nav="true"]::before,
133
+ .${e}-lightbox-strip[data-desktop-nav="true"]::after {
134
+ content: '';
135
+ position: absolute;
136
+ top: 0;
137
+ bottom: 0;
138
+ width: 50%;
139
+ z-index: 2;
140
+ }
141
+
142
+ .${e}-lightbox-strip[data-desktop-nav="true"]::before {
143
+ left: 0;
144
+ cursor: w-resize;
145
+ }
146
+
147
+ .${e}-lightbox-strip[data-desktop-nav="true"]::after {
148
+ right: 0;
149
+ cursor: e-resize;
150
+ }
151
+
152
+ .${e}-slide-stack {
153
+ position: relative;
154
+ width: 100%;
155
+ height: 100%;
156
+ display: flex;
157
+ align-items: center;
158
+ justify-content: center;
159
+ }
160
+
161
+ .${e}-slide-layer-out {
162
+ position: absolute;
163
+ inset: 0;
164
+ display: flex;
165
+ align-items: center;
166
+ justify-content: center;
167
+ z-index: 1;
168
+ }
169
+
170
+ .${e}-slide-layer-in {
171
+ position: absolute;
172
+ inset: 0;
173
+ display: flex;
174
+ align-items: center;
175
+ justify-content: center;
176
+ z-index: 0;
177
+ }
178
+
179
+ @keyframes ${e}-slide-fade-in {
180
+ from { opacity: 0; }
181
+ to { opacity: 1; }
182
+ }
183
+
184
+ @keyframes ${e}-slide-fade-out {
185
+ from { opacity: 1; }
186
+ to { opacity: 0; }
187
+ }
188
+
189
+ .${e}-slide-fade-in {
190
+ opacity: 0;
191
+ animation: ${e}-slide-fade-in 300ms ease-in-out forwards;
192
+ }
193
+
194
+ .${e}-slide-fade-out {
195
+ animation: ${e}-slide-fade-out 300ms ease-in-out forwards;
196
+ }
197
+
198
+ .${e}-slide-area {
199
+ position: relative;
200
+ width: 100%;
201
+ height: 100%;
202
+ min-width: 0;
203
+ min-height: 0;
204
+ box-sizing: border-box;
205
+ display: flex;
206
+ justify-content: center;
207
+ align-items: center;
208
+ }
209
+
210
+ .${e}-slide-inner {
211
+ display: flex;
212
+ flex-direction: row;
213
+ align-items: center;
214
+ justify-content: center;
215
+ width: 100%;
216
+ height: 100%;
217
+ box-sizing: border-box;
218
+ }
219
+
220
+ .${e}-slide-image-cell {
221
+ position: relative;
222
+ min-width: 0;
223
+ height: 100%;
224
+ }
225
+
226
+ .${e}-slide-image-cell-cover {
227
+ aspect-ratio: var(--image-aspect-ratio);
228
+ overflow: hidden;
229
+ height: auto;
230
+ width: 100%;
231
+ }
232
+
233
+ .${e}-slide-image {
234
+ display: block;
235
+ user-select: none;
236
+ }
237
+
238
+ .${e}-slide-image-cover {
239
+ object-fit: cover;
240
+ width: 100%;
241
+ height: 100%;
242
+ max-width: 100%;
243
+ }
244
+
245
+ .${e}-slide-image-fit {
246
+ object-fit: contain;
247
+ width: auto;
248
+ height: auto;
249
+ max-width: 100%;
250
+ }
251
+
252
+ .${e}-slide-image-custom {
253
+ object-fit: var(--image-object-fit);
254
+ max-width: 100%;
255
+ height: 100%;
256
+ }
257
+
258
+ .${e}-close-icon {
259
+ position: relative;
260
+ flex-shrink: 0;
261
+ align-self: center;
262
+ pointer-events: auto;
263
+ z-index: 2;
264
+ display: flex;
265
+ align-items: center;
266
+ justify-content: center;
267
+ border: none;
268
+ background-color: transparent;
269
+ padding: 0;
270
+ }
271
+
272
+ .${e}-close-icon-inner {
273
+ all: unset;
274
+ position: relative;
275
+ cursor: pointer;
276
+ width: 100%;
277
+ height: 100%;
278
+ pointer-events: auto;
279
+ }
280
+
281
+ .${e}-close-icon-img {
282
+ position: absolute;
283
+ top: 50%;
284
+ left: 50%;
285
+ transform: translate(-50%, -50%);
286
+ }
287
+
288
+ .${e}-titles-row {
289
+ position: relative;
290
+ flex: 0 1 auto;
291
+ z-index: 2;
292
+ box-sizing: border-box;
293
+ pointer-events: none;
294
+ word-break: break-word;
295
+ min-width: 0;
296
+ display: flex;
297
+ flex-direction: row;
298
+ align-items: baseline;
299
+ }
300
+
301
+ .${e}-titles-row-header {
302
+ flex: 1;
303
+ align-items: baseline;
304
+ }
305
+
306
+ .${e}-titles-row-header-controls {
307
+ display: flex;
308
+ flex-direction: row;
309
+ align-items: baseline;
310
+ flex-shrink: 0;
311
+ }
312
+
313
+ .${e}-titles-baseline-strut {
314
+ width: 0;
315
+ overflow: hidden;
316
+ flex-shrink: 0;
317
+ pointer-events: none;
318
+ white-space: nowrap;
319
+ }
320
+
321
+ .${e}-titles-row-titles {
322
+ position: relative;
323
+ flex: 1;
324
+ min-width: 0;
325
+ align-self: flex-start;
326
+ }
327
+
328
+ .${e}-titles-row-two-row {
329
+ display: flex;
330
+ flex: 1;
331
+ height: 100%;
332
+ min-height: 0;
333
+ align-self: stretch;
334
+ flex-direction: column;
335
+ width: 100%;
336
+ }
337
+
338
+ .${e}-titles-row-top {
339
+ display: flex;
340
+ flex-direction: row;
341
+ align-items: baseline;
342
+ width: 100%;
343
+ flex-shrink: 0;
344
+ margin-bottom: 0;
345
+ }
346
+
347
+ .${e}-titles-row-top .${e}-title-cell[data-title="title1"] {
348
+ flex: 0 0 auto;
349
+ min-width: 0;
350
+ }
351
+
352
+ .${e}-titles-row-bottom-wrap {
353
+ display: flex;
354
+ flex-direction: column;
355
+ width: 100%;
356
+ margin-top: auto;
357
+ flex-shrink: 0;
358
+ }
359
+
360
+ .${e}-titles-row-bottom-area {
361
+ position: relative;
362
+ flex: 1;
363
+ min-height: 0;
364
+ display: flex;
365
+ flex-direction: column;
366
+ width: 100%;
367
+ }
368
+
369
+ .${e}-titles-row-bottom {
370
+ position: relative;
371
+ display: flex;
372
+ flex-direction: row;
373
+ align-items: flex-end;
374
+ width: 100%;
375
+ }
376
+
377
+ .${e}-titles-row-bottom .${e}-title-cell {
378
+ flex: 0 0 auto;
379
+ }
380
+
381
+ .${e}-title-cell {
382
+ position: relative;
383
+ flex: 0 0 auto;
384
+ min-width: 0;
385
+ box-sizing: border-box;
386
+ }
387
+
388
+ .${e}-text-bar-cell {
389
+ position: relative;
390
+ flex: 0 1 auto;
391
+ min-width: 0;
392
+ display: flex;
393
+ align-items: baseline;
394
+ }
395
+
396
+ .${e}-title1,
397
+ .${e}-title2,
398
+ .${e}-title3 {
399
+ margin: 0;
400
+ min-width: 0;
401
+ }
402
+
403
+ .${e}-title-resize-handle {
404
+ background: transparent;
405
+ }
406
+
407
+ .${e}-titles-stack {
408
+ position: relative;
409
+ display: flex;
410
+ flex-direction: row;
411
+ align-items: baseline;
412
+ align-self: flex-start;
413
+ min-width: 0;
414
+ }
415
+
416
+ .${e}-titles-stack-stacked {
417
+ flex-direction: column;
418
+ align-items: stretch;
419
+ height: 100%;
420
+ }
421
+
422
+ .${e}-titles-layer-out {
423
+ position: absolute;
424
+ inset: 0;
425
+ display: flex;
426
+ flex-direction: row;
427
+ align-items: baseline;
428
+ z-index: 1;
429
+ overflow: visible;
430
+ }
431
+
432
+ .${e}-titles-layer-out-stacked {
433
+ flex-direction: column;
434
+ align-items: stretch;
435
+ }
436
+
437
+ .${e}-titles-layer-out-bottom {
438
+ justify-content: flex-end;
439
+ }
440
+
441
+ .${e}-titles-layer-in {
442
+ position: relative;
443
+ display: flex;
444
+ flex-direction: row;
445
+ align-items: baseline;
446
+ min-width: 0;
447
+ }
448
+
449
+ .${e}-titles-layer-in-stacked {
450
+ flex-direction: column;
451
+ align-items: stretch;
452
+ flex: 1;
453
+ min-height: 0;
454
+ }
455
+
456
+ .${e}-titles-layer-in-fading {
457
+ position: absolute;
458
+ inset: 0;
459
+ z-index: 0;
460
+ overflow: visible;
461
+ }
462
+
463
+ .${e}-titles-fade-in,
464
+ .${e}-titles-fade-out {
465
+ overflow: visible;
466
+ }
467
+
468
+ @keyframes ${e}-titles-fade-in {
469
+ from { opacity: 0; }
470
+ to { opacity: 1; }
471
+ }
472
+
473
+ @keyframes ${e}-titles-fade-out {
474
+ from { opacity: 1; }
475
+ to { opacity: 0; }
476
+ }
477
+
478
+ .${e}-titles-fade-in {
479
+ opacity: 0;
480
+ animation: ${e}-titles-fade-in 400ms ease-in-out forwards;
481
+ }
482
+
483
+ .${e}-titles-fade-out {
484
+ animation: ${e}-titles-fade-out 400ms ease-in-out forwards;
485
+ }
486
+
487
+ .${e}-lightbox-overlay-content {
488
+ position: absolute;
489
+ inset: 0;
490
+ z-index: 3;
491
+ pointer-events: none;
492
+ display: flex;
493
+ flex-direction: column;
494
+ isolation: isolate;
495
+ }
496
+
497
+ .${e}-lightbox-content-area {
498
+ position: relative;
499
+ display: flex;
500
+ flex-direction: row;
501
+ align-items: flex-start;
502
+ flex: 1;
503
+ min-width: 0;
504
+ min-height: 0;
505
+ }
506
+
507
+ .${e}-lightbox-content-area-stacked {
508
+ align-items: stretch;
509
+ align-self: stretch;
510
+ }
511
+
512
+ .${e}-text-bar-cell-stacked {
513
+ align-self: stretch;
514
+ flex: 1;
515
+ min-width: 0;
516
+ min-height: 0;
517
+ height: 100%;
518
+ flex-direction: column;
519
+ align-items: stretch;
520
+ }
521
+
522
+ .${e}-entry-counter {
523
+ position: relative;
524
+ z-index: 2;
525
+ pointer-events: none;
526
+ white-space: nowrap;
527
+ flex-shrink: 0;
528
+ }
529
+
530
+ .${e}-control {
531
+ position: relative;
532
+ z-index: 2;
533
+ pointer-events: auto;
534
+ flex-shrink: 0;
535
+ }
536
+
537
+ .${e}-control::before {
538
+ content: "";
539
+ position: absolute;
540
+ top: 0;
541
+ left: 0;
542
+ width: 100%;
543
+ height: 100%;
544
+ min-width: 20px;
545
+ min-height: 20px;
546
+ pointer-events: auto;
547
+ z-index: 10;
548
+ }
549
+ `}const wi=({settings:e,content:E,isEditor:I,isEditMode:w,isPreviewMode:f,portalId:ee,metadata:U})=>{const{prefix:j}=fi.useScopedStyles(),k=(U==null?void 0:U.itemId)??null,{cover:V,coverFit:q,type:C,hover:te="none"}=e,Ae=te!=="none"&&(!I||f)?` ${j}-hover-${te}`:"",Ee=o.useRef(null),[Je,H]=o.useState(!1),[J,ie]=o.useState(0),re=o.useRef(!1),X=o.useRef(!1),R=o.useRef(!1),L=o.useMemo(()=>(E??[]).filter(b=>l.getEntryImages(b).length>0),[E]),pe=Je&&L.length>0,$=!I,Fe=o.useCallback(()=>{$&&(R.current=!0,l.removeJournalUrlParam(X.current,k),X.current=!1)},[$,k]),ze=(b=0)=>{if(L.length===0||I&&!w&&!f)return;const _=l.buildJournalSlides(L,C),F=Math.max(0,Math.min(b,_.length-1));if(ie(F),$){const we=l.hasJournalUrlParam();l.setJournalUrlParam(F+1,k,we),X.current=!we}H(!0)},ve=o.useCallback(()=>{H(!1),R.current=!1},[]);return o.useEffect(()=>{!I||w||f||H(!1)},[I,w,f]),o.useEffect(()=>{if(!$||typeof window>"u")return;const b=window.history.scrollRestoration;return window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration=b}},[$]),o.useEffect(()=>{if(!$||re.current)return;re.current=!0;const b=l.findJournalUrlSlideNumber(k);if(!b)return;const _=l.slideNumberToIndex(b,l.buildJournalSlides(L,C).length);_<0||(ie(_),H(!0))},[L,k,$,C]),o.useEffect(()=>{if(!$)return;const b=()=>{if(R.current){R.current=!1,H(!1);return}const _=l.findJournalUrlSlideNumber(k);if(!_){H(!1);return}const F=l.slideNumberToIndex(_,l.buildJournalSlides(L,C).length);if(F<0){H(!1);return}X.current=!1,ie(F),H(!0)};return window.addEventListener("popstate",b),()=>window.removeEventListener("popstate",b)},[L,k,$,C]),i.jsxs(i.Fragment,{children:[i.jsxs("div",{ref:Ee,className:`${j}-wrapper${Ae}`,children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:vi(j)}}),V?i.jsx("button",{type:"button",className:`${j}-cover ${G.isImageRatioCover(q)?`${j}-ratio-wrapper-cover`:`${j}-ratio-wrapper-fit`}`,onClick:()=>ze(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:I&&!w&&!f?"none":void 0,...G.isImageRatioCover(q)?{"--image-aspect-ratio":G.getAspectRatio(q)}:{}},"aria-label":"Open journal gallery",children:i.jsx("img",{className:`${j}-cover-image ${G.isImageRatioCover(q)?`${j}-cover-image-cover`:`${j}-cover-image-fit`}`,src:V,alt:"cover"})}):null]}),pe&&typeof document<"u"&&(()=>{const b=(ee?document.getElementById(ee):null)??document.body;return Lt.createPortal(i.jsx(xi,{prefix:j,entries:L,settings:e,isEditor:I,isEditMode:w,isPreviewMode:f,initialSlideIndex:J,enableUrlSync:$,journalItemId:k,onBeforeClose:Fe,onClose:ve}),b)})()]})};exports.LightboxJournal=wi;