@cntrl-site/components 1.0.116 → 1.0.118-alpha.0
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-C3yVbQcq.js → Burger-B4kXX9aY.js} +1 -1
- package/dist/{Burger-BkVgNMGU.mjs → Burger-DyORh_vF.mjs} +1 -1
- package/dist/{ChroniclesComponent-0ZWBPdbh.mjs → ChroniclesComponent-DVoJ0kdT.mjs} +12 -12
- package/dist/{ChroniclesComponent-D4_6w8f7.js → ChroniclesComponent-Nm_yIRmr.js} +1 -1
- package/dist/Components/PopupMenu/PopupMenu.d.ts +73 -0
- package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +594 -0
- package/dist/Components/PopupMenu/popupMenuLayout.d.ts +203 -0
- package/dist/Components/PopupMenu/popupMenuSnap.d.ts +61 -0
- package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +7 -0
- package/dist/{ControlSlider-DqKfaKMG.mjs → ControlSlider-3w-bHQEg.mjs} +1 -1
- package/dist/{ControlSlider-C8ckUIDm.js → ControlSlider-DB4nbVLT.js} +1 -1
- package/dist/{FAQ-DLh63Utr.js → FAQ-7HEkaoU6.js} +1 -1
- package/dist/{FAQ-CJHCMSBa.mjs → FAQ-GmiwRdFq.mjs} +1 -1
- package/dist/{Grid-t07NDMzY.mjs → Grid-BuRdth9A.mjs} +201 -196
- package/dist/{Grid-OvzWvUW9.js → Grid-tqSSYh2-.js} +14 -9
- package/dist/{Hive-CzabuuCc.js → Hive-34KvKNsa.js} +1 -1
- package/dist/{Hive-DyxYd5eg.mjs → Hive-7xHXyMM1.mjs} +1 -1
- package/dist/{HiveLightboxTitles-DhEeFKWs.mjs → HiveLightboxTitles-BCoL46-V.mjs} +1 -1
- package/dist/{HiveLightboxTitles-DlyptAaK.js → HiveLightboxTitles-DEeyQGcf.js} +1 -1
- package/dist/{Lightbox-DZckgBzK.js → Lightbox-Cb7lyaNt.js} +1 -1
- package/dist/{Lightbox-BY99NS14.mjs → Lightbox-DzPqgKP4.mjs} +1 -1
- package/dist/{LightboxJournal-Bmw2zm4t.js → LightboxJournal-B-vul_be.js} +14 -8
- package/dist/{LightboxJournal-gePVKQJ4.mjs → LightboxJournal-DisD2DLv.mjs} +340 -334
- package/dist/{LightboxStrip-CTxRwLYk.js → LightboxStrip-YDyEPEb6.js} +14 -8
- package/dist/{LightboxStrip-BPQiQhd3.mjs → LightboxStrip-wCHUhAqN.mjs} +258 -252
- package/dist/{Mercury-B-s2Kvuq.js → Mercury-BmhtFYOw.js} +1 -1
- package/dist/{Mercury-CCW0Es-s.mjs → Mercury-Q788wrYQ.mjs} +1 -1
- package/dist/{OnelinerForm-C2Y_XMCY.js → OnelinerForm-CUmY-bXL.js} +1 -1
- package/dist/{OnelinerForm-BEu7_sho.mjs → OnelinerForm-D8WIB9Qy.mjs} +1 -1
- package/dist/PopupMenu-CYdDyzEt.mjs +1372 -0
- package/dist/PopupMenu-Di1fHgho.js +409 -0
- package/dist/{SimpleButton-C-o2W9bS.mjs → SimpleButton-DTpzfmb6.mjs} +1 -1
- package/dist/{SimpleButton-nGEcO2gB.js → SimpleButton-DtaCYa3y.js} +1 -1
- package/dist/{Slider20-DUi6qwnd.mjs → Slider20-CKngROrc.mjs} +1 -1
- package/dist/{Slider20-BOmjDRf2.js → Slider20-q0iGgnE3.js} +1 -1
- package/dist/SvgImage-CwRq9-ec.mjs +56 -0
- package/dist/SvgImage-_QN8ngad.js +1 -0
- package/dist/{TestimonialSingle-DrnyReim.mjs → TestimonialSingle-Bax71Hyo.mjs} +1 -1
- package/dist/{TestimonialSingle-BORQom3u.js → TestimonialSingle-CpEUendN.js} +1 -1
- package/dist/{Waterfall-DII4-WV5.js → Waterfall-B9YWMhrg.js} +1 -1
- package/dist/{Waterfall-3kKioKh2.mjs → Waterfall-znaoynn5.mjs} +1 -1
- package/dist/components-BYoTPJk3.js +1 -0
- package/dist/{components-BQjon_-7.mjs → components-eK82xypT.mjs} +653 -29
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +23 -22
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +63 -36
- package/dist/loadSvgMaskUrl-B6kHUyof.js +1 -0
- package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +39 -0
- package/dist/sources.js +30 -16
- package/dist/sources.mjs +30 -16
- package/dist/types/Component.d.ts +7 -0
- package/dist/types/SchemaV1.d.ts +3 -0
- package/package.json +1 -1
- package/dist/SvgImage-B5mR9y6q.mjs +0 -51
- package/dist/SvgImage-DFlmxAoL.js +0 -1
- package/dist/components-B8MjlzLL.js +0 -1
- package/dist/loadSvgMaskUrl-DfF7ay6h.js +0 -1
- package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +0 -20
|
@@ -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"),En=require("./useScopedStyles-Bf6yohVQ.js"),Z=require("./useLightboxSwipeDismiss-Br9uE5G0.js"),At=require("./scalingValue-CSHYgTZl.js"),Nn=require("./SvgImage-DFlmxAoL.js"),On=require("./useLightboxScrollLock-Hf16Eq4g.js"),zn=require("./textStylesToCss-CNN3zZTV.js"),Fn=(e,o,u,f)=>{const l=Math.min(Math.abs(e)/Math.max(f,1),1);return o+(u-o)*l},Kn=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Bn=e=>{const o=getComputedStyle(e).transform;return o==="none"?0:new DOMMatrixReadOnly(o).m41},Dn=(e,o,u,{duration:f,easing:l,onComplete:m})=>{const p=e.scrollLeft,w=u-p,R=p-u,N=(A,Q)=>{Kn(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-Bn(o),!1))}},xt=300,Hn=900,Xn=1500,Gn="cubic-bezier(0.16, 1, 0.3, 1)",Vn=3e3,Yn=2,qn=16,Un=.05,Zn=1,Wt=.3,Jn=50,Qn=20,at=.004,Fe=["title1","title2","title3"],Ke={title1:"1",title2:"2",title3:"3"},Pn={title1:"title1Color",title2:"title2Color",title3:"title3Color"},tr={title1:.02,title2:.02,title3:.02},Ct=e=>`max(${e}, ${Qn}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")],er=()=>({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)}},nr=(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},ne=(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[Pn[o]]}},rr=(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),re=(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??tr[e],lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,wordSpacing:o.wordSpacing,textAlign:o.textAlign,textAppearance:o.textAppearance,color:o.color??"#ffffff"};return zn.textStylesToCss(f,u)},or=({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:Ve,thumbnailActiveColor:Ye,title1Width:kt,title2Width:ie,title3Width:se,title1MarginLeft:W=0,title2MarginLeft:le=0,title3MarginLeft:ae=0,titleRowMarginBottom:ce=0,titleHeaderLayout:ue="desktop",contentMarginTop:qe,iconMarginLeft:Ue}=u,P=t=>At.scalingValue(t,f??!1),Ze=R??u.thumnailSize??.03,fe=P(Ze),Et=P(N),Nt=P(M??.02),ut=P(J??0),he=P(qe??0),Je=Ct(he),de=P(Ue??0),[tt,Ot]=a.useState(0),C=a.useRef(tt);C.current=tt;const Qe=o[tt],{title1:zt,title2:Ft,title3:Kt}=De(Qe),me=re("title1",ne(u,"title1"),f),pe=re("title2",ne(u,"title2"),f),ge=re("title3",ne(u,"title3"),f),j=ue==="mobile",G=!l&&(!f||m),ft=G,ht=G,Pe=G,xe=Z.isImageRatioCover(bt),tn=xe?{"--image-aspect-ratio":Z.getAspectRatio(bt)}:void 0,ve=!!(zt||Ft||Kt),x=a.useMemo(()=>nr(e,zt,Ft,Kt,me,pe,ge),[e,tt,zt,Ft,Kt,me,pe,ge]),et=a.useMemo(()=>({title1Width:kt,title2Width:ie,title3Width:se}),[kt,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]),_=a.useMemo(()=>x.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[x]),St=a.useMemo(()=>ze(wt,et),[wt,et]),B=a.useMemo(()=>ze(_,et),[_,et]),Bt=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=_.indexOf(t);return{effectiveWidth:B.effective[i]??0,resolvedWidth:B.resolved[i]??0,maxWidth:jt(i,B.resolved)}},[_,B,be,z,x,wt,St,j]),y=a.useCallback(t=>At.scalingValue(t,f??!1),[f]),en=y(ce??0),k=a.useMemo(()=>({title1MarginLeft:W,title2MarginLeft:le,title3MarginLeft:ae}),[W,le,ae]),nn=a.useCallback(t=>x.slice(0,t+1).reduce((n,r,i)=>n+(r!=null&&r.marginLeftKey?k[r.marginLeftKey]??0:0)+(z[i]??0),0)+(j?0:W??0),[x,k,z,j,W]),rn=a.useCallback(()=>j?0:W??0,[j,W]),Dt=a.useCallback(t=>_.slice(0,t).reduce((n,r,i)=>n+(r.marginLeftKey?k[r.marginLeftKey]??0:0)+(B.resolved[i]??0),0),[_,B.resolved,k]),on=a.useCallback(t=>{const n=_[t];return Dt(t)+(n.marginLeftKey?k[n.marginLeftKey]??0:0)+(B.resolved[t]??0)},[_,B.resolved,Dt,k]),Ht=(t,n)=>{const r=t.marginLeftKey?k[t.marginLeftKey]??0:0,{effectiveWidth:i,resolvedWidth:s,maxWidth:h}=Bt(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)},sn=()=>{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]:kt??0;return c.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s),style:{position:"absolute",top:0,left:0,width:`max(${y(i)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,r=x.flatMap((i,s)=>{if(!i.marginLeftKey)return[];const h=k[i.marginLeftKey]??0,d=rr(x,z,k,s)+rn();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},ln=()=>x.map((t,n)=>{const r=jt(n,z),s=nn(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`)}),an=()=>_.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const r=k[t.marginLeftKey]??0,i=Dt(n),{resolvedWidth:s}=Bt(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)}),cn=()=>_.map((t,n)=>{const{maxWidth:r}=Bt(t,"two-row-bottom"),s=on(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`)}),un=a.useRef(null),v=a.useRef(null),Xt=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),Gt=a.useRef(0),Vt=a.useRef("forward"),D=a.useRef(0),H=a.useRef(null),V=a.useRef(!1),$=o.length>1&&(!l||!!m),Yt=$?3:1,fn=a.useMemo(()=>Array.from({length:Yt},()=>o).flat(),[o,Yt]),[hn,we]=a.useState(!1),[Se,$e]=a.useState(!1),[dn,qt]=a.useState(!0),Y=a.useRef(null),ot=a.useRef(null),Ut=a.useRef(!1),Le=a.useRef(!1),Zt=a.useRef(null),q=a.useRef(null),Te=ft&&!dn,F=a.useCallback(()=>{ft&&(qt(!0),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>{b.current.isActive||qt(!1)},Vn))},[ft]),mt=a.useCallback(()=>{l||Le.current||(Le.current=!0,$e(!1),Zt.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(Nn.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"}:{}}}),mn=()=>{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&&Ht(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=>Ht(i,"two-row-bottom")),l&&c.jsxs(c.Fragment,{children:[an(),cn()]})]}):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:en,width:"100%",flexShrink:0,pointerEvents:l?"auto":"none"}})]}):null]})},pn=()=>c.jsxs(c.Fragment,{children:[(W??0)>0||l?Ie("single-row"):null,x.map(t=>Ht(t,"single-row")),l?c.jsxs(c.Fragment,{children:[sn(),ln()]}):null,I?Re():null]}),Jt=a.useCallback(t=>!!(t.closest("[data-controls]")||t.closest(`.${e}-thumbnails`)||t.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:gn,backdropStyle:xn,mediaAreaStyle:vn,overlayContentStyle:bn,swipeHandlers:yn,dismissAreaStyle:wn}=Z.useLightboxSwipeDismiss({enabled:G??!1,onClose:mt,animMs:xt,isBlockedTarget:Jt}),Qt=()=>{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=Qt();!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<Yt;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},Pt=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&&Pt(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")})},Sn=(t,n,r)=>{const i=t-n,s=it(n),h=S.current[s];if(Pt(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]),te=a.useCallback((t=!1)=>{t&&(Ut.current=!0),ot.current===null&&(ot.current=requestAnimationFrame(()=>{ot.current=null;const n=Ut.current;Ut.current=!1,je(n)}))},[je]),$n=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);Ot(t),te(r||i)},[o.length,$,te]),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&&$n(n)},Ln=()=>{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*Un,U(),K(),F(),H.current=requestAnimationFrame(Me)},_e=()=>{const t=Xt.current;t&&(t.style.transition="",t.style.transform="",t.style.willChange="")},ke=(t,n,r,i)=>{_e(),t.scrollLeft=n,Gt.current=t.scrollLeft,U(),r!==void 0?(C.current=r,Ot(r)):K(),X(!0),i==null||i()},Ee=(t,{behavior:n="smooth",activeIndex:r,onComplete:i}={})=>{const s=v.current,h=Xt.current;if(!s||!h)return;if(Tt(),pt(),X(!1),n==="auto"){ke(s,t,r,i);return}const d=Math.abs(t-s.scrollLeft),g=Fn(d,Hn,Xn,s.clientWidth*.55);rt.current=Dn(s,h,t,{duration:g,easing:Gn,onComplete:()=>{rt.current=null,ke(s,t,r,i)}})},Tn=(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})},Rn=(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(Pt(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 Mn=r??d%o.length,_n=Sn(i??s.scrollLeft,t,Mn);st(_n,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}Tn("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,Ot(t),te(!0),Ee(s.offsetLeft,{behavior:n,activeIndex:t,onComplete:n==="smooth"?Ln:void 0}))},ee=()=>{dt.current&&(window.removeEventListener("pointerup",dt.current),window.removeEventListener("pointercancel",dt.current),dt.current=null)},In=(t,n,r,i,s)=>{const h=r-t,d=i-n,g=Math.abs(h),L=Math.abs(d);if(g<Jn||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;ee();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?Rn(r,"smooth",i,h):(X(!0),K()),F()},An=(t,n)=>{const r=Lt.current;Lt.current=null,r&&(In(r.startX,r.startY,t,n,r.startActiveIndex),F())},Wn=t=>{if(!ht)return;if(t.pointerType==="touch"){if(Tt(),X(!0),Jt(t.target))return;Lt.current={startX:t.clientX,startY:t.clientY,startActiveIndex:C.current};return}if(t.pointerType!=="mouse"||t.button!==0||Jt(t.target))return;const n=v.current;if(!n)return;Tt(),pt(),_e(),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),ee();const r=i=>{i.pointerType==="mouse"&&Rt(i.pointerId)};dt.current=r,window.addEventListener("pointerup",r),window.addEventListener("pointercancel",r)},Cn=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)>Zn&&(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"?An(t.clientX,t.clientY):Lt.current=null;return}t.pointerType==="mouse"&&Rt(t.pointerId)}},jn=t=>{!ht||t.pointerType!=="mouse"||Rt(t.pointerId)};return On.useLightboxScrollLock(),a.useEffect(()=>{const t=requestAnimationFrame(()=>$e(!0));return()=>{cancelAnimationFrame(t),pt(),ee(),ot.current!==null&&(cancelAnimationFrame(ot.current),ot.current=null),Zt.current&&clearTimeout(Zt.current),q.current&&clearTimeout(q.current)}},[]),a.useEffect(()=>{if(!ft){qt(!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(()=>{Qt()},[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?qn:r.deltaMode===2?t.clientHeight:1,s=r.deltaY*i*Yn;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-Gt.current;Gt.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!==Vt.current&&(Vt.current=d,Ce(d))}b.current.isActive&&b.current.hasMoved||K()};t.addEventListener("scroll",n,{passive:!0});const r=new ResizeObserver(()=>{Qt(),U(b.current.isActive),Ce(Vt.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:()=>{gn||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,...xn}}),c.jsxs("div",{ref:un,className:`${e}-lightbox-dismiss-area`,style:wn,...yn,children:[c.jsx("div",{className:`${e}-lightbox-content`,style:vn,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":hn?"true":"false",onPointerDown:Wn,onPointerMove:Cn,onPointerUp:Ne,onPointerCancel:Ne,onLostPointerCapture:jn,children:c.jsx("div",{ref:Xt,className:`${e}-lightbox-strip-track`,style:{gap:ut},children:fn.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:bn,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:Je,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?mn():ve||I?pn():null})})})]}),o.length>1&&ct==="on"&&(()=>{const t=Ct(Nt),n=`calc(-0.5 * (${Nt} + ${t}))`;return c.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:Nt},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":Ve,style:{gap:Et,"--thumbnail-active-color":Ye},children:[o.map((r,i)=>{const s=Ct(Et),h=`calc(-0.5 * (${s} + ${Et}))`;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:()=>Pe&&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:{...tn,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}})]})})})})()]})]})},Mt=400,_t="cubic-bezier(0.25, 0.1, 0.25, 1)",Ge=1.1,ir=`${((1-1/Ge)/2*100).toFixed(4)}%`;function sr(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-_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`
|
|
2
2
|
.${e}-wrapper {
|
|
3
3
|
position: relative;
|
|
4
4
|
width: 100%;
|
|
@@ -43,23 +43,29 @@
|
|
|
43
43
|
max-width: 100%;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
@property --${e}-hover-zoom {
|
|
47
|
+
syntax: '<number>';
|
|
48
|
+
inherits: false;
|
|
49
|
+
initial-value: 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
46
52
|
.${e}-hover-zoom-in .${e}-cover-image {
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
transform: scale(var(--${e}-hover-zoom));
|
|
54
|
+
clip-path: inset(calc(50% - 50% / var(--${e}-hover-zoom)));
|
|
55
|
+
transition: --${e}-hover-zoom ${ne}ms ${re};
|
|
49
56
|
}
|
|
50
57
|
|
|
51
58
|
.${e}-hover-scale-down .${e}-cover-image {
|
|
52
|
-
transition: transform ${
|
|
59
|
+
transition: transform ${ne}ms ${re};
|
|
53
60
|
}
|
|
54
61
|
|
|
55
62
|
.${e}-hover-greyscale .${e}-cover-image {
|
|
56
|
-
transition: filter ${
|
|
63
|
+
transition: filter ${ne}ms ${re};
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
@media (hover: hover) {
|
|
60
67
|
.${e}-hover-zoom-in .${e}-cover:hover .${e}-cover-image {
|
|
61
|
-
|
|
62
|
-
clip-path: inset(${ir});
|
|
68
|
+
--${e}-hover-zoom: ${or};
|
|
63
69
|
}
|
|
64
70
|
.${e}-hover-scale-down .${e}-cover:hover .${e}-cover-image {
|
|
65
71
|
transform: scale(0.9);
|
|
@@ -409,4 +415,4 @@
|
|
|
409
415
|
pointer-events: auto;
|
|
410
416
|
z-index: 10;
|
|
411
417
|
}
|
|
412
|
-
`}const
|
|
418
|
+
`}const sr=({settings:e,content:o,isEditor:u,isEditMode:f,isPreviewMode:l,portalId:m})=>{const{prefix:p}=_n.useScopedStyles(),{cover:w,coverFit:R,hover:N="none"}=e,M=N!=="none"&&(!u||l)?` ${p}-hover-${N}`:"",J=a.useRef(null),[I,O]=a.useState(!1),A=o??[],Q=I&&A.length>0,vt=()=>{A.length!==0&&O(!0)};return a.useEffect(()=>{!u||f||l||O(!1)},[u,f,l]),c.jsxs(c.Fragment,{children:[c.jsxs("div",{ref:J,className:`${p}-wrapper${M}`,children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:ir(p)}}),w&&c.jsx("div",{className:`${p}-cover ${Z.isImageRatioCover(R)?`${p}-ratio-wrapper-cover`:`${p}-ratio-wrapper-fit`}`,onClick:()=>vt(),style:{...Z.isImageRatioCover(R)?{"--image-aspect-ratio":Z.getAspectRatio(R)}:{}},"aria-label":"Open image gallery",children:c.jsx("img",{className:`${p}-cover-image ${Z.isImageRatioCover(R)?`${p}-cover-image-cover`:`${p}-cover-image-fit`}`,src:w,alt:"cover"})})]}),Q&&typeof document<"u"&&(()=>{const ct=(m?document.getElementById(m):null)??document.body;return kn.createPortal(c.jsx(rr,{prefix:p,images:A,settings:e,isEditor:u,isEditMode:f,isPreviewMode:l,onClose:()=>O(!1)}),ct)})()]})};exports.LightboxStrip=sr;exports.STRIP_TEXT_STYLE_PREFIXES=Fe;exports.STRIP_TEXT_STYLE_TAB_LABELS=Ke;exports.createStripTextStylePanelTab=tr;exports.createStripTextStyleTabContentItems=He;exports.extractTitlesFromLegacyText=Be;exports.getStripTextStyleSettingKey=E;exports.resolveStripItemTitles=De;
|