@cntrl-site/components 1.0.50 → 1.0.51

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/index.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),nt=require("classnames"),y=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),gi=require("react-dom");function $c(e){return e.type==="object"&&e.version===1}const Cc="ControlSlider-module__wrapper___sHEkd",Tc="ControlSlider-module__hoverArrow___A-dOH",Lc="ControlSlider-module__sliderItem___QQSkR",Ic="ControlSlider-module__sliderImage___9hRl-",Rc="ControlSlider-module__arrow___05ghY",Ec="ControlSlider-module__arrowVertical___tBfVN",kc="ControlSlider-module__nextArrow___-30Yc",Mc="ControlSlider-module__arrowInner___aEra3",Pc="ControlSlider-module__arrowIcon___S4ztF",Ac="ControlSlider-module__arrowImg___2dwJW",Fc="ControlSlider-module__mirror___brd6U",Wc="ControlSlider-module__pagination___bicLF",_c="ControlSlider-module__paginationInner___bT-P-",Nc="ControlSlider-module__paginationVertical___zYqKw",Hc="ControlSlider-module__paginationItem___nTRbk",jc="ControlSlider-module__dot___p1Qun",Oc="ControlSlider-module__activeDot___LHFaj",zc="ControlSlider-module__paginationInsideBottom___R3FWn",Bc="ControlSlider-module__paginationInsideTop___V-qb-",Dc="ControlSlider-module__paginationOutsideBottom___14w8D",Vc="ControlSlider-module__paginationOutsideTop___SCLqB",Gc="ControlSlider-module__paginationInsideLeft___yOBRZ",qc="ControlSlider-module__paginationInsideRight___Rtt3o",Kc="ControlSlider-module__paginationOutsideLeft___lahaw",Uc="ControlSlider-module__paginationOutsideRight___EtuQa",Xc="ControlSlider-module__imgWrapper___UjEgB",Yc="ControlSlider-module__captionBlock___dJ6-j",Zc="ControlSlider-module__captionTextWrapper___HFlpf",Jc="ControlSlider-module__captionText___uGBVc",Qc="ControlSlider-module__active___WZK4G",ed="ControlSlider-module__withPointerEvents___t-18M",td="ControlSlider-module__topLeftAlignment___zjnGM",nd="ControlSlider-module__topCenterAlignment___gD1xW",id="ControlSlider-module__topRightAlignment___NMapS",od="ControlSlider-module__middleLeftAlignment___OnUrY",rd="ControlSlider-module__middleCenterAlignment___Tdkl0",ad="ControlSlider-module__middleRightAlignment___wEbfX",ld="ControlSlider-module__bottomLeftAlignment___cTP2-",sd="ControlSlider-module__bottomCenterAlignment___c54fB",cd="ControlSlider-module__bottomRightAlignment___kEwrz",dd="ControlSlider-module__clickOverlay___DZA28",ud="ControlSlider-module__contain___pLyq7",pd="ControlSlider-module__cover___KdDat",Xe={wrapper:Cc,hoverArrow:Tc,sliderItem:Lc,sliderImage:Ic,arrow:Rc,arrowVertical:Ec,nextArrow:kc,arrowInner:Mc,arrowIcon:Pc,arrowImg:Ac,mirror:Fc,pagination:Wc,paginationInner:_c,paginationVertical:Nc,paginationItem:Hc,dot:jc,activeDot:Oc,paginationInsideBottom:zc,paginationInsideTop:Bc,paginationOutsideBottom:Dc,paginationOutsideTop:Vc,paginationInsideLeft:Gc,paginationInsideRight:qc,paginationOutsideLeft:Kc,paginationOutsideRight:Uc,imgWrapper:Xc,captionBlock:Yc,captionTextWrapper:Zc,captionText:Jc,active:Qc,withPointerEvents:ed,topLeftAlignment:td,topCenterAlignment:nd,topRightAlignment:id,middleLeftAlignment:od,middleCenterAlignment:rd,middleRightAlignment:ad,bottomLeftAlignment:ld,bottomCenterAlignment:sd,bottomRightAlignment:cd,clickOverlay:dd,contain:ud,cover:pd};function md(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function gd(e,t,n){return t&&md(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ya="(prefers-reduced-motion: reduce)",Ci=1,hd=2,Ri=3,zi=4,yo=5,qo=6,Qo=7,fd={CREATED:Ci,MOUNTED:hd,IDLE:Ri,MOVING:zi,SCROLLING:yo,DRAGGING:qo,DESTROYED:Qo};function Wn(e){e.length=0}function Xn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ot(e){return e.bind.apply(e,[null].concat(Xn(arguments,1)))}var us=setTimeout,oa=function(){};function Za(e){return requestAnimationFrame(e)}function cr(e,t){return typeof t===e}function oo(e){return!xa(e)&&cr("object",e)}var va=Array.isArray,ps=Ot(cr,"function"),Gn=Ot(cr,"string"),vo=Ot(cr,"undefined");function xa(e){return e===null}function ms(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function xo(e){return va(e)?e:[e]}function vn(e,t){xo(e).forEach(t)}function ba(e,t){return e.indexOf(t)>-1}function Ko(e,t){return e.push.apply(e,xo(t)),e}function kn(e,t,n){e&&vn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){kn(e,Gn(t)?t.split(" "):t,!0)}function bo(e,t){vn(t,e.appendChild.bind(e))}function wa(e,t){vn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ro(e,t){return ms(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function gs(e,t){var n=e?Xn(e.children):[];return t?n.filter(function(i){return ro(i,t)}):n}function wo(e,t){return t?gs(e,t)[0]:e.firstElementChild}var ao=Object.keys;function di(e,t,n){return e&&(n?ao(e).reverse():ao(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function lo(e){return Xn(arguments,1).forEach(function(t){di(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Xn(arguments,1).forEach(function(t){di(t,function(n,i){va(n)?e[i]=n.slice():oo(n)?e[i]=zn({},oo(e[i])?e[i]:{},n):e[i]=n})}),e}function Ja(e,t){vn(t||ao(e),function(n){delete e[n]})}function Ln(e,t){vn(e,function(n){vn(t,function(i){n&&n.removeAttribute(i)})})}function ct(e,t,n){oo(t)?di(t,function(i,o){ct(e,o,i)}):vn(e,function(i){xa(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function Ti(e,t,n){var i=document.createElement(e);return t&&(Gn(t)?Tn(i,t):ct(i,t)),n&&bo(n,i),i}function xn(e,t,n){if(vo(n))return getComputedStyle(e)[t];xa(n)||(e.style[t]=""+n)}function so(e,t){xn(e,"display",t)}function hs(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function bn(e,t){return e.getAttribute(t)}function Qa(e,t){return e&&e.classList.contains(t)}function gn(e){return e.getBoundingClientRect()}function ui(e){vn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function fs(e){return wo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ys(e,t){return e&&e.querySelector(t)}function Sa(e,t){return t?Xn(e.querySelectorAll(t)):[]}function Mn(e,t){kn(e,t,!1)}function ra(e){return e.timeStamp}function ti(e){return Gn(e)?e:e?e+"px":""}var So="splide",$a="data-"+So;function Qi(e,t){if(!e)throw new Error("["+So+"] "+(t||""))}var qn=Math.min,er=Math.max,tr=Math.floor,co=Math.ceil,sn=Math.abs;function vs(e,t,n){return sn(e-t)<n}function Uo(e,t,n,i){var o=qn(t,n),l=er(t,n);return i?o<e&&e<l:o<=e&&e<=l}function wi(e,t,n){var i=qn(t,n),o=er(t,n);return qn(er(i,e),o)}function aa(e){return+(e>0)-+(e<0)}function la(e,t){return vn(t,function(n){e=e.replace("%s",""+n)}),e}function Ca(e){return e<10?"0"+e:""+e}var el={};function yd(e){return""+e+Ca(el[e]=(el[e]||0)+1)}function xs(){var e=[];function t(s,d,c,u){o(s,d,function(m,x,b){var T="addEventListener"in m,f=T?m.removeEventListener.bind(m,x,c,u):m.removeListener.bind(m,c);T?m.addEventListener(x,c,u):m.addListener(c),e.push([m,x,b,c,f])})}function n(s,d,c){o(s,d,function(u,m,x){e=e.filter(function(b){return b[0]===u&&b[1]===m&&b[2]===x&&(!c||b[3]===c)?(b[4](),!1):!0})})}function i(s,d,c){var u,m=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:m,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,m,!1,c)),s.dispatchEvent(u),u}function o(s,d,c){vn(s,function(u){u&&vn(d,function(m){m.split(" ").forEach(function(x){var b=x.split(".");c(u,b[0],b[1])})})})}function l(){e.forEach(function(s){s[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var Yn="mounted",sa="ready",_n="move",Bi="moved",Ta="click",bs="active",ws="inactive",Ss="visible",$s="hidden",Zt="refresh",an="updated",Ei="resize",dr="resized",Cs="drag",Ts="dragging",Ls="dragged",ur="scroll",hi="scrolled",vd="overflow",La="destroy",Is="arrows:mounted",Rs="arrows:updated",Es="pagination:mounted",ks="pagination:updated",Ia="navigation:mounted",Ra="autoplay:play",Ms="autoplay:playing",Ea="autoplay:pause",ka="lazyload:loaded",Ps="sk",As="sh",nr="ei";function qt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=xs();function i(l,s){n.bind(t,xo(l).join(" "),function(d){s.apply(s,va(d.detail)?d.detail:[])})}function o(l){n.dispatch(t,l,Xn(arguments,1))}return e&&e.event.on(La,n.destroy),lo(n,{bus:t,on:i,off:Ot(n.unbind,t),emit:o})}function pr(e,t,n,i){var o=Date.now,l,s=0,d,c=!0,u=0;function m(){if(!c){if(s=e?qn((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++u>=i))return b();d=Za(m)}}function x(R){R||f(),l=o()-(R?s*e:0),c=!1,d=Za(m)}function b(){c=!0}function T(){l=o(),s=0,n&&n(s)}function f(){d&&cancelAnimationFrame(d),s=0,d=0,c=!0}function L(R){e=R}function $(){return c}return{start:x,rewind:T,pause:b,cancel:f,set:L,isPaused:$}}function xd(e){var t=e;function n(o){t=o}function i(o){return ba(xo(o),t)}return{set:n,is:i}}function bd(e,t){var n=pr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function wd(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=xs(),d=[];function c(){var f=n.mediaQuery==="min";ao(o).sort(function(L,$){return f?+L-+$:+$-+L}).forEach(function(L){m(o[L],"("+(f?"min":"max")+"-width:"+L+"px)")}),m(l,Ya),x()}function u(f){f&&s.destroy()}function m(f,L){var $=matchMedia(L);s.bind($,"change",x),d.push([f,$])}function x(){var f=i.is(Qo),L=n.direction,$=d.reduce(function(R,E){return zn(R,E[1].matches?E[0]:{})},{});Ja(n),T($),n.destroy?e.destroy(n.destroy==="completely"):f?(u(!0),e.mount()):L!==n.direction&&e.refresh()}function b(f){matchMedia(Ya).matches&&(f?zn(n,l):Ja(n,ao(l)))}function T(f,L,$){zn(n,f),L&&zn(Object.getPrototypeOf(n),f),($||!i.is(Ci))&&e.emit(an,n)}return{setup:c,destroy:u,reduce:b,set:T}}var mr="Arrow",gr=mr+"Left",hr=mr+"Right",Fs=mr+"Up",Ws=mr+"Down",tl="rtl",fr="ttb",Pr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Fs,hr],ArrowRight:[Ws,gr]};function Sd(e,t,n){function i(l,s,d){d=d||n.direction;var c=d===tl&&!s?1:d===fr?0:-1;return Pr[l]&&Pr[l][c]||l.replace(/width|left|right/i,function(u,m){var x=Pr[u.toLowerCase()][c]||u;return m>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(l){return l*(n.direction===tl?1:-1)}return{resolve:i,orient:o}}var Pn="role",Li="tabindex",$d="disabled",wn="aria-",$o=wn+"controls",_s=wn+"current",nl=wn+"selected",fn=wn+"label",Ma=wn+"labelledby",Ns=wn+"hidden",Pa=wn+"orientation",uo=wn+"roledescription",il=wn+"live",ol=wn+"busy",rl=wn+"atomic",Aa=[Pn,Li,$d,$o,_s,fn,Ma,Ns,Pa,uo],In=So+"__",Zn="is-",Ar=So,al=In+"track",Cd=In+"list",yr=In+"slide",Hs=yr+"--clone",Td=yr+"__container",Fa=In+"arrows",vr=In+"arrow",js=vr+"--prev",Os=vr+"--next",xr=In+"pagination",zs=xr+"__page",Ld=In+"progress",Id=Ld+"__bar",Rd=In+"toggle",Ed=In+"spinner",kd=In+"sr",Md=Zn+"initialized",pi=Zn+"active",Bs=Zn+"prev",Ds=Zn+"next",ca=Zn+"visible",da=Zn+"loading",Vs=Zn+"focus-in",Gs=Zn+"overflow",Pd=[pi,ca,Bs,Ds,da,Vs,Gs],Ad={slide:yr,clone:Hs,arrows:Fa,arrow:vr,prev:js,next:Os,pagination:xr,page:zs,spinner:Ed};function Fd(e,t){if(ps(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ro(n,t);)n=n.parentElement;return n}var Wd=5,ll=200,qs="touchstart mousedown",Fr="touchmove mousemove",Wr="touchend touchcancel mouseup click";function _d(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=e.root,d=n.i18n,c={},u=[],m=[],x=[],b,T,f;function L(){C(),U(),E()}function $(){o(Zt,R),o(Zt,L),o(an,E),l(document,qs+" keydown",function(I){f=I.type==="keydown"},{capture:!0}),l(s,"focusin",function(){kn(s,Vs,!!f)})}function R(I){var w=Aa.concat("style");Wn(u),Mn(s,m),Mn(b,x),Ln([b,T],w),Ln(s,I?w:["style",uo])}function E(){Mn(s,m),Mn(b,x),m=j(Ar),x=j(al),Tn(s,m),Tn(b,x),ct(s,fn,n.label),ct(s,Ma,n.labelledby)}function C(){b=k("."+al),T=wo(b,"."+Cd),Qi(b&&T,"A track/list element is missing."),Ko(u,gs(T,"."+yr+":not(."+Hs+")")),di({arrows:Fa,pagination:xr,prev:js,next:Os,bar:Id,toggle:Rd},function(I,w){c[w]=k("."+I)}),lo(c,{root:s,track:b,list:T,slides:u})}function U(){var I=s.id||yd(So),w=n.role;s.id=I,b.id=b.id||I+"-track",T.id=T.id||I+"-list",!bn(s,Pn)&&s.tagName!=="SECTION"&&w&&ct(s,Pn,w),ct(s,uo,d.carousel),ct(T,Pn,"presentation")}function k(I){var w=ys(s,I);return w&&Fd(w,"."+Ar)===s?w:void 0}function j(I){return[I+"--"+n.type,I+"--"+n.direction,n.drag&&I+"--draggable",n.isNavigation&&I+"--nav",I===Ar&&pi]}return lo(c,{setup:L,mount:$,destroy:R})}var ki="slide",Di="loop",Co="fade";function Nd(e,t,n,i){var o=qt(e),l=o.on,s=o.emit,d=o.bind,c=e.Components,u=e.root,m=e.options,x=m.isNavigation,b=m.updateOnMove,T=m.i18n,f=m.pagination,L=m.slideFocus,$=c.Direction.resolve,R=bn(i,"style"),E=bn(i,fn),C=n>-1,U=wo(i,"."+Td),k;function j(){C||(i.id=u.id+"-slide"+Ca(t+1),ct(i,Pn,f?"tabpanel":"group"),ct(i,uo,T.slide),ct(i,fn,E||la(T.slideLabel,[t+1,e.length]))),I()}function I(){d(i,"click",Ot(s,Ta,N)),d(i,"keydown",Ot(s,Ps,N)),l([Bi,As,hi],S),l(Ia,W),b&&l(_n,h)}function w(){k=!0,o.destroy(),Mn(i,Pd),Ln(i,Aa),ct(i,"style",R),ct(i,fn,E||"")}function W(){var F=e.splides.map(function(A){var q=A.splide.Components.Slides.getAt(t);return q?q.slide.id:""}).join(" ");ct(i,fn,la(T.slideX,(C?n:t)+1)),ct(i,$o,F),ct(i,Pn,L?"button":""),L&&Ln(i,uo)}function h(){k||S()}function S(){if(!k){var F=e.index;M(),z(),kn(i,Bs,t===F-1),kn(i,Ds,t===F+1)}}function M(){var F=le();F!==Qa(i,pi)&&(kn(i,pi,F),ct(i,_s,x&&F||""),s(F?bs:ws,N))}function z(){var F=Y(),A=!F&&(!le()||C);if(e.state.is([zi,yo])||ct(i,Ns,A||""),ct(Sa(i,m.focusableNodes||""),Li,A?-1:""),L&&ct(i,Li,A?-1:0),F!==Qa(i,ca)&&(kn(i,ca,F),s(F?Ss:$s,N)),!F&&document.activeElement===i){var q=c.Slides.getAt(e.index);q&&hs(q.slide)}}function K(F,A,q){xn(q&&U||i,F,A)}function le(){var F=e.index;return F===t||m.cloneStatus&&F===n}function Y(){if(e.is(Co))return le();var F=gn(c.Elements.track),A=gn(i),q=$("left",!0),G=$("right",!0);return tr(F[q])<=co(A[q])&&tr(A[G])<=co(F[G])}function D(F,A){var q=sn(F-t);return!C&&(m.rewind||e.is(Di))&&(q=qn(q,e.length-q)),q<=A}var N={index:t,slideIndex:n,slide:i,container:U,isClone:C,mount:j,destroy:w,update:S,style:K,isWithin:D};return N}function Hd(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=i.bind,d=t.Elements,c=d.slides,u=d.list,m=[];function x(){b(),o(Zt,T),o(Zt,b)}function b(){c.forEach(function(S,M){L(S,M,-1)})}function T(){k(function(S){S.destroy()}),Wn(m)}function f(){k(function(S){S.update()})}function L(S,M,z){var K=Nd(e,M,z,S);K.mount(),m.push(K),m.sort(function(le,Y){return le.index-Y.index})}function $(S){return S?j(function(M){return!M.isClone}):m}function R(S){var M=t.Controller,z=M.toIndex(S),K=M.hasFocus()?1:n.perPage;return j(function(le){return Uo(le.index,z,z+K-1)})}function E(S){return j(S)[0]}function C(S,M){vn(S,function(z){if(Gn(z)&&(z=fs(z)),ms(z)){var K=c[M];K?wa(z,K):bo(u,z),Tn(z,n.classes.slide),w(z,Ot(l,Ei))}}),l(Zt)}function U(S){ui(j(S).map(function(M){return M.slide})),l(Zt)}function k(S,M){$(M).forEach(S)}function j(S){return m.filter(ps(S)?S:function(M){return Gn(S)?ro(M.slide,S):ba(xo(S),M.index)})}function I(S,M,z){k(function(K){K.style(S,M,z)})}function w(S,M){var z=Sa(S,"img"),K=z.length;K?z.forEach(function(le){s(le,"load error",function(){--K||M()})}):M()}function W(S){return S?c.length:m.length}function h(){return m.length>n.perPage}return{mount:x,destroy:T,update:f,register:L,get:$,getIn:R,getAt:E,add:C,remove:U,forEach:k,filter:j,style:I,getLength:W,isEnough:h}}function jd(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,m=u.root,x=u.track,b=u.list,T=d.getAt,f=d.style,L,$,R;function E(){C(),l(window,"resize load",bd(Ot(s,Ei))),o([an,Zt],C),o(Ei,U)}function C(){L=n.direction===fr,xn(m,"maxWidth",ti(n.width)),xn(x,c("paddingLeft"),k(!1)),xn(x,c("paddingRight"),k(!0)),U(!0)}function U(N){var F=gn(m);(N||$.width!==F.width||$.height!==F.height)&&(xn(x,"height",j()),f(c("marginRight"),ti(n.gap)),f("width",w()),f("height",W(),!0),$=F,s(dr),R!==(R=D())&&(kn(m,Gs,R),s(vd,R)))}function k(N){var F=n.padding,A=c(N?"right":"left");return F&&ti(F[A]||(oo(F)?0:F))||"0px"}function j(){var N="";return L&&(N=I(),Qi(N,"height or heightRatio is missing."),N="calc("+N+" - "+k(!1)+" - "+k(!0)+")"),N}function I(){return ti(n.height||gn(b).width*n.heightRatio)}function w(){return n.autoWidth?null:ti(n.fixedWidth)||(L?"":h())}function W(){return ti(n.fixedHeight)||(L?n.autoHeight?null:h():I())}function h(){var N=ti(n.gap);return"calc((100%"+(N&&" + "+N)+")/"+(n.perPage||1)+(N&&" - "+N)+")"}function S(){return gn(b)[c("width")]}function M(N,F){var A=T(N||0);return A?gn(A.slide)[c("width")]+(F?0:le()):0}function z(N,F){var A=T(N);if(A){var q=gn(A.slide)[c("right")],G=gn(b)[c("left")];return sn(q-G)+(F?0:le())}return 0}function K(N){return z(e.length-1)-z(0)+M(0,N)}function le(){var N=T(0);return N&&parseFloat(xn(N.slide,c("marginRight")))||0}function Y(N){return parseFloat(xn(x,c("padding"+(N?"Right":"Left"))))||0}function D(){return e.is(Co)||K(!0)>S()}return{mount:E,resize:U,listSize:S,slideSize:M,sliderSize:K,totalSize:z,getPadding:Y,isOverflow:D}}var Od=2;function zd(e,t,n){var i=qt(e),o=i.on,l=t.Elements,s=t.Slides,d=t.Direction.resolve,c=[],u;function m(){o(Zt,x),o([an,Ei],T),(u=$())&&(f(u),t.Layout.resize(!0))}function x(){b(),m()}function b(){ui(c),Wn(c),i.destroy()}function T(){var R=$();u!==R&&(u<R||!R)&&i.emit(Zt)}function f(R){var E=s.get().slice(),C=E.length;if(C){for(;E.length<R;)Ko(E,E);Ko(E.slice(-R),E.slice(0,R)).forEach(function(U,k){var j=k<R,I=L(U.slide,k);j?wa(I,E[0].slide):bo(l.list,I),Ko(c,I),s.register(I,k-R+(j?0:C),U.index)})}}function L(R,E){var C=R.cloneNode(!0);return Tn(C,n.classes.clone),C.id=e.root.id+"-clone"+Ca(E+1),C}function $(){var R=n.clones;if(!e.is(Di))R=0;else if(vo(R)){var E=n[d("fixedWidth")]&&t.Layout.slideSize(0),C=E&&co(gn(l.track)[d("width")]/E);R=C||n[d("autoWidth")]&&e.length||n.perPage*Od}return R}return{mount:m,destroy:b}}function Bd(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,m=d.totalSize,x=d.listSize,b=d.sliderSize,T=t.Direction,f=T.resolve,L=T.orient,$=t.Elements,R=$.list,E=$.track,C;function U(){C=t.Transition,o([Yn,dr,an,Zt],k)}function k(){t.Controller.isBusy()||(t.Scroll.cancel(),I(e.index),t.Slides.update())}function j(A,q,G,Z){A!==q&&N(A>G)&&(S(),w(h(K(),A>G),!0)),s(zi),l(_n,q,G,A),C.start(q,function(){s(Ri),l(Bi,q,G,A),Z&&Z()})}function I(A){w(z(A,!0))}function w(A,q){if(!e.is(Co)){var G=q?A:W(A);xn(R,"transform","translate"+f("X")+"("+G+"px)"),A!==G&&l(As)}}function W(A){if(e.is(Di)){var q=M(A),G=q>t.Controller.getEnd(),Z=q<0;(Z||G)&&(A=h(A,G))}return A}function h(A,q){var G=A-D(q),Z=b();return A-=L(Z*(co(sn(G)/Z)||1))*(q?1:-1),A}function S(){w(K(),!0),C.cancel()}function M(A){for(var q=t.Slides.get(),G=0,Z=1/0,_=0;_<q.length;_++){var me=q[_].index,v=sn(z(me,!0)-A);if(v<=Z)Z=v,G=me;else break}return G}function z(A,q){var G=L(m(A-1)-Y(A));return q?le(G):G}function K(){var A=f("left");return gn(R)[A]-gn(E)[A]+L(u(!1))}function le(A){return n.trimSpace&&e.is(ki)&&(A=wi(A,0,L(b(!0)-x()))),A}function Y(A){var q=n.focus;return q==="center"?(x()-c(A,!0))/2:+q*c(A)||0}function D(A){return z(A?t.Controller.getEnd():0,!!n.trimSpace)}function N(A){var q=L(h(K(),A));return A?q>=0:q<=R[f("scrollWidth")]-gn(E)[f("width")]}function F(A,q){q=vo(q)?K():q;var G=A!==!0&&L(q)<L(D(!1)),Z=A!==!1&&L(q)>L(D(!0));return G||Z}return{mount:U,move:j,jump:I,translate:w,shift:h,cancel:S,toIndex:M,toPosition:z,getPosition:K,getLimit:D,exceededLimit:F,reposition:k}}function Dd(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=t.Move,d=s.getPosition,c=s.getLimit,u=s.toPosition,m=t.Slides,x=m.isEnough,b=m.getLength,T=n.omitEnd,f=e.is(Di),L=e.is(ki),$=Ot(K,!1),R=Ot(K,!0),E=n.start||0,C,U=E,k,j,I;function w(){W(),o([an,Zt,nr],W),o(dr,h)}function W(){k=b(!0),j=n.perMove,I=n.perPage,C=N();var v=wi(E,0,T?C:k-1);v!==E&&(E=v,s.reposition())}function h(){C!==N()&&l(nr)}function S(v,fe,J){if(!me()){var de=z(v),$e=D(de);$e>-1&&(fe||$e!==E)&&(G($e),s.move(de,$e,U,J))}}function M(v,fe,J,de){t.Scroll.scroll(v,fe,J,function(){var $e=D(s.toIndex(d()));G(T?qn($e,C):$e),de&&de()})}function z(v){var fe=E;if(Gn(v)){var J=v.match(/([+\-<>])(\d+)?/)||[],de=J[1],$e=J[2];de==="+"||de==="-"?fe=le(E+ +(""+de+(+$e||1)),E):de===">"?fe=$e?F(+$e):$(!0):de==="<"&&(fe=R(!0))}else fe=f?v:wi(v,0,C);return fe}function K(v,fe){var J=j||(_()?1:I),de=le(E+J*(v?-1:1),E,!(j||_()));return de===-1&&L&&!vs(d(),c(!v),1)?v?0:C:fe?de:D(de)}function le(v,fe,J){if(x()||_()){var de=Y(v);de!==v&&(fe=v,v=de,J=!1),v<0||v>C?!j&&(Uo(0,v,fe,!0)||Uo(C,fe,v,!0))?v=F(A(v)):f?v=J?v<0?-(k%I||I):k:v:n.rewind?v=v<0?C:0:v=-1:J&&v!==fe&&(v=F(A(fe)+(v<fe?-1:1)))}else v=-1;return v}function Y(v){if(L&&n.trimSpace==="move"&&v!==E)for(var fe=d();fe===u(v,!0)&&Uo(v,0,e.length-1,!n.rewind);)v<E?--v:++v;return v}function D(v){return f?(v+k)%k||0:v}function N(){for(var v=k-(_()||f&&j?1:I);T&&v-- >0;)if(u(k-1,!0)!==u(v,!0)){v++;break}return wi(v,0,k-1)}function F(v){return wi(_()?v:I*v,0,C)}function A(v){return _()?qn(v,C):tr((v>=C?k-1:v)/I)}function q(v){var fe=s.toIndex(v);return L?wi(fe,0,C):fe}function G(v){v!==E&&(U=E,E=v)}function Z(v){return v?U:E}function _(){return!vo(n.focus)||n.isNavigation}function me(){return e.state.is([zi,yo])&&!!n.waitForTransition}return{mount:w,go:S,scroll:M,getNext:$,getPrev:R,getAdjacent:K,getEnd:N,setIndex:G,getIndex:Z,toIndex:F,toPage:A,toDest:q,hasFocus:_,isBusy:me}}var Vd="http://www.w3.org/2000/svg",Gd="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",ko=40;function qd(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.emit,d=n.classes,c=n.i18n,u=t.Elements,m=t.Controller,x=u.arrows,b=u.track,T=x,f=u.prev,L=u.next,$,R,E={};function C(){k(),o(an,U)}function U(){j(),C()}function k(){var M=n.arrows;M&&!(f&&L)&&W(),f&&L&&(lo(E,{prev:f,next:L}),so(T,M?"":"none"),Tn(T,R=Fa+"--"+n.direction),M&&(I(),S(),ct([f,L],$o,b.id),s(Is,f,L)))}function j(){i.destroy(),Mn(T,R),$?(ui(x?[f,L]:T),f=L=null):Ln([f,L],Aa)}function I(){o([Yn,Bi,Zt,hi,nr],S),l(L,"click",Ot(w,">")),l(f,"click",Ot(w,"<"))}function w(M){m.go(M,!0)}function W(){T=x||Ti("div",d.arrows),f=h(!0),L=h(!1),$=!0,bo(T,[f,L]),!x&&wa(T,b)}function h(M){var z='<button class="'+d.arrow+" "+(M?d.prev:d.next)+'" type="button"><svg xmlns="'+Vd+'" viewBox="0 0 '+ko+" "+ko+'" width="'+ko+'" height="'+ko+'" focusable="false"><path d="'+(n.arrowPath||Gd)+'" />';return fs(z)}function S(){if(f&&L){var M=e.index,z=m.getPrev(),K=m.getNext(),le=z>-1&&M<z?c.last:c.prev,Y=K>-1&&M>K?c.first:c.next;f.disabled=z<0,L.disabled=K<0,ct(f,fn,le),ct(L,fn,Y),s(Rs,f,L,z,K)}}return{arrows:E,mount:C,destroy:j,update:S}}var Kd=$a+"-interval";function Ud(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.emit,d=pr(n.interval,e.go.bind(e,">"),I),c=d.isPaused,u=t.Elements,m=t.Elements,x=m.root,b=m.toggle,T=n.autoplay,f,L,$=T==="pause";function R(){T&&(E(),b&&ct(b,$o,u.track.id),$||C(),j())}function E(){n.pauseOnHover&&l(x,"mouseenter mouseleave",function(W){f=W.type==="mouseenter",k()}),n.pauseOnFocus&&l(x,"focusin focusout",function(W){L=W.type==="focusin",k()}),b&&l(b,"click",function(){$?C():U(!0)}),o([_n,ur,Zt],d.rewind),o(_n,w)}function C(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),L=f=$=!1,j(),s(Ra))}function U(W){W===void 0&&(W=!0),$=!!W,j(),c()||(d.pause(),s(Ea))}function k(){$||(f||L?U(!1):C())}function j(){b&&(kn(b,pi,!$),ct(b,fn,n.i18n[$?"play":"pause"]))}function I(W){var h=u.bar;h&&xn(h,"width",W*100+"%"),s(Ms,W)}function w(W){var h=t.Slides.getAt(W);d.set(h&&+bn(h.slide,Kd)||n.interval)}return{mount:R,destroy:d.cancel,play:C,pause:U,isPaused:c}}function Xd(e,t,n){var i=qt(e),o=i.on;function l(){n.cover&&(o(ka,Ot(d,!0)),o([Yn,an,Zt],Ot(s,!0)))}function s(c){t.Slides.forEach(function(u){var m=wo(u.container||u.slide,"img");m&&m.src&&d(c,m,u)})}function d(c,u,m){m.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),so(u,c?"none":"")}return{mount:l,destroy:Ot(s,!1)}}var Yd=10,Zd=600,Jd=.6,Qd=1.5,eu=800;function tu(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,m=d.exceededLimit,x=d.translate,b=e.is(ki),T,f,L=1;function $(){o(_n,U),o([an,Zt],k)}function R(I,w,W,h,S){var M=c();if(U(),W&&(!b||!m())){var z=t.Layout.sliderSize(),K=aa(I)*z*tr(sn(I)/z)||0;I=d.toPosition(t.Controller.toDest(I%z))+K}var le=vs(M,I,1);L=1,w=le?0:w||er(sn(I-M)/Qd,eu),f=h,T=pr(w,E,Ot(C,M,I,S),1),s(yo),l(ur),T.start()}function E(){s(Ri),f&&f(),l(hi)}function C(I,w,W,h){var S=c(),M=I+(w-I)*j(h),z=(M-S)*L;x(S+z),b&&!W&&m()&&(L*=Jd,sn(z)<Yd&&R(u(m(!0)),Zd,!1,f,!0))}function U(){T&&T.cancel()}function k(){T&&!T.isPaused()&&(U(),E())}function j(I){var w=n.easingFunc;return w?w(I):1-Math.pow(1-I,4)}return{mount:$,destroy:U,scroll:R,cancel:k}}var Si={passive:!1,capture:!0};function nu(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=i.bind,d=i.unbind,c=e.state,u=t.Move,m=t.Scroll,x=t.Controller,b=t.Elements.track,T=t.Media.reduce,f=t.Direction,L=f.resolve,$=f.orient,R=u.getPosition,E=u.exceededLimit,C,U,k,j,I,w=!1,W,h,S;function M(){s(b,Fr,oa,Si),s(b,Wr,oa,Si),s(b,qs,K,Si),s(b,"click",D,{capture:!0}),s(b,"dragstart",En),o([Yn,an],z)}function z(){var Q=n.drag;xe(!Q),j=Q==="free"}function K(Q){if(W=!1,!h){var ye=$e(Q);de(Q.target)&&(ye||!Q.button)&&(x.isBusy()?En(Q,!0):(S=ye?b:window,I=c.is([zi,yo]),k=null,s(S,Fr,le,Si),s(S,Wr,Y,Si),u.cancel(),m.cancel(),N(Q)))}}function le(Q){if(c.is(qo)||(c.set(qo),l(Cs)),Q.cancelable)if(I){u.translate(C+J(_(Q)));var ye=me(Q)>ll,ve=w!==(w=E());(ye||ve)&&N(Q),W=!0,l(Ts),En(Q)}else q(Q)&&(I=A(Q),En(Q))}function Y(Q){c.is(qo)&&(c.set(Ri),l(Ls)),I&&(F(Q),En(Q)),d(S,Fr,le),d(S,Wr,Y),I=!1}function D(Q){!h&&W&&En(Q,!0)}function N(Q){k=U,U=Q,C=R()}function F(Q){var ye=G(Q),ve=Z(ye),ke=n.rewind&&n.rewindByDrag;T(!1),j?x.scroll(ve,0,n.snap):e.is(Co)?x.go($(aa(ye))<0?ke?"<":"-":ke?">":"+"):e.is(ki)&&w&&ke?x.go(E(!0)?">":"<"):x.go(x.toDest(ve),!0),T(!0)}function A(Q){var ye=n.dragMinThreshold,ve=oo(ye),ke=ve&&ye.mouse||0,we=(ve?ye.touch:+ye)||10;return sn(_(Q))>($e(Q)?we:ke)}function q(Q){return sn(_(Q))>sn(_(Q,!0))}function G(Q){if(e.is(Di)||!w){var ye=me(Q);if(ye&&ye<ll)return _(Q)/ye}return 0}function Z(Q){return R()+aa(Q)*qn(sn(Q)*(n.flickPower||600),j?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function _(Q,ye){return fe(Q,ye)-fe(v(Q),ye)}function me(Q){return ra(Q)-ra(v(Q))}function v(Q){return U===Q&&k||U}function fe(Q,ye){return($e(Q)?Q.changedTouches[0]:Q)["page"+L(ye?"Y":"X")]}function J(Q){return Q/(w&&e.is(ki)?Wd:1)}function de(Q){var ye=n.noDrag;return!ro(Q,"."+zs+", ."+vr)&&(!ye||!ro(Q,ye))}function $e(Q){return typeof TouchEvent<"u"&&Q instanceof TouchEvent}function oe(){return I}function xe(Q){h=Q}return{mount:M,disable:xe,isDragging:oe}}var iu={Spacebar:" ",Right:hr,Left:gr,Up:Fs,Down:Ws};function Wa(e){return e=Gn(e)?e:e.key,iu[e]||e}var sl="keydown";function ou(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.unbind,d=e.root,c=t.Direction.resolve,u,m;function x(){b(),o(an,T),o(an,b),o(_n,L)}function b(){var R=n.keyboard;R&&(u=R==="global"?window:d,l(u,sl,$))}function T(){s(u,sl)}function f(R){m=R}function L(){var R=m;m=!0,us(function(){m=R})}function $(R){if(!m){var E=Wa(R);E===c(gr)?e.go("<"):E===c(hr)&&e.go(">")}}return{mount:x,destroy:T,disable:f}}var eo=$a+"-lazy",Xo=eo+"-srcset",ru="["+eo+"], ["+Xo+"]";function au(e,t,n){var i=qt(e),o=i.on,l=i.off,s=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Bi,hi],m=[];function x(){n.lazyLoad&&(b(),o(Zt,b))}function b(){Wn(m),T(),c?R():(l(u),o(u,f),f())}function T(){t.Slides.forEach(function(E){Sa(E.slide,ru).forEach(function(C){var U=bn(C,eo),k=bn(C,Xo);if(U!==C.src||k!==C.srcset){var j=n.classes.spinner,I=C.parentElement,w=wo(I,"."+j)||Ti("span",j,I);m.push([C,E,w]),C.src||so(C,"none")}})})}function f(){m=m.filter(function(E){var C=n.perPage*((n.preloadPages||1)+1)-1;return E[1].isWithin(e.index,C)?L(E):!0}),m.length||l(u)}function L(E){var C=E[0];Tn(E[1].slide,da),s(C,"load error",Ot($,E)),ct(C,"src",bn(C,eo)),ct(C,"srcset",bn(C,Xo)),Ln(C,eo),Ln(C,Xo)}function $(E,C){var U=E[0],k=E[1];Mn(k.slide,da),C.type!=="error"&&(ui(E[2]),so(U,""),d(ka,U,k),d(Ei)),c&&R()}function R(){m.length&&L(m.shift())}return{mount:x,destroy:Ot(Wn,m),check:f}}function lu(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,m=u.hasFocus,x=u.getIndex,b=u.go,T=t.Direction.resolve,f=c.pagination,L=[],$,R;function E(){C(),o([an,Zt,nr],E);var h=n.pagination;f&&so(f,h?"":"none"),h&&(o([_n,ur,hi],W),U(),W(),l(Es,{list:$,items:L},w(e.index)))}function C(){$&&(ui(f?Xn($.children):$),Mn($,R),Wn(L),$=null),i.destroy()}function U(){var h=e.length,S=n.classes,M=n.i18n,z=n.perPage,K=m()?u.getEnd()+1:co(h/z);$=f||Ti("ul",S.pagination,c.track.parentElement),Tn($,R=xr+"--"+I()),ct($,Pn,"tablist"),ct($,fn,M.select),ct($,Pa,I()===fr?"vertical":"");for(var le=0;le<K;le++){var Y=Ti("li",null,$),D=Ti("button",{class:S.page,type:"button"},Y),N=d.getIn(le).map(function(A){return A.slide.id}),F=!m()&&z>1?M.pageX:M.slideX;s(D,"click",Ot(k,le)),n.paginationKeyboard&&s(D,"keydown",Ot(j,le)),ct(Y,Pn,"presentation"),ct(D,Pn,"tab"),ct(D,$o,N.join(" ")),ct(D,fn,la(F,le+1)),ct(D,Li,-1),L.push({li:Y,button:D,page:le})}}function k(h){b(">"+h,!0)}function j(h,S){var M=L.length,z=Wa(S),K=I(),le=-1;z===T(hr,!1,K)?le=++h%M:z===T(gr,!1,K)?le=(--h+M)%M:z==="Home"?le=0:z==="End"&&(le=M-1);var Y=L[le];Y&&(hs(Y.button),b(">"+le),En(S,!0))}function I(){return n.paginationDirection||n.direction}function w(h){return L[u.toPage(h)]}function W(){var h=w(x(!0)),S=w(x());if(h){var M=h.button;Mn(M,pi),Ln(M,nl),ct(M,Li,-1)}if(S){var z=S.button;Tn(z,pi),ct(z,nl,!0),ct(z,Li,"")}l(ks,{list:$,items:L},h,S)}return{items:L,mount:E,destroy:C,getAt:w,update:W}}var su=[" ","Enter"];function cu(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(f){f.isParent||(u(e,f.splide),u(f.splide,e))}),i&&m()}function d(){l.forEach(function(f){f.destroy()}),Wn(l)}function c(){d(),s()}function u(f,L){var $=qt(f);$.on(_n,function(R,E,C){L.go(L.is(Di)?C:R)}),l.push($)}function m(){var f=qt(e),L=f.on;L(Ta,b),L(Ps,T),L([Yn,an],x),l.push(f),f.emit(Ia,e.splides)}function x(){ct(t.Elements.list,Pa,n.direction===fr?"vertical":"")}function b(f){e.go(f.index)}function T(f,L){ba(su,Wa(L))&&(b(f),En(L))}return{setup:Ot(t.Media.set,{slideFocus:vo(o)?i:o},!0),mount:s,destroy:d,remount:c}}function du(e,t,n){var i=qt(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,Si)}function d(u){if(u.cancelable){var m=u.deltaY,x=m<0,b=ra(u),T=n.wheelMinThreshold||0,f=n.wheelSleep||0;sn(m)>T&&b-l>f&&(e.go(x?"<":">"),l=b),c(x)&&En(u)}}function c(u){return!n.releaseWheel||e.state.is(zi)||t.Controller.getAdjacent(u)!==-1}return{mount:s}}var uu=90;function pu(e,t,n){var i=qt(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,d=Ti("span",kd),c=pr(uu,Ot(m,!1));function u(){s&&(b(!t.Autoplay.isPaused()),ct(l,rl,!0),d.textContent="…",o(Ra,Ot(b,!0)),o(Ea,Ot(b,!1)),o([Bi,hi],Ot(m,!0)))}function m(T){ct(l,ol,T),T?(bo(l,d),c.start()):(ui(d),c.cancel())}function x(){Ln(l,[il,rl,ol]),ui(d)}function b(T){s&&ct(l,il,T?"off":"polite")}return{mount:u,disable:b,destroy:x}}var mu=Object.freeze({__proto__:null,Media:wd,Direction:Sd,Elements:_d,Slides:Hd,Layout:jd,Clones:zd,Move:Bd,Controller:Dd,Arrows:qd,Autoplay:Ud,Cover:Xd,Scroll:tu,Drag:nu,Keyboard:ou,LazyLoad:au,Pagination:lu,Sync:cu,Wheel:du,Live:pu}),gu={prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},hu={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:Ad,i18n:gu,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function fu(e,t,n){var i=t.Slides;function o(){qt(e).on([Yn,Zt],l)}function l(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function s(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),us(c)}return{mount:o,start:s,cancel:oa}}function yu(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,d=Ot(xn,s,"transition"),c;function u(){qt(e).bind(s,"transitionend",function(T){T.target===s&&c&&(x(),c())})}function m(T,f){var L=i.toPosition(T,!0),$=i.getPosition(),R=b(T);sn(L-$)>=1&&R>=1?n.useScroll?l.scroll(L,R,!1,f):(d("transform "+R+"ms "+n.easing),i.translate(L,!0),c=f):(i.jump(T),f())}function x(){d(""),l.cancel()}function b(T){var f=n.rewindSpeed;if(e.is(ki)&&f){var L=o.getIndex(!0),$=o.getEnd();if(L===0&&T>=$||L>=$&&T===0)return f}return n.speed}return{mount:u,start:m,cancel:x}}var vu=(function(){function e(n,i){this.event=qt(),this.Components={},this.state=xd(Ci),this.splides=[],this._o={},this._E={};var o=Gn(n)?ys(document,n):n;Qi(o,o+" is invalid."),this.root=o,i=zn({label:bn(o,fn)||"",labelledby:bn(o,Ma)||""},hu,e.defaults,i||{});try{zn(i,JSON.parse(bn(o,$a)))}catch{Qi(!1,"Invalid JSON")}this._o=Object.create(zn({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,d=this.Components;Qi(s.is([Ci,Qo]),"Already mounted!"),s.set(Ci),this._C=d,this._T=o||this._T||(this.is(Co)?fu:yu),this._E=i||this._E;var c=lo({},mu,this._E,{Transition:this._T});return di(c,function(u,m){var x=u(l,d,l._o);d[m]=x,x.setup&&x.setup()}),di(d,function(u){u.mount&&u.mount()}),this.emit(Yn),Tn(this.root,Md),s.set(Ri),this.emit(sa),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Ri)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(Xn(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(Zt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(Ci)?qt(this).on(sa,this.destroy.bind(this,i)):(di(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(La),o.destroy(),i&&Wn(this.splides),l.set(Qo)),this},gd(e,[{key:"options",get:function(){return this._o},set:function(i){this._C.Media.set(i,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),_a=vu;_a.defaults={};_a.STATES=fd;var cl=[[Yn,"onMounted"],[sa,"onReady"],[_n,"onMove"],[Bi,"onMoved"],[Ta,"onClick"],[bs,"onActive"],[ws,"onInactive"],[Ss,"onVisible"],[$s,"onHidden"],[Zt,"onRefresh"],[an,"onUpdated"],[Ei,"onResize"],[dr,"onResized"],[Cs,"onDrag"],[Ts,"onDragging"],[Ls,"onDragged"],[ur,"onScroll"],[hi,"onScrolled"],[La,"onDestroy"],[Is,"onArrowsMounted"],[Rs,"onArrowsUpdated"],[Es,"onPaginationMounted"],[ks,"onPaginationUpdated"],[Ia,"onNavigationMounted"],[Ra,"onAutoplayPlay"],[Ms,"onAutoplayPlaying"],[Ea,"onAutoplayPause"],[ka,"onLazyLoadLoaded"]];function Na(...e){return e.filter(Boolean).join(" ")}function ir(e){return e!==null&&typeof e=="object"}function ua(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!ua(n,t[i]));if(ir(e)&&ir(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!ua(e[o],t[o]))}return e===t}function xu(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function bu(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function pa(e,t){const n=e;return bu(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():ir(i)?n[o]=pa(ir(n[o])?n[o]:{},i):n[o]=i}),n}var wu=({children:e,className:t,...n})=>a.createElement("div",{className:Na("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),br=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new _a(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=pa({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!ua(this.options,e)&&(this.splide.options=e,this.options=pa({},e));const t=this.getSlides();xu(this.slides,t)||(this.splide.refresh(),this.slides=t)}sync(e){var t;(t=this.splide)==null||t.sync(e)}go(e){var t;(t=this.splide)==null||t.go(e)}getSlides(){var e;if(this.splide){const t=(e=this.splide.Components.Elements)==null?void 0:e.list.children;return t&&Array.prototype.slice.call(t)||[]}return[]}bind(e){cl.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return a.createElement(t,{className:Na("splide",e),ref:this.splideRef,...this.omit(o,["options",...cl.map(l=>l[1])])},n?a.createElement(wu,null,i):i)}},wr=({children:e,className:t,...n})=>a.createElement("li",{className:Na("splide__slide",t),...n},e);/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),nt=require("classnames"),y=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),gi=require("react-dom");function $c(e){return e.type==="object"&&e.version===1}const Cc="ControlSlider-module__wrapper___sHEkd",Tc="ControlSlider-module__hoverArrow___A-dOH",Lc="ControlSlider-module__sliderItem___QQSkR",Ic="ControlSlider-module__sliderImage___9hRl-",Rc="ControlSlider-module__arrow___05ghY",Ec="ControlSlider-module__arrowVertical___tBfVN",kc="ControlSlider-module__nextArrow___-30Yc",Mc="ControlSlider-module__arrowInner___aEra3",Pc="ControlSlider-module__arrowIcon___S4ztF",Ac="ControlSlider-module__arrowImg___2dwJW",Fc="ControlSlider-module__mirror___brd6U",Wc="ControlSlider-module__pagination___bicLF",_c="ControlSlider-module__paginationInner___bT-P-",Nc="ControlSlider-module__paginationVertical___zYqKw",Hc="ControlSlider-module__paginationItem___nTRbk",jc="ControlSlider-module__dot___p1Qun",Oc="ControlSlider-module__activeDot___LHFaj",zc="ControlSlider-module__paginationInsideBottom___R3FWn",Bc="ControlSlider-module__paginationInsideTop___V-qb-",Dc="ControlSlider-module__paginationOutsideBottom___14w8D",Vc="ControlSlider-module__paginationOutsideTop___SCLqB",Gc="ControlSlider-module__paginationInsideLeft___yOBRZ",qc="ControlSlider-module__paginationInsideRight___Rtt3o",Kc="ControlSlider-module__paginationOutsideLeft___lahaw",Uc="ControlSlider-module__paginationOutsideRight___EtuQa",Xc="ControlSlider-module__imgWrapper___UjEgB",Yc="ControlSlider-module__captionBlock___dJ6-j",Zc="ControlSlider-module__captionTextWrapper___HFlpf",Jc="ControlSlider-module__captionText___uGBVc",Qc="ControlSlider-module__active___WZK4G",ed="ControlSlider-module__withPointerEvents___t-18M",td="ControlSlider-module__topLeftAlignment___zjnGM",nd="ControlSlider-module__topCenterAlignment___gD1xW",id="ControlSlider-module__topRightAlignment___NMapS",od="ControlSlider-module__middleLeftAlignment___OnUrY",rd="ControlSlider-module__middleCenterAlignment___Tdkl0",ad="ControlSlider-module__middleRightAlignment___wEbfX",ld="ControlSlider-module__bottomLeftAlignment___cTP2-",sd="ControlSlider-module__bottomCenterAlignment___c54fB",cd="ControlSlider-module__bottomRightAlignment___kEwrz",dd="ControlSlider-module__clickOverlay___DZA28",ud="ControlSlider-module__contain___pLyq7",pd="ControlSlider-module__cover___KdDat",Xe={wrapper:Cc,hoverArrow:Tc,sliderItem:Lc,sliderImage:Ic,arrow:Rc,arrowVertical:Ec,nextArrow:kc,arrowInner:Mc,arrowIcon:Pc,arrowImg:Ac,mirror:Fc,pagination:Wc,paginationInner:_c,paginationVertical:Nc,paginationItem:Hc,dot:jc,activeDot:Oc,paginationInsideBottom:zc,paginationInsideTop:Bc,paginationOutsideBottom:Dc,paginationOutsideTop:Vc,paginationInsideLeft:Gc,paginationInsideRight:qc,paginationOutsideLeft:Kc,paginationOutsideRight:Uc,imgWrapper:Xc,captionBlock:Yc,captionTextWrapper:Zc,captionText:Jc,active:Qc,withPointerEvents:ed,topLeftAlignment:td,topCenterAlignment:nd,topRightAlignment:id,middleLeftAlignment:od,middleCenterAlignment:rd,middleRightAlignment:ad,bottomLeftAlignment:ld,bottomCenterAlignment:sd,bottomRightAlignment:cd,clickOverlay:dd,contain:ud,cover:pd};function md(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function gd(e,t,n){return t&&md(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ya="(prefers-reduced-motion: reduce)",Ci=1,hd=2,Ri=3,zi=4,yo=5,qo=6,Qo=7,fd={CREATED:Ci,MOUNTED:hd,IDLE:Ri,MOVING:zi,SCROLLING:yo,DRAGGING:qo,DESTROYED:Qo};function Wn(e){e.length=0}function Xn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ot(e){return e.bind.apply(e,[null].concat(Xn(arguments,1)))}var us=setTimeout,oa=function(){};function Za(e){return requestAnimationFrame(e)}function cr(e,t){return typeof t===e}function oo(e){return!xa(e)&&cr("object",e)}var va=Array.isArray,ps=Ot(cr,"function"),Gn=Ot(cr,"string"),vo=Ot(cr,"undefined");function xa(e){return e===null}function ms(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function xo(e){return va(e)?e:[e]}function vn(e,t){xo(e).forEach(t)}function ba(e,t){return e.indexOf(t)>-1}function Ko(e,t){return e.push.apply(e,xo(t)),e}function kn(e,t,n){e&&vn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){kn(e,Gn(t)?t.split(" "):t,!0)}function bo(e,t){vn(t,e.appendChild.bind(e))}function wa(e,t){vn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ro(e,t){return ms(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function gs(e,t){var n=e?Xn(e.children):[];return t?n.filter(function(i){return ro(i,t)}):n}function wo(e,t){return t?gs(e,t)[0]:e.firstElementChild}var ao=Object.keys;function di(e,t,n){return e&&(n?ao(e).reverse():ao(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function lo(e){return Xn(arguments,1).forEach(function(t){di(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Xn(arguments,1).forEach(function(t){di(t,function(n,i){va(n)?e[i]=n.slice():oo(n)?e[i]=zn({},oo(e[i])?e[i]:{},n):e[i]=n})}),e}function Ja(e,t){vn(t||ao(e),function(n){delete e[n]})}function Ln(e,t){vn(e,function(n){vn(t,function(i){n&&n.removeAttribute(i)})})}function ct(e,t,n){oo(t)?di(t,function(i,o){ct(e,o,i)}):vn(e,function(i){xa(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function Ti(e,t,n){var i=document.createElement(e);return t&&(Gn(t)?Tn(i,t):ct(i,t)),n&&bo(n,i),i}function xn(e,t,n){if(vo(n))return getComputedStyle(e)[t];xa(n)||(e.style[t]=""+n)}function so(e,t){xn(e,"display",t)}function hs(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function bn(e,t){return e.getAttribute(t)}function Qa(e,t){return e&&e.classList.contains(t)}function gn(e){return e.getBoundingClientRect()}function ui(e){vn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function fs(e){return wo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ys(e,t){return e&&e.querySelector(t)}function Sa(e,t){return t?Xn(e.querySelectorAll(t)):[]}function Mn(e,t){kn(e,t,!1)}function ra(e){return e.timeStamp}function ti(e){return Gn(e)?e:e?e+"px":""}var So="splide",$a="data-"+So;function Qi(e,t){if(!e)throw new Error("["+So+"] "+(t||""))}var qn=Math.min,er=Math.max,tr=Math.floor,co=Math.ceil,sn=Math.abs;function vs(e,t,n){return sn(e-t)<n}function Uo(e,t,n,i){var o=qn(t,n),l=er(t,n);return i?o<e&&e<l:o<=e&&e<=l}function wi(e,t,n){var i=qn(t,n),o=er(t,n);return qn(er(i,e),o)}function aa(e){return+(e>0)-+(e<0)}function la(e,t){return vn(t,function(n){e=e.replace("%s",""+n)}),e}function Ca(e){return e<10?"0"+e:""+e}var el={};function yd(e){return""+e+Ca(el[e]=(el[e]||0)+1)}function xs(){var e=[];function t(s,d,c,u){o(s,d,function(m,x,b){var T="addEventListener"in m,f=T?m.removeEventListener.bind(m,x,c,u):m.removeListener.bind(m,c);T?m.addEventListener(x,c,u):m.addListener(c),e.push([m,x,b,c,f])})}function n(s,d,c){o(s,d,function(u,m,x){e=e.filter(function(b){return b[0]===u&&b[1]===m&&b[2]===x&&(!c||b[3]===c)?(b[4](),!1):!0})})}function i(s,d,c){var u,m=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:m,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,m,!1,c)),s.dispatchEvent(u),u}function o(s,d,c){vn(s,function(u){u&&vn(d,function(m){m.split(" ").forEach(function(x){var b=x.split(".");c(u,b[0],b[1])})})})}function l(){e.forEach(function(s){s[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var Yn="mounted",sa="ready",_n="move",Bi="moved",Ta="click",bs="active",ws="inactive",Ss="visible",$s="hidden",Zt="refresh",an="updated",Ei="resize",dr="resized",Cs="drag",Ts="dragging",Ls="dragged",ur="scroll",hi="scrolled",vd="overflow",La="destroy",Is="arrows:mounted",Rs="arrows:updated",Es="pagination:mounted",ks="pagination:updated",Ia="navigation:mounted",Ra="autoplay:play",Ms="autoplay:playing",Ea="autoplay:pause",ka="lazyload:loaded",Ps="sk",As="sh",nr="ei";function qt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=xs();function i(l,s){n.bind(t,xo(l).join(" "),function(d){s.apply(s,va(d.detail)?d.detail:[])})}function o(l){n.dispatch(t,l,Xn(arguments,1))}return e&&e.event.on(La,n.destroy),lo(n,{bus:t,on:i,off:Ot(n.unbind,t),emit:o})}function pr(e,t,n,i){var o=Date.now,l,s=0,d,c=!0,u=0;function m(){if(!c){if(s=e?qn((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++u>=i))return b();d=Za(m)}}function x(R){R||f(),l=o()-(R?s*e:0),c=!1,d=Za(m)}function b(){c=!0}function T(){l=o(),s=0,n&&n(s)}function f(){d&&cancelAnimationFrame(d),s=0,d=0,c=!0}function L(R){e=R}function $(){return c}return{start:x,rewind:T,pause:b,cancel:f,set:L,isPaused:$}}function xd(e){var t=e;function n(o){t=o}function i(o){return ba(xo(o),t)}return{set:n,is:i}}function bd(e,t){var n=pr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function wd(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=xs(),d=[];function c(){var f=n.mediaQuery==="min";ao(o).sort(function(L,$){return f?+L-+$:+$-+L}).forEach(function(L){m(o[L],"("+(f?"min":"max")+"-width:"+L+"px)")}),m(l,Ya),x()}function u(f){f&&s.destroy()}function m(f,L){var $=matchMedia(L);s.bind($,"change",x),d.push([f,$])}function x(){var f=i.is(Qo),L=n.direction,$=d.reduce(function(R,P){return zn(R,P[1].matches?P[0]:{})},{});Ja(n),T($),n.destroy?e.destroy(n.destroy==="completely"):f?(u(!0),e.mount()):L!==n.direction&&e.refresh()}function b(f){matchMedia(Ya).matches&&(f?zn(n,l):Ja(n,ao(l)))}function T(f,L,$){zn(n,f),L&&zn(Object.getPrototypeOf(n),f),($||!i.is(Ci))&&e.emit(an,n)}return{setup:c,destroy:u,reduce:b,set:T}}var mr="Arrow",gr=mr+"Left",hr=mr+"Right",Fs=mr+"Up",Ws=mr+"Down",tl="rtl",fr="ttb",Pr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Fs,hr],ArrowRight:[Ws,gr]};function Sd(e,t,n){function i(l,s,d){d=d||n.direction;var c=d===tl&&!s?1:d===fr?0:-1;return Pr[l]&&Pr[l][c]||l.replace(/width|left|right/i,function(u,m){var x=Pr[u.toLowerCase()][c]||u;return m>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(l){return l*(n.direction===tl?1:-1)}return{resolve:i,orient:o}}var Pn="role",Li="tabindex",$d="disabled",wn="aria-",$o=wn+"controls",_s=wn+"current",nl=wn+"selected",fn=wn+"label",Ma=wn+"labelledby",Ns=wn+"hidden",Pa=wn+"orientation",uo=wn+"roledescription",il=wn+"live",ol=wn+"busy",rl=wn+"atomic",Aa=[Pn,Li,$d,$o,_s,fn,Ma,Ns,Pa,uo],In=So+"__",Zn="is-",Ar=So,al=In+"track",Cd=In+"list",yr=In+"slide",Hs=yr+"--clone",Td=yr+"__container",Fa=In+"arrows",vr=In+"arrow",js=vr+"--prev",Os=vr+"--next",xr=In+"pagination",zs=xr+"__page",Ld=In+"progress",Id=Ld+"__bar",Rd=In+"toggle",Ed=In+"spinner",kd=In+"sr",Md=Zn+"initialized",pi=Zn+"active",Bs=Zn+"prev",Ds=Zn+"next",ca=Zn+"visible",da=Zn+"loading",Vs=Zn+"focus-in",Gs=Zn+"overflow",Pd=[pi,ca,Bs,Ds,da,Vs,Gs],Ad={slide:yr,clone:Hs,arrows:Fa,arrow:vr,prev:js,next:Os,pagination:xr,page:zs,spinner:Ed};function Fd(e,t){if(ps(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ro(n,t);)n=n.parentElement;return n}var Wd=5,ll=200,qs="touchstart mousedown",Fr="touchmove mousemove",Wr="touchend touchcancel mouseup click";function _d(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=e.root,d=n.i18n,c={},u=[],m=[],x=[],b,T,f;function L(){C(),U(),P()}function $(){o(Zt,R),o(Zt,L),o(an,P),l(document,qs+" keydown",function(I){f=I.type==="keydown"},{capture:!0}),l(s,"focusin",function(){kn(s,Vs,!!f)})}function R(I){var w=Aa.concat("style");Wn(u),Mn(s,m),Mn(b,x),Ln([b,T],w),Ln(s,I?w:["style",uo])}function P(){Mn(s,m),Mn(b,x),m=j(Ar),x=j(al),Tn(s,m),Tn(b,x),ct(s,fn,n.label),ct(s,Ma,n.labelledby)}function C(){b=E("."+al),T=wo(b,"."+Cd),Qi(b&&T,"A track/list element is missing."),Ko(u,gs(T,"."+yr+":not(."+Hs+")")),di({arrows:Fa,pagination:xr,prev:js,next:Os,bar:Id,toggle:Rd},function(I,w){c[w]=E("."+I)}),lo(c,{root:s,track:b,list:T,slides:u})}function U(){var I=s.id||yd(So),w=n.role;s.id=I,b.id=b.id||I+"-track",T.id=T.id||I+"-list",!bn(s,Pn)&&s.tagName!=="SECTION"&&w&&ct(s,Pn,w),ct(s,uo,d.carousel),ct(T,Pn,"presentation")}function E(I){var w=ys(s,I);return w&&Fd(w,"."+Ar)===s?w:void 0}function j(I){return[I+"--"+n.type,I+"--"+n.direction,n.drag&&I+"--draggable",n.isNavigation&&I+"--nav",I===Ar&&pi]}return lo(c,{setup:L,mount:$,destroy:R})}var ki="slide",Di="loop",Co="fade";function Nd(e,t,n,i){var o=qt(e),l=o.on,s=o.emit,d=o.bind,c=e.Components,u=e.root,m=e.options,x=m.isNavigation,b=m.updateOnMove,T=m.i18n,f=m.pagination,L=m.slideFocus,$=c.Direction.resolve,R=bn(i,"style"),P=bn(i,fn),C=n>-1,U=wo(i,"."+Td),E;function j(){C||(i.id=u.id+"-slide"+Ca(t+1),ct(i,Pn,f?"tabpanel":"group"),ct(i,uo,T.slide),ct(i,fn,P||la(T.slideLabel,[t+1,e.length]))),I()}function I(){d(i,"click",Ot(s,Ta,N)),d(i,"keydown",Ot(s,Ps,N)),l([Bi,As,hi],S),l(Ia,W),b&&l(_n,h)}function w(){E=!0,o.destroy(),Mn(i,Pd),Ln(i,Aa),ct(i,"style",R),ct(i,fn,P||"")}function W(){var F=e.splides.map(function(A){var q=A.splide.Components.Slides.getAt(t);return q?q.slide.id:""}).join(" ");ct(i,fn,la(T.slideX,(C?n:t)+1)),ct(i,$o,F),ct(i,Pn,L?"button":""),L&&Ln(i,uo)}function h(){E||S()}function S(){if(!E){var F=e.index;k(),z(),kn(i,Bs,t===F-1),kn(i,Ds,t===F+1)}}function k(){var F=le();F!==Qa(i,pi)&&(kn(i,pi,F),ct(i,_s,x&&F||""),s(F?bs:ws,N))}function z(){var F=Y(),A=!F&&(!le()||C);if(e.state.is([zi,yo])||ct(i,Ns,A||""),ct(Sa(i,m.focusableNodes||""),Li,A?-1:""),L&&ct(i,Li,A?-1:0),F!==Qa(i,ca)&&(kn(i,ca,F),s(F?Ss:$s,N)),!F&&document.activeElement===i){var q=c.Slides.getAt(e.index);q&&hs(q.slide)}}function K(F,A,q){xn(q&&U||i,F,A)}function le(){var F=e.index;return F===t||m.cloneStatus&&F===n}function Y(){if(e.is(Co))return le();var F=gn(c.Elements.track),A=gn(i),q=$("left",!0),G=$("right",!0);return tr(F[q])<=co(A[q])&&tr(A[G])<=co(F[G])}function D(F,A){var q=sn(F-t);return!C&&(m.rewind||e.is(Di))&&(q=qn(q,e.length-q)),q<=A}var N={index:t,slideIndex:n,slide:i,container:U,isClone:C,mount:j,destroy:w,update:S,style:K,isWithin:D};return N}function Hd(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=i.bind,d=t.Elements,c=d.slides,u=d.list,m=[];function x(){b(),o(Zt,T),o(Zt,b)}function b(){c.forEach(function(S,k){L(S,k,-1)})}function T(){E(function(S){S.destroy()}),Wn(m)}function f(){E(function(S){S.update()})}function L(S,k,z){var K=Nd(e,k,z,S);K.mount(),m.push(K),m.sort(function(le,Y){return le.index-Y.index})}function $(S){return S?j(function(k){return!k.isClone}):m}function R(S){var k=t.Controller,z=k.toIndex(S),K=k.hasFocus()?1:n.perPage;return j(function(le){return Uo(le.index,z,z+K-1)})}function P(S){return j(S)[0]}function C(S,k){vn(S,function(z){if(Gn(z)&&(z=fs(z)),ms(z)){var K=c[k];K?wa(z,K):bo(u,z),Tn(z,n.classes.slide),w(z,Ot(l,Ei))}}),l(Zt)}function U(S){ui(j(S).map(function(k){return k.slide})),l(Zt)}function E(S,k){$(k).forEach(S)}function j(S){return m.filter(ps(S)?S:function(k){return Gn(S)?ro(k.slide,S):ba(xo(S),k.index)})}function I(S,k,z){E(function(K){K.style(S,k,z)})}function w(S,k){var z=Sa(S,"img"),K=z.length;K?z.forEach(function(le){s(le,"load error",function(){--K||k()})}):k()}function W(S){return S?c.length:m.length}function h(){return m.length>n.perPage}return{mount:x,destroy:T,update:f,register:L,get:$,getIn:R,getAt:P,add:C,remove:U,forEach:E,filter:j,style:I,getLength:W,isEnough:h}}function jd(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,m=u.root,x=u.track,b=u.list,T=d.getAt,f=d.style,L,$,R;function P(){C(),l(window,"resize load",bd(Ot(s,Ei))),o([an,Zt],C),o(Ei,U)}function C(){L=n.direction===fr,xn(m,"maxWidth",ti(n.width)),xn(x,c("paddingLeft"),E(!1)),xn(x,c("paddingRight"),E(!0)),U(!0)}function U(N){var F=gn(m);(N||$.width!==F.width||$.height!==F.height)&&(xn(x,"height",j()),f(c("marginRight"),ti(n.gap)),f("width",w()),f("height",W(),!0),$=F,s(dr),R!==(R=D())&&(kn(m,Gs,R),s(vd,R)))}function E(N){var F=n.padding,A=c(N?"right":"left");return F&&ti(F[A]||(oo(F)?0:F))||"0px"}function j(){var N="";return L&&(N=I(),Qi(N,"height or heightRatio is missing."),N="calc("+N+" - "+E(!1)+" - "+E(!0)+")"),N}function I(){return ti(n.height||gn(b).width*n.heightRatio)}function w(){return n.autoWidth?null:ti(n.fixedWidth)||(L?"":h())}function W(){return ti(n.fixedHeight)||(L?n.autoHeight?null:h():I())}function h(){var N=ti(n.gap);return"calc((100%"+(N&&" + "+N)+")/"+(n.perPage||1)+(N&&" - "+N)+")"}function S(){return gn(b)[c("width")]}function k(N,F){var A=T(N||0);return A?gn(A.slide)[c("width")]+(F?0:le()):0}function z(N,F){var A=T(N);if(A){var q=gn(A.slide)[c("right")],G=gn(b)[c("left")];return sn(q-G)+(F?0:le())}return 0}function K(N){return z(e.length-1)-z(0)+k(0,N)}function le(){var N=T(0);return N&&parseFloat(xn(N.slide,c("marginRight")))||0}function Y(N){return parseFloat(xn(x,c("padding"+(N?"Right":"Left"))))||0}function D(){return e.is(Co)||K(!0)>S()}return{mount:P,resize:U,listSize:S,slideSize:k,sliderSize:K,totalSize:z,getPadding:Y,isOverflow:D}}var Od=2;function zd(e,t,n){var i=qt(e),o=i.on,l=t.Elements,s=t.Slides,d=t.Direction.resolve,c=[],u;function m(){o(Zt,x),o([an,Ei],T),(u=$())&&(f(u),t.Layout.resize(!0))}function x(){b(),m()}function b(){ui(c),Wn(c),i.destroy()}function T(){var R=$();u!==R&&(u<R||!R)&&i.emit(Zt)}function f(R){var P=s.get().slice(),C=P.length;if(C){for(;P.length<R;)Ko(P,P);Ko(P.slice(-R),P.slice(0,R)).forEach(function(U,E){var j=E<R,I=L(U.slide,E);j?wa(I,P[0].slide):bo(l.list,I),Ko(c,I),s.register(I,E-R+(j?0:C),U.index)})}}function L(R,P){var C=R.cloneNode(!0);return Tn(C,n.classes.clone),C.id=e.root.id+"-clone"+Ca(P+1),C}function $(){var R=n.clones;if(!e.is(Di))R=0;else if(vo(R)){var P=n[d("fixedWidth")]&&t.Layout.slideSize(0),C=P&&co(gn(l.track)[d("width")]/P);R=C||n[d("autoWidth")]&&e.length||n.perPage*Od}return R}return{mount:m,destroy:b}}function Bd(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,m=d.totalSize,x=d.listSize,b=d.sliderSize,T=t.Direction,f=T.resolve,L=T.orient,$=t.Elements,R=$.list,P=$.track,C;function U(){C=t.Transition,o([Yn,dr,an,Zt],E)}function E(){t.Controller.isBusy()||(t.Scroll.cancel(),I(e.index),t.Slides.update())}function j(A,q,G,Z){A!==q&&N(A>G)&&(S(),w(h(K(),A>G),!0)),s(zi),l(_n,q,G,A),C.start(q,function(){s(Ri),l(Bi,q,G,A),Z&&Z()})}function I(A){w(z(A,!0))}function w(A,q){if(!e.is(Co)){var G=q?A:W(A);xn(R,"transform","translate"+f("X")+"("+G+"px)"),A!==G&&l(As)}}function W(A){if(e.is(Di)){var q=k(A),G=q>t.Controller.getEnd(),Z=q<0;(Z||G)&&(A=h(A,G))}return A}function h(A,q){var G=A-D(q),Z=b();return A-=L(Z*(co(sn(G)/Z)||1))*(q?1:-1),A}function S(){w(K(),!0),C.cancel()}function k(A){for(var q=t.Slides.get(),G=0,Z=1/0,_=0;_<q.length;_++){var me=q[_].index,v=sn(z(me,!0)-A);if(v<=Z)Z=v,G=me;else break}return G}function z(A,q){var G=L(m(A-1)-Y(A));return q?le(G):G}function K(){var A=f("left");return gn(R)[A]-gn(P)[A]+L(u(!1))}function le(A){return n.trimSpace&&e.is(ki)&&(A=wi(A,0,L(b(!0)-x()))),A}function Y(A){var q=n.focus;return q==="center"?(x()-c(A,!0))/2:+q*c(A)||0}function D(A){return z(A?t.Controller.getEnd():0,!!n.trimSpace)}function N(A){var q=L(h(K(),A));return A?q>=0:q<=R[f("scrollWidth")]-gn(P)[f("width")]}function F(A,q){q=vo(q)?K():q;var G=A!==!0&&L(q)<L(D(!1)),Z=A!==!1&&L(q)>L(D(!0));return G||Z}return{mount:U,move:j,jump:I,translate:w,shift:h,cancel:S,toIndex:k,toPosition:z,getPosition:K,getLimit:D,exceededLimit:F,reposition:E}}function Dd(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=t.Move,d=s.getPosition,c=s.getLimit,u=s.toPosition,m=t.Slides,x=m.isEnough,b=m.getLength,T=n.omitEnd,f=e.is(Di),L=e.is(ki),$=Ot(K,!1),R=Ot(K,!0),P=n.start||0,C,U=P,E,j,I;function w(){W(),o([an,Zt,nr],W),o(dr,h)}function W(){E=b(!0),j=n.perMove,I=n.perPage,C=N();var v=wi(P,0,T?C:E-1);v!==P&&(P=v,s.reposition())}function h(){C!==N()&&l(nr)}function S(v,fe,J){if(!me()){var de=z(v),$e=D(de);$e>-1&&(fe||$e!==P)&&(G($e),s.move(de,$e,U,J))}}function k(v,fe,J,de){t.Scroll.scroll(v,fe,J,function(){var $e=D(s.toIndex(d()));G(T?qn($e,C):$e),de&&de()})}function z(v){var fe=P;if(Gn(v)){var J=v.match(/([+\-<>])(\d+)?/)||[],de=J[1],$e=J[2];de==="+"||de==="-"?fe=le(P+ +(""+de+(+$e||1)),P):de===">"?fe=$e?F(+$e):$(!0):de==="<"&&(fe=R(!0))}else fe=f?v:wi(v,0,C);return fe}function K(v,fe){var J=j||(_()?1:I),de=le(P+J*(v?-1:1),P,!(j||_()));return de===-1&&L&&!vs(d(),c(!v),1)?v?0:C:fe?de:D(de)}function le(v,fe,J){if(x()||_()){var de=Y(v);de!==v&&(fe=v,v=de,J=!1),v<0||v>C?!j&&(Uo(0,v,fe,!0)||Uo(C,fe,v,!0))?v=F(A(v)):f?v=J?v<0?-(E%I||I):E:v:n.rewind?v=v<0?C:0:v=-1:J&&v!==fe&&(v=F(A(fe)+(v<fe?-1:1)))}else v=-1;return v}function Y(v){if(L&&n.trimSpace==="move"&&v!==P)for(var fe=d();fe===u(v,!0)&&Uo(v,0,e.length-1,!n.rewind);)v<P?--v:++v;return v}function D(v){return f?(v+E)%E||0:v}function N(){for(var v=E-(_()||f&&j?1:I);T&&v-- >0;)if(u(E-1,!0)!==u(v,!0)){v++;break}return wi(v,0,E-1)}function F(v){return wi(_()?v:I*v,0,C)}function A(v){return _()?qn(v,C):tr((v>=C?E-1:v)/I)}function q(v){var fe=s.toIndex(v);return L?wi(fe,0,C):fe}function G(v){v!==P&&(U=P,P=v)}function Z(v){return v?U:P}function _(){return!vo(n.focus)||n.isNavigation}function me(){return e.state.is([zi,yo])&&!!n.waitForTransition}return{mount:w,go:S,scroll:k,getNext:$,getPrev:R,getAdjacent:K,getEnd:N,setIndex:G,getIndex:Z,toIndex:F,toPage:A,toDest:q,hasFocus:_,isBusy:me}}var Vd="http://www.w3.org/2000/svg",Gd="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",ko=40;function qd(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.emit,d=n.classes,c=n.i18n,u=t.Elements,m=t.Controller,x=u.arrows,b=u.track,T=x,f=u.prev,L=u.next,$,R,P={};function C(){E(),o(an,U)}function U(){j(),C()}function E(){var k=n.arrows;k&&!(f&&L)&&W(),f&&L&&(lo(P,{prev:f,next:L}),so(T,k?"":"none"),Tn(T,R=Fa+"--"+n.direction),k&&(I(),S(),ct([f,L],$o,b.id),s(Is,f,L)))}function j(){i.destroy(),Mn(T,R),$?(ui(x?[f,L]:T),f=L=null):Ln([f,L],Aa)}function I(){o([Yn,Bi,Zt,hi,nr],S),l(L,"click",Ot(w,">")),l(f,"click",Ot(w,"<"))}function w(k){m.go(k,!0)}function W(){T=x||Ti("div",d.arrows),f=h(!0),L=h(!1),$=!0,bo(T,[f,L]),!x&&wa(T,b)}function h(k){var z='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+Vd+'" viewBox="0 0 '+ko+" "+ko+'" width="'+ko+'" height="'+ko+'" focusable="false"><path d="'+(n.arrowPath||Gd)+'" />';return fs(z)}function S(){if(f&&L){var k=e.index,z=m.getPrev(),K=m.getNext(),le=z>-1&&k<z?c.last:c.prev,Y=K>-1&&k>K?c.first:c.next;f.disabled=z<0,L.disabled=K<0,ct(f,fn,le),ct(L,fn,Y),s(Rs,f,L,z,K)}}return{arrows:P,mount:C,destroy:j,update:S}}var Kd=$a+"-interval";function Ud(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.emit,d=pr(n.interval,e.go.bind(e,">"),I),c=d.isPaused,u=t.Elements,m=t.Elements,x=m.root,b=m.toggle,T=n.autoplay,f,L,$=T==="pause";function R(){T&&(P(),b&&ct(b,$o,u.track.id),$||C(),j())}function P(){n.pauseOnHover&&l(x,"mouseenter mouseleave",function(W){f=W.type==="mouseenter",E()}),n.pauseOnFocus&&l(x,"focusin focusout",function(W){L=W.type==="focusin",E()}),b&&l(b,"click",function(){$?C():U(!0)}),o([_n,ur,Zt],d.rewind),o(_n,w)}function C(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),L=f=$=!1,j(),s(Ra))}function U(W){W===void 0&&(W=!0),$=!!W,j(),c()||(d.pause(),s(Ea))}function E(){$||(f||L?U(!1):C())}function j(){b&&(kn(b,pi,!$),ct(b,fn,n.i18n[$?"play":"pause"]))}function I(W){var h=u.bar;h&&xn(h,"width",W*100+"%"),s(Ms,W)}function w(W){var h=t.Slides.getAt(W);d.set(h&&+bn(h.slide,Kd)||n.interval)}return{mount:R,destroy:d.cancel,play:C,pause:U,isPaused:c}}function Xd(e,t,n){var i=qt(e),o=i.on;function l(){n.cover&&(o(ka,Ot(d,!0)),o([Yn,an,Zt],Ot(s,!0)))}function s(c){t.Slides.forEach(function(u){var m=wo(u.container||u.slide,"img");m&&m.src&&d(c,m,u)})}function d(c,u,m){m.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),so(u,c?"none":"")}return{mount:l,destroy:Ot(s,!1)}}var Yd=10,Zd=600,Jd=.6,Qd=1.5,eu=800;function tu(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,m=d.exceededLimit,x=d.translate,b=e.is(ki),T,f,L=1;function $(){o(_n,U),o([an,Zt],E)}function R(I,w,W,h,S){var k=c();if(U(),W&&(!b||!m())){var z=t.Layout.sliderSize(),K=aa(I)*z*tr(sn(I)/z)||0;I=d.toPosition(t.Controller.toDest(I%z))+K}var le=vs(k,I,1);L=1,w=le?0:w||er(sn(I-k)/Qd,eu),f=h,T=pr(w,P,Ot(C,k,I,S),1),s(yo),l(ur),T.start()}function P(){s(Ri),f&&f(),l(hi)}function C(I,w,W,h){var S=c(),k=I+(w-I)*j(h),z=(k-S)*L;x(S+z),b&&!W&&m()&&(L*=Jd,sn(z)<Yd&&R(u(m(!0)),Zd,!1,f,!0))}function U(){T&&T.cancel()}function E(){T&&!T.isPaused()&&(U(),P())}function j(I){var w=n.easingFunc;return w?w(I):1-Math.pow(1-I,4)}return{mount:$,destroy:U,scroll:R,cancel:E}}var Si={passive:!1,capture:!0};function nu(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=i.bind,d=i.unbind,c=e.state,u=t.Move,m=t.Scroll,x=t.Controller,b=t.Elements.track,T=t.Media.reduce,f=t.Direction,L=f.resolve,$=f.orient,R=u.getPosition,P=u.exceededLimit,C,U,E,j,I,w=!1,W,h,S;function k(){s(b,Fr,oa,Si),s(b,Wr,oa,Si),s(b,qs,K,Si),s(b,"click",D,{capture:!0}),s(b,"dragstart",En),o([Yn,an],z)}function z(){var Q=n.drag;xe(!Q),j=Q==="free"}function K(Q){if(W=!1,!h){var ye=$e(Q);de(Q.target)&&(ye||!Q.button)&&(x.isBusy()?En(Q,!0):(S=ye?b:window,I=c.is([zi,yo]),E=null,s(S,Fr,le,Si),s(S,Wr,Y,Si),u.cancel(),m.cancel(),N(Q)))}}function le(Q){if(c.is(qo)||(c.set(qo),l(Cs)),Q.cancelable)if(I){u.translate(C+J(_(Q)));var ye=me(Q)>ll,ve=w!==(w=P());(ye||ve)&&N(Q),W=!0,l(Ts),En(Q)}else q(Q)&&(I=A(Q),En(Q))}function Y(Q){c.is(qo)&&(c.set(Ri),l(Ls)),I&&(F(Q),En(Q)),d(S,Fr,le),d(S,Wr,Y),I=!1}function D(Q){!h&&W&&En(Q,!0)}function N(Q){E=U,U=Q,C=R()}function F(Q){var ye=G(Q),ve=Z(ye),ke=n.rewind&&n.rewindByDrag;T(!1),j?x.scroll(ve,0,n.snap):e.is(Co)?x.go($(aa(ye))<0?ke?"<":"-":ke?">":"+"):e.is(ki)&&w&&ke?x.go(P(!0)?">":"<"):x.go(x.toDest(ve),!0),T(!0)}function A(Q){var ye=n.dragMinThreshold,ve=oo(ye),ke=ve&&ye.mouse||0,we=(ve?ye.touch:+ye)||10;return sn(_(Q))>($e(Q)?we:ke)}function q(Q){return sn(_(Q))>sn(_(Q,!0))}function G(Q){if(e.is(Di)||!w){var ye=me(Q);if(ye&&ye<ll)return _(Q)/ye}return 0}function Z(Q){return R()+aa(Q)*qn(sn(Q)*(n.flickPower||600),j?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function _(Q,ye){return fe(Q,ye)-fe(v(Q),ye)}function me(Q){return ra(Q)-ra(v(Q))}function v(Q){return U===Q&&E||U}function fe(Q,ye){return($e(Q)?Q.changedTouches[0]:Q)["page"+L(ye?"Y":"X")]}function J(Q){return Q/(w&&e.is(ki)?Wd:1)}function de(Q){var ye=n.noDrag;return!ro(Q,"."+zs+", ."+vr)&&(!ye||!ro(Q,ye))}function $e(Q){return typeof TouchEvent<"u"&&Q instanceof TouchEvent}function oe(){return I}function xe(Q){h=Q}return{mount:k,disable:xe,isDragging:oe}}var iu={Spacebar:" ",Right:hr,Left:gr,Up:Fs,Down:Ws};function Wa(e){return e=Gn(e)?e:e.key,iu[e]||e}var sl="keydown";function ou(e,t,n){var i=qt(e),o=i.on,l=i.bind,s=i.unbind,d=e.root,c=t.Direction.resolve,u,m;function x(){b(),o(an,T),o(an,b),o(_n,L)}function b(){var R=n.keyboard;R&&(u=R==="global"?window:d,l(u,sl,$))}function T(){s(u,sl)}function f(R){m=R}function L(){var R=m;m=!0,us(function(){m=R})}function $(R){if(!m){var P=Wa(R);P===c(gr)?e.go("<"):P===c(hr)&&e.go(">")}}return{mount:x,destroy:T,disable:f}}var eo=$a+"-lazy",Xo=eo+"-srcset",ru="["+eo+"], ["+Xo+"]";function au(e,t,n){var i=qt(e),o=i.on,l=i.off,s=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Bi,hi],m=[];function x(){n.lazyLoad&&(b(),o(Zt,b))}function b(){Wn(m),T(),c?R():(l(u),o(u,f),f())}function T(){t.Slides.forEach(function(P){Sa(P.slide,ru).forEach(function(C){var U=bn(C,eo),E=bn(C,Xo);if(U!==C.src||E!==C.srcset){var j=n.classes.spinner,I=C.parentElement,w=wo(I,"."+j)||Ti("span",j,I);m.push([C,P,w]),C.src||so(C,"none")}})})}function f(){m=m.filter(function(P){var C=n.perPage*((n.preloadPages||1)+1)-1;return P[1].isWithin(e.index,C)?L(P):!0}),m.length||l(u)}function L(P){var C=P[0];Tn(P[1].slide,da),s(C,"load error",Ot($,P)),ct(C,"src",bn(C,eo)),ct(C,"srcset",bn(C,Xo)),Ln(C,eo),Ln(C,Xo)}function $(P,C){var U=P[0],E=P[1];Mn(E.slide,da),C.type!=="error"&&(ui(P[2]),so(U,""),d(ka,U,E),d(Ei)),c&&R()}function R(){m.length&&L(m.shift())}return{mount:x,destroy:Ot(Wn,m),check:f}}function lu(e,t,n){var i=qt(e),o=i.on,l=i.emit,s=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,m=u.hasFocus,x=u.getIndex,b=u.go,T=t.Direction.resolve,f=c.pagination,L=[],$,R;function P(){C(),o([an,Zt,nr],P);var h=n.pagination;f&&so(f,h?"":"none"),h&&(o([_n,ur,hi],W),U(),W(),l(Es,{list:$,items:L},w(e.index)))}function C(){$&&(ui(f?Xn($.children):$),Mn($,R),Wn(L),$=null),i.destroy()}function U(){var h=e.length,S=n.classes,k=n.i18n,z=n.perPage,K=m()?u.getEnd()+1:co(h/z);$=f||Ti("ul",S.pagination,c.track.parentElement),Tn($,R=xr+"--"+I()),ct($,Pn,"tablist"),ct($,fn,k.select),ct($,Pa,I()===fr?"vertical":"");for(var le=0;le<K;le++){var Y=Ti("li",null,$),D=Ti("button",{class:S.page,type:"button"},Y),N=d.getIn(le).map(function(A){return A.slide.id}),F=!m()&&z>1?k.pageX:k.slideX;s(D,"click",Ot(E,le)),n.paginationKeyboard&&s(D,"keydown",Ot(j,le)),ct(Y,Pn,"presentation"),ct(D,Pn,"tab"),ct(D,$o,N.join(" ")),ct(D,fn,la(F,le+1)),ct(D,Li,-1),L.push({li:Y,button:D,page:le})}}function E(h){b(">"+h,!0)}function j(h,S){var k=L.length,z=Wa(S),K=I(),le=-1;z===T(hr,!1,K)?le=++h%k:z===T(gr,!1,K)?le=(--h+k)%k:z==="Home"?le=0:z==="End"&&(le=k-1);var Y=L[le];Y&&(hs(Y.button),b(">"+le),En(S,!0))}function I(){return n.paginationDirection||n.direction}function w(h){return L[u.toPage(h)]}function W(){var h=w(x(!0)),S=w(x());if(h){var k=h.button;Mn(k,pi),Ln(k,nl),ct(k,Li,-1)}if(S){var z=S.button;Tn(z,pi),ct(z,nl,!0),ct(z,Li,"")}l(ks,{list:$,items:L},h,S)}return{items:L,mount:P,destroy:C,getAt:w,update:W}}var su=[" ","Enter"];function cu(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(f){f.isParent||(u(e,f.splide),u(f.splide,e))}),i&&m()}function d(){l.forEach(function(f){f.destroy()}),Wn(l)}function c(){d(),s()}function u(f,L){var $=qt(f);$.on(_n,function(R,P,C){L.go(L.is(Di)?C:R)}),l.push($)}function m(){var f=qt(e),L=f.on;L(Ta,b),L(Ps,T),L([Yn,an],x),l.push(f),f.emit(Ia,e.splides)}function x(){ct(t.Elements.list,Pa,n.direction===fr?"vertical":"")}function b(f){e.go(f.index)}function T(f,L){ba(su,Wa(L))&&(b(f),En(L))}return{setup:Ot(t.Media.set,{slideFocus:vo(o)?i:o},!0),mount:s,destroy:d,remount:c}}function du(e,t,n){var i=qt(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,Si)}function d(u){if(u.cancelable){var m=u.deltaY,x=m<0,b=ra(u),T=n.wheelMinThreshold||0,f=n.wheelSleep||0;sn(m)>T&&b-l>f&&(e.go(x?"<":">"),l=b),c(x)&&En(u)}}function c(u){return!n.releaseWheel||e.state.is(zi)||t.Controller.getAdjacent(u)!==-1}return{mount:s}}var uu=90;function pu(e,t,n){var i=qt(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,d=Ti("span",kd),c=pr(uu,Ot(m,!1));function u(){s&&(b(!t.Autoplay.isPaused()),ct(l,rl,!0),d.textContent="…",o(Ra,Ot(b,!0)),o(Ea,Ot(b,!1)),o([Bi,hi],Ot(m,!0)))}function m(T){ct(l,ol,T),T?(bo(l,d),c.start()):(ui(d),c.cancel())}function x(){Ln(l,[il,rl,ol]),ui(d)}function b(T){s&&ct(l,il,T?"off":"polite")}return{mount:u,disable:b,destroy:x}}var mu=Object.freeze({__proto__:null,Media:wd,Direction:Sd,Elements:_d,Slides:Hd,Layout:jd,Clones:zd,Move:Bd,Controller:Dd,Arrows:qd,Autoplay:Ud,Cover:Xd,Scroll:tu,Drag:nu,Keyboard:ou,LazyLoad:au,Pagination:lu,Sync:cu,Wheel:du,Live:pu}),gu={prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},hu={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:Ad,i18n:gu,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function fu(e,t,n){var i=t.Slides;function o(){qt(e).on([Yn,Zt],l)}function l(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function s(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),us(c)}return{mount:o,start:s,cancel:oa}}function yu(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,d=Ot(xn,s,"transition"),c;function u(){qt(e).bind(s,"transitionend",function(T){T.target===s&&c&&(x(),c())})}function m(T,f){var L=i.toPosition(T,!0),$=i.getPosition(),R=b(T);sn(L-$)>=1&&R>=1?n.useScroll?l.scroll(L,R,!1,f):(d("transform "+R+"ms "+n.easing),i.translate(L,!0),c=f):(i.jump(T),f())}function x(){d(""),l.cancel()}function b(T){var f=n.rewindSpeed;if(e.is(ki)&&f){var L=o.getIndex(!0),$=o.getEnd();if(L===0&&T>=$||L>=$&&T===0)return f}return n.speed}return{mount:u,start:m,cancel:x}}var vu=(function(){function e(n,i){this.event=qt(),this.Components={},this.state=xd(Ci),this.splides=[],this._o={},this._E={};var o=Gn(n)?ys(document,n):n;Qi(o,o+" is invalid."),this.root=o,i=zn({label:bn(o,fn)||"",labelledby:bn(o,Ma)||""},hu,e.defaults,i||{});try{zn(i,JSON.parse(bn(o,$a)))}catch{Qi(!1,"Invalid JSON")}this._o=Object.create(zn({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,d=this.Components;Qi(s.is([Ci,Qo]),"Already mounted!"),s.set(Ci),this._C=d,this._T=o||this._T||(this.is(Co)?fu:yu),this._E=i||this._E;var c=lo({},mu,this._E,{Transition:this._T});return di(c,function(u,m){var x=u(l,d,l._o);d[m]=x,x.setup&&x.setup()}),di(d,function(u){u.mount&&u.mount()}),this.emit(Yn),Tn(this.root,Md),s.set(Ri),this.emit(sa),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Ri)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(Xn(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(Zt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(Ci)?qt(this).on(sa,this.destroy.bind(this,i)):(di(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(La),o.destroy(),i&&Wn(this.splides),l.set(Qo)),this},gd(e,[{key:"options",get:function(){return this._o},set:function(i){this._C.Media.set(i,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),_a=vu;_a.defaults={};_a.STATES=fd;var cl=[[Yn,"onMounted"],[sa,"onReady"],[_n,"onMove"],[Bi,"onMoved"],[Ta,"onClick"],[bs,"onActive"],[ws,"onInactive"],[Ss,"onVisible"],[$s,"onHidden"],[Zt,"onRefresh"],[an,"onUpdated"],[Ei,"onResize"],[dr,"onResized"],[Cs,"onDrag"],[Ts,"onDragging"],[Ls,"onDragged"],[ur,"onScroll"],[hi,"onScrolled"],[La,"onDestroy"],[Is,"onArrowsMounted"],[Rs,"onArrowsUpdated"],[Es,"onPaginationMounted"],[ks,"onPaginationUpdated"],[Ia,"onNavigationMounted"],[Ra,"onAutoplayPlay"],[Ms,"onAutoplayPlaying"],[Ea,"onAutoplayPause"],[ka,"onLazyLoadLoaded"]];function Na(...e){return e.filter(Boolean).join(" ")}function ir(e){return e!==null&&typeof e=="object"}function ua(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!ua(n,t[i]));if(ir(e)&&ir(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!ua(e[o],t[o]))}return e===t}function xu(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function bu(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function pa(e,t){const n=e;return bu(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():ir(i)?n[o]=pa(ir(n[o])?n[o]:{},i):n[o]=i}),n}var wu=({children:e,className:t,...n})=>a.createElement("div",{className:Na("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),br=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new _a(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=pa({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!ua(this.options,e)&&(this.splide.options=e,this.options=pa({},e));const t=this.getSlides();xu(this.slides,t)||(this.splide.refresh(),this.slides=t)}sync(e){var t;(t=this.splide)==null||t.sync(e)}go(e){var t;(t=this.splide)==null||t.go(e)}getSlides(){var e;if(this.splide){const t=(e=this.splide.Components.Elements)==null?void 0:e.list.children;return t&&Array.prototype.slice.call(t)||[]}return[]}bind(e){cl.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return a.createElement(t,{className:Na("splide",e),ref:this.splideRef,...this.omit(o,["options",...cl.map(l=>l[1])])},n?a.createElement(wu,null,i):i)}},wr=({children:e,className:t,...n})=>a.createElement("li",{className:Na("splide__slide",t),...n},e);/*!
2
2
  * Splide.js
3
3
  * Version : 4.1.3
4
4
  * License : MIT
5
5
  * Copyright: 2022 Naotoshi Fujita
6
- */const Su="RichTextRenderer-module__link___BWeZ2",$u={link:Su},Cu=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(i=>/^\d/.test(i))},Sr=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Cu(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function dn(e){const{color:t,...n}=e;return n}function Xt(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Sr(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:y.scalingValue(e.letterSpacing,t),wordSpacing:y.scalingValue(e.wordSpacing,t),fontSize:y.scalingValue(n,t),lineHeight:i!==void 0?y.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(l=e.textAppearance)==null?void 0:l.textDecoration,fontVariant:(s=e.textAppearance)==null?void 0:s.fontVariant,textAlign:e.textAlign,color:e.color}}const mi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:$u.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Tu(i),children:i.text},o));return r.jsx(r.Fragment,{children:e.map((n,i)=>{const o=n.children;return r.jsx("div",{children:t(o)},i)})})};function Tu(e){return{...e.fontFamily&&{fontFamily:Sr(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}const Lu="SvgImage-module__svg___q3xE-",Iu="SvgImage-module__img___VsTm-",dl={svg:Lu,img:Iu},Ru=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Eu=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,rn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[l,s]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');s(d)}},[]),!Ru(e)||!l?r.jsx("img",{src:e,alt:"",className:nt(dl.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:nt(dl.svg,i),style:{"--svg":Eu(e),"--fill":t,"--hover-fill":n,...o??{}}})},ku={"top-left":Xe.topLeftAlignment,"top-center":Xe.topCenterAlignment,"top-right":Xe.topRightAlignment,"middle-left":Xe.middleLeftAlignment,"middle-center":Xe.middleCenterAlignment,"middle-right":Xe.middleRightAlignment,"bottom-left":Xe.bottomLeftAlignment,"bottom-center":Xe.bottomCenterAlignment,"bottom-right":Xe.bottomRightAlignment};function Mu({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=a.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:m,fontSizeLineHeight:x,textAppearance:b,color:T}=n.imageCaption??{},[f,L]=a.useState(void 0),[$,R]=a.useState(null),[E,C]=a.useState(0),[U,k]=a.useState(0),{direction:j,transition:I,controls:w,pagination:W,imageCaption:h,triggers:S}=e,M=a.useRef(I.type),{x:z,y:K}=e.controls.offset,le=Y=>{o&&o.go(Y)};return a.useEffect(()=>{if(!$)return;const Y=new ResizeObserver(D=>{if(!o)return;const[N]=D;L({width:Math.round(N.contentRect.width),height:Math.round(N.contentRect.height)})});return Y.observe($),()=>Y.unobserve($)},[$]),a.useEffect(()=>{!o||M.current===I.type||(k(Y=>Y+1),M.current=I.type)},[I.type]),r.jsx("div",{className:nt(Xe.wrapper,{[Xe.editor]:i}),ref:R,children:r.jsxs("div",{className:Xe.sliderInner,style:{width:f?f.width:"100%",height:f?f.height:"100%",backgroundColor:I.backgroundColor&&I.type==="fade in"?I.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:nt(Xe.captionBlock),children:r.jsx("div",{className:Xe.captionTextWrapper,children:t.map((Y,D)=>r.jsx("div",{className:nt(Xe.captionText,ku[h.alignment],{[Xe.withPointerEvents]:D===E&&i,[Xe.active]:D===E}),style:{fontFamily:Sr(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":y.scalingValue(s.width,i),letterSpacing:y.scalingValue(c,i),wordSpacing:y.scalingValue(m,i),textAlign:u,fontSize:y.scalingValue(x.fontSize,i),lineHeight:y.scalingValue(x.lineHeight,i),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:T,transitionDuration:I.duration?`${Math.round(parseInt(I.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:Xe.captionTextInner,style:{"--link-hover-color":h.linkHoverColor,"--link-color":h.linkColor,position:"relative",top:y.scalingValue(h.offset.y,i),left:y.scalingValue(h.offset.x,i)},children:r.jsx(mi,{content:Y.imageCaption})})},D))})}),r.jsx(br,{onMove:Y=>{C(Y.index)},ref:l,options:{arrows:!1,speed:I.duration?parseInt(I.duration):500,autoplay:S.autoPlay!==null,...S.autoPlay!==null&&{interval:parseInt(S.autoPlay)*1e3},direction:j==="horiz"||I.type==="fade in"?"ltr":"ttb",pagination:!1,drag:S.triggersList.drag,perPage:1,width:f?f.width:"100%",height:f?f.height:"100%",type:I.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((Y,D)=>r.jsx(wr,{children:r.jsx("div",{className:Xe.sliderItem,children:r.jsx("div",{className:Xe.imgWrapper,children:r.jsx("img",{className:nt(Xe.sliderImage,{[Xe.contain]:Y.image.objectFit==="contain",[Xe.cover]:Y.image.objectFit==="cover"}),src:Y.image.url,alt:Y.image.name??""})})})},D))},U),w.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:nt(Xe.arrow,{[Xe.arrowVertical]:j==="vert",[Xe.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:r.jsxs("button",{onClick:()=>{le("-1")},className:Xe.arrowInner,style:{transform:`translate(${y.scalingValue(z,i)}, ${y.scalingValue(K*(j==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&r.jsx(rn,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:nt(Xe.arrowImg,Xe.mirror)}),!w.arrowsImgUrl&&r.jsx(ul,{color:w.color,className:nt(Xe.arrowIcon,Xe.arrowImg,Xe.mirror)})]})}),r.jsx("div",{className:nt(Xe.arrow,Xe.nextArrow,{[Xe.arrowVertical]:j==="vert",[Xe.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:r.jsxs("button",{className:Xe.arrowInner,onClick:()=>le("+1"),style:{transform:`translate(${y.scalingValue(z*(j==="horiz"?-1:1),i)}, ${y.scalingValue(K,i)}) scale(${e.controls.scale/100}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&r.jsx(rn,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:Xe.arrowImg}),!w.arrowsImgUrl&&r.jsx(ul,{color:w.color,className:nt(Xe.arrowIcon,Xe.arrowImg)})]})})]}),S.triggersList.click&&r.jsx("div",{className:Xe.clickOverlay,onClick:()=>{o&&o.go("+1")}}),W.isActive&&r.jsx("div",{className:nt(Xe.pagination,{[Xe.paginationInsideBottom]:W.position==="inside-1"&&j==="horiz",[Xe.paginationInsideTop]:W.position==="inside-2"&&j==="horiz",[Xe.paginationOutsideBottom]:W.position==="outside-1"&&j==="horiz",[Xe.paginationOutsideTop]:W.position==="outside-2"&&j==="horiz",[Xe.paginationInsideLeft]:W.position==="inside-1"&&j==="vert",[Xe.paginationInsideRight]:W.position==="inside-2"&&j==="vert",[Xe.paginationOutsideLeft]:W.position==="outside-1"&&j==="vert",[Xe.paginationOutsideRight]:W.position==="outside-2"&&j==="vert",[Xe.paginationVertical]:j==="vert"}),children:r.jsx("div",{className:Xe.paginationInner,style:{backgroundColor:W.colors[2],transform:`scale(${W.scale/100}) translate(${y.scalingValue(W.offset.x,i)}, ${y.scalingValue(W.offset.y,i)}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:t.map((Y,D)=>r.jsx("button",{onClick:()=>{o&&o.go(D)},className:nt(Xe.paginationItem),children:r.jsx("div",{className:nt(Xe.dot,{[Xe.activeDot]:D===E}),style:{backgroundColor:D===E?W.colors[0]:W.colors[1],"--pagination-hover-color":W.hover}})},D))})})]})})}function ul({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Pu={element:Mu,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},Au="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Fu="ImageRevealSlider-module__image___Qjt-e",Wu="ImageRevealSlider-module__link___N-iLG",_u="ImageRevealSlider-module__cursor___2U03d",vi={imageRevealSlider:Au,image:Fu,link:Wu,cursor:_u};function pl(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const l=i.width?Number.parseFloat(i.width):o.naturalWidth,s=o.naturalHeight/o.naturalWidth*l,d=l/2,c=s/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function _r(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Nu(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await _r(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await _r(e);l=s.height/s.width*o}else{const s=await _r(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function Hu({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[l,s]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[m,x]=a.useState({x:0,y:0}),[b,T]=a.useState(1),[f,L]=a.useState("none"),$=a.useRef({x:0,y:0}),[R,E]=a.useState(!1),{sizeType:C,imageWidth:U,randomRangeImageWidth:k}=e.imageSize,{revealPosition:j,visible:I}=e.position,{cursorType:w,target:W,defaultCursorScale:h,defaultCursor:S,hoverCursorScale:M,hoverCursor:z}=e.cursor;a.useEffect(()=>{if(!i)return;const Y=(F,A)=>{const q=i.getBoundingClientRect(),G=F-q.left,Z=A-q.top;if(x({x:G,y:Z}),w==="system"){L("none"),T(1);return}const _=G,me=Z,v=document.elementFromPoint(q.left+_,q.top+me);if(v&&v.closest("a")){L("none"),T(1);return}const fe=pl(_,me,l)||W==="area"?{img:z??"none",scale:M}:{img:S??"none",scale:h};L(fe.img),T(fe.scale)},D=F=>{F.stopPropagation(),$.current={x:F.clientX,y:F.clientY},Y(F.clientX,F.clientY)},N=()=>{R&&Y($.current.x,$.current.y)};return i.addEventListener("mousemove",D),window.addEventListener("scroll",N,!0),()=>{i.removeEventListener("mousemove",D),window.removeEventListener("scroll",N,!0)}},[i,R,m,w,W,z,S,M,h,l]),a.useEffect(()=>{R||(L("none"),T(0))},[R]);const K=async(Y,D,N,F={})=>{const{width:A,height:q,finalWidth:G}=await Nu(Y.image.url,C,U,k);let Z=0,_=0;j==="same"?(Z=D/2,_=N/2):(Z=F.x??Math.random()*D,_=F.y??Math.random()*N);const me=Math.min(Math.max(Z,A/2),D-A/2),v=Math.min(Math.max(_,q/2),N-q/2);return{id:u.current++,url:Y.image.url,link:Y.link,name:Y.image.name,x:me,y:v,width:G}};a.useEffect(()=>{if(!i||t.length===0)return;const Y=i.getBoundingClientRect(),D=Y.width,N=Y.height,F=[];(async()=>{const q=t[0],G=await K(q,D,N);F.push(G),s(F),c(1)})()},[C,U,k,j,i]),a.useEffect(()=>{I==="last One"&&s(Y=>Y.length>0?[Y[Y.length-1]]:[])},[I]);const le=async Y=>{if(!i)return;const D=i.getBoundingClientRect(),N=Y.clientX-D.left,F=Y.clientY-D.top;if(W==="image"&&!pl(N,F,l))return;let A=0,q=0;j==="on Click"?(A=N,q=F):j==="same"?(A=D.width/2,q=D.height/2):(A=Math.random()*D.width,q=Math.random()*D.height);const G=t[d],Z=await K(G,D.width,D.height,{x:A,y:q});s(_=>I==="all"?[..._,Z]:[Z]),c(_=>_>=t.length-1?0:_+1)};return r.jsxs("div",{ref:o,onClick:le,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),className:vi.imageRevealSlider,style:{cursor:f==="none"?"default":"none"},children:[l.map(Y=>r.jsx("div",{className:vi.wrapper,style:{top:`${Y.y}px`,left:`${Y.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:Y.width??"auto",height:"auto",cursor:f==="none"?"default":"none"},children:W==="area"&&Y.link?r.jsx("a",{href:Y.link,target:"_blank",className:vi.link,children:r.jsx("img",{src:Y.url,alt:Y.name,className:vi.image},Y.id)}):r.jsx("img",{src:Y.url,alt:Y.name,className:vi.image},Y.id)},Y.id)),R&&r.jsx("div",{className:vi.cursor,style:{left:`${m.x}px`,top:`${m.y}px`,transform:`translate(-50%, -50%) scale(${b})`,backgroundImage:`url('${f}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const ju={element:Hu,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},Ou="LightBox-module__hidden___9s-9x",zu="LightBox-module__heroImage___sTxNF",Bu="LightBox-module__background___rm9ml",Du="LightBox-module__editor___4ACaY",Vu="LightBox-module__contentStyle___Bgnsq",Gu="LightBox-module__imageStyle___tLIlB",qu="LightBox-module__imgWrapper___LuFUp",Ku="LightBox-module__contain___8-yaS",Uu="LightBox-module__cover___hNvOG",Xu="LightBox-module__caption___b6L2I",Yu="LightBox-module__captionTextInner___rCGNH",Zu="LightBox-module__lightboxSplide___XFuWC",Ju="LightBox-module__arrow___iz38X",Qu="LightBox-module__arrowVertical___Zfz81",ep="LightBox-module__nextArrow___zkAQN",tp="LightBox-module__arrowInner___p48sW",np="LightBox-module__arrowIcon___3VaFf",ip="LightBox-module__arrowImg___pNV88",op="LightBox-module__mirror___pjeXc",rp="LightBox-module__thumbsWrapper___GB-nU",ap="LightBox-module__thumbsContainerVertical___wttk5",lp="LightBox-module__thumbsContainer___osSma",sp="LightBox-module__thumbsAlignStart___MO6tY",cp="LightBox-module__thumbsAlignCenter___Q4sUx",dp="LightBox-module__thumbsAlignEnd___p4y9R",up="LightBox-module__thumbItem___HvnF3",pp="LightBox-module__closeButton___g2khP",mp="LightBox-module__fadeIn___0m5GW",gp="LightBox-module__slideInLeft___gPYwC",hp="LightBox-module__slideInRight___S-pPp",fp="LightBox-module__slideInTop___DFdAj",yp="LightBox-module__slideInBottom___m27kZ",vp="LightBox-module__fadeOut___55qBR",xp="LightBox-module__slideOutLeft___NvU7P",bp="LightBox-module__slideOutRight___SK7eC",wp="LightBox-module__slideOutTop___Vgg0z",Sp="LightBox-module__slideOutBottom___nJ0Ef",$p="LightBox-module__scaleSlide___vZriG",Fe={hidden:Ou,heroImage:zu,background:Bu,editor:Du,contentStyle:Vu,imageStyle:Gu,imgWrapper:qu,contain:Ku,cover:Uu,caption:Xu,captionTextInner:Yu,lightboxSplide:Zu,arrow:Ju,arrowVertical:Qu,nextArrow:ep,arrowInner:tp,arrowIcon:np,arrowImg:ip,mirror:op,thumbsWrapper:rp,thumbsContainerVertical:ap,thumbsContainer:lp,thumbsAlignStart:sp,thumbsAlignCenter:cp,thumbsAlignEnd:dp,thumbItem:up,closeButton:pp,fadeIn:mp,slideInLeft:gp,slideInRight:hp,slideInTop:fp,slideInBottom:yp,fadeOut:vp,slideOutLeft:xp,slideOutRight:bp,slideOutTop:wp,slideOutBottom:Sp,scaleSlide:$p},Mo=(e,t,n)=>{const i={},[o,l]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),l==="left"?(i.left="0",i.right="auto"):l==="center"?(i.left="50%",i.right="auto"):l==="right"&&(i.left="auto",i.right="0"),o==="middle"&&l==="center"?i.transform=`translate(calc(-50% + ${y.scalingValue(t.x,n)}), calc(-50% + ${y.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${y.scalingValue(t.x,n)}, calc(-50% + ${y.scalingValue(t.y,n)}))`:l==="center"?i.transform=`translate(calc(-50% + ${y.scalingValue(t.x,n)}), ${y.scalingValue(t.y,n)})`:i.transform=`translate(${y.scalingValue(t.x,n)}, ${y.scalingValue(t.y,n)})`,i};function Ks(e){const t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function or(e){const t=e.getBoundingClientRect(),n=Ks(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,s=e.naturalHeight,d=i/o,c=l/s;let u,m;c>d?(u=i,m=i/c):(m=o,u=o*c);const x=t.left+n.left,b=t.top+n.top,T=(i-u)/2+x,f=(o-m)/2+b;return{x:T,y:f,width:u,height:m}}function ml(e){const t=e.getBoundingClientRect(),n=Ks(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function gl(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Cp(e,t){const n=(()=>{if(e==="fade in")return Fe.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Fe.slideInLeft;case"right":return Fe.slideInRight;case"top":return Fe.slideInTop;case"bottom":return Fe.slideInBottom;default:return Fe.slideInRight}return Fe.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Fe.fadeIn;if(e==="slide in")switch(t){case"left":return Fe.slideInLeft;case"right":return Fe.slideInRight;case"top":return Fe.slideInTop;case"bottom":return Fe.slideInBottom;default:return Fe.slideInRight}return Fe.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Fe.fadeOut;if(e==="slide in")switch(t){case"left":return Fe.slideOutLeft;case"right":return Fe.slideOutRight;case"top":return Fe.slideOutTop;case"bottom":return Fe.slideOutBottom;default:return Fe.slideOutRight}return Fe.fadeOut})(),l=(()=>{if(e==="fade in")return Fe.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Fe.slideOutLeft;case"right":return Fe.slideOutRight;case"top":return Fe.slideOutTop;case"bottom":return Fe.slideOutBottom;default:return Fe.slideOutRight}return Fe.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const Tp=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:l,isPreviewMode:s})=>{const[d,c]=a.useState(!1),{url:u}=e.thumbnailBlock.cover;return a.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:Fe.heroImage,onClick:()=>c(!0)}),r.jsx(Lp,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},Lp=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:d})=>{var Se;const{widthSettings:c,fontSettings:u,letterSpacing:m,textAlign:x,wordSpacing:b,fontSizeLineHeight:T,textAppearance:f,color:L}=i.imageCaption??{},[$,R]=a.useState(0),[E,C]=a.useState(0),[U,k]=a.useState(!1),[j,I]=a.useState(!1),[w,W]=a.useState({}),h=a.useRef(null),S=a.useRef(null),M=a.useRef(null),z=a.useRef(!1),K=a.useRef(null),le=a.useRef(null),Y=a.useRef(null),D=a.useRef(null),N=a.useRef(!1),F=a.useRef(null),[A,q]=a.useState(!1),{appear:G,triggers:Z,slider:_,thumbnail:me,controls:v,area:fe,caption:J,layout:de}=o.lightboxBlock,{appearClass:$e,backdropAppearClass:oe,backdropDisappearClass:xe,disappearClass:Q}=Cp(G.type,G.direction),ye=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const O=()=>{setTimeout(()=>{var H,re;(re=(H=h.current)==null?void 0:H.splide)==null||re.refresh()},16)},ce=()=>{C(H=>H+1)};return window.addEventListener("ArticleEditor.Layout:change",O),window.addEventListener("ArticleEditor.ComponentContent:change",ce),()=>{window.removeEventListener("ArticleEditor.Layout:change",O),window.removeEventListener("ArticleEditor.ComponentContent:change",ce)}},[]),a.useEffect(()=>{if(!e||!me.isActive){q(!1);return}const O=F.current;if(!O)return;const ce=()=>{_.direction==="horiz"?q(O.scrollWidth>O.clientWidth):q(O.scrollHeight>O.clientHeight)};ce();const H=new ResizeObserver(ce);return H.observe(O),()=>H.disconnect()},[e,me.isActive,n.length,w,_.direction]);const ve=a.useCallback(()=>{const O=window.matchMedia("(max-width: 768px)").matches,ce=gl(fe.color);O&&!s&&ce>.9&&(document.body.style.backgroundColor=""),k(!0),z.current=!0;const H=re=>{re.target===K.current&&re.animationName&&(K.current&&le.current&&K.current.removeEventListener("animationend",le.current),le.current=null,z.current&&(z.current=!1,t()),k(!1))};K.current&&(le.current=H,K.current.addEventListener("animationend",H))},[t,fe.color,s]),ke=(O,ce,H)=>{var re,ae;if(O){if(Z.type==="click"&&Z.switch==="image")Z.repeat==="close"&&$===n.length-1?ve():(re=h.current)==null||re.go("+1");else if(Z.type==="click"&&Z.switch==="50/50"){const ne=O.getBoundingClientRect(),ie=ce-ne.left,be=H-ne.top,Ce=ne.width,ee=ne.height;let pe;_.direction==="horiz"?pe=ie<Ce/2?"-1":"+1":pe=be<ee/2?"-1":"+1",(ae=h.current)==null||ae.go(pe)}}},we=O=>{if(N.current){N.current=!1;return}const ce=n[$],H=(ce==null?void 0:ce.image.objectFit)==="cover";let re,ae;if("changedTouches"in O&&O.changedTouches.length>0)re=O.changedTouches[0].clientX,ae=O.changedTouches[0].clientY;else if("clientX"in O)re=O.clientX,ae=O.clientY;else return;let ne;if(H&&M.current){const ie=ml(M.current);ne=re>=ie.left&&re<=ie.right&&ae>=ie.top&&ae<=ie.bottom}else{const ie=M.current?or(M.current):null;if(!ie){O.target===O.currentTarget&&ve();return}ne=re>=ie.x&&re<=ie.x+ie.width&&ae>=ie.y&&ae<=ie.y+ie.height}ne?ke(M.current,re,ae):ve()},Me=O=>{const ce=O.target;(ce.classList.contains(Fe.thumbsWrapper)||ce.classList.contains(Fe.thumbsContainer))&&we(O)};a.useEffect(()=>{if(!e)return;const O=ce=>{var H,re;if(ce.key==="Escape"){ve();return}if(ce.key==="ArrowRight"){R(ae=>(ae+1)%Math.max(n.length,1)),(H=h.current)==null||H.go("+1");return}ce.key==="ArrowLeft"&&(R(ae=>(ae-1+Math.max(n.length,1))%Math.max(n.length,1)),(re=h.current)==null||re.go("-1"))};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O)}},[e,ve,n.length]),a.useEffect(()=>{if(e){if(R(0),C(ce=>ce+1),z.current=!1,k(!1),I(!1),W({}),!ye)return;const O=new CustomEvent("page-overlay",{detail:{itemId:ye}});window.dispatchEvent(O)}return()=>{K.current&&le.current&&(K.current.removeEventListener("animationend",le.current),le.current=null),I(!1)}},[e,ye]),a.useEffect(()=>{S.current!==null&&S.current!==_.type&&C(O=>O+1),S.current=_.type},[_.type]),a.useEffect(()=>{if(!e)return;const O=document.body.style.overflow,ce=window.matchMedia("(max-width: 768px)").matches,H=gl(fe.color);document.body.style.overflow="hidden",I(!1);const re=ne=>{ne.target===K.current&&!z.current&&ne.animationName&&(ce&&!s&&H>.9&&(document.body.style.backgroundColor=fe.color),I(!0),K.current&&Y.current&&K.current.removeEventListener("animationend",Y.current),Y.current=null)};K.current&&(Y.current=re,K.current.addEventListener("animationend",re));const ae=ne=>{const ie=ne.target;ie&&(ie.closest(`.${Fe.thumbsWrapper}`)||ie.closest(`.${Fe.thumbsContainer}`))||_.type!=="slide"&&ne.preventDefault()};return document.addEventListener("touchmove",ae,{passive:!1}),()=>{document.body.style.overflow=O,document.removeEventListener("touchmove",ae),K.current&&Y.current&&(K.current.removeEventListener("animationend",Y.current),Y.current=null),I(!1)}},[e,s,fe.color,_.type]),a.useEffect(()=>{if(!e)return;const O=ce=>{var re,ae;if(z.current){ce.stopPropagation();return}if(N.current){N.current=!1;return}const H=ce.target;if(!(H&&(H.closest(`.${Fe.thumbsContainer}`)||H.closest(`.${Fe.thumbItem}`)||H.closest(`.${Fe.arrow}`)||H.closest(`.${Fe.closeButton}`)||H.closest(`.${Fe.caption}`)))){if(_.type==="slide"&&Z.type==="drag"&&((ae=(re=h.current)==null?void 0:re.splide)!=null&&ae.root)){const ne=h.current.splide.root;if(H&&(ne.contains(H)||ne===H))return}if(ce.touches.length===0&&ce.changedTouches.length>0){const ne=n[$],ie=(ne==null?void 0:ne.image.objectFit)==="cover",be=ce.changedTouches[0];let Ce;if(ie&&M.current){const ee=ml(M.current);Ce=be.clientX>=ee.left&&be.clientX<=ee.right&&be.clientY>=ee.top&&be.clientY<=ee.bottom}else{const ee=M.current?or(M.current):null;if(!ee)return;Ce=be.clientX>=ee.x&&be.clientX<=ee.x+ee.width&&be.clientY>=ee.y&&be.clientY<=ee.y+ee.height}if(!Ce){ce.stopPropagation(),z.current=!0;const ee=pe=>{pe.stopPropagation(),pe.preventDefault(),document.removeEventListener("click",ee,!0)};document.addEventListener("click",ee,!0),ve()}}}};return document.addEventListener("touchend",O,{passive:!0}),()=>{document.removeEventListener("touchend",O)}},[e,ve,$,n]);const X=(_.type==="scale"||_.type==="fade")&&_.direction==="vert"&&Z.type==="drag";a.useEffect(()=>{var pe,Ae;if(!e||!X||!((Ae=(pe=h.current)==null?void 0:pe.splide)!=null&&Ae.root))return;const O=h.current.splide.root,ce=30,H=(se,V)=>{if(D.current){const je=Math.abs(se-D.current.x),We=Math.abs(V-D.current.y);(je>0||We>0)&&(N.current=!0)}},re=se=>{D.current&&(se.preventDefault(),H(se.clientX,se.clientY))},ae=se=>{D.current&&se.touches.length>0&&(se.preventDefault(),H(se.touches[0].clientX,se.touches[0].clientY))},ne=(se,V)=>{if(!D.current||!h.current){D.current=null;return}const je=Math.abs(se-D.current.x),We=Math.abs(V-D.current.y);We>ce&&We>je&&h.current.go(V<D.current.y?"+1":"-1"),D.current=null},ie=se=>{D.current&&ne(se.clientX,se.clientY),document.removeEventListener("pointerup",ie),document.removeEventListener("pointercancel",ie),document.removeEventListener("pointermove",re)},be=se=>{if(D.current){if(se.changedTouches.length>0){const V=se.changedTouches[0];ne(V.clientX,V.clientY)}document.removeEventListener("touchend",be),document.removeEventListener("touchcancel",be),document.removeEventListener("touchmove",ae)}},Ce=se=>{D.current={x:se.clientX,y:se.clientY},N.current=!1,document.addEventListener("pointermove",re,{passive:!1}),document.addEventListener("pointerup",ie),document.addEventListener("pointercancel",ie)},ee=se=>{se.touches.length>0&&(D.current={x:se.touches[0].clientX,y:se.touches[0].clientY},N.current=!1,document.addEventListener("touchmove",ae,{passive:!1}),document.addEventListener("touchend",be),document.addEventListener("touchcancel",be))};return O.addEventListener("pointerdown",Ce),O.addEventListener("touchstart",ee),()=>{O.removeEventListener("pointerdown",Ce),O.removeEventListener("touchstart",ee),document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",ie),document.removeEventListener("pointercancel",ie),document.removeEventListener("touchmove",ae),document.removeEventListener("touchend",be),document.removeEventListener("touchcancel",be),D.current=null,N.current=!1}},[e,X,E]);const ue={backgroundColor:fe.color,backdropFilter:`blur(${fe.blur}px)`,animationDuration:`${parseInt(G.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:gi.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:K,className:nt(Fe.background,U?xe:oe,{[Fe.editor]:s},{[Fe.hidden]:!e}),style:{...ue,...j&&!s&&!U?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?K:null,className:nt(Fe.contentStyle,U?Q:$e,{[Fe.editor]:s},{[Fe.hidden]:!e}),style:{animationDuration:`${parseInt(G.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(br,{onMove:O=>R(O.index),ref:h,className:Fe.lightboxSplide,options:{arrows:!1,speed:_.duration?parseInt(_.duration):500,direction:_.direction==="horiz"||_.type==="fade"||_.type==="scale"?"ltr":"ttb",pagination:!1,drag:Z.type==="drag"&&!X,perPage:1,width:"100%",height:"100%",type:_.type==="fade"||_.type==="scale"?"fade":"loop",padding:0,rewind:Z.repeat!=="close",start:0},style:{"--splide-speed":_.duration},children:n.map((O,ce)=>{const H=Mo(de.position,de.offset,s),re=`${y.scalingValue(de.padding.top,s)} ${y.scalingValue(de.padding.right,s)} ${y.scalingValue(de.padding.bottom,s)} ${y.scalingValue(de.padding.left,s)}`,ae=_.type==="scale"?(()=>{const{transform:ne,...ie}=H;return{...ie,position:"absolute",padding:re,boxSizing:"border-box","--position-transform":ne||"none"}})():{...H,position:"absolute",padding:re,boxSizing:"border-box"};return r.jsx(wr,{children:r.jsx("div",{className:Fe.imgWrapper,onClick:we,children:r.jsx("img",{ref:ce===$?M:null,className:nt(Fe.imageStyle,{[Fe.contain]:O.image.objectFit==="contain",[Fe.cover]:O.image.objectFit==="cover",[Fe.scaleSlide]:_.type==="scale"}),src:O.image.url,alt:O.image.name??"",style:{...ae,pointerEvents:O.image.objectFit==="contain"?"none":"auto"}})})},ce)})},E),v.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:nt(Fe.arrow,{[Fe.arrowVertical]:_.direction==="vert"}),style:{color:v.color,"--arrow-hover-color":v.hover},children:r.jsxs("button",{className:Fe.arrowInner,style:{transform:`translate(${y.scalingValue(v.offset.x,s)}, ${y.scalingValue(v.offset.y*(_.direction==="horiz"?1:-1),s)}) scale(${v.scale}) rotate(${_.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var O;return(O=h.current)==null?void 0:O.go("-1")},"aria-label":"Previous",children:[v.arrowsImgUrl&&r.jsx(rn,{url:v.arrowsImgUrl,fill:v.color,hoverFill:v.hover,className:nt(Fe.arrowImg,Fe.mirror)}),!v.arrowsImgUrl&&r.jsx(hl,{color:v.color,className:nt(Fe.arrowIcon,Fe.arrowImg,Fe.mirror)})]})}),r.jsx("div",{className:nt(Fe.arrow,Fe.nextArrow,{[Fe.arrowVertical]:_.direction==="vert"}),style:{color:v.color,"--arrow-hover-color":v.hover},children:r.jsxs("button",{className:Fe.arrowInner,style:{transform:`translate(${y.scalingValue(v.offset.x*(_.direction==="horiz"?-1:1),s)}, ${y.scalingValue(v.offset.y,s)}) scale(${v.scale}) rotate(${_.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var O;return(O=h.current)==null?void 0:O.go("+1")},"aria-label":"Next",children:[v.arrowsImgUrl&&r.jsx(rn,{url:v.arrowsImgUrl,fill:v.color,hoverFill:v.hover,className:Fe.arrowImg}),!v.arrowsImgUrl&&r.jsx(hl,{color:v.color,className:nt(Fe.arrowIcon,Fe.arrowImg)})]})})]}),fe.closeIconUrl&&(()=>{const O=Mo(fe.closeIconAlign,fe.closeIconOffset,s),ce=`scale(${fe.closeIconScale})`,H=O.transform?`${O.transform} ${ce}`:ce;return r.jsx("button",{className:Fe.closeButton,style:{...O,transform:H},onClick:ve,"aria-label":"Close lightbox",children:r.jsx(rn,{url:fe.closeIconUrl,fill:fe.closeIconColor??"#000000",hoverFill:fe.closeIconHover??"#cccccc"})})})(),J&&J.isActive&&i.imageCaption&&((Se=n[$])==null?void 0:Se.imageCaption)&&r.jsx("div",{className:Fe.caption,style:{...Mo(J.alignment,J.offset,s),fontFamily:Sr(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":y.scalingValue(c.width,s),letterSpacing:y.scalingValue(m,s),wordSpacing:y.scalingValue(b,s),textAlign:x,fontSize:y.scalingValue(T.fontSize,s),lineHeight:y.scalingValue(T.lineHeight,s),textTransform:f.textTransform??"none",textDecoration:f.textDecoration??"none",fontVariant:f.fontVariant??"normal",color:L},onClick:O=>O.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Fe.captionTextInner,style:{"--link-color":J.linkColor,"--link-hover-color":J.linkHoverColor},children:r.jsx(mi,{content:n[$].imageCaption})})}),me.isActive&&(()=>{const[O,ce]=me.position.split("-"),H=_.direction==="horiz"?`${O}-left`:me.position,re=Mo(H,me.offset,s),ae=()=>{if(_.direction==="horiz"){if(ce==="left")return"flex-start";if(ce==="center")return"center";if(ce==="right")return"flex-end"}else{if(O==="top")return"flex-start";if(O==="middle")return"center";if(O==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:F,className:Fe.thumbsWrapper,onClick:ne=>Me(ne),style:{position:s?"absolute":"fixed",...re,..._.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:nt(Fe.thumbsContainer,{[Fe.thumbsContainerVertical]:_.direction==="vert",[Fe.thumbsAlignStart]:me.align==="start",[Fe.thumbsAlignCenter]:me.align==="center",[Fe.thumbsAlignEnd]:me.align==="end"}),style:{gap:y.scalingValue(me.grid.gap,s),justifyContent:A?"flex-start":ae()},children:n.map((ne,ie)=>{const be=ie===$,Ce=w[ie],pe=me.grid.size*(be?me.activeState.scale:1),Ae=()=>{if(me.fit!=="fit")return{};if(!Ce)return _.direction==="horiz"?{height:y.scalingValue(pe,s)}:{width:y.scalingValue(pe,s)};const se=Ce.width/Ce.height;if(_.direction==="horiz"){const V=pe,je=V*se;return{width:y.scalingValue(je,s),height:y.scalingValue(V,s)}}else{const V=pe,je=V/se;return{width:y.scalingValue(V,s),height:y.scalingValue(je,s)}}};return r.jsx("button",{className:Fe.thumbItem,style:{..._.direction==="horiz"&&me.fit!=="fit"?{height:y.scalingValue(pe,s)}:{},..._.direction==="vert"&&me.fit!=="fit"?{width:y.scalingValue(pe,s)}:{},...me.fit==="cover"?{width:y.scalingValue(pe,s),height:y.scalingValue(pe,s)}:{},...Ae(),transition:be?"all 0.25s ease-out":"none",opacity:be?me.activeState.opacity/100:me.opacity/100,"--thumb-hover":me.activeState.opacity/100},onClick:se=>{var V;se.stopPropagation(),R(ie),(V=h.current)==null||V.go(ie)},onMouseEnter:()=>{var se;me.triggers==="hov"&&((se=h.current)==null||se.go(ie))},children:r.jsx("img",{src:ne.image.url,alt:ne.image.name??"",onLoad:se=>{const V=se.currentTarget;V.naturalWidth&&V.naturalHeight&&W(je=>({...je,[ie]:{width:V.naturalWidth,height:V.naturalHeight}}))},style:{objectFit:me.fit==="cover"?"cover":"contain",...me.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...me.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ne.image.name}-${ie}`)})})})})()]})]}),document.getElementById(l))};function hl({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Ip={element:Tp,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function Po(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Rp(e){return`
6
+ */const Su="RichTextRenderer-module__link___BWeZ2",$u={link:Su},Cu=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(i=>/^\d/.test(i))},Sr=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Cu(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function dn(e){const{color:t,...n}=e;return n}function Xt(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Sr(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:y.scalingValue(e.letterSpacing,t),wordSpacing:y.scalingValue(e.wordSpacing,t),fontSize:y.scalingValue(n,t),lineHeight:i!==void 0?y.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(l=e.textAppearance)==null?void 0:l.textDecoration,fontVariant:(s=e.textAppearance)==null?void 0:s.fontVariant,textAlign:e.textAlign,color:e.color}}const mi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:$u.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Tu(i),children:i.text},o));return r.jsx(r.Fragment,{children:e.map((n,i)=>{const o=n.children;return r.jsx("div",{children:t(o)},i)})})};function Tu(e){return{...e.fontFamily&&{fontFamily:Sr(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}const Lu="SvgImage-module__svg___q3xE-",Iu="SvgImage-module__img___VsTm-",dl={svg:Lu,img:Iu},Ru=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Eu=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,rn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[l,s]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');s(d)}},[]),!Ru(e)||!l?r.jsx("img",{src:e,alt:"",className:nt(dl.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:nt(dl.svg,i),style:{"--svg":Eu(e),"--fill":t,"--hover-fill":n,...o??{}}})},ku={"top-left":Xe.topLeftAlignment,"top-center":Xe.topCenterAlignment,"top-right":Xe.topRightAlignment,"middle-left":Xe.middleLeftAlignment,"middle-center":Xe.middleCenterAlignment,"middle-right":Xe.middleRightAlignment,"bottom-left":Xe.bottomLeftAlignment,"bottom-center":Xe.bottomCenterAlignment,"bottom-right":Xe.bottomRightAlignment};function Mu({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=a.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:m,fontSizeLineHeight:x,textAppearance:b,color:T}=n.imageCaption??{},[f,L]=a.useState(void 0),[$,R]=a.useState(null),[P,C]=a.useState(0),[U,E]=a.useState(0),{direction:j,transition:I,controls:w,pagination:W,imageCaption:h,triggers:S}=e,k=a.useRef(I.type),{x:z,y:K}=e.controls.offset,le=Y=>{o&&o.go(Y)};return a.useEffect(()=>{if(!$)return;const Y=new ResizeObserver(D=>{if(!o)return;const[N]=D;L({width:Math.round(N.contentRect.width),height:Math.round(N.contentRect.height)})});return Y.observe($),()=>Y.unobserve($)},[$]),a.useEffect(()=>{!o||k.current===I.type||(E(Y=>Y+1),k.current=I.type)},[I.type]),r.jsx("div",{className:nt(Xe.wrapper,{[Xe.editor]:i}),ref:R,children:r.jsxs("div",{className:Xe.sliderInner,style:{width:f?f.width:"100%",height:f?f.height:"100%",backgroundColor:I.backgroundColor&&I.type==="fade in"?I.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:nt(Xe.captionBlock),children:r.jsx("div",{className:Xe.captionTextWrapper,children:t.map((Y,D)=>r.jsx("div",{className:nt(Xe.captionText,ku[h.alignment],{[Xe.withPointerEvents]:D===P&&i,[Xe.active]:D===P}),style:{fontFamily:Sr(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":y.scalingValue(s.width,i),letterSpacing:y.scalingValue(c,i),wordSpacing:y.scalingValue(m,i),textAlign:u,fontSize:y.scalingValue(x.fontSize,i),lineHeight:y.scalingValue(x.lineHeight,i),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:T,transitionDuration:I.duration?`${Math.round(parseInt(I.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:Xe.captionTextInner,style:{"--link-hover-color":h.linkHoverColor,"--link-color":h.linkColor,position:"relative",top:y.scalingValue(h.offset.y,i),left:y.scalingValue(h.offset.x,i)},children:r.jsx(mi,{content:Y.imageCaption})})},D))})}),r.jsx(br,{onMove:Y=>{C(Y.index)},ref:l,options:{arrows:!1,speed:I.duration?parseInt(I.duration):500,autoplay:S.autoPlay!==null,...S.autoPlay!==null&&{interval:parseInt(S.autoPlay)*1e3},direction:j==="horiz"||I.type==="fade in"?"ltr":"ttb",pagination:!1,drag:S.triggersList.drag,perPage:1,width:f?f.width:"100%",height:f?f.height:"100%",type:I.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((Y,D)=>r.jsx(wr,{children:r.jsx("div",{className:Xe.sliderItem,children:r.jsx("div",{className:Xe.imgWrapper,children:r.jsx("img",{className:nt(Xe.sliderImage,{[Xe.contain]:Y.image.objectFit==="contain",[Xe.cover]:Y.image.objectFit==="cover"}),src:Y.image.url,alt:Y.image.name??""})})})},D))},U),w.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:nt(Xe.arrow,{[Xe.arrowVertical]:j==="vert",[Xe.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:r.jsxs("button",{onClick:()=>{le("-1")},className:Xe.arrowInner,style:{transform:`translate(${y.scalingValue(z,i)}, ${y.scalingValue(K*(j==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&r.jsx(rn,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:nt(Xe.arrowImg,Xe.mirror)}),!w.arrowsImgUrl&&r.jsx(ul,{color:w.color,className:nt(Xe.arrowIcon,Xe.arrowImg,Xe.mirror)})]})}),r.jsx("div",{className:nt(Xe.arrow,Xe.nextArrow,{[Xe.arrowVertical]:j==="vert",[Xe.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:r.jsxs("button",{className:Xe.arrowInner,onClick:()=>le("+1"),style:{transform:`translate(${y.scalingValue(z*(j==="horiz"?-1:1),i)}, ${y.scalingValue(K,i)}) scale(${e.controls.scale/100}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&r.jsx(rn,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:Xe.arrowImg}),!w.arrowsImgUrl&&r.jsx(ul,{color:w.color,className:nt(Xe.arrowIcon,Xe.arrowImg)})]})})]}),S.triggersList.click&&r.jsx("div",{className:Xe.clickOverlay,onClick:()=>{o&&o.go("+1")}}),W.isActive&&r.jsx("div",{className:nt(Xe.pagination,{[Xe.paginationInsideBottom]:W.position==="inside-1"&&j==="horiz",[Xe.paginationInsideTop]:W.position==="inside-2"&&j==="horiz",[Xe.paginationOutsideBottom]:W.position==="outside-1"&&j==="horiz",[Xe.paginationOutsideTop]:W.position==="outside-2"&&j==="horiz",[Xe.paginationInsideLeft]:W.position==="inside-1"&&j==="vert",[Xe.paginationInsideRight]:W.position==="inside-2"&&j==="vert",[Xe.paginationOutsideLeft]:W.position==="outside-1"&&j==="vert",[Xe.paginationOutsideRight]:W.position==="outside-2"&&j==="vert",[Xe.paginationVertical]:j==="vert"}),children:r.jsx("div",{className:Xe.paginationInner,style:{backgroundColor:W.colors[2],transform:`scale(${W.scale/100}) translate(${y.scalingValue(W.offset.x,i)}, ${y.scalingValue(W.offset.y,i)}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:t.map((Y,D)=>r.jsx("button",{onClick:()=>{o&&o.go(D)},className:nt(Xe.paginationItem),children:r.jsx("div",{className:nt(Xe.dot,{[Xe.activeDot]:D===P}),style:{backgroundColor:D===P?W.colors[0]:W.colors[1],"--pagination-hover-color":W.hover}})},D))})})]})})}function ul({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Pu={element:Mu,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.arrowsImgUrl"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{triggers:{title:"triggers",icon:"target",tooltip:"Triggers",type:"object",properties:{triggersList:{type:"object",display:{type:"toggle-ratio-group"},properties:{click:{type:"boolean"},drag:{type:"boolean"}}},autoPlay:{type:["string","null"],label:"Auto",display:{type:"step-selector"},enum:[null,"1s","2s","3s","4s","5s"]}}},direction:{icon:"horizontal-resize",tooltip:"Direction",type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},transition:{title:"transit",icon:"transition",tooltip:"Transition",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade in"]},backgroundColor:{type:["string","null"],title:"BG Color",display:{visible:!1,type:"settings-color-picker",format:"single"}},duration:{type:"string",label:"icon:hourglass",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},controls:{title:"controls",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:50,max:600,display:{type:"range-control"}},color:{title:"color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}},show:{title:"Show",type:"string",display:{type:"ratio-group"},enum:["always","on hover"]}}},pagination:{title:"nav",icon:"pagination",tooltip:"Navigation",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"socket",direction:"horizontal"},type:"string",enum:["outside-1","outside-2","inside-1","inside-2"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"scale",min:10,max:400,display:{type:"range-control"}},colors:{display:{type:"settings-color-picker",format:"multiple"},title:"color",type:"array",items:{type:"string"}},hover:{title:"hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},imageCaption:{title:"Caption",icon:"text-icon",tooltip:"Caption",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}},default:{triggers:{triggersList:{click:!1,drag:!0},autoPlay:null},controls:{isActive:!0,arrowsImgUrl:null,offset:{x:0,y:0},scale:100,color:"#000000",hover:"#cccccc",show:"always"},transition:{type:"slide",duration:"500ms",backgroundColor:null},pagination:{isActive:!0,scale:50,position:"inside-1",offset:{x:0,y:0},colors:["#cccccc","#cccccc","#000000"],hover:"#cccccc"},direction:"horiz",imageCaption:{offset:{x:0,y:0},isActive:!0,alignment:"middle-center",linkColor:"#cccccc",linkHoverColor:"#cccccc"}},displayRules:[{if:{name:"direction",value:"vert"},then:{name:"properties.pagination.properties.position.display.direction",value:"vertical"}},{if:{name:"transition.type",value:"fade in"},then:{name:"properties.transition.properties.backgroundColor.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}},Au="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Fu="ImageRevealSlider-module__image___Qjt-e",Wu="ImageRevealSlider-module__link___N-iLG",_u="ImageRevealSlider-module__cursor___2U03d",vi={imageRevealSlider:Au,image:Fu,link:Wu,cursor:_u};function pl(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const l=i.width?Number.parseFloat(i.width):o.naturalWidth,s=o.naturalHeight/o.naturalWidth*l,d=l/2,c=s/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function _r(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Nu(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await _r(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await _r(e);l=s.height/s.width*o}else{const s=await _r(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function Hu({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[l,s]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[m,x]=a.useState({x:0,y:0}),[b,T]=a.useState(1),[f,L]=a.useState("none"),$=a.useRef({x:0,y:0}),[R,P]=a.useState(!1),{sizeType:C,imageWidth:U,randomRangeImageWidth:E}=e.imageSize,{revealPosition:j,visible:I}=e.position,{cursorType:w,target:W,defaultCursorScale:h,defaultCursor:S,hoverCursorScale:k,hoverCursor:z}=e.cursor;a.useEffect(()=>{if(!i)return;const Y=(F,A)=>{const q=i.getBoundingClientRect(),G=F-q.left,Z=A-q.top;if(x({x:G,y:Z}),w==="system"){L("none"),T(1);return}const _=G,me=Z,v=document.elementFromPoint(q.left+_,q.top+me);if(v&&v.closest("a")){L("none"),T(1);return}const fe=pl(_,me,l)||W==="area"?{img:z??"none",scale:k}:{img:S??"none",scale:h};L(fe.img),T(fe.scale)},D=F=>{F.stopPropagation(),$.current={x:F.clientX,y:F.clientY},Y(F.clientX,F.clientY)},N=()=>{R&&Y($.current.x,$.current.y)};return i.addEventListener("mousemove",D),window.addEventListener("scroll",N,!0),()=>{i.removeEventListener("mousemove",D),window.removeEventListener("scroll",N,!0)}},[i,R,m,w,W,z,S,k,h,l]),a.useEffect(()=>{R||(L("none"),T(0))},[R]);const K=async(Y,D,N,F={})=>{const{width:A,height:q,finalWidth:G}=await Nu(Y.image.url,C,U,E);let Z=0,_=0;j==="same"?(Z=D/2,_=N/2):(Z=F.x??Math.random()*D,_=F.y??Math.random()*N);const me=Math.min(Math.max(Z,A/2),D-A/2),v=Math.min(Math.max(_,q/2),N-q/2);return{id:u.current++,url:Y.image.url,link:Y.link,name:Y.image.name,x:me,y:v,width:G}};a.useEffect(()=>{if(!i||t.length===0)return;const Y=i.getBoundingClientRect(),D=Y.width,N=Y.height,F=[];(async()=>{const q=t[0],G=await K(q,D,N);F.push(G),s(F),c(1)})()},[C,U,E,j,i]),a.useEffect(()=>{I==="last One"&&s(Y=>Y.length>0?[Y[Y.length-1]]:[])},[I]);const le=async Y=>{if(!i)return;const D=i.getBoundingClientRect(),N=Y.clientX-D.left,F=Y.clientY-D.top;if(W==="image"&&!pl(N,F,l))return;let A=0,q=0;j==="on Click"?(A=N,q=F):j==="same"?(A=D.width/2,q=D.height/2):(A=Math.random()*D.width,q=Math.random()*D.height);const G=t[d],Z=await K(G,D.width,D.height,{x:A,y:q});s(_=>I==="all"?[..._,Z]:[Z]),c(_=>_>=t.length-1?0:_+1)};return r.jsxs("div",{ref:o,onClick:le,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),className:vi.imageRevealSlider,style:{cursor:f==="none"?"default":"none"},children:[l.map(Y=>r.jsx("div",{className:vi.wrapper,style:{top:`${Y.y}px`,left:`${Y.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:Y.width??"auto",height:"auto",cursor:f==="none"?"default":"none"},children:W==="area"&&Y.link?r.jsx("a",{href:Y.link,target:"_blank",className:vi.link,children:r.jsx("img",{src:Y.url,alt:Y.name,className:vi.image},Y.id)}):r.jsx("img",{src:Y.url,alt:Y.name,className:vi.image},Y.id)},Y.id)),R&&r.jsx("div",{className:vi.cursor,style:{left:`${m.x}px`,top:`${m.y}px`,transform:`translate(-50%, -50%) scale(${b})`,backgroundImage:`url('${f}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const ju={element:Hu,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},Ou="LightBox-module__hidden___9s-9x",zu="LightBox-module__heroImage___sTxNF",Bu="LightBox-module__background___rm9ml",Du="LightBox-module__editor___4ACaY",Vu="LightBox-module__contentStyle___Bgnsq",Gu="LightBox-module__imageStyle___tLIlB",qu="LightBox-module__imgWrapper___LuFUp",Ku="LightBox-module__contain___8-yaS",Uu="LightBox-module__cover___hNvOG",Xu="LightBox-module__caption___b6L2I",Yu="LightBox-module__captionTextInner___rCGNH",Zu="LightBox-module__lightboxSplide___XFuWC",Ju="LightBox-module__arrow___iz38X",Qu="LightBox-module__arrowVertical___Zfz81",ep="LightBox-module__nextArrow___zkAQN",tp="LightBox-module__arrowInner___p48sW",np="LightBox-module__arrowIcon___3VaFf",ip="LightBox-module__arrowImg___pNV88",op="LightBox-module__mirror___pjeXc",rp="LightBox-module__thumbsWrapper___GB-nU",ap="LightBox-module__thumbsContainerVertical___wttk5",lp="LightBox-module__thumbsContainer___osSma",sp="LightBox-module__thumbsAlignStart___MO6tY",cp="LightBox-module__thumbsAlignCenter___Q4sUx",dp="LightBox-module__thumbsAlignEnd___p4y9R",up="LightBox-module__thumbItem___HvnF3",pp="LightBox-module__closeButton___g2khP",mp="LightBox-module__fadeIn___0m5GW",gp="LightBox-module__slideInLeft___gPYwC",hp="LightBox-module__slideInRight___S-pPp",fp="LightBox-module__slideInTop___DFdAj",yp="LightBox-module__slideInBottom___m27kZ",vp="LightBox-module__fadeOut___55qBR",xp="LightBox-module__slideOutLeft___NvU7P",bp="LightBox-module__slideOutRight___SK7eC",wp="LightBox-module__slideOutTop___Vgg0z",Sp="LightBox-module__slideOutBottom___nJ0Ef",$p="LightBox-module__scaleSlide___vZriG",Fe={hidden:Ou,heroImage:zu,background:Bu,editor:Du,contentStyle:Vu,imageStyle:Gu,imgWrapper:qu,contain:Ku,cover:Uu,caption:Xu,captionTextInner:Yu,lightboxSplide:Zu,arrow:Ju,arrowVertical:Qu,nextArrow:ep,arrowInner:tp,arrowIcon:np,arrowImg:ip,mirror:op,thumbsWrapper:rp,thumbsContainerVertical:ap,thumbsContainer:lp,thumbsAlignStart:sp,thumbsAlignCenter:cp,thumbsAlignEnd:dp,thumbItem:up,closeButton:pp,fadeIn:mp,slideInLeft:gp,slideInRight:hp,slideInTop:fp,slideInBottom:yp,fadeOut:vp,slideOutLeft:xp,slideOutRight:bp,slideOutTop:wp,slideOutBottom:Sp,scaleSlide:$p},Mo=(e,t,n)=>{const i={},[o,l]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),l==="left"?(i.left="0",i.right="auto"):l==="center"?(i.left="50%",i.right="auto"):l==="right"&&(i.left="auto",i.right="0"),o==="middle"&&l==="center"?i.transform=`translate(calc(-50% + ${y.scalingValue(t.x,n)}), calc(-50% + ${y.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${y.scalingValue(t.x,n)}, calc(-50% + ${y.scalingValue(t.y,n)}))`:l==="center"?i.transform=`translate(calc(-50% + ${y.scalingValue(t.x,n)}), ${y.scalingValue(t.y,n)})`:i.transform=`translate(${y.scalingValue(t.x,n)}, ${y.scalingValue(t.y,n)})`,i};function Ks(e){const t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function or(e){const t=e.getBoundingClientRect(),n=Ks(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,s=e.naturalHeight,d=i/o,c=l/s;let u,m;c>d?(u=i,m=i/c):(m=o,u=o*c);const x=t.left+n.left,b=t.top+n.top,T=(i-u)/2+x,f=(o-m)/2+b;return{x:T,y:f,width:u,height:m}}function ml(e){const t=e.getBoundingClientRect(),n=Ks(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function gl(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Cp(e,t){const n=(()=>{if(e==="fade in")return Fe.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Fe.slideInLeft;case"right":return Fe.slideInRight;case"top":return Fe.slideInTop;case"bottom":return Fe.slideInBottom;default:return Fe.slideInRight}return Fe.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Fe.fadeIn;if(e==="slide in")switch(t){case"left":return Fe.slideInLeft;case"right":return Fe.slideInRight;case"top":return Fe.slideInTop;case"bottom":return Fe.slideInBottom;default:return Fe.slideInRight}return Fe.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Fe.fadeOut;if(e==="slide in")switch(t){case"left":return Fe.slideOutLeft;case"right":return Fe.slideOutRight;case"top":return Fe.slideOutTop;case"bottom":return Fe.slideOutBottom;default:return Fe.slideOutRight}return Fe.fadeOut})(),l=(()=>{if(e==="fade in")return Fe.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Fe.slideOutLeft;case"right":return Fe.slideOutRight;case"top":return Fe.slideOutTop;case"bottom":return Fe.slideOutBottom;default:return Fe.slideOutRight}return Fe.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const Tp=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:l,isPreviewMode:s})=>{const[d,c]=a.useState(!1),{url:u}=e.thumbnailBlock.cover;return a.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:Fe.heroImage,onClick:()=>c(!0)}),r.jsx(Lp,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},Lp=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:d})=>{var Se;const{widthSettings:c,fontSettings:u,letterSpacing:m,textAlign:x,wordSpacing:b,fontSizeLineHeight:T,textAppearance:f,color:L}=i.imageCaption??{},[$,R]=a.useState(0),[P,C]=a.useState(0),[U,E]=a.useState(!1),[j,I]=a.useState(!1),[w,W]=a.useState({}),h=a.useRef(null),S=a.useRef(null),k=a.useRef(null),z=a.useRef(!1),K=a.useRef(null),le=a.useRef(null),Y=a.useRef(null),D=a.useRef(null),N=a.useRef(!1),F=a.useRef(null),[A,q]=a.useState(!1),{appear:G,triggers:Z,slider:_,thumbnail:me,controls:v,area:fe,caption:J,layout:de}=o.lightboxBlock,{appearClass:$e,backdropAppearClass:oe,backdropDisappearClass:xe,disappearClass:Q}=Cp(G.type,G.direction),ye=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const O=()=>{setTimeout(()=>{var H,re;(re=(H=h.current)==null?void 0:H.splide)==null||re.refresh()},16)},ce=()=>{C(H=>H+1)};return window.addEventListener("ArticleEditor.Layout:change",O),window.addEventListener("ArticleEditor.ComponentContent:change",ce),()=>{window.removeEventListener("ArticleEditor.Layout:change",O),window.removeEventListener("ArticleEditor.ComponentContent:change",ce)}},[]),a.useEffect(()=>{if(!e||!me.isActive){q(!1);return}const O=F.current;if(!O)return;const ce=()=>{_.direction==="horiz"?q(O.scrollWidth>O.clientWidth):q(O.scrollHeight>O.clientHeight)};ce();const H=new ResizeObserver(ce);return H.observe(O),()=>H.disconnect()},[e,me.isActive,n.length,w,_.direction]);const ve=a.useCallback(()=>{const O=window.matchMedia("(max-width: 768px)").matches,ce=gl(fe.color);O&&!s&&ce>.9&&(document.body.style.backgroundColor=""),E(!0),z.current=!0;const H=re=>{re.target===K.current&&re.animationName&&(K.current&&le.current&&K.current.removeEventListener("animationend",le.current),le.current=null,z.current&&(z.current=!1,t()),E(!1))};K.current&&(le.current=H,K.current.addEventListener("animationend",H))},[t,fe.color,s]),ke=(O,ce,H)=>{var re,ae;if(O){if(Z.type==="click"&&Z.switch==="image")Z.repeat==="close"&&$===n.length-1?ve():(re=h.current)==null||re.go("+1");else if(Z.type==="click"&&Z.switch==="50/50"){const ne=O.getBoundingClientRect(),ie=ce-ne.left,be=H-ne.top,Ce=ne.width,ee=ne.height;let pe;_.direction==="horiz"?pe=ie<Ce/2?"-1":"+1":pe=be<ee/2?"-1":"+1",(ae=h.current)==null||ae.go(pe)}}},we=O=>{if(N.current){N.current=!1;return}const ce=n[$],H=(ce==null?void 0:ce.image.objectFit)==="cover";let re,ae;if("changedTouches"in O&&O.changedTouches.length>0)re=O.changedTouches[0].clientX,ae=O.changedTouches[0].clientY;else if("clientX"in O)re=O.clientX,ae=O.clientY;else return;let ne;if(H&&k.current){const ie=ml(k.current);ne=re>=ie.left&&re<=ie.right&&ae>=ie.top&&ae<=ie.bottom}else{const ie=k.current?or(k.current):null;if(!ie){O.target===O.currentTarget&&ve();return}ne=re>=ie.x&&re<=ie.x+ie.width&&ae>=ie.y&&ae<=ie.y+ie.height}ne?ke(k.current,re,ae):ve()},Me=O=>{const ce=O.target;(ce.classList.contains(Fe.thumbsWrapper)||ce.classList.contains(Fe.thumbsContainer))&&we(O)};a.useEffect(()=>{if(!e)return;const O=ce=>{var H,re;if(ce.key==="Escape"){ve();return}if(ce.key==="ArrowRight"){R(ae=>(ae+1)%Math.max(n.length,1)),(H=h.current)==null||H.go("+1");return}ce.key==="ArrowLeft"&&(R(ae=>(ae-1+Math.max(n.length,1))%Math.max(n.length,1)),(re=h.current)==null||re.go("-1"))};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O)}},[e,ve,n.length]),a.useEffect(()=>{if(e){if(R(0),C(ce=>ce+1),z.current=!1,E(!1),I(!1),W({}),!ye)return;const O=new CustomEvent("page-overlay",{detail:{itemId:ye}});window.dispatchEvent(O)}return()=>{K.current&&le.current&&(K.current.removeEventListener("animationend",le.current),le.current=null),I(!1)}},[e,ye]),a.useEffect(()=>{S.current!==null&&S.current!==_.type&&C(O=>O+1),S.current=_.type},[_.type]),a.useEffect(()=>{if(!e)return;const O=document.body.style.overflow,ce=window.matchMedia("(max-width: 768px)").matches,H=gl(fe.color);document.body.style.overflow="hidden",I(!1);const re=ne=>{ne.target===K.current&&!z.current&&ne.animationName&&(ce&&!s&&H>.9&&(document.body.style.backgroundColor=fe.color),I(!0),K.current&&Y.current&&K.current.removeEventListener("animationend",Y.current),Y.current=null)};K.current&&(Y.current=re,K.current.addEventListener("animationend",re));const ae=ne=>{const ie=ne.target;ie&&(ie.closest(`.${Fe.thumbsWrapper}`)||ie.closest(`.${Fe.thumbsContainer}`))||_.type!=="slide"&&ne.preventDefault()};return document.addEventListener("touchmove",ae,{passive:!1}),()=>{document.body.style.overflow=O,document.removeEventListener("touchmove",ae),K.current&&Y.current&&(K.current.removeEventListener("animationend",Y.current),Y.current=null),I(!1)}},[e,s,fe.color,_.type]),a.useEffect(()=>{if(!e)return;const O=ce=>{var re,ae;if(z.current){ce.stopPropagation();return}if(N.current){N.current=!1;return}const H=ce.target;if(!(H&&(H.closest(`.${Fe.thumbsContainer}`)||H.closest(`.${Fe.thumbItem}`)||H.closest(`.${Fe.arrow}`)||H.closest(`.${Fe.closeButton}`)||H.closest(`.${Fe.caption}`)))){if(_.type==="slide"&&Z.type==="drag"&&((ae=(re=h.current)==null?void 0:re.splide)!=null&&ae.root)){const ne=h.current.splide.root;if(H&&(ne.contains(H)||ne===H))return}if(ce.touches.length===0&&ce.changedTouches.length>0){const ne=n[$],ie=(ne==null?void 0:ne.image.objectFit)==="cover",be=ce.changedTouches[0];let Ce;if(ie&&k.current){const ee=ml(k.current);Ce=be.clientX>=ee.left&&be.clientX<=ee.right&&be.clientY>=ee.top&&be.clientY<=ee.bottom}else{const ee=k.current?or(k.current):null;if(!ee)return;Ce=be.clientX>=ee.x&&be.clientX<=ee.x+ee.width&&be.clientY>=ee.y&&be.clientY<=ee.y+ee.height}if(!Ce){ce.stopPropagation(),z.current=!0;const ee=pe=>{pe.stopPropagation(),pe.preventDefault(),document.removeEventListener("click",ee,!0)};document.addEventListener("click",ee,!0),ve()}}}};return document.addEventListener("touchend",O,{passive:!0}),()=>{document.removeEventListener("touchend",O)}},[e,ve,$,n]);const X=(_.type==="scale"||_.type==="fade")&&_.direction==="vert"&&Z.type==="drag";a.useEffect(()=>{var pe,Ae;if(!e||!X||!((Ae=(pe=h.current)==null?void 0:pe.splide)!=null&&Ae.root))return;const O=h.current.splide.root,ce=30,H=(se,V)=>{if(D.current){const je=Math.abs(se-D.current.x),We=Math.abs(V-D.current.y);(je>0||We>0)&&(N.current=!0)}},re=se=>{D.current&&(se.preventDefault(),H(se.clientX,se.clientY))},ae=se=>{D.current&&se.touches.length>0&&(se.preventDefault(),H(se.touches[0].clientX,se.touches[0].clientY))},ne=(se,V)=>{if(!D.current||!h.current){D.current=null;return}const je=Math.abs(se-D.current.x),We=Math.abs(V-D.current.y);We>ce&&We>je&&h.current.go(V<D.current.y?"+1":"-1"),D.current=null},ie=se=>{D.current&&ne(se.clientX,se.clientY),document.removeEventListener("pointerup",ie),document.removeEventListener("pointercancel",ie),document.removeEventListener("pointermove",re)},be=se=>{if(D.current){if(se.changedTouches.length>0){const V=se.changedTouches[0];ne(V.clientX,V.clientY)}document.removeEventListener("touchend",be),document.removeEventListener("touchcancel",be),document.removeEventListener("touchmove",ae)}},Ce=se=>{D.current={x:se.clientX,y:se.clientY},N.current=!1,document.addEventListener("pointermove",re,{passive:!1}),document.addEventListener("pointerup",ie),document.addEventListener("pointercancel",ie)},ee=se=>{se.touches.length>0&&(D.current={x:se.touches[0].clientX,y:se.touches[0].clientY},N.current=!1,document.addEventListener("touchmove",ae,{passive:!1}),document.addEventListener("touchend",be),document.addEventListener("touchcancel",be))};return O.addEventListener("pointerdown",Ce),O.addEventListener("touchstart",ee),()=>{O.removeEventListener("pointerdown",Ce),O.removeEventListener("touchstart",ee),document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",ie),document.removeEventListener("pointercancel",ie),document.removeEventListener("touchmove",ae),document.removeEventListener("touchend",be),document.removeEventListener("touchcancel",be),D.current=null,N.current=!1}},[e,X,P]);const ue={backgroundColor:fe.color,backdropFilter:`blur(${fe.blur}px)`,animationDuration:`${parseInt(G.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:gi.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:K,className:nt(Fe.background,U?xe:oe,{[Fe.editor]:s},{[Fe.hidden]:!e}),style:{...ue,...j&&!s&&!U?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?K:null,className:nt(Fe.contentStyle,U?Q:$e,{[Fe.editor]:s},{[Fe.hidden]:!e}),style:{animationDuration:`${parseInt(G.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(br,{onMove:O=>R(O.index),ref:h,className:Fe.lightboxSplide,options:{arrows:!1,speed:_.duration?parseInt(_.duration):500,direction:_.direction==="horiz"||_.type==="fade"||_.type==="scale"?"ltr":"ttb",pagination:!1,drag:Z.type==="drag"&&!X,perPage:1,width:"100%",height:"100%",type:_.type==="fade"||_.type==="scale"?"fade":"loop",padding:0,rewind:Z.repeat!=="close",start:0},style:{"--splide-speed":_.duration},children:n.map((O,ce)=>{const H=Mo(de.position,de.offset,s),re=`${y.scalingValue(de.padding.top,s)} ${y.scalingValue(de.padding.right,s)} ${y.scalingValue(de.padding.bottom,s)} ${y.scalingValue(de.padding.left,s)}`,ae=_.type==="scale"?(()=>{const{transform:ne,...ie}=H;return{...ie,position:"absolute",padding:re,boxSizing:"border-box","--position-transform":ne||"none"}})():{...H,position:"absolute",padding:re,boxSizing:"border-box"};return r.jsx(wr,{children:r.jsx("div",{className:Fe.imgWrapper,onClick:we,children:r.jsx("img",{ref:ce===$?k:null,className:nt(Fe.imageStyle,{[Fe.contain]:O.image.objectFit==="contain",[Fe.cover]:O.image.objectFit==="cover",[Fe.scaleSlide]:_.type==="scale"}),src:O.image.url,alt:O.image.name??"",style:{...ae,pointerEvents:O.image.objectFit==="contain"?"none":"auto"}})})},ce)})},P),v.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:nt(Fe.arrow,{[Fe.arrowVertical]:_.direction==="vert"}),style:{color:v.color,"--arrow-hover-color":v.hover},children:r.jsxs("button",{className:Fe.arrowInner,style:{transform:`translate(${y.scalingValue(v.offset.x,s)}, ${y.scalingValue(v.offset.y*(_.direction==="horiz"?1:-1),s)}) scale(${v.scale}) rotate(${_.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var O;return(O=h.current)==null?void 0:O.go("-1")},"aria-label":"Previous",children:[v.arrowsImgUrl&&r.jsx(rn,{url:v.arrowsImgUrl,fill:v.color,hoverFill:v.hover,className:nt(Fe.arrowImg,Fe.mirror)}),!v.arrowsImgUrl&&r.jsx(hl,{color:v.color,className:nt(Fe.arrowIcon,Fe.arrowImg,Fe.mirror)})]})}),r.jsx("div",{className:nt(Fe.arrow,Fe.nextArrow,{[Fe.arrowVertical]:_.direction==="vert"}),style:{color:v.color,"--arrow-hover-color":v.hover},children:r.jsxs("button",{className:Fe.arrowInner,style:{transform:`translate(${y.scalingValue(v.offset.x*(_.direction==="horiz"?-1:1),s)}, ${y.scalingValue(v.offset.y,s)}) scale(${v.scale}) rotate(${_.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var O;return(O=h.current)==null?void 0:O.go("+1")},"aria-label":"Next",children:[v.arrowsImgUrl&&r.jsx(rn,{url:v.arrowsImgUrl,fill:v.color,hoverFill:v.hover,className:Fe.arrowImg}),!v.arrowsImgUrl&&r.jsx(hl,{color:v.color,className:nt(Fe.arrowIcon,Fe.arrowImg)})]})})]}),fe.closeIconUrl&&(()=>{const O=Mo(fe.closeIconAlign,fe.closeIconOffset,s),ce=`scale(${fe.closeIconScale})`,H=O.transform?`${O.transform} ${ce}`:ce;return r.jsx("button",{className:Fe.closeButton,style:{...O,transform:H},onClick:ve,"aria-label":"Close lightbox",children:r.jsx(rn,{url:fe.closeIconUrl,fill:fe.closeIconColor??"#000000",hoverFill:fe.closeIconHover??"#cccccc"})})})(),J&&J.isActive&&i.imageCaption&&((Se=n[$])==null?void 0:Se.imageCaption)&&r.jsx("div",{className:Fe.caption,style:{...Mo(J.alignment,J.offset,s),fontFamily:Sr(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":y.scalingValue(c.width,s),letterSpacing:y.scalingValue(m,s),wordSpacing:y.scalingValue(b,s),textAlign:x,fontSize:y.scalingValue(T.fontSize,s),lineHeight:y.scalingValue(T.lineHeight,s),textTransform:f.textTransform??"none",textDecoration:f.textDecoration??"none",fontVariant:f.fontVariant??"normal",color:L},onClick:O=>O.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Fe.captionTextInner,style:{"--link-color":J.linkColor,"--link-hover-color":J.linkHoverColor},children:r.jsx(mi,{content:n[$].imageCaption})})}),me.isActive&&(()=>{const[O,ce]=me.position.split("-"),H=_.direction==="horiz"?`${O}-left`:me.position,re=Mo(H,me.offset,s),ae=()=>{if(_.direction==="horiz"){if(ce==="left")return"flex-start";if(ce==="center")return"center";if(ce==="right")return"flex-end"}else{if(O==="top")return"flex-start";if(O==="middle")return"center";if(O==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:F,className:Fe.thumbsWrapper,onClick:ne=>Me(ne),style:{position:s?"absolute":"fixed",...re,..._.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:nt(Fe.thumbsContainer,{[Fe.thumbsContainerVertical]:_.direction==="vert",[Fe.thumbsAlignStart]:me.align==="start",[Fe.thumbsAlignCenter]:me.align==="center",[Fe.thumbsAlignEnd]:me.align==="end"}),style:{gap:y.scalingValue(me.grid.gap,s),justifyContent:A?"flex-start":ae()},children:n.map((ne,ie)=>{const be=ie===$,Ce=w[ie],pe=me.grid.size*(be?me.activeState.scale:1),Ae=()=>{if(me.fit!=="fit")return{};if(!Ce)return _.direction==="horiz"?{height:y.scalingValue(pe,s)}:{width:y.scalingValue(pe,s)};const se=Ce.width/Ce.height;if(_.direction==="horiz"){const V=pe,je=V*se;return{width:y.scalingValue(je,s),height:y.scalingValue(V,s)}}else{const V=pe,je=V/se;return{width:y.scalingValue(V,s),height:y.scalingValue(je,s)}}};return r.jsx("button",{className:Fe.thumbItem,style:{..._.direction==="horiz"&&me.fit!=="fit"?{height:y.scalingValue(pe,s)}:{},..._.direction==="vert"&&me.fit!=="fit"?{width:y.scalingValue(pe,s)}:{},...me.fit==="cover"?{width:y.scalingValue(pe,s),height:y.scalingValue(pe,s)}:{},...Ae(),transition:be?"all 0.25s ease-out":"none",opacity:be?me.activeState.opacity/100:me.opacity/100,"--thumb-hover":me.activeState.opacity/100},onClick:se=>{var V;se.stopPropagation(),R(ie),(V=h.current)==null||V.go(ie)},onMouseEnter:()=>{var se;me.triggers==="hov"&&((se=h.current)==null||se.go(ie))},children:r.jsx("img",{src:ne.image.url,alt:ne.image.name??"",onLoad:se=>{const V=se.currentTarget;V.naturalWidth&&V.naturalHeight&&W(je=>({...je,[ie]:{width:V.naturalWidth,height:V.naturalHeight}}))},style:{objectFit:me.fit==="cover"?"cover":"contain",...me.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...me.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ne.image.name}-${ie}`)})})})})()]})]}),document.getElementById(l))};function hl({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Ip={element:Tp,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function Po(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Rp(e){return`
7
7
  .${e}-wrapper {
8
8
  display: flex;
9
9
  flex-direction: column;
@@ -155,7 +155,7 @@
155
155
  pointer-events: auto;
156
156
  z-index: 10;
157
157
  }
158
- `}function Ep({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:l}){const s=!!n,d=i&&t||!t,{prefix:c}=y.useScopedStyles(),{type:u="A",fieldsToShow:m=2,fields:x=[],buttonLabel:b,gap:T,fieldsGap:f,buttonCorners:L,buttonStroke:$,buttonPadding:R,isButtonFullWidth:E,inputCorners:C,inputStroke:U,inputPadding:k,inputColor:j,inputTextColor:I,inputBorderColor:w,placeholderColor:W,buttonColor:h,buttonTextColor:S,buttonBorderColor:M,labelTextColor:z,successColor:K,errorColor:le,fontFamily:Y,inputFontSettings:D,inputFontSize:N,inputLineHeight:F,inputLetterSpacing:A,inputWordSpacing:q,inputTextAppearance:G,buttonFontSettings:Z,buttonFontSize:_,buttonLineHeight:me,buttonLetterSpacing:v,buttonWordSpacing:fe,buttonTextAppearance:J,labelFontSettings:de,labelFontSize:$e,labelLineHeight:oe,labelLetterSpacing:xe,labelWordSpacing:Q,labelTextAppearance:ye,statusFontSettings:ve,statusFontSize:ke,statusLineHeight:we,statusLetterSpacing:Me,statusWordSpacing:X,statusTextAppearance:ue,successMessage:Se,errorMessage:O,stateOverrides:ce}=e,H=u==="B",re=x.slice(0,Math.min(m,x.length)),ae={fontSettings:{fontFamily:Y,fontWeight:(D==null?void 0:D.fontWeight)??400,fontStyle:(D==null?void 0:D.fontStyle)??"normal"},fontSize:N??.01,lineHeight:F,letterSpacing:A??0,wordSpacing:q??0,textAppearance:G,color:I},ne=dn(Xt(ae,t)),ie=y.scalingValue(U??0,t),be=y.scalingValue((F??N??.01)+((k==null?void 0:k.top)??0)+((k==null?void 0:k.bottom)??0)+(u==="C"?U??0:(U??0)*2),t),Ce={...ne,borderStyle:"solid",borderRadius:u==="C"?0:y.scalingValue(C??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:ie,borderLeftWidth:0}:{borderWidth:ie},paddingTop:y.scalingValue((k==null?void 0:k.top)??0,t),paddingRight:y.scalingValue((k==null?void 0:k.right)??0,t),paddingBottom:y.scalingValue((k==null?void 0:k.bottom)??0,t),paddingLeft:y.scalingValue((k==null?void 0:k.left)??0,t),height:be,minHeight:be},ee={fontSettings:{fontFamily:Y,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:_??.01,lineHeight:me,letterSpacing:v??0,wordSpacing:fe??0,textAppearance:J,color:S},pe=dn(Xt(ee,t)),Ae=y.scalingValue($??0,t),se={fontSettings:{fontFamily:Y,fontWeight:(de==null?void 0:de.fontWeight)??400,fontStyle:(de==null?void 0:de.fontStyle)??"normal"},fontSize:$e??.01,lineHeight:oe,letterSpacing:xe??0,wordSpacing:Q??0,textAppearance:ye,color:z},V=Xt(se,t),je={fontSettings:{fontFamily:Y,fontWeight:(ve==null?void 0:ve.fontWeight)??400,fontStyle:(ve==null?void 0:ve.fontStyle)??"normal"},fontSize:ke??.01,lineHeight:we,letterSpacing:Me??0,wordSpacing:X??0,textAppearance:ue,color:K},We=dn(Xt(je,t)),et=y.buildColorVars(c,{inputColor:j,inputTextColor:I,inputBorderColor:w,placeholderColor:W!=null&&W.trim()?W:"#cccccc",buttonColor:h,buttonTextColor:S,buttonBorderColor:M,labelTextColor:z,successColor:K,errorColor:le},kp,Mp,ce),[Ye,st]=a.useState(()=>Object.fromEntries(re.map(Ge=>[Ge.name,""]))),[mt,De]=a.useState("idle"),[ot,$t]=a.useState(null),rt=l==="success"?"success":l==="error"?"error":mt,Ue=l==="error"?O:ot,ht=l==="filled",xt=a.useMemo(()=>{if(!ht)return Ye;let Ge=null;for(const qe of re)(Ye[qe.name]??"").trim().length>0||(Ge=Ge??{...Ye},Ge[qe.name]="Filled");return Ge??Ye},[Ye,ht,re]),dt=rt==="error"?y.getFormFieldValidationError(re,xt):null,_t=`${l&&l!=="default"?`${c}-state-${l}`:""}`.trim(),Qe=o==null?void 0:o.submitUrl,Tt=(Ge,qe)=>{st(Pe=>({...Pe,[Ge]:qe}))},Lt=async Ge=>{if(Ge.preventDefault(),!d)return;const qe=Object.fromEntries(re.map(gt=>{var It;return[gt.name,((It=Ye[gt.name])==null?void 0:It.trim())??""]}).filter(([,gt])=>gt));if(!Qe){De("error"),$t("No integrations were found for this form.");return}if(Object.keys(qe).length===0)return;const Pe=y.getFormFieldValidationError(re,Ye);if(Pe){De("error"),$t(Pe);return}De("submitting"),$t(null);try{const gt=await fetch(Qe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(!gt.ok){const It=await gt.text();throw new Error(It||`Request failed: ${gt.status}`)}De("success"),st(Object.fromEntries(re.map(It=>[It.name,""])))}catch(gt){De("error"),$t(gt instanceof Error?gt.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${_t}`.trim(),style:et,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Rp(c)}}),r.jsxs("form",{onSubmit:Lt,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:re.map((Ge,qe)=>r.jsxs(a.Fragment,{children:[qe>0&&r.jsx("div",{"data-controls":s?"fieldsGap":void 0,className:s?`${c}-control`:void 0,style:{height:y.scalingValue(f??0,t)}}),r.jsxs("div",{className:`${c}-field-group${H?` ${c}-labeled`:""}`,children:[H&&r.jsx("span",{className:`${c}-field-label`,style:V?{...V,lineHeight:V.fontSize}:void 0,children:Ge.label||Ge.name}),Ge.type==="textarea"?r.jsx("textarea",{name:Ge.name,autoComplete:"off",value:xt[Ge.name]??"",onChange:Pe=>Tt(Ge.name,Pe.target.value),placeholder:Ge.placeholder,className:`${c}-input`,style:Ce,rows:1,"data-filled":ht||(xt[Ge.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:Ge.type==="phone"?"tel":Ge.type==="email"?"email":"text",name:Ge.name,autoComplete:"off",value:xt[Ge.name]??"",onChange:Pe=>Tt(Ge.name,Pe.target.value),placeholder:Ge.placeholder,required:Ge.isRequired??Ge.type==="email",className:`${c}-input`,style:Ce,"data-filled":ht||(xt[Ge.name]??"").trim().length>0})]})]},qe))}),r.jsx("div",{"data-controls":s?"gap":void 0,className:s?`${c}-control`:void 0,style:{height:y.scalingValue(T??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:y.scalingValue(L??0,t),borderWidth:Ae,paddingTop:y.scalingValue((R==null?void 0:R.top)??0,t),paddingRight:y.scalingValue((R==null?void 0:R.right)??0,t),paddingBottom:y.scalingValue((R==null?void 0:R.bottom)??0,t),paddingLeft:y.scalingValue((R==null?void 0:R.left)??0,t),pointerEvents:d?"auto":void 0,...pe,...E?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:E?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:mt==="submitting"?"...":b})})})]}),rt==="success"&&r.jsx("p",{className:`${c}-success`,style:{...We},children:Se}),rt==="error"&&r.jsx("p",{className:`${c}-error`,style:{...We},role:"alert",children:dt??Ue??O})]})}const kp={inputColor:"input-color",inputTextColor:"input-text-color",inputBorderColor:"input-border-color",placeholderColor:"placeholder-color",buttonColor:"button-color",buttonTextColor:"button-text-color",buttonBorderColor:"button-border-color",labelTextColor:"label-text-color",successColor:"success-color",errorColor:"error-color"},Mp=["hover","focus","filled","success","error"],Pp=`import React, { useMemo, useState } from 'react';
158
+ `}function Ep({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:l}){const s=!!n,d=i&&t||!t,{prefix:c}=y.useScopedStyles(),{type:u="A",fieldsToShow:m=2,fields:x=[],buttonLabel:b,gap:T,fieldsGap:f,buttonCorners:L,buttonStroke:$,buttonPadding:R,isButtonFullWidth:P,inputCorners:C,inputStroke:U,inputPadding:E,inputColor:j,inputTextColor:I,inputBorderColor:w,placeholderColor:W,buttonColor:h,buttonTextColor:S,buttonBorderColor:k,labelTextColor:z,successColor:K,errorColor:le,fontFamily:Y,inputFontSettings:D,inputFontSize:N,inputLineHeight:F,inputLetterSpacing:A,inputWordSpacing:q,inputTextAppearance:G,buttonFontSettings:Z,buttonFontSize:_,buttonLineHeight:me,buttonLetterSpacing:v,buttonWordSpacing:fe,buttonTextAppearance:J,labelFontSettings:de,labelFontSize:$e,labelLineHeight:oe,labelLetterSpacing:xe,labelWordSpacing:Q,labelTextAppearance:ye,statusFontSettings:ve,statusFontSize:ke,statusLineHeight:we,statusLetterSpacing:Me,statusWordSpacing:X,statusTextAppearance:ue,successMessage:Se,errorMessage:O,stateOverrides:ce}=e,H=u==="B",re=x.slice(0,Math.min(m,x.length)),ae={fontSettings:{fontFamily:Y,fontWeight:(D==null?void 0:D.fontWeight)??400,fontStyle:(D==null?void 0:D.fontStyle)??"normal"},fontSize:N??.01,lineHeight:F,letterSpacing:A??0,wordSpacing:q??0,textAppearance:G,color:I},ne=dn(Xt(ae,t)),ie=y.scalingValue(U??0,t),be=y.scalingValue((F??N??.01)+((E==null?void 0:E.top)??0)+((E==null?void 0:E.bottom)??0)+(u==="C"?U??0:(U??0)*2),t),Ce={...ne,borderStyle:"solid",borderRadius:u==="C"?0:y.scalingValue(C??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:ie,borderLeftWidth:0}:{borderWidth:ie},paddingTop:y.scalingValue((E==null?void 0:E.top)??0,t),paddingRight:y.scalingValue((E==null?void 0:E.right)??0,t),paddingBottom:y.scalingValue((E==null?void 0:E.bottom)??0,t),paddingLeft:y.scalingValue((E==null?void 0:E.left)??0,t),height:be,minHeight:be},ee={fontSettings:{fontFamily:Y,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:_??.01,lineHeight:me,letterSpacing:v??0,wordSpacing:fe??0,textAppearance:J,color:S},pe=dn(Xt(ee,t)),Ae=y.scalingValue($??0,t),se={fontSettings:{fontFamily:Y,fontWeight:(de==null?void 0:de.fontWeight)??400,fontStyle:(de==null?void 0:de.fontStyle)??"normal"},fontSize:$e??.01,lineHeight:oe,letterSpacing:xe??0,wordSpacing:Q??0,textAppearance:ye,color:z},V=Xt(se,t),je={fontSettings:{fontFamily:Y,fontWeight:(ve==null?void 0:ve.fontWeight)??400,fontStyle:(ve==null?void 0:ve.fontStyle)??"normal"},fontSize:ke??.01,lineHeight:we,letterSpacing:Me??0,wordSpacing:X??0,textAppearance:ue,color:K},We=dn(Xt(je,t)),et=y.buildColorVars(c,{inputColor:j,inputTextColor:I,inputBorderColor:w,placeholderColor:W!=null&&W.trim()?W:"#cccccc",buttonColor:h,buttonTextColor:S,buttonBorderColor:k,labelTextColor:z,successColor:K,errorColor:le},kp,Mp,ce),[Ye,st]=a.useState(()=>Object.fromEntries(re.map(Ge=>[Ge.name,""]))),[mt,De]=a.useState("idle"),[ot,$t]=a.useState(null),rt=l==="success"?"success":l==="error"?"error":mt,Ue=l==="error"?O:ot,ht=l==="filled",xt=a.useMemo(()=>{if(!ht)return Ye;let Ge=null;for(const qe of re)(Ye[qe.name]??"").trim().length>0||(Ge=Ge??{...Ye},Ge[qe.name]="Filled");return Ge??Ye},[Ye,ht,re]),dt=rt==="error"?y.getFormFieldValidationError(re,xt):null,_t=`${l&&l!=="default"?`${c}-state-${l}`:""}`.trim(),Qe=o==null?void 0:o.submitUrl,Tt=(Ge,qe)=>{st(Pe=>({...Pe,[Ge]:qe}))},Lt=async Ge=>{if(Ge.preventDefault(),!d)return;const qe=Object.fromEntries(re.map(gt=>{var It;return[gt.name,((It=Ye[gt.name])==null?void 0:It.trim())??""]}).filter(([,gt])=>gt));if(!Qe){De("error"),$t("No integrations were found for this form.");return}if(Object.keys(qe).length===0)return;const Pe=y.getFormFieldValidationError(re,Ye);if(Pe){De("error"),$t(Pe);return}De("submitting"),$t(null);try{const gt=await fetch(Qe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(!gt.ok){const It=await gt.text();throw new Error(It||`Request failed: ${gt.status}`)}De("success"),st(Object.fromEntries(re.map(It=>[It.name,""])))}catch(gt){De("error"),$t(gt instanceof Error?gt.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${_t}`.trim(),style:et,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Rp(c)}}),r.jsxs("form",{onSubmit:Lt,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:re.map((Ge,qe)=>r.jsxs(a.Fragment,{children:[qe>0&&r.jsx("div",{"data-controls":s?"fieldsGap":void 0,className:s?`${c}-control`:void 0,style:{height:y.scalingValue(f??0,t)}}),r.jsxs("div",{className:`${c}-field-group${H?` ${c}-labeled`:""}`,children:[H&&r.jsx("span",{className:`${c}-field-label`,style:V?{...V,lineHeight:V.fontSize}:void 0,children:Ge.label||Ge.name}),Ge.type==="textarea"?r.jsx("textarea",{name:Ge.name,autoComplete:"off",value:xt[Ge.name]??"",onChange:Pe=>Tt(Ge.name,Pe.target.value),placeholder:Ge.placeholder,className:`${c}-input`,style:Ce,rows:1,"data-filled":ht||(xt[Ge.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:Ge.type==="phone"?"tel":Ge.type==="email"?"email":"text",name:Ge.name,autoComplete:"off",value:xt[Ge.name]??"",onChange:Pe=>Tt(Ge.name,Pe.target.value),placeholder:Ge.placeholder,required:Ge.isRequired??Ge.type==="email",className:`${c}-input`,style:Ce,"data-filled":ht||(xt[Ge.name]??"").trim().length>0})]})]},qe))}),r.jsx("div",{"data-controls":s?"gap":void 0,className:s?`${c}-control`:void 0,style:{height:y.scalingValue(T??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:y.scalingValue(L??0,t),borderWidth:Ae,paddingTop:y.scalingValue((R==null?void 0:R.top)??0,t),paddingRight:y.scalingValue((R==null?void 0:R.right)??0,t),paddingBottom:y.scalingValue((R==null?void 0:R.bottom)??0,t),paddingLeft:y.scalingValue((R==null?void 0:R.left)??0,t),pointerEvents:d?"auto":void 0,...pe,...P?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:P?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:mt==="submitting"?"...":b})})})]}),rt==="success"&&r.jsx("p",{className:`${c}-success`,style:{...We},children:Se}),rt==="error"&&r.jsx("p",{className:`${c}-error`,style:{...We},role:"alert",children:dt??Ue??O})]})}const kp={inputColor:"input-color",inputTextColor:"input-text-color",inputBorderColor:"input-border-color",placeholderColor:"placeholder-color",buttonColor:"button-color",buttonTextColor:"button-text-color",buttonBorderColor:"button-border-color",labelTextColor:"label-text-color",successColor:"success-color",errorColor:"error-color"},Mp=["hover","focus","filled","success","error"],Pp=`import React, { useMemo, useState } from 'react';
159
159
  import { CommonComponentProps } from '../props';
160
160
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
161
161
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
@@ -980,7 +980,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
980
980
  font-size: ${Fo(14)};
981
981
  color: var(--${e}-error-error-color, var(--${e}-error-color));
982
982
  }
983
- `}const Hp=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:l}=y.useScopedStyles(),s=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:m=1,fontFamily:x,inputFontSettings:b,inputFontSize:T,inputLineHeight:f,inputLetterSpacing:L,inputWordSpacing:$,inputTextAppearance:R,buttonFontSettings:E,buttonFontSize:C,buttonLineHeight:U,buttonLetterSpacing:k,buttonWordSpacing:j,buttonTextAppearance:I,statusFontSettings:w,statusFontSize:W,statusLineHeight:h,statusLetterSpacing:S,statusWordSpacing:M,statusTextAppearance:z,iconMaxWidth:K,minHeight:le,corners:Y,stroke:D,stateOverrides:N,inputPadding:F,buttonPadding:A,successMessage:q="Thanks for subscribing!",errorMessage:G="Please, fill all required fields."}=e,Z=d.slice(0,Math.min(m,d.length)),[_,me]=a.useState(()=>Object.fromEntries(Z.map(se=>[se.name,""]))),[v,fe]=a.useState("idle"),[J,de]=a.useState(null),$e=o==="success"?"success":o==="error"?"error":v,oe=o==="error"?G:J,xe=o==="filled",Q=a.useMemo(()=>{if(!xe)return _;let se=null;for(const V of Z)(_[V.name]??"").trim().length>0||(se=se??{..._},se[V.name]="Filled");return se??_},[xe,_,Z]),ye=$e==="error"?y.getFormFieldValidationError(Z,Q):null,ve=o&&o!=="default"?`${l}-state-${o}`:"",ke=Z.some(se=>(Q[se.name]??"").trim().length>0),we=ve!==`${l}-state-filled`&&ke?`${l}-state-filled`:"",Me=`${ve} ${we}`.trim(),X=i==null?void 0:i.submitUrl,ue=u??"",Se=(c==null?void 0:c.icon)??"",O=(c==null?void 0:c.mode)==="On",ce=ue||"Submit",H={fontSettings:{fontFamily:x,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:T??.01,lineHeight:f,letterSpacing:L??0,wordSpacing:$??0,textAppearance:R,color:e.inputTextColor??"#111111"},re={fontSettings:{fontFamily:x,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:C??.01,lineHeight:U,letterSpacing:k??0,wordSpacing:j??0,textAppearance:I,color:e.buttonTextColor??"#ffffff"},ae={fontSettings:{fontFamily:x,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:W??.01,lineHeight:h,letterSpacing:S??0,wordSpacing:M??0,textAppearance:z,color:e.successColor??"#22c55e"},ne=dn(Xt(H,t)),ie=dn(Xt(re,t)),be=dn(Xt(ae,t)),Ce=y.buildColorVars(l,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(H==null?void 0:H.color)??"#111111",buttonTextColor:e.buttonTextColor??(re==null?void 0:re.color)??"#ffffff"},jp,Op,N),ee={borderRadius:y.scalingValue(Y,t),borderWidth:y.scalingValue(D,t),borderStyle:"solid"},pe={borderLeftWidth:y.scalingValue(D,t)},Ae=async se=>{if(se.preventDefault(),!s)return;const V=Object.fromEntries(Z.map(We=>{var et;return[We.name,((et=_[We.name])==null?void 0:et.trim())??""]}).filter(([,We])=>We));if(!X){fe("error"),de("No integrations were found for this form.");return}if(Object.keys(V).length===0)return;const je=y.getFormFieldValidationError(Z,_);if(je){fe("error"),de(je);return}fe("submitting"),de(null);try{const We=await fetch(X,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(V)});if(!We.ok){const et=await We.text();throw new Error(et||`Request failed: ${We.status}`)}fe("success"),me(Object.fromEntries(Z.map(et=>[et.name,""])))}catch(We){fe("error"),de(We instanceof Error?We.message:"Something went wrong")}};return r.jsxs("div",{className:`${l}-wrapper ${Me}`.trim(),style:Ce,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Np(l)}}),r.jsxs("form",{onSubmit:Ae,className:`${l}-form`,style:{...ee,height:y.scalingValue(le,t),minHeight:y.scalingValue(le,t)},children:[r.jsx("div",{className:`${l}-inputWrap ${l}-overlayAnchor`,style:{flex:1,minWidth:0},children:Z.map(se=>r.jsx("input",{type:se.type==="email"?"email":se.type==="phone"?"tel":"text",name:se.name,autoComplete:"off",value:Q[se.name]??"",onChange:V=>me(je=>({...je,[se.name]:V.target.value})),placeholder:se.placeholder,required:se.isRequired??se.type==="email",className:`${l}-input`,style:{...ne,paddingRight:y.scalingValue(F.right,t),paddingLeft:y.scalingValue(F.left,t),paddingTop:y.scalingValue(F.top,t),paddingBottom:y.scalingValue(F.bottom,t)}},se.name))}),r.jsx("div",{className:`${l}-overlayAnchor`,children:r.jsx("button",{type:s?"submit":"button",className:`${l}-submitBtn`,"aria-label":ce,style:{...ie,...pe,paddingRight:y.scalingValue(A.right,t),paddingLeft:y.scalingValue(A.left,t),paddingTop:y.scalingValue(A.top,t),paddingBottom:y.scalingValue(A.bottom,t),pointerEvents:s?"auto":void 0},children:v==="submitting"?"...":O?Se&&r.jsx(rn,{url:Se,className:`${l}-submitBtnIcon`,style:{maxWidth:y.scalingValue(K??0,t)},fill:`var(--${l}-button-text-color)`,hoverFill:`var(--${l}-button-text-color)`}):ue})})]}),$e==="success"&&r.jsx("p",{className:`${l}-success`,style:{...be},children:q}),$e==="error"&&r.jsx("p",{className:`${l}-error`,style:{...be},role:"alert",children:ye??oe??G})]})},jp={strokeColor:"stroke-color",inputColor:"input-color",placeholderColor:"placeholder-color",buttonColor:"button-color",inputTextColor:"input-text-color",buttonTextColor:"button-text-color",successColor:"success-color",errorColor:"error-color"},Op=["hover","focus","filled","success","error"],zp=`import React, { useMemo, useState } from 'react';
983
+ `}const Hp=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:l}=y.useScopedStyles(),s=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:m=1,fontFamily:x,inputFontSettings:b,inputFontSize:T,inputLineHeight:f,inputLetterSpacing:L,inputWordSpacing:$,inputTextAppearance:R,buttonFontSettings:P,buttonFontSize:C,buttonLineHeight:U,buttonLetterSpacing:E,buttonWordSpacing:j,buttonTextAppearance:I,statusFontSettings:w,statusFontSize:W,statusLineHeight:h,statusLetterSpacing:S,statusWordSpacing:k,statusTextAppearance:z,iconMaxWidth:K,minHeight:le,corners:Y,stroke:D,stateOverrides:N,inputPadding:F,buttonPadding:A,successMessage:q="Thanks for subscribing!",errorMessage:G="Please, fill all required fields."}=e,Z=d.slice(0,Math.min(m,d.length)),[_,me]=a.useState(()=>Object.fromEntries(Z.map(se=>[se.name,""]))),[v,fe]=a.useState("idle"),[J,de]=a.useState(null),$e=o==="success"?"success":o==="error"?"error":v,oe=o==="error"?G:J,xe=o==="filled",Q=a.useMemo(()=>{if(!xe)return _;let se=null;for(const V of Z)(_[V.name]??"").trim().length>0||(se=se??{..._},se[V.name]="Filled");return se??_},[xe,_,Z]),ye=$e==="error"?y.getFormFieldValidationError(Z,Q):null,ve=o&&o!=="default"?`${l}-state-${o}`:"",ke=Z.some(se=>(Q[se.name]??"").trim().length>0),we=ve!==`${l}-state-filled`&&ke?`${l}-state-filled`:"",Me=`${ve} ${we}`.trim(),X=i==null?void 0:i.submitUrl,ue=u??"",Se=(c==null?void 0:c.icon)??"",O=(c==null?void 0:c.mode)==="On",ce=ue||"Submit",H={fontSettings:{fontFamily:x,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:T??.01,lineHeight:f,letterSpacing:L??0,wordSpacing:$??0,textAppearance:R,color:e.inputTextColor??"#111111"},re={fontSettings:{fontFamily:x,fontWeight:(P==null?void 0:P.fontWeight)??400,fontStyle:(P==null?void 0:P.fontStyle)??"normal"},fontSize:C??.01,lineHeight:U,letterSpacing:E??0,wordSpacing:j??0,textAppearance:I,color:e.buttonTextColor??"#ffffff"},ae={fontSettings:{fontFamily:x,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:W??.01,lineHeight:h,letterSpacing:S??0,wordSpacing:k??0,textAppearance:z,color:e.successColor??"#22c55e"},ne=dn(Xt(H,t)),ie=dn(Xt(re,t)),be=dn(Xt(ae,t)),Ce=y.buildColorVars(l,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(H==null?void 0:H.color)??"#111111",buttonTextColor:e.buttonTextColor??(re==null?void 0:re.color)??"#ffffff"},jp,Op,N),ee={borderRadius:y.scalingValue(Y,t),borderWidth:y.scalingValue(D,t),borderStyle:"solid"},pe={borderLeftWidth:y.scalingValue(D,t)},Ae=async se=>{if(se.preventDefault(),!s)return;const V=Object.fromEntries(Z.map(We=>{var et;return[We.name,((et=_[We.name])==null?void 0:et.trim())??""]}).filter(([,We])=>We));if(!X){fe("error"),de("No integrations were found for this form.");return}if(Object.keys(V).length===0)return;const je=y.getFormFieldValidationError(Z,_);if(je){fe("error"),de(je);return}fe("submitting"),de(null);try{const We=await fetch(X,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(V)});if(!We.ok){const et=await We.text();throw new Error(et||`Request failed: ${We.status}`)}fe("success"),me(Object.fromEntries(Z.map(et=>[et.name,""])))}catch(We){fe("error"),de(We instanceof Error?We.message:"Something went wrong")}};return r.jsxs("div",{className:`${l}-wrapper ${Me}`.trim(),style:Ce,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Np(l)}}),r.jsxs("form",{onSubmit:Ae,className:`${l}-form`,style:{...ee,height:y.scalingValue(le,t),minHeight:y.scalingValue(le,t)},children:[r.jsx("div",{className:`${l}-inputWrap ${l}-overlayAnchor`,style:{flex:1,minWidth:0},children:Z.map(se=>r.jsx("input",{type:se.type==="email"?"email":se.type==="phone"?"tel":"text",name:se.name,autoComplete:"off",value:Q[se.name]??"",onChange:V=>me(je=>({...je,[se.name]:V.target.value})),placeholder:se.placeholder,required:se.isRequired??se.type==="email",className:`${l}-input`,style:{...ne,paddingRight:y.scalingValue(F.right,t),paddingLeft:y.scalingValue(F.left,t),paddingTop:y.scalingValue(F.top,t),paddingBottom:y.scalingValue(F.bottom,t)}},se.name))}),r.jsx("div",{className:`${l}-overlayAnchor`,children:r.jsx("button",{type:s?"submit":"button",className:`${l}-submitBtn`,"aria-label":ce,style:{...ie,...pe,paddingRight:y.scalingValue(A.right,t),paddingLeft:y.scalingValue(A.left,t),paddingTop:y.scalingValue(A.top,t),paddingBottom:y.scalingValue(A.bottom,t),pointerEvents:s?"auto":void 0},children:v==="submitting"?"...":O?Se&&r.jsx(rn,{url:Se,className:`${l}-submitBtnIcon`,style:{maxWidth:y.scalingValue(K??0,t)},fill:`var(--${l}-button-text-color)`,hoverFill:`var(--${l}-button-text-color)`}):ue})})]}),$e==="success"&&r.jsx("p",{className:`${l}-success`,style:{...be},children:q}),$e==="error"&&r.jsx("p",{className:`${l}-error`,style:{...be},role:"alert",children:ye??oe??G})]})},jp={strokeColor:"stroke-color",inputColor:"input-color",placeholderColor:"placeholder-color",buttonColor:"button-color",inputTextColor:"input-text-color",buttonTextColor:"button-text-color",successColor:"success-color",errorColor:"error-color"},Op=["hover","focus","filled","success","error"],zp=`import React, { useMemo, useState } from 'react';
984
984
  import { CommonComponentProps } from '../props';
985
985
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
986
986
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
1689
1689
  .${e}-image-hover-grayscale:hover video {
1690
1690
  filter: grayscale(100%);
1691
1691
  }
1692
- `}const Up=30,Xp=20,Hr=3,Yp=12,Zp=32,Jp=3,Qp=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},em=(e,t)=>Array.from({length:t},()=>e).flat(),tm=e=>typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"16:9",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"16:9",reversed:(e==null?void 0:e.reversed)??!1},Us=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),fl=(e,t)=>{if(t<=0||e.children.length<t)return 0;const n=e.children[0],i=e.children[t-1];if(!n||!i)return 0;const o=getComputedStyle(e),l=Number.parseFloat(o.columnGap||o.gap||"0")||0,s=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(s>0)return s;const d=Array.from({length:t},(u,m)=>e.children[m]),c=Us(d);return c<=0?0:c+l*Math.max(0,t-1)},nm=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Us(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),l=Number.parseFloat(o.columnGap||o.gap||"0")||0,s=Number.parseFloat(o.paddingRight)||0;return i+l*Math.max(0,e.children.length-1)+s},im=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},om=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>im(i,e))},rm=e=>{if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")},am=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,lm=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:l,imageHoverClass:s,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var M,z,K,le;const m=a.useRef(null),x=!!((M=e.image)!=null&&M.url&&rm(e.image));a.useLayoutEffect(()=>{d&&am(m.current)&&(u==null||u())},[d,(z=e.image)==null?void 0:z.url,u]);const b=n.display==="cover",T=n.ratioValue??"1:1",f=n.reversed??!1,[L,$]=T.split(":").map(Number),C=(f?$:L)/(f?L:$),U=i/C,k=U>o?o:U,j=U>o?o*C:i,I=c(j),w=c(k),W={borderRadius:c(l)},h=b?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...W}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...W},S=((K=e.image)==null?void 0:K.url)&&(x?r.jsx("video",{ref:Y=>{m.current=Y},src:e.image.url,style:h,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):r.jsx("img",{ref:Y=>{m.current=Y},src:e.image.url,alt:((le=e.image)==null?void 0:le.name)??"",style:h,onLoad:d?u:void 0,onError:d?u:void 0}));return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...b?{width:I}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:r.jsx("div",{className:s,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...b?{width:I,height:w,overflow:"hidden",...W}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:S&&e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:nt(`${t}-marquee-link`,!b&&`${t}-marquee-link-contain`),children:S}):S})})},sm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=y.useScopedStyles(),[s,d]=a.useState(0),c=s>0?Math.round(s):0,u=a.useMemo(()=>Kp(l,c),[l,c]),{speed:m,direction:x,pauseOnHover:b,gap:T,imageMaxWidth:f,imageMaxHeight:L,hoverEffect:$,cornerRadius:R=0}=e,E=a.useMemo(()=>tm(e.imageFit),[e.imageFit]),C=(t==null?void 0:t.length)??0,U=!!o,k=!n||!!i,j=k&&$!=="off"&&$!=="randomize"?`${l}-image-hover-${$}`:void 0,I=n?!!i:!0,W=((t==null?void 0:t.length)??0)>0&&(I||!!n),h=Math.max(0,m)*Up,S=we=>y.scalingValue(we,n??!1),M=a.useRef(null),z=a.useRef(null),K=a.useRef(null),[le,Y]=a.useState(0),D=I&&b==="on",[N,F]=a.useState(!1),[A,q]=a.useState({}),G=a.useRef(A);G.current=A;const Z=a.useRef(null),_=a.useRef(0),me=a.useRef(null),v=a.useMemo(()=>(t??[]).map(we=>{var Me;return((Me=we.image)==null?void 0:Me.url)??""}).join("\0"),[t]),[fe,J]=a.useState(Hr),de=a.useMemo(()=>{const we=t??[];return we.length===0||!(I||!!n)?we:em(we,fe)},[t,I,fe,n]),$e=a.useMemo(()=>(t??[]).filter(we=>{var Me;return!!((Me=we.image)!=null&&Me.url)}).length,[t]),oe=W?Jp:1;a.useLayoutEffect(()=>{_.current=0,q({}),Z.current=null,J(Hr),d(0)},[v]),a.useEffect(()=>{if(!k||$!=="randomize")return;const we=M.current;if(!we)return;const Me=O=>{q(ce=>{const H=Array.from(O).filter(ae=>ae in ce&&!om(we,ae));if(H.length===0)return ce;const re={...ce};return H.forEach(ae=>{delete re[ae]}),re})},X=new IntersectionObserver(O=>{const ce=new Set;for(const H of O){const re=H.target.dataset.marqueeItemIndex,ae=re!==void 0?Number(re):NaN;Number.isNaN(ae)||ce.add(ae)}ce.size>0&&Me(ce)},{root:we,threshold:0});Object.keys(A).forEach(O=>{const ce=Number(O);we.querySelectorAll(`[data-marquee-item-index="${ce}"]`).forEach(H=>X.observe(H))});const ue={current:0},Se=()=>{const O=Object.keys(G.current);O.length!==0&&(Me(O.map(Number)),ue.current=requestAnimationFrame(Se))};return Object.keys(G.current).length>0&&(ue.current=requestAnimationFrame(Se)),()=>{cancelAnimationFrame(ue.current),X.disconnect()}},[$,A,k]),a.useLayoutEffect(()=>{if(!W)return;const we=M.current,Me=K.current;if(!we||!Me)return;const X={current:0},ue=()=>{const ce=we.getBoundingClientRect().width||we.offsetWidth,H=nm(Me),re=Z.current,ae=typeof re=="number"&&Math.abs(re-H)<=.25;Z.current=H;let ne=fe,ie=0;if((I||n)&&C>0&&ce>0){const ee=fl(Me,C);if(ee>=Zp){ie=ee;const pe=Math.min(Yp,Math.max(Hr,Math.ceil(ce/ee)+1));ne=pe,pe!==fe&&J(pe)}}const Ce=ne!==fe&&ie>0?ie*ne:H>0?H:ie>0?ie*ne:(()=>{const ee=fl(Me,C);return ee>0?ee*ne:0})();Ce>0?d(ee=>ee<=0?Ce:!ae||Math.round(ee)===Math.round(Ce)?ee:Ce):!ae&&s<=0&&(cancelAnimationFrame(X.current),X.current=requestAnimationFrame(ue))},Se=()=>{cancelAnimationFrame(X.current),X.current=requestAnimationFrame(ue)};me.current=Se,Se();const O=new ResizeObserver(Se);return O.observe(we),O.observe(Me),()=>{me.current=null,cancelAnimationFrame(X.current),O.disconnect()}},[I,W,s,v,fe,C,n]),a.useLayoutEffect(()=>{if(!W||c<=0)return;const we=z.current;we&&Qp(we)},[W,c,x,h]),a.useLayoutEffect(()=>{if(!W||s<=0){Y(0);return}const we=z.current,Me=K.current;if(!we||!Me)return;const X=()=>{const Se=we.offsetHeight||we.getBoundingClientRect().height,O=Array.from(Me.children).reduce((H,re)=>Math.max(H,re.offsetHeight||re.getBoundingClientRect().height),0),ce=Se>0?Se:O;Y(ce>0?ce:0)};X();const ue=new ResizeObserver(X);return ue.observe(we),ue.observe(Me),()=>ue.disconnect()},[W,oe,de,n,T,f,L,s,E,A]),a.useLayoutEffect(()=>{if(!n||!U||!W||typeof window>"u")return;const we=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(we)},[n,U,W,x,s,le,T,de]);const xe=()=>{D&&F(!0)},Q=()=>{D&&F(!1)},ye=a.useCallback(()=>{var we;_.current=Math.min($e,_.current+1),(we=me.current)==null||we.call(me)},[$e]),ve=a.useCallback((we,Me)=>{q(X=>{const ue=X[we]??Me,Se=(t??[]).filter(ce=>ce!==ue);if(Se.length===0)return X;const O=Se[Math.floor(Math.random()*Se.length)];return{...X,[we]:O}})},[t]),ke=(we,Me,X,ue)=>{const Se=k&&$==="randomize"&&E.display==="cover"?A[X]??we:we,O=`max(${S(T)}, ${Xp}px)`,ce=`calc(-0.5 * (${O} + ${S(T)}))`;return r.jsxs("div",{className:`${l}-marquee-card`,"data-marquee-item-index":X,onMouseEnter:k&&$==="randomize"&&E.display==="cover"?()=>ve(X,we):void 0,children:[r.jsx(lm,{item:Se,prefix:l,imageFit:E,imageMaxWidth:f,imageMaxHeight:L,cornerRadius:R,imageHoverClass:j,isEditor:n,isFirstSet:ue,scaled:S,onFirstSetImageDone:ye}),U&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${l}-gap-control`,style:{position:"absolute",top:0,right:ce,width:O,height:"100%"}})]},`${Me}-${X}`)};if(W){const we=I?D&&N?"paused":"running":"paused",Me=c>0&&h>0?c/h*1e3:0,X=`${Math.max(0,Me)/1e3}s`;return r.jsxs("div",{ref:M,className:nt(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Marquee",style:le>0?{height:le}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{ref:z,className:`${l}-marquee-track`,"data-direction":x,onMouseEnter:xe,onMouseLeave:Q,style:{WebkitAnimationDuration:X,animationDuration:X,WebkitAnimationPlayState:we,animationPlayState:we},children:Array.from({length:oe},(ue,Se)=>r.jsx("div",{ref:Se===0?K:void 0,className:nt(`${l}-marquee-row`,`${l}-marquee-set`),style:{gap:S(T),paddingRight:S(T)},"aria-hidden":Se>0,children:de.map((O,ce)=>ke(O,Se,ce,Se===0&&ce<C))},`set-${Se}`))})]})}return r.jsxs("div",{ref:M,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{className:nt(`${l}-marquee-row`,`${l}-marquee-static`),style:{gap:S(T),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((we,Me)=>ke(we,0,Me))},"marquee-static")]})},cm=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1692
+ `}const Up=30,Xp=20,Hr=3,Yp=12,Zp=32,Jp=3,Qp=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},em=(e,t)=>Array.from({length:t},()=>e).flat(),tm=e=>typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"16:9",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"16:9",reversed:(e==null?void 0:e.reversed)??!1},Us=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),fl=(e,t)=>{if(t<=0||e.children.length<t)return 0;const n=e.children[0],i=e.children[t-1];if(!n||!i)return 0;const o=getComputedStyle(e),l=Number.parseFloat(o.columnGap||o.gap||"0")||0,s=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(s>0)return s;const d=Array.from({length:t},(u,m)=>e.children[m]),c=Us(d);return c<=0?0:c+l*Math.max(0,t-1)},nm=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Us(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),l=Number.parseFloat(o.columnGap||o.gap||"0")||0,s=Number.parseFloat(o.paddingRight)||0;return i+l*Math.max(0,e.children.length-1)+s},im=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},om=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>im(i,e))},rm=e=>{if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")},am=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,lm=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:l,imageHoverClass:s,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var k,z,K,le;const m=a.useRef(null),x=!!((k=e.image)!=null&&k.url&&rm(e.image));a.useLayoutEffect(()=>{d&&am(m.current)&&(u==null||u())},[d,(z=e.image)==null?void 0:z.url,u]);const b=n.display==="cover",T=n.ratioValue??"1:1",f=n.reversed??!1,[L,$]=T.split(":").map(Number),C=(f?$:L)/(f?L:$),U=i/C,E=U>o?o:U,j=U>o?o*C:i,I=c(j),w=c(E),W={borderRadius:c(l)},h=b?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...W}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...W},S=((K=e.image)==null?void 0:K.url)&&(x?r.jsx("video",{ref:Y=>{m.current=Y},src:e.image.url,style:h,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):r.jsx("img",{ref:Y=>{m.current=Y},src:e.image.url,alt:((le=e.image)==null?void 0:le.name)??"",style:h,onLoad:d?u:void 0,onError:d?u:void 0}));return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...b?{width:I}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:r.jsx("div",{className:s,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...b?{width:I,height:w,overflow:"hidden",...W}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:S&&e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:nt(`${t}-marquee-link`,!b&&`${t}-marquee-link-contain`),children:S}):S})})},sm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=y.useScopedStyles(),[s,d]=a.useState(0),c=s>0?Math.round(s):0,u=a.useMemo(()=>Kp(l,c),[l,c]),{speed:m,direction:x,pauseOnHover:b,gap:T,imageMaxWidth:f,imageMaxHeight:L,hoverEffect:$,cornerRadius:R=0}=e,P=a.useMemo(()=>tm(e.imageFit),[e.imageFit]),C=(t==null?void 0:t.length)??0,U=!!o,E=!n||!!i,j=E&&$!=="off"&&$!=="randomize"?`${l}-image-hover-${$}`:void 0,I=n?!!i:!0,W=((t==null?void 0:t.length)??0)>0&&(I||!!n),h=Math.max(0,m)*Up,S=we=>y.scalingValue(we,n??!1),k=a.useRef(null),z=a.useRef(null),K=a.useRef(null),[le,Y]=a.useState(0),D=I&&b==="on",[N,F]=a.useState(!1),[A,q]=a.useState({}),G=a.useRef(A);G.current=A;const Z=a.useRef(null),_=a.useRef(0),me=a.useRef(null),v=a.useMemo(()=>(t??[]).map(we=>{var Me;return((Me=we.image)==null?void 0:Me.url)??""}).join("\0"),[t]),[fe,J]=a.useState(Hr),de=a.useMemo(()=>{const we=t??[];return we.length===0||!(I||!!n)?we:em(we,fe)},[t,I,fe,n]),$e=a.useMemo(()=>(t??[]).filter(we=>{var Me;return!!((Me=we.image)!=null&&Me.url)}).length,[t]),oe=W?Jp:1;a.useLayoutEffect(()=>{_.current=0,q({}),Z.current=null,J(Hr),d(0)},[v]),a.useEffect(()=>{if(!E||$!=="randomize")return;const we=k.current;if(!we)return;const Me=O=>{q(ce=>{const H=Array.from(O).filter(ae=>ae in ce&&!om(we,ae));if(H.length===0)return ce;const re={...ce};return H.forEach(ae=>{delete re[ae]}),re})},X=new IntersectionObserver(O=>{const ce=new Set;for(const H of O){const re=H.target.dataset.marqueeItemIndex,ae=re!==void 0?Number(re):NaN;Number.isNaN(ae)||ce.add(ae)}ce.size>0&&Me(ce)},{root:we,threshold:0});Object.keys(A).forEach(O=>{const ce=Number(O);we.querySelectorAll(`[data-marquee-item-index="${ce}"]`).forEach(H=>X.observe(H))});const ue={current:0},Se=()=>{const O=Object.keys(G.current);O.length!==0&&(Me(O.map(Number)),ue.current=requestAnimationFrame(Se))};return Object.keys(G.current).length>0&&(ue.current=requestAnimationFrame(Se)),()=>{cancelAnimationFrame(ue.current),X.disconnect()}},[$,A,E]),a.useLayoutEffect(()=>{if(!W)return;const we=k.current,Me=K.current;if(!we||!Me)return;const X={current:0},ue=()=>{const ce=we.getBoundingClientRect().width||we.offsetWidth,H=nm(Me),re=Z.current,ae=typeof re=="number"&&Math.abs(re-H)<=.25;Z.current=H;let ne=fe,ie=0;if((I||n)&&C>0&&ce>0){const ee=fl(Me,C);if(ee>=Zp){ie=ee;const pe=Math.min(Yp,Math.max(Hr,Math.ceil(ce/ee)+1));ne=pe,pe!==fe&&J(pe)}}const Ce=ne!==fe&&ie>0?ie*ne:H>0?H:ie>0?ie*ne:(()=>{const ee=fl(Me,C);return ee>0?ee*ne:0})();Ce>0?d(ee=>ee<=0?Ce:!ae||Math.round(ee)===Math.round(Ce)?ee:Ce):!ae&&s<=0&&(cancelAnimationFrame(X.current),X.current=requestAnimationFrame(ue))},Se=()=>{cancelAnimationFrame(X.current),X.current=requestAnimationFrame(ue)};me.current=Se,Se();const O=new ResizeObserver(Se);return O.observe(we),O.observe(Me),()=>{me.current=null,cancelAnimationFrame(X.current),O.disconnect()}},[I,W,s,v,fe,C,n]),a.useLayoutEffect(()=>{if(!W||c<=0)return;const we=z.current;we&&Qp(we)},[W,c,x,h]),a.useLayoutEffect(()=>{if(!W||s<=0){Y(0);return}const we=z.current,Me=K.current;if(!we||!Me)return;const X=()=>{const Se=we.offsetHeight||we.getBoundingClientRect().height,O=Array.from(Me.children).reduce((H,re)=>Math.max(H,re.offsetHeight||re.getBoundingClientRect().height),0),ce=Se>0?Se:O;Y(ce>0?ce:0)};X();const ue=new ResizeObserver(X);return ue.observe(we),ue.observe(Me),()=>ue.disconnect()},[W,oe,de,n,T,f,L,s,P,A]),a.useLayoutEffect(()=>{if(!n||!U||!W||typeof window>"u")return;const we=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(we)},[n,U,W,x,s,le,T,de]);const xe=()=>{D&&F(!0)},Q=()=>{D&&F(!1)},ye=a.useCallback(()=>{var we;_.current=Math.min($e,_.current+1),(we=me.current)==null||we.call(me)},[$e]),ve=a.useCallback((we,Me)=>{q(X=>{const ue=X[we]??Me,Se=(t??[]).filter(ce=>ce!==ue);if(Se.length===0)return X;const O=Se[Math.floor(Math.random()*Se.length)];return{...X,[we]:O}})},[t]),ke=(we,Me,X,ue)=>{const Se=E&&$==="randomize"&&P.display==="cover"?A[X]??we:we,O=`max(${S(T)}, ${Xp}px)`,ce=`calc(-0.5 * (${O} + ${S(T)}))`;return r.jsxs("div",{className:`${l}-marquee-card`,"data-marquee-item-index":X,onMouseEnter:E&&$==="randomize"&&P.display==="cover"?()=>ve(X,we):void 0,children:[r.jsx(lm,{item:Se,prefix:l,imageFit:P,imageMaxWidth:f,imageMaxHeight:L,cornerRadius:R,imageHoverClass:j,isEditor:n,isFirstSet:ue,scaled:S,onFirstSetImageDone:ye}),U&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${l}-gap-control`,style:{position:"absolute",top:0,right:ce,width:O,height:"100%"}})]},`${Me}-${X}`)};if(W){const we=I?D&&N?"paused":"running":"paused",Me=c>0&&h>0?c/h*1e3:0,X=`${Math.max(0,Me)/1e3}s`;return r.jsxs("div",{ref:k,className:nt(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Marquee",style:le>0?{height:le}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{ref:z,className:`${l}-marquee-track`,"data-direction":x,onMouseEnter:xe,onMouseLeave:Q,style:{WebkitAnimationDuration:X,animationDuration:X,WebkitAnimationPlayState:we,animationPlayState:we},children:Array.from({length:oe},(ue,Se)=>r.jsx("div",{ref:Se===0?K:void 0,className:nt(`${l}-marquee-row`,`${l}-marquee-set`),style:{gap:S(T),paddingRight:S(T)},"aria-hidden":Se>0,children:de.map((O,ce)=>ke(O,Se,ce,Se===0&&ce<C))},`set-${Se}`))})]})}return r.jsxs("div",{ref:k,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{className:nt(`${l}-marquee-row`,`${l}-marquee-static`),style:{gap:S(T),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((we,Me)=>ke(we,0,Me))},"marquee-static")]})},cm=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1693
1693
  import cn from 'classnames';
1694
1694
  import { CommonComponentProps } from '../props';
1695
1695
  import { scalingValue } from '../utils/scalingValue';
@@ -2559,7 +2559,7 @@ type MarqueeProps = {
2559
2559
  pointer-events: auto;
2560
2560
  z-index: 10;
2561
2561
  }
2562
- `}const pm=30,vl=2,mm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=y.useScopedStyles(),{align:s,speed:d,direction:c,pauseOnHover:u,gap:m,cardWidth:x,corners:b,stroke:T,strokeColor:f,bgColor:L,padding:$,logoMarginTop:R,logoWidth:E,logoHeight:C,captionMarginTop:U}=e,k=!!o,j=((t==null?void 0:t.length)??0)>0,I=d>0&&(!n||i),w=j&&(I||n),W=Math.max(0,d)*pm,h=H=>y.scalingValue(H,n??!1),S=a.useRef(null),M=a.useRef(null),z=a.useRef(null),[K,le]=a.useState(0),[Y,D]=a.useState(0),[N,F]=a.useState(0),A=I&&u==="on",[q,G]=a.useState(!1),Z=a.useRef(null),[_,me]=a.useState(0),[v,fe]=a.useState(0),J=a.useRef(null),de=H=>{var ae,ne,ie,be,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${H}FontFamily`])??"Arial",fontWeight:((ae=e==null?void 0:e[`${H}FontSettings`])==null?void 0:ae.fontWeight)??400,fontStyle:((ne=e==null?void 0:e[`${H}FontSettings`])==null?void 0:ne.fontStyle)??"normal"},textAppearance:{textTransform:((ie=e==null?void 0:e[`${H}TextAppearance`])==null?void 0:ie.textTransform)??"none",textDecoration:((be=e==null?void 0:e[`${H}TextAppearance`])==null?void 0:be.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${H}TextAppearance`])==null?void 0:Ce.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${H}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${H}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${H}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${H}LineHeight`])??.01,color:(e==null?void 0:e[`${H}Color`])??"#000000"}},$e=de("text"),oe=de("caption"),xe=a.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(H=>{var re,ae;return(((re=H.text)==null?void 0:re.length)??0)>0||(((ae=H.caption)==null?void 0:ae.length)??0)>0}),[t]),Q=a.useMemo(()=>!w||(t==null?void 0:t.length)===0?1:Y<=0||K<=0?vl:Math.max(vl,Math.ceil(K/Y)+1),[w,t==null?void 0:t.length,Y,K]);a.useLayoutEffect(()=>{if(!w)return;const H=S.current,re=z.current;if(!H||!re)return;let ae=0;const ne=()=>{const Ce=H.getBoundingClientRect().width,ee=re.getBoundingClientRect().width,pe=J.current,Ae=typeof pe=="number"&&Math.abs(pe-ee)<=.25;if(J.current=ee,le(Ce),typeof ee=="number"&&ee>0&&Y<=0){D(ee);return}Ae&&ee!==Y?D(ee):!Ae&&Y<=0&&(cancelAnimationFrame(ae),ae=requestAnimationFrame(ne))},ie=()=>{cancelAnimationFrame(ae),ae=requestAnimationFrame(ne)};ie();const be=new ResizeObserver(ie);return be.observe(H),be.observe(re),()=>{cancelAnimationFrame(ae),be.disconnect()}},[I,w,Y]),a.useLayoutEffect(()=>{const H=M.current;if(!w||!H)return;const re=Y>0?Y:0,ae=re>0&&W>0?re/W*1e3:0,ne=`${Math.max(0,ae)/1e3}s`;H.style.setProperty("--marquee-distance",`${re}px`),H.style.setProperty("--marquee-duration",ne)},[I,w,W,Y]),a.useLayoutEffect(()=>{if(!w){F(0);return}const H=z.current,re=M.current;if(!H||!re)return;const ae=()=>{let ie=0;for(let be=0;be<H.children.length;be++){const ee=H.children[be].firstElementChild;ee&&(ie=Math.max(ie,ee.offsetHeight))}ie<=0&&(ie=re.offsetHeight),F(ie>0?ie:0)};ae();const ne=new ResizeObserver(ae);return ne.observe(H),ne.observe(re),()=>{ne.disconnect()}},[w,Q,t,n,m,x,$,T,b,E,C,_,v]);const ye=()=>{A&&G(!0)},ve=()=>{A&&G(!1)},ke=a.useMemo(()=>{switch(s){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[s]),we=a.useMemo(()=>{switch(s){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[s]),Me=a.useCallback((H,re,ae,ne)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ke,width:"100%"},children:[r.jsx("div",{"data-controls":k?ne==null?void 0:ne.controlsName:void 0,"data-controls-axis":k?"y":void 0,className:k?`${l}-control`:void 0,style:{height:h((ne==null?void 0:ne.marginTop)??0)}}),r.jsx("div",{...ne!=null&&ne.dataMeasureKind?{"data-testimonial-measure":ne.dataMeasureKind}:{},style:{...Xt(H,n),textAlign:we,pointerEvents:"auto",...typeof(ne==null?void 0:ne.minHeightPx)=="number"&&ne.minHeightPx>0?{minHeight:ne.minHeightPx}:{}},children:r.jsx(mi,{content:re})})]},ae),[ke,we,n,k,l,h]),X=a.useCallback((H,re,ae)=>{var ne,ie,be;return r.jsxs("div",{style:{padding:`${h($.top)} ${h($.right)} ${h($.bottom)} ${h($.left)}`,width:h(x+T*2),height:"100%",borderRadius:h(b),border:`${h(T)} solid ${f}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${l}-cover`,style:{background:L}}),r.jsxs("div",{className:`${l}-elements-overlay`,style:{alignItems:ke,textAlign:we},children:[H.text&&Me($e,H.text,"text",ae!=null&&ae.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ae==null?void 0:ae.textMinHeightPx)=="number"&&ae.textMinHeightPx>0?{minHeightPx:ae.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ke,width:"100%"},children:[r.jsx("div",{"data-controls":k&&!(ae!=null&&ae.dataMeasureAttrs)?"logoMarginTop":void 0,className:k&&!(ae!=null&&ae.dataMeasureAttrs)?`${l}-control`:void 0,style:{height:h(R)}}),r.jsx("div",{style:{width:h(E),height:h(C)},children:((ne=H.logo)==null?void 0:ne.url)&&r.jsx("img",{src:H.logo.url,alt:((ie=H.logo)==null?void 0:ie.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((be=H.logo)==null?void 0:be.objectFit)||"contain"}})})]}),H.caption&&Me(oe,H.caption,"caption",{...ae!=null&&ae.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:U,...ae!=null&&ae.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ae==null?void 0:ae.captionMinHeightPx)=="number"&&ae.captionMinHeightPx>0?{minHeightPx:ae.captionMinHeightPx}:{}})]})]},re)},[L,U,oe,x,b,C,R,E,ke,we,$.bottom,$.left,$.right,$.top,Me,T,f,$e,n,k,l]),ue=a.useCallback(H=>{me(H.maxTextPx),fe(H.maxCaptionPx)},[]);a.useLayoutEffect(()=>{if(!xe){ue({maxTextPx:0,maxCaptionPx:0});return}const H=Z.current;if(!H)return;const re=()=>{y.readTestimonialTextMeasure(H,ue)};re();const ae=new ResizeObserver(re);return ae.observe(H),()=>{ae.disconnect()}},[xe,ue,t,X]);const Se=xe?{textMinHeightPx:_,captionMinHeightPx:v}:void 0,O=xe?r.jsx("div",{ref:Z,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((H,re)=>X(H,`measure-${re}`,{dataMeasureAttrs:!0}))}):null,ce=(H,re)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[X(H,`card-${re}`,Se),k&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${h(m)})`,width:h(m),height:"100%",pointerEvents:"auto",zIndex:2}})]},re);if(w){const H=I?A&&q?"paused":"running":"paused";return r.jsxs("div",{ref:S,className:nt(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...N>0?{height:N}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:yl(l)}}),O,r.jsx("div",{ref:M,className:`${l}-marquee-track`,"data-direction":c,onMouseEnter:ye,onMouseLeave:ve,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px","--marquee-play-state":H},children:Array.from({length:Q},(re,ae)=>r.jsx("div",{ref:ae===0?z:void 0,className:`${l}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:h(m),paddingRight:h(m)},"aria-hidden":ae>0,children:t==null?void 0:t.map((ne,ie)=>ce(ne,`${ae}-${ie}`))},`set-${ae}`))})]})}return r.jsxs("div",{className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:yl(l)}}),O,r.jsx("div",{style:{gap:h(m),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((H,re)=>ce(H,re))})]})},gm=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
2562
+ `}const pm=30,vl=2,mm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=y.useScopedStyles(),{align:s,speed:d,direction:c,pauseOnHover:u,gap:m,cardWidth:x,corners:b,stroke:T,strokeColor:f,bgColor:L,padding:$,logoMarginTop:R,logoWidth:P,logoHeight:C,captionMarginTop:U}=e,E=!!o,j=((t==null?void 0:t.length)??0)>0,I=d>0&&(!n||i),w=j&&(I||n),W=Math.max(0,d)*pm,h=H=>y.scalingValue(H,n??!1),S=a.useRef(null),k=a.useRef(null),z=a.useRef(null),[K,le]=a.useState(0),[Y,D]=a.useState(0),[N,F]=a.useState(0),A=I&&u==="on",[q,G]=a.useState(!1),Z=a.useRef(null),[_,me]=a.useState(0),[v,fe]=a.useState(0),J=a.useRef(null),de=H=>{var ae,ne,ie,be,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${H}FontFamily`])??"Arial",fontWeight:((ae=e==null?void 0:e[`${H}FontSettings`])==null?void 0:ae.fontWeight)??400,fontStyle:((ne=e==null?void 0:e[`${H}FontSettings`])==null?void 0:ne.fontStyle)??"normal"},textAppearance:{textTransform:((ie=e==null?void 0:e[`${H}TextAppearance`])==null?void 0:ie.textTransform)??"none",textDecoration:((be=e==null?void 0:e[`${H}TextAppearance`])==null?void 0:be.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${H}TextAppearance`])==null?void 0:Ce.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${H}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${H}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${H}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${H}LineHeight`])??.01,color:(e==null?void 0:e[`${H}Color`])??"#000000"}},$e=de("text"),oe=de("caption"),xe=a.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(H=>{var re,ae;return(((re=H.text)==null?void 0:re.length)??0)>0||(((ae=H.caption)==null?void 0:ae.length)??0)>0}),[t]),Q=a.useMemo(()=>!w||(t==null?void 0:t.length)===0?1:Y<=0||K<=0?vl:Math.max(vl,Math.ceil(K/Y)+1),[w,t==null?void 0:t.length,Y,K]);a.useLayoutEffect(()=>{if(!w)return;const H=S.current,re=z.current;if(!H||!re)return;let ae=0;const ne=()=>{const Ce=H.getBoundingClientRect().width,ee=re.getBoundingClientRect().width,pe=J.current,Ae=typeof pe=="number"&&Math.abs(pe-ee)<=.25;if(J.current=ee,le(Ce),typeof ee=="number"&&ee>0&&Y<=0){D(ee);return}Ae&&ee!==Y?D(ee):!Ae&&Y<=0&&(cancelAnimationFrame(ae),ae=requestAnimationFrame(ne))},ie=()=>{cancelAnimationFrame(ae),ae=requestAnimationFrame(ne)};ie();const be=new ResizeObserver(ie);return be.observe(H),be.observe(re),()=>{cancelAnimationFrame(ae),be.disconnect()}},[I,w,Y]),a.useLayoutEffect(()=>{const H=k.current;if(!w||!H)return;const re=Y>0?Y:0,ae=re>0&&W>0?re/W*1e3:0,ne=`${Math.max(0,ae)/1e3}s`;H.style.setProperty("--marquee-distance",`${re}px`),H.style.setProperty("--marquee-duration",ne)},[I,w,W,Y]),a.useLayoutEffect(()=>{if(!w){F(0);return}const H=z.current,re=k.current;if(!H||!re)return;const ae=()=>{let ie=0;for(let be=0;be<H.children.length;be++){const ee=H.children[be].firstElementChild;ee&&(ie=Math.max(ie,ee.offsetHeight))}ie<=0&&(ie=re.offsetHeight),F(ie>0?ie:0)};ae();const ne=new ResizeObserver(ae);return ne.observe(H),ne.observe(re),()=>{ne.disconnect()}},[w,Q,t,n,m,x,$,T,b,P,C,_,v]);const ye=()=>{A&&G(!0)},ve=()=>{A&&G(!1)},ke=a.useMemo(()=>{switch(s){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[s]),we=a.useMemo(()=>{switch(s){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[s]),Me=a.useCallback((H,re,ae,ne)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ke,width:"100%"},children:[r.jsx("div",{"data-controls":E?ne==null?void 0:ne.controlsName:void 0,"data-controls-axis":E?"y":void 0,className:E?`${l}-control`:void 0,style:{height:h((ne==null?void 0:ne.marginTop)??0)}}),r.jsx("div",{...ne!=null&&ne.dataMeasureKind?{"data-testimonial-measure":ne.dataMeasureKind}:{},style:{...Xt(H,n),textAlign:we,pointerEvents:"auto",...typeof(ne==null?void 0:ne.minHeightPx)=="number"&&ne.minHeightPx>0?{minHeight:ne.minHeightPx}:{}},children:r.jsx(mi,{content:re})})]},ae),[ke,we,n,E,l,h]),X=a.useCallback((H,re,ae)=>{var ne,ie,be;return r.jsxs("div",{style:{padding:`${h($.top)} ${h($.right)} ${h($.bottom)} ${h($.left)}`,width:h(x+T*2),height:"100%",borderRadius:h(b),border:`${h(T)} solid ${f}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${l}-cover`,style:{background:L}}),r.jsxs("div",{className:`${l}-elements-overlay`,style:{alignItems:ke,textAlign:we},children:[H.text&&Me($e,H.text,"text",ae!=null&&ae.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ae==null?void 0:ae.textMinHeightPx)=="number"&&ae.textMinHeightPx>0?{minHeightPx:ae.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ke,width:"100%"},children:[r.jsx("div",{"data-controls":E&&!(ae!=null&&ae.dataMeasureAttrs)?"logoMarginTop":void 0,className:E&&!(ae!=null&&ae.dataMeasureAttrs)?`${l}-control`:void 0,style:{height:h(R)}}),r.jsx("div",{style:{width:h(P),height:h(C)},children:((ne=H.logo)==null?void 0:ne.url)&&r.jsx("img",{src:H.logo.url,alt:((ie=H.logo)==null?void 0:ie.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((be=H.logo)==null?void 0:be.objectFit)||"contain"}})})]}),H.caption&&Me(oe,H.caption,"caption",{...ae!=null&&ae.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:U,...ae!=null&&ae.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ae==null?void 0:ae.captionMinHeightPx)=="number"&&ae.captionMinHeightPx>0?{minHeightPx:ae.captionMinHeightPx}:{}})]})]},re)},[L,U,oe,x,b,C,R,P,ke,we,$.bottom,$.left,$.right,$.top,Me,T,f,$e,n,E,l]),ue=a.useCallback(H=>{me(H.maxTextPx),fe(H.maxCaptionPx)},[]);a.useLayoutEffect(()=>{if(!xe){ue({maxTextPx:0,maxCaptionPx:0});return}const H=Z.current;if(!H)return;const re=()=>{y.readTestimonialTextMeasure(H,ue)};re();const ae=new ResizeObserver(re);return ae.observe(H),()=>{ae.disconnect()}},[xe,ue,t,X]);const Se=xe?{textMinHeightPx:_,captionMinHeightPx:v}:void 0,O=xe?r.jsx("div",{ref:Z,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((H,re)=>X(H,`measure-${re}`,{dataMeasureAttrs:!0}))}):null,ce=(H,re)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[X(H,`card-${re}`,Se),E&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${h(m)})`,width:h(m),height:"100%",pointerEvents:"auto",zIndex:2}})]},re);if(w){const H=I?A&&q?"paused":"running":"paused";return r.jsxs("div",{ref:S,className:nt(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...N>0?{height:N}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:yl(l)}}),O,r.jsx("div",{ref:k,className:`${l}-marquee-track`,"data-direction":c,onMouseEnter:ye,onMouseLeave:ve,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px","--marquee-play-state":H},children:Array.from({length:Q},(re,ae)=>r.jsx("div",{ref:ae===0?z:void 0,className:`${l}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:h(m),paddingRight:h(m)},"aria-hidden":ae>0,children:t==null?void 0:t.map((ne,ie)=>ce(ne,`${ae}-${ie}`))},`set-${ae}`))})]})}return r.jsxs("div",{className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:yl(l)}}),O,r.jsx("div",{style:{gap:h(m),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((H,re)=>ce(H,re))})]})},gm=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
2563
2563
  import cn from 'classnames';
2564
2564
  import { CommonComponentProps } from '../props';
2565
2565
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -3298,7 +3298,7 @@ type TestimonialsSettings = {
3298
3298
  width: 100%;
3299
3299
  height: 100%;
3300
3300
  }
3301
- `}const vm=3e3,xm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=y.useScopedStyles(),s=t||[],{speed:d,align:c,width:u,imageMarginTop:m,textMarginTop:x,captionMarginTop:b,imageWidth:T,imageHeight:f,controlsWidth:L,controlsColor:$,controlsHoverColor:R}=e,E=d>0&&(!n||!!i),[C,U]=a.useState(0),[k,j]=a.useState(null),[I,w]=a.useState(!1),W=a.useRef(null),h=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),S=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);a.useEffect(()=>{U(0),j(null),w(!1)},[s.length]);const M=s[C],z=k===null?null:s[k],K=oe=>{var Q,ye,ve,ke,we;return{fontSettings:{fontFamily:(e==null?void 0:e[`${oe}FontFamily`])??"Arial",fontWeight:((Q=e==null?void 0:e[`${oe}FontSettings`])==null?void 0:Q.fontWeight)??400,fontStyle:((ye=e==null?void 0:e[`${oe}FontSettings`])==null?void 0:ye.fontStyle)??"normal"},textAppearance:{textTransform:((ve=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:ve.textTransform)??"none",textDecoration:((ke=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:ke.textDecoration)??"none",fontVariant:((we=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:we.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${oe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${oe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${oe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${oe}WordSpacing`])??0,color:(e==null?void 0:e[`${oe}Color`])??"#000000"}},le=K("text"),Y=K("caption"),D=s.length>1&&s.some(oe=>{var xe,Q;return(((xe=oe.text)==null?void 0:xe.length)??0)>0||(((Q=oe.caption)==null?void 0:Q.length)??0)>0}),N=a.useRef(null),[F,A]=a.useState(0),[q,G]=a.useState(0),Z=e.controls??{mode:"Off",icon:null},_=s.length>1,me=a.useCallback((oe,xe)=>!_||xe===oe?oe:(W.current&&window.clearTimeout(W.current),j(oe),w(!0),W.current=window.setTimeout(()=>{j(null),w(!1),W.current=null},300),xe),[_]),v=a.useCallback(()=>{_&&U(oe=>me(oe,(oe-1+s.length)%s.length))},[_,me,s.length]),fe=a.useCallback(()=>{_&&U(oe=>me(oe,(oe+1)%s.length))},[_,me,s.length]);a.useEffect(()=>{if(!E||!_)return;const oe=Math.max(300,vm/d),xe=window.setInterval(()=>{U(Q=>me(Q,(Q+1)%s.length))},oe);return()=>{window.clearInterval(xe)}},[E,_,me,s.length,d]),a.useEffect(()=>()=>{W.current&&window.clearTimeout(W.current)},[]);const J=(oe,xe)=>{var we,Me,X,ue;const Q=xe==null?void 0:xe.textMinHeightPx,ye=xe==null?void 0:xe.captionMinHeightPx,ve=xe==null?void 0:xe.dataMeasureAttrs,ke=o&&!(xe!=null&&xe.dataMeasureAttrs)&&!(xe!=null&&xe.hideControls);return r.jsxs(r.Fragment,{children:[oe.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:h,width:"100%"},children:[r.jsx("div",{"data-controls":ke?"textMarginTop":void 0,className:ke?`${l}-control`:void 0,style:{height:y.scalingValue(x??0,n??!1)}}),r.jsx("div",{...ve&&{"data-testimonial-measure":"text"},style:{...Xt(le,n),...Q&&Q>0?{minHeight:Q}:{},textAlign:S,pointerEvents:"auto"},children:r.jsx(mi,{content:oe.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:h,width:"100%"},children:[r.jsx("div",{"data-controls":ke?"imageMarginTop":void 0,className:ke?`${l}-control`:void 0,style:{height:y.scalingValue(m??0,n??!1)}}),r.jsx("div",{style:{width:y.scalingValue(T??0,n??!1),height:y.scalingValue(f??0,n??!1)},children:((we=oe.image)==null?void 0:we.url)&&r.jsx("img",{src:(Me=oe.image)==null?void 0:Me.url,alt:((X=oe.image)==null?void 0:X.name)??"",className:`${l}-icon`,style:{objectFit:((ue=oe.image)==null?void 0:ue.objectFit)||"contain"}})})]}),oe.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:h,width:"100%"},children:[r.jsx("div",{"data-controls":ke?"captionMarginTop":void 0,className:ke?`${l}-control`:void 0,style:{height:y.scalingValue(b??0,n??!1)}}),r.jsx("div",{...ve?{"data-testimonial-measure":"caption"}:{},style:{...Xt(Y,n),...ye&&ye>0?{minHeight:ye}:{},textAlign:S,pointerEvents:"auto"},children:r.jsx(mi,{content:oe.caption})})]})]})},de=a.useCallback(oe=>{A(oe.maxTextPx),G(oe.maxCaptionPx)},[]);if(a.useLayoutEffect(()=>{if(!D){de({maxTextPx:0,maxCaptionPx:0});return}const oe=N.current;if(!oe)return;const xe=()=>{y.readTestimonialTextMeasure(oe,de)};xe();const Q=new ResizeObserver(xe);return Q.observe(oe),()=>{Q.disconnect()}},[D,de,t]),!M)return r.jsx(r.Fragment,{});const $e=D?{textMinHeightPx:F,captionMinHeightPx:q}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${l}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ym(l)}}),r.jsxs("div",{className:`${l}-wrapper`,style:{width:y.scalingValue(u??0,n??!1),alignItems:h},children:[D&&r.jsx("div",{ref:N,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((oe,xe)=>r.jsx("div",{style:{width:"100%"},children:J(oe,{dataMeasureAttrs:!0})},xe))}),r.jsxs("div",{className:`${l}-fade-stack`,children:[z&&I&&r.jsx("div",{className:nt(`${l}-fade-item-prev`,`${l}-fade-out`),children:J(z,{...$e,hideControls:!0})}),r.jsx("div",{className:nt(`${l}-fade-item-current`,I?`${l}-fade-in`:void 0),children:J(M,$e)})]})]}),Z.mode==="On"&&r.jsxs("div",{className:`${l}-controls`,children:[r.jsx("div",{className:`${l}-arrow`,style:{width:y.scalingValue(L??.02,n??!1),height:y.scalingValue(L??.02,n??!1),"--arrow-hover-color":R},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:v,disabled:!_,"aria-label":"Previous testimonial",children:Z.icon&&r.jsx(rn,{url:Z.icon,fill:$,hoverFill:R,className:nt(`${l}-arrow-img`,`${l}-mirror`)})})}),r.jsx("div",{className:nt(`${l}-arrow`,`${l}-next-arrow`),style:{width:y.scalingValue(L??.02,n??!1),height:y.scalingValue(L??.02,n??!1),"--arrow-hover-color":R},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:fe,disabled:!_,"aria-label":"Next testimonial",children:Z.icon&&r.jsx(rn,{url:Z.icon,fill:$,hoverFill:R,className:`${l}-arrow-img`})})})]})]})})},bm=`import cn from 'classnames';
3301
+ `}const vm=3e3,xm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=y.useScopedStyles(),s=t||[],{speed:d,align:c,width:u,imageMarginTop:m,textMarginTop:x,captionMarginTop:b,imageWidth:T,imageHeight:f,controlsWidth:L,controlsColor:$,controlsHoverColor:R}=e,P=d>0&&(!n||!!i),[C,U]=a.useState(0),[E,j]=a.useState(null),[I,w]=a.useState(!1),W=a.useRef(null),h=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),S=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);a.useEffect(()=>{U(0),j(null),w(!1)},[s.length]);const k=s[C],z=E===null?null:s[E],K=oe=>{var Q,ye,ve,ke,we;return{fontSettings:{fontFamily:(e==null?void 0:e[`${oe}FontFamily`])??"Arial",fontWeight:((Q=e==null?void 0:e[`${oe}FontSettings`])==null?void 0:Q.fontWeight)??400,fontStyle:((ye=e==null?void 0:e[`${oe}FontSettings`])==null?void 0:ye.fontStyle)??"normal"},textAppearance:{textTransform:((ve=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:ve.textTransform)??"none",textDecoration:((ke=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:ke.textDecoration)??"none",fontVariant:((we=e==null?void 0:e[`${oe}TextAppearance`])==null?void 0:we.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${oe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${oe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${oe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${oe}WordSpacing`])??0,color:(e==null?void 0:e[`${oe}Color`])??"#000000"}},le=K("text"),Y=K("caption"),D=s.length>1&&s.some(oe=>{var xe,Q;return(((xe=oe.text)==null?void 0:xe.length)??0)>0||(((Q=oe.caption)==null?void 0:Q.length)??0)>0}),N=a.useRef(null),[F,A]=a.useState(0),[q,G]=a.useState(0),Z=e.controls??{mode:"Off",icon:null},_=s.length>1,me=a.useCallback((oe,xe)=>!_||xe===oe?oe:(W.current&&window.clearTimeout(W.current),j(oe),w(!0),W.current=window.setTimeout(()=>{j(null),w(!1),W.current=null},300),xe),[_]),v=a.useCallback(()=>{_&&U(oe=>me(oe,(oe-1+s.length)%s.length))},[_,me,s.length]),fe=a.useCallback(()=>{_&&U(oe=>me(oe,(oe+1)%s.length))},[_,me,s.length]);a.useEffect(()=>{if(!P||!_)return;const oe=Math.max(300,vm/d),xe=window.setInterval(()=>{U(Q=>me(Q,(Q+1)%s.length))},oe);return()=>{window.clearInterval(xe)}},[P,_,me,s.length,d]),a.useEffect(()=>()=>{W.current&&window.clearTimeout(W.current)},[]);const J=(oe,xe)=>{var we,Me,X,ue;const Q=xe==null?void 0:xe.textMinHeightPx,ye=xe==null?void 0:xe.captionMinHeightPx,ve=xe==null?void 0:xe.dataMeasureAttrs,ke=o&&!(xe!=null&&xe.dataMeasureAttrs)&&!(xe!=null&&xe.hideControls);return r.jsxs(r.Fragment,{children:[oe.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:h,width:"100%"},children:[r.jsx("div",{"data-controls":ke?"textMarginTop":void 0,className:ke?`${l}-control`:void 0,style:{height:y.scalingValue(x??0,n??!1)}}),r.jsx("div",{...ve&&{"data-testimonial-measure":"text"},style:{...Xt(le,n),...Q&&Q>0?{minHeight:Q}:{},textAlign:S,pointerEvents:"auto"},children:r.jsx(mi,{content:oe.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:h,width:"100%"},children:[r.jsx("div",{"data-controls":ke?"imageMarginTop":void 0,className:ke?`${l}-control`:void 0,style:{height:y.scalingValue(m??0,n??!1)}}),r.jsx("div",{style:{width:y.scalingValue(T??0,n??!1),height:y.scalingValue(f??0,n??!1)},children:((we=oe.image)==null?void 0:we.url)&&r.jsx("img",{src:(Me=oe.image)==null?void 0:Me.url,alt:((X=oe.image)==null?void 0:X.name)??"",className:`${l}-icon`,style:{objectFit:((ue=oe.image)==null?void 0:ue.objectFit)||"contain"}})})]}),oe.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:h,width:"100%"},children:[r.jsx("div",{"data-controls":ke?"captionMarginTop":void 0,className:ke?`${l}-control`:void 0,style:{height:y.scalingValue(b??0,n??!1)}}),r.jsx("div",{...ve?{"data-testimonial-measure":"caption"}:{},style:{...Xt(Y,n),...ye&&ye>0?{minHeight:ye}:{},textAlign:S,pointerEvents:"auto"},children:r.jsx(mi,{content:oe.caption})})]})]})},de=a.useCallback(oe=>{A(oe.maxTextPx),G(oe.maxCaptionPx)},[]);if(a.useLayoutEffect(()=>{if(!D){de({maxTextPx:0,maxCaptionPx:0});return}const oe=N.current;if(!oe)return;const xe=()=>{y.readTestimonialTextMeasure(oe,de)};xe();const Q=new ResizeObserver(xe);return Q.observe(oe),()=>{Q.disconnect()}},[D,de,t]),!k)return r.jsx(r.Fragment,{});const $e=D?{textMinHeightPx:F,captionMinHeightPx:q}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${l}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ym(l)}}),r.jsxs("div",{className:`${l}-wrapper`,style:{width:y.scalingValue(u??0,n??!1),alignItems:h},children:[D&&r.jsx("div",{ref:N,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((oe,xe)=>r.jsx("div",{style:{width:"100%"},children:J(oe,{dataMeasureAttrs:!0})},xe))}),r.jsxs("div",{className:`${l}-fade-stack`,children:[z&&I&&r.jsx("div",{className:nt(`${l}-fade-item-prev`,`${l}-fade-out`),children:J(z,{...$e,hideControls:!0})}),r.jsx("div",{className:nt(`${l}-fade-item-current`,I?`${l}-fade-in`:void 0),children:J(k,$e)})]})]}),Z.mode==="On"&&r.jsxs("div",{className:`${l}-controls`,children:[r.jsx("div",{className:`${l}-arrow`,style:{width:y.scalingValue(L??.02,n??!1),height:y.scalingValue(L??.02,n??!1),"--arrow-hover-color":R},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:v,disabled:!_,"aria-label":"Previous testimonial",children:Z.icon&&r.jsx(rn,{url:Z.icon,fill:$,hoverFill:R,className:nt(`${l}-arrow-img`,`${l}-mirror`)})})}),r.jsx("div",{className:nt(`${l}-arrow`,`${l}-next-arrow`),style:{width:y.scalingValue(L??.02,n??!1),height:y.scalingValue(L??.02,n??!1),"--arrow-hover-color":R},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:fe,disabled:!_,"aria-label":"Next testimonial",children:Z.icon&&r.jsx(rn,{url:Z.icon,fill:$,hoverFill:R,className:`${l}-arrow-img`})})})]})]})})},bm=`import cn from 'classnames';
3302
3302
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
3303
3303
  import { CommonComponentProps } from '../props';
3304
3304
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -4137,7 +4137,7 @@ type TestimonialsSettings = {
4137
4137
  z-index: 2;
4138
4138
  width: 100%;
4139
4139
  }
4140
- `}const Rn=500,Lm=750,ni="cubic-bezier(0.22, 1, 0.36, 1)",Im=72,Rm=50;function Em(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function km(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Mm(e){const[t]=e.media;return t!=null&&t.url?t:null}function Pm(e){return!Array.isArray(e)||e.length===0?[]:Em(e)?e.flatMap(t=>{const n=km(t);if(!n)return[];const i=Mm(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function to(e){return e.type==="video"}function Am(e){e.pause(),e.removeAttribute("src"),e.load()}function Sl({media:e,className:t,style:n,onMediaClick:i}){return to(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Wo(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Fm(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Wm({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:l,onMouseMove:s,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{Am(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:l,onMouseMove:s,onTransitionEnd:d,style:i})}function _m({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:l,onPrev:s,onNext:d,counterClassName:c,counterStyle:u}){const m=i==="cover",x=a.useRef(null),b=a.useRef(null),T=a.useRef(null),f=a.useRef(null),L=a.useRef(0),$=a.useRef(0),R=a.useRef("none"),E=a.useRef(!1),C=a.useRef(!1),U=a.useRef(!1),k=a.useRef(null),[j,I]=a.useState(null),[w,W]=a.useState("opening"),[h,S]=a.useState(0),[M,z]=a.useState(0),[K,le]=a.useState(!1),[Y,D]=a.useState(!1),[N,F]=a.useState(!1),A=a.useRef(n),q=t[n],G=q?to(q):!1,Z=M!==0||K,_=a.useCallback(X=>{U.current=X,le(X)},[]),me=a.useCallback(()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)},[]),v=a.useCallback(()=>{me(),k.current=window.setTimeout(()=>{me(),_(!1)},Rn+32)},[me,_]),fe=a.useCallback(()=>{const X=b.current,ue=T.current;if(!X)return;const Se=X.getBoundingClientRect(),O=Se.width,ce=Se.height;if(!O||!ce)return;if(i==="cover"){I({width:O,height:ce,left:Se.left,top:Se.top});return}if(!ue){I(Wo(X));return}const{width:H,height:re}=Fm(ue);if(!H||!re){I(Wo(X));return}const ae=H/re,ne=O/ce;if(ae>ne){const ie=O/ae;I({width:O,height:ie,left:Se.left,top:Se.top+(ce-ie)/2})}else{const ie=ce*ae;I({width:ie,height:ce,left:Se.left+(O-ie)/2,top:Se.top})}},[i]);a.useEffect(()=>{fe();const X=b.current;if(!X)return;const ue=new ResizeObserver(()=>fe());return ue.observe(X),()=>ue.disconnect()},[fe,n]),a.useEffect(()=>{w==="opening"&&j&&W("open")},[w,j]),a.useEffect(()=>{if(w!=="closing")return;const X=setTimeout(()=>l(),Rn);return()=>clearTimeout(X)},[w,l]),a.useEffect(()=>()=>{me()},[me]),a.useLayoutEffect(()=>{if(A.current===n)return;me(),S(0),z(0),_(!1),F(!1),D(!1),L.current=0,$.current=0,R.current="none",E.current=!1,f.current=null,C.current=!1;const X=b.current;X&&I(Wo(X)),A.current=n},[n,_,me]),a.useEffect(()=>{if(w!=="open")return;let X=null;const ue=()=>{X&&(document.removeEventListener("click",X,!0),X=null)},Se=()=>{ue(),X=ne=>{ne.stopPropagation(),ne.preventDefault(),ue()},document.addEventListener("click",X,!0)},O=ne=>{me(),U.current=!1,le(!1),z(0),D(!1),E.current=!1,$.current=0,R.current="none";const ie=b.current;ie&&I(Wo(ie)),ne<0?d():s()},ce=ne=>{if(Math.abs(ne)>Rm&&t.length>1){O(ne);return}_(!0),z(0),v()},H=ne=>{if(ne.touches.length!==1||U.current)return;const ie=ne.touches[0];C.current=!0,f.current={x:ie.clientX,y:ie.clientY},R.current="none",$.current=0,E.current=!1},re=ne=>{if(!f.current||ne.touches.length!==1||U.current)return;const ie=ne.touches[0],be=ie.clientX-f.current.x,Ce=ie.clientY-f.current.y;if(R.current==="none"){if(Math.abs(be)<10&&Math.abs(Ce)<10)return;if(Math.abs(be)>Math.abs(Ce)){if(t.length<=1)return;R.current="horizontal"}else if(Ce>0)R.current="vertical";else return}if(R.current==="horizontal"){E.current=!0,D(!0),$.current=be,z(be),ne.preventDefault();return}R.current==="vertical"&&(E.current=!0,D(!0),L.current=Ce,S(Ce),ne.preventDefault())},ae=()=>{if(!f.current)return;const ne=R.current,ie=E.current;if(ie&&ne==="horizontal")ce($.current),Se();else if(ie&&ne==="vertical")if(L.current>Im){const Ce=window.innerHeight;L.current=Ce,F(!0),S(Ce),W("closing")}else L.current=0,S(0),Se();else ne==="horizontal"&&Math.abs($.current)>0&&(ce($.current),Se());f.current=null,R.current="none",$.current=0,E.current=!1,D(!1)};return document.addEventListener("touchstart",H,{passive:!0}),document.addEventListener("touchmove",re,{passive:!1}),document.addEventListener("touchend",ae),document.addEventListener("touchcancel",ae),()=>{document.removeEventListener("touchstart",H),document.removeEventListener("touchmove",re),document.removeEventListener("touchend",ae),document.removeEventListener("touchcancel",ae),ue()}},[w,t.length,d,s,_,v]),a.useEffect(()=>{const X=ue=>{ue.key==="Escape"&&(ue.preventDefault(),ue.stopPropagation(),w!=="closing"&&W("closing"))};return window.addEventListener("keydown",X,!0),()=>window.removeEventListener("keydown",X,!0)},[w]);const J=()=>{w!=="closing"&&W("closing")},de=w==="open",$e=w==="closing",oe=h>0?Math.max(0,1-h/500):1,xe=h>0?Math.max(.35,1-h/500):1,Q=X=>{if(X.stopPropagation(),C.current){C.current=!1;return}if(t.length<=1)return;const ue=X.currentTarget.getBoundingClientRect(),Se=X.clientY-ue.top,O=Math.min(52,ue.height*.2);if(!(Se>ue.height-O)){if(X.clientX-ue.left<ue.width/2){s();return}d()}},ye=X=>{if(t.length<=1)return;const ue=X.currentTarget.getBoundingClientRect(),Se=X.clientX-ue.left,O=X.clientY-ue.top,ce=Math.min(52,ue.height*.2);if(O>ue.height-ce){X.currentTarget.style.cursor="default";return}X.currentTarget.style.cursor=Se<ue.width/2?"w-resize":"e-resize"},ve=a.useCallback(X=>{X.propertyName!=="transform"||!U.current||(me(),_(!1))},[me,_]),ke=Z?`translateX(${M}px)`:h>0?`translateY(${h}px)`:void 0,we={position:"fixed",top:j==null?void 0:j.top,left:j==null?void 0:j.left,width:j==null?void 0:j.width,height:j==null?void 0:j.height,objectFit:i==="cover"?"cover":"contain",transform:ke,opacity:h>0?xe:w==="opening"||$e?0:1,transition:Y&&!K?"none":K?`transform ${Rn}ms ${ni}`:N?`transform ${Rn}ms ${ni}, opacity ${Rn}ms ${ni}`:w==="opening"||$e?`opacity ${Rn}ms ${ni}`:"none",pointerEvents:G&&de&&!Z?"auto":"none",touchAction:G&&de?"none":void 0,zIndex:9998},Me=j?{position:"fixed",top:j.top,height:j.height,width:j.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:x,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:w==="open"?"none":void 0},onClick:J,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:de?oe:0,transition:Y?"none":`opacity ${Rn}ms ${ni}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:m?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:b,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:de?1:0,transition:`opacity ${Rn}ms ${ni}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:b,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:de?1:0,transition:`opacity ${Rn}ms ${ni}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),j&&q&&(G?r.jsx(Wm,{src:q.url,phase:w,mediaRef:T,mediaStyle:we,onLoadedMetadata:fe,onClick:Q,onMouseMove:ye,onTransitionEnd:ve},`${n}-${q.url}`):r.jsx("img",{ref:T,src:q.url,alt:q.name,onLoad:fe,onTransitionEnd:ve,style:we},`${n}-${q.url}`)),de&&Me&&t.length>1&&!G&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Me,left:j.left,cursor:"w-resize",pointerEvents:Z?"none":"auto"},onClick:X=>{if(C.current){C.current=!1;return}X.stopPropagation(),s()}}),r.jsx("div",{style:{...Me,left:j.left+j.width/2,cursor:"e-resize",pointerEvents:Z?"none":"auto"},onClick:X=>{if(C.current){C.current=!1;return}X.stopPropagation(),d()}})]})]})}function Nm(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Hm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:d,portalId:c}){const{prefix:u}=y.useScopedStyles(),{type:m="a",gridLayout:x,textBoxWidth:b=100,verticalGap:T,entriesCount:f,lightbox:L,imageDisplay:$,lightboxImageDisplay:R,slider:E,sliderTiming:C,direction:U,transition:k,titleMarginTop:j,subtitleMarginTop:I,titleColor:w,subtitleColor:W,lightboxCounterColor:h,titleFontFamily:S,titleFontSettings:M,titleFontSize:z,titleLineHeight:K,titleLetterSpacing:le,titleWordSpacing:Y,titleTextAppearance:D,subtitleFontFamily:N,subtitleFontSettings:F,subtitleFontSize:A,subtitleLineHeight:q,subtitleLetterSpacing:G,subtitleWordSpacing:Z,subtitleTextAppearance:_,lightboxCounterFontFamily:me,lightboxCounterFontSettings:v,lightboxCounterFontSize:fe,lightboxCounterLineHeight:J,lightboxCounterLetterSpacing:de,lightboxCounterWordSpacing:$e,lightboxCounterTextAppearance:oe,showText:xe="always",alignEntries:Q="off",align:ye="top"}=e,ve={fontSettings:{fontFamily:S,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:z??.01,lineHeight:K,letterSpacing:le??0,wordSpacing:Y??0,textAppearance:D,color:w},we={...dn(Xt(ve,n))},Me={fontSettings:{fontFamily:N,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:A??.01,lineHeight:q,letterSpacing:G??0,wordSpacing:Z??0,textAppearance:_,color:W},ue={...dn(Xt(Me,n))},Se={fontSettings:{fontFamily:me,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:fe??.01,lineHeight:J,letterSpacing:de??0,wordSpacing:$e??0,textAppearance:oe,color:h},ce={...dn(Xt(Se,n)),...Or(fe,J,u,n)},H=jr(z,K,`${u}-item-title`,`${u}-text-tight-leading`),re=jr(A,q,`${u}-item-subtitle`,`${u}-text-tight-leading`),ae=Or(z,K,u,n),ne=Or(A,q,u,n),ie=jr(fe,J,`${u}-lightbox-counter`,`${u}-text-tight-leading`),be=y.buildColorVars(u,{titleColor:w,subtitleColor:W,lightboxCounterColor:h},jm,Om),pe=`${s&&s!=="default"?`${u}-state-${s}`:""}${xe==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),Ae=f===0?1/0:f,se=(t??[]).slice(0,Ae),V=x.entryWidth??.2,je=($==null?void 0:$.display)==="cover",We=($==null?void 0:$.ratioValue)??"1:1",et=($==null?void 0:$.reversed)??!1,[Ye,st]=We.split(":").map(Number),ot=`${et?st:Ye} / ${et?Ye:st}`,$t=x.columnsCount,rt=y.scalingValue(V??0,n),Ue=rt,ht=!je&&E!=="off",xt=se.length%$t||$t,dt=xt<$t&&se.length>0,kt=se.length-xt,_t=dt?Math.floor(($t-xt)/2)+1:1,Qe={width:Ue,...je?{aspectRatio:ot,height:"auto",overflow:"hidden"}:{height:"auto"}},Tt=`${u}-item-image-wrapper${ht?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Lt=m==="d"||m==="e"||m==="f",Ge=Q==="on",qe=`calc(${y.scalingValue(V??0,n)} * (${b} / 100))`,Pe=y.scalingValue(V*b/100,n),gt=je?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[It,Mt]=a.useState("ltr"),[Dt,en]=a.useState(0),on=a.useRef(null);a.useEffect(()=>{const ze=on.current;if(!ze)return;const ut=new ResizeObserver(_e=>{en(Math.round(_e[0].contentRect.width))});return ut.observe(ze),()=>ut.disconnect()},[]);const bt=(()=>{const ze={...be},ut=on.current?getComputedStyle(on.current).getPropertyValue("--cntrl-article-width").trim():"";return ut&&(ze["--cntrl-article-width"]=ut),ze})(),[Rt,Ut]=a.useState(!1),[Kt,ft]=a.useState([]),[Jt,Te]=a.useState(0),Oe=L==="on"&&(!n||i),Ke=(ze,ut)=>{n&&!i||L!=="off"&&(ft(ze),Te(ut),Ut(!0))};a.useEffect(()=>{if(!Rt||L!=="on"||typeof document>"u")return;const ze=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ze}},[Rt,L]),a.useEffect(()=>{!n||i||Ut(!1)},[n,i]);const Ne=a.useMemo(()=>Tm(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ne}}),r.jsx("div",{style:be,children:r.jsx("div",{ref:on,className:`${u}-wrapper ${u}-type-${m}${Ge?` ${u}-align-entries`:""} ${u}-image-align-${ye} ${pe}`.trim(),style:{gridTemplateColumns:`repeat(${$t}, ${rt})`,rowGap:Ge?0:y.scalingValue(T??0,n),columnGap:y.scalingValue(x.horizontalGap??0,n),width:y.scalingValue(x.wrapperWidth??0,n),...Ge?{[`--${u}-align-entries-row-gap`]:y.scalingValue(T??0,n)}:{}},children:se.map((ze,ut)=>{var Gt;const _e=wl(ze.title),Je=wl(ze.subtitle),tt=(((Gt=ze.link)==null?void 0:Gt.length)??0)>0&&L==="off"?ze.link:void 0,Wt=Math.floor(ut/$t)===Math.ceil(se.length/$t)-1,Ct=dt&&ut>=kt?`${_t+(ut-kt)}`:void 0,lt=Lt?r.jsxs("div",{className:`${u}-item-text-block`,children:[_e&&r.jsx("p",{className:H,style:{width:qe,...we,...ae},children:ze.title}),_e&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:y.scalingValue(j??0,n),width:Pe}}),Je&&r.jsx("p",{className:re,style:{width:qe,...ue,...ne},children:ze.subtitle}),Je&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:y.scalingValue(I??0,n),width:Pe}})]}):null,Nt=Ge?r.jsxs("div",{className:`${u}-item-title-row`,children:[!Lt&&r.jsx("div",{"data-controls":o&&_e?"titleMarginTop":void 0,className:o&&_e?`${u}-control`:void 0,style:{height:_e?y.scalingValue(j??0,n):0,width:Pe}}),_e&&r.jsx("p",{className:H,style:{width:qe,...we,...ae},children:ze.title}),Lt&&_e&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:y.scalingValue(j??0,n),width:Pe}})]}):null,At=Ge?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Lt&&r.jsx("div",{"data-controls":o&&Je?"subtitleMarginTop":void 0,className:o&&Je?`${u}-control`:void 0,style:{height:Je?y.scalingValue(I??0,n):0,width:Pe}}),Je&&r.jsx("p",{className:re,style:{width:qe,...ue,...ne},children:ze.subtitle}),Lt&&Je&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:y.scalingValue(I??0,n),width:Pe}})]}):null,Vt=tt?r.jsxs("a",{href:tt,target:"_blank",className:`${u}-item-text-link`,children:[Nt,At]}):r.jsxs(r.Fragment,{children:[Nt,At]}),zt=Pm(ze.gallery),Pt=zt.filter(pt=>pt.lightboxMedia).map(pt=>pt.lightboxMedia),Qt=r.jsx("div",{className:Tt,style:Qe,children:zt.length===0?null:E==="off"?(()=>{const{displayMedia:pt,lightboxMedia:Ft}=zt[0],Bt=Ft?Pt.findIndex(g=>g.url===Ft.url):-1;return r.jsx(Sl,{media:pt,className:`${u}-item-${to(pt)?"video":"image"}`.trim(),style:gt,onMediaClick:Oe&&Bt>=0?()=>Ke(Pt,Bt):void 0})})():r.jsxs(r.Fragment,{children:[ht&&Ge&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:zt.map(({displayMedia:pt})=>to(pt)?r.jsx("video",{src:pt.url,muted:!0,playsInline:!0},`sizer-${pt.url}`):r.jsx("img",{src:pt.url,alt:""},`sizer-${pt.url}`))}),r.jsx(br,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:C*1e3,width:"100%",height:"100%",speed:Lm,type:k==="fade"?"fade":"loop",rewind:k==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:k==="fade"?"ltr":U!=="random"?U==="horizontal"?"ltr":"ttb":It},onMoved:pt=>{if(U!=="random"||k==="fade")return;const Ft=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Mt(Ft),setTimeout(()=>{pt.refresh()},0)},children:zt.map(({displayMedia:pt,lightboxMedia:Ft},Bt)=>{const g=Ft?Pt.findIndex(ge=>ge.url===Ft.url):-1;return r.jsx(wr,{children:r.jsx(Sl,{media:pt,className:`${u}-item-${to(pt)?"video":"image"}`.trim(),style:gt,onMediaClick:Oe&&g>=0?()=>Ke(Pt,g):void 0})},Bt)})},`${k}-${V}-${U}-${C}-${Dt}-${d}`)]})}),wt=Lt?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&_e?"titleMarginTop":void 0,className:o&&_e?`${u}-control`:void 0,style:{height:_e?y.scalingValue(j??0,n):0,width:Pe}}),r.jsx("p",{className:H,style:{width:qe,...we,...ae},children:ze.title}),r.jsx("div",{"data-controls":o&&Je?"subtitleMarginTop":void 0,className:o&&Je?`${u}-control`:void 0,style:{height:Je?y.scalingValue(I??0,n):0,width:Pe}}),r.jsx("p",{className:re,style:{width:qe,...ue,...ne},children:ze.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Ct&&!Ge?{gridColumn:Ct}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Ge&&Wt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(b??0)>100?`calc(${rt} * (${b} / 100))`:rt,...Ct&&Ge?{gridColumn:Ct}:{}},children:Ge?r.jsx(r.Fragment,{children:Lt?r.jsxs(r.Fragment,{children:[Vt,r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:Qt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:Qt}),Vt]})}):tt?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:[lt,Qt]}),!Lt&&r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-text-link`,children:wt})]}):r.jsxs(r.Fragment,{children:[lt,Qt,wt]})})},ut)})})}),(!n||i)&&Rt&&typeof document<"u"&&L==="on"&&(()=>{const ze=(c?document.getElementById(c):null)??document.body;return gi.createPortal(r.jsx("div",{style:bt,"data-selection":"none",children:r.jsx(_m,{prefix:u,items:Kt,index:Jt,imageDisplay:Nm(R),isEditor:n,onClose:()=>Ut(!1),onPrev:()=>Te(ut=>(ut-1+Kt.length)%Kt.length),onNext:()=>Te(ut=>(ut+1)%Kt.length),counterClassName:ie,counterStyle:ce})}),ze)})()]})}const jm={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Om=["hover","focus","filled","success","error"],zm=`import { Splide, SplideSlide } from '@splidejs/react-splide';
4140
+ `}const Rn=500,Lm=750,ni="cubic-bezier(0.22, 1, 0.36, 1)",Im=72,Rm=50;function Em(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function km(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Mm(e){const[t]=e.media;return t!=null&&t.url?t:null}function Pm(e){return!Array.isArray(e)||e.length===0?[]:Em(e)?e.flatMap(t=>{const n=km(t);if(!n)return[];const i=Mm(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function to(e){return e.type==="video"}function Am(e){e.pause(),e.removeAttribute("src"),e.load()}function Sl({media:e,className:t,style:n,onMediaClick:i}){return to(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Wo(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Fm(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Wm({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:l,onMouseMove:s,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{Am(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:l,onMouseMove:s,onTransitionEnd:d,style:i})}function _m({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:l,onPrev:s,onNext:d,counterClassName:c,counterStyle:u}){const m=i==="cover",x=a.useRef(null),b=a.useRef(null),T=a.useRef(null),f=a.useRef(null),L=a.useRef(0),$=a.useRef(0),R=a.useRef("none"),P=a.useRef(!1),C=a.useRef(!1),U=a.useRef(!1),E=a.useRef(null),[j,I]=a.useState(null),[w,W]=a.useState("opening"),[h,S]=a.useState(0),[k,z]=a.useState(0),[K,le]=a.useState(!1),[Y,D]=a.useState(!1),[N,F]=a.useState(!1),A=a.useRef(n),q=t[n],G=q?to(q):!1,Z=k!==0||K,_=a.useCallback(X=>{U.current=X,le(X)},[]),me=a.useCallback(()=>{E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),v=a.useCallback(()=>{me(),E.current=window.setTimeout(()=>{me(),_(!1)},Rn+32)},[me,_]),fe=a.useCallback(()=>{const X=b.current,ue=T.current;if(!X)return;const Se=X.getBoundingClientRect(),O=Se.width,ce=Se.height;if(!O||!ce)return;if(i==="cover"){I({width:O,height:ce,left:Se.left,top:Se.top});return}if(!ue){I(Wo(X));return}const{width:H,height:re}=Fm(ue);if(!H||!re){I(Wo(X));return}const ae=H/re,ne=O/ce;if(ae>ne){const ie=O/ae;I({width:O,height:ie,left:Se.left,top:Se.top+(ce-ie)/2})}else{const ie=ce*ae;I({width:ie,height:ce,left:Se.left+(O-ie)/2,top:Se.top})}},[i]);a.useEffect(()=>{fe();const X=b.current;if(!X)return;const ue=new ResizeObserver(()=>fe());return ue.observe(X),()=>ue.disconnect()},[fe,n]),a.useEffect(()=>{w==="opening"&&j&&W("open")},[w,j]),a.useEffect(()=>{if(w!=="closing")return;const X=setTimeout(()=>l(),Rn);return()=>clearTimeout(X)},[w,l]),a.useEffect(()=>()=>{me()},[me]),a.useLayoutEffect(()=>{if(A.current===n)return;me(),S(0),z(0),_(!1),F(!1),D(!1),L.current=0,$.current=0,R.current="none",P.current=!1,f.current=null,C.current=!1;const X=b.current;X&&I(Wo(X)),A.current=n},[n,_,me]),a.useEffect(()=>{if(w!=="open")return;let X=null;const ue=()=>{X&&(document.removeEventListener("click",X,!0),X=null)},Se=()=>{ue(),X=ne=>{ne.stopPropagation(),ne.preventDefault(),ue()},document.addEventListener("click",X,!0)},O=ne=>{me(),U.current=!1,le(!1),z(0),D(!1),P.current=!1,$.current=0,R.current="none";const ie=b.current;ie&&I(Wo(ie)),ne<0?d():s()},ce=ne=>{if(Math.abs(ne)>Rm&&t.length>1){O(ne);return}_(!0),z(0),v()},H=ne=>{if(ne.touches.length!==1||U.current)return;const ie=ne.touches[0];C.current=!0,f.current={x:ie.clientX,y:ie.clientY},R.current="none",$.current=0,P.current=!1},re=ne=>{if(!f.current||ne.touches.length!==1||U.current)return;const ie=ne.touches[0],be=ie.clientX-f.current.x,Ce=ie.clientY-f.current.y;if(R.current==="none"){if(Math.abs(be)<10&&Math.abs(Ce)<10)return;if(Math.abs(be)>Math.abs(Ce)){if(t.length<=1)return;R.current="horizontal"}else if(Ce>0)R.current="vertical";else return}if(R.current==="horizontal"){P.current=!0,D(!0),$.current=be,z(be),ne.preventDefault();return}R.current==="vertical"&&(P.current=!0,D(!0),L.current=Ce,S(Ce),ne.preventDefault())},ae=()=>{if(!f.current)return;const ne=R.current,ie=P.current;if(ie&&ne==="horizontal")ce($.current),Se();else if(ie&&ne==="vertical")if(L.current>Im){const Ce=window.innerHeight;L.current=Ce,F(!0),S(Ce),W("closing")}else L.current=0,S(0),Se();else ne==="horizontal"&&Math.abs($.current)>0&&(ce($.current),Se());f.current=null,R.current="none",$.current=0,P.current=!1,D(!1)};return document.addEventListener("touchstart",H,{passive:!0}),document.addEventListener("touchmove",re,{passive:!1}),document.addEventListener("touchend",ae),document.addEventListener("touchcancel",ae),()=>{document.removeEventListener("touchstart",H),document.removeEventListener("touchmove",re),document.removeEventListener("touchend",ae),document.removeEventListener("touchcancel",ae),ue()}},[w,t.length,d,s,_,v]),a.useEffect(()=>{const X=ue=>{ue.key==="Escape"&&(ue.preventDefault(),ue.stopPropagation(),w!=="closing"&&W("closing"))};return window.addEventListener("keydown",X,!0),()=>window.removeEventListener("keydown",X,!0)},[w]);const J=()=>{w!=="closing"&&W("closing")},de=w==="open",$e=w==="closing",oe=h>0?Math.max(0,1-h/500):1,xe=h>0?Math.max(.35,1-h/500):1,Q=X=>{if(X.stopPropagation(),C.current){C.current=!1;return}if(t.length<=1)return;const ue=X.currentTarget.getBoundingClientRect(),Se=X.clientY-ue.top,O=Math.min(52,ue.height*.2);if(!(Se>ue.height-O)){if(X.clientX-ue.left<ue.width/2){s();return}d()}},ye=X=>{if(t.length<=1)return;const ue=X.currentTarget.getBoundingClientRect(),Se=X.clientX-ue.left,O=X.clientY-ue.top,ce=Math.min(52,ue.height*.2);if(O>ue.height-ce){X.currentTarget.style.cursor="default";return}X.currentTarget.style.cursor=Se<ue.width/2?"w-resize":"e-resize"},ve=a.useCallback(X=>{X.propertyName!=="transform"||!U.current||(me(),_(!1))},[me,_]),ke=Z?`translateX(${k}px)`:h>0?`translateY(${h}px)`:void 0,we={position:"fixed",top:j==null?void 0:j.top,left:j==null?void 0:j.left,width:j==null?void 0:j.width,height:j==null?void 0:j.height,objectFit:i==="cover"?"cover":"contain",transform:ke,opacity:h>0?xe:w==="opening"||$e?0:1,transition:Y&&!K?"none":K?`transform ${Rn}ms ${ni}`:N?`transform ${Rn}ms ${ni}, opacity ${Rn}ms ${ni}`:w==="opening"||$e?`opacity ${Rn}ms ${ni}`:"none",pointerEvents:G&&de&&!Z?"auto":"none",touchAction:G&&de?"none":void 0,zIndex:9998},Me=j?{position:"fixed",top:j.top,height:j.height,width:j.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:x,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:w==="open"?"none":void 0},onClick:J,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:de?oe:0,transition:Y?"none":`opacity ${Rn}ms ${ni}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:m?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:b,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:de?1:0,transition:`opacity ${Rn}ms ${ni}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:b,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:de?1:0,transition:`opacity ${Rn}ms ${ni}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),j&&q&&(G?r.jsx(Wm,{src:q.url,phase:w,mediaRef:T,mediaStyle:we,onLoadedMetadata:fe,onClick:Q,onMouseMove:ye,onTransitionEnd:ve},`${n}-${q.url}`):r.jsx("img",{ref:T,src:q.url,alt:q.name,onLoad:fe,onTransitionEnd:ve,style:we},`${n}-${q.url}`)),de&&Me&&t.length>1&&!G&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Me,left:j.left,cursor:"w-resize",pointerEvents:Z?"none":"auto"},onClick:X=>{if(C.current){C.current=!1;return}X.stopPropagation(),s()}}),r.jsx("div",{style:{...Me,left:j.left+j.width/2,cursor:"e-resize",pointerEvents:Z?"none":"auto"},onClick:X=>{if(C.current){C.current=!1;return}X.stopPropagation(),d()}})]})]})}function Nm(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Hm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:d,portalId:c}){const{prefix:u}=y.useScopedStyles(),{type:m="a",gridLayout:x,textBoxWidth:b=100,verticalGap:T,entriesCount:f,lightbox:L,imageDisplay:$,lightboxImageDisplay:R,slider:P,sliderTiming:C,direction:U,transition:E,titleMarginTop:j,subtitleMarginTop:I,titleColor:w,subtitleColor:W,lightboxCounterColor:h,titleFontFamily:S,titleFontSettings:k,titleFontSize:z,titleLineHeight:K,titleLetterSpacing:le,titleWordSpacing:Y,titleTextAppearance:D,subtitleFontFamily:N,subtitleFontSettings:F,subtitleFontSize:A,subtitleLineHeight:q,subtitleLetterSpacing:G,subtitleWordSpacing:Z,subtitleTextAppearance:_,lightboxCounterFontFamily:me,lightboxCounterFontSettings:v,lightboxCounterFontSize:fe,lightboxCounterLineHeight:J,lightboxCounterLetterSpacing:de,lightboxCounterWordSpacing:$e,lightboxCounterTextAppearance:oe,showText:xe="always",alignEntries:Q="off",align:ye="top"}=e,ve={fontSettings:{fontFamily:S,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:z??.01,lineHeight:K,letterSpacing:le??0,wordSpacing:Y??0,textAppearance:D,color:w},we={...dn(Xt(ve,n))},Me={fontSettings:{fontFamily:N,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:A??.01,lineHeight:q,letterSpacing:G??0,wordSpacing:Z??0,textAppearance:_,color:W},ue={...dn(Xt(Me,n))},Se={fontSettings:{fontFamily:me,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:fe??.01,lineHeight:J,letterSpacing:de??0,wordSpacing:$e??0,textAppearance:oe,color:h},ce={...dn(Xt(Se,n)),...Or(fe,J,u,n)},H=jr(z,K,`${u}-item-title`,`${u}-text-tight-leading`),re=jr(A,q,`${u}-item-subtitle`,`${u}-text-tight-leading`),ae=Or(z,K,u,n),ne=Or(A,q,u,n),ie=jr(fe,J,`${u}-lightbox-counter`,`${u}-text-tight-leading`),be=y.buildColorVars(u,{titleColor:w,subtitleColor:W,lightboxCounterColor:h},jm,Om),pe=`${s&&s!=="default"?`${u}-state-${s}`:""}${xe==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),Ae=f===0?1/0:f,se=(t??[]).slice(0,Ae),V=x.entryWidth??.2,je=($==null?void 0:$.display)==="cover",We=($==null?void 0:$.ratioValue)??"1:1",et=($==null?void 0:$.reversed)??!1,[Ye,st]=We.split(":").map(Number),ot=`${et?st:Ye} / ${et?Ye:st}`,$t=x.columnsCount,rt=y.scalingValue(V??0,n),Ue=rt,ht=!je&&P!=="off",xt=se.length%$t||$t,dt=xt<$t&&se.length>0,kt=se.length-xt,_t=dt?Math.floor(($t-xt)/2)+1:1,Qe={width:Ue,...je?{aspectRatio:ot,height:"auto",overflow:"hidden"}:{height:"auto"}},Tt=`${u}-item-image-wrapper${ht?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Lt=m==="d"||m==="e"||m==="f",Ge=Q==="on",qe=`calc(${y.scalingValue(V??0,n)} * (${b} / 100))`,Pe=y.scalingValue(V*b/100,n),gt=je?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[It,Mt]=a.useState("ltr"),[Dt,en]=a.useState(0),on=a.useRef(null);a.useEffect(()=>{const ze=on.current;if(!ze)return;const ut=new ResizeObserver(_e=>{en(Math.round(_e[0].contentRect.width))});return ut.observe(ze),()=>ut.disconnect()},[]);const bt=(()=>{const ze={...be},ut=on.current?getComputedStyle(on.current).getPropertyValue("--cntrl-article-width").trim():"";return ut&&(ze["--cntrl-article-width"]=ut),ze})(),[Rt,Ut]=a.useState(!1),[Kt,ft]=a.useState([]),[Jt,Te]=a.useState(0),Oe=L==="on"&&(!n||i),Ke=(ze,ut)=>{n&&!i||L!=="off"&&(ft(ze),Te(ut),Ut(!0))};a.useEffect(()=>{if(!Rt||L!=="on"||typeof document>"u")return;const ze=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ze}},[Rt,L]),a.useEffect(()=>{!n||i||Ut(!1)},[n,i]);const Ne=a.useMemo(()=>Tm(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ne}}),r.jsx("div",{style:be,children:r.jsx("div",{ref:on,className:`${u}-wrapper ${u}-type-${m}${Ge?` ${u}-align-entries`:""} ${u}-image-align-${ye} ${pe}`.trim(),style:{gridTemplateColumns:`repeat(${$t}, ${rt})`,rowGap:Ge?0:y.scalingValue(T??0,n),columnGap:y.scalingValue(x.horizontalGap??0,n),width:y.scalingValue(x.wrapperWidth??0,n),...Ge?{[`--${u}-align-entries-row-gap`]:y.scalingValue(T??0,n)}:{}},children:se.map((ze,ut)=>{var Gt;const _e=wl(ze.title),Je=wl(ze.subtitle),tt=(((Gt=ze.link)==null?void 0:Gt.length)??0)>0&&L==="off"?ze.link:void 0,Wt=Math.floor(ut/$t)===Math.ceil(se.length/$t)-1,Ct=dt&&ut>=kt?`${_t+(ut-kt)}`:void 0,lt=Lt?r.jsxs("div",{className:`${u}-item-text-block`,children:[_e&&r.jsx("p",{className:H,style:{width:qe,...we,...ae},children:ze.title}),_e&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:y.scalingValue(j??0,n),width:Pe}}),Je&&r.jsx("p",{className:re,style:{width:qe,...ue,...ne},children:ze.subtitle}),Je&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:y.scalingValue(I??0,n),width:Pe}})]}):null,Nt=Ge?r.jsxs("div",{className:`${u}-item-title-row`,children:[!Lt&&r.jsx("div",{"data-controls":o&&_e?"titleMarginTop":void 0,className:o&&_e?`${u}-control`:void 0,style:{height:_e?y.scalingValue(j??0,n):0,width:Pe}}),_e&&r.jsx("p",{className:H,style:{width:qe,...we,...ae},children:ze.title}),Lt&&_e&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:y.scalingValue(j??0,n),width:Pe}})]}):null,At=Ge?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Lt&&r.jsx("div",{"data-controls":o&&Je?"subtitleMarginTop":void 0,className:o&&Je?`${u}-control`:void 0,style:{height:Je?y.scalingValue(I??0,n):0,width:Pe}}),Je&&r.jsx("p",{className:re,style:{width:qe,...ue,...ne},children:ze.subtitle}),Lt&&Je&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:y.scalingValue(I??0,n),width:Pe}})]}):null,Vt=tt?r.jsxs("a",{href:tt,target:"_blank",className:`${u}-item-text-link`,children:[Nt,At]}):r.jsxs(r.Fragment,{children:[Nt,At]}),zt=Pm(ze.gallery),Pt=zt.filter(pt=>pt.lightboxMedia).map(pt=>pt.lightboxMedia),Qt=r.jsx("div",{className:Tt,style:Qe,children:zt.length===0?null:P==="off"?(()=>{const{displayMedia:pt,lightboxMedia:Ft}=zt[0],Bt=Ft?Pt.findIndex(g=>g.url===Ft.url):-1;return r.jsx(Sl,{media:pt,className:`${u}-item-${to(pt)?"video":"image"}`.trim(),style:gt,onMediaClick:Oe&&Bt>=0?()=>Ke(Pt,Bt):void 0})})():r.jsxs(r.Fragment,{children:[ht&&Ge&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:zt.map(({displayMedia:pt})=>to(pt)?r.jsx("video",{src:pt.url,muted:!0,playsInline:!0},`sizer-${pt.url}`):r.jsx("img",{src:pt.url,alt:""},`sizer-${pt.url}`))}),r.jsx(br,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:C*1e3,width:"100%",height:"100%",speed:Lm,type:E==="fade"?"fade":"loop",rewind:E==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:E==="fade"?"ltr":U!=="random"?U==="horizontal"?"ltr":"ttb":It},onMoved:pt=>{if(U!=="random"||E==="fade")return;const Ft=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Mt(Ft),setTimeout(()=>{pt.refresh()},0)},children:zt.map(({displayMedia:pt,lightboxMedia:Ft},Bt)=>{const g=Ft?Pt.findIndex(ge=>ge.url===Ft.url):-1;return r.jsx(wr,{children:r.jsx(Sl,{media:pt,className:`${u}-item-${to(pt)?"video":"image"}`.trim(),style:gt,onMediaClick:Oe&&g>=0?()=>Ke(Pt,g):void 0})},Bt)})},`${E}-${V}-${U}-${C}-${Dt}-${d}`)]})}),wt=Lt?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&_e?"titleMarginTop":void 0,className:o&&_e?`${u}-control`:void 0,style:{height:_e?y.scalingValue(j??0,n):0,width:Pe}}),r.jsx("p",{className:H,style:{width:qe,...we,...ae},children:ze.title}),r.jsx("div",{"data-controls":o&&Je?"subtitleMarginTop":void 0,className:o&&Je?`${u}-control`:void 0,style:{height:Je?y.scalingValue(I??0,n):0,width:Pe}}),r.jsx("p",{className:re,style:{width:qe,...ue,...ne},children:ze.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Ct&&!Ge?{gridColumn:Ct}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Ge&&Wt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(b??0)>100?`calc(${rt} * (${b} / 100))`:rt,...Ct&&Ge?{gridColumn:Ct}:{}},children:Ge?r.jsx(r.Fragment,{children:Lt?r.jsxs(r.Fragment,{children:[Vt,r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:Qt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:Qt}),Vt]})}):tt?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:tt,target:"_blank",className:`${u}-item-image-link`,children:[lt,Qt]}),!Lt&&r.jsx("a",{href:tt,target:"_blank",className:`${u}-item-text-link`,children:wt})]}):r.jsxs(r.Fragment,{children:[lt,Qt,wt]})})},ut)})})}),(!n||i)&&Rt&&typeof document<"u"&&L==="on"&&(()=>{const ze=(c?document.getElementById(c):null)??document.body;return gi.createPortal(r.jsx("div",{style:bt,"data-selection":"none",children:r.jsx(_m,{prefix:u,items:Kt,index:Jt,imageDisplay:Nm(R),isEditor:n,onClose:()=>Ut(!1),onPrev:()=>Te(ut=>(ut-1+Kt.length)%Kt.length),onNext:()=>Te(ut=>(ut+1)%Kt.length),counterClassName:ie,counterStyle:ce})}),ze)})()]})}const jm={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Om=["hover","focus","filled","success","error"],zm=`import { Splide, SplideSlide } from '@splidejs/react-splide';
4141
4141
  import '@splidejs/react-splide/css/core';
4142
4142
  import { CommonComponentProps } from '../props';
4143
4143
  import {
@@ -5951,7 +5951,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
5951
5951
  };
5952
5952
 
5953
5953
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
5954
- `,zr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Bm=["titleColor","subtitleColor","lightboxCounterColor"],Dm={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...zr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},subtitleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},subtitleFontSettings:{...zr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},subtitleFontSize:{type:"number",scope:"layout",title:"Subtitle Font Size",display:{type:"font-size"}},subtitleLineHeight:{type:"number",scope:"layout",title:"Subtitle Line Height",display:{type:"line-height-input"}},subtitleLetterSpacing:{type:"number",scope:"layout",title:"Subtitle Letter Spacing",display:{type:"letter-spacing-input"}},subtitleWordSpacing:{type:"number",scope:"layout",title:"Subtitle Word Spacing",display:{type:"word-spacing-input"}},subtitleTextAppearance:{type:"object",scope:"layout",title:"Subtitle Text Appearance",display:{type:"text-appearance"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...zr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"b",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...Bm],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Vm={element:Hm,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Neptune_Grid.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:Dm,sourceCode:zm},Gm=50,$l=10,Ha="cntrl-lightbox-journal",$r=Ha,ma=`${Ha}-`,Cr=e=>`${Ha}-${e}`,ja=e=>e===$r||e.startsWith(ma),Cl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Tl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Cl(t.get(Cr(e)));if(i)return i}const n=Cl(t.get($r));if(n)return n;for(const[i]of t){if(!i.startsWith(ma))continue;const o=i.slice(ma.length);if(!/^\d+$/.test(o))continue;const l=Number.parseInt(o,10);if(Number.isFinite(l)&&l>=1)return l}return null},Ll=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Xs=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(s=>{ja(s)&&i.searchParams.delete(s)}),t?i.searchParams.set(Cr(t),String(e)):i.searchParams.set($r,String(e));const o=n?"replaceState":"pushState",l=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",l)},qm=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Cr(e)||i===$r:ja(i));if(n.forEach(i=>t.searchParams.delete(i)),n.length>0){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},Ys=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Cr(e)):[...t.keys()].some(n=>ja(n))},Km=(e,t)=>{if(Ys(t)){if(e){window.history.back();return}qm(t)}},Um=20,Xm=2,Br=e=>`max(${e}, ${Um}px)`,Mi=e=>((e==null?void 0:e.image)??[]).slice(0,Xm),Zs=e=>e.reduce((t,n)=>t+Mi(n).length,0),Ym=(e,t)=>{const n=e.slice(0,t).reduce((o,l)=>o+Mi(l).length,1),i=Mi(e[t]).length;return{start:n,end:n+i-1}},Zm=(e,t)=>{const n=Zs(e),{start:i,end:o}=Ym(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Yo=(e,t)=>t==="B"?e.flatMap((n,i)=>Mi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Mi(n)})),Jm=(e,t,n,i)=>{var l;if(n==="B")return`${t+1} / ${e.length}`;const o=((l=e[t])==null?void 0:l.entryIndex)??0;return Zm(i,o)},Il=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Qm=(e,t,n)=>e==="B"?t.length>1:Zs(n)>1,hn=.004,Bn=.004,Ii={title1Width:.13,title2Width:.13,title3Width:.14},Dn=(e,t,n,i,o)=>{const l=[];return t.title1&&l.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&l.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&l.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),l},Pi=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const c=Math.min(l,d);return{overflow:l-c,widths:[d-c,...s]}},{overflow:i-1,widths:[]});return o},po=(e,t)=>Pi(e,t),ln=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Vn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Pi(e.length,n),effective:po(e.length,n)}},Js=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Qs=(e,t,n,i)=>e.slice(0,i+1).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Kn=["title1","title2","title3","count"],Be=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Oa={title1:"1",title2:"2",title3:"3",count:"Count"},za=e=>[Be(e,"fontFamily"),Be(e,"fontSettings"),{type:"row",items:[Be(e,"fontSize"),Be(e,"lineHeight"),Be(e,"letterSpacing"),Be(e,"wordSpacing")]},Be(e,"textAlign"),Be(e,"textAppearance")],eg=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[Oa[e],za(e)]))}),tg={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},ng={title1:.02,title2:.02,title3:.02,count:.017},si=(e,t)=>{const n=i=>{const o=Be(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[tg[t]]}},ci=(e,t,n)=>{var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??ng[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Xt(i,n)};function ec({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:m=0,title2MarginLeft:x=0,title3MarginLeft:b=0,titleRowMarginBottom:T=0,titleHeaderLayout:f="desktop",contentMarginTop:L=0,iconMarginRight:$=0,closeIcon:R=null,closeIconMaxWidth:E=0,closeIconColor:C="#000000",closeIconHoverColor:U="#cccccc"}=n,k=y.scalingValue(L,i),j=y.scalingValue($,i),I=y.scalingValue(T,i),w=f==="mobile",W=ci("title1",si(n,"title1"),i),h=ci("title2",si(n,"title2"),i),S=ci("title3",si(n,"title3"),i),M=a.useMemo(()=>({title1Width:d??Ii.title1Width,title2Width:c??Ii.title2Width,title3Width:u??Ii.title3Width}),[d,c,u]),z=a.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:b}),[x,b]),K=a.useMemo(()=>Dn(e,t,W,h,S),[e,t,W,h,S]),le=a.useMemo(()=>K.map(ee=>M[ee.widthKey]),[K,M]),Y=a.useMemo(()=>Pi(K.length,le),[K.length,le]),D=a.useMemo(()=>po(K.length,le),[K.length,le]),N=a.useMemo(()=>K.filter(ee=>ee.prefix==="title1"),[K]),F=a.useMemo(()=>K.filter(ee=>ee.prefix==="title2"||ee.prefix==="title3"),[K]),A=a.useMemo(()=>Vn(N,M),[N,M]),q=a.useMemo(()=>Vn(F,M),[F,M]),G=!!(t.title1||t.title2||t.title3),Z=R!==null;if(!(G||Z))return null;const me=(m??0)>0||o,v=(ee,pe)=>{const Ae=K.findIndex(V=>V.prefix===ee.prefix);if(!w||pe==="single-row")return{effectiveWidth:D[Ae]??0,resolvedWidth:Y[Ae]??0,maxWidth:ln(Ae,Y)};if(pe==="two-row-top"){const V=N.findIndex(je=>je.prefix===ee.prefix);return{effectiveWidth:A.effective[V]??0,resolvedWidth:A.resolved[V]??0,maxWidth:ln(V,A.resolved)}}const se=F.findIndex(V=>V.prefix===ee.prefix);return{effectiveWidth:q.effective[se]??0,resolvedWidth:q.resolved[se]??0,maxWidth:ln(se,q.resolved)}},fe=(ee,pe,Ae)=>{if(!w||Ae==="single-row"){const et=ee.findIndex(De=>De.prefix===pe.prefix),Ye=ee.map(De=>M[De.widthKey]),st=Pi(ee.length,Ye);return{effectiveWidth:po(ee.length,Ye)[et]??0,resolvedWidth:st[et]??0,maxWidth:ln(et,st)}}if(Ae==="two-row-top"){const et=ee.filter(De=>De.prefix==="title1"),Ye=et.findIndex(De=>De.prefix===pe.prefix),{resolved:st,effective:mt}=Vn(et,M);return{effectiveWidth:mt[Ye]??0,resolvedWidth:st[Ye]??0,maxWidth:ln(Ye,st)}}const se=ee.filter(et=>et.prefix==="title2"||et.prefix==="title3"),V=se.findIndex(et=>et.prefix===pe.prefix),{resolved:je,effective:We}=Vn(se,M);return{effectiveWidth:We[V]??0,resolvedWidth:je[V]??0,maxWidth:ln(V,je)}},J=ee=>Qs(K,Y,z,ee)+(w?0:m??0),de=()=>w?0:m??0,$e=ee=>F.slice(0,ee).reduce((pe,Ae,se)=>pe+(Ae.marginLeftKey?z[Ae.marginLeftKey]??0:0)+(q.resolved[se]??0),0),oe=ee=>{const pe=F[ee];return $e(ee)+(pe.marginLeftKey?z[pe.marginLeftKey]??0:0)+(q.resolved[ee]??0)},xe=(ee,pe,Ae)=>{const se=ee.marginLeftKey?z[ee.marginLeftKey]??0:0,{effectiveWidth:V,resolvedWidth:je,maxWidth:We}=Ae??v(ee,pe),et=Math.max(se,Bn),Ye=o&&pe==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":ee.prefix,style:{width:y.scalingValue(V,i),...se>0?{marginLeft:y.scalingValue(se,i)}:{}},children:[r.jsx("p",{className:ee.className,style:ee.style,children:ee.text}),Ye&&ee.marginLeftKey?r.jsx("div",{"data-controls":ee.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:y.scalingValue(-se,i),width:y.scalingValue(et,i),height:"100%",pointerEvents:"auto"}}):null,Ye?r.jsx("div",{"data-controls":ee.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(We),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:y.scalingValue(-hn/2,i),width:y.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}}):null]},ee.className)},Q=(ee="two-row")=>{const pe=K.findIndex(V=>V.prefix==="title1"),Ae=pe>=0?Y[pe]:M.title1Width,se=ee==="two-row"&&o;return r.jsx("div",{...se?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae)}:{},style:{width:y.scalingValue(m??0,i),flexShrink:0,alignSelf:"stretch",...se?{pointerEvents:"auto"}:{}}})},ye=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:W,"aria-hidden":"true",children:" "}),ve=ee=>{const pe=Dn(e,ee,W,h,S);return r.jsx(r.Fragment,{children:pe.map(Ae=>xe(Ae,"single-row",fe(pe,Ae,"single-row")))})},ke=ee=>{const pe=Dn(e,ee,W,h,S),Ae=pe.find(se=>se.prefix==="title1");return Ae?xe(Ae,"two-row-top",fe(pe,Ae,"two-row-top")):null},we=(ee,pe=!1)=>{const Ae=Dn(e,ee,W,h,S),se=Ae.filter(We=>We.prefix==="title2"||We.prefix==="title3"),V=o&&pe;return se.length>0||V||(T??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[se.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:se.map(We=>xe(We,"two-row-bottom",fe(Ae,We,"two-row-bottom")))}),pe&&o?r.jsxs(r.Fragment,{children:[re(),ae()]}):null]}):null,(T??0)>0||V?r.jsx("div",{"data-controls":V?"titleRowMarginBottom":void 0,"data-controls-axis":V?"y":void 0,"data-controls-reverse":V?"":void 0,className:V?`${e}-control`:void 0,style:{height:I,width:"100%",flexShrink:0,pointerEvents:V?"auto":"none"}}):null]}):null},Me=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:y.scalingValue(E??0,i),height:y.scalingValue(E??0,i),marginRight:j,"--close-icon-hover-color":U},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:ee=>{ee.stopPropagation(),s==null||s()},"aria-label":"Close",children:r.jsx(rn,{url:R??"",fill:C,hoverFill:i&&!l?C:U,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:j,height:"100%",pointerEvents:"auto"}})]}),X=()=>Z?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:Me()}):null,ue=ee=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:ee})}),Se=ee=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Z||G?ye():null,me?Q("two-row"):null,ue(ee),X()]}),O=(ee,pe=!1)=>r.jsxs(r.Fragment,{children:[Se(ke(ee)),we(ee,pe)]}),ce=()=>{const ee=w?-1:K.findIndex(se=>se.prefix==="title1"),pe=!w&&(o||(m??0)>0)?(()=>{const se=m??0,V=ee>=0?Y[ee]:M.title1Width,je=Math.max(se,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(V),style:{position:"absolute",top:0,left:0,width:y.scalingValue(je,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ae=K.flatMap((se,V)=>{if(!se.marginLeftKey)return[];const je=z[se.marginLeftKey]??0,We=Js(K,Y,z,V)+de(),et=Math.max(je,Bn);return r.jsx("div",{"data-controls":se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Y[V]),style:{position:"absolute",top:0,left:y.scalingValue(We,i),width:y.scalingValue(et,i),height:"100%",pointerEvents:"auto"}},se.marginLeftKey)});return pe?[pe,...Ae]:Ae},H=()=>K.map((ee,pe)=>{const Ae=ln(pe,Y),V=J(pe)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ee.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ae),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:y.scalingValue(V,i),width:y.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}})},`${ee.widthKey}-junction`)}),re=()=>F.flatMap((ee,pe)=>{if(!ee.marginLeftKey)return[];const Ae=z[ee.marginLeftKey]??0,se=$e(pe),V=Math.max(Ae,Bn),{resolvedWidth:je}=v(ee,"two-row-bottom");return r.jsx("div",{"data-controls":ee.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:y.scalingValue(se,i),width:y.scalingValue(V,i),height:"100%",pointerEvents:"auto"}},ee.marginLeftKey)}),ae=()=>F.map((ee,pe)=>{const{maxWidth:Ae}=v(ee,"two-row-bottom"),V=oe(pe)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ee.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ae),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:y.scalingValue(V,i),width:y.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}})},`${ee.widthKey}-junction`)}),ne=()=>!o||w?null:r.jsxs(r.Fragment,{children:[ce(),H()]}),ie=!!(t.title2||t.title3||(T??0)>0||o),be=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Z||G?ye():null,me?Q("single-row"):null,G?ue(ve(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),X(),ne()]}),Ce=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ie?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:ie?void 0:{flex:"0 0 auto",height:"auto"},children:O(t,!0)}),ne()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:k,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...w?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${w?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${w?` ${e}-text-bar-cell-stacked`:""}`,style:w?void 0:{flex:1,minWidth:0,width:"100%"},children:w?Ce():be()})})})]})}function ig(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function og(e){return`
5954
+ `,zr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Bm=["titleColor","subtitleColor","lightboxCounterColor"],Dm={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...zr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},subtitleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},subtitleFontSettings:{...zr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},subtitleFontSize:{type:"number",scope:"layout",title:"Subtitle Font Size",display:{type:"font-size"}},subtitleLineHeight:{type:"number",scope:"layout",title:"Subtitle Line Height",display:{type:"line-height-input"}},subtitleLetterSpacing:{type:"number",scope:"layout",title:"Subtitle Letter Spacing",display:{type:"letter-spacing-input"}},subtitleWordSpacing:{type:"number",scope:"layout",title:"Subtitle Word Spacing",display:{type:"word-spacing-input"}},subtitleTextAppearance:{type:"object",scope:"layout",title:"Subtitle Text Appearance",display:{type:"text-appearance"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...zr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"b",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...Bm],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Vm={element:Hm,id:"grid",name:"Neptune",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Neptune_Grid.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:Dm,sourceCode:zm},Gm=50,$l=10,Ha="cntrl-lightbox-journal",$r=Ha,ma=`${Ha}-`,Cr=e=>`${Ha}-${e}`,ja=e=>e===$r||e.startsWith(ma),Cl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Tl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Cl(t.get(Cr(e)));if(i)return i}const n=Cl(t.get($r));if(n)return n;for(const[i]of t){if(!i.startsWith(ma))continue;const o=i.slice(ma.length);if(!/^\d+$/.test(o))continue;const l=Number.parseInt(o,10);if(Number.isFinite(l)&&l>=1)return l}return null},Ll=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Xs=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(s=>{ja(s)&&i.searchParams.delete(s)}),t?i.searchParams.set(Cr(t),String(e)):i.searchParams.set($r,String(e));const o=n?"replaceState":"pushState",l=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",l)},qm=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Cr(e)||i===$r:ja(i));if(n.forEach(i=>t.searchParams.delete(i)),n.length>0){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},Ys=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Cr(e)):[...t.keys()].some(n=>ja(n))},Km=(e,t)=>{if(Ys(t)){if(e){window.history.back();return}qm(t)}},Um=20,Xm=2,Br=e=>`max(${e}, ${Um}px)`,Mi=e=>((e==null?void 0:e.image)??[]).slice(0,Xm),Zs=e=>e.reduce((t,n)=>t+Mi(n).length,0),Ym=(e,t)=>{const n=e.slice(0,t).reduce((o,l)=>o+Mi(l).length,1),i=Mi(e[t]).length;return{start:n,end:n+i-1}},Zm=(e,t)=>{const n=Zs(e),{start:i,end:o}=Ym(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Yo=(e,t)=>t==="B"?e.flatMap((n,i)=>Mi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Mi(n)})),Jm=(e,t,n,i)=>{var l;if(n==="B")return`${t+1} / ${e.length}`;const o=((l=e[t])==null?void 0:l.entryIndex)??0;return Zm(i,o)},Il=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Qm=(e,t,n)=>e==="B"?t.length>1:Zs(n)>1,hn=.004,Bn=.004,Ii={title1Width:.13,title2Width:.13,title3Width:.14},Dn=(e,t,n,i,o)=>{const l=[];return t.title1&&l.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&l.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&l.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),l},Pi=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const c=Math.min(l,d);return{overflow:l-c,widths:[d-c,...s]}},{overflow:i-1,widths:[]});return o},po=(e,t)=>Pi(e,t),ln=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Vn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Pi(e.length,n),effective:po(e.length,n)}},Js=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Qs=(e,t,n,i)=>e.slice(0,i+1).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Kn=["title1","title2","title3","count"],Be=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Oa={title1:"1",title2:"2",title3:"3",count:"Count"},za=e=>[Be(e,"fontFamily"),Be(e,"fontSettings"),{type:"row",items:[Be(e,"fontSize"),Be(e,"lineHeight"),Be(e,"letterSpacing"),Be(e,"wordSpacing")]},Be(e,"textAlign"),Be(e,"textAppearance")],eg=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[Oa[e],za(e)]))}),tg={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},ng={title1:.02,title2:.02,title3:.02,count:.017},si=(e,t)=>{const n=i=>{const o=Be(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[tg[t]]}},ci=(e,t,n)=>{var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??ng[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Xt(i,n)};function ec({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:m=0,title2MarginLeft:x=0,title3MarginLeft:b=0,titleRowMarginBottom:T=0,titleHeaderLayout:f="desktop",contentMarginTop:L=0,iconMarginRight:$=0,closeIcon:R=null,closeIconMaxWidth:P=0,closeIconColor:C="#000000",closeIconHoverColor:U="#cccccc"}=n,E=y.scalingValue(L,i),j=y.scalingValue($,i),I=y.scalingValue(T,i),w=f==="mobile",W=ci("title1",si(n,"title1"),i),h=ci("title2",si(n,"title2"),i),S=ci("title3",si(n,"title3"),i),k=a.useMemo(()=>({title1Width:d??Ii.title1Width,title2Width:c??Ii.title2Width,title3Width:u??Ii.title3Width}),[d,c,u]),z=a.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:b}),[x,b]),K=a.useMemo(()=>Dn(e,t,W,h,S),[e,t,W,h,S]),le=a.useMemo(()=>K.map(ee=>k[ee.widthKey]),[K,k]),Y=a.useMemo(()=>Pi(K.length,le),[K.length,le]),D=a.useMemo(()=>po(K.length,le),[K.length,le]),N=a.useMemo(()=>K.filter(ee=>ee.prefix==="title1"),[K]),F=a.useMemo(()=>K.filter(ee=>ee.prefix==="title2"||ee.prefix==="title3"),[K]),A=a.useMemo(()=>Vn(N,k),[N,k]),q=a.useMemo(()=>Vn(F,k),[F,k]),G=!!(t.title1||t.title2||t.title3),Z=R!==null;if(!(G||Z))return null;const me=(m??0)>0||o,v=(ee,pe)=>{const Ae=K.findIndex(V=>V.prefix===ee.prefix);if(!w||pe==="single-row")return{effectiveWidth:D[Ae]??0,resolvedWidth:Y[Ae]??0,maxWidth:ln(Ae,Y)};if(pe==="two-row-top"){const V=N.findIndex(je=>je.prefix===ee.prefix);return{effectiveWidth:A.effective[V]??0,resolvedWidth:A.resolved[V]??0,maxWidth:ln(V,A.resolved)}}const se=F.findIndex(V=>V.prefix===ee.prefix);return{effectiveWidth:q.effective[se]??0,resolvedWidth:q.resolved[se]??0,maxWidth:ln(se,q.resolved)}},fe=(ee,pe,Ae)=>{if(!w||Ae==="single-row"){const et=ee.findIndex(De=>De.prefix===pe.prefix),Ye=ee.map(De=>k[De.widthKey]),st=Pi(ee.length,Ye);return{effectiveWidth:po(ee.length,Ye)[et]??0,resolvedWidth:st[et]??0,maxWidth:ln(et,st)}}if(Ae==="two-row-top"){const et=ee.filter(De=>De.prefix==="title1"),Ye=et.findIndex(De=>De.prefix===pe.prefix),{resolved:st,effective:mt}=Vn(et,k);return{effectiveWidth:mt[Ye]??0,resolvedWidth:st[Ye]??0,maxWidth:ln(Ye,st)}}const se=ee.filter(et=>et.prefix==="title2"||et.prefix==="title3"),V=se.findIndex(et=>et.prefix===pe.prefix),{resolved:je,effective:We}=Vn(se,k);return{effectiveWidth:We[V]??0,resolvedWidth:je[V]??0,maxWidth:ln(V,je)}},J=ee=>Qs(K,Y,z,ee)+(w?0:m??0),de=()=>w?0:m??0,$e=ee=>F.slice(0,ee).reduce((pe,Ae,se)=>pe+(Ae.marginLeftKey?z[Ae.marginLeftKey]??0:0)+(q.resolved[se]??0),0),oe=ee=>{const pe=F[ee];return $e(ee)+(pe.marginLeftKey?z[pe.marginLeftKey]??0:0)+(q.resolved[ee]??0)},xe=(ee,pe,Ae)=>{const se=ee.marginLeftKey?z[ee.marginLeftKey]??0:0,{effectiveWidth:V,resolvedWidth:je,maxWidth:We}=Ae??v(ee,pe),et=Math.max(se,Bn),Ye=o&&pe==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":ee.prefix,style:{width:y.scalingValue(V,i),...se>0?{marginLeft:y.scalingValue(se,i)}:{}},children:[r.jsx("p",{className:ee.className,style:ee.style,children:ee.text}),Ye&&ee.marginLeftKey?r.jsx("div",{"data-controls":ee.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:y.scalingValue(-se,i),width:y.scalingValue(et,i),height:"100%",pointerEvents:"auto"}}):null,Ye?r.jsx("div",{"data-controls":ee.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(We),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:y.scalingValue(-hn/2,i),width:y.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}}):null]},ee.className)},Q=(ee="two-row")=>{const pe=K.findIndex(V=>V.prefix==="title1"),Ae=pe>=0?Y[pe]:k.title1Width,se=ee==="two-row"&&o;return r.jsx("div",{...se?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae)}:{},style:{width:y.scalingValue(m??0,i),flexShrink:0,alignSelf:"stretch",...se?{pointerEvents:"auto"}:{}}})},ye=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:W,"aria-hidden":"true",children:" "}),ve=ee=>{const pe=Dn(e,ee,W,h,S);return r.jsx(r.Fragment,{children:pe.map(Ae=>xe(Ae,"single-row",fe(pe,Ae,"single-row")))})},ke=ee=>{const pe=Dn(e,ee,W,h,S),Ae=pe.find(se=>se.prefix==="title1");return Ae?xe(Ae,"two-row-top",fe(pe,Ae,"two-row-top")):null},we=(ee,pe=!1)=>{const Ae=Dn(e,ee,W,h,S),se=Ae.filter(We=>We.prefix==="title2"||We.prefix==="title3"),V=o&&pe;return se.length>0||V||(T??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[se.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:se.map(We=>xe(We,"two-row-bottom",fe(Ae,We,"two-row-bottom")))}),pe&&o?r.jsxs(r.Fragment,{children:[re(),ae()]}):null]}):null,(T??0)>0||V?r.jsx("div",{"data-controls":V?"titleRowMarginBottom":void 0,"data-controls-axis":V?"y":void 0,"data-controls-reverse":V?"":void 0,className:V?`${e}-control`:void 0,style:{height:I,width:"100%",flexShrink:0,pointerEvents:V?"auto":"none"}}):null]}):null},Me=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:y.scalingValue(P??0,i),height:y.scalingValue(P??0,i),marginRight:j,"--close-icon-hover-color":U},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:ee=>{ee.stopPropagation(),s==null||s()},"aria-label":"Close",children:r.jsx(rn,{url:R??"",fill:C,hoverFill:i&&!l?C:U,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:j,height:"100%",pointerEvents:"auto"}})]}),X=()=>Z?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:Me()}):null,ue=ee=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:ee})}),Se=ee=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Z||G?ye():null,me?Q("two-row"):null,ue(ee),X()]}),O=(ee,pe=!1)=>r.jsxs(r.Fragment,{children:[Se(ke(ee)),we(ee,pe)]}),ce=()=>{const ee=w?-1:K.findIndex(se=>se.prefix==="title1"),pe=!w&&(o||(m??0)>0)?(()=>{const se=m??0,V=ee>=0?Y[ee]:k.title1Width,je=Math.max(se,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(V),style:{position:"absolute",top:0,left:0,width:y.scalingValue(je,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ae=K.flatMap((se,V)=>{if(!se.marginLeftKey)return[];const je=z[se.marginLeftKey]??0,We=Js(K,Y,z,V)+de(),et=Math.max(je,Bn);return r.jsx("div",{"data-controls":se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Y[V]),style:{position:"absolute",top:0,left:y.scalingValue(We,i),width:y.scalingValue(et,i),height:"100%",pointerEvents:"auto"}},se.marginLeftKey)});return pe?[pe,...Ae]:Ae},H=()=>K.map((ee,pe)=>{const Ae=ln(pe,Y),V=J(pe)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ee.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ae),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:y.scalingValue(V,i),width:y.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}})},`${ee.widthKey}-junction`)}),re=()=>F.flatMap((ee,pe)=>{if(!ee.marginLeftKey)return[];const Ae=z[ee.marginLeftKey]??0,se=$e(pe),V=Math.max(Ae,Bn),{resolvedWidth:je}=v(ee,"two-row-bottom");return r.jsx("div",{"data-controls":ee.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:y.scalingValue(se,i),width:y.scalingValue(V,i),height:"100%",pointerEvents:"auto"}},ee.marginLeftKey)}),ae=()=>F.map((ee,pe)=>{const{maxWidth:Ae}=v(ee,"two-row-bottom"),V=oe(pe)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ee.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ae),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:y.scalingValue(V,i),width:y.scalingValue(hn,i),height:"100%",pointerEvents:"auto"}})},`${ee.widthKey}-junction`)}),ne=()=>!o||w?null:r.jsxs(r.Fragment,{children:[ce(),H()]}),ie=!!(t.title2||t.title3||(T??0)>0||o),be=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Z||G?ye():null,me?Q("single-row"):null,G?ue(ve(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),X(),ne()]}),Ce=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ie?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:ie?void 0:{flex:"0 0 auto",height:"auto"},children:O(t,!0)}),ne()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:E,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...w?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${w?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${w?` ${e}-text-bar-cell-stacked`:""}`,style:w?void 0:{flex:1,minWidth:0,width:"100%"},children:w?Ce():be()})})})]})}function ig(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function og(e){return`
5955
5955
  .${e}-wrapper {
5956
5956
  display: grid;
5957
5957
  align-items: start;
@@ -6282,7 +6282,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
6282
6282
  pointer-events: auto;
6283
6283
  flex-shrink: 0;
6284
6284
  }
6285
- `}const Rl={url:"",name:"",objectFit:"cover"},$n=500,Ki=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",rg=72,ag=50,lg=1e4,sg=650,cg=500;function dg(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,l=e.top-t.top;return`translate(${o}px, ${l}px) scale(${n}, ${i})`}function tc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=or(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function ug(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?tc(i,n):null}function pg(e){return e.reduce((t,n,i)=>{const o=Ba(n.gallery),s=Da(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return s.length===0||t.push({gridIndex:i,items:s,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function Zi(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function El(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Zi(e,i,n)}const mg=.03;function nc(e){return e.width*mg}const Dr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function _o(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function kl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function gg(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ga(e,t,n){const i=e.getBoundingClientRect(),o=i.width,l=i.height,s=t/n,d=o/l;if(s>d){const u=o/s;return{width:o,height:u,left:i.left,top:i.top+(l-u)/2}}const c=l*s;return{width:c,height:l,left:i.left+(o-c)/2,top:i.top}}function hg(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ga(e,t.width,t.height)}function fg(e,t){if(Vi(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function yg(e){const t=new Set,n=[];for(const i of e){const o=Ba(i.gallery),l=Da(o);for(const s of l)for(const d of[s.displayMedia,s.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function vg({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Vi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Ai(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:d}=n,c=nc(n);return t==="left"?{left:s+c-i,top:l,width:i,height:o}:{left:s+d-c,top:l,width:i,height:o}}function rr(e,t,n){const i=Ai(e,t,n);return{...i,left:2*i.left-e.left}}function xg(e,t,n){const{left:i,width:o}=n,l=nc(n);return t==="left"?{left:i,top:e.top,width:l,height:e.height}:{left:i+o-l,top:e.top,width:l,height:e.height}}function ic(e,t,n,i){const o=Ai(e,"left",i),l=Ai(e,"right",i),s=rr(e,"left",i),d=rr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:l,end:e};case"left-adjacent":return{start:o,end:s};case"far-right":return{start:d,end:l};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:l};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:l,end:d};case"far-left":return{start:s,end:o};default:return{start:e,end:e}}}function bg(e,t,n,i){const{start:o,end:l}=ic(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function wg(e,t,n){const i=Ai(e,t,n),o=rr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function oc(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function Ba(e){if(!e)return;if(oc(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.url?t:void 0,o=n!=null&&n.url?n:void 0;if(!(!i&&!o))return[{media:[o??i??Rl,i??o??Rl]}]}function Sg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function $g(e){const[t]=e.media;return t!=null&&t.url?t:null}function Da(e){if(!Array.isArray(e)||e.length===0)return[];if(oc(e)){const t=[];for(const n of e){const i=Sg(n);if(!i)continue;const o=$g(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Vi(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Cg({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Vi(e)?r.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):r.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Tg({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:l,onTransitionEnd:s}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:s,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:c=>c.stopPropagation(),style:o},e)})}function No({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Vi(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const l=o.currentTarget;l.videoWidth>0&&l.videoHeight>0&&(i==null||i(e.url,l.videoWidth,l.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const l=o.currentTarget;l.naturalWidth>0&&l.naturalHeight>0&&(i==null||i(e.url,l.naturalWidth,l.naturalHeight))},onTransitionEnd:n})}function Lg({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:m,layoutId:x,sourceRect:b,resolveCloseSourceRect:T,onClose:f,onPrev:L,onNext:$}){const R=a.useRef(null),E=a.useRef(null),C=a.useRef(null),U=a.useRef(new Map),[k,j]=a.useState(0),I=a.useRef(null),w=a.useRef(0),W=a.useRef(0),h=a.useRef("none"),S=a.useRef(!1),M=a.useRef(!1),z=a.useRef(!1),K=a.useRef(null),le=a.useRef(null),Y=a.useRef(null),D=a.useRef(()=>{}),N=a.useRef(null),F=a.useRef(null),A=a.useRef(null),q=a.useRef(!1),[G,Z]=a.useState(null),[_,me]=a.useState(Dr),[v,fe]=a.useState(0),[J,de]=a.useState("opening"),[$e,oe]=a.useState(0),[xe,Q]=a.useState(0),[ye,ve]=a.useState(!1),[ke,we]=a.useState(null),[Me,X]=a.useState(null),[ue,Se]=a.useState(null),[O,ce]=a.useState(!1),[H,re]=a.useState(null),[ae,ne]=a.useState(!1),ie=a.useRef(!1),[be,Ce]=a.useState(!1),[ee,pe]=a.useState(!1),Ae=a.useRef(n),se=a.useRef(void 0),V=t[n],je=V?Vi(V):!1,We=xe!==0||ye,et=!s&&(!l||!!d),Ye=c&&!s,st=u.length>1,mt=a.useCallback((g,ge)=>t.length<=1?null:t[(g+ge+t.length)%t.length]??null,[t]),De=st?Zi(u,m,-1):mt(n,-1),ot=st?Zi(u,m,1):mt(n,1),$t=ke===-1&&We?st&&Me!==null?Zi(u,Me,-1):ue!==null?mt(ue,-1):null:null,rt=ke===1&&We?st&&Me!==null?Zi(u,Me,1):ue!==null?mt(ue,1):null:null,Ue=$t&&$t.url!==(De==null?void 0:De.url)?$t:null,ht=rt&&rt.url!==(ot==null?void 0:ot.url)?rt:null,xt=De&&Ye?(()=>{const g=st?El(u,m,-1):t.length>2?mt((n-1+t.length)%t.length,-1):null;return g&&g.url!==De.url?g:null})():null,dt=ot&&Ye?(()=>{const g=st?El(u,m,1):t.length>2?mt((n+1)%t.length,1):null;return g&&g.url!==ot.url?g:null})():null,kt=Ue??xt,_t=ht??dt,Qe=a.useCallback((g,ge,Re)=>{if(!g||!ge||!Re)return;const Ie=U.current,Ze=Ie.get(g);(Ze==null?void 0:Ze.width)===ge&&(Ze==null?void 0:Ze.height)===Re||(Ie.set(g,{width:ge,height:Re}),j(Et=>Et+1))},[]),Tt=a.useCallback(g=>{if(!(g!=null&&g.url))return null;const ge=U.current.get(g.url);return hg(E.current,ge)},[k,v]),Lt=a.useCallback(()=>{if(!V)return;const g=Tt(V);if(g){Z(g);return}const ge=E.current;ge&&Z(kl(ge))},[V,Tt]),Ge=a.useCallback(g=>{if(st){const ge=u.length;X((m+g+ge)%ge),Se(null);return}t.length>1&&(Se((n+g+t.length)%t.length),X(null))},[st,u.length,m,t.length,n]),qe=a.useCallback(g=>{z.current=g,ve(g)},[]),Pe=a.useCallback(()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},[]),gt=a.useCallback(()=>{Pe(),K.current=window.setTimeout(()=>{Pe(),qe(!1)},Ki+32)},[Pe,qe]),It=a.useCallback(()=>{const g=R.current;if(!g){me({left:0,top:0,width:typeof window<"u"?window.innerWidth:Dr.width,height:typeof window<"u"?window.innerHeight:Dr.height});return}const ge=g.getBoundingClientRect();me({left:ge.left,top:ge.top,width:ge.width,height:ge.height})},[]),Mt=a.useCallback((g,ge)=>{if(We){if(be&&!ye)return`translate(${xe}px, 0px)`;if(ye&&ke!==null){const Re=Tt(g);if(!Re)return;const{x:Ie,y:Ze}=bg(Re,ge,ke,_);return`translate(${Ie}px, ${Ze}px)`}if(ye)return"translate(0px, 0px)"}},[We,be,ye,xe,ke,_,Tt]),Dt=a.useCallback(()=>{const g=le.current;le.current=null,Pe(),qe(!1),we(null),X(null),Se(null),Q(0),Ce(!1),S.current=!1,W.current=0,h.current="none",g===-1?L():g===1&&$()},[Pe,qe,L,$]),en=a.useCallback(()=>{Pe(),K.current=window.setTimeout(()=>{le.current!==null&&Dt()},Ki+32)},[Pe,Dt]),on=a.useCallback(()=>{Pe(),le.current=null,qe(!1),we(null),X(null),Se(null),Q(0),Ce(!1),S.current=!1,W.current=0,h.current="none"},[Pe,qe]),bt=a.useCallback(g=>{if(!(!Ye||!G)){if(z.current){if(le.current===g){Y.current=g,Dt();return}on()}Pe(),Ge(g),le.current=g,we(g),qe(!0),en()}},[Ye,G,Dt,on,Pe,Ge,qe,en]);D.current=bt;const Rt=a.useCallback(()=>{N.current=null,q.current=!1,F.current!==null&&(window.clearInterval(F.current),F.current=null),A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),Ut=a.useCallback(g=>{F.current!==null&&window.clearInterval(F.current);const ge=q.current?cg:sg;F.current=window.setInterval(()=>{D.current(g)},ge)},[]),Kt=a.useCallback(g=>{N.current!==g&&(Rt(),N.current=g,q.current=!1,D.current(g),Ut(g),A.current=window.setTimeout(()=>{A.current=null,N.current===g&&(q.current=!0,Ut(g))},lg))},[Rt,Ut]),ft=a.useCallback(()=>{const g=E.current;if(!g)return;const ge=V==null?void 0:V.url,Re=ge?U.current.get(ge):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){Z(ga(g,Re.width,Re.height));return}const Ie=C.current;if(Ie&&ge&&(Ie.src===ge||Ie.currentSrc===ge)){const{width:Et,height:Ve}=gg(Ie);if(Et&&Ve){Qe(ge,Et,Ve),Z(ga(g,Et,Ve));return}}const Ze=kl(g);!Ze.width||!Ze.height||Z(Ze)},[V==null?void 0:V.url,Qe]),Jt=a.useCallback(g=>{if(C.current=g,!!g){if(g instanceof HTMLVideoElement){g.readyState>=1&&g.videoWidth>0&&ft();return}g.complete&&g.naturalWidth>0&&ft()}},[ft]),Te=a.useCallback(()=>{It(),ft(),fe(g=>g+1)},[It,ft]);a.useEffect(()=>{Te();const g=E.current,ge=R.current,Re=new ResizeObserver(()=>Te());return g&&Re.observe(g),ge&&Re.observe(ge),window.addEventListener("resize",Te),()=>{Re.disconnect(),window.removeEventListener("resize",Te)}},[Te,n,x]),a.useLayoutEffect(()=>{if(!V)return;const g=C.current;if(g){if(g instanceof HTMLImageElement&&g.complete&&g.naturalWidth>0){ft();return}g instanceof HTMLVideoElement&&g.readyState>=1&&g.videoWidth>0&&ft()}},[V==null?void 0:V.url,n,ft]),a.useEffect(()=>{Lt()},[Lt,k]),a.useEffect(()=>{const g=new Set,ge=[],Re=Ie=>{!(Ie!=null&&Ie.url)||g.has(Ie.url)||(g.add(Ie.url),ge.push(Ie))};t.forEach(Re),u.forEach(Ie=>Ie.items.forEach(Re)),ge.forEach(Ie=>{U.current.has(Ie.url)||fg(Ie,Qe)})},[t,u,Qe]),a.useEffect(()=>{if(J!=="opening"||!G)return;if(!b){de("open");return}ce(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce(!0),de("open")})});return()=>cancelAnimationFrame(g)},[J,G,b]),a.useEffect(()=>{if(J!=="closing")return;const g=setTimeout(()=>f(),$n);return()=>clearTimeout(g)},[J,f]),a.useEffect(()=>()=>{Pe()},[Pe]),a.useLayoutEffect(()=>{Ae.current===n&&se.current===(V==null?void 0:V.url)||(Pe(),le.current=null,we(null),X(null),Se(null),oe(0),Q(0),qe(!1),pe(!1),Ce(!1),w.current=0,W.current=0,h.current="none",S.current=!1,I.current=null,M.current=!1,C.current=null,Lt(),Ae.current=n,se.current=V==null?void 0:V.url)},[n,V==null?void 0:V.url,qe,Pe,Lt]),a.useLayoutEffect(()=>{const g=Y.current;g!==null&&(Y.current=null,requestAnimationFrame(()=>{D.current(g)}))},[n,m,V==null?void 0:V.url]),a.useLayoutEffect(()=>{if(J==="opening"){ie.current=!1,ne(!1);return}if(J!=="open"||ie.current)return;if(!De&&!ot){ie.current=!0;return}ne(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ne(!0),ie.current=!0})});return()=>cancelAnimationFrame(g)},[J,De==null?void 0:De.url,ot==null?void 0:ot.url]),a.useEffect(()=>{if(J!=="open")return;const g=()=>{const Ve=it=>{it.stopPropagation(),it.preventDefault(),document.removeEventListener("click",Ve,!0)};document.addEventListener("click",Ve,!0)},ge=Ve=>{const it=Ve<0?1:-1;Pe(),Ge(it),le.current=it,we(it),qe(!0),en()},Re=Ve=>{if(Math.abs(Ve)>ag&&Ye){ge(Ve);return}le.current=null,we(null),X(null),Se(null),qe(!0),Q(0),gt()},Ie=Ve=>{if(Ve.touches.length!==1||z.current)return;const it=Ve.touches[0];M.current=!0,I.current={x:it.clientX,y:it.clientY},h.current="none",W.current=0,S.current=!1},Ze=Ve=>{if(!I.current||Ve.touches.length!==1||z.current)return;const it=Ve.touches[0],jt=it.clientX-I.current.x,St=it.clientY-I.current.y;if(h.current==="none"){if(Math.abs(jt)<10&&Math.abs(St)<10)return;if(Math.abs(jt)>Math.abs(St)){if(!Ye)return;h.current="horizontal"}else if(St>0){if(!et)return;h.current="vertical"}else return}if(h.current==="horizontal"){S.current=!0,Ce(!0),W.current=jt,Q(jt),Ve.preventDefault();return}h.current==="vertical"&&(S.current=!0,Ce(!0),w.current=St,oe(St),Ve.preventDefault())},Et=()=>{if(!I.current)return;const Ve=h.current,it=S.current;if(it&&Ve==="horizontal")Re(W.current),g();else if(it&&Ve==="vertical"){const jt=w.current;if(et&&jt>rg){const St=window.innerHeight;w.current=St,pe(!0),oe(St),de("closing")}else w.current=0,oe(0);g()}else Ve==="horizontal"&&Math.abs(W.current)>0&&(Re(W.current),g());I.current=null,h.current="none",W.current=0,S.current=!1,Ce(!1)};return document.addEventListener("touchstart",Ie,{passive:!0}),document.addEventListener("touchmove",Ze,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ie),document.removeEventListener("touchmove",Ze),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[J,Ye,qe,gt,Pe,et,en,Ge]);const Oe=a.useCallback(()=>{const g=(T==null?void 0:T())??b??null;g&&G&&(re(g),ce(!0)),de("closing")},[T,b,G]);a.useEffect(()=>{const g=Ie=>{if(Ie.key==="Escape"){if(l&&d||J==="closing")return;Rt(),Oe();return}if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight"||J!=="open"||!Ye)return;Ie.preventDefault();const Ze=Ie.key==="ArrowLeft"?-1:1;Ie.repeat&&N.current===Ze||Kt(Ze)},ge=Ie=>{if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight")return;const Ze=Ie.key==="ArrowLeft"?-1:1;N.current===Ze&&Rt()},Re=()=>{Rt()};return window.addEventListener("keydown",g),window.addEventListener("keyup",ge),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",ge),window.removeEventListener("blur",Re),Rt()}},[J,l,d,Oe,Ye,Kt,Rt]),a.useEffect(()=>{J!=="open"&&Rt()},[J,Rt]);const Ke=()=>{J==="closing"||s||Oe()},Ne=J==="open",ze=J==="closing",ut=$e>0?Math.max(0,1-$e/500):1,_e=$e>0?Math.max(.35,1-$e/500):1,Je=a.useCallback(g=>{if(!(g.propertyName!=="transform"||!z.current)){if(le.current!==null){Dt();return}Pe(),qe(!1)}},[Pe,qe,Dt]),tt=J==="closing"?H??b:b,Wt=tt&&G&&(J==="opening"||ze)?dg(tt,G):void 0,Ct=We&&V?Mt(V,"center"):$e>0?`translateY(${$e}px)`:Wt,lt=G?_o(G,_):null,Nt=!!(tt&&G),At=Nt&&(J==="closing"||J==="open"&&O),Vt={position:"absolute",top:lt==null?void 0:lt.top,left:lt==null?void 0:lt.left,width:lt==null?void 0:lt.width,height:lt==null?void 0:lt.height,objectFit:"contain",transformOrigin:"top left",transform:Ct,opacity:$e>0?_e:Nt?1:J==="opening"||ze?0:1,transition:be&&!ye?"none":ye?`transform ${Ki}ms ${pn}`:ee?`transform ${$n}ms ${pn}, opacity ${$n}ms ${pn}`:At?`transform ${$n}ms ${pn}`:J==="opening"||ze?`opacity ${$n}ms ${pn}`:"none",pointerEvents:je&&Ne&&!We?"auto":"none",touchAction:je&&Ne?"none":void 0,zIndex:1,overflow:je?"hidden":void 0},zt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ne&&!We?"auto":"none"},Pt=(g,ge,Re="adjacent")=>{const Ie=Tt(g);if(!Ie)return{display:"none"};const Ze=Re==="far"?ge==="left"?"far-left":"far-right":ge==="left"?"left-adjacent":"right-adjacent",{start:Et}=ke!==null?ic(Ie,Ze,ke,_):{start:Re==="far"?rr(Ie,ge,_):Ai(Ie,ge,_)},Ve=_o(Et,_),it=Mt(g,Ze),jt=!We&&Re==="adjacent"&&Ne&&!ae?wg(Ie,ge,_):null,St=Re==="far"&&We&&ke===(ge==="left"?-1:1),cn=be&&!ye?!1:ye,un=Re==="adjacent"&&Ne&&ae&&!We;return{position:"absolute",top:Ve.top,left:Ve.left,width:Ve.width,height:Ve.height,objectFit:"contain",transform:it??(jt?`translate(${jt.x}px, ${jt.y}px)`:void 0),opacity:Re==="far"?Ne&&St?1:0:Ne?1:0,transition:cn?Re==="far"?`transform ${Ki}ms ${pn}`:`transform ${Ki}ms ${pn}, opacity ${$n}ms ${pn}`:un?`transform ${$n}ms ${pn}`:J==="opening"||ze?`opacity ${$n}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Qt=(g,ge)=>{const Re=Tt(g);return Re?xg(Ai(Re,ge,_),ge,_):null},wt=g=>ge=>{if(!s){if(M.current){M.current=!1;return}ge.stopPropagation(),bt(g)}},Gt=De?Qt(De,"left"):null,pt=ot?Qt(ot,"right"):null,Ft=Gt?_o(Gt,_):null,Bt=pt?_o(pt,_):null;return r.jsxs("div",{ref:R,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:Ke,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ne?ut:0,transition:be?"none":`opacity ${$n}ms ${pn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:E,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ne?1:0,transition:be?"none":`opacity ${$n}ms ${pn}`,pointerEvents:"none"},children:r.jsx(ec,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,onClose:Ke})})]}),Ne&&kt&&r.jsx(No,{media:kt,style:Pt(kt,"left","far"),onMeasure:Qe,onTransitionEnd:Je},`far-prev-${kt.url}`),Ne&&De&&r.jsxs(r.Fragment,{children:[r.jsx(No,{media:De,style:Pt(De,"left"),onMeasure:Qe,onTransitionEnd:Je},`prev-${De.url}`),Ft&&r.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(-1)})]}),Ne&&ot&&r.jsxs(r.Fragment,{children:[r.jsx(No,{media:ot,style:Pt(ot,"right"),onMeasure:Qe,onTransitionEnd:Je},`next-${ot.url}`),Bt&&r.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(1)})]}),Ne&&_t&&r.jsx(No,{media:_t,style:Pt(_t,"right","far"),onMeasure:Qe,onTransitionEnd:Je},`far-next-${_t.url}`),G&&V&&(je?r.jsx(Tg,{src:V.url,phase:J,onMediaElement:Jt,wrapperStyle:Vt,videoStyle:zt,onLoadedMetadata:ft,onTransitionEnd:Je},`${n}-${V.url}`):r.jsx("img",{ref:Jt,src:V.url,alt:V.name,onLoad:ft,onTransitionEnd:Je,style:Vt},`${n}-${V.url}`))]})}function Ig({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:d}=y.useScopedStyles(),{gridLayout:c,verticalGap:u,align:m="top",imageDisplay:x}=e,b=(x==null?void 0:x.display)==="cover",T=(x==null?void 0:x.ratioValue)??"1:1",f=(x==null?void 0:x.reversed)??!1,[L,$]=T.split(":").map(Number),C=`${f?$:L} / ${f?L:$}`,U=c.entryWidth??.2,k=c.columnsCount,j=y.scalingValue(U,n),I=y.scalingValue(c.horizontalGap??0,n),w=j,W=j,h={width:w,...b?{aspectRatio:C,height:"auto",overflow:"hidden"}:{height:"auto"}},S=b?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},M=a.useRef(null),[z,K]=a.useState(!1),[le,Y]=a.useState([]),[D,N]=a.useState(0),[F,A]=a.useState(0),[q,G]=a.useState(null),[Z,_]=a.useState({title1:"",title2:"",title3:""}),me=(()=>{const ue={},Se=M.current?getComputedStyle(M.current).getPropertyValue("--cntrl-article-width").trim():"";return Se&&(ue["--cntrl-article-width"]=Se),ue})(),v=!n||i||o,fe=a.useMemo(()=>og(d),[d]),J=t??[],de=J.length%k||k,$e=de<k&&J.length>0,oe=J.length-de,xe=$e?Math.floor((k-de)/2)+1:1,Q=a.useMemo(()=>pg(J),[J]),ye=a.useMemo(()=>yg(J),[J]),ve=(ue,Se,O)=>{if(n&&!o&&!i)return;const ce=Q.findIndex(re=>re.gridIndex===ue);if(ce<0)return;const H=Q[ce];A(ce),Y(H.items),N(Se),_(H.entry),G(O??null),K(!0)},ke=a.useCallback(()=>{K(!1),G(null)},[]),we=a.useCallback(()=>{const ue=Q[F];return!ue||!M.current?q:ug(M.current,ue.gridIndex,b?"cover":"contain")??q},[Q,F,q,b]),Me=a.useCallback(ue=>{if(Q.length>1){const Se=Q.length,O=(F+ue+Se)%Se,ce=Q[O],H=Math.min(D,ce.items.length-1);A(O),Y(ce.items),N(H),_(ce.entry);return}N(Se=>(Se+ue+le.length)%le.length)},[Q,F,D,le.length]),X=Q.length>1||le.length>1;return a.useEffect(()=>{if(!z||typeof document>"u")return;const ue=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ue}},[z]),a.useEffect(()=>{!n||o||i||K(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:fe}}),r.jsx(vg,{mediaList:ye}),r.jsx("div",{ref:M,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${m}`.trim(),style:{gridTemplateColumns:`repeat(${k}, ${j})`,rowGap:0,columnGap:I,width:y.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:y.scalingValue(u??0,n)},children:J.map((ue,Se)=>{const O=Ba(ue.gallery),ce=Da(O),H=ce.filter(Ce=>Ce.lightboxMedia).map(Ce=>Ce.lightboxMedia),re=Math.floor(Se/k)===Math.ceil(J.length/k)-1,ae=$e&&Se>=oe?`${xe+(Se-oe)}`:void 0,ne=ce[0],ie=ne!=null&&ne.lightboxMedia?H.findIndex(Ce=>Ce.url===ne.lightboxMedia.url):-1,be=r.jsx("div",{className:`${d}-item-image-wrapper`,style:h,children:ce.length>0&&r.jsx(Cg,{media:ne.displayMedia,gridIndex:Se,className:`${d}-item-${Vi(ne.displayMedia)?"video":"image"}`.trim(),style:S,onMediaClick:v&&ie>=0?Ce=>ve(Se,ie,tc(Ce.currentTarget,b?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,re?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:j,...ae?{gridColumn:ae}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:W}})}),r.jsx("a",{className:`${d}-item-image-link`,children:be}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:W}})})]})},Se)})}),z&&typeof document<"u"&&(()=>{const ue=(s?document.getElementById(s):null)??document.body;return gi.createPortal(r.jsx("div",{style:me,"data-selection":"none",children:r.jsx(Lg,{prefix:d,items:le,index:D,entry:Z,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:X,lightboxEntries:Q,entryIdx:F,layoutId:l,sourceRect:q,resolveCloseSourceRect:we,onClose:ke,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),ue)})()]})}const Rg=`import { CommonComponentProps } from '../props';
6285
+ `}const Rl={url:"",name:"",objectFit:"cover"},$n=500,Ki=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",rg=72,ag=50,lg=1e4,sg=650,cg=500;function dg(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,l=e.top-t.top;return`translate(${o}px, ${l}px) scale(${n}, ${i})`}function tc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=or(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function ug(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?tc(i,n):null}function pg(e){return e.reduce((t,n,i)=>{const o=Ba(n.gallery),s=Da(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return s.length===0||t.push({gridIndex:i,items:s,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function Zi(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function El(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Zi(e,i,n)}const mg=.03;function nc(e){return e.width*mg}const Dr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function _o(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function kl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function gg(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ga(e,t,n){const i=e.getBoundingClientRect(),o=i.width,l=i.height,s=t/n,d=o/l;if(s>d){const u=o/s;return{width:o,height:u,left:i.left,top:i.top+(l-u)/2}}const c=l*s;return{width:c,height:l,left:i.left+(o-c)/2,top:i.top}}function hg(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ga(e,t.width,t.height)}function fg(e,t){if(Vi(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function yg(e){const t=new Set,n=[];for(const i of e){const o=Ba(i.gallery),l=Da(o);for(const s of l)for(const d of[s.displayMedia,s.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function vg({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Vi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Ai(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:d}=n,c=nc(n);return t==="left"?{left:s+c-i,top:l,width:i,height:o}:{left:s+d-c,top:l,width:i,height:o}}function rr(e,t,n){const i=Ai(e,t,n);return{...i,left:2*i.left-e.left}}function xg(e,t,n){const{left:i,width:o}=n,l=nc(n);return t==="left"?{left:i,top:e.top,width:l,height:e.height}:{left:i+o-l,top:e.top,width:l,height:e.height}}function ic(e,t,n,i){const o=Ai(e,"left",i),l=Ai(e,"right",i),s=rr(e,"left",i),d=rr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:l,end:e};case"left-adjacent":return{start:o,end:s};case"far-right":return{start:d,end:l};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:l};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:l,end:d};case"far-left":return{start:s,end:o};default:return{start:e,end:e}}}function bg(e,t,n,i){const{start:o,end:l}=ic(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function wg(e,t,n){const i=Ai(e,t,n),o=rr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function oc(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function Ba(e){if(!e)return;if(oc(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.url?t:void 0,o=n!=null&&n.url?n:void 0;if(!(!i&&!o))return[{media:[o??i??Rl,i??o??Rl]}]}function Sg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function $g(e){const[t]=e.media;return t!=null&&t.url?t:null}function Da(e){if(!Array.isArray(e)||e.length===0)return[];if(oc(e)){const t=[];for(const n of e){const i=Sg(n);if(!i)continue;const o=$g(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Vi(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Cg({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Vi(e)?r.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):r.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Tg({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:l,onTransitionEnd:s}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:s,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:c=>c.stopPropagation(),style:o},e)})}function No({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Vi(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const l=o.currentTarget;l.videoWidth>0&&l.videoHeight>0&&(i==null||i(e.url,l.videoWidth,l.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const l=o.currentTarget;l.naturalWidth>0&&l.naturalHeight>0&&(i==null||i(e.url,l.naturalWidth,l.naturalHeight))},onTransitionEnd:n})}function Lg({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:m,layoutId:x,sourceRect:b,resolveCloseSourceRect:T,onClose:f,onPrev:L,onNext:$}){const R=a.useRef(null),P=a.useRef(null),C=a.useRef(null),U=a.useRef(new Map),[E,j]=a.useState(0),I=a.useRef(null),w=a.useRef(0),W=a.useRef(0),h=a.useRef("none"),S=a.useRef(!1),k=a.useRef(!1),z=a.useRef(!1),K=a.useRef(null),le=a.useRef(null),Y=a.useRef(null),D=a.useRef(()=>{}),N=a.useRef(null),F=a.useRef(null),A=a.useRef(null),q=a.useRef(!1),[G,Z]=a.useState(null),[_,me]=a.useState(Dr),[v,fe]=a.useState(0),[J,de]=a.useState("opening"),[$e,oe]=a.useState(0),[xe,Q]=a.useState(0),[ye,ve]=a.useState(!1),[ke,we]=a.useState(null),[Me,X]=a.useState(null),[ue,Se]=a.useState(null),[O,ce]=a.useState(!1),[H,re]=a.useState(null),[ae,ne]=a.useState(!1),ie=a.useRef(!1),[be,Ce]=a.useState(!1),[ee,pe]=a.useState(!1),Ae=a.useRef(n),se=a.useRef(void 0),V=t[n],je=V?Vi(V):!1,We=xe!==0||ye,et=!s&&(!l||!!d),Ye=c&&!s,st=u.length>1,mt=a.useCallback((g,ge)=>t.length<=1?null:t[(g+ge+t.length)%t.length]??null,[t]),De=st?Zi(u,m,-1):mt(n,-1),ot=st?Zi(u,m,1):mt(n,1),$t=ke===-1&&We?st&&Me!==null?Zi(u,Me,-1):ue!==null?mt(ue,-1):null:null,rt=ke===1&&We?st&&Me!==null?Zi(u,Me,1):ue!==null?mt(ue,1):null:null,Ue=$t&&$t.url!==(De==null?void 0:De.url)?$t:null,ht=rt&&rt.url!==(ot==null?void 0:ot.url)?rt:null,xt=De&&Ye?(()=>{const g=st?El(u,m,-1):t.length>2?mt((n-1+t.length)%t.length,-1):null;return g&&g.url!==De.url?g:null})():null,dt=ot&&Ye?(()=>{const g=st?El(u,m,1):t.length>2?mt((n+1)%t.length,1):null;return g&&g.url!==ot.url?g:null})():null,kt=Ue??xt,_t=ht??dt,Qe=a.useCallback((g,ge,Re)=>{if(!g||!ge||!Re)return;const Ie=U.current,Ze=Ie.get(g);(Ze==null?void 0:Ze.width)===ge&&(Ze==null?void 0:Ze.height)===Re||(Ie.set(g,{width:ge,height:Re}),j(Et=>Et+1))},[]),Tt=a.useCallback(g=>{if(!(g!=null&&g.url))return null;const ge=U.current.get(g.url);return hg(P.current,ge)},[E,v]),Lt=a.useCallback(()=>{if(!V)return;const g=Tt(V);if(g){Z(g);return}const ge=P.current;ge&&Z(kl(ge))},[V,Tt]),Ge=a.useCallback(g=>{if(st){const ge=u.length;X((m+g+ge)%ge),Se(null);return}t.length>1&&(Se((n+g+t.length)%t.length),X(null))},[st,u.length,m,t.length,n]),qe=a.useCallback(g=>{z.current=g,ve(g)},[]),Pe=a.useCallback(()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},[]),gt=a.useCallback(()=>{Pe(),K.current=window.setTimeout(()=>{Pe(),qe(!1)},Ki+32)},[Pe,qe]),It=a.useCallback(()=>{const g=R.current;if(!g){me({left:0,top:0,width:typeof window<"u"?window.innerWidth:Dr.width,height:typeof window<"u"?window.innerHeight:Dr.height});return}const ge=g.getBoundingClientRect();me({left:ge.left,top:ge.top,width:ge.width,height:ge.height})},[]),Mt=a.useCallback((g,ge)=>{if(We){if(be&&!ye)return`translate(${xe}px, 0px)`;if(ye&&ke!==null){const Re=Tt(g);if(!Re)return;const{x:Ie,y:Ze}=bg(Re,ge,ke,_);return`translate(${Ie}px, ${Ze}px)`}if(ye)return"translate(0px, 0px)"}},[We,be,ye,xe,ke,_,Tt]),Dt=a.useCallback(()=>{const g=le.current;le.current=null,Pe(),qe(!1),we(null),X(null),Se(null),Q(0),Ce(!1),S.current=!1,W.current=0,h.current="none",g===-1?L():g===1&&$()},[Pe,qe,L,$]),en=a.useCallback(()=>{Pe(),K.current=window.setTimeout(()=>{le.current!==null&&Dt()},Ki+32)},[Pe,Dt]),on=a.useCallback(()=>{Pe(),le.current=null,qe(!1),we(null),X(null),Se(null),Q(0),Ce(!1),S.current=!1,W.current=0,h.current="none"},[Pe,qe]),bt=a.useCallback(g=>{if(!(!Ye||!G)){if(z.current){if(le.current===g){Y.current=g,Dt();return}on()}Pe(),Ge(g),le.current=g,we(g),qe(!0),en()}},[Ye,G,Dt,on,Pe,Ge,qe,en]);D.current=bt;const Rt=a.useCallback(()=>{N.current=null,q.current=!1,F.current!==null&&(window.clearInterval(F.current),F.current=null),A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),Ut=a.useCallback(g=>{F.current!==null&&window.clearInterval(F.current);const ge=q.current?cg:sg;F.current=window.setInterval(()=>{D.current(g)},ge)},[]),Kt=a.useCallback(g=>{N.current!==g&&(Rt(),N.current=g,q.current=!1,D.current(g),Ut(g),A.current=window.setTimeout(()=>{A.current=null,N.current===g&&(q.current=!0,Ut(g))},lg))},[Rt,Ut]),ft=a.useCallback(()=>{const g=P.current;if(!g)return;const ge=V==null?void 0:V.url,Re=ge?U.current.get(ge):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){Z(ga(g,Re.width,Re.height));return}const Ie=C.current;if(Ie&&ge&&(Ie.src===ge||Ie.currentSrc===ge)){const{width:Et,height:Ve}=gg(Ie);if(Et&&Ve){Qe(ge,Et,Ve),Z(ga(g,Et,Ve));return}}const Ze=kl(g);!Ze.width||!Ze.height||Z(Ze)},[V==null?void 0:V.url,Qe]),Jt=a.useCallback(g=>{if(C.current=g,!!g){if(g instanceof HTMLVideoElement){g.readyState>=1&&g.videoWidth>0&&ft();return}g.complete&&g.naturalWidth>0&&ft()}},[ft]),Te=a.useCallback(()=>{It(),ft(),fe(g=>g+1)},[It,ft]);a.useEffect(()=>{Te();const g=P.current,ge=R.current,Re=new ResizeObserver(()=>Te());return g&&Re.observe(g),ge&&Re.observe(ge),window.addEventListener("resize",Te),()=>{Re.disconnect(),window.removeEventListener("resize",Te)}},[Te,n,x]),a.useLayoutEffect(()=>{if(!V)return;const g=C.current;if(g){if(g instanceof HTMLImageElement&&g.complete&&g.naturalWidth>0){ft();return}g instanceof HTMLVideoElement&&g.readyState>=1&&g.videoWidth>0&&ft()}},[V==null?void 0:V.url,n,ft]),a.useEffect(()=>{Lt()},[Lt,E]),a.useEffect(()=>{const g=new Set,ge=[],Re=Ie=>{!(Ie!=null&&Ie.url)||g.has(Ie.url)||(g.add(Ie.url),ge.push(Ie))};t.forEach(Re),u.forEach(Ie=>Ie.items.forEach(Re)),ge.forEach(Ie=>{U.current.has(Ie.url)||fg(Ie,Qe)})},[t,u,Qe]),a.useEffect(()=>{if(J!=="opening"||!G)return;if(!b){de("open");return}ce(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce(!0),de("open")})});return()=>cancelAnimationFrame(g)},[J,G,b]),a.useEffect(()=>{if(J!=="closing")return;const g=setTimeout(()=>f(),$n);return()=>clearTimeout(g)},[J,f]),a.useEffect(()=>()=>{Pe()},[Pe]),a.useLayoutEffect(()=>{Ae.current===n&&se.current===(V==null?void 0:V.url)||(Pe(),le.current=null,we(null),X(null),Se(null),oe(0),Q(0),qe(!1),pe(!1),Ce(!1),w.current=0,W.current=0,h.current="none",S.current=!1,I.current=null,k.current=!1,C.current=null,Lt(),Ae.current=n,se.current=V==null?void 0:V.url)},[n,V==null?void 0:V.url,qe,Pe,Lt]),a.useLayoutEffect(()=>{const g=Y.current;g!==null&&(Y.current=null,requestAnimationFrame(()=>{D.current(g)}))},[n,m,V==null?void 0:V.url]),a.useLayoutEffect(()=>{if(J==="opening"){ie.current=!1,ne(!1);return}if(J!=="open"||ie.current)return;if(!De&&!ot){ie.current=!0;return}ne(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ne(!0),ie.current=!0})});return()=>cancelAnimationFrame(g)},[J,De==null?void 0:De.url,ot==null?void 0:ot.url]),a.useEffect(()=>{if(J!=="open")return;const g=()=>{const Ve=it=>{it.stopPropagation(),it.preventDefault(),document.removeEventListener("click",Ve,!0)};document.addEventListener("click",Ve,!0)},ge=Ve=>{const it=Ve<0?1:-1;Pe(),Ge(it),le.current=it,we(it),qe(!0),en()},Re=Ve=>{if(Math.abs(Ve)>ag&&Ye){ge(Ve);return}le.current=null,we(null),X(null),Se(null),qe(!0),Q(0),gt()},Ie=Ve=>{if(Ve.touches.length!==1||z.current)return;const it=Ve.touches[0];k.current=!0,I.current={x:it.clientX,y:it.clientY},h.current="none",W.current=0,S.current=!1},Ze=Ve=>{if(!I.current||Ve.touches.length!==1||z.current)return;const it=Ve.touches[0],jt=it.clientX-I.current.x,St=it.clientY-I.current.y;if(h.current==="none"){if(Math.abs(jt)<10&&Math.abs(St)<10)return;if(Math.abs(jt)>Math.abs(St)){if(!Ye)return;h.current="horizontal"}else if(St>0){if(!et)return;h.current="vertical"}else return}if(h.current==="horizontal"){S.current=!0,Ce(!0),W.current=jt,Q(jt),Ve.preventDefault();return}h.current==="vertical"&&(S.current=!0,Ce(!0),w.current=St,oe(St),Ve.preventDefault())},Et=()=>{if(!I.current)return;const Ve=h.current,it=S.current;if(it&&Ve==="horizontal")Re(W.current),g();else if(it&&Ve==="vertical"){const jt=w.current;if(et&&jt>rg){const St=window.innerHeight;w.current=St,pe(!0),oe(St),de("closing")}else w.current=0,oe(0);g()}else Ve==="horizontal"&&Math.abs(W.current)>0&&(Re(W.current),g());I.current=null,h.current="none",W.current=0,S.current=!1,Ce(!1)};return document.addEventListener("touchstart",Ie,{passive:!0}),document.addEventListener("touchmove",Ze,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ie),document.removeEventListener("touchmove",Ze),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[J,Ye,qe,gt,Pe,et,en,Ge]);const Oe=a.useCallback(()=>{const g=(T==null?void 0:T())??b??null;g&&G&&(re(g),ce(!0)),de("closing")},[T,b,G]);a.useEffect(()=>{const g=Ie=>{if(Ie.key==="Escape"){if(l&&d||J==="closing")return;Rt(),Oe();return}if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight"||J!=="open"||!Ye)return;Ie.preventDefault();const Ze=Ie.key==="ArrowLeft"?-1:1;Ie.repeat&&N.current===Ze||Kt(Ze)},ge=Ie=>{if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight")return;const Ze=Ie.key==="ArrowLeft"?-1:1;N.current===Ze&&Rt()},Re=()=>{Rt()};return window.addEventListener("keydown",g),window.addEventListener("keyup",ge),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",ge),window.removeEventListener("blur",Re),Rt()}},[J,l,d,Oe,Ye,Kt,Rt]),a.useEffect(()=>{J!=="open"&&Rt()},[J,Rt]);const Ke=()=>{J==="closing"||s||Oe()},Ne=J==="open",ze=J==="closing",ut=$e>0?Math.max(0,1-$e/500):1,_e=$e>0?Math.max(.35,1-$e/500):1,Je=a.useCallback(g=>{if(!(g.propertyName!=="transform"||!z.current)){if(le.current!==null){Dt();return}Pe(),qe(!1)}},[Pe,qe,Dt]),tt=J==="closing"?H??b:b,Wt=tt&&G&&(J==="opening"||ze)?dg(tt,G):void 0,Ct=We&&V?Mt(V,"center"):$e>0?`translateY(${$e}px)`:Wt,lt=G?_o(G,_):null,Nt=!!(tt&&G),At=Nt&&(J==="closing"||J==="open"&&O),Vt={position:"absolute",top:lt==null?void 0:lt.top,left:lt==null?void 0:lt.left,width:lt==null?void 0:lt.width,height:lt==null?void 0:lt.height,objectFit:"contain",transformOrigin:"top left",transform:Ct,opacity:$e>0?_e:Nt?1:J==="opening"||ze?0:1,transition:be&&!ye?"none":ye?`transform ${Ki}ms ${pn}`:ee?`transform ${$n}ms ${pn}, opacity ${$n}ms ${pn}`:At?`transform ${$n}ms ${pn}`:J==="opening"||ze?`opacity ${$n}ms ${pn}`:"none",pointerEvents:je&&Ne&&!We?"auto":"none",touchAction:je&&Ne?"none":void 0,zIndex:1,overflow:je?"hidden":void 0},zt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ne&&!We?"auto":"none"},Pt=(g,ge,Re="adjacent")=>{const Ie=Tt(g);if(!Ie)return{display:"none"};const Ze=Re==="far"?ge==="left"?"far-left":"far-right":ge==="left"?"left-adjacent":"right-adjacent",{start:Et}=ke!==null?ic(Ie,Ze,ke,_):{start:Re==="far"?rr(Ie,ge,_):Ai(Ie,ge,_)},Ve=_o(Et,_),it=Mt(g,Ze),jt=!We&&Re==="adjacent"&&Ne&&!ae?wg(Ie,ge,_):null,St=Re==="far"&&We&&ke===(ge==="left"?-1:1),cn=be&&!ye?!1:ye,un=Re==="adjacent"&&Ne&&ae&&!We;return{position:"absolute",top:Ve.top,left:Ve.left,width:Ve.width,height:Ve.height,objectFit:"contain",transform:it??(jt?`translate(${jt.x}px, ${jt.y}px)`:void 0),opacity:Re==="far"?Ne&&St?1:0:Ne?1:0,transition:cn?Re==="far"?`transform ${Ki}ms ${pn}`:`transform ${Ki}ms ${pn}, opacity ${$n}ms ${pn}`:un?`transform ${$n}ms ${pn}`:J==="opening"||ze?`opacity ${$n}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Qt=(g,ge)=>{const Re=Tt(g);return Re?xg(Ai(Re,ge,_),ge,_):null},wt=g=>ge=>{if(!s){if(k.current){k.current=!1;return}ge.stopPropagation(),bt(g)}},Gt=De?Qt(De,"left"):null,pt=ot?Qt(ot,"right"):null,Ft=Gt?_o(Gt,_):null,Bt=pt?_o(pt,_):null;return r.jsxs("div",{ref:R,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:Ke,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ne?ut:0,transition:be?"none":`opacity ${$n}ms ${pn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:P,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ne?1:0,transition:be?"none":`opacity ${$n}ms ${pn}`,pointerEvents:"none"},children:r.jsx(ec,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,onClose:Ke})})]}),Ne&&kt&&r.jsx(No,{media:kt,style:Pt(kt,"left","far"),onMeasure:Qe,onTransitionEnd:Je},`far-prev-${kt.url}`),Ne&&De&&r.jsxs(r.Fragment,{children:[r.jsx(No,{media:De,style:Pt(De,"left"),onMeasure:Qe,onTransitionEnd:Je},`prev-${De.url}`),Ft&&r.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(-1)})]}),Ne&&ot&&r.jsxs(r.Fragment,{children:[r.jsx(No,{media:ot,style:Pt(ot,"right"),onMeasure:Qe,onTransitionEnd:Je},`next-${ot.url}`),Bt&&r.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(1)})]}),Ne&&_t&&r.jsx(No,{media:_t,style:Pt(_t,"right","far"),onMeasure:Qe,onTransitionEnd:Je},`far-next-${_t.url}`),G&&V&&(je?r.jsx(Tg,{src:V.url,phase:J,onMediaElement:Jt,wrapperStyle:Vt,videoStyle:zt,onLoadedMetadata:ft,onTransitionEnd:Je},`${n}-${V.url}`):r.jsx("img",{ref:Jt,src:V.url,alt:V.name,onLoad:ft,onTransitionEnd:Je,style:Vt},`${n}-${V.url}`))]})}function Ig({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:d}=y.useScopedStyles(),{gridLayout:c,verticalGap:u,align:m="top",imageDisplay:x}=e,b=(x==null?void 0:x.display)==="cover",T=(x==null?void 0:x.ratioValue)??"1:1",f=(x==null?void 0:x.reversed)??!1,[L,$]=T.split(":").map(Number),C=`${f?$:L} / ${f?L:$}`,U=c.entryWidth??.2,E=c.columnsCount,j=y.scalingValue(U,n),I=y.scalingValue(c.horizontalGap??0,n),w=j,W=j,h={width:w,...b?{aspectRatio:C,height:"auto",overflow:"hidden"}:{height:"auto"}},S=b?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},k=a.useRef(null),[z,K]=a.useState(!1),[le,Y]=a.useState([]),[D,N]=a.useState(0),[F,A]=a.useState(0),[q,G]=a.useState(null),[Z,_]=a.useState({title1:"",title2:"",title3:""}),me=(()=>{const ue={},Se=k.current?getComputedStyle(k.current).getPropertyValue("--cntrl-article-width").trim():"";return Se&&(ue["--cntrl-article-width"]=Se),ue})(),v=!n||i||o,fe=a.useMemo(()=>og(d),[d]),J=t??[],de=J.length%E||E,$e=de<E&&J.length>0,oe=J.length-de,xe=$e?Math.floor((E-de)/2)+1:1,Q=a.useMemo(()=>pg(J),[J]),ye=a.useMemo(()=>yg(J),[J]),ve=(ue,Se,O)=>{if(n&&!o&&!i)return;const ce=Q.findIndex(re=>re.gridIndex===ue);if(ce<0)return;const H=Q[ce];A(ce),Y(H.items),N(Se),_(H.entry),G(O??null),K(!0)},ke=a.useCallback(()=>{K(!1),G(null)},[]),we=a.useCallback(()=>{const ue=Q[F];return!ue||!k.current?q:ug(k.current,ue.gridIndex,b?"cover":"contain")??q},[Q,F,q,b]),Me=a.useCallback(ue=>{if(Q.length>1){const Se=Q.length,O=(F+ue+Se)%Se,ce=Q[O],H=Math.min(D,ce.items.length-1);A(O),Y(ce.items),N(H),_(ce.entry);return}N(Se=>(Se+ue+le.length)%le.length)},[Q,F,D,le.length]),X=Q.length>1||le.length>1;return a.useEffect(()=>{if(!z||typeof document>"u")return;const ue=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ue}},[z]),a.useEffect(()=>{!n||o||i||K(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:fe}}),r.jsx(vg,{mediaList:ye}),r.jsx("div",{ref:k,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${m}`.trim(),style:{gridTemplateColumns:`repeat(${E}, ${j})`,rowGap:0,columnGap:I,width:y.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:y.scalingValue(u??0,n)},children:J.map((ue,Se)=>{const O=Ba(ue.gallery),ce=Da(O),H=ce.filter(Ce=>Ce.lightboxMedia).map(Ce=>Ce.lightboxMedia),re=Math.floor(Se/E)===Math.ceil(J.length/E)-1,ae=$e&&Se>=oe?`${xe+(Se-oe)}`:void 0,ne=ce[0],ie=ne!=null&&ne.lightboxMedia?H.findIndex(Ce=>Ce.url===ne.lightboxMedia.url):-1,be=r.jsx("div",{className:`${d}-item-image-wrapper`,style:h,children:ce.length>0&&r.jsx(Cg,{media:ne.displayMedia,gridIndex:Se,className:`${d}-item-${Vi(ne.displayMedia)?"video":"image"}`.trim(),style:S,onMediaClick:v&&ie>=0?Ce=>ve(Se,ie,tc(Ce.currentTarget,b?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,re?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:j,...ae?{gridColumn:ae}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:W}})}),r.jsx("a",{className:`${d}-item-image-link`,children:be}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:W}})})]})},Se)})}),z&&typeof document<"u"&&(()=>{const ue=(s?document.getElementById(s):null)??document.body;return gi.createPortal(r.jsx("div",{style:me,"data-selection":"none",children:r.jsx(Lg,{prefix:d,items:le,index:D,entry:Z,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:X,lightboxEntries:Q,entryIdx:F,layoutId:l,sourceRect:q,resolveCloseSourceRect:we,onClose:ke,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),ue)})()]})}const Rg=`import { CommonComponentProps } from '../props';
6286
6286
  import { scalingValue, useScopedStyles } from '../utils/index';
6287
6287
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
6288
6288
  import { createPortal } from 'react-dom';
@@ -9067,7 +9067,7 @@ a.${e}-list-item {
9067
9067
  overflow-wrap: anywhere;
9068
9068
  word-break: break-word;
9069
9069
  }
9070
- `}const Un=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Va=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",mo=[...Va,An],Tr=["A","B","C","D","E"];function rc(e){return`${e}ColumnVerticalAlign`}const ha=["Top","Center","Bottom"];function Ga(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Tr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Vg(e){const t=Ga(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Gg(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Tr.includes(n)?n:null}function ac(e,t,n){const i=Gg(e);return i?i===t?!1:Vg(n[rc(i)]):!0}function go(e){const t=Ga(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Tr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function qg(e,t,n){if(lc(e,t,n))return go(e);const i=go(e);return i.kind==="baseline"?{kind:"top"}:i}function Kg(e){const t=go(e);return t.kind==="baseline"?{kind:"top"}:t}function lc(e,t,n){return ac(e,n,t)?go(e).kind==="baseline":!1}function Ug(e){const t={};let n=!1;for(const i of Tr){const o=rc(i),l=e[o];if(e.type==="b"){const s=String(l??"Top").trim();s!=="Top"&&s!=="Center"&&s!=="Bottom"&&(t[o]="Top",n=!0);continue}ac(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Xg(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Yg(e){const t=go(e).kind;return t==="baseline"?"center":t}function Zg(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function _l(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Jg(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),l=o-i;return n.remove(),l}function qr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=Jg(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+s;const d=l.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+s}function Qg(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const l=o.querySelector(`.${n}`);l&&(l.style.minHeight=`${i}px`,l.style.height=`${i}px`)}),i)}function eh(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const th={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function vt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const nh={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function ih(e){return[vt(e,"textFontFamily"),vt(e,"textFontSettings"),{type:"row",items:[vt(e,"textFontSize"),vt(e,"textLineHeight"),vt(e,"textLetterSpacing"),vt(e,"textWordSpacing")]},vt(e,"textTextAlign"),vt(e,"textTextAppearance"),`${e}VerticalAlign`]}function oh(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(mo.map(e=>[nh[e],ih(e)]))}}function ar(e,t){const n=i=>{const o=vt(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===An?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Nl(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return dn(Xt(n,t))}function Hl(e,t,n,i){const o=ar(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function jl(e,t,n,i){const o=ar(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:y.scalingValue((l-s)/2,i)}}const yn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Wi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],_i=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ni=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],rh={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},ah=["hover","focus","filled","success","error"],Ol=.004,$i=.004,Kr=$i,qa=50,ho=1440,fo=qa/ho;function sc(e){const t=typeof e=="number"&&e>0?e:ho;return qa/t}function lh(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const o=parseFloat(n);if(Number.isFinite(o)&&o>0)return o}const i=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(i){const o=parseFloat(i);if(Number.isFinite(o)&&o>0)return o}t=t.parentElement}return ho}const cc={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function no(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function sh(e,t=1){const n=t/e;return Object.fromEntries(yn.map(i=>[i,n]))}function ch(){return Object.fromEntries([...Wi.map(e=>[e,0]),..._i.map(e=>[e,0])])}function dh(){return Object.fromEntries(Ni.map(e=>[e,0]))}function Ho(e){return Object.fromEntries(yn.map(t=>[t,typeof e[t]=="number"?e[t]:cc[t]]))}function dc(e,t,n){const i=e-fo,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const l=i/o;return{paddingLeft:t*l,paddingRight:n*l}}function Zo(e,t,n){const i=Ka(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((l,s)=>l+s,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function uh(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=Wi[o],s=_i[o],d=typeof n[l]=="number"?n[l]:0,c=typeof n[s]=="number"?n[s]:0,u=dc(t[o]??0,d,c);u.paddingLeft!==d&&(i[l]=u.paddingLeft),u.paddingRight!==c&&(i[s]=u.paddingRight)}return i}function Ka(e,t,n){if(e<=0)return[];const i=yn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),s=o.reduce((u,m)=>u+m,0)+fo;if(t>=s)return i;const d=[...o];let c=s-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const m=d[u]-fo;if(m<=0)continue;const x=Math.min(c,m);d[u]-=x,c-=x}return[...d,i[e-1]]}function ph(e,t,n){if(e<=1)return{};const i=Ka(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=yn[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function zl(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Un]}function mh(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function gh(e,t,n,i){const o=Math.min(i,e.length,yn.length),l={};for(let s=0;s<o;s+=1){const d=e[s],c=t.indexOf(d);if(c===-1)continue;const u=yn[c],m=Wi[c],x=_i[c],b=Ni[c],T=yn[s],f=Wi[s],L=_i[s],$=Ni[s],R=n[u],E=n[m],C=n[x],U=n[b];typeof R=="number"&&(l[T]=R),typeof E=="number"&&(l[f]=E),typeof C=="number"&&(l[L]=C),typeof U=="number"&&(l[$]=U)}return l}function uc(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of n)if(e[i]!==t[i])return!0;return!1}function hh(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=no(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...sh(n,o),...ch()};if(l)for(const d of Ni)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,dh());return uc(e,s)?s:e}function fh(e,t,n){const i=Ug(e);i&&(e={...e,...i});const o=sc(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,d=no(e),c=no(t),u=e.type==="b"||e.type===void 0&&t.type==="b",m=typeof l=="number"?l:typeof s=="number"?s:Un.length,x=C=>{if(u)return C;const U=Ho({...t,...C}),k=no(C),j=Zo(m,k,U),I=uh(m,j,{...t,...C});return Object.keys(I).length===0?C:{...C,...I}};if(typeof l=="number"&&l!==s)return e;const b=zl(e),T=zl(t);if(!mh(b,T))return x({...e,...gh(b,T,t,m)});if(d<c&&typeof m=="number"&&!u){const C=Ho({...t,...e});return x({...e,...ph(m,d,C)})}if(u){const C=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,U=Math.max(0,(d-o)/2);return C>U?{...e,textPaddingLR:U}:e}const f=Ho({...t,...e}),L=Zo(m,c,Ho(t)),R=Zo(m,d,f).some((C,U)=>C<(L[U]??C)),E=yn.some(C=>{const U=e[C],k=t[C];return typeof U=="number"&&typeof k=="number"&&U!==k});return R||E?x(e):e}function yh(e,t,n,i){const o=t.slice(0,e).reduce((s,d)=>s+d,0),l=n.slice(e+1,t.length-1).reduce((s,d)=>s+d,0);return Math.max(fo,i-o-l-fo)}function vh(e,t){return Math.random()*(t-e)+e}function xh(e){return Object.fromEntries(yn.map(t=>[t,typeof e[t]=="number"?e[t]:cc[t]]))}function Ur(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function bh(e,t,n,i,o,l){return e.slice(0,t).map((s,d)=>{const c=Wi[d],u=_i[d],m=Ni[d];return{key:s,textPrefix:th[s],widthKey:yn[d],width:n[yn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:m,paddingLeft:i[c],paddingRight:o[u],paddingBottom:l[m]}})}function wh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:d}){const{prefix:c}=y.useScopedStyles(),u=!!o,{columns:m,type:x,wrapperWidth:b,entriesCount:T,cellMinHeight:f,dividerWidth:L,showVisibility:$,cut:R,showCut:E,cutCellMinHeight:C,cutLabel:U,imageSize:k,imageOnHover:j,entryHoverEffect:I,entryHoverShowOption:w,rowPaddingTop:W,rowPaddingBottom:h,rowPaddingTopB:S,columnsOrder:M,textPaddingLR:z,textColor:K,backgroundColor:le,dividerColor:Y,textHoverColor:D,backgroundHoverColor:N,dividerHoverColor:F}=e,[A,q]=a.useState(void 0),[G,Z]=a.useState(null),_=j==="on"&&(!n||i),me=(R??0)>0,v=x==="b",fe=a.useRef(null),J=a.useRef(null),[de,$e]=a.useState(null),[oe,xe]=a.useState(ho),Q=sc(oe),ye=Math.max(0,((b??0)-Q)/2),ve=Math.min(z??0,ye),ke=Math.max(ve,$i),we=((b??0)+Q)/2;a.useLayoutEffect(()=>{if(!n){xe(ho);return}const Te=()=>{xe(lh(fe.current))};Te();const Oe=fe.current;if(!Oe)return;const Ke=new ResizeObserver(Te);Ke.observe(Oe);let Ne=Oe;for(;Ne&&!Ne.style.getPropertyValue("--cntrl-article-width");)Ne=Ne.parentElement;return Ne&&Ke.observe(Ne),()=>Ke.disconnect()},[n,s]),a.useEffect(()=>{q(void 0)},[R,E,t,T]),a.useEffect(()=>{n&&!i&&q(void 0)},[n,i]);const Me=y.buildColorVars(c,{textColor:K,backgroundColor:le,dividerColor:Y,textHoverColor:D,backgroundHoverColor:N,dividerHoverColor:F},rh,ah),X=l&&l!=="default"?`${c}-state-${l}`:"",Se=`${!n||i?I==="default"?`${c}-entry-hover-default`:I==="blinds"?`${c}-entry-hover-blinds`:I==="reveal"?`${c}-entry-hover-reveal`:"":""} ${X}`.trim(),O=I==="reveal"&&(!n||i),ce=($==null?void 0:$[0])??!1,H=($==null?void 0:$[1])??!1,re=a.useRef(e),ae=a.useRef(s);a.useEffect(()=>{if(!d||!n){re.current=e,ae.current=s;return}if(ae.current!==s){re.current=e,ae.current=s;return}const Te=re.current;if(!(Te!==e))return;if(typeof Te.columns=="number"&&typeof e.columns=="number"&&Te.columns!==e.columns){re.current=e;return}const Ke=fh(e,Te,{designWidth:oe});re.current=e,uc(e,Ke)&&d(Ke)},[e,d,n,s,oe]);const ne=a.useMemo(()=>xh(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ie=a.useMemo(()=>Ur(e,Wi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),be=a.useMemo(()=>Ur(e,_i),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ce=a.useMemo(()=>Ur(e,Ni),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ee=a.useMemo(()=>Array.isArray(M)&&M.length>0?M:[...Un],[M]),pe=a.useMemo(()=>bh(ee,m,ne,ie,be,Ce),[ee,m,ne,ie,be,Ce]),Ae=no(e),se=a.useMemo(()=>yn.slice(0,m).map(Te=>ne[Te]),[m,ne]),V=a.useMemo(()=>Ka(m,Ae,ne),[m,Ae,ne]),je=a.useMemo(()=>Zo(m,Ae,ne),[m,Ae,ne]),We=a.useMemo(()=>pe.map((Te,Oe)=>dc(je[Oe]??0,Te.paddingLeft,Te.paddingRight)),[pe,je]),et=a.useMemo(()=>{const Te=T===0?1/0:T;return(t??[]).slice(0,Te).map((Ke,Ne)=>({id:Ne,cells:Object.fromEntries(Un.map(ze=>[ze,Ke[ze]??""])),image:Ke.image,link:Ke.link}))},[t,T]),Ye=me?A??R:et.length,st=a.useMemo(()=>me?et.slice(0,Ye):et,[et,me,Ye]),mt=me&&Ye<et.length,De=st.length>1||mt,ot=[ce?`${c}-divider-top`:"",H||De?`${c}-divider-bottom`:""].filter(Boolean).join(" "),$t=!n||i,rt=()=>{if(!$t)return;const Te=A??R;if(!E){q(et.length);return}q(Math.min(Te+E,et.length))},Ue=Te=>y.scalingValue(Te,n??!1),ht=v?S??0:W??0,xt=h??0,dt=f??0,kt=ht+dt/2,_t=Math.max(xt,Kr),Qe=Fl(0,st.length,ce,H,mt,L??0,n??!1).borderTopWidth,Tt=de!=null?`${de}px`:`calc(${Qe} + ${Ue(kt)})`,Lt=v?"rowPaddingTopB":"rowPaddingTop",Ge=pe[0],qe=pe[pe.length-1],Pe=We[0],gt=We[We.length-1],It=Ge&&Pe?Math.max(Pe.paddingLeft,$i):0,Mt=qe&&gt?Math.max(gt.paddingRight,$i):0,Dt=Ae,en=Te=>{const Oe=fe.current;if(!Oe)return{x:0,y:0};const Ke=Oe.getBoundingClientRect();return{x:Te.clientX-Ke.left+Wl,y:Te.clientY-Ke.top+Wl}},on=(Te,Oe)=>{if(!_)return;const Ke=Te.image;if(!(Ke!=null&&Ke.url)){Z(null);return}const{x:Ne,y:ze}=en(Oe),ut=(k==null?void 0:k.min)??80,_e=(k==null?void 0:k.max)??320,Je=(G==null?void 0:G.rowId)===Te.id?G.widthPx:vh(ut,_e);Z({rowId:Te.id,url:Ke.url,objectFit:"contain",isVideo:jg(Ke),widthPx:Je,x:Ne,y:ze})},bt=Te=>{if(!_||!G)return;const{x:Oe,y:Ke}=en(Te);Z(Ne=>!Ne||Ne.x===Oe&&Ne.y===Ke?Ne:{...Ne,x:Oe,y:Ke})},Rt=()=>{Z(null)},Ut=Te=>{O&&Pl(Te,c),_&&Z(null)},Kt=Te=>{O&&Al(Te,c)};a.useLayoutEffect(()=>{if(!u||v){$e(null);return}const Te=J.current,Oe=Te==null?void 0:Te.parentElement;if(!Te||!Oe){$e(null);return}const Ke=()=>{const ze=Te.querySelector("[data-list-row]");if(!ze){$e(null);return}const ut=Oe.getBoundingClientRect(),_e=ze.getBoundingClientRect();$e(_e.top-ut.top+_e.height/2)};Ke();const Ne=new ResizeObserver(Ke);return Ne.observe(Te),Ne.observe(Oe),()=>Ne.disconnect()},[u,v,st,ht,xt,dt,t,e,pe,je,oe,L,ce,H,mt]);const ft=a.useMemo(()=>!v&&Va.some(Te=>{const Oe=Te.charAt(0),Ke=e[`${Te}VerticalAlign`];return lc(Ke,e,Oe)}),[v,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Je;const Te=fe.current;if(!Te)return;const Oe=()=>{Te.querySelectorAll("[data-list-col]").forEach(tt=>{tt.style.transform="";const Wt=tt.querySelector(`.${c}-list-col`);Wt&&(Wt.style.minHeight="",Wt.style.height="");const Ct=tt.querySelector(`.${c}-list-col-title`);Ct&&(Ct.style.transform="")})};if(v||!ft){Oe();return}const Ke=()=>{const tt=Array.from(Te.querySelectorAll("[data-list-row]")),Wt=`${c}-list-col`,Ct=`${c}-baseline-probe`;tt.forEach(lt=>{lt.querySelectorAll("[data-list-col]").forEach(Nt=>{Nt.style.transform="";const At=Nt.querySelector(`.${Wt}`);At&&(At.style.minHeight="",At.style.height="");const Vt=Nt.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})}),tt.forEach(lt=>{const Nt=Array.from(lt.querySelectorAll("[data-list-col]"));Qg(lt,Nt,Wt)}),Te.offsetHeight,tt.forEach(lt=>{const Nt=Array.from(lt.querySelectorAll("[data-list-col]")),At=lt.getBoundingClientRect().top,Vt=new Map,zt=Nt.map(wt=>{const Gt=wt.querySelector(`.${c}-list-col-title`),pt={el:wt,titleEl:Gt,letter:wt.getAttribute("data-col-letter")??"",kind:wt.getAttribute("data-valign")??"top",anchor:wt.getAttribute("data-valign-anchor")};return Vt.set(pt.letter,pt),pt}),Pt=new Map,Qt=(wt,Gt)=>{const pt=Pt.get(wt.letter);if(pt!==void 0)return pt;const Ft=wt.anchor?Vt.get(wt.anchor):void 0;if(wt.kind!=="baseline"||!Ft||Gt.has(wt.letter)){const Ie=qr(wt,At,Wt,Ct);return Pt.set(wt.letter,Ie),Ie}Gt.add(wt.letter);const Bt=Qt(Ft,Gt);Gt.delete(wt.letter);const g=qr(wt,At,Wt,Ct),ge=Bt-g;eh(wt.titleEl,ge);const Re=qr(wt,At,Wt,Ct);return Pt.set(wt.letter,Re),Re};zt.forEach(wt=>Qt(wt,new Set))})};let Ne=null;const ze=()=>{Ne===null&&(Ne=requestAnimationFrame(()=>{Ne=null,Ke()}))};Ke();const ut=new ResizeObserver(()=>ze());ut.observe(Te);let _e=!1;return typeof document<"u"&&((Je=document.fonts)!=null&&Je.ready)&&document.fonts.ready.then(()=>{_e||ze()}),()=>{_e=!0,Ne!==null&&(cancelAnimationFrame(Ne),Ne=null),ut.disconnect(),Oe()}},[ft,v,e,t,oe,st,je]);const Jt=a.useMemo(()=>Dg(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Jt}}),r.jsx("div",{style:Me,children:r.jsxs("div",{ref:fe,className:`${c}-wrapper ${Se}${ot?` ${ot}`:""}${v?` ${c}-type-b`:""}`.trim(),style:{width:y.scalingValue(b??0,n),...!v&&u?{[`--${c}-first-entry-handle-top`]:Tt}:{}},onMouseMove:_?bt:void 0,onMouseLeave:_?Rt:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[st.map((Te,Oe)=>{var ut;const Ke=(((ut=Te.link)==null?void 0:ut.length)??0)>0,Ne=Ke&&(!n||i)?"a":"div",ze=Fl(Oe,st.length,ce,H,mt,L??0,n??!1);return r.jsxs(Ne,{ref:Oe===0?_e=>{J.current=_e}:void 0,className:`${c}-list-item${Ke||w==="always"?` ${c}-list-item-has-link`:""}`,...Ke?{href:Te.link,target:"_blank"}:{},style:ze,onMouseEnter:_e=>{O&&(Ke||w==="always")&&Pl(_e,c),_&&on(Te,_e)},onMouseLeave:_e=>{O&&(Ke||w==="always")&&Al(_e,c)},children:[ht>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(ht)}}),r.jsxs("div",{className:`${c}-list-cols-row${v?"":` ${c}-list-cols-row-h`}${u&&Oe===0&&v?` ${c}-list-cols-row-controls`:""}`,...v?{}:{"data-list-row":""},style:v?void 0:{minHeight:Ue(dt)},children:[pe.map((_e,Je)=>{const tt=Je===pe.length-1,Wt=We[Je],Ct=_e.paddingBottom,lt=zg(Te.cells[_e.key]),Nt=v&&lt&&Ct>0,At=v?{minHeight:Ue(dt)}:{width:Ue(je[Je])},Vt=v?{paddingLeft:Ue(ve),paddingRight:Ue(ve)}:{paddingLeft:Ue(Wt.paddingLeft),paddingRight:Ue(Wt.paddingRight)},zt=_e.textPrefix.charAt(0),Pt=v?Kg(e[`${_e.textPrefix}VerticalAlign`]):qg(e[`${_e.textPrefix}VerticalAlign`],e,zt),Qt=v&&lt&&u&&Oe===0;return v&&!lt?null:r.jsxs("div",{className:v?`${c}-list-col-wrap`:void 0,...v?{}:{"data-list-col":"","data-col-letter":zt,"data-valign":Pt.kind,...Pt.kind==="baseline"?{"data-valign-anchor":Pt.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${tt?` ${c}-list-col-last`:""}`,style:{...Vt,...At,...v?{justifyContent:_l(Pt.kind)}:{}},"data-test":_e.width,children:r.jsx("span",{className:Hl(e,_e.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Nl(ar(e,_e.textPrefix),n),...jl(e,_e.textPrefix,c,n),...v?{}:Xg(Pt.kind)},children:Te.cells[_e.key]??null})}),Nt&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(Ct)}}),Qt&&r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":_e.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ue(Math.max(Ct,Kr))}})]},_e.key)}),u&&Oe===0&&v&&r.jsxs(r.Fragment,{children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(we),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Ue(ke),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(we),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Ue(Math.max(ke,Ae-ke)),width:Ue(ke),height:"100%"}})]})]}),!v&&xt>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(xt)}}),u&&Oe===0&&!v&&r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ue(_t)}})]},Te.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Lt,"data-controls-static-handle":"",...v?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:v?"center":"left-y",areaStyle:{position:"absolute",top:Qe,left:0,width:"100%",height:Ue(Math.max(ht,Kr))}})},"row-padding-handles"),u&&!v&&Ge&&qe&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ge.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[0]-((Pe==null?void 0:Pe.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Ue(It),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":qe.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(je[pe.length-1]-((gt==null?void 0:gt.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(Dt-Mt),width:Ue(Mt),height:"100%"}})]},"column-edge-padding-handles"),u&&!v&&pe.slice(0,-1).map((Te,Oe)=>{const Ke=pe[Oe+1],Ne=V.slice(0,Oe+1).reduce((tt,Wt)=>tt+Wt,0),ze=We[Oe],ut=We[Oe+1],_e=Math.max(ze.paddingRight,$i),Je=Math.max(ut.paddingLeft,$i);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Te.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(je[Oe]-ze.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(Ne-_e),width:Ue(_e),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ke.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[Oe+1]-ut.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(Ne),width:Ue(Je),height:"100%"}})]},`${Te.paddingRightKey}-padding`)}),u&&!v&&pe.slice(0,-1).map((Te,Oe)=>{const Ke=yh(Oe,V,se,Ae),ze=V.slice(0,Oe+1).reduce((ut,_e)=>ut+_e,0)-Ol/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Te.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(qa),"data-controls-max-fraction":String(Ke),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ue(ze),width:Ue(Ol),height:"calc(100%)",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)})]}),mt&&(()=>{const Te=ar(e,An),Oe=Yg(e.cutLabelVerticalAlign),Ke=Te.textTextAlign==="justify"||v;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Ue(C??0),cursor:$t?"pointer":"default",...Bg(H,L??0,n??!1)},onClick:$t?rt:void 0,onMouseEnter:O||_?Ut:void 0,onMouseLeave:O?Kt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...v?{paddingLeft:Ue(ve),paddingRight:Ue(ve)}:{},justifyContent:Zg(Te.textTextAlign),alignItems:_l(Oe)},children:r.jsx("span",{className:Hl(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Nl(Te,n),...jl(e,An,c,n),...Ke?{width:"100%"}:{}},children:U})})})})(),_&&G&&(()=>{const Te=`${G.widthPx}px`,Oe={width:Te,height:"auto",maxHeight:Te,objectFit:"contain",left:G.x,top:G.y,position:"absolute"};return r.jsx(Og,{media:G,className:G.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Oe},`${G.rowId}-${G.url}`)})()]})})]})}const Sh=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
9070
+ `}const Un=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Va=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",mo=[...Va,An],Tr=["A","B","C","D","E"];function rc(e){return`${e}ColumnVerticalAlign`}const ha=["Top","Center","Bottom"];function Ga(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Tr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Vg(e){const t=Ga(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Gg(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Tr.includes(n)?n:null}function ac(e,t,n){const i=Gg(e);return i?i===t?!1:Vg(n[rc(i)]):!0}function go(e){const t=Ga(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Tr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function qg(e,t,n){if(lc(e,t,n))return go(e);const i=go(e);return i.kind==="baseline"?{kind:"top"}:i}function Kg(e){const t=go(e);return t.kind==="baseline"?{kind:"top"}:t}function lc(e,t,n){return ac(e,n,t)?go(e).kind==="baseline":!1}function Ug(e){const t={};let n=!1;for(const i of Tr){const o=rc(i),l=e[o];if(e.type==="b"){const s=String(l??"Top").trim();s!=="Top"&&s!=="Center"&&s!=="Bottom"&&(t[o]="Top",n=!0);continue}ac(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Xg(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Yg(e){const t=go(e).kind;return t==="baseline"?"center":t}function Zg(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function _l(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Jg(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),l=o-i;return n.remove(),l}function qr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=Jg(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+s;const d=l.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+s}function Qg(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const l=o.querySelector(`.${n}`);l&&(l.style.minHeight=`${i}px`,l.style.height=`${i}px`)}),i)}function eh(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const th={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function vt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const nh={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function ih(e){return[vt(e,"textFontFamily"),vt(e,"textFontSettings"),{type:"row",items:[vt(e,"textFontSize"),vt(e,"textLineHeight"),vt(e,"textLetterSpacing"),vt(e,"textWordSpacing")]},vt(e,"textTextAlign"),vt(e,"textTextAppearance"),`${e}VerticalAlign`]}function oh(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(mo.map(e=>[nh[e],ih(e)]))}}function ar(e,t){const n=i=>{const o=vt(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===An?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Nl(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return dn(Xt(n,t))}function Hl(e,t,n,i){const o=ar(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function jl(e,t,n,i){const o=ar(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:y.scalingValue((l-s)/2,i)}}const yn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Wi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],_i=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ni=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],rh={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},ah=["hover","focus","filled","success","error"],Ol=.004,$i=.004,Kr=$i,qa=50,ho=1440,fo=qa/ho;function sc(e){const t=typeof e=="number"&&e>0?e:ho;return qa/t}function lh(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const o=parseFloat(n);if(Number.isFinite(o)&&o>0)return o}const i=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(i){const o=parseFloat(i);if(Number.isFinite(o)&&o>0)return o}t=t.parentElement}return ho}const cc={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function no(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function sh(e,t=1){const n=t/e;return Object.fromEntries(yn.map(i=>[i,n]))}function ch(){return Object.fromEntries([...Wi.map(e=>[e,0]),..._i.map(e=>[e,0])])}function dh(){return Object.fromEntries(Ni.map(e=>[e,0]))}function Ho(e){return Object.fromEntries(yn.map(t=>[t,typeof e[t]=="number"?e[t]:cc[t]]))}function dc(e,t,n){const i=e-fo,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const l=i/o;return{paddingLeft:t*l,paddingRight:n*l}}function Zo(e,t,n){const i=Ka(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((l,s)=>l+s,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function uh(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=Wi[o],s=_i[o],d=typeof n[l]=="number"?n[l]:0,c=typeof n[s]=="number"?n[s]:0,u=dc(t[o]??0,d,c);u.paddingLeft!==d&&(i[l]=u.paddingLeft),u.paddingRight!==c&&(i[s]=u.paddingRight)}return i}function Ka(e,t,n){if(e<=0)return[];const i=yn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),s=o.reduce((u,m)=>u+m,0)+fo;if(t>=s)return i;const d=[...o];let c=s-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const m=d[u]-fo;if(m<=0)continue;const x=Math.min(c,m);d[u]-=x,c-=x}return[...d,i[e-1]]}function ph(e,t,n){if(e<=1)return{};const i=Ka(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=yn[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function zl(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Un]}function mh(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function gh(e,t,n,i){const o=Math.min(i,e.length,yn.length),l={};for(let s=0;s<o;s+=1){const d=e[s],c=t.indexOf(d);if(c===-1)continue;const u=yn[c],m=Wi[c],x=_i[c],b=Ni[c],T=yn[s],f=Wi[s],L=_i[s],$=Ni[s],R=n[u],P=n[m],C=n[x],U=n[b];typeof R=="number"&&(l[T]=R),typeof P=="number"&&(l[f]=P),typeof C=="number"&&(l[L]=C),typeof U=="number"&&(l[$]=U)}return l}function uc(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of n)if(e[i]!==t[i])return!0;return!1}function hh(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=no(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...sh(n,o),...ch()};if(l)for(const d of Ni)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,dh());return uc(e,s)?s:e}function fh(e,t,n){const i=Ug(e);i&&(e={...e,...i});const o=sc(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,d=no(e),c=no(t),u=e.type==="b"||e.type===void 0&&t.type==="b",m=typeof l=="number"?l:typeof s=="number"?s:Un.length,x=C=>{if(u)return C;const U=Ho({...t,...C}),E=no(C),j=Zo(m,E,U),I=uh(m,j,{...t,...C});return Object.keys(I).length===0?C:{...C,...I}};if(typeof l=="number"&&l!==s)return e;const b=zl(e),T=zl(t);if(!mh(b,T))return x({...e,...gh(b,T,t,m)});if(d<c&&typeof m=="number"&&!u){const C=Ho({...t,...e});return x({...e,...ph(m,d,C)})}if(u){const C=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,U=Math.max(0,(d-o)/2);return C>U?{...e,textPaddingLR:U}:e}const f=Ho({...t,...e}),L=Zo(m,c,Ho(t)),R=Zo(m,d,f).some((C,U)=>C<(L[U]??C)),P=yn.some(C=>{const U=e[C],E=t[C];return typeof U=="number"&&typeof E=="number"&&U!==E});return R||P?x(e):e}function yh(e,t,n,i){const o=t.slice(0,e).reduce((s,d)=>s+d,0),l=n.slice(e+1,t.length-1).reduce((s,d)=>s+d,0);return Math.max(fo,i-o-l-fo)}function vh(e,t){return Math.random()*(t-e)+e}function xh(e){return Object.fromEntries(yn.map(t=>[t,typeof e[t]=="number"?e[t]:cc[t]]))}function Ur(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function bh(e,t,n,i,o,l){return e.slice(0,t).map((s,d)=>{const c=Wi[d],u=_i[d],m=Ni[d];return{key:s,textPrefix:th[s],widthKey:yn[d],width:n[yn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:m,paddingLeft:i[c],paddingRight:o[u],paddingBottom:l[m]}})}function wh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:d}){const{prefix:c}=y.useScopedStyles(),u=!!o,{columns:m,type:x,wrapperWidth:b,entriesCount:T,cellMinHeight:f,dividerWidth:L,showVisibility:$,cut:R,showCut:P,cutCellMinHeight:C,cutLabel:U,imageSize:E,imageOnHover:j,entryHoverEffect:I,entryHoverShowOption:w,rowPaddingTop:W,rowPaddingBottom:h,rowPaddingTopB:S,columnsOrder:k,textPaddingLR:z,textColor:K,backgroundColor:le,dividerColor:Y,textHoverColor:D,backgroundHoverColor:N,dividerHoverColor:F}=e,[A,q]=a.useState(void 0),[G,Z]=a.useState(null),_=j==="on"&&(!n||i),me=(R??0)>0,v=x==="b",fe=a.useRef(null),J=a.useRef(null),[de,$e]=a.useState(null),[oe,xe]=a.useState(ho),Q=sc(oe),ye=Math.max(0,((b??0)-Q)/2),ve=Math.min(z??0,ye),ke=Math.max(ve,$i),we=((b??0)+Q)/2;a.useLayoutEffect(()=>{if(!n){xe(ho);return}const Te=()=>{xe(lh(fe.current))};Te();const Oe=fe.current;if(!Oe)return;const Ke=new ResizeObserver(Te);Ke.observe(Oe);let Ne=Oe;for(;Ne&&!Ne.style.getPropertyValue("--cntrl-article-width");)Ne=Ne.parentElement;return Ne&&Ke.observe(Ne),()=>Ke.disconnect()},[n,s]),a.useEffect(()=>{q(void 0)},[R,P,t,T]),a.useEffect(()=>{n&&!i&&q(void 0)},[n,i]);const Me=y.buildColorVars(c,{textColor:K,backgroundColor:le,dividerColor:Y,textHoverColor:D,backgroundHoverColor:N,dividerHoverColor:F},rh,ah),X=l&&l!=="default"?`${c}-state-${l}`:"",Se=`${!n||i?I==="default"?`${c}-entry-hover-default`:I==="blinds"?`${c}-entry-hover-blinds`:I==="reveal"?`${c}-entry-hover-reveal`:"":""} ${X}`.trim(),O=I==="reveal"&&(!n||i),ce=($==null?void 0:$[0])??!1,H=($==null?void 0:$[1])??!1,re=a.useRef(e),ae=a.useRef(s);a.useEffect(()=>{if(!d||!n){re.current=e,ae.current=s;return}if(ae.current!==s){re.current=e,ae.current=s;return}const Te=re.current;if(!(Te!==e))return;if(typeof Te.columns=="number"&&typeof e.columns=="number"&&Te.columns!==e.columns){re.current=e;return}const Ke=fh(e,Te,{designWidth:oe});re.current=e,uc(e,Ke)&&d(Ke)},[e,d,n,s,oe]);const ne=a.useMemo(()=>xh(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ie=a.useMemo(()=>Ur(e,Wi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),be=a.useMemo(()=>Ur(e,_i),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ce=a.useMemo(()=>Ur(e,Ni),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ee=a.useMemo(()=>Array.isArray(k)&&k.length>0?k:[...Un],[k]),pe=a.useMemo(()=>bh(ee,m,ne,ie,be,Ce),[ee,m,ne,ie,be,Ce]),Ae=no(e),se=a.useMemo(()=>yn.slice(0,m).map(Te=>ne[Te]),[m,ne]),V=a.useMemo(()=>Ka(m,Ae,ne),[m,Ae,ne]),je=a.useMemo(()=>Zo(m,Ae,ne),[m,Ae,ne]),We=a.useMemo(()=>pe.map((Te,Oe)=>dc(je[Oe]??0,Te.paddingLeft,Te.paddingRight)),[pe,je]),et=a.useMemo(()=>{const Te=T===0?1/0:T;return(t??[]).slice(0,Te).map((Ke,Ne)=>({id:Ne,cells:Object.fromEntries(Un.map(ze=>[ze,Ke[ze]??""])),image:Ke.image,link:Ke.link}))},[t,T]),Ye=me?A??R:et.length,st=a.useMemo(()=>me?et.slice(0,Ye):et,[et,me,Ye]),mt=me&&Ye<et.length,De=st.length>1||mt,ot=[ce?`${c}-divider-top`:"",H||De?`${c}-divider-bottom`:""].filter(Boolean).join(" "),$t=!n||i,rt=()=>{if(!$t)return;const Te=A??R;if(!P){q(et.length);return}q(Math.min(Te+P,et.length))},Ue=Te=>y.scalingValue(Te,n??!1),ht=v?S??0:W??0,xt=h??0,dt=f??0,kt=ht+dt/2,_t=Math.max(xt,Kr),Qe=Fl(0,st.length,ce,H,mt,L??0,n??!1).borderTopWidth,Tt=de!=null?`${de}px`:`calc(${Qe} + ${Ue(kt)})`,Lt=v?"rowPaddingTopB":"rowPaddingTop",Ge=pe[0],qe=pe[pe.length-1],Pe=We[0],gt=We[We.length-1],It=Ge&&Pe?Math.max(Pe.paddingLeft,$i):0,Mt=qe&&gt?Math.max(gt.paddingRight,$i):0,Dt=Ae,en=Te=>{const Oe=fe.current;if(!Oe)return{x:0,y:0};const Ke=Oe.getBoundingClientRect();return{x:Te.clientX-Ke.left+Wl,y:Te.clientY-Ke.top+Wl}},on=(Te,Oe)=>{if(!_)return;const Ke=Te.image;if(!(Ke!=null&&Ke.url)){Z(null);return}const{x:Ne,y:ze}=en(Oe),ut=(E==null?void 0:E.min)??80,_e=(E==null?void 0:E.max)??320,Je=(G==null?void 0:G.rowId)===Te.id?G.widthPx:vh(ut,_e);Z({rowId:Te.id,url:Ke.url,objectFit:"contain",isVideo:jg(Ke),widthPx:Je,x:Ne,y:ze})},bt=Te=>{if(!_||!G)return;const{x:Oe,y:Ke}=en(Te);Z(Ne=>!Ne||Ne.x===Oe&&Ne.y===Ke?Ne:{...Ne,x:Oe,y:Ke})},Rt=()=>{Z(null)},Ut=Te=>{O&&Pl(Te,c),_&&Z(null)},Kt=Te=>{O&&Al(Te,c)};a.useLayoutEffect(()=>{if(!u||v){$e(null);return}const Te=J.current,Oe=Te==null?void 0:Te.parentElement;if(!Te||!Oe){$e(null);return}const Ke=()=>{const ze=Te.querySelector("[data-list-row]");if(!ze){$e(null);return}const ut=Oe.getBoundingClientRect(),_e=ze.getBoundingClientRect();$e(_e.top-ut.top+_e.height/2)};Ke();const Ne=new ResizeObserver(Ke);return Ne.observe(Te),Ne.observe(Oe),()=>Ne.disconnect()},[u,v,st,ht,xt,dt,t,e,pe,je,oe,L,ce,H,mt]);const ft=a.useMemo(()=>!v&&Va.some(Te=>{const Oe=Te.charAt(0),Ke=e[`${Te}VerticalAlign`];return lc(Ke,e,Oe)}),[v,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Je;const Te=fe.current;if(!Te)return;const Oe=()=>{Te.querySelectorAll("[data-list-col]").forEach(tt=>{tt.style.transform="";const Wt=tt.querySelector(`.${c}-list-col`);Wt&&(Wt.style.minHeight="",Wt.style.height="");const Ct=tt.querySelector(`.${c}-list-col-title`);Ct&&(Ct.style.transform="")})};if(v||!ft){Oe();return}const Ke=()=>{const tt=Array.from(Te.querySelectorAll("[data-list-row]")),Wt=`${c}-list-col`,Ct=`${c}-baseline-probe`;tt.forEach(lt=>{lt.querySelectorAll("[data-list-col]").forEach(Nt=>{Nt.style.transform="";const At=Nt.querySelector(`.${Wt}`);At&&(At.style.minHeight="",At.style.height="");const Vt=Nt.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})}),tt.forEach(lt=>{const Nt=Array.from(lt.querySelectorAll("[data-list-col]"));Qg(lt,Nt,Wt)}),Te.offsetHeight,tt.forEach(lt=>{const Nt=Array.from(lt.querySelectorAll("[data-list-col]")),At=lt.getBoundingClientRect().top,Vt=new Map,zt=Nt.map(wt=>{const Gt=wt.querySelector(`.${c}-list-col-title`),pt={el:wt,titleEl:Gt,letter:wt.getAttribute("data-col-letter")??"",kind:wt.getAttribute("data-valign")??"top",anchor:wt.getAttribute("data-valign-anchor")};return Vt.set(pt.letter,pt),pt}),Pt=new Map,Qt=(wt,Gt)=>{const pt=Pt.get(wt.letter);if(pt!==void 0)return pt;const Ft=wt.anchor?Vt.get(wt.anchor):void 0;if(wt.kind!=="baseline"||!Ft||Gt.has(wt.letter)){const Ie=qr(wt,At,Wt,Ct);return Pt.set(wt.letter,Ie),Ie}Gt.add(wt.letter);const Bt=Qt(Ft,Gt);Gt.delete(wt.letter);const g=qr(wt,At,Wt,Ct),ge=Bt-g;eh(wt.titleEl,ge);const Re=qr(wt,At,Wt,Ct);return Pt.set(wt.letter,Re),Re};zt.forEach(wt=>Qt(wt,new Set))})};let Ne=null;const ze=()=>{Ne===null&&(Ne=requestAnimationFrame(()=>{Ne=null,Ke()}))};Ke();const ut=new ResizeObserver(()=>ze());ut.observe(Te);let _e=!1;return typeof document<"u"&&((Je=document.fonts)!=null&&Je.ready)&&document.fonts.ready.then(()=>{_e||ze()}),()=>{_e=!0,Ne!==null&&(cancelAnimationFrame(Ne),Ne=null),ut.disconnect(),Oe()}},[ft,v,e,t,oe,st,je]);const Jt=a.useMemo(()=>Dg(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Jt}}),r.jsx("div",{style:Me,children:r.jsxs("div",{ref:fe,className:`${c}-wrapper ${Se}${ot?` ${ot}`:""}${v?` ${c}-type-b`:""}`.trim(),style:{width:y.scalingValue(b??0,n),...!v&&u?{[`--${c}-first-entry-handle-top`]:Tt}:{}},onMouseMove:_?bt:void 0,onMouseLeave:_?Rt:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[st.map((Te,Oe)=>{var ut;const Ke=(((ut=Te.link)==null?void 0:ut.length)??0)>0,Ne=Ke&&(!n||i)?"a":"div",ze=Fl(Oe,st.length,ce,H,mt,L??0,n??!1);return r.jsxs(Ne,{ref:Oe===0?_e=>{J.current=_e}:void 0,className:`${c}-list-item${Ke||w==="always"?` ${c}-list-item-has-link`:""}`,...Ke?{href:Te.link,target:"_blank"}:{},style:ze,onMouseEnter:_e=>{O&&(Ke||w==="always")&&Pl(_e,c),_&&on(Te,_e)},onMouseLeave:_e=>{O&&(Ke||w==="always")&&Al(_e,c)},children:[ht>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(ht)}}),r.jsxs("div",{className:`${c}-list-cols-row${v?"":` ${c}-list-cols-row-h`}${u&&Oe===0&&v?` ${c}-list-cols-row-controls`:""}`,...v?{}:{"data-list-row":""},style:v?void 0:{minHeight:Ue(dt)},children:[pe.map((_e,Je)=>{const tt=Je===pe.length-1,Wt=We[Je],Ct=_e.paddingBottom,lt=zg(Te.cells[_e.key]),Nt=v&&lt&&Ct>0,At=v?{minHeight:Ue(dt)}:{width:Ue(je[Je])},Vt=v?{paddingLeft:Ue(ve),paddingRight:Ue(ve)}:{paddingLeft:Ue(Wt.paddingLeft),paddingRight:Ue(Wt.paddingRight)},zt=_e.textPrefix.charAt(0),Pt=v?Kg(e[`${_e.textPrefix}VerticalAlign`]):qg(e[`${_e.textPrefix}VerticalAlign`],e,zt),Qt=v&&lt&&u&&Oe===0;return v&&!lt?null:r.jsxs("div",{className:v?`${c}-list-col-wrap`:void 0,...v?{}:{"data-list-col":"","data-col-letter":zt,"data-valign":Pt.kind,...Pt.kind==="baseline"?{"data-valign-anchor":Pt.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${tt?` ${c}-list-col-last`:""}`,style:{...Vt,...At,...v?{justifyContent:_l(Pt.kind)}:{}},"data-test":_e.width,children:r.jsx("span",{className:Hl(e,_e.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Nl(ar(e,_e.textPrefix),n),...jl(e,_e.textPrefix,c,n),...v?{}:Xg(Pt.kind)},children:Te.cells[_e.key]??null})}),Nt&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(Ct)}}),Qt&&r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":_e.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ue(Math.max(Ct,Kr))}})]},_e.key)}),u&&Oe===0&&v&&r.jsxs(r.Fragment,{children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(we),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Ue(ke),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(we),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Ue(Math.max(ke,Ae-ke)),width:Ue(ke),height:"100%"}})]})]}),!v&&xt>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ue(xt)}}),u&&Oe===0&&!v&&r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ue(_t)}})]},Te.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Lt,"data-controls-static-handle":"",...v?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:v?"center":"left-y",areaStyle:{position:"absolute",top:Qe,left:0,width:"100%",height:Ue(Math.max(ht,Kr))}})},"row-padding-handles"),u&&!v&&Ge&&qe&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ge.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[0]-((Pe==null?void 0:Pe.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Ue(It),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":qe.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(je[pe.length-1]-((gt==null?void 0:gt.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(Dt-Mt),width:Ue(Mt),height:"100%"}})]},"column-edge-padding-handles"),u&&!v&&pe.slice(0,-1).map((Te,Oe)=>{const Ke=pe[Oe+1],Ne=V.slice(0,Oe+1).reduce((tt,Wt)=>tt+Wt,0),ze=We[Oe],ut=We[Oe+1],_e=Math.max(ze.paddingRight,$i),Je=Math.max(ut.paddingLeft,$i);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Te.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(je[Oe]-ze.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(Ne-_e),width:Ue(_e),height:"100%"}}),r.jsx(nn,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ke.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[Oe+1]-ut.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ue(Ne),width:Ue(Je),height:"100%"}})]},`${Te.paddingRightKey}-padding`)}),u&&!v&&pe.slice(0,-1).map((Te,Oe)=>{const Ke=yh(Oe,V,se,Ae),ze=V.slice(0,Oe+1).reduce((ut,_e)=>ut+_e,0)-Ol/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Te.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(qa),"data-controls-max-fraction":String(Ke),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ue(ze),width:Ue(Ol),height:"calc(100%)",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)})]}),mt&&(()=>{const Te=ar(e,An),Oe=Yg(e.cutLabelVerticalAlign),Ke=Te.textTextAlign==="justify"||v;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Ue(C??0),cursor:$t?"pointer":"default",...Bg(H,L??0,n??!1)},onClick:$t?rt:void 0,onMouseEnter:O||_?Ut:void 0,onMouseLeave:O?Kt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...v?{paddingLeft:Ue(ve),paddingRight:Ue(ve)}:{},justifyContent:Zg(Te.textTextAlign),alignItems:_l(Oe)},children:r.jsx("span",{className:Hl(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Nl(Te,n),...jl(e,An,c,n),...Ke?{width:"100%"}:{}},children:U})})})})(),_&&G&&(()=>{const Te=`${G.widthPx}px`,Oe={width:Te,height:"auto",maxHeight:Te,objectFit:"contain",left:G.x,top:G.y,position:"absolute"};return r.jsx(Og,{media:G,className:G.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Oe},`${G.rowId}-${G.url}`)})()]})})]})}const Sh=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
9071
9071
  import { CommonComponentProps } from '../props';
9072
9072
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
9073
9073
  import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
@@ -12221,7 +12221,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
12221
12221
  left: 20px;
12222
12222
  transform: translateY(-50%);
12223
12223
  }
12224
- `}function Ul(e,t,n,i,o,l,s,d){return{fontSettings:{fontFamily:e,fontWeight:(t==null?void 0:t.fontWeight)??400,fontStyle:(t==null?void 0:t.fontStyle)??"normal"},fontSize:n??.01,lineHeight:i,letterSpacing:o??0,wordSpacing:l??0,textAppearance:s,color:d??"#000000"}}function Vh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l}){const{prefix:s}=y.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:m=694e-6,dividerStyle:x="solid",entryHoverEffect:b="default",autoclose:T="off",icon:f,iconMaxWidth:L=.00833,iconPaddingRight:$=0,iconAnimation:R="rotate 45",questionColor:E="#000000",answerColor:C="#000000",dividerColor:U="#0000001F",iconColor:k="#000000",questionHoverColor:j="#666666",iconHoverColor:I="#666666",iconActiveColor:w="#000000",dividerHoverColor:W="#000000",questionFontFamily:h,questionFontSettings:S,questionFontSize:M,questionLineHeight:z,questionLetterSpacing:K,questionWordSpacing:le,questionTextAppearance:Y,answerFontFamily:D,answerFontSettings:N,answerFontSize:F,answerLineHeight:A,answerLetterSpacing:q,answerWordSpacing:G,answerTextAppearance:Z,questionPaddingLeft:_=0,questionPaddingTop:me=0,questionPaddingBottom:v=0,answerPaddingLeft:fe=0,answerPaddingRight:J=0,answerPaddingTop:de=0,answerPaddingBottom:$e=0}=e,oe=t??[],[xe,Q]=a.useState(()=>new Set),ye=!n||i;a.useEffect(()=>{Q(new Set)},[T]),a.useEffect(()=>{n&&!o&&!i&&Q(new Set)},[n,o,i]);const ve=Ue=>y.scalingValue(Ue,n??!1),ke=Math.max(_,Nn),we=Math.max(me,Nn),Me=Math.max(v,Nn),X=Math.max(fe,Nn),ue=Math.max(J,Nn),Se=Math.max(de,Nn),O=Math.max($e,Nn),ce=Math.max(0,(c??1)-$-L),H=Math.max(0,(c??1)-J),re=Math.max(0,(c??1)-fe),ae=Math.max($,Nn),ne=Math.max(0,(c??1)-_-L),ie=a.useMemo(()=>xe.size===0?0:Math.min(...xe),[xe]),be=a.useCallback(Ue=>xe.has(Ue),[xe]),Ce=ye&&b==="default"?`${s}-entry-hover-default`:"",ee=f??"",pe=ee!=="",Ae=R.replace(/^rotate /,""),se=`${s}-icon-anim-${Ae}`,V=dn(Xt(Ul(h,S,M,z,K,le,Y,E),n)),je=dn(Xt(Ul(D,N,F,A,q,G,Z,C),n)),We=ql(M,z,`${s}-question`,`${s}-text-tight-leading`),et=ql(F,A,`${s}-answer-text`,`${s}-text-tight-leading`),Ye=Kl(M,z,s,n),st=Kl(F,A,s,n),mt=y.buildColorVars(s,{questionColor:E,answerColor:C,dividerColor:U,iconColor:k,questionHoverColor:j,iconHoverColor:I,iconActiveColor:w,dividerHoverColor:W},Oh,zh),De=l&&l!=="default"?`${s}-state-${l}`:"",ot=a.useCallback(Ue=>{ye&&Q(ht=>{if(ht.has(Ue)){const dt=new Set(ht);return dt.delete(Ue),dt}if(T==="on")return new Set([Ue]);const xt=new Set(ht);return xt.add(Ue),xt})},[ye,T]),$t=a.useMemo(()=>Dh(s),[s]),rt={[`--${s}-divider-width`]:y.scalingValue(m,n??!1),[`--${s}-divider-style`]:x,[`--${s}-icon-max-width`]:y.scalingValue(L,n??!1),...u>0?{[`--${s}-question-min-height`]:y.scalingValue(u,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:$t}}),r.jsx("div",{style:mt,children:r.jsx("div",{className:nt(`${s}-wrapper`,n&&!i&&`${s}-editor`,Ce,De),style:{width:y.scalingValue(c,n??!1),maxWidth:"100%",...rt},children:oe.map((Ue,ht)=>{var Tt;const xt=be(ht),dt=((Tt=Ue.question)==null?void 0:Tt.trim())??"",kt=Ue.answer,_t=((kt==null?void 0:kt.length)??0)>0,Qe=d&&ht===ie;return r.jsxs("div",{className:nt(`${s}-item`,xt&&`${s}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${s}-question-controls`,children:[Qe&&r.jsxs(r.Fragment,{children:[r.jsx(nn,{"data-controls":"questionPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:ve(we),zIndex:2}}),r.jsx(nn,{"data-controls":"questionPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ce),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:ve(ke),height:"100%",zIndex:2}}),r.jsx(nn,{"data-controls":"iconPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ne),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:ve(ae),height:"100%",zIndex:2}})]}),r.jsxs("button",{type:"button",className:`${s}-question-button`,"aria-expanded":xt,style:{...V,...Ye,paddingLeft:ve(_),paddingRight:ve($)},onClick:()=>ot(ht),children:[me>0&&r.jsx("span",{className:`${s}-padding-handle`,style:{height:ve(me)},"aria-hidden":"true"}),r.jsxs("span",{className:`${s}-question-row`,children:[r.jsx("span",{className:We,children:dt}),_t&&(pe?r.jsx("span",{className:`${s}-icon ${s}-icon-custom ${se}`,"aria-hidden":"true",children:r.jsx(rn,{url:ee,fill:k,hoverFill:I,className:`${s}-icon-image`})}):r.jsx("span",{className:`${s}-icon ${s}-icon-default ${se}`,"aria-hidden":"true"}))]}),v>0&&r.jsx("span",{className:`${s}-padding-handle`,style:{height:ve(v)},"aria-hidden":"true"})]}),Qe&&r.jsx(nn,{"data-controls":"questionPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:ve(Me),zIndex:2}})]}),_t&&kt&&r.jsx("div",{className:`${s}-panel`,"aria-hidden":!xt,children:r.jsx("div",{className:`${s}-panel-inner`,children:r.jsxs("div",{className:`${s}-answer-controls`,children:[Qe&&xt&&r.jsxs(r.Fragment,{children:[r.jsx(nn,{"data-controls":"answerPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:ve(Se),zIndex:2}}),r.jsx(nn,{"data-controls":"answerPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(H),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:ve(X),height:"100%",zIndex:2}}),r.jsx(nn,{"data-controls":"answerPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(re),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:ve(ue),height:"100%",zIndex:2}})]}),de>0&&r.jsx("div",{className:`${s}-padding-handle`,style:{height:ve(de)}}),r.jsx("div",{className:`${s}-answer`,style:{...je,...st,paddingLeft:ve(fe),paddingRight:ve(J)},children:r.jsx("div",{className:et,children:r.jsx(mi,{content:kt})})}),$e>0&&r.jsx("div",{className:`${s}-padding-handle`,style:{height:ve($e)}}),Qe&&xt&&r.jsx(nn,{"data-controls":"answerPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:ve(O),zIndex:2}})]})})})]},ht)})})})]})}const Gh=`import { useCallback, useEffect, useMemo, useState } from 'react';
12224
+ `}function Ul(e,t,n,i,o,l,s,d){return{fontSettings:{fontFamily:e,fontWeight:(t==null?void 0:t.fontWeight)??400,fontStyle:(t==null?void 0:t.fontStyle)??"normal"},fontSize:n??.01,lineHeight:i,letterSpacing:o??0,wordSpacing:l??0,textAppearance:s,color:d??"#000000"}}function Vh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l}){const{prefix:s}=y.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:m=694e-6,dividerStyle:x="solid",entryHoverEffect:b="default",autoclose:T="off",icon:f,iconMaxWidth:L=.00833,iconPaddingRight:$=0,iconAnimation:R="rotate 45",questionColor:P="#000000",answerColor:C="#000000",dividerColor:U="#0000001F",iconColor:E="#000000",questionHoverColor:j="#666666",iconHoverColor:I="#666666",iconActiveColor:w="#000000",dividerHoverColor:W="#000000",questionFontFamily:h,questionFontSettings:S,questionFontSize:k,questionLineHeight:z,questionLetterSpacing:K,questionWordSpacing:le,questionTextAppearance:Y,answerFontFamily:D,answerFontSettings:N,answerFontSize:F,answerLineHeight:A,answerLetterSpacing:q,answerWordSpacing:G,answerTextAppearance:Z,questionPaddingLeft:_=0,questionPaddingTop:me=0,questionPaddingBottom:v=0,answerPaddingLeft:fe=0,answerPaddingRight:J=0,answerPaddingTop:de=0,answerPaddingBottom:$e=0}=e,oe=t??[],[xe,Q]=a.useState(()=>new Set),ye=!n||i;a.useEffect(()=>{Q(new Set)},[T]),a.useEffect(()=>{n&&!o&&!i&&Q(new Set)},[n,o,i]);const ve=Ue=>y.scalingValue(Ue,n??!1),ke=Math.max(_,Nn),we=Math.max(me,Nn),Me=Math.max(v,Nn),X=Math.max(fe,Nn),ue=Math.max(J,Nn),Se=Math.max(de,Nn),O=Math.max($e,Nn),ce=Math.max(0,(c??1)-$-L),H=Math.max(0,(c??1)-J),re=Math.max(0,(c??1)-fe),ae=Math.max($,Nn),ne=Math.max(0,(c??1)-_-L),ie=a.useMemo(()=>xe.size===0?0:Math.min(...xe),[xe]),be=a.useCallback(Ue=>xe.has(Ue),[xe]),Ce=ye&&b==="default"?`${s}-entry-hover-default`:"",ee=f??"",pe=ee!=="",Ae=R.replace(/^rotate /,""),se=`${s}-icon-anim-${Ae}`,V=dn(Xt(Ul(h,S,k,z,K,le,Y,P),n)),je=dn(Xt(Ul(D,N,F,A,q,G,Z,C),n)),We=ql(k,z,`${s}-question`,`${s}-text-tight-leading`),et=ql(F,A,`${s}-answer-text`,`${s}-text-tight-leading`),Ye=Kl(k,z,s,n),st=Kl(F,A,s,n),mt=y.buildColorVars(s,{questionColor:P,answerColor:C,dividerColor:U,iconColor:E,questionHoverColor:j,iconHoverColor:I,iconActiveColor:w,dividerHoverColor:W},Oh,zh),De=l&&l!=="default"?`${s}-state-${l}`:"",ot=a.useCallback(Ue=>{ye&&Q(ht=>{if(ht.has(Ue)){const dt=new Set(ht);return dt.delete(Ue),dt}if(T==="on")return new Set([Ue]);const xt=new Set(ht);return xt.add(Ue),xt})},[ye,T]),$t=a.useMemo(()=>Dh(s),[s]),rt={[`--${s}-divider-width`]:y.scalingValue(m,n??!1),[`--${s}-divider-style`]:x,[`--${s}-icon-max-width`]:y.scalingValue(L,n??!1),...u>0?{[`--${s}-question-min-height`]:y.scalingValue(u,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:$t}}),r.jsx("div",{style:mt,children:r.jsx("div",{className:nt(`${s}-wrapper`,n&&!i&&`${s}-editor`,Ce,De),style:{width:y.scalingValue(c,n??!1),maxWidth:"100%",...rt},children:oe.map((Ue,ht)=>{var Tt;const xt=be(ht),dt=((Tt=Ue.question)==null?void 0:Tt.trim())??"",kt=Ue.answer,_t=((kt==null?void 0:kt.length)??0)>0,Qe=d&&ht===ie;return r.jsxs("div",{className:nt(`${s}-item`,xt&&`${s}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${s}-question-controls`,children:[Qe&&r.jsxs(r.Fragment,{children:[r.jsx(nn,{"data-controls":"questionPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:ve(we),zIndex:2}}),r.jsx(nn,{"data-controls":"questionPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ce),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:ve(ke),height:"100%",zIndex:2}}),r.jsx(nn,{"data-controls":"iconPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ne),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:ve(ae),height:"100%",zIndex:2}})]}),r.jsxs("button",{type:"button",className:`${s}-question-button`,"aria-expanded":xt,style:{...V,...Ye,paddingLeft:ve(_),paddingRight:ve($)},onClick:()=>ot(ht),children:[me>0&&r.jsx("span",{className:`${s}-padding-handle`,style:{height:ve(me)},"aria-hidden":"true"}),r.jsxs("span",{className:`${s}-question-row`,children:[r.jsx("span",{className:We,children:dt}),_t&&(pe?r.jsx("span",{className:`${s}-icon ${s}-icon-custom ${se}`,"aria-hidden":"true",children:r.jsx(rn,{url:ee,fill:E,hoverFill:I,className:`${s}-icon-image`})}):r.jsx("span",{className:`${s}-icon ${s}-icon-default ${se}`,"aria-hidden":"true"}))]}),v>0&&r.jsx("span",{className:`${s}-padding-handle`,style:{height:ve(v)},"aria-hidden":"true"})]}),Qe&&r.jsx(nn,{"data-controls":"questionPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:ve(Me),zIndex:2}})]}),_t&&kt&&r.jsx("div",{className:`${s}-panel`,"aria-hidden":!xt,children:r.jsx("div",{className:`${s}-panel-inner`,children:r.jsxs("div",{className:`${s}-answer-controls`,children:[Qe&&xt&&r.jsxs(r.Fragment,{children:[r.jsx(nn,{"data-controls":"answerPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:ve(Se),zIndex:2}}),r.jsx(nn,{"data-controls":"answerPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(H),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:ve(X),height:"100%",zIndex:2}}),r.jsx(nn,{"data-controls":"answerPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(re),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:ve(ue),height:"100%",zIndex:2}})]}),de>0&&r.jsx("div",{className:`${s}-padding-handle`,style:{height:ve(de)}}),r.jsx("div",{className:`${s}-answer`,style:{...je,...st,paddingLeft:ve(fe),paddingRight:ve(J)},children:r.jsx("div",{className:et,children:r.jsx(mi,{content:kt})})}),$e>0&&r.jsx("div",{className:`${s}-padding-handle`,style:{height:ve($e)}}),Qe&&xt&&r.jsx(nn,{"data-controls":"answerPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:ve(O),zIndex:2}})]})})})]},ht)})})})]})}const Gh=`import { useCallback, useEffect, useMemo, useState } from 'react';
12225
12225
  import cn from 'classnames';
12226
12226
  import { CommonComponentProps } from '../props';
12227
12227
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
@@ -13018,7 +13018,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
13018
13018
  </>
13019
13019
  );
13020
13020
  }
13021
- `;function Hn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Xl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},qh=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Kh={type:"object",version:1,content:{type:"array",display:{type:"array"},items:{type:"object",properties:{question:{type:"string",label:"Question",placeholder:"Add question...",display:{type:"text-input"}},answer:{label:"Answer",placeholder:"Add answer...",display:{type:"rich-text"}}}},default:[{question:"What are the three main parts of The Divine Comedy?",answer:[{type:"paragraph",children:[{text:"The poem is divided into Inferno, Purgatorio, and Paradiso. These three sections follow Dante’s journey through Hell, Purgatory, and Heaven."}]}]},{question:"Who guides Dante through Hell and most of Purgatory?",answer:[{type:"paragraph",children:[{text:"Dante is guided by Virgil, the ancient Roman poet. Virgil represents human reason and wisdom, but because he lived before Christianity, he cannot guide Dante all the way into Heaven."}]}]},{question:"What does the dark wood at the beginning of the poem symbolize?",answer:[{type:"paragraph",children:[{text:"The dark wood symbolizes Dante’s spiritual confusion and moral crisis. It shows that he has lost the “straight way” in life and needs guidance to return to truth and salvation."}]}]},{question:"What is “contrapasso” in Inferno?",answer:[{type:"paragraph",children:[{text:"“Contrapasso” is the principle that punishments in Hell reflect the sins committed during life. For example, people who caused division are themselves physically divided, showing how their punishment mirrors their wrongdoing."}]}]},{question:"Who guides Dante through Heaven?",answer:[{type:"paragraph",children:[{text:"Beatrice guides Dante through Paradiso. She represents divine love, grace, and spiritual understanding, helping Dante move beyond human reason toward a vision of God."}]}]},{question:"Why is The Divine Comedy important in literary history?",answer:[{type:"paragraph",children:[{text:"The Divine Comedy is important because it is one of the greatest works of world literature and helped shape the Italian language. Dante wrote it in the Tuscan dialect rather than Latin, making serious literature more accessible to ordinary readers."}]}]},{question:"What is the overall journey of The Divine Comedy about?",answer:[{type:"paragraph",children:[{text:"The poem is about Dante’s spiritual journey from sin and despair toward repentance, wisdom, and union with God. On a deeper level, it represents the soul’s path from confusion to divine truth."}]}]}]},settings:{sizing:"auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},dividerWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},dividerStyle:{type:"string",scope:"common",title:"Style",display:{type:"toggle-cycle",enum:["solid","dashed","dotted"]}},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default"]}},autoclose:{type:"string",scope:"common",title:"Autoclose",display:{type:"toggle-cycle",enum:["on","off"]}},icon:{type:["string","null"],scope:"common",display:{type:"settings-image-input"}},iconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},iconPaddingRight:Hn("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...Xl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...Xl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:Hn("Question Padding Left"),questionPaddingTop:Hn("Question Padding Top"),questionPaddingBottom:Hn("Question Padding Bottom"),answerPaddingLeft:Hn("Answer Padding Left"),answerPaddingRight:Hn("Answer Padding Right"),answerPaddingTop:Hn("Answer Padding Top"),answerPaddingBottom:Hn("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/component-assets/PlusIcon.svg",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[...qh],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Uh={element:Vh,id:"faq",name:"FAQ",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/FAQ_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"questionFontFamily"},{path:"answerFontFamily"}]},fontRelations:{questionFontSettings:"questionFontFamily",answerFontSettings:"answerFontFamily"},schema:Kh,sourceCode:Gh},Fn=e=>e.display==="cover",Lr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Yl=100,Xh=.2,Zl=8,mc=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,l]=a.useState(0),[s,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const m=a.useMemo(()=>typeof window>"u"?Yl:Math.max(Yl,window.innerHeight*Xh),[]),x=a.useCallback(h=>Math.max(0,1-h/(m*1.5)),[m]),b=a.useCallback(h=>Math.max(0,1-h/(m*.45)),[m]),T=a.useCallback(h=>{const S=typeof window<"u"?window.innerHeight:800,M=Math.max(.88,1-h/S*.12);return`translateY(${h}px) scale(${M})`},[]),f=a.useCallback(()=>{c.current=null},[]),L=a.useCallback(()=>{d(!0),l(0),window.setTimeout(()=>d(!1),n),f()},[n,f]),$=a.useCallback(()=>{const h=typeof window<"u"?window.innerHeight:800;d(!0),l(h),window.setTimeout(()=>{t(),f(),d(!1)},Math.min(n,200))},[n,t,f]),R=a.useCallback(h=>{!e||s||h.pointerType==="touch"&&(i!=null&&i(h.target)||(c.current={startX:h.clientX,startY:h.clientY,isLocked:null,pointerId:h.pointerId}))},[e,s,i]),E=a.useCallback(h=>{const S=c.current;if(!e||!S||h.pointerType!=="touch"||S.pointerId!==h.pointerId)return;const M=h.clientX-S.startX,z=h.clientY-S.startY;if(S.isLocked===null){if(Math.abs(M)<Zl&&Math.abs(z)<Zl)return;if(z>0&&z>Math.abs(M))S.isLocked=!0,h.currentTarget.setPointerCapture(h.pointerId);else{S.isLocked=!1,f();return}}if(!S.isLocked)return;h.preventDefault();const K=Math.max(0,z);u.current=K,l(K)},[e,f]),C=a.useCallback(h=>{const S=c.current;if(!e||!S||h.pointerType!=="touch"||S.pointerId!==h.pointerId)return;const M=S.isLocked===!0;if(h.currentTarget.hasPointerCapture(h.pointerId)&&h.currentTarget.releasePointerCapture(h.pointerId),!M){f();return}h.clientY-S.startY>=m?$():L()},[m,$,e,f,L]),U=a.useCallback(h=>{C(h)},[C]),k=a.useCallback(h=>{C(h)},[C]),j=o>0,I=s?`transform ${n}ms ease`:"none",w=s?`opacity ${n}ms ease`:"none",W=o>0||s;return{isSwipeDragging:j,backdropStyle:{opacity:x(o),transition:w},mediaAreaStyle:{transform:T(o),transition:I,touchAction:j?"none":void 0,willChange:j?"transform":void 0},overlayContentStyle:W?{opacity:b(o),transition:w}:void 0,swipeHandlers:e?{onPointerDown:R,onPointerMove:E,onPointerUp:U,onPointerCancel:k}:{},dismissAreaStyle:e?{touchAction:j?"none":"pan-x"}:void 0}},Yh="[data-lightbox-scrollable]",gc=()=>{a.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,l=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const s=d=>{const c=d.target;c instanceof Element&&c.closest(Yh)||d.preventDefault()};return document.addEventListener("touchmove",s,{passive:!1}),()=>{document.removeEventListener("touchmove",s),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=l,window.scrollTo(0,e)}},[])},Zh=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Jh=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Qh=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},ef=(e,t,n,{duration:i,easing:o,onComplete:l})=>{const s=e.scrollLeft,d=n-s,c=s-n,u=(f,L)=>{Jh(t),e.scrollLeft=f,L&&(l==null||l())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let m=!1,x=0;const b=()=>{t.removeEventListener("transitionend",T),clearTimeout(x)},T=f=>{f.target!==t||f.propertyName!=="transform"||m||(m=!0,b(),u(n,!0))};return t.addEventListener("transitionend",T),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,x=window.setTimeout(()=>{m||(m=!0,b(),u(n,!0))},i+64),()=>{m||(m=!0,b(),u(s-Qh(t),!1))}},io=300,tf=900,nf=1500,of="cubic-bezier(0.16, 1, 0.3, 1)",rf=3e3,af=2,lf=16,sf=.05,cf=1,Oo=.3,df=50,uf=20,xi=.004,Hi=["title1","title2","title3"],pf={title1:"1",title2:"2",title3:"3"},mf={title1:"title1Color",title2:"title2Color",title3:"title3Color"},gf={title1:.02,title2:.02,title3:.02},zo=e=>`max(${e}, ${uf}px)`,hf=e=>{if(!Array.isArray(e)||e.length===0)return{};const t=e.find(o=>(o==null?void 0:o.type)==="paragraph")??e[0],n=t==null?void 0:t.children;if(!Array.isArray(n))return{};const i=n.map(o=>typeof(o==null?void 0:o.text)=="string"?o.text.trim():"").filter(Boolean);return{title1:i[0],title2:i[1],title3:i[2]}},ff=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 t=hf(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Ht=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,yf=e=>[Ht(e,"fontFamily"),Ht(e,"fontSettings"),{type:"row",items:[Ht(e,"fontSize"),Ht(e,"lineHeight"),Ht(e,"letterSpacing"),Ht(e,"wordSpacing")]},Ht(e,"textAlign"),Ht(e,"textAppearance")],vf=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Hi.map(e=>[pf[e],yf(e)]))}),Ua=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const c=Math.min(l,d);return{overflow:l-c,widths:[d-c,...s]}},{overflow:i-1,widths:[]});return o},hc=(e,t)=>Ua(e,t),Bo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Jl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ua(e.length,n),effective:hc(e.length,n)}},xf=(e,t,n,i,o,l,s)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:l,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:s,text:i}),d},Xr=(e,t)=>{const n=i=>{const o=Ht(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[mf[t]]}},bf=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Yr=(e,t,n)=>{var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??gf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Xt(i,n)},wf=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:m,imageGap:x,closeIcon:b,closeIconMaxWidth:T,closeIconColor:f,closeIconHoverColor:L,thumbnailTrigger:$,thumbnailVisibility:R,thumbnailObjectFit:E,thumbnailActive:C,thumbnailActiveColor:U,title1Width:k,title2Width:j,title3Width:I,title1MarginLeft:w=0,title2MarginLeft:W=0,title3MarginLeft:h=0,titleRowMarginBottom:S=0,titleHeaderLayout:M="desktop",contentMarginTop:z,iconMarginLeft:K}=n,le=p=>y.scalingValue(p,i??!1),Y=c??n.thumnailSize??.03,D=le(Y),N=le(u),F=le(m??.02),A=le(x??0),q=le(z??0),G=zo(q),Z=le(K??0),[_,me]=a.useState(0),v=a.useRef(_);v.current=_;const fe=t[_],{title1:J,title2:de,title3:$e}=ff(fe),oe=Yr("title1",Xr(n,"title1"),i),xe=Yr("title2",Xr(n,"title2"),i),Q=Yr("title3",Xr(n,"title3"),i),ye=M==="mobile",ve=!o&&(!i||l),ke=ve,we=ve,Me=ve,X=Fn(E),ue=X?{"--image-aspect-ratio":Lr(E)}:void 0,Se=!!(J||de||$e),O=a.useMemo(()=>xf(e,J,de,$e,oe,xe,Q),[e,_,J,de,$e,oe,xe,Q]),ce=a.useMemo(()=>({title1Width:k,title2Width:j,title3Width:I}),[k,j,I]),H=a.useMemo(()=>O.map(p=>ce[p.widthKey]),[O,ce]),re=a.useMemo(()=>Ua(O.length,H),[O.length,H]),ae=a.useMemo(()=>hc(O.length,H),[O.length,H]),ne=a.useMemo(()=>O.filter(p=>p.prefix==="title1"),[O]),ie=a.useMemo(()=>O.filter(p=>p.prefix==="title2"||p.prefix==="title3"),[O]),be=a.useMemo(()=>Jl(ne,ce),[ne,ce]),Ce=a.useMemo(()=>Jl(ie,ce),[ie,ce]),ee=a.useCallback((p,P)=>{const B=O.indexOf(p);if(!ye||P==="single-row")return{effectiveWidth:ae[B]??0,resolvedWidth:re[B]??0,maxWidth:Bo(B,re)};if(P==="two-row-top"){const Le=ne.indexOf(p);return{effectiveWidth:be.effective[Le]??0,resolvedWidth:be.resolved[Le]??0,maxWidth:Bo(Le,be.resolved)}}const he=ie.indexOf(p);return{effectiveWidth:Ce.effective[he]??0,resolvedWidth:Ce.resolved[he]??0,maxWidth:Bo(he,Ce.resolved)}},[ie,Ce,ae,re,O,ne,be,ye]),pe=a.useCallback(p=>y.scalingValue(p,i??!1),[i]),Ae=pe(S??0),se=a.useMemo(()=>({title1MarginLeft:w,title2MarginLeft:W,title3MarginLeft:h}),[w,W,h]),V=a.useCallback(p=>O.slice(0,p+1).reduce((P,B,he)=>P+(B!=null&&B.marginLeftKey?se[B.marginLeftKey]??0:0)+(re[he]??0),0)+(ye?0:w??0),[O,se,re,ye,w]),je=a.useCallback(()=>ye?0:w??0,[ye,w]),We=a.useCallback(p=>ie.slice(0,p).reduce((P,B,he)=>P+(B.marginLeftKey?se[B.marginLeftKey]??0:0)+(Ce.resolved[he]??0),0),[ie,Ce.resolved,se]),et=a.useCallback(p=>{const P=ie[p];return We(p)+(P.marginLeftKey?se[P.marginLeftKey]??0:0)+(Ce.resolved[p]??0)},[ie,Ce.resolved,We,se]),Ye=(p,P)=>{const B=p.marginLeftKey?se[p.marginLeftKey]??0:0,{effectiveWidth:he,resolvedWidth:Le,maxWidth:He}=ee(p,P),at=o&&P==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":p.prefix,style:{...P==="single-row"?{gridArea:p.prefix}:{},width:pe(he),...B>0?{marginLeft:pe(B)}:{}},children:[r.jsx("p",{className:p.className,style:p.style,children:p.text}),at&&p.marginLeftKey&&r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:pe(-B),width:`max(${pe(B)}, 10px)`,height:"100%",pointerEvents:"auto"}}),at&&r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(He),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:pe(-xi/2),width:pe(xi),height:"100%",pointerEvents:"auto"}})]},p.className)},st=()=>{const p=ye?-1:O.findIndex(he=>he.prefix==="title1"),P=!ye&&(o||(w??0)>0)?(()=>{const he=w??0,Le=p>=0?re[p]:k??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:0,width:`max(${pe(he)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,B=O.flatMap((he,Le)=>{if(!he.marginLeftKey)return[];const He=se[he.marginLeftKey]??0,at=bf(O,re,se,Le)+je();return r.jsx("div",{"data-controls":he.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(re[Le]),style:{position:"absolute",top:0,left:pe(at),width:`max(${pe(He)}, 10px)`,height:"100%",pointerEvents:"auto"}},he.marginLeftKey)});return P?[P,...B]:B},mt=()=>O.map((p,P)=>{const B=Bo(P,re),Le=V(P)-xi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(B),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:pe(Le),width:pe(xi),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),De=()=>ie.flatMap((p,P)=>{if(!p.marginLeftKey)return[];const B=se[p.marginLeftKey]??0,he=We(P),{resolvedWidth:Le}=ee(p,"two-row-bottom");return r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:pe(he),width:`max(${pe(B)}, 10px)`,height:"100%",pointerEvents:"auto"}},p.marginLeftKey)}),ot=()=>ie.map((p,P)=>{const{maxWidth:B}=ee(p,"two-row-bottom"),Le=et(P)-xi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(B),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:pe(Le),width:pe(xi),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),$t=a.useRef(null),rt=a.useRef(null),Ue=a.useRef(null),ht=a.useRef(null),xt=a.useRef([]),dt=a.useRef([]),kt=a.useRef(0),_t=a.useRef(null),Qe=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Tt=a.useRef(null),Lt=a.useRef(null),Ge=a.useRef(0),qe=a.useRef("forward"),Pe=a.useRef(0),gt=a.useRef(null),It=a.useRef(!1),Mt=t.length>1&&(!o||!!l),Dt=Mt?3:1,en=a.useMemo(()=>Array.from({length:Dt},()=>t).flat(),[t,Dt]),[on,bt]=a.useState(!1),[Rt,Ut]=a.useState(!1),[Kt,ft]=a.useState(!0),Jt=a.useRef(null),Te=a.useRef(null),Oe=a.useRef(!1),Ke=a.useRef(!1),Ne=a.useRef(null),ze=a.useRef(null),ut=ke&&!Kt,_e=a.useCallback(()=>{ke&&(ft(!0),ze.current&&clearTimeout(ze.current),ze.current=setTimeout(()=>{Qe.current.isActive||ft(!1)},rf))},[ke]),Je=a.useCallback(()=>{o||Ke.current||(Ke.current=!0,Ut(!1),Ne.current=setTimeout(()=>{s()},io))},[o,s]),tt=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":ut?"true":"false",style:{width:y.scalingValue(T??0,i),height:y.scalingValue(T??0,i),marginRight:Z,"--close-icon-hover-color":L},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Je,"aria-label":"Close",children:r.jsx(rn,{url:b,fill:f,hoverFill:i&&!l?f:L,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:Z,height:"100%",pointerEvents:"auto"}})]}),Wt=(p="two-row")=>r.jsx("div",{...p==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:pe(w??0),flexShrink:0,...p==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...p==="two-row"&&o?{pointerEvents:"auto"}:{}}}),Ct=()=>{const p=O.find(he=>he.prefix==="title1"),P=O.filter(he=>he.prefix==="title2"||he.prefix==="title3"),B=P.length>0||o||(S??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(w??0)>0||o?Wt():null,p&&Ye(p,"two-row-top"),b&&tt()]}),B?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[P.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[P.map(he=>Ye(he,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[De(),ot()]})]}):null,r.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:Ae,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},lt=()=>r.jsxs(r.Fragment,{children:[(w??0)>0||o?Wt("single-row"):null,O.map(p=>Ye(p,"single-row")),o?r.jsxs(r.Fragment,{children:[st(),mt()]}):null,b?tt():null]}),Nt=a.useCallback(p=>!!(p.closest("[data-controls]")||p.closest(`.${e}-thumbnails`)||p.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:At,backdropStyle:Vt,mediaAreaStyle:zt,overlayContentStyle:Pt,swipeHandlers:Qt,dismissAreaStyle:wt}=mc({enabled:ve??!1,onClose:Je,animMs:io,isBlockedTarget:Nt}),Gt=()=>{if(!Mt||t.length===0)return kt.current=0,0;const p=dt.current[0],P=dt.current[t.length];if(!p||!P)return kt.current;const B=P.offsetLeft-p.offsetLeft;return B>0&&(kt.current=B),kt.current},pt=(p=!1)=>{if(!Mt)return;const P=rt.current,B=Gt();!P||B<=0||B<P.clientWidth*.25||(P.scrollLeft<=0?(P.scrollLeft+=B,p&&(Qe.current.scrollLeft+=B),It.current&&(Pe.current+=B)):P.scrollLeft>=B*2&&(P.scrollLeft-=B,p&&(Qe.current.scrollLeft-=B),It.current&&(Pe.current-=B)))},Ft=(p,P=(B=>(B=rt.current)==null?void 0:B.scrollLeft)()??0)=>{if(!Mt)return p;let he=t.length+p,Le=1/0;for(let He=0;He<Dt;He++){const at=He*t.length+p,yt=dt.current[at];if(!yt)continue;const tn=Math.abs(yt.offsetLeft-P);tn<Le&&(Le=tn,he=at)}return he},Bt=p=>{const P=rt.current;return!p||!P?!1:p.offsetWidth>P.clientWidth+1},g=p=>{const P=rt.current;if(!p||!P||!Bt(p))return!1;const B=p.offsetLeft,he=B+p.offsetWidth;return P.scrollLeft>=B-1&&P.scrollLeft+P.clientWidth<=he+1},ge=(p=(P=>(P=rt.current)==null?void 0:P.scrollLeft)()??0)=>{for(let he=0;he<dt.current.length;he+=1){const Le=dt.current[he];if(Le&&g(Le))return he}let B={flatIndex:0,distance:1/0};return dt.current.forEach((he,Le)=>{if(!he)return;const He=Math.abs(he.offsetLeft-p);He<B.distance&&(B={flatIndex:Le,distance:He})}),B.flatIndex},Re=p=>{rt.current&&dt.current.forEach(P=>{P&&(P.style.scrollSnapAlign=Bt(P)&&p==="backward"?"end":"start")})},Ie=(p,P,B)=>{const he=p-P,Le=ge(P),He=dt.current[Le];if(g(He))return ge(p)%t.length;const at=dt.current[Le+1],yt=He?at?at.offsetLeft-He.offsetLeft:He.offsetWidth:0,tn=yt>0?he>yt*Oo?1:he<-yt*Oo?-1:0:0;return tn===0?B:Mt?(B+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,B+tn))},Ze=a.useCallback((p=!1)=>{if(R!=="on"||o)return;const P=ht.current,B=v.current,he=xt.current[B];if(!P||!he||P.scrollWidth<=P.clientWidth)return;const Le=P.scrollLeft,He=Le+P.clientWidth,at=he.offsetLeft,yt=at+he.offsetWidth;if(at>=Le&&yt<=He)return;const tn=P.scrollWidth-P.clientWidth;let Yt=Le;if(!p&&Jt.current===null){const yi=xt.current[B-1],qi=xt.current[B+1],Eo=yi?he.offsetLeft-yi.offsetLeft:qi?qi.offsetLeft-he.offsetLeft:he.offsetWidth;yt>He?Yt+=Eo:at<Le&&(Yt-=Eo)}else yt>He?Yt=yt-P.clientWidth:Yt=at;P.scrollLeft=Math.max(0,Math.min(tn,Yt))},[o,R]),Et=a.useCallback((p=!1)=>{p&&(Oe.current=!0),Te.current===null&&(Te.current=requestAnimationFrame(()=>{Te.current=null;const P=Oe.current;Oe.current=!1,Ze(P)}))},[Ze]),Ve=a.useCallback(p=>{if(p===v.current)return;const P=v.current;v.current=p;const B=Math.abs(p-P)>1,he=Mt&&t.length>1&&(P===t.length-1&&p===0||P===0&&p===t.length-1);me(p),Et(B||he)},[t.length,Mt,Et]),it=()=>{if(!rt.current||t.length===0||Jt.current!==null||Qe.current.isActive&&Qe.current.hasMoved)return;const p=rt.current.scrollLeft,P=ge(p)%t.length;P!==v.current&&Ve(P)},jt=()=>{Jt.current=null},St=p=>{const P=rt.current;P&&(P.style.scrollSnapType=p?"":"none")},cn=()=>{var p;(p=Lt.current)==null||p.call(Lt),Lt.current=null},un=()=>{gt.current!==null&&(cancelAnimationFrame(gt.current),gt.current=null),It.current=!1},Jn=()=>{const p=rt.current;if(!p){gt.current=null,It.current=!1;return}const P=Pe.current-p.scrollLeft;if(Math.abs(P)<.5){p.scrollLeft=Pe.current,pt(),it(),gt.current=null,It.current=!1;return}p.scrollLeft+=P*sf,pt(),it(),_e(),gt.current=requestAnimationFrame(Jn)},Qn=()=>{const p=Ue.current;p&&(p.style.transition="",p.style.transform="",p.style.willChange="")},To=(p,P,B,he)=>{Qn(),p.scrollLeft=P,Ge.current=p.scrollLeft,pt(),B!==void 0?(v.current=B,me(B)):it(),St(!0),he==null||he()},Lo=(p,{behavior:P="smooth",activeIndex:B,onComplete:he}={})=>{const Le=rt.current,He=Ue.current;if(!Le||!He)return;if(un(),cn(),St(!1),P==="auto"){To(Le,p,B,he);return}const at=Math.abs(p-Le.scrollLeft),yt=Zh(at,tf,nf,Le.clientWidth*.55);Lt.current=ef(Le,He,p,{duration:yt,easing:of,onComplete:()=>{Lt.current=null,To(Le,p,B,he)}})},Rr=(p="smooth")=>{const P=rt.current;if(!P||t.length===0)return;const B=ge()%t.length,he=Ft(B,P.scrollLeft),Le=dt.current[he];Le&&Lo(Le.offsetLeft,{behavior:p,activeIndex:B})},Er=(p,P="smooth",B,he)=>{const Le=rt.current;if(!Le||t.length===0)return;const He=(he??Le.scrollLeft)-p,at=ge(p),yt=dt.current[at];if(g(yt)){St(!0),it();return}const tn=dt.current[at+1],Yt=yt?tn?tn.offsetLeft-yt.offsetLeft:yt.offsetWidth:0;if((Yt>0?He>Yt*Oo?1:He<-Yt*Oo?-1:0:0)!==0){const wc=B??at%t.length,Sc=Ie(he??Le.scrollLeft,p,wc);Sn(Sc,P);return}const qi=he??Le.scrollLeft,Eo=ge(qi),Xa=dt.current[Eo];if(Xa&&Math.abs(Xa.offsetLeft-qi)<1){St(!0),it();return}Rr("auto")},Sn=(p,P="smooth")=>{const B=rt.current;if(!B||t.length===0)return;const he=Ft(p,B.scrollLeft),Le=dt.current[he];Le&&(P==="smooth"?Jt.current=p:Jt.current=null,v.current=p,me(p),Et(!0),Lo(Le.offsetLeft,{behavior:P,activeIndex:p,onComplete:P==="smooth"?jt:void 0}))},fi=()=>{Tt.current&&(window.removeEventListener("pointerup",Tt.current),window.removeEventListener("pointercancel",Tt.current),Tt.current=null)},Io=(p,P,B,he,Le)=>{const He=B-p,at=he-P,yt=Math.abs(He),tn=Math.abs(at);if(yt<df||yt<=tn)return!1;const Yt=He<0?1:-1,yi=Mt?(Le+Yt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Le+Yt));return yi===Le?!1:(Sn(yi),!0)},ei=p=>{if(!Qe.current.isActive)return;fi();const P=rt.current;if(!P)return;const{scrollLeft:B,startActiveIndex:he,hasMoved:Le}=Qe.current,He=P.scrollLeft;pt(!0),Qe.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},bt(!1),p!==void 0&&P.hasPointerCapture(p)&&P.releasePointerCapture(p),Le?Er(B,"smooth",he,He):(St(!0),it()),_e()},Ro=(p,P)=>{const B=_t.current;_t.current=null,B&&(Io(B.startX,B.startY,p,P,B.startActiveIndex),_e())},kr=p=>{if(!we)return;if(p.pointerType==="touch"){if(un(),St(!0),Nt(p.target))return;_t.current={startX:p.clientX,startY:p.clientY,startActiveIndex:v.current};return}if(p.pointerType!=="mouse"||p.button!==0||Nt(p.target))return;const P=rt.current;if(!P)return;un(),cn(),Qn(),Jt.current=null,Qe.current={isActive:!0,startX:p.clientX,scrollLeft:P.scrollLeft,startActiveIndex:v.current,hasMoved:!1},St(!1),_e(),P.setPointerCapture(p.pointerId),fi();const B=he=>{he.pointerType==="mouse"&&ei(he.pointerId)};Tt.current=B,window.addEventListener("pointerup",B),window.addEventListener("pointercancel",B)},Mr=p=>{if(!we||p.pointerType!=="mouse")return;const P=rt.current;if(!P||!Qe.current.isActive)return;if(p.buttons===0){ei(p.pointerId);return}const B=p.clientX-Qe.current.startX;Math.abs(B)>cf&&(Qe.current.hasMoved=!0,bt(!0)),Qe.current.hasMoved&&(p.preventDefault(),P.scrollLeft=Qe.current.scrollLeft-B,pt(!0),it(),_e())},te=p=>{if(we){if(p.pointerType==="touch"){p.type==="pointerup"?Ro(p.clientX,p.clientY):_t.current=null;return}p.pointerType==="mouse"&&ei(p.pointerId)}},Ee=p=>{!we||p.pointerType!=="mouse"||ei(p.pointerId)};return gc(),a.useEffect(()=>{const p=requestAnimationFrame(()=>Ut(!0));return()=>{cancelAnimationFrame(p),cn(),fi(),Te.current!==null&&(cancelAnimationFrame(Te.current),Te.current=null),Ne.current&&clearTimeout(Ne.current),ze.current&&clearTimeout(ze.current)}},[]),a.useEffect(()=>{if(!ke){ft(!0);return}_e();const p=$t.current;if(!p)return;const P=()=>_e();return p.addEventListener("pointermove",P),p.addEventListener("pointerdown",P),()=>{p.removeEventListener("pointermove",P),p.removeEventListener("pointerdown",P),ze.current&&clearTimeout(ze.current)}},[ke,_e]),a.useEffect(()=>{const p=P=>{P.key==="Escape"&&Je()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[Je]),a.useLayoutEffect(()=>{Gt()},[A,t.length,Mt]),a.useLayoutEffect(()=>{o||Sn(v.current,"auto")},[A,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,Mt]),a.useEffect(()=>{const p=rt.current;if(!p||o||!ve)return;const P=B=>{if(B.preventDefault(),Math.abs(B.deltaY)<=Math.abs(B.deltaX))return;const he=B.deltaMode===1?lf:B.deltaMode===2?p.clientHeight:1,Le=B.deltaY*he*af;if(Le!==0){if(cn(),It.current||(It.current=!0,Pe.current=p.scrollLeft,Jt.current=null,St(!1)),Pe.current+=Le,!Mt){const He=p.scrollWidth-p.clientWidth;Pe.current=Math.max(0,Math.min(He,Pe.current))}_e(),gt.current===null&&(gt.current=requestAnimationFrame(Jn))}};return p.addEventListener("wheel",P,{passive:!1}),()=>{p.removeEventListener("wheel",P),un()}},[o,ve,Mt]),a.useEffect(()=>{const p=rt.current;if(!p)return;const P=()=>{pt(Qe.current.isActive);const he=p.scrollLeft,Le=he-Ge.current;Ge.current=he;const He=kt.current>0?kt.current*.5:1/0;if(Le!==0&&Math.abs(Le)<He){const at=Le>0?"forward":"backward";at!==qe.current&&(qe.current=at,Re(at))}Qe.current.isActive&&Qe.current.hasMoved||it()};p.addEventListener("scroll",P,{passive:!0});const B=new ResizeObserver(()=>{Gt(),pt(Qe.current.isActive),Re(qe.current),it()});return B.observe(p),()=>{cn(),p.removeEventListener("scroll",P),B.disconnect()}},[t.length,Mt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{At||Je()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Rt?1:0,transition:`opacity ${io}ms ease`,pointerEvents:Rt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Vt}}),r.jsxs("div",{ref:$t,className:`${e}-lightbox-dismiss-area`,style:wt,...Qt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:zt,onClick:p=>p.stopPropagation(),children:r.jsx("div",{ref:rt,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":we&&t.length>0?"true":"false","data-mouse-dragging":on?"true":"false",onPointerDown:kr,onPointerMove:Mr,onPointerUp:te,onPointerCancel:te,onLostPointerCapture:Ee,children:r.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:A},children:en.map((p,P)=>{const B=p.image.objectFit??"contain",he=P%t.length,Le=Math.floor(P/t.length),He=zo(A),at=`calc(-0.5 * (${He} + ${A}))`;return r.jsxs("div",{ref:yt=>dt.current[P]=yt,className:`${e}-strip-item`,style:{height:M==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:p.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:B}}),o&&he<t.length-1&&Le===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:at,width:He,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Le}-${p.image.url}-${he}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":ut?"true":"false",style:Pt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:q,flexShrink:0,pointerEvents:"none"},children:o&&r.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:G,pointerEvents:"auto",zIndex:3}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:r.jsx("div",{className:`${e}-lightbox-content-area${ye?` ${e}-lightbox-content-area-stacked`:""}`,children:(Se||b)&&r.jsx("div",{className:`${e}-header ${ye?`${e}-header-two-row`:`${e}-header-single-row`}`,children:ye?Ct():Se||b?lt():null})})})]}),t.length>1&&R==="on"&&(()=>{const p=zo(F),P=`calc(-0.5 * (${F} + ${p}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:F},children:r.jsx("div",{ref:ht,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:B=>B.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":C,style:{gap:N,"--thumbnail-active-color":U},children:[t.map((B,he)=>{const Le=zo(N),He=`calc(-0.5 * (${Le} + ${N}))`;return r.jsxs("div",{ref:at=>{xt.current[he]=at},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":_===he?"true":"false",onClick:()=>ve&&$==="click"&&Sn(he),onMouseEnter:()=>Me&&$==="hover"&&Sn(he),"aria-label":B.image.name?`View ${B.image.name}`:`View image ${he+1}`,"aria-current":_===he?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${X?` ${e}-thumb-image-cover`:""}`,src:B.image.url,alt:"",draggable:!1,style:{...ue,maxWidth:D,maxHeight:D,width:E.display==="cover"?"auto":"100%",height:"auto",objectFit:E.display==="cover"?"cover":"contain"}})}),o&&he<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:He,width:Le,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${B.image.url}-${he}`)}),o&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:P,height:p,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Sf(e){return`
13021
+ `;function Hn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Xl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},qh=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Kh={type:"object",version:1,content:{type:"array",display:{type:"array"},items:{type:"object",properties:{question:{type:"string",label:"Question",placeholder:"Add question...",display:{type:"text-input"}},answer:{label:"Answer",placeholder:"Add answer...",display:{type:"rich-text"}}}},default:[{question:"What are the three main parts of The Divine Comedy?",answer:[{type:"paragraph",children:[{text:"The poem is divided into Inferno, Purgatorio, and Paradiso. These three sections follow Dante’s journey through Hell, Purgatory, and Heaven."}]}]},{question:"Who guides Dante through Hell and most of Purgatory?",answer:[{type:"paragraph",children:[{text:"Dante is guided by Virgil, the ancient Roman poet. Virgil represents human reason and wisdom, but because he lived before Christianity, he cannot guide Dante all the way into Heaven."}]}]},{question:"What does the dark wood at the beginning of the poem symbolize?",answer:[{type:"paragraph",children:[{text:"The dark wood symbolizes Dante’s spiritual confusion and moral crisis. It shows that he has lost the “straight way” in life and needs guidance to return to truth and salvation."}]}]},{question:"What is “contrapasso” in Inferno?",answer:[{type:"paragraph",children:[{text:"“Contrapasso” is the principle that punishments in Hell reflect the sins committed during life. For example, people who caused division are themselves physically divided, showing how their punishment mirrors their wrongdoing."}]}]},{question:"Who guides Dante through Heaven?",answer:[{type:"paragraph",children:[{text:"Beatrice guides Dante through Paradiso. She represents divine love, grace, and spiritual understanding, helping Dante move beyond human reason toward a vision of God."}]}]},{question:"Why is The Divine Comedy important in literary history?",answer:[{type:"paragraph",children:[{text:"The Divine Comedy is important because it is one of the greatest works of world literature and helped shape the Italian language. Dante wrote it in the Tuscan dialect rather than Latin, making serious literature more accessible to ordinary readers."}]}]},{question:"What is the overall journey of The Divine Comedy about?",answer:[{type:"paragraph",children:[{text:"The poem is about Dante’s spiritual journey from sin and despair toward repentance, wisdom, and union with God. On a deeper level, it represents the soul’s path from confusion to divine truth."}]}]}]},settings:{sizing:"auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},dividerWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},dividerStyle:{type:"string",scope:"common",title:"Style",display:{type:"toggle-cycle",enum:["solid","dashed","dotted"]}},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default"]}},autoclose:{type:"string",scope:"common",title:"Autoclose",display:{type:"toggle-cycle",enum:["on","off"]}},icon:{type:["string","null"],scope:"common",display:{type:"settings-image-input"}},iconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},iconPaddingRight:Hn("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...Xl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...Xl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:Hn("Question Padding Left"),questionPaddingTop:Hn("Question Padding Top"),questionPaddingBottom:Hn("Question Padding Bottom"),answerPaddingLeft:Hn("Answer Padding Left"),answerPaddingRight:Hn("Answer Padding Right"),answerPaddingTop:Hn("Answer Padding Top"),answerPaddingBottom:Hn("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/component-assets/PlusIcon.svg",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[...qh],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Uh={element:Vh,id:"faq",name:"FAQ",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/FAQ_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"questionFontFamily"},{path:"answerFontFamily"}]},fontRelations:{questionFontSettings:"questionFontFamily",answerFontSettings:"answerFontFamily"},schema:Kh,sourceCode:Gh},Fn=e=>e.display==="cover",Lr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Yl=100,Xh=.2,Zl=8,mc=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,l]=a.useState(0),[s,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const m=a.useMemo(()=>typeof window>"u"?Yl:Math.max(Yl,window.innerHeight*Xh),[]),x=a.useCallback(h=>Math.max(0,1-h/(m*1.5)),[m]),b=a.useCallback(h=>Math.max(0,1-h/(m*.45)),[m]),T=a.useCallback(h=>{const S=typeof window<"u"?window.innerHeight:800,k=Math.max(.88,1-h/S*.12);return`translateY(${h}px) scale(${k})`},[]),f=a.useCallback(()=>{c.current=null},[]),L=a.useCallback(()=>{d(!0),l(0),window.setTimeout(()=>d(!1),n),f()},[n,f]),$=a.useCallback(()=>{const h=typeof window<"u"?window.innerHeight:800;d(!0),l(h),window.setTimeout(()=>{t(),f(),d(!1)},Math.min(n,200))},[n,t,f]),R=a.useCallback(h=>{!e||s||h.pointerType==="touch"&&(i!=null&&i(h.target)||(c.current={startX:h.clientX,startY:h.clientY,isLocked:null,pointerId:h.pointerId}))},[e,s,i]),P=a.useCallback(h=>{const S=c.current;if(!e||!S||h.pointerType!=="touch"||S.pointerId!==h.pointerId)return;const k=h.clientX-S.startX,z=h.clientY-S.startY;if(S.isLocked===null){if(Math.abs(k)<Zl&&Math.abs(z)<Zl)return;if(z>0&&z>Math.abs(k))S.isLocked=!0,h.currentTarget.setPointerCapture(h.pointerId);else{S.isLocked=!1,f();return}}if(!S.isLocked)return;h.preventDefault();const K=Math.max(0,z);u.current=K,l(K)},[e,f]),C=a.useCallback(h=>{const S=c.current;if(!e||!S||h.pointerType!=="touch"||S.pointerId!==h.pointerId)return;const k=S.isLocked===!0;if(h.currentTarget.hasPointerCapture(h.pointerId)&&h.currentTarget.releasePointerCapture(h.pointerId),!k){f();return}h.clientY-S.startY>=m?$():L()},[m,$,e,f,L]),U=a.useCallback(h=>{C(h)},[C]),E=a.useCallback(h=>{C(h)},[C]),j=o>0,I=s?`transform ${n}ms ease`:"none",w=s?`opacity ${n}ms ease`:"none",W=o>0||s;return{isSwipeDragging:j,backdropStyle:{opacity:x(o),transition:w},mediaAreaStyle:{transform:T(o),transition:I,touchAction:j?"none":void 0,willChange:j?"transform":void 0},overlayContentStyle:W?{opacity:b(o),transition:w}:void 0,swipeHandlers:e?{onPointerDown:R,onPointerMove:P,onPointerUp:U,onPointerCancel:E}:{},dismissAreaStyle:e?{touchAction:j?"none":"pan-x"}:void 0}},Yh="[data-lightbox-scrollable]",gc=()=>{a.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,l=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const s=d=>{const c=d.target;c instanceof Element&&c.closest(Yh)||d.preventDefault()};return document.addEventListener("touchmove",s,{passive:!1}),()=>{document.removeEventListener("touchmove",s),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=l,window.scrollTo(0,e)}},[])},Zh=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Jh=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Qh=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},ef=(e,t,n,{duration:i,easing:o,onComplete:l})=>{const s=e.scrollLeft,d=n-s,c=s-n,u=(f,L)=>{Jh(t),e.scrollLeft=f,L&&(l==null||l())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let m=!1,x=0;const b=()=>{t.removeEventListener("transitionend",T),clearTimeout(x)},T=f=>{f.target!==t||f.propertyName!=="transform"||m||(m=!0,b(),u(n,!0))};return t.addEventListener("transitionend",T),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,x=window.setTimeout(()=>{m||(m=!0,b(),u(n,!0))},i+64),()=>{m||(m=!0,b(),u(s-Qh(t),!1))}},io=300,tf=900,nf=1500,of="cubic-bezier(0.16, 1, 0.3, 1)",rf=3e3,af=2,lf=16,sf=.05,cf=1,Oo=.3,df=50,uf=20,xi=.004,Hi=["title1","title2","title3"],pf={title1:"1",title2:"2",title3:"3"},mf={title1:"title1Color",title2:"title2Color",title3:"title3Color"},gf={title1:.02,title2:.02,title3:.02},zo=e=>`max(${e}, ${uf}px)`,hf=e=>{if(!Array.isArray(e)||e.length===0)return{};const t=e.find(o=>(o==null?void 0:o.type)==="paragraph")??e[0],n=t==null?void 0:t.children;if(!Array.isArray(n))return{};const i=n.map(o=>typeof(o==null?void 0:o.text)=="string"?o.text.trim():"").filter(Boolean);return{title1:i[0],title2:i[1],title3:i[2]}},ff=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 t=hf(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Ht=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,yf=e=>[Ht(e,"fontFamily"),Ht(e,"fontSettings"),{type:"row",items:[Ht(e,"fontSize"),Ht(e,"lineHeight"),Ht(e,"letterSpacing"),Ht(e,"wordSpacing")]},Ht(e,"textAlign"),Ht(e,"textAppearance")],vf=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Hi.map(e=>[pf[e],yf(e)]))}),Ua=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const c=Math.min(l,d);return{overflow:l-c,widths:[d-c,...s]}},{overflow:i-1,widths:[]});return o},hc=(e,t)=>Ua(e,t),Bo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Jl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ua(e.length,n),effective:hc(e.length,n)}},xf=(e,t,n,i,o,l,s)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:l,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:s,text:i}),d},Xr=(e,t)=>{const n=i=>{const o=Ht(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[mf[t]]}},bf=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Yr=(e,t,n)=>{var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??gf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Xt(i,n)},wf=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:m,imageGap:x,closeIcon:b,closeIconMaxWidth:T,closeIconColor:f,closeIconHoverColor:L,thumbnailTrigger:$,thumbnailVisibility:R,thumbnailObjectFit:P,thumbnailActive:C,thumbnailActiveColor:U,title1Width:E,title2Width:j,title3Width:I,title1MarginLeft:w=0,title2MarginLeft:W=0,title3MarginLeft:h=0,titleRowMarginBottom:S=0,titleHeaderLayout:k="desktop",contentMarginTop:z,iconMarginLeft:K}=n,le=p=>y.scalingValue(p,i??!1),Y=c??n.thumnailSize??.03,D=le(Y),N=le(u),F=le(m??.02),A=le(x??0),q=le(z??0),G=zo(q),Z=le(K??0),[_,me]=a.useState(0),v=a.useRef(_);v.current=_;const fe=t[_],{title1:J,title2:de,title3:$e}=ff(fe),oe=Yr("title1",Xr(n,"title1"),i),xe=Yr("title2",Xr(n,"title2"),i),Q=Yr("title3",Xr(n,"title3"),i),ye=k==="mobile",ve=!o&&(!i||l),ke=ve,we=ve,Me=ve,X=Fn(P),ue=X?{"--image-aspect-ratio":Lr(P)}:void 0,Se=!!(J||de||$e),O=a.useMemo(()=>xf(e,J,de,$e,oe,xe,Q),[e,_,J,de,$e,oe,xe,Q]),ce=a.useMemo(()=>({title1Width:E,title2Width:j,title3Width:I}),[E,j,I]),H=a.useMemo(()=>O.map(p=>ce[p.widthKey]),[O,ce]),re=a.useMemo(()=>Ua(O.length,H),[O.length,H]),ae=a.useMemo(()=>hc(O.length,H),[O.length,H]),ne=a.useMemo(()=>O.filter(p=>p.prefix==="title1"),[O]),ie=a.useMemo(()=>O.filter(p=>p.prefix==="title2"||p.prefix==="title3"),[O]),be=a.useMemo(()=>Jl(ne,ce),[ne,ce]),Ce=a.useMemo(()=>Jl(ie,ce),[ie,ce]),ee=a.useCallback((p,M)=>{const B=O.indexOf(p);if(!ye||M==="single-row")return{effectiveWidth:ae[B]??0,resolvedWidth:re[B]??0,maxWidth:Bo(B,re)};if(M==="two-row-top"){const Le=ne.indexOf(p);return{effectiveWidth:be.effective[Le]??0,resolvedWidth:be.resolved[Le]??0,maxWidth:Bo(Le,be.resolved)}}const he=ie.indexOf(p);return{effectiveWidth:Ce.effective[he]??0,resolvedWidth:Ce.resolved[he]??0,maxWidth:Bo(he,Ce.resolved)}},[ie,Ce,ae,re,O,ne,be,ye]),pe=a.useCallback(p=>y.scalingValue(p,i??!1),[i]),Ae=pe(S??0),se=a.useMemo(()=>({title1MarginLeft:w,title2MarginLeft:W,title3MarginLeft:h}),[w,W,h]),V=a.useCallback(p=>O.slice(0,p+1).reduce((M,B,he)=>M+(B!=null&&B.marginLeftKey?se[B.marginLeftKey]??0:0)+(re[he]??0),0)+(ye?0:w??0),[O,se,re,ye,w]),je=a.useCallback(()=>ye?0:w??0,[ye,w]),We=a.useCallback(p=>ie.slice(0,p).reduce((M,B,he)=>M+(B.marginLeftKey?se[B.marginLeftKey]??0:0)+(Ce.resolved[he]??0),0),[ie,Ce.resolved,se]),et=a.useCallback(p=>{const M=ie[p];return We(p)+(M.marginLeftKey?se[M.marginLeftKey]??0:0)+(Ce.resolved[p]??0)},[ie,Ce.resolved,We,se]),Ye=(p,M)=>{const B=p.marginLeftKey?se[p.marginLeftKey]??0:0,{effectiveWidth:he,resolvedWidth:Le,maxWidth:He}=ee(p,M),at=o&&M==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":p.prefix,style:{...M==="single-row"?{gridArea:p.prefix}:{},width:pe(he),...B>0?{marginLeft:pe(B)}:{}},children:[r.jsx("p",{className:p.className,style:p.style,children:p.text}),at&&p.marginLeftKey&&r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:pe(-B),width:`max(${pe(B)}, 10px)`,height:"100%",pointerEvents:"auto"}}),at&&r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(He),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:pe(-xi/2),width:pe(xi),height:"100%",pointerEvents:"auto"}})]},p.className)},st=()=>{const p=ye?-1:O.findIndex(he=>he.prefix==="title1"),M=!ye&&(o||(w??0)>0)?(()=>{const he=w??0,Le=p>=0?re[p]:E??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:0,width:`max(${pe(he)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,B=O.flatMap((he,Le)=>{if(!he.marginLeftKey)return[];const He=se[he.marginLeftKey]??0,at=bf(O,re,se,Le)+je();return r.jsx("div",{"data-controls":he.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(re[Le]),style:{position:"absolute",top:0,left:pe(at),width:`max(${pe(He)}, 10px)`,height:"100%",pointerEvents:"auto"}},he.marginLeftKey)});return M?[M,...B]:B},mt=()=>O.map((p,M)=>{const B=Bo(M,re),Le=V(M)-xi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(B),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:pe(Le),width:pe(xi),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),De=()=>ie.flatMap((p,M)=>{if(!p.marginLeftKey)return[];const B=se[p.marginLeftKey]??0,he=We(M),{resolvedWidth:Le}=ee(p,"two-row-bottom");return r.jsx("div",{"data-controls":p.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:pe(he),width:`max(${pe(B)}, 10px)`,height:"100%",pointerEvents:"auto"}},p.marginLeftKey)}),ot=()=>ie.map((p,M)=>{const{maxWidth:B}=ee(p,"two-row-bottom"),Le=et(M)-xi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":p.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(B),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:pe(Le),width:pe(xi),height:"100%",pointerEvents:"auto"}})},`${p.widthKey}-junction`)}),$t=a.useRef(null),rt=a.useRef(null),Ue=a.useRef(null),ht=a.useRef(null),xt=a.useRef([]),dt=a.useRef([]),kt=a.useRef(0),_t=a.useRef(null),Qe=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Tt=a.useRef(null),Lt=a.useRef(null),Ge=a.useRef(0),qe=a.useRef("forward"),Pe=a.useRef(0),gt=a.useRef(null),It=a.useRef(!1),Mt=t.length>1&&(!o||!!l),Dt=Mt?3:1,en=a.useMemo(()=>Array.from({length:Dt},()=>t).flat(),[t,Dt]),[on,bt]=a.useState(!1),[Rt,Ut]=a.useState(!1),[Kt,ft]=a.useState(!0),Jt=a.useRef(null),Te=a.useRef(null),Oe=a.useRef(!1),Ke=a.useRef(!1),Ne=a.useRef(null),ze=a.useRef(null),ut=ke&&!Kt,_e=a.useCallback(()=>{ke&&(ft(!0),ze.current&&clearTimeout(ze.current),ze.current=setTimeout(()=>{Qe.current.isActive||ft(!1)},rf))},[ke]),Je=a.useCallback(()=>{o||Ke.current||(Ke.current=!0,Ut(!1),Ne.current=setTimeout(()=>{s()},io))},[o,s]),tt=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":ut?"true":"false",style:{width:y.scalingValue(T??0,i),height:y.scalingValue(T??0,i),marginRight:Z,"--close-icon-hover-color":L},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Je,"aria-label":"Close",children:r.jsx(rn,{url:b,fill:f,hoverFill:i&&!l?f:L,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:Z,height:"100%",pointerEvents:"auto"}})]}),Wt=(p="two-row")=>r.jsx("div",{...p==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:pe(w??0),flexShrink:0,...p==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...p==="two-row"&&o?{pointerEvents:"auto"}:{}}}),Ct=()=>{const p=O.find(he=>he.prefix==="title1"),M=O.filter(he=>he.prefix==="title2"||he.prefix==="title3"),B=M.length>0||o||(S??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(w??0)>0||o?Wt():null,p&&Ye(p,"two-row-top"),b&&tt()]}),B?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[M.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[M.map(he=>Ye(he,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[De(),ot()]})]}):null,r.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:Ae,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},lt=()=>r.jsxs(r.Fragment,{children:[(w??0)>0||o?Wt("single-row"):null,O.map(p=>Ye(p,"single-row")),o?r.jsxs(r.Fragment,{children:[st(),mt()]}):null,b?tt():null]}),Nt=a.useCallback(p=>!!(p.closest("[data-controls]")||p.closest(`.${e}-thumbnails`)||p.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:At,backdropStyle:Vt,mediaAreaStyle:zt,overlayContentStyle:Pt,swipeHandlers:Qt,dismissAreaStyle:wt}=mc({enabled:ve??!1,onClose:Je,animMs:io,isBlockedTarget:Nt}),Gt=()=>{if(!Mt||t.length===0)return kt.current=0,0;const p=dt.current[0],M=dt.current[t.length];if(!p||!M)return kt.current;const B=M.offsetLeft-p.offsetLeft;return B>0&&(kt.current=B),kt.current},pt=(p=!1)=>{if(!Mt)return;const M=rt.current,B=Gt();!M||B<=0||B<M.clientWidth*.25||(M.scrollLeft<=0?(M.scrollLeft+=B,p&&(Qe.current.scrollLeft+=B),It.current&&(Pe.current+=B)):M.scrollLeft>=B*2&&(M.scrollLeft-=B,p&&(Qe.current.scrollLeft-=B),It.current&&(Pe.current-=B)))},Ft=(p,M=(B=>(B=rt.current)==null?void 0:B.scrollLeft)()??0)=>{if(!Mt)return p;let he=t.length+p,Le=1/0;for(let He=0;He<Dt;He++){const at=He*t.length+p,yt=dt.current[at];if(!yt)continue;const tn=Math.abs(yt.offsetLeft-M);tn<Le&&(Le=tn,he=at)}return he},Bt=p=>{const M=rt.current;return!p||!M?!1:p.offsetWidth>M.clientWidth+1},g=p=>{const M=rt.current;if(!p||!M||!Bt(p))return!1;const B=p.offsetLeft,he=B+p.offsetWidth;return M.scrollLeft>=B-1&&M.scrollLeft+M.clientWidth<=he+1},ge=(p=(M=>(M=rt.current)==null?void 0:M.scrollLeft)()??0)=>{for(let he=0;he<dt.current.length;he+=1){const Le=dt.current[he];if(Le&&g(Le))return he}let B={flatIndex:0,distance:1/0};return dt.current.forEach((he,Le)=>{if(!he)return;const He=Math.abs(he.offsetLeft-p);He<B.distance&&(B={flatIndex:Le,distance:He})}),B.flatIndex},Re=p=>{rt.current&&dt.current.forEach(M=>{M&&(M.style.scrollSnapAlign=Bt(M)&&p==="backward"?"end":"start")})},Ie=(p,M,B)=>{const he=p-M,Le=ge(M),He=dt.current[Le];if(g(He))return ge(p)%t.length;const at=dt.current[Le+1],yt=He?at?at.offsetLeft-He.offsetLeft:He.offsetWidth:0,tn=yt>0?he>yt*Oo?1:he<-yt*Oo?-1:0:0;return tn===0?B:Mt?(B+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,B+tn))},Ze=a.useCallback((p=!1)=>{if(R!=="on"||o)return;const M=ht.current,B=v.current,he=xt.current[B];if(!M||!he||M.scrollWidth<=M.clientWidth)return;const Le=M.scrollLeft,He=Le+M.clientWidth,at=he.offsetLeft,yt=at+he.offsetWidth;if(at>=Le&&yt<=He)return;const tn=M.scrollWidth-M.clientWidth;let Yt=Le;if(!p&&Jt.current===null){const yi=xt.current[B-1],qi=xt.current[B+1],Eo=yi?he.offsetLeft-yi.offsetLeft:qi?qi.offsetLeft-he.offsetLeft:he.offsetWidth;yt>He?Yt+=Eo:at<Le&&(Yt-=Eo)}else yt>He?Yt=yt-M.clientWidth:Yt=at;M.scrollLeft=Math.max(0,Math.min(tn,Yt))},[o,R]),Et=a.useCallback((p=!1)=>{p&&(Oe.current=!0),Te.current===null&&(Te.current=requestAnimationFrame(()=>{Te.current=null;const M=Oe.current;Oe.current=!1,Ze(M)}))},[Ze]),Ve=a.useCallback(p=>{if(p===v.current)return;const M=v.current;v.current=p;const B=Math.abs(p-M)>1,he=Mt&&t.length>1&&(M===t.length-1&&p===0||M===0&&p===t.length-1);me(p),Et(B||he)},[t.length,Mt,Et]),it=()=>{if(!rt.current||t.length===0||Jt.current!==null||Qe.current.isActive&&Qe.current.hasMoved)return;const p=rt.current.scrollLeft,M=ge(p)%t.length;M!==v.current&&Ve(M)},jt=()=>{Jt.current=null},St=p=>{const M=rt.current;M&&(M.style.scrollSnapType=p?"":"none")},cn=()=>{var p;(p=Lt.current)==null||p.call(Lt),Lt.current=null},un=()=>{gt.current!==null&&(cancelAnimationFrame(gt.current),gt.current=null),It.current=!1},Jn=()=>{const p=rt.current;if(!p){gt.current=null,It.current=!1;return}const M=Pe.current-p.scrollLeft;if(Math.abs(M)<.5){p.scrollLeft=Pe.current,pt(),it(),gt.current=null,It.current=!1;return}p.scrollLeft+=M*sf,pt(),it(),_e(),gt.current=requestAnimationFrame(Jn)},Qn=()=>{const p=Ue.current;p&&(p.style.transition="",p.style.transform="",p.style.willChange="")},To=(p,M,B,he)=>{Qn(),p.scrollLeft=M,Ge.current=p.scrollLeft,pt(),B!==void 0?(v.current=B,me(B)):it(),St(!0),he==null||he()},Lo=(p,{behavior:M="smooth",activeIndex:B,onComplete:he}={})=>{const Le=rt.current,He=Ue.current;if(!Le||!He)return;if(un(),cn(),St(!1),M==="auto"){To(Le,p,B,he);return}const at=Math.abs(p-Le.scrollLeft),yt=Zh(at,tf,nf,Le.clientWidth*.55);Lt.current=ef(Le,He,p,{duration:yt,easing:of,onComplete:()=>{Lt.current=null,To(Le,p,B,he)}})},Rr=(p="smooth")=>{const M=rt.current;if(!M||t.length===0)return;const B=ge()%t.length,he=Ft(B,M.scrollLeft),Le=dt.current[he];Le&&Lo(Le.offsetLeft,{behavior:p,activeIndex:B})},Er=(p,M="smooth",B,he)=>{const Le=rt.current;if(!Le||t.length===0)return;const He=(he??Le.scrollLeft)-p,at=ge(p),yt=dt.current[at];if(g(yt)){St(!0),it();return}const tn=dt.current[at+1],Yt=yt?tn?tn.offsetLeft-yt.offsetLeft:yt.offsetWidth:0;if((Yt>0?He>Yt*Oo?1:He<-Yt*Oo?-1:0:0)!==0){const wc=B??at%t.length,Sc=Ie(he??Le.scrollLeft,p,wc);Sn(Sc,M);return}const qi=he??Le.scrollLeft,Eo=ge(qi),Xa=dt.current[Eo];if(Xa&&Math.abs(Xa.offsetLeft-qi)<1){St(!0),it();return}Rr("auto")},Sn=(p,M="smooth")=>{const B=rt.current;if(!B||t.length===0)return;const he=Ft(p,B.scrollLeft),Le=dt.current[he];Le&&(M==="smooth"?Jt.current=p:Jt.current=null,v.current=p,me(p),Et(!0),Lo(Le.offsetLeft,{behavior:M,activeIndex:p,onComplete:M==="smooth"?jt:void 0}))},fi=()=>{Tt.current&&(window.removeEventListener("pointerup",Tt.current),window.removeEventListener("pointercancel",Tt.current),Tt.current=null)},Io=(p,M,B,he,Le)=>{const He=B-p,at=he-M,yt=Math.abs(He),tn=Math.abs(at);if(yt<df||yt<=tn)return!1;const Yt=He<0?1:-1,yi=Mt?(Le+Yt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Le+Yt));return yi===Le?!1:(Sn(yi),!0)},ei=p=>{if(!Qe.current.isActive)return;fi();const M=rt.current;if(!M)return;const{scrollLeft:B,startActiveIndex:he,hasMoved:Le}=Qe.current,He=M.scrollLeft;pt(!0),Qe.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},bt(!1),p!==void 0&&M.hasPointerCapture(p)&&M.releasePointerCapture(p),Le?Er(B,"smooth",he,He):(St(!0),it()),_e()},Ro=(p,M)=>{const B=_t.current;_t.current=null,B&&(Io(B.startX,B.startY,p,M,B.startActiveIndex),_e())},kr=p=>{if(!we)return;if(p.pointerType==="touch"){if(un(),St(!0),Nt(p.target))return;_t.current={startX:p.clientX,startY:p.clientY,startActiveIndex:v.current};return}if(p.pointerType!=="mouse"||p.button!==0||Nt(p.target))return;const M=rt.current;if(!M)return;un(),cn(),Qn(),Jt.current=null,Qe.current={isActive:!0,startX:p.clientX,scrollLeft:M.scrollLeft,startActiveIndex:v.current,hasMoved:!1},St(!1),_e(),M.setPointerCapture(p.pointerId),fi();const B=he=>{he.pointerType==="mouse"&&ei(he.pointerId)};Tt.current=B,window.addEventListener("pointerup",B),window.addEventListener("pointercancel",B)},Mr=p=>{if(!we||p.pointerType!=="mouse")return;const M=rt.current;if(!M||!Qe.current.isActive)return;if(p.buttons===0){ei(p.pointerId);return}const B=p.clientX-Qe.current.startX;Math.abs(B)>cf&&(Qe.current.hasMoved=!0,bt(!0)),Qe.current.hasMoved&&(p.preventDefault(),M.scrollLeft=Qe.current.scrollLeft-B,pt(!0),it(),_e())},te=p=>{if(we){if(p.pointerType==="touch"){p.type==="pointerup"?Ro(p.clientX,p.clientY):_t.current=null;return}p.pointerType==="mouse"&&ei(p.pointerId)}},Ee=p=>{!we||p.pointerType!=="mouse"||ei(p.pointerId)};return gc(),a.useEffect(()=>{const p=requestAnimationFrame(()=>Ut(!0));return()=>{cancelAnimationFrame(p),cn(),fi(),Te.current!==null&&(cancelAnimationFrame(Te.current),Te.current=null),Ne.current&&clearTimeout(Ne.current),ze.current&&clearTimeout(ze.current)}},[]),a.useEffect(()=>{if(!ke){ft(!0);return}_e();const p=$t.current;if(!p)return;const M=()=>_e();return p.addEventListener("pointermove",M),p.addEventListener("pointerdown",M),()=>{p.removeEventListener("pointermove",M),p.removeEventListener("pointerdown",M),ze.current&&clearTimeout(ze.current)}},[ke,_e]),a.useEffect(()=>{const p=M=>{M.key==="Escape"&&Je()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[Je]),a.useLayoutEffect(()=>{Gt()},[A,t.length,Mt]),a.useLayoutEffect(()=>{o||Sn(v.current,"auto")},[A,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,Mt]),a.useEffect(()=>{const p=rt.current;if(!p||o||!ve)return;const M=B=>{if(B.preventDefault(),Math.abs(B.deltaY)<=Math.abs(B.deltaX))return;const he=B.deltaMode===1?lf:B.deltaMode===2?p.clientHeight:1,Le=B.deltaY*he*af;if(Le!==0){if(cn(),It.current||(It.current=!0,Pe.current=p.scrollLeft,Jt.current=null,St(!1)),Pe.current+=Le,!Mt){const He=p.scrollWidth-p.clientWidth;Pe.current=Math.max(0,Math.min(He,Pe.current))}_e(),gt.current===null&&(gt.current=requestAnimationFrame(Jn))}};return p.addEventListener("wheel",M,{passive:!1}),()=>{p.removeEventListener("wheel",M),un()}},[o,ve,Mt]),a.useEffect(()=>{const p=rt.current;if(!p)return;const M=()=>{pt(Qe.current.isActive);const he=p.scrollLeft,Le=he-Ge.current;Ge.current=he;const He=kt.current>0?kt.current*.5:1/0;if(Le!==0&&Math.abs(Le)<He){const at=Le>0?"forward":"backward";at!==qe.current&&(qe.current=at,Re(at))}Qe.current.isActive&&Qe.current.hasMoved||it()};p.addEventListener("scroll",M,{passive:!0});const B=new ResizeObserver(()=>{Gt(),pt(Qe.current.isActive),Re(qe.current),it()});return B.observe(p),()=>{cn(),p.removeEventListener("scroll",M),B.disconnect()}},[t.length,Mt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{At||Je()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Rt?1:0,transition:`opacity ${io}ms ease`,pointerEvents:Rt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Vt}}),r.jsxs("div",{ref:$t,className:`${e}-lightbox-dismiss-area`,style:wt,...Qt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:zt,onClick:p=>p.stopPropagation(),children:r.jsx("div",{ref:rt,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":we&&t.length>0?"true":"false","data-mouse-dragging":on?"true":"false",onPointerDown:kr,onPointerMove:Mr,onPointerUp:te,onPointerCancel:te,onLostPointerCapture:Ee,children:r.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:A},children:en.map((p,M)=>{const B=p.image.objectFit??"contain",he=M%t.length,Le=Math.floor(M/t.length),He=zo(A),at=`calc(-0.5 * (${He} + ${A}))`;return r.jsxs("div",{ref:yt=>dt.current[M]=yt,className:`${e}-strip-item`,style:{height:k==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:p.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:B}}),o&&he<t.length-1&&Le===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:at,width:He,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Le}-${p.image.url}-${he}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":ut?"true":"false",style:Pt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:q,flexShrink:0,pointerEvents:"none"},children:o&&r.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:G,pointerEvents:"auto",zIndex:3}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:r.jsx("div",{className:`${e}-lightbox-content-area${ye?` ${e}-lightbox-content-area-stacked`:""}`,children:(Se||b)&&r.jsx("div",{className:`${e}-header ${ye?`${e}-header-two-row`:`${e}-header-single-row`}`,children:ye?Ct():Se||b?lt():null})})})]}),t.length>1&&R==="on"&&(()=>{const p=zo(F),M=`calc(-0.5 * (${F} + ${p}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:F},children:r.jsx("div",{ref:ht,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:B=>B.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":C,style:{gap:N,"--thumbnail-active-color":U},children:[t.map((B,he)=>{const Le=zo(N),He=`calc(-0.5 * (${Le} + ${N}))`;return r.jsxs("div",{ref:at=>{xt.current[he]=at},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":_===he?"true":"false",onClick:()=>ve&&$==="click"&&Sn(he),onMouseEnter:()=>Me&&$==="hover"&&Sn(he),"aria-label":B.image.name?`View ${B.image.name}`:`View image ${he+1}`,"aria-current":_===he?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${X?` ${e}-thumb-image-cover`:""}`,src:B.image.url,alt:"",draggable:!1,style:{...ue,maxWidth:D,maxHeight:D,width:P.display==="cover"?"auto":"100%",height:"auto",objectFit:P.display==="cover"?"cover":"contain"}})}),o&&he<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:He,width:Le,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${B.image.url}-${he}`)}),o&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:M,height:p,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Sf(e){return`
13022
13022
  .${e}-wrapper {
13023
13023
  position: relative;
13024
13024
  width: 100%;
@@ -13973,7 +13973,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
13973
13973
  </>
13974
13974
  );
13975
13975
  };
13976
- `,Tf="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),ai={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Lf(e){const t={};return t[Ht(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ht(e,"fontSettings")]={...ai.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ht(e,"fontSize")]={...ai.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ht(e,"lineHeight")]={...ai.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ht(e,"letterSpacing")]={...ai.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ht(e,"wordSpacing")]={...ai.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ht(e,"textAlign")]={...ai.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ht(e,"textAppearance")]={...ai.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const If=Hi.reduce((e,t)=>({...e,...Lf(t)}),{}),Rf=Hi.reduce((e,t)=>({...e,[Ht(t,"fontFamily")]:"Goudy Bookletter 1911",[Ht(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ht(t,"letterSpacing")]:0,[Ht(t,"wordSpacing")]:0,[Ht(t,"textAlign")]:"left",[Ht(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Zr(e){return Hi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ht(n,"fontSize")]=i),o!==void 0&&(t[Ht(n,"lineHeight")]=o),t},{})}const Ef=vf(),kf={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailSize:{type:"number",scope:"layout",title:"Thumbnail Size",min:0,display:{type:"range-control"}},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"layout",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"layout",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up","none"]}},thumbnailActiveColor:{type:"string",scope:"layout",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"layout",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"layout",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"layout",title:"Caption Default",display:{type:"palette-color-picker"}},...If,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:Tf,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Rf},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...Zr({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...Zr({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...Zr({title1FontSize:.011,title1LineHeight:.02,title2FontSize:.011,title2LineHeight:.02,title3FontSize:.011,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Ef]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},Mf={element:$f,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:kf,sourceCode:Cf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Hi.map(e=>({path:`${Ht(e,"fontFamily")}`}))]},fontRelations:{...Hi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ht(t,"fontFamily")}`}),{})}},Pf=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,initialSlideIndex:s=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:m})=>{const{type:x,coverFit:b,backgroundColor:T,imageGap:f,maxWidth:L,maxHeight:$,textTransition:R,title1Width:E,title2Width:C,title3Width:U,title1MarginLeft:k=0,title2MarginLeft:j=0,title3MarginLeft:I=0,titleRowMarginBottom:w=0,titleHeaderLayout:W="single-row",countCloseGap:h=0,closeIcon:S,closeIconMaxWidth:M,closeIconColor:z,closeIconHoverColor:K,contentMarginTop:le=0,iconMarginRight:Y=0}=n,D=a.useCallback(te=>y.scalingValue(te,i??!1),[i]),N=D(f??0),F=`${L}%`,A=`${$}%`,q=D(h),G=D(le),Z=D(Y),_=ci("title1",si(n,"title1"),i),me=ci("title2",si(n,"title2"),i),v=ci("title3",si(n,"title3"),i),fe=ci("count",si(n,"count"),i),J=W==="mobile",de=!i||!!l,$e=!o&&(!i||!!l),oe=a.useMemo(()=>Yo(t,x),[t,x]),[xe,Q]=a.useState(s),ye=oe[xe],ve=ye==null?void 0:ye.entry,[ke,we]=a.useState(!1),[Me,X]=a.useState(null),[ue,Se]=a.useState(!1),[O,ce]=a.useState(null),[H,re]=a.useState(!1),[ae,ne]=a.useState(0),[ie,be]=a.useState(),[Ce,ee]=a.useState(),[pe,Ae]=a.useState(null),se=a.useRef(null),V=a.useRef(0),je=a.useRef(0),We=a.useRef(0),et=a.useRef(!1),Ye=a.useRef(null),st=a.useRef(null),mt=a.useRef(null),De=a.useRef(null),ot=a.useRef(null),$t=a.useRef(null),rt=a.useRef(null),Ue=a.useCallback(()=>{const te=st.current;if(!te)return;const Ee=te.closest(`.${e}-lightbox-content-area`);if(!Ee)return te.getBoundingClientRect().width;const p=Array.from(Ee.children).reduce((P,B)=>!(B instanceof HTMLElement)||B.contains(te)?P:P+B.getBoundingClientRect().width,0);return Ee.getBoundingClientRect().width-p},[e]),ht=a.useCallback(()=>{se.current&&(clearTimeout(se.current),se.current=null)},[]),xt=a.useCallback(te=>{te===V.current&&(ce(null),re(!1))},[]),dt=a.useCallback(()=>{o||et.current||(et.current=!0,u==null||u(),we(!1),Ye.current=setTimeout(()=>{m()},300))},[o,u,m]),kt=a.useCallback(te=>!!(te.closest("[data-controls]")||te.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:_t,backdropStyle:Qe,mediaAreaStyle:Tt,overlayContentStyle:Lt,swipeHandlers:Ge,dismissAreaStyle:qe}=mc({enabled:$e,onClose:dt,animMs:300,isBlockedTarget:kt}),Pe=a.useCallback(te=>{d&&Xs(te+1,c,!0)},[d,c]),gt=a.useCallback(te=>{if(te)return te.getBoundingClientRect().height},[]),It=a.useCallback(te=>{if(oe.length===0)return;const Ee=(te%oe.length+oe.length)%oe.length;if(Ee===xe)return;const p=oe[xe],P=oe[Ee];V.current+=1;const B=V.current,he=R==="fade"&&Il(p==null?void 0:p.entry)!==Il(P==null?void 0:P.entry),Le=gt(mt.current),He=he?(()=>{const yt=Ue();gi.flushSync(()=>{Ae(P.entry)}),mt.current&&yt&&(mt.current.style.width=`${yt}px`);const tn=gt(mt.current);return mt.current&&(mt.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:yt}})():void 0,at=Math.max(Le??0,(He==null?void 0:He.measuredIncomingTitlesHeight)??0)||void 0;ne(B),ce(xe),re(!0),Q(Ee),Pe(Ee),We.current=Ee,he?(ht(),at&&be(at),He!=null&&He.incomingTitlesMeasureWidth&&ee(He.incomingTitlesMeasureWidth),X((p==null?void 0:p.entryIndex)??null),Se(!0),je.current=P.entryIndex,se.current=setTimeout(()=>{X(null),Se(!1),be(void 0),ee(void 0),Ae(null),se.current=null},400)):(ht(),X(null),Se(!1),be(void 0),ee(void 0),Ae(null),je.current=P.entryIndex)},[xe,ht,Ue,gt,oe,Pe,R]),Mt=a.useCallback(()=>{rt.current=null},[]),Dt=a.useCallback(te=>{!de||oe.length<=1||te.pointerType==="mouse"&&te.button!==0||te.target.closest("[data-controls]")||(rt.current={startX:te.clientX,startY:te.clientY,pointerId:te.pointerId})},[de,oe.length]),en=a.useCallback(te=>{var yt;if(!de||oe.length<=1||te.pointerType==="mouse"&&te.button!==0)return;if(_t){Mt();return}const Ee=rt.current;if(!Ee||Ee.pointerId!==te.pointerId||(Mt(),te.target.closest("[data-controls]")))return;const P=te.clientX-Ee.startX,B=te.clientY-Ee.startY,he=Math.abs(P),Le=Math.abs(B);if(he>=Gm&&he>Le){It(P>0?xe-1:xe+1);return}if(he>$l||Le>$l)return;const He=(yt=De.current)==null?void 0:yt.getBoundingClientRect(),at=He?He.left+He.width/2:window.innerWidth/2;It(te.clientX<at?xe-1:xe+1)},[xe,de,It,_t,Mt,oe.length]),on=a.useCallback(te=>{const Ee=rt.current;(Ee==null?void 0:Ee.pointerId)===te.pointerId&&Mt()},[Mt]);gc(),a.useEffect(()=>{$t.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const te=requestAnimationFrame(()=>{we(!0),requestAnimationFrame(()=>{ot.current?ot.current.focus():De.current&&De.current.focus()})});return()=>{cancelAnimationFrame(te),Ye.current&&clearTimeout(Ye.current),se.current&&clearTimeout(se.current);const Ee=$t.current;Ee&&document.contains(Ee)&&Ee.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var te;R!=="fade"&&(je.current=((te=oe[xe])==null?void 0:te.entryIndex)??0,ht(),X(null),Se(!1),be(void 0),ee(void 0))},[xe,ht,oe,R]),a.useEffect(()=>{const te=Ee=>{if(Ee.key==="Escape"){dt();return}if(Ee.key==="ArrowLeft"&&oe.length>1){It(xe-1);return}if(Ee.key==="ArrowRight"&&oe.length>1){It(xe+1);return}if(Ee.key==="Tab"&&De.current){const p=De.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),P=Array.from(p).filter(He=>!He.closest('[aria-hidden="true"]'));if(P.length===0)return;const B=P[0],he=P[P.length-1],Le=document.activeElement;Ee.shiftKey?(Le===B||!De.current.contains(Le))&&(Ee.preventDefault(),he.focus()):(Le===he||!De.current.contains(Le))&&(Ee.preventDefault(),B.focus())}};return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[It,dt,xe,oe.length]),a.useLayoutEffect(()=>{ht(),V.current=0,ne(0),ce(null),re(!1),X(null),Se(!1),be(void 0),ee(void 0),Ae(null),Q(te=>{const Ee=Math.max(0,oe.length-1);return Math.min(te,Ee)})},[ht,t.length,x,oe.length]),a.useLayoutEffect(()=>{var p;const te=Math.max(0,oe.length-1),Ee=Math.min(Math.max(0,s),te);We.current=Ee,je.current=((p=oe[Ee])==null?void 0:p.entryIndex)??0,Q(Ee)},[s]);const bt=Me!==null?t[Me]:null,Rt=O!==null?oe[O]:null,Ut=(ve==null?void 0:ve.title1)||(ve==null?void 0:ve.title2)||(ve==null?void 0:ve.title3)||(bt==null?void 0:bt.title1)||(bt==null?void 0:bt.title2)||(bt==null?void 0:bt.title3),Kt=Qm(x,oe,t),ft=S!==null,Jt=Ut||Kt||ft,Te=Kt&&ft?{gap:q}:void 0,Oe=`${e}-titles-stack${J?` ${e}-titles-stack-stacked`:""}`,Ke=`${e}-titles-layer-out${J?` ${e}-titles-layer-out-stacked`:""}`,Ne=`${e}-titles-layer-out`,ze=(k??0)>0||o,ut=D(w),_e=a.useMemo(()=>({title1Width:E??Ii.title1Width,title2Width:C??Ii.title2Width,title3Width:U??Ii.title3Width}),[E,C,U]),Je=a.useMemo(()=>({title2MarginLeft:j,title3MarginLeft:I}),[j,I]),tt=a.useMemo(()=>ve?Dn(e,ve,_,me,v):[],[e,ve,_,me,v]),Wt=a.useMemo(()=>tt.map(te=>_e[te.widthKey]),[tt,_e]),Ct=a.useMemo(()=>Pi(tt.length,Wt),[tt.length,Wt]),lt=a.useMemo(()=>po(tt.length,Wt),[tt.length,Wt]),Nt=a.useMemo(()=>tt.filter(te=>te.prefix==="title1"),[tt]),At=a.useMemo(()=>tt.filter(te=>te.prefix==="title2"||te.prefix==="title3"),[tt]),Vt=a.useMemo(()=>Vn(Nt,_e),[Nt,_e]),zt=a.useMemo(()=>Vn(At,_e),[At,_e]),Pt=a.useCallback((te,Ee)=>{const p=tt.findIndex(B=>B.prefix===te.prefix);if(!J||Ee==="single-row")return{effectiveWidth:lt[p]??0,resolvedWidth:Ct[p]??0,maxWidth:ln(p,Ct)};if(Ee==="two-row-top"){const B=Nt.findIndex(he=>he.prefix===te.prefix);return{effectiveWidth:Vt.effective[B]??0,resolvedWidth:Vt.resolved[B]??0,maxWidth:ln(B,Vt.resolved)}}const P=At.findIndex(B=>B.prefix===te.prefix);return{effectiveWidth:zt.effective[P]??0,resolvedWidth:zt.resolved[P]??0,maxWidth:ln(P,zt.resolved)}},[tt,At,zt,lt,Ct,Nt,Vt,J]),Qt=a.useCallback(te=>Qs(tt,Ct,Je,te)+(J?0:k??0),[tt,Ct,Je,J,k]),wt=a.useCallback(()=>J?0:k??0,[J,k]),Gt=a.useCallback(te=>At.slice(0,te).reduce((Ee,p,P)=>Ee+(p.marginLeftKey?Je[p.marginLeftKey]??0:0)+(zt.resolved[P]??0),0),[At,zt.resolved,Je]),pt=a.useCallback(te=>{const Ee=At[te];return Gt(te)+(Ee.marginLeftKey?Je[Ee.marginLeftKey]??0:0)+(zt.resolved[te]??0)},[At,zt.resolved,Gt,Je]),Ft=a.useCallback((te,Ee,p)=>{if(!J||p==="single-row"){const He=te.findIndex(Yt=>Yt.prefix===Ee.prefix),at=te.map(Yt=>_e[Yt.widthKey]),yt=Pi(te.length,at);return{effectiveWidth:po(te.length,at)[He]??0,resolvedWidth:yt[He]??0,maxWidth:ln(He,yt)}}if(p==="two-row-top"){const He=te.filter(Yt=>Yt.prefix==="title1"),at=He.findIndex(Yt=>Yt.prefix===Ee.prefix),{resolved:yt,effective:tn}=Vn(He,_e);return{effectiveWidth:tn[at]??0,resolvedWidth:yt[at]??0,maxWidth:ln(at,yt)}}const P=te.filter(He=>He.prefix==="title2"||He.prefix==="title3"),B=P.findIndex(He=>He.prefix===Ee.prefix),{resolved:he,effective:Le}=Vn(P,_e);return{effectiveWidth:Le[B]??0,resolvedWidth:he[B]??0,maxWidth:ln(B,he)}},[_e,J]),Bt=(te,Ee,p)=>{const P=te.marginLeftKey?Je[te.marginLeftKey]??0:0,{effectiveWidth:B,resolvedWidth:he,maxWidth:Le}=p??Pt(te,Ee),He=Math.max(P,Bn),at=o&&Ee==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":te.prefix,style:{width:D(B),...P>0?{marginLeft:D(P)}:{}},children:[r.jsx("p",{className:te.className,style:te.style,children:te.text}),at&&te.marginLeftKey?r.jsx("div",{"data-controls":te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(he),style:{position:"absolute",top:0,left:D(-P),width:D(He),height:"100%",pointerEvents:"auto"}}):null,at?r.jsx("div",{"data-controls":te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Le),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D(-hn/2),width:D(hn),height:"100%",pointerEvents:"auto"}}):null]},te.className)},g=(te="two-row")=>{const Ee=tt.findIndex(B=>B.prefix==="title1"),p=Ee>=0?Ct[Ee]:_e.title1Width,P=te==="two-row"&&o;return r.jsx("div",{...P?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p)}:{},style:{width:D(k??0),flexShrink:0,alignSelf:"stretch",...P?{pointerEvents:"auto"}:{}}})},ge=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:_,"aria-hidden":"true",children:" "}),Re=()=>r.jsx("span",{className:`${e}-entry-counter`,style:fe,"aria-live":"polite","aria-atomic":"true",children:Jm(oe,xe,x,t)}),Ie=()=>Kt?o&&ft?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Re(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Br(q)} + ${q}))`,width:Br(q),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Re():null,Ze=()=>!Kt&&!ft?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Te,children:[Ie(),ft?it():null]}),Et=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Kt||Ut?ge():null,ze?g("single-row"):null,St(ve),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),Ze(),Sn()]}),Ve=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Kt||Ut?ge():null,ze?g("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:ue&&ie?{minHeight:ie}:void 0,children:[r.jsx("div",{ref:mt,className:Oe,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Qn(pe||ve)}),r.jsxs("div",{ref:st,className:Oe,style:{position:ue?"absolute":"relative",inset:ue?0:void 0,width:"100%",...ue&&Ce?{width:Ce,maxWidth:"100%"}:void 0},children:[bt&&ue?r.jsx("div",{className:`${Ke} ${e}-titles-fade-out`,children:Qn(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Qn(ve)})]})]}),Ze(),Sn()]}),it=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:y.scalingValue(M??0,i),height:y.scalingValue(M??0,i),marginRight:Z,"--close-icon-hover-color":K},children:[r.jsx("button",{ref:ot,type:"button",className:`${e}-close-icon-inner`,onClick:dt,"aria-label":"Close",children:r.jsx(rn,{url:S??"",fill:z,hoverFill:i&&!l?z:K,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:Z,height:"100%",pointerEvents:"auto"}})]}),jt=(te,Ee)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Kt||Ut?ge():null,ze?g("two-row"):null,Ee!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ee},children:te}):r.jsxs(r.Fragment,{children:[te,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),Ze()]}),St=te=>{if(!te)return null;const Ee=Dn(e,te,_,me,v);return r.jsx(r.Fragment,{children:Ee.map(p=>Bt(p,"single-row",Ft(Ee,p,"single-row")))})},cn=te=>{if(!te)return null;const Ee=Dn(e,te,_,me,v),p=Ee.find(P=>P.prefix==="title1");return p?Bt(p,"two-row-top",Ft(Ee,p,"two-row-top")):null},un=(te,Ee=!1)=>{const p=te?Dn(e,te,_,me,v):[],P=p.filter(Le=>Le.prefix==="title2"||Le.prefix==="title3"),B=o&&Ee;return P.length>0||B||(w??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[P.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[P.map(Le=>Bt(Le,"two-row-bottom",Ft(p,Le,"two-row-bottom"))),Ee&&o?r.jsxs(r.Fragment,{children:[Rr(),Er()]}):null]}):null,(w??0)>0||B?r.jsx("div",{"data-controls":B?"titleRowMarginBottom":void 0,"data-controls-axis":B?"y":void 0,"data-controls-reverse":B?"":void 0,className:B?`${e}-control`:void 0,style:{height:ut,width:"100%",flexShrink:0,pointerEvents:B?"auto":"none"}}):null]}):null},Jn=(te,Ee=!1)=>r.jsxs(r.Fragment,{children:[jt(cn(te)),un(te,Ee)]}),Qn=te=>J?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Jn(te)}):te?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:St(te)}):null,To=()=>{const te=J?-1:tt.findIndex(P=>P.prefix==="title1"),Ee=!J&&(o||(k??0)>0)?(()=>{const P=k??0,B=te>=0?Ct[te]:_e.title1Width,he=Math.max(P,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(B),style:{position:"absolute",top:0,left:0,width:D(he),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,p=tt.flatMap((P,B)=>{if(!P.marginLeftKey)return[];const he=Je[P.marginLeftKey]??0,Le=Js(tt,Ct,Je,B)+wt(),He=Math.max(he,Bn);return r.jsx("div",{"data-controls":P.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ct[B]),style:{position:"absolute",top:0,left:D(Le),width:D(He),height:"100%",pointerEvents:"auto"}},P.marginLeftKey)});return Ee?[Ee,...p]:p},Lo=()=>tt.map((te,Ee)=>{const p=ln(Ee,Ct),B=Qt(Ee)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(B),width:D(hn),height:"100%",pointerEvents:"auto"}})},`${te.widthKey}-junction`)}),Rr=()=>At.flatMap((te,Ee)=>{if(!te.marginLeftKey)return[];const p=Je[te.marginLeftKey]??0,P=Gt(Ee),B=Math.max(p,Bn),{resolvedWidth:he}=Pt(te,"two-row-bottom");return r.jsx("div",{"data-controls":te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(he),style:{position:"absolute",top:0,left:D(P),width:D(B),height:"100%",pointerEvents:"auto"}},te.marginLeftKey)}),Er=()=>At.map((te,Ee)=>{const{maxWidth:p}=Pt(te,"two-row-bottom"),B=pt(Ee)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(B),width:D(hn),height:"100%",pointerEvents:"auto"}})},`${te.widthKey}-junction`)}),Sn=()=>!o||J?null:r.jsxs(r.Fragment,{children:[To(),Lo()]}),fi=te=>{const Ee=!te.objectFit&&Fn(b);return{className:`${e}-slide-image-cell${Ee?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:F,maxHeight:A,...Ee?{"--image-aspect-ratio":Lr(b)}:{}}}},Io=te=>te.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":te.objectFit}}:Fn(b)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ei=te=>{if(te.length===0)return null;const Ee=te.length>1,p=Br(N),P=`calc(-0.5 * (${p} + ${N}))`;if(te.length===1){const B=te[0];return r.jsx("div",{...fi(B),children:r.jsx("img",{...Io(B),src:B.url,alt:B.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:Ee?{gap:N}:void 0,children:te.map((B,he)=>r.jsxs("div",{...fi(B),children:[r.jsx("img",{...Io(B),src:B.url,alt:B.name??"",draggable:!1}),o&&Ee&&he<te.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:P,width:p,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${B.url}-${he}`))})},Ro=!!(ve!=null&&ve.title2||ve!=null&&ve.title3||bt!=null&&bt.title2||bt!=null&&bt.title3||(w??0)>0||o),kr=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:mt,className:Oe,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Jn(pe||ve)}),r.jsxs("div",{ref:st,className:`${e}-titles-row-two-row`,style:{...ue&&ie?{minHeight:ie}:void 0,...ue&&Ce?{width:Ce,maxWidth:"100%"}:void 0},children:[jt(r.jsxs("div",{className:Oe,style:{position:ue?"absolute":"relative",inset:ue?0:void 0,width:"100%"},children:[bt&&ue?r.jsx("div",{className:`${Ne} ${e}-titles-fade-out`,children:cn(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:cn(ve)})]}),ue&&ie?ie:void 0),Ro?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[bt&&ue?r.jsx("div",{className:`${Ke} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${J?` ${e}-titles-layer-in-stacked`:""}`,children:un(ve,!0)})]}):null]})]}),Mr=()=>{const te=Ro;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...te?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:te?void 0:{flex:"0 0 auto",height:"auto"},children:Jn(ve,!0)}),Sn()]})};return r.jsxs("div",{ref:De,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{_t||dt()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:ft?void 0:-1,style:{opacity:ke?1:0,transition:"opacity 300ms ease",pointerEvents:ke?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:T,...Qe}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,...Ge,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Tt,onClick:te=>te.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":de&&oe.length>1?"true":"false",onPointerDown:de?Dt:void 0,onPointerUp:de?en:void 0,onPointerCancel:de?on:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Rt&&H?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:te=>{te.target===te.currentTarget&&xt(ae)},children:r.jsx("div",{className:`${e}-slide-area`,children:ei(Rt.images)})},`slide-out-${ae}`):null,r.jsx("div",{className:`${e}-slide-layer-in${H?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:ye?ei(ye.images):null})},`slide-in-${ae}-${xe}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Lt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:G,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...J?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${J?` ${e}-lightbox-content-area-stacked`:""}`,children:Jt&&r.jsx("div",{className:`${e}-text-bar-cell${J?` ${e}-text-bar-cell-stacked`:""}`,style:J?void 0:{flex:1,minWidth:0,width:"100%"},children:J?R==="fade"?kr():Mr():R==="fade"?Ve():Et()})})})]})]})]})};function Af(e){return`
13976
+ `,Tf="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),ai={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Lf(e){const t={};return t[Ht(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ht(e,"fontSettings")]={...ai.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ht(e,"fontSize")]={...ai.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ht(e,"lineHeight")]={...ai.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ht(e,"letterSpacing")]={...ai.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ht(e,"wordSpacing")]={...ai.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ht(e,"textAlign")]={...ai.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ht(e,"textAppearance")]={...ai.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const If=Hi.reduce((e,t)=>({...e,...Lf(t)}),{}),Rf=Hi.reduce((e,t)=>({...e,[Ht(t,"fontFamily")]:"Goudy Bookletter 1911",[Ht(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ht(t,"letterSpacing")]:0,[Ht(t,"wordSpacing")]:0,[Ht(t,"textAlign")]:"left",[Ht(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Zr(e){return Hi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ht(n,"fontSize")]=i),o!==void 0&&(t[Ht(n,"lineHeight")]=o),t},{})}const Ef=vf(),kf={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailSize:{type:"number",scope:"layout",title:"Thumbnail Size",min:0,display:{type:"range-control"}},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"layout",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"layout",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up","none"]}},thumbnailActiveColor:{type:"string",scope:"layout",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"layout",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"layout",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"layout",title:"Caption Default",display:{type:"palette-color-picker"}},...If,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:Tf,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Rf},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...Zr({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...Zr({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...Zr({title1FontSize:.011,title1LineHeight:.02,title2FontSize:.011,title2LineHeight:.02,title3FontSize:.011,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Ef]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},Mf={element:$f,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:kf,sourceCode:Cf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Hi.map(e=>({path:`${Ht(e,"fontFamily")}`}))]},fontRelations:{...Hi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ht(t,"fontFamily")}`}),{})}},Pf=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,initialSlideIndex:s=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:m})=>{const{type:x,coverFit:b,backgroundColor:T,imageGap:f,maxWidth:L,maxHeight:$,textTransition:R,title1Width:P,title2Width:C,title3Width:U,title1MarginLeft:E=0,title2MarginLeft:j=0,title3MarginLeft:I=0,titleRowMarginBottom:w=0,titleHeaderLayout:W="single-row",countCloseGap:h=0,closeIcon:S,closeIconMaxWidth:k,closeIconColor:z,closeIconHoverColor:K,contentMarginTop:le=0,iconMarginRight:Y=0}=n,D=a.useCallback(te=>y.scalingValue(te,i??!1),[i]),N=D(f??0),F=`${L}%`,A=`${$}%`,q=D(h),G=D(le),Z=D(Y),_=ci("title1",si(n,"title1"),i),me=ci("title2",si(n,"title2"),i),v=ci("title3",si(n,"title3"),i),fe=ci("count",si(n,"count"),i),J=W==="mobile",de=!i||!!l,$e=!o&&(!i||!!l),oe=a.useMemo(()=>Yo(t,x),[t,x]),[xe,Q]=a.useState(s),ye=oe[xe],ve=ye==null?void 0:ye.entry,[ke,we]=a.useState(!1),[Me,X]=a.useState(null),[ue,Se]=a.useState(!1),[O,ce]=a.useState(null),[H,re]=a.useState(!1),[ae,ne]=a.useState(0),[ie,be]=a.useState(),[Ce,ee]=a.useState(),[pe,Ae]=a.useState(null),se=a.useRef(null),V=a.useRef(0),je=a.useRef(0),We=a.useRef(0),et=a.useRef(!1),Ye=a.useRef(null),st=a.useRef(null),mt=a.useRef(null),De=a.useRef(null),ot=a.useRef(null),$t=a.useRef(null),rt=a.useRef(null),Ue=a.useCallback(()=>{const te=st.current;if(!te)return;const Ee=te.closest(`.${e}-lightbox-content-area`);if(!Ee)return te.getBoundingClientRect().width;const p=Array.from(Ee.children).reduce((M,B)=>!(B instanceof HTMLElement)||B.contains(te)?M:M+B.getBoundingClientRect().width,0);return Ee.getBoundingClientRect().width-p},[e]),ht=a.useCallback(()=>{se.current&&(clearTimeout(se.current),se.current=null)},[]),xt=a.useCallback(te=>{te===V.current&&(ce(null),re(!1))},[]),dt=a.useCallback(()=>{o||et.current||(et.current=!0,u==null||u(),we(!1),Ye.current=setTimeout(()=>{m()},300))},[o,u,m]),kt=a.useCallback(te=>!!(te.closest("[data-controls]")||te.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:_t,backdropStyle:Qe,mediaAreaStyle:Tt,overlayContentStyle:Lt,swipeHandlers:Ge,dismissAreaStyle:qe}=mc({enabled:$e,onClose:dt,animMs:300,isBlockedTarget:kt}),Pe=a.useCallback(te=>{d&&Xs(te+1,c,!0)},[d,c]),gt=a.useCallback(te=>{if(te)return te.getBoundingClientRect().height},[]),It=a.useCallback(te=>{if(oe.length===0)return;const Ee=(te%oe.length+oe.length)%oe.length;if(Ee===xe)return;const p=oe[xe],M=oe[Ee];V.current+=1;const B=V.current,he=R==="fade"&&Il(p==null?void 0:p.entry)!==Il(M==null?void 0:M.entry),Le=gt(mt.current),He=he?(()=>{const yt=Ue();gi.flushSync(()=>{Ae(M.entry)}),mt.current&&yt&&(mt.current.style.width=`${yt}px`);const tn=gt(mt.current);return mt.current&&(mt.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:yt}})():void 0,at=Math.max(Le??0,(He==null?void 0:He.measuredIncomingTitlesHeight)??0)||void 0;ne(B),ce(xe),re(!0),Q(Ee),Pe(Ee),We.current=Ee,he?(ht(),at&&be(at),He!=null&&He.incomingTitlesMeasureWidth&&ee(He.incomingTitlesMeasureWidth),X((p==null?void 0:p.entryIndex)??null),Se(!0),je.current=M.entryIndex,se.current=setTimeout(()=>{X(null),Se(!1),be(void 0),ee(void 0),Ae(null),se.current=null},400)):(ht(),X(null),Se(!1),be(void 0),ee(void 0),Ae(null),je.current=M.entryIndex)},[xe,ht,Ue,gt,oe,Pe,R]),Mt=a.useCallback(()=>{rt.current=null},[]),Dt=a.useCallback(te=>{!de||oe.length<=1||te.pointerType==="mouse"&&te.button!==0||te.target.closest("[data-controls]")||(rt.current={startX:te.clientX,startY:te.clientY,pointerId:te.pointerId})},[de,oe.length]),en=a.useCallback(te=>{var yt;if(!de||oe.length<=1||te.pointerType==="mouse"&&te.button!==0)return;if(_t){Mt();return}const Ee=rt.current;if(!Ee||Ee.pointerId!==te.pointerId||(Mt(),te.target.closest("[data-controls]")))return;const M=te.clientX-Ee.startX,B=te.clientY-Ee.startY,he=Math.abs(M),Le=Math.abs(B);if(he>=Gm&&he>Le){It(M>0?xe-1:xe+1);return}if(he>$l||Le>$l)return;const He=(yt=De.current)==null?void 0:yt.getBoundingClientRect(),at=He?He.left+He.width/2:window.innerWidth/2;It(te.clientX<at?xe-1:xe+1)},[xe,de,It,_t,Mt,oe.length]),on=a.useCallback(te=>{const Ee=rt.current;(Ee==null?void 0:Ee.pointerId)===te.pointerId&&Mt()},[Mt]);gc(),a.useEffect(()=>{$t.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const te=requestAnimationFrame(()=>{we(!0),requestAnimationFrame(()=>{ot.current?ot.current.focus():De.current&&De.current.focus()})});return()=>{cancelAnimationFrame(te),Ye.current&&clearTimeout(Ye.current),se.current&&clearTimeout(se.current);const Ee=$t.current;Ee&&document.contains(Ee)&&Ee.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var te;R!=="fade"&&(je.current=((te=oe[xe])==null?void 0:te.entryIndex)??0,ht(),X(null),Se(!1),be(void 0),ee(void 0))},[xe,ht,oe,R]),a.useEffect(()=>{const te=Ee=>{if(Ee.key==="Escape"){dt();return}if(Ee.key==="ArrowLeft"&&oe.length>1){It(xe-1);return}if(Ee.key==="ArrowRight"&&oe.length>1){It(xe+1);return}if(Ee.key==="Tab"&&De.current){const p=De.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),M=Array.from(p).filter(He=>!He.closest('[aria-hidden="true"]'));if(M.length===0)return;const B=M[0],he=M[M.length-1],Le=document.activeElement;Ee.shiftKey?(Le===B||!De.current.contains(Le))&&(Ee.preventDefault(),he.focus()):(Le===he||!De.current.contains(Le))&&(Ee.preventDefault(),B.focus())}};return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[It,dt,xe,oe.length]),a.useLayoutEffect(()=>{ht(),V.current=0,ne(0),ce(null),re(!1),X(null),Se(!1),be(void 0),ee(void 0),Ae(null),Q(te=>{const Ee=Math.max(0,oe.length-1);return Math.min(te,Ee)})},[ht,t.length,x,oe.length]),a.useLayoutEffect(()=>{var p;const te=Math.max(0,oe.length-1),Ee=Math.min(Math.max(0,s),te);We.current=Ee,je.current=((p=oe[Ee])==null?void 0:p.entryIndex)??0,Q(Ee)},[s]);const bt=Me!==null?t[Me]:null,Rt=O!==null?oe[O]:null,Ut=(ve==null?void 0:ve.title1)||(ve==null?void 0:ve.title2)||(ve==null?void 0:ve.title3)||(bt==null?void 0:bt.title1)||(bt==null?void 0:bt.title2)||(bt==null?void 0:bt.title3),Kt=Qm(x,oe,t),ft=S!==null,Jt=Ut||Kt||ft,Te=Kt&&ft?{gap:q}:void 0,Oe=`${e}-titles-stack${J?` ${e}-titles-stack-stacked`:""}`,Ke=`${e}-titles-layer-out${J?` ${e}-titles-layer-out-stacked`:""}`,Ne=`${e}-titles-layer-out`,ze=(E??0)>0||o,ut=D(w),_e=a.useMemo(()=>({title1Width:P??Ii.title1Width,title2Width:C??Ii.title2Width,title3Width:U??Ii.title3Width}),[P,C,U]),Je=a.useMemo(()=>({title2MarginLeft:j,title3MarginLeft:I}),[j,I]),tt=a.useMemo(()=>ve?Dn(e,ve,_,me,v):[],[e,ve,_,me,v]),Wt=a.useMemo(()=>tt.map(te=>_e[te.widthKey]),[tt,_e]),Ct=a.useMemo(()=>Pi(tt.length,Wt),[tt.length,Wt]),lt=a.useMemo(()=>po(tt.length,Wt),[tt.length,Wt]),Nt=a.useMemo(()=>tt.filter(te=>te.prefix==="title1"),[tt]),At=a.useMemo(()=>tt.filter(te=>te.prefix==="title2"||te.prefix==="title3"),[tt]),Vt=a.useMemo(()=>Vn(Nt,_e),[Nt,_e]),zt=a.useMemo(()=>Vn(At,_e),[At,_e]),Pt=a.useCallback((te,Ee)=>{const p=tt.findIndex(B=>B.prefix===te.prefix);if(!J||Ee==="single-row")return{effectiveWidth:lt[p]??0,resolvedWidth:Ct[p]??0,maxWidth:ln(p,Ct)};if(Ee==="two-row-top"){const B=Nt.findIndex(he=>he.prefix===te.prefix);return{effectiveWidth:Vt.effective[B]??0,resolvedWidth:Vt.resolved[B]??0,maxWidth:ln(B,Vt.resolved)}}const M=At.findIndex(B=>B.prefix===te.prefix);return{effectiveWidth:zt.effective[M]??0,resolvedWidth:zt.resolved[M]??0,maxWidth:ln(M,zt.resolved)}},[tt,At,zt,lt,Ct,Nt,Vt,J]),Qt=a.useCallback(te=>Qs(tt,Ct,Je,te)+(J?0:E??0),[tt,Ct,Je,J,E]),wt=a.useCallback(()=>J?0:E??0,[J,E]),Gt=a.useCallback(te=>At.slice(0,te).reduce((Ee,p,M)=>Ee+(p.marginLeftKey?Je[p.marginLeftKey]??0:0)+(zt.resolved[M]??0),0),[At,zt.resolved,Je]),pt=a.useCallback(te=>{const Ee=At[te];return Gt(te)+(Ee.marginLeftKey?Je[Ee.marginLeftKey]??0:0)+(zt.resolved[te]??0)},[At,zt.resolved,Gt,Je]),Ft=a.useCallback((te,Ee,p)=>{if(!J||p==="single-row"){const He=te.findIndex(Yt=>Yt.prefix===Ee.prefix),at=te.map(Yt=>_e[Yt.widthKey]),yt=Pi(te.length,at);return{effectiveWidth:po(te.length,at)[He]??0,resolvedWidth:yt[He]??0,maxWidth:ln(He,yt)}}if(p==="two-row-top"){const He=te.filter(Yt=>Yt.prefix==="title1"),at=He.findIndex(Yt=>Yt.prefix===Ee.prefix),{resolved:yt,effective:tn}=Vn(He,_e);return{effectiveWidth:tn[at]??0,resolvedWidth:yt[at]??0,maxWidth:ln(at,yt)}}const M=te.filter(He=>He.prefix==="title2"||He.prefix==="title3"),B=M.findIndex(He=>He.prefix===Ee.prefix),{resolved:he,effective:Le}=Vn(M,_e);return{effectiveWidth:Le[B]??0,resolvedWidth:he[B]??0,maxWidth:ln(B,he)}},[_e,J]),Bt=(te,Ee,p)=>{const M=te.marginLeftKey?Je[te.marginLeftKey]??0:0,{effectiveWidth:B,resolvedWidth:he,maxWidth:Le}=p??Pt(te,Ee),He=Math.max(M,Bn),at=o&&Ee==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":te.prefix,style:{width:D(B),...M>0?{marginLeft:D(M)}:{}},children:[r.jsx("p",{className:te.className,style:te.style,children:te.text}),at&&te.marginLeftKey?r.jsx("div",{"data-controls":te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(he),style:{position:"absolute",top:0,left:D(-M),width:D(He),height:"100%",pointerEvents:"auto"}}):null,at?r.jsx("div",{"data-controls":te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Le),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D(-hn/2),width:D(hn),height:"100%",pointerEvents:"auto"}}):null]},te.className)},g=(te="two-row")=>{const Ee=tt.findIndex(B=>B.prefix==="title1"),p=Ee>=0?Ct[Ee]:_e.title1Width,M=te==="two-row"&&o;return r.jsx("div",{...M?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p)}:{},style:{width:D(E??0),flexShrink:0,alignSelf:"stretch",...M?{pointerEvents:"auto"}:{}}})},ge=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:_,"aria-hidden":"true",children:" "}),Re=()=>r.jsx("span",{className:`${e}-entry-counter`,style:fe,"aria-live":"polite","aria-atomic":"true",children:Jm(oe,xe,x,t)}),Ie=()=>Kt?o&&ft?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Re(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Br(q)} + ${q}))`,width:Br(q),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Re():null,Ze=()=>!Kt&&!ft?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Te,children:[Ie(),ft?it():null]}),Et=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Kt||Ut?ge():null,ze?g("single-row"):null,St(ve),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),Ze(),Sn()]}),Ve=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Kt||Ut?ge():null,ze?g("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:ue&&ie?{minHeight:ie}:void 0,children:[r.jsx("div",{ref:mt,className:Oe,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Qn(pe||ve)}),r.jsxs("div",{ref:st,className:Oe,style:{position:ue?"absolute":"relative",inset:ue?0:void 0,width:"100%",...ue&&Ce?{width:Ce,maxWidth:"100%"}:void 0},children:[bt&&ue?r.jsx("div",{className:`${Ke} ${e}-titles-fade-out`,children:Qn(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Qn(ve)})]})]}),Ze(),Sn()]}),it=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:y.scalingValue(k??0,i),height:y.scalingValue(k??0,i),marginRight:Z,"--close-icon-hover-color":K},children:[r.jsx("button",{ref:ot,type:"button",className:`${e}-close-icon-inner`,onClick:dt,"aria-label":"Close",children:r.jsx(rn,{url:S??"",fill:z,hoverFill:i&&!l?z:K,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:Z,height:"100%",pointerEvents:"auto"}})]}),jt=(te,Ee)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Kt||Ut?ge():null,ze?g("two-row"):null,Ee!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ee},children:te}):r.jsxs(r.Fragment,{children:[te,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),Ze()]}),St=te=>{if(!te)return null;const Ee=Dn(e,te,_,me,v);return r.jsx(r.Fragment,{children:Ee.map(p=>Bt(p,"single-row",Ft(Ee,p,"single-row")))})},cn=te=>{if(!te)return null;const Ee=Dn(e,te,_,me,v),p=Ee.find(M=>M.prefix==="title1");return p?Bt(p,"two-row-top",Ft(Ee,p,"two-row-top")):null},un=(te,Ee=!1)=>{const p=te?Dn(e,te,_,me,v):[],M=p.filter(Le=>Le.prefix==="title2"||Le.prefix==="title3"),B=o&&Ee;return M.length>0||B||(w??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[M.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[M.map(Le=>Bt(Le,"two-row-bottom",Ft(p,Le,"two-row-bottom"))),Ee&&o?r.jsxs(r.Fragment,{children:[Rr(),Er()]}):null]}):null,(w??0)>0||B?r.jsx("div",{"data-controls":B?"titleRowMarginBottom":void 0,"data-controls-axis":B?"y":void 0,"data-controls-reverse":B?"":void 0,className:B?`${e}-control`:void 0,style:{height:ut,width:"100%",flexShrink:0,pointerEvents:B?"auto":"none"}}):null]}):null},Jn=(te,Ee=!1)=>r.jsxs(r.Fragment,{children:[jt(cn(te)),un(te,Ee)]}),Qn=te=>J?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Jn(te)}):te?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:St(te)}):null,To=()=>{const te=J?-1:tt.findIndex(M=>M.prefix==="title1"),Ee=!J&&(o||(E??0)>0)?(()=>{const M=E??0,B=te>=0?Ct[te]:_e.title1Width,he=Math.max(M,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(B),style:{position:"absolute",top:0,left:0,width:D(he),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,p=tt.flatMap((M,B)=>{if(!M.marginLeftKey)return[];const he=Je[M.marginLeftKey]??0,Le=Js(tt,Ct,Je,B)+wt(),He=Math.max(he,Bn);return r.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ct[B]),style:{position:"absolute",top:0,left:D(Le),width:D(He),height:"100%",pointerEvents:"auto"}},M.marginLeftKey)});return Ee?[Ee,...p]:p},Lo=()=>tt.map((te,Ee)=>{const p=ln(Ee,Ct),B=Qt(Ee)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(B),width:D(hn),height:"100%",pointerEvents:"auto"}})},`${te.widthKey}-junction`)}),Rr=()=>At.flatMap((te,Ee)=>{if(!te.marginLeftKey)return[];const p=Je[te.marginLeftKey]??0,M=Gt(Ee),B=Math.max(p,Bn),{resolvedWidth:he}=Pt(te,"two-row-bottom");return r.jsx("div",{"data-controls":te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(he),style:{position:"absolute",top:0,left:D(M),width:D(B),height:"100%",pointerEvents:"auto"}},te.marginLeftKey)}),Er=()=>At.map((te,Ee)=>{const{maxWidth:p}=Pt(te,"two-row-bottom"),B=pt(Ee)-hn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":te.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(p),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(B),width:D(hn),height:"100%",pointerEvents:"auto"}})},`${te.widthKey}-junction`)}),Sn=()=>!o||J?null:r.jsxs(r.Fragment,{children:[To(),Lo()]}),fi=te=>{const Ee=!te.objectFit&&Fn(b);return{className:`${e}-slide-image-cell${Ee?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:F,maxHeight:A,...Ee?{"--image-aspect-ratio":Lr(b)}:{}}}},Io=te=>te.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":te.objectFit}}:Fn(b)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ei=te=>{if(te.length===0)return null;const Ee=te.length>1,p=Br(N),M=`calc(-0.5 * (${p} + ${N}))`;if(te.length===1){const B=te[0];return r.jsx("div",{...fi(B),children:r.jsx("img",{...Io(B),src:B.url,alt:B.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:Ee?{gap:N}:void 0,children:te.map((B,he)=>r.jsxs("div",{...fi(B),children:[r.jsx("img",{...Io(B),src:B.url,alt:B.name??"",draggable:!1}),o&&Ee&&he<te.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:M,width:p,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${B.url}-${he}`))})},Ro=!!(ve!=null&&ve.title2||ve!=null&&ve.title3||bt!=null&&bt.title2||bt!=null&&bt.title3||(w??0)>0||o),kr=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:mt,className:Oe,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Jn(pe||ve)}),r.jsxs("div",{ref:st,className:`${e}-titles-row-two-row`,style:{...ue&&ie?{minHeight:ie}:void 0,...ue&&Ce?{width:Ce,maxWidth:"100%"}:void 0},children:[jt(r.jsxs("div",{className:Oe,style:{position:ue?"absolute":"relative",inset:ue?0:void 0,width:"100%"},children:[bt&&ue?r.jsx("div",{className:`${Ne} ${e}-titles-fade-out`,children:cn(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:cn(ve)})]}),ue&&ie?ie:void 0),Ro?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[bt&&ue?r.jsx("div",{className:`${Ke} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(bt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${J?` ${e}-titles-layer-in-stacked`:""}`,children:un(ve,!0)})]}):null]})]}),Mr=()=>{const te=Ro;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...te?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:te?void 0:{flex:"0 0 auto",height:"auto"},children:Jn(ve,!0)}),Sn()]})};return r.jsxs("div",{ref:De,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{_t||dt()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:ft?void 0:-1,style:{opacity:ke?1:0,transition:"opacity 300ms ease",pointerEvents:ke?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:T,...Qe}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,...Ge,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Tt,onClick:te=>te.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":de&&oe.length>1?"true":"false",onPointerDown:de?Dt:void 0,onPointerUp:de?en:void 0,onPointerCancel:de?on:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Rt&&H?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:te=>{te.target===te.currentTarget&&xt(ae)},children:r.jsx("div",{className:`${e}-slide-area`,children:ei(Rt.images)})},`slide-out-${ae}`):null,r.jsx("div",{className:`${e}-slide-layer-in${H?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:ye?ei(ye.images):null})},`slide-in-${ae}-${xe}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Lt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:G,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...J?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${J?` ${e}-lightbox-content-area-stacked`:""}`,children:Jt&&r.jsx("div",{className:`${e}-text-bar-cell${J?` ${e}-text-bar-cell-stacked`:""}`,style:J?void 0:{flex:1,minWidth:0,width:"100%"},children:J?R==="fade"?kr():Mr():R==="fade"?Ve():Et()})})})]})]})]})};function Af(e){return`
13977
13977
  .${e}-wrapper {
13978
13978
  position: relative;
13979
13979
  width: 100%;
@@ -14507,7 +14507,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
14507
14507
  pointer-events: auto;
14508
14508
  z-index: 10;
14509
14509
  }
14510
- `}const Ff=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l,metadata:s})=>{const{prefix:d}=y.useScopedStyles(),c=(s==null?void 0:s.itemId)??null,{cover:u,coverFit:m,type:x}=e,b=a.useRef(null),[T,f]=a.useState(!1),[L,$]=a.useState(0),R=a.useRef(!1),E=a.useRef(!1),C=a.useRef(!1),U=a.useMemo(()=>(t??[]).filter(h=>Mi(h).length>0),[t]),k=T&&U.length>0,j=!n,I=a.useCallback(()=>{j&&(C.current=!0,Km(E.current,c),E.current=!1)},[j,c]),w=(h=0)=>{if(U.length===0||n&&!i&&!o)return;const S=Yo(U,x),M=Math.max(0,Math.min(h,S.length-1));if($(M),j){const z=Ys();Xs(M+1,c,z),E.current=!z}f(!0)},W=a.useCallback(()=>{f(!1),C.current=!1},[]);return a.useEffect(()=>{!n||i||o||f(!1)},[n,i,o]),a.useEffect(()=>{if(!j||R.current)return;R.current=!0;const h=Tl(c);if(!h)return;const S=Ll(h,Yo(U,x).length);S<0||($(S),f(!0))},[U,c,j,x]),a.useEffect(()=>{if(!j)return;const h=()=>{if(C.current){C.current=!1,f(!1);return}const S=Tl(c);if(!S){f(!1);return}const M=Ll(S,Yo(U,x).length);if(M<0){f(!1);return}E.current=!1,$(M),f(!0)};return window.addEventListener("popstate",h),()=>window.removeEventListener("popstate",h)},[U,c,j,x]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:b,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Af(d)}}),u?r.jsx("button",{type:"button",className:`${d}-cover ${Fn(m)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>w(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Fn(m)?{"--image-aspect-ratio":Lr(m)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Fn(m)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),k&&typeof document<"u"&&(()=>{const h=(l?document.getElementById(l):null)??document.body;return gi.createPortal(r.jsx(Pf,{prefix:d,entries:U,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:L,enableUrlSync:j,journalItemId:c,onBeforeClose:I,onClose:W}),h)})()]})},Wf=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
14510
+ `}const Ff=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l,metadata:s})=>{const{prefix:d}=y.useScopedStyles(),c=(s==null?void 0:s.itemId)??null,{cover:u,coverFit:m,type:x}=e,b=a.useRef(null),[T,f]=a.useState(!1),[L,$]=a.useState(0),R=a.useRef(!1),P=a.useRef(!1),C=a.useRef(!1),U=a.useMemo(()=>(t??[]).filter(h=>Mi(h).length>0),[t]),E=T&&U.length>0,j=!n,I=a.useCallback(()=>{j&&(C.current=!0,Km(P.current,c),P.current=!1)},[j,c]),w=(h=0)=>{if(U.length===0||n&&!i&&!o)return;const S=Yo(U,x),k=Math.max(0,Math.min(h,S.length-1));if($(k),j){const z=Ys();Xs(k+1,c,z),P.current=!z}f(!0)},W=a.useCallback(()=>{f(!1),C.current=!1},[]);return a.useEffect(()=>{!n||i||o||f(!1)},[n,i,o]),a.useEffect(()=>{if(!j||R.current)return;R.current=!0;const h=Tl(c);if(!h)return;const S=Ll(h,Yo(U,x).length);S<0||($(S),f(!0))},[U,c,j,x]),a.useEffect(()=>{if(!j)return;const h=()=>{if(C.current){C.current=!1,f(!1);return}const S=Tl(c);if(!S){f(!1);return}const k=Ll(S,Yo(U,x).length);if(k<0){f(!1);return}P.current=!1,$(k),f(!0)};return window.addEventListener("popstate",h),()=>window.removeEventListener("popstate",h)},[U,c,j,x]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:b,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Af(d)}}),u?r.jsx("button",{type:"button",className:`${d}-cover ${Fn(m)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>w(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Fn(m)?{"--image-aspect-ratio":Lr(m)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Fn(m)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),E&&typeof document<"u"&&(()=>{const h=(l?document.getElementById(l):null)??document.body;return gi.createPortal(r.jsx(Pf,{prefix:d,entries:U,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:L,enableUrlSync:j,journalItemId:c,onBeforeClose:I,onClose:W}),h)})()]})},Wf=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
14511
14511
  import { createPortal } from 'react-dom';
14512
14512
  import { CommonComponentProps } from '../props';
14513
14513
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -15310,7 +15310,7 @@ export type LightboxJournalSettings = {
15310
15310
  width: 32px;
15311
15311
  height: 32px;
15312
15312
  }
15313
- `}function qf(e){return new Promise(t=>{const n=new Image;n.onload=()=>{t({aspectRatio:n.naturalHeight/n.naturalWidth,naturalWidth:n.naturalWidth})},n.onerror=()=>{t({aspectRatio:1,naturalWidth:700})},n.src=e})}async function Kf(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await qf(i)]));return new Map(n)}function Uf({settings:e,content:t=[],isEditor:n}){const{prefix:i}=y.useScopedStyles(),[o,l]=a.useState(null),[s,d]=a.useState([]),[c,u]=a.useState(0),m=a.useRef(0),[x,b]=a.useState({x:0,y:0}),[T,f]=a.useState("none"),L=a.useRef({x:0,y:0}),[$,R]=a.useState(!1),[E,C]=a.useState(!1),U=a.useRef(new Map),{imageSize:k=Df,cursor:j="system",target:I="area",position:w="random",visible:W="all",defaultCursor:h=null,hoverCursor:S=null}=e,M=a.useMemo(()=>Gf(i),[i]),z=a.useCallback((N,F,A=s)=>{if(!o)return;const q=o.getBoundingClientRect(),G=N-q.left,Z=F-q.top;b({x:G,y:Z}),f(Vf(G,Z,A,o,j,I,S,h))},[o,s,j,I,S,h]);a.useEffect(()=>{const N=[...t.map(A=>A.image.url),h,S].filter(A=>!!A);if(N.length===0){U.current=new Map,C(!0);return}let F=!1;return C(!1),Kf(N).then(A=>{F||(U.current=A,C(!0))}),()=>{F=!0}},[t,h,S]),a.useEffect(()=>{if(!o)return;const N=A=>{A.stopPropagation(),L.current={x:A.clientX,y:A.clientY},z(A.clientX,A.clientY)},F=()=>{$&&z(L.current.x,L.current.y)};return o.addEventListener("mousemove",N),window.addEventListener("scroll",F,!0),()=>{o.removeEventListener("mousemove",N),window.removeEventListener("scroll",F,!0)}},[o,$,z]),a.useEffect(()=>{!o||!$||z(L.current.x,L.current.y)},[s,o,$,z]),a.useEffect(()=>{$||f("none")},[$]);const K=(N,F,A,q={})=>{var fe;const G=((fe=U.current.get(N.image.url))==null?void 0:fe.aspectRatio)??1,Z=es(N.image.url,k,U.current),{heightPx:_}=lr(Z,G);let me=0,v=0;return w==="same"?{x:me,y:v}=Ql(F,A,Z,G):(me=q.x??Math.random()*F,v=q.y??Math.random()*A,{x:me,y:v}=fa(me,v,F,A,Z,_)),{id:m.current++,url:N.image.url,link:N.link,name:N.image.name,x:me,y:v,xRatio:me/F,yRatio:v/A,aspectRatio:G,widthPx:Z}},le=()=>{if(!o)return;const N=o.getBoundingClientRect(),F=N.width,A=N.height;F===0||A===0||d(q=>q.length===0?q:q.map(G=>{const Z=k.sizeType==="random"?G.widthPx:es(G.url,k,U.current),{heightPx:_}=lr(Z,G.aspectRatio);if(w==="same"){const{x:fe,y:J}=Ql(F,A,Z,G.aspectRatio);return{...G,x:fe,y:J,widthPx:Z}}const{x:me,y:v}=fa(G.xRatio*F,G.yRatio*A,F,A,Z,_);return{...G,x:me,y:v,widthPx:Z}}))};a.useEffect(()=>{if(!o||t.length===0||!E)return;const N=o.getBoundingClientRect(),F=N.width,A=N.height,q=K(t[0],F,A);d([q]),u(1)},[k,w,o,t,E]),a.useEffect(()=>{if(!o)return;le();const N=new ResizeObserver(le);return N.observe(o),window.addEventListener("resize",le),()=>{N.disconnect(),window.removeEventListener("resize",le)}},[o,w,k,s.length]),a.useEffect(()=>{W==="last One"&&d(N=>N.length>0?[N[N.length-1]]:[])},[W]);const Y=N=>{if(!o||t.length===0||!E)return;const F=o.getBoundingClientRect(),A=N.clientX-F.left,q=N.clientY-F.top;if(I==="image"&&!fc(A,q,s))return;let G=0,Z=0;w==="on Click"?(G=A,Z=q):w==="same"?(G=F.width/2,Z=F.height/2):(G=Math.random()*F.width,Z=Math.random()*F.height);const _=t[c],me=K(_,F.width,F.height,{x:G,y:Z}),v=W==="all"?[...s,me]:[me];d(v),u(fe=>fe>=t.length-1?0:fe+1),z(N.clientX,N.clientY,v)},D=j==="custom"&&T!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:M}}),r.jsxs("div",{ref:l,onClick:Y,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),className:`${i}-root`,style:{cursor:D?"none":"default"},children:[s.map(N=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${N.y}px`,left:`${N.x}px`,width:`${N.widthPx}px`,cursor:D?"none":"default"},children:I==="area"&&N.link?r.jsx("a",{href:N.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:N.url,alt:N.name,className:`${i}-image`})}):r.jsx("img",{src:N.url,alt:N.name,className:`${i}-image`})},N.id)),$&&D&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${x.x}px`,top:`${x.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${T}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Xf=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
15313
+ `}function qf(e){return new Promise(t=>{const n=new Image;n.onload=()=>{t({aspectRatio:n.naturalHeight/n.naturalWidth,naturalWidth:n.naturalWidth})},n.onerror=()=>{t({aspectRatio:1,naturalWidth:700})},n.src=e})}async function Kf(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await qf(i)]));return new Map(n)}function Uf({settings:e,content:t=[],isEditor:n}){const{prefix:i}=y.useScopedStyles(),[o,l]=a.useState(null),[s,d]=a.useState([]),[c,u]=a.useState(0),m=a.useRef(0),[x,b]=a.useState({x:0,y:0}),[T,f]=a.useState("none"),L=a.useRef({x:0,y:0}),[$,R]=a.useState(!1),[P,C]=a.useState(!1),U=a.useRef(new Map),{imageSize:E=Df,cursor:j="system",target:I="area",position:w="random",visible:W="all",defaultCursor:h=null,hoverCursor:S=null}=e,k=a.useMemo(()=>Gf(i),[i]),z=a.useCallback((N,F,A=s)=>{if(!o)return;const q=o.getBoundingClientRect(),G=N-q.left,Z=F-q.top;b({x:G,y:Z}),f(Vf(G,Z,A,o,j,I,S,h))},[o,s,j,I,S,h]);a.useEffect(()=>{const N=[...t.map(A=>A.image.url),h,S].filter(A=>!!A);if(N.length===0){U.current=new Map,C(!0);return}let F=!1;return C(!1),Kf(N).then(A=>{F||(U.current=A,C(!0))}),()=>{F=!0}},[t,h,S]),a.useEffect(()=>{if(!o)return;const N=A=>{A.stopPropagation(),L.current={x:A.clientX,y:A.clientY},z(A.clientX,A.clientY)},F=()=>{$&&z(L.current.x,L.current.y)};return o.addEventListener("mousemove",N),window.addEventListener("scroll",F,!0),()=>{o.removeEventListener("mousemove",N),window.removeEventListener("scroll",F,!0)}},[o,$,z]),a.useEffect(()=>{!o||!$||z(L.current.x,L.current.y)},[s,o,$,z]),a.useEffect(()=>{$||f("none")},[$]);const K=(N,F,A,q={})=>{var fe;const G=((fe=U.current.get(N.image.url))==null?void 0:fe.aspectRatio)??1,Z=es(N.image.url,E,U.current),{heightPx:_}=lr(Z,G);let me=0,v=0;return w==="same"?{x:me,y:v}=Ql(F,A,Z,G):(me=q.x??Math.random()*F,v=q.y??Math.random()*A,{x:me,y:v}=fa(me,v,F,A,Z,_)),{id:m.current++,url:N.image.url,link:N.link,name:N.image.name,x:me,y:v,xRatio:me/F,yRatio:v/A,aspectRatio:G,widthPx:Z}},le=()=>{if(!o)return;const N=o.getBoundingClientRect(),F=N.width,A=N.height;F===0||A===0||d(q=>q.length===0?q:q.map(G=>{const Z=E.sizeType==="random"?G.widthPx:es(G.url,E,U.current),{heightPx:_}=lr(Z,G.aspectRatio);if(w==="same"){const{x:fe,y:J}=Ql(F,A,Z,G.aspectRatio);return{...G,x:fe,y:J,widthPx:Z}}const{x:me,y:v}=fa(G.xRatio*F,G.yRatio*A,F,A,Z,_);return{...G,x:me,y:v,widthPx:Z}}))};a.useEffect(()=>{if(!o||t.length===0||!P)return;const N=o.getBoundingClientRect(),F=N.width,A=N.height,q=K(t[0],F,A);d([q]),u(1)},[E,w,o,t,P]),a.useEffect(()=>{if(!o)return;le();const N=new ResizeObserver(le);return N.observe(o),window.addEventListener("resize",le),()=>{N.disconnect(),window.removeEventListener("resize",le)}},[o,w,E,s.length]),a.useEffect(()=>{W==="last One"&&d(N=>N.length>0?[N[N.length-1]]:[])},[W]);const Y=N=>{if(!o||t.length===0||!P)return;const F=o.getBoundingClientRect(),A=N.clientX-F.left,q=N.clientY-F.top;if(I==="image"&&!fc(A,q,s))return;let G=0,Z=0;w==="on Click"?(G=A,Z=q):w==="same"?(G=F.width/2,Z=F.height/2):(G=Math.random()*F.width,Z=Math.random()*F.height);const _=t[c],me=K(_,F.width,F.height,{x:G,y:Z}),v=W==="all"?[...s,me]:[me];d(v),u(fe=>fe>=t.length-1?0:fe+1),z(N.clientX,N.clientY,v)},D=j==="custom"&&T!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:k}}),r.jsxs("div",{ref:l,onClick:Y,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),className:`${i}-root`,style:{cursor:D?"none":"default"},children:[s.map(N=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${N.y}px`,left:`${N.x}px`,width:`${N.widthPx}px`,cursor:D?"none":"default"},children:I==="area"&&N.link?r.jsx("a",{href:N.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:N.url,alt:N.name,className:`${i}-image`})}):r.jsx("img",{src:N.url,alt:N.name,className:`${i}-image`})},N.id)),$&&D&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${x.x}px`,top:`${x.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${T}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Xf=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
15314
15314
  import { CommonComponentProps } from '../props';
15315
15315
  import { useScopedStyles } from '../utils/index';
15316
15316
 
@@ -15941,7 +15941,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
15941
15941
  display: block;
15942
15942
  pointer-events: none;
15943
15943
  }
15944
- `}function ty(e){return e==="blur"?Qf:e==="greyscale"?Jf:0}function Ui(e,t=1,n=1){const i=ty(e)*Math.max(0,Math.min(1,t));if(e==="greyscale")return`grayscale(${i}%)`;if(e==="blur"){const o=i/4;return o<=0?"none":`blur(${o/Math.max(n,1)}px)`}return"none"}function ts(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function ny(e,t){return t<=1?0:(e-1+t)%t}function iy(e,t=1){return!e||e.height===0?t:e.width/e.height}function oy(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const l=e*i/100,s=t*o/100;let d=l,c=d/n;return c>s&&(c=s,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function ns(e,t,n){if(e<=0||t<=0)return 1;const i=e*n.widthPercent/100,o=t*n.heightPercent/100;return i<=0||o<=0?1:Math.max(e/i,t/o)}function yc(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function is(e,t,n){return{...yc(e),[`--${n}-stage-scale`]:t}}function ry(e,t){[...new Set(e.filter(Boolean))].forEach(i=>{const o=new Image;o.onload=()=>{o.naturalWidth>0&&o.naturalHeight>0&&t(i,{width:o.naturalWidth,height:o.naturalHeight})},o.src=i})}function ay({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Se,O,ce,H,re,ae,ne;const{prefix:o}=y.useScopedStyles(),l=a.useMemo(()=>ey(o),[o]),{imageSize:s,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:m="greyscale"}=e,x=t??[],b=ts(x.length),[T,f]=a.useState(b.activeIndex),[L,$]=a.useState(b.backgroundIndex),[R,E]=a.useState(!1),[C,U]=a.useState(!1),[k,j]=a.useState(null),[I,w]=a.useState(null),[W,h]=a.useState(0),[S,M]=a.useState(1),[z,K]=a.useState("none"),[le,Y]=a.useState("next"),[D,N]=a.useState({}),[F,A]=a.useState({width:0,height:0}),q=a.useRef(null),G=a.useRef(null),Z=!n||!!i,_=s??60,me=Math.max(10,Math.min(100,d??_)),v=Math.max(10,Math.min(100,c??_)),fe=Math.max(100,u),J=Ui(m),de=a.useCallback(ie=>{const be=iy(ie?D[ie]:void 0);return oy(F.width,F.height,be,me,v)},[F.height,F.width,D,v,me]);a.useEffect(()=>{const ie=G.current;if(!ie)return;const be=new ResizeObserver(([Ce])=>{const{width:ee,height:pe}=Ce.contentRect;A({width:ee,height:pe})});return be.observe(ie),()=>be.disconnect()},[]),a.useEffect(()=>{const ie=(t??[]).map(be=>{var Ce;return(Ce=be.image)==null?void 0:Ce.url}).filter(be=>!!be);ry(ie,(be,Ce)=>{N(ee=>{var pe,Ae;return((pe=ee[be])==null?void 0:pe.width)===Ce.width&&((Ae=ee[be])==null?void 0:Ae.height)===Ce.height?ee:{...ee,[be]:Ce}})})},[t]),a.useEffect(()=>{const{backgroundIndex:ie,activeIndex:be}=ts(x.length);f(be),$(ie),E(!1),U(!1),j(null),w(null),h(0),M(1),K("none"),Y("next")},[x.length,t]),a.useEffect(()=>()=>{q.current&&clearTimeout(q.current)},[]);const $e=a.useCallback(ie=>{var se,V,je,We;if(!Z||R||x.length<=1)return;const be=ie==="next"?(T+1)%x.length:(T-1+x.length)%x.length,Ce=de((V=(se=x[T])==null?void 0:se.image)==null?void 0:V.url),ee=de((We=(je=x[be])==null?void 0:je.image)==null?void 0:We.url),pe=ns(F.width,F.height,Ce),Ae=ns(F.width,F.height,ee);q.current&&clearTimeout(q.current),Y(ie),U(!0),E(!0),ie==="next"?(j(T),w(be),h(0),M(1),K(Ui(m,0,1))):($(ny(be,x.length)),j(be),w(T),h(1),M(Ae),K(Ui(m,1,Ae))),requestAnimationFrame(()=>{U(!1),requestAnimationFrame(()=>{ie==="next"?(h(1),M(pe),K(Ui(m,1,pe))):(h(0),M(1),K(Ui(m,0,1)))})}),q.current=setTimeout(()=>{ie==="next"&&$(T),f(be),j(null),w(null),E(!1)},fe)},[T,m,F.height,F.width,de,R,Z,x,fe]),oe=x[T],xe=L!==null?x[L]:null,Q=k!==null?x[k]:null,ye=I!==null?x[I]:null,ve=x.length<=1?0:(T-1+x.length)%x.length,ke=x.length<=1?0:(T+1)%x.length,we=de((Se=oe==null?void 0:oe.image)==null?void 0:Se.url),Me=de((O=Q==null?void 0:Q.image)==null?void 0:O.url),X=de((ce=ye==null?void 0:ye.image)==null?void 0:ce.url),ue={[`--${o}-transition-ms`]:`${fe}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsxs("div",{ref:G,className:nt(`${o}-wrapper`,C&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ue,"aria-label":"Zoom gallery",children:[((H=xe==null?void 0:xe.image)==null?void 0:H.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:xe.image.url,alt:"",style:{filter:J}})}),R&&((re=Q==null?void 0:Q.image)==null?void 0:re.url)&&r.jsx("div",{className:nt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${le}`),style:is(Me,S,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:Q.image.url,alt:"",style:{filter:z}})}),R&&((ae=ye==null?void 0:ye.image)==null?void 0:ae.url)&&r.jsx("div",{className:nt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${le}`),style:is(X,W,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:ye.image.url,alt:""})}),!R&&((ne=oe==null?void 0:oe.image)==null?void 0:ne.url)&&r.jsx("div",{className:nt(`${o}-stage`,`${o}-foreground`),style:yc(we),children:r.jsx("img",{className:`${o}-image`,src:oe.image.url,alt:oe.image.name??""})}),Z&&x.length>1&&!R&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:nt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>$e("prev"),"aria-label":`Show previous image (${ve+1} of ${x.length})`}),r.jsx("button",{type:"button",className:nt(`${o}-nav`,`${o}-nav-next`),onClick:()=>$e("next"),"aria-label":`Show next image (${ke+1} of ${x.length})`})]})]})]})}const ly=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
15944
+ `}function ty(e){return e==="blur"?Qf:e==="greyscale"?Jf:0}function Ui(e,t=1,n=1){const i=ty(e)*Math.max(0,Math.min(1,t));if(e==="greyscale")return`grayscale(${i}%)`;if(e==="blur"){const o=i/4;return o<=0?"none":`blur(${o/Math.max(n,1)}px)`}return"none"}function ts(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function ny(e,t){return t<=1?0:(e-1+t)%t}function iy(e,t=1){return!e||e.height===0?t:e.width/e.height}function oy(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const l=e*i/100,s=t*o/100;let d=l,c=d/n;return c>s&&(c=s,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function ns(e,t,n){if(e<=0||t<=0)return 1;const i=e*n.widthPercent/100,o=t*n.heightPercent/100;return i<=0||o<=0?1:Math.max(e/i,t/o)}function yc(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function is(e,t,n){return{...yc(e),[`--${n}-stage-scale`]:t}}function ry(e,t){[...new Set(e.filter(Boolean))].forEach(i=>{const o=new Image;o.onload=()=>{o.naturalWidth>0&&o.naturalHeight>0&&t(i,{width:o.naturalWidth,height:o.naturalHeight})},o.src=i})}function ay({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Se,O,ce,H,re,ae,ne;const{prefix:o}=y.useScopedStyles(),l=a.useMemo(()=>ey(o),[o]),{imageSize:s,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:m="greyscale"}=e,x=t??[],b=ts(x.length),[T,f]=a.useState(b.activeIndex),[L,$]=a.useState(b.backgroundIndex),[R,P]=a.useState(!1),[C,U]=a.useState(!1),[E,j]=a.useState(null),[I,w]=a.useState(null),[W,h]=a.useState(0),[S,k]=a.useState(1),[z,K]=a.useState("none"),[le,Y]=a.useState("next"),[D,N]=a.useState({}),[F,A]=a.useState({width:0,height:0}),q=a.useRef(null),G=a.useRef(null),Z=!n||!!i,_=s??60,me=Math.max(10,Math.min(100,d??_)),v=Math.max(10,Math.min(100,c??_)),fe=Math.max(100,u),J=Ui(m),de=a.useCallback(ie=>{const be=iy(ie?D[ie]:void 0);return oy(F.width,F.height,be,me,v)},[F.height,F.width,D,v,me]);a.useEffect(()=>{const ie=G.current;if(!ie)return;const be=new ResizeObserver(([Ce])=>{const{width:ee,height:pe}=Ce.contentRect;A({width:ee,height:pe})});return be.observe(ie),()=>be.disconnect()},[]),a.useEffect(()=>{const ie=(t??[]).map(be=>{var Ce;return(Ce=be.image)==null?void 0:Ce.url}).filter(be=>!!be);ry(ie,(be,Ce)=>{N(ee=>{var pe,Ae;return((pe=ee[be])==null?void 0:pe.width)===Ce.width&&((Ae=ee[be])==null?void 0:Ae.height)===Ce.height?ee:{...ee,[be]:Ce}})})},[t]),a.useEffect(()=>{const{backgroundIndex:ie,activeIndex:be}=ts(x.length);f(be),$(ie),P(!1),U(!1),j(null),w(null),h(0),k(1),K("none"),Y("next")},[x.length,t]),a.useEffect(()=>()=>{q.current&&clearTimeout(q.current)},[]);const $e=a.useCallback(ie=>{var se,V,je,We;if(!Z||R||x.length<=1)return;const be=ie==="next"?(T+1)%x.length:(T-1+x.length)%x.length,Ce=de((V=(se=x[T])==null?void 0:se.image)==null?void 0:V.url),ee=de((We=(je=x[be])==null?void 0:je.image)==null?void 0:We.url),pe=ns(F.width,F.height,Ce),Ae=ns(F.width,F.height,ee);q.current&&clearTimeout(q.current),Y(ie),U(!0),P(!0),ie==="next"?(j(T),w(be),h(0),k(1),K(Ui(m,0,1))):($(ny(be,x.length)),j(be),w(T),h(1),k(Ae),K(Ui(m,1,Ae))),requestAnimationFrame(()=>{U(!1),requestAnimationFrame(()=>{ie==="next"?(h(1),k(pe),K(Ui(m,1,pe))):(h(0),k(1),K(Ui(m,0,1)))})}),q.current=setTimeout(()=>{ie==="next"&&$(T),f(be),j(null),w(null),P(!1)},fe)},[T,m,F.height,F.width,de,R,Z,x,fe]),oe=x[T],xe=L!==null?x[L]:null,Q=E!==null?x[E]:null,ye=I!==null?x[I]:null,ve=x.length<=1?0:(T-1+x.length)%x.length,ke=x.length<=1?0:(T+1)%x.length,we=de((Se=oe==null?void 0:oe.image)==null?void 0:Se.url),Me=de((O=Q==null?void 0:Q.image)==null?void 0:O.url),X=de((ce=ye==null?void 0:ye.image)==null?void 0:ce.url),ue={[`--${o}-transition-ms`]:`${fe}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsxs("div",{ref:G,className:nt(`${o}-wrapper`,C&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ue,"aria-label":"Zoom gallery",children:[((H=xe==null?void 0:xe.image)==null?void 0:H.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:xe.image.url,alt:"",style:{filter:J}})}),R&&((re=Q==null?void 0:Q.image)==null?void 0:re.url)&&r.jsx("div",{className:nt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${le}`),style:is(Me,S,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:Q.image.url,alt:"",style:{filter:z}})}),R&&((ae=ye==null?void 0:ye.image)==null?void 0:ae.url)&&r.jsx("div",{className:nt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${le}`),style:is(X,W,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:ye.image.url,alt:""})}),!R&&((ne=oe==null?void 0:oe.image)==null?void 0:ne.url)&&r.jsx("div",{className:nt(`${o}-stage`,`${o}-foreground`),style:yc(we),children:r.jsx("img",{className:`${o}-image`,src:oe.image.url,alt:oe.image.name??""})}),Z&&x.length>1&&!R&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:nt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>$e("prev"),"aria-label":`Show previous image (${ve+1} of ${x.length})`}),r.jsx("button",{type:"button",className:nt(`${o}-nav`,`${o}-nav-next`),onClick:()=>$e("next"),"aria-label":`Show next image (${ke+1} of ${x.length})`})]})]})]})}const ly=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
15945
15945
  import cn from 'classnames';
15946
15946
  import { CommonComponentProps } from '../props';
15947
15947
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -16700,7 +16700,7 @@ a:active .${e}-button .${e}-icon-image,
16700
16700
  height: calc(1em * var(--${e}-icon-scale, 1));
16701
16701
  width: calc(1em * var(--${e}-icon-scale, 1));
16702
16702
  }
16703
- `}function ea(e,t,n="",i,o){const l=t();return r.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[r.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:l}),r.jsxs("span",{className:`${e}-content-roll-viewport`,children:[r.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),r.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function os(e,t,n="fill",i=100,o=0,l){if(!t)return null;const s=r.jsx(rn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return r.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:s});if(n==="fixed"&&o>0){const d=y.scalingValue(o,l);return r.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:s})}return r.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:s})}function hy({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:l}=y.useScopedStyles(),s=a.useMemo(()=>gy(l),[l]),{type:d="a",label:c="Button",icon:u,alignment:m="center",alignA:x,order:b="text-icon",gap:T=0,iconSize:f=0,iconWidthC:L=0,dimensions:$=!1,padding:R={top:0,right:0,bottom:0,left:0},cornerRadius:E={top:0,right:0,bottom:0,left:0},boxShadow:C={top:0,left:0,right:0,bottom:0},boxShadowColor:U="rgba(0, 0, 0, 0)",innerBoxShadow:k={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:j="rgba(0, 0, 0, 0)",stroke:I=0,backgroundColor:w="#000000",textColor:W="#ffffff",borderColor:h="#ffffff",iconColor:S="#ffffff",hoverEffect:M="none",fontFamily:z,fontSettings:K,fontSize:le,lineHeight:Y,letterSpacing:D=0,wordSpacing:N=0,textAppearance:F,stateOverrides:A,minWidth:q=0,minHeight:G=0,width:Z=0,height:_=0}=e,me=y.buildColorVars(l,{backgroundColor:w,textColor:W,borderColor:h,iconColor:S,boxShadowColor:U,innerBoxShadowColor:j},dy,uy,A),v=i&&i!=="default"?`${l}-state-${i}`:"",fe=t&&!n?`${l}-editing`:"",J=M!=="none"&&(!t||n||i==="hover")?`${l}-hover-effect-${M}`:"",de=M==="reveal"||M==="swipe",$e=M==="content-roll",oe=M==="reveal"&&(!t||n),xe=$===!0,ye=d==="a"?x??m:m,ve=d==="c",ke=d!=="b",we={fontSettings:{fontFamily:z,fontWeight:(K==null?void 0:K.fontWeight)??400,fontStyle:(K==null?void 0:K.fontStyle)??"normal"},fontSize:le??.01,lineHeight:Y,letterSpacing:D,wordSpacing:N,textAppearance:F,color:W},X={...ke?dn(Xt(we,t)):{},[`--${l}-box-shadow-x`]:y.scalingValue(C.left,t),[`--${l}-box-shadow-y`]:y.scalingValue(C.top,t),[`--${l}-box-shadow-blur`]:y.scalingValue(C.right,t),[`--${l}-box-shadow-spread`]:y.scalingValue(C.bottom,t),[`--${l}-inner-box-shadow-x`]:y.scalingValue(k.left,t),[`--${l}-inner-box-shadow-y`]:y.scalingValue(k.top,t),[`--${l}-inner-box-shadow-blur`]:y.scalingValue(k.right,t),[`--${l}-inner-box-shadow-spread`]:y.scalingValue(k.bottom,t),paddingTop:y.scalingValue(R.top,t),paddingRight:y.scalingValue(R.right,t),paddingBottom:y.scalingValue(R.bottom,t),paddingLeft:y.scalingValue(R.left,t),borderTopLeftRadius:y.scalingValue(E.top,t),borderTopRightRadius:y.scalingValue(E.right,t),borderBottomRightRadius:y.scalingValue(E.bottom,t),borderBottomLeftRadius:y.scalingValue(E.left,t),borderWidth:y.scalingValue(I,t),...ve?{}:{justifyContent:Qr[ye],textAlign:ye},...ve&&!$e?{gap:y.scalingValue(T,t)}:{},...xe?{width:y.scalingValue(Z,t),height:y.scalingValue(_,t)}:{minWidth:y.scalingValue(q,t),minHeight:y.scalingValue(G,t),...ve?{width:"100%"}:{}}};let ue;const Se={display:"inline-flex",alignItems:"center",justifyContent:ve?Qr[ye]:Qr[d==="a"?ye:"center"],gap:ve?y.scalingValue(T,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:ye}:{}};if(d==="b"){const H=()=>os(l,u,f>0?"fixed":"fill",100,f,t);ue=$e?ea(l,H,`${l}-icon-roll`,void 0,Se):H()}else if(d==="c"){const H=()=>{const re=r.jsx("span",{className:`${l}-text`,style:{textAlign:ye},children:c}),ae=os(l,u,L>0?"fixed":"fill",100,L,t);return b==="icon-text"?r.jsxs(r.Fragment,{children:[ae,re]}):r.jsxs(r.Fragment,{children:[re,ae]})};ue=$e?ea(l,H,`${l}-icon-text-roll`,void 0,Se):H()}else ue=$e?ea(l,()=>c,`${l}-label-roll`,void 0,Se):de?r.jsx("span",{className:`${l}-button-inner`,children:c}):c;const O=oe?H=>py(H,l):void 0,ce=oe?H=>my(H,l):void 0;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsx("div",{className:`${l}-root`,style:me,children:r.jsx("div",{className:`${l}-wrapper ${v} ${fe}`.trim(),children:r.jsx("div",{className:`${l}-button ${J}`.trim(),style:X,onMouseEnter:O,onMouseLeave:ce,role:"button",tabIndex:o||t&&!n?void 0:0,children:ue})})})]})}const fy=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
16703
+ `}function ea(e,t,n="",i,o){const l=t();return r.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[r.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:l}),r.jsxs("span",{className:`${e}-content-roll-viewport`,children:[r.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),r.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function os(e,t,n="fill",i=100,o=0,l){if(!t)return null;const s=r.jsx(rn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return r.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:s});if(n==="fixed"&&o>0){const d=y.scalingValue(o,l);return r.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:s})}return r.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:s})}function hy({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:l}=y.useScopedStyles(),s=a.useMemo(()=>gy(l),[l]),{type:d="a",label:c="Button",icon:u,alignment:m="center",alignA:x,order:b="text-icon",gap:T=0,iconSize:f=0,iconWidthC:L=0,dimensions:$=!1,padding:R={top:0,right:0,bottom:0,left:0},cornerRadius:P=0,boxShadow:C={top:0,left:0,right:0,bottom:0},boxShadowColor:U="rgba(0, 0, 0, 0)",innerBoxShadow:E={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:j="rgba(0, 0, 0, 0)",stroke:I=0,backgroundColor:w="#000000",textColor:W="#ffffff",borderColor:h="#ffffff",iconColor:S="#ffffff",hoverEffect:k="none",fontFamily:z,fontSettings:K,fontSize:le,lineHeight:Y,letterSpacing:D=0,wordSpacing:N=0,textAppearance:F,stateOverrides:A,minWidth:q=0,minHeight:G=0,width:Z=0,height:_=0}=e,me=y.buildColorVars(l,{backgroundColor:w,textColor:W,borderColor:h,iconColor:S,boxShadowColor:U,innerBoxShadowColor:j},dy,uy,A),v=i&&i!=="default"?`${l}-state-${i}`:"",fe=t&&!n?`${l}-editing`:"",J=k!=="none"&&(!t||n||i==="hover")?`${l}-hover-effect-${k}`:"",de=k==="reveal"||k==="swipe",$e=k==="content-roll",oe=k==="reveal"&&(!t||n),xe=$===!0,ye=d==="a"?x??m:m,ve=d==="c",ke=d!=="b",we={fontSettings:{fontFamily:z,fontWeight:(K==null?void 0:K.fontWeight)??400,fontStyle:(K==null?void 0:K.fontStyle)??"normal"},fontSize:le??.01,lineHeight:Y,letterSpacing:D,wordSpacing:N,textAppearance:F,color:W},X={...ke?dn(Xt(we,t)):{},[`--${l}-box-shadow-x`]:y.scalingValue(C.left,t),[`--${l}-box-shadow-y`]:y.scalingValue(C.top,t),[`--${l}-box-shadow-blur`]:y.scalingValue(C.right,t),[`--${l}-box-shadow-spread`]:y.scalingValue(C.bottom,t),[`--${l}-inner-box-shadow-x`]:y.scalingValue(E.left,t),[`--${l}-inner-box-shadow-y`]:y.scalingValue(E.top,t),[`--${l}-inner-box-shadow-blur`]:y.scalingValue(E.right,t),[`--${l}-inner-box-shadow-spread`]:y.scalingValue(E.bottom,t),paddingTop:y.scalingValue(R.top,t),paddingRight:y.scalingValue(R.right,t),paddingBottom:y.scalingValue(R.bottom,t),paddingLeft:y.scalingValue(R.left,t),borderRadius:y.scalingValue(P,t),borderWidth:y.scalingValue(I,t),...ve?{}:{justifyContent:Qr[ye],textAlign:ye},...ve&&!$e?{gap:y.scalingValue(T,t)}:{},...xe?{width:y.scalingValue(Z,t),height:y.scalingValue(_,t)}:{minWidth:y.scalingValue(q,t),minHeight:y.scalingValue(G,t),...ve?{width:"100%"}:{}}};let ue;const Se={display:"inline-flex",alignItems:"center",justifyContent:ve?Qr[ye]:Qr[d==="a"?ye:"center"],gap:ve?y.scalingValue(T,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:ye}:{}};if(d==="b"){const H=()=>os(l,u,f>0?"fixed":"fill",100,f,t);ue=$e?ea(l,H,`${l}-icon-roll`,void 0,Se):H()}else if(d==="c"){const H=()=>{const re=r.jsx("span",{className:`${l}-text`,style:{textAlign:ye},children:c}),ae=os(l,u,L>0?"fixed":"fill",100,L,t);return b==="icon-text"?r.jsxs(r.Fragment,{children:[ae,re]}):r.jsxs(r.Fragment,{children:[re,ae]})};ue=$e?ea(l,H,`${l}-icon-text-roll`,void 0,Se):H()}else ue=$e?ea(l,()=>c,`${l}-label-roll`,void 0,Se):de?r.jsx("span",{className:`${l}-button-inner`,children:c}):c;const O=oe?H=>py(H,l):void 0,ce=oe?H=>my(H,l):void 0;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsx("div",{className:`${l}-root`,style:me,children:r.jsx("div",{className:`${l}-wrapper ${v} ${fe}`.trim(),children:r.jsx("div",{className:`${l}-button ${J}`.trim(),style:X,onMouseEnter:O,onMouseLeave:ce,role:"button",tabIndex:o||t&&!n?void 0:0,children:ue})})})]})}const fy=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
16704
16704
  import { SvgImage } from '../helpers/SvgImage/SvgImage';
16705
16705
  import { CommonComponentProps } from '../props';
16706
16706
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
@@ -16713,13 +16713,6 @@ type Padding = {
16713
16713
  left: number;
16714
16714
  };
16715
16715
 
16716
- type CornerRadius = {
16717
- top: number;
16718
- right: number;
16719
- bottom: number;
16720
- left: number;
16721
- };
16722
-
16723
16716
  type BoxShadow = {
16724
16717
  top: number;
16725
16718
  left: number;
@@ -16742,7 +16735,7 @@ type SimpleButtonSettings = {
16742
16735
  iconColor?: string;
16743
16736
  dimensions?: boolean;
16744
16737
  padding?: Padding;
16745
- cornerRadius?: CornerRadius;
16738
+ cornerRadius?: number;
16746
16739
  boxShadow?: BoxShadow;
16747
16740
  boxShadowColor?: string;
16748
16741
  innerBoxShadow?: BoxShadow;
@@ -17158,7 +17151,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
17158
17151
  iconWidthC = 0,
17159
17152
  dimensions = false,
17160
17153
  padding = { top: 0, right: 0, bottom: 0, left: 0 },
17161
- cornerRadius = { top: 0, right: 0, bottom: 0, left: 0 },
17154
+ cornerRadius = 0,
17162
17155
  boxShadow = { top: 0, left: 0, right: 0, bottom: 0 },
17163
17156
  boxShadowColor = 'rgba(0, 0, 0, 0)',
17164
17157
  innerBoxShadow = { top: 0, left: 0, right: 0, bottom: 0 },
@@ -17240,10 +17233,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
17240
17233
  paddingRight: scalingValue(padding.right, isEditor),
17241
17234
  paddingBottom: scalingValue(padding.bottom, isEditor),
17242
17235
  paddingLeft: scalingValue(padding.left, isEditor),
17243
- borderTopLeftRadius: scalingValue(cornerRadius.top, isEditor),
17244
- borderTopRightRadius: scalingValue(cornerRadius.right, isEditor),
17245
- borderBottomRightRadius: scalingValue(cornerRadius.bottom, isEditor),
17246
- borderBottomLeftRadius: scalingValue(cornerRadius.left, isEditor),
17236
+ borderRadius: scalingValue(cornerRadius, isEditor),
17247
17237
  borderWidth: scalingValue(stroke, isEditor),
17248
17238
  ...(!isIconTextType ? {
17249
17239
  justifyContent: ALIGNMENT_MAP[effectiveAlignment],
@@ -17337,7 +17327,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
17337
17327
  </>
17338
17328
  );
17339
17329
  }
17340
- `,yy={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},vy=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],xy={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"object",scope:"layout",title:"Corner radius",display:{type:"padding-controls"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"Background Default",titleByState:{default:"Background Default",hover:"Background Hover",active:"Background Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...yy.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:{top:20/375,right:20/375,bottom:20/375,left:20/375},boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:{top:20/768,right:20/768,bottom:20/768,left:20/768},boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:{top:20/1440,right:20/1440,bottom:20/1440,left:20/1440},boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...vy],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},by={element:hy,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:xy,sourceCode:fy,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function wy(e){return`
17330
+ `,yy={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},vy=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],xy={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"Background Default",titleByState:{default:"Background Default",hover:"Background Hover",active:"Background Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...yy.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...vy],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},by={element:hy,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:xy,sourceCode:fy,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function wy(e){return`
17341
17331
  .${e}-titles-row {
17342
17332
  position: relative;
17343
17333
  flex: 0 1 auto;
@@ -17535,7 +17525,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
17535
17525
  pointer-events: auto;
17536
17526
  flex-shrink: 0;
17537
17527
  }
17538
- `}const Cn=500,Xi=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",Sy=72,$y=50,Cy=1e4,Ty=650,Ly=500;function Iy(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,l=e.top-t.top;return`translate(${o}px, ${l}px) scale(${n}, ${i})`}function vc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=or(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function Ry(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?vc(i,n):null}function Ey(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.url&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function Ji(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function rs(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Ji(e,i,n)}const ky=.03;function xc(e){return e.width*ky}const ta={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Do(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function as(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function My(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ya(e,t,n){const i=e.getBoundingClientRect(),o=i.width,l=i.height,s=t/n,d=o/l;if(s>d){const u=o/s;return{width:o,height:u,left:i.left,top:i.top+(l-u)/2}}const c=l*s;return{width:c,height:l,left:i.left+(o-c)/2,top:i.top}}function Py(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ya(e,t.width,t.height)}function Ay(e,t){if(Ir(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function Fy(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.url)||t.has(o.url)||(t.add(o.url),n.push(o))}return n}function Wy({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Ir(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function ji(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:d}=n,c=xc(n);return t==="left"?{left:s+c-i,top:l,width:i,height:o}:{left:s+d-c,top:l,width:i,height:o}}function sr(e,t,n){const i=ji(e,t,n);return{...i,left:2*i.left-e.left}}function _y(e,t,n){const{left:i,width:o}=n,l=xc(n);return t==="left"?{left:i,top:e.top,width:l,height:e.height}:{left:i+o-l,top:e.top,width:l,height:e.height}}function bc(e,t,n,i){const o=ji(e,"left",i),l=ji(e,"right",i),s=sr(e,"left",i),d=sr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:l,end:e};case"left-adjacent":return{start:o,end:s};case"far-right":return{start:d,end:l};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:l};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:l,end:d};case"far-left":return{start:s,end:o};default:return{start:e,end:e}}}function Ny(e,t,n,i){const{start:o,end:l}=bc(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function Hy(e,t,n){const i=ji(e,t,n),o=sr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Ir(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function jy({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:l,onTransitionEnd:s}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:s,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:c=>c.stopPropagation(),style:o},e)})}function Vo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Ir(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const l=o.currentTarget;l.videoWidth>0&&l.videoHeight>0&&(i==null||i(e.url,l.videoWidth,l.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const l=o.currentTarget;l.naturalWidth>0&&l.naturalHeight>0&&(i==null||i(e.url,l.naturalWidth,l.naturalHeight))},onTransitionEnd:n})}function Oy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:m,layoutId:x,sourceRect:b,resolveCloseSourceRect:T,onClose:f,onPrev:L,onNext:$}){const R=a.useRef(null),E=a.useRef(null),C=a.useRef(null),U=a.useRef(new Map),[k,j]=a.useState(0),I=a.useRef(null),w=a.useRef(0),W=a.useRef(0),h=a.useRef("none"),S=a.useRef(!1),M=a.useRef(!1),z=a.useRef(!1),K=a.useRef(null),le=a.useRef(null),Y=a.useRef(null),D=a.useRef(()=>{}),N=a.useRef(null),F=a.useRef(null),A=a.useRef(null),q=a.useRef(!1),[G,Z]=a.useState(null),[_,me]=a.useState(ta),[v,fe]=a.useState(0),[J,de]=a.useState("opening"),[$e,oe]=a.useState(0),[xe,Q]=a.useState(0),[ye,ve]=a.useState(!1),[ke,we]=a.useState(null),[Me,X]=a.useState(null),[ue,Se]=a.useState(null),[O,ce]=a.useState(!1),[H,re]=a.useState(null),[ae,ne]=a.useState(!1),ie=a.useRef(!1),[be,Ce]=a.useState(!1),[ee,pe]=a.useState(!1),Ae=a.useRef(n),se=a.useRef(void 0),V=t[n],je=V?Ir(V):!1,We=xe!==0||ye,et=!s&&(!l||!!d),Ye=c&&!s,st=u.length>1,mt=a.useCallback((g,ge)=>t.length<=1?null:t[(g+ge+t.length)%t.length]??null,[t]),De=st?Ji(u,m,-1):mt(n,-1),ot=st?Ji(u,m,1):mt(n,1),$t=ke===-1&&We?st&&Me!==null?Ji(u,Me,-1):ue!==null?mt(ue,-1):null:null,rt=ke===1&&We?st&&Me!==null?Ji(u,Me,1):ue!==null?mt(ue,1):null:null,Ue=$t&&$t.url!==(De==null?void 0:De.url)?$t:null,ht=rt&&rt.url!==(ot==null?void 0:ot.url)?rt:null,xt=De&&Ye?(()=>{const g=st?rs(u,m,-1):t.length>2?mt((n-1+t.length)%t.length,-1):null;return g&&g.url!==De.url?g:null})():null,dt=ot&&Ye?(()=>{const g=st?rs(u,m,1):t.length>2?mt((n+1)%t.length,1):null;return g&&g.url!==ot.url?g:null})():null,kt=Ue??xt,_t=ht??dt,Qe=a.useCallback((g,ge,Re)=>{if(!g||!ge||!Re)return;const Ie=U.current,Ze=Ie.get(g);(Ze==null?void 0:Ze.width)===ge&&(Ze==null?void 0:Ze.height)===Re||(Ie.set(g,{width:ge,height:Re}),j(Et=>Et+1))},[]),Tt=a.useCallback(g=>{if(!(g!=null&&g.url))return null;const ge=U.current.get(g.url);return Py(E.current,ge)},[k,v]),Lt=a.useCallback(()=>{if(!V)return;const g=Tt(V);if(g){Z(g);return}const ge=E.current;ge&&Z(as(ge))},[V,Tt]),Ge=a.useCallback(g=>{if(st){const ge=u.length;X((m+g+ge)%ge),Se(null);return}t.length>1&&(Se((n+g+t.length)%t.length),X(null))},[st,u.length,m,t.length,n]),qe=a.useCallback(g=>{z.current=g,ve(g)},[]),Pe=a.useCallback(()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},[]),gt=a.useCallback(()=>{Pe(),K.current=window.setTimeout(()=>{Pe(),qe(!1)},Xi+32)},[Pe,qe]),It=a.useCallback(()=>{const g=R.current;if(!g){me({left:0,top:0,width:typeof window<"u"?window.innerWidth:ta.width,height:typeof window<"u"?window.innerHeight:ta.height});return}const ge=g.getBoundingClientRect();me({left:ge.left,top:ge.top,width:ge.width,height:ge.height})},[]),Mt=a.useCallback((g,ge)=>{if(We){if(be&&!ye)return`translate(${xe}px, 0px)`;if(ye&&ke!==null){const Re=Tt(g);if(!Re)return;const{x:Ie,y:Ze}=Ny(Re,ge,ke,_);return`translate(${Ie}px, ${Ze}px)`}if(ye)return"translate(0px, 0px)"}},[We,be,ye,xe,ke,_,Tt]),Dt=a.useCallback(()=>{const g=le.current;le.current=null,Pe(),qe(!1),we(null),X(null),Se(null),Q(0),Ce(!1),S.current=!1,W.current=0,h.current="none",g===-1?L():g===1&&$()},[Pe,qe,L,$]),en=a.useCallback(()=>{Pe(),K.current=window.setTimeout(()=>{le.current!==null&&Dt()},Xi+32)},[Pe,Dt]),on=a.useCallback(()=>{Pe(),le.current=null,qe(!1),we(null),X(null),Se(null),Q(0),Ce(!1),S.current=!1,W.current=0,h.current="none"},[Pe,qe]),bt=a.useCallback(g=>{if(!(!Ye||!G)){if(z.current){if(le.current===g){Y.current=g,Dt();return}on()}Pe(),Ge(g),le.current=g,we(g),qe(!0),en()}},[Ye,G,Dt,on,Pe,Ge,qe,en]);D.current=bt;const Rt=a.useCallback(()=>{N.current=null,q.current=!1,F.current!==null&&(window.clearInterval(F.current),F.current=null),A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),Ut=a.useCallback(g=>{F.current!==null&&window.clearInterval(F.current);const ge=q.current?Ly:Ty;F.current=window.setInterval(()=>{D.current(g)},ge)},[]),Kt=a.useCallback(g=>{N.current!==g&&(Rt(),N.current=g,q.current=!1,D.current(g),Ut(g),A.current=window.setTimeout(()=>{A.current=null,N.current===g&&(q.current=!0,Ut(g))},Cy))},[Rt,Ut]),ft=a.useCallback(()=>{const g=E.current;if(!g)return;const ge=V==null?void 0:V.url,Re=ge?U.current.get(ge):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){Z(ya(g,Re.width,Re.height));return}const Ie=C.current;if(Ie&&ge&&(Ie.src===ge||Ie.currentSrc===ge)){const{width:Et,height:Ve}=My(Ie);if(Et&&Ve){Qe(ge,Et,Ve),Z(ya(g,Et,Ve));return}}const Ze=as(g);!Ze.width||!Ze.height||Z(Ze)},[V==null?void 0:V.url,Qe]),Jt=a.useCallback(g=>{if(C.current=g,!!g){if(g instanceof HTMLVideoElement){g.readyState>=1&&g.videoWidth>0&&ft();return}g.complete&&g.naturalWidth>0&&ft()}},[ft]),Te=a.useCallback(()=>{It(),ft(),fe(g=>g+1)},[It,ft]);a.useEffect(()=>{Te();const g=E.current,ge=R.current,Re=new ResizeObserver(()=>Te());return g&&Re.observe(g),ge&&Re.observe(ge),window.addEventListener("resize",Te),()=>{Re.disconnect(),window.removeEventListener("resize",Te)}},[Te,n,x]),a.useLayoutEffect(()=>{if(!V)return;const g=C.current;if(g){if(g instanceof HTMLImageElement&&g.complete&&g.naturalWidth>0){ft();return}g instanceof HTMLVideoElement&&g.readyState>=1&&g.videoWidth>0&&ft()}},[V==null?void 0:V.url,n,ft]),a.useEffect(()=>{Lt()},[Lt,k]),a.useEffect(()=>{const g=new Set,ge=[],Re=Ie=>{!(Ie!=null&&Ie.url)||g.has(Ie.url)||(g.add(Ie.url),ge.push(Ie))};t.forEach(Re),u.forEach(Ie=>Ie.items.forEach(Re)),ge.forEach(Ie=>{U.current.has(Ie.url)||Ay(Ie,Qe)})},[t,u,Qe]),a.useEffect(()=>{if(J!=="opening"||!G)return;if(!b){de("open");return}ce(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce(!0),de("open")})});return()=>cancelAnimationFrame(g)},[J,G,b]),a.useEffect(()=>{if(J!=="closing")return;const g=setTimeout(()=>f(),Cn);return()=>clearTimeout(g)},[J,f]),a.useEffect(()=>()=>{Pe()},[Pe]),a.useLayoutEffect(()=>{Ae.current===n&&se.current===(V==null?void 0:V.url)||(Pe(),le.current=null,we(null),X(null),Se(null),oe(0),Q(0),qe(!1),pe(!1),Ce(!1),w.current=0,W.current=0,h.current="none",S.current=!1,I.current=null,M.current=!1,C.current=null,Lt(),Ae.current=n,se.current=V==null?void 0:V.url)},[n,V==null?void 0:V.url,qe,Pe,Lt]),a.useLayoutEffect(()=>{const g=Y.current;g!==null&&(Y.current=null,requestAnimationFrame(()=>{D.current(g)}))},[n,m,V==null?void 0:V.url]),a.useLayoutEffect(()=>{if(J==="opening"){ie.current=!1,ne(!1);return}if(J!=="open"||ie.current)return;if(!De&&!ot){ie.current=!0;return}ne(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ne(!0),ie.current=!0})});return()=>cancelAnimationFrame(g)},[J,De==null?void 0:De.url,ot==null?void 0:ot.url]),a.useEffect(()=>{if(J!=="open")return;const g=()=>{const Ve=it=>{it.stopPropagation(),it.preventDefault(),document.removeEventListener("click",Ve,!0)};document.addEventListener("click",Ve,!0)},ge=Ve=>{const it=Ve<0?1:-1;Pe(),Ge(it),le.current=it,we(it),qe(!0),en()},Re=Ve=>{if(Math.abs(Ve)>$y&&Ye){ge(Ve);return}le.current=null,we(null),X(null),Se(null),qe(!0),Q(0),gt()},Ie=Ve=>{if(Ve.touches.length!==1||z.current)return;const it=Ve.touches[0];M.current=!0,I.current={x:it.clientX,y:it.clientY},h.current="none",W.current=0,S.current=!1},Ze=Ve=>{if(!I.current||Ve.touches.length!==1||z.current)return;const it=Ve.touches[0],jt=it.clientX-I.current.x,St=it.clientY-I.current.y;if(h.current==="none"){if(Math.abs(jt)<10&&Math.abs(St)<10)return;if(Math.abs(jt)>Math.abs(St)){if(!Ye)return;h.current="horizontal"}else if(St>0){if(!et)return;h.current="vertical"}else return}if(h.current==="horizontal"){S.current=!0,Ce(!0),W.current=jt,Q(jt),Ve.preventDefault();return}h.current==="vertical"&&(S.current=!0,Ce(!0),w.current=St,oe(St),Ve.preventDefault())},Et=()=>{if(!I.current)return;const Ve=h.current,it=S.current;if(it&&Ve==="horizontal")Re(W.current),g();else if(it&&Ve==="vertical"){const jt=w.current;if(et&&jt>Sy){const St=window.innerHeight;w.current=St,pe(!0),oe(St),de("closing")}else w.current=0,oe(0);g()}else Ve==="horizontal"&&Math.abs(W.current)>0&&(Re(W.current),g());I.current=null,h.current="none",W.current=0,S.current=!1,Ce(!1)};return document.addEventListener("touchstart",Ie,{passive:!0}),document.addEventListener("touchmove",Ze,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ie),document.removeEventListener("touchmove",Ze),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[J,Ye,qe,gt,Pe,et,en,Ge]);const Oe=a.useCallback(()=>{const g=(T==null?void 0:T())??b??null;g&&G&&(re(g),ce(!0)),de("closing")},[T,b,G]);a.useEffect(()=>{const g=Ie=>{if(Ie.key==="Escape"){if(l&&d||J==="closing")return;Rt(),Oe();return}if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight"||J!=="open"||!Ye)return;Ie.preventDefault();const Ze=Ie.key==="ArrowLeft"?-1:1;Ie.repeat&&N.current===Ze||Kt(Ze)},ge=Ie=>{if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight")return;const Ze=Ie.key==="ArrowLeft"?-1:1;N.current===Ze&&Rt()},Re=()=>{Rt()};return window.addEventListener("keydown",g),window.addEventListener("keyup",ge),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",ge),window.removeEventListener("blur",Re),Rt()}},[J,l,d,Oe,Ye,Kt,Rt]),a.useEffect(()=>{J!=="open"&&Rt()},[J,Rt]);const Ke=()=>{J==="closing"||s||Oe()},Ne=J==="open",ze=J==="closing",ut=$e>0?Math.max(0,1-$e/500):1,_e=$e>0?Math.max(.35,1-$e/500):1,Je=a.useCallback(g=>{if(!(g.propertyName!=="transform"||!z.current)){if(le.current!==null){Dt();return}Pe(),qe(!1)}},[Pe,qe,Dt]),tt=J==="closing"?H??b:b,Wt=tt&&G&&(J==="opening"||ze)?Iy(tt,G):void 0,Ct=We&&V?Mt(V,"center"):$e>0?`translateY(${$e}px)`:Wt,lt=G?Do(G,_):null,Nt=!!(tt&&G),At=Nt&&(J==="closing"||J==="open"&&O),Vt={position:"absolute",top:lt==null?void 0:lt.top,left:lt==null?void 0:lt.left,width:lt==null?void 0:lt.width,height:lt==null?void 0:lt.height,objectFit:"contain",transformOrigin:"top left",transform:Ct,opacity:$e>0?_e:Nt?1:J==="opening"||ze?0:1,transition:be&&!ye?"none":ye?`transform ${Xi}ms ${mn}`:ee?`transform ${Cn}ms ${mn}, opacity ${Cn}ms ${mn}`:At?`transform ${Cn}ms ${mn}`:J==="opening"||ze?`opacity ${Cn}ms ${mn}`:"none",pointerEvents:je&&Ne&&!We?"auto":"none",touchAction:je&&Ne?"none":void 0,zIndex:1,overflow:je?"hidden":void 0},zt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ne&&!We?"auto":"none"},Pt=(g,ge,Re="adjacent")=>{const Ie=Tt(g);if(!Ie)return{display:"none"};const Ze=Re==="far"?ge==="left"?"far-left":"far-right":ge==="left"?"left-adjacent":"right-adjacent",{start:Et}=ke!==null?bc(Ie,Ze,ke,_):{start:Re==="far"?sr(Ie,ge,_):ji(Ie,ge,_)},Ve=Do(Et,_),it=Mt(g,Ze),jt=!We&&Re==="adjacent"&&Ne&&!ae?Hy(Ie,ge,_):null,St=Re==="far"&&We&&ke===(ge==="left"?-1:1),cn=be&&!ye?!1:ye,un=Re==="adjacent"&&Ne&&ae&&!We;return{position:"absolute",top:Ve.top,left:Ve.left,width:Ve.width,height:Ve.height,objectFit:"contain",transform:it??(jt?`translate(${jt.x}px, ${jt.y}px)`:void 0),opacity:Re==="far"?Ne&&St?1:0:Ne?1:0,transition:cn?Re==="far"?`transform ${Xi}ms ${mn}`:`transform ${Xi}ms ${mn}, opacity ${Cn}ms ${mn}`:un?`transform ${Cn}ms ${mn}`:J==="opening"||ze?`opacity ${Cn}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Qt=(g,ge)=>{const Re=Tt(g);return Re?_y(ji(Re,ge,_),ge,_):null},wt=g=>ge=>{if(!s){if(M.current){M.current=!1;return}ge.stopPropagation(),bt(g)}},Gt=De?Qt(De,"left"):null,pt=ot?Qt(ot,"right"):null,Ft=Gt?Do(Gt,_):null,Bt=pt?Do(pt,_):null;return r.jsxs("div",{ref:R,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:Ke,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ne?ut:0,transition:be?"none":`opacity ${Cn}ms ${mn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:E,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ne?1:0,transition:be?"none":`opacity ${Cn}ms ${mn}`,pointerEvents:"none"},children:r.jsx(ec,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,onClose:Ke})})]}),Ne&&kt&&r.jsx(Vo,{media:kt,style:Pt(kt,"left","far"),onMeasure:Qe,onTransitionEnd:Je},`far-prev-${kt.url}`),Ne&&De&&r.jsxs(r.Fragment,{children:[r.jsx(Vo,{media:De,style:Pt(De,"left"),onMeasure:Qe,onTransitionEnd:Je},`prev-${De.url}`),Ft&&r.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(-1)})]}),Ne&&ot&&r.jsxs(r.Fragment,{children:[r.jsx(Vo,{media:ot,style:Pt(ot,"right"),onMeasure:Qe,onTransitionEnd:Je},`next-${ot.url}`),Bt&&r.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(1)})]}),Ne&&_t&&r.jsx(Vo,{media:_t,style:Pt(_t,"right","far"),onMeasure:Qe,onTransitionEnd:Je},`far-next-${_t.url}`),G&&V&&(je?r.jsx(jy,{src:V.url,phase:J,onMediaElement:Jt,wrapperStyle:Vt,videoStyle:zt,onLoadedMetadata:ft,onTransitionEnd:Je},`${n}-${V.url}`):r.jsx("img",{ref:Jt,src:V.url,alt:V.name,onLoad:ft,onTransitionEnd:Je,style:Vt},`${n}-${V.url}`))]})}const zy=20,By=.18;function Dy(e){return`
17528
+ `}const Cn=500,Xi=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",Sy=72,$y=50,Cy=1e4,Ty=650,Ly=500;function Iy(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,l=e.top-t.top;return`translate(${o}px, ${l}px) scale(${n}, ${i})`}function vc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=or(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function Ry(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?vc(i,n):null}function Ey(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.url&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function Ji(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function rs(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Ji(e,i,n)}const ky=.03;function xc(e){return e.width*ky}const ta={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Do(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function as(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function My(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ya(e,t,n){const i=e.getBoundingClientRect(),o=i.width,l=i.height,s=t/n,d=o/l;if(s>d){const u=o/s;return{width:o,height:u,left:i.left,top:i.top+(l-u)/2}}const c=l*s;return{width:c,height:l,left:i.left+(o-c)/2,top:i.top}}function Py(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ya(e,t.width,t.height)}function Ay(e,t){if(Ir(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function Fy(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.url)||t.has(o.url)||(t.add(o.url),n.push(o))}return n}function Wy({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Ir(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function ji(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:d}=n,c=xc(n);return t==="left"?{left:s+c-i,top:l,width:i,height:o}:{left:s+d-c,top:l,width:i,height:o}}function sr(e,t,n){const i=ji(e,t,n);return{...i,left:2*i.left-e.left}}function _y(e,t,n){const{left:i,width:o}=n,l=xc(n);return t==="left"?{left:i,top:e.top,width:l,height:e.height}:{left:i+o-l,top:e.top,width:l,height:e.height}}function bc(e,t,n,i){const o=ji(e,"left",i),l=ji(e,"right",i),s=sr(e,"left",i),d=sr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:l,end:e};case"left-adjacent":return{start:o,end:s};case"far-right":return{start:d,end:l};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:l};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:l,end:d};case"far-left":return{start:s,end:o};default:return{start:e,end:e}}}function Ny(e,t,n,i){const{start:o,end:l}=bc(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function Hy(e,t,n){const i=ji(e,t,n),o=sr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Ir(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function jy({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:l,onTransitionEnd:s}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:s,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:c=>c.stopPropagation(),style:o},e)})}function Vo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Ir(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const l=o.currentTarget;l.videoWidth>0&&l.videoHeight>0&&(i==null||i(e.url,l.videoWidth,l.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const l=o.currentTarget;l.naturalWidth>0&&l.naturalHeight>0&&(i==null||i(e.url,l.naturalWidth,l.naturalHeight))},onTransitionEnd:n})}function Oy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:m,layoutId:x,sourceRect:b,resolveCloseSourceRect:T,onClose:f,onPrev:L,onNext:$}){const R=a.useRef(null),P=a.useRef(null),C=a.useRef(null),U=a.useRef(new Map),[E,j]=a.useState(0),I=a.useRef(null),w=a.useRef(0),W=a.useRef(0),h=a.useRef("none"),S=a.useRef(!1),k=a.useRef(!1),z=a.useRef(!1),K=a.useRef(null),le=a.useRef(null),Y=a.useRef(null),D=a.useRef(()=>{}),N=a.useRef(null),F=a.useRef(null),A=a.useRef(null),q=a.useRef(!1),[G,Z]=a.useState(null),[_,me]=a.useState(ta),[v,fe]=a.useState(0),[J,de]=a.useState("opening"),[$e,oe]=a.useState(0),[xe,Q]=a.useState(0),[ye,ve]=a.useState(!1),[ke,we]=a.useState(null),[Me,X]=a.useState(null),[ue,Se]=a.useState(null),[O,ce]=a.useState(!1),[H,re]=a.useState(null),[ae,ne]=a.useState(!1),ie=a.useRef(!1),[be,Ce]=a.useState(!1),[ee,pe]=a.useState(!1),Ae=a.useRef(n),se=a.useRef(void 0),V=t[n],je=V?Ir(V):!1,We=xe!==0||ye,et=!s&&(!l||!!d),Ye=c&&!s,st=u.length>1,mt=a.useCallback((g,ge)=>t.length<=1?null:t[(g+ge+t.length)%t.length]??null,[t]),De=st?Ji(u,m,-1):mt(n,-1),ot=st?Ji(u,m,1):mt(n,1),$t=ke===-1&&We?st&&Me!==null?Ji(u,Me,-1):ue!==null?mt(ue,-1):null:null,rt=ke===1&&We?st&&Me!==null?Ji(u,Me,1):ue!==null?mt(ue,1):null:null,Ue=$t&&$t.url!==(De==null?void 0:De.url)?$t:null,ht=rt&&rt.url!==(ot==null?void 0:ot.url)?rt:null,xt=De&&Ye?(()=>{const g=st?rs(u,m,-1):t.length>2?mt((n-1+t.length)%t.length,-1):null;return g&&g.url!==De.url?g:null})():null,dt=ot&&Ye?(()=>{const g=st?rs(u,m,1):t.length>2?mt((n+1)%t.length,1):null;return g&&g.url!==ot.url?g:null})():null,kt=Ue??xt,_t=ht??dt,Qe=a.useCallback((g,ge,Re)=>{if(!g||!ge||!Re)return;const Ie=U.current,Ze=Ie.get(g);(Ze==null?void 0:Ze.width)===ge&&(Ze==null?void 0:Ze.height)===Re||(Ie.set(g,{width:ge,height:Re}),j(Et=>Et+1))},[]),Tt=a.useCallback(g=>{if(!(g!=null&&g.url))return null;const ge=U.current.get(g.url);return Py(P.current,ge)},[E,v]),Lt=a.useCallback(()=>{if(!V)return;const g=Tt(V);if(g){Z(g);return}const ge=P.current;ge&&Z(as(ge))},[V,Tt]),Ge=a.useCallback(g=>{if(st){const ge=u.length;X((m+g+ge)%ge),Se(null);return}t.length>1&&(Se((n+g+t.length)%t.length),X(null))},[st,u.length,m,t.length,n]),qe=a.useCallback(g=>{z.current=g,ve(g)},[]),Pe=a.useCallback(()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},[]),gt=a.useCallback(()=>{Pe(),K.current=window.setTimeout(()=>{Pe(),qe(!1)},Xi+32)},[Pe,qe]),It=a.useCallback(()=>{const g=R.current;if(!g){me({left:0,top:0,width:typeof window<"u"?window.innerWidth:ta.width,height:typeof window<"u"?window.innerHeight:ta.height});return}const ge=g.getBoundingClientRect();me({left:ge.left,top:ge.top,width:ge.width,height:ge.height})},[]),Mt=a.useCallback((g,ge)=>{if(We){if(be&&!ye)return`translate(${xe}px, 0px)`;if(ye&&ke!==null){const Re=Tt(g);if(!Re)return;const{x:Ie,y:Ze}=Ny(Re,ge,ke,_);return`translate(${Ie}px, ${Ze}px)`}if(ye)return"translate(0px, 0px)"}},[We,be,ye,xe,ke,_,Tt]),Dt=a.useCallback(()=>{const g=le.current;le.current=null,Pe(),qe(!1),we(null),X(null),Se(null),Q(0),Ce(!1),S.current=!1,W.current=0,h.current="none",g===-1?L():g===1&&$()},[Pe,qe,L,$]),en=a.useCallback(()=>{Pe(),K.current=window.setTimeout(()=>{le.current!==null&&Dt()},Xi+32)},[Pe,Dt]),on=a.useCallback(()=>{Pe(),le.current=null,qe(!1),we(null),X(null),Se(null),Q(0),Ce(!1),S.current=!1,W.current=0,h.current="none"},[Pe,qe]),bt=a.useCallback(g=>{if(!(!Ye||!G)){if(z.current){if(le.current===g){Y.current=g,Dt();return}on()}Pe(),Ge(g),le.current=g,we(g),qe(!0),en()}},[Ye,G,Dt,on,Pe,Ge,qe,en]);D.current=bt;const Rt=a.useCallback(()=>{N.current=null,q.current=!1,F.current!==null&&(window.clearInterval(F.current),F.current=null),A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),Ut=a.useCallback(g=>{F.current!==null&&window.clearInterval(F.current);const ge=q.current?Ly:Ty;F.current=window.setInterval(()=>{D.current(g)},ge)},[]),Kt=a.useCallback(g=>{N.current!==g&&(Rt(),N.current=g,q.current=!1,D.current(g),Ut(g),A.current=window.setTimeout(()=>{A.current=null,N.current===g&&(q.current=!0,Ut(g))},Cy))},[Rt,Ut]),ft=a.useCallback(()=>{const g=P.current;if(!g)return;const ge=V==null?void 0:V.url,Re=ge?U.current.get(ge):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){Z(ya(g,Re.width,Re.height));return}const Ie=C.current;if(Ie&&ge&&(Ie.src===ge||Ie.currentSrc===ge)){const{width:Et,height:Ve}=My(Ie);if(Et&&Ve){Qe(ge,Et,Ve),Z(ya(g,Et,Ve));return}}const Ze=as(g);!Ze.width||!Ze.height||Z(Ze)},[V==null?void 0:V.url,Qe]),Jt=a.useCallback(g=>{if(C.current=g,!!g){if(g instanceof HTMLVideoElement){g.readyState>=1&&g.videoWidth>0&&ft();return}g.complete&&g.naturalWidth>0&&ft()}},[ft]),Te=a.useCallback(()=>{It(),ft(),fe(g=>g+1)},[It,ft]);a.useEffect(()=>{Te();const g=P.current,ge=R.current,Re=new ResizeObserver(()=>Te());return g&&Re.observe(g),ge&&Re.observe(ge),window.addEventListener("resize",Te),()=>{Re.disconnect(),window.removeEventListener("resize",Te)}},[Te,n,x]),a.useLayoutEffect(()=>{if(!V)return;const g=C.current;if(g){if(g instanceof HTMLImageElement&&g.complete&&g.naturalWidth>0){ft();return}g instanceof HTMLVideoElement&&g.readyState>=1&&g.videoWidth>0&&ft()}},[V==null?void 0:V.url,n,ft]),a.useEffect(()=>{Lt()},[Lt,E]),a.useEffect(()=>{const g=new Set,ge=[],Re=Ie=>{!(Ie!=null&&Ie.url)||g.has(Ie.url)||(g.add(Ie.url),ge.push(Ie))};t.forEach(Re),u.forEach(Ie=>Ie.items.forEach(Re)),ge.forEach(Ie=>{U.current.has(Ie.url)||Ay(Ie,Qe)})},[t,u,Qe]),a.useEffect(()=>{if(J!=="opening"||!G)return;if(!b){de("open");return}ce(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce(!0),de("open")})});return()=>cancelAnimationFrame(g)},[J,G,b]),a.useEffect(()=>{if(J!=="closing")return;const g=setTimeout(()=>f(),Cn);return()=>clearTimeout(g)},[J,f]),a.useEffect(()=>()=>{Pe()},[Pe]),a.useLayoutEffect(()=>{Ae.current===n&&se.current===(V==null?void 0:V.url)||(Pe(),le.current=null,we(null),X(null),Se(null),oe(0),Q(0),qe(!1),pe(!1),Ce(!1),w.current=0,W.current=0,h.current="none",S.current=!1,I.current=null,k.current=!1,C.current=null,Lt(),Ae.current=n,se.current=V==null?void 0:V.url)},[n,V==null?void 0:V.url,qe,Pe,Lt]),a.useLayoutEffect(()=>{const g=Y.current;g!==null&&(Y.current=null,requestAnimationFrame(()=>{D.current(g)}))},[n,m,V==null?void 0:V.url]),a.useLayoutEffect(()=>{if(J==="opening"){ie.current=!1,ne(!1);return}if(J!=="open"||ie.current)return;if(!De&&!ot){ie.current=!0;return}ne(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ne(!0),ie.current=!0})});return()=>cancelAnimationFrame(g)},[J,De==null?void 0:De.url,ot==null?void 0:ot.url]),a.useEffect(()=>{if(J!=="open")return;const g=()=>{const Ve=it=>{it.stopPropagation(),it.preventDefault(),document.removeEventListener("click",Ve,!0)};document.addEventListener("click",Ve,!0)},ge=Ve=>{const it=Ve<0?1:-1;Pe(),Ge(it),le.current=it,we(it),qe(!0),en()},Re=Ve=>{if(Math.abs(Ve)>$y&&Ye){ge(Ve);return}le.current=null,we(null),X(null),Se(null),qe(!0),Q(0),gt()},Ie=Ve=>{if(Ve.touches.length!==1||z.current)return;const it=Ve.touches[0];k.current=!0,I.current={x:it.clientX,y:it.clientY},h.current="none",W.current=0,S.current=!1},Ze=Ve=>{if(!I.current||Ve.touches.length!==1||z.current)return;const it=Ve.touches[0],jt=it.clientX-I.current.x,St=it.clientY-I.current.y;if(h.current==="none"){if(Math.abs(jt)<10&&Math.abs(St)<10)return;if(Math.abs(jt)>Math.abs(St)){if(!Ye)return;h.current="horizontal"}else if(St>0){if(!et)return;h.current="vertical"}else return}if(h.current==="horizontal"){S.current=!0,Ce(!0),W.current=jt,Q(jt),Ve.preventDefault();return}h.current==="vertical"&&(S.current=!0,Ce(!0),w.current=St,oe(St),Ve.preventDefault())},Et=()=>{if(!I.current)return;const Ve=h.current,it=S.current;if(it&&Ve==="horizontal")Re(W.current),g();else if(it&&Ve==="vertical"){const jt=w.current;if(et&&jt>Sy){const St=window.innerHeight;w.current=St,pe(!0),oe(St),de("closing")}else w.current=0,oe(0);g()}else Ve==="horizontal"&&Math.abs(W.current)>0&&(Re(W.current),g());I.current=null,h.current="none",W.current=0,S.current=!1,Ce(!1)};return document.addEventListener("touchstart",Ie,{passive:!0}),document.addEventListener("touchmove",Ze,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ie),document.removeEventListener("touchmove",Ze),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[J,Ye,qe,gt,Pe,et,en,Ge]);const Oe=a.useCallback(()=>{const g=(T==null?void 0:T())??b??null;g&&G&&(re(g),ce(!0)),de("closing")},[T,b,G]);a.useEffect(()=>{const g=Ie=>{if(Ie.key==="Escape"){if(l&&d||J==="closing")return;Rt(),Oe();return}if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight"||J!=="open"||!Ye)return;Ie.preventDefault();const Ze=Ie.key==="ArrowLeft"?-1:1;Ie.repeat&&N.current===Ze||Kt(Ze)},ge=Ie=>{if(Ie.key!=="ArrowLeft"&&Ie.key!=="ArrowRight")return;const Ze=Ie.key==="ArrowLeft"?-1:1;N.current===Ze&&Rt()},Re=()=>{Rt()};return window.addEventListener("keydown",g),window.addEventListener("keyup",ge),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",ge),window.removeEventListener("blur",Re),Rt()}},[J,l,d,Oe,Ye,Kt,Rt]),a.useEffect(()=>{J!=="open"&&Rt()},[J,Rt]);const Ke=()=>{J==="closing"||s||Oe()},Ne=J==="open",ze=J==="closing",ut=$e>0?Math.max(0,1-$e/500):1,_e=$e>0?Math.max(.35,1-$e/500):1,Je=a.useCallback(g=>{if(!(g.propertyName!=="transform"||!z.current)){if(le.current!==null){Dt();return}Pe(),qe(!1)}},[Pe,qe,Dt]),tt=J==="closing"?H??b:b,Wt=tt&&G&&(J==="opening"||ze)?Iy(tt,G):void 0,Ct=We&&V?Mt(V,"center"):$e>0?`translateY(${$e}px)`:Wt,lt=G?Do(G,_):null,Nt=!!(tt&&G),At=Nt&&(J==="closing"||J==="open"&&O),Vt={position:"absolute",top:lt==null?void 0:lt.top,left:lt==null?void 0:lt.left,width:lt==null?void 0:lt.width,height:lt==null?void 0:lt.height,objectFit:"contain",transformOrigin:"top left",transform:Ct,opacity:$e>0?_e:Nt?1:J==="opening"||ze?0:1,transition:be&&!ye?"none":ye?`transform ${Xi}ms ${mn}`:ee?`transform ${Cn}ms ${mn}, opacity ${Cn}ms ${mn}`:At?`transform ${Cn}ms ${mn}`:J==="opening"||ze?`opacity ${Cn}ms ${mn}`:"none",pointerEvents:je&&Ne&&!We?"auto":"none",touchAction:je&&Ne?"none":void 0,zIndex:1,overflow:je?"hidden":void 0},zt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ne&&!We?"auto":"none"},Pt=(g,ge,Re="adjacent")=>{const Ie=Tt(g);if(!Ie)return{display:"none"};const Ze=Re==="far"?ge==="left"?"far-left":"far-right":ge==="left"?"left-adjacent":"right-adjacent",{start:Et}=ke!==null?bc(Ie,Ze,ke,_):{start:Re==="far"?sr(Ie,ge,_):ji(Ie,ge,_)},Ve=Do(Et,_),it=Mt(g,Ze),jt=!We&&Re==="adjacent"&&Ne&&!ae?Hy(Ie,ge,_):null,St=Re==="far"&&We&&ke===(ge==="left"?-1:1),cn=be&&!ye?!1:ye,un=Re==="adjacent"&&Ne&&ae&&!We;return{position:"absolute",top:Ve.top,left:Ve.left,width:Ve.width,height:Ve.height,objectFit:"contain",transform:it??(jt?`translate(${jt.x}px, ${jt.y}px)`:void 0),opacity:Re==="far"?Ne&&St?1:0:Ne?1:0,transition:cn?Re==="far"?`transform ${Xi}ms ${mn}`:`transform ${Xi}ms ${mn}, opacity ${Cn}ms ${mn}`:un?`transform ${Cn}ms ${mn}`:J==="opening"||ze?`opacity ${Cn}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Qt=(g,ge)=>{const Re=Tt(g);return Re?_y(ji(Re,ge,_),ge,_):null},wt=g=>ge=>{if(!s){if(k.current){k.current=!1;return}ge.stopPropagation(),bt(g)}},Gt=De?Qt(De,"left"):null,pt=ot?Qt(ot,"right"):null,Ft=Gt?Do(Gt,_):null,Bt=pt?Do(pt,_):null;return r.jsxs("div",{ref:R,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:Ke,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ne?ut:0,transition:be?"none":`opacity ${Cn}ms ${mn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:P,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ne?1:0,transition:be?"none":`opacity ${Cn}ms ${mn}`,pointerEvents:"none"},children:r.jsx(ec,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,onClose:Ke})})]}),Ne&&kt&&r.jsx(Vo,{media:kt,style:Pt(kt,"left","far"),onMeasure:Qe,onTransitionEnd:Je},`far-prev-${kt.url}`),Ne&&De&&r.jsxs(r.Fragment,{children:[r.jsx(Vo,{media:De,style:Pt(De,"left"),onMeasure:Qe,onTransitionEnd:Je},`prev-${De.url}`),Ft&&r.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(-1)})]}),Ne&&ot&&r.jsxs(r.Fragment,{children:[r.jsx(Vo,{media:ot,style:Pt(ot,"right"),onMeasure:Qe,onTransitionEnd:Je},`next-${ot.url}`),Bt&&r.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:s||be?"default":"pointer",pointerEvents:s||be?"none":"auto",zIndex:3},onClick:wt(1)})]}),Ne&&_t&&r.jsx(Vo,{media:_t,style:Pt(_t,"right","far"),onMeasure:Qe,onTransitionEnd:Je},`far-next-${_t.url}`),G&&V&&(je?r.jsx(jy,{src:V.url,phase:J,onMediaElement:Jt,wrapperStyle:Vt,videoStyle:zt,onLoadedMetadata:ft,onTransitionEnd:Je},`${n}-${V.url}`):r.jsx("img",{ref:Jt,src:V.url,alt:V.name,onLoad:ft,onTransitionEnd:Je,style:Vt},`${n}-${V.url}`))]})}const zy=20,By=.18;function Dy(e){return`
17539
17529
  .${e}-wrapper {
17540
17530
  box-sizing: border-box;
17541
17531
  max-width: 100%;
@@ -17609,7 +17599,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
17609
17599
  pointer-events: auto;
17610
17600
  }
17611
17601
  ${wy(e)}
17612
- `}function Vy(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,l]=n.split(":").map(Number),s=i?l:o,d=i?o:l;return d>0?s/d:1}function Gy(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:y.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:y.scalingValue(i*By,n??!1),[`--${t}-image-aspect`]:Vy(e)}}function qy(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.07,lineHeight:e==null?void 0:e.titleLineHeight,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,color:(e==null?void 0:e.titleColor)??"#000000"};return Xt(n,t)}function Ky(e){var o;const t=((o=e==null?void 0:e.imageDisplay)==null?void 0:o.display)==="cover",n=((e==null?void 0:e.lightbox)??"on")==="on",i={objectFit:t?"cover":"contain",pointerEvents:"auto",...n?{cursor:"pointer"}:null};return{objectFitMode:t?"cover":"contain",imageStyle:i}}function Uy(e,t,n,i,o,l){if(!(!e||!t))return s=>{var c;const d=((c=s.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(s.currentTarget instanceof HTMLImageElement||s.currentTarget instanceof HTMLVideoElement?s.currentTarget:null);l(n,d?vc(d,o):void 0)}}function Xy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:d}=y.useScopedStyles(),c=a.useMemo(()=>Dy(d),[d]),u=t??[],m=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,x=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,b=y.scalingValue(x,n??!1),T=`max(${b}, ${zy}px)`,{objectFitMode:f,imageStyle:L}=Ky(e),$=qy(e,n),R=a.useRef(null),[E,C]=a.useState(!1),[U,k]=a.useState([]),[j,I]=a.useState(0),[w,W]=a.useState(0),[h,S]=a.useState(null),[M,z]=a.useState({title1:"",title2:"",title3:""}),K=(!n||i)&&!E,le=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},Y=le.sizeType??"none",D=K&&Y!=="none"?`${d}-item-image-hover-${Y}`:void 0,N=(le.value??120)/100,F={width:y.scalingValue(m,n??!1),...$,...Gy(e,d,n),[`--${d}-image-hover-scale`]:String(N)},A=(()=>{const de={},$e=R.current?getComputedStyle(R.current).getPropertyValue("--cntrl-article-width").trim():"";return $e&&(de["--cntrl-article-width"]=$e),de})(),q=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),G=a.useMemo(()=>Ey(u),[u]),Z=a.useMemo(()=>Fy(u),[u]),_=(de,$e)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const oe=G.findIndex(Q=>Q.gridIndex===de);if(oe<0)return;const xe=G[oe];W(oe),k(xe.items),I(0),z(xe.entry),S($e??null),C(!0)},me=a.useCallback(()=>{C(!1),S(null)},[]),v=a.useCallback(()=>{const de=G[w];return!de||!R.current?h:Ry(R.current,de.gridIndex,f)??h},[G,w,h,f]),fe=a.useCallback(de=>{if(G.length>1){const $e=G.length,oe=(w+de+$e)%$e,xe=G[oe];W(oe),k(xe.items),I(0),z(xe.entry);return}I($e=>($e+de+U.length)%U.length)},[G,w,U.length]),J=G.length>1||U.length>1;return a.useEffect(()=>{if(!E||typeof document>"u")return;const de=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=de}},[E]),a.useEffect(()=>{!n||o||i||C(!1)},[n,o,i]),a.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&C(!1)},[e==null?void 0:e.lightbox]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),r.jsx(Wy,{mediaList:Z}),r.jsx("div",{ref:R,className:`${d}-wrapper`,style:F,children:u.map((de,$e)=>{var Q,ye;const oe=!!((Q=de.image)!=null&&Q.url),xe=Uy(!!q,oe,$e,d,f,_);return r.jsxs("div",{className:`${d}-item`,children:[de.title?r.jsx("span",{className:`${d}-item-title`,onClick:xe,style:xe?{cursor:"pointer"}:void 0,children:de.title}):null,(ye=de.image)!=null&&ye.url?r.jsx("span",{className:[`${d}-item-image`,D].filter(Boolean).join(" "),children:de.image.type==="video"?r.jsx("video",{src:de.image.url,"data-waterfall-index":$e,style:L,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:xe}):r.jsx("img",{src:de.image.url,alt:de.image.name??"","data-waterfall-index":$e,style:L,onClick:xe})}):null,$e<u.length-1&&r.jsx("div",{className:`${d}-item-gap-host`,style:{width:b},children:o&&!E&&r.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${d}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:T,height:"100%"}})})]},$e)})}),E&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const de=(s?document.getElementById(s):null)??document.body;return gi.createPortal(r.jsx("div",{style:A,"data-selection":"none",children:r.jsx(Oy,{prefix:d,items:U,index:j,entry:M,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:J,lightboxEntries:G,entryIdx:w,layoutId:l,sourceRect:h,resolveCloseSourceRect:v,onClose:me,onPrev:()=>fe(-1),onNext:()=>fe(1)})}),de)})()]})}const Yy=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17602
+ `}function Vy(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,l]=n.split(":").map(Number),s=i?l:o,d=i?o:l;return d>0?s/d:1}function Gy(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:y.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:y.scalingValue(i*By,n??!1),[`--${t}-image-aspect`]:Vy(e)}}function qy(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.07,lineHeight:e==null?void 0:e.titleLineHeight,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,color:(e==null?void 0:e.titleColor)??"#000000"};return Xt(n,t)}function Ky(e){var o;const t=((o=e==null?void 0:e.imageDisplay)==null?void 0:o.display)==="cover",n=((e==null?void 0:e.lightbox)??"on")==="on",i={objectFit:t?"cover":"contain",pointerEvents:"auto",...n?{cursor:"pointer"}:null};return{objectFitMode:t?"cover":"contain",imageStyle:i}}function Uy(e,t,n,i,o,l){if(!(!e||!t))return s=>{var c;const d=((c=s.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(s.currentTarget instanceof HTMLImageElement||s.currentTarget instanceof HTMLVideoElement?s.currentTarget:null);l(n,d?vc(d,o):void 0)}}function Xy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:d}=y.useScopedStyles(),c=a.useMemo(()=>Dy(d),[d]),u=t??[],m=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,x=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,b=y.scalingValue(x,n??!1),T=`max(${b}, ${zy}px)`,{objectFitMode:f,imageStyle:L}=Ky(e),$=qy(e,n),R=a.useRef(null),[P,C]=a.useState(!1),[U,E]=a.useState([]),[j,I]=a.useState(0),[w,W]=a.useState(0),[h,S]=a.useState(null),[k,z]=a.useState({title1:"",title2:"",title3:""}),K=(!n||i)&&!P,le=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},Y=le.sizeType??"none",D=K&&Y!=="none"?`${d}-item-image-hover-${Y}`:void 0,N=(le.value??120)/100,F={width:y.scalingValue(m,n??!1),...$,...Gy(e,d,n),[`--${d}-image-hover-scale`]:String(N)},A=(()=>{const de={},$e=R.current?getComputedStyle(R.current).getPropertyValue("--cntrl-article-width").trim():"";return $e&&(de["--cntrl-article-width"]=$e),de})(),q=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),G=a.useMemo(()=>Ey(u),[u]),Z=a.useMemo(()=>Fy(u),[u]),_=(de,$e)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const oe=G.findIndex(Q=>Q.gridIndex===de);if(oe<0)return;const xe=G[oe];W(oe),E(xe.items),I(0),z(xe.entry),S($e??null),C(!0)},me=a.useCallback(()=>{C(!1),S(null)},[]),v=a.useCallback(()=>{const de=G[w];return!de||!R.current?h:Ry(R.current,de.gridIndex,f)??h},[G,w,h,f]),fe=a.useCallback(de=>{if(G.length>1){const $e=G.length,oe=(w+de+$e)%$e,xe=G[oe];W(oe),E(xe.items),I(0),z(xe.entry);return}I($e=>($e+de+U.length)%U.length)},[G,w,U.length]),J=G.length>1||U.length>1;return a.useEffect(()=>{if(!P||typeof document>"u")return;const de=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=de}},[P]),a.useEffect(()=>{!n||o||i||C(!1)},[n,o,i]),a.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&C(!1)},[e==null?void 0:e.lightbox]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),r.jsx(Wy,{mediaList:Z}),r.jsx("div",{ref:R,className:`${d}-wrapper`,style:F,children:u.map((de,$e)=>{var Q,ye;const oe=!!((Q=de.image)!=null&&Q.url),xe=Uy(!!q,oe,$e,d,f,_);return r.jsxs("div",{className:`${d}-item`,children:[de.title?r.jsx("span",{className:`${d}-item-title`,onClick:xe,style:xe?{cursor:"pointer"}:void 0,children:de.title}):null,(ye=de.image)!=null&&ye.url?r.jsx("span",{className:[`${d}-item-image`,D].filter(Boolean).join(" "),children:de.image.type==="video"?r.jsx("video",{src:de.image.url,"data-waterfall-index":$e,style:L,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:xe}):r.jsx("img",{src:de.image.url,alt:de.image.name??"","data-waterfall-index":$e,style:L,onClick:xe})}):null,$e<u.length-1&&r.jsx("div",{className:`${d}-item-gap-host`,style:{width:b},children:o&&!P&&r.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${d}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:T,height:"100%"}})})]},$e)})}),P&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const de=(s?document.getElementById(s):null)??document.body;return gi.createPortal(r.jsx("div",{style:A,"data-selection":"none",children:r.jsx(Oy,{prefix:d,items:U,index:j,entry:k,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:J,lightboxEntries:G,entryIdx:w,layoutId:l,sourceRect:h,resolveCloseSourceRect:v,onClose:me,onPrev:()=>fe(-1),onNext:()=>fe(1)})}),de)})()]})}const Yy=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17613
17603
  import type React from 'react';
17614
17604
  import { createPortal } from 'react-dom';
17615
17605
  import { CommonComponentProps } from '../props';
@@ -18266,7 +18256,7 @@ export function Waterfall({
18266
18256
  from { clip-path: inset(100% 0 0 0); }
18267
18257
  to { clip-path: inset(0 0 0 0); }
18268
18258
  }
18269
- `}function cv({settings:e,content:t,isEditor:n}){const{prefix:i}=y.useScopedStyles(),[o,l]=a.useState(null),s=lv(e,n),[d,c]=a.useState(void 0),[u,m]=a.useState(null),[x,b]=a.useState(0),[T,f]=a.useState(!1),[L,$]=a.useState(0),R=t??[],E=(e==null?void 0:e.trigger)??cs,C=E.sizeType??"drag",U=E.value??cs.value,k=(e==null?void 0:e.direction)??"horizontal",j=(e==null?void 0:e.transition)??"slide",I=(e==null?void 0:e.nav)??"classic",w=(e==null?void 0:e.navSize)??"m",W=rv[w],h=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,S=X=>y.scalingValue(X*h,n),M=(e==null?void 0:e.show)??"always",z=(e==null?void 0:e.controls)??null,K=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,le=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,Y=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,D=(e==null?void 0:e.controlsColor)??ss.color,N=(e==null?void 0:e.controlsHoverColor)??ss.hover,F=(e==null?void 0:e.navColor)??Yi.colors.inactive,A=(e==null?void 0:e.navPaginationColor)??Yi.colors.pagination,q=(e==null?void 0:e.navBackgroundColor)??Yi.colors.background,G=(e==null?void 0:e.linkColor)??ia.linkColor,Z=k==="horizontal",_=C==="click",me=C==="drag",v=C==="auto",fe=j==="fade in"||j==="reveal",J=I==="classic",de=M!=="never",$e=M==="on hover",oe=a.useRef(j),xe=a.useRef(C),Q=a.useRef(U),ye=a.useRef(k),ve=a.useRef(I),ke=y.scalingValue(K,n),we={width:ke,height:ke,maxWidth:ke},Me=X=>{o&&o.go(X)};return a.useEffect(()=>{if(!T)return;const X=window.setTimeout(()=>f(!1),300);return()=>window.clearTimeout(X)},[T,x]),a.useEffect(()=>{if(!u)return;const X=new ResizeObserver(ue=>{if(!o)return;const[Se]=ue;c({width:Math.round(Se.contentRect.width),height:Math.round(Se.contentRect.height)})});return X.observe(u),()=>X.unobserve(u)},[u]),a.useEffect(()=>{oe.current!==j&&($(X=>X+1),oe.current=j)},[j]),a.useEffect(()=>{xe.current!==C&&($(X=>X+1),xe.current=C)},[C]),a.useEffect(()=>{Q.current!==U&&($(X=>X+1),Q.current=U)},[U]),a.useEffect(()=>{ye.current!==k&&($(X=>X+1),ye.current=k)},[k]),a.useEffect(()=>{ve.current!==I&&($(X=>X+1),ve.current=I)},[I]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:sv(i,n)}}),r.jsxs("div",{className:nt(`${i}-wrapper`,{[`${i}-transition-reveal`]:j==="reveal",[`${i}-transition-reveal-vertical`]:j==="reveal"&&!Z}),ref:m,children:[r.jsxs("div",{className:`${i}-slider-inner`,style:{width:d?d.width:"100%",height:d?d.height:"100%",backgroundColor:"transparent"},children:[r.jsx(br,{onMove:X=>{f(!0),b(X.index)},ref:l,options:{arrows:!1,speed:parseInt(ls),autoplay:v,...v&&{interval:U*1e3},direction:Z||fe?"ltr":"ttb",pagination:!1,drag:me,perPage:1,width:d?d.width:"100%",height:d?d.height:"100%",type:fe?"fade":"loop",rewind:!0},children:R.map((X,ue)=>r.jsx(wr,{children:r.jsx("div",{className:`${i}-slider-item`,children:r.jsx("div",{className:`${i}-img-wrapper`,children:r.jsx("img",{className:nt(`${i}-slider-image`,{[`${i}-contain`]:X.image.objectFit==="contain",[`${i}-cover`]:X.image.objectFit==="cover"}),src:X.image.url,alt:X.image.name??""})})})},ue))},L),de&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:nt(`${i}-arrow`,{[`${i}-arrow-prev`]:Z,[`${i}-arrow-prev-vertical`]:!Z,[`${i}-hover-arrow`]:$e}),style:{color:D,"--arrow-hover-color":N,...we},children:r.jsxs("button",{onClick:X=>{X.stopPropagation(),Me("-1")},className:`${i}-arrow-inner`,style:{transform:`translate(${y.scalingValue(le,n)}, ${y.scalingValue(Y*(Z?1:-1),n)}) rotate(${Z?"0deg":"90deg"})`},children:[z&&r.jsx(rn,{url:z,fill:D,hoverFill:N,className:nt(`${i}-arrow-img`,`${i}-mirror`),style:we}),!z&&r.jsx(ds,{color:D,className:nt(`${i}-arrow-icon`,`${i}-arrow-img`,`${i}-mirror`)})]})}),r.jsx("div",{className:nt(`${i}-arrow`,{[`${i}-arrow-next`]:Z,[`${i}-arrow-next-vertical`]:!Z,[`${i}-hover-arrow`]:$e}),style:{color:D,"--arrow-hover-color":N,...we},children:r.jsxs("button",{className:`${i}-arrow-inner`,onClick:X=>{X.stopPropagation(),Me("+1")},style:{transform:`translate(${y.scalingValue(le*(Z?-1:1),n)}, ${y.scalingValue(Y,n)}) rotate(${Z?"0deg":"90deg"})`},children:[z&&r.jsx(rn,{url:z,fill:D,hoverFill:N,className:`${i}-arrow-img`,style:we}),!z&&r.jsx(ds,{color:D,className:nt(`${i}-arrow-icon`,`${i}-arrow-img`)})]})})]}),_&&r.jsx("div",{className:`${i}-click-overlay`,onClick:()=>{o&&o.go("+1")}}),J&&r.jsx("div",{className:nt(`${i}-pagination`,{[`${i}-pagination-inside-bottom`]:Z,[`${i}-pagination-inside-left`]:!Z}),style:Z?{bottom:S(W.inset)}:{left:S(W.inset)},children:r.jsx("div",{className:nt(`${i}-pagination-inner`,{[`${i}-pagination-vertical`]:!Z,[`${i}-animate-dots`]:T}),style:{backgroundColor:q,gap:S(W.gapInactive-W.activeDot+W.dot),...Z?{height:S(W.activeDot+W.paddingY*2),paddingTop:S(W.paddingY),paddingBottom:S(W.paddingY),paddingLeft:S(W.paddingActive),paddingRight:S(W.paddingActive)}:{width:S(W.activeDot+W.paddingY*2),paddingLeft:S(W.paddingY),paddingRight:S(W.paddingY),paddingTop:S(W.paddingActive),paddingBottom:S(W.paddingActive)},borderRadius:S(W.borderRadius),transform:`translate(${y.scalingValue(Yi.offset.x,n)}, ${y.scalingValue(Yi.offset.y,n)})`},children:R.map((X,ue)=>{const Se=ue===x,O=Se?W.activeDot:W.dot;return r.jsx("button",{onClick:()=>{o&&o.go(ue)},className:`${i}-pagination-item`,style:{width:S(W.activeDot)},children:r.jsx("div",{className:`${i}-dot`,style:{backgroundColor:Se?A:F,width:S(O)}})},ue)})},`${w}-${k}`)})]}),r.jsx("div",{className:`${i}-caption-block`,children:r.jsx("div",{className:`${i}-caption-text-wrapper`,children:R.map((X,ue)=>r.jsx("div",{className:nt(`${i}-caption-text`,{[`${i}-with-pointer-events`]:ue===x&&n,[`${i}-active`]:ue===x}),style:{...s,width:"max-content",transitionDuration:`${Math.round(parseInt(ls)/2)}ms`},children:r.jsx("div",{className:`${i}-caption-text-inner`,style:{"--link-color":G,"--link-hover-color":G,position:"relative",top:y.scalingValue(ia.offset.y,n),left:y.scalingValue(ia.offset.x,n)},children:r.jsx(mi,{content:X.imageCaption})})},ue))})})]})]})}function ds({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const dv=`import React, { useState, useEffect, useRef } from 'react';
18259
+ `}function cv({settings:e,content:t,isEditor:n}){const{prefix:i}=y.useScopedStyles(),[o,l]=a.useState(null),s=lv(e,n),[d,c]=a.useState(void 0),[u,m]=a.useState(null),[x,b]=a.useState(0),[T,f]=a.useState(!1),[L,$]=a.useState(0),R=t??[],P=(e==null?void 0:e.trigger)??cs,C=P.sizeType??"drag",U=P.value??cs.value,E=(e==null?void 0:e.direction)??"horizontal",j=(e==null?void 0:e.transition)??"slide",I=(e==null?void 0:e.nav)??"classic",w=(e==null?void 0:e.navSize)??"m",W=rv[w],h=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,S=X=>y.scalingValue(X*h,n),k=(e==null?void 0:e.show)??"always",z=(e==null?void 0:e.controls)??null,K=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,le=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,Y=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,D=(e==null?void 0:e.controlsColor)??ss.color,N=(e==null?void 0:e.controlsHoverColor)??ss.hover,F=(e==null?void 0:e.navColor)??Yi.colors.inactive,A=(e==null?void 0:e.navPaginationColor)??Yi.colors.pagination,q=(e==null?void 0:e.navBackgroundColor)??Yi.colors.background,G=(e==null?void 0:e.linkColor)??ia.linkColor,Z=E==="horizontal",_=C==="click",me=C==="drag",v=C==="auto",fe=j==="fade in"||j==="reveal",J=I==="classic",de=k!=="never",$e=k==="on hover",oe=a.useRef(j),xe=a.useRef(C),Q=a.useRef(U),ye=a.useRef(E),ve=a.useRef(I),ke=y.scalingValue(K,n),we={width:ke,height:ke,maxWidth:ke},Me=X=>{o&&o.go(X)};return a.useEffect(()=>{if(!T)return;const X=window.setTimeout(()=>f(!1),300);return()=>window.clearTimeout(X)},[T,x]),a.useEffect(()=>{if(!u)return;const X=new ResizeObserver(ue=>{if(!o)return;const[Se]=ue;c({width:Math.round(Se.contentRect.width),height:Math.round(Se.contentRect.height)})});return X.observe(u),()=>X.unobserve(u)},[u]),a.useEffect(()=>{oe.current!==j&&($(X=>X+1),oe.current=j)},[j]),a.useEffect(()=>{xe.current!==C&&($(X=>X+1),xe.current=C)},[C]),a.useEffect(()=>{Q.current!==U&&($(X=>X+1),Q.current=U)},[U]),a.useEffect(()=>{ye.current!==E&&($(X=>X+1),ye.current=E)},[E]),a.useEffect(()=>{ve.current!==I&&($(X=>X+1),ve.current=I)},[I]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:sv(i,n)}}),r.jsxs("div",{className:nt(`${i}-wrapper`,{[`${i}-transition-reveal`]:j==="reveal",[`${i}-transition-reveal-vertical`]:j==="reveal"&&!Z}),ref:m,children:[r.jsxs("div",{className:`${i}-slider-inner`,style:{width:d?d.width:"100%",height:d?d.height:"100%",backgroundColor:"transparent"},children:[r.jsx(br,{onMove:X=>{f(!0),b(X.index)},ref:l,options:{arrows:!1,speed:parseInt(ls),autoplay:v,...v&&{interval:U*1e3},direction:Z||fe?"ltr":"ttb",pagination:!1,drag:me,perPage:1,width:d?d.width:"100%",height:d?d.height:"100%",type:fe?"fade":"loop",rewind:!0},children:R.map((X,ue)=>r.jsx(wr,{children:r.jsx("div",{className:`${i}-slider-item`,children:r.jsx("div",{className:`${i}-img-wrapper`,children:r.jsx("img",{className:nt(`${i}-slider-image`,{[`${i}-contain`]:X.image.objectFit==="contain",[`${i}-cover`]:X.image.objectFit==="cover"}),src:X.image.url,alt:X.image.name??""})})})},ue))},L),de&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:nt(`${i}-arrow`,{[`${i}-arrow-prev`]:Z,[`${i}-arrow-prev-vertical`]:!Z,[`${i}-hover-arrow`]:$e}),style:{color:D,"--arrow-hover-color":N,...we},children:r.jsxs("button",{onClick:X=>{X.stopPropagation(),Me("-1")},className:`${i}-arrow-inner`,style:{transform:`translate(${y.scalingValue(le,n)}, ${y.scalingValue(Y*(Z?1:-1),n)}) rotate(${Z?"0deg":"90deg"})`},children:[z&&r.jsx(rn,{url:z,fill:D,hoverFill:N,className:nt(`${i}-arrow-img`,`${i}-mirror`),style:we}),!z&&r.jsx(ds,{color:D,className:nt(`${i}-arrow-icon`,`${i}-arrow-img`,`${i}-mirror`)})]})}),r.jsx("div",{className:nt(`${i}-arrow`,{[`${i}-arrow-next`]:Z,[`${i}-arrow-next-vertical`]:!Z,[`${i}-hover-arrow`]:$e}),style:{color:D,"--arrow-hover-color":N,...we},children:r.jsxs("button",{className:`${i}-arrow-inner`,onClick:X=>{X.stopPropagation(),Me("+1")},style:{transform:`translate(${y.scalingValue(le*(Z?-1:1),n)}, ${y.scalingValue(Y,n)}) rotate(${Z?"0deg":"90deg"})`},children:[z&&r.jsx(rn,{url:z,fill:D,hoverFill:N,className:`${i}-arrow-img`,style:we}),!z&&r.jsx(ds,{color:D,className:nt(`${i}-arrow-icon`,`${i}-arrow-img`)})]})})]}),_&&r.jsx("div",{className:`${i}-click-overlay`,onClick:()=>{o&&o.go("+1")}}),J&&r.jsx("div",{className:nt(`${i}-pagination`,{[`${i}-pagination-inside-bottom`]:Z,[`${i}-pagination-inside-left`]:!Z}),style:Z?{bottom:S(W.inset)}:{left:S(W.inset)},children:r.jsx("div",{className:nt(`${i}-pagination-inner`,{[`${i}-pagination-vertical`]:!Z,[`${i}-animate-dots`]:T}),style:{backgroundColor:q,gap:S(W.gapInactive-W.activeDot+W.dot),...Z?{height:S(W.activeDot+W.paddingY*2),paddingTop:S(W.paddingY),paddingBottom:S(W.paddingY),paddingLeft:S(W.paddingActive),paddingRight:S(W.paddingActive)}:{width:S(W.activeDot+W.paddingY*2),paddingLeft:S(W.paddingY),paddingRight:S(W.paddingY),paddingTop:S(W.paddingActive),paddingBottom:S(W.paddingActive)},borderRadius:S(W.borderRadius),transform:`translate(${y.scalingValue(Yi.offset.x,n)}, ${y.scalingValue(Yi.offset.y,n)})`},children:R.map((X,ue)=>{const Se=ue===x,O=Se?W.activeDot:W.dot;return r.jsx("button",{onClick:()=>{o&&o.go(ue)},className:`${i}-pagination-item`,style:{width:S(W.activeDot)},children:r.jsx("div",{className:`${i}-dot`,style:{backgroundColor:Se?A:F,width:S(O)}})},ue)})},`${w}-${E}`)})]}),r.jsx("div",{className:`${i}-caption-block`,children:r.jsx("div",{className:`${i}-caption-text-wrapper`,children:R.map((X,ue)=>r.jsx("div",{className:nt(`${i}-caption-text`,{[`${i}-with-pointer-events`]:ue===x&&n,[`${i}-active`]:ue===x}),style:{...s,width:"max-content",transitionDuration:`${Math.round(parseInt(ls)/2)}ms`},children:r.jsx("div",{className:`${i}-caption-text-inner`,style:{"--link-color":G,"--link-hover-color":G,position:"relative",top:y.scalingValue(ia.offset.y,n),left:y.scalingValue(ia.offset.x,n)},children:r.jsx(mi,{content:X.imageCaption})})},ue))})})]})]})}function ds({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const dv=`import React, { useState, useEffect, useRef } from 'react';
18270
18260
  import { Splide, SplideSlide } from '@splidejs/react-splide';
18271
18261
  import '@splidejs/react-splide/css/core';
18272
18262
  import cn from 'classnames';