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

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 (65) 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/{ChroniclesComponent-DRf1Xd9_.mjs → ChroniclesComponent-D-yEbs9w.mjs} +26 -12
  4. package/dist/ChroniclesComponent-Os_r2IYg.js +1 -0
  5. package/dist/Components/Chronicles/ChroniclesComponent.d.ts +4 -0
  6. package/dist/Components/Grid/Grid.d.ts +1 -0
  7. package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +0 -7
  8. package/dist/{ControlSlider-DB4nbVLT.js → ControlSlider-C8ckUIDm.js} +1 -1
  9. package/dist/{ControlSlider-3w-bHQEg.mjs → ControlSlider-DqKfaKMG.mjs} +1 -1
  10. package/dist/{FAQ-GmiwRdFq.mjs → FAQ-CJHCMSBa.mjs} +1 -1
  11. package/dist/{FAQ-7HEkaoU6.js → FAQ-DLh63Utr.js} +1 -1
  12. package/dist/Grid-OvzWvUW9.js +403 -0
  13. package/dist/{Grid-Dn44dvgx.mjs → Grid-t07NDMzY.mjs} +555 -528
  14. package/dist/{Hive-34KvKNsa.js → Hive-CzabuuCc.js} +1 -1
  15. package/dist/{Hive-7xHXyMM1.mjs → Hive-DyxYd5eg.mjs} +1 -1
  16. package/dist/{HiveLightboxTitles-BCoL46-V.mjs → HiveLightboxTitles-DhEeFKWs.mjs} +1 -1
  17. package/dist/{HiveLightboxTitles-DEeyQGcf.js → HiveLightboxTitles-DlyptAaK.js} +1 -1
  18. package/dist/{Lightbox-DzPqgKP4.mjs → Lightbox-BY99NS14.mjs} +1 -1
  19. package/dist/{Lightbox-Cb7lyaNt.js → Lightbox-DZckgBzK.js} +1 -1
  20. package/dist/{LightboxJournal-C_q7_s-B.mjs → LightboxJournal-D59ex6wH.mjs} +1 -1
  21. package/dist/{LightboxJournal-BFF5aKRz.js → LightboxJournal-DAEZOPDi.js} +1 -1
  22. package/dist/{LightboxStrip-CC2e0_9A.js → LightboxStrip-BDjI1jyH.js} +1 -1
  23. package/dist/{LightboxStrip-BrNj7ipX.mjs → LightboxStrip-YspzBP8N.mjs} +1 -1
  24. package/dist/{Mercury-BmhtFYOw.js → Mercury-B-s2Kvuq.js} +1 -1
  25. package/dist/{Mercury-Q788wrYQ.mjs → Mercury-CCW0Es-s.mjs} +1 -1
  26. package/dist/{OnelinerForm-D8WIB9Qy.mjs → OnelinerForm-BEu7_sho.mjs} +1 -1
  27. package/dist/{OnelinerForm-CUmY-bXL.js → OnelinerForm-C2Y_XMCY.js} +1 -1
  28. package/dist/{SimpleButton-DTpzfmb6.mjs → SimpleButton-C-o2W9bS.mjs} +1 -1
  29. package/dist/{SimpleButton-DtaCYa3y.js → SimpleButton-nGEcO2gB.js} +1 -1
  30. package/dist/{Slider20-q0iGgnE3.js → Slider20-BOmjDRf2.js} +1 -1
  31. package/dist/{Slider20-CKngROrc.mjs → Slider20-DUi6qwnd.mjs} +1 -1
  32. package/dist/SvgImage-B5mR9y6q.mjs +51 -0
  33. package/dist/SvgImage-DFlmxAoL.js +1 -0
  34. package/dist/{TestimonialSingle-CpEUendN.js → TestimonialSingle-BORQom3u.js} +1 -1
  35. package/dist/{TestimonialSingle-Bax71Hyo.mjs → TestimonialSingle-DrnyReim.mjs} +1 -1
  36. package/dist/{Waterfall-znaoynn5.mjs → Waterfall-3kKioKh2.mjs} +1 -1
  37. package/dist/{Waterfall-B9YWMhrg.js → Waterfall-DII4-WV5.js} +1 -1
  38. package/dist/components-D4ZrIo2M.js +1 -0
  39. package/dist/{components-y6LC2ILa.mjs → components-Ds6rhj3U.mjs} +29 -652
  40. package/dist/elements.js +1 -1
  41. package/dist/elements.mjs +22 -23
  42. package/dist/elements.node.js +1 -1
  43. package/dist/elements.node.mjs +1 -1
  44. package/dist/index.d.ts +1 -3
  45. package/dist/index.js +1 -1
  46. package/dist/index.mjs +27 -48
  47. package/dist/loadSvgMaskUrl-DfF7ay6h.js +1 -0
  48. package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +20 -0
  49. package/dist/sources.js +42 -5
  50. package/dist/sources.mjs +45 -8
  51. package/dist/types/Component.d.ts +0 -7
  52. package/dist/types/SchemaV1.d.ts +0 -3
  53. package/package.json +1 -1
  54. package/dist/ChroniclesComponent-BHZu7BbK.js +0 -1
  55. package/dist/Components/PopupMenu/PopupMenu.d.ts +0 -70
  56. package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +0 -597
  57. package/dist/Components/PopupMenu/popupMenuLayout.d.ts +0 -176
  58. package/dist/Grid-BXUT_Hn6.js +0 -378
  59. package/dist/PopupMenu-On4dKyT3.js +0 -369
  60. package/dist/PopupMenu-RPz8MN6s.mjs +0 -1026
  61. package/dist/SvgImage-CwRq9-ec.mjs +0 -56
  62. package/dist/SvgImage-_QN8ngad.js +0 -1
  63. package/dist/components-DScrkzXw.js +0 -1
  64. package/dist/loadSvgMaskUrl-B6kHUyof.js +0 -1
  65. package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +0 -39
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),Wt=require("./scalingValue-CSHYgTZl.js"),on=require("./useScopedStyles-Bf6yohVQ.js"),sn=require("./useLazyVideos-CdCbc2j0.js"),st=require("./EmbedMediaFrame-DsOTKE4i.js"),ln=require("./LazyVideo-imbU18js.js"),r=require("react"),an=require("react-dom"),cn=require("./HiveLightboxTitles-DEeyQGcf.js"),un=require("./getImageRect-BQhQXvT8.js"),fn=require("./textStylesToCss-CNN3zZTV.js");function dn(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function hn(t){return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),Wt=require("./scalingValue-CSHYgTZl.js"),on=require("./useScopedStyles-Bf6yohVQ.js"),sn=require("./useLazyVideos-CdCbc2j0.js"),st=require("./EmbedMediaFrame-DsOTKE4i.js"),ln=require("./LazyVideo-imbU18js.js"),r=require("react"),an=require("react-dom"),cn=require("./HiveLightboxTitles-DlyptAaK.js"),un=require("./getImageRect-BQhQXvT8.js"),fn=require("./textStylesToCss-CNN3zZTV.js");function dn(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function hn(t){return`
2
2
  .${t}-wrapper {
3
3
  display: grid;
4
4
  align-items: start;
@@ -6,7 +6,7 @@ import { i as Mt, E as Ke, g as pn } from "./EmbedMediaFrame-DwHeOAy5.mjs";
6
6
  import { L as mn } from "./LazyVideo-CdAWymKO.mjs";
7
7
  import { useMemo as de, useRef as y, useState as $, useCallback as v, useEffect as _, useLayoutEffect as fe } from "react";
8
8
  import { createPortal as wn } from "react-dom";
9
- import { H as vn } from "./HiveLightboxTitles-BCoL46-V.mjs";
9
+ import { H as vn } from "./HiveLightboxTitles-DhEeFKWs.mjs";
10
10
  import { g as yn } from "./getImageRect-CBMhFNHM.mjs";
11
11
  import { t as xn } from "./textStylesToCss-05Mn6I_2.mjs";
12
12
  function $n(t) {
@@ -1,7 +1,7 @@
1
1
  import { jsxs as x, jsx as r, Fragment as J } from "react/jsx-runtime";
2
2
  import { useMemo as w } from "react";
3
3
  import { s } from "./scalingValue-C9JH5L6O.mjs";
4
- import { S as Ft } from "./SvgImage-CwRq9-ec.mjs";
4
+ import { S as Ft } from "./SvgImage-B5mR9y6q.mjs";
5
5
  import { j as Z, r as q, D as Q, b as _, a as pt, g as wt, c as F, T as K, d as jt, e as b, f as R, h as At } from "./utils-FxC9rcxw.mjs";
6
6
  function Qt({
7
7
  prefix: i,
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),T=require("react"),c=require("./scalingValue-CSHYgTZl.js"),Ht=require("./SvgImage-_QN8ngad.js"),i=require("./utils-033j3qNL.js");function Rt({prefix:a,entry:w,settings:R,isEditor:r,isEditMode:m,isPreviewMode:st,onClose:J}){const{title1Width:E,title2Width:F,title3Width:O,title1MarginLeft:y=0,title2MarginLeft:k=0,title3MarginLeft:U=0,titleRowMarginBottom:_=0,titleHeaderLayout:rt="desktop",contentMarginTop:Z=0,iconMarginRight:ct=0,closeIcon:q=null,closeIconMaxWidth:G=0,closeIconColor:z="#000000",closeIconHoverColor:Q="#cccccc"}=R,dt=c.scalingValue(Z,r),ht=c.scalingValue(Math.max(Z,i.TITLE_PADDING_HANDLE_WIDTH),r),X=c.scalingValue(ct,r),ft=c.scalingValue(_,r),g=rt==="mobile",S=i.journalTextFieldsToCss("title1",i.resolveJournalTextFields(R,"title1"),r),M=i.journalTextFieldsToCss("title2",i.resolveJournalTextFields(R,"title2"),r),N=i.journalTextFieldsToCss("title3",i.resolveJournalTextFields(R,"title3"),r),u=T.useMemo(()=>({title1Width:E??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title1Width,title2Width:F??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title2Width,title3Width:O??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title3Width}),[E,F,O]),W=T.useMemo(()=>({title2MarginLeft:k,title3MarginLeft:U}),[k,U]),d=T.useMemo(()=>i.buildJournalTitleSlots(a,w,S,M,N),[a,w,S,M,N]),b=T.useMemo(()=>d.map(t=>u[t.widthKey]),[d,u]),p=T.useMemo(()=>i.resolveJournalTitleWidths(d.length,b),[d.length,b]),gt=T.useMemo(()=>i.getEffectiveJournalTitleWidths(d.length,b),[d.length,b]),K=T.useMemo(()=>d.filter(t=>t.prefix==="title1"),[d]),L=T.useMemo(()=>d.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[d]),B=T.useMemo(()=>i.getRowScopedJournalTitleWidths(K,u),[K,u]),j=T.useMemo(()=>i.getRowScopedJournalTitleWidths(L,u),[L,u]),D=!!(w.title1||w.title2||w.title3),$=q!==null;if(!(D||$))return null;const Y=(y??0)>0||m,A=(t,n)=>{const s=d.findIndex(l=>l.prefix===t.prefix);if(!g||n==="single-row")return{effectiveWidth:gt[s]??0,resolvedWidth:p[s]??0,maxWidth:i.getJournalTitleMaxWidth(s,p)};if(n==="two-row-top"){const l=K.findIndex(f=>f.prefix===t.prefix);return{effectiveWidth:B.effective[l]??0,resolvedWidth:B.resolved[l]??0,maxWidth:i.getJournalTitleMaxWidth(l,B.resolved)}}const o=L.findIndex(l=>l.prefix===t.prefix);return{effectiveWidth:j.effective[o]??0,resolvedWidth:j.resolved[o]??0,maxWidth:i.getJournalTitleMaxWidth(o,j.resolved)}},C=(t,n,s)=>{if(!g||s==="single-row"){const h=t.findIndex(I=>I.prefix===n.prefix),v=t.map(I=>u[I.widthKey]),H=i.resolveJournalTitleWidths(t.length,v);return{effectiveWidth:i.getEffectiveJournalTitleWidths(t.length,v)[h]??0,resolvedWidth:H[h]??0,maxWidth:i.getJournalTitleMaxWidth(h,H)}}if(s==="two-row-top"){const h=t.filter(I=>I.prefix==="title1"),v=h.findIndex(I=>I.prefix===n.prefix),{resolved:H,effective:at}=i.getRowScopedJournalTitleWidths(h,u);return{effectiveWidth:at[v]??0,resolvedWidth:H[v]??0,maxWidth:i.getJournalTitleMaxWidth(v,H)}}const o=t.filter(h=>h.prefix==="title2"||h.prefix==="title3"),l=o.findIndex(h=>h.prefix===n.prefix),{resolved:f,effective:x}=i.getRowScopedJournalTitleWidths(o,u);return{effectiveWidth:x[l]??0,resolvedWidth:f[l]??0,maxWidth:i.getJournalTitleMaxWidth(l,f)}},ut=t=>i.getJournalTitleBoundaryOffset(d,p,W,t)+(g?0:y??0),xt=()=>g?0:y??0,P=t=>L.slice(0,t).reduce((n,s,o)=>n+(s.marginLeftKey?W[s.marginLeftKey]??0:0)+(j.resolved[o]??0),0),mt=t=>{const n=L[t];return P(t)+(n.marginLeftKey?W[n.marginLeftKey]??0:0)+(j.resolved[t]??0)},V=(t,n,s)=>{const o=t.marginLeftKey?W[t.marginLeftKey]??0:0,{effectiveWidth:l,resolvedWidth:f,maxWidth:x}=s??A(t,n),h=Math.max(o,i.TITLE_PADDING_HANDLE_WIDTH),v=m&&n==="two-row-top";return e.jsxs("div",{className:`${a}-title-cell`,"data-title":t.prefix,style:{width:c.scalingValue(l,r),...o>0?{marginLeft:c.scalingValue(o,r)}:{}},children:[e.jsx("p",{className:t.className,style:t.style,children:t.text}),v&&t.marginLeftKey?e.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f),style:{position:"absolute",top:0,left:c.scalingValue(-o,r),width:c.scalingValue(h,r),height:"100%",pointerEvents:"auto"}}):null,v?e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,right:c.scalingValue(-i.TITLE_RESIZE_HANDLE_WIDTH/2,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}}):null]},t.className)},tt=(t="two-row")=>{const n=d.findIndex(l=>l.prefix==="title1"),s=n>=0?p[n]:u.title1Width,o=t==="two-row"&&m;return e.jsx("div",{...o?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s)}:{},style:{width:c.scalingValue(y??0,r),flexShrink:0,alignSelf:"stretch",...o?{pointerEvents:"auto"}:{}}})},et=()=>e.jsx("span",{className:`${a}-titles-baseline-strut`,style:S,"aria-hidden":"true",children:" "}),Tt=t=>{const n=i.buildJournalTitleSlots(a,t,S,M,N);return e.jsx(e.Fragment,{children:n.map(s=>V(s,"single-row",C(n,s,"single-row")))})},wt=t=>{const n=i.buildJournalTitleSlots(a,t,S,M,N),s=n.find(o=>o.prefix==="title1");return s?V(s,"two-row-top",C(n,s,"two-row-top")):null},vt=(t,n=!1)=>{const s=i.buildJournalTitleSlots(a,t,S,M,N),o=s.filter(x=>x.prefix==="title2"||x.prefix==="title3"),l=m&&n;return o.length>0||l||(_??0)>0?e.jsxs("div",{className:`${a}-titles-row-bottom-wrap`,children:[o.length>0?e.jsxs("div",{className:`${a}-titles-row-bottom`,children:[e.jsx("div",{className:`${a}-titles-stack`,children:o.map(x=>V(x,"two-row-bottom",C(s,x,"two-row-bottom")))}),n&&m?e.jsxs(e.Fragment,{children:[St(),Mt()]}):null]}):null,(_??0)>0||l?e.jsx("div",{"data-controls":l?"titleRowMarginBottom":void 0,"data-controls-axis":l?"y":void 0,"data-controls-reverse":l?"":void 0,className:l?`${a}-control`:void 0,style:{height:ft,width:"100%",flexShrink:0,pointerEvents:l?"auto":"none"}}):null]}):null},pt=()=>e.jsxs("div",{className:`${a}-close-icon`,style:{width:c.scalingValue(G??0,r),height:c.scalingValue(G??0,r),marginRight:X,"--close-icon-hover-color":Q},children:[e.jsx("button",{type:"button",className:`${a}-close-icon-inner`,onClick:t=>{t.stopPropagation(),J==null||J()},"aria-label":"Close",children:e.jsx(Ht.SvgImage,{url:q??"",fill:z,hoverFill:r&&!st?z:Q,className:`${a}-close-icon-img`})}),m&&e.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${a}-control`,style:{position:"absolute",top:0,left:"100%",width:X,height:"100%",pointerEvents:"auto"}})]}),it=()=>$?e.jsx("div",{className:`${a}-titles-row-header-controls`,children:pt()}):null,nt=t=>e.jsx("div",{className:`${a}-titles-row-titles`,children:e.jsx("div",{className:`${a}-titles-stack`,children:t})}),Wt=t=>e.jsxs("div",{className:`${a}-titles-row-top`,children:[$||D?et():null,Y?tt("two-row"):null,nt(t),it()]}),Lt=(t,n=!1)=>e.jsxs(e.Fragment,{children:[Wt(wt(t)),vt(t,n)]}),It=()=>{const t=g?-1:d.findIndex(o=>o.prefix==="title1"),n=!g&&(m||(y??0)>0)?(()=>{const o=y??0,l=t>=0?p[t]:u.title1Width,f=Math.max(o,i.TITLE_PADDING_HANDLE_WIDTH);return e.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(l),style:{position:"absolute",top:0,left:0,width:c.scalingValue(f,r),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,s=d.flatMap((o,l)=>{if(!o.marginLeftKey)return[];const f=W[o.marginLeftKey]??0,x=i.getJournalTitleOffsetBeforeSlot(d,p,W,l)+xt(),h=Math.max(f,i.TITLE_PADDING_HANDLE_WIDTH);return e.jsx("div",{"data-controls":o.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p[l]),style:{position:"absolute",top:0,left:c.scalingValue(x,r),width:c.scalingValue(h,r),height:"100%",pointerEvents:"auto"}},o.marginLeftKey)});return n?[n,...s]:s},yt=()=>d.map((t,n)=>{const s=i.getJournalTitleMaxWidth(n,p),l=ut(n)-i.TITLE_RESIZE_HANDLE_WIDTH/2;return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(s),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,left:c.scalingValue(l,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),St=()=>L.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const s=W[t.marginLeftKey]??0,o=P(n),l=Math.max(s,i.TITLE_PADDING_HANDLE_WIDTH),{resolvedWidth:f}=A(t,"two-row-bottom");return e.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f),style:{position:"absolute",top:0,left:c.scalingValue(o,r),width:c.scalingValue(l,r),height:"100%",pointerEvents:"auto"}},t.marginLeftKey)}),Mt=()=>L.map((t,n)=>{const{maxWidth:s}=A(t,"two-row-bottom"),l=mt(n)-i.TITLE_RESIZE_HANDLE_WIDTH/2;return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(s),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,left:c.scalingValue(l,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),ot=()=>!m||g?null:e.jsxs(e.Fragment,{children:[It(),yt()]}),lt=!!(w.title2||w.title3||(_??0)>0||m),Nt=()=>e.jsxs("div",{className:`${a}-titles-row ${a}-titles-row-header`,style:{width:"100%",position:"relative"},children:[$||D?et():null,Y?tt("single-row"):null,D?nt(Tt(w)):e.jsx("div",{className:`${a}-titles-row-titles`,"aria-hidden":"true"}),it(),ot()]}),jt=()=>e.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...lt?{flex:1,height:"100%"}:{}},children:[e.jsx("div",{className:`${a}-titles-row-two-row`,style:lt?void 0:{flex:"0 0 auto",height:"auto"},children:Lt(w,!0)}),ot()]});return e.jsxs("div",{className:`${a}-lightbox-overlay-content`,children:[e.jsx("div",{style:{position:"relative",width:"100%",height:dt,flexShrink:0},children:m&&e.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${a}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:ht,pointerEvents:"auto"}})}),e.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...g?{flex:1,minHeight:0}:{}},children:e.jsx("div",{className:`${a}-lightbox-content-area${g?` ${a}-lightbox-content-area-stacked`:""}`,children:e.jsx("div",{className:`${a}-text-bar-cell${g?` ${a}-text-bar-cell-stacked`:""}`,style:g?void 0:{flex:1,minWidth:0,width:"100%"},children:g?jt():Nt()})})})]})}exports.HiveLightboxTitles=Rt;
1
+ "use strict";const e=require("react/jsx-runtime"),T=require("react"),c=require("./scalingValue-CSHYgTZl.js"),Ht=require("./SvgImage-DFlmxAoL.js"),i=require("./utils-033j3qNL.js");function Rt({prefix:a,entry:w,settings:R,isEditor:r,isEditMode:m,isPreviewMode:st,onClose:J}){const{title1Width:E,title2Width:F,title3Width:O,title1MarginLeft:y=0,title2MarginLeft:k=0,title3MarginLeft:U=0,titleRowMarginBottom:_=0,titleHeaderLayout:rt="desktop",contentMarginTop:Z=0,iconMarginRight:ct=0,closeIcon:q=null,closeIconMaxWidth:G=0,closeIconColor:z="#000000",closeIconHoverColor:Q="#cccccc"}=R,dt=c.scalingValue(Z,r),ht=c.scalingValue(Math.max(Z,i.TITLE_PADDING_HANDLE_WIDTH),r),X=c.scalingValue(ct,r),ft=c.scalingValue(_,r),g=rt==="mobile",S=i.journalTextFieldsToCss("title1",i.resolveJournalTextFields(R,"title1"),r),M=i.journalTextFieldsToCss("title2",i.resolveJournalTextFields(R,"title2"),r),N=i.journalTextFieldsToCss("title3",i.resolveJournalTextFields(R,"title3"),r),u=T.useMemo(()=>({title1Width:E??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title1Width,title2Width:F??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title2Width,title3Width:O??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title3Width}),[E,F,O]),W=T.useMemo(()=>({title2MarginLeft:k,title3MarginLeft:U}),[k,U]),d=T.useMemo(()=>i.buildJournalTitleSlots(a,w,S,M,N),[a,w,S,M,N]),b=T.useMemo(()=>d.map(t=>u[t.widthKey]),[d,u]),p=T.useMemo(()=>i.resolveJournalTitleWidths(d.length,b),[d.length,b]),gt=T.useMemo(()=>i.getEffectiveJournalTitleWidths(d.length,b),[d.length,b]),K=T.useMemo(()=>d.filter(t=>t.prefix==="title1"),[d]),L=T.useMemo(()=>d.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[d]),B=T.useMemo(()=>i.getRowScopedJournalTitleWidths(K,u),[K,u]),j=T.useMemo(()=>i.getRowScopedJournalTitleWidths(L,u),[L,u]),D=!!(w.title1||w.title2||w.title3),$=q!==null;if(!(D||$))return null;const Y=(y??0)>0||m,A=(t,n)=>{const s=d.findIndex(l=>l.prefix===t.prefix);if(!g||n==="single-row")return{effectiveWidth:gt[s]??0,resolvedWidth:p[s]??0,maxWidth:i.getJournalTitleMaxWidth(s,p)};if(n==="two-row-top"){const l=K.findIndex(f=>f.prefix===t.prefix);return{effectiveWidth:B.effective[l]??0,resolvedWidth:B.resolved[l]??0,maxWidth:i.getJournalTitleMaxWidth(l,B.resolved)}}const o=L.findIndex(l=>l.prefix===t.prefix);return{effectiveWidth:j.effective[o]??0,resolvedWidth:j.resolved[o]??0,maxWidth:i.getJournalTitleMaxWidth(o,j.resolved)}},C=(t,n,s)=>{if(!g||s==="single-row"){const h=t.findIndex(I=>I.prefix===n.prefix),v=t.map(I=>u[I.widthKey]),H=i.resolveJournalTitleWidths(t.length,v);return{effectiveWidth:i.getEffectiveJournalTitleWidths(t.length,v)[h]??0,resolvedWidth:H[h]??0,maxWidth:i.getJournalTitleMaxWidth(h,H)}}if(s==="two-row-top"){const h=t.filter(I=>I.prefix==="title1"),v=h.findIndex(I=>I.prefix===n.prefix),{resolved:H,effective:at}=i.getRowScopedJournalTitleWidths(h,u);return{effectiveWidth:at[v]??0,resolvedWidth:H[v]??0,maxWidth:i.getJournalTitleMaxWidth(v,H)}}const o=t.filter(h=>h.prefix==="title2"||h.prefix==="title3"),l=o.findIndex(h=>h.prefix===n.prefix),{resolved:f,effective:x}=i.getRowScopedJournalTitleWidths(o,u);return{effectiveWidth:x[l]??0,resolvedWidth:f[l]??0,maxWidth:i.getJournalTitleMaxWidth(l,f)}},ut=t=>i.getJournalTitleBoundaryOffset(d,p,W,t)+(g?0:y??0),xt=()=>g?0:y??0,P=t=>L.slice(0,t).reduce((n,s,o)=>n+(s.marginLeftKey?W[s.marginLeftKey]??0:0)+(j.resolved[o]??0),0),mt=t=>{const n=L[t];return P(t)+(n.marginLeftKey?W[n.marginLeftKey]??0:0)+(j.resolved[t]??0)},V=(t,n,s)=>{const o=t.marginLeftKey?W[t.marginLeftKey]??0:0,{effectiveWidth:l,resolvedWidth:f,maxWidth:x}=s??A(t,n),h=Math.max(o,i.TITLE_PADDING_HANDLE_WIDTH),v=m&&n==="two-row-top";return e.jsxs("div",{className:`${a}-title-cell`,"data-title":t.prefix,style:{width:c.scalingValue(l,r),...o>0?{marginLeft:c.scalingValue(o,r)}:{}},children:[e.jsx("p",{className:t.className,style:t.style,children:t.text}),v&&t.marginLeftKey?e.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f),style:{position:"absolute",top:0,left:c.scalingValue(-o,r),width:c.scalingValue(h,r),height:"100%",pointerEvents:"auto"}}):null,v?e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,right:c.scalingValue(-i.TITLE_RESIZE_HANDLE_WIDTH/2,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}}):null]},t.className)},tt=(t="two-row")=>{const n=d.findIndex(l=>l.prefix==="title1"),s=n>=0?p[n]:u.title1Width,o=t==="two-row"&&m;return e.jsx("div",{...o?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s)}:{},style:{width:c.scalingValue(y??0,r),flexShrink:0,alignSelf:"stretch",...o?{pointerEvents:"auto"}:{}}})},et=()=>e.jsx("span",{className:`${a}-titles-baseline-strut`,style:S,"aria-hidden":"true",children:" "}),Tt=t=>{const n=i.buildJournalTitleSlots(a,t,S,M,N);return e.jsx(e.Fragment,{children:n.map(s=>V(s,"single-row",C(n,s,"single-row")))})},wt=t=>{const n=i.buildJournalTitleSlots(a,t,S,M,N),s=n.find(o=>o.prefix==="title1");return s?V(s,"two-row-top",C(n,s,"two-row-top")):null},vt=(t,n=!1)=>{const s=i.buildJournalTitleSlots(a,t,S,M,N),o=s.filter(x=>x.prefix==="title2"||x.prefix==="title3"),l=m&&n;return o.length>0||l||(_??0)>0?e.jsxs("div",{className:`${a}-titles-row-bottom-wrap`,children:[o.length>0?e.jsxs("div",{className:`${a}-titles-row-bottom`,children:[e.jsx("div",{className:`${a}-titles-stack`,children:o.map(x=>V(x,"two-row-bottom",C(s,x,"two-row-bottom")))}),n&&m?e.jsxs(e.Fragment,{children:[St(),Mt()]}):null]}):null,(_??0)>0||l?e.jsx("div",{"data-controls":l?"titleRowMarginBottom":void 0,"data-controls-axis":l?"y":void 0,"data-controls-reverse":l?"":void 0,className:l?`${a}-control`:void 0,style:{height:ft,width:"100%",flexShrink:0,pointerEvents:l?"auto":"none"}}):null]}):null},pt=()=>e.jsxs("div",{className:`${a}-close-icon`,style:{width:c.scalingValue(G??0,r),height:c.scalingValue(G??0,r),marginRight:X,"--close-icon-hover-color":Q},children:[e.jsx("button",{type:"button",className:`${a}-close-icon-inner`,onClick:t=>{t.stopPropagation(),J==null||J()},"aria-label":"Close",children:e.jsx(Ht.SvgImage,{url:q??"",fill:z,hoverFill:r&&!st?z:Q,className:`${a}-close-icon-img`})}),m&&e.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${a}-control`,style:{position:"absolute",top:0,left:"100%",width:X,height:"100%",pointerEvents:"auto"}})]}),it=()=>$?e.jsx("div",{className:`${a}-titles-row-header-controls`,children:pt()}):null,nt=t=>e.jsx("div",{className:`${a}-titles-row-titles`,children:e.jsx("div",{className:`${a}-titles-stack`,children:t})}),Wt=t=>e.jsxs("div",{className:`${a}-titles-row-top`,children:[$||D?et():null,Y?tt("two-row"):null,nt(t),it()]}),Lt=(t,n=!1)=>e.jsxs(e.Fragment,{children:[Wt(wt(t)),vt(t,n)]}),It=()=>{const t=g?-1:d.findIndex(o=>o.prefix==="title1"),n=!g&&(m||(y??0)>0)?(()=>{const o=y??0,l=t>=0?p[t]:u.title1Width,f=Math.max(o,i.TITLE_PADDING_HANDLE_WIDTH);return e.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(l),style:{position:"absolute",top:0,left:0,width:c.scalingValue(f,r),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,s=d.flatMap((o,l)=>{if(!o.marginLeftKey)return[];const f=W[o.marginLeftKey]??0,x=i.getJournalTitleOffsetBeforeSlot(d,p,W,l)+xt(),h=Math.max(f,i.TITLE_PADDING_HANDLE_WIDTH);return e.jsx("div",{"data-controls":o.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p[l]),style:{position:"absolute",top:0,left:c.scalingValue(x,r),width:c.scalingValue(h,r),height:"100%",pointerEvents:"auto"}},o.marginLeftKey)});return n?[n,...s]:s},yt=()=>d.map((t,n)=>{const s=i.getJournalTitleMaxWidth(n,p),l=ut(n)-i.TITLE_RESIZE_HANDLE_WIDTH/2;return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(s),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,left:c.scalingValue(l,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),St=()=>L.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const s=W[t.marginLeftKey]??0,o=P(n),l=Math.max(s,i.TITLE_PADDING_HANDLE_WIDTH),{resolvedWidth:f}=A(t,"two-row-bottom");return e.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f),style:{position:"absolute",top:0,left:c.scalingValue(o,r),width:c.scalingValue(l,r),height:"100%",pointerEvents:"auto"}},t.marginLeftKey)}),Mt=()=>L.map((t,n)=>{const{maxWidth:s}=A(t,"two-row-bottom"),l=mt(n)-i.TITLE_RESIZE_HANDLE_WIDTH/2;return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(s),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,left:c.scalingValue(l,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),ot=()=>!m||g?null:e.jsxs(e.Fragment,{children:[It(),yt()]}),lt=!!(w.title2||w.title3||(_??0)>0||m),Nt=()=>e.jsxs("div",{className:`${a}-titles-row ${a}-titles-row-header`,style:{width:"100%",position:"relative"},children:[$||D?et():null,Y?tt("single-row"):null,D?nt(Tt(w)):e.jsx("div",{className:`${a}-titles-row-titles`,"aria-hidden":"true"}),it(),ot()]}),jt=()=>e.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...lt?{flex:1,height:"100%"}:{}},children:[e.jsx("div",{className:`${a}-titles-row-two-row`,style:lt?void 0:{flex:"0 0 auto",height:"auto"},children:Lt(w,!0)}),ot()]});return e.jsxs("div",{className:`${a}-lightbox-overlay-content`,children:[e.jsx("div",{style:{position:"relative",width:"100%",height:dt,flexShrink:0},children:m&&e.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${a}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:ht,pointerEvents:"auto"}})}),e.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...g?{flex:1,minHeight:0}:{}},children:e.jsx("div",{className:`${a}-lightbox-content-area${g?` ${a}-lightbox-content-area-stacked`:""}`,children:e.jsx("div",{className:`${a}-text-bar-cell${g?` ${a}-text-bar-cell-stacked`:""}`,style:g?void 0:{flex:1,minWidth:0,width:"100%"},children:g?jt():Nt()})})})]})}exports.HiveLightboxTitles=Rt;
@@ -2,7 +2,7 @@ import { jsxs as U, Fragment as ue, jsx as g } from "react/jsx-runtime";
2
2
  import { useState as P, useEffect as F, useRef as R, useCallback as Fe } from "react";
3
3
  import { createPortal as Oe } from "react-dom";
4
4
  import { s as d } from "./scalingValue-C9JH5L6O.mjs";
5
- import { S as se } from "./SvgImage-CwRq9-ec.mjs";
5
+ import { S as se } from "./SvgImage-B5mR9y6q.mjs";
6
6
  import N from "classnames";
7
7
  import { S as We, a as Ve } from "./react-splide.esm-DQqds4PL.mjs";
8
8
  import { R as De } from "./RichTextRenderer-D52Xto59.mjs";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),g=require("react"),Ae=require("react-dom"),h=require("./scalingValue-CSHYgTZl.js"),ae=require("./SvgImage-_QN8ngad.js"),$=require("classnames"),fe=require("./react-splide.esm-CabaEmHi.js"),Te=require("./RichTextRenderer-DEFXh5o6.js"),Z=require("./getImageRect-BQhQXvT8.js"),pe=require("./getColorAlpha-CoSseoCn.js"),je=require("./textStylesToCss-CNN3zZTV.js"),$e="LightBox-module__hidden___9s-9x",ze="LightBox-module__heroImage___sTxNF",Fe="LightBox-module__background___rm9ml",Ne="LightBox-module__editor___4ACaY",Oe="LightBox-module__contentStyle___Bgnsq",We="LightBox-module__imageStyle___tLIlB",Ee="LightBox-module__imgWrapper___LuFUp",De="LightBox-module__contain___8-yaS",Me="LightBox-module__cover___hNvOG",Pe="LightBox-module__caption___b6L2I",Xe="LightBox-module__captionTextInner___rCGNH",He="LightBox-module__lightboxSplide___XFuWC",Ye="LightBox-module__arrow___iz38X",Ue="LightBox-module__arrowVertical___Zfz81",qe="LightBox-module__nextArrow___zkAQN",Ge="LightBox-module__arrowInner___p48sW",Ke="LightBox-module__arrowIcon___3VaFf",Ze="LightBox-module__arrowImg___pNV88",Je="LightBox-module__mirror___pjeXc",Qe="LightBox-module__thumbsWrapper___GB-nU",et="LightBox-module__thumbsContainerVertical___wttk5",tt="LightBox-module__thumbsContainer___osSma",nt="LightBox-module__thumbsAlignStart___MO6tY",rt="LightBox-module__thumbsAlignCenter___Q4sUx",ot="LightBox-module__thumbsAlignEnd___p4y9R",it="LightBox-module__thumbItem___HvnF3",st="LightBox-module__closeButton___g2khP",at="LightBox-module__fadeIn___0m5GW",lt="LightBox-module__slideInLeft___gPYwC",ct="LightBox-module__slideInRight___S-pPp",ut="LightBox-module__slideInTop___DFdAj",dt="LightBox-module__slideInBottom___m27kZ",ht="LightBox-module__fadeOut___55qBR",mt="LightBox-module__slideOutLeft___NvU7P",gt="LightBox-module__slideOutRight___SK7eC",ft="LightBox-module__slideOutTop___Vgg0z",pt="LightBox-module__slideOutBottom___nJ0Ef",_t="LightBox-module__scaleSlide___vZriG",e={hidden:$e,heroImage:ze,background:Fe,editor:Ne,contentStyle:Oe,imageStyle:We,imgWrapper:Ee,contain:De,cover:Me,caption:Pe,captionTextInner:Xe,lightboxSplide:He,arrow:Ye,arrowVertical:Ue,nextArrow:qe,arrowInner:Ge,arrowIcon:Ke,arrowImg:Ze,mirror:Je,thumbsWrapper:Qe,thumbsContainerVertical:et,thumbsContainer:tt,thumbsAlignStart:nt,thumbsAlignCenter:rt,thumbsAlignEnd:ot,thumbItem:it,closeButton:st,fadeIn:at,slideInLeft:lt,slideInRight:ct,slideInTop:ut,slideInBottom:dt,fadeOut:ht,slideOutLeft:mt,slideOutRight:gt,slideOutTop:ft,slideOutBottom:pt,scaleSlide:_t},J=(l,L,f)=>{const p={},[V,R]=l.split("-");return V==="top"?(p.top="0",p.bottom="auto"):V==="middle"?(p.top="50%",p.bottom="auto"):V==="bottom"&&(p.top="auto",p.bottom="0"),R==="left"?(p.left="0",p.right="auto"):R==="center"?(p.left="50%",p.right="auto"):R==="right"&&(p.left="auto",p.right="0"),V==="middle"&&R==="center"?p.transform=`translate(calc(-50% + ${h.scalingValue(L.x,f)}), calc(-50% + ${h.scalingValue(L.y,f)}))`:V==="middle"?p.transform=`translate(${h.scalingValue(L.x,f)}, calc(-50% + ${h.scalingValue(L.y,f)}))`:R==="center"?p.transform=`translate(calc(-50% + ${h.scalingValue(L.x,f)}), ${h.scalingValue(L.y,f)})`:p.transform=`translate(${h.scalingValue(L.x,f)}, ${h.scalingValue(L.y,f)})`,p};function vt(l,L){const f=(()=>{if(l==="fade in")return e.fadeIn;if(l==="slide in"||l==="mix")switch(L){case"left":return e.slideInLeft;case"right":return e.slideInRight;case"top":return e.slideInTop;case"bottom":return e.slideInBottom;default:return e.slideInRight}return e.fadeIn})(),p=(()=>{if(l==="fade in"||l==="mix")return e.fadeIn;if(l==="slide in")switch(L){case"left":return e.slideInLeft;case"right":return e.slideInRight;case"top":return e.slideInTop;case"bottom":return e.slideInBottom;default:return e.slideInRight}return e.fadeIn})(),V=(()=>{if(l==="fade in"||l==="mix")return e.fadeOut;if(l==="slide in")switch(L){case"left":return e.slideOutLeft;case"right":return e.slideOutRight;case"top":return e.slideOutTop;case"bottom":return e.slideOutBottom;default:return e.slideOutRight}return e.fadeOut})(),R=(()=>{if(l==="fade in")return e.fadeOut;if(l==="slide in"||l==="mix")switch(L){case"left":return e.slideOutLeft;case"right":return e.slideOutRight;case"top":return e.slideOutTop;case"bottom":return e.slideOutBottom;default:return e.slideOutRight}return e.fadeOut})();return{appearClass:f,backdropAppearClass:p,backdropDisappearClass:V,disappearClass:R}}const xt=({settings:l,content:L,styles:f,portalId:p,activeEvent:V,isEditor:R,isPreviewMode:r})=>{const[X,O]=g.useState(!1),{assetId:H}=l.thumbnailBlock.cover;return g.useEffect(()=>{V==="close"&&O(!1),V==="open"&&O(!0)},[V]),u.jsxs(u.Fragment,{children:[u.jsx("img",{src:H,alt:"Cover",className:e.heroImage,onClick:()=>O(!0)}),u.jsx(bt,{isOpen:X,onClose:()=>O(!1),content:L,settings:l,lightboxStyles:f,portalId:p,isEditor:R})]})},bt=({isOpen:l,onClose:L,content:f,lightboxStyles:p,settings:V,portalId:R,isEditor:r,metadata:X})=>{var ge;const{widthSettings:O,fontSettings:H,letterSpacing:ve,textAlign:xe,wordSpacing:be,fontSizeLineHeight:le,textAppearance:Q,color:we}=p.imageCaption??{},[z,Y]=g.useState(0),[ce,ee]=g.useState(0),[te,ne]=g.useState(!1),[Le,U]=g.useState(!1),[ue,de]=g.useState({}),I=g.useRef(null),re=g.useRef(null),A=g.useRef(null),W=g.useRef(!1),C=g.useRef(null),E=g.useRef(null),D=g.useRef(null),S=g.useRef(null),F=g.useRef(!1),he=g.useRef(null),[ye,oe]=g.useState(!1),{appear:q,triggers:T,slider:s,thumbnail:_,controls:v,area:B,caption:M,layout:P}=V.lightboxBlock,{appearClass:Ie,backdropAppearClass:Ce,backdropDisappearClass:Se,disappearClass:Be}=vt(q.type,q.direction),ie=(X==null?void 0:X.itemId)??null;g.useEffect(()=>{const t=()=>{setTimeout(()=>{var o,c;(c=(o=I.current)==null?void 0:o.splide)==null||c.refresh()},16)},n=()=>{ee(o=>o+1)};return window.addEventListener("ArticleEditor.Layout:change",t),window.addEventListener("ArticleEditor.ComponentContent:change",n),()=>{window.removeEventListener("ArticleEditor.Layout:change",t),window.removeEventListener("ArticleEditor.ComponentContent:change",n)}},[]),g.useEffect(()=>{if(!l||!_.isActive){oe(!1);return}const t=he.current;if(!t)return;const n=()=>{s.direction==="horiz"?oe(t.scrollWidth>t.clientWidth):oe(t.scrollHeight>t.clientHeight)};n();const o=new ResizeObserver(n);return o.observe(t),()=>o.disconnect()},[l,_.isActive,f.length,ue,s.direction]);const N=g.useCallback(()=>{const t=window.matchMedia("(max-width: 768px)").matches,n=pe.getColorAlpha(B.color);t&&!r&&n>.9&&(document.body.style.backgroundColor=""),ne(!0),W.current=!0;const o=c=>{c.target===C.current&&c.animationName&&(C.current&&E.current&&C.current.removeEventListener("animationend",E.current),E.current=null,W.current&&(W.current=!1,L()),ne(!1))};C.current&&(E.current=o,C.current.addEventListener("animationend",o))},[L,B.color,r]),Ve=(t,n,o)=>{var c,m;if(t){if(T.type==="click"&&T.switch==="image")T.repeat==="close"&&z===f.length-1?N():(c=I.current)==null||c.go("+1");else if(T.type==="click"&&T.switch==="50/50"){const d=t.getBoundingClientRect(),i=n-d.left,x=o-d.top,k=d.width,b=d.height;let y;s.direction==="horiz"?y=i<k/2?"-1":"+1":y=x<b/2?"-1":"+1",(m=I.current)==null||m.go(y)}}},me=t=>{if(F.current){F.current=!1;return}const n=f[z],o=(n==null?void 0:n.image.objectFit)==="cover";let c,m;if("changedTouches"in t&&t.changedTouches.length>0)c=t.changedTouches[0].clientX,m=t.changedTouches[0].clientY;else if("clientX"in t)c=t.clientX,m=t.clientY;else return;let d;if(o&&A.current){const i=Z.getPaddedContainerBounds(A.current);d=c>=i.left&&c<=i.right&&m>=i.top&&m<=i.bottom}else{const i=A.current?Z.getDisplayedImageRect(A.current):null;if(!i){t.target===t.currentTarget&&N();return}d=c>=i.x&&c<=i.x+i.width&&m>=i.y&&m<=i.y+i.height}d?Ve(A.current,c,m):N()},Re=t=>{const n=t.target;(n.classList.contains(e.thumbsWrapper)||n.classList.contains(e.thumbsContainer))&&me(t)};g.useEffect(()=>{if(!l)return;const t=n=>{var o,c;if(n.key==="Escape"){N();return}if(n.key==="ArrowRight"){Y(m=>(m+1)%Math.max(f.length,1)),(o=I.current)==null||o.go("+1");return}n.key==="ArrowLeft"&&(Y(m=>(m-1+Math.max(f.length,1))%Math.max(f.length,1)),(c=I.current)==null||c.go("-1"))};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[l,N,f.length]),g.useEffect(()=>{if(l){if(Y(0),ee(n=>n+1),W.current=!1,ne(!1),U(!1),de({}),!ie)return;const t=new CustomEvent("page-overlay",{detail:{itemId:ie}});window.dispatchEvent(t)}return()=>{C.current&&E.current&&(C.current.removeEventListener("animationend",E.current),E.current=null),U(!1)}},[l,ie]),g.useEffect(()=>{re.current!==null&&re.current!==s.type&&ee(t=>t+1),re.current=s.type},[s.type]),g.useEffect(()=>{if(!l)return;const t=document.body.style.overflow,n=window.matchMedia("(max-width: 768px)").matches,o=pe.getColorAlpha(B.color);document.body.style.overflow="hidden",U(!1);const c=d=>{d.target===C.current&&!W.current&&d.animationName&&(n&&!r&&o>.9&&(document.body.style.backgroundColor=B.color),U(!0),C.current&&D.current&&C.current.removeEventListener("animationend",D.current),D.current=null)};C.current&&(D.current=c,C.current.addEventListener("animationend",c));const m=d=>{const i=d.target;i&&(i.closest(`.${e.thumbsWrapper}`)||i.closest(`.${e.thumbsContainer}`))||s.type!=="slide"&&d.preventDefault()};return document.addEventListener("touchmove",m,{passive:!1}),()=>{document.body.style.overflow=t,document.removeEventListener("touchmove",m),C.current&&D.current&&(C.current.removeEventListener("animationend",D.current),D.current=null),U(!1)}},[l,r,B.color,s.type]),g.useEffect(()=>{if(!l)return;const t=n=>{var c,m;if(W.current){n.stopPropagation();return}if(F.current){F.current=!1;return}const o=n.target;if(!(o&&(o.closest(`.${e.thumbsContainer}`)||o.closest(`.${e.thumbItem}`)||o.closest(`.${e.arrow}`)||o.closest(`.${e.closeButton}`)||o.closest(`.${e.caption}`)))){if(s.type==="slide"&&T.type==="drag"&&((m=(c=I.current)==null?void 0:c.splide)!=null&&m.root)){const d=I.current.splide.root;if(o&&(d.contains(o)||d===o))return}if(n.touches.length===0&&n.changedTouches.length>0){const d=f[z],i=(d==null?void 0:d.image.objectFit)==="cover",x=n.changedTouches[0];let k;if(i&&A.current){const b=Z.getPaddedContainerBounds(A.current);k=x.clientX>=b.left&&x.clientX<=b.right&&x.clientY>=b.top&&x.clientY<=b.bottom}else{const b=A.current?Z.getDisplayedImageRect(A.current):null;if(!b)return;k=x.clientX>=b.x&&x.clientX<=b.x+b.width&&x.clientY>=b.y&&x.clientY<=b.y+b.height}if(!k){n.stopPropagation(),W.current=!0;const b=y=>{y.stopPropagation(),y.preventDefault(),document.removeEventListener("click",b,!0)};document.addEventListener("click",b,!0),N()}}}};return document.addEventListener("touchend",t,{passive:!0}),()=>{document.removeEventListener("touchend",t)}},[l,N,z,f]);const se=(s.type==="scale"||s.type==="fade")&&s.direction==="vert"&&T.type==="drag";g.useEffect(()=>{var y,G;if(!l||!se||!((G=(y=I.current)==null?void 0:y.splide)!=null&&G.root))return;const t=I.current.splide.root,n=30,o=(a,w)=>{if(S.current){const j=Math.abs(a-S.current.x),K=Math.abs(w-S.current.y);(j>0||K>0)&&(F.current=!0)}},c=a=>{S.current&&(a.preventDefault(),o(a.clientX,a.clientY))},m=a=>{S.current&&a.touches.length>0&&(a.preventDefault(),o(a.touches[0].clientX,a.touches[0].clientY))},d=(a,w)=>{if(!S.current||!I.current){S.current=null;return}const j=Math.abs(a-S.current.x),K=Math.abs(w-S.current.y);K>n&&K>j&&I.current.go(w<S.current.y?"+1":"-1"),S.current=null},i=a=>{S.current&&d(a.clientX,a.clientY),document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",i),document.removeEventListener("pointermove",c)},x=a=>{if(S.current){if(a.changedTouches.length>0){const w=a.changedTouches[0];d(w.clientX,w.clientY)}document.removeEventListener("touchend",x),document.removeEventListener("touchcancel",x),document.removeEventListener("touchmove",m)}},k=a=>{S.current={x:a.clientX,y:a.clientY},F.current=!1,document.addEventListener("pointermove",c,{passive:!1}),document.addEventListener("pointerup",i),document.addEventListener("pointercancel",i)},b=a=>{a.touches.length>0&&(S.current={x:a.touches[0].clientX,y:a.touches[0].clientY},F.current=!1,document.addEventListener("touchmove",m,{passive:!1}),document.addEventListener("touchend",x),document.addEventListener("touchcancel",x))};return t.addEventListener("pointerdown",k),t.addEventListener("touchstart",b),()=>{t.removeEventListener("pointerdown",k),t.removeEventListener("touchstart",b),document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",i),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",x),document.removeEventListener("touchcancel",x),S.current=null,F.current=!1}},[l,se,ce]);const ke={backgroundColor:B.color,backdropFilter:`blur(${B.blur}px)`,animationDuration:`${parseInt(q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(R)?null:Ae.createPortal(u.jsxs(u.Fragment,{children:[u.jsx("div",{ref:r?null:C,className:$(e.background,te?Se:Ce,{[e.editor]:r},{[e.hidden]:!l}),style:{...ke,...Le&&!r&&!te?{position:"absolute"}:{}}}),u.jsxs("div",{ref:r?C:null,className:$(e.contentStyle,te?Be:Ie,{[e.editor]:r},{[e.hidden]:!l}),style:{animationDuration:`${parseInt(q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[u.jsx(fe.Splide2,{onMove:t=>Y(t.index),ref:I,className:e.lightboxSplide,options:{arrows:!1,speed:s.duration?parseInt(s.duration):500,direction:s.direction==="horiz"||s.type==="fade"||s.type==="scale"?"ltr":"ttb",pagination:!1,drag:T.type==="drag"&&!se,perPage:1,width:"100%",height:"100%",type:s.type==="fade"||s.type==="scale"?"fade":"loop",padding:0,rewind:T.repeat!=="close",start:0},style:{"--splide-speed":s.duration},children:f.map((t,n)=>{const o=J(P.position,P.offset,r),c=`${h.scalingValue(P.padding.top,r)} ${h.scalingValue(P.padding.right,r)} ${h.scalingValue(P.padding.bottom,r)} ${h.scalingValue(P.padding.left,r)}`,m=s.type==="scale"?(()=>{const{transform:d,...i}=o;return{...i,position:"absolute",padding:c,boxSizing:"border-box","--position-transform":d||"none"}})():{...o,position:"absolute",padding:c,boxSizing:"border-box"};return u.jsx(fe.SplideSlide,{children:u.jsx("div",{className:e.imgWrapper,onClick:me,children:u.jsx("img",{ref:n===z?A:null,className:$(e.imageStyle,{[e.contain]:t.image.objectFit==="contain",[e.cover]:t.image.objectFit==="cover",[e.scaleSlide]:s.type==="scale"}),src:t.image.assetId,alt:t.image.name??"",style:{...m,pointerEvents:t.image.objectFit==="contain"?"none":"auto"}})})},n)})},ce),v.isActive&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:$(e.arrow,{[e.arrowVertical]:s.direction==="vert"}),style:{color:v.color,"--arrow-hover-color":v.hover},children:u.jsxs("button",{className:e.arrowInner,style:{transform:`translate(${h.scalingValue(v.offset.x,r)}, ${h.scalingValue(v.offset.y*(s.direction==="horiz"?1:-1),r)}) scale(${v.scale}) rotate(${s.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var t;return(t=I.current)==null?void 0:t.go("-1")},"aria-label":"Previous",children:[v.arrowsImgUrl&&u.jsx(ae.SvgImage,{url:v.arrowsImgUrl,fill:v.color,hoverFill:v.hover,className:$(e.arrowImg,e.mirror)}),!v.arrowsImgUrl&&u.jsx(_e,{color:v.color,className:$(e.arrowIcon,e.arrowImg,e.mirror)})]})}),u.jsx("div",{className:$(e.arrow,e.nextArrow,{[e.arrowVertical]:s.direction==="vert"}),style:{color:v.color,"--arrow-hover-color":v.hover},children:u.jsxs("button",{className:e.arrowInner,style:{transform:`translate(${h.scalingValue(v.offset.x*(s.direction==="horiz"?-1:1),r)}, ${h.scalingValue(v.offset.y,r)}) scale(${v.scale}) rotate(${s.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var t;return(t=I.current)==null?void 0:t.go("+1")},"aria-label":"Next",children:[v.arrowsImgUrl&&u.jsx(ae.SvgImage,{url:v.arrowsImgUrl,fill:v.color,hoverFill:v.hover,className:e.arrowImg}),!v.arrowsImgUrl&&u.jsx(_e,{color:v.color,className:$(e.arrowIcon,e.arrowImg)})]})})]}),B.closeIconUrl&&(()=>{const t=J(B.closeIconAlign,B.closeIconOffset,r),n=`scale(${B.closeIconScale})`,o=t.transform?`${t.transform} ${n}`:n;return u.jsx("button",{className:e.closeButton,style:{...t,transform:o},onClick:N,"aria-label":"Close lightbox",children:u.jsx(ae.SvgImage,{url:B.closeIconUrl,fill:B.closeIconColor??"#000000",hoverFill:B.closeIconHover??"#cccccc"})})})(),M&&M.isActive&&p.imageCaption&&((ge=f[z])==null?void 0:ge.imageCaption)&&u.jsx("div",{className:e.caption,style:{...J(M.alignment,M.offset,r),fontFamily:je.normalizeFontFamilyCssValue(H.fontFamily),fontWeight:H.fontWeight,fontStyle:H.fontStyle,width:O.sizing==="auto"?"max-content":h.scalingValue(O.width,r),letterSpacing:h.scalingValue(ve,r),wordSpacing:h.scalingValue(be,r),textAlign:xe,fontSize:h.scalingValue(le.fontSize,r),lineHeight:h.scalingValue(le.lineHeight,r),textTransform:Q.textTransform??"none",textDecoration:Q.textDecoration??"none",fontVariant:Q.fontVariant??"normal",color:we},onClick:t=>t.stopPropagation(),children:u.jsx("div",{"data-styles":"imageCaption",className:e.captionTextInner,style:{"--link-color":M.linkColor,"--link-hover-color":M.linkHoverColor},children:u.jsx(Te.RichTextRenderer,{content:f[z].imageCaption})})}),_.isActive&&(()=>{const[t,n]=_.position.split("-"),o=s.direction==="horiz"?`${t}-left`:_.position,c=J(o,_.offset,r),m=()=>{if(s.direction==="horiz"){if(n==="left")return"flex-start";if(n==="center")return"center";if(n==="right")return"flex-end"}else{if(t==="top")return"flex-start";if(t==="middle")return"center";if(t==="bottom")return"flex-end"}return"flex-start"};return u.jsx("div",{ref:he,className:e.thumbsWrapper,onClick:d=>Re(d),style:{position:r?"absolute":"fixed",...c,...s.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:u.jsx("div",{className:$(e.thumbsContainer,{[e.thumbsContainerVertical]:s.direction==="vert",[e.thumbsAlignStart]:_.align==="start",[e.thumbsAlignCenter]:_.align==="center",[e.thumbsAlignEnd]:_.align==="end"}),style:{gap:h.scalingValue(_.grid.gap,r),justifyContent:ye?"flex-start":m()},children:f.map((d,i)=>{const x=i===z,k=ue[i],y=_.grid.size*(x?_.activeState.scale:1),G=()=>{if(_.fit!=="fit")return{};if(!k)return s.direction==="horiz"?{height:h.scalingValue(y,r)}:{width:h.scalingValue(y,r)};const a=k.width/k.height;if(s.direction==="horiz"){const w=y,j=w*a;return{width:h.scalingValue(j,r),height:h.scalingValue(w,r)}}else{const w=y,j=w/a;return{width:h.scalingValue(w,r),height:h.scalingValue(j,r)}}};return u.jsx("button",{className:e.thumbItem,style:{...s.direction==="horiz"&&_.fit!=="fit"?{height:h.scalingValue(y,r)}:{},...s.direction==="vert"&&_.fit!=="fit"?{width:h.scalingValue(y,r)}:{},..._.fit==="cover"?{width:h.scalingValue(y,r),height:h.scalingValue(y,r)}:{},...G(),transition:x?"all 0.25s ease-out":"none",opacity:x?_.activeState.opacity/100:_.opacity/100,"--thumb-hover":_.activeState.opacity/100},onClick:a=>{var w;a.stopPropagation(),Y(i),(w=I.current)==null||w.go(i)},onMouseEnter:()=>{var a;_.triggers==="hov"&&((a=I.current)==null||a.go(i))},children:u.jsx("img",{src:d.image.assetId,alt:d.image.name??"",onLoad:a=>{const w=a.currentTarget;w.naturalWidth&&w.naturalHeight&&de(j=>({...j,[i]:{width:w.naturalWidth,height:w.naturalHeight}}))},style:{objectFit:_.fit==="cover"?"cover":"contain",..._.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},..._.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${d.image.name}-${i}`)})})})})()]})]}),document.getElementById(R))};function _e({color:l,className:L}){return u.jsx("svg",{viewBox:"0 0 10 18",className:L,children:u.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:u.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:l,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}exports.LightboxGallery=xt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),g=require("react"),Ae=require("react-dom"),h=require("./scalingValue-CSHYgTZl.js"),ae=require("./SvgImage-DFlmxAoL.js"),$=require("classnames"),fe=require("./react-splide.esm-CabaEmHi.js"),Te=require("./RichTextRenderer-DEFXh5o6.js"),Z=require("./getImageRect-BQhQXvT8.js"),pe=require("./getColorAlpha-CoSseoCn.js"),je=require("./textStylesToCss-CNN3zZTV.js"),$e="LightBox-module__hidden___9s-9x",ze="LightBox-module__heroImage___sTxNF",Fe="LightBox-module__background___rm9ml",Ne="LightBox-module__editor___4ACaY",Oe="LightBox-module__contentStyle___Bgnsq",We="LightBox-module__imageStyle___tLIlB",Ee="LightBox-module__imgWrapper___LuFUp",De="LightBox-module__contain___8-yaS",Me="LightBox-module__cover___hNvOG",Pe="LightBox-module__caption___b6L2I",Xe="LightBox-module__captionTextInner___rCGNH",He="LightBox-module__lightboxSplide___XFuWC",Ye="LightBox-module__arrow___iz38X",Ue="LightBox-module__arrowVertical___Zfz81",qe="LightBox-module__nextArrow___zkAQN",Ge="LightBox-module__arrowInner___p48sW",Ke="LightBox-module__arrowIcon___3VaFf",Ze="LightBox-module__arrowImg___pNV88",Je="LightBox-module__mirror___pjeXc",Qe="LightBox-module__thumbsWrapper___GB-nU",et="LightBox-module__thumbsContainerVertical___wttk5",tt="LightBox-module__thumbsContainer___osSma",nt="LightBox-module__thumbsAlignStart___MO6tY",rt="LightBox-module__thumbsAlignCenter___Q4sUx",ot="LightBox-module__thumbsAlignEnd___p4y9R",it="LightBox-module__thumbItem___HvnF3",st="LightBox-module__closeButton___g2khP",at="LightBox-module__fadeIn___0m5GW",lt="LightBox-module__slideInLeft___gPYwC",ct="LightBox-module__slideInRight___S-pPp",ut="LightBox-module__slideInTop___DFdAj",dt="LightBox-module__slideInBottom___m27kZ",ht="LightBox-module__fadeOut___55qBR",mt="LightBox-module__slideOutLeft___NvU7P",gt="LightBox-module__slideOutRight___SK7eC",ft="LightBox-module__slideOutTop___Vgg0z",pt="LightBox-module__slideOutBottom___nJ0Ef",_t="LightBox-module__scaleSlide___vZriG",e={hidden:$e,heroImage:ze,background:Fe,editor:Ne,contentStyle:Oe,imageStyle:We,imgWrapper:Ee,contain:De,cover:Me,caption:Pe,captionTextInner:Xe,lightboxSplide:He,arrow:Ye,arrowVertical:Ue,nextArrow:qe,arrowInner:Ge,arrowIcon:Ke,arrowImg:Ze,mirror:Je,thumbsWrapper:Qe,thumbsContainerVertical:et,thumbsContainer:tt,thumbsAlignStart:nt,thumbsAlignCenter:rt,thumbsAlignEnd:ot,thumbItem:it,closeButton:st,fadeIn:at,slideInLeft:lt,slideInRight:ct,slideInTop:ut,slideInBottom:dt,fadeOut:ht,slideOutLeft:mt,slideOutRight:gt,slideOutTop:ft,slideOutBottom:pt,scaleSlide:_t},J=(l,L,f)=>{const p={},[V,R]=l.split("-");return V==="top"?(p.top="0",p.bottom="auto"):V==="middle"?(p.top="50%",p.bottom="auto"):V==="bottom"&&(p.top="auto",p.bottom="0"),R==="left"?(p.left="0",p.right="auto"):R==="center"?(p.left="50%",p.right="auto"):R==="right"&&(p.left="auto",p.right="0"),V==="middle"&&R==="center"?p.transform=`translate(calc(-50% + ${h.scalingValue(L.x,f)}), calc(-50% + ${h.scalingValue(L.y,f)}))`:V==="middle"?p.transform=`translate(${h.scalingValue(L.x,f)}, calc(-50% + ${h.scalingValue(L.y,f)}))`:R==="center"?p.transform=`translate(calc(-50% + ${h.scalingValue(L.x,f)}), ${h.scalingValue(L.y,f)})`:p.transform=`translate(${h.scalingValue(L.x,f)}, ${h.scalingValue(L.y,f)})`,p};function vt(l,L){const f=(()=>{if(l==="fade in")return e.fadeIn;if(l==="slide in"||l==="mix")switch(L){case"left":return e.slideInLeft;case"right":return e.slideInRight;case"top":return e.slideInTop;case"bottom":return e.slideInBottom;default:return e.slideInRight}return e.fadeIn})(),p=(()=>{if(l==="fade in"||l==="mix")return e.fadeIn;if(l==="slide in")switch(L){case"left":return e.slideInLeft;case"right":return e.slideInRight;case"top":return e.slideInTop;case"bottom":return e.slideInBottom;default:return e.slideInRight}return e.fadeIn})(),V=(()=>{if(l==="fade in"||l==="mix")return e.fadeOut;if(l==="slide in")switch(L){case"left":return e.slideOutLeft;case"right":return e.slideOutRight;case"top":return e.slideOutTop;case"bottom":return e.slideOutBottom;default:return e.slideOutRight}return e.fadeOut})(),R=(()=>{if(l==="fade in")return e.fadeOut;if(l==="slide in"||l==="mix")switch(L){case"left":return e.slideOutLeft;case"right":return e.slideOutRight;case"top":return e.slideOutTop;case"bottom":return e.slideOutBottom;default:return e.slideOutRight}return e.fadeOut})();return{appearClass:f,backdropAppearClass:p,backdropDisappearClass:V,disappearClass:R}}const xt=({settings:l,content:L,styles:f,portalId:p,activeEvent:V,isEditor:R,isPreviewMode:r})=>{const[X,O]=g.useState(!1),{assetId:H}=l.thumbnailBlock.cover;return g.useEffect(()=>{V==="close"&&O(!1),V==="open"&&O(!0)},[V]),u.jsxs(u.Fragment,{children:[u.jsx("img",{src:H,alt:"Cover",className:e.heroImage,onClick:()=>O(!0)}),u.jsx(bt,{isOpen:X,onClose:()=>O(!1),content:L,settings:l,lightboxStyles:f,portalId:p,isEditor:R})]})},bt=({isOpen:l,onClose:L,content:f,lightboxStyles:p,settings:V,portalId:R,isEditor:r,metadata:X})=>{var ge;const{widthSettings:O,fontSettings:H,letterSpacing:ve,textAlign:xe,wordSpacing:be,fontSizeLineHeight:le,textAppearance:Q,color:we}=p.imageCaption??{},[z,Y]=g.useState(0),[ce,ee]=g.useState(0),[te,ne]=g.useState(!1),[Le,U]=g.useState(!1),[ue,de]=g.useState({}),I=g.useRef(null),re=g.useRef(null),A=g.useRef(null),W=g.useRef(!1),C=g.useRef(null),E=g.useRef(null),D=g.useRef(null),S=g.useRef(null),F=g.useRef(!1),he=g.useRef(null),[ye,oe]=g.useState(!1),{appear:q,triggers:T,slider:s,thumbnail:_,controls:v,area:B,caption:M,layout:P}=V.lightboxBlock,{appearClass:Ie,backdropAppearClass:Ce,backdropDisappearClass:Se,disappearClass:Be}=vt(q.type,q.direction),ie=(X==null?void 0:X.itemId)??null;g.useEffect(()=>{const t=()=>{setTimeout(()=>{var o,c;(c=(o=I.current)==null?void 0:o.splide)==null||c.refresh()},16)},n=()=>{ee(o=>o+1)};return window.addEventListener("ArticleEditor.Layout:change",t),window.addEventListener("ArticleEditor.ComponentContent:change",n),()=>{window.removeEventListener("ArticleEditor.Layout:change",t),window.removeEventListener("ArticleEditor.ComponentContent:change",n)}},[]),g.useEffect(()=>{if(!l||!_.isActive){oe(!1);return}const t=he.current;if(!t)return;const n=()=>{s.direction==="horiz"?oe(t.scrollWidth>t.clientWidth):oe(t.scrollHeight>t.clientHeight)};n();const o=new ResizeObserver(n);return o.observe(t),()=>o.disconnect()},[l,_.isActive,f.length,ue,s.direction]);const N=g.useCallback(()=>{const t=window.matchMedia("(max-width: 768px)").matches,n=pe.getColorAlpha(B.color);t&&!r&&n>.9&&(document.body.style.backgroundColor=""),ne(!0),W.current=!0;const o=c=>{c.target===C.current&&c.animationName&&(C.current&&E.current&&C.current.removeEventListener("animationend",E.current),E.current=null,W.current&&(W.current=!1,L()),ne(!1))};C.current&&(E.current=o,C.current.addEventListener("animationend",o))},[L,B.color,r]),Ve=(t,n,o)=>{var c,m;if(t){if(T.type==="click"&&T.switch==="image")T.repeat==="close"&&z===f.length-1?N():(c=I.current)==null||c.go("+1");else if(T.type==="click"&&T.switch==="50/50"){const d=t.getBoundingClientRect(),i=n-d.left,x=o-d.top,k=d.width,b=d.height;let y;s.direction==="horiz"?y=i<k/2?"-1":"+1":y=x<b/2?"-1":"+1",(m=I.current)==null||m.go(y)}}},me=t=>{if(F.current){F.current=!1;return}const n=f[z],o=(n==null?void 0:n.image.objectFit)==="cover";let c,m;if("changedTouches"in t&&t.changedTouches.length>0)c=t.changedTouches[0].clientX,m=t.changedTouches[0].clientY;else if("clientX"in t)c=t.clientX,m=t.clientY;else return;let d;if(o&&A.current){const i=Z.getPaddedContainerBounds(A.current);d=c>=i.left&&c<=i.right&&m>=i.top&&m<=i.bottom}else{const i=A.current?Z.getDisplayedImageRect(A.current):null;if(!i){t.target===t.currentTarget&&N();return}d=c>=i.x&&c<=i.x+i.width&&m>=i.y&&m<=i.y+i.height}d?Ve(A.current,c,m):N()},Re=t=>{const n=t.target;(n.classList.contains(e.thumbsWrapper)||n.classList.contains(e.thumbsContainer))&&me(t)};g.useEffect(()=>{if(!l)return;const t=n=>{var o,c;if(n.key==="Escape"){N();return}if(n.key==="ArrowRight"){Y(m=>(m+1)%Math.max(f.length,1)),(o=I.current)==null||o.go("+1");return}n.key==="ArrowLeft"&&(Y(m=>(m-1+Math.max(f.length,1))%Math.max(f.length,1)),(c=I.current)==null||c.go("-1"))};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[l,N,f.length]),g.useEffect(()=>{if(l){if(Y(0),ee(n=>n+1),W.current=!1,ne(!1),U(!1),de({}),!ie)return;const t=new CustomEvent("page-overlay",{detail:{itemId:ie}});window.dispatchEvent(t)}return()=>{C.current&&E.current&&(C.current.removeEventListener("animationend",E.current),E.current=null),U(!1)}},[l,ie]),g.useEffect(()=>{re.current!==null&&re.current!==s.type&&ee(t=>t+1),re.current=s.type},[s.type]),g.useEffect(()=>{if(!l)return;const t=document.body.style.overflow,n=window.matchMedia("(max-width: 768px)").matches,o=pe.getColorAlpha(B.color);document.body.style.overflow="hidden",U(!1);const c=d=>{d.target===C.current&&!W.current&&d.animationName&&(n&&!r&&o>.9&&(document.body.style.backgroundColor=B.color),U(!0),C.current&&D.current&&C.current.removeEventListener("animationend",D.current),D.current=null)};C.current&&(D.current=c,C.current.addEventListener("animationend",c));const m=d=>{const i=d.target;i&&(i.closest(`.${e.thumbsWrapper}`)||i.closest(`.${e.thumbsContainer}`))||s.type!=="slide"&&d.preventDefault()};return document.addEventListener("touchmove",m,{passive:!1}),()=>{document.body.style.overflow=t,document.removeEventListener("touchmove",m),C.current&&D.current&&(C.current.removeEventListener("animationend",D.current),D.current=null),U(!1)}},[l,r,B.color,s.type]),g.useEffect(()=>{if(!l)return;const t=n=>{var c,m;if(W.current){n.stopPropagation();return}if(F.current){F.current=!1;return}const o=n.target;if(!(o&&(o.closest(`.${e.thumbsContainer}`)||o.closest(`.${e.thumbItem}`)||o.closest(`.${e.arrow}`)||o.closest(`.${e.closeButton}`)||o.closest(`.${e.caption}`)))){if(s.type==="slide"&&T.type==="drag"&&((m=(c=I.current)==null?void 0:c.splide)!=null&&m.root)){const d=I.current.splide.root;if(o&&(d.contains(o)||d===o))return}if(n.touches.length===0&&n.changedTouches.length>0){const d=f[z],i=(d==null?void 0:d.image.objectFit)==="cover",x=n.changedTouches[0];let k;if(i&&A.current){const b=Z.getPaddedContainerBounds(A.current);k=x.clientX>=b.left&&x.clientX<=b.right&&x.clientY>=b.top&&x.clientY<=b.bottom}else{const b=A.current?Z.getDisplayedImageRect(A.current):null;if(!b)return;k=x.clientX>=b.x&&x.clientX<=b.x+b.width&&x.clientY>=b.y&&x.clientY<=b.y+b.height}if(!k){n.stopPropagation(),W.current=!0;const b=y=>{y.stopPropagation(),y.preventDefault(),document.removeEventListener("click",b,!0)};document.addEventListener("click",b,!0),N()}}}};return document.addEventListener("touchend",t,{passive:!0}),()=>{document.removeEventListener("touchend",t)}},[l,N,z,f]);const se=(s.type==="scale"||s.type==="fade")&&s.direction==="vert"&&T.type==="drag";g.useEffect(()=>{var y,G;if(!l||!se||!((G=(y=I.current)==null?void 0:y.splide)!=null&&G.root))return;const t=I.current.splide.root,n=30,o=(a,w)=>{if(S.current){const j=Math.abs(a-S.current.x),K=Math.abs(w-S.current.y);(j>0||K>0)&&(F.current=!0)}},c=a=>{S.current&&(a.preventDefault(),o(a.clientX,a.clientY))},m=a=>{S.current&&a.touches.length>0&&(a.preventDefault(),o(a.touches[0].clientX,a.touches[0].clientY))},d=(a,w)=>{if(!S.current||!I.current){S.current=null;return}const j=Math.abs(a-S.current.x),K=Math.abs(w-S.current.y);K>n&&K>j&&I.current.go(w<S.current.y?"+1":"-1"),S.current=null},i=a=>{S.current&&d(a.clientX,a.clientY),document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",i),document.removeEventListener("pointermove",c)},x=a=>{if(S.current){if(a.changedTouches.length>0){const w=a.changedTouches[0];d(w.clientX,w.clientY)}document.removeEventListener("touchend",x),document.removeEventListener("touchcancel",x),document.removeEventListener("touchmove",m)}},k=a=>{S.current={x:a.clientX,y:a.clientY},F.current=!1,document.addEventListener("pointermove",c,{passive:!1}),document.addEventListener("pointerup",i),document.addEventListener("pointercancel",i)},b=a=>{a.touches.length>0&&(S.current={x:a.touches[0].clientX,y:a.touches[0].clientY},F.current=!1,document.addEventListener("touchmove",m,{passive:!1}),document.addEventListener("touchend",x),document.addEventListener("touchcancel",x))};return t.addEventListener("pointerdown",k),t.addEventListener("touchstart",b),()=>{t.removeEventListener("pointerdown",k),t.removeEventListener("touchstart",b),document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",i),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",x),document.removeEventListener("touchcancel",x),S.current=null,F.current=!1}},[l,se,ce]);const ke={backgroundColor:B.color,backdropFilter:`blur(${B.blur}px)`,animationDuration:`${parseInt(q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(R)?null:Ae.createPortal(u.jsxs(u.Fragment,{children:[u.jsx("div",{ref:r?null:C,className:$(e.background,te?Se:Ce,{[e.editor]:r},{[e.hidden]:!l}),style:{...ke,...Le&&!r&&!te?{position:"absolute"}:{}}}),u.jsxs("div",{ref:r?C:null,className:$(e.contentStyle,te?Be:Ie,{[e.editor]:r},{[e.hidden]:!l}),style:{animationDuration:`${parseInt(q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[u.jsx(fe.Splide2,{onMove:t=>Y(t.index),ref:I,className:e.lightboxSplide,options:{arrows:!1,speed:s.duration?parseInt(s.duration):500,direction:s.direction==="horiz"||s.type==="fade"||s.type==="scale"?"ltr":"ttb",pagination:!1,drag:T.type==="drag"&&!se,perPage:1,width:"100%",height:"100%",type:s.type==="fade"||s.type==="scale"?"fade":"loop",padding:0,rewind:T.repeat!=="close",start:0},style:{"--splide-speed":s.duration},children:f.map((t,n)=>{const o=J(P.position,P.offset,r),c=`${h.scalingValue(P.padding.top,r)} ${h.scalingValue(P.padding.right,r)} ${h.scalingValue(P.padding.bottom,r)} ${h.scalingValue(P.padding.left,r)}`,m=s.type==="scale"?(()=>{const{transform:d,...i}=o;return{...i,position:"absolute",padding:c,boxSizing:"border-box","--position-transform":d||"none"}})():{...o,position:"absolute",padding:c,boxSizing:"border-box"};return u.jsx(fe.SplideSlide,{children:u.jsx("div",{className:e.imgWrapper,onClick:me,children:u.jsx("img",{ref:n===z?A:null,className:$(e.imageStyle,{[e.contain]:t.image.objectFit==="contain",[e.cover]:t.image.objectFit==="cover",[e.scaleSlide]:s.type==="scale"}),src:t.image.assetId,alt:t.image.name??"",style:{...m,pointerEvents:t.image.objectFit==="contain"?"none":"auto"}})})},n)})},ce),v.isActive&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:$(e.arrow,{[e.arrowVertical]:s.direction==="vert"}),style:{color:v.color,"--arrow-hover-color":v.hover},children:u.jsxs("button",{className:e.arrowInner,style:{transform:`translate(${h.scalingValue(v.offset.x,r)}, ${h.scalingValue(v.offset.y*(s.direction==="horiz"?1:-1),r)}) scale(${v.scale}) rotate(${s.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var t;return(t=I.current)==null?void 0:t.go("-1")},"aria-label":"Previous",children:[v.arrowsImgUrl&&u.jsx(ae.SvgImage,{url:v.arrowsImgUrl,fill:v.color,hoverFill:v.hover,className:$(e.arrowImg,e.mirror)}),!v.arrowsImgUrl&&u.jsx(_e,{color:v.color,className:$(e.arrowIcon,e.arrowImg,e.mirror)})]})}),u.jsx("div",{className:$(e.arrow,e.nextArrow,{[e.arrowVertical]:s.direction==="vert"}),style:{color:v.color,"--arrow-hover-color":v.hover},children:u.jsxs("button",{className:e.arrowInner,style:{transform:`translate(${h.scalingValue(v.offset.x*(s.direction==="horiz"?-1:1),r)}, ${h.scalingValue(v.offset.y,r)}) scale(${v.scale}) rotate(${s.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var t;return(t=I.current)==null?void 0:t.go("+1")},"aria-label":"Next",children:[v.arrowsImgUrl&&u.jsx(ae.SvgImage,{url:v.arrowsImgUrl,fill:v.color,hoverFill:v.hover,className:e.arrowImg}),!v.arrowsImgUrl&&u.jsx(_e,{color:v.color,className:$(e.arrowIcon,e.arrowImg)})]})})]}),B.closeIconUrl&&(()=>{const t=J(B.closeIconAlign,B.closeIconOffset,r),n=`scale(${B.closeIconScale})`,o=t.transform?`${t.transform} ${n}`:n;return u.jsx("button",{className:e.closeButton,style:{...t,transform:o},onClick:N,"aria-label":"Close lightbox",children:u.jsx(ae.SvgImage,{url:B.closeIconUrl,fill:B.closeIconColor??"#000000",hoverFill:B.closeIconHover??"#cccccc"})})})(),M&&M.isActive&&p.imageCaption&&((ge=f[z])==null?void 0:ge.imageCaption)&&u.jsx("div",{className:e.caption,style:{...J(M.alignment,M.offset,r),fontFamily:je.normalizeFontFamilyCssValue(H.fontFamily),fontWeight:H.fontWeight,fontStyle:H.fontStyle,width:O.sizing==="auto"?"max-content":h.scalingValue(O.width,r),letterSpacing:h.scalingValue(ve,r),wordSpacing:h.scalingValue(be,r),textAlign:xe,fontSize:h.scalingValue(le.fontSize,r),lineHeight:h.scalingValue(le.lineHeight,r),textTransform:Q.textTransform??"none",textDecoration:Q.textDecoration??"none",fontVariant:Q.fontVariant??"normal",color:we},onClick:t=>t.stopPropagation(),children:u.jsx("div",{"data-styles":"imageCaption",className:e.captionTextInner,style:{"--link-color":M.linkColor,"--link-hover-color":M.linkHoverColor},children:u.jsx(Te.RichTextRenderer,{content:f[z].imageCaption})})}),_.isActive&&(()=>{const[t,n]=_.position.split("-"),o=s.direction==="horiz"?`${t}-left`:_.position,c=J(o,_.offset,r),m=()=>{if(s.direction==="horiz"){if(n==="left")return"flex-start";if(n==="center")return"center";if(n==="right")return"flex-end"}else{if(t==="top")return"flex-start";if(t==="middle")return"center";if(t==="bottom")return"flex-end"}return"flex-start"};return u.jsx("div",{ref:he,className:e.thumbsWrapper,onClick:d=>Re(d),style:{position:r?"absolute":"fixed",...c,...s.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:u.jsx("div",{className:$(e.thumbsContainer,{[e.thumbsContainerVertical]:s.direction==="vert",[e.thumbsAlignStart]:_.align==="start",[e.thumbsAlignCenter]:_.align==="center",[e.thumbsAlignEnd]:_.align==="end"}),style:{gap:h.scalingValue(_.grid.gap,r),justifyContent:ye?"flex-start":m()},children:f.map((d,i)=>{const x=i===z,k=ue[i],y=_.grid.size*(x?_.activeState.scale:1),G=()=>{if(_.fit!=="fit")return{};if(!k)return s.direction==="horiz"?{height:h.scalingValue(y,r)}:{width:h.scalingValue(y,r)};const a=k.width/k.height;if(s.direction==="horiz"){const w=y,j=w*a;return{width:h.scalingValue(j,r),height:h.scalingValue(w,r)}}else{const w=y,j=w/a;return{width:h.scalingValue(w,r),height:h.scalingValue(j,r)}}};return u.jsx("button",{className:e.thumbItem,style:{...s.direction==="horiz"&&_.fit!=="fit"?{height:h.scalingValue(y,r)}:{},...s.direction==="vert"&&_.fit!=="fit"?{width:h.scalingValue(y,r)}:{},..._.fit==="cover"?{width:h.scalingValue(y,r),height:h.scalingValue(y,r)}:{},...G(),transition:x?"all 0.25s ease-out":"none",opacity:x?_.activeState.opacity/100:_.opacity/100,"--thumb-hover":_.activeState.opacity/100},onClick:a=>{var w;a.stopPropagation(),Y(i),(w=I.current)==null||w.go(i)},onMouseEnter:()=>{var a;_.triggers==="hov"&&((a=I.current)==null||a.go(i))},children:u.jsx("img",{src:d.image.assetId,alt:d.image.name??"",onLoad:a=>{const w=a.currentTarget;w.naturalWidth&&w.naturalHeight&&de(j=>({...j,[i]:{width:w.naturalWidth,height:w.naturalHeight}}))},style:{objectFit:_.fit==="cover"?"cover":"contain",..._.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},..._.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${d.image.name}-${i}`)})})})})()]})]}),document.getElementById(R))};function _e({color:l,className:L}){return u.jsx("svg",{viewBox:"0 0 10 18",className:L,children:u.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:u.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:l,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}exports.LightboxGallery=xt;
@@ -4,7 +4,7 @@ import { flushSync as Mi, createPortal as Bi } from "react-dom";
4
4
  import { u as zi } from "./useScopedStyles-DhBG3557.mjs";
5
5
  import { u as Ki, i as It, g as Qe } from "./useLightboxSwipeDismiss-SGv6Ra33.mjs";
6
6
  import { s as we } from "./scalingValue-C9JH5L6O.mjs";
7
- import { S as ji } from "./SvgImage-CwRq9-ec.mjs";
7
+ import { S as ji } from "./SvgImage-B5mR9y6q.mjs";
8
8
  import { u as Ai } from "./useLightboxScrollLock-VQ07s7EJ.mjs";
9
9
  import { j as _t, r as Jt, i as Vt, s as Ee, k as Ue, S as Fi, l as Xe, m as Oi, D as ve, b as Gt, a as Ve, g as Ye, c as Ut, e as nt, h as Di, n as ye, f as ht, d as _i, T as Xt, o as Ji, p as Gi, q as Ui, t as qe, u as Ze, v as Xi } from "./utils-FxC9rcxw.mjs";
10
10
  const Vi = ({
@@ -1,4 +1,4 @@
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`
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-DFlmxAoL.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
2
  .${e}-wrapper {
3
3
  position: relative;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),a=require("react"),jn=require("react-dom"),Mn=require("./useScopedStyles-Bf6yohVQ.js"),J=require("./useLightboxSwipeDismiss-Br9uE5G0.js"),Rt=require("./scalingValue-CSHYgTZl.js"),kn=require("./SvgImage-_QN8ngad.js"),_n=require("./useLightboxScrollLock-Hf16Eq4g.js"),En=require("./textStylesToCss-CNN3zZTV.js"),Nn=(e,o,u,f)=>{const l=Math.min(Math.abs(e)/Math.max(f,1),1);return o+(u-o)*l},On=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},zn=e=>{const o=getComputedStyle(e).transform;return o==="none"?0:new DOMMatrixReadOnly(o).m41},Fn=(e,o,u,{duration:f,easing:l,onComplete:m})=>{const p=e.scrollLeft,w=u-p,I=p-u,F=(E,Q)=>{On(o),e.scrollLeft=E,Q&&(m==null||m())};if(Math.abs(w)<.5)return F(u,!0),()=>{};let j=!1,K=0;const L=()=>{o.removeEventListener("transitionend",G),clearTimeout(K)},G=E=>{E.target!==o||E.propertyName!=="transform"||j||(j=!0,L(),F(u,!0))};return o.addEventListener("transitionend",G),o.style.willChange="transform",o.style.transition="none",o.style.transform="translate3d(0, 0, 0)",o.offsetHeight,o.style.transition=`transform ${f}ms ${l}`,o.style.transform=`translate3d(${I}px, 0, 0)`,K=window.setTimeout(()=>{j||(j=!0,L(),F(u,!0))},f+64),()=>{j||(j=!0,L(),F(p-zn(o),!1))}},gt=300,Kn=900,Bn=1500,Dn="cubic-bezier(0.16, 1, 0.3, 1)",Hn=3e3,Xn=2,Gn=16,Vn=.05,Yn=1,It=.3,qn=50,Un=20,at=.004,Oe=["title1","title2","title3"],ze={title1:"1",title2:"2",title3:"3"},Zn={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Jn={title1:.02,title2:.02,title3:.02},Wt=e=>`max(${e}, ${Un}px)`,Fe=e=>{if(!Array.isArray(e)||e.length===0)return{};const o=e.find(l=>(l==null?void 0:l.type)==="paragraph")??e[0],u=o==null?void 0:o.children;if(!Array.isArray(u))return{};const f=u.map(l=>typeof(l==null?void 0:l.text)=="string"?l.text.trim():"").filter(Boolean);return{title1:f[0],title2:f[1],title3:f[2]}},Ke=e=>{if(!e)return{title1:"",title2:"",title3:""};if(e.title1||e.title2||e.title3)return{title1:e.title1??"",title2:e.title2??"",title3:e.title3??""};const o=Fe(e.text);return{title1:o.title1??"",title2:o.title2??"",title3:o.title3??""}},_=(e,o)=>`${e}${o.charAt(0).toUpperCase()}${o.slice(1)}`,Be=e=>[_(e,"fontFamily"),_(e,"fontSettings"),{type:"row",items:[_(e,"fontSize"),_(e,"lineHeight"),_(e,"letterSpacing"),_(e,"wordSpacing")]},_(e,"textAlign"),_(e,"textAppearance")],Qn=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Oe.map(e=>[ze[e],Be(e)]))}),ee=(e,o)=>{if(e<=0)return[];const u=o.slice(0,e),f=u.reduce((m,p)=>m+p,0);if(f<=1)return u;const{widths:l}=[...u].reverse().reduce(({overflow:m,widths:p},w)=>{if(m<=0||w<=0)return{overflow:m,widths:[w,...p]};const I=Math.min(m,w);return{overflow:m-I,widths:[w-I,...p]}},{overflow:f-1,widths:[]});return l},De=(e,o)=>ee(e,o),At=(e,o)=>{const u=o.filter((f,l)=>l!==e).reduce((f,l)=>f+l,0);return Math.max(1-u,0)},Ne=(e,o)=>{const u=e.map(f=>o[f.widthKey]??0);return{resolved:ee(e.length,u),effective:De(e.length,u)}},Pn=(e,o,u,f,l,m,p)=>{const w=[];return o&&w.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:l,text:o}),u&&w.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:m,text:u}),f&&w.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:p,text:f}),w},Pt=(e,o)=>{const u=f=>{const l=_(o,f);return e[l]};return{fontFamily:u("fontFamily")??"Arial",fontSettings:u("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:u("fontSize"),lineHeight:u("lineHeight"),letterSpacing:u("letterSpacing")??0,wordSpacing:u("wordSpacing")??0,textAlign:u("textAlign")??"left",textAppearance:u("textAppearance"),color:e[Zn[o]]}},tr=(e,o,u,f)=>e.slice(0,f).reduce((l,m,p)=>l+(m!=null&&m.marginLeftKey?u[m.marginLeftKey]??0:0)+(o[p]??0),0),te=(e,o,u)=>{var l,m;const f={fontSettings:{fontFamily:o.fontFamily,fontWeight:((l=o.fontSettings)==null?void 0:l.fontWeight)??400,fontStyle:((m=o.fontSettings)==null?void 0:m.fontStyle)??"normal"},fontSize:o.fontSize??Jn[e],lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,wordSpacing:o.wordSpacing,textAlign:o.textAlign,textAppearance:o.textAppearance,color:o.color??"#ffffff"};return En.textStylesToCss(f,u)},er=({prefix:e,images:o,settings:u,isEditor:f,isEditMode:l,isPreviewMode:m,onClose:p})=>{const{backgroundColor:w,thumbnailSize:I,thumbnailGap:F,thumbnailMarginBottom:j,imageGap:K,closeIcon:L,closeIconMaxWidth:G,closeIconColor:E,closeIconHoverColor:Q,thumbnailTrigger:ne,thumbnailVisibility:Ct,thumbnailObjectFit:xt,thumbnailActive:He,thumbnailActiveColor:Xe,title1Width:jt,title2Width:re,title3Width:oe,title1MarginLeft:W=0,title2MarginLeft:ie=0,title3MarginLeft:se=0,titleRowMarginBottom:le=0,titleHeaderLayout:ae="desktop",contentMarginTop:Ge,iconMarginLeft:Ve}=u,P=t=>Rt.scalingValue(t,f??!1),Ye=I??u.thumnailSize??.03,ce=P(Ye),Mt=P(F),kt=P(j??.02),ct=P(K??0),ue=P(Ge??0),qe=Wt(ue),fe=P(Ve??0),[tt,_t]=a.useState(0),A=a.useRef(tt);A.current=tt;const Ue=o[tt],{title1:Et,title2:Nt,title3:Ot}=Ke(Ue),he=te("title1",Pt(u,"title1"),f),de=te("title2",Pt(u,"title2"),f),me=te("title3",Pt(u,"title3"),f),C=ae==="mobile",V=!l&&(!f||m),ut=V,ft=V,Ze=V,pe=J.isImageRatioCover(xt),Je=pe?{"--image-aspect-ratio":J.getAspectRatio(xt)}:void 0,ge=!!(Et||Nt||Ot),x=a.useMemo(()=>Pn(e,Et,Nt,Ot,he,de,me),[e,tt,Et,Nt,Ot,he,de,me]),et=a.useMemo(()=>({title1Width:jt,title2Width:re,title3Width:oe}),[jt,re,oe]),bt=a.useMemo(()=>x.map(t=>et[t.widthKey]),[x,et]),N=a.useMemo(()=>ee(x.length,bt),[x.length,bt]),xe=a.useMemo(()=>De(x.length,bt),[x.length,bt]),vt=a.useMemo(()=>x.filter(t=>t.prefix==="title1"),[x]),M=a.useMemo(()=>x.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[x]),yt=a.useMemo(()=>Ne(vt,et),[vt,et]),B=a.useMemo(()=>Ne(M,et),[M,et]),zt=a.useCallback((t,n)=>{const r=x.indexOf(t);if(!C||n==="single-row")return{effectiveWidth:xe[r]??0,resolvedWidth:N[r]??0,maxWidth:At(r,N)};if(n==="two-row-top"){const s=vt.indexOf(t);return{effectiveWidth:yt.effective[s]??0,resolvedWidth:yt.resolved[s]??0,maxWidth:At(s,yt.resolved)}}const i=M.indexOf(t);return{effectiveWidth:B.effective[i]??0,resolvedWidth:B.resolved[i]??0,maxWidth:At(i,B.resolved)}},[M,B,xe,N,x,vt,yt,C]),y=a.useCallback(t=>Rt.scalingValue(t,f??!1),[f]),Qe=y(le??0),k=a.useMemo(()=>({title1MarginLeft:W,title2MarginLeft:ie,title3MarginLeft:se}),[W,ie,se]),Pe=a.useCallback(t=>x.slice(0,t+1).reduce((n,r,i)=>n+(r!=null&&r.marginLeftKey?k[r.marginLeftKey]??0:0)+(N[i]??0),0)+(C?0:W??0),[x,k,N,C,W]),tn=a.useCallback(()=>C?0:W??0,[C,W]),Ft=a.useCallback(t=>M.slice(0,t).reduce((n,r,i)=>n+(r.marginLeftKey?k[r.marginLeftKey]??0:0)+(B.resolved[i]??0),0),[M,B.resolved,k]),en=a.useCallback(t=>{const n=M[t];return Ft(t)+(n.marginLeftKey?k[n.marginLeftKey]??0:0)+(B.resolved[t]??0)},[M,B.resolved,Ft,k]),Kt=(t,n)=>{const r=t.marginLeftKey?k[t.marginLeftKey]??0:0,{effectiveWidth:i,resolvedWidth:s,maxWidth:h}=zt(t,n),d=l&&n==="two-row-top";return c.jsxs("div",{className:`${e}-title-cell`,"data-title":t.prefix,style:{...n==="single-row"?{gridArea:t.prefix}:{},width:y(i),...r>0?{marginLeft:y(r)}:{}},children:[c.jsx("p",{className:t.className,style:t.style,children:t.text}),d&&t.marginLeftKey&&c.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s),style:{position:"absolute",top:0,left:y(-r),width:`max(${y(r)}, 10px)`,height:"100%",pointerEvents:"auto"}}),d&&c.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(h),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:y(-at/2),width:y(at),height:"100%",pointerEvents:"auto"}})]},t.className)},nn=()=>{const t=C?-1:x.findIndex(i=>i.prefix==="title1"),n=!C&&(l||(W??0)>0)?(()=>{const i=W??0,s=t>=0?N[t]:jt??0;return c.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s),style:{position:"absolute",top:0,left:0,width:`max(${y(i)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,r=x.flatMap((i,s)=>{if(!i.marginLeftKey)return[];const h=k[i.marginLeftKey]??0,d=tr(x,N,k,s)+tn();return c.jsx("div",{"data-controls":i.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(N[s]),style:{position:"absolute",top:0,left:y(d),width:`max(${y(h)}, 10px)`,height:"100%",pointerEvents:"auto"}},i.marginLeftKey)});return n?[n,...r]:r},rn=()=>x.map((t,n)=>{const r=At(n,N),s=Pe(n)-at/2;return c.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:c.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(r),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:y(s),width:y(at),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),on=()=>M.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const r=k[t.marginLeftKey]??0,i=Ft(n),{resolvedWidth:s}=zt(t,"two-row-bottom");return c.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s),style:{position:"absolute",top:0,left:y(i),width:`max(${y(r)}, 10px)`,height:"100%",pointerEvents:"auto"}},t.marginLeftKey)}),sn=()=>M.map((t,n)=>{const{maxWidth:r}=zt(t,"two-row-bottom"),s=en(n)-at/2;return c.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:c.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(r),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:y(s),width:y(at),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),ln=a.useRef(null),b=a.useRef(null),Bt=a.useRef(null),be=a.useRef(null),wt=a.useRef([]),S=a.useRef([]),nt=a.useRef(0),St=a.useRef(null),v=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),ht=a.useRef(null),rt=a.useRef(null),Dt=a.useRef(0),Ht=a.useRef("forward"),D=a.useRef(0),H=a.useRef(null),Y=a.useRef(!1),$=o.length>1&&(!l||!!m),Xt=$?3:1,an=a.useMemo(()=>Array.from({length:Xt},()=>o).flat(),[o,Xt]),[cn,ve]=a.useState(!1),[ye,we]=a.useState(!1),[un,Gt]=a.useState(!0),q=a.useRef(null),ot=a.useRef(null),Vt=a.useRef(!1),Se=a.useRef(!1),Yt=a.useRef(null),U=a.useRef(null),Le=ut&&!un,O=a.useCallback(()=>{ut&&(Gt(!0),U.current&&clearTimeout(U.current),U.current=setTimeout(()=>{v.current.isActive||Gt(!1)},Hn))},[ut]),dt=a.useCallback(()=>{l||Se.current||(Se.current=!0,we(!1),Yt.current=setTimeout(()=>{p()},gt))},[l,p]),$e=()=>c.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Le?"true":"false",style:{width:Rt.scalingValue(G??0,f),height:Rt.scalingValue(G??0,f),marginRight:fe,"--close-icon-hover-color":Q},children:[c.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:dt,"aria-label":"Close",children:c.jsx(kn.SvgImage,{url:L,fill:E,hoverFill:f&&!m?E:Q,className:`${e}-close-icon-img`})}),l&&c.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:fe,height:"100%",pointerEvents:"auto"}})]}),Te=(t="two-row")=>c.jsx("div",{...t==="two-row"&&l?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:y(W??0),flexShrink:0,...t==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...t==="two-row"&&l?{pointerEvents:"auto"}:{}}}),fn=()=>{const t=x.find(i=>i.prefix==="title1"),n=x.filter(i=>i.prefix==="title2"||i.prefix==="title3"),r=n.length>0||l||(le??0)>0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`${e}-header-row-top`,children:[(W??0)>0||l?Te():null,t&&Kt(t,"two-row-top"),L&&$e()]}),r?c.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[n.length>0?c.jsxs("div",{className:`${e}-header-row-bottom`,children:[n.map(i=>Kt(i,"two-row-bottom")),l&&c.jsxs(c.Fragment,{children:[on(),sn()]})]}):null,c.jsx("div",{"data-controls":l?"titleRowMarginBottom":void 0,"data-controls-axis":l?"y":void 0,"data-controls-reverse":l?"":void 0,className:l?`${e}-control`:void 0,style:{height:Qe,width:"100%",flexShrink:0,pointerEvents:l?"auto":"none"}})]}):null]})},hn=()=>c.jsxs(c.Fragment,{children:[(W??0)>0||l?Te("single-row"):null,x.map(t=>Kt(t,"single-row")),l?c.jsxs(c.Fragment,{children:[nn(),rn()]}):null,L?$e():null]}),qt=a.useCallback(t=>!!(t.closest("[data-controls]")||t.closest(`.${e}-thumbnails`)||t.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:dn,backdropStyle:mn,mediaAreaStyle:pn,overlayContentStyle:gn,swipeHandlers:xn,dismissAreaStyle:bn}=J.useLightboxSwipeDismiss({enabled:V??!1,onClose:dt,animMs:gt,isBlockedTarget:qt}),Ut=()=>{if(!$||o.length===0)return nt.current=0,0;const t=S.current[0],n=S.current[o.length];if(!t||!n)return nt.current;const r=n.offsetLeft-t.offsetLeft;return r>0&&(nt.current=r),nt.current},Z=(t=!1)=>{if(!$)return;const n=b.current,r=Ut();!n||r<=0||r<n.clientWidth*.25||(n.scrollLeft<=0?(n.scrollLeft+=r,t&&(v.current.scrollLeft+=r),Y.current&&(D.current+=r)):n.scrollLeft>=r*2&&(n.scrollLeft-=r,t&&(v.current.scrollLeft-=r),Y.current&&(D.current-=r)))},Re=(t,n=(r=>(r=b.current)==null?void 0:r.scrollLeft)()??0)=>{if(!$)return t;let i=o.length+t,s=1/0;for(let h=0;h<Xt;h++){const d=h*o.length+t,g=S.current[d];if(!g)continue;const T=Math.abs(g.offsetLeft-n);T<s&&(s=T,i=d)}return i},Ie=t=>{const n=b.current;return!t||!n?!1:t.offsetWidth>n.clientWidth+1},Zt=t=>{const n=b.current;if(!t||!n||!Ie(t))return!1;const r=t.offsetLeft,i=r+t.offsetWidth;return n.scrollLeft>=r-1&&n.scrollLeft+n.clientWidth<=i+1},it=(t=(n=>(n=b.current)==null?void 0:n.scrollLeft)()??0)=>{for(let i=0;i<S.current.length;i+=1){const s=S.current[i];if(s&&Zt(s))return i}let r={flatIndex:0,distance:1/0};return S.current.forEach((i,s)=>{if(!i)return;const h=Math.abs(i.offsetLeft-t);h<r.distance&&(r={flatIndex:s,distance:h})}),r.flatIndex},We=t=>{b.current&&S.current.forEach(n=>{n&&(n.style.scrollSnapAlign=Ie(n)&&t==="backward"?"end":"start")})},vn=(t,n,r)=>{const i=t-n,s=it(n),h=S.current[s];if(Zt(h))return it(t)%o.length;const d=S.current[s+1],g=h?d?d.offsetLeft-h.offsetLeft:h.offsetWidth:0,T=g>0?i>g*It?1:i<-g*It?-1:0:0;return T===0?r:$?(r+T+o.length)%o.length:Math.max(0,Math.min(o.length-1,r+T))},Ae=a.useCallback((t=!1)=>{if(Ct!=="on"||l)return;const n=be.current,r=A.current,i=wt.current[r];if(!n||!i||n.scrollWidth<=n.clientWidth)return;const s=n.scrollLeft,h=s+n.clientWidth,d=i.offsetLeft,g=d+i.offsetWidth;if(d>=s&&g<=h)return;const T=n.scrollWidth-n.clientWidth;let R=s;if(!t&&q.current===null){const lt=wt.current[r-1],pt=wt.current[r+1],Tt=lt?i.offsetLeft-lt.offsetLeft:pt?pt.offsetLeft-i.offsetLeft:i.offsetWidth;g>h?R+=Tt:d<s&&(R-=Tt)}else g>h?R=g-n.clientWidth:R=d;n.scrollLeft=Math.max(0,Math.min(T,R))},[l,Ct]),Jt=a.useCallback((t=!1)=>{t&&(Vt.current=!0),ot.current===null&&(ot.current=requestAnimationFrame(()=>{ot.current=null;const n=Vt.current;Vt.current=!1,Ae(n)}))},[Ae]),yn=a.useCallback(t=>{if(t===A.current)return;const n=A.current;A.current=t;const r=Math.abs(t-n)>1,i=$&&o.length>1&&(n===o.length-1&&t===0||n===0&&t===o.length-1);_t(t),Jt(r||i)},[o.length,$,Jt]),z=()=>{if(!b.current||o.length===0||q.current!==null||v.current.isActive&&v.current.hasMoved)return;const t=b.current.scrollLeft,n=it(t)%o.length;n!==A.current&&yn(n)},wn=()=>{q.current=null},X=t=>{const n=b.current;n&&(n.style.scrollSnapType=t?"":"none")},mt=()=>{var t;(t=rt.current)==null||t.call(rt),rt.current=null},Lt=()=>{H.current!==null&&(cancelAnimationFrame(H.current),H.current=null),Y.current=!1},Ce=()=>{const t=b.current;if(!t){H.current=null,Y.current=!1;return}const n=D.current-t.scrollLeft;if(Math.abs(n)<.5){t.scrollLeft=D.current,Z(),z(),H.current=null,Y.current=!1;return}t.scrollLeft+=n*Vn,Z(),z(),O(),H.current=requestAnimationFrame(Ce)},je=()=>{const t=Bt.current;t&&(t.style.transition="",t.style.transform="",t.style.willChange="")},Me=(t,n,r,i)=>{je(),t.scrollLeft=n,Dt.current=t.scrollLeft,Z(),r!==void 0?(A.current=r,_t(r)):z(),X(!0),i==null||i()},ke=(t,{behavior:n="smooth",activeIndex:r,onComplete:i}={})=>{const s=b.current,h=Bt.current;if(!s||!h)return;if(Lt(),mt(),X(!1),n==="auto"){Me(s,t,r,i);return}const d=Math.abs(t-s.scrollLeft),g=Nn(d,Kn,Bn,s.clientWidth*.55);rt.current=Fn(s,h,t,{duration:g,easing:Dn,onComplete:()=>{rt.current=null,Me(s,t,r,i)}})},Sn=(t="smooth")=>{const n=b.current;if(!n||o.length===0)return;const r=it()%o.length,i=Re(r,n.scrollLeft),s=S.current[i];s&&ke(s.offsetLeft,{behavior:t,activeIndex:r})},Ln=(t,n="smooth",r,i)=>{const s=b.current;if(!s||o.length===0)return;const h=(i??s.scrollLeft)-t,d=it(t),g=S.current[d];if(Zt(g)){X(!0),z();return}const T=S.current[d+1],R=g?T?T.offsetLeft-g.offsetLeft:g.offsetWidth:0;if((R>0?h>R*It?1:h<-R*It?-1:0:0)!==0){const An=r??d%o.length,Cn=vn(i??s.scrollLeft,t,An);st(Cn,n);return}const pt=i??s.scrollLeft,Tt=it(pt),Ee=S.current[Tt];if(Ee&&Math.abs(Ee.offsetLeft-pt)<1){X(!0),z();return}Sn("auto")},st=(t,n="smooth")=>{const r=b.current;if(!r||o.length===0)return;const i=Re(t,r.scrollLeft),s=S.current[i];s&&(n==="smooth"?q.current=t:q.current=null,A.current=t,_t(t),Jt(!0),ke(s.offsetLeft,{behavior:n,activeIndex:t,onComplete:n==="smooth"?wn:void 0}))},Qt=()=>{ht.current&&(window.removeEventListener("pointerup",ht.current),window.removeEventListener("pointercancel",ht.current),ht.current=null)},$n=(t,n,r,i,s)=>{const h=r-t,d=i-n,g=Math.abs(h),T=Math.abs(d);if(g<qn||g<=T)return!1;const R=h<0?1:-1,lt=$?(s+R+o.length)%o.length:Math.max(0,Math.min(o.length-1,s+R));return lt===s?!1:(st(lt),!0)},$t=t=>{if(!v.current.isActive)return;Qt();const n=b.current;if(!n)return;const{scrollLeft:r,startActiveIndex:i,hasMoved:s}=v.current,h=n.scrollLeft;Z(!0),v.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ve(!1),t!==void 0&&n.hasPointerCapture(t)&&n.releasePointerCapture(t),s?Ln(r,"smooth",i,h):(X(!0),z()),O()},Tn=(t,n)=>{const r=St.current;St.current=null,r&&($n(r.startX,r.startY,t,n,r.startActiveIndex),O())},Rn=t=>{if(!ft)return;if(t.pointerType==="touch"){if(Lt(),X(!0),qt(t.target))return;St.current={startX:t.clientX,startY:t.clientY,startActiveIndex:A.current};return}if(t.pointerType!=="mouse"||t.button!==0||qt(t.target))return;const n=b.current;if(!n)return;Lt(),mt(),je(),q.current=null,v.current={isActive:!0,startX:t.clientX,scrollLeft:n.scrollLeft,startActiveIndex:A.current,hasMoved:!1},X(!1),O(),n.setPointerCapture(t.pointerId),Qt();const r=i=>{i.pointerType==="mouse"&&$t(i.pointerId)};ht.current=r,window.addEventListener("pointerup",r),window.addEventListener("pointercancel",r)},In=t=>{if(!ft||t.pointerType!=="mouse")return;const n=b.current;if(!n||!v.current.isActive)return;if(t.buttons===0){$t(t.pointerId);return}const r=t.clientX-v.current.startX;Math.abs(r)>Yn&&(v.current.hasMoved=!0,ve(!0)),v.current.hasMoved&&(t.preventDefault(),n.scrollLeft=v.current.scrollLeft-r,Z(!0),z(),O())},_e=t=>{if(ft){if(t.pointerType==="touch"){t.type==="pointerup"?Tn(t.clientX,t.clientY):St.current=null;return}t.pointerType==="mouse"&&$t(t.pointerId)}},Wn=t=>{!ft||t.pointerType!=="mouse"||$t(t.pointerId)};return _n.useLightboxScrollLock(),a.useEffect(()=>{const t=requestAnimationFrame(()=>we(!0));return()=>{cancelAnimationFrame(t),mt(),Qt(),ot.current!==null&&(cancelAnimationFrame(ot.current),ot.current=null),Yt.current&&clearTimeout(Yt.current),U.current&&clearTimeout(U.current)}},[]),a.useEffect(()=>{if(!ut){Gt(!0);return}O();const t=()=>O();return document.addEventListener("pointermove",t,{passive:!0}),document.addEventListener("pointerdown",t,{passive:!0}),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerdown",t),U.current&&clearTimeout(U.current)}},[ut,O]),a.useEffect(()=>{const t=n=>{n.key==="Escape"&&dt()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[dt]),a.useLayoutEffect(()=>{Ut()},[ct,o.length,$]),a.useLayoutEffect(()=>{l||st(A.current,"auto")},[ct,l]),a.useLayoutEffect(()=>{st(0,"auto")},[o.length,$]),a.useEffect(()=>{const t=b.current;if(!t||l||!V)return;const n=r=>{if(r.preventDefault(),Math.abs(r.deltaY)<=Math.abs(r.deltaX))return;const i=r.deltaMode===1?Gn:r.deltaMode===2?t.clientHeight:1,s=r.deltaY*i*Xn;if(s!==0){if(mt(),Y.current||(Y.current=!0,D.current=t.scrollLeft,q.current=null,X(!1)),D.current+=s,!$){const h=t.scrollWidth-t.clientWidth;D.current=Math.max(0,Math.min(h,D.current))}O(),H.current===null&&(H.current=requestAnimationFrame(Ce))}};return t.addEventListener("wheel",n,{passive:!1}),()=>{t.removeEventListener("wheel",n),Lt()}},[l,V,$]),a.useEffect(()=>{const t=b.current;if(!t)return;const n=()=>{Z(v.current.isActive);const i=t.scrollLeft,s=i-Dt.current;Dt.current=i;const h=nt.current>0?nt.current*.5:1/0;if(s!==0&&Math.abs(s)<h){const d=s>0?"forward":"backward";d!==Ht.current&&(Ht.current=d,We(d))}v.current.isActive&&v.current.hasMoved||z()};t.addEventListener("scroll",n,{passive:!0});const r=new ResizeObserver(()=>{Ut(),Z(v.current.isActive),We(Ht.current),z()});return r.observe(t),()=>{mt(),t.removeEventListener("scroll",n),r.disconnect()}},[o.length,$]),c.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${f?` ${e}-lightbox-editor`:""}${l?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{dn||dt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:ye?1:0,transition:`opacity ${gt}ms ease`,pointerEvents:ye?"auto":"none"},children:[c.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:w,...mn}}),c.jsxs("div",{ref:ln,className:`${e}-lightbox-dismiss-area`,style:bn,...xn,children:[c.jsx("div",{className:`${e}-lightbox-content`,style:pn,onClick:t=>t.stopPropagation(),children:c.jsx("div",{ref:b,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":ft&&o.length>0?"true":"false","data-mouse-dragging":cn?"true":"false",onPointerDown:Rn,onPointerMove:In,onPointerUp:_e,onPointerCancel:_e,onLostPointerCapture:Wn,children:c.jsx("div",{ref:Bt,className:`${e}-lightbox-strip-track`,style:{gap:ct},children:an.map((t,n)=>{const r=t.image.objectFit??"contain",i=n%o.length,s=Math.floor(n/o.length),h=Wt(ct),d=`calc(-0.5 * (${h} + ${ct}))`;return c.jsxs("div",{ref:g=>S.current[n]=g,className:`${e}-strip-item`,style:{height:ae==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[c.jsx("img",{src:t.image.assetId,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:r}}),l&&i<o.length-1&&s===0&&c.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:d,width:h,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${s}-${t.image.assetId}-${i}`)})})})}),c.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":Le?"true":"false",style:gn,children:[c.jsx("div",{style:{position:"relative",width:"100%",height:ue,flexShrink:0,pointerEvents:"none"},children:l&&c.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:qe,pointerEvents:"auto",zIndex:3}})}),c.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:c.jsx("div",{className:`${e}-lightbox-content-area${C?` ${e}-lightbox-content-area-stacked`:""}`,children:(ge||L)&&c.jsx("div",{className:`${e}-header ${C?`${e}-header-two-row`:`${e}-header-single-row`}`,children:C?fn():ge||L?hn():null})})})]}),o.length>1&&Ct==="on"&&(()=>{const t=Wt(kt),n=`calc(-0.5 * (${kt} + ${t}))`;return c.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:kt},children:c.jsx("div",{ref:be,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:r=>r.stopPropagation(),children:c.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":He,style:{gap:Mt,"--thumbnail-active-color":Xe},children:[o.map((r,i)=>{const s=Wt(Mt),h=`calc(-0.5 * (${s} + ${Mt}))`;return c.jsxs("div",{ref:d=>{wt.current[i]=d},style:{position:"relative",flex:"0 0 auto"},children:[c.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":tt===i?"true":"false",onClick:()=>V&&ne==="click"&&st(i),onMouseEnter:()=>Ze&&ne==="hover"&&st(i),"aria-label":r.image.name?`View ${r.image.name}`:`View image ${i+1}`,"aria-current":tt===i?"true":void 0,children:c.jsx("img",{className:`${e}-thumb-image${pe?` ${e}-thumb-image-cover`:""}`,src:r.image.assetId,alt:"",draggable:!1,style:{...Je,maxWidth:ce,maxHeight:ce,width:xt.display==="cover"?"auto":"100%",height:"auto",objectFit:xt.display==="cover"?"cover":"contain"}})}),l&&i<o.length-1&&c.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:h,width:s,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${r.image.assetId}-${i}`)}),l&&c.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":l?"":void 0,style:{position:"absolute",left:0,right:0,bottom:n,height:t,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function nr(e){return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),a=require("react"),jn=require("react-dom"),Mn=require("./useScopedStyles-Bf6yohVQ.js"),J=require("./useLightboxSwipeDismiss-Br9uE5G0.js"),Rt=require("./scalingValue-CSHYgTZl.js"),kn=require("./SvgImage-DFlmxAoL.js"),_n=require("./useLightboxScrollLock-Hf16Eq4g.js"),En=require("./textStylesToCss-CNN3zZTV.js"),Nn=(e,o,u,f)=>{const l=Math.min(Math.abs(e)/Math.max(f,1),1);return o+(u-o)*l},On=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},zn=e=>{const o=getComputedStyle(e).transform;return o==="none"?0:new DOMMatrixReadOnly(o).m41},Fn=(e,o,u,{duration:f,easing:l,onComplete:m})=>{const p=e.scrollLeft,w=u-p,I=p-u,F=(E,Q)=>{On(o),e.scrollLeft=E,Q&&(m==null||m())};if(Math.abs(w)<.5)return F(u,!0),()=>{};let j=!1,K=0;const L=()=>{o.removeEventListener("transitionend",G),clearTimeout(K)},G=E=>{E.target!==o||E.propertyName!=="transform"||j||(j=!0,L(),F(u,!0))};return o.addEventListener("transitionend",G),o.style.willChange="transform",o.style.transition="none",o.style.transform="translate3d(0, 0, 0)",o.offsetHeight,o.style.transition=`transform ${f}ms ${l}`,o.style.transform=`translate3d(${I}px, 0, 0)`,K=window.setTimeout(()=>{j||(j=!0,L(),F(u,!0))},f+64),()=>{j||(j=!0,L(),F(p-zn(o),!1))}},gt=300,Kn=900,Bn=1500,Dn="cubic-bezier(0.16, 1, 0.3, 1)",Hn=3e3,Xn=2,Gn=16,Vn=.05,Yn=1,It=.3,qn=50,Un=20,at=.004,Oe=["title1","title2","title3"],ze={title1:"1",title2:"2",title3:"3"},Zn={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Jn={title1:.02,title2:.02,title3:.02},Wt=e=>`max(${e}, ${Un}px)`,Fe=e=>{if(!Array.isArray(e)||e.length===0)return{};const o=e.find(l=>(l==null?void 0:l.type)==="paragraph")??e[0],u=o==null?void 0:o.children;if(!Array.isArray(u))return{};const f=u.map(l=>typeof(l==null?void 0:l.text)=="string"?l.text.trim():"").filter(Boolean);return{title1:f[0],title2:f[1],title3:f[2]}},Ke=e=>{if(!e)return{title1:"",title2:"",title3:""};if(e.title1||e.title2||e.title3)return{title1:e.title1??"",title2:e.title2??"",title3:e.title3??""};const o=Fe(e.text);return{title1:o.title1??"",title2:o.title2??"",title3:o.title3??""}},_=(e,o)=>`${e}${o.charAt(0).toUpperCase()}${o.slice(1)}`,Be=e=>[_(e,"fontFamily"),_(e,"fontSettings"),{type:"row",items:[_(e,"fontSize"),_(e,"lineHeight"),_(e,"letterSpacing"),_(e,"wordSpacing")]},_(e,"textAlign"),_(e,"textAppearance")],Qn=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Oe.map(e=>[ze[e],Be(e)]))}),ee=(e,o)=>{if(e<=0)return[];const u=o.slice(0,e),f=u.reduce((m,p)=>m+p,0);if(f<=1)return u;const{widths:l}=[...u].reverse().reduce(({overflow:m,widths:p},w)=>{if(m<=0||w<=0)return{overflow:m,widths:[w,...p]};const I=Math.min(m,w);return{overflow:m-I,widths:[w-I,...p]}},{overflow:f-1,widths:[]});return l},De=(e,o)=>ee(e,o),At=(e,o)=>{const u=o.filter((f,l)=>l!==e).reduce((f,l)=>f+l,0);return Math.max(1-u,0)},Ne=(e,o)=>{const u=e.map(f=>o[f.widthKey]??0);return{resolved:ee(e.length,u),effective:De(e.length,u)}},Pn=(e,o,u,f,l,m,p)=>{const w=[];return o&&w.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:l,text:o}),u&&w.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:m,text:u}),f&&w.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:p,text:f}),w},Pt=(e,o)=>{const u=f=>{const l=_(o,f);return e[l]};return{fontFamily:u("fontFamily")??"Arial",fontSettings:u("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:u("fontSize"),lineHeight:u("lineHeight"),letterSpacing:u("letterSpacing")??0,wordSpacing:u("wordSpacing")??0,textAlign:u("textAlign")??"left",textAppearance:u("textAppearance"),color:e[Zn[o]]}},tr=(e,o,u,f)=>e.slice(0,f).reduce((l,m,p)=>l+(m!=null&&m.marginLeftKey?u[m.marginLeftKey]??0:0)+(o[p]??0),0),te=(e,o,u)=>{var l,m;const f={fontSettings:{fontFamily:o.fontFamily,fontWeight:((l=o.fontSettings)==null?void 0:l.fontWeight)??400,fontStyle:((m=o.fontSettings)==null?void 0:m.fontStyle)??"normal"},fontSize:o.fontSize??Jn[e],lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,wordSpacing:o.wordSpacing,textAlign:o.textAlign,textAppearance:o.textAppearance,color:o.color??"#ffffff"};return En.textStylesToCss(f,u)},er=({prefix:e,images:o,settings:u,isEditor:f,isEditMode:l,isPreviewMode:m,onClose:p})=>{const{backgroundColor:w,thumbnailSize:I,thumbnailGap:F,thumbnailMarginBottom:j,imageGap:K,closeIcon:L,closeIconMaxWidth:G,closeIconColor:E,closeIconHoverColor:Q,thumbnailTrigger:ne,thumbnailVisibility:Ct,thumbnailObjectFit:xt,thumbnailActive:He,thumbnailActiveColor:Xe,title1Width:jt,title2Width:re,title3Width:oe,title1MarginLeft:W=0,title2MarginLeft:ie=0,title3MarginLeft:se=0,titleRowMarginBottom:le=0,titleHeaderLayout:ae="desktop",contentMarginTop:Ge,iconMarginLeft:Ve}=u,P=t=>Rt.scalingValue(t,f??!1),Ye=I??u.thumnailSize??.03,ce=P(Ye),Mt=P(F),kt=P(j??.02),ct=P(K??0),ue=P(Ge??0),qe=Wt(ue),fe=P(Ve??0),[tt,_t]=a.useState(0),A=a.useRef(tt);A.current=tt;const Ue=o[tt],{title1:Et,title2:Nt,title3:Ot}=Ke(Ue),he=te("title1",Pt(u,"title1"),f),de=te("title2",Pt(u,"title2"),f),me=te("title3",Pt(u,"title3"),f),C=ae==="mobile",V=!l&&(!f||m),ut=V,ft=V,Ze=V,pe=J.isImageRatioCover(xt),Je=pe?{"--image-aspect-ratio":J.getAspectRatio(xt)}:void 0,ge=!!(Et||Nt||Ot),x=a.useMemo(()=>Pn(e,Et,Nt,Ot,he,de,me),[e,tt,Et,Nt,Ot,he,de,me]),et=a.useMemo(()=>({title1Width:jt,title2Width:re,title3Width:oe}),[jt,re,oe]),bt=a.useMemo(()=>x.map(t=>et[t.widthKey]),[x,et]),N=a.useMemo(()=>ee(x.length,bt),[x.length,bt]),xe=a.useMemo(()=>De(x.length,bt),[x.length,bt]),vt=a.useMemo(()=>x.filter(t=>t.prefix==="title1"),[x]),M=a.useMemo(()=>x.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[x]),yt=a.useMemo(()=>Ne(vt,et),[vt,et]),B=a.useMemo(()=>Ne(M,et),[M,et]),zt=a.useCallback((t,n)=>{const r=x.indexOf(t);if(!C||n==="single-row")return{effectiveWidth:xe[r]??0,resolvedWidth:N[r]??0,maxWidth:At(r,N)};if(n==="two-row-top"){const s=vt.indexOf(t);return{effectiveWidth:yt.effective[s]??0,resolvedWidth:yt.resolved[s]??0,maxWidth:At(s,yt.resolved)}}const i=M.indexOf(t);return{effectiveWidth:B.effective[i]??0,resolvedWidth:B.resolved[i]??0,maxWidth:At(i,B.resolved)}},[M,B,xe,N,x,vt,yt,C]),y=a.useCallback(t=>Rt.scalingValue(t,f??!1),[f]),Qe=y(le??0),k=a.useMemo(()=>({title1MarginLeft:W,title2MarginLeft:ie,title3MarginLeft:se}),[W,ie,se]),Pe=a.useCallback(t=>x.slice(0,t+1).reduce((n,r,i)=>n+(r!=null&&r.marginLeftKey?k[r.marginLeftKey]??0:0)+(N[i]??0),0)+(C?0:W??0),[x,k,N,C,W]),tn=a.useCallback(()=>C?0:W??0,[C,W]),Ft=a.useCallback(t=>M.slice(0,t).reduce((n,r,i)=>n+(r.marginLeftKey?k[r.marginLeftKey]??0:0)+(B.resolved[i]??0),0),[M,B.resolved,k]),en=a.useCallback(t=>{const n=M[t];return Ft(t)+(n.marginLeftKey?k[n.marginLeftKey]??0:0)+(B.resolved[t]??0)},[M,B.resolved,Ft,k]),Kt=(t,n)=>{const r=t.marginLeftKey?k[t.marginLeftKey]??0:0,{effectiveWidth:i,resolvedWidth:s,maxWidth:h}=zt(t,n),d=l&&n==="two-row-top";return c.jsxs("div",{className:`${e}-title-cell`,"data-title":t.prefix,style:{...n==="single-row"?{gridArea:t.prefix}:{},width:y(i),...r>0?{marginLeft:y(r)}:{}},children:[c.jsx("p",{className:t.className,style:t.style,children:t.text}),d&&t.marginLeftKey&&c.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s),style:{position:"absolute",top:0,left:y(-r),width:`max(${y(r)}, 10px)`,height:"100%",pointerEvents:"auto"}}),d&&c.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(h),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:y(-at/2),width:y(at),height:"100%",pointerEvents:"auto"}})]},t.className)},nn=()=>{const t=C?-1:x.findIndex(i=>i.prefix==="title1"),n=!C&&(l||(W??0)>0)?(()=>{const i=W??0,s=t>=0?N[t]:jt??0;return c.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s),style:{position:"absolute",top:0,left:0,width:`max(${y(i)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,r=x.flatMap((i,s)=>{if(!i.marginLeftKey)return[];const h=k[i.marginLeftKey]??0,d=tr(x,N,k,s)+tn();return c.jsx("div",{"data-controls":i.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(N[s]),style:{position:"absolute",top:0,left:y(d),width:`max(${y(h)}, 10px)`,height:"100%",pointerEvents:"auto"}},i.marginLeftKey)});return n?[n,...r]:r},rn=()=>x.map((t,n)=>{const r=At(n,N),s=Pe(n)-at/2;return c.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:c.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(r),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:y(s),width:y(at),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),on=()=>M.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const r=k[t.marginLeftKey]??0,i=Ft(n),{resolvedWidth:s}=zt(t,"two-row-bottom");return c.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s),style:{position:"absolute",top:0,left:y(i),width:`max(${y(r)}, 10px)`,height:"100%",pointerEvents:"auto"}},t.marginLeftKey)}),sn=()=>M.map((t,n)=>{const{maxWidth:r}=zt(t,"two-row-bottom"),s=en(n)-at/2;return c.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:c.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(r),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:y(s),width:y(at),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),ln=a.useRef(null),b=a.useRef(null),Bt=a.useRef(null),be=a.useRef(null),wt=a.useRef([]),S=a.useRef([]),nt=a.useRef(0),St=a.useRef(null),v=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),ht=a.useRef(null),rt=a.useRef(null),Dt=a.useRef(0),Ht=a.useRef("forward"),D=a.useRef(0),H=a.useRef(null),Y=a.useRef(!1),$=o.length>1&&(!l||!!m),Xt=$?3:1,an=a.useMemo(()=>Array.from({length:Xt},()=>o).flat(),[o,Xt]),[cn,ve]=a.useState(!1),[ye,we]=a.useState(!1),[un,Gt]=a.useState(!0),q=a.useRef(null),ot=a.useRef(null),Vt=a.useRef(!1),Se=a.useRef(!1),Yt=a.useRef(null),U=a.useRef(null),Le=ut&&!un,O=a.useCallback(()=>{ut&&(Gt(!0),U.current&&clearTimeout(U.current),U.current=setTimeout(()=>{v.current.isActive||Gt(!1)},Hn))},[ut]),dt=a.useCallback(()=>{l||Se.current||(Se.current=!0,we(!1),Yt.current=setTimeout(()=>{p()},gt))},[l,p]),$e=()=>c.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Le?"true":"false",style:{width:Rt.scalingValue(G??0,f),height:Rt.scalingValue(G??0,f),marginRight:fe,"--close-icon-hover-color":Q},children:[c.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:dt,"aria-label":"Close",children:c.jsx(kn.SvgImage,{url:L,fill:E,hoverFill:f&&!m?E:Q,className:`${e}-close-icon-img`})}),l&&c.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:fe,height:"100%",pointerEvents:"auto"}})]}),Te=(t="two-row")=>c.jsx("div",{...t==="two-row"&&l?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:y(W??0),flexShrink:0,...t==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...t==="two-row"&&l?{pointerEvents:"auto"}:{}}}),fn=()=>{const t=x.find(i=>i.prefix==="title1"),n=x.filter(i=>i.prefix==="title2"||i.prefix==="title3"),r=n.length>0||l||(le??0)>0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`${e}-header-row-top`,children:[(W??0)>0||l?Te():null,t&&Kt(t,"two-row-top"),L&&$e()]}),r?c.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[n.length>0?c.jsxs("div",{className:`${e}-header-row-bottom`,children:[n.map(i=>Kt(i,"two-row-bottom")),l&&c.jsxs(c.Fragment,{children:[on(),sn()]})]}):null,c.jsx("div",{"data-controls":l?"titleRowMarginBottom":void 0,"data-controls-axis":l?"y":void 0,"data-controls-reverse":l?"":void 0,className:l?`${e}-control`:void 0,style:{height:Qe,width:"100%",flexShrink:0,pointerEvents:l?"auto":"none"}})]}):null]})},hn=()=>c.jsxs(c.Fragment,{children:[(W??0)>0||l?Te("single-row"):null,x.map(t=>Kt(t,"single-row")),l?c.jsxs(c.Fragment,{children:[nn(),rn()]}):null,L?$e():null]}),qt=a.useCallback(t=>!!(t.closest("[data-controls]")||t.closest(`.${e}-thumbnails`)||t.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:dn,backdropStyle:mn,mediaAreaStyle:pn,overlayContentStyle:gn,swipeHandlers:xn,dismissAreaStyle:bn}=J.useLightboxSwipeDismiss({enabled:V??!1,onClose:dt,animMs:gt,isBlockedTarget:qt}),Ut=()=>{if(!$||o.length===0)return nt.current=0,0;const t=S.current[0],n=S.current[o.length];if(!t||!n)return nt.current;const r=n.offsetLeft-t.offsetLeft;return r>0&&(nt.current=r),nt.current},Z=(t=!1)=>{if(!$)return;const n=b.current,r=Ut();!n||r<=0||r<n.clientWidth*.25||(n.scrollLeft<=0?(n.scrollLeft+=r,t&&(v.current.scrollLeft+=r),Y.current&&(D.current+=r)):n.scrollLeft>=r*2&&(n.scrollLeft-=r,t&&(v.current.scrollLeft-=r),Y.current&&(D.current-=r)))},Re=(t,n=(r=>(r=b.current)==null?void 0:r.scrollLeft)()??0)=>{if(!$)return t;let i=o.length+t,s=1/0;for(let h=0;h<Xt;h++){const d=h*o.length+t,g=S.current[d];if(!g)continue;const T=Math.abs(g.offsetLeft-n);T<s&&(s=T,i=d)}return i},Ie=t=>{const n=b.current;return!t||!n?!1:t.offsetWidth>n.clientWidth+1},Zt=t=>{const n=b.current;if(!t||!n||!Ie(t))return!1;const r=t.offsetLeft,i=r+t.offsetWidth;return n.scrollLeft>=r-1&&n.scrollLeft+n.clientWidth<=i+1},it=(t=(n=>(n=b.current)==null?void 0:n.scrollLeft)()??0)=>{for(let i=0;i<S.current.length;i+=1){const s=S.current[i];if(s&&Zt(s))return i}let r={flatIndex:0,distance:1/0};return S.current.forEach((i,s)=>{if(!i)return;const h=Math.abs(i.offsetLeft-t);h<r.distance&&(r={flatIndex:s,distance:h})}),r.flatIndex},We=t=>{b.current&&S.current.forEach(n=>{n&&(n.style.scrollSnapAlign=Ie(n)&&t==="backward"?"end":"start")})},vn=(t,n,r)=>{const i=t-n,s=it(n),h=S.current[s];if(Zt(h))return it(t)%o.length;const d=S.current[s+1],g=h?d?d.offsetLeft-h.offsetLeft:h.offsetWidth:0,T=g>0?i>g*It?1:i<-g*It?-1:0:0;return T===0?r:$?(r+T+o.length)%o.length:Math.max(0,Math.min(o.length-1,r+T))},Ae=a.useCallback((t=!1)=>{if(Ct!=="on"||l)return;const n=be.current,r=A.current,i=wt.current[r];if(!n||!i||n.scrollWidth<=n.clientWidth)return;const s=n.scrollLeft,h=s+n.clientWidth,d=i.offsetLeft,g=d+i.offsetWidth;if(d>=s&&g<=h)return;const T=n.scrollWidth-n.clientWidth;let R=s;if(!t&&q.current===null){const lt=wt.current[r-1],pt=wt.current[r+1],Tt=lt?i.offsetLeft-lt.offsetLeft:pt?pt.offsetLeft-i.offsetLeft:i.offsetWidth;g>h?R+=Tt:d<s&&(R-=Tt)}else g>h?R=g-n.clientWidth:R=d;n.scrollLeft=Math.max(0,Math.min(T,R))},[l,Ct]),Jt=a.useCallback((t=!1)=>{t&&(Vt.current=!0),ot.current===null&&(ot.current=requestAnimationFrame(()=>{ot.current=null;const n=Vt.current;Vt.current=!1,Ae(n)}))},[Ae]),yn=a.useCallback(t=>{if(t===A.current)return;const n=A.current;A.current=t;const r=Math.abs(t-n)>1,i=$&&o.length>1&&(n===o.length-1&&t===0||n===0&&t===o.length-1);_t(t),Jt(r||i)},[o.length,$,Jt]),z=()=>{if(!b.current||o.length===0||q.current!==null||v.current.isActive&&v.current.hasMoved)return;const t=b.current.scrollLeft,n=it(t)%o.length;n!==A.current&&yn(n)},wn=()=>{q.current=null},X=t=>{const n=b.current;n&&(n.style.scrollSnapType=t?"":"none")},mt=()=>{var t;(t=rt.current)==null||t.call(rt),rt.current=null},Lt=()=>{H.current!==null&&(cancelAnimationFrame(H.current),H.current=null),Y.current=!1},Ce=()=>{const t=b.current;if(!t){H.current=null,Y.current=!1;return}const n=D.current-t.scrollLeft;if(Math.abs(n)<.5){t.scrollLeft=D.current,Z(),z(),H.current=null,Y.current=!1;return}t.scrollLeft+=n*Vn,Z(),z(),O(),H.current=requestAnimationFrame(Ce)},je=()=>{const t=Bt.current;t&&(t.style.transition="",t.style.transform="",t.style.willChange="")},Me=(t,n,r,i)=>{je(),t.scrollLeft=n,Dt.current=t.scrollLeft,Z(),r!==void 0?(A.current=r,_t(r)):z(),X(!0),i==null||i()},ke=(t,{behavior:n="smooth",activeIndex:r,onComplete:i}={})=>{const s=b.current,h=Bt.current;if(!s||!h)return;if(Lt(),mt(),X(!1),n==="auto"){Me(s,t,r,i);return}const d=Math.abs(t-s.scrollLeft),g=Nn(d,Kn,Bn,s.clientWidth*.55);rt.current=Fn(s,h,t,{duration:g,easing:Dn,onComplete:()=>{rt.current=null,Me(s,t,r,i)}})},Sn=(t="smooth")=>{const n=b.current;if(!n||o.length===0)return;const r=it()%o.length,i=Re(r,n.scrollLeft),s=S.current[i];s&&ke(s.offsetLeft,{behavior:t,activeIndex:r})},Ln=(t,n="smooth",r,i)=>{const s=b.current;if(!s||o.length===0)return;const h=(i??s.scrollLeft)-t,d=it(t),g=S.current[d];if(Zt(g)){X(!0),z();return}const T=S.current[d+1],R=g?T?T.offsetLeft-g.offsetLeft:g.offsetWidth:0;if((R>0?h>R*It?1:h<-R*It?-1:0:0)!==0){const An=r??d%o.length,Cn=vn(i??s.scrollLeft,t,An);st(Cn,n);return}const pt=i??s.scrollLeft,Tt=it(pt),Ee=S.current[Tt];if(Ee&&Math.abs(Ee.offsetLeft-pt)<1){X(!0),z();return}Sn("auto")},st=(t,n="smooth")=>{const r=b.current;if(!r||o.length===0)return;const i=Re(t,r.scrollLeft),s=S.current[i];s&&(n==="smooth"?q.current=t:q.current=null,A.current=t,_t(t),Jt(!0),ke(s.offsetLeft,{behavior:n,activeIndex:t,onComplete:n==="smooth"?wn:void 0}))},Qt=()=>{ht.current&&(window.removeEventListener("pointerup",ht.current),window.removeEventListener("pointercancel",ht.current),ht.current=null)},$n=(t,n,r,i,s)=>{const h=r-t,d=i-n,g=Math.abs(h),T=Math.abs(d);if(g<qn||g<=T)return!1;const R=h<0?1:-1,lt=$?(s+R+o.length)%o.length:Math.max(0,Math.min(o.length-1,s+R));return lt===s?!1:(st(lt),!0)},$t=t=>{if(!v.current.isActive)return;Qt();const n=b.current;if(!n)return;const{scrollLeft:r,startActiveIndex:i,hasMoved:s}=v.current,h=n.scrollLeft;Z(!0),v.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ve(!1),t!==void 0&&n.hasPointerCapture(t)&&n.releasePointerCapture(t),s?Ln(r,"smooth",i,h):(X(!0),z()),O()},Tn=(t,n)=>{const r=St.current;St.current=null,r&&($n(r.startX,r.startY,t,n,r.startActiveIndex),O())},Rn=t=>{if(!ft)return;if(t.pointerType==="touch"){if(Lt(),X(!0),qt(t.target))return;St.current={startX:t.clientX,startY:t.clientY,startActiveIndex:A.current};return}if(t.pointerType!=="mouse"||t.button!==0||qt(t.target))return;const n=b.current;if(!n)return;Lt(),mt(),je(),q.current=null,v.current={isActive:!0,startX:t.clientX,scrollLeft:n.scrollLeft,startActiveIndex:A.current,hasMoved:!1},X(!1),O(),n.setPointerCapture(t.pointerId),Qt();const r=i=>{i.pointerType==="mouse"&&$t(i.pointerId)};ht.current=r,window.addEventListener("pointerup",r),window.addEventListener("pointercancel",r)},In=t=>{if(!ft||t.pointerType!=="mouse")return;const n=b.current;if(!n||!v.current.isActive)return;if(t.buttons===0){$t(t.pointerId);return}const r=t.clientX-v.current.startX;Math.abs(r)>Yn&&(v.current.hasMoved=!0,ve(!0)),v.current.hasMoved&&(t.preventDefault(),n.scrollLeft=v.current.scrollLeft-r,Z(!0),z(),O())},_e=t=>{if(ft){if(t.pointerType==="touch"){t.type==="pointerup"?Tn(t.clientX,t.clientY):St.current=null;return}t.pointerType==="mouse"&&$t(t.pointerId)}},Wn=t=>{!ft||t.pointerType!=="mouse"||$t(t.pointerId)};return _n.useLightboxScrollLock(),a.useEffect(()=>{const t=requestAnimationFrame(()=>we(!0));return()=>{cancelAnimationFrame(t),mt(),Qt(),ot.current!==null&&(cancelAnimationFrame(ot.current),ot.current=null),Yt.current&&clearTimeout(Yt.current),U.current&&clearTimeout(U.current)}},[]),a.useEffect(()=>{if(!ut){Gt(!0);return}O();const t=()=>O();return document.addEventListener("pointermove",t,{passive:!0}),document.addEventListener("pointerdown",t,{passive:!0}),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerdown",t),U.current&&clearTimeout(U.current)}},[ut,O]),a.useEffect(()=>{const t=n=>{n.key==="Escape"&&dt()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[dt]),a.useLayoutEffect(()=>{Ut()},[ct,o.length,$]),a.useLayoutEffect(()=>{l||st(A.current,"auto")},[ct,l]),a.useLayoutEffect(()=>{st(0,"auto")},[o.length,$]),a.useEffect(()=>{const t=b.current;if(!t||l||!V)return;const n=r=>{if(r.preventDefault(),Math.abs(r.deltaY)<=Math.abs(r.deltaX))return;const i=r.deltaMode===1?Gn:r.deltaMode===2?t.clientHeight:1,s=r.deltaY*i*Xn;if(s!==0){if(mt(),Y.current||(Y.current=!0,D.current=t.scrollLeft,q.current=null,X(!1)),D.current+=s,!$){const h=t.scrollWidth-t.clientWidth;D.current=Math.max(0,Math.min(h,D.current))}O(),H.current===null&&(H.current=requestAnimationFrame(Ce))}};return t.addEventListener("wheel",n,{passive:!1}),()=>{t.removeEventListener("wheel",n),Lt()}},[l,V,$]),a.useEffect(()=>{const t=b.current;if(!t)return;const n=()=>{Z(v.current.isActive);const i=t.scrollLeft,s=i-Dt.current;Dt.current=i;const h=nt.current>0?nt.current*.5:1/0;if(s!==0&&Math.abs(s)<h){const d=s>0?"forward":"backward";d!==Ht.current&&(Ht.current=d,We(d))}v.current.isActive&&v.current.hasMoved||z()};t.addEventListener("scroll",n,{passive:!0});const r=new ResizeObserver(()=>{Ut(),Z(v.current.isActive),We(Ht.current),z()});return r.observe(t),()=>{mt(),t.removeEventListener("scroll",n),r.disconnect()}},[o.length,$]),c.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${f?` ${e}-lightbox-editor`:""}${l?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{dn||dt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:ye?1:0,transition:`opacity ${gt}ms ease`,pointerEvents:ye?"auto":"none"},children:[c.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:w,...mn}}),c.jsxs("div",{ref:ln,className:`${e}-lightbox-dismiss-area`,style:bn,...xn,children:[c.jsx("div",{className:`${e}-lightbox-content`,style:pn,onClick:t=>t.stopPropagation(),children:c.jsx("div",{ref:b,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":ft&&o.length>0?"true":"false","data-mouse-dragging":cn?"true":"false",onPointerDown:Rn,onPointerMove:In,onPointerUp:_e,onPointerCancel:_e,onLostPointerCapture:Wn,children:c.jsx("div",{ref:Bt,className:`${e}-lightbox-strip-track`,style:{gap:ct},children:an.map((t,n)=>{const r=t.image.objectFit??"contain",i=n%o.length,s=Math.floor(n/o.length),h=Wt(ct),d=`calc(-0.5 * (${h} + ${ct}))`;return c.jsxs("div",{ref:g=>S.current[n]=g,className:`${e}-strip-item`,style:{height:ae==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[c.jsx("img",{src:t.image.assetId,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:r}}),l&&i<o.length-1&&s===0&&c.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:d,width:h,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${s}-${t.image.assetId}-${i}`)})})})}),c.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":Le?"true":"false",style:gn,children:[c.jsx("div",{style:{position:"relative",width:"100%",height:ue,flexShrink:0,pointerEvents:"none"},children:l&&c.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:qe,pointerEvents:"auto",zIndex:3}})}),c.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:c.jsx("div",{className:`${e}-lightbox-content-area${C?` ${e}-lightbox-content-area-stacked`:""}`,children:(ge||L)&&c.jsx("div",{className:`${e}-header ${C?`${e}-header-two-row`:`${e}-header-single-row`}`,children:C?fn():ge||L?hn():null})})})]}),o.length>1&&Ct==="on"&&(()=>{const t=Wt(kt),n=`calc(-0.5 * (${kt} + ${t}))`;return c.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:kt},children:c.jsx("div",{ref:be,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:r=>r.stopPropagation(),children:c.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":He,style:{gap:Mt,"--thumbnail-active-color":Xe},children:[o.map((r,i)=>{const s=Wt(Mt),h=`calc(-0.5 * (${s} + ${Mt}))`;return c.jsxs("div",{ref:d=>{wt.current[i]=d},style:{position:"relative",flex:"0 0 auto"},children:[c.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":tt===i?"true":"false",onClick:()=>V&&ne==="click"&&st(i),onMouseEnter:()=>Ze&&ne==="hover"&&st(i),"aria-label":r.image.name?`View ${r.image.name}`:`View image ${i+1}`,"aria-current":tt===i?"true":void 0,children:c.jsx("img",{className:`${e}-thumb-image${pe?` ${e}-thumb-image-cover`:""}`,src:r.image.assetId,alt:"",draggable:!1,style:{...Je,maxWidth:ce,maxHeight:ce,width:xt.display==="cover"?"auto":"100%",height:"auto",objectFit:xt.display==="cover"?"cover":"contain"}})}),l&&i<o.length-1&&c.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:h,width:s,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${r.image.assetId}-${i}`)}),l&&c.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":l?"":void 0,style:{position:"absolute",left:0,right:0,bottom:n,height:t,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function nr(e){return`
2
2
  .${e}-wrapper {
3
3
  position: relative;
4
4
  width: 100%;
@@ -4,7 +4,7 @@ import { createPortal as kn } from "react-dom";
4
4
  import { u as On } from "./useScopedStyles-DhBG3557.mjs";
5
5
  import { i as Ot, g as je, u as zn } from "./useLightboxSwipeDismiss-SGv6Ra33.mjs";
6
6
  import { s as Mt } from "./scalingValue-C9JH5L6O.mjs";
7
- import { S as En } from "./SvgImage-CwRq9-ec.mjs";
7
+ import { S as En } from "./SvgImage-B5mR9y6q.mjs";
8
8
  import { u as Kn } from "./useLightboxScrollLock-VQ07s7EJ.mjs";
9
9
  import { t as Fn } from "./textStylesToCss-05Mn6I_2.mjs";
10
10
  const Bn = (e, o, a, c) => {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),a=require("react"),_e=require("react-dom"),lt=require("./scalingValue-CSHYgTZl.js"),Be=require("./buildColorVars-CE2D5cQV.js"),Ge=require("./useScopedStyles-Bf6yohVQ.js"),gt=require("./EmbedMediaFrame-DsOTKE4i.js"),bt=require("./textStylesToCss-CNN3zZTV.js"),qe=require("./SvgImage-_QN8ngad.js"),Ke=require("./LazyVideo-imbU18js.js"),wt=300/1440,Ue=8/1440,rt=.004;function Xe(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function Pt(t,e,o,r){return e!==void 0&&e<(t??.01)?`${o} ${r}`:o}function te(t,e,o,r,l="title-leading-gap"){const c=t??.01;return e===void 0||e>=c?{}:{[`--${o}-${l}`]:lt.scalingValue((c-e)/2,r)}}function Ye(t){return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),a=require("react"),_e=require("react-dom"),lt=require("./scalingValue-CSHYgTZl.js"),Be=require("./buildColorVars-CE2D5cQV.js"),Ge=require("./useScopedStyles-Bf6yohVQ.js"),gt=require("./EmbedMediaFrame-DsOTKE4i.js"),bt=require("./textStylesToCss-CNN3zZTV.js"),qe=require("./SvgImage-DFlmxAoL.js"),Ke=require("./LazyVideo-imbU18js.js"),wt=300/1440,Ue=8/1440,rt=.004;function Xe(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function Pt(t,e,o,r){return e!==void 0&&e<(t??.01)?`${o} ${r}`:o}function te(t,e,o,r,l="title-leading-gap"){const c=t??.01;return e===void 0||e>=c?{}:{[`--${o}-${l}`]:lt.scalingValue((c-e)/2,r)}}function Ye(t){return`
2
2
  .${t}-wrapper {
3
3
  box-sizing: border-box;
4
4
  display: flex;
@@ -6,7 +6,7 @@ import { b as Qe } from "./buildColorVars-CLyWQm5K.mjs";
6
6
  import { u as Pe } from "./useScopedStyles-DhBG3557.mjs";
7
7
  import { i as ae, E as Ae, g as tn, a as en } from "./EmbedMediaFrame-DwHeOAy5.mjs";
8
8
  import { o as ne, t as oe } from "./textStylesToCss-05Mn6I_2.mjs";
9
- import { S as nn } from "./SvgImage-CwRq9-ec.mjs";
9
+ import { S as nn } from "./SvgImage-B5mR9y6q.mjs";
10
10
  import { L as on } from "./LazyVideo-CdAWymKO.mjs";
11
11
  const Tt = 300 / 1440, rn = 8 / 1440, ct = 4e-3;
12
12
  function ln(t) {
@@ -5,7 +5,7 @@ import { b as Lo } from "./buildColorVars-CLyWQm5K.mjs";
5
5
  import { g as D } from "./formFieldValidation-DvihFrq5.mjs";
6
6
  import { u as Mo } from "./useScopedStyles-DhBG3557.mjs";
7
7
  import { o as A, t as L } from "./textStylesToCss-05Mn6I_2.mjs";
8
- import { S as No } from "./SvgImage-CwRq9-ec.mjs";
8
+ import { S as No } from "./SvgImage-B5mR9y6q.mjs";
9
9
  function k(o) {
10
10
  return `calc(var(--cntrl-article-width, 100vw) * ${o / 1440})`;
11
11
  }
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),C=require("react"),l=require("./scalingValue-CSHYgTZl.js"),Vo=require("./buildColorVars-CE2D5cQV.js"),U=require("./formFieldValidation-DZl2KVaF.js"),Wo=require("./useScopedStyles-Bf6yohVQ.js"),m=require("./textStylesToCss-CNN3zZTV.js"),jo=require("./SvgImage-_QN8ngad.js");function k(o){return`calc(var(--cntrl-article-width, 100vw) * ${o/1440})`}function zo(o){return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),C=require("react"),l=require("./scalingValue-CSHYgTZl.js"),Vo=require("./buildColorVars-CE2D5cQV.js"),U=require("./formFieldValidation-DZl2KVaF.js"),Wo=require("./useScopedStyles-Bf6yohVQ.js"),m=require("./textStylesToCss-CNN3zZTV.js"),jo=require("./SvgImage-DFlmxAoL.js");function k(o){return`calc(var(--cntrl-article-width, 100vw) * ${o/1440})`}function zo(o){return`
2
2
  .${o}-wrapper {
3
3
  display: flex;
4
4
  flex-direction: column;
@@ -1,6 +1,6 @@
1
1
  import { jsx as c, jsxs as x, Fragment as R } from "react/jsx-runtime";
2
2
  import { useMemo as po } from "react";
3
- import { S as uo } from "./SvgImage-CwRq9-ec.mjs";
3
+ import { S as uo } from "./SvgImage-B5mR9y6q.mjs";
4
4
  import { s as t } from "./scalingValue-C9JH5L6O.mjs";
5
5
  import { b as mo } from "./buildColorVars-CLyWQm5K.mjs";
6
6
  import { u as xo } from "./useScopedStyles-DhBG3557.mjs";
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),bo=require("react"),uo=require("./SvgImage-_QN8ngad.js"),t=require("./scalingValue-CSHYgTZl.js"),po=require("./buildColorVars-CE2D5cQV.js"),xo=require("./useScopedStyles-Bf6yohVQ.js"),Y=require("./textStylesToCss-CNN3zZTV.js"),go={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},mo=["hover","active"],N={left:"flex-start",center:"center",right:"flex-end"};function wo(o,e){const a=o.currentTarget,l=a.getBoundingClientRect(),c=o.clientY-l.top>l.height/2;a.classList.toggle(`${e}-reveal-from-bottom`,c)}function yo(o,e){const a=o.currentTarget,l=a.getBoundingClientRect(),c=o.clientY<l.top+l.height/2;a.classList.toggle(`${e}-reveal-from-bottom`,c)}function ko(o){const e=`var(--${o}-box-shadow-x, 0) var(--${o}-box-shadow-y, 0) var(--${o}-box-shadow-blur, 0) var(--${o}-box-shadow-spread, 0) var(--${o}-box-shadow-color, transparent)`,a=`inset var(--${o}-inner-box-shadow-x, 0) var(--${o}-inner-box-shadow-y, 0) var(--${o}-inner-box-shadow-blur, 0) var(--${o}-inner-box-shadow-spread, 0) var(--${o}-inner-box-shadow-color, transparent)`,l=`${e}, ${a}`,c=`var(--${o}-box-shadow-x, 0) var(--${o}-box-shadow-y, 0) var(--${o}-box-shadow-blur, 0) var(--${o}-box-shadow-spread, 0) var(--${o}-hover-box-shadow-color, var(--${o}-box-shadow-color, transparent))`,r=`inset var(--${o}-inner-box-shadow-x, 0) var(--${o}-inner-box-shadow-y, 0) var(--${o}-inner-box-shadow-blur, 0) var(--${o}-inner-box-shadow-spread, 0) var(--${o}-hover-inner-box-shadow-color, var(--${o}-inner-box-shadow-color, transparent))`,$=`${c}, ${r}`,s=`var(--${o}-box-shadow-x, 0) var(--${o}-box-shadow-y, 0) var(--${o}-box-shadow-blur, 0) var(--${o}-box-shadow-spread, 0) var(--${o}-active-box-shadow-color, var(--${o}-box-shadow-color, transparent))`,h=`inset var(--${o}-inner-box-shadow-x, 0) var(--${o}-inner-box-shadow-y, 0) var(--${o}-inner-box-shadow-blur, 0) var(--${o}-inner-box-shadow-spread, 0) var(--${o}-active-inner-box-shadow-color, var(--${o}-inner-box-shadow-color, transparent))`,p=`${s}, ${h}`,g=`0 4px 12px rgba(0, 0, 0, 0.15), ${a}`,C=`.${o}-button:focus-visible, a:focus-visible .${o}-button`,V=`.${o}-button:hover, ${C}`,v=f=>`.${o}-hover-effect-${f}:hover, .${o}-hover-effect-${f}:focus-visible, a:focus-visible .${o}-hover-effect-${f}`;return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),bo=require("react"),uo=require("./SvgImage-DFlmxAoL.js"),t=require("./scalingValue-CSHYgTZl.js"),po=require("./buildColorVars-CE2D5cQV.js"),xo=require("./useScopedStyles-Bf6yohVQ.js"),Y=require("./textStylesToCss-CNN3zZTV.js"),go={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},mo=["hover","active"],N={left:"flex-start",center:"center",right:"flex-end"};function wo(o,e){const a=o.currentTarget,l=a.getBoundingClientRect(),c=o.clientY-l.top>l.height/2;a.classList.toggle(`${e}-reveal-from-bottom`,c)}function yo(o,e){const a=o.currentTarget,l=a.getBoundingClientRect(),c=o.clientY<l.top+l.height/2;a.classList.toggle(`${e}-reveal-from-bottom`,c)}function ko(o){const e=`var(--${o}-box-shadow-x, 0) var(--${o}-box-shadow-y, 0) var(--${o}-box-shadow-blur, 0) var(--${o}-box-shadow-spread, 0) var(--${o}-box-shadow-color, transparent)`,a=`inset var(--${o}-inner-box-shadow-x, 0) var(--${o}-inner-box-shadow-y, 0) var(--${o}-inner-box-shadow-blur, 0) var(--${o}-inner-box-shadow-spread, 0) var(--${o}-inner-box-shadow-color, transparent)`,l=`${e}, ${a}`,c=`var(--${o}-box-shadow-x, 0) var(--${o}-box-shadow-y, 0) var(--${o}-box-shadow-blur, 0) var(--${o}-box-shadow-spread, 0) var(--${o}-hover-box-shadow-color, var(--${o}-box-shadow-color, transparent))`,r=`inset var(--${o}-inner-box-shadow-x, 0) var(--${o}-inner-box-shadow-y, 0) var(--${o}-inner-box-shadow-blur, 0) var(--${o}-inner-box-shadow-spread, 0) var(--${o}-hover-inner-box-shadow-color, var(--${o}-inner-box-shadow-color, transparent))`,$=`${c}, ${r}`,s=`var(--${o}-box-shadow-x, 0) var(--${o}-box-shadow-y, 0) var(--${o}-box-shadow-blur, 0) var(--${o}-box-shadow-spread, 0) var(--${o}-active-box-shadow-color, var(--${o}-box-shadow-color, transparent))`,h=`inset var(--${o}-inner-box-shadow-x, 0) var(--${o}-inner-box-shadow-y, 0) var(--${o}-inner-box-shadow-blur, 0) var(--${o}-inner-box-shadow-spread, 0) var(--${o}-active-inner-box-shadow-color, var(--${o}-inner-box-shadow-color, transparent))`,p=`${s}, ${h}`,g=`0 4px 12px rgba(0, 0, 0, 0.15), ${a}`,C=`.${o}-button:focus-visible, a:focus-visible .${o}-button`,V=`.${o}-button:hover, ${C}`,v=f=>`.${o}-hover-effect-${f}:hover, .${o}-hover-effect-${f}:focus-visible, a:focus-visible .${o}-hover-effect-${f}`;return`
2
2
  .${o}-root {
3
3
  line-height: 0;
4
4
  }