@cntrl-site/components 1.0.118-alpha.4 → 1.0.118-alpha.9
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.
- package/dist/{Burger-DyORh_vF.mjs → Burger-C8JIQQwm.mjs} +330 -307
- package/dist/Burger-C_SjPZWp.js +669 -0
- package/dist/{ChroniclesComponent-DVoJ0kdT.mjs → ChroniclesComponent-Bf8jxaas.mjs} +512 -442
- package/dist/ChroniclesComponent-XAHXrzRb.js +1 -0
- package/dist/Components/Burger/Burger.d.ts +4 -2
- package/dist/Components/Grid/CustomGridComponent.d.ts +41 -0
- package/dist/Components/Grid/Grid.d.ts +27 -7
- package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +0 -7
- package/dist/{ControlSlider-3w-bHQEg.mjs → ControlSlider-BBAXRDLP.mjs} +3 -4
- package/dist/ControlSlider-BCkVFl4w.js +1 -0
- package/dist/{FAQ-GmiwRdFq.mjs → FAQ-CJHCMSBa.mjs} +1 -1
- package/dist/{FAQ-7HEkaoU6.js → FAQ-DLh63Utr.js} +1 -1
- package/dist/Grid-Dwn03N-q.mjs +1853 -0
- package/dist/Grid-pyPdnAeI.js +445 -0
- package/dist/{Hive-34KvKNsa.js → Hive-CzabuuCc.js} +1 -1
- package/dist/{Hive-7xHXyMM1.mjs → Hive-DyxYd5eg.mjs} +1 -1
- package/dist/{HiveLightboxTitles-BCoL46-V.mjs → HiveLightboxTitles-DhEeFKWs.mjs} +1 -1
- package/dist/{HiveLightboxTitles-DEeyQGcf.js → HiveLightboxTitles-DlyptAaK.js} +1 -1
- package/dist/{Lightbox-DzPqgKP4.mjs → Lightbox-BY99NS14.mjs} +1 -1
- package/dist/{Lightbox-Cb7lyaNt.js → Lightbox-DZckgBzK.js} +1 -1
- package/dist/{LightboxJournal-DisD2DLv.mjs → LightboxJournal-BDUs6T0B.mjs} +1 -1
- package/dist/{LightboxJournal-B-vul_be.js → LightboxJournal-Bf_rZzmz.js} +1 -1
- package/dist/{LightboxStrip-wCHUhAqN.mjs → LightboxStrip-Cuhb2fIR.mjs} +1 -1
- package/dist/{LightboxStrip-YDyEPEb6.js → LightboxStrip-RA4ABUC-.js} +1 -1
- package/dist/{Mercury-BmhtFYOw.js → Mercury-B-s2Kvuq.js} +1 -1
- package/dist/{Mercury-Q788wrYQ.mjs → Mercury-CCW0Es-s.mjs} +1 -1
- package/dist/{OnelinerForm-D8WIB9Qy.mjs → OnelinerForm-BEu7_sho.mjs} +1 -1
- package/dist/{OnelinerForm-CUmY-bXL.js → OnelinerForm-C2Y_XMCY.js} +1 -1
- package/dist/{SimpleButton-DTpzfmb6.mjs → SimpleButton-C-o2W9bS.mjs} +1 -1
- package/dist/{SimpleButton-DtaCYa3y.js → SimpleButton-nGEcO2gB.js} +1 -1
- package/dist/{Slider20-q0iGgnE3.js → Slider20-BOmjDRf2.js} +1 -1
- package/dist/{Slider20-CKngROrc.mjs → Slider20-DUi6qwnd.mjs} +1 -1
- package/dist/SvgImage-B5mR9y6q.mjs +51 -0
- package/dist/SvgImage-DFlmxAoL.js +1 -0
- package/dist/{TestimonialSingle-CpEUendN.js → TestimonialSingle-BORQom3u.js} +1 -1
- package/dist/{TestimonialSingle-Bax71Hyo.mjs → TestimonialSingle-DrnyReim.mjs} +1 -1
- package/dist/{Waterfall-znaoynn5.mjs → Waterfall-3kKioKh2.mjs} +1 -1
- package/dist/{Waterfall-B9YWMhrg.js → Waterfall-DII4-WV5.js} +1 -1
- package/dist/{components-eK82xypT.mjs → components-IX-rNSn-.mjs} +30 -653
- package/dist/components-QVeWZKot.js +1 -0
- package/dist/components.css +1 -1
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +24 -24
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +36 -63
- package/dist/loadSvgMaskUrl-DfF7ay6h.js +1 -0
- package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +20 -0
- package/dist/sources.js +676 -244
- package/dist/sources.mjs +717 -284
- package/dist/types/Component.d.ts +0 -7
- package/dist/types/SchemaV1.d.ts +0 -3
- package/package.json +1 -1
- package/dist/Burger-B4kXX9aY.js +0 -669
- package/dist/ChroniclesComponent-Nm_yIRmr.js +0 -1
- package/dist/Components/PopupMenu/PopupMenu.d.ts +0 -73
- package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +0 -594
- package/dist/Components/PopupMenu/popupMenuLayout.d.ts +0 -203
- package/dist/Components/PopupMenu/popupMenuSnap.d.ts +0 -61
- package/dist/ControlSlider-DB4nbVLT.js +0 -1
- package/dist/Grid-BuRdth9A.mjs +0 -1622
- package/dist/Grid-tqSSYh2-.js +0 -408
- package/dist/PopupMenu-CYdDyzEt.mjs +0 -1372
- package/dist/PopupMenu-Di1fHgho.js +0 -409
- package/dist/SvgImage-CwRq9-ec.mjs +0 -56
- package/dist/SvgImage-_QN8ngad.js +0 -1
- package/dist/components-BYoTPJk3.js +0 -1
- package/dist/loadSvgMaskUrl-B6kHUyof.js +0 -1
- package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +0 -39
|
@@ -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 Bi, createPortal as Ki } from "react-dom";
|
|
|
4
4
|
import { u as ji } from "./useScopedStyles-DhBG3557.mjs";
|
|
5
5
|
import { u as Oi, i as Tt, g as ti } from "./useLightboxSwipeDismiss-SGv6Ra33.mjs";
|
|
6
6
|
import { s as ye } from "./scalingValue-C9JH5L6O.mjs";
|
|
7
|
-
import { S as Ai } from "./SvgImage-
|
|
7
|
+
import { S as Ai } from "./SvgImage-B5mR9y6q.mjs";
|
|
8
8
|
import { u as Fi } from "./useLightboxScrollLock-VQ07s7EJ.mjs";
|
|
9
9
|
import { j as Dt, r as Gt, i as Vt, s as ei, k as Ye, S as _i, l as qe, m as Di, D as $e, b as Jt, a as Ee, g as Ze, c as Ut, e as it, h as Gi, n as be, f as ht, d as Ji, T as Xt, o as Ui, p as Xi, q as Vi, t as Qe, u as Pe, v as Yi } from "./utils-FxC9rcxw.mjs";
|
|
10
10
|
const qi = ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),o=require("react"),Lt=require("react-dom"),hi=require("./useScopedStyles-Bf6yohVQ.js"),G=require("./useLightboxSwipeDismiss-Br9uE5G0.js"),rt=require("./scalingValue-CSHYgTZl.js"),fi=require("./SvgImage-_QN8ngad.js"),mi=require("./useLightboxScrollLock-Hf16Eq4g.js"),l=require("./utils-033j3qNL.js"),gi=({prefix:e,entries:z,settings:I,isEditor:w,isEditMode:f,isPreviewMode:ee,initialSlideIndex:U=0,enableUrlSync:j=!1,journalItemId:k=null,onBeforeClose:V,onClose:q})=>{const{type:C,coverFit:te,backgroundColor:_e,imageGap:De,maxWidth:Ae,maxHeight:H,textTransition:E,title1Width:ie,title2Width:re,title3Width:X,title1MarginLeft:R=0,title2MarginLeft:L=0,title3MarginLeft:pe=0,titleRowMarginBottom:$=0,titleHeaderLayout:ze="single-row",countCloseGap:Ee=0,closeIcon:ve,closeIconMaxWidth:b,closeIconColor:M,closeIconHoverColor:J,contentMarginTop:we=0,iconMarginRight:Ht=0}=I,m=o.useCallback(t=>rt.scalingValue(t,w??!1),[w]),Je=m(De??0),Mt=`${Ae}%`,_t=`${H}%`,ye=m(Ee),Dt=m(we),dt=m(Ht),ne=l.journalTextFieldsToCss("title1",l.resolveJournalTextFields(I,"title1"),w),ae=l.journalTextFieldsToCss("title2",l.resolveJournalTextFields(I,"title2"),w),ce=l.journalTextFieldsToCss("title3",l.resolveJournalTextFields(I,"title3"),w),At=l.journalTextFieldsToCss("count",l.resolveJournalTextFields(I,"count"),w),p=ze==="mobile",F=!w||!!ee,zt=!f&&(!w||!!ee),u=o.useMemo(()=>l.buildJournalSlides(z,C),[z,C]),[y,Fe]=o.useState(U),de=u[y],h=de==null?void 0:de.entry,[ut,ht]=o.useState(!1),[ft,ue]=o.useState(null),[T,he]=o.useState(!1),[mt,Be]=o.useState(null),[gt,Ke]=o.useState(!1),[Oe,xt]=o.useState(0),[oe,fe]=o.useState(),[be,me]=o.useState(),[$e,Te]=o.useState(null),Z=o.useRef(null),Se=o.useRef(0),Ie=o.useRef(0),pt=o.useRef(0),vt=o.useRef(!1),Ge=o.useRef(null),Ue=o.useRef(null),B=o.useRef(null),K=o.useRef(null),Ve=o.useRef(null),wt=o.useRef(null),je=o.useRef(null),yt=o.useCallback(()=>{const t=Ue.current;if(!t)return;const n=t.closest(`.${e}-lightbox-content-area`);if(!n)return t.getBoundingClientRect().width;const a=Array.from(n.children).reduce((s,r)=>!(r instanceof HTMLElement)||r.contains(t)?s:s+r.getBoundingClientRect().width,0);return n.getBoundingClientRect().width-a},[e]),Y=o.useCallback(()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)},[]),Et=o.useCallback(t=>{t===Se.current&&(Be(null),Ke(!1))},[]),ge=o.useCallback(()=>{f||vt.current||(vt.current=!0,V==null||V(),ht(!1),Ge.current=setTimeout(()=>{q()},300))},[f,V,q]),Jt=o.useCallback(t=>!!(t.closest("[data-controls]")||t.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:qe,backdropStyle:Ft,mediaAreaStyle:Bt,overlayContentStyle:Kt,swipeHandlers:Ot,dismissAreaStyle:Gt}=G.useLightboxSwipeDismiss({enabled:zt,onClose:ge,animMs:300,isBlockedTarget:Jt}),bt=o.useCallback(t=>{j&&l.setJournalUrlParam(t+1,k,!0)},[j,k]),Xe=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=Xe(B.current),c=d?(()=>{const N=yt();Lt.flushSync(()=>{Te(s.entry)}),B.current&&N&&(B.current.style.width=`${N}px`);const Me=Xe(B.current);return B.current&&(B.current.style.width=""),{measuredIncomingTitlesHeight:Me,incomingTitlesMeasureWidth:N}})():void 0,S=Math.max(x??0,(c==null?void 0:c.measuredIncomingTitlesHeight)??0)||void 0;xt(r),Be(y),Ke(!0),Fe(n),bt(n),pt.current=n,d?(Y(),S&&fe(S),c!=null&&c.incomingTitlesMeasureWidth&&me(c.incomingTitlesMeasureWidth),ue((a==null?void 0:a.entryIndex)??null),he(!0),Ie.current=s.entryIndex,Z.current=setTimeout(()=>{ue(null),he(!1),fe(void 0),me(void 0),Te(null),Z.current=null},400)):(Y(),ue(null),he(!1),fe(void 0),me(void 0),Te(null),Ie.current=s.entryIndex)},[y,Y,yt,Xe,u,bt,E]),xe=o.useCallback(()=>{je.current=null},[]),Ut=o.useCallback(t=>{!F||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})},[F,u.length]),Vt=o.useCallback(t=>{var N;if(!F||u.length<=1||t.pointerType==="mouse"&&t.button!==0)return;if(qe){xe();return}const n=je.current;if(!n||n.pointerId!==t.pointerId||(xe(),t.target.closest("[data-controls]")))return;const s=t.clientX-n.startX,r=t.clientY-n.startY,d=Math.abs(s),x=Math.abs(r);if(d>=l.STRIP_NAV_SWIPE_MIN_PX&&d>x){le(s>0?y-1:y+1);return}if(d>l.STRIP_NAV_TAP_MAX_PX||x>l.STRIP_NAV_TAP_MAX_PX)return;const c=(N=K.current)==null?void 0:N.getBoundingClientRect(),S=c?c.left+c.width/2:window.innerWidth/2;le(t.clientX<S?y-1:y+1)},[y,F,le,qe,xe,u.length]),qt=o.useCallback(t=>{const n=je.current;(n==null?void 0:n.pointerId)===t.pointerId&&xe()},[xe]);mi.useLightboxScrollLock(),o.useEffect(()=>{wt.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const t=requestAnimationFrame(()=>{ht(!0),requestAnimationFrame(()=>{Ve.current?Ve.current.focus():K.current&&K.current.focus()})});return()=>{cancelAnimationFrame(t),Ge.current&&clearTimeout(Ge.current),Z.current&&clearTimeout(Z.current);const n=wt.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,Y(),ue(null),he(!1),fe(void 0),me(void 0))},[y,Y,u,E]),o.useEffect(()=>{const t=n=>{if(n.key==="Escape"){ge();return}if(n.key==="ArrowLeft"&&u.length>1){le(y-1);return}if(n.key==="ArrowRight"&&u.length>1){le(y+1);return}if(n.key==="Tab"&&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,ge,y,u.length]),o.useLayoutEffect(()=>{Y(),Se.current=0,xt(0),Be(null),Ke(!1),ue(null),he(!1),fe(void 0),me(void 0),Te(null),Fe(t=>{const n=Math.max(0,u.length-1);return Math.min(t,n)})},[Y,z.length,C,u.length]),o.useLayoutEffect(()=>{var a;const t=Math.max(0,u.length-1),n=Math.min(Math.max(0,U),t);pt.current=n,Ie.current=((a=u[n])==null?void 0:a.entryIndex)??0,Fe(n)},[U]);const g=ft!==null?z[ft]:null,$t=mt!==null?u[mt]:null,Re=(h==null?void 0:h.title1)||(h==null?void 0:h.title2)||(h==null?void 0:h.title3)||(g==null?void 0:g.title1)||(g==null?void 0:g.title2)||(g==null?void 0:g.title3),Q=l.shouldShowCounter(C,u,z),se=ve!==null,Xt=Re||Q||se,Zt=Q&&se?{gap:ye}:void 0,We=`${e}-titles-stack${p?` ${e}-titles-stack-stacked`:""}`,Tt=`${e}-titles-layer-out${p?` ${e}-titles-layer-out-stacked`:""}`,Yt=`${e}-titles-layer-out`,Ze=(R??0)>0||f,Qt=m($),W=o.useMemo(()=>({title1Width:ie??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title1Width,title2Width:re??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title2Width,title3Width:X??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title3Width}),[ie,re,X]),_=o.useMemo(()=>({title2MarginLeft:L,title3MarginLeft:pe}),[L,pe]),v=o.useMemo(()=>h?l.buildJournalTitleSlots(e,h,ne,ae,ce):[],[e,h,ne,ae,ce]),Ne=o.useMemo(()=>v.map(t=>W[t.widthKey]),[v,W]),D=o.useMemo(()=>l.resolveJournalTitleWidths(v.length,Ne),[v.length,Ne]),St=o.useMemo(()=>l.getEffectiveJournalTitleWidths(v.length,Ne),[v.length,Ne]),ke=o.useMemo(()=>v.filter(t=>t.prefix==="title1"),[v]),A=o.useMemo(()=>v.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[v]),Ce=o.useMemo(()=>l.getRowScopedJournalTitleWidths(ke,W),[ke,W]),O=o.useMemo(()=>l.getRowScopedJournalTitleWidths(A,W),[A,W]),Ye=o.useCallback((t,n)=>{const a=v.findIndex(r=>r.prefix===t.prefix);if(!p||n==="single-row")return{effectiveWidth:St[a]??0,resolvedWidth:D[a]??0,maxWidth:l.getJournalTitleMaxWidth(a,D)};if(n==="two-row-top"){const r=ke.findIndex(d=>d.prefix===t.prefix);return{effectiveWidth:Ce.effective[r]??0,resolvedWidth:Ce.resolved[r]??0,maxWidth:l.getJournalTitleMaxWidth(r,Ce.resolved)}}const s=A.findIndex(r=>r.prefix===t.prefix);return{effectiveWidth:O.effective[s]??0,resolvedWidth:O.resolved[s]??0,maxWidth:l.getJournalTitleMaxWidth(s,O.resolved)}},[v,A,O,St,D,ke,Ce,p]),Pt=o.useCallback(t=>l.getJournalTitleBoundaryOffset(v,D,_,t)+(p?0:R??0),[v,D,_,p,R]),ei=o.useCallback(()=>p?0:R??0,[p,R]),Qe=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,_]),ti=o.useCallback(t=>{const n=A[t];return Qe(t)+(n.marginLeftKey?_[n.marginLeftKey]??0:0)+(O.resolved[t]??0)},[A,O.resolved,Qe,_]),Pe=o.useCallback((t,n,a)=>{if(!p||a==="single-row"){const c=t.findIndex(P=>P.prefix===n.prefix),S=t.map(P=>W[P.widthKey]),N=l.resolveJournalTitleWidths(t.length,S);return{effectiveWidth:l.getEffectiveJournalTitleWidths(t.length,S)[c]??0,resolvedWidth:N[c]??0,maxWidth:l.getJournalTitleMaxWidth(c,N)}}if(a==="two-row-top"){const c=t.filter(P=>P.prefix==="title1"),S=c.findIndex(P=>P.prefix===n.prefix),{resolved:N,effective:Me}=l.getRowScopedJournalTitleWidths(c,W);return{effectiveWidth:Me[S]??0,resolvedWidth:N[S]??0,maxWidth:l.getJournalTitleMaxWidth(S,N)}}const s=t.filter(c=>c.prefix==="title2"||c.prefix==="title3"),r=s.findIndex(c=>c.prefix===n.prefix),{resolved:d,effective:x}=l.getRowScopedJournalTitleWidths(s,W);return{effectiveWidth:x[r]??0,resolvedWidth:d[r]??0,maxWidth:l.getJournalTitleMaxWidth(r,d)}},[W,p]),et=(t,n,a)=>{const s=t.marginLeftKey?_[t.marginLeftKey]??0:0,{effectiveWidth:r,resolvedWidth:d,maxWidth:x}=a??Ye(t,n),c=Math.max(s,l.TITLE_PADDING_HANDLE_WIDTH),S=f&&n==="two-row-top";return i.jsxs("div",{className:`${e}-title-cell`,"data-title":t.prefix,style:{width:m(r),...s>0?{marginLeft:m(s)}:{}},children:[i.jsx("p",{className:t.className,style:t.style,children:t.text}),S&&t.marginLeftKey?i.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(d),style:{position:"absolute",top:0,left:m(-s),width:m(c),height:"100%",pointerEvents:"auto"}}):null,S?i.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:m(-l.TITLE_RESIZE_HANDLE_WIDTH/2),width:m(l.TITLE_RESIZE_HANDLE_WIDTH),height:"100%",pointerEvents:"auto"}}):null]},t.className)},tt=(t="two-row")=>{const n=v.findIndex(r=>r.prefix==="title1"),a=n>=0?D[n]:W.title1Width,s=t==="two-row"&&f;return i.jsx("div",{...s?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(a)}:{},style:{width:m(R??0),flexShrink:0,alignSelf:"stretch",...s?{pointerEvents:"auto"}:{}}})},it=()=>i.jsx("span",{className:`${e}-titles-baseline-strut`,style:ne,"aria-hidden":"true",children:" "}),It=()=>i.jsx("span",{className:`${e}-entry-counter`,style:At,"aria-live":"polite","aria-atomic":"true",children:l.formatSlideCounter(u,y,C,z)}),ii=()=>Q?f&&se?i.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[It(),i.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${l.getGapControlSize(ye)} + ${ye}))`,width:l.getGapControlSize(ye),height:"100%",pointerEvents:"auto",zIndex:3}})]}):It():null,nt=()=>!Q&&!se?null:i.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Zt,children:[ii(),se?li():null]}),ni=()=>i.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Q||Re?it():null,Ze?tt("single-row"):null,Rt(h),i.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),nt(),st()]}),oi=()=>i.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Q||Re?it():null,Ze?tt("single-row"):null,i.jsxs("div",{className:`${e}-titles-row-titles`,style:T&&oe?{minHeight:oe}:void 0,children:[i.jsx("div",{ref:B,className:We,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:He($e||h)}),i.jsxs("div",{ref:Ue,className:We,style:{position:T?"absolute":"relative",inset:T?0:void 0,width:"100%",...T&&be?{width:be,maxWidth:"100%"}:void 0},children:[g&&T?i.jsx("div",{className:`${Tt} ${e}-titles-fade-out`,children:He(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${T?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:He(h)})]})]}),nt(),st()]}),li=()=>i.jsxs("div",{className:`${e}-close-icon`,style:{width:rt.scalingValue(b??0,w),height:rt.scalingValue(b??0,w),marginRight:dt,"--close-icon-hover-color":J},children:[i.jsx("button",{ref:Ve,type:"button",className:`${e}-close-icon-inner`,onClick:ge,"aria-label":"Close",children:i.jsx(fi.SvgImage,{url:ve??"",fill:M,hoverFill:w&&!ee?M:J,className:`${e}-close-icon-img`})}),f&&i.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:dt,height:"100%",pointerEvents:"auto"}})]}),jt=(t,n)=>i.jsxs("div",{className:`${e}-titles-row-top`,children:[Q||Re?it():null,Ze?tt("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"})]}),nt()]}),Rt=t=>{if(!t)return null;const n=l.buildJournalTitleSlots(e,t,ne,ae,ce);return i.jsx(i.Fragment,{children:n.map(a=>et(a,"single-row",Pe(n,a,"single-row")))})},ot=t=>{if(!t)return null;const n=l.buildJournalTitleSlots(e,t,ne,ae,ce),a=n.find(s=>s.prefix==="title1");return a?et(a,"two-row-top",Pe(n,a,"two-row-top")):null},lt=(t,n=!1)=>{const a=t?l.buildJournalTitleSlots(e,t,ne,ae,ce):[],s=a.filter(x=>x.prefix==="title2"||x.prefix==="title3"),r=f&&n;return s.length>0||r||($??0)>0?i.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[s.length>0?i.jsxs("div",{className:`${e}-titles-row-bottom`,children:[s.map(x=>et(x,"two-row-bottom",Pe(a,x,"two-row-bottom"))),n&&f?i.jsxs(i.Fragment,{children:[ai(),ci()]}):null]}):null,($??0)>0||r?i.jsx("div",{"data-controls":r?"titleRowMarginBottom":void 0,"data-controls-axis":r?"y":void 0,"data-controls-reverse":r?"":void 0,className:r?`${e}-control`:void 0,style:{height:Qt,width:"100%",flexShrink:0,pointerEvents:r?"auto":"none"}}):null]}):null},Le=(t,n=!1)=>i.jsxs(i.Fragment,{children:[jt(ot(t)),lt(t,n)]}),He=t=>p?i.jsx("div",{className:`${e}-titles-row-two-row`,children:Le(t)}):t?i.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Rt(t)}):null,si=()=>{const t=p?-1:v.findIndex(s=>s.prefix==="title1"),n=!p&&(f||(R??0)>0)?(()=>{const s=R??0,r=t>=0?D[t]:W.title1Width,d=Math.max(s,l.TITLE_PADDING_HANDLE_WIDTH);return i.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(r),style:{position:"absolute",top:0,left:0,width:m(d),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,a=v.flatMap((s,r)=>{if(!s.marginLeftKey)return[];const d=_[s.marginLeftKey]??0,x=l.getJournalTitleOffsetBeforeSlot(v,D,_,r)+ei(),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},ri=()=>v.map((t,n)=>{const a=l.getJournalTitleMaxWidth(n,D),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`)}),ai=()=>A.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const a=_[t.marginLeftKey]??0,s=Qe(n),r=Math.max(a,l.TITLE_PADDING_HANDLE_WIDTH),{resolvedWidth:d}=Ye(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)}),ci=()=>A.map((t,n)=>{const{maxWidth:a}=Ye(t,"two-row-bottom"),r=ti(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`)}),st=()=>!f||p?null:i.jsxs(i.Fragment,{children:[si(),ri()]}),Wt=t=>{const n=!t.objectFit&&G.isImageRatioCover(te);return{className:`${e}-slide-image-cell${n?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:Mt,maxHeight:_t,...n?{"--image-aspect-ratio":G.getAspectRatio(te)}:{}}}},Nt=t=>t.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":t.objectFit}}:G.isImageRatioCover(te)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},kt=t=>{if(t.length===0)return null;const n=t.length>1,a=l.getGapControlSize(Je),s=`calc(-0.5 * (${a} + ${Je}))`;if(t.length===1){const r=t[0];return i.jsx("div",{...Wt(r),children:i.jsx("img",{...Nt(r),src:r.assetId,alt:r.name??"",draggable:!1})})}return i.jsx("div",{className:`${e}-slide-inner`,style:n?{gap:Je}:void 0,children:t.map((r,d)=>i.jsxs("div",{...Wt(r),children:[i.jsx("img",{...Nt(r),src:r.assetId,alt:r.name??"",draggable:!1}),f&&n&&d<t.length-1&&i.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:s,width:a,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${r.assetId}-${d}`))})},Ct=!!(h!=null&&h.title2||h!=null&&h.title3||g!=null&&g.title2||g!=null&&g.title3||($??0)>0||f),di=()=>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:We,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Le($e||h)}),i.jsxs("div",{ref:Ue,className:`${e}-titles-row-two-row`,style:{...T&&oe?{minHeight:oe}:void 0,...T&&be?{width:be,maxWidth:"100%"}:void 0},children:[jt(i.jsxs("div",{className:We,style:{position:T?"absolute":"relative",inset:T?0:void 0,width:"100%"},children:[g&&T?i.jsx("div",{className:`${Yt} ${e}-titles-fade-out`,children:ot(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${T?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ot(h)})]}),T&&oe?oe:void 0),Ct?i.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[g&&T?i.jsx("div",{className:`${Tt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:lt(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${T?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${p?` ${e}-titles-layer-in-stacked`:""}`,children:lt(h,!0)})]}):null]})]}),ui=()=>{const t=Ct;return i.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...t?{flex:1,height:"100%"}:{}},children:[i.jsx("div",{className:`${e}-titles-row-two-row`,style:t?void 0:{flex:"0 0 auto",height:"auto"},children:Le(h,!0)}),st()]})};return i.jsxs("div",{ref:K,"data-selection":"none",className:`${e}-lightbox${w?` ${e}-lightbox-editor`:""}${f?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{qe||ge()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:se?void 0:-1,style:{opacity:ut?1:0,transition:"opacity 300ms ease",pointerEvents:ut?"auto":"none"},children:[i.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:_e,...Ft}}),i.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Gt,...Ot,children:[i.jsx("div",{className:`${e}-lightbox-content`,style:Bt,onClick:t=>t.stopPropagation(),children:i.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":F&&u.length>1?"true":"false",onPointerDown:F?Ut:void 0,onPointerUp:F?Vt:void 0,onPointerCancel:F?qt:void 0,children:i.jsxs("div",{className:`${e}-slide-stack`,children:[$t&>?i.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:t=>{t.target===t.currentTarget&&Et(Oe)},children:i.jsx("div",{className:`${e}-slide-area`,children:kt($t.images)})},`slide-out-${Oe}`):null,i.jsx("div",{className:`${e}-slide-layer-in${gt?` ${e}-slide-fade-in`:""}`,children:i.jsx("div",{className:`${e}-slide-area`,children:de?kt(de.images):null})},`slide-in-${Oe}-${y}`)]})})}),i.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Kt,children:[i.jsx("div",{"data-controls":f?"contentMarginTop":void 0,className:f?`${e}-control`:void 0,style:{height:Dt,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:Xt&&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"?di():ui():E==="fade"?oi():ni()})})})]})]})]})},at=400,ct="cubic-bezier(0.25, 0.1, 0.25, 1)",xi=1.1;function pi(e){return`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),o=require("react"),Lt=require("react-dom"),hi=require("./useScopedStyles-Bf6yohVQ.js"),G=require("./useLightboxSwipeDismiss-Br9uE5G0.js"),rt=require("./scalingValue-CSHYgTZl.js"),fi=require("./SvgImage-DFlmxAoL.js"),mi=require("./useLightboxScrollLock-Hf16Eq4g.js"),l=require("./utils-033j3qNL.js"),gi=({prefix:e,entries:z,settings:I,isEditor:w,isEditMode:f,isPreviewMode:ee,initialSlideIndex:U=0,enableUrlSync:j=!1,journalItemId:k=null,onBeforeClose:V,onClose:q})=>{const{type:C,coverFit:te,backgroundColor:_e,imageGap:De,maxWidth:Ae,maxHeight:H,textTransition:E,title1Width:ie,title2Width:re,title3Width:X,title1MarginLeft:R=0,title2MarginLeft:L=0,title3MarginLeft:pe=0,titleRowMarginBottom:$=0,titleHeaderLayout:ze="single-row",countCloseGap:Ee=0,closeIcon:ve,closeIconMaxWidth:b,closeIconColor:M,closeIconHoverColor:J,contentMarginTop:we=0,iconMarginRight:Ht=0}=I,m=o.useCallback(t=>rt.scalingValue(t,w??!1),[w]),Je=m(De??0),Mt=`${Ae}%`,_t=`${H}%`,ye=m(Ee),Dt=m(we),dt=m(Ht),ne=l.journalTextFieldsToCss("title1",l.resolveJournalTextFields(I,"title1"),w),ae=l.journalTextFieldsToCss("title2",l.resolveJournalTextFields(I,"title2"),w),ce=l.journalTextFieldsToCss("title3",l.resolveJournalTextFields(I,"title3"),w),At=l.journalTextFieldsToCss("count",l.resolveJournalTextFields(I,"count"),w),p=ze==="mobile",F=!w||!!ee,zt=!f&&(!w||!!ee),u=o.useMemo(()=>l.buildJournalSlides(z,C),[z,C]),[y,Fe]=o.useState(U),de=u[y],h=de==null?void 0:de.entry,[ut,ht]=o.useState(!1),[ft,ue]=o.useState(null),[T,he]=o.useState(!1),[mt,Be]=o.useState(null),[gt,Ke]=o.useState(!1),[Oe,xt]=o.useState(0),[oe,fe]=o.useState(),[be,me]=o.useState(),[$e,Te]=o.useState(null),Z=o.useRef(null),Se=o.useRef(0),Ie=o.useRef(0),pt=o.useRef(0),vt=o.useRef(!1),Ge=o.useRef(null),Ue=o.useRef(null),B=o.useRef(null),K=o.useRef(null),Ve=o.useRef(null),wt=o.useRef(null),je=o.useRef(null),yt=o.useCallback(()=>{const t=Ue.current;if(!t)return;const n=t.closest(`.${e}-lightbox-content-area`);if(!n)return t.getBoundingClientRect().width;const a=Array.from(n.children).reduce((s,r)=>!(r instanceof HTMLElement)||r.contains(t)?s:s+r.getBoundingClientRect().width,0);return n.getBoundingClientRect().width-a},[e]),Y=o.useCallback(()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)},[]),Et=o.useCallback(t=>{t===Se.current&&(Be(null),Ke(!1))},[]),ge=o.useCallback(()=>{f||vt.current||(vt.current=!0,V==null||V(),ht(!1),Ge.current=setTimeout(()=>{q()},300))},[f,V,q]),Jt=o.useCallback(t=>!!(t.closest("[data-controls]")||t.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:qe,backdropStyle:Ft,mediaAreaStyle:Bt,overlayContentStyle:Kt,swipeHandlers:Ot,dismissAreaStyle:Gt}=G.useLightboxSwipeDismiss({enabled:zt,onClose:ge,animMs:300,isBlockedTarget:Jt}),bt=o.useCallback(t=>{j&&l.setJournalUrlParam(t+1,k,!0)},[j,k]),Xe=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=Xe(B.current),c=d?(()=>{const N=yt();Lt.flushSync(()=>{Te(s.entry)}),B.current&&N&&(B.current.style.width=`${N}px`);const Me=Xe(B.current);return B.current&&(B.current.style.width=""),{measuredIncomingTitlesHeight:Me,incomingTitlesMeasureWidth:N}})():void 0,S=Math.max(x??0,(c==null?void 0:c.measuredIncomingTitlesHeight)??0)||void 0;xt(r),Be(y),Ke(!0),Fe(n),bt(n),pt.current=n,d?(Y(),S&&fe(S),c!=null&&c.incomingTitlesMeasureWidth&&me(c.incomingTitlesMeasureWidth),ue((a==null?void 0:a.entryIndex)??null),he(!0),Ie.current=s.entryIndex,Z.current=setTimeout(()=>{ue(null),he(!1),fe(void 0),me(void 0),Te(null),Z.current=null},400)):(Y(),ue(null),he(!1),fe(void 0),me(void 0),Te(null),Ie.current=s.entryIndex)},[y,Y,yt,Xe,u,bt,E]),xe=o.useCallback(()=>{je.current=null},[]),Ut=o.useCallback(t=>{!F||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})},[F,u.length]),Vt=o.useCallback(t=>{var N;if(!F||u.length<=1||t.pointerType==="mouse"&&t.button!==0)return;if(qe){xe();return}const n=je.current;if(!n||n.pointerId!==t.pointerId||(xe(),t.target.closest("[data-controls]")))return;const s=t.clientX-n.startX,r=t.clientY-n.startY,d=Math.abs(s),x=Math.abs(r);if(d>=l.STRIP_NAV_SWIPE_MIN_PX&&d>x){le(s>0?y-1:y+1);return}if(d>l.STRIP_NAV_TAP_MAX_PX||x>l.STRIP_NAV_TAP_MAX_PX)return;const c=(N=K.current)==null?void 0:N.getBoundingClientRect(),S=c?c.left+c.width/2:window.innerWidth/2;le(t.clientX<S?y-1:y+1)},[y,F,le,qe,xe,u.length]),qt=o.useCallback(t=>{const n=je.current;(n==null?void 0:n.pointerId)===t.pointerId&&xe()},[xe]);mi.useLightboxScrollLock(),o.useEffect(()=>{wt.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const t=requestAnimationFrame(()=>{ht(!0),requestAnimationFrame(()=>{Ve.current?Ve.current.focus():K.current&&K.current.focus()})});return()=>{cancelAnimationFrame(t),Ge.current&&clearTimeout(Ge.current),Z.current&&clearTimeout(Z.current);const n=wt.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,Y(),ue(null),he(!1),fe(void 0),me(void 0))},[y,Y,u,E]),o.useEffect(()=>{const t=n=>{if(n.key==="Escape"){ge();return}if(n.key==="ArrowLeft"&&u.length>1){le(y-1);return}if(n.key==="ArrowRight"&&u.length>1){le(y+1);return}if(n.key==="Tab"&&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,ge,y,u.length]),o.useLayoutEffect(()=>{Y(),Se.current=0,xt(0),Be(null),Ke(!1),ue(null),he(!1),fe(void 0),me(void 0),Te(null),Fe(t=>{const n=Math.max(0,u.length-1);return Math.min(t,n)})},[Y,z.length,C,u.length]),o.useLayoutEffect(()=>{var a;const t=Math.max(0,u.length-1),n=Math.min(Math.max(0,U),t);pt.current=n,Ie.current=((a=u[n])==null?void 0:a.entryIndex)??0,Fe(n)},[U]);const g=ft!==null?z[ft]:null,$t=mt!==null?u[mt]:null,Re=(h==null?void 0:h.title1)||(h==null?void 0:h.title2)||(h==null?void 0:h.title3)||(g==null?void 0:g.title1)||(g==null?void 0:g.title2)||(g==null?void 0:g.title3),Q=l.shouldShowCounter(C,u,z),se=ve!==null,Xt=Re||Q||se,Zt=Q&&se?{gap:ye}:void 0,We=`${e}-titles-stack${p?` ${e}-titles-stack-stacked`:""}`,Tt=`${e}-titles-layer-out${p?` ${e}-titles-layer-out-stacked`:""}`,Yt=`${e}-titles-layer-out`,Ze=(R??0)>0||f,Qt=m($),W=o.useMemo(()=>({title1Width:ie??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title1Width,title2Width:re??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title2Width,title3Width:X??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title3Width}),[ie,re,X]),_=o.useMemo(()=>({title2MarginLeft:L,title3MarginLeft:pe}),[L,pe]),v=o.useMemo(()=>h?l.buildJournalTitleSlots(e,h,ne,ae,ce):[],[e,h,ne,ae,ce]),Ne=o.useMemo(()=>v.map(t=>W[t.widthKey]),[v,W]),D=o.useMemo(()=>l.resolveJournalTitleWidths(v.length,Ne),[v.length,Ne]),St=o.useMemo(()=>l.getEffectiveJournalTitleWidths(v.length,Ne),[v.length,Ne]),ke=o.useMemo(()=>v.filter(t=>t.prefix==="title1"),[v]),A=o.useMemo(()=>v.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[v]),Ce=o.useMemo(()=>l.getRowScopedJournalTitleWidths(ke,W),[ke,W]),O=o.useMemo(()=>l.getRowScopedJournalTitleWidths(A,W),[A,W]),Ye=o.useCallback((t,n)=>{const a=v.findIndex(r=>r.prefix===t.prefix);if(!p||n==="single-row")return{effectiveWidth:St[a]??0,resolvedWidth:D[a]??0,maxWidth:l.getJournalTitleMaxWidth(a,D)};if(n==="two-row-top"){const r=ke.findIndex(d=>d.prefix===t.prefix);return{effectiveWidth:Ce.effective[r]??0,resolvedWidth:Ce.resolved[r]??0,maxWidth:l.getJournalTitleMaxWidth(r,Ce.resolved)}}const s=A.findIndex(r=>r.prefix===t.prefix);return{effectiveWidth:O.effective[s]??0,resolvedWidth:O.resolved[s]??0,maxWidth:l.getJournalTitleMaxWidth(s,O.resolved)}},[v,A,O,St,D,ke,Ce,p]),Pt=o.useCallback(t=>l.getJournalTitleBoundaryOffset(v,D,_,t)+(p?0:R??0),[v,D,_,p,R]),ei=o.useCallback(()=>p?0:R??0,[p,R]),Qe=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,_]),ti=o.useCallback(t=>{const n=A[t];return Qe(t)+(n.marginLeftKey?_[n.marginLeftKey]??0:0)+(O.resolved[t]??0)},[A,O.resolved,Qe,_]),Pe=o.useCallback((t,n,a)=>{if(!p||a==="single-row"){const c=t.findIndex(P=>P.prefix===n.prefix),S=t.map(P=>W[P.widthKey]),N=l.resolveJournalTitleWidths(t.length,S);return{effectiveWidth:l.getEffectiveJournalTitleWidths(t.length,S)[c]??0,resolvedWidth:N[c]??0,maxWidth:l.getJournalTitleMaxWidth(c,N)}}if(a==="two-row-top"){const c=t.filter(P=>P.prefix==="title1"),S=c.findIndex(P=>P.prefix===n.prefix),{resolved:N,effective:Me}=l.getRowScopedJournalTitleWidths(c,W);return{effectiveWidth:Me[S]??0,resolvedWidth:N[S]??0,maxWidth:l.getJournalTitleMaxWidth(S,N)}}const s=t.filter(c=>c.prefix==="title2"||c.prefix==="title3"),r=s.findIndex(c=>c.prefix===n.prefix),{resolved:d,effective:x}=l.getRowScopedJournalTitleWidths(s,W);return{effectiveWidth:x[r]??0,resolvedWidth:d[r]??0,maxWidth:l.getJournalTitleMaxWidth(r,d)}},[W,p]),et=(t,n,a)=>{const s=t.marginLeftKey?_[t.marginLeftKey]??0:0,{effectiveWidth:r,resolvedWidth:d,maxWidth:x}=a??Ye(t,n),c=Math.max(s,l.TITLE_PADDING_HANDLE_WIDTH),S=f&&n==="two-row-top";return i.jsxs("div",{className:`${e}-title-cell`,"data-title":t.prefix,style:{width:m(r),...s>0?{marginLeft:m(s)}:{}},children:[i.jsx("p",{className:t.className,style:t.style,children:t.text}),S&&t.marginLeftKey?i.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(d),style:{position:"absolute",top:0,left:m(-s),width:m(c),height:"100%",pointerEvents:"auto"}}):null,S?i.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:m(-l.TITLE_RESIZE_HANDLE_WIDTH/2),width:m(l.TITLE_RESIZE_HANDLE_WIDTH),height:"100%",pointerEvents:"auto"}}):null]},t.className)},tt=(t="two-row")=>{const n=v.findIndex(r=>r.prefix==="title1"),a=n>=0?D[n]:W.title1Width,s=t==="two-row"&&f;return i.jsx("div",{...s?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(a)}:{},style:{width:m(R??0),flexShrink:0,alignSelf:"stretch",...s?{pointerEvents:"auto"}:{}}})},it=()=>i.jsx("span",{className:`${e}-titles-baseline-strut`,style:ne,"aria-hidden":"true",children:" "}),It=()=>i.jsx("span",{className:`${e}-entry-counter`,style:At,"aria-live":"polite","aria-atomic":"true",children:l.formatSlideCounter(u,y,C,z)}),ii=()=>Q?f&&se?i.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[It(),i.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${l.getGapControlSize(ye)} + ${ye}))`,width:l.getGapControlSize(ye),height:"100%",pointerEvents:"auto",zIndex:3}})]}):It():null,nt=()=>!Q&&!se?null:i.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Zt,children:[ii(),se?li():null]}),ni=()=>i.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Q||Re?it():null,Ze?tt("single-row"):null,Rt(h),i.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),nt(),st()]}),oi=()=>i.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Q||Re?it():null,Ze?tt("single-row"):null,i.jsxs("div",{className:`${e}-titles-row-titles`,style:T&&oe?{minHeight:oe}:void 0,children:[i.jsx("div",{ref:B,className:We,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:He($e||h)}),i.jsxs("div",{ref:Ue,className:We,style:{position:T?"absolute":"relative",inset:T?0:void 0,width:"100%",...T&&be?{width:be,maxWidth:"100%"}:void 0},children:[g&&T?i.jsx("div",{className:`${Tt} ${e}-titles-fade-out`,children:He(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${T?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:He(h)})]})]}),nt(),st()]}),li=()=>i.jsxs("div",{className:`${e}-close-icon`,style:{width:rt.scalingValue(b??0,w),height:rt.scalingValue(b??0,w),marginRight:dt,"--close-icon-hover-color":J},children:[i.jsx("button",{ref:Ve,type:"button",className:`${e}-close-icon-inner`,onClick:ge,"aria-label":"Close",children:i.jsx(fi.SvgImage,{url:ve??"",fill:M,hoverFill:w&&!ee?M:J,className:`${e}-close-icon-img`})}),f&&i.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:dt,height:"100%",pointerEvents:"auto"}})]}),jt=(t,n)=>i.jsxs("div",{className:`${e}-titles-row-top`,children:[Q||Re?it():null,Ze?tt("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"})]}),nt()]}),Rt=t=>{if(!t)return null;const n=l.buildJournalTitleSlots(e,t,ne,ae,ce);return i.jsx(i.Fragment,{children:n.map(a=>et(a,"single-row",Pe(n,a,"single-row")))})},ot=t=>{if(!t)return null;const n=l.buildJournalTitleSlots(e,t,ne,ae,ce),a=n.find(s=>s.prefix==="title1");return a?et(a,"two-row-top",Pe(n,a,"two-row-top")):null},lt=(t,n=!1)=>{const a=t?l.buildJournalTitleSlots(e,t,ne,ae,ce):[],s=a.filter(x=>x.prefix==="title2"||x.prefix==="title3"),r=f&&n;return s.length>0||r||($??0)>0?i.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[s.length>0?i.jsxs("div",{className:`${e}-titles-row-bottom`,children:[s.map(x=>et(x,"two-row-bottom",Pe(a,x,"two-row-bottom"))),n&&f?i.jsxs(i.Fragment,{children:[ai(),ci()]}):null]}):null,($??0)>0||r?i.jsx("div",{"data-controls":r?"titleRowMarginBottom":void 0,"data-controls-axis":r?"y":void 0,"data-controls-reverse":r?"":void 0,className:r?`${e}-control`:void 0,style:{height:Qt,width:"100%",flexShrink:0,pointerEvents:r?"auto":"none"}}):null]}):null},Le=(t,n=!1)=>i.jsxs(i.Fragment,{children:[jt(ot(t)),lt(t,n)]}),He=t=>p?i.jsx("div",{className:`${e}-titles-row-two-row`,children:Le(t)}):t?i.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Rt(t)}):null,si=()=>{const t=p?-1:v.findIndex(s=>s.prefix==="title1"),n=!p&&(f||(R??0)>0)?(()=>{const s=R??0,r=t>=0?D[t]:W.title1Width,d=Math.max(s,l.TITLE_PADDING_HANDLE_WIDTH);return i.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(r),style:{position:"absolute",top:0,left:0,width:m(d),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,a=v.flatMap((s,r)=>{if(!s.marginLeftKey)return[];const d=_[s.marginLeftKey]??0,x=l.getJournalTitleOffsetBeforeSlot(v,D,_,r)+ei(),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},ri=()=>v.map((t,n)=>{const a=l.getJournalTitleMaxWidth(n,D),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`)}),ai=()=>A.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const a=_[t.marginLeftKey]??0,s=Qe(n),r=Math.max(a,l.TITLE_PADDING_HANDLE_WIDTH),{resolvedWidth:d}=Ye(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)}),ci=()=>A.map((t,n)=>{const{maxWidth:a}=Ye(t,"two-row-bottom"),r=ti(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`)}),st=()=>!f||p?null:i.jsxs(i.Fragment,{children:[si(),ri()]}),Wt=t=>{const n=!t.objectFit&&G.isImageRatioCover(te);return{className:`${e}-slide-image-cell${n?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:Mt,maxHeight:_t,...n?{"--image-aspect-ratio":G.getAspectRatio(te)}:{}}}},Nt=t=>t.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":t.objectFit}}:G.isImageRatioCover(te)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},kt=t=>{if(t.length===0)return null;const n=t.length>1,a=l.getGapControlSize(Je),s=`calc(-0.5 * (${a} + ${Je}))`;if(t.length===1){const r=t[0];return i.jsx("div",{...Wt(r),children:i.jsx("img",{...Nt(r),src:r.assetId,alt:r.name??"",draggable:!1})})}return i.jsx("div",{className:`${e}-slide-inner`,style:n?{gap:Je}:void 0,children:t.map((r,d)=>i.jsxs("div",{...Wt(r),children:[i.jsx("img",{...Nt(r),src:r.assetId,alt:r.name??"",draggable:!1}),f&&n&&d<t.length-1&&i.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:s,width:a,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${r.assetId}-${d}`))})},Ct=!!(h!=null&&h.title2||h!=null&&h.title3||g!=null&&g.title2||g!=null&&g.title3||($??0)>0||f),di=()=>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:We,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Le($e||h)}),i.jsxs("div",{ref:Ue,className:`${e}-titles-row-two-row`,style:{...T&&oe?{minHeight:oe}:void 0,...T&&be?{width:be,maxWidth:"100%"}:void 0},children:[jt(i.jsxs("div",{className:We,style:{position:T?"absolute":"relative",inset:T?0:void 0,width:"100%"},children:[g&&T?i.jsx("div",{className:`${Yt} ${e}-titles-fade-out`,children:ot(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${T?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ot(h)})]}),T&&oe?oe:void 0),Ct?i.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[g&&T?i.jsx("div",{className:`${Tt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:lt(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${T?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${p?` ${e}-titles-layer-in-stacked`:""}`,children:lt(h,!0)})]}):null]})]}),ui=()=>{const t=Ct;return i.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...t?{flex:1,height:"100%"}:{}},children:[i.jsx("div",{className:`${e}-titles-row-two-row`,style:t?void 0:{flex:"0 0 auto",height:"auto"},children:Le(h,!0)}),st()]})};return i.jsxs("div",{ref:K,"data-selection":"none",className:`${e}-lightbox${w?` ${e}-lightbox-editor`:""}${f?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{qe||ge()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:se?void 0:-1,style:{opacity:ut?1:0,transition:"opacity 300ms ease",pointerEvents:ut?"auto":"none"},children:[i.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:_e,...Ft}}),i.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Gt,...Ot,children:[i.jsx("div",{className:`${e}-lightbox-content`,style:Bt,onClick:t=>t.stopPropagation(),children:i.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":F&&u.length>1?"true":"false",onPointerDown:F?Ut:void 0,onPointerUp:F?Vt:void 0,onPointerCancel:F?qt:void 0,children:i.jsxs("div",{className:`${e}-slide-stack`,children:[$t&>?i.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:t=>{t.target===t.currentTarget&&Et(Oe)},children:i.jsx("div",{className:`${e}-slide-area`,children:kt($t.images)})},`slide-out-${Oe}`):null,i.jsx("div",{className:`${e}-slide-layer-in${gt?` ${e}-slide-fade-in`:""}`,children:i.jsx("div",{className:`${e}-slide-area`,children:de?kt(de.images):null})},`slide-in-${Oe}-${y}`)]})})}),i.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Kt,children:[i.jsx("div",{"data-controls":f?"contentMarginTop":void 0,className:f?`${e}-control`:void 0,style:{height:Dt,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:Xt&&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"?di():ui():E==="fade"?oi():ni()})})})]})]})]})},at=400,ct="cubic-bezier(0.25, 0.1, 0.25, 1)",xi=1.1;function pi(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 En } from "./useScopedStyles-DhBG3557.mjs";
|
|
5
5
|
import { i as Et, g as Ve, u as Kn } from "./useLightboxSwipeDismiss-SGv6Ra33.mjs";
|
|
6
6
|
import { s as _t } from "./scalingValue-C9JH5L6O.mjs";
|
|
7
|
-
import { S as Fn } from "./SvgImage-
|
|
7
|
+
import { S as Fn } from "./SvgImage-B5mR9y6q.mjs";
|
|
8
8
|
import { u as Bn } from "./useLightboxScrollLock-VQ07s7EJ.mjs";
|
|
9
9
|
import { t as Dn } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
10
10
|
const Hn = (e, o, a, c) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),a=require("react"),kn=require("react-dom"),_n=require("./useScopedStyles-Bf6yohVQ.js"),Z=require("./useLightboxSwipeDismiss-Br9uE5G0.js"),At=require("./scalingValue-CSHYgTZl.js"),En=require("./SvgImage-_QN8ngad.js"),Nn=require("./useLightboxScrollLock-Hf16Eq4g.js"),On=require("./textStylesToCss-CNN3zZTV.js"),zn=(e,o,u,f)=>{const l=Math.min(Math.abs(e)/Math.max(f,1),1);return o+(u-o)*l},Fn=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Kn=e=>{const o=getComputedStyle(e).transform;return o==="none"?0:new DOMMatrixReadOnly(o).m41},Bn=(e,o,u,{duration:f,easing:l,onComplete:m})=>{const p=e.scrollLeft,w=u-p,R=p-u,N=(A,Q)=>{Fn(o),e.scrollLeft=A,Q&&(m==null||m())};if(Math.abs(w)<.5)return N(u,!0),()=>{};let M=!1,J=0;const I=()=>{o.removeEventListener("transitionend",O),clearTimeout(J)},O=A=>{A.target!==o||A.propertyName!=="transform"||M||(M=!0,I(),N(u,!0))};return o.addEventListener("transitionend",O),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(${R}px, 0, 0)`,J=window.setTimeout(()=>{M||(M=!0,I(),N(u,!0))},f+64),()=>{M||(M=!0,I(),N(p-Kn(o),!1))}},xt=300,Dn=900,Hn=1500,Xn="cubic-bezier(0.16, 1, 0.3, 1)",Gn=3e3,Vn=2,Yn=16,qn=.05,Un=1,Wt=.3,Zn=50,Jn=20,at=.004,Fe=["title1","title2","title3"],Ke={title1:"1",title2:"2",title3:"3"},Qn={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Pn={title1:.02,title2:.02,title3:.02},Ct=e=>`max(${e}, ${Jn}px)`,Be=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]}},De=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=Be(e.text);return{title1:o.title1??"",title2:o.title2??"",title3:o.title3??""}},E=(e,o)=>`${e}${o.charAt(0).toUpperCase()}${o.slice(1)}`,He=e=>[E(e,"fontFamily"),E(e,"fontSettings"),{type:"row",items:[E(e,"fontSize"),E(e,"lineHeight"),E(e,"letterSpacing"),E(e,"wordSpacing")]},E(e,"textAlign"),E(e,"textAppearance")],tr=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Fe.map(e=>[Ke[e],He(e)]))}),oe=(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 R=Math.min(m,w);return{overflow:m-R,widths:[w-R,...p]}},{overflow:f-1,widths:[]});return l},Xe=(e,o)=>oe(e,o),jt=(e,o)=>{const u=o.filter((f,l)=>l!==e).reduce((f,l)=>f+l,0);return Math.max(1-u,0)},ze=(e,o)=>{const u=e.map(f=>o[f.widthKey]??0);return{resolved:oe(e.length,u),effective:Xe(e.length,u)}},er=(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},te=(e,o)=>{const u=f=>{const l=E(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[Qn[o]]}},nr=(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),ee=(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??Pn[e],lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,wordSpacing:o.wordSpacing,textAlign:o.textAlign,textAppearance:o.textAppearance,color:o.color??"#ffffff"};return On.textStylesToCss(f,u)},rr=({prefix:e,images:o,settings:u,isEditor:f,isEditMode:l,isPreviewMode:m,onClose:p})=>{const{backgroundColor:w,thumbnailSize:R,thumbnailGap:N,thumbnailMarginBottom:M,imageGap:J,closeIcon:I,closeIconMaxWidth:O,closeIconColor:A,closeIconHoverColor:Q,thumbnailTrigger:vt,thumbnailVisibility:ct,thumbnailObjectFit:bt,thumbnailActive:Ge,thumbnailActiveColor:Ve,title1Width:Mt,title2Width:ie,title3Width:se,title1MarginLeft:W=0,title2MarginLeft:le=0,title3MarginLeft:ae=0,titleRowMarginBottom:ce=0,titleHeaderLayout:ue="desktop",contentMarginTop:Ye,iconMarginLeft:qe}=u,P=t=>At.scalingValue(t,f??!1),Ue=R??u.thumnailSize??.03,fe=P(Ue),kt=P(N),_t=P(M??.02),ut=P(J??0),he=P(Ye??0),Ze=Ct(he),de=P(qe??0),[tt,Et]=a.useState(0),C=a.useRef(tt);C.current=tt;const Je=o[tt],{title1:Nt,title2:Ot,title3:zt}=De(Je),me=ee("title1",te(u,"title1"),f),pe=ee("title2",te(u,"title2"),f),ge=ee("title3",te(u,"title3"),f),j=ue==="mobile",G=!l&&(!f||m),ft=G,ht=G,Qe=G,xe=Z.isImageRatioCover(bt),Pe=xe?{"--image-aspect-ratio":Z.getAspectRatio(bt)}:void 0,ve=!!(Nt||Ot||zt),x=a.useMemo(()=>er(e,Nt,Ot,zt,me,pe,ge),[e,tt,Nt,Ot,zt,me,pe,ge]),et=a.useMemo(()=>({title1Width:Mt,title2Width:ie,title3Width:se}),[Mt,ie,se]),yt=a.useMemo(()=>x.map(t=>et[t.widthKey]),[x,et]),z=a.useMemo(()=>oe(x.length,yt),[x.length,yt]),be=a.useMemo(()=>Xe(x.length,yt),[x.length,yt]),wt=a.useMemo(()=>x.filter(t=>t.prefix==="title1"),[x]),k=a.useMemo(()=>x.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[x]),St=a.useMemo(()=>ze(wt,et),[wt,et]),B=a.useMemo(()=>ze(k,et),[k,et]),Ft=a.useCallback((t,n)=>{const r=x.indexOf(t);if(!j||n==="single-row")return{effectiveWidth:be[r]??0,resolvedWidth:z[r]??0,maxWidth:jt(r,z)};if(n==="two-row-top"){const s=wt.indexOf(t);return{effectiveWidth:St.effective[s]??0,resolvedWidth:St.resolved[s]??0,maxWidth:jt(s,St.resolved)}}const i=k.indexOf(t);return{effectiveWidth:B.effective[i]??0,resolvedWidth:B.resolved[i]??0,maxWidth:jt(i,B.resolved)}},[k,B,be,z,x,wt,St,j]),y=a.useCallback(t=>At.scalingValue(t,f??!1),[f]),tn=y(ce??0),_=a.useMemo(()=>({title1MarginLeft:W,title2MarginLeft:le,title3MarginLeft:ae}),[W,le,ae]),en=a.useCallback(t=>x.slice(0,t+1).reduce((n,r,i)=>n+(r!=null&&r.marginLeftKey?_[r.marginLeftKey]??0:0)+(z[i]??0),0)+(j?0:W??0),[x,_,z,j,W]),nn=a.useCallback(()=>j?0:W??0,[j,W]),Kt=a.useCallback(t=>k.slice(0,t).reduce((n,r,i)=>n+(r.marginLeftKey?_[r.marginLeftKey]??0:0)+(B.resolved[i]??0),0),[k,B.resolved,_]),rn=a.useCallback(t=>{const n=k[t];return Kt(t)+(n.marginLeftKey?_[n.marginLeftKey]??0:0)+(B.resolved[t]??0)},[k,B.resolved,Kt,_]),Bt=(t,n)=>{const r=t.marginLeftKey?_[t.marginLeftKey]??0:0,{effectiveWidth:i,resolvedWidth:s,maxWidth:h}=Ft(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)},on=()=>{const t=j?-1:x.findIndex(i=>i.prefix==="title1"),n=!j&&(l||(W??0)>0)?(()=>{const i=W??0,s=t>=0?z[t]:Mt??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=_[i.marginLeftKey]??0,d=nr(x,z,_,s)+nn();return c.jsx("div",{"data-controls":i.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(z[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},sn=()=>x.map((t,n)=>{const r=jt(n,z),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=()=>k.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const r=_[t.marginLeftKey]??0,i=Kt(n),{resolvedWidth:s}=Ft(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)}),an=()=>k.map((t,n)=>{const{maxWidth:r}=Ft(t,"two-row-bottom"),s=rn(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`)}),cn=a.useRef(null),v=a.useRef(null),Dt=a.useRef(null),ye=a.useRef(null),$t=a.useRef([]),S=a.useRef([]),nt=a.useRef(0),Lt=a.useRef(null),b=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),dt=a.useRef(null),rt=a.useRef(null),Ht=a.useRef(0),Xt=a.useRef("forward"),D=a.useRef(0),H=a.useRef(null),V=a.useRef(!1),$=o.length>1&&(!l||!!m),Gt=$?3:1,un=a.useMemo(()=>Array.from({length:Gt},()=>o).flat(),[o,Gt]),[fn,we]=a.useState(!1),[Se,$e]=a.useState(!1),[hn,Vt]=a.useState(!0),Y=a.useRef(null),ot=a.useRef(null),Yt=a.useRef(!1),Le=a.useRef(!1),qt=a.useRef(null),q=a.useRef(null),Te=ft&&!hn,F=a.useCallback(()=>{ft&&(Vt(!0),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>{b.current.isActive||Vt(!1)},Gn))},[ft]),mt=a.useCallback(()=>{l||Le.current||(Le.current=!0,$e(!1),qt.current=setTimeout(()=>{p()},xt))},[l,p]),Re=()=>c.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Te?"true":"false",style:{width:At.scalingValue(O??0,f),height:At.scalingValue(O??0,f),marginRight:de,"--close-icon-hover-color":Q},children:[c.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:mt,"aria-label":"Close",children:c.jsx(En.SvgImage,{url:I,fill:A,hoverFill:f&&!m?A: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:de,height:"100%",pointerEvents:"auto"}})]}),Ie=(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"}:{}}}),dn=()=>{const t=x.find(i=>i.prefix==="title1"),n=x.filter(i=>i.prefix==="title2"||i.prefix==="title3"),r=n.length>0||l||(ce??0)>0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`${e}-header-row-top`,children:[(W??0)>0||l?Ie():null,t&&Bt(t,"two-row-top"),I&&Re()]}),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=>Bt(i,"two-row-bottom")),l&&c.jsxs(c.Fragment,{children:[ln(),an()]})]}):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:tn,width:"100%",flexShrink:0,pointerEvents:l?"auto":"none"}})]}):null]})},mn=()=>c.jsxs(c.Fragment,{children:[(W??0)>0||l?Ie("single-row"):null,x.map(t=>Bt(t,"single-row")),l?c.jsxs(c.Fragment,{children:[on(),sn()]}):null,I?Re():null]}),Ut=a.useCallback(t=>!!(t.closest("[data-controls]")||t.closest(`.${e}-thumbnails`)||t.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:pn,backdropStyle:gn,mediaAreaStyle:xn,overlayContentStyle:vn,swipeHandlers:bn,dismissAreaStyle:yn}=Z.useLightboxSwipeDismiss({enabled:G??!1,onClose:mt,animMs:xt,isBlockedTarget:Ut}),Zt=()=>{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},U=(t=!1)=>{if(!$)return;const n=v.current,r=Zt();!n||r<=0||r<n.clientWidth*.25||(n.scrollLeft<=0?(n.scrollLeft+=r,t&&(b.current.scrollLeft+=r),V.current&&(D.current+=r)):n.scrollLeft>=r*2&&(n.scrollLeft-=r,t&&(b.current.scrollLeft-=r),V.current&&(D.current-=r)))},Ae=(t,n=(r=>(r=v.current)==null?void 0:r.scrollLeft)()??0)=>{if(!$)return t;let i=o.length+t,s=1/0;for(let h=0;h<Gt;h++){const d=h*o.length+t,g=S.current[d];if(!g)continue;const L=Math.abs(g.offsetLeft-n);L<s&&(s=L,i=d)}return i},We=t=>{const n=v.current;return!t||!n?!1:t.offsetWidth>n.clientWidth+1},Jt=t=>{const n=v.current;if(!t||!n||!We(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=v.current)==null?void 0:n.scrollLeft)()??0)=>{for(let i=0;i<S.current.length;i+=1){const s=S.current[i];if(s&&Jt(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},Ce=t=>{v.current&&S.current.forEach(n=>{n&&(n.style.scrollSnapAlign=We(n)&&t==="backward"?"end":"start")})},wn=(t,n,r)=>{const i=t-n,s=it(n),h=S.current[s];if(Jt(h))return it(t)%o.length;const d=S.current[s+1],g=h?d?d.offsetLeft-h.offsetLeft:h.offsetWidth:0,L=g>0?i>g*Wt?1:i<-g*Wt?-1:0:0;return L===0?r:$?(r+L+o.length)%o.length:Math.max(0,Math.min(o.length-1,r+L))},je=a.useCallback((t=!1)=>{if(ct!=="on"||l)return;const n=ye.current,r=C.current,i=$t.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 L=n.scrollWidth-n.clientWidth;let T=s;if(!t&&Y.current===null){const lt=$t.current[r-1],gt=$t.current[r+1],It=lt?i.offsetLeft-lt.offsetLeft:gt?gt.offsetLeft-i.offsetLeft:i.offsetWidth;g>h?T+=It:d<s&&(T-=It)}else g>h?T=g-n.clientWidth:T=d;n.scrollLeft=Math.max(0,Math.min(L,T))},[l,ct]),Qt=a.useCallback((t=!1)=>{t&&(Yt.current=!0),ot.current===null&&(ot.current=requestAnimationFrame(()=>{ot.current=null;const n=Yt.current;Yt.current=!1,je(n)}))},[je]),Sn=a.useCallback(t=>{if(t===C.current)return;const n=C.current;C.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);Et(t),Qt(r||i)},[o.length,$,Qt]),K=()=>{if(!v.current||o.length===0||Y.current!==null||b.current.isActive&&b.current.hasMoved)return;const t=v.current.scrollLeft,n=it(t)%o.length;n!==C.current&&Sn(n)},$n=()=>{Y.current=null},X=t=>{const n=v.current;n&&(n.style.scrollSnapType=t?"":"none")},pt=()=>{var t;(t=rt.current)==null||t.call(rt),rt.current=null},Tt=()=>{H.current!==null&&(cancelAnimationFrame(H.current),H.current=null),V.current=!1},Me=()=>{const t=v.current;if(!t){H.current=null,V.current=!1;return}const n=D.current-t.scrollLeft;if(Math.abs(n)<.5){t.scrollLeft=D.current,U(),K(),H.current=null,V.current=!1;return}t.scrollLeft+=n*qn,U(),K(),F(),H.current=requestAnimationFrame(Me)},ke=()=>{const t=Dt.current;t&&(t.style.transition="",t.style.transform="",t.style.willChange="")},_e=(t,n,r,i)=>{ke(),t.scrollLeft=n,Ht.current=t.scrollLeft,U(),r!==void 0?(C.current=r,Et(r)):K(),X(!0),i==null||i()},Ee=(t,{behavior:n="smooth",activeIndex:r,onComplete:i}={})=>{const s=v.current,h=Dt.current;if(!s||!h)return;if(Tt(),pt(),X(!1),n==="auto"){_e(s,t,r,i);return}const d=Math.abs(t-s.scrollLeft),g=zn(d,Dn,Hn,s.clientWidth*.55);rt.current=Bn(s,h,t,{duration:g,easing:Xn,onComplete:()=>{rt.current=null,_e(s,t,r,i)}})},Ln=(t="smooth")=>{const n=v.current;if(!n||o.length===0)return;const r=it()%o.length,i=Ae(r,n.scrollLeft),s=S.current[i];s&&Ee(s.offsetLeft,{behavior:t,activeIndex:r})},Tn=(t,n="smooth",r,i)=>{const s=v.current;if(!s||o.length===0)return;const h=(i??s.scrollLeft)-t,d=it(t),g=S.current[d];if(Jt(g)){X(!0),K();return}const L=S.current[d+1],T=g?L?L.offsetLeft-g.offsetLeft:g.offsetWidth:0;if((T>0?h>T*Wt?1:h<-T*Wt?-1:0:0)!==0){const jn=r??d%o.length,Mn=wn(i??s.scrollLeft,t,jn);st(Mn,n);return}const gt=i??s.scrollLeft,It=it(gt),Oe=S.current[It];if(Oe&&Math.abs(Oe.offsetLeft-gt)<1){X(!0),K();return}Ln("auto")},st=(t,n="smooth")=>{const r=v.current;if(!r||o.length===0)return;const i=Ae(t,r.scrollLeft),s=S.current[i];s&&(n==="smooth"?Y.current=t:Y.current=null,C.current=t,Et(t),Qt(!0),Ee(s.offsetLeft,{behavior:n,activeIndex:t,onComplete:n==="smooth"?$n:void 0}))},Pt=()=>{dt.current&&(window.removeEventListener("pointerup",dt.current),window.removeEventListener("pointercancel",dt.current),dt.current=null)},Rn=(t,n,r,i,s)=>{const h=r-t,d=i-n,g=Math.abs(h),L=Math.abs(d);if(g<Zn||g<=L)return!1;const T=h<0?1:-1,lt=$?(s+T+o.length)%o.length:Math.max(0,Math.min(o.length-1,s+T));return lt===s?!1:(st(lt),!0)},Rt=t=>{if(!b.current.isActive)return;Pt();const n=v.current;if(!n)return;const{scrollLeft:r,startActiveIndex:i,hasMoved:s}=b.current,h=n.scrollLeft;U(!0),b.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},we(!1),t!==void 0&&n.hasPointerCapture(t)&&n.releasePointerCapture(t),s?Tn(r,"smooth",i,h):(X(!0),K()),F()},In=(t,n)=>{const r=Lt.current;Lt.current=null,r&&(Rn(r.startX,r.startY,t,n,r.startActiveIndex),F())},An=t=>{if(!ht)return;if(t.pointerType==="touch"){if(Tt(),X(!0),Ut(t.target))return;Lt.current={startX:t.clientX,startY:t.clientY,startActiveIndex:C.current};return}if(t.pointerType!=="mouse"||t.button!==0||Ut(t.target))return;const n=v.current;if(!n)return;Tt(),pt(),ke(),Y.current=null,b.current={isActive:!0,startX:t.clientX,scrollLeft:n.scrollLeft,startActiveIndex:C.current,hasMoved:!1},X(!1),F(),n.setPointerCapture(t.pointerId),Pt();const r=i=>{i.pointerType==="mouse"&&Rt(i.pointerId)};dt.current=r,window.addEventListener("pointerup",r),window.addEventListener("pointercancel",r)},Wn=t=>{if(!ht||t.pointerType!=="mouse")return;const n=v.current;if(!n||!b.current.isActive)return;if(t.buttons===0){Rt(t.pointerId);return}const r=t.clientX-b.current.startX;Math.abs(r)>Un&&(b.current.hasMoved=!0,we(!0)),b.current.hasMoved&&(t.preventDefault(),n.scrollLeft=b.current.scrollLeft-r,U(!0),K(),F())},Ne=t=>{if(ht){if(t.pointerType==="touch"){t.type==="pointerup"?In(t.clientX,t.clientY):Lt.current=null;return}t.pointerType==="mouse"&&Rt(t.pointerId)}},Cn=t=>{!ht||t.pointerType!=="mouse"||Rt(t.pointerId)};return Nn.useLightboxScrollLock(),a.useEffect(()=>{const t=requestAnimationFrame(()=>$e(!0));return()=>{cancelAnimationFrame(t),pt(),Pt(),ot.current!==null&&(cancelAnimationFrame(ot.current),ot.current=null),qt.current&&clearTimeout(qt.current),q.current&&clearTimeout(q.current)}},[]),a.useEffect(()=>{if(!ft){Vt(!0);return}F();const t=()=>F();return document.addEventListener("pointermove",t,{passive:!0}),document.addEventListener("pointerdown",t,{passive:!0}),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerdown",t),q.current&&clearTimeout(q.current)}},[ft,F]),a.useEffect(()=>{const t=n=>{n.key==="Escape"&&mt()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[mt]),a.useLayoutEffect(()=>{Zt()},[ut,o.length,$]),a.useLayoutEffect(()=>{l||st(C.current,"auto")},[ut,l]),a.useLayoutEffect(()=>{st(0,"auto")},[o.length,$]),a.useEffect(()=>{const t=v.current;if(!t||l||!G)return;const n=r=>{if(r.preventDefault(),Math.abs(r.deltaY)<=Math.abs(r.deltaX))return;const i=r.deltaMode===1?Yn:r.deltaMode===2?t.clientHeight:1,s=r.deltaY*i*Vn;if(s!==0){if(pt(),V.current||(V.current=!0,D.current=t.scrollLeft,Y.current=null,X(!1)),D.current+=s,!$){const h=t.scrollWidth-t.clientWidth;D.current=Math.max(0,Math.min(h,D.current))}F(),H.current===null&&(H.current=requestAnimationFrame(Me))}};return t.addEventListener("wheel",n,{passive:!1}),()=>{t.removeEventListener("wheel",n),Tt()}},[l,G,$]),a.useEffect(()=>{const t=v.current;if(!t)return;const n=()=>{U(b.current.isActive);const i=t.scrollLeft,s=i-Ht.current;Ht.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!==Xt.current&&(Xt.current=d,Ce(d))}b.current.isActive&&b.current.hasMoved||K()};t.addEventListener("scroll",n,{passive:!0});const r=new ResizeObserver(()=>{Zt(),U(b.current.isActive),Ce(Xt.current),K()});return r.observe(t),()=>{pt(),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:()=>{pn||mt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Se?1:0,transition:`opacity ${xt}ms ease`,pointerEvents:Se?"auto":"none"},children:[c.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:w,...gn}}),c.jsxs("div",{ref:cn,className:`${e}-lightbox-dismiss-area`,style:yn,...bn,children:[c.jsx("div",{className:`${e}-lightbox-content`,style:xn,onClick:t=>t.stopPropagation(),children:c.jsx("div",{ref:v,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":ht&&o.length>0?"true":"false","data-mouse-dragging":fn?"true":"false",onPointerDown:An,onPointerMove:Wn,onPointerUp:Ne,onPointerCancel:Ne,onLostPointerCapture:Cn,children:c.jsx("div",{ref:Dt,className:`${e}-lightbox-strip-track`,style:{gap:ut},children:un.map((t,n)=>{const r=t.image.objectFit??"contain",i=n%o.length,s=Math.floor(n/o.length),h=Ct(ut),d=`calc(-0.5 * (${h} + ${ut}))`;return c.jsxs("div",{ref:g=>S.current[n]=g,className:`${e}-strip-item`,style:{height:ue==="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":Te?"true":"false",style:vn,children:[c.jsx("div",{style:{position:"relative",width:"100%",height:he,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:Ze,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${j?` ${e}-lightbox-content-area-stacked`:""}`,children:(ve||I)&&c.jsx("div",{className:`${e}-header ${j?`${e}-header-two-row`:`${e}-header-single-row`}`,children:j?dn():ve||I?mn():null})})})]}),o.length>1&&ct==="on"&&(()=>{const t=Ct(_t),n=`calc(-0.5 * (${_t} + ${t}))`;return c.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:_t},children:c.jsx("div",{ref:ye,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:r=>r.stopPropagation(),children:c.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":Ge,style:{gap:kt,"--thumbnail-active-color":Ve},children:[o.map((r,i)=>{const s=Ct(kt),h=`calc(-0.5 * (${s} + ${kt}))`;return c.jsxs("div",{ref:d=>{$t.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:()=>G&&vt==="click"&&st(i),onMouseEnter:()=>Qe&&vt==="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${xe?` ${e}-thumb-image-cover`:""}`,src:r.image.assetId,alt:"",draggable:!1,style:{...Pe,maxWidth:fe,maxHeight:fe,width:bt.display==="cover"?"auto":"100%",height:"auto",objectFit:bt.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}})]})})})})()]})]})},ne=400,re="cubic-bezier(0.25, 0.1, 0.25, 1)",or=1.1;function ir(e){return`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),a=require("react"),kn=require("react-dom"),_n=require("./useScopedStyles-Bf6yohVQ.js"),Z=require("./useLightboxSwipeDismiss-Br9uE5G0.js"),At=require("./scalingValue-CSHYgTZl.js"),En=require("./SvgImage-DFlmxAoL.js"),Nn=require("./useLightboxScrollLock-Hf16Eq4g.js"),On=require("./textStylesToCss-CNN3zZTV.js"),zn=(e,o,u,f)=>{const l=Math.min(Math.abs(e)/Math.max(f,1),1);return o+(u-o)*l},Fn=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Kn=e=>{const o=getComputedStyle(e).transform;return o==="none"?0:new DOMMatrixReadOnly(o).m41},Bn=(e,o,u,{duration:f,easing:l,onComplete:m})=>{const p=e.scrollLeft,w=u-p,R=p-u,N=(A,Q)=>{Fn(o),e.scrollLeft=A,Q&&(m==null||m())};if(Math.abs(w)<.5)return N(u,!0),()=>{};let M=!1,J=0;const I=()=>{o.removeEventListener("transitionend",O),clearTimeout(J)},O=A=>{A.target!==o||A.propertyName!=="transform"||M||(M=!0,I(),N(u,!0))};return o.addEventListener("transitionend",O),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(${R}px, 0, 0)`,J=window.setTimeout(()=>{M||(M=!0,I(),N(u,!0))},f+64),()=>{M||(M=!0,I(),N(p-Kn(o),!1))}},xt=300,Dn=900,Hn=1500,Xn="cubic-bezier(0.16, 1, 0.3, 1)",Gn=3e3,Vn=2,Yn=16,qn=.05,Un=1,Wt=.3,Zn=50,Jn=20,at=.004,Fe=["title1","title2","title3"],Ke={title1:"1",title2:"2",title3:"3"},Qn={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Pn={title1:.02,title2:.02,title3:.02},Ct=e=>`max(${e}, ${Jn}px)`,Be=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]}},De=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=Be(e.text);return{title1:o.title1??"",title2:o.title2??"",title3:o.title3??""}},E=(e,o)=>`${e}${o.charAt(0).toUpperCase()}${o.slice(1)}`,He=e=>[E(e,"fontFamily"),E(e,"fontSettings"),{type:"row",items:[E(e,"fontSize"),E(e,"lineHeight"),E(e,"letterSpacing"),E(e,"wordSpacing")]},E(e,"textAlign"),E(e,"textAppearance")],tr=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Fe.map(e=>[Ke[e],He(e)]))}),oe=(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 R=Math.min(m,w);return{overflow:m-R,widths:[w-R,...p]}},{overflow:f-1,widths:[]});return l},Xe=(e,o)=>oe(e,o),jt=(e,o)=>{const u=o.filter((f,l)=>l!==e).reduce((f,l)=>f+l,0);return Math.max(1-u,0)},ze=(e,o)=>{const u=e.map(f=>o[f.widthKey]??0);return{resolved:oe(e.length,u),effective:Xe(e.length,u)}},er=(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},te=(e,o)=>{const u=f=>{const l=E(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[Qn[o]]}},nr=(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),ee=(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??Pn[e],lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,wordSpacing:o.wordSpacing,textAlign:o.textAlign,textAppearance:o.textAppearance,color:o.color??"#ffffff"};return On.textStylesToCss(f,u)},rr=({prefix:e,images:o,settings:u,isEditor:f,isEditMode:l,isPreviewMode:m,onClose:p})=>{const{backgroundColor:w,thumbnailSize:R,thumbnailGap:N,thumbnailMarginBottom:M,imageGap:J,closeIcon:I,closeIconMaxWidth:O,closeIconColor:A,closeIconHoverColor:Q,thumbnailTrigger:vt,thumbnailVisibility:ct,thumbnailObjectFit:bt,thumbnailActive:Ge,thumbnailActiveColor:Ve,title1Width:Mt,title2Width:ie,title3Width:se,title1MarginLeft:W=0,title2MarginLeft:le=0,title3MarginLeft:ae=0,titleRowMarginBottom:ce=0,titleHeaderLayout:ue="desktop",contentMarginTop:Ye,iconMarginLeft:qe}=u,P=t=>At.scalingValue(t,f??!1),Ue=R??u.thumnailSize??.03,fe=P(Ue),kt=P(N),_t=P(M??.02),ut=P(J??0),he=P(Ye??0),Ze=Ct(he),de=P(qe??0),[tt,Et]=a.useState(0),C=a.useRef(tt);C.current=tt;const Je=o[tt],{title1:Nt,title2:Ot,title3:zt}=De(Je),me=ee("title1",te(u,"title1"),f),pe=ee("title2",te(u,"title2"),f),ge=ee("title3",te(u,"title3"),f),j=ue==="mobile",G=!l&&(!f||m),ft=G,ht=G,Qe=G,xe=Z.isImageRatioCover(bt),Pe=xe?{"--image-aspect-ratio":Z.getAspectRatio(bt)}:void 0,ve=!!(Nt||Ot||zt),x=a.useMemo(()=>er(e,Nt,Ot,zt,me,pe,ge),[e,tt,Nt,Ot,zt,me,pe,ge]),et=a.useMemo(()=>({title1Width:Mt,title2Width:ie,title3Width:se}),[Mt,ie,se]),yt=a.useMemo(()=>x.map(t=>et[t.widthKey]),[x,et]),z=a.useMemo(()=>oe(x.length,yt),[x.length,yt]),be=a.useMemo(()=>Xe(x.length,yt),[x.length,yt]),wt=a.useMemo(()=>x.filter(t=>t.prefix==="title1"),[x]),k=a.useMemo(()=>x.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[x]),St=a.useMemo(()=>ze(wt,et),[wt,et]),B=a.useMemo(()=>ze(k,et),[k,et]),Ft=a.useCallback((t,n)=>{const r=x.indexOf(t);if(!j||n==="single-row")return{effectiveWidth:be[r]??0,resolvedWidth:z[r]??0,maxWidth:jt(r,z)};if(n==="two-row-top"){const s=wt.indexOf(t);return{effectiveWidth:St.effective[s]??0,resolvedWidth:St.resolved[s]??0,maxWidth:jt(s,St.resolved)}}const i=k.indexOf(t);return{effectiveWidth:B.effective[i]??0,resolvedWidth:B.resolved[i]??0,maxWidth:jt(i,B.resolved)}},[k,B,be,z,x,wt,St,j]),y=a.useCallback(t=>At.scalingValue(t,f??!1),[f]),tn=y(ce??0),_=a.useMemo(()=>({title1MarginLeft:W,title2MarginLeft:le,title3MarginLeft:ae}),[W,le,ae]),en=a.useCallback(t=>x.slice(0,t+1).reduce((n,r,i)=>n+(r!=null&&r.marginLeftKey?_[r.marginLeftKey]??0:0)+(z[i]??0),0)+(j?0:W??0),[x,_,z,j,W]),nn=a.useCallback(()=>j?0:W??0,[j,W]),Kt=a.useCallback(t=>k.slice(0,t).reduce((n,r,i)=>n+(r.marginLeftKey?_[r.marginLeftKey]??0:0)+(B.resolved[i]??0),0),[k,B.resolved,_]),rn=a.useCallback(t=>{const n=k[t];return Kt(t)+(n.marginLeftKey?_[n.marginLeftKey]??0:0)+(B.resolved[t]??0)},[k,B.resolved,Kt,_]),Bt=(t,n)=>{const r=t.marginLeftKey?_[t.marginLeftKey]??0:0,{effectiveWidth:i,resolvedWidth:s,maxWidth:h}=Ft(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)},on=()=>{const t=j?-1:x.findIndex(i=>i.prefix==="title1"),n=!j&&(l||(W??0)>0)?(()=>{const i=W??0,s=t>=0?z[t]:Mt??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=_[i.marginLeftKey]??0,d=nr(x,z,_,s)+nn();return c.jsx("div",{"data-controls":i.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(z[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},sn=()=>x.map((t,n)=>{const r=jt(n,z),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=()=>k.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const r=_[t.marginLeftKey]??0,i=Kt(n),{resolvedWidth:s}=Ft(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)}),an=()=>k.map((t,n)=>{const{maxWidth:r}=Ft(t,"two-row-bottom"),s=rn(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`)}),cn=a.useRef(null),v=a.useRef(null),Dt=a.useRef(null),ye=a.useRef(null),$t=a.useRef([]),S=a.useRef([]),nt=a.useRef(0),Lt=a.useRef(null),b=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),dt=a.useRef(null),rt=a.useRef(null),Ht=a.useRef(0),Xt=a.useRef("forward"),D=a.useRef(0),H=a.useRef(null),V=a.useRef(!1),$=o.length>1&&(!l||!!m),Gt=$?3:1,un=a.useMemo(()=>Array.from({length:Gt},()=>o).flat(),[o,Gt]),[fn,we]=a.useState(!1),[Se,$e]=a.useState(!1),[hn,Vt]=a.useState(!0),Y=a.useRef(null),ot=a.useRef(null),Yt=a.useRef(!1),Le=a.useRef(!1),qt=a.useRef(null),q=a.useRef(null),Te=ft&&!hn,F=a.useCallback(()=>{ft&&(Vt(!0),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>{b.current.isActive||Vt(!1)},Gn))},[ft]),mt=a.useCallback(()=>{l||Le.current||(Le.current=!0,$e(!1),qt.current=setTimeout(()=>{p()},xt))},[l,p]),Re=()=>c.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Te?"true":"false",style:{width:At.scalingValue(O??0,f),height:At.scalingValue(O??0,f),marginRight:de,"--close-icon-hover-color":Q},children:[c.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:mt,"aria-label":"Close",children:c.jsx(En.SvgImage,{url:I,fill:A,hoverFill:f&&!m?A: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:de,height:"100%",pointerEvents:"auto"}})]}),Ie=(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"}:{}}}),dn=()=>{const t=x.find(i=>i.prefix==="title1"),n=x.filter(i=>i.prefix==="title2"||i.prefix==="title3"),r=n.length>0||l||(ce??0)>0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`${e}-header-row-top`,children:[(W??0)>0||l?Ie():null,t&&Bt(t,"two-row-top"),I&&Re()]}),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=>Bt(i,"two-row-bottom")),l&&c.jsxs(c.Fragment,{children:[ln(),an()]})]}):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:tn,width:"100%",flexShrink:0,pointerEvents:l?"auto":"none"}})]}):null]})},mn=()=>c.jsxs(c.Fragment,{children:[(W??0)>0||l?Ie("single-row"):null,x.map(t=>Bt(t,"single-row")),l?c.jsxs(c.Fragment,{children:[on(),sn()]}):null,I?Re():null]}),Ut=a.useCallback(t=>!!(t.closest("[data-controls]")||t.closest(`.${e}-thumbnails`)||t.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:pn,backdropStyle:gn,mediaAreaStyle:xn,overlayContentStyle:vn,swipeHandlers:bn,dismissAreaStyle:yn}=Z.useLightboxSwipeDismiss({enabled:G??!1,onClose:mt,animMs:xt,isBlockedTarget:Ut}),Zt=()=>{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},U=(t=!1)=>{if(!$)return;const n=v.current,r=Zt();!n||r<=0||r<n.clientWidth*.25||(n.scrollLeft<=0?(n.scrollLeft+=r,t&&(b.current.scrollLeft+=r),V.current&&(D.current+=r)):n.scrollLeft>=r*2&&(n.scrollLeft-=r,t&&(b.current.scrollLeft-=r),V.current&&(D.current-=r)))},Ae=(t,n=(r=>(r=v.current)==null?void 0:r.scrollLeft)()??0)=>{if(!$)return t;let i=o.length+t,s=1/0;for(let h=0;h<Gt;h++){const d=h*o.length+t,g=S.current[d];if(!g)continue;const L=Math.abs(g.offsetLeft-n);L<s&&(s=L,i=d)}return i},We=t=>{const n=v.current;return!t||!n?!1:t.offsetWidth>n.clientWidth+1},Jt=t=>{const n=v.current;if(!t||!n||!We(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=v.current)==null?void 0:n.scrollLeft)()??0)=>{for(let i=0;i<S.current.length;i+=1){const s=S.current[i];if(s&&Jt(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},Ce=t=>{v.current&&S.current.forEach(n=>{n&&(n.style.scrollSnapAlign=We(n)&&t==="backward"?"end":"start")})},wn=(t,n,r)=>{const i=t-n,s=it(n),h=S.current[s];if(Jt(h))return it(t)%o.length;const d=S.current[s+1],g=h?d?d.offsetLeft-h.offsetLeft:h.offsetWidth:0,L=g>0?i>g*Wt?1:i<-g*Wt?-1:0:0;return L===0?r:$?(r+L+o.length)%o.length:Math.max(0,Math.min(o.length-1,r+L))},je=a.useCallback((t=!1)=>{if(ct!=="on"||l)return;const n=ye.current,r=C.current,i=$t.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 L=n.scrollWidth-n.clientWidth;let T=s;if(!t&&Y.current===null){const lt=$t.current[r-1],gt=$t.current[r+1],It=lt?i.offsetLeft-lt.offsetLeft:gt?gt.offsetLeft-i.offsetLeft:i.offsetWidth;g>h?T+=It:d<s&&(T-=It)}else g>h?T=g-n.clientWidth:T=d;n.scrollLeft=Math.max(0,Math.min(L,T))},[l,ct]),Qt=a.useCallback((t=!1)=>{t&&(Yt.current=!0),ot.current===null&&(ot.current=requestAnimationFrame(()=>{ot.current=null;const n=Yt.current;Yt.current=!1,je(n)}))},[je]),Sn=a.useCallback(t=>{if(t===C.current)return;const n=C.current;C.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);Et(t),Qt(r||i)},[o.length,$,Qt]),K=()=>{if(!v.current||o.length===0||Y.current!==null||b.current.isActive&&b.current.hasMoved)return;const t=v.current.scrollLeft,n=it(t)%o.length;n!==C.current&&Sn(n)},$n=()=>{Y.current=null},X=t=>{const n=v.current;n&&(n.style.scrollSnapType=t?"":"none")},pt=()=>{var t;(t=rt.current)==null||t.call(rt),rt.current=null},Tt=()=>{H.current!==null&&(cancelAnimationFrame(H.current),H.current=null),V.current=!1},Me=()=>{const t=v.current;if(!t){H.current=null,V.current=!1;return}const n=D.current-t.scrollLeft;if(Math.abs(n)<.5){t.scrollLeft=D.current,U(),K(),H.current=null,V.current=!1;return}t.scrollLeft+=n*qn,U(),K(),F(),H.current=requestAnimationFrame(Me)},ke=()=>{const t=Dt.current;t&&(t.style.transition="",t.style.transform="",t.style.willChange="")},_e=(t,n,r,i)=>{ke(),t.scrollLeft=n,Ht.current=t.scrollLeft,U(),r!==void 0?(C.current=r,Et(r)):K(),X(!0),i==null||i()},Ee=(t,{behavior:n="smooth",activeIndex:r,onComplete:i}={})=>{const s=v.current,h=Dt.current;if(!s||!h)return;if(Tt(),pt(),X(!1),n==="auto"){_e(s,t,r,i);return}const d=Math.abs(t-s.scrollLeft),g=zn(d,Dn,Hn,s.clientWidth*.55);rt.current=Bn(s,h,t,{duration:g,easing:Xn,onComplete:()=>{rt.current=null,_e(s,t,r,i)}})},Ln=(t="smooth")=>{const n=v.current;if(!n||o.length===0)return;const r=it()%o.length,i=Ae(r,n.scrollLeft),s=S.current[i];s&&Ee(s.offsetLeft,{behavior:t,activeIndex:r})},Tn=(t,n="smooth",r,i)=>{const s=v.current;if(!s||o.length===0)return;const h=(i??s.scrollLeft)-t,d=it(t),g=S.current[d];if(Jt(g)){X(!0),K();return}const L=S.current[d+1],T=g?L?L.offsetLeft-g.offsetLeft:g.offsetWidth:0;if((T>0?h>T*Wt?1:h<-T*Wt?-1:0:0)!==0){const jn=r??d%o.length,Mn=wn(i??s.scrollLeft,t,jn);st(Mn,n);return}const gt=i??s.scrollLeft,It=it(gt),Oe=S.current[It];if(Oe&&Math.abs(Oe.offsetLeft-gt)<1){X(!0),K();return}Ln("auto")},st=(t,n="smooth")=>{const r=v.current;if(!r||o.length===0)return;const i=Ae(t,r.scrollLeft),s=S.current[i];s&&(n==="smooth"?Y.current=t:Y.current=null,C.current=t,Et(t),Qt(!0),Ee(s.offsetLeft,{behavior:n,activeIndex:t,onComplete:n==="smooth"?$n:void 0}))},Pt=()=>{dt.current&&(window.removeEventListener("pointerup",dt.current),window.removeEventListener("pointercancel",dt.current),dt.current=null)},Rn=(t,n,r,i,s)=>{const h=r-t,d=i-n,g=Math.abs(h),L=Math.abs(d);if(g<Zn||g<=L)return!1;const T=h<0?1:-1,lt=$?(s+T+o.length)%o.length:Math.max(0,Math.min(o.length-1,s+T));return lt===s?!1:(st(lt),!0)},Rt=t=>{if(!b.current.isActive)return;Pt();const n=v.current;if(!n)return;const{scrollLeft:r,startActiveIndex:i,hasMoved:s}=b.current,h=n.scrollLeft;U(!0),b.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},we(!1),t!==void 0&&n.hasPointerCapture(t)&&n.releasePointerCapture(t),s?Tn(r,"smooth",i,h):(X(!0),K()),F()},In=(t,n)=>{const r=Lt.current;Lt.current=null,r&&(Rn(r.startX,r.startY,t,n,r.startActiveIndex),F())},An=t=>{if(!ht)return;if(t.pointerType==="touch"){if(Tt(),X(!0),Ut(t.target))return;Lt.current={startX:t.clientX,startY:t.clientY,startActiveIndex:C.current};return}if(t.pointerType!=="mouse"||t.button!==0||Ut(t.target))return;const n=v.current;if(!n)return;Tt(),pt(),ke(),Y.current=null,b.current={isActive:!0,startX:t.clientX,scrollLeft:n.scrollLeft,startActiveIndex:C.current,hasMoved:!1},X(!1),F(),n.setPointerCapture(t.pointerId),Pt();const r=i=>{i.pointerType==="mouse"&&Rt(i.pointerId)};dt.current=r,window.addEventListener("pointerup",r),window.addEventListener("pointercancel",r)},Wn=t=>{if(!ht||t.pointerType!=="mouse")return;const n=v.current;if(!n||!b.current.isActive)return;if(t.buttons===0){Rt(t.pointerId);return}const r=t.clientX-b.current.startX;Math.abs(r)>Un&&(b.current.hasMoved=!0,we(!0)),b.current.hasMoved&&(t.preventDefault(),n.scrollLeft=b.current.scrollLeft-r,U(!0),K(),F())},Ne=t=>{if(ht){if(t.pointerType==="touch"){t.type==="pointerup"?In(t.clientX,t.clientY):Lt.current=null;return}t.pointerType==="mouse"&&Rt(t.pointerId)}},Cn=t=>{!ht||t.pointerType!=="mouse"||Rt(t.pointerId)};return Nn.useLightboxScrollLock(),a.useEffect(()=>{const t=requestAnimationFrame(()=>$e(!0));return()=>{cancelAnimationFrame(t),pt(),Pt(),ot.current!==null&&(cancelAnimationFrame(ot.current),ot.current=null),qt.current&&clearTimeout(qt.current),q.current&&clearTimeout(q.current)}},[]),a.useEffect(()=>{if(!ft){Vt(!0);return}F();const t=()=>F();return document.addEventListener("pointermove",t,{passive:!0}),document.addEventListener("pointerdown",t,{passive:!0}),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerdown",t),q.current&&clearTimeout(q.current)}},[ft,F]),a.useEffect(()=>{const t=n=>{n.key==="Escape"&&mt()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[mt]),a.useLayoutEffect(()=>{Zt()},[ut,o.length,$]),a.useLayoutEffect(()=>{l||st(C.current,"auto")},[ut,l]),a.useLayoutEffect(()=>{st(0,"auto")},[o.length,$]),a.useEffect(()=>{const t=v.current;if(!t||l||!G)return;const n=r=>{if(r.preventDefault(),Math.abs(r.deltaY)<=Math.abs(r.deltaX))return;const i=r.deltaMode===1?Yn:r.deltaMode===2?t.clientHeight:1,s=r.deltaY*i*Vn;if(s!==0){if(pt(),V.current||(V.current=!0,D.current=t.scrollLeft,Y.current=null,X(!1)),D.current+=s,!$){const h=t.scrollWidth-t.clientWidth;D.current=Math.max(0,Math.min(h,D.current))}F(),H.current===null&&(H.current=requestAnimationFrame(Me))}};return t.addEventListener("wheel",n,{passive:!1}),()=>{t.removeEventListener("wheel",n),Tt()}},[l,G,$]),a.useEffect(()=>{const t=v.current;if(!t)return;const n=()=>{U(b.current.isActive);const i=t.scrollLeft,s=i-Ht.current;Ht.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!==Xt.current&&(Xt.current=d,Ce(d))}b.current.isActive&&b.current.hasMoved||K()};t.addEventListener("scroll",n,{passive:!0});const r=new ResizeObserver(()=>{Zt(),U(b.current.isActive),Ce(Xt.current),K()});return r.observe(t),()=>{pt(),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:()=>{pn||mt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Se?1:0,transition:`opacity ${xt}ms ease`,pointerEvents:Se?"auto":"none"},children:[c.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:w,...gn}}),c.jsxs("div",{ref:cn,className:`${e}-lightbox-dismiss-area`,style:yn,...bn,children:[c.jsx("div",{className:`${e}-lightbox-content`,style:xn,onClick:t=>t.stopPropagation(),children:c.jsx("div",{ref:v,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":ht&&o.length>0?"true":"false","data-mouse-dragging":fn?"true":"false",onPointerDown:An,onPointerMove:Wn,onPointerUp:Ne,onPointerCancel:Ne,onLostPointerCapture:Cn,children:c.jsx("div",{ref:Dt,className:`${e}-lightbox-strip-track`,style:{gap:ut},children:un.map((t,n)=>{const r=t.image.objectFit??"contain",i=n%o.length,s=Math.floor(n/o.length),h=Ct(ut),d=`calc(-0.5 * (${h} + ${ut}))`;return c.jsxs("div",{ref:g=>S.current[n]=g,className:`${e}-strip-item`,style:{height:ue==="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":Te?"true":"false",style:vn,children:[c.jsx("div",{style:{position:"relative",width:"100%",height:he,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:Ze,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${j?` ${e}-lightbox-content-area-stacked`:""}`,children:(ve||I)&&c.jsx("div",{className:`${e}-header ${j?`${e}-header-two-row`:`${e}-header-single-row`}`,children:j?dn():ve||I?mn():null})})})]}),o.length>1&&ct==="on"&&(()=>{const t=Ct(_t),n=`calc(-0.5 * (${_t} + ${t}))`;return c.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:_t},children:c.jsx("div",{ref:ye,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:r=>r.stopPropagation(),children:c.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":Ge,style:{gap:kt,"--thumbnail-active-color":Ve},children:[o.map((r,i)=>{const s=Ct(kt),h=`calc(-0.5 * (${s} + ${kt}))`;return c.jsxs("div",{ref:d=>{$t.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:()=>G&&vt==="click"&&st(i),onMouseEnter:()=>Qe&&vt==="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${xe?` ${e}-thumb-image-cover`:""}`,src:r.image.assetId,alt:"",draggable:!1,style:{...Pe,maxWidth:fe,maxHeight:fe,width:bt.display==="cover"?"auto":"100%",height:"auto",objectFit:bt.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}})]})})})})()]})]})},ne=400,re="cubic-bezier(0.25, 0.1, 0.25, 1)",or=1.1;function ir(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 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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),l=require("react"),g=require("classnames"),Ze=require("./RichTextRenderer-DEFXh5o6.js"),S=require("./scalingValue-CSHYgTZl.js"),Re=require("./SvgImage-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),l=require("react"),g=require("classnames"),Ze=require("./RichTextRenderer-DEFXh5o6.js"),S=require("./scalingValue-CSHYgTZl.js"),Re=require("./SvgImage-DFlmxAoL.js"),Je=require("./textStylesToCss-CNN3zZTV.js"),Qe=require("./useScopedStyles-Bf6yohVQ.js"),H=500,De="cubic-bezier(0.25, 1, 0.5, 1)",Pe=300,et=5,tt=.15,ot=.4,rt=100,Y=100,Ne={color:"#000000",hover:"#cccccc"},U={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},nt={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},pe={offset:{x:0,y:0},linkColor:"#cccccc"},je={sizeType:"drag",value:3},at="left";function it(e,i){var b,f;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((b=e==null?void 0:e.titleFontSettings)==null?void 0:b.fontWeight)??400,fontStyle:((f=e==null?void 0:e.titleFontSettings)==null?void 0:f.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:at,color:(e==null?void 0:e.titleColor)??"#000000"};return Je.textStylesToCss(n,i)}function V(e,i,n){return`${e}: ${S.scalingValue(i/1440,n)};`}function E(e,i){return i<=0?0:(e%i+i)%i}function ct(e,i,n,b){if(!b)return{position:E(e+i,n),hitBoundary:!1};const f=e+i;return f>=0&&f<=n+1?{position:f,hitBoundary:!1}:{position:i>0?n+1:0,hitBoundary:!0}}function lt(e,i){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return i?n.m41:n.m42}function st(e,i){const n=document.createElement("div");n.className=i,n.setAttribute("aria-hidden","true"),e.appendChild(n);const b=(X,J)=>{n.style.transform=`translate(${X}px, ${J}px)`;const B=n.getBoundingClientRect();return{x:B.left,y:B.top}},f=b(0,0),r=b(Y,0),K=b(0,Y);e.removeChild(n);const C={x:(r.x-f.x)/Y,y:(r.y-f.y)/Y},s={x:(K.x-f.x)/Y,y:(K.y-f.y)/Y},Z=C.x*s.y-s.x*C.y;return{ex:C,ey:s,det:Z}}function dt(e,i,n){const{ex:b,ey:f,det:r}=e;return{x:(i*f.y-n*f.x)/r,y:(b.x*n-b.y*i)/r}}function ut(e,i){return`
|
|
2
2
|
.${e}-wrapper {
|
|
3
3
|
position: relative;
|
|
4
4
|
width: 100%;
|
|
@@ -3,7 +3,7 @@ import { useState as D, useRef as k, useCallback as E, useEffect as B } from "re
|
|
|
3
3
|
import x from "classnames";
|
|
4
4
|
import { R as te } from "./RichTextRenderer-D52Xto59.mjs";
|
|
5
5
|
import { s as C } from "./scalingValue-C9JH5L6O.mjs";
|
|
6
|
-
import { S as Oo } from "./SvgImage-
|
|
6
|
+
import { S as Oo } from "./SvgImage-B5mR9y6q.mjs";
|
|
7
7
|
import { t as re } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
8
8
|
import { u as ne } from "./useScopedStyles-DhBG3557.mjs";
|
|
9
9
|
const j = 500, Ho = "cubic-bezier(0.25, 1, 0.5, 1)", ae = 300, ie = 5, ce = 0.15, le = 0.4, se = 100, W = 100, _o = {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l, useEffect as u } from "react";
|
|
3
|
+
import g from "classnames";
|
|
4
|
+
import { i as p, l as k } from "./loadSvgMaskUrl-xHgGYgPe.mjs";
|
|
5
|
+
const v = "SvgImage-module__svg___q3xE-", C = "SvgImage-module__img___VsTm-", c = {
|
|
6
|
+
svg: v,
|
|
7
|
+
img: C
|
|
8
|
+
}, w = (s) => {
|
|
9
|
+
const e = s.trim().toLowerCase();
|
|
10
|
+
return !!(e.startsWith("data:image/svg+xml") || e.includes("image/svg+xml") || e.includes(".svg") || e.startsWith("blob:"));
|
|
11
|
+
}, _ = (s) => `url("${s.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}")`, x = ({ url: s, fill: e = "#000000", hoverFill: f = "#CCCCCC", className: a = "", style: i }) => {
|
|
12
|
+
const [n, d] = l(() => typeof window > "u" ? !0 : CSS.supports("mask-image", 'url("")') || CSS.supports("-webkit-mask-image", 'url("")')), [o, r] = l(() => p(s) ? s : null);
|
|
13
|
+
return u(() => {
|
|
14
|
+
if (typeof window < "u" && window.CSS) {
|
|
15
|
+
const t = CSS.supports("mask-image", 'url("")') || CSS.supports("-webkit-mask-image", 'url("")');
|
|
16
|
+
d(t);
|
|
17
|
+
}
|
|
18
|
+
}, []), u(() => {
|
|
19
|
+
if (!w(s)) {
|
|
20
|
+
r(null);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (p(s)) {
|
|
24
|
+
r(s);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
let t = !1;
|
|
28
|
+
return k(s).then((S) => {
|
|
29
|
+
t || r(S);
|
|
30
|
+
}).catch(() => {
|
|
31
|
+
t || r(null);
|
|
32
|
+
}), () => {
|
|
33
|
+
t = !0;
|
|
34
|
+
};
|
|
35
|
+
}, [s]), !o || !n ? /* @__PURE__ */ m("img", { src: s, alt: "", className: g(c.img, a), style: i }) : /* @__PURE__ */ m(
|
|
36
|
+
"span",
|
|
37
|
+
{
|
|
38
|
+
"data-supports-mask": n,
|
|
39
|
+
className: g(c.svg, a),
|
|
40
|
+
style: {
|
|
41
|
+
"--svg": _(o),
|
|
42
|
+
"--fill": e,
|
|
43
|
+
"--hover-fill": f,
|
|
44
|
+
...i ?? {}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
x as S
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const g=require("react/jsx-runtime"),a=require("react"),c=require("classnames"),n=require("./loadSvgMaskUrl-DfF7ay6h.js"),d="SvgImage-module__svg___q3xE-",k="SvgImage-module__img___VsTm-",m={svg:d,img:k},v=e=>{const s=e.trim().toLowerCase();return!!(s.startsWith("data:image/svg+xml")||s.includes("image/svg+xml")||s.includes(".svg")||s.startsWith("blob:"))},C=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,w=({url:e,fill:s="#000000",hoverFill:f="#CCCCCC",className:i="",style:u})=>{const[l,p]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")')),[o,r]=a.useState(()=>n.isInlineMaskUrl(e)?e:null);return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const t=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');p(t)}},[]),a.useEffect(()=>{if(!v(e)){r(null);return}if(n.isInlineMaskUrl(e)){r(e);return}let t=!1;return n.loadSvgMaskUrl(e).then(S=>{t||r(S)}).catch(()=>{t||r(null)}),()=>{t=!0}},[e]),!o||!l?g.jsx("img",{src:e,alt:"",className:c(m.img,i),style:u}):g.jsx("span",{"data-supports-mask":l,className:c(m.svg,i),style:{"--svg":C(o),"--fill":s,"--hover-fill":f,...u??{}}})};exports.SvgImage=w;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),j=require("classnames"),o=require("react"),E=require("./RichTextRenderer-DEFXh5o6.js"),u=require("./scalingValue-CSHYgTZl.js"),X=require("./SvgImage-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),j=require("classnames"),o=require("react"),E=require("./RichTextRenderer-DEFXh5o6.js"),u=require("./scalingValue-CSHYgTZl.js"),X=require("./SvgImage-DFlmxAoL.js"),ue=require("./useScopedStyles-Bf6yohVQ.js"),de=require("./readTestimonialTextMeasure-CEPaB4Sy.js"),G=require("./textStylesToCss-CNN3zZTV.js");function he(e){return`
|
|
2
2
|
.${e}-container {
|
|
3
3
|
position: relative;
|
|
4
4
|
overflow-x: clip;
|
|
@@ -3,7 +3,7 @@ import b from "classnames";
|
|
|
3
3
|
import { useState as w, useRef as U, useMemo as Y, useEffect as R, useCallback as N, useLayoutEffect as pe } from "react";
|
|
4
4
|
import { R as Z } from "./RichTextRenderer-D52Xto59.mjs";
|
|
5
5
|
import { s } from "./scalingValue-C9JH5L6O.mjs";
|
|
6
|
-
import { S as E } from "./SvgImage-
|
|
6
|
+
import { S as E } from "./SvgImage-B5mR9y6q.mjs";
|
|
7
7
|
import { u as ve } from "./useScopedStyles-DhBG3557.mjs";
|
|
8
8
|
import { r as we } from "./readTestimonialTextMeasure-BIXpGFEt.mjs";
|
|
9
9
|
import { t as P } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
@@ -8,7 +8,7 @@ import { g as dn, a as hn } from "./getImageRect-CBMhFNHM.mjs";
|
|
|
8
8
|
import { L as pn } from "./LazyVideo-CdAWymKO.mjs";
|
|
9
9
|
import { t as gn } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
10
10
|
import { u as mn } from "./useLazyVideos-CxXyEjRQ.mjs";
|
|
11
|
-
import { H as wn } from "./HiveLightboxTitles-
|
|
11
|
+
import { H as wn } from "./HiveLightboxTitles-DhEeFKWs.mjs";
|
|
12
12
|
function vn(t) {
|
|
13
13
|
return `
|
|
14
14
|
.${t}-titles-row {
|