@cntrl-site/components 1.0.116 → 1.0.117

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.
@@ -4,13 +4,13 @@ import { Marquee as wt } from "./Marquee-_xVuf-zp.mjs";
4
4
  import { MarqueeText as Ht } from "./MarqueeText-C2E6UDsb.mjs";
5
5
  import { TestimonialGrid as It } from "./TestimonialGrid-C-8IDzWu.mjs";
6
6
  import { TestimonialSingle as Wt } from "./TestimonialSingle-DrnyReim.mjs";
7
- import { Grid as Pt } from "./Grid-t07NDMzY.mjs";
7
+ import { Grid as Pt } from "./Grid-Dud7PLS9.mjs";
8
8
  import { Hive as At } from "./Hive-DyxYd5eg.mjs";
9
9
  import { J as F, w as i, x as gt, y as ut, z as kt } from "./utils-FxC9rcxw.mjs";
10
10
  import { createListTextStylePanelTab as zt, LIST_TEXT_STYLE_PREFIXES as B, applyListColumnCountChange as Et, List as Bt, getListColumnTextSettingKey as l, COLUMN_TEXT_PREFIXES as _t, COLUMN_CONTENT_KEYS as _, normalizeListColumnVerticalAlign as Dt, CUT_LABEL_TEXT_PREFIX as D, COLUMN_VALIGN_BASIC_OPTIONS as q } from "./List-Bh_-l9vD.mjs";
11
11
  import { FAQ as Rt } from "./FAQ-CJHCMSBa.mjs";
12
- import { STRIP_TEXT_STYLE_PREFIXES as I, createStripTextStylePanelTab as jt, LightboxStrip as Nt, getStripTextStyleSettingKey as p } from "./LightboxStrip-BPQiQhd3.mjs";
13
- import { LightboxJournal as Gt } from "./LightboxJournal-gePVKQJ4.mjs";
12
+ import { STRIP_TEXT_STYLE_PREFIXES as I, createStripTextStylePanelTab as jt, LightboxStrip as Nt, getStripTextStyleSettingKey as p } from "./LightboxStrip-Cuhb2fIR.mjs";
13
+ import { LightboxJournal as Gt } from "./LightboxJournal-BDUs6T0B.mjs";
14
14
  import { ClickGallerie as Qt } from "./ClickGallerie-Cjc_1Gxy.mjs";
15
15
  import { Scale as Ot } from "./Scale-TnkWtRrs.mjs";
16
16
  import { SimpleButton as Xt } from "./SimpleButton-C-o2W9bS.mjs";
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),Wt=require("./react-splide.esm-CabaEmHi.js");;/* empty css */const f=require("./scalingValue-CSHYgTZl.js"),ni=require("./buildColorVars-CE2D5cQV.js"),ri=require("./useScopedStyles-Bf6yohVQ.js"),qt=require("./useLazyVideos-CdCbc2j0.js"),ct=require("./LinkWrapper-CTqM1ucO.js"),H=require("./EmbedMediaFrame-DsOTKE4i.js"),r=require("react"),si=require("react-dom"),Re=require("./textStylesToCss-CNN3zZTV.js"),oi=require("./SvgImage-DFlmxAoL.js"),Bt=require("./LazyVideo-imbU18js.js");function li(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Et(e){return((e==null?void 0:e.trim().length)??0)>0}function Ct(e,i,n,a){return i!==void 0&&i<(e??.01)?`${n} ${a}`:n}function It(e,i,n,a){const o=e??.01;return i===void 0||i>=o?{}:{[`--${n}-title-leading-gap`]:f.scalingValue((o-i)/2,a)}}const dt=400,ut="cubic-bezier(0.25, 0.1, 0.25, 1)",kt=1.1,ai=`${((1-1/kt)/2*100).toFixed(4)}%`,Tt="--grid-media-radius";function ci(e){return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),Mt=require("./react-splide.esm-CabaEmHi.js");;/* empty css */const f=require("./scalingValue-CSHYgTZl.js"),ii=require("./buildColorVars-CE2D5cQV.js"),ni=require("./useScopedStyles-Bf6yohVQ.js"),Dt=require("./useLazyVideos-CdCbc2j0.js"),ct=require("./LinkWrapper-CTqM1ucO.js"),H=require("./EmbedMediaFrame-DsOTKE4i.js"),r=require("react"),ri=require("react-dom"),Ne=require("./textStylesToCss-CNN3zZTV.js"),si=require("./SvgImage-DFlmxAoL.js"),Ht=require("./LazyVideo-imbU18js.js");function oi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ot(e){return((e==null?void 0:e.trim().length)??0)>0}function St(e,i,n,a){return i!==void 0&&i<(e??.01)?`${n} ${a}`:n}function jt(e,i,n,a){const o=e??.01;return i===void 0||i>=o?{}:{[`--${n}-title-leading-gap`]:f.scalingValue((o-i)/2,a)}}const Ct=400,It="cubic-bezier(0.25, 0.1, 0.25, 1)",li=1.1,qt="--grid-media-radius";function ai(e){return`
2
2
  .${e}-wrapper {
3
3
  display: grid;
4
4
  align-items: start;
5
5
  justify-content: center;
6
- min-height: ${li(48)};
6
+ min-height: ${oi(48)};
7
7
  }
8
8
  .${e}-item {
9
9
  display: flex;
@@ -140,22 +140,27 @@
140
140
  .${e}-show-text-hover .${e}-item-inner-hidden:hover .${e}-item-subtitle {
141
141
  opacity: 1;
142
142
  }
143
+ @property --${e}-hover-zoom {
144
+ syntax: '<number>';
145
+ inherits: false;
146
+ initial-value: 1;
147
+ }
143
148
  .${e}-hover-zoom-in .${e}-item-image,
144
149
  .${e}-hover-zoom-in .${e}-item-video {
145
- clip-path: inset(0 round var(${Tt}, 0px));
146
- transition: transform ${dt}ms ${ut}, clip-path ${dt}ms ${ut};
150
+ transform: scale(var(--${e}-hover-zoom));
151
+ clip-path: inset(calc(50% - 50% / var(--${e}-hover-zoom)) round calc(var(${qt}, 0px) / var(--${e}-hover-zoom)));
152
+ transition: --${e}-hover-zoom ${Ct}ms ${It};
147
153
  }
148
154
  .${e}-hover-scale-down .${e}-item-image,
149
155
  .${e}-hover-scale-down .${e}-item-video {
150
- transition: transform ${dt}ms ${ut};
156
+ transition: transform ${Ct}ms ${It};
151
157
  }
152
158
  .${e}-hover-greyscale .${e}-item-image-wrapper {
153
- transition: filter ${dt}ms ${ut};
159
+ transition: filter ${Ct}ms ${It};
154
160
  }
155
161
  @media (hover: hover) {
156
162
  .${e}-hover-zoom-in .${e}-item-image-wrapper:has(.${e}-item-image:hover, .${e}-item-video:hover) :is(.${e}-item-image, .${e}-item-video) {
157
- transform: scale(${kt});
158
- clip-path: inset(${ai} round calc(var(${Tt}, 0px) / ${kt}));
163
+ --${e}-hover-zoom: ${li};
159
164
  }
160
165
  .${e}-hover-scale-down .${e}-item-image-wrapper:hover .${e}-item-image,
161
166
  .${e}-hover-scale-down .${e}-item-image-wrapper:hover .${e}-item-video {
@@ -400,4 +405,4 @@
400
405
  left: 50%;
401
406
  transform: translate(-50%, -50%);
402
407
  }
403
- `}function di(){return Math.random()<.5?"ltr":"ttb"}function ui(e){const i=e.Components.Autoplay;i&&(i.pause(!1),i.play())}function mi(e){const i=di();e.options.direction!==i&&(e.options={...e.options,direction:i}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ui(e)})})}const D=500,gi=750,le="cubic-bezier(0.22, 1, 0.36, 1)",hi=72,pi=50;function fi(e){if(!Array.isArray(e)||e.length===0)return!1;const i=e[0];return i!==null&&typeof i=="object"&&"media"in i&&Array.isArray(i.media)}function $i(e){const[i,n]=e.media;return n!=null&&n.assetId?n:i!=null&&i.assetId?i:null}function yi(e){const[i]=e.media;return i!=null&&i.assetId?i:null}function Gt(e){return!Array.isArray(e)||e.length===0?[]:fi(e)?e.flatMap(i=>{const n=$i(i);if(!n)return[];const a=yi(i);return[{displayMedia:n,lightboxMedia:a!=null&&a.assetId?a:null}]}):e.filter(i=>i==null?void 0:i.assetId).map(i=>({displayMedia:i,lightboxMedia:i}))}function xe(e){return!H.isEmbedMedia(e)&&e.type==="video"}function xi(e){const i=new Set,n=[];for(const a of e){const o=Gt(a.gallery);for(const x of o){const y=x.lightboxMedia;y!=null&&y.assetId&&!i.has(y.assetId)&&(i.add(y.assetId),n.push(y))}}return n}function vi({mediaList:e}){const[i,n]=r.useState(null);qt.useLazyVideos(i,{preload:"metadata"});const a=e.filter(o=>!H.isEmbedMedia(o));return a.length===0?null:t.jsx("div",{ref:n,"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:a.map(o=>xe(o)?t.jsx("video",{src:o.assetId,preload:"none",muted:!0,playsInline:!0},o.assetId):t.jsx("img",{src:o.assetId,alt:""},o.assetId))})}function wi(e){e.pause(),e.removeAttribute("src"),e.load()}const bi=".splide__slide video";function Si(e){var o;if(e.closest(".splide--fade, .splide__slide.is-active:not(.splide__slide--clone), .splide__slide.is-next"))return!0;const i=e.closest(".splide__slide");if(!i||i.classList.contains("splide__slide--clone"))return!1;const n=i.dataset.slideIndex,a=(o=i.parentElement)==null?void 0:o.querySelector(".splide__slide.is-next");return n!==void 0&&(a==null?void 0:a.dataset.slideIndex)===n}function Dt({media:e,className:i,style:n,hasLightbox:a,isSplideSlide:o=!1,onMediaClick:x}){if(H.isEmbedMedia(e))return t.jsx(H.EmbedMediaFrame,{media:e,fit:n.objectFit==="contain"?"contain":"cover",silentLoop:a,className:i,style:{...n,cursor:x?"pointer":"default"},onClick:x});if(xe(e)){const y={src:e.assetId,className:i,style:{...n,cursor:x?"pointer":"default"},muted:!0,loop:!0,playsInline:!0,onClick:x};return o?t.jsx("video",{...y,preload:"none"}):t.jsx(Bt.LazyVideo,{...y,autoPlay:!0})}return t.jsx("img",{src:e.assetId,alt:e.name,className:i,style:{...n,cursor:x?"pointer":"default"},onClick:x})}function ji({className:e,style:i,children:n}){const[a,o]=r.useState(null);return qt.useLazyVideos(a,{autoPlay:!0,selector:bi,shouldPlay:Si}),t.jsx("div",{ref:o,className:e,style:i,children:n})}function Ht(e){const i=e.getBoundingClientRect();return{width:i.width,height:i.height,left:i.left,top:i.top}}function Ci(e,i){if(!i||!i.width||!i.height||!e.width||!e.height)return e;const n=i.width/i.height,a=e.width/e.height;if(n>a){const x=e.width/n;return{width:e.width,height:x,left:e.left,top:e.top+(e.height-x)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function Ii({src:e,mediaRef:i,mediaStyle:n,onLoadedMetadata:a}){return r.useEffect(()=>{const o=i.current;if(o)return()=>{wi(o)}},[e,i]),t.jsx("video",{ref:i,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:a,style:n})}const ki="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",Ti=.004;function Li({prefix:e,closeIcon:i=ki,closeIconMaxWidth:n=.0125,closeIconColor:a="#FFFFFF",closeIconHoverColor:o="#999999",iconMarginRight:x=.01,contentMarginTop:y=.01,isEditor:q,isPreviewMode:ae,isEditMode:s,visible:V,onClose:Z}){if(!i)return null;const J=f.scalingValue(n,q),ce=f.scalingValue(x,q),ve=f.scalingValue(y,q),S=f.scalingValue(Math.max(y,Ti),q);return t.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:V?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[t.jsx("div",{style:{position:"relative",width:"100%",height:ve,flexShrink:0},children:s&&t.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:S,pointerEvents:V?"auto":"none"}})}),t.jsxs("div",{className:`${e}-close-icon`,style:{width:J,height:J,marginRight:ce,pointerEvents:V?"auto":"none"},onClick:j=>j.stopPropagation(),children:[t.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:j=>{j.stopPropagation(),Z()},children:t.jsx(oi.SvgImage,{url:i,fill:a,hoverFill:q&&!ae?a:o,className:`${e}-close-icon-img`})}),s&&t.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ce,height:"100%",pointerEvents:V?"auto":"none"}})]})]})}function _i({prefix:e,items:i,index:n,imageDisplay:a,isEditor:o,isPreviewMode:x,isEditMode:y,onClose:q,onPrev:ae,onNext:s,counterClassName:V,counterStyle:Z,closeIcon:J,closeIconMaxWidth:ce,closeIconColor:ve,closeIconHoverColor:S,iconMarginRight:j,contentMarginTop:Xe}){const we=a==="cover",ze=r.useRef(null),de=r.useRef(null),ue=r.useRef(null),L=r.useRef(null),B=r.useRef(0),_=r.useRef(0),N=r.useRef("none"),G=r.useRef(!1),Q=r.useRef(!1),Ue=r.useRef(null),k=r.useRef(0),M=r.useRef(null),R=r.useRef(!1),ie=r.useRef(null),X=r.useRef(null),Fe=r.useRef(null),Ye=r.useRef(()=>{}),[m,Ve]=r.useState(null),[c,mt]=r.useState(null),[w,be]=r.useState("opening"),[P,O]=r.useState(0),[me,W]=r.useState(0),[Ae,ne]=r.useState(null),[Me,ge]=r.useState(!1),[Se,he]=r.useState(!1),[gt,Ke]=r.useState(!1),[ht,Ze]=r.useState(null),Oe=r.useRef(n),Je=r.useRef(void 0),d=i[n],pt=d?xe(d):!1,Qe=d?H.isEmbedMedia(d):!1,je=Ae!==null,Pe=r.useCallback(l=>{const u=l.currentTarget,I=u instanceof HTMLVideoElement?{width:u.videoWidth,height:u.videoHeight}:{width:u.naturalWidth,height:u.naturalHeight};!I.width||!I.height||Ze(I)},[]);r.useEffect(()=>{Ue.current=c},[c]),r.useEffect(()=>{const l=ze.current;if(!l)return;const u=()=>mt(Ht(l));u();const I=new ResizeObserver(u);return I.observe(l),()=>I.disconnect()},[]);const C=r.useCallback(()=>{ie.current!==null&&(window.clearTimeout(ie.current),ie.current=null)},[]),U=r.useCallback(()=>{const l=X.current;X.current=null,C(),M.current=null,R.current=!1,ne(null),ge(!1),W(0),k.current=0,he(!1),G.current=!1,_.current=0,N.current="none",l===1?s():l===-1&&ae()},[C,s,ae]),Ce=r.useCallback(()=>{C(),X.current=null,M.current=null,R.current=!1,ne(null),ge(!1),W(0),k.current=0},[C]),ft=r.useCallback(()=>{C(),ie.current=window.setTimeout(()=>{X.current!==null&&U()},D+32)},[C,U]),pe=r.useCallback((l,u)=>{var ee;const I=((ee=Ue.current)==null?void 0:ee.width)??0;if(C(),M.current=l,ne(l),R.current=!0,ge(!0),u){X.current=l;const se=-l*I;k.current=se,W(se),ft();return}k.current=0,W(0),ie.current=window.setTimeout(()=>{ie.current=null,Ce()},D+32)},[C,Ce,ft]),fe=r.useCallback(l=>{if(!(i.length<=1)){if(R.current){if(X.current===l){Fe.current=l,U();return}Ce()}C(),M.current=l,ne(l),R.current=!1,ge(!1),k.current=0,W(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{pe(l,!0)})})}},[i.length,pe,U,Ce,C]);Ye.current=fe;const Ie=r.useCallback(l=>{l.propertyName!=="transform"||!R.current||X.current!==null&&U()},[U]),$e=r.useCallback(()=>{const l=de.current;if(!l)return;const u=Ht(l);!u.width||!u.height||Ve(u)},[]);r.useEffect(()=>{$e();const l=de.current;if(!l)return;const u=new ResizeObserver(()=>$e());return u.observe(l),()=>u.disconnect()},[$e]),r.useEffect(()=>{w==="opening"&&m&&be("open")},[w,m]),r.useEffect(()=>{if(w!=="closing")return;const l=setTimeout(()=>q(),D);return()=>clearTimeout(l)},[w,q]),r.useEffect(()=>()=>{C()},[C]),r.useLayoutEffect(()=>{Oe.current===n&&Je.current===(d==null?void 0:d.assetId)||(C(),X.current=null,ne(null),O(0),W(0),ge(!1),Ke(!1),he(!1),Ze(null),B.current=0,_.current=0,N.current="none",G.current=!1,R.current=!1,k.current=0,M.current=null,L.current=null,Q.current=!1,Oe.current=n,Je.current=d==null?void 0:d.assetId)},[n,d==null?void 0:d.assetId,C]),r.useLayoutEffect(()=>{const l=Fe.current;l!==null&&(Fe.current=null,requestAnimationFrame(()=>{Ye.current(l)}))},[n,d==null?void 0:d.assetId]),r.useEffect(()=>{if(w!=="open")return;let l=null;const u=()=>{l&&(document.removeEventListener("click",l,!0),l=null)},I=()=>{u(),l=h=>{h.stopPropagation(),h.preventDefault(),u()},document.addEventListener("click",l,!0)},ee=h=>{const z=h<0?1:-1;if(Math.abs(h)>pi&&i.length>1){pe(z,!0);return}pe(z,!1)},se=h=>{if(h.touches.length!==1||R.current)return;const z=h.touches[0];Q.current=!0,L.current={x:z.clientX,y:z.clientY},N.current="none",_.current=0,G.current=!1},He=h=>{if(!L.current||h.touches.length!==1||R.current)return;const z=h.touches[0],te=z.clientX-L.current.x,v=z.clientY-L.current.y;if(N.current==="none"){if(Math.abs(te)<10&&Math.abs(v)<10)return;if(Math.abs(te)>Math.abs(v)){if(i.length<=1)return;N.current="horizontal"}else if(v>0)N.current="vertical";else return}if(N.current==="horizontal"){G.current=!0,he(!0),_.current=te;const F=te<0?1:-1;M.current!==F&&(M.current=F,ne(F)),k.current=te,W(te),h.preventDefault();return}N.current==="vertical"&&(G.current=!0,he(!0),B.current=v,O(v),h.preventDefault())},Le=()=>{if(!L.current)return;const h=N.current,z=G.current;if(z&&h==="horizontal")ee(_.current),I();else if(z&&h==="vertical")if(B.current>hi){const v=window.innerHeight;B.current=v,Ke(!0),O(v),be("closing")}else B.current=0,O(0),I();else h==="horizontal"&&Math.abs(_.current)>0&&(ee(_.current),I());L.current=null,N.current="none",_.current=0,G.current=!1,he(!1)};return document.addEventListener("touchstart",se,{passive:!0}),document.addEventListener("touchmove",He,{passive:!1}),document.addEventListener("touchend",Le),document.addEventListener("touchcancel",Le),()=>{document.removeEventListener("touchstart",se),document.removeEventListener("touchmove",He),document.removeEventListener("touchend",Le),document.removeEventListener("touchcancel",Le),u()}},[w,i.length,pe]),r.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),w!=="closing"&&be("closing"))};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[w]);const ke=()=>{w!=="closing"&&be("closing")},ye=w==="open",We=w==="closing",$t=P>0?Math.max(0,1-P/500):1,yt=P>0?Math.max(.35,1-P/500):1,xt=Qe&&d?{width:H.getEmbedAspect(d),height:1}:ht,g=m?we?m:Ci(m,xt):null,et={position:"fixed",top:c==null?void 0:c.top,left:c==null?void 0:c.left,width:c==null?void 0:c.width,height:c==null?void 0:c.height,zIndex:9998},Y=we?"cover":"contain",vt=me!==0||P>0?`translate(${me}px, ${P}px)`:void 0,Te=Se&&!Me?"none":Me?`transform ${D}ms ${le}`:gt?`transform ${D}ms ${le}, opacity ${D}ms ${le}`:w==="opening"||We?`opacity ${D}ms ${le}`:"none",Ee={...et,transform:vt,opacity:P>0?yt:w==="opening"||We?0:1,transition:Te,pointerEvents:"none"},De={position:"absolute",top:((g==null?void 0:g.top)??0)-((c==null?void 0:c.top)??0),left:((g==null?void 0:g.left)??0)-((c==null?void 0:c.left)??0),width:g==null?void 0:g.width,height:g==null?void 0:g.height,objectFit:Y,pointerEvents:"none"},tt=(c==null?void 0:c.width)??0,re=je?(n+Ae+i.length)%i.length:null,T=re!==null?i[re]:null,Lt={...et,transform:je?`translateX(${Ae*tt+me}px)`:void 0,opacity:1,transition:Me?`transform ${D}ms ${le}`:"none",pointerEvents:"none"},it={position:"absolute",top:((m==null?void 0:m.top)??0)-((c==null?void 0:c.top)??0),left:((m==null?void 0:m.left)??0)-((c==null?void 0:c.left)??0),width:m==null?void 0:m.width,height:m==null?void 0:m.height,objectFit:Y,pointerEvents:"none"},wt=Qe&&d&&H.getEmbedPlayback(d).controls&&g?Math.min(52,g.height*.2):0,E=g?{position:"fixed",top:g.top,height:g.height-wt,width:g.width/2,zIndex:9999}:null;return t.jsxs("div",{ref:ze,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:w==="open"?"none":void 0},onClick:ke,children:[t.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:ye?$t:0,transition:Se?"none":`opacity ${D}ms ${le}`,pointerEvents:"none"}}),t.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:we?t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:de,style:{position:"absolute",inset:0}}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${D}ms ${le}`,pointerEvents:"none",zIndex:9999},children:i.length>1&&t.jsxs("p",{className:V,style:Z,children:[n+1," / ",i.length]})})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{height:"10%"}}),t.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx("div",{ref:de,style:{width:"100%",height:"100%"}})}),t.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${D}ms ${le}`},children:i.length>1&&t.jsxs("p",{className:V,style:Z,children:[n+1," / ",i.length]})})]})}),m&&c&&T&&t.jsx("div",{style:Lt,onTransitionEnd:Ie,children:H.isEmbedMedia(T)?t.jsx("img",{src:T.thumbnail,alt:T.name,style:it},`neighbor-${re}-${T.assetId}`):xe(T)?t.jsx("video",{src:T.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",style:it},`neighbor-${re}-${T.assetId}`):t.jsx("img",{src:T.assetId,alt:T.name,style:it},`neighbor-${re}-${T.assetId}`)}),m&&c&&d&&t.jsx("div",{style:Ee,onTransitionEnd:Ie,children:Qe?t.jsx(H.EmbedMediaFrame,{media:d,fit:we?"cover":"contain",lazy:!1,startsAtOnce:!0,style:De},`${n}-${d.assetId}`):pt?t.jsx(Ii,{src:d.assetId,mediaRef:ue,mediaStyle:De,onLoadedMetadata:Pe},`${n}-${d.assetId}`):t.jsx("img",{ref:ue,src:d.assetId,alt:d.name,onLoad:Pe,style:De},`${n}-${d.assetId}`)}),ye&&E&&i.length>1&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{...E,left:g.left,cursor:"w-resize",pointerEvents:Se?"none":"auto"},onClick:l=>{if(Q.current){Q.current=!1;return}l.stopPropagation(),fe(-1)}}),t.jsx("div",{style:{...E,left:g.left+g.width/2,cursor:"e-resize",pointerEvents:Se?"none":"auto"},onClick:l=>{if(Q.current){Q.current=!1;return}l.stopPropagation(),fe(1)}})]}),t.jsx(Li,{prefix:e,closeIcon:J,closeIconMaxWidth:ce,closeIconColor:ve,closeIconHoverColor:S,iconMarginRight:j,contentMarginTop:Xe,isEditor:o,isPreviewMode:x,isEditMode:y,visible:ye,onClose:ke})]})}function Ni(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Ri({settings:e,content:i,isEditor:n,isPreviewMode:a,isEditMode:o,metadata:x,activeEvent:y,layoutId:q,portalId:ae}){const{prefix:s}=ri.useScopedStyles(),{type:V="a",gridLayout:Z,textBoxWidth:J=100,verticalGap:ce,entriesCount:ve,lightbox:S,imageDisplay:j,imageCorners:Xe,lightboxImageDisplay:we,slider:ze,sliderTiming:de,direction:ue,transition:L,titleMarginTop:B,subtitleMarginTop:_,titleColor:N,subtitleColor:G,lightboxCounterColor:Q,titleFontFamily:Ue,titleFontSettings:k,titleFontSize:M,titleLineHeight:R,titleLetterSpacing:ie,titleWordSpacing:X,titleTextAppearance:Fe,subtitleFontFamily:Ye,subtitleFontSettings:m,subtitleFontSize:Ve,subtitleLineHeight:c,subtitleLetterSpacing:mt,subtitleWordSpacing:w,subtitleTextAppearance:be,lightboxCounterFontFamily:P,lightboxCounterFontSettings:O,lightboxCounterFontSize:me,lightboxCounterLineHeight:W,lightboxCounterLetterSpacing:Ae,lightboxCounterWordSpacing:ne,lightboxCounterTextAppearance:Me,closeIcon:ge,closeIconMaxWidth:Se,closeIconColor:he,closeIconHoverColor:gt,iconMarginRight:Ke,contentMarginTop:ht,showText:Ze="always",hover:Oe="none",alignEntries:Je="off",align:d="top"}=e,pt={fontSettings:{fontFamily:Ue,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:M??.01,lineHeight:R,letterSpacing:ie??0,wordSpacing:X??0,textAppearance:Fe,color:N},je={...Re.omitTextColors(Re.textStylesToCss(pt,n))},Pe={fontSettings:{fontFamily:Ye,fontWeight:(m==null?void 0:m.fontWeight)??400,fontStyle:(m==null?void 0:m.fontStyle)??"normal"},fontSize:Ve??.01,lineHeight:c,letterSpacing:mt??0,wordSpacing:w??0,textAppearance:be,color:G},U={...Re.omitTextColors(Re.textStylesToCss(Pe,n))},Ce={fontSettings:{fontFamily:P,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:me??.01,lineHeight:W,letterSpacing:Ae??0,wordSpacing:ne??0,textAppearance:Me,color:Q},pe={...Re.omitTextColors(Re.textStylesToCss(Ce,n)),...It(me,W,s,n)},fe=Ct(M,R,`${s}-item-title`,`${s}-text-tight-leading`),Ie=Ct(Ve,c,`${s}-item-subtitle`,`${s}-text-tight-leading`),$e=It(M,R,s,n),ke=It(Ve,c,s,n),ye=Ct(me,W,`${s}-lightbox-counter`,`${s}-text-tight-leading`),We=ni.buildColorVars(s,{titleColor:N,subtitleColor:G,lightboxCounterColor:Q},zi,Fi),$t=y&&y!=="default"?`${s}-state-${y}`:"",yt=Ze==="on hover"&&(!n||a),xt=Oe!=="none"&&(!n||a)?` ${s}-hover-${Oe}`:"",g=`${$t}${yt?` ${s}-show-text-hover`:""}${xt}`.trim(),et=ve===0?1/0:ve,Y=(i??[]).slice(0,et),vt=r.useMemo(()=>S==="on"?xi(Y):[],[Y,S]),Te=Z.entryWidth??.2,Ee=(j==null?void 0:j.display)==="cover",De=(j==null?void 0:j.ratioValue)??"1:1",tt=(j==null?void 0:j.reversed)??!1,[re,T]=De.split(":").map(Number),wt=`${tt?T:re} / ${tt?re:T}`,E=Z.columnsCount,l=f.scalingValue(Te??0,n),u=l,I=!Ee&&ze!=="off",ee=Y.length%E||E,se=ee<E&&Y.length>0,He=Y.length-ee,Le=se?Math.floor((E-ee)/2)+1:1,h=Xe?f.scalingValue(Xe,n):void 0,z={width:u,...Ee?{aspectRatio:wt,height:"auto",overflow:"hidden"}:{height:"auto"},...h?{borderRadius:h,overflow:"hidden"}:{}},te=`${s}-item-image-wrapper${I?` ${s}-item-image-wrapper-fit-slider`:""}`.trim(),v=V==="d"||V==="e"||V==="f",F=Je==="on",_e=`calc(${f.scalingValue(Te??0,n)} * (${J} / 100))`,oe=f.scalingValue(Te*J/100,n),_t=h?{borderRadius:h,[Tt]:h}:{},Nt=Ee?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",..._t}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",..._t},[Xt,Ut]=r.useState(0),nt=r.useRef(null),Yt=L==="fade"||ue==="horizontal"?"ltr":ue==="vertical"?"ttb":"ltr";r.useEffect(()=>{const p=nt.current;if(!p)return;const b=new ResizeObserver(A=>{Ut(Math.round(A[0].contentRect.width))});return b.observe(p),()=>b.disconnect()},[]);const Kt=(()=>{const p={...We},b=nt.current?getComputedStyle(nt.current).getPropertyValue("--cntrl-article-width").trim():"";return b&&(p["--cntrl-article-width"]=b),p})(),[bt,St]=r.useState(!1),[rt,Zt]=r.useState([]),[Jt,jt]=r.useState(0),Rt=S==="on"&&(!n||a),zt=(p,b)=>{n&&!a||S!=="off"&&(Zt(p),jt(b),St(!0))};r.useEffect(()=>{if(!bt||S!=="on"||typeof document>"u")return;const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[bt,S]),r.useEffect(()=>{!n||a||St(!1)},[n,a]);const Qt=r.useMemo(()=>ci(s),[s]);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:Qt}}),S==="on"&&t.jsx(vi,{mediaList:vt}),t.jsx("div",{style:We,children:t.jsx("div",{ref:nt,className:`${s}-wrapper ${s}-type-${V}${F?` ${s}-align-entries`:""} ${s}-image-align-${d} ${g}`.trim(),style:{gridTemplateColumns:`repeat(${E}, ${l})`,rowGap:F?0:f.scalingValue(ce??0,n),columnGap:f.scalingValue(Z.horizontalGap??0,n),width:f.scalingValue(Z.wrapperWidth??0,n),...F?{[`--${s}-align-entries-row-gap`]:f.scalingValue(ce??0,n)}:{}},children:Y.map((p,b)=>{var Ot;const A=Et(p.title),K=Et(p.subtitle),Ne=S==="off"&&((Ot=p.link)!=null&&Ot.value)?p.link:void 0,Pt=Math.floor(b/E)===Math.ceil(Y.length/E)-1,st=se&&b>=He?`${Le+(b-He)}`:void 0,Ft=v?t.jsxs("div",{className:`${s}-item-text-block`,children:[A&&t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),A&&t.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(B??0,n),width:oe}}),K&&t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle}),K&&t.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(_??0,n),width:oe}})]}):null,ei=F?t.jsxs("div",{className:`${s}-item-title-row`,children:[!v&&t.jsx("div",{"data-controls":o&&A?"titleMarginTop":void 0,className:o&&A?`${s}-control`:void 0,style:{height:A?f.scalingValue(B??0,n):0,width:oe}}),A&&t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),v&&A&&t.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(B??0,n),width:oe}})]}):null,ti=F?t.jsxs("div",{className:`${s}-item-subtitle-row`,children:[!v&&t.jsx("div",{"data-controls":o&&K?"subtitleMarginTop":void 0,className:o&&K?`${s}-control`:void 0,style:{height:K?f.scalingValue(_??0,n):0,width:oe}}),K&&t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle}),v&&K&&t.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(_??0,n),width:oe}})]}):null,Vt=t.jsxs(ct.LinkWrapper,{link:Ne,className:`${s}-item-text-link`,children:[ei,ti]}),qe=Gt(p.gallery),ot=qe.filter($=>$.lightboxMedia).map($=>$.lightboxMedia),lt=t.jsx(ji,{className:te,style:z,children:qe.length===0?null:ze==="off"?(()=>{const{displayMedia:$,lightboxMedia:Be}=qe[0],Ge=Be?ot.findIndex(at=>at.assetId===Be.assetId):-1;return t.jsx(Dt,{media:$,className:`${s}-item-${xe($)?"video":"image"}`.trim(),style:Nt,hasLightbox:S==="on",onMediaClick:Rt&&Ge>=0?()=>zt(ot,Ge):void 0})})():t.jsxs(t.Fragment,{children:[I&&t.jsx("div",{className:`${s}-item-image-wrapper-sizer`,"aria-hidden":"true",children:qe.map(({displayMedia:$})=>H.isEmbedMedia($)?t.jsx("div",{style:{aspectRatio:`${H.getEmbedAspect($)}`}},`sizer-${$.assetId}`):xe($)?t.jsx(Bt.LazyVideo,{src:$.assetId,nearPreload:"metadata",muted:!0,playsInline:!0},`sizer-${$.assetId}`):t.jsx("img",{src:$.assetId,alt:""},`sizer-${$.assetId}`))}),t.jsx(Wt.Splide2,{className:`${s}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:de*1e3,width:"100%",height:"100%",speed:gi,type:L==="fade"?"fade":"loop",rewind:L==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:Yt},onMoved:$=>{ue!=="random"||L==="fade"||mi($)},children:qe.map(({displayMedia:$,lightboxMedia:Be},Ge)=>{const at=Be?ot.findIndex(ii=>ii.assetId===Be.assetId):-1;return t.jsx(Wt.SplideSlide,{"data-slide-index":Ge,children:t.jsx(Dt,{media:$,className:`${s}-item-${xe($)?"video":"image"}`.trim(),style:Nt,hasLightbox:S==="on",isSplideSlide:!0,onMediaClick:Rt&&at>=0?()=>zt(ot,at):void 0})},Ge)})},`${L}-${Te}-${ue}-${de}-${Xt}-${q}`)]})}),At=v?null:t.jsxs(t.Fragment,{children:[t.jsx("div",{"data-controls":o&&A?"titleMarginTop":void 0,className:o&&A?`${s}-control`:void 0,style:{height:A?f.scalingValue(B??0,n):0,width:oe}}),t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),t.jsx("div",{"data-controls":o&&K?"subtitleMarginTop":void 0,className:o&&K?`${s}-control`:void 0,style:{height:K?f.scalingValue(_??0,n):0,width:oe}}),t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle})]}),Mt=Ne?t.jsx(ct.LinkWrapper,{link:Ne,className:`${s}-item-image-link`,children:lt}):t.jsx("a",{className:`${s}-item-image-link`,children:lt});return t.jsx("div",{className:`${s}-item`.trim(),style:st&&!F?{gridColumn:st}:void 0,children:t.jsx("div",{className:`${o?`${s}-item-inner`:`${s}-item-inner-hidden`}${F&&Pt?` ${s}-item-inner-last-row`:""}`.trim(),style:{width:(J??0)>100?`calc(${l} * (${J} / 100))`:l,...st&&F?{gridColumn:st}:{}},children:F?t.jsx(t.Fragment,{children:v?t.jsxs(t.Fragment,{children:[Vt,Mt]}):t.jsxs(t.Fragment,{children:[Mt,Vt]})}):Ne?t.jsxs(t.Fragment,{children:[t.jsxs(ct.LinkWrapper,{link:Ne,className:`${s}-item-image-link`,children:[Ft,lt]}),!v&&t.jsx(ct.LinkWrapper,{link:Ne,className:`${s}-item-text-link`,children:At})]}):t.jsxs(t.Fragment,{children:[Ft,lt,At]})})},b)})})}),(!n||a)&&bt&&typeof document<"u"&&S==="on"&&(()=>{const p=(ae?document.getElementById(ae):null)??document.body;return si.createPortal(t.jsx("div",{style:Kt,"data-selection":"none",children:t.jsx(_i,{prefix:s,items:rt,index:Jt,imageDisplay:Ni(we),isEditor:n,isPreviewMode:a,isEditMode:o,closeIcon:ge,closeIconMaxWidth:Se,closeIconColor:he,closeIconHoverColor:gt,iconMarginRight:Ke,contentMarginTop:ht,onClose:()=>St(!1),onPrev:()=>jt(b=>(b-1+rt.length)%rt.length),onNext:()=>jt(b=>(b+1)%rt.length),counterClassName:ye,counterStyle:pe})}),p)})()]})}const zi={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Fi=["hover","focus","filled","success","error"];exports.Grid=Ri;
408
+ `}function ci(){return Math.random()<.5?"ltr":"ttb"}function di(e){const i=e.Components.Autoplay;i&&(i.pause(!1),i.play())}function ui(e){const i=ci();e.options.direction!==i&&(e.options={...e.options,direction:i}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{di(e)})})}const D=500,mi=750,le="cubic-bezier(0.22, 1, 0.36, 1)",gi=72,hi=50;function pi(e){if(!Array.isArray(e)||e.length===0)return!1;const i=e[0];return i!==null&&typeof i=="object"&&"media"in i&&Array.isArray(i.media)}function fi(e){const[i,n]=e.media;return n!=null&&n.assetId?n:i!=null&&i.assetId?i:null}function $i(e){const[i]=e.media;return i!=null&&i.assetId?i:null}function Bt(e){return!Array.isArray(e)||e.length===0?[]:pi(e)?e.flatMap(i=>{const n=fi(i);if(!n)return[];const a=$i(i);return[{displayMedia:n,lightboxMedia:a!=null&&a.assetId?a:null}]}):e.filter(i=>i==null?void 0:i.assetId).map(i=>({displayMedia:i,lightboxMedia:i}))}function xe(e){return!H.isEmbedMedia(e)&&e.type==="video"}function yi(e){const i=new Set,n=[];for(const a of e){const o=Bt(a.gallery);for(const x of o){const y=x.lightboxMedia;y!=null&&y.assetId&&!i.has(y.assetId)&&(i.add(y.assetId),n.push(y))}}return n}function xi({mediaList:e}){const[i,n]=r.useState(null);Dt.useLazyVideos(i,{preload:"metadata"});const a=e.filter(o=>!H.isEmbedMedia(o));return a.length===0?null:t.jsx("div",{ref:n,"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:a.map(o=>xe(o)?t.jsx("video",{src:o.assetId,preload:"none",muted:!0,playsInline:!0},o.assetId):t.jsx("img",{src:o.assetId,alt:""},o.assetId))})}function vi(e){e.pause(),e.removeAttribute("src"),e.load()}const wi=".splide__slide video";function bi(e){var o;if(e.closest(".splide--fade, .splide__slide.is-active:not(.splide__slide--clone), .splide__slide.is-next"))return!0;const i=e.closest(".splide__slide");if(!i||i.classList.contains("splide__slide--clone"))return!1;const n=i.dataset.slideIndex,a=(o=i.parentElement)==null?void 0:o.querySelector(".splide__slide.is-next");return n!==void 0&&(a==null?void 0:a.dataset.slideIndex)===n}function Wt({media:e,className:i,style:n,hasLightbox:a,isSplideSlide:o=!1,onMediaClick:x}){if(H.isEmbedMedia(e))return t.jsx(H.EmbedMediaFrame,{media:e,fit:n.objectFit==="contain"?"contain":"cover",silentLoop:a,className:i,style:{...n,cursor:x?"pointer":"default"},onClick:x});if(xe(e)){const y={src:e.assetId,className:i,style:{...n,cursor:x?"pointer":"default"},muted:!0,loop:!0,playsInline:!0,onClick:x};return o?t.jsx("video",{...y,preload:"none"}):t.jsx(Ht.LazyVideo,{...y,autoPlay:!0})}return t.jsx("img",{src:e.assetId,alt:e.name,className:i,style:{...n,cursor:x?"pointer":"default"},onClick:x})}function Si({className:e,style:i,children:n}){const[a,o]=r.useState(null);return Dt.useLazyVideos(a,{autoPlay:!0,selector:wi,shouldPlay:bi}),t.jsx("div",{ref:o,className:e,style:i,children:n})}function Et(e){const i=e.getBoundingClientRect();return{width:i.width,height:i.height,left:i.left,top:i.top}}function ji(e,i){if(!i||!i.width||!i.height||!e.width||!e.height)return e;const n=i.width/i.height,a=e.width/e.height;if(n>a){const x=e.width/n;return{width:e.width,height:x,left:e.left,top:e.top+(e.height-x)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function Ci({src:e,mediaRef:i,mediaStyle:n,onLoadedMetadata:a}){return r.useEffect(()=>{const o=i.current;if(o)return()=>{vi(o)}},[e,i]),t.jsx("video",{ref:i,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:a,style:n})}const Ii="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",ki=.004;function Ti({prefix:e,closeIcon:i=Ii,closeIconMaxWidth:n=.0125,closeIconColor:a="#FFFFFF",closeIconHoverColor:o="#999999",iconMarginRight:x=.01,contentMarginTop:y=.01,isEditor:q,isPreviewMode:ae,isEditMode:s,visible:V,onClose:Z}){if(!i)return null;const J=f.scalingValue(n,q),ce=f.scalingValue(x,q),ve=f.scalingValue(y,q),S=f.scalingValue(Math.max(y,ki),q);return t.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:V?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[t.jsx("div",{style:{position:"relative",width:"100%",height:ve,flexShrink:0},children:s&&t.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:S,pointerEvents:V?"auto":"none"}})}),t.jsxs("div",{className:`${e}-close-icon`,style:{width:J,height:J,marginRight:ce,pointerEvents:V?"auto":"none"},onClick:j=>j.stopPropagation(),children:[t.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:j=>{j.stopPropagation(),Z()},children:t.jsx(si.SvgImage,{url:i,fill:a,hoverFill:q&&!ae?a:o,className:`${e}-close-icon-img`})}),s&&t.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ce,height:"100%",pointerEvents:V?"auto":"none"}})]})]})}function Li({prefix:e,items:i,index:n,imageDisplay:a,isEditor:o,isPreviewMode:x,isEditMode:y,onClose:q,onPrev:ae,onNext:s,counterClassName:V,counterStyle:Z,closeIcon:J,closeIconMaxWidth:ce,closeIconColor:ve,closeIconHoverColor:S,iconMarginRight:j,contentMarginTop:Xe}){const we=a==="cover",Re=r.useRef(null),de=r.useRef(null),ue=r.useRef(null),L=r.useRef(null),B=r.useRef(0),_=r.useRef(0),z=r.useRef("none"),G=r.useRef(!1),Q=r.useRef(!1),Ue=r.useRef(null),k=r.useRef(0),M=r.useRef(null),N=r.useRef(!1),ie=r.useRef(null),X=r.useRef(null),Fe=r.useRef(null),Ye=r.useRef(()=>{}),[m,Ve]=r.useState(null),[c,dt]=r.useState(null),[w,be]=r.useState("opening"),[P,O]=r.useState(0),[me,W]=r.useState(0),[Ae,ne]=r.useState(null),[Me,ge]=r.useState(!1),[Se,he]=r.useState(!1),[ut,Ke]=r.useState(!1),[mt,Ze]=r.useState(null),Oe=r.useRef(n),Je=r.useRef(void 0),d=i[n],gt=d?xe(d):!1,Qe=d?H.isEmbedMedia(d):!1,je=Ae!==null,Pe=r.useCallback(l=>{const u=l.currentTarget,I=u instanceof HTMLVideoElement?{width:u.videoWidth,height:u.videoHeight}:{width:u.naturalWidth,height:u.naturalHeight};!I.width||!I.height||Ze(I)},[]);r.useEffect(()=>{Ue.current=c},[c]),r.useEffect(()=>{const l=Re.current;if(!l)return;const u=()=>dt(Et(l));u();const I=new ResizeObserver(u);return I.observe(l),()=>I.disconnect()},[]);const C=r.useCallback(()=>{ie.current!==null&&(window.clearTimeout(ie.current),ie.current=null)},[]),U=r.useCallback(()=>{const l=X.current;X.current=null,C(),M.current=null,N.current=!1,ne(null),ge(!1),W(0),k.current=0,he(!1),G.current=!1,_.current=0,z.current="none",l===1?s():l===-1&&ae()},[C,s,ae]),Ce=r.useCallback(()=>{C(),X.current=null,M.current=null,N.current=!1,ne(null),ge(!1),W(0),k.current=0},[C]),ht=r.useCallback(()=>{C(),ie.current=window.setTimeout(()=>{X.current!==null&&U()},D+32)},[C,U]),pe=r.useCallback((l,u)=>{var ee;const I=((ee=Ue.current)==null?void 0:ee.width)??0;if(C(),M.current=l,ne(l),N.current=!0,ge(!0),u){X.current=l;const se=-l*I;k.current=se,W(se),ht();return}k.current=0,W(0),ie.current=window.setTimeout(()=>{ie.current=null,Ce()},D+32)},[C,Ce,ht]),fe=r.useCallback(l=>{if(!(i.length<=1)){if(N.current){if(X.current===l){Fe.current=l,U();return}Ce()}C(),M.current=l,ne(l),N.current=!1,ge(!1),k.current=0,W(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{pe(l,!0)})})}},[i.length,pe,U,Ce,C]);Ye.current=fe;const Ie=r.useCallback(l=>{l.propertyName!=="transform"||!N.current||X.current!==null&&U()},[U]),$e=r.useCallback(()=>{const l=de.current;if(!l)return;const u=Et(l);!u.width||!u.height||Ve(u)},[]);r.useEffect(()=>{$e();const l=de.current;if(!l)return;const u=new ResizeObserver(()=>$e());return u.observe(l),()=>u.disconnect()},[$e]),r.useEffect(()=>{w==="opening"&&m&&be("open")},[w,m]),r.useEffect(()=>{if(w!=="closing")return;const l=setTimeout(()=>q(),D);return()=>clearTimeout(l)},[w,q]),r.useEffect(()=>()=>{C()},[C]),r.useLayoutEffect(()=>{Oe.current===n&&Je.current===(d==null?void 0:d.assetId)||(C(),X.current=null,ne(null),O(0),W(0),ge(!1),Ke(!1),he(!1),Ze(null),B.current=0,_.current=0,z.current="none",G.current=!1,N.current=!1,k.current=0,M.current=null,L.current=null,Q.current=!1,Oe.current=n,Je.current=d==null?void 0:d.assetId)},[n,d==null?void 0:d.assetId,C]),r.useLayoutEffect(()=>{const l=Fe.current;l!==null&&(Fe.current=null,requestAnimationFrame(()=>{Ye.current(l)}))},[n,d==null?void 0:d.assetId]),r.useEffect(()=>{if(w!=="open")return;let l=null;const u=()=>{l&&(document.removeEventListener("click",l,!0),l=null)},I=()=>{u(),l=h=>{h.stopPropagation(),h.preventDefault(),u()},document.addEventListener("click",l,!0)},ee=h=>{const R=h<0?1:-1;if(Math.abs(h)>hi&&i.length>1){pe(R,!0);return}pe(R,!1)},se=h=>{if(h.touches.length!==1||N.current)return;const R=h.touches[0];Q.current=!0,L.current={x:R.clientX,y:R.clientY},z.current="none",_.current=0,G.current=!1},He=h=>{if(!L.current||h.touches.length!==1||N.current)return;const R=h.touches[0],te=R.clientX-L.current.x,v=R.clientY-L.current.y;if(z.current==="none"){if(Math.abs(te)<10&&Math.abs(v)<10)return;if(Math.abs(te)>Math.abs(v)){if(i.length<=1)return;z.current="horizontal"}else if(v>0)z.current="vertical";else return}if(z.current==="horizontal"){G.current=!0,he(!0),_.current=te;const F=te<0?1:-1;M.current!==F&&(M.current=F,ne(F)),k.current=te,W(te),h.preventDefault();return}z.current==="vertical"&&(G.current=!0,he(!0),B.current=v,O(v),h.preventDefault())},Le=()=>{if(!L.current)return;const h=z.current,R=G.current;if(R&&h==="horizontal")ee(_.current),I();else if(R&&h==="vertical")if(B.current>gi){const v=window.innerHeight;B.current=v,Ke(!0),O(v),be("closing")}else B.current=0,O(0),I();else h==="horizontal"&&Math.abs(_.current)>0&&(ee(_.current),I());L.current=null,z.current="none",_.current=0,G.current=!1,he(!1)};return document.addEventListener("touchstart",se,{passive:!0}),document.addEventListener("touchmove",He,{passive:!1}),document.addEventListener("touchend",Le),document.addEventListener("touchcancel",Le),()=>{document.removeEventListener("touchstart",se),document.removeEventListener("touchmove",He),document.removeEventListener("touchend",Le),document.removeEventListener("touchcancel",Le),u()}},[w,i.length,pe]),r.useEffect(()=>{const l=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),w!=="closing"&&be("closing"))};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[w]);const ke=()=>{w!=="closing"&&be("closing")},ye=w==="open",We=w==="closing",pt=P>0?Math.max(0,1-P/500):1,ft=P>0?Math.max(.35,1-P/500):1,$t=Qe&&d?{width:H.getEmbedAspect(d),height:1}:mt,g=m?we?m:ji(m,$t):null,et={position:"fixed",top:c==null?void 0:c.top,left:c==null?void 0:c.left,width:c==null?void 0:c.width,height:c==null?void 0:c.height,zIndex:9998},Y=we?"cover":"contain",yt=me!==0||P>0?`translate(${me}px, ${P}px)`:void 0,Te=Se&&!Me?"none":Me?`transform ${D}ms ${le}`:ut?`transform ${D}ms ${le}, opacity ${D}ms ${le}`:w==="opening"||We?`opacity ${D}ms ${le}`:"none",Ee={...et,transform:yt,opacity:P>0?ft:w==="opening"||We?0:1,transition:Te,pointerEvents:"none"},De={position:"absolute",top:((g==null?void 0:g.top)??0)-((c==null?void 0:c.top)??0),left:((g==null?void 0:g.left)??0)-((c==null?void 0:c.left)??0),width:g==null?void 0:g.width,height:g==null?void 0:g.height,objectFit:Y,pointerEvents:"none"},tt=(c==null?void 0:c.width)??0,re=je?(n+Ae+i.length)%i.length:null,T=re!==null?i[re]:null,kt={...et,transform:je?`translateX(${Ae*tt+me}px)`:void 0,opacity:1,transition:Me?`transform ${D}ms ${le}`:"none",pointerEvents:"none"},it={position:"absolute",top:((m==null?void 0:m.top)??0)-((c==null?void 0:c.top)??0),left:((m==null?void 0:m.left)??0)-((c==null?void 0:c.left)??0),width:m==null?void 0:m.width,height:m==null?void 0:m.height,objectFit:Y,pointerEvents:"none"},xt=Qe&&d&&H.getEmbedPlayback(d).controls&&g?Math.min(52,g.height*.2):0,E=g?{position:"fixed",top:g.top,height:g.height-xt,width:g.width/2,zIndex:9999}:null;return t.jsxs("div",{ref:Re,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:w==="open"?"none":void 0},onClick:ke,children:[t.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:ye?pt:0,transition:Se?"none":`opacity ${D}ms ${le}`,pointerEvents:"none"}}),t.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:we?t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:de,style:{position:"absolute",inset:0}}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${D}ms ${le}`,pointerEvents:"none",zIndex:9999},children:i.length>1&&t.jsxs("p",{className:V,style:Z,children:[n+1," / ",i.length]})})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{height:"10%"}}),t.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx("div",{ref:de,style:{width:"100%",height:"100%"}})}),t.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${D}ms ${le}`},children:i.length>1&&t.jsxs("p",{className:V,style:Z,children:[n+1," / ",i.length]})})]})}),m&&c&&T&&t.jsx("div",{style:kt,onTransitionEnd:Ie,children:H.isEmbedMedia(T)?t.jsx("img",{src:T.thumbnail,alt:T.name,style:it},`neighbor-${re}-${T.assetId}`):xe(T)?t.jsx("video",{src:T.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",style:it},`neighbor-${re}-${T.assetId}`):t.jsx("img",{src:T.assetId,alt:T.name,style:it},`neighbor-${re}-${T.assetId}`)}),m&&c&&d&&t.jsx("div",{style:Ee,onTransitionEnd:Ie,children:Qe?t.jsx(H.EmbedMediaFrame,{media:d,fit:we?"cover":"contain",lazy:!1,startsAtOnce:!0,style:De},`${n}-${d.assetId}`):gt?t.jsx(Ci,{src:d.assetId,mediaRef:ue,mediaStyle:De,onLoadedMetadata:Pe},`${n}-${d.assetId}`):t.jsx("img",{ref:ue,src:d.assetId,alt:d.name,onLoad:Pe,style:De},`${n}-${d.assetId}`)}),ye&&E&&i.length>1&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{...E,left:g.left,cursor:"w-resize",pointerEvents:Se?"none":"auto"},onClick:l=>{if(Q.current){Q.current=!1;return}l.stopPropagation(),fe(-1)}}),t.jsx("div",{style:{...E,left:g.left+g.width/2,cursor:"e-resize",pointerEvents:Se?"none":"auto"},onClick:l=>{if(Q.current){Q.current=!1;return}l.stopPropagation(),fe(1)}})]}),t.jsx(Ti,{prefix:e,closeIcon:J,closeIconMaxWidth:ce,closeIconColor:ve,closeIconHoverColor:S,iconMarginRight:j,contentMarginTop:Xe,isEditor:o,isPreviewMode:x,isEditMode:y,visible:ye,onClose:ke})]})}function _i(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function zi({settings:e,content:i,isEditor:n,isPreviewMode:a,isEditMode:o,metadata:x,activeEvent:y,layoutId:q,portalId:ae}){const{prefix:s}=ni.useScopedStyles(),{type:V="a",gridLayout:Z,textBoxWidth:J=100,verticalGap:ce,entriesCount:ve,lightbox:S,imageDisplay:j,imageCorners:Xe,lightboxImageDisplay:we,slider:Re,sliderTiming:de,direction:ue,transition:L,titleMarginTop:B,subtitleMarginTop:_,titleColor:z,subtitleColor:G,lightboxCounterColor:Q,titleFontFamily:Ue,titleFontSettings:k,titleFontSize:M,titleLineHeight:N,titleLetterSpacing:ie,titleWordSpacing:X,titleTextAppearance:Fe,subtitleFontFamily:Ye,subtitleFontSettings:m,subtitleFontSize:Ve,subtitleLineHeight:c,subtitleLetterSpacing:dt,subtitleWordSpacing:w,subtitleTextAppearance:be,lightboxCounterFontFamily:P,lightboxCounterFontSettings:O,lightboxCounterFontSize:me,lightboxCounterLineHeight:W,lightboxCounterLetterSpacing:Ae,lightboxCounterWordSpacing:ne,lightboxCounterTextAppearance:Me,closeIcon:ge,closeIconMaxWidth:Se,closeIconColor:he,closeIconHoverColor:ut,iconMarginRight:Ke,contentMarginTop:mt,showText:Ze="always",hover:Oe="none",alignEntries:Je="off",align:d="top"}=e,gt={fontSettings:{fontFamily:Ue,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:M??.01,lineHeight:N,letterSpacing:ie??0,wordSpacing:X??0,textAppearance:Fe,color:z},je={...Ne.omitTextColors(Ne.textStylesToCss(gt,n))},Pe={fontSettings:{fontFamily:Ye,fontWeight:(m==null?void 0:m.fontWeight)??400,fontStyle:(m==null?void 0:m.fontStyle)??"normal"},fontSize:Ve??.01,lineHeight:c,letterSpacing:dt??0,wordSpacing:w??0,textAppearance:be,color:G},U={...Ne.omitTextColors(Ne.textStylesToCss(Pe,n))},Ce={fontSettings:{fontFamily:P,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:me??.01,lineHeight:W,letterSpacing:Ae??0,wordSpacing:ne??0,textAppearance:Me,color:Q},pe={...Ne.omitTextColors(Ne.textStylesToCss(Ce,n)),...jt(me,W,s,n)},fe=St(M,N,`${s}-item-title`,`${s}-text-tight-leading`),Ie=St(Ve,c,`${s}-item-subtitle`,`${s}-text-tight-leading`),$e=jt(M,N,s,n),ke=jt(Ve,c,s,n),ye=St(me,W,`${s}-lightbox-counter`,`${s}-text-tight-leading`),We=ii.buildColorVars(s,{titleColor:z,subtitleColor:G,lightboxCounterColor:Q},Ni,Ri),pt=y&&y!=="default"?`${s}-state-${y}`:"",ft=Ze==="on hover"&&(!n||a),$t=Oe!=="none"&&(!n||a)?` ${s}-hover-${Oe}`:"",g=`${pt}${ft?` ${s}-show-text-hover`:""}${$t}`.trim(),et=ve===0?1/0:ve,Y=(i??[]).slice(0,et),yt=r.useMemo(()=>S==="on"?yi(Y):[],[Y,S]),Te=Z.entryWidth??.2,Ee=(j==null?void 0:j.display)==="cover",De=(j==null?void 0:j.ratioValue)??"1:1",tt=(j==null?void 0:j.reversed)??!1,[re,T]=De.split(":").map(Number),xt=`${tt?T:re} / ${tt?re:T}`,E=Z.columnsCount,l=f.scalingValue(Te??0,n),u=l,I=!Ee&&Re!=="off",ee=Y.length%E||E,se=ee<E&&Y.length>0,He=Y.length-ee,Le=se?Math.floor((E-ee)/2)+1:1,h=Xe?f.scalingValue(Xe,n):void 0,R={width:u,...Ee?{aspectRatio:xt,height:"auto",overflow:"hidden"}:{height:"auto"},...h?{borderRadius:h,overflow:"hidden"}:{}},te=`${s}-item-image-wrapper${I?` ${s}-item-image-wrapper-fit-slider`:""}`.trim(),v=V==="d"||V==="e"||V==="f",F=Je==="on",_e=`calc(${f.scalingValue(Te??0,n)} * (${J} / 100))`,oe=f.scalingValue(Te*J/100,n),Tt=h?{borderRadius:h,[qt]:h}:{},Lt=Ee?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Tt}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Tt},[Gt,Xt]=r.useState(0),nt=r.useRef(null),Ut=L==="fade"||ue==="horizontal"?"ltr":ue==="vertical"?"ttb":"ltr";r.useEffect(()=>{const p=nt.current;if(!p)return;const b=new ResizeObserver(A=>{Xt(Math.round(A[0].contentRect.width))});return b.observe(p),()=>b.disconnect()},[]);const Yt=(()=>{const p={...We},b=nt.current?getComputedStyle(nt.current).getPropertyValue("--cntrl-article-width").trim():"";return b&&(p["--cntrl-article-width"]=b),p})(),[vt,wt]=r.useState(!1),[rt,Kt]=r.useState([]),[Zt,bt]=r.useState(0),_t=S==="on"&&(!n||a),zt=(p,b)=>{n&&!a||S!=="off"&&(Kt(p),bt(b),wt(!0))};r.useEffect(()=>{if(!vt||S!=="on"||typeof document>"u")return;const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p}},[vt,S]),r.useEffect(()=>{!n||a||wt(!1)},[n,a]);const Jt=r.useMemo(()=>ai(s),[s]);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:Jt}}),S==="on"&&t.jsx(xi,{mediaList:yt}),t.jsx("div",{style:We,children:t.jsx("div",{ref:nt,className:`${s}-wrapper ${s}-type-${V}${F?` ${s}-align-entries`:""} ${s}-image-align-${d} ${g}`.trim(),style:{gridTemplateColumns:`repeat(${E}, ${l})`,rowGap:F?0:f.scalingValue(ce??0,n),columnGap:f.scalingValue(Z.horizontalGap??0,n),width:f.scalingValue(Z.wrapperWidth??0,n),...F?{[`--${s}-align-entries-row-gap`]:f.scalingValue(ce??0,n)}:{}},children:Y.map((p,b)=>{var At;const A=Ot(p.title),K=Ot(p.subtitle),ze=S==="off"&&((At=p.link)!=null&&At.value)?p.link:void 0,Qt=Math.floor(b/E)===Math.ceil(Y.length/E)-1,st=se&&b>=He?`${Le+(b-He)}`:void 0,Nt=v?t.jsxs("div",{className:`${s}-item-text-block`,children:[A&&t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),A&&t.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(B??0,n),width:oe}}),K&&t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle}),K&&t.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(_??0,n),width:oe}})]}):null,Pt=F?t.jsxs("div",{className:`${s}-item-title-row`,children:[!v&&t.jsx("div",{"data-controls":o&&A?"titleMarginTop":void 0,className:o&&A?`${s}-control`:void 0,style:{height:A?f.scalingValue(B??0,n):0,width:oe}}),A&&t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),v&&A&&t.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(B??0,n),width:oe}})]}):null,ei=F?t.jsxs("div",{className:`${s}-item-subtitle-row`,children:[!v&&t.jsx("div",{"data-controls":o&&K?"subtitleMarginTop":void 0,className:o&&K?`${s}-control`:void 0,style:{height:K?f.scalingValue(_??0,n):0,width:oe}}),K&&t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle}),v&&K&&t.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:f.scalingValue(_??0,n),width:oe}})]}):null,Rt=t.jsxs(ct.LinkWrapper,{link:ze,className:`${s}-item-text-link`,children:[Pt,ei]}),qe=Bt(p.gallery),ot=qe.filter($=>$.lightboxMedia).map($=>$.lightboxMedia),lt=t.jsx(Si,{className:te,style:R,children:qe.length===0?null:Re==="off"?(()=>{const{displayMedia:$,lightboxMedia:Be}=qe[0],Ge=Be?ot.findIndex(at=>at.assetId===Be.assetId):-1;return t.jsx(Wt,{media:$,className:`${s}-item-${xe($)?"video":"image"}`.trim(),style:Lt,hasLightbox:S==="on",onMediaClick:_t&&Ge>=0?()=>zt(ot,Ge):void 0})})():t.jsxs(t.Fragment,{children:[I&&t.jsx("div",{className:`${s}-item-image-wrapper-sizer`,"aria-hidden":"true",children:qe.map(({displayMedia:$})=>H.isEmbedMedia($)?t.jsx("div",{style:{aspectRatio:`${H.getEmbedAspect($)}`}},`sizer-${$.assetId}`):xe($)?t.jsx(Ht.LazyVideo,{src:$.assetId,nearPreload:"metadata",muted:!0,playsInline:!0},`sizer-${$.assetId}`):t.jsx("img",{src:$.assetId,alt:""},`sizer-${$.assetId}`))}),t.jsx(Mt.Splide2,{className:`${s}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:de*1e3,width:"100%",height:"100%",speed:mi,type:L==="fade"?"fade":"loop",rewind:L==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:Ut},onMoved:$=>{ue!=="random"||L==="fade"||ui($)},children:qe.map(({displayMedia:$,lightboxMedia:Be},Ge)=>{const at=Be?ot.findIndex(ti=>ti.assetId===Be.assetId):-1;return t.jsx(Mt.SplideSlide,{"data-slide-index":Ge,children:t.jsx(Wt,{media:$,className:`${s}-item-${xe($)?"video":"image"}`.trim(),style:Lt,hasLightbox:S==="on",isSplideSlide:!0,onMediaClick:_t&&at>=0?()=>zt(ot,at):void 0})},Ge)})},`${L}-${Te}-${ue}-${de}-${Gt}-${q}`)]})}),Ft=v?null:t.jsxs(t.Fragment,{children:[t.jsx("div",{"data-controls":o&&A?"titleMarginTop":void 0,className:o&&A?`${s}-control`:void 0,style:{height:A?f.scalingValue(B??0,n):0,width:oe}}),t.jsx("p",{className:fe,style:{width:_e,...je,...$e},children:p.title}),t.jsx("div",{"data-controls":o&&K?"subtitleMarginTop":void 0,className:o&&K?`${s}-control`:void 0,style:{height:K?f.scalingValue(_??0,n):0,width:oe}}),t.jsx("p",{className:Ie,style:{width:_e,...U,...ke},children:p.subtitle})]}),Vt=ze?t.jsx(ct.LinkWrapper,{link:ze,className:`${s}-item-image-link`,children:lt}):t.jsx("a",{className:`${s}-item-image-link`,children:lt});return t.jsx("div",{className:`${s}-item`.trim(),style:st&&!F?{gridColumn:st}:void 0,children:t.jsx("div",{className:`${o?`${s}-item-inner`:`${s}-item-inner-hidden`}${F&&Qt?` ${s}-item-inner-last-row`:""}`.trim(),style:{width:(J??0)>100?`calc(${l} * (${J} / 100))`:l,...st&&F?{gridColumn:st}:{}},children:F?t.jsx(t.Fragment,{children:v?t.jsxs(t.Fragment,{children:[Rt,Vt]}):t.jsxs(t.Fragment,{children:[Vt,Rt]})}):ze?t.jsxs(t.Fragment,{children:[t.jsxs(ct.LinkWrapper,{link:ze,className:`${s}-item-image-link`,children:[Nt,lt]}),!v&&t.jsx(ct.LinkWrapper,{link:ze,className:`${s}-item-text-link`,children:Ft})]}):t.jsxs(t.Fragment,{children:[Nt,lt,Ft]})})},b)})})}),(!n||a)&&vt&&typeof document<"u"&&S==="on"&&(()=>{const p=(ae?document.getElementById(ae):null)??document.body;return ri.createPortal(t.jsx("div",{style:Yt,"data-selection":"none",children:t.jsx(Li,{prefix:s,items:rt,index:Zt,imageDisplay:_i(we),isEditor:n,isPreviewMode:a,isEditMode:o,closeIcon:ge,closeIconMaxWidth:Se,closeIconColor:he,closeIconHoverColor:ut,iconMarginRight:Ke,contentMarginTop:mt,onClose:()=>wt(!1),onPrev:()=>bt(b=>(b-1+rt.length)%rt.length),onNext:()=>bt(b=>(b+1)%rt.length),counterClassName:ye,counterStyle:pe})}),p)})()]})}const Ni={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Ri=["hover","focus","filled","success","error"];exports.Grid=zi;