@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
@@ -1,523 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),o=require("react"),Nt=require("react-dom"),di=require("./useScopedStyles-Bf6yohVQ.js"),G=require("./useLightboxSwipeDismiss-Br9uE5G0.js"),lt=require("./scalingValue-CSHYgTZl.js"),ui=require("./SvgImage-_QN8ngad.js"),hi=require("./useLightboxScrollLock-Hf16Eq4g.js"),l=require("./utils-033j3qNL.js"),fi=({prefix:e,entries:J,settings:I,isEditor:w,isEditMode:f,isPreviewMode:te,initialSlideIndex:U=0,enableUrlSync:j=!1,journalItemId:N=null,onBeforeClose:q,onClose:X})=>{const{type:k,coverFit:re,backgroundColor:_e,imageGap:L,maxWidth:De,maxHeight:ae,textTransition:E,title1Width:V,title2Width:Y,title3Width:C,title1MarginLeft:H=0,title2MarginLeft:S=0,title3MarginLeft:we=0,titleRowMarginBottom:ie=0,titleHeaderLayout:Ae="single-row",countCloseGap:b=0,closeIcon:M,closeIconMaxWidth:F,closeIconColor:ce,closeIconHoverColor:st,contentMarginTop:kt=0,iconMarginRight:Ct=0}=I,m=o.useCallback(t=>lt.scalingValue(t,w??!1),[w]),Je=m(L??0),Lt=`${De}%`,Ht=`${ae}%`,ye=m(b),Mt=m(kt),rt=m(Ct),ne=l.journalTextFieldsToCss("title1",l.resolveJournalTextFields(I,"title1"),w),de=l.journalTextFieldsToCss("title2",l.resolveJournalTextFields(I,"title2"),w),ue=l.journalTextFieldsToCss("title3",l.resolveJournalTextFields(I,"title3"),w),_t=l.journalTextFieldsToCss("count",l.resolveJournalTextFields(I,"count"),w),p=Ae==="mobile",z=!w||!!te,Dt=!f&&(!w||!!te),u=o.useMemo(()=>l.buildJournalSlides(J,k),[J,k]),[y,Ee]=o.useState(U),he=u[y],h=he==null?void 0:he.entry,[at,ct]=o.useState(!1),[dt,fe]=o.useState(null),[$,me]=o.useState(!1),[ut,Fe]=o.useState(null),[ht,ze]=o.useState(!1),[Be,ft]=o.useState(0),[oe,ge]=o.useState(),[be,xe]=o.useState(),[$e,Te]=o.useState(null),Z=o.useRef(null),Se=o.useRef(0),Ie=o.useRef(0),mt=o.useRef(0),gt=o.useRef(!1),Ke=o.useRef(null),Oe=o.useRef(null),B=o.useRef(null),K=o.useRef(null),Ge=o.useRef(null),xt=o.useRef(null),je=o.useRef(null),pt=o.useCallback(()=>{const t=Oe.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]),Q=o.useCallback(()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)},[]),At=o.useCallback(t=>{t===Se.current&&(Fe(null),ze(!1))},[]),pe=o.useCallback(()=>{f||gt.current||(gt.current=!0,q==null||q(),ct(!1),Ke.current=setTimeout(()=>{X()},300))},[f,q,X]),Jt=o.useCallback(t=>!!(t.closest("[data-controls]")||t.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ue,backdropStyle:Et,mediaAreaStyle:Ft,overlayContentStyle:zt,swipeHandlers:Bt,dismissAreaStyle:Kt}=G.useLightboxSwipeDismiss({enabled:Dt,onClose:pe,animMs:300,isBlockedTarget:Jt}),vt=o.useCallback(t=>{j&&l.setJournalUrlParam(t+1,N,!0)},[j,N]),qe=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=E==="fade"&&l.getEntryTitleKey(a==null?void 0:a.entry)!==l.getEntryTitleKey(s==null?void 0:s.entry),x=qe(B.current),c=d?(()=>{const R=pt();Nt.flushSync(()=>{Te(s.entry)}),B.current&&R&&(B.current.style.width=`${R}px`);const Me=qe(B.current);return B.current&&(B.current.style.width=""),{measuredIncomingTitlesHeight:Me,incomingTitlesMeasureWidth:R}})():void 0,T=Math.max(x??0,(c==null?void 0:c.measuredIncomingTitlesHeight)??0)||void 0;ft(r),Fe(y),ze(!0),Ee(n),vt(n),mt.current=n,d?(Q(),T&&ge(T),c!=null&&c.incomingTitlesMeasureWidth&&xe(c.incomingTitlesMeasureWidth),fe((a==null?void 0:a.entryIndex)??null),me(!0),Ie.current=s.entryIndex,Z.current=setTimeout(()=>{fe(null),me(!1),ge(void 0),xe(void 0),Te(null),Z.current=null},400)):(Q(),fe(null),me(!1),ge(void 0),xe(void 0),Te(null),Ie.current=s.entryIndex)},[y,Q,pt,qe,u,vt,E]),ve=o.useCallback(()=>{je.current=null},[]),Ot=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]),Gt=o.useCallback(t=>{var R;if(!z||u.length<=1||t.pointerType==="mouse"&&t.button!==0)return;if(Ue){ve();return}const n=je.current;if(!n||n.pointerId!==t.pointerId||(ve(),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=(R=K.current)==null?void 0:R.getBoundingClientRect(),T=c?c.left+c.width/2:window.innerWidth/2;le(t.clientX<T?y-1:y+1)},[y,z,le,Ue,ve,u.length]),Ut=o.useCallback(t=>{const n=je.current;(n==null?void 0:n.pointerId)===t.pointerId&&ve()},[ve]);hi.useLightboxScrollLock(),o.useEffect(()=>{xt.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const t=requestAnimationFrame(()=>{ct(!0),requestAnimationFrame(()=>{Ge.current?Ge.current.focus():K.current&&K.current.focus()})});return()=>{cancelAnimationFrame(t),Ke.current&&clearTimeout(Ke.current),Z.current&&clearTimeout(Z.current);const n=xt.current;n&&document.contains(n)&&n.focus({preventScroll:!0})}},[]),o.useEffect(()=>{var t;E!=="fade"&&(Ie.current=((t=u[y])==null?void 0:t.entryIndex)??0,Q(),fe(null),me(!1),ge(void 0),xe(void 0))},[y,Q,u,E]),o.useEffect(()=>{const t=n=>{if(n.key==="Escape"){pe();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"&&K.current){const a=K.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||!K.current.contains(x))&&(n.preventDefault(),d.focus()):(x===d||!K.current.contains(x))&&(n.preventDefault(),r.focus())}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[le,pe,y,u.length]),o.useLayoutEffect(()=>{Q(),Se.current=0,ft(0),Fe(null),ze(!1),fe(null),me(!1),ge(void 0),xe(void 0),Te(null),Ee(t=>{const n=Math.max(0,u.length-1);return Math.min(t,n)})},[Q,J.length,k,u.length]),o.useLayoutEffect(()=>{var a;const t=Math.max(0,u.length-1),n=Math.min(Math.max(0,U),t);mt.current=n,Ie.current=((a=u[n])==null?void 0:a.entryIndex)??0,Ee(n)},[U]);const g=dt!==null?J[dt]:null,wt=ut!==null?u[ut]:null,We=(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),P=l.shouldShowCounter(k,u,J),se=M!==null,qt=We||P||se,Xt=P&&se?{gap:ye}:void 0,Re=`${e}-titles-stack${p?` ${e}-titles-stack-stacked`:""}`,yt=`${e}-titles-layer-out${p?` ${e}-titles-layer-out-stacked`:""}`,Vt=`${e}-titles-layer-out`,Xe=(H??0)>0||f,Yt=m(ie),W=o.useMemo(()=>({title1Width:V??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title1Width,title2Width:Y??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title2Width,title3Width:C??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title3Width}),[V,Y,C]),_=o.useMemo(()=>({title2MarginLeft:S,title3MarginLeft:we}),[S,we]),v=o.useMemo(()=>h?l.buildJournalTitleSlots(e,h,ne,de,ue):[],[e,h,ne,de,ue]),Ne=o.useMemo(()=>v.map(t=>W[t.widthKey]),[v,W]),D=o.useMemo(()=>l.resolveJournalTitleWidths(v.length,Ne),[v.length,Ne]),bt=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]),O=o.useMemo(()=>l.getRowScopedJournalTitleWidths(A,W),[A,W]),Ve=o.useCallback((t,n)=>{const a=v.findIndex(r=>r.prefix===t.prefix);if(!p||n==="single-row")return{effectiveWidth:bt[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:O.effective[s]??0,resolvedWidth:O.resolved[s]??0,maxWidth:l.getJournalTitleMaxWidth(s,O.resolved)}},[v,A,O,bt,D,ke,Ce,p]),Zt=o.useCallback(t=>l.getJournalTitleBoundaryOffset(v,D,_,t)+(p?0:H??0),[v,D,_,p,H]),Qt=o.useCallback(()=>p?0:H??0,[p,H]),Ye=o.useCallback(t=>A.slice(0,t).reduce((n,a,s)=>n+(a.marginLeftKey?_[a.marginLeftKey]??0:0)+(O.resolved[s]??0),0),[A,O.resolved,_]),Pt=o.useCallback(t=>{const n=A[t];return Ye(t)+(n.marginLeftKey?_[n.marginLeftKey]??0:0)+(O.resolved[t]??0)},[A,O.resolved,Ye,_]),Ze=o.useCallback((t,n,a)=>{if(!p||a==="single-row"){const c=t.findIndex(ee=>ee.prefix===n.prefix),T=t.map(ee=>W[ee.widthKey]),R=l.resolveJournalTitleWidths(t.length,T);return{effectiveWidth:l.getEffectiveJournalTitleWidths(t.length,T)[c]??0,resolvedWidth:R[c]??0,maxWidth:l.getJournalTitleMaxWidth(c,R)}}if(a==="two-row-top"){const c=t.filter(ee=>ee.prefix==="title1"),T=c.findIndex(ee=>ee.prefix===n.prefix),{resolved:R,effective:Me}=l.getRowScopedJournalTitleWidths(c,W);return{effectiveWidth:Me[T]??0,resolvedWidth:R[T]??0,maxWidth:l.getJournalTitleMaxWidth(T,R)}}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]),Qe=(t,n,a)=>{const s=t.marginLeftKey?_[t.marginLeftKey]??0:0,{effectiveWidth:r,resolvedWidth:d,maxWidth:x}=a??Ve(t,n),c=Math.max(s,l.TITLE_PADDING_HANDLE_WIDTH),T=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}),T&&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,T?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)},Pe=(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(H??0),flexShrink:0,alignSelf:"stretch",...s?{pointerEvents:"auto"}:{}}})},et=()=>i.jsx("span",{className:`${e}-titles-baseline-strut`,style:ne,"aria-hidden":"true",children:" "}),$t=()=>i.jsx("span",{className:`${e}-entry-counter`,style:_t,"aria-live":"polite","aria-atomic":"true",children:l.formatSlideCounter(u,y,k,J)}),ei=()=>P?f&&se?i.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[$t(),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}})]}):$t():null,tt=()=>!P&&!se?null:i.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Xt,children:[ei(),se?ni():null]}),ti=()=>i.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[P||We?et():null,Xe?Pe("single-row"):null,St(h),i.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),tt(),ot()]}),ii=()=>i.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[P||We?et():null,Xe?Pe("single-row"):null,i.jsxs("div",{className:`${e}-titles-row-titles`,style:$&&oe?{minHeight:oe}:void 0,children:[i.jsx("div",{ref:B,className:Re,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:Oe,className:Re,style:{position:$?"absolute":"relative",inset:$?0:void 0,width:"100%",...$&&be?{width:be,maxWidth:"100%"}:void 0},children:[g&&$?i.jsx("div",{className:`${yt} ${e}-titles-fade-out`,children:He(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${$?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:He(h)})]})]}),tt(),ot()]}),ni=()=>i.jsxs("div",{className:`${e}-close-icon`,style:{width:lt.scalingValue(F??0,w),height:lt.scalingValue(F??0,w),marginRight:rt,"--close-icon-hover-color":st},children:[i.jsx("button",{ref:Ge,type:"button",className:`${e}-close-icon-inner`,onClick:pe,"aria-label":"Close",children:i.jsx(ui.SvgImage,{url:M??"",fill:ce,hoverFill:w&&!te?ce:st,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:rt,height:"100%",pointerEvents:"auto"}})]}),Tt=(t,n)=>i.jsxs("div",{className:`${e}-titles-row-top`,children:[P||We?et():null,Xe?Pe("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"})]}),tt()]}),St=t=>{if(!t)return null;const n=l.buildJournalTitleSlots(e,t,ne,de,ue);return i.jsx(i.Fragment,{children:n.map(a=>Qe(a,"single-row",Ze(n,a,"single-row")))})},it=t=>{if(!t)return null;const n=l.buildJournalTitleSlots(e,t,ne,de,ue),a=n.find(s=>s.prefix==="title1");return a?Qe(a,"two-row-top",Ze(n,a,"two-row-top")):null},nt=(t,n=!1)=>{const a=t?l.buildJournalTitleSlots(e,t,ne,de,ue):[],s=a.filter(x=>x.prefix==="title2"||x.prefix==="title3"),r=f&&n;return s.length>0||r||(ie??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=>Qe(x,"two-row-bottom",Ze(a,x,"two-row-bottom"))),n&&f?i.jsxs(i.Fragment,{children:[si(),ri()]}):null]}):null,(ie??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:Yt,width:"100%",flexShrink:0,pointerEvents:r?"auto":"none"}}):null]}):null},Le=(t,n=!1)=>i.jsxs(i.Fragment,{children:[Tt(it(t)),nt(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:St(t)}):null,oi=()=>{const t=p?-1:v.findIndex(s=>s.prefix==="title1"),n=!p&&(f||(H??0)>0)?(()=>{const s=H??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=_[s.marginLeftKey]??0,x=l.getJournalTitleOffsetBeforeSlot(v,D,_,r)+Qt(),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},li=()=>v.map((t,n)=>{const a=l.getJournalTitleMaxWidth(n,D),r=Zt(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`)}),si=()=>A.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const a=_[t.marginLeftKey]??0,s=Ye(n),r=Math.max(a,l.TITLE_PADDING_HANDLE_WIDTH),{resolvedWidth:d}=Ve(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)}),ri=()=>A.map((t,n)=>{const{maxWidth:a}=Ve(t,"two-row-bottom"),r=Pt(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`)}),ot=()=>!f||p?null:i.jsxs(i.Fragment,{children:[oi(),li()]}),It=t=>{const n=!t.objectFit&&G.isImageRatioCover(re);return{className:`${e}-slide-image-cell${n?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:Lt,maxHeight:Ht,...n?{"--image-aspect-ratio":G.getAspectRatio(re)}:{}}}},jt=t=>t.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":t.objectFit}}:G.isImageRatioCover(re)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Wt=t=>{if(t.length===0)return null;const n=t.length>1,a=l.getGapControlSize(Je),s=`calc(-0.5 * (${a} + ${Je}))`;if(t.length===1){const r=t[0];return i.jsx("div",{...It(r),children:i.jsx("img",{...jt(r),src:r.assetId,alt:r.name??"",draggable:!1})})}return i.jsx("div",{className:`${e}-slide-inner`,style:n?{gap:Je}:void 0,children:t.map((r,d)=>i.jsxs("div",{...It(r),children:[i.jsx("img",{...jt(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}`))})},Rt=!!(h!=null&&h.title2||h!=null&&h.title3||g!=null&&g.title2||g!=null&&g.title3||(ie??0)>0||f),ai=()=>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:B,className:Re,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:Oe,className:`${e}-titles-row-two-row`,style:{...$&&oe?{minHeight:oe}:void 0,...$&&be?{width:be,maxWidth:"100%"}:void 0},children:[Tt(i.jsxs("div",{className:Re,style:{position:$?"absolute":"relative",inset:$?0:void 0,width:"100%"},children:[g&&$?i.jsx("div",{className:`${Vt} ${e}-titles-fade-out`,children:it(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${$?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:it(h)})]}),$&&oe?oe:void 0),Rt?i.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[g&&$?i.jsx("div",{className:`${yt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:nt(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${$?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${p?` ${e}-titles-layer-in-stacked`:""}`,children:nt(h,!0)})]}):null]})]}),ci=()=>{const t=Rt;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)}),ot()]})};return i.jsxs("div",{ref:K,"data-selection":"none",className:`${e}-lightbox${w?` ${e}-lightbox-editor`:""}${f?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ue||pe()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:se?void 0:-1,style:{opacity:at?1:0,transition:"opacity 300ms ease",pointerEvents:at?"auto":"none"},children:[i.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:_e,...Et}}),i.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Kt,...Bt,children:[i.jsx("div",{className:`${e}-lightbox-content`,style:Ft,onClick:t=>t.stopPropagation(),children:i.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":z&&u.length>1?"true":"false",onPointerDown:z?Ot:void 0,onPointerUp:z?Gt:void 0,onPointerCancel:z?Ut:void 0,children:i.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&ht?i.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:t=>{t.target===t.currentTarget&&At(Be)},children:i.jsx("div",{className:`${e}-slide-area`,children:Wt(wt.images)})},`slide-out-${Be}`):null,i.jsx("div",{className:`${e}-slide-layer-in${ht?` ${e}-slide-fade-in`:""}`,children:i.jsx("div",{className:`${e}-slide-area`,children:he?Wt(he.images):null})},`slide-in-${Be}-${y}`)]})})}),i.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:zt,children:[i.jsx("div",{"data-controls":f?"contentMarginTop":void 0,className:f?`${e}-control`:void 0,style:{height:Mt,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:qt&&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?E==="fade"?ai():ci():E==="fade"?ii():ti()})})})]})]})]})};function mi(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}-lightbox {
47
- position: fixed;
48
- inset: 0;
49
- z-index: 9997;
50
- display: flex;
51
- flex-direction: column;
52
- align-items: center;
53
- justify-content: center;
54
- overscroll-behavior: none;
55
- }
56
-
57
- .${e}-lightbox-editor {
58
- inset: auto;
59
- top: var(--cntrl-article-top, 0);
60
- left: var(--cntrl-article-left, 0);
61
- width: var(--cntrl-article-width, 100vw) !important;
62
- height: var(--cntrl-viewport-height, 100vh) !important;
63
- }
64
-
65
- .${e}-lightbox-edit-mode {
66
- z-index: 1;
67
- }
68
-
69
- .${e}-lightbox-content {
70
- position: relative;
71
- z-index: 1;
72
- display: flex;
73
- flex-direction: column;
74
- align-items: center;
75
- justify-content: center;
76
- width: 100%;
77
- height: 100%;
78
- box-sizing: border-box;
79
- }
80
-
81
- .${e}-lightbox-backdrop {
82
- position: absolute;
83
- inset: 0;
84
- pointer-events: none;
85
- }
86
-
87
- .${e}-lightbox-dismiss-area {
88
- position: relative;
89
- width: 100%;
90
- height: 100%;
91
- }
92
-
93
- .${e}-lightbox-strip {
94
- position: relative;
95
- flex: 1;
96
- width: 100%;
97
- min-height: 0;
98
- display: flex;
99
- align-items: center;
100
- justify-content: center;
101
- max-width: 100%;
102
- overflow: hidden;
103
- box-sizing: border-box;
104
- }
105
-
106
- .${e}-lightbox-strip[data-desktop-nav="true"]::before,
107
- .${e}-lightbox-strip[data-desktop-nav="true"]::after {
108
- content: '';
109
- position: absolute;
110
- top: 0;
111
- bottom: 0;
112
- width: 50%;
113
- z-index: 2;
114
- }
115
-
116
- .${e}-lightbox-strip[data-desktop-nav="true"]::before {
117
- left: 0;
118
- cursor: w-resize;
119
- }
120
-
121
- .${e}-lightbox-strip[data-desktop-nav="true"]::after {
122
- right: 0;
123
- cursor: e-resize;
124
- }
125
-
126
- .${e}-slide-stack {
127
- position: relative;
128
- width: 100%;
129
- height: 100%;
130
- display: flex;
131
- align-items: center;
132
- justify-content: center;
133
- }
134
-
135
- .${e}-slide-layer-out {
136
- position: absolute;
137
- inset: 0;
138
- display: flex;
139
- align-items: center;
140
- justify-content: center;
141
- z-index: 1;
142
- }
143
-
144
- .${e}-slide-layer-in {
145
- position: absolute;
146
- inset: 0;
147
- display: flex;
148
- align-items: center;
149
- justify-content: center;
150
- z-index: 0;
151
- }
152
-
153
- @keyframes ${e}-slide-fade-in {
154
- from { opacity: 0; }
155
- to { opacity: 1; }
156
- }
157
-
158
- @keyframes ${e}-slide-fade-out {
159
- from { opacity: 1; }
160
- to { opacity: 0; }
161
- }
162
-
163
- .${e}-slide-fade-in {
164
- opacity: 0;
165
- animation: ${e}-slide-fade-in 300ms ease-in-out forwards;
166
- }
167
-
168
- .${e}-slide-fade-out {
169
- animation: ${e}-slide-fade-out 300ms ease-in-out forwards;
170
- }
171
-
172
- .${e}-slide-area {
173
- position: relative;
174
- width: 100%;
175
- height: 100%;
176
- min-width: 0;
177
- min-height: 0;
178
- box-sizing: border-box;
179
- display: flex;
180
- justify-content: center;
181
- align-items: center;
182
- }
183
-
184
- .${e}-slide-inner {
185
- display: flex;
186
- flex-direction: row;
187
- align-items: center;
188
- justify-content: center;
189
- width: 100%;
190
- height: 100%;
191
- box-sizing: border-box;
192
- }
193
-
194
- .${e}-slide-image-cell {
195
- position: relative;
196
- min-width: 0;
197
- height: 100%;
198
- }
199
-
200
- .${e}-slide-image-cell-cover {
201
- aspect-ratio: var(--image-aspect-ratio);
202
- overflow: hidden;
203
- height: auto;
204
- width: 100%;
205
- }
206
-
207
- .${e}-slide-image {
208
- display: block;
209
- user-select: none;
210
- }
211
-
212
- .${e}-slide-image-cover {
213
- object-fit: cover;
214
- width: 100%;
215
- height: 100%;
216
- max-width: 100%;
217
- }
218
-
219
- .${e}-slide-image-fit {
220
- object-fit: contain;
221
- width: auto;
222
- height: auto;
223
- max-width: 100%;
224
- }
225
-
226
- .${e}-slide-image-custom {
227
- object-fit: var(--image-object-fit);
228
- max-width: 100%;
229
- height: 100%;
230
- }
231
-
232
- .${e}-close-icon {
233
- position: relative;
234
- flex-shrink: 0;
235
- align-self: center;
236
- pointer-events: auto;
237
- z-index: 2;
238
- display: flex;
239
- align-items: center;
240
- justify-content: center;
241
- border: none;
242
- background-color: transparent;
243
- padding: 0;
244
- }
245
-
246
- .${e}-close-icon-inner {
247
- all: unset;
248
- position: relative;
249
- cursor: pointer;
250
- width: 100%;
251
- height: 100%;
252
- pointer-events: auto;
253
- }
254
-
255
- .${e}-close-icon-img {
256
- position: absolute;
257
- top: 50%;
258
- left: 50%;
259
- transform: translate(-50%, -50%);
260
- }
261
-
262
- .${e}-titles-row {
263
- position: relative;
264
- flex: 0 1 auto;
265
- z-index: 2;
266
- box-sizing: border-box;
267
- pointer-events: none;
268
- word-break: break-word;
269
- min-width: 0;
270
- display: flex;
271
- flex-direction: row;
272
- align-items: baseline;
273
- }
274
-
275
- .${e}-titles-row-header {
276
- flex: 1;
277
- align-items: baseline;
278
- }
279
-
280
- .${e}-titles-row-header-controls {
281
- display: flex;
282
- flex-direction: row;
283
- align-items: baseline;
284
- flex-shrink: 0;
285
- }
286
-
287
- .${e}-titles-baseline-strut {
288
- width: 0;
289
- overflow: hidden;
290
- flex-shrink: 0;
291
- pointer-events: none;
292
- white-space: nowrap;
293
- }
294
-
295
- .${e}-titles-row-titles {
296
- position: relative;
297
- flex: 1;
298
- min-width: 0;
299
- align-self: flex-start;
300
- }
301
-
302
- .${e}-titles-row-two-row {
303
- display: flex;
304
- flex: 1;
305
- height: 100%;
306
- min-height: 0;
307
- align-self: stretch;
308
- flex-direction: column;
309
- width: 100%;
310
- }
311
-
312
- .${e}-titles-row-top {
313
- display: flex;
314
- flex-direction: row;
315
- align-items: baseline;
316
- width: 100%;
317
- flex-shrink: 0;
318
- margin-bottom: 0;
319
- }
320
-
321
- .${e}-titles-row-top .${e}-title-cell[data-title="title1"] {
322
- flex: 0 0 auto;
323
- min-width: 0;
324
- }
325
-
326
- .${e}-titles-row-bottom-wrap {
327
- display: flex;
328
- flex-direction: column;
329
- width: 100%;
330
- margin-top: auto;
331
- flex-shrink: 0;
332
- }
333
-
334
- .${e}-titles-row-bottom-area {
335
- position: relative;
336
- flex: 1;
337
- min-height: 0;
338
- display: flex;
339
- flex-direction: column;
340
- width: 100%;
341
- }
342
-
343
- .${e}-titles-row-bottom {
344
- position: relative;
345
- display: flex;
346
- flex-direction: row;
347
- align-items: flex-end;
348
- width: 100%;
349
- }
350
-
351
- .${e}-titles-row-bottom .${e}-title-cell {
352
- flex: 0 0 auto;
353
- }
354
-
355
- .${e}-title-cell {
356
- position: relative;
357
- flex: 0 0 auto;
358
- min-width: 0;
359
- box-sizing: border-box;
360
- }
361
-
362
- .${e}-text-bar-cell {
363
- position: relative;
364
- flex: 0 1 auto;
365
- min-width: 0;
366
- display: flex;
367
- align-items: baseline;
368
- }
369
-
370
- .${e}-title1,
371
- .${e}-title2,
372
- .${e}-title3 {
373
- margin: 0;
374
- min-width: 0;
375
- }
376
-
377
- .${e}-title-resize-handle {
378
- background: transparent;
379
- }
380
-
381
- .${e}-titles-stack {
382
- position: relative;
383
- display: flex;
384
- flex-direction: row;
385
- align-items: baseline;
386
- align-self: flex-start;
387
- min-width: 0;
388
- }
389
-
390
- .${e}-titles-stack-stacked {
391
- flex-direction: column;
392
- align-items: stretch;
393
- height: 100%;
394
- }
395
-
396
- .${e}-titles-layer-out {
397
- position: absolute;
398
- inset: 0;
399
- display: flex;
400
- flex-direction: row;
401
- align-items: baseline;
402
- z-index: 1;
403
- overflow: visible;
404
- }
405
-
406
- .${e}-titles-layer-out-stacked {
407
- flex-direction: column;
408
- align-items: stretch;
409
- }
410
-
411
- .${e}-titles-layer-out-bottom {
412
- justify-content: flex-end;
413
- }
414
-
415
- .${e}-titles-layer-in {
416
- position: relative;
417
- display: flex;
418
- flex-direction: row;
419
- align-items: baseline;
420
- min-width: 0;
421
- }
422
-
423
- .${e}-titles-layer-in-stacked {
424
- flex-direction: column;
425
- align-items: stretch;
426
- flex: 1;
427
- min-height: 0;
428
- }
429
-
430
- .${e}-titles-layer-in-fading {
431
- position: absolute;
432
- inset: 0;
433
- z-index: 0;
434
- overflow: visible;
435
- }
436
-
437
- .${e}-titles-fade-in,
438
- .${e}-titles-fade-out {
439
- overflow: visible;
440
- }
441
-
442
- @keyframes ${e}-titles-fade-in {
443
- from { opacity: 0; }
444
- to { opacity: 1; }
445
- }
446
-
447
- @keyframes ${e}-titles-fade-out {
448
- from { opacity: 1; }
449
- to { opacity: 0; }
450
- }
451
-
452
- .${e}-titles-fade-in {
453
- opacity: 0;
454
- animation: ${e}-titles-fade-in 400ms ease-in-out forwards;
455
- }
456
-
457
- .${e}-titles-fade-out {
458
- animation: ${e}-titles-fade-out 400ms ease-in-out forwards;
459
- }
460
-
461
- .${e}-lightbox-overlay-content {
462
- position: absolute;
463
- inset: 0;
464
- z-index: 3;
465
- pointer-events: none;
466
- display: flex;
467
- flex-direction: column;
468
- isolation: isolate;
469
- }
470
-
471
- .${e}-lightbox-content-area {
472
- position: relative;
473
- display: flex;
474
- flex-direction: row;
475
- align-items: flex-start;
476
- flex: 1;
477
- min-width: 0;
478
- min-height: 0;
479
- }
480
-
481
- .${e}-lightbox-content-area-stacked {
482
- align-items: stretch;
483
- align-self: stretch;
484
- }
485
-
486
- .${e}-text-bar-cell-stacked {
487
- align-self: stretch;
488
- flex: 1;
489
- min-width: 0;
490
- min-height: 0;
491
- height: 100%;
492
- flex-direction: column;
493
- align-items: stretch;
494
- }
495
-
496
- .${e}-entry-counter {
497
- position: relative;
498
- z-index: 2;
499
- pointer-events: none;
500
- white-space: nowrap;
501
- flex-shrink: 0;
502
- }
503
-
504
- .${e}-control {
505
- position: relative;
506
- z-index: 2;
507
- pointer-events: auto;
508
- flex-shrink: 0;
509
- }
510
-
511
- .${e}-control::before {
512
- content: "";
513
- position: absolute;
514
- top: 0;
515
- left: 0;
516
- width: 100%;
517
- height: 100%;
518
- min-width: 20px;
519
- min-height: 20px;
520
- pointer-events: auto;
521
- z-index: 10;
522
- }
523
- `}const gi=({settings:e,content:J,isEditor:I,isEditMode:w,isPreviewMode:f,portalId:te,metadata:U})=>{const{prefix:j}=di.useScopedStyles(),N=(U==null?void 0:U.itemId)??null,{cover:q,coverFit:X,type:k}=e,re=o.useRef(null),[_e,L]=o.useState(!1),[De,ae]=o.useState(0),E=o.useRef(!1),V=o.useRef(!1),Y=o.useRef(!1),C=o.useMemo(()=>(J??[]).filter(b=>l.getEntryImages(b).length>0),[J]),H=_e&&C.length>0,S=!I,we=o.useCallback(()=>{S&&(Y.current=!0,l.removeJournalUrlParam(V.current,N),V.current=!1)},[S,N]),ie=(b=0)=>{if(C.length===0||I&&!w&&!f)return;const M=l.buildJournalSlides(C,k),F=Math.max(0,Math.min(b,M.length-1));if(ae(F),S){const ce=l.hasJournalUrlParam();l.setJournalUrlParam(F+1,N,ce),V.current=!ce}L(!0)},Ae=o.useCallback(()=>{L(!1),Y.current=!1},[]);return o.useEffect(()=>{!I||w||f||L(!1)},[I,w,f]),o.useEffect(()=>{if(!S||typeof window>"u")return;const b=window.history.scrollRestoration;return window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration=b}},[S]),o.useEffect(()=>{if(!S||E.current)return;E.current=!0;const b=l.findJournalUrlSlideNumber(N);if(!b)return;const M=l.slideNumberToIndex(b,l.buildJournalSlides(C,k).length);M<0||(ae(M),L(!0))},[C,N,S,k]),o.useEffect(()=>{if(!S)return;const b=()=>{if(Y.current){Y.current=!1,L(!1);return}const M=l.findJournalUrlSlideNumber(N);if(!M){L(!1);return}const F=l.slideNumberToIndex(M,l.buildJournalSlides(C,k).length);if(F<0){L(!1);return}V.current=!1,ae(F),L(!0)};return window.addEventListener("popstate",b),()=>window.removeEventListener("popstate",b)},[C,N,S,k]),i.jsxs(i.Fragment,{children:[i.jsxs("div",{ref:re,className:`${j}-wrapper`,children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:mi(j)}}),q?i.jsx("button",{type:"button",className:`${j}-cover ${G.isImageRatioCover(X)?`${j}-ratio-wrapper-cover`:`${j}-ratio-wrapper-fit`}`,onClick:()=>ie(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:I&&!w&&!f?"none":void 0,...G.isImageRatioCover(X)?{"--image-aspect-ratio":G.getAspectRatio(X)}:{}},"aria-label":"Open journal gallery",children:i.jsx("img",{className:`${j}-cover-image ${G.isImageRatioCover(X)?`${j}-cover-image-cover`:`${j}-cover-image-fit`}`,src:q,alt:"cover"})}):null]}),H&&typeof document<"u"&&(()=>{const b=(te?document.getElementById(te):null)??document.body;return Nt.createPortal(i.jsx(fi,{prefix:j,entries:C,settings:e,isEditor:I,isEditMode:w,isPreviewMode:f,initialSlideIndex:De,enableUrlSync:S,journalItemId:N,onBeforeClose:we,onClose:Ae}),b)})()]})};exports.LightboxJournal=gi;