@cntrl-site/components 1.0.66-alpha.4 → 1.0.66-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +61 -33
  2. package/dist/index.mjs +2138 -2089
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),pt=require("classnames"),D=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),zn=require("react-dom");function Tu(e){return e.type==="object"&&e.version===1}const Iu="ControlSlider-module__wrapper___sHEkd",Ru="ControlSlider-module__hoverArrow___A-dOH",Lu="ControlSlider-module__sliderItem___QQSkR",Pu="ControlSlider-module__sliderImage___9hRl-",Eu="ControlSlider-module__arrow___05ghY",Mu="ControlSlider-module__arrowVertical___tBfVN",ku="ControlSlider-module__nextArrow___-30Yc",Au="ControlSlider-module__arrowInner___aEra3",Fu="ControlSlider-module__arrowIcon___S4ztF",_u="ControlSlider-module__arrowImg___2dwJW",Nu="ControlSlider-module__mirror___brd6U",Wu="ControlSlider-module__pagination___bicLF",Hu="ControlSlider-module__paginationInner___bT-P-",Du="ControlSlider-module__paginationVertical___zYqKw",Ou="ControlSlider-module__paginationItem___nTRbk",Bu="ControlSlider-module__dot___p1Qun",zu="ControlSlider-module__activeDot___LHFaj",ju="ControlSlider-module__paginationInsideBottom___R3FWn",Vu="ControlSlider-module__paginationInsideTop___V-qb-",Gu="ControlSlider-module__paginationOutsideBottom___14w8D",Xu="ControlSlider-module__paginationOutsideTop___SCLqB",Yu="ControlSlider-module__paginationInsideLeft___yOBRZ",qu="ControlSlider-module__paginationInsideRight___Rtt3o",Uu="ControlSlider-module__paginationOutsideLeft___lahaw",Ku="ControlSlider-module__paginationOutsideRight___EtuQa",Zu="ControlSlider-module__imgWrapper___UjEgB",Ju="ControlSlider-module__captionBlock___dJ6-j",Qu="ControlSlider-module__captionTextWrapper___HFlpf",ep="ControlSlider-module__captionText___uGBVc",tp="ControlSlider-module__active___WZK4G",np="ControlSlider-module__withPointerEvents___t-18M",ip="ControlSlider-module__topLeftAlignment___zjnGM",op="ControlSlider-module__topCenterAlignment___gD1xW",rp="ControlSlider-module__topRightAlignment___NMapS",ap="ControlSlider-module__middleLeftAlignment___OnUrY",sp="ControlSlider-module__middleCenterAlignment___Tdkl0",lp="ControlSlider-module__middleRightAlignment___wEbfX",cp="ControlSlider-module__bottomLeftAlignment___cTP2-",dp="ControlSlider-module__bottomCenterAlignment___c54fB",up="ControlSlider-module__bottomRightAlignment___kEwrz",pp="ControlSlider-module__clickOverlay___DZA28",mp="ControlSlider-module__contain___pLyq7",gp="ControlSlider-module__cover___KdDat",ut={wrapper:Iu,hoverArrow:Ru,sliderItem:Lu,sliderImage:Pu,arrow:Eu,arrowVertical:Mu,nextArrow:ku,arrowInner:Au,arrowIcon:Fu,arrowImg:_u,mirror:Nu,pagination:Wu,paginationInner:Hu,paginationVertical:Du,paginationItem:Ou,dot:Bu,activeDot:zu,paginationInsideBottom:ju,paginationInsideTop:Vu,paginationOutsideBottom:Gu,paginationOutsideTop:Xu,paginationInsideLeft:Yu,paginationInsideRight:qu,paginationOutsideLeft:Uu,paginationOutsideRight:Ku,imgWrapper:Zu,captionBlock:Ju,captionTextWrapper:Qu,captionText:ep,active:tp,withPointerEvents:np,topLeftAlignment:ip,topCenterAlignment:op,topRightAlignment:rp,middleLeftAlignment:ap,middleCenterAlignment:sp,middleRightAlignment:lp,bottomLeftAlignment:cp,bottomCenterAlignment:dp,bottomRightAlignment:up,clickOverlay:pp,contain:mp,cover:gp};function hp(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 fp(e,t,n){return t&&hp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ol="(prefers-reduced-motion: reduce)",Bi=1,yp=2,Ui=3,lo=4,Xo=5,Ir=6,_r=7,xp={CREATED:Bi,MOUNTED:yp,IDLE:Ui,MOVING:lo,SCROLLING:Xo,DRAGGING:Ir,DESTROYED:_r};function On(e){e.length=0}function ai(e,t,n){return Array.prototype.slice.call(e,t,n)}function Xt(e){return e.bind.apply(e,[null].concat(ai(arguments,1)))}var jc=setTimeout,Ka=function(){};function rl(e){return requestAnimationFrame(e)}function Kr(e,t){return typeof t===e}function Mo(e){return!Cs(e)&&Kr("object",e)}var Ss=Array.isArray,Vc=Xt(Kr,"function"),ni=Xt(Kr,"string"),Yo=Xt(Kr,"undefined");function Cs(e){return e===null}function Gc(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function qo(e){return Ss(e)?e:[e]}function vn(e,t){qo(e).forEach(t)}function $s(e,t){return e.indexOf(t)>-1}function Rr(e,t){return e.push.apply(e,qo(t)),e}function _n(e,t,n){e&&vn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function En(e,t){_n(e,ni(t)?t.split(" "):t,!0)}function Uo(e,t){vn(t,e.appendChild.bind(e))}function Ts(e,t){vn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ko(e,t){return Gc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Xc(e,t){var n=e?ai(e.children):[];return t?n.filter(function(i){return ko(i,t)}):n}function Ko(e,t){return t?Xc(e,t)[0]:e.firstElementChild}var Ao=Object.keys;function Ci(e,t,n){return e&&(n?Ao(e).reverse():Ao(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Fo(e){return ai(arguments,1).forEach(function(t){Ci(t,function(n,i){e[i]=t[i]})}),e}function qn(e){return ai(arguments,1).forEach(function(t){Ci(t,function(n,i){Ss(n)?e[i]=n.slice():Mo(n)?e[i]=qn({},Mo(e[i])?e[i]:{},n):e[i]=n})}),e}function al(e,t){vn(t||Ao(e),function(n){delete e[n]})}function Mn(e,t){vn(e,function(n){vn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){Mo(t)?Ci(t,function(i,o){$t(e,o,i)}):vn(e,function(i){Cs(n)||n===""?Mn(i,t):i.setAttribute(t,String(n))})}function Gi(e,t,n){var i=document.createElement(e);return t&&(ni(t)?En(i,t):$t(i,t)),n&&Uo(n,i),i}function wn(e,t,n){if(Yo(n))return getComputedStyle(e)[t];Cs(n)||(e.style[t]=""+n)}function _o(e,t){wn(e,"display",t)}function Yc(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Sn(e,t){return e.getAttribute(t)}function sl(e,t){return e&&e.classList.contains(t)}function hn(e){return e.getBoundingClientRect()}function Ti(e){vn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function qc(e){return Ko(new DOMParser().parseFromString(e,"text/html").body)}function Fn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Uc(e,t){return e&&e.querySelector(t)}function Is(e,t){return t?ai(e.querySelectorAll(t)):[]}function Nn(e,t){_n(e,t,!1)}function Za(e){return e.timeStamp}function pi(e){return ni(e)?e:e?e+"px":""}var Zo="splide",Rs="data-"+Zo;function Ro(e,t){if(!e)throw new Error("["+Zo+"] "+(t||""))}var ii=Math.min,Nr=Math.max,Wr=Math.floor,No=Math.ceil,dn=Math.abs;function Kc(e,t,n){return dn(e-t)<n}function Lr(e,t,n,i){var o=ii(t,n),r=Nr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Wi(e,t,n){var i=ii(t,n),o=Nr(t,n);return ii(Nr(i,e),o)}function Ja(e){return+(e>0)-+(e<0)}function Qa(e,t){return vn(t,function(n){e=e.replace("%s",""+n)}),e}function Ls(e){return e<10?"0"+e:""+e}var ll={};function vp(e){return""+e+Ls(ll[e]=(ll[e]||0)+1)}function Zc(){var e=[];function t(l,d,c,u){o(l,d,function(p,x,w){var m="addEventListener"in p,h=m?p.removeEventListener.bind(p,x,c,u):p.removeListener.bind(p,c);m?p.addEventListener(x,c,u):p.addListener(c),e.push([p,x,w,c,h])})}function n(l,d,c){o(l,d,function(u,p,x){e=e.filter(function(w){return w[0]===u&&w[1]===p&&w[2]===x&&(!c||w[3]===c)?(w[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){vn(l,function(u){u&&vn(d,function(p){p.split(" ").forEach(function(x){var w=x.split(".");c(u,w[0],w[1])})})})}function r(){e.forEach(function(l){l[4]()}),On(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var si="mounted",es="ready",Bn="move",co="moved",Ps="click",Jc="active",Qc="inactive",ed="visible",td="hidden",en="refresh",ln="updated",Ki="resize",Zr="resized",nd="drag",id="dragging",od="dragged",Jr="scroll",Li="scrolled",bp="overflow",Es="destroy",rd="arrows:mounted",ad="arrows:updated",sd="pagination:mounted",ld="pagination:updated",Ms="navigation:mounted",ks="autoplay:play",cd="autoplay:playing",As="autoplay:pause",Fs="lazyload:loaded",dd="sk",ud="sh",Hr="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Zc();function i(r,l){n.bind(t,qo(r).join(" "),function(d){l.apply(l,Ss(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ai(arguments,1))}return e&&e.event.on(Es,n.destroy),Fo(n,{bus:t,on:i,off:Xt(n.unbind,t),emit:o})}function Qr(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?ii((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return w();d=rl(p)}}function x(C){C||h(),r=o()-(C?l*e:0),c=!1,d=rl(p)}function w(){c=!0}function m(){r=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(C){e=C}function v(){return c}return{start:x,rewind:m,pause:w,cancel:h,set:f,isPaused:v}}function wp(e){var t=e;function n(o){t=o}function i(o){return $s(qo(o),t)}return{set:n,is:i}}function Sp(e,t){var n=Qr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Cp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Zc(),d=[];function c(){var h=n.mediaQuery==="min";Ao(o).sort(function(f,v){return h?+f-+v:+v-+f}).forEach(function(f){p(o[f],"("+(h?"min":"max")+"-width:"+f+"px)")}),p(r,ol),x()}function u(h){h&&l.destroy()}function p(h,f){var v=matchMedia(f);l.bind(v,"change",x),d.push([h,v])}function x(){var h=i.is(_r),f=n.direction,v=d.reduce(function(C,y){return qn(C,y[1].matches?y[0]:{})},{});al(n),m(v),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function w(h){matchMedia(ol).matches&&(h?qn(n,r):al(n,Ao(r)))}function m(h,f,v){qn(n,h),f&&qn(Object.getPrototypeOf(n),h),(v||!i.is(Bi))&&e.emit(ln,n)}return{setup:c,destroy:u,reduce:w,set:m}}var ea="Arrow",ta=ea+"Left",na=ea+"Right",pd=ea+"Up",md=ea+"Down",cl="rtl",ia="ttb",fa={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[pd,na],ArrowRight:[md,ta]};function $p(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===cl&&!l?1:d===ia?0:-1;return fa[r]&&fa[r][c]||r.replace(/width|left|right/i,function(u,p){var x=fa[u.toLowerCase()][c]||u;return p>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(r){return r*(n.direction===cl?1:-1)}return{resolve:i,orient:o}}var Wn="role",Xi="tabindex",Tp="disabled",Cn="aria-",Jo=Cn+"controls",gd=Cn+"current",dl=Cn+"selected",yn=Cn+"label",_s=Cn+"labelledby",hd=Cn+"hidden",Ns=Cn+"orientation",Wo=Cn+"roledescription",ul=Cn+"live",pl=Cn+"busy",ml=Cn+"atomic",Ws=[Wn,Xi,Tp,Jo,gd,yn,_s,hd,Ns,Wo],kn=Zo+"__",li="is-",ya=Zo,gl=kn+"track",Ip=kn+"list",oa=kn+"slide",fd=oa+"--clone",Rp=oa+"__container",Hs=kn+"arrows",ra=kn+"arrow",yd=ra+"--prev",xd=ra+"--next",aa=kn+"pagination",vd=aa+"__page",Lp=kn+"progress",Pp=Lp+"__bar",Ep=kn+"toggle",Mp=kn+"spinner",kp=kn+"sr",Ap=li+"initialized",Ii=li+"active",bd=li+"prev",wd=li+"next",ts=li+"visible",ns=li+"loading",Sd=li+"focus-in",Cd=li+"overflow",Fp=[Ii,ts,bd,wd,ns,Sd,Cd],_p={slide:oa,clone:fd,arrows:Hs,arrow:ra,prev:yd,next:xd,pagination:aa,page:vd,spinner:Mp};function Np(e,t){if(Vc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ko(n,t);)n=n.parentElement;return n}var Wp=5,hl=200,$d="touchstart mousedown",xa="touchmove mousemove",va="touchend touchcancel mouseup click";function Hp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],x=[],w,m,h;function f(){S(),G(),y()}function v(){o(en,C),o(en,f),o(ln,y),r(document,$d+" keydown",function(H){h=H.type==="keydown"},{capture:!0}),r(l,"focusin",function(){_n(l,Sd,!!h)})}function C(H){var I=Ws.concat("style");On(u),Nn(l,p),Nn(w,x),Mn([w,m],I),Mn(l,H?I:["style",Wo])}function y(){Nn(l,p),Nn(w,x),p=U(ya),x=U(gl),En(l,p),En(w,x),$t(l,yn,n.label),$t(l,_s,n.labelledby)}function S(){w=W("."+gl),m=Ko(w,"."+Ip),Ro(w&&m,"A track/list element is missing."),Rr(u,Xc(m,"."+oa+":not(."+fd+")")),Ci({arrows:Hs,pagination:aa,prev:yd,next:xd,bar:Pp,toggle:Ep},function(H,I){c[I]=W("."+H)}),Fo(c,{root:l,track:w,list:m,slides:u})}function G(){var H=l.id||vp(Zo),I=n.role;l.id=H,w.id=w.id||H+"-track",m.id=m.id||H+"-list",!Sn(l,Wn)&&l.tagName!=="SECTION"&&I&&$t(l,Wn,I),$t(l,Wo,d.carousel),$t(m,Wn,"presentation")}function W(H){var I=Uc(l,H);return I&&Np(I,"."+ya)===l?I:void 0}function U(H){return[H+"--"+n.type,H+"--"+n.direction,n.drag&&H+"--draggable",n.isNavigation&&H+"--nav",H===ya&&Ii]}return Fo(c,{setup:f,mount:v,destroy:C})}var Zi="slide",uo="loop",Qo="fade";function Dp(e,t,n,i){var o=Kt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,x=p.isNavigation,w=p.updateOnMove,m=p.i18n,h=p.pagination,f=p.slideFocus,v=c.Direction.resolve,C=Sn(i,"style"),y=Sn(i,yn),S=n>-1,G=Ko(i,"."+Rp),W;function U(){S||(i.id=u.id+"-slide"+Ls(t+1),$t(i,Wn,h?"tabpanel":"group"),$t(i,Wo,m.slide),$t(i,yn,y||Qa(m.slideLabel,[t+1,e.length]))),H()}function H(){d(i,"click",Xt(l,Ps,ie)),d(i,"keydown",Xt(l,dd,ie)),r([co,ud,Li],T),r(Ms,z),w&&r(Bn,$)}function I(){W=!0,o.destroy(),Nn(i,Fp),Mn(i,Ws),$t(i,"style",C),$t(i,yn,y||"")}function z(){var L=e.splides.map(function(O){var K=O.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");$t(i,yn,Qa(m.slideX,(S?n:t)+1)),$t(i,Jo,L),$t(i,Wn,f?"button":""),f&&Mn(i,Wo)}function $(){W||T()}function T(){if(!W){var L=e.index;A(),_(),_n(i,bd,t===L-1),_n(i,wd,t===L+1)}}function A(){var L=B();L!==sl(i,Ii)&&(_n(i,Ii,L),$t(i,gd,x&&L||""),l(L?Jc:Qc,ie))}function _(){var L=P(),O=!L&&(!B()||S);if(e.state.is([lo,Xo])||$t(i,hd,O||""),$t(Is(i,p.focusableNodes||""),Xi,O?-1:""),f&&$t(i,Xi,O?-1:0),L!==sl(i,ts)&&(_n(i,ts,L),l(L?ed:td,ie)),!L&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&Yc(K.slide)}}function g(L,O,K){wn(K&&G||i,L,O)}function B(){var L=e.index;return L===t||p.cloneStatus&&L===n}function P(){if(e.is(Qo))return B();var L=hn(c.Elements.track),O=hn(i),K=v("left",!0),ue=v("right",!0);return Wr(L[K])<=No(O[K])&&Wr(O[ue])<=No(L[ue])}function Y(L,O){var K=dn(L-t);return!S&&(p.rewind||e.is(uo))&&(K=ii(K,e.length-K)),K<=O}var ie={index:t,slideIndex:n,slide:i,container:G,isClone:S,mount:U,destroy:I,update:T,style:g,isWithin:Y};return ie}function Op(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function x(){w(),o(en,m),o(en,w)}function w(){c.forEach(function(T,A){f(T,A,-1)})}function m(){W(function(T){T.destroy()}),On(p)}function h(){W(function(T){T.update()})}function f(T,A,_){var g=Dp(e,A,_,T);g.mount(),p.push(g),p.sort(function(B,P){return B.index-P.index})}function v(T){return T?U(function(A){return!A.isClone}):p}function C(T){var A=t.Controller,_=A.toIndex(T),g=A.hasFocus()?1:n.perPage;return U(function(B){return Lr(B.index,_,_+g-1)})}function y(T){return U(T)[0]}function S(T,A){vn(T,function(_){if(ni(_)&&(_=qc(_)),Gc(_)){var g=c[A];g?Ts(_,g):Uo(u,_),En(_,n.classes.slide),I(_,Xt(r,Ki))}}),r(en)}function G(T){Ti(U(T).map(function(A){return A.slide})),r(en)}function W(T,A){v(A).forEach(T)}function U(T){return p.filter(Vc(T)?T:function(A){return ni(T)?ko(A.slide,T):$s(qo(T),A.index)})}function H(T,A,_){W(function(g){g.style(T,A,_)})}function I(T,A){var _=Is(T,"img"),g=_.length;g?_.forEach(function(B){l(B,"load error",function(){--g||A()})}):A()}function z(T){return T?c.length:p.length}function $(){return p.length>n.perPage}return{mount:x,destroy:m,update:h,register:f,get:v,getIn:C,getAt:y,add:S,remove:G,forEach:W,filter:U,style:H,getLength:z,isEnough:$}}function Bp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,x=u.track,w=u.list,m=d.getAt,h=d.style,f,v,C;function y(){S(),r(window,"resize load",Sp(Xt(l,Ki))),o([ln,en],S),o(Ki,G)}function S(){f=n.direction===ia,wn(p,"maxWidth",pi(n.width)),wn(x,c("paddingLeft"),W(!1)),wn(x,c("paddingRight"),W(!0)),G(!0)}function G(ie){var L=hn(p);(ie||v.width!==L.width||v.height!==L.height)&&(wn(x,"height",U()),h(c("marginRight"),pi(n.gap)),h("width",I()),h("height",z(),!0),v=L,l(Zr),C!==(C=Y())&&(_n(p,Cd,C),l(bp,C)))}function W(ie){var L=n.padding,O=c(ie?"right":"left");return L&&pi(L[O]||(Mo(L)?0:L))||"0px"}function U(){var ie="";return f&&(ie=H(),Ro(ie,"height or heightRatio is missing."),ie="calc("+ie+" - "+W(!1)+" - "+W(!0)+")"),ie}function H(){return pi(n.height||hn(w).width*n.heightRatio)}function I(){return n.autoWidth?null:pi(n.fixedWidth)||(f?"":$())}function z(){return pi(n.fixedHeight)||(f?n.autoHeight?null:$():H())}function $(){var ie=pi(n.gap);return"calc((100%"+(ie&&" + "+ie)+")/"+(n.perPage||1)+(ie&&" - "+ie)+")"}function T(){return hn(w)[c("width")]}function A(ie,L){var O=m(ie||0);return O?hn(O.slide)[c("width")]+(L?0:B()):0}function _(ie,L){var O=m(ie);if(O){var K=hn(O.slide)[c("right")],ue=hn(w)[c("left")];return dn(K-ue)+(L?0:B())}return 0}function g(ie){return _(e.length-1)-_(0)+A(0,ie)}function B(){var ie=m(0);return ie&&parseFloat(wn(ie.slide,c("marginRight")))||0}function P(ie){return parseFloat(wn(x,c("padding"+(ie?"Right":"Left"))))||0}function Y(){return e.is(Qo)||g(!0)>T()}return{mount:y,resize:G,listSize:T,slideSize:A,sliderSize:g,totalSize:_,getPadding:P,isOverflow:Y}}var zp=2;function jp(e,t,n){var i=Kt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(en,x),o([ln,Ki],m),(u=v())&&(h(u),t.Layout.resize(!0))}function x(){w(),p()}function w(){Ti(c),On(c),i.destroy()}function m(){var C=v();u!==C&&(u<C||!C)&&i.emit(en)}function h(C){var y=l.get().slice(),S=y.length;if(S){for(;y.length<C;)Rr(y,y);Rr(y.slice(-C),y.slice(0,C)).forEach(function(G,W){var U=W<C,H=f(G.slide,W);U?Ts(H,y[0].slide):Uo(r.list,H),Rr(c,H),l.register(H,W-C+(U?0:S),G.index)})}}function f(C,y){var S=C.cloneNode(!0);return En(S,n.classes.clone),S.id=e.root.id+"-clone"+Ls(y+1),S}function v(){var C=n.clones;if(!e.is(uo))C=0;else if(Yo(C)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=y&&No(hn(r.track)[d("width")]/y);C=S||n[d("autoWidth")]&&e.length||n.perPage*zp}return C}return{mount:p,destroy:w}}function Vp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,x=d.listSize,w=d.sliderSize,m=t.Direction,h=m.resolve,f=m.orient,v=t.Elements,C=v.list,y=v.track,S;function G(){S=t.Transition,o([si,Zr,ln,en],W)}function W(){t.Controller.isBusy()||(t.Scroll.cancel(),H(e.index),t.Slides.update())}function U(O,K,ue,le){O!==K&&ie(O>ue)&&(T(),I($(g(),O>ue),!0)),l(lo),r(Bn,K,ue,O),S.start(K,function(){l(Ui),r(co,K,ue,O),le&&le()})}function H(O){I(_(O,!0))}function I(O,K){if(!e.is(Qo)){var ue=K?O:z(O);wn(C,"transform","translate"+h("X")+"("+ue+"px)"),O!==ue&&r(ud)}}function z(O){if(e.is(uo)){var K=A(O),ue=K>t.Controller.getEnd(),le=K<0;(le||ue)&&(O=$(O,ue))}return O}function $(O,K){var ue=O-Y(K),le=w();return O-=f(le*(No(dn(ue)/le)||1))*(K?1:-1),O}function T(){I(g(),!0),S.cancel()}function A(O){for(var K=t.Slides.get(),ue=0,le=1/0,F=0;F<K.length;F++){var pe=K[F].index,j=dn(_(pe,!0)-O);if(j<=le)le=j,ue=pe;else break}return ue}function _(O,K){var ue=f(p(O-1)-P(O));return K?B(ue):ue}function g(){var O=h("left");return hn(C)[O]-hn(y)[O]+f(u(!1))}function B(O){return n.trimSpace&&e.is(Zi)&&(O=Wi(O,0,f(w(!0)-x()))),O}function P(O){var K=n.focus;return K==="center"?(x()-c(O,!0))/2:+K*c(O)||0}function Y(O){return _(O?t.Controller.getEnd():0,!!n.trimSpace)}function ie(O){var K=f($(g(),O));return O?K>=0:K<=C[h("scrollWidth")]-hn(y)[h("width")]}function L(O,K){K=Yo(K)?g():K;var ue=O!==!0&&f(K)<f(Y(!1)),le=O!==!1&&f(K)>f(Y(!0));return ue||le}return{mount:G,move:U,jump:H,translate:I,shift:$,cancel:T,toIndex:A,toPosition:_,getPosition:g,getLimit:Y,exceededLimit:L,reposition:W}}function Gp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,x=p.isEnough,w=p.getLength,m=n.omitEnd,h=e.is(uo),f=e.is(Zi),v=Xt(g,!1),C=Xt(g,!0),y=n.start||0,S,G=y,W,U,H;function I(){z(),o([ln,en,Hr],z),o(Zr,$)}function z(){W=w(!0),U=n.perMove,H=n.perPage,S=ie();var j=Wi(y,0,m?S:W-1);j!==y&&(y=j,l.reposition())}function $(){S!==ie()&&r(Hr)}function T(j,se,ne){if(!pe()){var ve=_(j),Me=Y(ve);Me>-1&&(se||Me!==y)&&(ue(Me),l.move(ve,Me,G,ne))}}function A(j,se,ne,ve){t.Scroll.scroll(j,se,ne,function(){var Me=Y(l.toIndex(d()));ue(m?ii(Me,S):Me),ve&&ve()})}function _(j){var se=y;if(ni(j)){var ne=j.match(/([+\-<>])(\d+)?/)||[],ve=ne[1],Me=ne[2];ve==="+"||ve==="-"?se=B(y+ +(""+ve+(+Me||1)),y):ve===">"?se=Me?L(+Me):v(!0):ve==="<"&&(se=C(!0))}else se=h?j:Wi(j,0,S);return se}function g(j,se){var ne=U||(F()?1:H),ve=B(y+ne*(j?-1:1),y,!(U||F()));return ve===-1&&f&&!Kc(d(),c(!j),1)?j?0:S:se?ve:Y(ve)}function B(j,se,ne){if(x()||F()){var ve=P(j);ve!==j&&(se=j,j=ve,ne=!1),j<0||j>S?!U&&(Lr(0,j,se,!0)||Lr(S,se,j,!0))?j=L(O(j)):h?j=ne?j<0?-(W%H||H):W:j:n.rewind?j=j<0?S:0:j=-1:ne&&j!==se&&(j=L(O(se)+(j<se?-1:1)))}else j=-1;return j}function P(j){if(f&&n.trimSpace==="move"&&j!==y)for(var se=d();se===u(j,!0)&&Lr(j,0,e.length-1,!n.rewind);)j<y?--j:++j;return j}function Y(j){return h?(j+W)%W||0:j}function ie(){for(var j=W-(F()||h&&U?1:H);m&&j-- >0;)if(u(W-1,!0)!==u(j,!0)){j++;break}return Wi(j,0,W-1)}function L(j){return Wi(F()?j:H*j,0,S)}function O(j){return F()?ii(j,S):Wr((j>=S?W-1:j)/H)}function K(j){var se=l.toIndex(j);return f?Wi(se,0,S):se}function ue(j){j!==y&&(G=y,y=j)}function le(j){return j?G:y}function F(){return!Yo(n.focus)||n.isNavigation}function pe(){return e.state.is([lo,Xo])&&!!n.waitForTransition}return{mount:I,go:T,scroll:A,getNext:v,getPrev:C,getAdjacent:g,getEnd:ie,setIndex:ue,getIndex:le,toIndex:L,toPage:O,toDest:K,hasFocus:F,isBusy:pe}}var Xp="http://www.w3.org/2000/svg",Yp="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",sr=40;function qp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,x=u.arrows,w=u.track,m=x,h=u.prev,f=u.next,v,C,y={};function S(){W(),o(ln,G)}function G(){U(),S()}function W(){var A=n.arrows;A&&!(h&&f)&&z(),h&&f&&(Fo(y,{prev:h,next:f}),_o(m,A?"":"none"),En(m,C=Hs+"--"+n.direction),A&&(H(),T(),$t([h,f],Jo,w.id),l(rd,h,f)))}function U(){i.destroy(),Nn(m,C),v?(Ti(x?[h,f]:m),h=f=null):Mn([h,f],Ws)}function H(){o([si,co,en,Li,Hr],T),r(f,"click",Xt(I,">")),r(h,"click",Xt(I,"<"))}function I(A){p.go(A,!0)}function z(){m=x||Gi("div",d.arrows),h=$(!0),f=$(!1),v=!0,Uo(m,[h,f]),!x&&Ts(m,w)}function $(A){var _='<button class="'+d.arrow+" "+(A?d.prev:d.next)+'" type="button"><svg xmlns="'+Xp+'" viewBox="0 0 '+sr+" "+sr+'" width="'+sr+'" height="'+sr+'" focusable="false"><path d="'+(n.arrowPath||Yp)+'" />';return qc(_)}function T(){if(h&&f){var A=e.index,_=p.getPrev(),g=p.getNext(),B=_>-1&&A<_?c.last:c.prev,P=g>-1&&A>g?c.first:c.next;h.disabled=_<0,f.disabled=g<0,$t(h,yn,B),$t(f,yn,P),l(ad,h,f,_,g)}}return{arrows:y,mount:S,destroy:U,update:T}}var Up=Rs+"-interval";function Kp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=Qr(n.interval,e.go.bind(e,">"),H),c=d.isPaused,u=t.Elements,p=t.Elements,x=p.root,w=p.toggle,m=n.autoplay,h,f,v=m==="pause";function C(){m&&(y(),w&&$t(w,Jo,u.track.id),v||S(),U())}function y(){n.pauseOnHover&&r(x,"mouseenter mouseleave",function(z){h=z.type==="mouseenter",W()}),n.pauseOnFocus&&r(x,"focusin focusout",function(z){f=z.type==="focusin",W()}),w&&r(w,"click",function(){v?S():G(!0)}),o([Bn,Jr,en],d.rewind),o(Bn,I)}function S(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=h=v=!1,U(),l(ks))}function G(z){z===void 0&&(z=!0),v=!!z,U(),c()||(d.pause(),l(As))}function W(){v||(h||f?G(!1):S())}function U(){w&&(_n(w,Ii,!v),$t(w,yn,n.i18n[v?"play":"pause"]))}function H(z){var $=u.bar;$&&wn($,"width",z*100+"%"),l(cd,z)}function I(z){var $=t.Slides.getAt(z);d.set($&&+Sn($.slide,Up)||n.interval)}return{mount:C,destroy:d.cancel,play:S,pause:G,isPaused:c}}function Zp(e,t,n){var i=Kt(e),o=i.on;function r(){n.cover&&(o(Fs,Xt(d,!0)),o([si,ln,en],Xt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Ko(u.container||u.slide,"img");p&&p.src&&d(c,p,u)})}function d(c,u,p){p.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),_o(u,c?"none":"")}return{mount:r,destroy:Xt(l,!1)}}var Jp=10,Qp=600,em=.6,tm=1.5,nm=800;function im(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,x=d.translate,w=e.is(Zi),m,h,f=1;function v(){o(Bn,G),o([ln,en],W)}function C(H,I,z,$,T){var A=c();if(G(),z&&(!w||!p())){var _=t.Layout.sliderSize(),g=Ja(H)*_*Wr(dn(H)/_)||0;H=d.toPosition(t.Controller.toDest(H%_))+g}var B=Kc(A,H,1);f=1,I=B?0:I||Nr(dn(H-A)/tm,nm),h=$,m=Qr(I,y,Xt(S,A,H,T),1),l(Xo),r(Jr),m.start()}function y(){l(Ui),h&&h(),r(Li)}function S(H,I,z,$){var T=c(),A=H+(I-H)*U($),_=(A-T)*f;x(T+_),w&&!z&&p()&&(f*=em,dn(_)<Jp&&C(u(p(!0)),Qp,!1,h,!0))}function G(){m&&m.cancel()}function W(){m&&!m.isPaused()&&(G(),y())}function U(H){var I=n.easingFunc;return I?I(H):1-Math.pow(1-H,4)}return{mount:v,destroy:G,scroll:C,cancel:W}}var Hi={passive:!1,capture:!0};function om(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,x=t.Controller,w=t.Elements.track,m=t.Media.reduce,h=t.Direction,f=h.resolve,v=h.orient,C=u.getPosition,y=u.exceededLimit,S,G,W,U,H,I=!1,z,$,T;function A(){l(w,xa,Ka,Hi),l(w,va,Ka,Hi),l(w,$d,g,Hi),l(w,"click",Y,{capture:!0}),l(w,"dragstart",Fn),o([si,ln],_)}function _(){var M=n.drag;b(!M),U=M==="free"}function g(M){if(z=!1,!$){var E=Me(M);ve(M.target)&&(E||!M.button)&&(x.isBusy()?Fn(M,!0):(T=E?w:window,H=c.is([lo,Xo]),W=null,l(T,xa,B,Hi),l(T,va,P,Hi),u.cancel(),p.cancel(),ie(M)))}}function B(M){if(c.is(Ir)||(c.set(Ir),r(nd)),M.cancelable)if(H){u.translate(S+ne(F(M)));var E=pe(M)>hl,V=I!==(I=y());(E||V)&&ie(M),z=!0,r(id),Fn(M)}else K(M)&&(H=O(M),Fn(M))}function P(M){c.is(Ir)&&(c.set(Ui),r(od)),H&&(L(M),Fn(M)),d(T,xa,B),d(T,va,P),H=!1}function Y(M){!$&&z&&Fn(M,!0)}function ie(M){W=G,G=M,S=C()}function L(M){var E=ue(M),V=le(E),Se=n.rewind&&n.rewindByDrag;m(!1),U?x.scroll(V,0,n.snap):e.is(Qo)?x.go(v(Ja(E))<0?Se?"<":"-":Se?">":"+"):e.is(Zi)&&I&&Se?x.go(y(!0)?">":"<"):x.go(x.toDest(V),!0),m(!0)}function O(M){var E=n.dragMinThreshold,V=Mo(E),Se=V&&E.mouse||0,te=(V?E.touch:+E)||10;return dn(F(M))>(Me(M)?te:Se)}function K(M){return dn(F(M))>dn(F(M,!0))}function ue(M){if(e.is(uo)||!I){var E=pe(M);if(E&&E<hl)return F(M)/E}return 0}function le(M){return C()+Ja(M)*ii(dn(M)*(n.flickPower||600),U?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function F(M,E){return se(M,E)-se(j(M),E)}function pe(M){return Za(M)-Za(j(M))}function j(M){return G===M&&W||G}function se(M,E){return(Me(M)?M.changedTouches[0]:M)["page"+f(E?"Y":"X")]}function ne(M){return M/(I&&e.is(Zi)?Wp:1)}function ve(M){var E=n.noDrag;return!ko(M,"."+vd+", ."+ra)&&(!E||!ko(M,E))}function Me(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}function xe(){return H}function b(M){$=M}return{mount:A,disable:b,isDragging:xe}}var rm={Spacebar:" ",Right:na,Left:ta,Up:pd,Down:md};function Ds(e){return e=ni(e)?e:e.key,rm[e]||e}var fl="keydown";function am(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function x(){w(),o(ln,m),o(ln,w),o(Bn,f)}function w(){var C=n.keyboard;C&&(u=C==="global"?window:d,r(u,fl,v))}function m(){l(u,fl)}function h(C){p=C}function f(){var C=p;p=!0,jc(function(){p=C})}function v(C){if(!p){var y=Ds(C);y===c(ta)?e.go("<"):y===c(na)&&e.go(">")}}return{mount:x,destroy:m,disable:h}}var Lo=Rs+"-lazy",Pr=Lo+"-srcset",sm="["+Lo+"], ["+Pr+"]";function lm(e,t,n){var i=Kt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[co,Li],p=[];function x(){n.lazyLoad&&(w(),o(en,w))}function w(){On(p),m(),c?C():(r(u),o(u,h),h())}function m(){t.Slides.forEach(function(y){Is(y.slide,sm).forEach(function(S){var G=Sn(S,Lo),W=Sn(S,Pr);if(G!==S.src||W!==S.srcset){var U=n.classes.spinner,H=S.parentElement,I=Ko(H,"."+U)||Gi("span",U,H);p.push([S,y,I]),S.src||_o(S,"none")}})})}function h(){p=p.filter(function(y){var S=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,S)?f(y):!0}),p.length||r(u)}function f(y){var S=y[0];En(y[1].slide,ns),l(S,"load error",Xt(v,y)),$t(S,"src",Sn(S,Lo)),$t(S,"srcset",Sn(S,Pr)),Mn(S,Lo),Mn(S,Pr)}function v(y,S){var G=y[0],W=y[1];Nn(W.slide,ns),S.type!=="error"&&(Ti(y[2]),_o(G,""),d(Fs,G,W),d(Ki)),c&&C()}function C(){p.length&&f(p.shift())}return{mount:x,destroy:Xt(On,p),check:h}}function cm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,x=u.getIndex,w=u.go,m=t.Direction.resolve,h=c.pagination,f=[],v,C;function y(){S(),o([ln,en,Hr],y);var $=n.pagination;h&&_o(h,$?"":"none"),$&&(o([Bn,Jr,Li],z),G(),z(),r(sd,{list:v,items:f},I(e.index)))}function S(){v&&(Ti(h?ai(v.children):v),Nn(v,C),On(f),v=null),i.destroy()}function G(){var $=e.length,T=n.classes,A=n.i18n,_=n.perPage,g=p()?u.getEnd()+1:No($/_);v=h||Gi("ul",T.pagination,c.track.parentElement),En(v,C=aa+"--"+H()),$t(v,Wn,"tablist"),$t(v,yn,A.select),$t(v,Ns,H()===ia?"vertical":"");for(var B=0;B<g;B++){var P=Gi("li",null,v),Y=Gi("button",{class:T.page,type:"button"},P),ie=d.getIn(B).map(function(O){return O.slide.id}),L=!p()&&_>1?A.pageX:A.slideX;l(Y,"click",Xt(W,B)),n.paginationKeyboard&&l(Y,"keydown",Xt(U,B)),$t(P,Wn,"presentation"),$t(Y,Wn,"tab"),$t(Y,Jo,ie.join(" ")),$t(Y,yn,Qa(L,B+1)),$t(Y,Xi,-1),f.push({li:P,button:Y,page:B})}}function W($){w(">"+$,!0)}function U($,T){var A=f.length,_=Ds(T),g=H(),B=-1;_===m(na,!1,g)?B=++$%A:_===m(ta,!1,g)?B=(--$+A)%A:_==="Home"?B=0:_==="End"&&(B=A-1);var P=f[B];P&&(Yc(P.button),w(">"+B),Fn(T,!0))}function H(){return n.paginationDirection||n.direction}function I($){return f[u.toPage($)]}function z(){var $=I(x(!0)),T=I(x());if($){var A=$.button;Nn(A,Ii),Mn(A,dl),$t(A,Xi,-1)}if(T){var _=T.button;En(_,Ii),$t(_,dl,!0),$t(_,Xi,"")}r(ld,{list:v,items:f},$,T)}return{items:f,mount:y,destroy:S,getAt:I,update:z}}var dm=[" ","Enter"];function um(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){r.forEach(function(h){h.destroy()}),On(r)}function c(){d(),l()}function u(h,f){var v=Kt(h);v.on(Bn,function(C,y,S){f.go(f.is(uo)?S:C)}),r.push(v)}function p(){var h=Kt(e),f=h.on;f(Ps,w),f(dd,m),f([si,ln],x),r.push(h),h.emit(Ms,e.splides)}function x(){$t(t.Elements.list,Ns,n.direction===ia?"vertical":"")}function w(h){e.go(h.index)}function m(h,f){$s(dm,Ds(f))&&(w(h),Fn(f))}return{setup:Xt(t.Media.set,{slideFocus:Yo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function pm(e,t,n){var i=Kt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Hi)}function d(u){if(u.cancelable){var p=u.deltaY,x=p<0,w=Za(u),m=n.wheelMinThreshold||0,h=n.wheelSleep||0;dn(p)>m&&w-r>h&&(e.go(x?"<":">"),r=w),c(x)&&Fn(u)}}function c(u){return!n.releaseWheel||e.state.is(lo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var mm=90;function gm(e,t,n){var i=Kt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Gi("span",kp),c=Qr(mm,Xt(p,!1));function u(){l&&(w(!t.Autoplay.isPaused()),$t(r,ml,!0),d.textContent="…",o(ks,Xt(w,!0)),o(As,Xt(w,!1)),o([co,Li],Xt(p,!0)))}function p(m){$t(r,pl,m),m?(Uo(r,d),c.start()):(Ti(d),c.cancel())}function x(){Mn(r,[ul,ml,pl]),Ti(d)}function w(m){l&&$t(r,ul,m?"off":"polite")}return{mount:u,disable:w,destroy:x}}var hm=Object.freeze({__proto__:null,Media:Cp,Direction:$p,Elements:Hp,Slides:Op,Layout:Bp,Clones:jp,Move:Vp,Controller:Gp,Arrows:qp,Autoplay:Kp,Cover:Zp,Scroll:im,Drag:om,Keyboard:am,LazyLoad:lm,Pagination:cm,Sync:um,Wheel:pm,Live:gm}),fm={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"},ym={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:_p,i18n:fm,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function xm(e,t,n){var i=t.Slides;function o(){Kt(e).on([si,en],r)}function r(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),jc(c)}return{mount:o,start:l,cancel:Ka}}function vm(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Xt(wn,l,"transition"),c;function u(){Kt(e).bind(l,"transitionend",function(m){m.target===l&&c&&(x(),c())})}function p(m,h){var f=i.toPosition(m,!0),v=i.getPosition(),C=w(m);dn(f-v)>=1&&C>=1?n.useScroll?r.scroll(f,C,!1,h):(d("transform "+C+"ms "+n.easing),i.translate(f,!0),c=h):(i.jump(m),h())}function x(){d(""),r.cancel()}function w(m){var h=n.rewindSpeed;if(e.is(Zi)&&h){var f=o.getIndex(!0),v=o.getEnd();if(f===0&&m>=v||f>=v&&m===0)return h}return n.speed}return{mount:u,start:p,cancel:x}}var bm=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=wp(Bi),this.splides=[],this._o={},this._E={};var o=ni(n)?Uc(document,n):n;Ro(o,o+" is invalid."),this.root=o,i=qn({label:Sn(o,yn)||"",labelledby:Sn(o,_s)||""},ym,e.defaults,i||{});try{qn(i,JSON.parse(Sn(o,Rs)))}catch{Ro(!1,"Invalid JSON")}this._o=Object.create(qn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;Ro(l.is([Bi,_r]),"Already mounted!"),l.set(Bi),this._C=d,this._T=o||this._T||(this.is(Qo)?xm:vm),this._E=i||this._E;var c=Fo({},hm,this._E,{Transition:this._T});return Ci(c,function(u,p){var x=u(r,d,r._o);d[p]=x,x.setup&&x.setup()}),Ci(d,function(u){u.mount&&u.mount()}),this.emit(si),En(this.root,Ap),l.set(Ui),this.emit(es),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Ui)&&(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(ai(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(en),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(Bi)?Kt(this).on(es,this.destroy.bind(this,i)):(Ci(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Es),o.destroy(),i&&On(this.splides),r.set(_r)),this},fp(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})(),Os=bm;Os.defaults={};Os.STATES=xp;var yl=[[si,"onMounted"],[es,"onReady"],[Bn,"onMove"],[co,"onMoved"],[Ps,"onClick"],[Jc,"onActive"],[Qc,"onInactive"],[ed,"onVisible"],[td,"onHidden"],[en,"onRefresh"],[ln,"onUpdated"],[Ki,"onResize"],[Zr,"onResized"],[nd,"onDrag"],[id,"onDragging"],[od,"onDragged"],[Jr,"onScroll"],[Li,"onScrolled"],[Es,"onDestroy"],[rd,"onArrowsMounted"],[ad,"onArrowsUpdated"],[sd,"onPaginationMounted"],[ld,"onPaginationUpdated"],[Ms,"onNavigationMounted"],[ks,"onAutoplayPlay"],[cd,"onAutoplayPlaying"],[As,"onAutoplayPause"],[Fs,"onLazyLoadLoaded"]];function Bs(...e){return e.filter(Boolean).join(" ")}function Dr(e){return e!==null&&typeof e=="object"}function is(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!is(n,t[i]));if(Dr(e)&&Dr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!is(e[o],t[o]))}return e===t}function wm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Sm(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 os(e,t){const n=e;return Sm(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Dr(i)?n[o]=os(Dr(n[o])?n[o]:{},i):n[o]=i}),n}var Cm=({children:e,className:t,...n})=>s.createElement("div",{className:Bs("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),zs=class extends s.Component{constructor(){super(...arguments),this.splideRef=s.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Os(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=os({},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&&!is(this.options,e)&&(this.splide.options=e,this.options=os({},e));const t=this.getSlides();wm(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){yl.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 s.createElement(t,{className:Bs("splide",e),ref:this.splideRef,...this.omit(o,["options",...yl.map(r=>r[1])])},n?s.createElement(Cm,null,i):i)}},js=({children:e,className:t,...n})=>s.createElement("li",{className:Bs("splide__slide",t),...n},e);/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),pt=require("classnames"),O=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),zn=require("react-dom");function Tu(e){return e.type==="object"&&e.version===1}const Iu="ControlSlider-module__wrapper___sHEkd",Ru="ControlSlider-module__hoverArrow___A-dOH",Lu="ControlSlider-module__sliderItem___QQSkR",Pu="ControlSlider-module__sliderImage___9hRl-",Eu="ControlSlider-module__arrow___05ghY",Mu="ControlSlider-module__arrowVertical___tBfVN",ku="ControlSlider-module__nextArrow___-30Yc",Au="ControlSlider-module__arrowInner___aEra3",Fu="ControlSlider-module__arrowIcon___S4ztF",_u="ControlSlider-module__arrowImg___2dwJW",Nu="ControlSlider-module__mirror___brd6U",Wu="ControlSlider-module__pagination___bicLF",Hu="ControlSlider-module__paginationInner___bT-P-",Du="ControlSlider-module__paginationVertical___zYqKw",Ou="ControlSlider-module__paginationItem___nTRbk",Bu="ControlSlider-module__dot___p1Qun",zu="ControlSlider-module__activeDot___LHFaj",ju="ControlSlider-module__paginationInsideBottom___R3FWn",Vu="ControlSlider-module__paginationInsideTop___V-qb-",Gu="ControlSlider-module__paginationOutsideBottom___14w8D",Xu="ControlSlider-module__paginationOutsideTop___SCLqB",Yu="ControlSlider-module__paginationInsideLeft___yOBRZ",qu="ControlSlider-module__paginationInsideRight___Rtt3o",Uu="ControlSlider-module__paginationOutsideLeft___lahaw",Ku="ControlSlider-module__paginationOutsideRight___EtuQa",Zu="ControlSlider-module__imgWrapper___UjEgB",Ju="ControlSlider-module__captionBlock___dJ6-j",Qu="ControlSlider-module__captionTextWrapper___HFlpf",ep="ControlSlider-module__captionText___uGBVc",tp="ControlSlider-module__active___WZK4G",np="ControlSlider-module__withPointerEvents___t-18M",ip="ControlSlider-module__topLeftAlignment___zjnGM",op="ControlSlider-module__topCenterAlignment___gD1xW",rp="ControlSlider-module__topRightAlignment___NMapS",ap="ControlSlider-module__middleLeftAlignment___OnUrY",sp="ControlSlider-module__middleCenterAlignment___Tdkl0",lp="ControlSlider-module__middleRightAlignment___wEbfX",cp="ControlSlider-module__bottomLeftAlignment___cTP2-",dp="ControlSlider-module__bottomCenterAlignment___c54fB",up="ControlSlider-module__bottomRightAlignment___kEwrz",pp="ControlSlider-module__clickOverlay___DZA28",mp="ControlSlider-module__contain___pLyq7",gp="ControlSlider-module__cover___KdDat",ut={wrapper:Iu,hoverArrow:Ru,sliderItem:Lu,sliderImage:Pu,arrow:Eu,arrowVertical:Mu,nextArrow:ku,arrowInner:Au,arrowIcon:Fu,arrowImg:_u,mirror:Nu,pagination:Wu,paginationInner:Hu,paginationVertical:Du,paginationItem:Ou,dot:Bu,activeDot:zu,paginationInsideBottom:ju,paginationInsideTop:Vu,paginationOutsideBottom:Gu,paginationOutsideTop:Xu,paginationInsideLeft:Yu,paginationInsideRight:qu,paginationOutsideLeft:Uu,paginationOutsideRight:Ku,imgWrapper:Zu,captionBlock:Ju,captionTextWrapper:Qu,captionText:ep,active:tp,withPointerEvents:np,topLeftAlignment:ip,topCenterAlignment:op,topRightAlignment:rp,middleLeftAlignment:ap,middleCenterAlignment:sp,middleRightAlignment:lp,bottomLeftAlignment:cp,bottomCenterAlignment:dp,bottomRightAlignment:up,clickOverlay:pp,contain:mp,cover:gp};function hp(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 fp(e,t,n){return t&&hp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ol="(prefers-reduced-motion: reduce)",Bi=1,yp=2,Ui=3,lo=4,Xo=5,Ir=6,_r=7,xp={CREATED:Bi,MOUNTED:yp,IDLE:Ui,MOVING:lo,SCROLLING:Xo,DRAGGING:Ir,DESTROYED:_r};function On(e){e.length=0}function ai(e,t,n){return Array.prototype.slice.call(e,t,n)}function Xt(e){return e.bind.apply(e,[null].concat(ai(arguments,1)))}var jc=setTimeout,Ka=function(){};function rl(e){return requestAnimationFrame(e)}function Kr(e,t){return typeof t===e}function Mo(e){return!Cs(e)&&Kr("object",e)}var Ss=Array.isArray,Vc=Xt(Kr,"function"),ni=Xt(Kr,"string"),Yo=Xt(Kr,"undefined");function Cs(e){return e===null}function Gc(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function qo(e){return Ss(e)?e:[e]}function vn(e,t){qo(e).forEach(t)}function $s(e,t){return e.indexOf(t)>-1}function Rr(e,t){return e.push.apply(e,qo(t)),e}function _n(e,t,n){e&&vn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function En(e,t){_n(e,ni(t)?t.split(" "):t,!0)}function Uo(e,t){vn(t,e.appendChild.bind(e))}function Ts(e,t){vn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ko(e,t){return Gc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Xc(e,t){var n=e?ai(e.children):[];return t?n.filter(function(i){return ko(i,t)}):n}function Ko(e,t){return t?Xc(e,t)[0]:e.firstElementChild}var Ao=Object.keys;function Ci(e,t,n){return e&&(n?Ao(e).reverse():Ao(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Fo(e){return ai(arguments,1).forEach(function(t){Ci(t,function(n,i){e[i]=t[i]})}),e}function qn(e){return ai(arguments,1).forEach(function(t){Ci(t,function(n,i){Ss(n)?e[i]=n.slice():Mo(n)?e[i]=qn({},Mo(e[i])?e[i]:{},n):e[i]=n})}),e}function al(e,t){vn(t||Ao(e),function(n){delete e[n]})}function Mn(e,t){vn(e,function(n){vn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){Mo(t)?Ci(t,function(i,o){$t(e,o,i)}):vn(e,function(i){Cs(n)||n===""?Mn(i,t):i.setAttribute(t,String(n))})}function Gi(e,t,n){var i=document.createElement(e);return t&&(ni(t)?En(i,t):$t(i,t)),n&&Uo(n,i),i}function wn(e,t,n){if(Yo(n))return getComputedStyle(e)[t];Cs(n)||(e.style[t]=""+n)}function _o(e,t){wn(e,"display",t)}function Yc(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Sn(e,t){return e.getAttribute(t)}function sl(e,t){return e&&e.classList.contains(t)}function hn(e){return e.getBoundingClientRect()}function Ti(e){vn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function qc(e){return Ko(new DOMParser().parseFromString(e,"text/html").body)}function Fn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Uc(e,t){return e&&e.querySelector(t)}function Is(e,t){return t?ai(e.querySelectorAll(t)):[]}function Nn(e,t){_n(e,t,!1)}function Za(e){return e.timeStamp}function pi(e){return ni(e)?e:e?e+"px":""}var Zo="splide",Rs="data-"+Zo;function Ro(e,t){if(!e)throw new Error("["+Zo+"] "+(t||""))}var ii=Math.min,Nr=Math.max,Wr=Math.floor,No=Math.ceil,dn=Math.abs;function Kc(e,t,n){return dn(e-t)<n}function Lr(e,t,n,i){var o=ii(t,n),r=Nr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Wi(e,t,n){var i=ii(t,n),o=Nr(t,n);return ii(Nr(i,e),o)}function Ja(e){return+(e>0)-+(e<0)}function Qa(e,t){return vn(t,function(n){e=e.replace("%s",""+n)}),e}function Ls(e){return e<10?"0"+e:""+e}var ll={};function vp(e){return""+e+Ls(ll[e]=(ll[e]||0)+1)}function Zc(){var e=[];function t(l,d,c,u){o(l,d,function(p,x,w){var m="addEventListener"in p,h=m?p.removeEventListener.bind(p,x,c,u):p.removeListener.bind(p,c);m?p.addEventListener(x,c,u):p.addListener(c),e.push([p,x,w,c,h])})}function n(l,d,c){o(l,d,function(u,p,x){e=e.filter(function(w){return w[0]===u&&w[1]===p&&w[2]===x&&(!c||w[3]===c)?(w[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){vn(l,function(u){u&&vn(d,function(p){p.split(" ").forEach(function(x){var w=x.split(".");c(u,w[0],w[1])})})})}function r(){e.forEach(function(l){l[4]()}),On(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var si="mounted",es="ready",Bn="move",co="moved",Ps="click",Jc="active",Qc="inactive",ed="visible",td="hidden",en="refresh",ln="updated",Ki="resize",Zr="resized",nd="drag",id="dragging",od="dragged",Jr="scroll",Li="scrolled",bp="overflow",Es="destroy",rd="arrows:mounted",ad="arrows:updated",sd="pagination:mounted",ld="pagination:updated",Ms="navigation:mounted",ks="autoplay:play",cd="autoplay:playing",As="autoplay:pause",Fs="lazyload:loaded",dd="sk",ud="sh",Hr="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Zc();function i(r,l){n.bind(t,qo(r).join(" "),function(d){l.apply(l,Ss(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ai(arguments,1))}return e&&e.event.on(Es,n.destroy),Fo(n,{bus:t,on:i,off:Xt(n.unbind,t),emit:o})}function Qr(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?ii((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return w();d=rl(p)}}function x(C){C||h(),r=o()-(C?l*e:0),c=!1,d=rl(p)}function w(){c=!0}function m(){r=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(C){e=C}function v(){return c}return{start:x,rewind:m,pause:w,cancel:h,set:f,isPaused:v}}function wp(e){var t=e;function n(o){t=o}function i(o){return $s(qo(o),t)}return{set:n,is:i}}function Sp(e,t){var n=Qr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Cp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Zc(),d=[];function c(){var h=n.mediaQuery==="min";Ao(o).sort(function(f,v){return h?+f-+v:+v-+f}).forEach(function(f){p(o[f],"("+(h?"min":"max")+"-width:"+f+"px)")}),p(r,ol),x()}function u(h){h&&l.destroy()}function p(h,f){var v=matchMedia(f);l.bind(v,"change",x),d.push([h,v])}function x(){var h=i.is(_r),f=n.direction,v=d.reduce(function(C,y){return qn(C,y[1].matches?y[0]:{})},{});al(n),m(v),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function w(h){matchMedia(ol).matches&&(h?qn(n,r):al(n,Ao(r)))}function m(h,f,v){qn(n,h),f&&qn(Object.getPrototypeOf(n),h),(v||!i.is(Bi))&&e.emit(ln,n)}return{setup:c,destroy:u,reduce:w,set:m}}var ea="Arrow",ta=ea+"Left",na=ea+"Right",pd=ea+"Up",md=ea+"Down",cl="rtl",ia="ttb",fa={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[pd,na],ArrowRight:[md,ta]};function $p(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===cl&&!l?1:d===ia?0:-1;return fa[r]&&fa[r][c]||r.replace(/width|left|right/i,function(u,p){var x=fa[u.toLowerCase()][c]||u;return p>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(r){return r*(n.direction===cl?1:-1)}return{resolve:i,orient:o}}var Wn="role",Xi="tabindex",Tp="disabled",Cn="aria-",Jo=Cn+"controls",gd=Cn+"current",dl=Cn+"selected",yn=Cn+"label",_s=Cn+"labelledby",hd=Cn+"hidden",Ns=Cn+"orientation",Wo=Cn+"roledescription",ul=Cn+"live",pl=Cn+"busy",ml=Cn+"atomic",Ws=[Wn,Xi,Tp,Jo,gd,yn,_s,hd,Ns,Wo],kn=Zo+"__",li="is-",ya=Zo,gl=kn+"track",Ip=kn+"list",oa=kn+"slide",fd=oa+"--clone",Rp=oa+"__container",Hs=kn+"arrows",ra=kn+"arrow",yd=ra+"--prev",xd=ra+"--next",aa=kn+"pagination",vd=aa+"__page",Lp=kn+"progress",Pp=Lp+"__bar",Ep=kn+"toggle",Mp=kn+"spinner",kp=kn+"sr",Ap=li+"initialized",Ii=li+"active",bd=li+"prev",wd=li+"next",ts=li+"visible",ns=li+"loading",Sd=li+"focus-in",Cd=li+"overflow",Fp=[Ii,ts,bd,wd,ns,Sd,Cd],_p={slide:oa,clone:fd,arrows:Hs,arrow:ra,prev:yd,next:xd,pagination:aa,page:vd,spinner:Mp};function Np(e,t){if(Vc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ko(n,t);)n=n.parentElement;return n}var Wp=5,hl=200,$d="touchstart mousedown",xa="touchmove mousemove",va="touchend touchcancel mouseup click";function Hp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],x=[],w,m,h;function f(){S(),G(),y()}function v(){o(en,C),o(en,f),o(ln,y),r(document,$d+" keydown",function(H){h=H.type==="keydown"},{capture:!0}),r(l,"focusin",function(){_n(l,Sd,!!h)})}function C(H){var I=Ws.concat("style");On(u),Nn(l,p),Nn(w,x),Mn([w,m],I),Mn(l,H?I:["style",Wo])}function y(){Nn(l,p),Nn(w,x),p=U(ya),x=U(gl),En(l,p),En(w,x),$t(l,yn,n.label),$t(l,_s,n.labelledby)}function S(){w=W("."+gl),m=Ko(w,"."+Ip),Ro(w&&m,"A track/list element is missing."),Rr(u,Xc(m,"."+oa+":not(."+fd+")")),Ci({arrows:Hs,pagination:aa,prev:yd,next:xd,bar:Pp,toggle:Ep},function(H,I){c[I]=W("."+H)}),Fo(c,{root:l,track:w,list:m,slides:u})}function G(){var H=l.id||vp(Zo),I=n.role;l.id=H,w.id=w.id||H+"-track",m.id=m.id||H+"-list",!Sn(l,Wn)&&l.tagName!=="SECTION"&&I&&$t(l,Wn,I),$t(l,Wo,d.carousel),$t(m,Wn,"presentation")}function W(H){var I=Uc(l,H);return I&&Np(I,"."+ya)===l?I:void 0}function U(H){return[H+"--"+n.type,H+"--"+n.direction,n.drag&&H+"--draggable",n.isNavigation&&H+"--nav",H===ya&&Ii]}return Fo(c,{setup:f,mount:v,destroy:C})}var Zi="slide",uo="loop",Qo="fade";function Dp(e,t,n,i){var o=Kt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,x=p.isNavigation,w=p.updateOnMove,m=p.i18n,h=p.pagination,f=p.slideFocus,v=c.Direction.resolve,C=Sn(i,"style"),y=Sn(i,yn),S=n>-1,G=Ko(i,"."+Rp),W;function U(){S||(i.id=u.id+"-slide"+Ls(t+1),$t(i,Wn,h?"tabpanel":"group"),$t(i,Wo,m.slide),$t(i,yn,y||Qa(m.slideLabel,[t+1,e.length]))),H()}function H(){d(i,"click",Xt(l,Ps,ie)),d(i,"keydown",Xt(l,dd,ie)),r([co,ud,Li],T),r(Ms,z),w&&r(Bn,$)}function I(){W=!0,o.destroy(),Nn(i,Fp),Mn(i,Ws),$t(i,"style",C),$t(i,yn,y||"")}function z(){var L=e.splides.map(function(B){var K=B.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");$t(i,yn,Qa(m.slideX,(S?n:t)+1)),$t(i,Jo,L),$t(i,Wn,f?"button":""),f&&Mn(i,Wo)}function $(){W||T()}function T(){if(!W){var L=e.index;k(),_(),_n(i,bd,t===L-1),_n(i,wd,t===L+1)}}function k(){var L=D();L!==sl(i,Ii)&&(_n(i,Ii,L),$t(i,gd,x&&L||""),l(L?Jc:Qc,ie))}function _(){var L=P(),B=!L&&(!D()||S);if(e.state.is([lo,Xo])||$t(i,hd,B||""),$t(Is(i,p.focusableNodes||""),Xi,B?-1:""),f&&$t(i,Xi,B?-1:0),L!==sl(i,ts)&&(_n(i,ts,L),l(L?ed:td,ie)),!L&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&Yc(K.slide)}}function g(L,B,K){wn(K&&G||i,L,B)}function D(){var L=e.index;return L===t||p.cloneStatus&&L===n}function P(){if(e.is(Qo))return D();var L=hn(c.Elements.track),B=hn(i),K=v("left",!0),ue=v("right",!0);return Wr(L[K])<=No(B[K])&&Wr(B[ue])<=No(L[ue])}function q(L,B){var K=dn(L-t);return!S&&(p.rewind||e.is(uo))&&(K=ii(K,e.length-K)),K<=B}var ie={index:t,slideIndex:n,slide:i,container:G,isClone:S,mount:U,destroy:I,update:T,style:g,isWithin:q};return ie}function Op(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function x(){w(),o(en,m),o(en,w)}function w(){c.forEach(function(T,k){f(T,k,-1)})}function m(){W(function(T){T.destroy()}),On(p)}function h(){W(function(T){T.update()})}function f(T,k,_){var g=Dp(e,k,_,T);g.mount(),p.push(g),p.sort(function(D,P){return D.index-P.index})}function v(T){return T?U(function(k){return!k.isClone}):p}function C(T){var k=t.Controller,_=k.toIndex(T),g=k.hasFocus()?1:n.perPage;return U(function(D){return Lr(D.index,_,_+g-1)})}function y(T){return U(T)[0]}function S(T,k){vn(T,function(_){if(ni(_)&&(_=qc(_)),Gc(_)){var g=c[k];g?Ts(_,g):Uo(u,_),En(_,n.classes.slide),I(_,Xt(r,Ki))}}),r(en)}function G(T){Ti(U(T).map(function(k){return k.slide})),r(en)}function W(T,k){v(k).forEach(T)}function U(T){return p.filter(Vc(T)?T:function(k){return ni(T)?ko(k.slide,T):$s(qo(T),k.index)})}function H(T,k,_){W(function(g){g.style(T,k,_)})}function I(T,k){var _=Is(T,"img"),g=_.length;g?_.forEach(function(D){l(D,"load error",function(){--g||k()})}):k()}function z(T){return T?c.length:p.length}function $(){return p.length>n.perPage}return{mount:x,destroy:m,update:h,register:f,get:v,getIn:C,getAt:y,add:S,remove:G,forEach:W,filter:U,style:H,getLength:z,isEnough:$}}function Bp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,x=u.track,w=u.list,m=d.getAt,h=d.style,f,v,C;function y(){S(),r(window,"resize load",Sp(Xt(l,Ki))),o([ln,en],S),o(Ki,G)}function S(){f=n.direction===ia,wn(p,"maxWidth",pi(n.width)),wn(x,c("paddingLeft"),W(!1)),wn(x,c("paddingRight"),W(!0)),G(!0)}function G(ie){var L=hn(p);(ie||v.width!==L.width||v.height!==L.height)&&(wn(x,"height",U()),h(c("marginRight"),pi(n.gap)),h("width",I()),h("height",z(),!0),v=L,l(Zr),C!==(C=q())&&(_n(p,Cd,C),l(bp,C)))}function W(ie){var L=n.padding,B=c(ie?"right":"left");return L&&pi(L[B]||(Mo(L)?0:L))||"0px"}function U(){var ie="";return f&&(ie=H(),Ro(ie,"height or heightRatio is missing."),ie="calc("+ie+" - "+W(!1)+" - "+W(!0)+")"),ie}function H(){return pi(n.height||hn(w).width*n.heightRatio)}function I(){return n.autoWidth?null:pi(n.fixedWidth)||(f?"":$())}function z(){return pi(n.fixedHeight)||(f?n.autoHeight?null:$():H())}function $(){var ie=pi(n.gap);return"calc((100%"+(ie&&" + "+ie)+")/"+(n.perPage||1)+(ie&&" - "+ie)+")"}function T(){return hn(w)[c("width")]}function k(ie,L){var B=m(ie||0);return B?hn(B.slide)[c("width")]+(L?0:D()):0}function _(ie,L){var B=m(ie);if(B){var K=hn(B.slide)[c("right")],ue=hn(w)[c("left")];return dn(K-ue)+(L?0:D())}return 0}function g(ie){return _(e.length-1)-_(0)+k(0,ie)}function D(){var ie=m(0);return ie&&parseFloat(wn(ie.slide,c("marginRight")))||0}function P(ie){return parseFloat(wn(x,c("padding"+(ie?"Right":"Left"))))||0}function q(){return e.is(Qo)||g(!0)>T()}return{mount:y,resize:G,listSize:T,slideSize:k,sliderSize:g,totalSize:_,getPadding:P,isOverflow:q}}var zp=2;function jp(e,t,n){var i=Kt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(en,x),o([ln,Ki],m),(u=v())&&(h(u),t.Layout.resize(!0))}function x(){w(),p()}function w(){Ti(c),On(c),i.destroy()}function m(){var C=v();u!==C&&(u<C||!C)&&i.emit(en)}function h(C){var y=l.get().slice(),S=y.length;if(S){for(;y.length<C;)Rr(y,y);Rr(y.slice(-C),y.slice(0,C)).forEach(function(G,W){var U=W<C,H=f(G.slide,W);U?Ts(H,y[0].slide):Uo(r.list,H),Rr(c,H),l.register(H,W-C+(U?0:S),G.index)})}}function f(C,y){var S=C.cloneNode(!0);return En(S,n.classes.clone),S.id=e.root.id+"-clone"+Ls(y+1),S}function v(){var C=n.clones;if(!e.is(uo))C=0;else if(Yo(C)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=y&&No(hn(r.track)[d("width")]/y);C=S||n[d("autoWidth")]&&e.length||n.perPage*zp}return C}return{mount:p,destroy:w}}function Vp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,x=d.listSize,w=d.sliderSize,m=t.Direction,h=m.resolve,f=m.orient,v=t.Elements,C=v.list,y=v.track,S;function G(){S=t.Transition,o([si,Zr,ln,en],W)}function W(){t.Controller.isBusy()||(t.Scroll.cancel(),H(e.index),t.Slides.update())}function U(B,K,ue,le){B!==K&&ie(B>ue)&&(T(),I($(g(),B>ue),!0)),l(lo),r(Bn,K,ue,B),S.start(K,function(){l(Ui),r(co,K,ue,B),le&&le()})}function H(B){I(_(B,!0))}function I(B,K){if(!e.is(Qo)){var ue=K?B:z(B);wn(C,"transform","translate"+h("X")+"("+ue+"px)"),B!==ue&&r(ud)}}function z(B){if(e.is(uo)){var K=k(B),ue=K>t.Controller.getEnd(),le=K<0;(le||ue)&&(B=$(B,ue))}return B}function $(B,K){var ue=B-q(K),le=w();return B-=f(le*(No(dn(ue)/le)||1))*(K?1:-1),B}function T(){I(g(),!0),S.cancel()}function k(B){for(var K=t.Slides.get(),ue=0,le=1/0,F=0;F<K.length;F++){var pe=K[F].index,j=dn(_(pe,!0)-B);if(j<=le)le=j,ue=pe;else break}return ue}function _(B,K){var ue=f(p(B-1)-P(B));return K?D(ue):ue}function g(){var B=h("left");return hn(C)[B]-hn(y)[B]+f(u(!1))}function D(B){return n.trimSpace&&e.is(Zi)&&(B=Wi(B,0,f(w(!0)-x()))),B}function P(B){var K=n.focus;return K==="center"?(x()-c(B,!0))/2:+K*c(B)||0}function q(B){return _(B?t.Controller.getEnd():0,!!n.trimSpace)}function ie(B){var K=f($(g(),B));return B?K>=0:K<=C[h("scrollWidth")]-hn(y)[h("width")]}function L(B,K){K=Yo(K)?g():K;var ue=B!==!0&&f(K)<f(q(!1)),le=B!==!1&&f(K)>f(q(!0));return ue||le}return{mount:G,move:U,jump:H,translate:I,shift:$,cancel:T,toIndex:k,toPosition:_,getPosition:g,getLimit:q,exceededLimit:L,reposition:W}}function Gp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,x=p.isEnough,w=p.getLength,m=n.omitEnd,h=e.is(uo),f=e.is(Zi),v=Xt(g,!1),C=Xt(g,!0),y=n.start||0,S,G=y,W,U,H;function I(){z(),o([ln,en,Hr],z),o(Zr,$)}function z(){W=w(!0),U=n.perMove,H=n.perPage,S=ie();var j=Wi(y,0,m?S:W-1);j!==y&&(y=j,l.reposition())}function $(){S!==ie()&&r(Hr)}function T(j,se,ne){if(!pe()){var ve=_(j),ke=q(ve);ke>-1&&(se||ke!==y)&&(ue(ke),l.move(ve,ke,G,ne))}}function k(j,se,ne,ve){t.Scroll.scroll(j,se,ne,function(){var ke=q(l.toIndex(d()));ue(m?ii(ke,S):ke),ve&&ve()})}function _(j){var se=y;if(ni(j)){var ne=j.match(/([+\-<>])(\d+)?/)||[],ve=ne[1],ke=ne[2];ve==="+"||ve==="-"?se=D(y+ +(""+ve+(+ke||1)),y):ve===">"?se=ke?L(+ke):v(!0):ve==="<"&&(se=C(!0))}else se=h?j:Wi(j,0,S);return se}function g(j,se){var ne=U||(F()?1:H),ve=D(y+ne*(j?-1:1),y,!(U||F()));return ve===-1&&f&&!Kc(d(),c(!j),1)?j?0:S:se?ve:q(ve)}function D(j,se,ne){if(x()||F()){var ve=P(j);ve!==j&&(se=j,j=ve,ne=!1),j<0||j>S?!U&&(Lr(0,j,se,!0)||Lr(S,se,j,!0))?j=L(B(j)):h?j=ne?j<0?-(W%H||H):W:j:n.rewind?j=j<0?S:0:j=-1:ne&&j!==se&&(j=L(B(se)+(j<se?-1:1)))}else j=-1;return j}function P(j){if(f&&n.trimSpace==="move"&&j!==y)for(var se=d();se===u(j,!0)&&Lr(j,0,e.length-1,!n.rewind);)j<y?--j:++j;return j}function q(j){return h?(j+W)%W||0:j}function ie(){for(var j=W-(F()||h&&U?1:H);m&&j-- >0;)if(u(W-1,!0)!==u(j,!0)){j++;break}return Wi(j,0,W-1)}function L(j){return Wi(F()?j:H*j,0,S)}function B(j){return F()?ii(j,S):Wr((j>=S?W-1:j)/H)}function K(j){var se=l.toIndex(j);return f?Wi(se,0,S):se}function ue(j){j!==y&&(G=y,y=j)}function le(j){return j?G:y}function F(){return!Yo(n.focus)||n.isNavigation}function pe(){return e.state.is([lo,Xo])&&!!n.waitForTransition}return{mount:I,go:T,scroll:k,getNext:v,getPrev:C,getAdjacent:g,getEnd:ie,setIndex:ue,getIndex:le,toIndex:L,toPage:B,toDest:K,hasFocus:F,isBusy:pe}}var Xp="http://www.w3.org/2000/svg",Yp="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",sr=40;function qp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,x=u.arrows,w=u.track,m=x,h=u.prev,f=u.next,v,C,y={};function S(){W(),o(ln,G)}function G(){U(),S()}function W(){var k=n.arrows;k&&!(h&&f)&&z(),h&&f&&(Fo(y,{prev:h,next:f}),_o(m,k?"":"none"),En(m,C=Hs+"--"+n.direction),k&&(H(),T(),$t([h,f],Jo,w.id),l(rd,h,f)))}function U(){i.destroy(),Nn(m,C),v?(Ti(x?[h,f]:m),h=f=null):Mn([h,f],Ws)}function H(){o([si,co,en,Li,Hr],T),r(f,"click",Xt(I,">")),r(h,"click",Xt(I,"<"))}function I(k){p.go(k,!0)}function z(){m=x||Gi("div",d.arrows),h=$(!0),f=$(!1),v=!0,Uo(m,[h,f]),!x&&Ts(m,w)}function $(k){var _='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+Xp+'" viewBox="0 0 '+sr+" "+sr+'" width="'+sr+'" height="'+sr+'" focusable="false"><path d="'+(n.arrowPath||Yp)+'" />';return qc(_)}function T(){if(h&&f){var k=e.index,_=p.getPrev(),g=p.getNext(),D=_>-1&&k<_?c.last:c.prev,P=g>-1&&k>g?c.first:c.next;h.disabled=_<0,f.disabled=g<0,$t(h,yn,D),$t(f,yn,P),l(ad,h,f,_,g)}}return{arrows:y,mount:S,destroy:U,update:T}}var Up=Rs+"-interval";function Kp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=Qr(n.interval,e.go.bind(e,">"),H),c=d.isPaused,u=t.Elements,p=t.Elements,x=p.root,w=p.toggle,m=n.autoplay,h,f,v=m==="pause";function C(){m&&(y(),w&&$t(w,Jo,u.track.id),v||S(),U())}function y(){n.pauseOnHover&&r(x,"mouseenter mouseleave",function(z){h=z.type==="mouseenter",W()}),n.pauseOnFocus&&r(x,"focusin focusout",function(z){f=z.type==="focusin",W()}),w&&r(w,"click",function(){v?S():G(!0)}),o([Bn,Jr,en],d.rewind),o(Bn,I)}function S(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=h=v=!1,U(),l(ks))}function G(z){z===void 0&&(z=!0),v=!!z,U(),c()||(d.pause(),l(As))}function W(){v||(h||f?G(!1):S())}function U(){w&&(_n(w,Ii,!v),$t(w,yn,n.i18n[v?"play":"pause"]))}function H(z){var $=u.bar;$&&wn($,"width",z*100+"%"),l(cd,z)}function I(z){var $=t.Slides.getAt(z);d.set($&&+Sn($.slide,Up)||n.interval)}return{mount:C,destroy:d.cancel,play:S,pause:G,isPaused:c}}function Zp(e,t,n){var i=Kt(e),o=i.on;function r(){n.cover&&(o(Fs,Xt(d,!0)),o([si,ln,en],Xt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Ko(u.container||u.slide,"img");p&&p.src&&d(c,p,u)})}function d(c,u,p){p.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),_o(u,c?"none":"")}return{mount:r,destroy:Xt(l,!1)}}var Jp=10,Qp=600,em=.6,tm=1.5,nm=800;function im(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,x=d.translate,w=e.is(Zi),m,h,f=1;function v(){o(Bn,G),o([ln,en],W)}function C(H,I,z,$,T){var k=c();if(G(),z&&(!w||!p())){var _=t.Layout.sliderSize(),g=Ja(H)*_*Wr(dn(H)/_)||0;H=d.toPosition(t.Controller.toDest(H%_))+g}var D=Kc(k,H,1);f=1,I=D?0:I||Nr(dn(H-k)/tm,nm),h=$,m=Qr(I,y,Xt(S,k,H,T),1),l(Xo),r(Jr),m.start()}function y(){l(Ui),h&&h(),r(Li)}function S(H,I,z,$){var T=c(),k=H+(I-H)*U($),_=(k-T)*f;x(T+_),w&&!z&&p()&&(f*=em,dn(_)<Jp&&C(u(p(!0)),Qp,!1,h,!0))}function G(){m&&m.cancel()}function W(){m&&!m.isPaused()&&(G(),y())}function U(H){var I=n.easingFunc;return I?I(H):1-Math.pow(1-H,4)}return{mount:v,destroy:G,scroll:C,cancel:W}}var Hi={passive:!1,capture:!0};function om(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,x=t.Controller,w=t.Elements.track,m=t.Media.reduce,h=t.Direction,f=h.resolve,v=h.orient,C=u.getPosition,y=u.exceededLimit,S,G,W,U,H,I=!1,z,$,T;function k(){l(w,xa,Ka,Hi),l(w,va,Ka,Hi),l(w,$d,g,Hi),l(w,"click",q,{capture:!0}),l(w,"dragstart",Fn),o([si,ln],_)}function _(){var M=n.drag;b(!M),U=M==="free"}function g(M){if(z=!1,!$){var E=ke(M);ve(M.target)&&(E||!M.button)&&(x.isBusy()?Fn(M,!0):(T=E?w:window,H=c.is([lo,Xo]),W=null,l(T,xa,D,Hi),l(T,va,P,Hi),u.cancel(),p.cancel(),ie(M)))}}function D(M){if(c.is(Ir)||(c.set(Ir),r(nd)),M.cancelable)if(H){u.translate(S+ne(F(M)));var E=pe(M)>hl,V=I!==(I=y());(E||V)&&ie(M),z=!0,r(id),Fn(M)}else K(M)&&(H=B(M),Fn(M))}function P(M){c.is(Ir)&&(c.set(Ui),r(od)),H&&(L(M),Fn(M)),d(T,xa,D),d(T,va,P),H=!1}function q(M){!$&&z&&Fn(M,!0)}function ie(M){W=G,G=M,S=C()}function L(M){var E=ue(M),V=le(E),Ce=n.rewind&&n.rewindByDrag;m(!1),U?x.scroll(V,0,n.snap):e.is(Qo)?x.go(v(Ja(E))<0?Ce?"<":"-":Ce?">":"+"):e.is(Zi)&&I&&Ce?x.go(y(!0)?">":"<"):x.go(x.toDest(V),!0),m(!0)}function B(M){var E=n.dragMinThreshold,V=Mo(E),Ce=V&&E.mouse||0,te=(V?E.touch:+E)||10;return dn(F(M))>(ke(M)?te:Ce)}function K(M){return dn(F(M))>dn(F(M,!0))}function ue(M){if(e.is(uo)||!I){var E=pe(M);if(E&&E<hl)return F(M)/E}return 0}function le(M){return C()+Ja(M)*ii(dn(M)*(n.flickPower||600),U?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function F(M,E){return se(M,E)-se(j(M),E)}function pe(M){return Za(M)-Za(j(M))}function j(M){return G===M&&W||G}function se(M,E){return(ke(M)?M.changedTouches[0]:M)["page"+f(E?"Y":"X")]}function ne(M){return M/(I&&e.is(Zi)?Wp:1)}function ve(M){var E=n.noDrag;return!ko(M,"."+vd+", ."+ra)&&(!E||!ko(M,E))}function ke(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}function xe(){return H}function b(M){$=M}return{mount:k,disable:b,isDragging:xe}}var rm={Spacebar:" ",Right:na,Left:ta,Up:pd,Down:md};function Ds(e){return e=ni(e)?e:e.key,rm[e]||e}var fl="keydown";function am(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function x(){w(),o(ln,m),o(ln,w),o(Bn,f)}function w(){var C=n.keyboard;C&&(u=C==="global"?window:d,r(u,fl,v))}function m(){l(u,fl)}function h(C){p=C}function f(){var C=p;p=!0,jc(function(){p=C})}function v(C){if(!p){var y=Ds(C);y===c(ta)?e.go("<"):y===c(na)&&e.go(">")}}return{mount:x,destroy:m,disable:h}}var Lo=Rs+"-lazy",Pr=Lo+"-srcset",sm="["+Lo+"], ["+Pr+"]";function lm(e,t,n){var i=Kt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[co,Li],p=[];function x(){n.lazyLoad&&(w(),o(en,w))}function w(){On(p),m(),c?C():(r(u),o(u,h),h())}function m(){t.Slides.forEach(function(y){Is(y.slide,sm).forEach(function(S){var G=Sn(S,Lo),W=Sn(S,Pr);if(G!==S.src||W!==S.srcset){var U=n.classes.spinner,H=S.parentElement,I=Ko(H,"."+U)||Gi("span",U,H);p.push([S,y,I]),S.src||_o(S,"none")}})})}function h(){p=p.filter(function(y){var S=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,S)?f(y):!0}),p.length||r(u)}function f(y){var S=y[0];En(y[1].slide,ns),l(S,"load error",Xt(v,y)),$t(S,"src",Sn(S,Lo)),$t(S,"srcset",Sn(S,Pr)),Mn(S,Lo),Mn(S,Pr)}function v(y,S){var G=y[0],W=y[1];Nn(W.slide,ns),S.type!=="error"&&(Ti(y[2]),_o(G,""),d(Fs,G,W),d(Ki)),c&&C()}function C(){p.length&&f(p.shift())}return{mount:x,destroy:Xt(On,p),check:h}}function cm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,x=u.getIndex,w=u.go,m=t.Direction.resolve,h=c.pagination,f=[],v,C;function y(){S(),o([ln,en,Hr],y);var $=n.pagination;h&&_o(h,$?"":"none"),$&&(o([Bn,Jr,Li],z),G(),z(),r(sd,{list:v,items:f},I(e.index)))}function S(){v&&(Ti(h?ai(v.children):v),Nn(v,C),On(f),v=null),i.destroy()}function G(){var $=e.length,T=n.classes,k=n.i18n,_=n.perPage,g=p()?u.getEnd()+1:No($/_);v=h||Gi("ul",T.pagination,c.track.parentElement),En(v,C=aa+"--"+H()),$t(v,Wn,"tablist"),$t(v,yn,k.select),$t(v,Ns,H()===ia?"vertical":"");for(var D=0;D<g;D++){var P=Gi("li",null,v),q=Gi("button",{class:T.page,type:"button"},P),ie=d.getIn(D).map(function(B){return B.slide.id}),L=!p()&&_>1?k.pageX:k.slideX;l(q,"click",Xt(W,D)),n.paginationKeyboard&&l(q,"keydown",Xt(U,D)),$t(P,Wn,"presentation"),$t(q,Wn,"tab"),$t(q,Jo,ie.join(" ")),$t(q,yn,Qa(L,D+1)),$t(q,Xi,-1),f.push({li:P,button:q,page:D})}}function W($){w(">"+$,!0)}function U($,T){var k=f.length,_=Ds(T),g=H(),D=-1;_===m(na,!1,g)?D=++$%k:_===m(ta,!1,g)?D=(--$+k)%k:_==="Home"?D=0:_==="End"&&(D=k-1);var P=f[D];P&&(Yc(P.button),w(">"+D),Fn(T,!0))}function H(){return n.paginationDirection||n.direction}function I($){return f[u.toPage($)]}function z(){var $=I(x(!0)),T=I(x());if($){var k=$.button;Nn(k,Ii),Mn(k,dl),$t(k,Xi,-1)}if(T){var _=T.button;En(_,Ii),$t(_,dl,!0),$t(_,Xi,"")}r(ld,{list:v,items:f},$,T)}return{items:f,mount:y,destroy:S,getAt:I,update:z}}var dm=[" ","Enter"];function um(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){r.forEach(function(h){h.destroy()}),On(r)}function c(){d(),l()}function u(h,f){var v=Kt(h);v.on(Bn,function(C,y,S){f.go(f.is(uo)?S:C)}),r.push(v)}function p(){var h=Kt(e),f=h.on;f(Ps,w),f(dd,m),f([si,ln],x),r.push(h),h.emit(Ms,e.splides)}function x(){$t(t.Elements.list,Ns,n.direction===ia?"vertical":"")}function w(h){e.go(h.index)}function m(h,f){$s(dm,Ds(f))&&(w(h),Fn(f))}return{setup:Xt(t.Media.set,{slideFocus:Yo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function pm(e,t,n){var i=Kt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Hi)}function d(u){if(u.cancelable){var p=u.deltaY,x=p<0,w=Za(u),m=n.wheelMinThreshold||0,h=n.wheelSleep||0;dn(p)>m&&w-r>h&&(e.go(x?"<":">"),r=w),c(x)&&Fn(u)}}function c(u){return!n.releaseWheel||e.state.is(lo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var mm=90;function gm(e,t,n){var i=Kt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Gi("span",kp),c=Qr(mm,Xt(p,!1));function u(){l&&(w(!t.Autoplay.isPaused()),$t(r,ml,!0),d.textContent="…",o(ks,Xt(w,!0)),o(As,Xt(w,!1)),o([co,Li],Xt(p,!0)))}function p(m){$t(r,pl,m),m?(Uo(r,d),c.start()):(Ti(d),c.cancel())}function x(){Mn(r,[ul,ml,pl]),Ti(d)}function w(m){l&&$t(r,ul,m?"off":"polite")}return{mount:u,disable:w,destroy:x}}var hm=Object.freeze({__proto__:null,Media:Cp,Direction:$p,Elements:Hp,Slides:Op,Layout:Bp,Clones:jp,Move:Vp,Controller:Gp,Arrows:qp,Autoplay:Kp,Cover:Zp,Scroll:im,Drag:om,Keyboard:am,LazyLoad:lm,Pagination:cm,Sync:um,Wheel:pm,Live:gm}),fm={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"},ym={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:_p,i18n:fm,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function xm(e,t,n){var i=t.Slides;function o(){Kt(e).on([si,en],r)}function r(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),jc(c)}return{mount:o,start:l,cancel:Ka}}function vm(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Xt(wn,l,"transition"),c;function u(){Kt(e).bind(l,"transitionend",function(m){m.target===l&&c&&(x(),c())})}function p(m,h){var f=i.toPosition(m,!0),v=i.getPosition(),C=w(m);dn(f-v)>=1&&C>=1?n.useScroll?r.scroll(f,C,!1,h):(d("transform "+C+"ms "+n.easing),i.translate(f,!0),c=h):(i.jump(m),h())}function x(){d(""),r.cancel()}function w(m){var h=n.rewindSpeed;if(e.is(Zi)&&h){var f=o.getIndex(!0),v=o.getEnd();if(f===0&&m>=v||f>=v&&m===0)return h}return n.speed}return{mount:u,start:p,cancel:x}}var bm=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=wp(Bi),this.splides=[],this._o={},this._E={};var o=ni(n)?Uc(document,n):n;Ro(o,o+" is invalid."),this.root=o,i=qn({label:Sn(o,yn)||"",labelledby:Sn(o,_s)||""},ym,e.defaults,i||{});try{qn(i,JSON.parse(Sn(o,Rs)))}catch{Ro(!1,"Invalid JSON")}this._o=Object.create(qn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;Ro(l.is([Bi,_r]),"Already mounted!"),l.set(Bi),this._C=d,this._T=o||this._T||(this.is(Qo)?xm:vm),this._E=i||this._E;var c=Fo({},hm,this._E,{Transition:this._T});return Ci(c,function(u,p){var x=u(r,d,r._o);d[p]=x,x.setup&&x.setup()}),Ci(d,function(u){u.mount&&u.mount()}),this.emit(si),En(this.root,Ap),l.set(Ui),this.emit(es),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Ui)&&(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(ai(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(en),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(Bi)?Kt(this).on(es,this.destroy.bind(this,i)):(Ci(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Es),o.destroy(),i&&On(this.splides),r.set(_r)),this},fp(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})(),Os=bm;Os.defaults={};Os.STATES=xp;var yl=[[si,"onMounted"],[es,"onReady"],[Bn,"onMove"],[co,"onMoved"],[Ps,"onClick"],[Jc,"onActive"],[Qc,"onInactive"],[ed,"onVisible"],[td,"onHidden"],[en,"onRefresh"],[ln,"onUpdated"],[Ki,"onResize"],[Zr,"onResized"],[nd,"onDrag"],[id,"onDragging"],[od,"onDragged"],[Jr,"onScroll"],[Li,"onScrolled"],[Es,"onDestroy"],[rd,"onArrowsMounted"],[ad,"onArrowsUpdated"],[sd,"onPaginationMounted"],[ld,"onPaginationUpdated"],[Ms,"onNavigationMounted"],[ks,"onAutoplayPlay"],[cd,"onAutoplayPlaying"],[As,"onAutoplayPause"],[Fs,"onLazyLoadLoaded"]];function Bs(...e){return e.filter(Boolean).join(" ")}function Dr(e){return e!==null&&typeof e=="object"}function is(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!is(n,t[i]));if(Dr(e)&&Dr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!is(e[o],t[o]))}return e===t}function wm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Sm(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 os(e,t){const n=e;return Sm(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Dr(i)?n[o]=os(Dr(n[o])?n[o]:{},i):n[o]=i}),n}var Cm=({children:e,className:t,...n})=>s.createElement("div",{className:Bs("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),zs=class extends s.Component{constructor(){super(...arguments),this.splideRef=s.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Os(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=os({},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&&!is(this.options,e)&&(this.splide.options=e,this.options=os({},e));const t=this.getSlides();wm(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){yl.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 s.createElement(t,{className:Bs("splide",e),ref:this.splideRef,...this.omit(o,["options",...yl.map(r=>r[1])])},n?s.createElement(Cm,null,i):i)}},js=({children:e,className:t,...n})=>s.createElement("li",{className:Bs("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 $m="RichTextRenderer-module__link___BWeZ2",Tm={link:$m},Im=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))},po=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Im(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function an(e){const{color:t,...n}=e;return n}function qt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:po(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:D.scalingValue(e.letterSpacing,t),wordSpacing:D.scalingValue(e.wordSpacing,t),fontSize:D.scalingValue(n,t),lineHeight:i!==void 0?D.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Ri=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:Tm.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Rm(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:t(o)},i)})})};function Rm(e){return{...e.fontFamily&&{fontFamily:po(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 Lm="SvgImage-module__svg___q3xE-",Pm="SvgImage-module__img___VsTm-",xl={svg:Lm,img:Pm},Em=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Mm=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,sn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[r,l]=s.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return s.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!Em(e)||!r?a.jsx("img",{src:e,alt:"",className:pt(xl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:pt(xl.svg,i),style:{"--svg":Mm(e),"--fill":t,"--hover-fill":n,...o??{}}})},km={"top-left":ut.topLeftAlignment,"top-center":ut.topCenterAlignment,"top-right":ut.topRightAlignment,"middle-left":ut.middleLeftAlignment,"middle-center":ut.middleCenterAlignment,"middle-right":ut.middleRightAlignment,"bottom-left":ut.bottomLeftAlignment,"bottom-center":ut.bottomCenterAlignment,"bottom-right":ut.bottomRightAlignment};function Am({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:x,textAppearance:w,color:m}=n.imageCaption??{},[h,f]=s.useState(void 0),[v,C]=s.useState(null),[y,S]=s.useState(0),[G,W]=s.useState(0),{direction:U,transition:H,controls:I,pagination:z,imageCaption:$,triggers:T}=e,A=s.useRef(H.type),{x:_,y:g}=e.controls.offset,B=P=>{o&&o.go(P)};return s.useEffect(()=>{if(!v)return;const P=new ResizeObserver(Y=>{if(!o)return;const[ie]=Y;f({width:Math.round(ie.contentRect.width),height:Math.round(ie.contentRect.height)})});return P.observe(v),()=>P.unobserve(v)},[v]),s.useEffect(()=>{!o||A.current===H.type||(W(P=>P+1),A.current=H.type)},[H.type]),a.jsx("div",{className:pt(ut.wrapper,{[ut.editor]:i}),ref:C,children:a.jsxs("div",{className:ut.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:H.backgroundColor&&H.type==="fade in"?H.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:pt(ut.captionBlock),children:a.jsx("div",{className:ut.captionTextWrapper,children:t.map((P,Y)=>a.jsx("div",{className:pt(ut.captionText,km[$.alignment],{[ut.withPointerEvents]:Y===y&&i,[ut.active]:Y===y}),style:{fontFamily:po(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":D.scalingValue(l.width,i),letterSpacing:D.scalingValue(c,i),wordSpacing:D.scalingValue(p,i),textAlign:u,fontSize:D.scalingValue(x.fontSize,i),lineHeight:D.scalingValue(x.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:m,transitionDuration:H.duration?`${Math.round(parseInt(H.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ut.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:D.scalingValue($.offset.y,i),left:D.scalingValue($.offset.x,i)},children:a.jsx(Ri,{content:P.imageCaption})})},Y))})}),a.jsx(zs,{onMove:P=>{S(P.index)},ref:r,options:{arrows:!1,speed:H.duration?parseInt(H.duration):500,autoplay:T.autoPlay!==null,...T.autoPlay!==null&&{interval:parseInt(T.autoPlay)*1e3},direction:U==="horiz"||H.type==="fade in"?"ltr":"ttb",pagination:!1,drag:T.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:H.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((P,Y)=>a.jsx(js,{children:a.jsx("div",{className:ut.sliderItem,children:a.jsx("div",{className:ut.imgWrapper,children:a.jsx("img",{className:pt(ut.sliderImage,{[ut.contain]:P.image.objectFit==="contain",[ut.cover]:P.image.objectFit==="cover"}),src:P.image.url,alt:P.image.name??""})})})},Y))},G),I.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(ut.arrow,{[ut.arrowVertical]:U==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{onClick:()=>{B("-1")},className:ut.arrowInner,style:{transform:`translate(${D.scalingValue(_,i)}, ${D.scalingValue(g*(U==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&a.jsx(sn,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:pt(ut.arrowImg,ut.mirror)}),!I.arrowsImgUrl&&a.jsx(vl,{color:I.color,className:pt(ut.arrowIcon,ut.arrowImg,ut.mirror)})]})}),a.jsx("div",{className:pt(ut.arrow,ut.nextArrow,{[ut.arrowVertical]:U==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:ut.arrowInner,onClick:()=>B("+1"),style:{transform:`translate(${D.scalingValue(_*(U==="horiz"?-1:1),i)}, ${D.scalingValue(g,i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&a.jsx(sn,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:ut.arrowImg}),!I.arrowsImgUrl&&a.jsx(vl,{color:I.color,className:pt(ut.arrowIcon,ut.arrowImg)})]})})]}),T.triggersList.click&&a.jsx("div",{className:ut.clickOverlay,onClick:()=>{o&&o.go("+1")}}),z.isActive&&a.jsx("div",{className:pt(ut.pagination,{[ut.paginationInsideBottom]:z.position==="inside-1"&&U==="horiz",[ut.paginationInsideTop]:z.position==="inside-2"&&U==="horiz",[ut.paginationOutsideBottom]:z.position==="outside-1"&&U==="horiz",[ut.paginationOutsideTop]:z.position==="outside-2"&&U==="horiz",[ut.paginationInsideLeft]:z.position==="inside-1"&&U==="vert",[ut.paginationInsideRight]:z.position==="inside-2"&&U==="vert",[ut.paginationOutsideLeft]:z.position==="outside-1"&&U==="vert",[ut.paginationOutsideRight]:z.position==="outside-2"&&U==="vert",[ut.paginationVertical]:U==="vert"}),children:a.jsx("div",{className:ut.paginationInner,style:{backgroundColor:z.colors[2],transform:`scale(${z.scale/100}) translate(${D.scalingValue(z.offset.x,i)}, ${D.scalingValue(z.offset.y,i)}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:t.map((P,Y)=>a.jsx("button",{onClick:()=>{o&&o.go(Y)},className:pt(ut.paginationItem),children:a.jsx("div",{className:pt(ut.dot,{[ut.activeDot]:Y===y}),style:{backgroundColor:Y===y?z.colors[0]:z.colors[1],"--pagination-hover-color":z.hover}})},Y))})})]})})}function vl({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.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 Fm={element:Am,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"]}},_m="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Nm="ImageRevealSlider-module__image___Qjt-e",Wm="ImageRevealSlider-module__link___N-iLG",Hm="ImageRevealSlider-module__cursor___2U03d",Mi={imageRevealSlider:_m,image:Nm,link:Wm,cursor:Hm};function bl(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const r=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*r,d=r/2,c=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function ba(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Dm(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await ba(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await ba(e);r=l.height/l.width*o}else{const l=await ba(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Om({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[d,c]=s.useState(0),u=s.useRef(0),[p,x]=s.useState({x:0,y:0}),[w,m]=s.useState(1),[h,f]=s.useState("none"),v=s.useRef({x:0,y:0}),[C,y]=s.useState(!1),{sizeType:S,imageWidth:G,randomRangeImageWidth:W}=e.imageSize,{revealPosition:U,visible:H}=e.position,{cursorType:I,target:z,defaultCursorScale:$,defaultCursor:T,hoverCursorScale:A,hoverCursor:_}=e.cursor;s.useEffect(()=>{if(!i)return;const P=(L,O)=>{const K=i.getBoundingClientRect(),ue=L-K.left,le=O-K.top;if(x({x:ue,y:le}),I==="system"){f("none"),m(1);return}const F=ue,pe=le,j=document.elementFromPoint(K.left+F,K.top+pe);if(j&&j.closest("a")){f("none"),m(1);return}const se=bl(F,pe,r)||z==="area"?{img:_??"none",scale:A}:{img:T??"none",scale:$};f(se.img),m(se.scale)},Y=L=>{L.stopPropagation(),v.current={x:L.clientX,y:L.clientY},P(L.clientX,L.clientY)},ie=()=>{C&&P(v.current.x,v.current.y)};return i.addEventListener("mousemove",Y),window.addEventListener("scroll",ie,!0),()=>{i.removeEventListener("mousemove",Y),window.removeEventListener("scroll",ie,!0)}},[i,C,p,I,z,_,T,A,$,r]),s.useEffect(()=>{C||(f("none"),m(0))},[C]);const g=async(P,Y,ie,L={})=>{const{width:O,height:K,finalWidth:ue}=await Dm(P.image.url,S,G,W);let le=0,F=0;U==="same"?(le=Y/2,F=ie/2):(le=L.x??Math.random()*Y,F=L.y??Math.random()*ie);const pe=Math.min(Math.max(le,O/2),Y-O/2),j=Math.min(Math.max(F,K/2),ie-K/2);return{id:u.current++,url:P.image.url,link:P.link,name:P.image.name,x:pe,y:j,width:ue}};s.useEffect(()=>{if(!i||t.length===0)return;const P=i.getBoundingClientRect(),Y=P.width,ie=P.height,L=[];(async()=>{const K=t[0],ue=await g(K,Y,ie);L.push(ue),l(L),c(1)})()},[S,G,W,U,i]),s.useEffect(()=>{H==="last One"&&l(P=>P.length>0?[P[P.length-1]]:[])},[H]);const B=async P=>{if(!i)return;const Y=i.getBoundingClientRect(),ie=P.clientX-Y.left,L=P.clientY-Y.top;if(z==="image"&&!bl(ie,L,r))return;let O=0,K=0;U==="on Click"?(O=ie,K=L):U==="same"?(O=Y.width/2,K=Y.height/2):(O=Math.random()*Y.width,K=Math.random()*Y.height);const ue=t[d],le=await g(ue,Y.width,Y.height,{x:O,y:K});l(F=>H==="all"?[...F,le]:[le]),c(F=>F>=t.length-1?0:F+1)};return a.jsxs("div",{ref:o,onClick:B,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:Mi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[r.map(P=>a.jsx("div",{className:Mi.wrapper,style:{top:`${P.y}px`,left:`${P.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:P.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:z==="area"&&P.link?a.jsx("a",{href:P.link,target:"_blank",className:Mi.link,children:a.jsx("img",{src:P.url,alt:P.name,className:Mi.image},P.id)}):a.jsx("img",{src:P.url,alt:P.name,className:Mi.image},P.id)},P.id)),C&&a.jsx("div",{className:Mi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${w})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Bm={element:Om,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:""}]}}}},zm="LightBox-module__hidden___9s-9x",jm="LightBox-module__heroImage___sTxNF",Vm="LightBox-module__background___rm9ml",Gm="LightBox-module__editor___4ACaY",Xm="LightBox-module__contentStyle___Bgnsq",Ym="LightBox-module__imageStyle___tLIlB",qm="LightBox-module__imgWrapper___LuFUp",Um="LightBox-module__contain___8-yaS",Km="LightBox-module__cover___hNvOG",Zm="LightBox-module__caption___b6L2I",Jm="LightBox-module__captionTextInner___rCGNH",Qm="LightBox-module__lightboxSplide___XFuWC",eg="LightBox-module__arrow___iz38X",tg="LightBox-module__arrowVertical___Zfz81",ng="LightBox-module__nextArrow___zkAQN",ig="LightBox-module__arrowInner___p48sW",og="LightBox-module__arrowIcon___3VaFf",rg="LightBox-module__arrowImg___pNV88",ag="LightBox-module__mirror___pjeXc",sg="LightBox-module__thumbsWrapper___GB-nU",lg="LightBox-module__thumbsContainerVertical___wttk5",cg="LightBox-module__thumbsContainer___osSma",dg="LightBox-module__thumbsAlignStart___MO6tY",ug="LightBox-module__thumbsAlignCenter___Q4sUx",pg="LightBox-module__thumbsAlignEnd___p4y9R",mg="LightBox-module__thumbItem___HvnF3",gg="LightBox-module__closeButton___g2khP",hg="LightBox-module__fadeIn___0m5GW",fg="LightBox-module__slideInLeft___gPYwC",yg="LightBox-module__slideInRight___S-pPp",xg="LightBox-module__slideInTop___DFdAj",vg="LightBox-module__slideInBottom___m27kZ",bg="LightBox-module__fadeOut___55qBR",wg="LightBox-module__slideOutLeft___NvU7P",Sg="LightBox-module__slideOutRight___SK7eC",Cg="LightBox-module__slideOutTop___Vgg0z",$g="LightBox-module__slideOutBottom___nJ0Ef",Tg="LightBox-module__scaleSlide___vZriG",Ke={hidden:zm,heroImage:jm,background:Vm,editor:Gm,contentStyle:Xm,imageStyle:Ym,imgWrapper:qm,contain:Um,cover:Km,caption:Zm,captionTextInner:Jm,lightboxSplide:Qm,arrow:eg,arrowVertical:tg,nextArrow:ng,arrowInner:ig,arrowIcon:og,arrowImg:rg,mirror:ag,thumbsWrapper:sg,thumbsContainerVertical:lg,thumbsContainer:cg,thumbsAlignStart:dg,thumbsAlignCenter:ug,thumbsAlignEnd:pg,thumbItem:mg,closeButton:gg,fadeIn:hg,slideInLeft:fg,slideInRight:yg,slideInTop:xg,slideInBottom:vg,fadeOut:bg,slideOutLeft:wg,slideOutRight:Sg,slideOutTop:Cg,slideOutBottom:$g,scaleSlide:Tg},lr=(e,t,n)=>{const i={},[o,r]=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"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${D.scalingValue(t.x,n)}), calc(-50% + ${D.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${D.scalingValue(t.x,n)}, calc(-50% + ${D.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${D.scalingValue(t.x,n)}), ${D.scalingValue(t.y,n)})`:i.transform=`translate(${D.scalingValue(t.x,n)}, ${D.scalingValue(t.y,n)})`,i};function Td(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 Ig(e){const t=e.trim().split(/\s+/),n=i=>{if(i.endsWith("%"))return parseFloat(i)/100;switch(i){case"left":case"top":return 0;case"right":case"bottom":return 1;case"center":return .5;default:return .5}};if(t.length===1){const i=t[0];return i==="center"?{x:.5,y:.5}:i==="top"||i==="bottom"?{x:.5,y:n(i)}:i==="left"||i==="right"?{x:n(i),y:.5}:{x:n(i),y:.5}}return{x:n(t[0]),y:n(t[1])}}function Id(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const d=e;return{renderedW:d,renderedH:d/r}}const l=t;return{renderedW:l*r,renderedH:l}}function Rg(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const d=t;return{renderedW:d*r,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/r}}function Rd(e,t,n,i,o){const{x:r,y:l}=Ig(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Lg(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height;if(!n||!i)return"center center";const o=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,r=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?Rg:Id,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:x,offsetY:w}=Rd(n,i,u,p,d),m=(x+u/2)/n*100,h=(w+p/2)/i*100;return`${m}% ${h}%`}function Pg(e){return Lg(e)}function Or(e){const t=e.getBoundingClientRect(),n=Td(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),r=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=Id(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:x}=Rd(i,o,d,c,u),w=t.left+n.left,m=t.top+n.top;return{x:p+w,y:x+m,width:d,height:c}}function wl(e){const t=e.getBoundingClientRect(),n=Td(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Sl(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 Eg(e,t){const n=(()=>{if(e==="fade in")return Ke.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ke.slideInLeft;case"right":return Ke.slideInRight;case"top":return Ke.slideInTop;case"bottom":return Ke.slideInBottom;default:return Ke.slideInRight}return Ke.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ke.fadeIn;if(e==="slide in")switch(t){case"left":return Ke.slideInLeft;case"right":return Ke.slideInRight;case"top":return Ke.slideInTop;case"bottom":return Ke.slideInBottom;default:return Ke.slideInRight}return Ke.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ke.fadeOut;if(e==="slide in")switch(t){case"left":return Ke.slideOutLeft;case"right":return Ke.slideOutRight;case"top":return Ke.slideOutTop;case"bottom":return Ke.slideOutBottom;default:return Ke.slideOutRight}return Ke.fadeOut})(),r=(()=>{if(e==="fade in")return Ke.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ke.slideOutLeft;case"right":return Ke.slideOutRight;case"top":return Ke.slideOutTop;case"bottom":return Ke.slideOutBottom;default:return Ke.slideOutRight}return Ke.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Mg=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[d,c]=s.useState(!1),{url:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:Ke.heroImage,onClick:()=>c(!0)}),a.jsx(kg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},kg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var ye;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:x,wordSpacing:w,fontSizeLineHeight:m,textAppearance:h,color:f}=i.imageCaption??{},[v,C]=s.useState(0),[y,S]=s.useState(0),[G,W]=s.useState(!1),[U,H]=s.useState(!1),[I,z]=s.useState({}),$=s.useRef(null),T=s.useRef(null),A=s.useRef(null),_=s.useRef(!1),g=s.useRef(null),B=s.useRef(null),P=s.useRef(null),Y=s.useRef(null),ie=s.useRef(!1),L=s.useRef(null),[O,K]=s.useState(!1),{appear:ue,triggers:le,slider:F,thumbnail:pe,controls:j,area:se,caption:ne,layout:ve}=o.lightboxBlock,{appearClass:Me,backdropAppearClass:xe,backdropDisappearClass:b,disappearClass:M}=Eg(ue.type,ue.direction),E=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const Z=()=>{setTimeout(()=>{var ce,we;(we=(ce=$.current)==null?void 0:ce.splide)==null||we.refresh()},16)},Q=()=>{S(ce=>ce+1)};return window.addEventListener("ArticleEditor.Layout:change",Z),window.addEventListener("ArticleEditor.ComponentContent:change",Q),()=>{window.removeEventListener("ArticleEditor.Layout:change",Z),window.removeEventListener("ArticleEditor.ComponentContent:change",Q)}},[]),s.useEffect(()=>{if(!e||!pe.isActive){K(!1);return}const Z=L.current;if(!Z)return;const Q=()=>{F.direction==="horiz"?K(Z.scrollWidth>Z.clientWidth):K(Z.scrollHeight>Z.clientHeight)};Q();const ce=new ResizeObserver(Q);return ce.observe(Z),()=>ce.disconnect()},[e,pe.isActive,n.length,I,F.direction]);const V=s.useCallback(()=>{const Z=window.matchMedia("(max-width: 768px)").matches,Q=Sl(se.color);Z&&!l&&Q>.9&&(document.body.style.backgroundColor=""),W(!0),_.current=!0;const ce=we=>{we.target===g.current&&we.animationName&&(g.current&&B.current&&g.current.removeEventListener("animationend",B.current),B.current=null,_.current&&(_.current=!1,t()),W(!1))};g.current&&(B.current=ce,g.current.addEventListener("animationend",ce))},[t,se.color,l]),Se=(Z,Q,ce)=>{var we,Pe;if(Z){if(le.type==="click"&&le.switch==="image")le.repeat==="close"&&v===n.length-1?V():(we=$.current)==null||we.go("+1");else if(le.type==="click"&&le.switch==="50/50"){const Ce=Z.getBoundingClientRect(),X=Q-Ce.left,me=ce-Ce.top,ae=Ce.width,q=Ce.height;let de;F.direction==="horiz"?de=X<ae/2?"-1":"+1":de=me<q/2?"-1":"+1",(Pe=$.current)==null||Pe.go(de)}}},te=Z=>{if(ie.current){ie.current=!1;return}const Q=n[v],ce=(Q==null?void 0:Q.image.objectFit)==="cover";let we,Pe;if("changedTouches"in Z&&Z.changedTouches.length>0)we=Z.changedTouches[0].clientX,Pe=Z.changedTouches[0].clientY;else if("clientX"in Z)we=Z.clientX,Pe=Z.clientY;else return;let Ce;if(ce&&A.current){const X=wl(A.current);Ce=we>=X.left&&we<=X.right&&Pe>=X.top&&Pe<=X.bottom}else{const X=A.current?Or(A.current):null;if(!X){Z.target===Z.currentTarget&&V();return}Ce=we>=X.x&&we<=X.x+X.width&&Pe>=X.y&&Pe<=X.y+X.height}Ce?Se(A.current,we,Pe):V()},$e=Z=>{const Q=Z.target;(Q.classList.contains(Ke.thumbsWrapper)||Q.classList.contains(Ke.thumbsContainer))&&te(Z)};s.useEffect(()=>{if(!e)return;const Z=Q=>{var ce,we;if(Q.key==="Escape"){V();return}if(Q.key==="ArrowRight"){C(Pe=>(Pe+1)%Math.max(n.length,1)),(ce=$.current)==null||ce.go("+1");return}Q.key==="ArrowLeft"&&(C(Pe=>(Pe-1+Math.max(n.length,1))%Math.max(n.length,1)),(we=$.current)==null||we.go("-1"))};return window.addEventListener("keydown",Z),()=>{window.removeEventListener("keydown",Z)}},[e,V,n.length]),s.useEffect(()=>{if(e){if(C(0),S(Q=>Q+1),_.current=!1,W(!1),H(!1),z({}),!E)return;const Z=new CustomEvent("page-overlay",{detail:{itemId:E}});window.dispatchEvent(Z)}return()=>{g.current&&B.current&&(g.current.removeEventListener("animationend",B.current),B.current=null),H(!1)}},[e,E]),s.useEffect(()=>{T.current!==null&&T.current!==F.type&&S(Z=>Z+1),T.current=F.type},[F.type]),s.useEffect(()=>{if(!e)return;const Z=document.body.style.overflow,Q=window.matchMedia("(max-width: 768px)").matches,ce=Sl(se.color);document.body.style.overflow="hidden",H(!1);const we=Ce=>{Ce.target===g.current&&!_.current&&Ce.animationName&&(Q&&!l&&ce>.9&&(document.body.style.backgroundColor=se.color),H(!0),g.current&&P.current&&g.current.removeEventListener("animationend",P.current),P.current=null)};g.current&&(P.current=we,g.current.addEventListener("animationend",we));const Pe=Ce=>{const X=Ce.target;X&&(X.closest(`.${Ke.thumbsWrapper}`)||X.closest(`.${Ke.thumbsContainer}`))||F.type!=="slide"&&Ce.preventDefault()};return document.addEventListener("touchmove",Pe,{passive:!1}),()=>{document.body.style.overflow=Z,document.removeEventListener("touchmove",Pe),g.current&&P.current&&(g.current.removeEventListener("animationend",P.current),P.current=null),H(!1)}},[e,l,se.color,F.type]),s.useEffect(()=>{if(!e)return;const Z=Q=>{var we,Pe;if(_.current){Q.stopPropagation();return}if(ie.current){ie.current=!1;return}const ce=Q.target;if(!(ce&&(ce.closest(`.${Ke.thumbsContainer}`)||ce.closest(`.${Ke.thumbItem}`)||ce.closest(`.${Ke.arrow}`)||ce.closest(`.${Ke.closeButton}`)||ce.closest(`.${Ke.caption}`)))){if(F.type==="slide"&&le.type==="drag"&&((Pe=(we=$.current)==null?void 0:we.splide)!=null&&Pe.root)){const Ce=$.current.splide.root;if(ce&&(Ce.contains(ce)||Ce===ce))return}if(Q.touches.length===0&&Q.changedTouches.length>0){const Ce=n[v],X=(Ce==null?void 0:Ce.image.objectFit)==="cover",me=Q.changedTouches[0];let ae;if(X&&A.current){const q=wl(A.current);ae=me.clientX>=q.left&&me.clientX<=q.right&&me.clientY>=q.top&&me.clientY<=q.bottom}else{const q=A.current?Or(A.current):null;if(!q)return;ae=me.clientX>=q.x&&me.clientX<=q.x+q.width&&me.clientY>=q.y&&me.clientY<=q.y+q.height}if(!ae){Q.stopPropagation(),_.current=!0;const q=de=>{de.stopPropagation(),de.preventDefault(),document.removeEventListener("click",q,!0)};document.addEventListener("click",q,!0),V()}}}};return document.addEventListener("touchend",Z,{passive:!0}),()=>{document.removeEventListener("touchend",Z)}},[e,V,v,n]);const re=(F.type==="scale"||F.type==="fade")&&F.direction==="vert"&&le.type==="drag";s.useEffect(()=>{var de,ke;if(!e||!re||!((ke=(de=$.current)==null?void 0:de.splide)!=null&&ke.root))return;const Z=$.current.splide.root,Q=30,ce=(he,J)=>{if(Y.current){const Ne=Math.abs(he-Y.current.x),Fe=Math.abs(J-Y.current.y);(Ne>0||Fe>0)&&(ie.current=!0)}},we=he=>{Y.current&&(he.preventDefault(),ce(he.clientX,he.clientY))},Pe=he=>{Y.current&&he.touches.length>0&&(he.preventDefault(),ce(he.touches[0].clientX,he.touches[0].clientY))},Ce=(he,J)=>{if(!Y.current||!$.current){Y.current=null;return}const Ne=Math.abs(he-Y.current.x),Fe=Math.abs(J-Y.current.y);Fe>Q&&Fe>Ne&&$.current.go(J<Y.current.y?"+1":"-1"),Y.current=null},X=he=>{Y.current&&Ce(he.clientX,he.clientY),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.removeEventListener("pointermove",we)},me=he=>{if(Y.current){if(he.changedTouches.length>0){const J=he.changedTouches[0];Ce(J.clientX,J.clientY)}document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),document.removeEventListener("touchmove",Pe)}},ae=he=>{Y.current={x:he.clientX,y:he.clientY},ie.current=!1,document.addEventListener("pointermove",we,{passive:!1}),document.addEventListener("pointerup",X),document.addEventListener("pointercancel",X)},q=he=>{he.touches.length>0&&(Y.current={x:he.touches[0].clientX,y:he.touches[0].clientY},ie.current=!1,document.addEventListener("touchmove",Pe,{passive:!1}),document.addEventListener("touchend",me),document.addEventListener("touchcancel",me))};return Z.addEventListener("pointerdown",ae),Z.addEventListener("touchstart",q),()=>{Z.removeEventListener("pointerdown",ae),Z.removeEventListener("touchstart",q),document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.removeEventListener("touchmove",Pe),document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),Y.current=null,ie.current=!1}},[e,re,y]);const ge={backgroundColor:se.color,backdropFilter:`blur(${se.blur}px)`,animationDuration:`${parseInt(ue.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:zn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:g,className:pt(Ke.background,G?b:xe,{[Ke.editor]:l},{[Ke.hidden]:!e}),style:{...ge,...U&&!l&&!G?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?g:null,className:pt(Ke.contentStyle,G?M:Me,{[Ke.editor]:l},{[Ke.hidden]:!e}),style:{animationDuration:`${parseInt(ue.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(zs,{onMove:Z=>C(Z.index),ref:$,className:Ke.lightboxSplide,options:{arrows:!1,speed:F.duration?parseInt(F.duration):500,direction:F.direction==="horiz"||F.type==="fade"||F.type==="scale"?"ltr":"ttb",pagination:!1,drag:le.type==="drag"&&!re,perPage:1,width:"100%",height:"100%",type:F.type==="fade"||F.type==="scale"?"fade":"loop",padding:0,rewind:le.repeat!=="close",start:0},style:{"--splide-speed":F.duration},children:n.map((Z,Q)=>{const ce=lr(ve.position,ve.offset,l),we=`${D.scalingValue(ve.padding.top,l)} ${D.scalingValue(ve.padding.right,l)} ${D.scalingValue(ve.padding.bottom,l)} ${D.scalingValue(ve.padding.left,l)}`,Pe=F.type==="scale"?(()=>{const{transform:Ce,...X}=ce;return{...X,position:"absolute",padding:we,boxSizing:"border-box","--position-transform":Ce||"none"}})():{...ce,position:"absolute",padding:we,boxSizing:"border-box"};return a.jsx(js,{children:a.jsx("div",{className:Ke.imgWrapper,onClick:te,children:a.jsx("img",{ref:Q===v?A:null,className:pt(Ke.imageStyle,{[Ke.contain]:Z.image.objectFit==="contain",[Ke.cover]:Z.image.objectFit==="cover",[Ke.scaleSlide]:F.type==="scale"}),src:Z.image.url,alt:Z.image.name??"",style:{...Pe,pointerEvents:Z.image.objectFit==="contain"?"none":"auto"}})})},Q)})},y),j.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(Ke.arrow,{[Ke.arrowVertical]:F.direction==="vert"}),style:{color:j.color,"--arrow-hover-color":j.hover},children:a.jsxs("button",{className:Ke.arrowInner,style:{transform:`translate(${D.scalingValue(j.offset.x,l)}, ${D.scalingValue(j.offset.y*(F.direction==="horiz"?1:-1),l)}) scale(${j.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var Z;return(Z=$.current)==null?void 0:Z.go("-1")},"aria-label":"Previous",children:[j.arrowsImgUrl&&a.jsx(sn,{url:j.arrowsImgUrl,fill:j.color,hoverFill:j.hover,className:pt(Ke.arrowImg,Ke.mirror)}),!j.arrowsImgUrl&&a.jsx(Cl,{color:j.color,className:pt(Ke.arrowIcon,Ke.arrowImg,Ke.mirror)})]})}),a.jsx("div",{className:pt(Ke.arrow,Ke.nextArrow,{[Ke.arrowVertical]:F.direction==="vert"}),style:{color:j.color,"--arrow-hover-color":j.hover},children:a.jsxs("button",{className:Ke.arrowInner,style:{transform:`translate(${D.scalingValue(j.offset.x*(F.direction==="horiz"?-1:1),l)}, ${D.scalingValue(j.offset.y,l)}) scale(${j.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var Z;return(Z=$.current)==null?void 0:Z.go("+1")},"aria-label":"Next",children:[j.arrowsImgUrl&&a.jsx(sn,{url:j.arrowsImgUrl,fill:j.color,hoverFill:j.hover,className:Ke.arrowImg}),!j.arrowsImgUrl&&a.jsx(Cl,{color:j.color,className:pt(Ke.arrowIcon,Ke.arrowImg)})]})})]}),se.closeIconUrl&&(()=>{const Z=lr(se.closeIconAlign,se.closeIconOffset,l),Q=`scale(${se.closeIconScale})`,ce=Z.transform?`${Z.transform} ${Q}`:Q;return a.jsx("button",{className:Ke.closeButton,style:{...Z,transform:ce},onClick:V,"aria-label":"Close lightbox",children:a.jsx(sn,{url:se.closeIconUrl,fill:se.closeIconColor??"#000000",hoverFill:se.closeIconHover??"#cccccc"})})})(),ne&&ne.isActive&&i.imageCaption&&((ye=n[v])==null?void 0:ye.imageCaption)&&a.jsx("div",{className:Ke.caption,style:{...lr(ne.alignment,ne.offset,l),fontFamily:po(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":D.scalingValue(c.width,l),letterSpacing:D.scalingValue(p,l),wordSpacing:D.scalingValue(w,l),textAlign:x,fontSize:D.scalingValue(m.fontSize,l),lineHeight:D.scalingValue(m.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f},onClick:Z=>Z.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Ke.captionTextInner,style:{"--link-color":ne.linkColor,"--link-hover-color":ne.linkHoverColor},children:a.jsx(Ri,{content:n[v].imageCaption})})}),pe.isActive&&(()=>{const[Z,Q]=pe.position.split("-"),ce=F.direction==="horiz"?`${Z}-left`:pe.position,we=lr(ce,pe.offset,l),Pe=()=>{if(F.direction==="horiz"){if(Q==="left")return"flex-start";if(Q==="center")return"center";if(Q==="right")return"flex-end"}else{if(Z==="top")return"flex-start";if(Z==="middle")return"center";if(Z==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:L,className:Ke.thumbsWrapper,onClick:Ce=>$e(Ce),style:{position:l?"absolute":"fixed",...we,...F.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:pt(Ke.thumbsContainer,{[Ke.thumbsContainerVertical]:F.direction==="vert",[Ke.thumbsAlignStart]:pe.align==="start",[Ke.thumbsAlignCenter]:pe.align==="center",[Ke.thumbsAlignEnd]:pe.align==="end"}),style:{gap:D.scalingValue(pe.grid.gap,l),justifyContent:O?"flex-start":Pe()},children:n.map((Ce,X)=>{const me=X===v,ae=I[X],de=pe.grid.size*(me?pe.activeState.scale:1),ke=()=>{if(pe.fit!=="fit")return{};if(!ae)return F.direction==="horiz"?{height:D.scalingValue(de,l)}:{width:D.scalingValue(de,l)};const he=ae.width/ae.height;if(F.direction==="horiz"){const J=de,Ne=J*he;return{width:D.scalingValue(Ne,l),height:D.scalingValue(J,l)}}else{const J=de,Ne=J/he;return{width:D.scalingValue(J,l),height:D.scalingValue(Ne,l)}}};return a.jsx("button",{className:Ke.thumbItem,style:{...F.direction==="horiz"&&pe.fit!=="fit"?{height:D.scalingValue(de,l)}:{},...F.direction==="vert"&&pe.fit!=="fit"?{width:D.scalingValue(de,l)}:{},...pe.fit==="cover"?{width:D.scalingValue(de,l),height:D.scalingValue(de,l)}:{},...ke(),transition:me?"all 0.25s ease-out":"none",opacity:me?pe.activeState.opacity/100:pe.opacity/100,"--thumb-hover":pe.activeState.opacity/100},onClick:he=>{var J;he.stopPropagation(),C(X),(J=$.current)==null||J.go(X)},onMouseEnter:()=>{var he;pe.triggers==="hov"&&((he=$.current)==null||he.go(X))},children:a.jsx("img",{src:Ce.image.url,alt:Ce.image.name??"",onLoad:he=>{const J=he.currentTarget;J.naturalWidth&&J.naturalHeight&&z(Ne=>({...Ne,[X]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:pe.fit==="cover"?"cover":"contain",...pe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...pe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Ce.image.name}-${X}`)})})})})()]})]}),document.getElementById(r))};function Cl({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.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 Ag={element:Mg,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 cr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Fg(e){return`
6
+ */const $m="RichTextRenderer-module__link___BWeZ2",Tm={link:$m},Im=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))},po=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Im(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function an(e){const{color:t,...n}=e;return n}function qt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:po(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:O.scalingValue(e.letterSpacing,t),wordSpacing:O.scalingValue(e.wordSpacing,t),fontSize:O.scalingValue(n,t),lineHeight:i!==void 0?O.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Ri=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:Tm.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Rm(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:t(o)},i)})})};function Rm(e){return{...e.fontFamily&&{fontFamily:po(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 Lm="SvgImage-module__svg___q3xE-",Pm="SvgImage-module__img___VsTm-",xl={svg:Lm,img:Pm},Em=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Mm=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,sn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[r,l]=s.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return s.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!Em(e)||!r?a.jsx("img",{src:e,alt:"",className:pt(xl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:pt(xl.svg,i),style:{"--svg":Mm(e),"--fill":t,"--hover-fill":n,...o??{}}})},km={"top-left":ut.topLeftAlignment,"top-center":ut.topCenterAlignment,"top-right":ut.topRightAlignment,"middle-left":ut.middleLeftAlignment,"middle-center":ut.middleCenterAlignment,"middle-right":ut.middleRightAlignment,"bottom-left":ut.bottomLeftAlignment,"bottom-center":ut.bottomCenterAlignment,"bottom-right":ut.bottomRightAlignment};function Am({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:x,textAppearance:w,color:m}=n.imageCaption??{},[h,f]=s.useState(void 0),[v,C]=s.useState(null),[y,S]=s.useState(0),[G,W]=s.useState(0),{direction:U,transition:H,controls:I,pagination:z,imageCaption:$,triggers:T}=e,k=s.useRef(H.type),{x:_,y:g}=e.controls.offset,D=P=>{o&&o.go(P)};return s.useEffect(()=>{if(!v)return;const P=new ResizeObserver(q=>{if(!o)return;const[ie]=q;f({width:Math.round(ie.contentRect.width),height:Math.round(ie.contentRect.height)})});return P.observe(v),()=>P.unobserve(v)},[v]),s.useEffect(()=>{!o||k.current===H.type||(W(P=>P+1),k.current=H.type)},[H.type]),a.jsx("div",{className:pt(ut.wrapper,{[ut.editor]:i}),ref:C,children:a.jsxs("div",{className:ut.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:H.backgroundColor&&H.type==="fade in"?H.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:pt(ut.captionBlock),children:a.jsx("div",{className:ut.captionTextWrapper,children:t.map((P,q)=>a.jsx("div",{className:pt(ut.captionText,km[$.alignment],{[ut.withPointerEvents]:q===y&&i,[ut.active]:q===y}),style:{fontFamily:po(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":O.scalingValue(l.width,i),letterSpacing:O.scalingValue(c,i),wordSpacing:O.scalingValue(p,i),textAlign:u,fontSize:O.scalingValue(x.fontSize,i),lineHeight:O.scalingValue(x.lineHeight,i),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:m,transitionDuration:H.duration?`${Math.round(parseInt(H.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ut.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:O.scalingValue($.offset.y,i),left:O.scalingValue($.offset.x,i)},children:a.jsx(Ri,{content:P.imageCaption})})},q))})}),a.jsx(zs,{onMove:P=>{S(P.index)},ref:r,options:{arrows:!1,speed:H.duration?parseInt(H.duration):500,autoplay:T.autoPlay!==null,...T.autoPlay!==null&&{interval:parseInt(T.autoPlay)*1e3},direction:U==="horiz"||H.type==="fade in"?"ltr":"ttb",pagination:!1,drag:T.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:H.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((P,q)=>a.jsx(js,{children:a.jsx("div",{className:ut.sliderItem,children:a.jsx("div",{className:ut.imgWrapper,children:a.jsx("img",{className:pt(ut.sliderImage,{[ut.contain]:P.image.objectFit==="contain",[ut.cover]:P.image.objectFit==="cover"}),src:P.image.url,alt:P.image.name??""})})})},q))},G),I.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(ut.arrow,{[ut.arrowVertical]:U==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{onClick:()=>{D("-1")},className:ut.arrowInner,style:{transform:`translate(${O.scalingValue(_,i)}, ${O.scalingValue(g*(U==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&a.jsx(sn,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:pt(ut.arrowImg,ut.mirror)}),!I.arrowsImgUrl&&a.jsx(vl,{color:I.color,className:pt(ut.arrowIcon,ut.arrowImg,ut.mirror)})]})}),a.jsx("div",{className:pt(ut.arrow,ut.nextArrow,{[ut.arrowVertical]:U==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:ut.arrowInner,onClick:()=>D("+1"),style:{transform:`translate(${O.scalingValue(_*(U==="horiz"?-1:1),i)}, ${O.scalingValue(g,i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&a.jsx(sn,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:ut.arrowImg}),!I.arrowsImgUrl&&a.jsx(vl,{color:I.color,className:pt(ut.arrowIcon,ut.arrowImg)})]})})]}),T.triggersList.click&&a.jsx("div",{className:ut.clickOverlay,onClick:()=>{o&&o.go("+1")}}),z.isActive&&a.jsx("div",{className:pt(ut.pagination,{[ut.paginationInsideBottom]:z.position==="inside-1"&&U==="horiz",[ut.paginationInsideTop]:z.position==="inside-2"&&U==="horiz",[ut.paginationOutsideBottom]:z.position==="outside-1"&&U==="horiz",[ut.paginationOutsideTop]:z.position==="outside-2"&&U==="horiz",[ut.paginationInsideLeft]:z.position==="inside-1"&&U==="vert",[ut.paginationInsideRight]:z.position==="inside-2"&&U==="vert",[ut.paginationOutsideLeft]:z.position==="outside-1"&&U==="vert",[ut.paginationOutsideRight]:z.position==="outside-2"&&U==="vert",[ut.paginationVertical]:U==="vert"}),children:a.jsx("div",{className:ut.paginationInner,style:{backgroundColor:z.colors[2],transform:`scale(${z.scale/100}) translate(${O.scalingValue(z.offset.x,i)}, ${O.scalingValue(z.offset.y,i)}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:t.map((P,q)=>a.jsx("button",{onClick:()=>{o&&o.go(q)},className:pt(ut.paginationItem),children:a.jsx("div",{className:pt(ut.dot,{[ut.activeDot]:q===y}),style:{backgroundColor:q===y?z.colors[0]:z.colors[1],"--pagination-hover-color":z.hover}})},q))})})]})})}function vl({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.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 Fm={element:Am,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"]}},_m="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Nm="ImageRevealSlider-module__image___Qjt-e",Wm="ImageRevealSlider-module__link___N-iLG",Hm="ImageRevealSlider-module__cursor___2U03d",Mi={imageRevealSlider:_m,image:Nm,link:Wm,cursor:Hm};function bl(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const r=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*r,d=r/2,c=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function ba(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Dm(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await ba(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await ba(e);r=l.height/l.width*o}else{const l=await ba(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Om({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[d,c]=s.useState(0),u=s.useRef(0),[p,x]=s.useState({x:0,y:0}),[w,m]=s.useState(1),[h,f]=s.useState("none"),v=s.useRef({x:0,y:0}),[C,y]=s.useState(!1),{sizeType:S,imageWidth:G,randomRangeImageWidth:W}=e.imageSize,{revealPosition:U,visible:H}=e.position,{cursorType:I,target:z,defaultCursorScale:$,defaultCursor:T,hoverCursorScale:k,hoverCursor:_}=e.cursor;s.useEffect(()=>{if(!i)return;const P=(L,B)=>{const K=i.getBoundingClientRect(),ue=L-K.left,le=B-K.top;if(x({x:ue,y:le}),I==="system"){f("none"),m(1);return}const F=ue,pe=le,j=document.elementFromPoint(K.left+F,K.top+pe);if(j&&j.closest("a")){f("none"),m(1);return}const se=bl(F,pe,r)||z==="area"?{img:_??"none",scale:k}:{img:T??"none",scale:$};f(se.img),m(se.scale)},q=L=>{L.stopPropagation(),v.current={x:L.clientX,y:L.clientY},P(L.clientX,L.clientY)},ie=()=>{C&&P(v.current.x,v.current.y)};return i.addEventListener("mousemove",q),window.addEventListener("scroll",ie,!0),()=>{i.removeEventListener("mousemove",q),window.removeEventListener("scroll",ie,!0)}},[i,C,p,I,z,_,T,k,$,r]),s.useEffect(()=>{C||(f("none"),m(0))},[C]);const g=async(P,q,ie,L={})=>{const{width:B,height:K,finalWidth:ue}=await Dm(P.image.url,S,G,W);let le=0,F=0;U==="same"?(le=q/2,F=ie/2):(le=L.x??Math.random()*q,F=L.y??Math.random()*ie);const pe=Math.min(Math.max(le,B/2),q-B/2),j=Math.min(Math.max(F,K/2),ie-K/2);return{id:u.current++,url:P.image.url,link:P.link,name:P.image.name,x:pe,y:j,width:ue}};s.useEffect(()=>{if(!i||t.length===0)return;const P=i.getBoundingClientRect(),q=P.width,ie=P.height,L=[];(async()=>{const K=t[0],ue=await g(K,q,ie);L.push(ue),l(L),c(1)})()},[S,G,W,U,i]),s.useEffect(()=>{H==="last One"&&l(P=>P.length>0?[P[P.length-1]]:[])},[H]);const D=async P=>{if(!i)return;const q=i.getBoundingClientRect(),ie=P.clientX-q.left,L=P.clientY-q.top;if(z==="image"&&!bl(ie,L,r))return;let B=0,K=0;U==="on Click"?(B=ie,K=L):U==="same"?(B=q.width/2,K=q.height/2):(B=Math.random()*q.width,K=Math.random()*q.height);const ue=t[d],le=await g(ue,q.width,q.height,{x:B,y:K});l(F=>H==="all"?[...F,le]:[le]),c(F=>F>=t.length-1?0:F+1)};return a.jsxs("div",{ref:o,onClick:D,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:Mi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[r.map(P=>a.jsx("div",{className:Mi.wrapper,style:{top:`${P.y}px`,left:`${P.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:P.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:z==="area"&&P.link?a.jsx("a",{href:P.link,target:"_blank",className:Mi.link,children:a.jsx("img",{src:P.url,alt:P.name,className:Mi.image},P.id)}):a.jsx("img",{src:P.url,alt:P.name,className:Mi.image},P.id)},P.id)),C&&a.jsx("div",{className:Mi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${w})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Bm={element:Om,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:""}]}}}},zm="LightBox-module__hidden___9s-9x",jm="LightBox-module__heroImage___sTxNF",Vm="LightBox-module__background___rm9ml",Gm="LightBox-module__editor___4ACaY",Xm="LightBox-module__contentStyle___Bgnsq",Ym="LightBox-module__imageStyle___tLIlB",qm="LightBox-module__imgWrapper___LuFUp",Um="LightBox-module__contain___8-yaS",Km="LightBox-module__cover___hNvOG",Zm="LightBox-module__caption___b6L2I",Jm="LightBox-module__captionTextInner___rCGNH",Qm="LightBox-module__lightboxSplide___XFuWC",eg="LightBox-module__arrow___iz38X",tg="LightBox-module__arrowVertical___Zfz81",ng="LightBox-module__nextArrow___zkAQN",ig="LightBox-module__arrowInner___p48sW",og="LightBox-module__arrowIcon___3VaFf",rg="LightBox-module__arrowImg___pNV88",ag="LightBox-module__mirror___pjeXc",sg="LightBox-module__thumbsWrapper___GB-nU",lg="LightBox-module__thumbsContainerVertical___wttk5",cg="LightBox-module__thumbsContainer___osSma",dg="LightBox-module__thumbsAlignStart___MO6tY",ug="LightBox-module__thumbsAlignCenter___Q4sUx",pg="LightBox-module__thumbsAlignEnd___p4y9R",mg="LightBox-module__thumbItem___HvnF3",gg="LightBox-module__closeButton___g2khP",hg="LightBox-module__fadeIn___0m5GW",fg="LightBox-module__slideInLeft___gPYwC",yg="LightBox-module__slideInRight___S-pPp",xg="LightBox-module__slideInTop___DFdAj",vg="LightBox-module__slideInBottom___m27kZ",bg="LightBox-module__fadeOut___55qBR",wg="LightBox-module__slideOutLeft___NvU7P",Sg="LightBox-module__slideOutRight___SK7eC",Cg="LightBox-module__slideOutTop___Vgg0z",$g="LightBox-module__slideOutBottom___nJ0Ef",Tg="LightBox-module__scaleSlide___vZriG",Ke={hidden:zm,heroImage:jm,background:Vm,editor:Gm,contentStyle:Xm,imageStyle:Ym,imgWrapper:qm,contain:Um,cover:Km,caption:Zm,captionTextInner:Jm,lightboxSplide:Qm,arrow:eg,arrowVertical:tg,nextArrow:ng,arrowInner:ig,arrowIcon:og,arrowImg:rg,mirror:ag,thumbsWrapper:sg,thumbsContainerVertical:lg,thumbsContainer:cg,thumbsAlignStart:dg,thumbsAlignCenter:ug,thumbsAlignEnd:pg,thumbItem:mg,closeButton:gg,fadeIn:hg,slideInLeft:fg,slideInRight:yg,slideInTop:xg,slideInBottom:vg,fadeOut:bg,slideOutLeft:wg,slideOutRight:Sg,slideOutTop:Cg,slideOutBottom:$g,scaleSlide:Tg},lr=(e,t,n)=>{const i={},[o,r]=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"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${O.scalingValue(t.x,n)}), calc(-50% + ${O.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${O.scalingValue(t.x,n)}, calc(-50% + ${O.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${O.scalingValue(t.x,n)}), ${O.scalingValue(t.y,n)})`:i.transform=`translate(${O.scalingValue(t.x,n)}, ${O.scalingValue(t.y,n)})`,i};function Td(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 Ig(e){const t=e.trim().split(/\s+/),n=i=>{if(i.endsWith("%"))return parseFloat(i)/100;switch(i){case"left":case"top":return 0;case"right":case"bottom":return 1;case"center":return .5;default:return .5}};if(t.length===1){const i=t[0];return i==="center"?{x:.5,y:.5}:i==="top"||i==="bottom"?{x:.5,y:n(i)}:i==="left"||i==="right"?{x:n(i),y:.5}:{x:n(i),y:.5}}return{x:n(t[0]),y:n(t[1])}}function Id(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const d=e;return{renderedW:d,renderedH:d/r}}const l=t;return{renderedW:l*r,renderedH:l}}function Rg(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,r=n/i;if(r>o){const d=t;return{renderedW:d*r,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/r}}function Rd(e,t,n,i,o){const{x:r,y:l}=Ig(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Lg(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height;if(!n||!i)return"center center";const o=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,r=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?Rg:Id,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:x,offsetY:w}=Rd(n,i,u,p,d),m=(x+u/2)/n*100,h=(w+p/2)/i*100;return`${m}% ${h}%`}function Pg(e){return Lg(e)}function Or(e){const t=e.getBoundingClientRect(),n=Td(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),r=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=Id(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:x}=Rd(i,o,d,c,u),w=t.left+n.left,m=t.top+n.top;return{x:p+w,y:x+m,width:d,height:c}}function wl(e){const t=e.getBoundingClientRect(),n=Td(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Sl(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 Eg(e,t){const n=(()=>{if(e==="fade in")return Ke.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ke.slideInLeft;case"right":return Ke.slideInRight;case"top":return Ke.slideInTop;case"bottom":return Ke.slideInBottom;default:return Ke.slideInRight}return Ke.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ke.fadeIn;if(e==="slide in")switch(t){case"left":return Ke.slideInLeft;case"right":return Ke.slideInRight;case"top":return Ke.slideInTop;case"bottom":return Ke.slideInBottom;default:return Ke.slideInRight}return Ke.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ke.fadeOut;if(e==="slide in")switch(t){case"left":return Ke.slideOutLeft;case"right":return Ke.slideOutRight;case"top":return Ke.slideOutTop;case"bottom":return Ke.slideOutBottom;default:return Ke.slideOutRight}return Ke.fadeOut})(),r=(()=>{if(e==="fade in")return Ke.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ke.slideOutLeft;case"right":return Ke.slideOutRight;case"top":return Ke.slideOutTop;case"bottom":return Ke.slideOutBottom;default:return Ke.slideOutRight}return Ke.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Mg=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[d,c]=s.useState(!1),{url:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:Ke.heroImage,onClick:()=>c(!0)}),a.jsx(kg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},kg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var ye;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:x,wordSpacing:w,fontSizeLineHeight:m,textAppearance:h,color:f}=i.imageCaption??{},[v,C]=s.useState(0),[y,S]=s.useState(0),[G,W]=s.useState(!1),[U,H]=s.useState(!1),[I,z]=s.useState({}),$=s.useRef(null),T=s.useRef(null),k=s.useRef(null),_=s.useRef(!1),g=s.useRef(null),D=s.useRef(null),P=s.useRef(null),q=s.useRef(null),ie=s.useRef(!1),L=s.useRef(null),[B,K]=s.useState(!1),{appear:ue,triggers:le,slider:F,thumbnail:pe,controls:j,area:se,caption:ne,layout:ve}=o.lightboxBlock,{appearClass:ke,backdropAppearClass:xe,backdropDisappearClass:b,disappearClass:M}=Eg(ue.type,ue.direction),E=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const Z=()=>{setTimeout(()=>{var de,be;(be=(de=$.current)==null?void 0:de.splide)==null||be.refresh()},16)},J=()=>{S(de=>de+1)};return window.addEventListener("ArticleEditor.Layout:change",Z),window.addEventListener("ArticleEditor.ComponentContent:change",J),()=>{window.removeEventListener("ArticleEditor.Layout:change",Z),window.removeEventListener("ArticleEditor.ComponentContent:change",J)}},[]),s.useEffect(()=>{if(!e||!pe.isActive){K(!1);return}const Z=L.current;if(!Z)return;const J=()=>{F.direction==="horiz"?K(Z.scrollWidth>Z.clientWidth):K(Z.scrollHeight>Z.clientHeight)};J();const de=new ResizeObserver(J);return de.observe(Z),()=>de.disconnect()},[e,pe.isActive,n.length,I,F.direction]);const V=s.useCallback(()=>{const Z=window.matchMedia("(max-width: 768px)").matches,J=Sl(se.color);Z&&!l&&J>.9&&(document.body.style.backgroundColor=""),W(!0),_.current=!0;const de=be=>{be.target===g.current&&be.animationName&&(g.current&&D.current&&g.current.removeEventListener("animationend",D.current),D.current=null,_.current&&(_.current=!1,t()),W(!1))};g.current&&(D.current=de,g.current.addEventListener("animationend",de))},[t,se.color,l]),Ce=(Z,J,de)=>{var be,Pe;if(Z){if(le.type==="click"&&le.switch==="image")le.repeat==="close"&&v===n.length-1?V():(be=$.current)==null||be.go("+1");else if(le.type==="click"&&le.switch==="50/50"){const Se=Z.getBoundingClientRect(),X=J-Se.left,me=de-Se.top,re=Se.width,Y=Se.height;let ce;F.direction==="horiz"?ce=X<re/2?"-1":"+1":ce=me<Y/2?"-1":"+1",(Pe=$.current)==null||Pe.go(ce)}}},te=Z=>{if(ie.current){ie.current=!1;return}const J=n[v],de=(J==null?void 0:J.image.objectFit)==="cover";let be,Pe;if("changedTouches"in Z&&Z.changedTouches.length>0)be=Z.changedTouches[0].clientX,Pe=Z.changedTouches[0].clientY;else if("clientX"in Z)be=Z.clientX,Pe=Z.clientY;else return;let Se;if(de&&k.current){const X=wl(k.current);Se=be>=X.left&&be<=X.right&&Pe>=X.top&&Pe<=X.bottom}else{const X=k.current?Or(k.current):null;if(!X){Z.target===Z.currentTarget&&V();return}Se=be>=X.x&&be<=X.x+X.width&&Pe>=X.y&&Pe<=X.y+X.height}Se?Ce(k.current,be,Pe):V()},$e=Z=>{const J=Z.target;(J.classList.contains(Ke.thumbsWrapper)||J.classList.contains(Ke.thumbsContainer))&&te(Z)};s.useEffect(()=>{if(!e)return;const Z=J=>{var de,be;if(J.key==="Escape"){V();return}if(J.key==="ArrowRight"){C(Pe=>(Pe+1)%Math.max(n.length,1)),(de=$.current)==null||de.go("+1");return}J.key==="ArrowLeft"&&(C(Pe=>(Pe-1+Math.max(n.length,1))%Math.max(n.length,1)),(be=$.current)==null||be.go("-1"))};return window.addEventListener("keydown",Z),()=>{window.removeEventListener("keydown",Z)}},[e,V,n.length]),s.useEffect(()=>{if(e){if(C(0),S(J=>J+1),_.current=!1,W(!1),H(!1),z({}),!E)return;const Z=new CustomEvent("page-overlay",{detail:{itemId:E}});window.dispatchEvent(Z)}return()=>{g.current&&D.current&&(g.current.removeEventListener("animationend",D.current),D.current=null),H(!1)}},[e,E]),s.useEffect(()=>{T.current!==null&&T.current!==F.type&&S(Z=>Z+1),T.current=F.type},[F.type]),s.useEffect(()=>{if(!e)return;const Z=document.body.style.overflow,J=window.matchMedia("(max-width: 768px)").matches,de=Sl(se.color);document.body.style.overflow="hidden",H(!1);const be=Se=>{Se.target===g.current&&!_.current&&Se.animationName&&(J&&!l&&de>.9&&(document.body.style.backgroundColor=se.color),H(!0),g.current&&P.current&&g.current.removeEventListener("animationend",P.current),P.current=null)};g.current&&(P.current=be,g.current.addEventListener("animationend",be));const Pe=Se=>{const X=Se.target;X&&(X.closest(`.${Ke.thumbsWrapper}`)||X.closest(`.${Ke.thumbsContainer}`))||F.type!=="slide"&&Se.preventDefault()};return document.addEventListener("touchmove",Pe,{passive:!1}),()=>{document.body.style.overflow=Z,document.removeEventListener("touchmove",Pe),g.current&&P.current&&(g.current.removeEventListener("animationend",P.current),P.current=null),H(!1)}},[e,l,se.color,F.type]),s.useEffect(()=>{if(!e)return;const Z=J=>{var be,Pe;if(_.current){J.stopPropagation();return}if(ie.current){ie.current=!1;return}const de=J.target;if(!(de&&(de.closest(`.${Ke.thumbsContainer}`)||de.closest(`.${Ke.thumbItem}`)||de.closest(`.${Ke.arrow}`)||de.closest(`.${Ke.closeButton}`)||de.closest(`.${Ke.caption}`)))){if(F.type==="slide"&&le.type==="drag"&&((Pe=(be=$.current)==null?void 0:be.splide)!=null&&Pe.root)){const Se=$.current.splide.root;if(de&&(Se.contains(de)||Se===de))return}if(J.touches.length===0&&J.changedTouches.length>0){const Se=n[v],X=(Se==null?void 0:Se.image.objectFit)==="cover",me=J.changedTouches[0];let re;if(X&&k.current){const Y=wl(k.current);re=me.clientX>=Y.left&&me.clientX<=Y.right&&me.clientY>=Y.top&&me.clientY<=Y.bottom}else{const Y=k.current?Or(k.current):null;if(!Y)return;re=me.clientX>=Y.x&&me.clientX<=Y.x+Y.width&&me.clientY>=Y.y&&me.clientY<=Y.y+Y.height}if(!re){J.stopPropagation(),_.current=!0;const Y=ce=>{ce.stopPropagation(),ce.preventDefault(),document.removeEventListener("click",Y,!0)};document.addEventListener("click",Y,!0),V()}}}};return document.addEventListener("touchend",Z,{passive:!0}),()=>{document.removeEventListener("touchend",Z)}},[e,V,v,n]);const ae=(F.type==="scale"||F.type==="fade")&&F.direction==="vert"&&le.type==="drag";s.useEffect(()=>{var ce,Ee;if(!e||!ae||!((Ee=(ce=$.current)==null?void 0:ce.splide)!=null&&Ee.root))return;const Z=$.current.splide.root,J=30,de=(he,Q)=>{if(q.current){const Ne=Math.abs(he-q.current.x),Fe=Math.abs(Q-q.current.y);(Ne>0||Fe>0)&&(ie.current=!0)}},be=he=>{q.current&&(he.preventDefault(),de(he.clientX,he.clientY))},Pe=he=>{q.current&&he.touches.length>0&&(he.preventDefault(),de(he.touches[0].clientX,he.touches[0].clientY))},Se=(he,Q)=>{if(!q.current||!$.current){q.current=null;return}const Ne=Math.abs(he-q.current.x),Fe=Math.abs(Q-q.current.y);Fe>J&&Fe>Ne&&$.current.go(Q<q.current.y?"+1":"-1"),q.current=null},X=he=>{q.current&&Se(he.clientX,he.clientY),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.removeEventListener("pointermove",be)},me=he=>{if(q.current){if(he.changedTouches.length>0){const Q=he.changedTouches[0];Se(Q.clientX,Q.clientY)}document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),document.removeEventListener("touchmove",Pe)}},re=he=>{q.current={x:he.clientX,y:he.clientY},ie.current=!1,document.addEventListener("pointermove",be,{passive:!1}),document.addEventListener("pointerup",X),document.addEventListener("pointercancel",X)},Y=he=>{he.touches.length>0&&(q.current={x:he.touches[0].clientX,y:he.touches[0].clientY},ie.current=!1,document.addEventListener("touchmove",Pe,{passive:!1}),document.addEventListener("touchend",me),document.addEventListener("touchcancel",me))};return Z.addEventListener("pointerdown",re),Z.addEventListener("touchstart",Y),()=>{Z.removeEventListener("pointerdown",re),Z.removeEventListener("touchstart",Y),document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.removeEventListener("touchmove",Pe),document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),q.current=null,ie.current=!1}},[e,ae,y]);const ge={backgroundColor:se.color,backdropFilter:`blur(${se.blur}px)`,animationDuration:`${parseInt(ue.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:zn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:g,className:pt(Ke.background,G?b:xe,{[Ke.editor]:l},{[Ke.hidden]:!e}),style:{...ge,...U&&!l&&!G?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?g:null,className:pt(Ke.contentStyle,G?M:ke,{[Ke.editor]:l},{[Ke.hidden]:!e}),style:{animationDuration:`${parseInt(ue.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(zs,{onMove:Z=>C(Z.index),ref:$,className:Ke.lightboxSplide,options:{arrows:!1,speed:F.duration?parseInt(F.duration):500,direction:F.direction==="horiz"||F.type==="fade"||F.type==="scale"?"ltr":"ttb",pagination:!1,drag:le.type==="drag"&&!ae,perPage:1,width:"100%",height:"100%",type:F.type==="fade"||F.type==="scale"?"fade":"loop",padding:0,rewind:le.repeat!=="close",start:0},style:{"--splide-speed":F.duration},children:n.map((Z,J)=>{const de=lr(ve.position,ve.offset,l),be=`${O.scalingValue(ve.padding.top,l)} ${O.scalingValue(ve.padding.right,l)} ${O.scalingValue(ve.padding.bottom,l)} ${O.scalingValue(ve.padding.left,l)}`,Pe=F.type==="scale"?(()=>{const{transform:Se,...X}=de;return{...X,position:"absolute",padding:be,boxSizing:"border-box","--position-transform":Se||"none"}})():{...de,position:"absolute",padding:be,boxSizing:"border-box"};return a.jsx(js,{children:a.jsx("div",{className:Ke.imgWrapper,onClick:te,children:a.jsx("img",{ref:J===v?k:null,className:pt(Ke.imageStyle,{[Ke.contain]:Z.image.objectFit==="contain",[Ke.cover]:Z.image.objectFit==="cover",[Ke.scaleSlide]:F.type==="scale"}),src:Z.image.url,alt:Z.image.name??"",style:{...Pe,pointerEvents:Z.image.objectFit==="contain"?"none":"auto"}})})},J)})},y),j.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(Ke.arrow,{[Ke.arrowVertical]:F.direction==="vert"}),style:{color:j.color,"--arrow-hover-color":j.hover},children:a.jsxs("button",{className:Ke.arrowInner,style:{transform:`translate(${O.scalingValue(j.offset.x,l)}, ${O.scalingValue(j.offset.y*(F.direction==="horiz"?1:-1),l)}) scale(${j.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var Z;return(Z=$.current)==null?void 0:Z.go("-1")},"aria-label":"Previous",children:[j.arrowsImgUrl&&a.jsx(sn,{url:j.arrowsImgUrl,fill:j.color,hoverFill:j.hover,className:pt(Ke.arrowImg,Ke.mirror)}),!j.arrowsImgUrl&&a.jsx(Cl,{color:j.color,className:pt(Ke.arrowIcon,Ke.arrowImg,Ke.mirror)})]})}),a.jsx("div",{className:pt(Ke.arrow,Ke.nextArrow,{[Ke.arrowVertical]:F.direction==="vert"}),style:{color:j.color,"--arrow-hover-color":j.hover},children:a.jsxs("button",{className:Ke.arrowInner,style:{transform:`translate(${O.scalingValue(j.offset.x*(F.direction==="horiz"?-1:1),l)}, ${O.scalingValue(j.offset.y,l)}) scale(${j.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var Z;return(Z=$.current)==null?void 0:Z.go("+1")},"aria-label":"Next",children:[j.arrowsImgUrl&&a.jsx(sn,{url:j.arrowsImgUrl,fill:j.color,hoverFill:j.hover,className:Ke.arrowImg}),!j.arrowsImgUrl&&a.jsx(Cl,{color:j.color,className:pt(Ke.arrowIcon,Ke.arrowImg)})]})})]}),se.closeIconUrl&&(()=>{const Z=lr(se.closeIconAlign,se.closeIconOffset,l),J=`scale(${se.closeIconScale})`,de=Z.transform?`${Z.transform} ${J}`:J;return a.jsx("button",{className:Ke.closeButton,style:{...Z,transform:de},onClick:V,"aria-label":"Close lightbox",children:a.jsx(sn,{url:se.closeIconUrl,fill:se.closeIconColor??"#000000",hoverFill:se.closeIconHover??"#cccccc"})})})(),ne&&ne.isActive&&i.imageCaption&&((ye=n[v])==null?void 0:ye.imageCaption)&&a.jsx("div",{className:Ke.caption,style:{...lr(ne.alignment,ne.offset,l),fontFamily:po(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":O.scalingValue(c.width,l),letterSpacing:O.scalingValue(p,l),wordSpacing:O.scalingValue(w,l),textAlign:x,fontSize:O.scalingValue(m.fontSize,l),lineHeight:O.scalingValue(m.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f},onClick:Z=>Z.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Ke.captionTextInner,style:{"--link-color":ne.linkColor,"--link-hover-color":ne.linkHoverColor},children:a.jsx(Ri,{content:n[v].imageCaption})})}),pe.isActive&&(()=>{const[Z,J]=pe.position.split("-"),de=F.direction==="horiz"?`${Z}-left`:pe.position,be=lr(de,pe.offset,l),Pe=()=>{if(F.direction==="horiz"){if(J==="left")return"flex-start";if(J==="center")return"center";if(J==="right")return"flex-end"}else{if(Z==="top")return"flex-start";if(Z==="middle")return"center";if(Z==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:L,className:Ke.thumbsWrapper,onClick:Se=>$e(Se),style:{position:l?"absolute":"fixed",...be,...F.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:pt(Ke.thumbsContainer,{[Ke.thumbsContainerVertical]:F.direction==="vert",[Ke.thumbsAlignStart]:pe.align==="start",[Ke.thumbsAlignCenter]:pe.align==="center",[Ke.thumbsAlignEnd]:pe.align==="end"}),style:{gap:O.scalingValue(pe.grid.gap,l),justifyContent:B?"flex-start":Pe()},children:n.map((Se,X)=>{const me=X===v,re=I[X],ce=pe.grid.size*(me?pe.activeState.scale:1),Ee=()=>{if(pe.fit!=="fit")return{};if(!re)return F.direction==="horiz"?{height:O.scalingValue(ce,l)}:{width:O.scalingValue(ce,l)};const he=re.width/re.height;if(F.direction==="horiz"){const Q=ce,Ne=Q*he;return{width:O.scalingValue(Ne,l),height:O.scalingValue(Q,l)}}else{const Q=ce,Ne=Q/he;return{width:O.scalingValue(Q,l),height:O.scalingValue(Ne,l)}}};return a.jsx("button",{className:Ke.thumbItem,style:{...F.direction==="horiz"&&pe.fit!=="fit"?{height:O.scalingValue(ce,l)}:{},...F.direction==="vert"&&pe.fit!=="fit"?{width:O.scalingValue(ce,l)}:{},...pe.fit==="cover"?{width:O.scalingValue(ce,l),height:O.scalingValue(ce,l)}:{},...Ee(),transition:me?"all 0.25s ease-out":"none",opacity:me?pe.activeState.opacity/100:pe.opacity/100,"--thumb-hover":pe.activeState.opacity/100},onClick:he=>{var Q;he.stopPropagation(),C(X),(Q=$.current)==null||Q.go(X)},onMouseEnter:()=>{var he;pe.triggers==="hov"&&((he=$.current)==null||he.go(X))},children:a.jsx("img",{src:Se.image.url,alt:Se.image.name??"",onLoad:he=>{const Q=he.currentTarget;Q.naturalWidth&&Q.naturalHeight&&z(Ne=>({...Ne,[X]:{width:Q.naturalWidth,height:Q.naturalHeight}}))},style:{objectFit:pe.fit==="cover"?"cover":"contain",...pe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...pe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Se.image.name}-${X}`)})})})})()]})]}),document.getElementById(r))};function Cl({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.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 Ag={element:Mg,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 cr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Fg(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 _g({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=D.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:x=[],buttonLabel:w,gap:m,fieldsGap:h,buttonCorners:f,buttonStroke:v,buttonPadding:C,isButtonFullWidth:y,inputCorners:S,inputStroke:G,inputPadding:W,inputColor:U,inputTextColor:H,inputBorderColor:I,placeholderColor:z,buttonColor:$,buttonTextColor:T,buttonBorderColor:A,labelTextColor:_,successColor:g,errorColor:B,fontFamily:P,inputFontSettings:Y,inputFontSize:ie,inputLineHeight:L,inputLetterSpacing:O,inputWordSpacing:K,inputTextAppearance:ue,buttonFontSettings:le,buttonFontSize:F,buttonLineHeight:pe,buttonLetterSpacing:j,buttonWordSpacing:se,buttonTextAppearance:ne,labelFontSettings:ve,labelFontSize:Me,labelLineHeight:xe,labelLetterSpacing:b,labelWordSpacing:M,labelTextAppearance:E,statusFontSettings:V,statusFontSize:Se,statusLineHeight:te,statusLetterSpacing:$e,statusWordSpacing:re,statusTextAppearance:ge,successMessage:ye,errorMessage:Z,stateOverrides:Q}=e,ce=u==="B",we=x.slice(0,Math.min(p,x.length)),Pe={fontSettings:{fontFamily:P,fontWeight:(Y==null?void 0:Y.fontWeight)??400,fontStyle:(Y==null?void 0:Y.fontStyle)??"normal"},fontSize:ie??.01,lineHeight:L,letterSpacing:O??0,wordSpacing:K??0,textAppearance:ue,color:H},Ce=an(qt(Pe,t)),X=D.scalingValue(G??0,t),me=D.scalingValue((L??ie??.01)+((W==null?void 0:W.top)??0)+((W==null?void 0:W.bottom)??0)+(u==="C"?G??0:(G??0)*2),t),ae={...Ce,borderStyle:"solid",borderRadius:u==="C"?0:D.scalingValue(S??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:X,borderLeftWidth:0}:{borderWidth:X},paddingTop:D.scalingValue((W==null?void 0:W.top)??0,t),paddingRight:D.scalingValue((W==null?void 0:W.right)??0,t),paddingBottom:D.scalingValue((W==null?void 0:W.bottom)??0,t),paddingLeft:D.scalingValue((W==null?void 0:W.left)??0,t),height:me,minHeight:me},q={fontSettings:{fontFamily:P,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:F??.01,lineHeight:pe,letterSpacing:j??0,wordSpacing:se??0,textAppearance:ne,color:T},de=an(qt(q,t)),ke=D.scalingValue(v??0,t),he={fontSettings:{fontFamily:P,fontWeight:(ve==null?void 0:ve.fontWeight)??400,fontStyle:(ve==null?void 0:ve.fontStyle)??"normal"},fontSize:Me??.01,lineHeight:xe,letterSpacing:b??0,wordSpacing:M??0,textAppearance:E,color:_},J=qt(he,t),Ne={fontSettings:{fontFamily:P,fontWeight:(V==null?void 0:V.fontWeight)??400,fontStyle:(V==null?void 0:V.fontStyle)??"normal"},fontSize:Se??.01,lineHeight:te,letterSpacing:$e??0,wordSpacing:re??0,textAppearance:ge,color:g},Fe=an(qt(Ne,t)),et=D.buildColorVars(c,{inputColor:U,inputTextColor:H,inputBorderColor:I,placeholderColor:z!=null&&z.trim()?z:"#cccccc",buttonColor:$,buttonTextColor:T,buttonBorderColor:A,labelTextColor:_,successColor:g,errorColor:B},Ng,Wg,Q),[Je,dt]=s.useState(()=>Object.fromEntries(we.map(_e=>[_e.name,""]))),[tt,De]=s.useState("idle"),[Ie,We]=s.useState(null),je=r==="success"?"success":r==="error"?"error":tt,Ue=r==="error"?Z:Ie,k=r==="filled",ee=s.useMemo(()=>{if(!k)return Je;let _e=null;for(const qe of we)(Je[qe.name]??"").trim().length>0||(_e=_e??{...Je},_e[qe.name]="Filled");return _e??Je},[Je,k,we]),Te=je==="error"?D.getFormFieldValidationError(we,ee):null,Be=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),Ve=o==null?void 0:o.submitUrl,rt=(_e,qe)=>{dt(Oe=>({...Oe,[_e]:qe}))},Ze=async _e=>{if(_e.preventDefault(),!d)return;const qe=Object.fromEntries(we.map(nt=>{var at;return[nt.name,((at=Je[nt.name])==null?void 0:at.trim())??""]}).filter(([,nt])=>nt));if(!Ve){De("error"),We("No integrations were found for this form.");return}if(Object.keys(qe).length===0)return;const Oe=D.getFormFieldValidationError(we,Je);if(Oe){De("error"),We(Oe);return}De("submitting"),We(null);try{const nt=await fetch(Ve,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(!nt.ok){const at=await nt.text();throw new Error(at||`Request failed: ${nt.status}`)}De("success"),dt(Object.fromEntries(we.map(at=>[at.name,""])))}catch(nt){De("error"),We(nt instanceof Error?nt.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${Be}`.trim(),style:et,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Fg(c)}}),a.jsxs("form",{onSubmit:Ze,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:we.map((_e,qe)=>a.jsxs(s.Fragment,{children:[qe>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:D.scalingValue(h??0,t)}}),a.jsxs("div",{className:`${c}-field-group${ce?` ${c}-labeled`:""}`,children:[ce&&a.jsx("span",{className:`${c}-field-label`,style:J?{...J,lineHeight:J.fontSize}:void 0,children:_e.label||_e.name}),_e.type==="textarea"?a.jsx("textarea",{name:_e.name,autoComplete:"off",value:ee[_e.name]??"",onChange:Oe=>rt(_e.name,Oe.target.value),placeholder:_e.placeholder,className:`${c}-input`,style:ae,rows:1,"data-filled":k||(ee[_e.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:_e.type==="phone"?"tel":_e.type==="email"?"email":"text",name:_e.name,autoComplete:"off",value:ee[_e.name]??"",onChange:Oe=>rt(_e.name,Oe.target.value),placeholder:_e.placeholder,required:_e.isRequired??_e.type==="email",className:`${c}-input`,style:ae,"data-filled":k||(ee[_e.name]??"").trim().length>0})]})]},qe))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:D.scalingValue(m??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:D.scalingValue(f??0,t),borderWidth:ke,paddingTop:D.scalingValue((C==null?void 0:C.top)??0,t),paddingRight:D.scalingValue((C==null?void 0:C.right)??0,t),paddingBottom:D.scalingValue((C==null?void 0:C.bottom)??0,t),paddingLeft:D.scalingValue((C==null?void 0:C.left)??0,t),pointerEvents:d?"auto":void 0,...de,...y?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${c}-overlay-anchor`,style:y?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:tt==="submitting"?"...":w})})})]}),je==="success"&&a.jsx("p",{className:`${c}-success`,style:{...Fe},children:ye}),je==="error"&&a.jsx("p",{className:`${c}-error`,style:{...Fe},role:"alert",children:Te??Ue??Z})]})}const Ng={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"},Wg=["hover","focus","filled","success","error"],Hg=`import React, { useMemo, useState } from 'react';
158
+ `}function _g({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=O.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:x=[],buttonLabel:w,gap:m,fieldsGap:h,buttonCorners:f,buttonStroke:v,buttonPadding:C,isButtonFullWidth:y,inputCorners:S,inputStroke:G,inputPadding:W,inputColor:U,inputTextColor:H,inputBorderColor:I,placeholderColor:z,buttonColor:$,buttonTextColor:T,buttonBorderColor:k,labelTextColor:_,successColor:g,errorColor:D,fontFamily:P,inputFontSettings:q,inputFontSize:ie,inputLineHeight:L,inputLetterSpacing:B,inputWordSpacing:K,inputTextAppearance:ue,buttonFontSettings:le,buttonFontSize:F,buttonLineHeight:pe,buttonLetterSpacing:j,buttonWordSpacing:se,buttonTextAppearance:ne,labelFontSettings:ve,labelFontSize:ke,labelLineHeight:xe,labelLetterSpacing:b,labelWordSpacing:M,labelTextAppearance:E,statusFontSettings:V,statusFontSize:Ce,statusLineHeight:te,statusLetterSpacing:$e,statusWordSpacing:ae,statusTextAppearance:ge,successMessage:ye,errorMessage:Z,stateOverrides:J}=e,de=u==="B",be=x.slice(0,Math.min(p,x.length)),Pe={fontSettings:{fontFamily:P,fontWeight:(q==null?void 0:q.fontWeight)??400,fontStyle:(q==null?void 0:q.fontStyle)??"normal"},fontSize:ie??.01,lineHeight:L,letterSpacing:B??0,wordSpacing:K??0,textAppearance:ue,color:H},Se=an(qt(Pe,t)),X=O.scalingValue(G??0,t),me=O.scalingValue((L??ie??.01)+((W==null?void 0:W.top)??0)+((W==null?void 0:W.bottom)??0)+(u==="C"?G??0:(G??0)*2),t),re={...Se,borderStyle:"solid",borderRadius:u==="C"?0:O.scalingValue(S??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:X,borderLeftWidth:0}:{borderWidth:X},paddingTop:O.scalingValue((W==null?void 0:W.top)??0,t),paddingRight:O.scalingValue((W==null?void 0:W.right)??0,t),paddingBottom:O.scalingValue((W==null?void 0:W.bottom)??0,t),paddingLeft:O.scalingValue((W==null?void 0:W.left)??0,t),height:me,minHeight:me},Y={fontSettings:{fontFamily:P,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:F??.01,lineHeight:pe,letterSpacing:j??0,wordSpacing:se??0,textAppearance:ne,color:T},ce=an(qt(Y,t)),Ee=O.scalingValue(v??0,t),he={fontSettings:{fontFamily:P,fontWeight:(ve==null?void 0:ve.fontWeight)??400,fontStyle:(ve==null?void 0:ve.fontStyle)??"normal"},fontSize:ke??.01,lineHeight:xe,letterSpacing:b??0,wordSpacing:M??0,textAppearance:E,color:_},Q=qt(he,t),Ne={fontSettings:{fontFamily:P,fontWeight:(V==null?void 0:V.fontWeight)??400,fontStyle:(V==null?void 0:V.fontStyle)??"normal"},fontSize:Ce??.01,lineHeight:te,letterSpacing:$e??0,wordSpacing:ae??0,textAppearance:ge,color:g},Fe=an(qt(Ne,t)),et=O.buildColorVars(c,{inputColor:U,inputTextColor:H,inputBorderColor:I,placeholderColor:z!=null&&z.trim()?z:"#cccccc",buttonColor:$,buttonTextColor:T,buttonBorderColor:k,labelTextColor:_,successColor:g,errorColor:D},Ng,Wg,J),[Je,dt]=s.useState(()=>Object.fromEntries(be.map(_e=>[_e.name,""]))),[tt,De]=s.useState("idle"),[Ie,We]=s.useState(null),je=r==="success"?"success":r==="error"?"error":tt,Ue=r==="error"?Z:Ie,A=r==="filled",ee=s.useMemo(()=>{if(!A)return Je;let _e=null;for(const qe of be)(Je[qe.name]??"").trim().length>0||(_e=_e??{...Je},_e[qe.name]="Filled");return _e??Je},[Je,A,be]),Te=je==="error"?O.getFormFieldValidationError(be,ee):null,Be=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),Ve=o==null?void 0:o.submitUrl,rt=(_e,qe)=>{dt(Oe=>({...Oe,[_e]:qe}))},Ze=async _e=>{if(_e.preventDefault(),!d)return;const qe=Object.fromEntries(be.map(nt=>{var at;return[nt.name,((at=Je[nt.name])==null?void 0:at.trim())??""]}).filter(([,nt])=>nt));if(!Ve){De("error"),We("No integrations were found for this form.");return}if(Object.keys(qe).length===0)return;const Oe=O.getFormFieldValidationError(be,Je);if(Oe){De("error"),We(Oe);return}De("submitting"),We(null);try{const nt=await fetch(Ve,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(!nt.ok){const at=await nt.text();throw new Error(at||`Request failed: ${nt.status}`)}De("success"),dt(Object.fromEntries(be.map(at=>[at.name,""])))}catch(nt){De("error"),We(nt instanceof Error?nt.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${Be}`.trim(),style:et,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Fg(c)}}),a.jsxs("form",{onSubmit:Ze,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:be.map((_e,qe)=>a.jsxs(s.Fragment,{children:[qe>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:O.scalingValue(h??0,t)}}),a.jsxs("div",{className:`${c}-field-group${de?` ${c}-labeled`:""}`,children:[de&&a.jsx("span",{className:`${c}-field-label`,style:Q?{...Q,lineHeight:Q.fontSize}:void 0,children:_e.label||_e.name}),_e.type==="textarea"?a.jsx("textarea",{name:_e.name,autoComplete:"off",value:ee[_e.name]??"",onChange:Oe=>rt(_e.name,Oe.target.value),placeholder:_e.placeholder,className:`${c}-input`,style:re,rows:1,"data-filled":A||(ee[_e.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:_e.type==="phone"?"tel":_e.type==="email"?"email":"text",name:_e.name,autoComplete:"off",value:ee[_e.name]??"",onChange:Oe=>rt(_e.name,Oe.target.value),placeholder:_e.placeholder,required:_e.isRequired??_e.type==="email",className:`${c}-input`,style:re,"data-filled":A||(ee[_e.name]??"").trim().length>0})]})]},qe))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:O.scalingValue(m??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:O.scalingValue(f??0,t),borderWidth:Ee,paddingTop:O.scalingValue((C==null?void 0:C.top)??0,t),paddingRight:O.scalingValue((C==null?void 0:C.right)??0,t),paddingBottom:O.scalingValue((C==null?void 0:C.bottom)??0,t),paddingLeft:O.scalingValue((C==null?void 0:C.left)??0,t),pointerEvents:d?"auto":void 0,...ce,...y?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${c}-overlay-anchor`,style:y?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:tt==="submitting"?"...":w})})})]}),je==="success"&&a.jsx("p",{className:`${c}-success`,style:{...Fe},children:ye}),je==="error"&&a.jsx("p",{className:`${c}-error`,style:{...Fe},role:"alert",children:Te??Ue??Z})]})}const Ng={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"},Wg=["hover","focus","filled","success","error"],Hg=`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';
@@ -982,7 +982,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
982
982
  font-size: ${ur(14)};
983
983
  color: var(--${e}-error-error-color, var(--${e}-error-color));
984
984
  }
985
- `}const Vg=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=D.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:x,inputFontSettings:w,inputFontSize:m,inputLineHeight:h,inputLetterSpacing:f,inputWordSpacing:v,inputTextAppearance:C,buttonFontSettings:y,buttonFontSize:S,buttonLineHeight:G,buttonLetterSpacing:W,buttonWordSpacing:U,buttonTextAppearance:H,statusFontSettings:I,statusFontSize:z,statusLineHeight:$,statusLetterSpacing:T,statusWordSpacing:A,statusTextAppearance:_,iconMaxWidth:g,minHeight:B,corners:P,stroke:Y,stateOverrides:ie,inputPadding:L,buttonPadding:O,successMessage:K="Thanks for subscribing!",errorMessage:ue="Please, fill all required fields."}=e,le=d.slice(0,Math.min(p,d.length)),[F,pe]=s.useState(()=>Object.fromEntries(le.map(he=>[he.name,""]))),[j,se]=s.useState("idle"),[ne,ve]=s.useState(null),Me=o==="success"?"success":o==="error"?"error":j,xe=o==="error"?ue:ne,b=o==="filled",M=s.useMemo(()=>{if(!b)return F;let he=null;for(const J of le)(F[J.name]??"").trim().length>0||(he=he??{...F},he[J.name]="Filled");return he??F},[b,F,le]),E=Me==="error"?D.getFormFieldValidationError(le,M):null,V=o&&o!=="default"?`${r}-state-${o}`:"",Se=le.some(he=>(M[he.name]??"").trim().length>0),te=V!==`${r}-state-filled`&&Se?`${r}-state-filled`:"",$e=`${V} ${te}`.trim(),re=i==null?void 0:i.submitUrl,ge=u??"",ye=(c==null?void 0:c.icon)??"",Z=(c==null?void 0:c.mode)==="On",Q=ge||"Submit",ce={fontSettings:{fontFamily:x,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:m??.01,lineHeight:h,letterSpacing:f??0,wordSpacing:v??0,textAppearance:C,color:e.inputTextColor??"#111111"},we={fontSettings:{fontFamily:x,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:S??.01,lineHeight:G,letterSpacing:W??0,wordSpacing:U??0,textAppearance:H,color:e.buttonTextColor??"#ffffff"},Pe={fontSettings:{fontFamily:x,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:z??.01,lineHeight:$,letterSpacing:T??0,wordSpacing:A??0,textAppearance:_,color:e.successColor??"#22c55e"},Ce=an(qt(ce,t)),X=an(qt(we,t)),me=an(qt(Pe,t)),ae=D.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(ce==null?void 0:ce.color)??"#111111",buttonTextColor:e.buttonTextColor??(we==null?void 0:we.color)??"#ffffff"},Gg,Xg,ie),q={borderRadius:D.scalingValue(P,t),borderWidth:D.scalingValue(Y,t),borderStyle:"solid"},de={borderLeftWidth:D.scalingValue(Y,t)},ke=async he=>{if(he.preventDefault(),!l)return;const J=Object.fromEntries(le.map(Fe=>{var et;return[Fe.name,((et=F[Fe.name])==null?void 0:et.trim())??""]}).filter(([,Fe])=>Fe));if(!re){se("error"),ve("No integrations were found for this form.");return}if(Object.keys(J).length===0)return;const Ne=D.getFormFieldValidationError(le,F);if(Ne){se("error"),ve(Ne);return}se("submitting"),ve(null);try{const Fe=await fetch(re,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!Fe.ok){const et=await Fe.text();throw new Error(et||`Request failed: ${Fe.status}`)}se("success"),pe(Object.fromEntries(le.map(et=>[et.name,""])))}catch(Fe){se("error"),ve(Fe instanceof Error?Fe.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${$e}`.trim(),style:ae,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:jg(r)}}),a.jsxs("form",{onSubmit:ke,className:`${r}-form`,style:{...q,height:D.scalingValue(B,t),minHeight:D.scalingValue(B,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:le.map(he=>a.jsx("input",{type:he.type==="email"?"email":he.type==="phone"?"tel":"text",name:he.name,autoComplete:"off",value:M[he.name]??"",onChange:J=>pe(Ne=>({...Ne,[he.name]:J.target.value})),placeholder:he.placeholder,required:he.isRequired??he.type==="email",className:`${r}-input`,style:{...Ce,paddingRight:D.scalingValue(L.right,t),paddingLeft:D.scalingValue(L.left,t),paddingTop:D.scalingValue(L.top,t),paddingBottom:D.scalingValue(L.bottom,t)}},he.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":Q,style:{...X,...de,paddingRight:D.scalingValue(O.right,t),paddingLeft:D.scalingValue(O.left,t),paddingTop:D.scalingValue(O.top,t),paddingBottom:D.scalingValue(O.bottom,t),pointerEvents:l?"auto":void 0},children:j==="submitting"?"...":Z?ye&&a.jsx(sn,{url:ye,className:`${r}-submitBtnIcon`,style:{maxWidth:D.scalingValue(g??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):ge})})]}),Me==="success"&&a.jsx("p",{className:`${r}-success`,style:{...me},children:K}),Me==="error"&&a.jsx("p",{className:`${r}-error`,style:{...me},role:"alert",children:E??xe??ue})]})},Gg={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"},Xg=["hover","focus","filled","success","error"],Yg=`import React, { useMemo, useState } from 'react';
985
+ `}const Vg=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=O.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:x,inputFontSettings:w,inputFontSize:m,inputLineHeight:h,inputLetterSpacing:f,inputWordSpacing:v,inputTextAppearance:C,buttonFontSettings:y,buttonFontSize:S,buttonLineHeight:G,buttonLetterSpacing:W,buttonWordSpacing:U,buttonTextAppearance:H,statusFontSettings:I,statusFontSize:z,statusLineHeight:$,statusLetterSpacing:T,statusWordSpacing:k,statusTextAppearance:_,iconMaxWidth:g,minHeight:D,corners:P,stroke:q,stateOverrides:ie,inputPadding:L,buttonPadding:B,successMessage:K="Thanks for subscribing!",errorMessage:ue="Please, fill all required fields."}=e,le=d.slice(0,Math.min(p,d.length)),[F,pe]=s.useState(()=>Object.fromEntries(le.map(he=>[he.name,""]))),[j,se]=s.useState("idle"),[ne,ve]=s.useState(null),ke=o==="success"?"success":o==="error"?"error":j,xe=o==="error"?ue:ne,b=o==="filled",M=s.useMemo(()=>{if(!b)return F;let he=null;for(const Q of le)(F[Q.name]??"").trim().length>0||(he=he??{...F},he[Q.name]="Filled");return he??F},[b,F,le]),E=ke==="error"?O.getFormFieldValidationError(le,M):null,V=o&&o!=="default"?`${r}-state-${o}`:"",Ce=le.some(he=>(M[he.name]??"").trim().length>0),te=V!==`${r}-state-filled`&&Ce?`${r}-state-filled`:"",$e=`${V} ${te}`.trim(),ae=i==null?void 0:i.submitUrl,ge=u??"",ye=(c==null?void 0:c.icon)??"",Z=(c==null?void 0:c.mode)==="On",J=ge||"Submit",de={fontSettings:{fontFamily:x,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:m??.01,lineHeight:h,letterSpacing:f??0,wordSpacing:v??0,textAppearance:C,color:e.inputTextColor??"#111111"},be={fontSettings:{fontFamily:x,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:S??.01,lineHeight:G,letterSpacing:W??0,wordSpacing:U??0,textAppearance:H,color:e.buttonTextColor??"#ffffff"},Pe={fontSettings:{fontFamily:x,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:z??.01,lineHeight:$,letterSpacing:T??0,wordSpacing:k??0,textAppearance:_,color:e.successColor??"#22c55e"},Se=an(qt(de,t)),X=an(qt(be,t)),me=an(qt(Pe,t)),re=O.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(de==null?void 0:de.color)??"#111111",buttonTextColor:e.buttonTextColor??(be==null?void 0:be.color)??"#ffffff"},Gg,Xg,ie),Y={borderRadius:O.scalingValue(P,t),borderWidth:O.scalingValue(q,t),borderStyle:"solid"},ce={borderLeftWidth:O.scalingValue(q,t)},Ee=async he=>{if(he.preventDefault(),!l)return;const Q=Object.fromEntries(le.map(Fe=>{var et;return[Fe.name,((et=F[Fe.name])==null?void 0:et.trim())??""]}).filter(([,Fe])=>Fe));if(!ae){se("error"),ve("No integrations were found for this form.");return}if(Object.keys(Q).length===0)return;const Ne=O.getFormFieldValidationError(le,F);if(Ne){se("error"),ve(Ne);return}se("submitting"),ve(null);try{const Fe=await fetch(ae,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)});if(!Fe.ok){const et=await Fe.text();throw new Error(et||`Request failed: ${Fe.status}`)}se("success"),pe(Object.fromEntries(le.map(et=>[et.name,""])))}catch(Fe){se("error"),ve(Fe instanceof Error?Fe.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${$e}`.trim(),style:re,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:jg(r)}}),a.jsxs("form",{onSubmit:Ee,className:`${r}-form`,style:{...Y,height:O.scalingValue(D,t),minHeight:O.scalingValue(D,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:le.map(he=>a.jsx("input",{type:he.type==="email"?"email":he.type==="phone"?"tel":"text",name:he.name,autoComplete:"off",value:M[he.name]??"",onChange:Q=>pe(Ne=>({...Ne,[he.name]:Q.target.value})),placeholder:he.placeholder,required:he.isRequired??he.type==="email",className:`${r}-input`,style:{...Se,paddingRight:O.scalingValue(L.right,t),paddingLeft:O.scalingValue(L.left,t),paddingTop:O.scalingValue(L.top,t),paddingBottom:O.scalingValue(L.bottom,t)}},he.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":J,style:{...X,...ce,paddingRight:O.scalingValue(B.right,t),paddingLeft:O.scalingValue(B.left,t),paddingTop:O.scalingValue(B.top,t),paddingBottom:O.scalingValue(B.bottom,t),pointerEvents:l?"auto":void 0},children:j==="submitting"?"...":Z?ye&&a.jsx(sn,{url:ye,className:`${r}-submitBtnIcon`,style:{maxWidth:O.scalingValue(g??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):ge})})]}),ke==="success"&&a.jsx("p",{className:`${r}-success`,style:{...me},children:K}),ke==="error"&&a.jsx("p",{className:`${r}-error`,style:{...me},role:"alert",children:E??xe??ue})]})},Gg={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"},Xg=["hover","focus","filled","success","error"],Yg=`import React, { useMemo, useState } from 'react';
986
986
  import { CommonComponentProps } from '../props';
987
987
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
988
988
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
@@ -1693,7 +1693,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
1693
1693
  .${e}-image-hover-grayscale:hover video {
1694
1694
  filter: grayscale(100%);
1695
1695
  }
1696
- `}const eh=30,th=20,Sa=3,nh=12,ih=32,oh=3,rh=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")},ah=(e,t)=>Array.from({length:t},()=>e).flat(),sh=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},Ld=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),$l=(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),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(l>0)return l;const d=Array.from({length:t},(u,p)=>e.children[p]),c=Ld(d);return c<=0?0:c+r*Math.max(0,t-1)},lh=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Ld(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+r*Math.max(0,e.children.length-1)+l},ch=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},dh=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>ch(i,e))},uh=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??"")},ph=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,mh=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var A,_,g,B;const p=s.useRef(null),x=!!((A=e.image)!=null&&A.url&&uh(e.image));s.useLayoutEffect(()=>{d&&ph(p.current)&&(u==null||u())},[d,(_=e.image)==null?void 0:_.url,u]);const w=n.display==="cover",m=n.ratioValue??"1:1",h=n.reversed??!1,[f,v]=m.split(":").map(Number),S=(h?v:f)/(h?f:v),G=i/S,W=G>o?o:G,U=G>o?o*S:i,H=c(U),I=c(W),z={borderRadius:c(r)},$=w?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...z}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...z},T=((g=e.image)==null?void 0:g.url)&&(x?a.jsx("video",{ref:P=>{p.current=P},src:e.image.url,style:$,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:P=>{p.current=P},src:e.image.url,alt:((B=e.image)==null?void 0:B.name)??"",style:$,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...w?{width:H}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:a.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...w?{width:H,height:I,overflow:"hidden",...z}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:T&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:pt(`${t}-marquee-link`,!w&&`${t}-marquee-link-contain`),children:T}):T})})},gh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>Qg(r,c),[r,c]),{speed:p,direction:x,pauseOnHover:w,gap:m,imageMaxWidth:h,imageMaxHeight:f,hoverEffect:v,cornerRadius:C=0}=e,y=s.useMemo(()=>sh(e.imageFit),[e.imageFit]),S=(t==null?void 0:t.length)??0,G=!!o,W=!n||!!i,U=W&&v!=="off"&&v!=="randomize"?`${r}-image-hover-${v}`:void 0,H=n?!!i:!0,z=((t==null?void 0:t.length)??0)>0&&(H||!!n),$=Math.max(0,p)*eh,T=te=>D.scalingValue(te,n??!1),A=s.useRef(null),_=s.useRef(null),g=s.useRef(null),[B,P]=s.useState(0),Y=H&&w==="on",[ie,L]=s.useState(!1),[O,K]=s.useState({}),ue=s.useRef(O);ue.current=O;const le=s.useRef(null),F=s.useRef(0),pe=s.useRef(null),j=s.useMemo(()=>(t??[]).map(te=>{var $e;return(($e=te.image)==null?void 0:$e.url)??""}).join("\0"),[t]),[se,ne]=s.useState(Sa),ve=s.useMemo(()=>{const te=t??[];return te.length===0||!(H||!!n)?te:ah(te,se)},[t,H,se,n]),Me=s.useMemo(()=>(t??[]).filter(te=>{var $e;return!!(($e=te.image)!=null&&$e.url)}).length,[t]),xe=z?oh:1;s.useLayoutEffect(()=>{F.current=0,K({}),le.current=null,ne(Sa),d(0)},[j]),s.useEffect(()=>{if(!W||v!=="randomize")return;const te=A.current;if(!te)return;const $e=Z=>{K(Q=>{const ce=Array.from(Z).filter(Pe=>Pe in Q&&!dh(te,Pe));if(ce.length===0)return Q;const we={...Q};return ce.forEach(Pe=>{delete we[Pe]}),we})},re=new IntersectionObserver(Z=>{const Q=new Set;for(const ce of Z){const we=ce.target.dataset.marqueeItemIndex,Pe=we!==void 0?Number(we):NaN;Number.isNaN(Pe)||Q.add(Pe)}Q.size>0&&$e(Q)},{root:te,threshold:0});Object.keys(O).forEach(Z=>{const Q=Number(Z);te.querySelectorAll(`[data-marquee-item-index="${Q}"]`).forEach(ce=>re.observe(ce))});const ge={current:0},ye=()=>{const Z=Object.keys(ue.current);Z.length!==0&&($e(Z.map(Number)),ge.current=requestAnimationFrame(ye))};return Object.keys(ue.current).length>0&&(ge.current=requestAnimationFrame(ye)),()=>{cancelAnimationFrame(ge.current),re.disconnect()}},[v,O,W]),s.useLayoutEffect(()=>{if(!z)return;const te=A.current,$e=g.current;if(!te||!$e)return;const re={current:0},ge=()=>{const Q=te.getBoundingClientRect().width||te.offsetWidth,ce=lh($e),we=le.current,Pe=typeof we=="number"&&Math.abs(we-ce)<=.25;le.current=ce;let Ce=se,X=0;if((H||n)&&S>0&&Q>0){const q=$l($e,S);if(q>=ih){X=q;const de=Math.min(nh,Math.max(Sa,Math.ceil(Q/q)+1));Ce=de,de!==se&&ne(de)}}const ae=Ce!==se&&X>0?X*Ce:ce>0?ce:X>0?X*Ce:(()=>{const q=$l($e,S);return q>0?q*Ce:0})();ae>0?d(q=>q<=0?ae:!Pe||Math.round(q)===Math.round(ae)?q:ae):!Pe&&l<=0&&(cancelAnimationFrame(re.current),re.current=requestAnimationFrame(ge))},ye=()=>{cancelAnimationFrame(re.current),re.current=requestAnimationFrame(ge)};pe.current=ye,ye();const Z=new ResizeObserver(ye);return Z.observe(te),Z.observe($e),()=>{pe.current=null,cancelAnimationFrame(re.current),Z.disconnect()}},[H,z,l,j,se,S,n]),s.useLayoutEffect(()=>{if(!z||c<=0)return;const te=_.current;te&&rh(te)},[z,c,x,$]),s.useLayoutEffect(()=>{if(!z||l<=0){P(0);return}const te=_.current,$e=g.current;if(!te||!$e)return;const re=()=>{const ye=te.offsetHeight||te.getBoundingClientRect().height,Z=Array.from($e.children).reduce((ce,we)=>Math.max(ce,we.offsetHeight||we.getBoundingClientRect().height),0),Q=ye>0?ye:Z;P(Q>0?Q:0)};re();const ge=new ResizeObserver(re);return ge.observe(te),ge.observe($e),()=>ge.disconnect()},[z,xe,ve,n,m,h,f,l,y,O]),s.useLayoutEffect(()=>{if(!n||!G||!z||typeof window>"u")return;const te=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(te)},[n,G,z,x,l,B,m,ve]);const b=()=>{Y&&L(!0)},M=()=>{Y&&L(!1)},E=s.useCallback(()=>{var te;F.current=Math.min(Me,F.current+1),(te=pe.current)==null||te.call(pe)},[Me]),V=s.useCallback((te,$e)=>{K(re=>{const ge=re[te]??$e,ye=(t??[]).filter(Q=>Q!==ge);if(ye.length===0)return re;const Z=ye[Math.floor(Math.random()*ye.length)];return{...re,[te]:Z}})},[t]),Se=(te,$e,re,ge)=>{const ye=W&&v==="randomize"&&y.display==="cover"?O[re]??te:te,Z=`max(${T(m)}, ${th}px)`,Q=`calc(-0.5 * (${Z} + ${T(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":re,onMouseEnter:W&&v==="randomize"&&y.display==="cover"?()=>V(re,te):void 0,children:[a.jsx(mh,{item:ye,prefix:r,imageFit:y,imageMaxWidth:h,imageMaxHeight:f,cornerRadius:C,imageHoverClass:U,isEditor:n,isFirstSet:ge,scaled:T,onFirstSetImageDone:E}),G&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:Q,width:Z,height:"100%"}})]},`${$e}-${re}`)};if(z){const te=H?Y&&ie?"paused":"running":"paused",$e=c>0&&$>0?c/$*1e3:0,re=`${Math.max(0,$e)/1e3}s`;return a.jsxs("div",{ref:A,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:B>0?{height:B}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:_,className:`${r}-marquee-track`,"data-direction":x,onMouseEnter:b,onMouseLeave:M,style:{WebkitAnimationDuration:re,animationDuration:re,WebkitAnimationPlayState:te,animationPlayState:te},children:Array.from({length:xe},(ge,ye)=>a.jsx("div",{ref:ye===0?g:void 0,className:pt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:T(m),paddingRight:T(m)},"aria-hidden":ye>0,children:ve.map((Z,Q)=>Se(Z,ye,Q,ye===0&&Q<S))},`set-${ye}`))})]})}return a.jsxs("div",{ref:A,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:pt(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:T(m),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((te,$e)=>Se(te,0,$e))},"marquee-static")]})},hh=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1696
+ `}const eh=30,th=20,Sa=3,nh=12,ih=32,oh=3,rh=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")},ah=(e,t)=>Array.from({length:t},()=>e).flat(),sh=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},Ld=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),$l=(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),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(l>0)return l;const d=Array.from({length:t},(u,p)=>e.children[p]),c=Ld(d);return c<=0?0:c+r*Math.max(0,t-1)},lh=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Ld(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),r=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+r*Math.max(0,e.children.length-1)+l},ch=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},dh=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>ch(i,e))},uh=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??"")},ph=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,mh=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var k,_,g,D;const p=s.useRef(null),x=!!((k=e.image)!=null&&k.url&&uh(e.image));s.useLayoutEffect(()=>{d&&ph(p.current)&&(u==null||u())},[d,(_=e.image)==null?void 0:_.url,u]);const w=n.display==="cover",m=n.ratioValue??"1:1",h=n.reversed??!1,[f,v]=m.split(":").map(Number),S=(h?v:f)/(h?f:v),G=i/S,W=G>o?o:G,U=G>o?o*S:i,H=c(U),I=c(W),z={borderRadius:c(r)},$=w?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...z}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...z},T=((g=e.image)==null?void 0:g.url)&&(x?a.jsx("video",{ref:P=>{p.current=P},src:e.image.url,style:$,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:P=>{p.current=P},src:e.image.url,alt:((D=e.image)==null?void 0:D.name)??"",style:$,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...w?{width:H}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:a.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...w?{width:H,height:I,overflow:"hidden",...z}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:T&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:pt(`${t}-marquee-link`,!w&&`${t}-marquee-link-contain`),children:T}):T})})},gh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=O.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>Qg(r,c),[r,c]),{speed:p,direction:x,pauseOnHover:w,gap:m,imageMaxWidth:h,imageMaxHeight:f,hoverEffect:v,cornerRadius:C=0}=e,y=s.useMemo(()=>sh(e.imageFit),[e.imageFit]),S=(t==null?void 0:t.length)??0,G=!!o,W=!n||!!i,U=W&&v!=="off"&&v!=="randomize"?`${r}-image-hover-${v}`:void 0,H=n?!!i:!0,z=((t==null?void 0:t.length)??0)>0&&(H||!!n),$=Math.max(0,p)*eh,T=te=>O.scalingValue(te,n??!1),k=s.useRef(null),_=s.useRef(null),g=s.useRef(null),[D,P]=s.useState(0),q=H&&w==="on",[ie,L]=s.useState(!1),[B,K]=s.useState({}),ue=s.useRef(B);ue.current=B;const le=s.useRef(null),F=s.useRef(0),pe=s.useRef(null),j=s.useMemo(()=>(t??[]).map(te=>{var $e;return(($e=te.image)==null?void 0:$e.url)??""}).join("\0"),[t]),[se,ne]=s.useState(Sa),ve=s.useMemo(()=>{const te=t??[];return te.length===0||!(H||!!n)?te:ah(te,se)},[t,H,se,n]),ke=s.useMemo(()=>(t??[]).filter(te=>{var $e;return!!(($e=te.image)!=null&&$e.url)}).length,[t]),xe=z?oh:1;s.useLayoutEffect(()=>{F.current=0,K({}),le.current=null,ne(Sa),d(0)},[j]),s.useEffect(()=>{if(!W||v!=="randomize")return;const te=k.current;if(!te)return;const $e=Z=>{K(J=>{const de=Array.from(Z).filter(Pe=>Pe in J&&!dh(te,Pe));if(de.length===0)return J;const be={...J};return de.forEach(Pe=>{delete be[Pe]}),be})},ae=new IntersectionObserver(Z=>{const J=new Set;for(const de of Z){const be=de.target.dataset.marqueeItemIndex,Pe=be!==void 0?Number(be):NaN;Number.isNaN(Pe)||J.add(Pe)}J.size>0&&$e(J)},{root:te,threshold:0});Object.keys(B).forEach(Z=>{const J=Number(Z);te.querySelectorAll(`[data-marquee-item-index="${J}"]`).forEach(de=>ae.observe(de))});const ge={current:0},ye=()=>{const Z=Object.keys(ue.current);Z.length!==0&&($e(Z.map(Number)),ge.current=requestAnimationFrame(ye))};return Object.keys(ue.current).length>0&&(ge.current=requestAnimationFrame(ye)),()=>{cancelAnimationFrame(ge.current),ae.disconnect()}},[v,B,W]),s.useLayoutEffect(()=>{if(!z)return;const te=k.current,$e=g.current;if(!te||!$e)return;const ae={current:0},ge=()=>{const J=te.getBoundingClientRect().width||te.offsetWidth,de=lh($e),be=le.current,Pe=typeof be=="number"&&Math.abs(be-de)<=.25;le.current=de;let Se=se,X=0;if((H||n)&&S>0&&J>0){const Y=$l($e,S);if(Y>=ih){X=Y;const ce=Math.min(nh,Math.max(Sa,Math.ceil(J/Y)+1));Se=ce,ce!==se&&ne(ce)}}const re=Se!==se&&X>0?X*Se:de>0?de:X>0?X*Se:(()=>{const Y=$l($e,S);return Y>0?Y*Se:0})();re>0?d(Y=>Y<=0?re:!Pe||Math.round(Y)===Math.round(re)?Y:re):!Pe&&l<=0&&(cancelAnimationFrame(ae.current),ae.current=requestAnimationFrame(ge))},ye=()=>{cancelAnimationFrame(ae.current),ae.current=requestAnimationFrame(ge)};pe.current=ye,ye();const Z=new ResizeObserver(ye);return Z.observe(te),Z.observe($e),()=>{pe.current=null,cancelAnimationFrame(ae.current),Z.disconnect()}},[H,z,l,j,se,S,n]),s.useLayoutEffect(()=>{if(!z||c<=0)return;const te=_.current;te&&rh(te)},[z,c,x,$]),s.useLayoutEffect(()=>{if(!z||l<=0){P(0);return}const te=_.current,$e=g.current;if(!te||!$e)return;const ae=()=>{const ye=te.offsetHeight||te.getBoundingClientRect().height,Z=Array.from($e.children).reduce((de,be)=>Math.max(de,be.offsetHeight||be.getBoundingClientRect().height),0),J=ye>0?ye:Z;P(J>0?J:0)};ae();const ge=new ResizeObserver(ae);return ge.observe(te),ge.observe($e),()=>ge.disconnect()},[z,xe,ve,n,m,h,f,l,y,B]),s.useLayoutEffect(()=>{if(!n||!G||!z||typeof window>"u")return;const te=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(te)},[n,G,z,x,l,D,m,ve]);const b=()=>{q&&L(!0)},M=()=>{q&&L(!1)},E=s.useCallback(()=>{var te;F.current=Math.min(ke,F.current+1),(te=pe.current)==null||te.call(pe)},[ke]),V=s.useCallback((te,$e)=>{K(ae=>{const ge=ae[te]??$e,ye=(t??[]).filter(J=>J!==ge);if(ye.length===0)return ae;const Z=ye[Math.floor(Math.random()*ye.length)];return{...ae,[te]:Z}})},[t]),Ce=(te,$e,ae,ge)=>{const ye=W&&v==="randomize"&&y.display==="cover"?B[ae]??te:te,Z=`max(${T(m)}, ${th}px)`,J=`calc(-0.5 * (${Z} + ${T(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":ae,onMouseEnter:W&&v==="randomize"&&y.display==="cover"?()=>V(ae,te):void 0,children:[a.jsx(mh,{item:ye,prefix:r,imageFit:y,imageMaxWidth:h,imageMaxHeight:f,cornerRadius:C,imageHoverClass:U,isEditor:n,isFirstSet:ge,scaled:T,onFirstSetImageDone:E}),G&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:J,width:Z,height:"100%"}})]},`${$e}-${ae}`)};if(z){const te=H?q&&ie?"paused":"running":"paused",$e=c>0&&$>0?c/$*1e3:0,ae=`${Math.max(0,$e)/1e3}s`;return a.jsxs("div",{ref:k,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:D>0?{height:D}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:_,className:`${r}-marquee-track`,"data-direction":x,onMouseEnter:b,onMouseLeave:M,style:{WebkitAnimationDuration:ae,animationDuration:ae,WebkitAnimationPlayState:te,animationPlayState:te},children:Array.from({length:xe},(ge,ye)=>a.jsx("div",{ref:ye===0?g:void 0,className:pt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:T(m),paddingRight:T(m)},"aria-hidden":ye>0,children:ve.map((Z,J)=>Ce(Z,ye,J,ye===0&&J<S))},`set-${ye}`))})]})}return a.jsxs("div",{ref:k,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:pt(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:T(m),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((te,$e)=>Ce(te,0,$e))},"marquee-static")]})},hh=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1697
1697
  import cn from 'classnames';
1698
1698
  import { CommonComponentProps } from '../props';
1699
1699
  import { scalingValue } from '../utils/scalingValue';
@@ -2605,7 +2605,7 @@ ${o}
2605
2605
  left: -9999px;
2606
2606
  top: 0;
2607
2607
  }
2608
- `}const vh=30,Ca=3,bh=12,wh=3,rs=.72,Sh=100,Ch=10,$h=e=>Math.max(0,e)/Sh,Th=e=>Math.max(0,e)/Ch,Ih=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")},Rh=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ki={ctx:void 0},Lh=()=>ki.ctx!==void 0?ki.ctx:typeof document>"u"?(ki.ctx=null,ki.ctx):(ki.ctx=document.createElement("canvas").getContext("2d"),ki.ctx),Ph=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},Eh=e=>{e.style.transform=""},Mh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},kh=(e,t)=>{const n=(i,o)=>{if(!i||i===t)return o;const r=o+i.offsetLeft,l=i.offsetParent;return!l||l===i?r:n(l,r)};return n(e,e.offsetWidth/2)},Ah=96,Fh=(e,t,n)=>{if(t<=0||e<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),r=new Float64Array(n+1),l=e*t,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const x=p*c,w=x+c;o[p+1]=w,r[p+1]=r[p]+(d(x)+d(w))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},_h=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:d}=e,c=(m,h)=>{if(h-m<=1)return[m,h];const f=m+h>>1;return l[f]<=r?c(f,h):c(m,f)},[u,p]=c(0,l.length-1),x=l[p]-l[u],w=x>0?(r-l[u])/x:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*w)},Nh=(e,t,n,i)=>{const o=Math.max(0,n),r=e>0?2*Math.PI*o/e:0,l=p=>i+t*Math.sin(r*p),d=p=>t*r*Math.cos(r*p),c=Math.max(4,Math.ceil(o*4)),u=Array.from({length:c},(p,x)=>{const w=x/c*e,m=(x+1)/c*e,h=m-w,f=l(w),v=l(m),C=w+h/3,y=f+d(w)*h/3,S=m-h/3,G=v-d(m)*h/3;return`C${C.toFixed(2)} ${y.toFixed(2)} ${S.toFixed(2)} ${G.toFixed(2)} ${m.toFixed(2)} ${v.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},Wh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${rs}em`},u=((m=e.image)==null?void 0:m.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),x=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((h,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),w=a.jsxs(a.Fragment,{children:[p,x]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:w}):w})},Hh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=D.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:x,layoutType:w,curveAmplitude:m,curveFrequency:h,textFontFamily:f,textFontSettings:v,textFontSize:C,textLineHeight:y,textLetterSpacing:S,textWordSpacing:G,textTextAppearance:W,textColor:U,backgroundColor:H,ribbonWidth:I}=e,z=I??y,$=w==="curve",T=$h(m),A=Th(h),_=s.useMemo(()=>xh(o,d,$),[o,d,$]),g=s.useMemo(()=>qt({fontSettings:{fontFamily:f,fontWeight:v.fontWeight,fontStyle:v.fontStyle},letterSpacing:S,wordSpacing:G,fontSize:C,lineHeight:y,textAppearance:W,color:U},n),[f,v,S,G,C,y,W,U,n]),B=k=>D.scalingValue(k,n??!1),P=((t==null?void 0:t.length)??0)>0,Y=n?!!i:!0,ie=P&&(Y||!!n),L=Math.max(0,c)*vh,O=Y&&p==="on",[K,ue]=s.useState(!1),le=Y?O&&K?"paused":"running":"paused",F=le==="running"&&L>0&&d>0,pe=s.useRef(null),j=s.useRef(null),se=s.useRef(null),ne=s.useRef(null),ve=s.useRef(null),Me=s.useRef(null),xe=s.useRef(F),b=s.useRef(null);xe.current=F;const[M,E]=s.useState(0),[V,Se]=s.useState(0),[te,$e]=s.useState(0),[re,ge]=s.useState(0),[ye,Z]=s.useState(0),Q=s.useMemo(()=>(t??[]).map(k=>{var ee;return`${k.text}\0${((ee=k.image)==null?void 0:ee.url)??""}`}).join("\0"),[t]),[ce,we]=s.useState(Ca),Pe=s.useMemo(()=>{const k=t??[];return k.length===0||!(Y||n)?k:Rh(k,ce)},[t,Y,ce,n]),Ce=ie?wh:1;s.useLayoutEffect(()=>{we(Ca),l(0)},[Q]),s.useLayoutEffect(()=>{var Be;const k=Me.current;if(!k)return;const ee=()=>{const Ve=getComputedStyle(k),rt=parseFloat(Ve.fontSize)||0;if(rt<=0)return;const Ze=Lh();if(!Ze){E(rt*rs),Se(0);return}Ze.font=`${Ve.fontStyle} ${Ve.fontWeight} ${rt}px ${Ve.fontFamily}`;const _e=Ze.measureText("H"),qe=_e.actualBoundingBoxAscent>0?_e.actualBoundingBoxAscent:rt*rs,Oe=Math.max(0,_e.actualBoundingBoxDescent||0),nt=_e.fontBoundingBoxAscent||0,at=_e.fontBoundingBoxDescent||0;E(St=>Math.abs(St-qe)>.5?qe:St);const st=nt>0||at>0?(at-Oe-(nt-qe))/2:0;Se(St=>Math.abs(St-st)>.25?st:St)};ee();const Te=typeof document<"u"?document.fonts:void 0;(Be=Te==null?void 0:Te.ready)==null||Be.then(ee).catch(()=>{});const He=new ResizeObserver(ee);return He.observe(k),()=>He.disconnect()},[g.fontFamily,g.fontWeight,g.fontStyle,g.fontSize,g.lineHeight]),s.useLayoutEffect(()=>{if(!ie)return;const k=pe.current,ee=ne.current;if(!k||!ee)return;const Te={id:0},He=()=>{const Ve=k.offsetWidth||k.getBoundingClientRect().width,rt=ee.offsetWidth||ee.getBoundingClientRect().width;if(P&&Ve>0&&rt>0){const Ze=rt/ce;if(Ze>0){const _e=Math.min(bh,Math.max(Ca,Math.ceil(Ve/Ze)+1));if(_e!==ce){we(_e);return}}}rt>0&&l(rt)};Te.id=requestAnimationFrame(He);const Be=new ResizeObserver(()=>{cancelAnimationFrame(Te.id),Te.id=requestAnimationFrame(He)});return Be.observe(k),Be.observe(ee),()=>{cancelAnimationFrame(Te.id),Be.disconnect()}},[ie,Q,ce,P,M]),s.useLayoutEffect(()=>{const k=ve.current;if(!k)return;const ee={id:0},Te=()=>{const Be=k.offsetHeight;Be>0&&Z(Ve=>Math.abs(Ve-Be)>.5?Be:Ve)};ee.id=requestAnimationFrame(Te);const He=new ResizeObserver(()=>{cancelAnimationFrame(ee.id),ee.id=requestAnimationFrame(Te)});return He.observe(k),()=>{cancelAnimationFrame(ee.id),He.disconnect()}},[z,n]),s.useLayoutEffect(()=>{if(!$){$e(0),ge(0);return}const k=pe.current,ee=ne.current;if(!k||!ee)return;const Te={id:0},He=()=>{const Ve=k.offsetWidth,rt=ee.offsetHeight;Ve>0&&ge(Ze=>Math.abs(Ze-Ve)>.5?Ve:Ze),rt>0&&$e(Ze=>Math.abs(Ze-rt)>.5?rt:Ze)};Te.id=requestAnimationFrame(He);const Be=new ResizeObserver(()=>{cancelAnimationFrame(Te.id),Te.id=requestAnimationFrame(He)});return Be.observe(k),Be.observe(ee),()=>{cancelAnimationFrame(Te.id),Be.disconnect()}},[$,Q,M,y,C,ie]),s.useLayoutEffect(()=>{if(!ie||d<=0)return;const k=se.current;k&&Ih(k)},[ie,d,u,L]),s.useLayoutEffect(()=>{if(!$||!P)return;const k=pe.current;if(!k)return;const ee={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Te=()=>{for(const _e of ee.itemsCache)for(const qe of _e.glyphs)Eh(qe.inner)},He=()=>{const _e=j.current??k;ee.itemsCache=Array.from(k.querySelectorAll("[data-marquee-text-item]"),qe=>{const Oe=[];return qe.querySelectorAll("[data-marquee-wave-node]").forEach(nt=>{const at=nt.firstElementChild;at&&Oe.push({inner:at,layoutLocalX:kh(nt,_e)})}),{item:qe,glyphs:Oe}}),ee.cacheDirty=!1},Be=()=>{ee.cacheDirty&&He();const qe=(j.current??k).offsetWidth||1,Oe=qe*T,nt=2*Math.PI*A/qe,at=`${qe}|${Oe}|${nt}`;at!==ee.lutKey&&(ee.lutKey=at,ee.lut=Fh(Oe,nt,Ah));const st=se.current,St=st?Mh(getComputedStyle(st).transform):0,Yt=k.getBoundingClientRect(),Zt=Yt.left,vt=Yt.right,wt=ee.lut&&ee.lut.wavelength>0?Math.max(0,(ee.lut.periodArc/ee.lut.wavelength-1)*qe):0;for(const{item:Bt,glyphs:At}of ee.itemsCache){const xt=Bt.getBoundingClientRect();if(!(xt.right<Zt||xt.left>vt+wt))for(const Ft of At){const Nt=Ft.layoutLocalX+St,Ut=ee.lut?_h(ee.lut,Nt):Nt,Jt=nt*Ut,Tt=Oe*Math.sin(Jt),Wt=Oe*nt*Math.cos(Jt),rn=Math.atan(Wt)*(180/Math.PI);Ph(Ft.inner,Ut-Nt,Tt,rn)}}},Ve=()=>{ee.cancelled||(ee.raf=0,Be(),xe.current&&!document.hidden&&(ee.raf=requestAnimationFrame(Ve)))},rt=()=>{ee.cancelled||ee.raf||(ee.raf=requestAnimationFrame(Ve))};b.current=rt,rt();const Ze=()=>{if(document.hidden){cancelAnimationFrame(ee.raf),ee.raf=0;return}rt()};return document.addEventListener("visibilitychange",Ze),()=>{ee.cancelled=!0,b.current=null,cancelAnimationFrame(ee.raf),document.removeEventListener("visibilitychange",Ze),Te()}},[$,T,A,P,r,Q,ce,M]),s.useLayoutEffect(()=>{var k;(k=b.current)==null||k.call(b)},[F]);const X=()=>{O&&ue(!0)},me=()=>{O&&ue(!1)},ae=$?T*100:0,q=B(z),de={minHeight:q,...$?{paddingTop:`${ae}%`,paddingBottom:`${ae}%`}:{}},ke={height:q,...$?{visibility:"hidden"}:{backgroundColor:H}},he={gap:B(x),minHeight:q},J=re*T,Ne=ye>0?ye:te,Fe=Math.max(te,Ne),et=$&&re>0&&Fe>0?Nh(re,J,A,J+Fe/2):"",Je=J*2+Fe,dt=et?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${re} ${Je}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:et,fill:"none",stroke:H,strokeWidth:Ne,strokeLinecap:"round",strokeLinejoin:"round"})}):null,tt=a.jsx("div",{ref:ve,className:`${o}-ribbon`,style:ke,"aria-hidden":!0}),De=(k,ee,Te)=>a.jsx(Wh,{item:k,prefix:o,textCss:g,capHeightPx:M,opticalOffsetY:V,imageGapPx:B(x),isCurve:$},`${ee}-${Te}`),Ie=a.jsx("span",{ref:Me,"aria-hidden":!0,className:`${o}-cap-ref`,style:g,children:"H"}),We=d>0&&L>0?d/L*1e3:0,je=`${Math.max(0,We)/1e3}s`,Ue=ie?a.jsx("div",{ref:se,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:X,onMouseLeave:me,style:{WebkitAnimationDuration:je,animationDuration:je,WebkitAnimationPlayState:le,animationPlayState:le},children:Array.from({length:Ce},(k,ee)=>a.jsx("div",{ref:ee===0?ne:void 0,className:`${o}-marquee-set`,style:{...he,paddingRight:B(x)},"aria-hidden":ee>0,children:Pe.map((Te,He)=>De(Te,ee,He))},`set-${ee}`))}):a.jsx("div",{ref:ne,className:pt(`${o}-marquee-set`,`${o}-marquee-static`),style:he,children:t==null?void 0:t.map((k,ee)=>De(k,0,ee))});return a.jsxs("div",{ref:pe,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_}}),Ie,a.jsxs("div",{ref:j,className:`${o}-marquee-wrapper`,style:de,children:[tt,dt,Ue]})]})},Dh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
2608
+ `}const vh=30,Ca=3,bh=12,wh=3,rs=.72,Sh=100,Ch=10,$h=e=>Math.max(0,e)/Sh,Th=e=>Math.max(0,e)/Ch,Ih=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")},Rh=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ki={ctx:void 0},Lh=()=>ki.ctx!==void 0?ki.ctx:typeof document>"u"?(ki.ctx=null,ki.ctx):(ki.ctx=document.createElement("canvas").getContext("2d"),ki.ctx),Ph=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},Eh=e=>{e.style.transform=""},Mh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},kh=(e,t)=>{const n=(i,o)=>{if(!i||i===t)return o;const r=o+i.offsetLeft,l=i.offsetParent;return!l||l===i?r:n(l,r)};return n(e,e.offsetWidth/2)},Ah=96,Fh=(e,t,n)=>{if(t<=0||e<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),r=new Float64Array(n+1),l=e*t,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const x=p*c,w=x+c;o[p+1]=w,r[p+1]=r[p]+(d(x)+d(w))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},_h=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:d}=e,c=(m,h)=>{if(h-m<=1)return[m,h];const f=m+h>>1;return l[f]<=r?c(f,h):c(m,f)},[u,p]=c(0,l.length-1),x=l[p]-l[u],w=x>0?(r-l[u])/x:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*w)},Nh=(e,t,n,i)=>{const o=Math.max(0,n),r=e>0?2*Math.PI*o/e:0,l=p=>i+t*Math.sin(r*p),d=p=>t*r*Math.cos(r*p),c=Math.max(4,Math.ceil(o*4)),u=Array.from({length:c},(p,x)=>{const w=x/c*e,m=(x+1)/c*e,h=m-w,f=l(w),v=l(m),C=w+h/3,y=f+d(w)*h/3,S=m-h/3,G=v-d(m)*h/3;return`C${C.toFixed(2)} ${y.toFixed(2)} ${S.toFixed(2)} ${G.toFixed(2)} ${m.toFixed(2)} ${v.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},Wh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${rs}em`},u=((m=e.image)==null?void 0:m.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),x=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((h,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),w=a.jsxs(a.Fragment,{children:[p,x]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:w}):w})},Hh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=O.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:x,layoutType:w,curveAmplitude:m,curveFrequency:h,textFontFamily:f,textFontSettings:v,textFontSize:C,textLineHeight:y,textLetterSpacing:S,textWordSpacing:G,textTextAppearance:W,textColor:U,backgroundColor:H,ribbonWidth:I}=e,z=I??y,$=w==="curve",T=$h(m),k=Th(h),_=s.useMemo(()=>xh(o,d,$),[o,d,$]),g=s.useMemo(()=>qt({fontSettings:{fontFamily:f,fontWeight:v.fontWeight,fontStyle:v.fontStyle},letterSpacing:S,wordSpacing:G,fontSize:C,lineHeight:y,textAppearance:W,color:U},n),[f,v,S,G,C,y,W,U,n]),D=A=>O.scalingValue(A,n??!1),P=((t==null?void 0:t.length)??0)>0,q=n?!!i:!0,ie=P&&(q||!!n),L=Math.max(0,c)*vh,B=q&&p==="on",[K,ue]=s.useState(!1),le=q?B&&K?"paused":"running":"paused",F=le==="running"&&L>0&&d>0,pe=s.useRef(null),j=s.useRef(null),se=s.useRef(null),ne=s.useRef(null),ve=s.useRef(null),ke=s.useRef(null),xe=s.useRef(F),b=s.useRef(null);xe.current=F;const[M,E]=s.useState(0),[V,Ce]=s.useState(0),[te,$e]=s.useState(0),[ae,ge]=s.useState(0),[ye,Z]=s.useState(0),J=s.useMemo(()=>(t??[]).map(A=>{var ee;return`${A.text}\0${((ee=A.image)==null?void 0:ee.url)??""}`}).join("\0"),[t]),[de,be]=s.useState(Ca),Pe=s.useMemo(()=>{const A=t??[];return A.length===0||!(q||n)?A:Rh(A,de)},[t,q,de,n]),Se=ie?wh:1;s.useLayoutEffect(()=>{be(Ca),l(0)},[J]),s.useLayoutEffect(()=>{var Be;const A=ke.current;if(!A)return;const ee=()=>{const Ve=getComputedStyle(A),rt=parseFloat(Ve.fontSize)||0;if(rt<=0)return;const Ze=Lh();if(!Ze){E(rt*rs),Ce(0);return}Ze.font=`${Ve.fontStyle} ${Ve.fontWeight} ${rt}px ${Ve.fontFamily}`;const _e=Ze.measureText("H"),qe=_e.actualBoundingBoxAscent>0?_e.actualBoundingBoxAscent:rt*rs,Oe=Math.max(0,_e.actualBoundingBoxDescent||0),nt=_e.fontBoundingBoxAscent||0,at=_e.fontBoundingBoxDescent||0;E(St=>Math.abs(St-qe)>.5?qe:St);const st=nt>0||at>0?(at-Oe-(nt-qe))/2:0;Ce(St=>Math.abs(St-st)>.25?st:St)};ee();const Te=typeof document<"u"?document.fonts:void 0;(Be=Te==null?void 0:Te.ready)==null||Be.then(ee).catch(()=>{});const He=new ResizeObserver(ee);return He.observe(A),()=>He.disconnect()},[g.fontFamily,g.fontWeight,g.fontStyle,g.fontSize,g.lineHeight]),s.useLayoutEffect(()=>{if(!ie)return;const A=pe.current,ee=ne.current;if(!A||!ee)return;const Te={id:0},He=()=>{const Ve=A.offsetWidth||A.getBoundingClientRect().width,rt=ee.offsetWidth||ee.getBoundingClientRect().width;if(P&&Ve>0&&rt>0){const Ze=rt/de;if(Ze>0){const _e=Math.min(bh,Math.max(Ca,Math.ceil(Ve/Ze)+1));if(_e!==de){be(_e);return}}}rt>0&&l(rt)};Te.id=requestAnimationFrame(He);const Be=new ResizeObserver(()=>{cancelAnimationFrame(Te.id),Te.id=requestAnimationFrame(He)});return Be.observe(A),Be.observe(ee),()=>{cancelAnimationFrame(Te.id),Be.disconnect()}},[ie,J,de,P,M]),s.useLayoutEffect(()=>{const A=ve.current;if(!A)return;const ee={id:0},Te=()=>{const Be=A.offsetHeight;Be>0&&Z(Ve=>Math.abs(Ve-Be)>.5?Be:Ve)};ee.id=requestAnimationFrame(Te);const He=new ResizeObserver(()=>{cancelAnimationFrame(ee.id),ee.id=requestAnimationFrame(Te)});return He.observe(A),()=>{cancelAnimationFrame(ee.id),He.disconnect()}},[z,n]),s.useLayoutEffect(()=>{if(!$){$e(0),ge(0);return}const A=pe.current,ee=ne.current;if(!A||!ee)return;const Te={id:0},He=()=>{const Ve=A.offsetWidth,rt=ee.offsetHeight;Ve>0&&ge(Ze=>Math.abs(Ze-Ve)>.5?Ve:Ze),rt>0&&$e(Ze=>Math.abs(Ze-rt)>.5?rt:Ze)};Te.id=requestAnimationFrame(He);const Be=new ResizeObserver(()=>{cancelAnimationFrame(Te.id),Te.id=requestAnimationFrame(He)});return Be.observe(A),Be.observe(ee),()=>{cancelAnimationFrame(Te.id),Be.disconnect()}},[$,J,M,y,C,ie]),s.useLayoutEffect(()=>{if(!ie||d<=0)return;const A=se.current;A&&Ih(A)},[ie,d,u,L]),s.useLayoutEffect(()=>{if(!$||!P)return;const A=pe.current;if(!A)return;const ee={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Te=()=>{for(const _e of ee.itemsCache)for(const qe of _e.glyphs)Eh(qe.inner)},He=()=>{const _e=j.current??A;ee.itemsCache=Array.from(A.querySelectorAll("[data-marquee-text-item]"),qe=>{const Oe=[];return qe.querySelectorAll("[data-marquee-wave-node]").forEach(nt=>{const at=nt.firstElementChild;at&&Oe.push({inner:at,layoutLocalX:kh(nt,_e)})}),{item:qe,glyphs:Oe}}),ee.cacheDirty=!1},Be=()=>{ee.cacheDirty&&He();const qe=(j.current??A).offsetWidth||1,Oe=qe*T,nt=2*Math.PI*k/qe,at=`${qe}|${Oe}|${nt}`;at!==ee.lutKey&&(ee.lutKey=at,ee.lut=Fh(Oe,nt,Ah));const st=se.current,St=st?Mh(getComputedStyle(st).transform):0,Yt=A.getBoundingClientRect(),Zt=Yt.left,vt=Yt.right,wt=ee.lut&&ee.lut.wavelength>0?Math.max(0,(ee.lut.periodArc/ee.lut.wavelength-1)*qe):0;for(const{item:Bt,glyphs:At}of ee.itemsCache){const xt=Bt.getBoundingClientRect();if(!(xt.right<Zt||xt.left>vt+wt))for(const Ft of At){const Nt=Ft.layoutLocalX+St,Ut=ee.lut?_h(ee.lut,Nt):Nt,Jt=nt*Ut,Tt=Oe*Math.sin(Jt),Wt=Oe*nt*Math.cos(Jt),rn=Math.atan(Wt)*(180/Math.PI);Ph(Ft.inner,Ut-Nt,Tt,rn)}}},Ve=()=>{ee.cancelled||(ee.raf=0,Be(),xe.current&&!document.hidden&&(ee.raf=requestAnimationFrame(Ve)))},rt=()=>{ee.cancelled||ee.raf||(ee.raf=requestAnimationFrame(Ve))};b.current=rt,rt();const Ze=()=>{if(document.hidden){cancelAnimationFrame(ee.raf),ee.raf=0;return}rt()};return document.addEventListener("visibilitychange",Ze),()=>{ee.cancelled=!0,b.current=null,cancelAnimationFrame(ee.raf),document.removeEventListener("visibilitychange",Ze),Te()}},[$,T,k,P,r,J,de,M]),s.useLayoutEffect(()=>{var A;(A=b.current)==null||A.call(b)},[F]);const X=()=>{B&&ue(!0)},me=()=>{B&&ue(!1)},re=$?T*100:0,Y=D(z),ce={minHeight:Y,...$?{paddingTop:`${re}%`,paddingBottom:`${re}%`}:{}},Ee={height:Y,...$?{visibility:"hidden"}:{backgroundColor:H}},he={gap:D(x),minHeight:Y},Q=ae*T,Ne=ye>0?ye:te,Fe=Math.max(te,Ne),et=$&&ae>0&&Fe>0?Nh(ae,Q,k,Q+Fe/2):"",Je=Q*2+Fe,dt=et?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${ae} ${Je}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:et,fill:"none",stroke:H,strokeWidth:Ne,strokeLinecap:"round",strokeLinejoin:"round"})}):null,tt=a.jsx("div",{ref:ve,className:`${o}-ribbon`,style:Ee,"aria-hidden":!0}),De=(A,ee,Te)=>a.jsx(Wh,{item:A,prefix:o,textCss:g,capHeightPx:M,opticalOffsetY:V,imageGapPx:D(x),isCurve:$},`${ee}-${Te}`),Ie=a.jsx("span",{ref:ke,"aria-hidden":!0,className:`${o}-cap-ref`,style:g,children:"H"}),We=d>0&&L>0?d/L*1e3:0,je=`${Math.max(0,We)/1e3}s`,Ue=ie?a.jsx("div",{ref:se,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:X,onMouseLeave:me,style:{WebkitAnimationDuration:je,animationDuration:je,WebkitAnimationPlayState:le,animationPlayState:le},children:Array.from({length:Se},(A,ee)=>a.jsx("div",{ref:ee===0?ne:void 0,className:`${o}-marquee-set`,style:{...he,paddingRight:D(x)},"aria-hidden":ee>0,children:Pe.map((Te,He)=>De(Te,ee,He))},`set-${ee}`))}):a.jsx("div",{ref:ne,className:pt(`${o}-marquee-set`,`${o}-marquee-static`),style:he,children:t==null?void 0:t.map((A,ee)=>De(A,0,ee))});return a.jsxs("div",{ref:pe,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_}}),Ie,a.jsxs("div",{ref:j,className:`${o}-marquee-wrapper`,style:ce,children:[tt,dt,Ue]})]})},Dh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
2609
2609
  import cn from 'classnames';
2610
2610
  import { CommonComponentProps } from '../props';
2611
2611
  import { scalingValue } from '../utils/scalingValue';
@@ -3535,7 +3535,7 @@ type MarqueeTextProps = {
3535
3535
  pointer-events: auto;
3536
3536
  z-index: 10;
3537
3537
  }
3538
- `}const Vh=30,Tl=2,Gh=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")},Xh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:x,corners:w,stroke:m,strokeColor:h,bgColor:f,padding:v,logoMarginTop:C,logoWidth:y,logoHeight:S,captionMarginTop:G}=e,W=!!o,U=((t==null?void 0:t.length)??0)>0,H=d>0&&(!n||i),I=U&&(H||n),z=Math.max(0,d)*Vh,$=X=>D.scalingValue(X,n??!1),T=s.useRef(null),A=s.useRef(null),_=s.useRef(null),[g,B]=s.useState(0),[P,Y]=s.useState(0),ie=P>0?P:0,L=s.useMemo(()=>jh(r,ie),[r,ie]),[O,K]=s.useState(0),ue=H&&u==="on",[le,F]=s.useState(!1),pe=s.useRef(null),[j,se]=s.useState(0),[ne,ve]=s.useState(0),Me=s.useRef(null),xe=X=>{var ae,q,de,ke,he;return{fontSettings:{fontFamily:(e==null?void 0:e[`${X}FontFamily`])??"Arial",fontWeight:((ae=e==null?void 0:e[`${X}FontSettings`])==null?void 0:ae.fontWeight)??400,fontStyle:((q=e==null?void 0:e[`${X}FontSettings`])==null?void 0:q.fontStyle)??"normal"},textAppearance:{textTransform:((de=e==null?void 0:e[`${X}TextAppearance`])==null?void 0:de.textTransform)??"none",textDecoration:((ke=e==null?void 0:e[`${X}TextAppearance`])==null?void 0:ke.textDecoration)??"none",fontVariant:((he=e==null?void 0:e[`${X}TextAppearance`])==null?void 0:he.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${X}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${X}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${X}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${X}LineHeight`])??.01,color:(e==null?void 0:e[`${X}Color`])??"#000000"}},b=xe("text"),M=xe("caption"),E=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(X=>{var me,ae;return(((me=X.text)==null?void 0:me.length)??0)>0||(((ae=X.caption)==null?void 0:ae.length)??0)>0}),[t]),V=s.useMemo(()=>!I||(t==null?void 0:t.length)===0?1:P<=0||g<=0?Tl:Math.max(Tl,Math.ceil(g/P)+1),[I,t==null?void 0:t.length,P,g]);s.useLayoutEffect(()=>{if(!I)return;const X=T.current,me=_.current;if(!X||!me)return;let ae=0;const q=()=>{const he=X.getBoundingClientRect().width,J=me.getBoundingClientRect().width,Ne=Me.current,Fe=typeof Ne=="number"&&Math.abs(Ne-J)<=.25;if(Me.current=J,B(he),typeof J=="number"&&J>0&&P<=0){Y(J);return}Fe&&J!==P?Y(J):!Fe&&P<=0&&(cancelAnimationFrame(ae),ae=requestAnimationFrame(q))},de=()=>{cancelAnimationFrame(ae),ae=requestAnimationFrame(q)};de();const ke=new ResizeObserver(de);return ke.observe(X),ke.observe(me),()=>{cancelAnimationFrame(ae),ke.disconnect()}},[H,I,P]);const Se=ie>0&&z>0?ie/z*1e3:0,te=`${Math.max(0,Se)/1e3}s`;s.useLayoutEffect(()=>{if(!I||ie<=0)return;const X=A.current;X&&Gh(X)},[I,ie,c]),s.useLayoutEffect(()=>{if(!I){K(0);return}const X=_.current,me=A.current;if(!X||!me)return;const ae=()=>{let de=0;for(let ke=0;ke<X.children.length;ke++){const J=X.children[ke].firstElementChild;J&&(de=Math.max(de,J.offsetHeight))}de<=0&&(de=me.offsetHeight),K(de>0?de:0)};ae();const q=new ResizeObserver(ae);return q.observe(X),q.observe(me),()=>{q.disconnect()}},[I,V,t,n,p,x,v,m,w,y,S,j,ne]);const $e=()=>{ue&&F(!0)},re=()=>{ue&&F(!1)},ge=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),ye=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),Z=s.useCallback((X,me,ae,q)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[a.jsx("div",{"data-controls":W?q==null?void 0:q.controlsName:void 0,"data-controls-axis":W?"y":void 0,className:W?`${r}-control`:void 0,style:{height:$((q==null?void 0:q.marginTop)??0)}}),a.jsx("div",{...q!=null&&q.dataMeasureKind?{"data-testimonial-measure":q.dataMeasureKind}:{},style:{...qt(X,n),textAlign:ye,pointerEvents:"auto",...typeof(q==null?void 0:q.minHeightPx)=="number"&&q.minHeightPx>0?{minHeight:q.minHeightPx}:{}},children:a.jsx(Ri,{content:me})})]},ae),[ge,ye,n,W,r,$]),Q=s.useCallback((X,me,ae)=>{var q,de,ke;return a.jsxs("div",{style:{padding:`${$(v.top)} ${$(v.right)} ${$(v.bottom)} ${$(v.left)}`,width:$(x+m*2),height:"100%",borderRadius:$(w),border:`${$(m)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:f}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:ge,textAlign:ye},children:[X.text&&Z(b,X.text,"text",ae!=null&&ae.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ae==null?void 0:ae.textMinHeightPx)=="number"&&ae.textMinHeightPx>0?{minHeightPx:ae.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[a.jsx("div",{"data-controls":W&&!(ae!=null&&ae.dataMeasureAttrs)?"logoMarginTop":void 0,className:W&&!(ae!=null&&ae.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:$(C)}}),a.jsx("div",{style:{width:$(y),height:$(S)},children:((q=X.logo)==null?void 0:q.url)&&a.jsx("img",{src:X.logo.url,alt:((de=X.logo)==null?void 0:de.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((ke=X.logo)==null?void 0:ke.objectFit)||"contain"}})})]}),X.caption&&Z(M,X.caption,"caption",{...ae!=null&&ae.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:G,...ae!=null&&ae.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ae==null?void 0:ae.captionMinHeightPx)=="number"&&ae.captionMinHeightPx>0?{minHeightPx:ae.captionMinHeightPx}:{}})]})]},me)},[f,G,M,x,w,S,C,y,ge,ye,v.bottom,v.left,v.right,v.top,Z,m,h,b,n,W,r]),ce=s.useCallback(X=>{se(X.maxTextPx),ve(X.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!E){ce({maxTextPx:0,maxCaptionPx:0});return}const X=pe.current;if(!X)return;const me=()=>{D.readTestimonialTextMeasure(X,ce)};me();const ae=new ResizeObserver(me);return ae.observe(X),()=>{ae.disconnect()}},[E,ce,t,Q]);const we=E?{textMinHeightPx:j,captionMinHeightPx:ne}:void 0,Pe=E?a.jsx("div",{ref:pe,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((X,me)=>Q(X,`measure-${me}`,{dataMeasureAttrs:!0}))}):null,Ce=(X,me)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Q(X,`card-${me}`,we),W&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${$(p)})`,width:$(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},me);if(I){const X=H?ue&&le?"paused":"running":"paused";return a.jsxs("div",{ref:T,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...O>0?{height:O}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),Pe,a.jsx("div",{ref:A,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:$e,onMouseLeave:re,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",animationDuration:te,WebkitAnimationDuration:te,animationPlayState:X,WebkitAnimationPlayState:X},children:Array.from({length:V},(me,ae)=>a.jsx("div",{ref:ae===0?_:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:$(p),paddingRight:$(p)},"aria-hidden":ae>0,children:t==null?void 0:t.map((q,de)=>Ce(q,`${ae}-${de}`))},`set-${ae}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),Pe,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((X,me)=>Ce(X,me))})]})},Yh=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
3538
+ `}const Vh=30,Tl=2,Gh=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")},Xh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=O.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:x,corners:w,stroke:m,strokeColor:h,bgColor:f,padding:v,logoMarginTop:C,logoWidth:y,logoHeight:S,captionMarginTop:G}=e,W=!!o,U=((t==null?void 0:t.length)??0)>0,H=d>0&&(!n||i),I=U&&(H||n),z=Math.max(0,d)*Vh,$=X=>O.scalingValue(X,n??!1),T=s.useRef(null),k=s.useRef(null),_=s.useRef(null),[g,D]=s.useState(0),[P,q]=s.useState(0),ie=P>0?P:0,L=s.useMemo(()=>jh(r,ie),[r,ie]),[B,K]=s.useState(0),ue=H&&u==="on",[le,F]=s.useState(!1),pe=s.useRef(null),[j,se]=s.useState(0),[ne,ve]=s.useState(0),ke=s.useRef(null),xe=X=>{var re,Y,ce,Ee,he;return{fontSettings:{fontFamily:(e==null?void 0:e[`${X}FontFamily`])??"Arial",fontWeight:((re=e==null?void 0:e[`${X}FontSettings`])==null?void 0:re.fontWeight)??400,fontStyle:((Y=e==null?void 0:e[`${X}FontSettings`])==null?void 0:Y.fontStyle)??"normal"},textAppearance:{textTransform:((ce=e==null?void 0:e[`${X}TextAppearance`])==null?void 0:ce.textTransform)??"none",textDecoration:((Ee=e==null?void 0:e[`${X}TextAppearance`])==null?void 0:Ee.textDecoration)??"none",fontVariant:((he=e==null?void 0:e[`${X}TextAppearance`])==null?void 0:he.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${X}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${X}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${X}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${X}LineHeight`])??.01,color:(e==null?void 0:e[`${X}Color`])??"#000000"}},b=xe("text"),M=xe("caption"),E=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(X=>{var me,re;return(((me=X.text)==null?void 0:me.length)??0)>0||(((re=X.caption)==null?void 0:re.length)??0)>0}),[t]),V=s.useMemo(()=>!I||(t==null?void 0:t.length)===0?1:P<=0||g<=0?Tl:Math.max(Tl,Math.ceil(g/P)+1),[I,t==null?void 0:t.length,P,g]);s.useLayoutEffect(()=>{if(!I)return;const X=T.current,me=_.current;if(!X||!me)return;let re=0;const Y=()=>{const he=X.getBoundingClientRect().width,Q=me.getBoundingClientRect().width,Ne=ke.current,Fe=typeof Ne=="number"&&Math.abs(Ne-Q)<=.25;if(ke.current=Q,D(he),typeof Q=="number"&&Q>0&&P<=0){q(Q);return}Fe&&Q!==P?q(Q):!Fe&&P<=0&&(cancelAnimationFrame(re),re=requestAnimationFrame(Y))},ce=()=>{cancelAnimationFrame(re),re=requestAnimationFrame(Y)};ce();const Ee=new ResizeObserver(ce);return Ee.observe(X),Ee.observe(me),()=>{cancelAnimationFrame(re),Ee.disconnect()}},[H,I,P]);const Ce=ie>0&&z>0?ie/z*1e3:0,te=`${Math.max(0,Ce)/1e3}s`;s.useLayoutEffect(()=>{if(!I||ie<=0)return;const X=k.current;X&&Gh(X)},[I,ie,c]),s.useLayoutEffect(()=>{if(!I){K(0);return}const X=_.current,me=k.current;if(!X||!me)return;const re=()=>{let ce=0;for(let Ee=0;Ee<X.children.length;Ee++){const Q=X.children[Ee].firstElementChild;Q&&(ce=Math.max(ce,Q.offsetHeight))}ce<=0&&(ce=me.offsetHeight),K(ce>0?ce:0)};re();const Y=new ResizeObserver(re);return Y.observe(X),Y.observe(me),()=>{Y.disconnect()}},[I,V,t,n,p,x,v,m,w,y,S,j,ne]);const $e=()=>{ue&&F(!0)},ae=()=>{ue&&F(!1)},ge=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),ye=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),Z=s.useCallback((X,me,re,Y)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[a.jsx("div",{"data-controls":W?Y==null?void 0:Y.controlsName:void 0,"data-controls-axis":W?"y":void 0,className:W?`${r}-control`:void 0,style:{height:$((Y==null?void 0:Y.marginTop)??0)}}),a.jsx("div",{...Y!=null&&Y.dataMeasureKind?{"data-testimonial-measure":Y.dataMeasureKind}:{},style:{...qt(X,n),textAlign:ye,pointerEvents:"auto",...typeof(Y==null?void 0:Y.minHeightPx)=="number"&&Y.minHeightPx>0?{minHeight:Y.minHeightPx}:{}},children:a.jsx(Ri,{content:me})})]},re),[ge,ye,n,W,r,$]),J=s.useCallback((X,me,re)=>{var Y,ce,Ee;return a.jsxs("div",{style:{padding:`${$(v.top)} ${$(v.right)} ${$(v.bottom)} ${$(v.left)}`,width:$(x+m*2),height:"100%",borderRadius:$(w),border:`${$(m)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:f}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:ge,textAlign:ye},children:[X.text&&Z(b,X.text,"text",re!=null&&re.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(re==null?void 0:re.textMinHeightPx)=="number"&&re.textMinHeightPx>0?{minHeightPx:re.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ge,width:"100%"},children:[a.jsx("div",{"data-controls":W&&!(re!=null&&re.dataMeasureAttrs)?"logoMarginTop":void 0,className:W&&!(re!=null&&re.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:$(C)}}),a.jsx("div",{style:{width:$(y),height:$(S)},children:((Y=X.logo)==null?void 0:Y.url)&&a.jsx("img",{src:X.logo.url,alt:((ce=X.logo)==null?void 0:ce.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Ee=X.logo)==null?void 0:Ee.objectFit)||"contain"}})})]}),X.caption&&Z(M,X.caption,"caption",{...re!=null&&re.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:G,...re!=null&&re.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(re==null?void 0:re.captionMinHeightPx)=="number"&&re.captionMinHeightPx>0?{minHeightPx:re.captionMinHeightPx}:{}})]})]},me)},[f,G,M,x,w,S,C,y,ge,ye,v.bottom,v.left,v.right,v.top,Z,m,h,b,n,W,r]),de=s.useCallback(X=>{se(X.maxTextPx),ve(X.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!E){de({maxTextPx:0,maxCaptionPx:0});return}const X=pe.current;if(!X)return;const me=()=>{O.readTestimonialTextMeasure(X,de)};me();const re=new ResizeObserver(me);return re.observe(X),()=>{re.disconnect()}},[E,de,t,J]);const be=E?{textMinHeightPx:j,captionMinHeightPx:ne}:void 0,Pe=E?a.jsx("div",{ref:pe,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((X,me)=>J(X,`measure-${me}`,{dataMeasureAttrs:!0}))}):null,Se=(X,me)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[J(X,`card-${me}`,be),W&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${$(p)})`,width:$(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},me);if(I){const X=H?ue&&le?"paused":"running":"paused";return a.jsxs("div",{ref:T,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...B>0?{height:B}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),Pe,a.jsx("div",{ref:k,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:$e,onMouseLeave:ae,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",animationDuration:te,WebkitAnimationDuration:te,animationPlayState:X,WebkitAnimationPlayState:X},children:Array.from({length:V},(me,re)=>a.jsx("div",{ref:re===0?_:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:$(p),paddingRight:$(p)},"aria-hidden":re>0,children:t==null?void 0:t.map((Y,ce)=>Se(Y,`${re}-${ce}`))},`set-${re}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),Pe,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((X,me)=>Se(X,me))})]})},Yh=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
3539
3539
  import cn from 'classnames';
3540
3540
  import { CommonComponentProps } from '../props';
3541
3541
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -4290,7 +4290,7 @@ type TestimonialsSettings = {
4290
4290
  width: 100%;
4291
4291
  height: 100%;
4292
4292
  }
4293
- `}const Zh=3e3,Jh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:x,captionMarginTop:w,imageWidth:m,imageHeight:h,controlsWidth:f,controlsColor:v,controlsHoverColor:C}=e,y=d>0&&(!n||!!i),[S,G]=s.useState(0),[W,U]=s.useState(null),[H,I]=s.useState(!1),z=s.useRef(null),$=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),T=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{G(0),U(null),I(!1)},[l.length]);const A=l[S],_=W===null?null:l[W],g=xe=>{var M,E,V,Se,te;return{fontSettings:{fontFamily:(e==null?void 0:e[`${xe}FontFamily`])??"Arial",fontWeight:((M=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:M.fontWeight)??400,fontStyle:((E=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:E.fontStyle)??"normal"},textAppearance:{textTransform:((V=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:V.textTransform)??"none",textDecoration:((Se=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:Se.textDecoration)??"none",fontVariant:((te=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:te.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${xe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${xe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${xe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${xe}WordSpacing`])??0,color:(e==null?void 0:e[`${xe}Color`])??"#000000"}},B=g("text"),P=g("caption"),Y=l.length>1&&l.some(xe=>{var b,M;return(((b=xe.text)==null?void 0:b.length)??0)>0||(((M=xe.caption)==null?void 0:M.length)??0)>0}),ie=s.useRef(null),[L,O]=s.useState(0),[K,ue]=s.useState(0),le=e.controls??{mode:"Off",icon:null},F=l.length>1,pe=s.useCallback((xe,b)=>!F||b===xe?xe:(z.current&&window.clearTimeout(z.current),U(xe),I(!0),z.current=window.setTimeout(()=>{U(null),I(!1),z.current=null},300),b),[F]),j=s.useCallback(()=>{F&&G(xe=>pe(xe,(xe-1+l.length)%l.length))},[F,pe,l.length]),se=s.useCallback(()=>{F&&G(xe=>pe(xe,(xe+1)%l.length))},[F,pe,l.length]);s.useEffect(()=>{if(!y||!F)return;const xe=Math.max(300,Zh/d),b=window.setInterval(()=>{G(M=>pe(M,(M+1)%l.length))},xe);return()=>{window.clearInterval(b)}},[y,F,pe,l.length,d]),s.useEffect(()=>()=>{z.current&&window.clearTimeout(z.current)},[]);const ne=(xe,b)=>{var te,$e,re,ge;const M=b==null?void 0:b.textMinHeightPx,E=b==null?void 0:b.captionMinHeightPx,V=b==null?void 0:b.dataMeasureAttrs,Se=o&&!(b!=null&&b.dataMeasureAttrs)&&!(b!=null&&b.hideControls);return a.jsxs(a.Fragment,{children:[xe.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Se?"textMarginTop":void 0,className:Se?`${r}-control`:void 0,style:{height:D.scalingValue(x??0,n??!1)}}),a.jsx("div",{...V&&{"data-testimonial-measure":"text"},style:{...qt(B,n),...M&&M>0?{minHeight:M}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Ri,{content:xe.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Se?"imageMarginTop":void 0,className:Se?`${r}-control`:void 0,style:{height:D.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:D.scalingValue(m??0,n??!1),height:D.scalingValue(h??0,n??!1)},children:((te=xe.image)==null?void 0:te.url)&&a.jsx("img",{src:($e=xe.image)==null?void 0:$e.url,alt:((re=xe.image)==null?void 0:re.name)??"",className:`${r}-icon`,style:{objectFit:((ge=xe.image)==null?void 0:ge.objectFit)||"contain"}})})]}),xe.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Se?"captionMarginTop":void 0,className:Se?`${r}-control`:void 0,style:{height:D.scalingValue(w??0,n??!1)}}),a.jsx("div",{...V?{"data-testimonial-measure":"caption"}:{},style:{...qt(P,n),...E&&E>0?{minHeight:E}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Ri,{content:xe.caption})})]})]})},ve=s.useCallback(xe=>{O(xe.maxTextPx),ue(xe.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!Y){ve({maxTextPx:0,maxCaptionPx:0});return}const xe=ie.current;if(!xe)return;const b=()=>{D.readTestimonialTextMeasure(xe,ve)};b();const M=new ResizeObserver(b);return M.observe(xe),()=>{M.disconnect()}},[Y,ve,t]),!A)return a.jsx(a.Fragment,{});const Me=Y?{textMinHeightPx:L,captionMinHeightPx:K}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Kh(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:D.scalingValue(u??0,n??!1),alignItems:$},children:[Y&&a.jsx("div",{ref:ie,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((xe,b)=>a.jsx("div",{style:{width:"100%"},children:ne(xe,{dataMeasureAttrs:!0})},b))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[_&&H&&a.jsx("div",{className:pt(`${r}-fade-item-prev`,`${r}-fade-out`),children:ne(_,{...Me,hideControls:!0})}),a.jsx("div",{className:pt(`${r}-fade-item-current`,H?`${r}-fade-in`:void 0),children:ne(A,Me)})]})]}),le.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:D.scalingValue(f??.02,n??!1),height:D.scalingValue(f??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:j,disabled:!F,"aria-label":"Previous testimonial",children:le.icon&&a.jsx(sn,{url:le.icon,fill:v,hoverFill:C,className:pt(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:pt(`${r}-arrow`,`${r}-next-arrow`),style:{width:D.scalingValue(f??.02,n??!1),height:D.scalingValue(f??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:se,disabled:!F,"aria-label":"Next testimonial",children:le.icon&&a.jsx(sn,{url:le.icon,fill:v,hoverFill:C,className:`${r}-arrow-img`})})})]})]})})},Qh=`import cn from 'classnames';
4293
+ `}const Zh=3e3,Jh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=O.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:x,captionMarginTop:w,imageWidth:m,imageHeight:h,controlsWidth:f,controlsColor:v,controlsHoverColor:C}=e,y=d>0&&(!n||!!i),[S,G]=s.useState(0),[W,U]=s.useState(null),[H,I]=s.useState(!1),z=s.useRef(null),$=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),T=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{G(0),U(null),I(!1)},[l.length]);const k=l[S],_=W===null?null:l[W],g=xe=>{var M,E,V,Ce,te;return{fontSettings:{fontFamily:(e==null?void 0:e[`${xe}FontFamily`])??"Arial",fontWeight:((M=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:M.fontWeight)??400,fontStyle:((E=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:E.fontStyle)??"normal"},textAppearance:{textTransform:((V=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:V.textTransform)??"none",textDecoration:((Ce=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:Ce.textDecoration)??"none",fontVariant:((te=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:te.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${xe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${xe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${xe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${xe}WordSpacing`])??0,color:(e==null?void 0:e[`${xe}Color`])??"#000000"}},D=g("text"),P=g("caption"),q=l.length>1&&l.some(xe=>{var b,M;return(((b=xe.text)==null?void 0:b.length)??0)>0||(((M=xe.caption)==null?void 0:M.length)??0)>0}),ie=s.useRef(null),[L,B]=s.useState(0),[K,ue]=s.useState(0),le=e.controls??{mode:"Off",icon:null},F=l.length>1,pe=s.useCallback((xe,b)=>!F||b===xe?xe:(z.current&&window.clearTimeout(z.current),U(xe),I(!0),z.current=window.setTimeout(()=>{U(null),I(!1),z.current=null},300),b),[F]),j=s.useCallback(()=>{F&&G(xe=>pe(xe,(xe-1+l.length)%l.length))},[F,pe,l.length]),se=s.useCallback(()=>{F&&G(xe=>pe(xe,(xe+1)%l.length))},[F,pe,l.length]);s.useEffect(()=>{if(!y||!F)return;const xe=Math.max(300,Zh/d),b=window.setInterval(()=>{G(M=>pe(M,(M+1)%l.length))},xe);return()=>{window.clearInterval(b)}},[y,F,pe,l.length,d]),s.useEffect(()=>()=>{z.current&&window.clearTimeout(z.current)},[]);const ne=(xe,b)=>{var te,$e,ae,ge;const M=b==null?void 0:b.textMinHeightPx,E=b==null?void 0:b.captionMinHeightPx,V=b==null?void 0:b.dataMeasureAttrs,Ce=o&&!(b!=null&&b.dataMeasureAttrs)&&!(b!=null&&b.hideControls);return a.jsxs(a.Fragment,{children:[xe.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Ce?"textMarginTop":void 0,className:Ce?`${r}-control`:void 0,style:{height:O.scalingValue(x??0,n??!1)}}),a.jsx("div",{...V&&{"data-testimonial-measure":"text"},style:{...qt(D,n),...M&&M>0?{minHeight:M}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Ri,{content:xe.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Ce?"imageMarginTop":void 0,className:Ce?`${r}-control`:void 0,style:{height:O.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:O.scalingValue(m??0,n??!1),height:O.scalingValue(h??0,n??!1)},children:((te=xe.image)==null?void 0:te.url)&&a.jsx("img",{src:($e=xe.image)==null?void 0:$e.url,alt:((ae=xe.image)==null?void 0:ae.name)??"",className:`${r}-icon`,style:{objectFit:((ge=xe.image)==null?void 0:ge.objectFit)||"contain"}})})]}),xe.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Ce?"captionMarginTop":void 0,className:Ce?`${r}-control`:void 0,style:{height:O.scalingValue(w??0,n??!1)}}),a.jsx("div",{...V?{"data-testimonial-measure":"caption"}:{},style:{...qt(P,n),...E&&E>0?{minHeight:E}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Ri,{content:xe.caption})})]})]})},ve=s.useCallback(xe=>{B(xe.maxTextPx),ue(xe.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!q){ve({maxTextPx:0,maxCaptionPx:0});return}const xe=ie.current;if(!xe)return;const b=()=>{O.readTestimonialTextMeasure(xe,ve)};b();const M=new ResizeObserver(b);return M.observe(xe),()=>{M.disconnect()}},[q,ve,t]),!k)return a.jsx(a.Fragment,{});const ke=q?{textMinHeightPx:L,captionMinHeightPx:K}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Kh(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:O.scalingValue(u??0,n??!1),alignItems:$},children:[q&&a.jsx("div",{ref:ie,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((xe,b)=>a.jsx("div",{style:{width:"100%"},children:ne(xe,{dataMeasureAttrs:!0})},b))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[_&&H&&a.jsx("div",{className:pt(`${r}-fade-item-prev`,`${r}-fade-out`),children:ne(_,{...ke,hideControls:!0})}),a.jsx("div",{className:pt(`${r}-fade-item-current`,H?`${r}-fade-in`:void 0),children:ne(k,ke)})]})]}),le.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:O.scalingValue(f??.02,n??!1),height:O.scalingValue(f??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:j,disabled:!F,"aria-label":"Previous testimonial",children:le.icon&&a.jsx(sn,{url:le.icon,fill:v,hoverFill:C,className:pt(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:pt(`${r}-arrow`,`${r}-next-arrow`),style:{width:O.scalingValue(f??.02,n??!1),height:O.scalingValue(f??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:se,disabled:!F,"aria-label":"Next testimonial",children:le.icon&&a.jsx(sn,{url:le.icon,fill:v,hoverFill:C,className:`${r}-arrow-img`})})})]})]})})},Qh=`import cn from 'classnames';
4294
4294
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
4295
4295
  import { CommonComponentProps } from '../props';
4296
4296
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -4786,7 +4786,7 @@ type TestimonialsSettings = {
4786
4786
  icon?: string | null;
4787
4787
  };
4788
4788
  };
4789
- `,ef="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" 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" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),Rl={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},tf={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Rl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Default"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Rl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Default"}},defaults:{controls:{mode:"On",icon:ef},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{speed:1,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},t:{speed:1,width:.65,imageMarginTop:.026,captionMarginTop:.01,textMarginTop:0,textFontSize:.035,captionFontSize:.023,textLineHeight:.04,captionLineHeight:.029,imageWidth:.05,imageHeight:.05,controlsWidth:.026},d:{speed:1,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},layout:["__componentName__","speed","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","speed"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},nf={element:Jh,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Single.png"},defaultSize:{d:{width:700},t:{width:700},m:{width:334}},schema:tf,sourceCode:Qh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function of(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ll(e){return((e==null?void 0:e.trim().length)??0)>0}function $a(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Ta(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:D.scalingValue((o-t)/2,i)}}function rf(e){return`
4789
+ `,ef="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" 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" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),Rl={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},tf={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Rl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Default"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Rl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Default"}},defaults:{controls:{mode:"On",icon:ef},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{speed:1,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},t:{speed:1,width:.65,imageMarginTop:.026,captionMarginTop:.01,textMarginTop:0,textFontSize:.035,captionFontSize:.023,textLineHeight:.04,captionLineHeight:.029,imageWidth:.05,imageHeight:.05,controlsWidth:.026},d:{speed:1,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},layout:["__componentName__","speed","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","speed"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},nf={element:Jh,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Single.png"},defaultSize:{d:{width:700},t:{width:700},m:{width:334}},schema:tf,sourceCode:Qh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function of(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ll(e){return((e==null?void 0:e.trim().length)??0)>0}function $a(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Ta(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:O.scalingValue((o-t)/2,i)}}function rf(e){return`
4790
4790
  .${e}-wrapper {
4791
4791
  display: grid;
4792
4792
  align-items: start;
@@ -5133,7 +5133,7 @@ type TestimonialsSettings = {
5133
5133
  z-index: 2;
5134
5134
  width: 100%;
5135
5135
  }
5136
- `}function af(){return Math.random()<.5?"ltr":"ttb"}function sf(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function lf(e){const t=af();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{sf(e)})})}const bn=500,cf=750,jn="cubic-bezier(0.22, 1, 0.36, 1)",df=72,uf=50;function pf(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 mf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function gf(e){const[t]=e.media;return t!=null&&t.url?t:null}function Pd(e){return!Array.isArray(e)||e.length===0?[]:pf(e)?e.flatMap(t=>{const n=mf(t);if(!n)return[];const i=gf(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 $i(e){return e.type==="video"}function hf(e){const t=new Set,n=[];for(const i of e){const o=Pd(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function ff({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>$i(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function yf(e){e.pause(),e.removeAttribute("src"),e.load()}function Pl({media:e,className:t,style:n,onMediaClick:i}){return $i(e)?a.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):a.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function El(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function xf(e,t){if(!t||!t.width||!t.height||!e.width||!e.height)return e;const n=t.width/t.height,i=e.width/e.height;if(n>i){const r=e.width/n;return{width:e.width,height:r,left:e.left,top:e.top+(e.height-r)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function vf({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{yf(d)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,style:i})}function bf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",x=s.useRef(null),w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),v=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),G=s.useRef(null),W=s.useRef(0),U=s.useRef(null),H=s.useRef(!1),I=s.useRef(null),z=s.useRef(null),$=s.useRef(null),T=s.useRef(()=>{}),[A,_]=s.useState(null),[g,B]=s.useState(null),[P,Y]=s.useState("opening"),[ie,L]=s.useState(0),[O,K]=s.useState(0),[ue,le]=s.useState(null),[F,pe]=s.useState(!1),[j,se]=s.useState(!1),[ne,ve]=s.useState(!1),[Me,xe]=s.useState(null),b=s.useRef(n),M=s.useRef(void 0),E=t[n],V=E?$i(E):!1,Se=O!==0||F,te=ue!==null,$e=s.useCallback(k=>{const ee=k.currentTarget,Te=ee instanceof HTMLVideoElement?{width:ee.videoWidth,height:ee.videoHeight}:{width:ee.naturalWidth,height:ee.naturalHeight};!Te.width||!Te.height||xe(Te)},[]);s.useEffect(()=>{G.current=g},[g]),s.useEffect(()=>{const k=x.current;if(!k)return;const ee=()=>B(El(k));ee();const Te=new ResizeObserver(ee);return Te.observe(k),()=>Te.disconnect()},[]);const re=s.useCallback(()=>{I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),ge=s.useCallback(()=>{const k=z.current;z.current=null,re(),U.current=null,H.current=!1,le(null),pe(!1),K(0),W.current=0,se(!1),y.current=!1,v.current=0,C.current="none",k===1?d():k===-1&&l()},[re,d,l]),ye=s.useCallback(()=>{re(),z.current=null,U.current=null,H.current=!1,le(null),pe(!1),K(0),W.current=0},[re]),Z=s.useCallback(()=>{re(),I.current=window.setTimeout(()=>{z.current!==null&&ge()},bn+32)},[re,ge]),Q=s.useCallback((k,ee)=>{var He;const Te=((He=G.current)==null?void 0:He.width)??0;if(re(),U.current=k,le(k),H.current=!0,pe(!0),ee){z.current=k;const Be=-k*Te;W.current=Be,K(Be),Z();return}W.current=0,K(0),I.current=window.setTimeout(()=>{I.current=null,ye()},bn+32)},[re,ye,Z]),ce=s.useCallback(k=>{if(!(t.length<=1)){if(H.current){if(z.current===k){$.current=k,ge();return}ye()}re(),U.current=k,le(k),H.current=!1,pe(!1),W.current=0,K(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Q(k,!0)})})}},[t.length,Q,ge,ye,re]);T.current=ce;const we=s.useCallback(k=>{k.propertyName!=="transform"||!H.current||z.current!==null&&ge()},[ge]),Pe=s.useCallback(()=>{const k=w.current;if(!k)return;const ee=El(k);!ee.width||!ee.height||_(ee)},[]);s.useEffect(()=>{Pe();const k=w.current;if(!k)return;const ee=new ResizeObserver(()=>Pe());return ee.observe(k),()=>ee.disconnect()},[Pe]),s.useEffect(()=>{P==="opening"&&A&&Y("open")},[P,A]),s.useEffect(()=>{if(P!=="closing")return;const k=setTimeout(()=>r(),bn);return()=>clearTimeout(k)},[P,r]),s.useEffect(()=>()=>{re()},[re]),s.useLayoutEffect(()=>{b.current===n&&M.current===(E==null?void 0:E.url)||(re(),z.current=null,le(null),L(0),K(0),pe(!1),ve(!1),se(!1),xe(null),f.current=0,v.current=0,C.current="none",y.current=!1,H.current=!1,W.current=0,U.current=null,h.current=null,S.current=!1,b.current=n,M.current=E==null?void 0:E.url)},[n,E==null?void 0:E.url,re]),s.useLayoutEffect(()=>{const k=$.current;k!==null&&($.current=null,requestAnimationFrame(()=>{T.current(k)}))},[n,E==null?void 0:E.url]),s.useEffect(()=>{if(P!=="open")return;let k=null;const ee=()=>{k&&(document.removeEventListener("click",k,!0),k=null)},Te=()=>{ee(),k=Ze=>{Ze.stopPropagation(),Ze.preventDefault(),ee()},document.addEventListener("click",k,!0)},He=Ze=>{const _e=Ze<0?1:-1;if(Math.abs(Ze)>uf&&t.length>1){Q(_e,!0);return}Q(_e,!1)},Be=Ze=>{if(Ze.touches.length!==1||H.current)return;const _e=Ze.touches[0];S.current=!0,h.current={x:_e.clientX,y:_e.clientY},C.current="none",v.current=0,y.current=!1},Ve=Ze=>{if(!h.current||Ze.touches.length!==1||H.current)return;const _e=Ze.touches[0],qe=_e.clientX-h.current.x,Oe=_e.clientY-h.current.y;if(C.current==="none"){if(Math.abs(qe)<10&&Math.abs(Oe)<10)return;if(Math.abs(qe)>Math.abs(Oe)){if(t.length<=1)return;C.current="horizontal"}else if(Oe>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,se(!0),v.current=qe;const nt=qe<0?1:-1;U.current!==nt&&(U.current=nt,le(nt)),W.current=qe,K(qe),Ze.preventDefault();return}C.current==="vertical"&&(y.current=!0,se(!0),f.current=Oe,L(Oe),Ze.preventDefault())},rt=()=>{if(!h.current)return;const Ze=C.current,_e=y.current;if(_e&&Ze==="horizontal")He(v.current),Te();else if(_e&&Ze==="vertical")if(f.current>df){const Oe=window.innerHeight;f.current=Oe,ve(!0),L(Oe),Y("closing")}else f.current=0,L(0),Te();else Ze==="horizontal"&&Math.abs(v.current)>0&&(He(v.current),Te());h.current=null,C.current="none",v.current=0,y.current=!1,se(!1)};return document.addEventListener("touchstart",Be,{passive:!0}),document.addEventListener("touchmove",Ve,{passive:!1}),document.addEventListener("touchend",rt),document.addEventListener("touchcancel",rt),()=>{document.removeEventListener("touchstart",Be),document.removeEventListener("touchmove",Ve),document.removeEventListener("touchend",rt),document.removeEventListener("touchcancel",rt),ee()}},[P,t.length,Q]),s.useEffect(()=>{const k=ee=>{ee.key==="Escape"&&(ee.preventDefault(),ee.stopPropagation(),P!=="closing"&&Y("closing"))};return window.addEventListener("keydown",k,!0),()=>window.removeEventListener("keydown",k,!0)},[P]);const Ce=()=>{P!=="closing"&&Y("closing")},X=P==="open",me=P==="closing",ae=ie>0?Math.max(0,1-ie/500):1,q=ie>0?Math.max(.35,1-ie/500):1,de=A?p?A:xf(A,Me):null,ke=k=>{if(k.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ee=de??k.currentTarget.getBoundingClientRect(),Te=k.clientY-ee.top,He=Math.min(52,ee.height*.2);if(!(Te>ee.height-He)){if(k.clientX-ee.left<ee.width/2){ce(-1);return}ce(1)}},he=k=>{if(t.length<=1)return;const ee=de??k.currentTarget.getBoundingClientRect(),Te=k.clientX-ee.left,He=k.clientY-ee.top,Be=Math.min(52,ee.height*.2);if(He>ee.height-Be){k.currentTarget.style.cursor="default";return}k.currentTarget.style.cursor=Te<ee.width/2?"w-resize":"e-resize"},J={position:"fixed",top:g==null?void 0:g.top,left:g==null?void 0:g.left,width:g==null?void 0:g.width,height:g==null?void 0:g.height,zIndex:9998},Ne=p?"cover":"contain",Fe=O!==0||ie>0?`translate(${O}px, ${ie}px)`:void 0,et=j&&!F?"none":F?`transform ${bn}ms ${jn}`:ne?`transform ${bn}ms ${jn}, opacity ${bn}ms ${jn}`:P==="opening"||me?`opacity ${bn}ms ${jn}`:"none",Je={...J,transform:Fe,opacity:ie>0?q:P==="opening"||me?0:1,transition:et,pointerEvents:"none"},dt={position:"absolute",top:((de==null?void 0:de.top)??0)-((g==null?void 0:g.top)??0),left:((de==null?void 0:de.left)??0)-((g==null?void 0:g.left)??0),width:de==null?void 0:de.width,height:de==null?void 0:de.height,objectFit:Ne,pointerEvents:V&&X&&!Se?"auto":"none",touchAction:V&&X?"none":void 0},tt=(g==null?void 0:g.width)??0,De=te?(n+ue+t.length)%t.length:null,Ie=De!==null?t[De]:null,We={...J,transform:te?`translateX(${ue*tt+O}px)`:void 0,opacity:1,transition:F?`transform ${bn}ms ${jn}`:"none",pointerEvents:"none"},je={position:"absolute",top:((A==null?void 0:A.top)??0)-((g==null?void 0:g.top)??0),left:((A==null?void 0:A.left)??0)-((g==null?void 0:g.left)??0),width:A==null?void 0:A.width,height:A==null?void 0:A.height,objectFit:Ne,pointerEvents:"none"},Ue=de?{position:"fixed",top:de.top,height:de.height,width:de.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:x,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:P==="open"?"none":void 0},onClick:Ce,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:X?ae:0,transition:j?"none":`opacity ${bn}ms ${jn}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:w,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:X?1:0,transition:`opacity ${bn}ms ${jn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:w,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:X?1:0,transition:`opacity ${bn}ms ${jn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),A&&g&&Ie&&a.jsx("div",{style:We,onTransitionEnd:we,children:$i(Ie)?a.jsx("video",{src:Ie.url,muted:!0,playsInline:!0,preload:"auto",style:je},`neighbor-${De}-${Ie.url}`):a.jsx("img",{src:Ie.url,alt:Ie.name,style:je},`neighbor-${De}-${Ie.url}`)}),A&&g&&E&&a.jsx("div",{style:Je,onTransitionEnd:we,children:V?a.jsx(vf,{src:E.url,phase:P,mediaRef:m,mediaStyle:dt,onLoadedMetadata:$e,onClick:ke,onMouseMove:he},`${n}-${E.url}`):a.jsx("img",{ref:m,src:E.url,alt:E.name,onLoad:$e,style:dt},`${n}-${E.url}`)}),X&&Ue&&t.length>1&&!V&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ue,left:de.left,cursor:"w-resize",pointerEvents:j?"none":"auto"},onClick:k=>{if(S.current){S.current=!1;return}k.stopPropagation(),ce(-1)}}),a.jsx("div",{style:{...Ue,left:de.left+de.width/2,cursor:"e-resize",pointerEvents:j?"none":"auto"},onClick:k=>{if(S.current){S.current=!1;return}k.stopPropagation(),ce(1)}})]})]})}function wf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Sf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=D.useScopedStyles(),{type:p="a",gridLayout:x,textBoxWidth:w=100,verticalGap:m,entriesCount:h,lightbox:f,imageDisplay:v,imageCorners:C,lightboxImageDisplay:y,slider:S,sliderTiming:G,direction:W,transition:U,titleMarginTop:H,subtitleMarginTop:I,titleColor:z,subtitleColor:$,lightboxCounterColor:T,titleFontFamily:A,titleFontSettings:_,titleFontSize:g,titleLineHeight:B,titleLetterSpacing:P,titleWordSpacing:Y,titleTextAppearance:ie,subtitleFontFamily:L,subtitleFontSettings:O,subtitleFontSize:K,subtitleLineHeight:ue,subtitleLetterSpacing:le,subtitleWordSpacing:F,subtitleTextAppearance:pe,lightboxCounterFontFamily:j,lightboxCounterFontSettings:se,lightboxCounterFontSize:ne,lightboxCounterLineHeight:ve,lightboxCounterLetterSpacing:Me,lightboxCounterWordSpacing:xe,lightboxCounterTextAppearance:b,showText:M="always",alignEntries:E="off",align:V="top"}=e,Se={fontSettings:{fontFamily:A,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:g??.01,lineHeight:B,letterSpacing:P??0,wordSpacing:Y??0,textAppearance:ie,color:z},$e={...an(qt(Se,n))},re={fontSettings:{fontFamily:L,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:K??.01,lineHeight:ue,letterSpacing:le??0,wordSpacing:F??0,textAppearance:pe,color:$},ye={...an(qt(re,n))},Z={fontSettings:{fontFamily:j,fontWeight:(se==null?void 0:se.fontWeight)??400,fontStyle:(se==null?void 0:se.fontStyle)??"normal"},fontSize:ne??.01,lineHeight:ve,letterSpacing:Me??0,wordSpacing:xe??0,textAppearance:b,color:T},ce={...an(qt(Z,n)),...Ta(ne,ve,u,n)},we=$a(g,B,`${u}-item-title`,`${u}-text-tight-leading`),Pe=$a(K,ue,`${u}-item-subtitle`,`${u}-text-tight-leading`),Ce=Ta(g,B,u,n),X=Ta(K,ue,u,n),me=$a(ne,ve,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ae=D.buildColorVars(u,{titleColor:z,subtitleColor:$,lightboxCounterColor:T},Cf,$f),ke=`${l&&l!=="default"?`${u}-state-${l}`:""}${M==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),he=h===0?1/0:h,J=(t??[]).slice(0,he),Ne=s.useMemo(()=>f==="on"?hf(J):[],[J,f]),Fe=x.entryWidth??.2,et=(v==null?void 0:v.display)==="cover",Je=(v==null?void 0:v.ratioValue)??"1:1",dt=(v==null?void 0:v.reversed)??!1,[tt,De]=Je.split(":").map(Number),je=`${dt?De:tt} / ${dt?tt:De}`,Ue=x.columnsCount,k=D.scalingValue(Fe??0,n),ee=k,Te=!et&&S!=="off",He=J.length%Ue||Ue,Be=He<Ue&&J.length>0,Ve=J.length-He,rt=Be?Math.floor((Ue-He)/2)+1:1,Ze=C?D.scalingValue(C,n):void 0,_e={width:ee,...et?{aspectRatio:je,height:"auto",overflow:"hidden"}:{height:"auto"},...Ze?{borderRadius:Ze,overflow:"hidden"}:{}},qe=`${u}-item-image-wrapper${Te?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Oe=p==="d"||p==="e"||p==="f",nt=E==="on",at=`calc(${D.scalingValue(Fe??0,n)} * (${w} / 100))`,st=D.scalingValue(Fe*w/100,n),St=et?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Ze?{borderRadius:Ze}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Ze?{borderRadius:Ze}:{}},[Yt,Zt]=s.useState(0),vt=s.useRef(null),wt=U==="fade"||W==="horizontal"?"ltr":W==="vertical"?"ttb":"ltr";s.useEffect(()=>{const gt=vt.current;if(!gt)return;const Ee=new ResizeObserver(Xe=>{Zt(Math.round(Xe[0].contentRect.width))});return Ee.observe(gt),()=>Ee.disconnect()},[]);const Bt=(()=>{const gt={...ae},Ee=vt.current?getComputedStyle(vt.current).getPropertyValue("--cntrl-article-width").trim():"";return Ee&&(gt["--cntrl-article-width"]=Ee),gt})(),[At,xt]=s.useState(!1),[Ft,Nt]=s.useState([]),[Ut,Jt]=s.useState(0),Tt=f==="on"&&(!n||i),Wt=(gt,Ee)=>{n&&!i||f!=="off"&&(Nt(gt),Jt(Ee),xt(!0))};s.useEffect(()=>{if(!At||f!=="on"||typeof document>"u")return;const gt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=gt}},[At,f]),s.useEffect(()=>{!n||i||xt(!1)},[n,i]);const rn=s.useMemo(()=>rf(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),f==="on"&&a.jsx(ff,{mediaList:Ne}),a.jsx("div",{style:ae,children:a.jsx("div",{ref:vt,className:`${u}-wrapper ${u}-type-${p}${nt?` ${u}-align-entries`:""} ${u}-image-align-${V} ${ke}`.trim(),style:{gridTemplateColumns:`repeat(${Ue}, ${k})`,rowGap:nt?0:D.scalingValue(m??0,n),columnGap:D.scalingValue(x.horizontalGap??0,n),width:D.scalingValue(x.wrapperWidth??0,n),...nt?{[`--${u}-align-entries-row-gap`]:D.scalingValue(m??0,n)}:{}},children:J.map((gt,Ee)=>{var _t;const Xe=Ll(gt.title),lt=Ll(gt.subtitle),ht=(((_t=gt.link)==null?void 0:_t.length)??0)>0&&f==="off"?gt.link:void 0,ft=Math.floor(Ee/Ue)===Math.ceil(J.length/Ue)-1,Lt=Be&&Ee>=Ve?`${rt+(Ee-Ve)}`:void 0,mt=Oe?a.jsxs("div",{className:`${u}-item-text-block`,children:[Xe&&a.jsx("p",{className:we,style:{width:at,...$e,...Ce},children:gt.title}),Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(H??0,n),width:st}}),lt&&a.jsx("p",{className:Pe,style:{width:at,...ye,...X},children:gt.subtitle}),lt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(I??0,n),width:st}})]}):null,zt=nt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?D.scalingValue(H??0,n):0,width:st}}),Xe&&a.jsx("p",{className:we,style:{width:at,...$e,...Ce},children:gt.title}),Oe&&Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(H??0,n),width:st}})]}):null,kt=nt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&&lt?"subtitleMarginTop":void 0,className:o&&lt?`${u}-control`:void 0,style:{height:lt?D.scalingValue(I??0,n):0,width:st}}),lt&&a.jsx("p",{className:Pe,style:{width:at,...ye,...X},children:gt.subtitle}),Oe&&lt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(I??0,n),width:st}})]}):null,Mt=ht?a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:[zt,kt]}):a.jsxs(a.Fragment,{children:[zt,kt]}),Vt=Pd(gt.gallery),Gt=Vt.filter(Ct=>Ct.lightboxMedia).map(Ct=>Ct.lightboxMedia),Ht=a.jsx("div",{className:qe,style:_e,children:Vt.length===0?null:S==="off"?(()=>{const{displayMedia:Ct,lightboxMedia:N}=Vt[0],Re=N?Gt.findIndex(Ae=>Ae.url===N.url):-1;return a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Re>=0?()=>Wt(Gt,Re):void 0})})():a.jsxs(a.Fragment,{children:[Te&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Vt.map(({displayMedia:Ct})=>$i(Ct)?a.jsx("video",{src:Ct.url,muted:!0,playsInline:!0},`sizer-${Ct.url}`):a.jsx("img",{src:Ct.url,alt:""},`sizer-${Ct.url}`))}),a.jsx(zs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:G*1e3,width:"100%",height:"100%",speed:cf,type:U==="fade"?"fade":"loop",rewind:U==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:Ct=>{W!=="random"||U==="fade"||lf(Ct)},children:Vt.map(({displayMedia:Ct,lightboxMedia:N},Re)=>{const Ae=N?Gt.findIndex(ze=>ze.url===N.url):-1;return a.jsx(js,{children:a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Ae>=0?()=>Wt(Gt,Ae):void 0})},Re)})},`${U}-${Fe}-${W}-${G}-${Yt}-${d}`)]})}),Dt=Oe?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?D.scalingValue(H??0,n):0,width:st}}),a.jsx("p",{className:we,style:{width:at,...$e,...Ce},children:gt.title}),a.jsx("div",{"data-controls":o&&lt?"subtitleMarginTop":void 0,className:o&&lt?`${u}-control`:void 0,style:{height:lt?D.scalingValue(I??0,n):0,width:st}}),a.jsx("p",{className:Pe,style:{width:at,...ye,...X},children:gt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Lt&&!nt?{gridColumn:Lt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${nt&&ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(w??0)>100?`calc(${k} * (${w} / 100))`:k,...Lt&&nt?{gridColumn:Lt}:{}},children:nt?a.jsx(a.Fragment,{children:Oe?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Ht})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Ht}),Mt]})}):ht?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:[mt,Ht]}),!Oe&&a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[mt,Ht,Dt]})})},Ee)})})}),(!n||i)&&At&&typeof document<"u"&&f==="on"&&(()=>{const gt=(c?document.getElementById(c):null)??document.body;return zn.createPortal(a.jsx("div",{style:Bt,"data-selection":"none",children:a.jsx(bf,{prefix:u,items:Ft,index:Ut,imageDisplay:wf(y),isEditor:n,onClose:()=>xt(!1),onPrev:()=>Jt(Ee=>(Ee-1+Ft.length)%Ft.length),onNext:()=>Jt(Ee=>(Ee+1)%Ft.length),counterClassName:me,counterStyle:ce})}),gt)})()]})}const Cf={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},$f=["hover","focus","filled","success","error"],Tf=`import { Splide, SplideSlide } from '@splidejs/react-splide';
5136
+ `}function af(){return Math.random()<.5?"ltr":"ttb"}function sf(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function lf(e){const t=af();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{sf(e)})})}const bn=500,cf=750,jn="cubic-bezier(0.22, 1, 0.36, 1)",df=72,uf=50;function pf(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 mf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function gf(e){const[t]=e.media;return t!=null&&t.url?t:null}function Pd(e){return!Array.isArray(e)||e.length===0?[]:pf(e)?e.flatMap(t=>{const n=mf(t);if(!n)return[];const i=gf(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 $i(e){return e.type==="video"}function hf(e){const t=new Set,n=[];for(const i of e){const o=Pd(i.gallery);for(const r of o){const l=r.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function ff({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>$i(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function yf(e){e.pause(),e.removeAttribute("src"),e.load()}function Pl({media:e,className:t,style:n,onMediaClick:i}){return $i(e)?a.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):a.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function El(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function xf(e,t){if(!t||!t.width||!t.height||!e.width||!e.height)return e;const n=t.width/t.height,i=e.width/e.height;if(n>i){const r=e.width/n;return{width:e.width,height:r,left:e.left,top:e.top+(e.height-r)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function vf({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{yf(d)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,style:i})}function bf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",x=s.useRef(null),w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),v=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),G=s.useRef(null),W=s.useRef(0),U=s.useRef(null),H=s.useRef(!1),I=s.useRef(null),z=s.useRef(null),$=s.useRef(null),T=s.useRef(()=>{}),[k,_]=s.useState(null),[g,D]=s.useState(null),[P,q]=s.useState("opening"),[ie,L]=s.useState(0),[B,K]=s.useState(0),[ue,le]=s.useState(null),[F,pe]=s.useState(!1),[j,se]=s.useState(!1),[ne,ve]=s.useState(!1),[ke,xe]=s.useState(null),b=s.useRef(n),M=s.useRef(void 0),E=t[n],V=E?$i(E):!1,Ce=B!==0||F,te=ue!==null,$e=s.useCallback(A=>{const ee=A.currentTarget,Te=ee instanceof HTMLVideoElement?{width:ee.videoWidth,height:ee.videoHeight}:{width:ee.naturalWidth,height:ee.naturalHeight};!Te.width||!Te.height||xe(Te)},[]);s.useEffect(()=>{G.current=g},[g]),s.useEffect(()=>{const A=x.current;if(!A)return;const ee=()=>D(El(A));ee();const Te=new ResizeObserver(ee);return Te.observe(A),()=>Te.disconnect()},[]);const ae=s.useCallback(()=>{I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),ge=s.useCallback(()=>{const A=z.current;z.current=null,ae(),U.current=null,H.current=!1,le(null),pe(!1),K(0),W.current=0,se(!1),y.current=!1,v.current=0,C.current="none",A===1?d():A===-1&&l()},[ae,d,l]),ye=s.useCallback(()=>{ae(),z.current=null,U.current=null,H.current=!1,le(null),pe(!1),K(0),W.current=0},[ae]),Z=s.useCallback(()=>{ae(),I.current=window.setTimeout(()=>{z.current!==null&&ge()},bn+32)},[ae,ge]),J=s.useCallback((A,ee)=>{var He;const Te=((He=G.current)==null?void 0:He.width)??0;if(ae(),U.current=A,le(A),H.current=!0,pe(!0),ee){z.current=A;const Be=-A*Te;W.current=Be,K(Be),Z();return}W.current=0,K(0),I.current=window.setTimeout(()=>{I.current=null,ye()},bn+32)},[ae,ye,Z]),de=s.useCallback(A=>{if(!(t.length<=1)){if(H.current){if(z.current===A){$.current=A,ge();return}ye()}ae(),U.current=A,le(A),H.current=!1,pe(!1),W.current=0,K(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{J(A,!0)})})}},[t.length,J,ge,ye,ae]);T.current=de;const be=s.useCallback(A=>{A.propertyName!=="transform"||!H.current||z.current!==null&&ge()},[ge]),Pe=s.useCallback(()=>{const A=w.current;if(!A)return;const ee=El(A);!ee.width||!ee.height||_(ee)},[]);s.useEffect(()=>{Pe();const A=w.current;if(!A)return;const ee=new ResizeObserver(()=>Pe());return ee.observe(A),()=>ee.disconnect()},[Pe]),s.useEffect(()=>{P==="opening"&&k&&q("open")},[P,k]),s.useEffect(()=>{if(P!=="closing")return;const A=setTimeout(()=>r(),bn);return()=>clearTimeout(A)},[P,r]),s.useEffect(()=>()=>{ae()},[ae]),s.useLayoutEffect(()=>{b.current===n&&M.current===(E==null?void 0:E.url)||(ae(),z.current=null,le(null),L(0),K(0),pe(!1),ve(!1),se(!1),xe(null),f.current=0,v.current=0,C.current="none",y.current=!1,H.current=!1,W.current=0,U.current=null,h.current=null,S.current=!1,b.current=n,M.current=E==null?void 0:E.url)},[n,E==null?void 0:E.url,ae]),s.useLayoutEffect(()=>{const A=$.current;A!==null&&($.current=null,requestAnimationFrame(()=>{T.current(A)}))},[n,E==null?void 0:E.url]),s.useEffect(()=>{if(P!=="open")return;let A=null;const ee=()=>{A&&(document.removeEventListener("click",A,!0),A=null)},Te=()=>{ee(),A=Ze=>{Ze.stopPropagation(),Ze.preventDefault(),ee()},document.addEventListener("click",A,!0)},He=Ze=>{const _e=Ze<0?1:-1;if(Math.abs(Ze)>uf&&t.length>1){J(_e,!0);return}J(_e,!1)},Be=Ze=>{if(Ze.touches.length!==1||H.current)return;const _e=Ze.touches[0];S.current=!0,h.current={x:_e.clientX,y:_e.clientY},C.current="none",v.current=0,y.current=!1},Ve=Ze=>{if(!h.current||Ze.touches.length!==1||H.current)return;const _e=Ze.touches[0],qe=_e.clientX-h.current.x,Oe=_e.clientY-h.current.y;if(C.current==="none"){if(Math.abs(qe)<10&&Math.abs(Oe)<10)return;if(Math.abs(qe)>Math.abs(Oe)){if(t.length<=1)return;C.current="horizontal"}else if(Oe>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,se(!0),v.current=qe;const nt=qe<0?1:-1;U.current!==nt&&(U.current=nt,le(nt)),W.current=qe,K(qe),Ze.preventDefault();return}C.current==="vertical"&&(y.current=!0,se(!0),f.current=Oe,L(Oe),Ze.preventDefault())},rt=()=>{if(!h.current)return;const Ze=C.current,_e=y.current;if(_e&&Ze==="horizontal")He(v.current),Te();else if(_e&&Ze==="vertical")if(f.current>df){const Oe=window.innerHeight;f.current=Oe,ve(!0),L(Oe),q("closing")}else f.current=0,L(0),Te();else Ze==="horizontal"&&Math.abs(v.current)>0&&(He(v.current),Te());h.current=null,C.current="none",v.current=0,y.current=!1,se(!1)};return document.addEventListener("touchstart",Be,{passive:!0}),document.addEventListener("touchmove",Ve,{passive:!1}),document.addEventListener("touchend",rt),document.addEventListener("touchcancel",rt),()=>{document.removeEventListener("touchstart",Be),document.removeEventListener("touchmove",Ve),document.removeEventListener("touchend",rt),document.removeEventListener("touchcancel",rt),ee()}},[P,t.length,J]),s.useEffect(()=>{const A=ee=>{ee.key==="Escape"&&(ee.preventDefault(),ee.stopPropagation(),P!=="closing"&&q("closing"))};return window.addEventListener("keydown",A,!0),()=>window.removeEventListener("keydown",A,!0)},[P]);const Se=()=>{P!=="closing"&&q("closing")},X=P==="open",me=P==="closing",re=ie>0?Math.max(0,1-ie/500):1,Y=ie>0?Math.max(.35,1-ie/500):1,ce=k?p?k:xf(k,ke):null,Ee=A=>{if(A.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ee=ce??A.currentTarget.getBoundingClientRect(),Te=A.clientY-ee.top,He=Math.min(52,ee.height*.2);if(!(Te>ee.height-He)){if(A.clientX-ee.left<ee.width/2){de(-1);return}de(1)}},he=A=>{if(t.length<=1)return;const ee=ce??A.currentTarget.getBoundingClientRect(),Te=A.clientX-ee.left,He=A.clientY-ee.top,Be=Math.min(52,ee.height*.2);if(He>ee.height-Be){A.currentTarget.style.cursor="default";return}A.currentTarget.style.cursor=Te<ee.width/2?"w-resize":"e-resize"},Q={position:"fixed",top:g==null?void 0:g.top,left:g==null?void 0:g.left,width:g==null?void 0:g.width,height:g==null?void 0:g.height,zIndex:9998},Ne=p?"cover":"contain",Fe=B!==0||ie>0?`translate(${B}px, ${ie}px)`:void 0,et=j&&!F?"none":F?`transform ${bn}ms ${jn}`:ne?`transform ${bn}ms ${jn}, opacity ${bn}ms ${jn}`:P==="opening"||me?`opacity ${bn}ms ${jn}`:"none",Je={...Q,transform:Fe,opacity:ie>0?Y:P==="opening"||me?0:1,transition:et,pointerEvents:"none"},dt={position:"absolute",top:((ce==null?void 0:ce.top)??0)-((g==null?void 0:g.top)??0),left:((ce==null?void 0:ce.left)??0)-((g==null?void 0:g.left)??0),width:ce==null?void 0:ce.width,height:ce==null?void 0:ce.height,objectFit:Ne,pointerEvents:V&&X&&!Ce?"auto":"none",touchAction:V&&X?"none":void 0},tt=(g==null?void 0:g.width)??0,De=te?(n+ue+t.length)%t.length:null,Ie=De!==null?t[De]:null,We={...Q,transform:te?`translateX(${ue*tt+B}px)`:void 0,opacity:1,transition:F?`transform ${bn}ms ${jn}`:"none",pointerEvents:"none"},je={position:"absolute",top:((k==null?void 0:k.top)??0)-((g==null?void 0:g.top)??0),left:((k==null?void 0:k.left)??0)-((g==null?void 0:g.left)??0),width:k==null?void 0:k.width,height:k==null?void 0:k.height,objectFit:Ne,pointerEvents:"none"},Ue=ce?{position:"fixed",top:ce.top,height:ce.height,width:ce.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:x,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:P==="open"?"none":void 0},onClick:Se,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:X?re:0,transition:j?"none":`opacity ${bn}ms ${jn}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:w,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:X?1:0,transition:`opacity ${bn}ms ${jn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:w,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:X?1:0,transition:`opacity ${bn}ms ${jn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),k&&g&&Ie&&a.jsx("div",{style:We,onTransitionEnd:be,children:$i(Ie)?a.jsx("video",{src:Ie.url,muted:!0,playsInline:!0,preload:"auto",style:je},`neighbor-${De}-${Ie.url}`):a.jsx("img",{src:Ie.url,alt:Ie.name,style:je},`neighbor-${De}-${Ie.url}`)}),k&&g&&E&&a.jsx("div",{style:Je,onTransitionEnd:be,children:V?a.jsx(vf,{src:E.url,phase:P,mediaRef:m,mediaStyle:dt,onLoadedMetadata:$e,onClick:Ee,onMouseMove:he},`${n}-${E.url}`):a.jsx("img",{ref:m,src:E.url,alt:E.name,onLoad:$e,style:dt},`${n}-${E.url}`)}),X&&Ue&&t.length>1&&!V&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ue,left:ce.left,cursor:"w-resize",pointerEvents:j?"none":"auto"},onClick:A=>{if(S.current){S.current=!1;return}A.stopPropagation(),de(-1)}}),a.jsx("div",{style:{...Ue,left:ce.left+ce.width/2,cursor:"e-resize",pointerEvents:j?"none":"auto"},onClick:A=>{if(S.current){S.current=!1;return}A.stopPropagation(),de(1)}})]})]})}function wf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Sf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=O.useScopedStyles(),{type:p="a",gridLayout:x,textBoxWidth:w=100,verticalGap:m,entriesCount:h,lightbox:f,imageDisplay:v,imageCorners:C,lightboxImageDisplay:y,slider:S,sliderTiming:G,direction:W,transition:U,titleMarginTop:H,subtitleMarginTop:I,titleColor:z,subtitleColor:$,lightboxCounterColor:T,titleFontFamily:k,titleFontSettings:_,titleFontSize:g,titleLineHeight:D,titleLetterSpacing:P,titleWordSpacing:q,titleTextAppearance:ie,subtitleFontFamily:L,subtitleFontSettings:B,subtitleFontSize:K,subtitleLineHeight:ue,subtitleLetterSpacing:le,subtitleWordSpacing:F,subtitleTextAppearance:pe,lightboxCounterFontFamily:j,lightboxCounterFontSettings:se,lightboxCounterFontSize:ne,lightboxCounterLineHeight:ve,lightboxCounterLetterSpacing:ke,lightboxCounterWordSpacing:xe,lightboxCounterTextAppearance:b,showText:M="always",alignEntries:E="off",align:V="top"}=e,Ce={fontSettings:{fontFamily:k,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:g??.01,lineHeight:D,letterSpacing:P??0,wordSpacing:q??0,textAppearance:ie,color:z},$e={...an(qt(Ce,n))},ae={fontSettings:{fontFamily:L,fontWeight:(B==null?void 0:B.fontWeight)??400,fontStyle:(B==null?void 0:B.fontStyle)??"normal"},fontSize:K??.01,lineHeight:ue,letterSpacing:le??0,wordSpacing:F??0,textAppearance:pe,color:$},ye={...an(qt(ae,n))},Z={fontSettings:{fontFamily:j,fontWeight:(se==null?void 0:se.fontWeight)??400,fontStyle:(se==null?void 0:se.fontStyle)??"normal"},fontSize:ne??.01,lineHeight:ve,letterSpacing:ke??0,wordSpacing:xe??0,textAppearance:b,color:T},de={...an(qt(Z,n)),...Ta(ne,ve,u,n)},be=$a(g,D,`${u}-item-title`,`${u}-text-tight-leading`),Pe=$a(K,ue,`${u}-item-subtitle`,`${u}-text-tight-leading`),Se=Ta(g,D,u,n),X=Ta(K,ue,u,n),me=$a(ne,ve,`${u}-lightbox-counter`,`${u}-text-tight-leading`),re=O.buildColorVars(u,{titleColor:z,subtitleColor:$,lightboxCounterColor:T},Cf,$f),Ee=`${l&&l!=="default"?`${u}-state-${l}`:""}${M==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),he=h===0?1/0:h,Q=(t??[]).slice(0,he),Ne=s.useMemo(()=>f==="on"?hf(Q):[],[Q,f]),Fe=x.entryWidth??.2,et=(v==null?void 0:v.display)==="cover",Je=(v==null?void 0:v.ratioValue)??"1:1",dt=(v==null?void 0:v.reversed)??!1,[tt,De]=Je.split(":").map(Number),je=`${dt?De:tt} / ${dt?tt:De}`,Ue=x.columnsCount,A=O.scalingValue(Fe??0,n),ee=A,Te=!et&&S!=="off",He=Q.length%Ue||Ue,Be=He<Ue&&Q.length>0,Ve=Q.length-He,rt=Be?Math.floor((Ue-He)/2)+1:1,Ze=C?O.scalingValue(C,n):void 0,_e={width:ee,...et?{aspectRatio:je,height:"auto",overflow:"hidden"}:{height:"auto"},...Ze?{borderRadius:Ze,overflow:"hidden"}:{}},qe=`${u}-item-image-wrapper${Te?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Oe=p==="d"||p==="e"||p==="f",nt=E==="on",at=`calc(${O.scalingValue(Fe??0,n)} * (${w} / 100))`,st=O.scalingValue(Fe*w/100,n),St=et?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Ze?{borderRadius:Ze}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Ze?{borderRadius:Ze}:{}},[Yt,Zt]=s.useState(0),vt=s.useRef(null),wt=U==="fade"||W==="horizontal"?"ltr":W==="vertical"?"ttb":"ltr";s.useEffect(()=>{const gt=vt.current;if(!gt)return;const Me=new ResizeObserver(Xe=>{Zt(Math.round(Xe[0].contentRect.width))});return Me.observe(gt),()=>Me.disconnect()},[]);const Bt=(()=>{const gt={...re},Me=vt.current?getComputedStyle(vt.current).getPropertyValue("--cntrl-article-width").trim():"";return Me&&(gt["--cntrl-article-width"]=Me),gt})(),[At,xt]=s.useState(!1),[Ft,Nt]=s.useState([]),[Ut,Jt]=s.useState(0),Tt=f==="on"&&(!n||i),Wt=(gt,Me)=>{n&&!i||f!=="off"&&(Nt(gt),Jt(Me),xt(!0))};s.useEffect(()=>{if(!At||f!=="on"||typeof document>"u")return;const gt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=gt}},[At,f]),s.useEffect(()=>{!n||i||xt(!1)},[n,i]);const rn=s.useMemo(()=>rf(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),f==="on"&&a.jsx(ff,{mediaList:Ne}),a.jsx("div",{style:re,children:a.jsx("div",{ref:vt,className:`${u}-wrapper ${u}-type-${p}${nt?` ${u}-align-entries`:""} ${u}-image-align-${V} ${Ee}`.trim(),style:{gridTemplateColumns:`repeat(${Ue}, ${A})`,rowGap:nt?0:O.scalingValue(m??0,n),columnGap:O.scalingValue(x.horizontalGap??0,n),width:O.scalingValue(x.wrapperWidth??0,n),...nt?{[`--${u}-align-entries-row-gap`]:O.scalingValue(m??0,n)}:{}},children:Q.map((gt,Me)=>{var _t;const Xe=Ll(gt.title),lt=Ll(gt.subtitle),ht=(((_t=gt.link)==null?void 0:_t.length)??0)>0&&f==="off"?gt.link:void 0,ft=Math.floor(Me/Ue)===Math.ceil(Q.length/Ue)-1,Lt=Be&&Me>=Ve?`${rt+(Me-Ve)}`:void 0,mt=Oe?a.jsxs("div",{className:`${u}-item-text-block`,children:[Xe&&a.jsx("p",{className:be,style:{width:at,...$e,...Se},children:gt.title}),Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:O.scalingValue(H??0,n),width:st}}),lt&&a.jsx("p",{className:Pe,style:{width:at,...ye,...X},children:gt.subtitle}),lt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:O.scalingValue(I??0,n),width:st}})]}):null,zt=nt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?O.scalingValue(H??0,n):0,width:st}}),Xe&&a.jsx("p",{className:be,style:{width:at,...$e,...Se},children:gt.title}),Oe&&Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:O.scalingValue(H??0,n),width:st}})]}):null,kt=nt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&&lt?"subtitleMarginTop":void 0,className:o&&lt?`${u}-control`:void 0,style:{height:lt?O.scalingValue(I??0,n):0,width:st}}),lt&&a.jsx("p",{className:Pe,style:{width:at,...ye,...X},children:gt.subtitle}),Oe&&lt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:O.scalingValue(I??0,n),width:st}})]}):null,Mt=ht?a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:[zt,kt]}):a.jsxs(a.Fragment,{children:[zt,kt]}),Vt=Pd(gt.gallery),Gt=Vt.filter(Ct=>Ct.lightboxMedia).map(Ct=>Ct.lightboxMedia),Ht=a.jsx("div",{className:qe,style:_e,children:Vt.length===0?null:S==="off"?(()=>{const{displayMedia:Ct,lightboxMedia:N}=Vt[0],Re=N?Gt.findIndex(Ae=>Ae.url===N.url):-1;return a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Re>=0?()=>Wt(Gt,Re):void 0})})():a.jsxs(a.Fragment,{children:[Te&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Vt.map(({displayMedia:Ct})=>$i(Ct)?a.jsx("video",{src:Ct.url,muted:!0,playsInline:!0},`sizer-${Ct.url}`):a.jsx("img",{src:Ct.url,alt:""},`sizer-${Ct.url}`))}),a.jsx(zs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:G*1e3,width:"100%",height:"100%",speed:cf,type:U==="fade"?"fade":"loop",rewind:U==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:Ct=>{W!=="random"||U==="fade"||lf(Ct)},children:Vt.map(({displayMedia:Ct,lightboxMedia:N},Re)=>{const Ae=N?Gt.findIndex(ze=>ze.url===N.url):-1;return a.jsx(js,{children:a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Ae>=0?()=>Wt(Gt,Ae):void 0})},Re)})},`${U}-${Fe}-${W}-${G}-${Yt}-${d}`)]})}),Dt=Oe?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?O.scalingValue(H??0,n):0,width:st}}),a.jsx("p",{className:be,style:{width:at,...$e,...Se},children:gt.title}),a.jsx("div",{"data-controls":o&&lt?"subtitleMarginTop":void 0,className:o&&lt?`${u}-control`:void 0,style:{height:lt?O.scalingValue(I??0,n):0,width:st}}),a.jsx("p",{className:Pe,style:{width:at,...ye,...X},children:gt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Lt&&!nt?{gridColumn:Lt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${nt&&ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(w??0)>100?`calc(${A} * (${w} / 100))`:A,...Lt&&nt?{gridColumn:Lt}:{}},children:nt?a.jsx(a.Fragment,{children:Oe?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Ht})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Ht}),Mt]})}):ht?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:[mt,Ht]}),!Oe&&a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[mt,Ht,Dt]})})},Me)})})}),(!n||i)&&At&&typeof document<"u"&&f==="on"&&(()=>{const gt=(c?document.getElementById(c):null)??document.body;return zn.createPortal(a.jsx("div",{style:Bt,"data-selection":"none",children:a.jsx(bf,{prefix:u,items:Ft,index:Ut,imageDisplay:wf(y),isEditor:n,onClose:()=>xt(!1),onPrev:()=>Jt(Me=>(Me-1+Ft.length)%Ft.length),onNext:()=>Jt(Me=>(Me+1)%Ft.length),counterClassName:me,counterStyle:de})}),gt)})()]})}const Cf={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},$f=["hover","focus","filled","success","error"],Tf=`import { Splide, SplideSlide } from '@splidejs/react-splide';
5137
5137
  import '@splidejs/react-splide/css/core';
5138
5138
  import { CommonComponentProps } from '../props';
5139
5139
  import {
@@ -7186,7 +7186,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
7186
7186
  };
7187
7187
 
7188
7188
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
7189
- `,Ia={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},If=["titleColor","subtitleColor","lightboxCounterColor"],Rf={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"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},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:{...Ia.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:{...Ia.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:{...Ia.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,imageCorners:0,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,imageCorners:0,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,imageCorners:0,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","imageCorners","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","imageCorners"]},{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:[...If],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Lf={element:Sf,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:Rf,sourceCode:Tf},Pf=50,Ml=10,Vs="cntrl-lightbox-journal",sa=Vs,as=`${Vs}-`,la=e=>`${Vs}-${e}`,Gs=e=>e===sa||e.startsWith(as),kl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Al=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=kl(t.get(la(e)));if(i)return i}const n=kl(t.get(sa));if(n)return n;for(const[i]of t){if(!i.startsWith(as))continue;const o=i.slice(as.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Fl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Ed=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Gs(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(la(t),String(e)):i.searchParams.set(sa,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Ef=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===la(e)||i===sa:Gs(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)}},Md=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(la(e)):[...t.keys()].some(n=>Gs(n))},Mf=(e,t)=>{if(Md(t)){if(e){window.history.back();return}Ef(t)}},kf=20,Af=2,Ra=e=>`max(${e}, ${kf}px)`,Ji=e=>((e==null?void 0:e.image)??[]).slice(0,Af),kd=e=>e.reduce((t,n)=>t+Ji(n).length,0),Ff=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Ji(r).length,1),i=Ji(e[t]).length;return{start:n,end:n+i-1}},_f=(e,t)=>{const n=kd(e),{start:i,end:o}=Ff(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Er=(e,t)=>t==="B"?e.flatMap((n,i)=>Ji(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Ji(n)})),Nf=(e,t,n,i)=>{var r;if(n==="B")return`${t+1} / ${e.length}`;const o=((r=e[t])==null?void 0:r.entryIndex)??0;return _f(i,o)},_l=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Wf=(e,t,n)=>e==="B"?t.length>1:kd(n)>1,fn=.004,Un=.004,Yi={title1Width:.13,title2Width:.13,title3Width:.14},Kn=(e,t,n,i,o)=>{const r=[];return t.title1&&r.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&r.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&r.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),r},Qi=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Ho=(e,t)=>Qi(e,t),cn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Zn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Qi(e.length,n),effective:Ho(e.length,n)}},Ad=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),Fd=(e,t,n,i)=>e.slice(0,i+1).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),oi=["title1","title2","title3","count"],ot=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Xs={title1:"1",title2:"2",title3:"3",count:"Count"},Ys=e=>[ot(e,"fontFamily"),ot(e,"fontSettings"),{type:"row",items:[ot(e,"fontSize"),ot(e,"lineHeight"),ot(e,"letterSpacing"),ot(e,"wordSpacing")]},ot(e,"textAlign"),ot(e,"textAppearance")],Hf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(oi.map(e=>[Xs[e],Ys(e)]))}),Df={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Of={title1:.02,title2:.02,title3:.02,count:.017},bi=(e,t)=>{const n=i=>{const o=ot(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[Df[t]]}},wi=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Of[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return qt(i,n)};function _d({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:x=0,title3MarginLeft:w=0,titleRowMarginBottom:m=0,titleHeaderLayout:h="desktop",contentMarginTop:f=0,iconMarginRight:v=0,closeIcon:C=null,closeIconMaxWidth:y=0,closeIconColor:S="#000000",closeIconHoverColor:G="#cccccc"}=n,W=D.scalingValue(f,i),U=D.scalingValue(v,i),H=D.scalingValue(m,i),I=h==="mobile",z=wi("title1",bi(n,"title1"),i),$=wi("title2",bi(n,"title2"),i),T=wi("title3",bi(n,"title3"),i),A=s.useMemo(()=>({title1Width:d??Yi.title1Width,title2Width:c??Yi.title2Width,title3Width:u??Yi.title3Width}),[d,c,u]),_=s.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:w}),[x,w]),g=s.useMemo(()=>Kn(e,t,z,$,T),[e,t,z,$,T]),B=s.useMemo(()=>g.map(q=>A[q.widthKey]),[g,A]),P=s.useMemo(()=>Qi(g.length,B),[g.length,B]),Y=s.useMemo(()=>Ho(g.length,B),[g.length,B]),ie=s.useMemo(()=>g.filter(q=>q.prefix==="title1"),[g]),L=s.useMemo(()=>g.filter(q=>q.prefix==="title2"||q.prefix==="title3"),[g]),O=s.useMemo(()=>Zn(ie,A),[ie,A]),K=s.useMemo(()=>Zn(L,A),[L,A]),ue=!!(t.title1||t.title2||t.title3),le=C!==null;if(!(ue||le))return null;const pe=(p??0)>0||o,j=(q,de)=>{const ke=g.findIndex(J=>J.prefix===q.prefix);if(!I||de==="single-row")return{effectiveWidth:Y[ke]??0,resolvedWidth:P[ke]??0,maxWidth:cn(ke,P)};if(de==="two-row-top"){const J=ie.findIndex(Ne=>Ne.prefix===q.prefix);return{effectiveWidth:O.effective[J]??0,resolvedWidth:O.resolved[J]??0,maxWidth:cn(J,O.resolved)}}const he=L.findIndex(J=>J.prefix===q.prefix);return{effectiveWidth:K.effective[he]??0,resolvedWidth:K.resolved[he]??0,maxWidth:cn(he,K.resolved)}},se=(q,de,ke)=>{if(!I||ke==="single-row"){const et=q.findIndex(De=>De.prefix===de.prefix),Je=q.map(De=>A[De.widthKey]),dt=Qi(q.length,Je);return{effectiveWidth:Ho(q.length,Je)[et]??0,resolvedWidth:dt[et]??0,maxWidth:cn(et,dt)}}if(ke==="two-row-top"){const et=q.filter(De=>De.prefix==="title1"),Je=et.findIndex(De=>De.prefix===de.prefix),{resolved:dt,effective:tt}=Zn(et,A);return{effectiveWidth:tt[Je]??0,resolvedWidth:dt[Je]??0,maxWidth:cn(Je,dt)}}const he=q.filter(et=>et.prefix==="title2"||et.prefix==="title3"),J=he.findIndex(et=>et.prefix===de.prefix),{resolved:Ne,effective:Fe}=Zn(he,A);return{effectiveWidth:Fe[J]??0,resolvedWidth:Ne[J]??0,maxWidth:cn(J,Ne)}},ne=q=>Fd(g,P,_,q)+(I?0:p??0),ve=()=>I?0:p??0,Me=q=>L.slice(0,q).reduce((de,ke,he)=>de+(ke.marginLeftKey?_[ke.marginLeftKey]??0:0)+(K.resolved[he]??0),0),xe=q=>{const de=L[q];return Me(q)+(de.marginLeftKey?_[de.marginLeftKey]??0:0)+(K.resolved[q]??0)},b=(q,de,ke)=>{const he=q.marginLeftKey?_[q.marginLeftKey]??0:0,{effectiveWidth:J,resolvedWidth:Ne,maxWidth:Fe}=ke??j(q,de),et=Math.max(he,Un),Je=o&&de==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":q.prefix,style:{width:D.scalingValue(J,i),...he>0?{marginLeft:D.scalingValue(he,i)}:{}},children:[a.jsx("p",{className:q.className,style:q.style,children:q.text}),Je&&q.marginLeftKey?a.jsx("div",{"data-controls":q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:D.scalingValue(-he,i),width:D.scalingValue(et,i),height:"100%",pointerEvents:"auto"}}):null,Je?a.jsx("div",{"data-controls":q.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D.scalingValue(-fn/2,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},q.className)},M=(q="two-row")=>{const de=g.findIndex(J=>J.prefix==="title1"),ke=de>=0?P[de]:A.title1Width,he=q==="two-row"&&o;return a.jsx("div",{...he?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke)}:{},style:{width:D.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...he?{pointerEvents:"auto"}:{}}})},E=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:z,"aria-hidden":"true",children:" "}),V=q=>{const de=Kn(e,q,z,$,T);return a.jsx(a.Fragment,{children:de.map(ke=>b(ke,"single-row",se(de,ke,"single-row")))})},Se=q=>{const de=Kn(e,q,z,$,T),ke=de.find(he=>he.prefix==="title1");return ke?b(ke,"two-row-top",se(de,ke,"two-row-top")):null},te=(q,de=!1)=>{const ke=Kn(e,q,z,$,T),he=ke.filter(Fe=>Fe.prefix==="title2"||Fe.prefix==="title3"),J=o&&de;return he.length>0||J||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[he.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:he.map(Fe=>b(Fe,"two-row-bottom",se(ke,Fe,"two-row-bottom")))}),de&&o?a.jsxs(a.Fragment,{children:[we(),Pe()]}):null]}):null,(m??0)>0||J?a.jsx("div",{"data-controls":J?"titleRowMarginBottom":void 0,"data-controls-axis":J?"y":void 0,"data-controls-reverse":J?"":void 0,className:J?`${e}-control`:void 0,style:{height:H,width:"100%",flexShrink:0,pointerEvents:J?"auto":"none"}}):null]}):null},$e=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(y??0,i),height:D.scalingValue(y??0,i),marginRight:U,"--close-icon-hover-color":G},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:q=>{q.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(sn,{url:C??"",fill:S,hoverFill:i&&!r?S:G,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:U,height:"100%",pointerEvents:"auto"}})]}),re=()=>le?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:$e()}):null,ge=q=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:q})}),ye=q=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[le||ue?E():null,pe?M("two-row"):null,ge(q),re()]}),Z=(q,de=!1)=>a.jsxs(a.Fragment,{children:[ye(Se(q)),te(q,de)]}),Q=()=>{const q=I?-1:g.findIndex(he=>he.prefix==="title1"),de=!I&&(o||(p??0)>0)?(()=>{const he=p??0,J=q>=0?P[q]:A.title1Width,Ne=Math.max(he,Un);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(J),style:{position:"absolute",top:0,left:0,width:D.scalingValue(Ne,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ke=g.flatMap((he,J)=>{if(!he.marginLeftKey)return[];const Ne=_[he.marginLeftKey]??0,Fe=Ad(g,P,_,J)+ve(),et=Math.max(Ne,Un);return a.jsx("div",{"data-controls":he.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(P[J]),style:{position:"absolute",top:0,left:D.scalingValue(Fe,i),width:D.scalingValue(et,i),height:"100%",pointerEvents:"auto"}},he.marginLeftKey)});return de?[de,...ke]:ke},ce=()=>g.map((q,de)=>{const ke=cn(de,P),J=ne(de)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":q.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D.scalingValue(J,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${q.widthKey}-junction`)}),we=()=>L.flatMap((q,de)=>{if(!q.marginLeftKey)return[];const ke=_[q.marginLeftKey]??0,he=Me(de),J=Math.max(ke,Un),{resolvedWidth:Ne}=j(q,"two-row-bottom");return a.jsx("div",{"data-controls":q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:D.scalingValue(he,i),width:D.scalingValue(J,i),height:"100%",pointerEvents:"auto"}},q.marginLeftKey)}),Pe=()=>L.map((q,de)=>{const{maxWidth:ke}=j(q,"two-row-bottom"),J=xe(de)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":q.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D.scalingValue(J,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${q.widthKey}-junction`)}),Ce=()=>!o||I?null:a.jsxs(a.Fragment,{children:[Q(),ce()]}),X=!!(t.title2||t.title3||(m??0)>0||o),me=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[le||ue?E():null,pe?M("single-row"):null,ue?ge(V(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),re(),Ce()]}),ae=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...X?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:X?void 0:{flex:"0 0 auto",height:"auto"},children:Z(t,!0)}),Ce()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:W,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...I?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${I?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${I?` ${e}-text-bar-cell-stacked`:""}`,style:I?void 0:{flex:1,minWidth:0,width:"100%"},children:I?ae():me()})})})]})}function Bf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function zf(e){return`
7189
+ `,Ia={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},If=["titleColor","subtitleColor","lightboxCounterColor"],Rf={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"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},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:{...Ia.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:{...Ia.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:{...Ia.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,imageCorners:0,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,imageCorners:0,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,imageCorners:0,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","imageCorners","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","imageCorners"]},{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:[...If],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Lf={element:Sf,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:Rf,sourceCode:Tf},Pf=50,Ml=10,Vs="cntrl-lightbox-journal",sa=Vs,as=`${Vs}-`,la=e=>`${Vs}-${e}`,Gs=e=>e===sa||e.startsWith(as),kl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Al=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=kl(t.get(la(e)));if(i)return i}const n=kl(t.get(sa));if(n)return n;for(const[i]of t){if(!i.startsWith(as))continue;const o=i.slice(as.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Fl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Ed=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Gs(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(la(t),String(e)):i.searchParams.set(sa,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Ef=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===la(e)||i===sa:Gs(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)}},Md=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(la(e)):[...t.keys()].some(n=>Gs(n))},Mf=(e,t)=>{if(Md(t)){if(e){window.history.back();return}Ef(t)}},kf=20,Af=2,Ra=e=>`max(${e}, ${kf}px)`,Ji=e=>((e==null?void 0:e.image)??[]).slice(0,Af),kd=e=>e.reduce((t,n)=>t+Ji(n).length,0),Ff=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Ji(r).length,1),i=Ji(e[t]).length;return{start:n,end:n+i-1}},_f=(e,t)=>{const n=kd(e),{start:i,end:o}=Ff(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Er=(e,t)=>t==="B"?e.flatMap((n,i)=>Ji(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Ji(n)})),Nf=(e,t,n,i)=>{var r;if(n==="B")return`${t+1} / ${e.length}`;const o=((r=e[t])==null?void 0:r.entryIndex)??0;return _f(i,o)},_l=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Wf=(e,t,n)=>e==="B"?t.length>1:kd(n)>1,fn=.004,Un=.004,Yi={title1Width:.13,title2Width:.13,title3Width:.14},Kn=(e,t,n,i,o)=>{const r=[];return t.title1&&r.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&r.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&r.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),r},Qi=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Ho=(e,t)=>Qi(e,t),cn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Zn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Qi(e.length,n),effective:Ho(e.length,n)}},Ad=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),Fd=(e,t,n,i)=>e.slice(0,i+1).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),oi=["title1","title2","title3","count"],ot=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Xs={title1:"1",title2:"2",title3:"3",count:"Count"},Ys=e=>[ot(e,"fontFamily"),ot(e,"fontSettings"),{type:"row",items:[ot(e,"fontSize"),ot(e,"lineHeight"),ot(e,"letterSpacing"),ot(e,"wordSpacing")]},ot(e,"textAlign"),ot(e,"textAppearance")],Hf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(oi.map(e=>[Xs[e],Ys(e)]))}),Df={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Of={title1:.02,title2:.02,title3:.02,count:.017},bi=(e,t)=>{const n=i=>{const o=ot(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[Df[t]]}},wi=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Of[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return qt(i,n)};function _d({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:x=0,title3MarginLeft:w=0,titleRowMarginBottom:m=0,titleHeaderLayout:h="desktop",contentMarginTop:f=0,iconMarginRight:v=0,closeIcon:C=null,closeIconMaxWidth:y=0,closeIconColor:S="#000000",closeIconHoverColor:G="#cccccc"}=n,W=O.scalingValue(f,i),U=O.scalingValue(v,i),H=O.scalingValue(m,i),I=h==="mobile",z=wi("title1",bi(n,"title1"),i),$=wi("title2",bi(n,"title2"),i),T=wi("title3",bi(n,"title3"),i),k=s.useMemo(()=>({title1Width:d??Yi.title1Width,title2Width:c??Yi.title2Width,title3Width:u??Yi.title3Width}),[d,c,u]),_=s.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:w}),[x,w]),g=s.useMemo(()=>Kn(e,t,z,$,T),[e,t,z,$,T]),D=s.useMemo(()=>g.map(Y=>k[Y.widthKey]),[g,k]),P=s.useMemo(()=>Qi(g.length,D),[g.length,D]),q=s.useMemo(()=>Ho(g.length,D),[g.length,D]),ie=s.useMemo(()=>g.filter(Y=>Y.prefix==="title1"),[g]),L=s.useMemo(()=>g.filter(Y=>Y.prefix==="title2"||Y.prefix==="title3"),[g]),B=s.useMemo(()=>Zn(ie,k),[ie,k]),K=s.useMemo(()=>Zn(L,k),[L,k]),ue=!!(t.title1||t.title2||t.title3),le=C!==null;if(!(ue||le))return null;const pe=(p??0)>0||o,j=(Y,ce)=>{const Ee=g.findIndex(Q=>Q.prefix===Y.prefix);if(!I||ce==="single-row")return{effectiveWidth:q[Ee]??0,resolvedWidth:P[Ee]??0,maxWidth:cn(Ee,P)};if(ce==="two-row-top"){const Q=ie.findIndex(Ne=>Ne.prefix===Y.prefix);return{effectiveWidth:B.effective[Q]??0,resolvedWidth:B.resolved[Q]??0,maxWidth:cn(Q,B.resolved)}}const he=L.findIndex(Q=>Q.prefix===Y.prefix);return{effectiveWidth:K.effective[he]??0,resolvedWidth:K.resolved[he]??0,maxWidth:cn(he,K.resolved)}},se=(Y,ce,Ee)=>{if(!I||Ee==="single-row"){const et=Y.findIndex(De=>De.prefix===ce.prefix),Je=Y.map(De=>k[De.widthKey]),dt=Qi(Y.length,Je);return{effectiveWidth:Ho(Y.length,Je)[et]??0,resolvedWidth:dt[et]??0,maxWidth:cn(et,dt)}}if(Ee==="two-row-top"){const et=Y.filter(De=>De.prefix==="title1"),Je=et.findIndex(De=>De.prefix===ce.prefix),{resolved:dt,effective:tt}=Zn(et,k);return{effectiveWidth:tt[Je]??0,resolvedWidth:dt[Je]??0,maxWidth:cn(Je,dt)}}const he=Y.filter(et=>et.prefix==="title2"||et.prefix==="title3"),Q=he.findIndex(et=>et.prefix===ce.prefix),{resolved:Ne,effective:Fe}=Zn(he,k);return{effectiveWidth:Fe[Q]??0,resolvedWidth:Ne[Q]??0,maxWidth:cn(Q,Ne)}},ne=Y=>Fd(g,P,_,Y)+(I?0:p??0),ve=()=>I?0:p??0,ke=Y=>L.slice(0,Y).reduce((ce,Ee,he)=>ce+(Ee.marginLeftKey?_[Ee.marginLeftKey]??0:0)+(K.resolved[he]??0),0),xe=Y=>{const ce=L[Y];return ke(Y)+(ce.marginLeftKey?_[ce.marginLeftKey]??0:0)+(K.resolved[Y]??0)},b=(Y,ce,Ee)=>{const he=Y.marginLeftKey?_[Y.marginLeftKey]??0:0,{effectiveWidth:Q,resolvedWidth:Ne,maxWidth:Fe}=Ee??j(Y,ce),et=Math.max(he,Un),Je=o&&ce==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Y.prefix,style:{width:O.scalingValue(Q,i),...he>0?{marginLeft:O.scalingValue(he,i)}:{}},children:[a.jsx("p",{className:Y.className,style:Y.style,children:Y.text}),Je&&Y.marginLeftKey?a.jsx("div",{"data-controls":Y.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:O.scalingValue(-he,i),width:O.scalingValue(et,i),height:"100%",pointerEvents:"auto"}}):null,Je?a.jsx("div",{"data-controls":Y.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:O.scalingValue(-fn/2,i),width:O.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},Y.className)},M=(Y="two-row")=>{const ce=g.findIndex(Q=>Q.prefix==="title1"),Ee=ce>=0?P[ce]:k.title1Width,he=Y==="two-row"&&o;return a.jsx("div",{...he?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ee)}:{},style:{width:O.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...he?{pointerEvents:"auto"}:{}}})},E=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:z,"aria-hidden":"true",children:" "}),V=Y=>{const ce=Kn(e,Y,z,$,T);return a.jsx(a.Fragment,{children:ce.map(Ee=>b(Ee,"single-row",se(ce,Ee,"single-row")))})},Ce=Y=>{const ce=Kn(e,Y,z,$,T),Ee=ce.find(he=>he.prefix==="title1");return Ee?b(Ee,"two-row-top",se(ce,Ee,"two-row-top")):null},te=(Y,ce=!1)=>{const Ee=Kn(e,Y,z,$,T),he=Ee.filter(Fe=>Fe.prefix==="title2"||Fe.prefix==="title3"),Q=o&&ce;return he.length>0||Q||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[he.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:he.map(Fe=>b(Fe,"two-row-bottom",se(Ee,Fe,"two-row-bottom")))}),ce&&o?a.jsxs(a.Fragment,{children:[be(),Pe()]}):null]}):null,(m??0)>0||Q?a.jsx("div",{"data-controls":Q?"titleRowMarginBottom":void 0,"data-controls-axis":Q?"y":void 0,"data-controls-reverse":Q?"":void 0,className:Q?`${e}-control`:void 0,style:{height:H,width:"100%",flexShrink:0,pointerEvents:Q?"auto":"none"}}):null]}):null},$e=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:O.scalingValue(y??0,i),height:O.scalingValue(y??0,i),marginRight:U,"--close-icon-hover-color":G},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Y=>{Y.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(sn,{url:C??"",fill:S,hoverFill:i&&!r?S:G,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:U,height:"100%",pointerEvents:"auto"}})]}),ae=()=>le?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:$e()}):null,ge=Y=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:Y})}),ye=Y=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[le||ue?E():null,pe?M("two-row"):null,ge(Y),ae()]}),Z=(Y,ce=!1)=>a.jsxs(a.Fragment,{children:[ye(Ce(Y)),te(Y,ce)]}),J=()=>{const Y=I?-1:g.findIndex(he=>he.prefix==="title1"),ce=!I&&(o||(p??0)>0)?(()=>{const he=p??0,Q=Y>=0?P[Y]:k.title1Width,Ne=Math.max(he,Un);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Q),style:{position:"absolute",top:0,left:0,width:O.scalingValue(Ne,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ee=g.flatMap((he,Q)=>{if(!he.marginLeftKey)return[];const Ne=_[he.marginLeftKey]??0,Fe=Ad(g,P,_,Q)+ve(),et=Math.max(Ne,Un);return a.jsx("div",{"data-controls":he.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(P[Q]),style:{position:"absolute",top:0,left:O.scalingValue(Fe,i),width:O.scalingValue(et,i),height:"100%",pointerEvents:"auto"}},he.marginLeftKey)});return ce?[ce,...Ee]:Ee},de=()=>g.map((Y,ce)=>{const Ee=cn(ce,P),Q=ne(ce)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Y.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:O.scalingValue(Q,i),width:O.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${Y.widthKey}-junction`)}),be=()=>L.flatMap((Y,ce)=>{if(!Y.marginLeftKey)return[];const Ee=_[Y.marginLeftKey]??0,he=ke(ce),Q=Math.max(Ee,Un),{resolvedWidth:Ne}=j(Y,"two-row-bottom");return a.jsx("div",{"data-controls":Y.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:O.scalingValue(he,i),width:O.scalingValue(Q,i),height:"100%",pointerEvents:"auto"}},Y.marginLeftKey)}),Pe=()=>L.map((Y,ce)=>{const{maxWidth:Ee}=j(Y,"two-row-bottom"),Q=xe(ce)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Y.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:O.scalingValue(Q,i),width:O.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${Y.widthKey}-junction`)}),Se=()=>!o||I?null:a.jsxs(a.Fragment,{children:[J(),de()]}),X=!!(t.title2||t.title3||(m??0)>0||o),me=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[le||ue?E():null,pe?M("single-row"):null,ue?ge(V(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ae(),Se()]}),re=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...X?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:X?void 0:{flex:"0 0 auto",height:"auto"},children:Z(t,!0)}),Se()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:W,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...I?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${I?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${I?` ${e}-text-bar-cell-stacked`:""}`,style:I?void 0:{flex:1,minWidth:0,width:"100%"},children:I?re():me()})})})]})}function Bf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function zf(e){return`
7190
7190
  .${e}-wrapper {
7191
7191
  display: grid;
7192
7192
  align-items: start;
@@ -7506,7 +7506,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
7506
7506
  pointer-events: auto;
7507
7507
  flex-shrink: 0;
7508
7508
  }
7509
- `}const Nl={url:"",name:"",objectFit:"cover"},Tn=500,fo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",jf=72,Vf=50,Gf=1e4,Xf=650,Yf=500;function qf(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function Nd(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 Uf(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Nd(i,n):null}function Kf(e){return e.reduce((t,n,i)=>{const o=qs(n.gallery),l=Us(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function $o(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 Wl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return $o(e,i,n)}const Zf=.03;function Wd(e){return e.width*Zf}const La={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function pr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Hl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Jf(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ss(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function Qf(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ss(e,t.width,t.height)}function ey(e,t){if(mo(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 ty(e){const t=new Set,n=[];for(const i of e){const o=qs(i.gallery),r=Us(o);for(const l of r)for(const d of[l.displayMedia,l.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function ny({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>mo(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function eo(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Wd(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function Br(e,t,n){const i=eo(e,t,n);return{...i,left:2*i.left-e.left}}function iy(e,t,n){const{left:i,width:o}=n,r=Wd(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function Hd(e,t,n,i){const o=eo(e,"left",i),r=eo(e,"right",i),l=Br(e,"left",i),d=Br(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function oy(e,t,n,i){const{start:o,end:r}=Hd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function ry(e,t,n){const i=eo(e,t,n),o=Br(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Dd(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 qs(e){if(!e)return;if(Dd(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??Nl,i??o??Nl]}]}function ay(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function sy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Us(e){if(!Array.isArray(e)||e.length===0)return[];if(Dd(e)){const t=[];for(const n of e){const i=ay(n);if(!i)continue;const o=sy(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 mo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function ly({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return mo(e)?a.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}):a.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function cy({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function mr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return mo(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function dy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:v}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),G=s.useRef(new Map),[W,U]=s.useState(0),H=s.useRef(null),I=s.useRef(0),z=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),A=s.useRef(!1),_=s.useRef(!1),g=s.useRef(null),B=s.useRef(null),P=s.useRef(null),Y=s.useRef(()=>{}),ie=s.useRef(null),L=s.useRef(null),O=s.useRef(null),K=s.useRef(!1),[ue,le]=s.useState(null),[F,pe]=s.useState(La),[j,se]=s.useState(0),[ne,ve]=s.useState("opening"),[Me,xe]=s.useState(0),[b,M]=s.useState(0),[E,V]=s.useState(!1),[Se,te]=s.useState(null),[$e,re]=s.useState(null),[ge,ye]=s.useState(null),[Z,Q]=s.useState(!1),[ce,we]=s.useState(null),[Pe,Ce]=s.useState(!1),X=s.useRef(!1),[me,ae]=s.useState(!1),[q,de]=s.useState(!1),ke=s.useRef(n),he=s.useRef(void 0),J=t[n],Ne=J?mo(J):!1,Fe=b!==0||E,et=!l&&(!r||!!d),Je=c&&!l,dt=u.length>1,tt=s.useCallback((N,Re)=>t.length<=1?null:t[(N+Re+t.length)%t.length]??null,[t]),De=dt?$o(u,p,-1):tt(n,-1),Ie=dt?$o(u,p,1):tt(n,1),We=Se===-1&&Fe?dt&&$e!==null?$o(u,$e,-1):ge!==null?tt(ge,-1):null:null,je=Se===1&&Fe?dt&&$e!==null?$o(u,$e,1):ge!==null?tt(ge,1):null:null,Ue=We&&We.url!==(De==null?void 0:De.url)?We:null,k=je&&je.url!==(Ie==null?void 0:Ie.url)?je:null,ee=De&&Je?(()=>{const N=dt?Wl(u,p,-1):t.length>2?tt((n-1+t.length)%t.length,-1):null;return N&&N.url!==De.url?N:null})():null,Te=Ie&&Je?(()=>{const N=dt?Wl(u,p,1):t.length>2?tt((n+1)%t.length,1):null;return N&&N.url!==Ie.url?N:null})():null,He=Ue??ee,Be=k??Te,Ve=s.useCallback((N,Re,Ae)=>{if(!N||!Re||!Ae)return;const ze=G.current,ct=ze.get(N);(ct==null?void 0:ct.width)===Re&&(ct==null?void 0:ct.height)===Ae||(ze.set(N,{width:Re,height:Ae}),U(Et=>Et+1))},[]),rt=s.useCallback(N=>{if(!(N!=null&&N.url))return null;const Re=G.current.get(N.url);return Qf(y.current,Re)},[W,j]),Ze=s.useCallback(()=>{if(!J)return;const N=rt(J);if(N){le(N);return}const Re=y.current;Re&&le(Hl(Re))},[J,rt]),_e=s.useCallback(N=>{if(dt){const Re=u.length;re((p+N+Re)%Re),ye(null);return}t.length>1&&(ye((n+N+t.length)%t.length),re(null))},[dt,u.length,p,t.length,n]),qe=s.useCallback(N=>{_.current=N,V(N)},[]),Oe=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),nt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{Oe(),qe(!1)},fo+32)},[Oe,qe]),at=s.useCallback(()=>{const N=C.current;if(!N){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:La.width,height:typeof window<"u"?window.innerHeight:La.height});return}const Re=N.getBoundingClientRect();pe({left:Re.left,top:Re.top,width:Re.width,height:Re.height})},[]),st=s.useCallback((N,Re)=>{if(Fe){if(me&&!E)return`translate(${b}px, 0px)`;if(E&&Se!==null){const Ae=rt(N);if(!Ae)return;const{x:ze,y:ct}=oy(Ae,Re,Se,F);return`translate(${ze}px, ${ct}px)`}if(E)return"translate(0px, 0px)"}},[Fe,me,E,b,Se,F,rt]),St=s.useCallback(()=>{const N=B.current;B.current=null,Oe(),qe(!1),te(null),re(null),ye(null),M(0),ae(!1),T.current=!1,z.current=0,$.current="none",N===-1?f():N===1&&v()},[Oe,qe,f,v]),Yt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{B.current!==null&&St()},fo+32)},[Oe,St]),Zt=s.useCallback(()=>{Oe(),B.current=null,qe(!1),te(null),re(null),ye(null),M(0),ae(!1),T.current=!1,z.current=0,$.current="none"},[Oe,qe]),vt=s.useCallback(N=>{if(!(!Je||!ue)){if(_.current){if(B.current===N){P.current=N,St();return}Zt()}Oe(),_e(N),B.current=N,te(N),qe(!0),Yt()}},[Je,ue,St,Zt,Oe,_e,qe,Yt]);Y.current=vt;const wt=s.useCallback(()=>{ie.current=null,K.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),O.current!==null&&(window.clearTimeout(O.current),O.current=null)},[]),Bt=s.useCallback(N=>{L.current!==null&&window.clearInterval(L.current);const Re=K.current?Yf:Xf;L.current=window.setInterval(()=>{Y.current(N)},Re)},[]),At=s.useCallback(N=>{ie.current!==N&&(wt(),ie.current=N,K.current=!1,Y.current(N),Bt(N),O.current=window.setTimeout(()=>{O.current=null,ie.current===N&&(K.current=!0,Bt(N))},Gf))},[wt,Bt]),xt=s.useCallback(()=>{const N=y.current;if(!N)return;const Re=J==null?void 0:J.url,Ae=Re?G.current.get(Re):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){le(ss(N,Ae.width,Ae.height));return}const ze=S.current;if(ze&&Re&&(ze.src===Re||ze.currentSrc===Re)){const{width:Et,height:it}=Jf(ze);if(Et&&it){Ve(Re,Et,it),le(ss(N,Et,it));return}}const ct=Hl(N);!ct.width||!ct.height||le(ct)},[J==null?void 0:J.url,Ve]),Ft=s.useCallback(N=>{if(S.current=N,!!N){if(N instanceof HTMLVideoElement){N.readyState>=1&&N.videoWidth>0&&xt();return}N.complete&&N.naturalWidth>0&&xt()}},[xt]),Nt=s.useCallback(()=>{at(),xt(),se(N=>N+1)},[at,xt]);s.useEffect(()=>{Nt();const N=y.current,Re=C.current,Ae=new ResizeObserver(()=>Nt());return N&&Ae.observe(N),Re&&Ae.observe(Re),window.addEventListener("resize",Nt),()=>{Ae.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,x]),s.useLayoutEffect(()=>{if(!J)return;const N=S.current;if(N){if(N instanceof HTMLImageElement&&N.complete&&N.naturalWidth>0){xt();return}N instanceof HTMLVideoElement&&N.readyState>=1&&N.videoWidth>0&&xt()}},[J==null?void 0:J.url,n,xt]),s.useEffect(()=>{Ze()},[Ze,W]),s.useEffect(()=>{const N=new Set,Re=[],Ae=ze=>{!(ze!=null&&ze.url)||N.has(ze.url)||(N.add(ze.url),Re.push(ze))};t.forEach(Ae),u.forEach(ze=>ze.items.forEach(Ae)),Re.forEach(ze=>{G.current.has(ze.url)||ey(ze,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(ne!=="opening"||!ue)return;if(!w){ve("open");return}Q(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Q(!0),ve("open")})});return()=>cancelAnimationFrame(N)},[ne,ue,w]),s.useEffect(()=>{if(ne!=="closing")return;const N=setTimeout(()=>h(),Tn);return()=>clearTimeout(N)},[ne,h]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{ke.current===n&&he.current===(J==null?void 0:J.url)||(Oe(),B.current=null,te(null),re(null),ye(null),xe(0),M(0),qe(!1),de(!1),ae(!1),I.current=0,z.current=0,$.current="none",T.current=!1,H.current=null,A.current=!1,S.current=null,Ze(),ke.current=n,he.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,qe,Oe,Ze]),s.useLayoutEffect(()=>{const N=P.current;N!==null&&(P.current=null,requestAnimationFrame(()=>{Y.current(N)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(ne==="opening"){X.current=!1,Ce(!1);return}if(ne!=="open"||X.current)return;if(!De&&!Ie){X.current=!0;return}Ce(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),X.current=!0})});return()=>cancelAnimationFrame(N)},[ne,De==null?void 0:De.url,Ie==null?void 0:Ie.url]),s.useEffect(()=>{if(ne!=="open")return;const N=()=>{const it=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",it,!0)};document.addEventListener("click",it,!0)},Re=it=>{const yt=it<0?1:-1;Oe(),_e(yt),B.current=yt,te(yt),qe(!0),Yt()},Ae=it=>{if(Math.abs(it)>Vf&&Je){Re(it);return}B.current=null,te(null),re(null),ye(null),qe(!0),M(0),nt()},ze=it=>{if(it.touches.length!==1||_.current)return;const yt=it.touches[0];A.current=!0,H.current={x:yt.clientX,y:yt.clientY},$.current="none",z.current=0,T.current=!1},ct=it=>{if(!H.current||it.touches.length!==1||_.current)return;const yt=it.touches[0],Ot=yt.clientX-H.current.x,It=yt.clientY-H.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Je)return;$.current="horizontal"}else if(It>0){if(!et)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,ae(!0),z.current=Ot,M(Ot),it.preventDefault();return}$.current==="vertical"&&(T.current=!0,ae(!0),I.current=It,xe(It),it.preventDefault())},Et=()=>{if(!H.current)return;const it=$.current,yt=T.current;if(yt&&it==="horizontal")Ae(z.current),N();else if(yt&&it==="vertical"){const Ot=I.current;if(et&&Ot>jf){const It=window.innerHeight;I.current=It,de(!0),xe(It),ve("closing")}else I.current=0,xe(0);N()}else it==="horizontal"&&Math.abs(z.current)>0&&(Ae(z.current),N());H.current=null,$.current="none",z.current=0,T.current=!1,ae(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",ct,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",ct),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[ne,Je,qe,nt,Oe,et,Yt,_e]);const Ut=s.useCallback(()=>{const N=(m==null?void 0:m())??w??null;N&&ue&&(we(N),Q(!0)),ve("closing")},[m,w,ue]);s.useEffect(()=>{const N=ze=>{if(ze.key==="Escape"){if(r&&d||ne==="closing")return;wt(),Ut();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||ne!=="open"||!Je)return;ze.preventDefault();const ct=ze.key==="ArrowLeft"?-1:1;ze.repeat&&ie.current===ct||At(ct)},Re=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const ct=ze.key==="ArrowLeft"?-1:1;ie.current===ct&&wt()},Ae=()=>{wt()};return window.addEventListener("keydown",N),window.addEventListener("keyup",Re),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",Re),window.removeEventListener("blur",Ae),wt()}},[ne,r,d,Ut,Je,At,wt]),s.useEffect(()=>{ne!=="open"&&wt()},[ne,wt]);const Jt=()=>{ne==="closing"||l||Ut()},Tt=ne==="open",Wt=ne==="closing",rn=Me>0?Math.max(0,1-Me/500):1,gt=Me>0?Math.max(.35,1-Me/500):1,Ee=s.useCallback(N=>{if(!(N.propertyName!=="transform"||!_.current)){if(B.current!==null){St();return}Oe(),qe(!1)}},[Oe,qe,St]),Xe=ne==="closing"?ce??w:w,lt=Xe&&ue&&(ne==="opening"||Wt)?qf(Xe,ue):void 0,ht=Fe&&J?st(J,"center"):Me>0?`translateY(${Me}px)`:lt,ft=ue?pr(ue,F):null,Lt=!!(Xe&&ue),mt=Lt&&(ne==="closing"||ne==="open"&&Z),zt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:Me>0?gt:Lt?1:ne==="opening"||Wt?0:1,transition:me&&!E?"none":E?`transform ${fo}ms ${pn}`:q?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:mt?`transform ${Tn}ms ${pn}`:ne==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Ne&&Tt&&!Fe?"auto":"none",touchAction:Ne&&Tt?"none":void 0,zIndex:1,overflow:Ne?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!Fe?"auto":"none"},Mt=(N,Re,Ae="adjacent")=>{const ze=rt(N);if(!ze)return{display:"none"};const ct=Ae==="far"?Re==="left"?"far-left":"far-right":Re==="left"?"left-adjacent":"right-adjacent",{start:Et}=Se!==null?Hd(ze,ct,Se,F):{start:Ae==="far"?Br(ze,Re,F):eo(ze,Re,F)},it=pr(Et,F),yt=st(N,ct),Ot=!Fe&&Ae==="adjacent"&&Tt&&!Pe?ry(ze,Re,F):null,It=Ae==="far"&&Fe&&Se===(Re==="left"?-1:1),nn=me&&!E?!1:E,un=Ae==="adjacent"&&Tt&&Pe&&!Fe;return{position:"absolute",top:it.top,left:it.left,width:it.width,height:it.height,objectFit:"contain",transform:yt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ae==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Ae==="far"?`transform ${fo}ms ${pn}`:`transform ${fo}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:ne==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(N,Re)=>{const Ae=rt(N);return Ae?iy(eo(Ae,Re,F),Re,F):null},Gt=N=>Re=>{if(!l){if(A.current){A.current=!1;return}Re.stopPropagation(),vt(N)}},Ht=De?Vt(De,"left"):null,Dt=Ie?Vt(Ie,"right"):null,_t=Ht?pr(Ht,F):null,Ct=Dt?pr(Dt,F):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ne==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:me?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Tt?1:0,transition:me?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(_d,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&He&&a.jsx(mr,{media:He,style:Mt(He,"left","far"),onMeasure:Ve,onTransitionEnd:Ee},`far-prev-${He.url}`),Tt&&De&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:De,style:Mt(De,"left"),onMeasure:Ve,onTransitionEnd:Ee},`prev-${De.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Tt&&Ie&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Ie,style:Mt(Ie,"right"),onMeasure:Ve,onTransitionEnd:Ee},`next-${Ie.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Tt&&Be&&a.jsx(mr,{media:Be,style:Mt(Be,"right","far"),onMeasure:Ve,onTransitionEnd:Ee},`far-next-${Be.url}`),ue&&J&&(Ne?a.jsx(cy,{src:J.url,phase:ne,onMediaElement:Ft,wrapperStyle:zt,videoStyle:kt,onLoadedMetadata:xt,onTransitionEnd:Ee},`${n}-${J.url}`):a.jsx("img",{ref:Ft,src:J.url,alt:J.name,onLoad:xt,onTransitionEnd:Ee,style:zt},`${n}-${J.url}`))]})}function uy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:x}=e,w=(x==null?void 0:x.display)==="cover",m=(x==null?void 0:x.ratioValue)??"1:1",h=(x==null?void 0:x.reversed)??!1,[f,v]=m.split(":").map(Number),S=`${h?v:f} / ${h?f:v}`,G=c.entryWidth??.2,W=c.columnsCount,U=D.scalingValue(G,n),H=D.scalingValue(c.horizontalGap??0,n),I=U,z=U,$={width:I,...w?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},T=w?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},A=s.useRef(null),[_,g]=s.useState(!1),[B,P]=s.useState([]),[Y,ie]=s.useState(0),[L,O]=s.useState(0),[K,ue]=s.useState(null),[le,F]=s.useState({title1:"",title2:"",title3:""}),pe=(()=>{const ge={},ye=A.current?getComputedStyle(A.current).getPropertyValue("--cntrl-article-width").trim():"";return ye&&(ge["--cntrl-article-width"]=ye),ge})(),j=!n||i||o,se=s.useMemo(()=>zf(d),[d]),ne=t??[],ve=ne.length%W||W,Me=ve<W&&ne.length>0,xe=ne.length-ve,b=Me?Math.floor((W-ve)/2)+1:1,M=s.useMemo(()=>Kf(ne),[ne]),E=s.useMemo(()=>ty(ne),[ne]),V=(ge,ye,Z)=>{if(n&&!o&&!i)return;const Q=M.findIndex(we=>we.gridIndex===ge);if(Q<0)return;const ce=M[Q];O(Q),P(ce.items),ie(ye),F(ce.entry),ue(Z??null),g(!0)},Se=s.useCallback(()=>{g(!1),ue(null)},[]),te=s.useCallback(()=>{const ge=M[L];return!ge||!A.current?K:Uf(A.current,ge.gridIndex,w?"cover":"contain")??K},[M,L,K,w]),$e=s.useCallback(ge=>{if(M.length>1){const ye=M.length,Z=(L+ge+ye)%ye,Q=M[Z],ce=Math.min(Y,Q.items.length-1);O(Z),P(Q.items),ie(ce),F(Q.entry);return}ie(ye=>(ye+ge+B.length)%B.length)},[M,L,Y,B.length]),re=M.length>1||B.length>1;return s.useEffect(()=>{if(!_||typeof document>"u")return;const ge=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ge}},[_]),s.useEffect(()=>{!n||o||i||g(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:se}}),a.jsx(ny,{mediaList:E}),a.jsx("div",{ref:A,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${W}, ${U})`,rowGap:0,columnGap:H,width:D.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:D.scalingValue(u??0,n)},children:ne.map((ge,ye)=>{const Z=qs(ge.gallery),Q=Us(Z),ce=Q.filter(ae=>ae.lightboxMedia).map(ae=>ae.lightboxMedia),we=Math.floor(ye/W)===Math.ceil(ne.length/W)-1,Pe=Me&&ye>=xe?`${b+(ye-xe)}`:void 0,Ce=Q[0],X=Ce!=null&&Ce.lightboxMedia?ce.findIndex(ae=>ae.url===Ce.lightboxMedia.url):-1,me=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:Q.length>0&&a.jsx(ly,{media:Ce.displayMedia,gridIndex:ye,className:`${d}-item-${mo(Ce.displayMedia)?"video":"image"}`.trim(),style:T,onMediaClick:j&&X>=0?ae=>V(ye,X,Nd(ae.currentTarget,w?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,we?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:U,...Pe?{gridColumn:Pe}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:z}})}),a.jsx("a",{className:`${d}-item-image-link`,children:me}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:z}})})]})},ye)})}),_&&typeof document<"u"&&(()=>{const ge=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:pe,"data-selection":"none",children:a.jsx(dy,{prefix:d,items:B,index:Y,entry:le,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:re,lightboxEntries:M,entryIdx:L,layoutId:r,sourceRect:K,resolveCloseSourceRect:te,onClose:Se,onPrev:()=>$e(-1),onNext:()=>$e(1)})}),ge)})()]})}const py=`import { CommonComponentProps } from '../props';
7509
+ `}const Nl={url:"",name:"",objectFit:"cover"},Tn=500,fo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",jf=72,Vf=50,Gf=1e4,Xf=650,Yf=500;function qf(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function Nd(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 Uf(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Nd(i,n):null}function Kf(e){return e.reduce((t,n,i)=>{const o=qs(n.gallery),l=Us(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function $o(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 Wl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return $o(e,i,n)}const Zf=.03;function Wd(e){return e.width*Zf}const La={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function pr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Hl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Jf(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ss(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function Qf(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ss(e,t.width,t.height)}function ey(e,t){if(mo(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 ty(e){const t=new Set,n=[];for(const i of e){const o=qs(i.gallery),r=Us(o);for(const l of r)for(const d of[l.displayMedia,l.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function ny({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>mo(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function eo(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Wd(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function Br(e,t,n){const i=eo(e,t,n);return{...i,left:2*i.left-e.left}}function iy(e,t,n){const{left:i,width:o}=n,r=Wd(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function Hd(e,t,n,i){const o=eo(e,"left",i),r=eo(e,"right",i),l=Br(e,"left",i),d=Br(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function oy(e,t,n,i){const{start:o,end:r}=Hd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function ry(e,t,n){const i=eo(e,t,n),o=Br(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Dd(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 qs(e){if(!e)return;if(Dd(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??Nl,i??o??Nl]}]}function ay(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function sy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Us(e){if(!Array.isArray(e)||e.length===0)return[];if(Dd(e)){const t=[];for(const n of e){const i=ay(n);if(!i)continue;const o=sy(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 mo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function ly({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return mo(e)?a.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}):a.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function cy({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function mr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return mo(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function dy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:v}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),G=s.useRef(new Map),[W,U]=s.useState(0),H=s.useRef(null),I=s.useRef(0),z=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),k=s.useRef(!1),_=s.useRef(!1),g=s.useRef(null),D=s.useRef(null),P=s.useRef(null),q=s.useRef(()=>{}),ie=s.useRef(null),L=s.useRef(null),B=s.useRef(null),K=s.useRef(!1),[ue,le]=s.useState(null),[F,pe]=s.useState(La),[j,se]=s.useState(0),[ne,ve]=s.useState("opening"),[ke,xe]=s.useState(0),[b,M]=s.useState(0),[E,V]=s.useState(!1),[Ce,te]=s.useState(null),[$e,ae]=s.useState(null),[ge,ye]=s.useState(null),[Z,J]=s.useState(!1),[de,be]=s.useState(null),[Pe,Se]=s.useState(!1),X=s.useRef(!1),[me,re]=s.useState(!1),[Y,ce]=s.useState(!1),Ee=s.useRef(n),he=s.useRef(void 0),Q=t[n],Ne=Q?mo(Q):!1,Fe=b!==0||E,et=!l&&(!r||!!d),Je=c&&!l,dt=u.length>1,tt=s.useCallback((N,Re)=>t.length<=1?null:t[(N+Re+t.length)%t.length]??null,[t]),De=dt?$o(u,p,-1):tt(n,-1),Ie=dt?$o(u,p,1):tt(n,1),We=Ce===-1&&Fe?dt&&$e!==null?$o(u,$e,-1):ge!==null?tt(ge,-1):null:null,je=Ce===1&&Fe?dt&&$e!==null?$o(u,$e,1):ge!==null?tt(ge,1):null:null,Ue=We&&We.url!==(De==null?void 0:De.url)?We:null,A=je&&je.url!==(Ie==null?void 0:Ie.url)?je:null,ee=De&&Je?(()=>{const N=dt?Wl(u,p,-1):t.length>2?tt((n-1+t.length)%t.length,-1):null;return N&&N.url!==De.url?N:null})():null,Te=Ie&&Je?(()=>{const N=dt?Wl(u,p,1):t.length>2?tt((n+1)%t.length,1):null;return N&&N.url!==Ie.url?N:null})():null,He=Ue??ee,Be=A??Te,Ve=s.useCallback((N,Re,Ae)=>{if(!N||!Re||!Ae)return;const ze=G.current,ct=ze.get(N);(ct==null?void 0:ct.width)===Re&&(ct==null?void 0:ct.height)===Ae||(ze.set(N,{width:Re,height:Ae}),U(Et=>Et+1))},[]),rt=s.useCallback(N=>{if(!(N!=null&&N.url))return null;const Re=G.current.get(N.url);return Qf(y.current,Re)},[W,j]),Ze=s.useCallback(()=>{if(!Q)return;const N=rt(Q);if(N){le(N);return}const Re=y.current;Re&&le(Hl(Re))},[Q,rt]),_e=s.useCallback(N=>{if(dt){const Re=u.length;ae((p+N+Re)%Re),ye(null);return}t.length>1&&(ye((n+N+t.length)%t.length),ae(null))},[dt,u.length,p,t.length,n]),qe=s.useCallback(N=>{_.current=N,V(N)},[]),Oe=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),nt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{Oe(),qe(!1)},fo+32)},[Oe,qe]),at=s.useCallback(()=>{const N=C.current;if(!N){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:La.width,height:typeof window<"u"?window.innerHeight:La.height});return}const Re=N.getBoundingClientRect();pe({left:Re.left,top:Re.top,width:Re.width,height:Re.height})},[]),st=s.useCallback((N,Re)=>{if(Fe){if(me&&!E)return`translate(${b}px, 0px)`;if(E&&Ce!==null){const Ae=rt(N);if(!Ae)return;const{x:ze,y:ct}=oy(Ae,Re,Ce,F);return`translate(${ze}px, ${ct}px)`}if(E)return"translate(0px, 0px)"}},[Fe,me,E,b,Ce,F,rt]),St=s.useCallback(()=>{const N=D.current;D.current=null,Oe(),qe(!1),te(null),ae(null),ye(null),M(0),re(!1),T.current=!1,z.current=0,$.current="none",N===-1?f():N===1&&v()},[Oe,qe,f,v]),Yt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{D.current!==null&&St()},fo+32)},[Oe,St]),Zt=s.useCallback(()=>{Oe(),D.current=null,qe(!1),te(null),ae(null),ye(null),M(0),re(!1),T.current=!1,z.current=0,$.current="none"},[Oe,qe]),vt=s.useCallback(N=>{if(!(!Je||!ue)){if(_.current){if(D.current===N){P.current=N,St();return}Zt()}Oe(),_e(N),D.current=N,te(N),qe(!0),Yt()}},[Je,ue,St,Zt,Oe,_e,qe,Yt]);q.current=vt;const wt=s.useCallback(()=>{ie.current=null,K.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),B.current!==null&&(window.clearTimeout(B.current),B.current=null)},[]),Bt=s.useCallback(N=>{L.current!==null&&window.clearInterval(L.current);const Re=K.current?Yf:Xf;L.current=window.setInterval(()=>{q.current(N)},Re)},[]),At=s.useCallback(N=>{ie.current!==N&&(wt(),ie.current=N,K.current=!1,q.current(N),Bt(N),B.current=window.setTimeout(()=>{B.current=null,ie.current===N&&(K.current=!0,Bt(N))},Gf))},[wt,Bt]),xt=s.useCallback(()=>{const N=y.current;if(!N)return;const Re=Q==null?void 0:Q.url,Ae=Re?G.current.get(Re):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){le(ss(N,Ae.width,Ae.height));return}const ze=S.current;if(ze&&Re&&(ze.src===Re||ze.currentSrc===Re)){const{width:Et,height:it}=Jf(ze);if(Et&&it){Ve(Re,Et,it),le(ss(N,Et,it));return}}const ct=Hl(N);!ct.width||!ct.height||le(ct)},[Q==null?void 0:Q.url,Ve]),Ft=s.useCallback(N=>{if(S.current=N,!!N){if(N instanceof HTMLVideoElement){N.readyState>=1&&N.videoWidth>0&&xt();return}N.complete&&N.naturalWidth>0&&xt()}},[xt]),Nt=s.useCallback(()=>{at(),xt(),se(N=>N+1)},[at,xt]);s.useEffect(()=>{Nt();const N=y.current,Re=C.current,Ae=new ResizeObserver(()=>Nt());return N&&Ae.observe(N),Re&&Ae.observe(Re),window.addEventListener("resize",Nt),()=>{Ae.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,x]),s.useLayoutEffect(()=>{if(!Q)return;const N=S.current;if(N){if(N instanceof HTMLImageElement&&N.complete&&N.naturalWidth>0){xt();return}N instanceof HTMLVideoElement&&N.readyState>=1&&N.videoWidth>0&&xt()}},[Q==null?void 0:Q.url,n,xt]),s.useEffect(()=>{Ze()},[Ze,W]),s.useEffect(()=>{const N=new Set,Re=[],Ae=ze=>{!(ze!=null&&ze.url)||N.has(ze.url)||(N.add(ze.url),Re.push(ze))};t.forEach(Ae),u.forEach(ze=>ze.items.forEach(Ae)),Re.forEach(ze=>{G.current.has(ze.url)||ey(ze,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(ne!=="opening"||!ue)return;if(!w){ve("open");return}J(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{J(!0),ve("open")})});return()=>cancelAnimationFrame(N)},[ne,ue,w]),s.useEffect(()=>{if(ne!=="closing")return;const N=setTimeout(()=>h(),Tn);return()=>clearTimeout(N)},[ne,h]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{Ee.current===n&&he.current===(Q==null?void 0:Q.url)||(Oe(),D.current=null,te(null),ae(null),ye(null),xe(0),M(0),qe(!1),ce(!1),re(!1),I.current=0,z.current=0,$.current="none",T.current=!1,H.current=null,k.current=!1,S.current=null,Ze(),Ee.current=n,he.current=Q==null?void 0:Q.url)},[n,Q==null?void 0:Q.url,qe,Oe,Ze]),s.useLayoutEffect(()=>{const N=P.current;N!==null&&(P.current=null,requestAnimationFrame(()=>{q.current(N)}))},[n,p,Q==null?void 0:Q.url]),s.useLayoutEffect(()=>{if(ne==="opening"){X.current=!1,Se(!1);return}if(ne!=="open"||X.current)return;if(!De&&!Ie){X.current=!0;return}Se(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Se(!0),X.current=!0})});return()=>cancelAnimationFrame(N)},[ne,De==null?void 0:De.url,Ie==null?void 0:Ie.url]),s.useEffect(()=>{if(ne!=="open")return;const N=()=>{const it=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",it,!0)};document.addEventListener("click",it,!0)},Re=it=>{const yt=it<0?1:-1;Oe(),_e(yt),D.current=yt,te(yt),qe(!0),Yt()},Ae=it=>{if(Math.abs(it)>Vf&&Je){Re(it);return}D.current=null,te(null),ae(null),ye(null),qe(!0),M(0),nt()},ze=it=>{if(it.touches.length!==1||_.current)return;const yt=it.touches[0];k.current=!0,H.current={x:yt.clientX,y:yt.clientY},$.current="none",z.current=0,T.current=!1},ct=it=>{if(!H.current||it.touches.length!==1||_.current)return;const yt=it.touches[0],Ot=yt.clientX-H.current.x,It=yt.clientY-H.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Je)return;$.current="horizontal"}else if(It>0){if(!et)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,re(!0),z.current=Ot,M(Ot),it.preventDefault();return}$.current==="vertical"&&(T.current=!0,re(!0),I.current=It,xe(It),it.preventDefault())},Et=()=>{if(!H.current)return;const it=$.current,yt=T.current;if(yt&&it==="horizontal")Ae(z.current),N();else if(yt&&it==="vertical"){const Ot=I.current;if(et&&Ot>jf){const It=window.innerHeight;I.current=It,ce(!0),xe(It),ve("closing")}else I.current=0,xe(0);N()}else it==="horizontal"&&Math.abs(z.current)>0&&(Ae(z.current),N());H.current=null,$.current="none",z.current=0,T.current=!1,re(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",ct,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",ct),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[ne,Je,qe,nt,Oe,et,Yt,_e]);const Ut=s.useCallback(()=>{const N=(m==null?void 0:m())??w??null;N&&ue&&(be(N),J(!0)),ve("closing")},[m,w,ue]);s.useEffect(()=>{const N=ze=>{if(ze.key==="Escape"){if(r&&d||ne==="closing")return;wt(),Ut();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||ne!=="open"||!Je)return;ze.preventDefault();const ct=ze.key==="ArrowLeft"?-1:1;ze.repeat&&ie.current===ct||At(ct)},Re=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const ct=ze.key==="ArrowLeft"?-1:1;ie.current===ct&&wt()},Ae=()=>{wt()};return window.addEventListener("keydown",N),window.addEventListener("keyup",Re),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",Re),window.removeEventListener("blur",Ae),wt()}},[ne,r,d,Ut,Je,At,wt]),s.useEffect(()=>{ne!=="open"&&wt()},[ne,wt]);const Jt=()=>{ne==="closing"||l||Ut()},Tt=ne==="open",Wt=ne==="closing",rn=ke>0?Math.max(0,1-ke/500):1,gt=ke>0?Math.max(.35,1-ke/500):1,Me=s.useCallback(N=>{if(!(N.propertyName!=="transform"||!_.current)){if(D.current!==null){St();return}Oe(),qe(!1)}},[Oe,qe,St]),Xe=ne==="closing"?de??w:w,lt=Xe&&ue&&(ne==="opening"||Wt)?qf(Xe,ue):void 0,ht=Fe&&Q?st(Q,"center"):ke>0?`translateY(${ke}px)`:lt,ft=ue?pr(ue,F):null,Lt=!!(Xe&&ue),mt=Lt&&(ne==="closing"||ne==="open"&&Z),zt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:ke>0?gt:Lt?1:ne==="opening"||Wt?0:1,transition:me&&!E?"none":E?`transform ${fo}ms ${pn}`:Y?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:mt?`transform ${Tn}ms ${pn}`:ne==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Ne&&Tt&&!Fe?"auto":"none",touchAction:Ne&&Tt?"none":void 0,zIndex:1,overflow:Ne?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!Fe?"auto":"none"},Mt=(N,Re,Ae="adjacent")=>{const ze=rt(N);if(!ze)return{display:"none"};const ct=Ae==="far"?Re==="left"?"far-left":"far-right":Re==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ce!==null?Hd(ze,ct,Ce,F):{start:Ae==="far"?Br(ze,Re,F):eo(ze,Re,F)},it=pr(Et,F),yt=st(N,ct),Ot=!Fe&&Ae==="adjacent"&&Tt&&!Pe?ry(ze,Re,F):null,It=Ae==="far"&&Fe&&Ce===(Re==="left"?-1:1),nn=me&&!E?!1:E,un=Ae==="adjacent"&&Tt&&Pe&&!Fe;return{position:"absolute",top:it.top,left:it.left,width:it.width,height:it.height,objectFit:"contain",transform:yt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ae==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Ae==="far"?`transform ${fo}ms ${pn}`:`transform ${fo}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:ne==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(N,Re)=>{const Ae=rt(N);return Ae?iy(eo(Ae,Re,F),Re,F):null},Gt=N=>Re=>{if(!l){if(k.current){k.current=!1;return}Re.stopPropagation(),vt(N)}},Ht=De?Vt(De,"left"):null,Dt=Ie?Vt(Ie,"right"):null,_t=Ht?pr(Ht,F):null,Ct=Dt?pr(Dt,F):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ne==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:me?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Tt?1:0,transition:me?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(_d,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&He&&a.jsx(mr,{media:He,style:Mt(He,"left","far"),onMeasure:Ve,onTransitionEnd:Me},`far-prev-${He.url}`),Tt&&De&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:De,style:Mt(De,"left"),onMeasure:Ve,onTransitionEnd:Me},`prev-${De.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Tt&&Ie&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Ie,style:Mt(Ie,"right"),onMeasure:Ve,onTransitionEnd:Me},`next-${Ie.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Tt&&Be&&a.jsx(mr,{media:Be,style:Mt(Be,"right","far"),onMeasure:Ve,onTransitionEnd:Me},`far-next-${Be.url}`),ue&&Q&&(Ne?a.jsx(cy,{src:Q.url,phase:ne,onMediaElement:Ft,wrapperStyle:zt,videoStyle:kt,onLoadedMetadata:xt,onTransitionEnd:Me},`${n}-${Q.url}`):a.jsx("img",{ref:Ft,src:Q.url,alt:Q.name,onLoad:xt,onTransitionEnd:Me,style:zt},`${n}-${Q.url}`))]})}function uy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=O.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:x}=e,w=(x==null?void 0:x.display)==="cover",m=(x==null?void 0:x.ratioValue)??"1:1",h=(x==null?void 0:x.reversed)??!1,[f,v]=m.split(":").map(Number),S=`${h?v:f} / ${h?f:v}`,G=c.entryWidth??.2,W=c.columnsCount,U=O.scalingValue(G,n),H=O.scalingValue(c.horizontalGap??0,n),I=U,z=U,$={width:I,...w?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},T=w?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},k=s.useRef(null),[_,g]=s.useState(!1),[D,P]=s.useState([]),[q,ie]=s.useState(0),[L,B]=s.useState(0),[K,ue]=s.useState(null),[le,F]=s.useState({title1:"",title2:"",title3:""}),pe=(()=>{const ge={},ye=k.current?getComputedStyle(k.current).getPropertyValue("--cntrl-article-width").trim():"";return ye&&(ge["--cntrl-article-width"]=ye),ge})(),j=!n||i||o,se=s.useMemo(()=>zf(d),[d]),ne=t??[],ve=ne.length%W||W,ke=ve<W&&ne.length>0,xe=ne.length-ve,b=ke?Math.floor((W-ve)/2)+1:1,M=s.useMemo(()=>Kf(ne),[ne]),E=s.useMemo(()=>ty(ne),[ne]),V=(ge,ye,Z)=>{if(n&&!o&&!i)return;const J=M.findIndex(be=>be.gridIndex===ge);if(J<0)return;const de=M[J];B(J),P(de.items),ie(ye),F(de.entry),ue(Z??null),g(!0)},Ce=s.useCallback(()=>{g(!1),ue(null)},[]),te=s.useCallback(()=>{const ge=M[L];return!ge||!k.current?K:Uf(k.current,ge.gridIndex,w?"cover":"contain")??K},[M,L,K,w]),$e=s.useCallback(ge=>{if(M.length>1){const ye=M.length,Z=(L+ge+ye)%ye,J=M[Z],de=Math.min(q,J.items.length-1);B(Z),P(J.items),ie(de),F(J.entry);return}ie(ye=>(ye+ge+D.length)%D.length)},[M,L,q,D.length]),ae=M.length>1||D.length>1;return s.useEffect(()=>{if(!_||typeof document>"u")return;const ge=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ge}},[_]),s.useEffect(()=>{!n||o||i||g(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:se}}),a.jsx(ny,{mediaList:E}),a.jsx("div",{ref:k,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${W}, ${U})`,rowGap:0,columnGap:H,width:O.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:O.scalingValue(u??0,n)},children:ne.map((ge,ye)=>{const Z=qs(ge.gallery),J=Us(Z),de=J.filter(re=>re.lightboxMedia).map(re=>re.lightboxMedia),be=Math.floor(ye/W)===Math.ceil(ne.length/W)-1,Pe=ke&&ye>=xe?`${b+(ye-xe)}`:void 0,Se=J[0],X=Se!=null&&Se.lightboxMedia?de.findIndex(re=>re.url===Se.lightboxMedia.url):-1,me=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:J.length>0&&a.jsx(ly,{media:Se.displayMedia,gridIndex:ye,className:`${d}-item-${mo(Se.displayMedia)?"video":"image"}`.trim(),style:T,onMediaClick:j&&X>=0?re=>V(ye,X,Nd(re.currentTarget,w?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,be?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:U,...Pe?{gridColumn:Pe}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:z}})}),a.jsx("a",{className:`${d}-item-image-link`,children:me}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:z}})})]})},ye)})}),_&&typeof document<"u"&&(()=>{const ge=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:pe,"data-selection":"none",children:a.jsx(dy,{prefix:d,items:D,index:q,entry:le,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ae,lightboxEntries:M,entryIdx:L,layoutId:r,sourceRect:K,resolveCloseSourceRect:te,onClose:Ce,onPrev:()=>$e(-1),onNext:()=>$e(1)})}),ge)})()]})}const py=`import { CommonComponentProps } from '../props';
7510
7510
  import { scalingValue, useScopedStyles } from '../utils/index';
7511
7511
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
7512
7512
  import { createPortal } from 'react-dom';
@@ -9849,7 +9849,7 @@ export function Hive({
9849
9849
  </>
9850
9850
  );
9851
9851
  }
9852
- `,my="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>'),mi={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 gy(e){const t={};return t[ot(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSettings")]={...mi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSize")]={...mi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ot(e,"lineHeight")]={...mi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ot(e,"letterSpacing")]={...mi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ot(e,"wordSpacing")]={...mi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ot(e,"textAlign")]={...mi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ot(e,"textAppearance")]={...mi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const to=oi.filter(e=>e!=="count"),hy=to.reduce((e,t)=>({...e,...gy(t)}),{}),fy=to.reduce((e,t)=>({...e,[ot(t,"fontFamily")]:"Arial",[ot(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ot(t,"letterSpacing")]:0,[ot(t,"wordSpacing")]:0,[ot(t,"textAlign")]:"left",[ot(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Pa(e){return to.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ot(n,"fontSize")]=i),o!==void 0&&(t[ot(n,"lineHeight")]=o),t},{})}const yy={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(to.map(e=>[Xs[e],Ys(e)]))},xy={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},vy=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...xy,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),by={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{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"}},gallery:{type:"array",label:"Gallery",max:1,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"]}}}}}}}},required:["gallery"]},default:vy},settings:{sizing:"auto auto",properties:{gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:9999,display:{type:"numeric-input"}},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},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"]}},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"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},...hy},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:my,closeIconColor:"#000000",closeIconHoverColor:"#999999",...fy},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...Pa({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...Pa({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...Pa({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})}},displayRules:[{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","gridLayout","verticalGap","align","imageDisplay","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"",items:["imageDisplay","align"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[yy]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},wy={element:uy,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...to.map(e=>({path:`${ot(e,"fontFamily")}`}))]},fontRelations:{...to.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ot(t,"fontFamily")}`}),{})},schema:by,sourceCode:py};function Sy(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)}function Cy({media:e,className:t,style:n}){const i=s.useRef(null);return s.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const r=o.play();r&&r.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Ea(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function $y(e){return String(e??"").trim().length>0}function Dl(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Ol(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Bl(e,t,n,i,o,r,l){const d=D.scalingValue(r,l),c=D.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Ty(e,t,n){const i=D.scalingValue(t,n),o=D.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const zl=10,jl=10,yo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Iy(e,t,n){return Math.max(t,Math.min(n,e))}function Ma(e,t,n){return e+(t-e)*n}function Ry(e,t,n,i){if(!t)return{x:0,y:0};const o=t.offsetWidth,l=t.offsetHeight/2;if(e==="cursor"&&n){const d=t.getBoundingClientRect();return{x:n.clientX-d.left+zl,y:n.clientY-d.top+zl}}switch(e){case"left":return{x:jl+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-jl-i/2,y:l};default:return{x:o/2,y:l}}}function Ly(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const m=n.current,h=i.current;m&&(m.style.transform=`translate3d(${h.x}px, ${h.y}px, 0) translate(-50%, -50%) rotate(${h.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const m=i.current;t?(m.x=Ma(m.x,m.targetX,yo.positionEase),m.y=Ma(m.y,m.targetY,yo.positionEase),m.rotation=Ma(m.rotation,m.targetRotation,yo.rotationEase)):(m.x=m.targetX,m.y=m.targetY,m.rotation=m.targetRotation),r();const h=Math.abs(m.x-m.targetX)<.4&&Math.abs(m.y-m.targetY)<.4,f=Math.abs(m.rotation-m.targetRotation)<.08;!h||!f?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((m,h)=>{const f=i.current;f.targetX=m,f.targetY=h,f.targetRotation=0,f.x=m,f.y=h,f.rotation=0,f.lastX=m,f.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((m,h)=>{if(!e)return;const f=i.current;if(t&&f.hasLastX){const v=m-f.lastX;f.targetRotation=Iy(v*yo.rotationFactor,-20,yo.maxRotation)}else f.targetRotation=0;if(f.lastX=m,f.hasLastX=!0,f.targetX=m,f.targetY=h,t){c();return}f.x=m,f.y=h,f.rotation=f.targetRotation,r()},[e,r,t,c]),x=s.useCallback(m=>{l(),i.current.hasLastX=!1,m==null||m()},[l]),w=s.useCallback(()=>{l(),i.current={x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1},n.current&&(n.current.style.transform="")},[l]);return s.useEffect(()=>(e||w(),l),[e,w,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:x,reset:w}}function Py(e){return`
9852
+ `,my="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>'),mi={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 gy(e){const t={};return t[ot(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSettings")]={...mi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSize")]={...mi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ot(e,"lineHeight")]={...mi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ot(e,"letterSpacing")]={...mi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ot(e,"wordSpacing")]={...mi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ot(e,"textAlign")]={...mi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ot(e,"textAppearance")]={...mi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const to=oi.filter(e=>e!=="count"),hy=to.reduce((e,t)=>({...e,...gy(t)}),{}),fy=to.reduce((e,t)=>({...e,[ot(t,"fontFamily")]:"Arial",[ot(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ot(t,"letterSpacing")]:0,[ot(t,"wordSpacing")]:0,[ot(t,"textAlign")]:"left",[ot(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Pa(e){return to.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ot(n,"fontSize")]=i),o!==void 0&&(t[ot(n,"lineHeight")]=o),t},{})}const yy={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(to.map(e=>[Xs[e],Ys(e)]))},xy={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},vy=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...xy,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),by={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{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"}},gallery:{type:"array",label:"Gallery",max:1,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"]}}}}}}}},required:["gallery"]},default:vy},settings:{sizing:"auto auto",properties:{gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:9999,display:{type:"numeric-input"}},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},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"]}},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"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},...hy},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:my,closeIconColor:"#000000",closeIconHoverColor:"#999999",...fy},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...Pa({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...Pa({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...Pa({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})}},displayRules:[{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","gridLayout","verticalGap","align","imageDisplay","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"",items:["imageDisplay","align"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[yy]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},wy={element:uy,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...to.map(e=>({path:`${ot(e,"fontFamily")}`}))]},fontRelations:{...to.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ot(t,"fontFamily")}`}),{})},schema:by,sourceCode:py};function Sy(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)}function Cy({media:e,className:t,style:n}){const i=s.useRef(null);return s.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const r=o.play();r&&r.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Ea(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function $y(e){return String(e??"").trim().length>0}function Dl(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Ol(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Bl(e,t,n,i,o,r,l){const d=O.scalingValue(r,l),c=O.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Ty(e,t,n){const i=O.scalingValue(t,n),o=O.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const zl=10,jl=10,yo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Iy(e,t,n){return Math.max(t,Math.min(n,e))}function Ma(e,t,n){return e+(t-e)*n}function Ry(e,t,n,i){if(!t)return{x:0,y:0};const o=t.offsetWidth,l=t.offsetHeight/2;if(e==="cursor"&&n){const d=t.getBoundingClientRect();return{x:n.clientX-d.left+zl,y:n.clientY-d.top+zl}}switch(e){case"left":return{x:jl+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-jl-i/2,y:l};default:return{x:o/2,y:l}}}function Ly(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const m=n.current,h=i.current;m&&(m.style.transform=`translate3d(${h.x}px, ${h.y}px, 0) translate(-50%, -50%) rotate(${h.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const m=i.current;t?(m.x=Ma(m.x,m.targetX,yo.positionEase),m.y=Ma(m.y,m.targetY,yo.positionEase),m.rotation=Ma(m.rotation,m.targetRotation,yo.rotationEase)):(m.x=m.targetX,m.y=m.targetY,m.rotation=m.targetRotation),r();const h=Math.abs(m.x-m.targetX)<.4&&Math.abs(m.y-m.targetY)<.4,f=Math.abs(m.rotation-m.targetRotation)<.08;!h||!f?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((m,h)=>{const f=i.current;f.targetX=m,f.targetY=h,f.targetRotation=0,f.x=m,f.y=h,f.rotation=0,f.lastX=m,f.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((m,h)=>{if(!e)return;const f=i.current;if(t&&f.hasLastX){const v=m-f.lastX;f.targetRotation=Iy(v*yo.rotationFactor,-20,yo.maxRotation)}else f.targetRotation=0;if(f.lastX=m,f.hasLastX=!0,f.targetX=m,f.targetY=h,t){c();return}f.x=m,f.y=h,f.rotation=f.targetRotation,r()},[e,r,t,c]),x=s.useCallback(m=>{l(),i.current.hasLastX=!1,m==null||m()},[l]),w=s.useCallback(()=>{l(),i.current={x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1},n.current&&(n.current.style.transform="")},[l]);return s.useEffect(()=>(e||w(),l),[e,w,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:x,reset:w}}function Py(e){return`
9853
9853
  .${e}-wrapper {
9854
9854
  display: grid;
9855
9855
  align-items: start;
@@ -10225,7 +10225,7 @@ a.${e}-list-item {
10225
10225
  overflow-wrap: anywhere;
10226
10226
  word-break: break-word;
10227
10227
  }
10228
- `}const ri=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ks=["AColumn","BColumn","CColumn","DColumn","EColumn"],Hn="cutLabel",Do=[...Ks,Hn],ca=["A","B","C","D","E"];function Od(e){return`${e}ColumnVerticalAlign`}const ls=["Top","Center","Bottom"];function Zs(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return ca.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Ey(e){const t=Zs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function My(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ca.includes(n)?n:null}function Bd(e,t,n){const i=My(e);return i?i===t?!1:Ey(n[Od(i)]):!0}function Oo(e){const t=Zs(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ca.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function ky(e,t,n){if(zd(e,t,n))return Oo(e);const i=Oo(e);return i.kind==="baseline"?{kind:"top"}:i}function Ay(e){const t=Oo(e);return t.kind==="baseline"?{kind:"top"}:t}function zd(e,t,n){return Bd(e,n,t)?Oo(e).kind==="baseline":!1}function Fy(e){const t={};let n=!1;for(const i of ca){const o=Od(i),r=e[o];if(e.type==="b"){const l=String(r??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}Bd(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function _y(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Ny(e){const t=Oo(e).kind;return t==="baseline"?"center":t}function Wy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Vl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Hy(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(),r=o-i;return n.remove(),r}function ka(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Hy(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=r.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+l}function Dy(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const r=o.querySelector(`.${n}`);r&&(r.style.minHeight=`${i}px`,r.style.height=`${i}px`)}),i)}function Oy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const By={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const zy={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function jy(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),{type:"row",items:[Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing")]},Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Vy(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Do.map(e=>[zy[e],jy(e)]))}}function zr(e,t){const n=i=>{const o=Pt(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===Hn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Gl(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 an(qt(n,t))}function Xl(e,t,n,i){const o=zr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Yl(e,t,n,i){const o=zr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:D.scalingValue((r-l)/2,i)}}const xn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],no=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],io=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],oo=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Gy={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Xy=["hover","focus","filled","success","error"],ql=.004,Di=.004,Aa=Di,Js=50,Bo=1440,zo=Js/Bo;function jd(e){const t=typeof e=="number"&&e>0?e:Bo;return Js/t}function Yy(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 Bo}const Vd={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Po(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function qy(e,t=1){const n=t/e;return Object.fromEntries(xn.map(i=>[i,n]))}function Uy(){return Object.fromEntries([...no.map(e=>[e,0]),...io.map(e=>[e,0])])}function Ky(){return Object.fromEntries(oo.map(e=>[e,0]))}function gr(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:Vd[t]]))}function Gd(e,t,n){const i=e-zo,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const r=i/o;return{paddingLeft:t*r,paddingRight:n*r}}function Mr(e,t,n){const i=Qs(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((r,l)=>r+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Zy(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=no[o],l=io[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=Gd(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function Qs(e,t,n){if(e<=0)return[];const i=xn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+zo;if(t>=l)return i;const d=[...o];let c=l-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const p=d[u]-zo;if(p<=0)continue;const x=Math.min(c,p);d[u]-=x,c-=x}return[...d,i[e-1]]}function Jy(e,t,n){if(e<=1)return{};const i=Qs(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=xn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Ul(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...ri]}function Qy(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function ex(e,t,n,i){const o=Math.min(i,e.length,xn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=xn[c],p=no[c],x=io[c],w=oo[c],m=xn[l],h=no[l],f=io[l],v=oo[l],C=n[u],y=n[p],S=n[x],G=n[w];typeof C=="number"&&(r[m]=C),typeof y=="number"&&(r[h]=y),typeof S=="number"&&(r[f]=S),typeof G=="number"&&(r[v]=G)}return r}function Xd(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 tx(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Po(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...qy(n,o),...Uy()};if(r)for(const d of oo)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Ky());return Xd(e,l)?l:e}function nx(e,t,n){const i=Fy(e);i&&(e={...e,...i});const o=jd(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=Po(e),c=Po(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:ri.length,x=S=>{if(u)return S;const G=gr({...t,...S}),W=Po(S),U=Mr(p,W,G),H=Zy(p,U,{...t,...S});return Object.keys(H).length===0?S:{...S,...H}};if(typeof r=="number"&&r!==l)return e;const w=Ul(e),m=Ul(t);if(!Qy(w,m))return x({...e,...ex(w,m,t,p)});if(d<c&&typeof p=="number"&&!u){const S=gr({...t,...e});return x({...e,...Jy(p,d,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,G=Math.max(0,(d-o)/2);return S>G?{...e,textPaddingLR:G}:e}const h=gr({...t,...e}),f=Mr(p,c,gr(t)),C=Mr(p,d,h).some((S,G)=>S<(f[G]??S)),y=xn.some(S=>{const G=e[S],W=t[S];return typeof G=="number"&&typeof W=="number"&&G!==W});return C||y?x(e):e}function ix(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),r=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(zo,i-o-r-zo)}function ox(e,t){return Math.random()*(t-e)+e}function rx(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:Vd[t]]))}function Fa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function ax(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=no[d],u=io[d],p=oo[d];return{key:l,textPrefix:By[l],widthKey:xn[d],width:n[xn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function sx({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=D.useScopedStyles(),u=!!o,{columns:p,type:x,wrapperWidth:w,entriesCount:m,cellMinHeight:h,dividerWidth:f,showVisibility:v,cut:C,showCut:y,cutCellMinHeight:S,cutLabel:G,imageSize:W,imageOnHover:U,imagePosition:H="cursor",imageInterpolation:I="on",entryHoverEffect:z,entryHoverShowOption:$,rowPaddingTop:T,rowPaddingBottom:A,rowPaddingTopB:_,columnsOrder:g,textPaddingLR:B,textColor:P,backgroundColor:Y,dividerColor:ie,textHoverColor:L,backgroundHoverColor:O,dividerHoverColor:K}=e,[ue,le]=s.useState(void 0),[F,pe]=s.useState(null),j=s.useRef(null),se=U==="on"&&(!n||i),ne=H==="cursor",ve=ne&&I==="on",{anchorRef:Me,onShow:xe,onCursorMove:b,exit:M}=Ly(!!(se&&F!==null),ve),E=(C??0)>0,V=x==="b",Se=s.useRef(null),te=s.useRef(null),[$e,re]=s.useState(null),[ge,ye]=s.useState(Bo),Z=jd(ge),Q=Math.max(0,((w??0)-Z)/2),ce=Math.min(B??0,Q),we=Math.max(ce,Di),Pe=((w??0)+Z)/2;s.useLayoutEffect(()=>{if(!n){ye(Bo);return}const Ee=()=>{ye(Yy(Se.current))};Ee();const Xe=Se.current;if(!Xe)return;const lt=new ResizeObserver(Ee);lt.observe(Xe);let ht=Xe;for(;ht&&!ht.style.getPropertyValue("--cntrl-article-width");)ht=ht.parentElement;return ht&&lt.observe(ht),()=>lt.disconnect()},[n,l]),s.useEffect(()=>{le(void 0)},[C,y,t,m]),s.useEffect(()=>{n&&!i&&le(void 0)},[n,i]);const Ce=D.buildColorVars(c,{textColor:P,backgroundColor:Y,dividerColor:ie,textHoverColor:L,backgroundHoverColor:O,dividerHoverColor:K},Gy,Xy),X=r&&r!=="default"?`${c}-state-${r}`:"",ae=`${!n||i?z==="default"?`${c}-entry-hover-default`:z==="blinds"?`${c}-entry-hover-blinds`:z==="reveal"?`${c}-entry-hover-reveal`:"":""} ${X}`.trim(),q=z==="reveal"&&(!n||i),de=(v==null?void 0:v[0])??!1,ke=(v==null?void 0:v[1])??!1,he=s.useRef(e),J=s.useRef(l);s.useEffect(()=>{if(!d||!n){he.current=e,J.current=l;return}if(J.current!==l){he.current=e,J.current=l;return}const Ee=he.current;if(!(Ee!==e))return;if(typeof Ee.columns=="number"&&typeof e.columns=="number"&&Ee.columns!==e.columns){he.current=e;return}const lt=nx(e,Ee,{designWidth:ge});he.current=e,Xd(e,lt)&&d(lt)},[e,d,n,l,ge]);const Ne=s.useMemo(()=>rx(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Fe=s.useMemo(()=>Fa(e,no),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),et=s.useMemo(()=>Fa(e,io),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Je=s.useMemo(()=>Fa(e,oo),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),dt=s.useMemo(()=>Array.isArray(g)&&g.length>0?g:[...ri],[g]),tt=s.useMemo(()=>ax(dt,p,Ne,Fe,et,Je),[dt,p,Ne,Fe,et,Je]),De=Po(e),Ie=s.useMemo(()=>xn.slice(0,p).map(Ee=>Ne[Ee]),[p,Ne]),We=s.useMemo(()=>Qs(p,De,Ne),[p,De,Ne]),je=s.useMemo(()=>Mr(p,De,Ne),[p,De,Ne]),Ue=s.useMemo(()=>tt.map((Ee,Xe)=>Gd(je[Xe]??0,Ee.paddingLeft,Ee.paddingRight)),[tt,je]),k=s.useMemo(()=>{const Ee=m===0?1/0:m;return(t??[]).slice(0,Ee).map((lt,ht)=>({id:ht,cells:Object.fromEntries(ri.map(ft=>[ft,lt[ft]??""])),image:lt.image,link:lt.link}))},[t,m]),ee=E?ue??C:k.length,Te=s.useMemo(()=>E?k.slice(0,ee):k,[k,E,ee]),He=E&&ee<k.length,Be=Te.length>1||He,Ve=[de?`${c}-divider-top`:"",ke||Be?`${c}-divider-bottom`:""].filter(Boolean).join(" "),rt=!n||i,Ze=()=>{if(!rt)return;const Ee=ue??C;if(!y){le(k.length);return}le(Math.min(Ee+y,k.length))},_e=Ee=>D.scalingValue(Ee,n??!1),qe=V?_??0:T??0,Oe=A??0,nt=h??0,at=Math.max(Oe,Aa),st=Bl(0,Te.length,de,ke,He,f??0,n??!1).borderTopWidth,St=V?"rowPaddingTopB":"rowPaddingTop",Yt=tt[0],Zt=tt[tt.length-1],vt=Ue[0],wt=Ue[Ue.length-1],Bt=Yt&&vt?Math.max(vt.paddingLeft,Di):0,At=Zt&&wt?Math.max(wt.paddingRight,Di):0,xt=De,Ft=(Ee,Xe)=>Ry(H,Se.current,ne?Ee:null,Xe),Nt=(Ee,Xe)=>{if(!se)return;const lt=Ee.image;if(!(lt!=null&&lt.url)){M(()=>pe(null));return}const ht=(W==null?void 0:W.min)??80,ft=(W==null?void 0:W.max)??320,Lt=(F==null?void 0:F.rowId)===Ee.id,mt=Lt?F.widthPx:ox(ht,ft),{x:zt,y:kt}=Ft(Xe,mt);if(Lt&&ne){b(zt,kt);return}pe({rowId:Ee.id,url:lt.url,objectFit:"contain",isVideo:Sy(lt),widthPx:mt}),j.current={x:zt,y:kt}},Ut=Ee=>{if(!se||!F||!ne)return;const{x:Xe,y:lt}=Ft(Ee,F.widthPx);b(Xe,lt)},Jt=()=>{F&&M(()=>pe(null))},Tt=Ee=>{q&&Dl(Ee,c),!(!se||!F)&&M(()=>pe(null))},Wt=Ee=>{q&&Ol(Ee,c)};s.useLayoutEffect(()=>{if(!F||!j.current)return;const{x:Ee,y:Xe}=j.current;j.current=null,xe(Ee,Xe)},[F==null?void 0:F.rowId,F==null?void 0:F.url,xe]),s.useLayoutEffect(()=>{if(!u||V){re(null);return}const Ee=te.current,Xe=Ee==null?void 0:Ee.parentElement;if(!Ee||!Xe){re(null);return}const lt=()=>{const ft=Ee.querySelector("[data-list-row]");if(!ft){re(null);return}const Lt=Xe.getBoundingClientRect(),mt=ft.getBoundingClientRect();re(mt.top-Lt.top+mt.height/2)};lt();const ht=new ResizeObserver(lt);return ht.observe(Ee),ht.observe(Xe),()=>ht.disconnect()},[u,V,Te,qe,Oe,nt,t,e,tt,je,ge,f,de,ke,He]);const rn=s.useMemo(()=>!V&&Ks.some(Ee=>{const Xe=Ee.charAt(0),lt=e[`${Ee}VerticalAlign`];return zd(lt,e,Xe)}),[V,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var zt;const Ee=Se.current;if(!Ee)return;const Xe=()=>{Ee.querySelectorAll("[data-list-col]").forEach(kt=>{kt.style.transform="";const Mt=kt.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Vt=kt.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})};if(V||!rn){Xe();return}const lt=()=>{const kt=Array.from(Ee.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Vt=`${c}-baseline-probe`;kt.forEach(Gt=>{Gt.querySelectorAll("[data-list-col]").forEach(Ht=>{Ht.style.transform="";const Dt=Ht.querySelector(`.${Mt}`);Dt&&(Dt.style.minHeight="",Dt.style.height="");const _t=Ht.querySelector(`.${c}-list-col-title`);_t&&(_t.style.transform="")})}),kt.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]"));Dy(Gt,Ht,Mt)}),Ee.offsetHeight,kt.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]")),Dt=Gt.getBoundingClientRect().top,_t=new Map,Ct=Ht.map(Ae=>{const ze=Ae.querySelector(`.${c}-list-col-title`),ct={el:Ae,titleEl:ze,letter:Ae.getAttribute("data-col-letter")??"",kind:Ae.getAttribute("data-valign")??"top",anchor:Ae.getAttribute("data-valign-anchor")};return _t.set(ct.letter,ct),ct}),N=new Map,Re=(Ae,ze)=>{const ct=N.get(Ae.letter);if(ct!==void 0)return ct;const Et=Ae.anchor?_t.get(Ae.anchor):void 0;if(Ae.kind!=="baseline"||!Et||ze.has(Ae.letter)){const nn=ka(Ae,Dt,Mt,Vt);return N.set(Ae.letter,nn),nn}ze.add(Ae.letter);const it=Re(Et,ze);ze.delete(Ae.letter);const yt=ka(Ae,Dt,Mt,Vt),Ot=it-yt;Oy(Ae.titleEl,Ot);const It=ka(Ae,Dt,Mt,Vt);return N.set(Ae.letter,It),It};Ct.forEach(Ae=>Re(Ae,new Set))})};let ht=null;const ft=()=>{ht===null&&(ht=requestAnimationFrame(()=>{ht=null,lt()}))};lt();const Lt=new ResizeObserver(()=>ft());Lt.observe(Ee);let mt=!1;return typeof document<"u"&&((zt=document.fonts)!=null&&zt.ready)&&document.fonts.ready.then(()=>{mt||ft()}),()=>{mt=!0,ht!==null&&(cancelAnimationFrame(ht),ht=null),Lt.disconnect(),Xe()}},[rn,V,e,t,ge,Te,je]);const gt=s.useMemo(()=>Py(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gt}}),a.jsx("div",{style:Ce,children:a.jsxs("div",{ref:Se,className:`${c}-wrapper ${ae}${Ve?` ${Ve}`:""}${V?` ${c}-type-b`:""}`.trim(),style:{width:D.scalingValue(w??0,n)},onMouseMove:se?Ut:void 0,onMouseLeave:se?Jt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Te.map((Ee,Xe)=>{var Lt;const lt=(((Lt=Ee.link)==null?void 0:Lt.length)??0)>0,ht=lt&&(!n||i)?"a":"div",ft=Bl(Xe,Te.length,de,ke,He,f??0,n??!1);return a.jsxs(ht,{ref:Xe===0?mt=>{te.current=mt}:void 0,className:`${c}-list-item${lt||$==="always"?` ${c}-list-item-has-link`:""}${He&&Xe===Te.length-1?` ${c}-list-item-before-cut`:""}`,...lt?{href:Ee.link,target:"_blank"}:{},style:ft,onMouseEnter:mt=>{q&&(lt||$==="always")&&Dl(mt,c),se&&Nt(Ee,mt)},onMouseLeave:mt=>{q&&(lt||$==="always")&&Ol(mt,c)},children:[qe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(qe)}}),a.jsxs("div",{className:`${c}-list-cols-row${V?"":` ${c}-list-cols-row-h`}${u&&Xe===0&&V?` ${c}-list-cols-row-controls`:""}`,...V?{}:{"data-list-row":""},style:V?void 0:{minHeight:_e(nt)},children:[tt.map((mt,zt)=>{const kt=zt===tt.length-1,Mt=Ue[zt],Vt=mt.paddingBottom,Gt=$y(Ee.cells[mt.key]),Ht=V&&Gt&&Vt>0,Dt=V?{minHeight:_e(nt)}:{width:_e(je[zt])},_t=V?{paddingLeft:_e(ce),paddingRight:_e(ce)}:{paddingLeft:_e(Mt.paddingLeft),paddingRight:_e(Mt.paddingRight)},Ct=mt.textPrefix.charAt(0),N=V?Ay(e[`${mt.textPrefix}VerticalAlign`]):ky(e[`${mt.textPrefix}VerticalAlign`],e,Ct),Re=V&&Gt&&u&&Xe===0;return V&&!Gt?null:a.jsxs("div",{className:V?`${c}-list-col-wrap`:void 0,...V?{}:{"data-list-col":"","data-col-letter":Ct,"data-valign":N.kind,...N.kind==="baseline"?{"data-valign-anchor":N.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{..._t,...Dt,...V?{justifyContent:Vl(N.kind)}:{}},"data-test":mt.width,children:a.jsx("span",{className:Xl(e,mt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Gl(zr(e,mt.textPrefix),n),...Yl(e,mt.textPrefix,c,n),...V?{}:_y(N.kind)},children:Ee.cells[mt.key]??null})}),Ht&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Vt)}}),Re&&a.jsx("div",{"data-controls":mt.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:_e(Math.max(Vt,Aa))}})]},mt.key)}),u&&Xe===0&&V&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:_e(we),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:_e(Math.max(we,De-we)),width:_e(we),height:"100%"}})]})]}),!V&&Oe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Oe)}}),u&&Xe===0&&!V&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:_e(at)}})]},Ee.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":St,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":V?"center":"left-y",className:`${c}-control-anchor`,style:{top:st,left:0,width:"100%",height:_e(Math.max(qe,Aa))}})},"row-padding-handles"),u&&!V&&Yt&&Zt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Yt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[0]-((vt==null?void 0:vt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:_e(Bt),height:"100%"}}),a.jsx("div",{"data-controls":Zt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(je[tt.length-1]-((wt==null?void 0:wt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(xt-At),width:_e(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!V&&tt.slice(0,-1).map((Ee,Xe)=>{const lt=tt[Xe+1],ht=We.slice(0,Xe+1).reduce((kt,Mt)=>kt+Mt,0),ft=Ue[Xe],Lt=Ue[Xe+1],mt=Math.max(ft.paddingRight,Di),zt=Math.max(Lt.paddingLeft,Di);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ee.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(je[Xe]-ft.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(ht-mt),width:_e(mt),height:"100%"}}),a.jsx("div",{"data-controls":lt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[Xe+1]-Lt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(ht),width:_e(zt),height:"100%"}})]},`${Ee.paddingRightKey}-padding`)}),u&&!V&&tt.slice(0,-1).map((Ee,Xe)=>{const lt=ix(Xe,We,Ie,De),ft=We.slice(0,Xe+1).reduce((Lt,mt)=>Lt+mt,0)-ql/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ee.widthKey,"data-controls-axis":"x","data-controls-min":String(Js),"data-controls-max-fraction":String(lt),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:_e(ft),width:_e(ql),height:"calc(100%)",pointerEvents:"auto"}})},`${Ee.widthKey}-junction`)})]}),He&&(()=>{const Ee=zr(e,Hn),Xe=Ny(e.cutLabelVerticalAlign),lt=Ee.textTextAlign==="justify"||V;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:_e(S??0),cursor:rt?"pointer":"default",...Ty(ke,f??0,n??!1)},onClick:rt?Ze:void 0,onMouseEnter:q||se?Tt:void 0,onMouseLeave:q?Wt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...V?{paddingLeft:_e(ce),paddingRight:_e(ce)}:{},justifyContent:Wy(Ee.textTextAlign),alignItems:Vl(Xe)},children:a.jsx("span",{className:Xl(e,Hn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Gl(Ee,n),...Yl(e,Hn,c,n),...lt?{width:"100%"}:{}},children:G})})})})(),se&&F&&(()=>{const Ee=`${F.widthPx}px`,Xe={width:Ee,height:"auto",maxHeight:Ee,objectFit:"contain"};return a.jsx("div",{ref:Me,className:`${c}-hover-media-anchor`,children:a.jsx(Cy,{media:F,className:F.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Xe},`${F.rowId}-${F.url}`)})})()]})})]})}const lx=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
10228
+ `}const ri=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ks=["AColumn","BColumn","CColumn","DColumn","EColumn"],Hn="cutLabel",Do=[...Ks,Hn],ca=["A","B","C","D","E"];function Od(e){return`${e}ColumnVerticalAlign`}const ls=["Top","Center","Bottom"];function Zs(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return ca.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Ey(e){const t=Zs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function My(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ca.includes(n)?n:null}function Bd(e,t,n){const i=My(e);return i?i===t?!1:Ey(n[Od(i)]):!0}function Oo(e){const t=Zs(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ca.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function ky(e,t,n){if(zd(e,t,n))return Oo(e);const i=Oo(e);return i.kind==="baseline"?{kind:"top"}:i}function Ay(e){const t=Oo(e);return t.kind==="baseline"?{kind:"top"}:t}function zd(e,t,n){return Bd(e,n,t)?Oo(e).kind==="baseline":!1}function Fy(e){const t={};let n=!1;for(const i of ca){const o=Od(i),r=e[o];if(e.type==="b"){const l=String(r??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}Bd(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function _y(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Ny(e){const t=Oo(e).kind;return t==="baseline"?"center":t}function Wy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Vl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Hy(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(),r=o-i;return n.remove(),r}function ka(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Hy(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=r.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+l}function Dy(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const r=o.querySelector(`.${n}`);r&&(r.style.minHeight=`${i}px`,r.style.height=`${i}px`)}),i)}function Oy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const By={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const zy={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function jy(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),{type:"row",items:[Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing")]},Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Vy(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Do.map(e=>[zy[e],jy(e)]))}}function zr(e,t){const n=i=>{const o=Pt(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===Hn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Gl(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 an(qt(n,t))}function Xl(e,t,n,i){const o=zr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Yl(e,t,n,i){const o=zr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:O.scalingValue((r-l)/2,i)}}const xn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],no=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],io=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],oo=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Gy={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Xy=["hover","focus","filled","success","error"],ql=.004,Di=.004,Aa=Di,Js=50,Bo=1440,zo=Js/Bo;function jd(e){const t=typeof e=="number"&&e>0?e:Bo;return Js/t}function Yy(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 Bo}const Vd={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Po(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function qy(e,t=1){const n=t/e;return Object.fromEntries(xn.map(i=>[i,n]))}function Uy(){return Object.fromEntries([...no.map(e=>[e,0]),...io.map(e=>[e,0])])}function Ky(){return Object.fromEntries(oo.map(e=>[e,0]))}function gr(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:Vd[t]]))}function Gd(e,t,n){const i=e-zo,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const r=i/o;return{paddingLeft:t*r,paddingRight:n*r}}function Mr(e,t,n){const i=Qs(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((r,l)=>r+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Zy(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=no[o],l=io[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=Gd(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function Qs(e,t,n){if(e<=0)return[];const i=xn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+zo;if(t>=l)return i;const d=[...o];let c=l-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const p=d[u]-zo;if(p<=0)continue;const x=Math.min(c,p);d[u]-=x,c-=x}return[...d,i[e-1]]}function Jy(e,t,n){if(e<=1)return{};const i=Qs(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=xn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Ul(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...ri]}function Qy(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function ex(e,t,n,i){const o=Math.min(i,e.length,xn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=xn[c],p=no[c],x=io[c],w=oo[c],m=xn[l],h=no[l],f=io[l],v=oo[l],C=n[u],y=n[p],S=n[x],G=n[w];typeof C=="number"&&(r[m]=C),typeof y=="number"&&(r[h]=y),typeof S=="number"&&(r[f]=S),typeof G=="number"&&(r[v]=G)}return r}function Xd(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 tx(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Po(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...qy(n,o),...Uy()};if(r)for(const d of oo)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Ky());return Xd(e,l)?l:e}function nx(e,t,n){const i=Fy(e);i&&(e={...e,...i});const o=jd(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=Po(e),c=Po(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:ri.length,x=S=>{if(u)return S;const G=gr({...t,...S}),W=Po(S),U=Mr(p,W,G),H=Zy(p,U,{...t,...S});return Object.keys(H).length===0?S:{...S,...H}};if(typeof r=="number"&&r!==l)return e;const w=Ul(e),m=Ul(t);if(!Qy(w,m))return x({...e,...ex(w,m,t,p)});if(d<c&&typeof p=="number"&&!u){const S=gr({...t,...e});return x({...e,...Jy(p,d,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,G=Math.max(0,(d-o)/2);return S>G?{...e,textPaddingLR:G}:e}const h=gr({...t,...e}),f=Mr(p,c,gr(t)),C=Mr(p,d,h).some((S,G)=>S<(f[G]??S)),y=xn.some(S=>{const G=e[S],W=t[S];return typeof G=="number"&&typeof W=="number"&&G!==W});return C||y?x(e):e}function ix(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),r=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(zo,i-o-r-zo)}function ox(e,t){return Math.random()*(t-e)+e}function rx(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:Vd[t]]))}function Fa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function ax(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=no[d],u=io[d],p=oo[d];return{key:l,textPrefix:By[l],widthKey:xn[d],width:n[xn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function sx({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=O.useScopedStyles(),u=!!o,{columns:p,type:x,wrapperWidth:w,entriesCount:m,cellMinHeight:h,dividerWidth:f,showVisibility:v,cut:C,showCut:y,cutCellMinHeight:S,cutLabel:G,imageSize:W,imageOnHover:U,imagePosition:H="cursor",imageInterpolation:I="on",entryHoverEffect:z,entryHoverShowOption:$,rowPaddingTop:T,rowPaddingBottom:k,rowPaddingTopB:_,columnsOrder:g,textPaddingLR:D,textColor:P,backgroundColor:q,dividerColor:ie,textHoverColor:L,backgroundHoverColor:B,dividerHoverColor:K}=e,[ue,le]=s.useState(void 0),[F,pe]=s.useState(null),j=s.useRef(null),se=U==="on"&&(!n||i),ne=H==="cursor",ve=ne&&I==="on",{anchorRef:ke,onShow:xe,onCursorMove:b,exit:M}=Ly(!!(se&&F!==null),ve),E=(C??0)>0,V=x==="b",Ce=s.useRef(null),te=s.useRef(null),[$e,ae]=s.useState(null),[ge,ye]=s.useState(Bo),Z=jd(ge),J=Math.max(0,((w??0)-Z)/2),de=Math.min(D??0,J),be=Math.max(de,Di),Pe=((w??0)+Z)/2;s.useLayoutEffect(()=>{if(!n){ye(Bo);return}const Me=()=>{ye(Yy(Ce.current))};Me();const Xe=Ce.current;if(!Xe)return;const lt=new ResizeObserver(Me);lt.observe(Xe);let ht=Xe;for(;ht&&!ht.style.getPropertyValue("--cntrl-article-width");)ht=ht.parentElement;return ht&&lt.observe(ht),()=>lt.disconnect()},[n,l]),s.useEffect(()=>{le(void 0)},[C,y,t,m]),s.useEffect(()=>{n&&!i&&le(void 0)},[n,i]);const Se=O.buildColorVars(c,{textColor:P,backgroundColor:q,dividerColor:ie,textHoverColor:L,backgroundHoverColor:B,dividerHoverColor:K},Gy,Xy),X=r&&r!=="default"?`${c}-state-${r}`:"",re=`${!n||i?z==="default"?`${c}-entry-hover-default`:z==="blinds"?`${c}-entry-hover-blinds`:z==="reveal"?`${c}-entry-hover-reveal`:"":""} ${X}`.trim(),Y=z==="reveal"&&(!n||i),ce=(v==null?void 0:v[0])??!1,Ee=(v==null?void 0:v[1])??!1,he=s.useRef(e),Q=s.useRef(l);s.useEffect(()=>{if(!d||!n){he.current=e,Q.current=l;return}if(Q.current!==l){he.current=e,Q.current=l;return}const Me=he.current;if(!(Me!==e))return;if(typeof Me.columns=="number"&&typeof e.columns=="number"&&Me.columns!==e.columns){he.current=e;return}const lt=nx(e,Me,{designWidth:ge});he.current=e,Xd(e,lt)&&d(lt)},[e,d,n,l,ge]);const Ne=s.useMemo(()=>rx(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Fe=s.useMemo(()=>Fa(e,no),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),et=s.useMemo(()=>Fa(e,io),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Je=s.useMemo(()=>Fa(e,oo),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),dt=s.useMemo(()=>Array.isArray(g)&&g.length>0?g:[...ri],[g]),tt=s.useMemo(()=>ax(dt,p,Ne,Fe,et,Je),[dt,p,Ne,Fe,et,Je]),De=Po(e),Ie=s.useMemo(()=>xn.slice(0,p).map(Me=>Ne[Me]),[p,Ne]),We=s.useMemo(()=>Qs(p,De,Ne),[p,De,Ne]),je=s.useMemo(()=>Mr(p,De,Ne),[p,De,Ne]),Ue=s.useMemo(()=>tt.map((Me,Xe)=>Gd(je[Xe]??0,Me.paddingLeft,Me.paddingRight)),[tt,je]),A=s.useMemo(()=>{const Me=m===0?1/0:m;return(t??[]).slice(0,Me).map((lt,ht)=>({id:ht,cells:Object.fromEntries(ri.map(ft=>[ft,lt[ft]??""])),image:lt.image,link:lt.link}))},[t,m]),ee=E?ue??C:A.length,Te=s.useMemo(()=>E?A.slice(0,ee):A,[A,E,ee]),He=E&&ee<A.length,Be=Te.length>1||He,Ve=[ce?`${c}-divider-top`:"",Ee||Be?`${c}-divider-bottom`:""].filter(Boolean).join(" "),rt=!n||i,Ze=()=>{if(!rt)return;const Me=ue??C;if(!y){le(A.length);return}le(Math.min(Me+y,A.length))},_e=Me=>O.scalingValue(Me,n??!1),qe=V?_??0:T??0,Oe=k??0,nt=h??0,at=Math.max(Oe,Aa),st=Bl(0,Te.length,ce,Ee,He,f??0,n??!1).borderTopWidth,St=V?"rowPaddingTopB":"rowPaddingTop",Yt=tt[0],Zt=tt[tt.length-1],vt=Ue[0],wt=Ue[Ue.length-1],Bt=Yt&&vt?Math.max(vt.paddingLeft,Di):0,At=Zt&&wt?Math.max(wt.paddingRight,Di):0,xt=De,Ft=(Me,Xe)=>Ry(H,Ce.current,ne?Me:null,Xe),Nt=(Me,Xe)=>{if(!se)return;const lt=Me.image;if(!(lt!=null&&lt.url)){M(()=>pe(null));return}const ht=(W==null?void 0:W.min)??80,ft=(W==null?void 0:W.max)??320,Lt=(F==null?void 0:F.rowId)===Me.id,mt=Lt?F.widthPx:ox(ht,ft),{x:zt,y:kt}=Ft(Xe,mt);if(Lt&&ne){b(zt,kt);return}pe({rowId:Me.id,url:lt.url,objectFit:"contain",isVideo:Sy(lt),widthPx:mt}),j.current={x:zt,y:kt}},Ut=Me=>{if(!se||!F||!ne)return;const{x:Xe,y:lt}=Ft(Me,F.widthPx);b(Xe,lt)},Jt=()=>{F&&M(()=>pe(null))},Tt=Me=>{Y&&Dl(Me,c),!(!se||!F)&&M(()=>pe(null))},Wt=Me=>{Y&&Ol(Me,c)};s.useLayoutEffect(()=>{if(!F||!j.current)return;const{x:Me,y:Xe}=j.current;j.current=null,xe(Me,Xe)},[F==null?void 0:F.rowId,F==null?void 0:F.url,xe]),s.useLayoutEffect(()=>{if(!u||V){ae(null);return}const Me=te.current,Xe=Me==null?void 0:Me.parentElement;if(!Me||!Xe){ae(null);return}const lt=()=>{const ft=Me.querySelector("[data-list-row]");if(!ft){ae(null);return}const Lt=Xe.getBoundingClientRect(),mt=ft.getBoundingClientRect();ae(mt.top-Lt.top+mt.height/2)};lt();const ht=new ResizeObserver(lt);return ht.observe(Me),ht.observe(Xe),()=>ht.disconnect()},[u,V,Te,qe,Oe,nt,t,e,tt,je,ge,f,ce,Ee,He]);const rn=s.useMemo(()=>!V&&Ks.some(Me=>{const Xe=Me.charAt(0),lt=e[`${Me}VerticalAlign`];return zd(lt,e,Xe)}),[V,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var zt;const Me=Ce.current;if(!Me)return;const Xe=()=>{Me.querySelectorAll("[data-list-col]").forEach(kt=>{kt.style.transform="";const Mt=kt.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Vt=kt.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})};if(V||!rn){Xe();return}const lt=()=>{const kt=Array.from(Me.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Vt=`${c}-baseline-probe`;kt.forEach(Gt=>{Gt.querySelectorAll("[data-list-col]").forEach(Ht=>{Ht.style.transform="";const Dt=Ht.querySelector(`.${Mt}`);Dt&&(Dt.style.minHeight="",Dt.style.height="");const _t=Ht.querySelector(`.${c}-list-col-title`);_t&&(_t.style.transform="")})}),kt.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]"));Dy(Gt,Ht,Mt)}),Me.offsetHeight,kt.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]")),Dt=Gt.getBoundingClientRect().top,_t=new Map,Ct=Ht.map(Ae=>{const ze=Ae.querySelector(`.${c}-list-col-title`),ct={el:Ae,titleEl:ze,letter:Ae.getAttribute("data-col-letter")??"",kind:Ae.getAttribute("data-valign")??"top",anchor:Ae.getAttribute("data-valign-anchor")};return _t.set(ct.letter,ct),ct}),N=new Map,Re=(Ae,ze)=>{const ct=N.get(Ae.letter);if(ct!==void 0)return ct;const Et=Ae.anchor?_t.get(Ae.anchor):void 0;if(Ae.kind!=="baseline"||!Et||ze.has(Ae.letter)){const nn=ka(Ae,Dt,Mt,Vt);return N.set(Ae.letter,nn),nn}ze.add(Ae.letter);const it=Re(Et,ze);ze.delete(Ae.letter);const yt=ka(Ae,Dt,Mt,Vt),Ot=it-yt;Oy(Ae.titleEl,Ot);const It=ka(Ae,Dt,Mt,Vt);return N.set(Ae.letter,It),It};Ct.forEach(Ae=>Re(Ae,new Set))})};let ht=null;const ft=()=>{ht===null&&(ht=requestAnimationFrame(()=>{ht=null,lt()}))};lt();const Lt=new ResizeObserver(()=>ft());Lt.observe(Me);let mt=!1;return typeof document<"u"&&((zt=document.fonts)!=null&&zt.ready)&&document.fonts.ready.then(()=>{mt||ft()}),()=>{mt=!0,ht!==null&&(cancelAnimationFrame(ht),ht=null),Lt.disconnect(),Xe()}},[rn,V,e,t,ge,Te,je]);const gt=s.useMemo(()=>Py(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gt}}),a.jsx("div",{style:Se,children:a.jsxs("div",{ref:Ce,className:`${c}-wrapper ${re}${Ve?` ${Ve}`:""}${V?` ${c}-type-b`:""}`.trim(),style:{width:O.scalingValue(w??0,n)},onMouseMove:se?Ut:void 0,onMouseLeave:se?Jt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Te.map((Me,Xe)=>{var Lt;const lt=(((Lt=Me.link)==null?void 0:Lt.length)??0)>0,ht=lt&&(!n||i)?"a":"div",ft=Bl(Xe,Te.length,ce,Ee,He,f??0,n??!1);return a.jsxs(ht,{ref:Xe===0?mt=>{te.current=mt}:void 0,className:`${c}-list-item${lt||$==="always"?` ${c}-list-item-has-link`:""}${He&&Xe===Te.length-1?` ${c}-list-item-before-cut`:""}`,...lt?{href:Me.link,target:"_blank"}:{},style:ft,onMouseEnter:mt=>{Y&&(lt||$==="always")&&Dl(mt,c),se&&Nt(Me,mt)},onMouseLeave:mt=>{Y&&(lt||$==="always")&&Ol(mt,c)},children:[qe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(qe)}}),a.jsxs("div",{className:`${c}-list-cols-row${V?"":` ${c}-list-cols-row-h`}${u&&Xe===0&&V?` ${c}-list-cols-row-controls`:""}`,...V?{}:{"data-list-row":""},style:V?void 0:{minHeight:_e(nt)},children:[tt.map((mt,zt)=>{const kt=zt===tt.length-1,Mt=Ue[zt],Vt=mt.paddingBottom,Gt=$y(Me.cells[mt.key]),Ht=V&&Gt&&Vt>0,Dt=V?{minHeight:_e(nt)}:{width:_e(je[zt])},_t=V?{paddingLeft:_e(de),paddingRight:_e(de)}:{paddingLeft:_e(Mt.paddingLeft),paddingRight:_e(Mt.paddingRight)},Ct=mt.textPrefix.charAt(0),N=V?Ay(e[`${mt.textPrefix}VerticalAlign`]):ky(e[`${mt.textPrefix}VerticalAlign`],e,Ct),Re=V&&Gt&&u&&Xe===0;return V&&!Gt?null:a.jsxs("div",{className:V?`${c}-list-col-wrap`:void 0,...V?{}:{"data-list-col":"","data-col-letter":Ct,"data-valign":N.kind,...N.kind==="baseline"?{"data-valign-anchor":N.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{..._t,...Dt,...V?{justifyContent:Vl(N.kind)}:{}},"data-test":mt.width,children:a.jsx("span",{className:Xl(e,mt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Gl(zr(e,mt.textPrefix),n),...Yl(e,mt.textPrefix,c,n),...V?{}:_y(N.kind)},children:Me.cells[mt.key]??null})}),Ht&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Vt)}}),Re&&a.jsx("div",{"data-controls":mt.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:_e(Math.max(Vt,Aa))}})]},mt.key)}),u&&Xe===0&&V&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:_e(be),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:_e(Math.max(be,De-be)),width:_e(be),height:"100%"}})]})]}),!V&&Oe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Oe)}}),u&&Xe===0&&!V&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:_e(at)}})]},Me.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":St,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":V?"center":"left-y",className:`${c}-control-anchor`,style:{top:st,left:0,width:"100%",height:_e(Math.max(qe,Aa))}})},"row-padding-handles"),u&&!V&&Yt&&Zt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Yt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[0]-((vt==null?void 0:vt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:_e(Bt),height:"100%"}}),a.jsx("div",{"data-controls":Zt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(je[tt.length-1]-((wt==null?void 0:wt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(xt-At),width:_e(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!V&&tt.slice(0,-1).map((Me,Xe)=>{const lt=tt[Xe+1],ht=We.slice(0,Xe+1).reduce((kt,Mt)=>kt+Mt,0),ft=Ue[Xe],Lt=Ue[Xe+1],mt=Math.max(ft.paddingRight,Di),zt=Math.max(Lt.paddingLeft,Di);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Me.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(je[Xe]-ft.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(ht-mt),width:_e(mt),height:"100%"}}),a.jsx("div",{"data-controls":lt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[Xe+1]-Lt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":$e??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(ht),width:_e(zt),height:"100%"}})]},`${Me.paddingRightKey}-padding`)}),u&&!V&&tt.slice(0,-1).map((Me,Xe)=>{const lt=ix(Xe,We,Ie,De),ft=We.slice(0,Xe+1).reduce((Lt,mt)=>Lt+mt,0)-ql/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Me.widthKey,"data-controls-axis":"x","data-controls-min":String(Js),"data-controls-max-fraction":String(lt),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:_e(ft),width:_e(ql),height:"calc(100%)",pointerEvents:"auto"}})},`${Me.widthKey}-junction`)})]}),He&&(()=>{const Me=zr(e,Hn),Xe=Ny(e.cutLabelVerticalAlign),lt=Me.textTextAlign==="justify"||V;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:_e(S??0),cursor:rt?"pointer":"default",...Ty(Ee,f??0,n??!1)},onClick:rt?Ze:void 0,onMouseEnter:Y||se?Tt:void 0,onMouseLeave:Y?Wt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...V?{paddingLeft:_e(de),paddingRight:_e(de)}:{},justifyContent:Wy(Me.textTextAlign),alignItems:Vl(Xe)},children:a.jsx("span",{className:Xl(e,Hn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Gl(Me,n),...Yl(e,Hn,c,n),...lt?{width:"100%"}:{}},children:G})})})})(),se&&F&&(()=>{const Me=`${F.widthPx}px`,Xe={width:Me,height:"auto",maxHeight:Me,objectFit:"contain"};return a.jsx("div",{ref:ke,className:`${c}-hover-media-anchor`,children:a.jsx(Cy,{media:F,className:F.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Xe},`${F.rowId}-${F.url}`)})})()]})})]})}const lx=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
10229
10229
  import { CommonComponentProps } from '../props';
10230
10230
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
10231
10231
  import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
@@ -13313,7 +13313,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
13313
13313
  </>
13314
13314
  );
13315
13315
  }
13316
- `,go=["A","B","C","D","E"],Kl=[...ls,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],gi={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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function cx(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function hr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function dx(){return Object.fromEntries(go.map((e,t)=>{const n=ri[t],i=`${e} column`;return[n,cx(i)]}))}function ux(){const e={};for(const t of go)e[`${t}ColumnWidth`]=hr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=hr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=hr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=hr(`${t} column padding bottom`);return e}function Zl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...ri]};for(const r of go)i[`${r}ColumnWidth`]=r==="A"?.0798:.32,i[`${r}ColumnPaddingLeft`]=0,i[`${r}ColumnPaddingRight`]=0,i[`${r}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function px(e){const t={};if(e===Hn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ls]},enum:[...ls]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Kl],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Kl]}}return t[Pt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Pt(e,"textFontSettings")]={...gi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Pt(e,"textFontSize")]={...gi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Pt(e,"textLineHeight")]={...gi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Pt(e,"textLetterSpacing")]={...gi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Pt(e,"textWordSpacing")]={...gi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Pt(e,"textTextAlign")]={...gi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Pt(e,"textTextAppearance")]={...gi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const mx=Do.reduce((e,t)=>({...e,...px(t)}),{});function gx(e){return{verticalAlign:e===Hn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Hn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function hx(e,t={}){var n;return{...gx(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Jl=new Set(["textFontFamily","textFontSettings"]);function fx(e,t,n){const i=r=>n===void 0?!0:n==="common"?Jl.has(r):!Jl.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Zs(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Pt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Pt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Pt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Pt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Pt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Pt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Pt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Pt(e,"textTextAppearance")]=t.textTextAppearance),o}function kr(e={},t){return Do.reduce((n,i)=>({...n,...fx(i,hx(i,e),t)}),{})}const yx=kr(),xx=Vy();function Yd(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing"),Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function vx(){const e=[];return Ks.forEach((t,n)=>{const i=ri[n],o=Yd(t);for(let r=1;r<ri.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const bx=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Yd(Hn);const wx=[...go.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],hi=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],Sx=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:hi[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:hi[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:hi[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:hi[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:hi[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:hi[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:hi[6],link:""}],Cx=[...go.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],$x={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...dx(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:Sx},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Amount",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imagePosition:{type:"string",scope:"layout",title:"Image Position",display:{type:"toggle-cycle",enum:["left","center","right","cursor"]}},imageInterpolation:{type:"boolean",scope:"common",title:"Interpolation",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...ux(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},...mx,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",imagePosition:"cursor",imageInterpolation:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...yx,...kr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Zl({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...kr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Zl({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...kr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...vx(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...wx.map(e=>({if:{name:"type",value:"b"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...go.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),{if:{name:"imagePosition",value:"cursor",isNotEqual:!0},then:{name:"properties.imageInterpolation.display.enabled",value:!1}}],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imagePosition","imageInterpolation","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Cx]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"Entries",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["imagePosition","imageInterpolation"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",xx]}],paletteBookmark:{items:[...bx],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Tx={element:sx,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>tx(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Do.map(e=>({path:`${Pt(e,"textFontFamily")}`}))]},fontRelations:{...Do.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Pt(t,"textFontFamily")}`}),{})},schema:$x,sourceCode:lx},Ql=300,Vn=.004,Ix={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},Rx=["hover","focus","filled","success","error"];function Lx(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ec(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function tc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:D.scalingValue((o-t)/2,i)}}function Px(e){return`
13316
+ `,go=["A","B","C","D","E"],Kl=[...ls,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],gi={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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function cx(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function hr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function dx(){return Object.fromEntries(go.map((e,t)=>{const n=ri[t],i=`${e} column`;return[n,cx(i)]}))}function ux(){const e={};for(const t of go)e[`${t}ColumnWidth`]=hr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=hr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=hr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=hr(`${t} column padding bottom`);return e}function Zl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...ri]};for(const r of go)i[`${r}ColumnWidth`]=r==="A"?.0798:.32,i[`${r}ColumnPaddingLeft`]=0,i[`${r}ColumnPaddingRight`]=0,i[`${r}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function px(e){const t={};if(e===Hn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ls]},enum:[...ls]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Kl],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Kl]}}return t[Pt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Pt(e,"textFontSettings")]={...gi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Pt(e,"textFontSize")]={...gi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Pt(e,"textLineHeight")]={...gi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Pt(e,"textLetterSpacing")]={...gi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Pt(e,"textWordSpacing")]={...gi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Pt(e,"textTextAlign")]={...gi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Pt(e,"textTextAppearance")]={...gi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const mx=Do.reduce((e,t)=>({...e,...px(t)}),{});function gx(e){return{verticalAlign:e===Hn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Hn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function hx(e,t={}){var n;return{...gx(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Jl=new Set(["textFontFamily","textFontSettings"]);function fx(e,t,n){const i=r=>n===void 0?!0:n==="common"?Jl.has(r):!Jl.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Zs(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Pt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Pt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Pt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Pt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Pt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Pt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Pt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Pt(e,"textTextAppearance")]=t.textTextAppearance),o}function kr(e={},t){return Do.reduce((n,i)=>({...n,...fx(i,hx(i,e),t)}),{})}const yx=kr(),xx=Vy();function Yd(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing"),Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function vx(){const e=[];return Ks.forEach((t,n)=>{const i=ri[n],o=Yd(t);for(let r=1;r<ri.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const bx=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Yd(Hn);const wx=[...go.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],hi=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],Sx=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:hi[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:hi[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:hi[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:hi[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:hi[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:hi[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:hi[6],link:""}],Cx=[...go.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],$x={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...dx(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:Sx},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Amount",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imagePosition:{type:"string",scope:"layout",title:"Image Position",display:{type:"toggle-cycle",enum:["left","center","right","cursor"]}},imageInterpolation:{type:"boolean",scope:"common",title:"Interpolation",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...ux(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},...mx,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",imagePosition:"cursor",imageInterpolation:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...yx,...kr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Zl({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...kr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Zl({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...kr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...vx(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...wx.map(e=>({if:{name:"type",value:"b"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...go.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),{if:{name:"imagePosition",value:"cursor",isNotEqual:!0},then:{name:"properties.imageInterpolation.display.enabled",value:!1}}],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imagePosition","imageInterpolation","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Cx]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"Entries",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["imagePosition","imageInterpolation"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",xx]}],paletteBookmark:{items:[...bx],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Tx={element:sx,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>tx(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Do.map(e=>({path:`${Pt(e,"textFontFamily")}`}))]},fontRelations:{...Do.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Pt(t,"textFontFamily")}`}),{})},schema:$x,sourceCode:lx},Ql=300,Vn=.004,Ix={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},Rx=["hover","focus","filled","success","error"];function Lx(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ec(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function tc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:O.scalingValue((o-t)/2,i)}}function Px(e){return`
13317
13317
  .${e}-wrapper {
13318
13318
  box-sizing: border-box;
13319
13319
  display: flex;
@@ -13478,7 +13478,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
13478
13478
  pointer-events: none;
13479
13479
  z-index: 2;
13480
13480
  }
13481
- `}function nc(e,t,n,i,o,r,l,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:r??0,textAppearance:l,color:d??"#000000"}}function Ex({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=D.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:x="solid",entryHoverEffect:w="default",autoclose:m="off",icon:h,iconMaxWidth:f=.00833,iconPaddingRight:v=0,iconAnimation:C="rotate 45",questionColor:y="#000000",answerColor:S="#000000",dividerColor:G="#0000001F",iconColor:W="#000000",questionHoverColor:U="#666666",iconHoverColor:H="#666666",iconActiveColor:I="#000000",dividerHoverColor:z="#000000",questionFontFamily:$,questionFontSettings:T,questionFontSize:A,questionLineHeight:_,questionLetterSpacing:g,questionWordSpacing:B,questionTextAppearance:P,answerFontFamily:Y,answerFontSettings:ie,answerFontSize:L,answerLineHeight:O,answerLetterSpacing:K,answerWordSpacing:ue,answerTextAppearance:le,questionPaddingLeft:F=0,questionPaddingTop:pe=0,questionPaddingBottom:j=0,answerPaddingLeft:se=0,answerPaddingRight:ne=0,answerPaddingTop:ve=0,answerPaddingBottom:Me=0}=e,xe=t??[],[b,M]=s.useState(()=>new Set),E=!n||i;s.useEffect(()=>{M(new Set)},[m]),s.useEffect(()=>{n&&!o&&!i&&M(new Set)},[n,o,i]);const V=Ue=>D.scalingValue(Ue,n??!1),Se=Math.max(F,Vn),te=Math.max(pe,Vn),$e=Math.max(j,Vn),re=Math.max(se,Vn),ge=Math.max(ne,Vn),ye=Math.max(ve,Vn),Z=Math.max(Me,Vn),Q=Math.max(0,(c??1)-v-f),ce=Math.max(0,(c??1)-ne),we=Math.max(0,(c??1)-se),Pe=Math.max(v,Vn),Ce=Math.max(0,(c??1)-F-f),X=s.useMemo(()=>b.size===0?0:Math.min(...b),[b]),me=s.useCallback(Ue=>b.has(Ue),[b]),ae=E&&w==="default"?`${l}-entry-hover-default`:"",q=h??"",de=q!=="",ke=C.replace(/^rotate /,""),he=`${l}-icon-anim-${ke}`,J=an(qt(nc($,T,A,_,g,B,P,y),n)),Ne=an(qt(nc(Y,ie,L,O,K,ue,le,S),n)),Fe=ec(A,_,`${l}-question`,`${l}-text-tight-leading`),et=ec(L,O,`${l}-answer-text`,`${l}-text-tight-leading`),Je=tc(A,_,l,n),dt=tc(L,O,l,n),tt=D.buildColorVars(l,{questionColor:y,answerColor:S,dividerColor:G,iconColor:W,questionHoverColor:U,iconHoverColor:H,iconActiveColor:I,dividerHoverColor:z},Ix,Rx),De=r&&r!=="default"?`${l}-state-${r}`:"",Ie=s.useCallback(Ue=>{E&&M(k=>{if(k.has(Ue)){const Te=new Set(k);return Te.delete(Ue),Te}if(m==="on")return new Set([Ue]);const ee=new Set(k);return ee.add(Ue),ee})},[E,m]),We=s.useMemo(()=>Px(l),[l]),je={[`--${l}-divider-width`]:D.scalingValue(p,n??!1),[`--${l}-divider-style`]:x,[`--${l}-icon-max-width`]:D.scalingValue(f,n??!1),...u>0?{[`--${l}-question-min-height`]:D.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:We}}),a.jsx("div",{style:tt,children:a.jsx("div",{className:pt(`${l}-wrapper`,n&&!i&&`${l}-editor`,ae,De),style:{width:D.scalingValue(c,n??!1),maxWidth:"100%",...je},children:xe.map((Ue,k)=>{var rt;const ee=me(k),Te=((rt=Ue.question)==null?void 0:rt.trim())??"",He=Ue.answer,Be=((He==null?void 0:He.length)??0)>0,Ve=d&&k===X;return a.jsxs("div",{className:pt(`${l}-item`,ee&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[Ve&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"questionPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:V(te)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Q),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:V(Se),height:"100%"}}),a.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:V(Pe),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":ee,style:{...J,...Je,paddingLeft:V(F),paddingRight:V(v)},onClick:()=>Ie(k),children:[pe>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:V(pe)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:Fe,children:Te}),Be&&(de?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${he}`,"aria-hidden":"true",children:a.jsx(sn,{url:q,fill:`var(--${l}-icon-color)`,hoverFill:`var(--${l}-icon-hover-color, var(--${l}-icon-color))`,className:`${l}-icon-image`})}):a.jsx("span",{className:`${l}-icon ${l}-icon-default ${he}`,"aria-hidden":"true"}))]}),j>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:V(j)},"aria-hidden":"true"})]}),Ve&&a.jsx("div",{"data-controls":"questionPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:V($e)}})]}),Be&&He&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!ee,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[Ve&&ee&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"answerPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:V(ye)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:V(re),height:"100%"}}),a.jsx("div",{"data-controls":"answerPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(we),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:V(ge),height:"100%"}})]}),ve>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:V(ve)}}),a.jsx("div",{className:`${l}-answer`,style:{...Ne,...dt,paddingLeft:V(se),paddingRight:V(ne)},children:a.jsx("div",{className:et,children:a.jsx(Ri,{content:He})})}),Me>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:V(Me)}}),Ve&&ee&&a.jsx("div",{"data-controls":"answerPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:V(Z)}})]})})})]},k)})})})]})}const Mx=`import { useCallback, useEffect, useMemo, useState } from 'react';
13481
+ `}function nc(e,t,n,i,o,r,l,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:r??0,textAppearance:l,color:d??"#000000"}}function Ex({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=O.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:x="solid",entryHoverEffect:w="default",autoclose:m="off",icon:h,iconMaxWidth:f=.00833,iconPaddingRight:v=0,iconAnimation:C="rotate 45",questionColor:y="#000000",answerColor:S="#000000",dividerColor:G="#0000001F",iconColor:W="#000000",questionHoverColor:U="#666666",iconHoverColor:H="#666666",iconActiveColor:I="#000000",dividerHoverColor:z="#000000",questionFontFamily:$,questionFontSettings:T,questionFontSize:k,questionLineHeight:_,questionLetterSpacing:g,questionWordSpacing:D,questionTextAppearance:P,answerFontFamily:q,answerFontSettings:ie,answerFontSize:L,answerLineHeight:B,answerLetterSpacing:K,answerWordSpacing:ue,answerTextAppearance:le,questionPaddingLeft:F=0,questionPaddingTop:pe=0,questionPaddingBottom:j=0,answerPaddingLeft:se=0,answerPaddingRight:ne=0,answerPaddingTop:ve=0,answerPaddingBottom:ke=0}=e,xe=t??[],[b,M]=s.useState(()=>new Set),E=!n||i;s.useEffect(()=>{M(new Set)},[m]),s.useEffect(()=>{n&&!o&&!i&&M(new Set)},[n,o,i]);const V=Ue=>O.scalingValue(Ue,n??!1),Ce=Math.max(F,Vn),te=Math.max(pe,Vn),$e=Math.max(j,Vn),ae=Math.max(se,Vn),ge=Math.max(ne,Vn),ye=Math.max(ve,Vn),Z=Math.max(ke,Vn),J=Math.max(0,(c??1)-v-f),de=Math.max(0,(c??1)-ne),be=Math.max(0,(c??1)-se),Pe=Math.max(v,Vn),Se=Math.max(0,(c??1)-F-f),X=s.useMemo(()=>b.size===0?0:Math.min(...b),[b]),me=s.useCallback(Ue=>b.has(Ue),[b]),re=E&&w==="default"?`${l}-entry-hover-default`:"",Y=h??"",ce=Y!=="",Ee=C.replace(/^rotate /,""),he=`${l}-icon-anim-${Ee}`,Q=an(qt(nc($,T,k,_,g,D,P,y),n)),Ne=an(qt(nc(q,ie,L,B,K,ue,le,S),n)),Fe=ec(k,_,`${l}-question`,`${l}-text-tight-leading`),et=ec(L,B,`${l}-answer-text`,`${l}-text-tight-leading`),Je=tc(k,_,l,n),dt=tc(L,B,l,n),tt=O.buildColorVars(l,{questionColor:y,answerColor:S,dividerColor:G,iconColor:W,questionHoverColor:U,iconHoverColor:H,iconActiveColor:I,dividerHoverColor:z},Ix,Rx),De=r&&r!=="default"?`${l}-state-${r}`:"",Ie=s.useCallback(Ue=>{E&&M(A=>{if(A.has(Ue)){const Te=new Set(A);return Te.delete(Ue),Te}if(m==="on")return new Set([Ue]);const ee=new Set(A);return ee.add(Ue),ee})},[E,m]),We=s.useMemo(()=>Px(l),[l]),je={[`--${l}-divider-width`]:O.scalingValue(p,n??!1),[`--${l}-divider-style`]:x,[`--${l}-icon-max-width`]:O.scalingValue(f,n??!1),...u>0?{[`--${l}-question-min-height`]:O.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:We}}),a.jsx("div",{style:tt,children:a.jsx("div",{className:pt(`${l}-wrapper`,n&&!i&&`${l}-editor`,re,De),style:{width:O.scalingValue(c,n??!1),maxWidth:"100%",...je},children:xe.map((Ue,A)=>{var rt;const ee=me(A),Te=((rt=Ue.question)==null?void 0:rt.trim())??"",He=Ue.answer,Be=((He==null?void 0:He.length)??0)>0,Ve=d&&A===X;return a.jsxs("div",{className:pt(`${l}-item`,ee&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[Ve&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"questionPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:V(te)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(J),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:V(Ce),height:"100%"}}),a.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Se),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:V(Pe),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":ee,style:{...Q,...Je,paddingLeft:V(F),paddingRight:V(v)},onClick:()=>Ie(A),children:[pe>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:V(pe)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:Fe,children:Te}),Be&&(ce?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${he}`,"aria-hidden":"true",children:a.jsx(sn,{url:Y,fill:`var(--${l}-icon-color)`,hoverFill:`var(--${l}-icon-hover-color, var(--${l}-icon-color))`,className:`${l}-icon-image`})}):a.jsx("span",{className:`${l}-icon ${l}-icon-default ${he}`,"aria-hidden":"true"}))]}),j>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:V(j)},"aria-hidden":"true"})]}),Ve&&a.jsx("div",{"data-controls":"questionPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:V($e)}})]}),Be&&He&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!ee,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[Ve&&ee&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"answerPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:V(ye)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(de),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:V(ae),height:"100%"}}),a.jsx("div",{"data-controls":"answerPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(be),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:V(ge),height:"100%"}})]}),ve>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:V(ve)}}),a.jsx("div",{className:`${l}-answer`,style:{...Ne,...dt,paddingLeft:V(se),paddingRight:V(ne)},children:a.jsx("div",{className:et,children:a.jsx(Ri,{content:He})})}),ke>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:V(ke)}}),Ve&&ee&&a.jsx("div",{"data-controls":"answerPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:V(Z)}})]})})})]},A)})})})]})}const Mx=`import { useCallback, useEffect, useMemo, useState } from 'react';
13482
13482
  import cn from 'classnames';
13483
13483
  import { CommonComponentProps } from '../props';
13484
13484
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
@@ -14226,7 +14226,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
14226
14226
  </>
14227
14227
  );
14228
14228
  }
14229
- `;function Gn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ic={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},kx=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Ax={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:Gn("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:{...ic.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:{...ic.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:Gn("Question Padding Left"),questionPaddingTop:Gn("Question Padding Top"),questionPaddingBottom:Gn("Question Padding Bottom"),answerPaddingLeft:Gn("Answer Padding Left"),answerPaddingRight:Gn("Answer Padding Right"),answerPaddingTop:Gn("Answer Padding Top"),answerPaddingBottom:Gn("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01M0GB8Z9EQFMGYA20F2J0ACA8.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:[...kx],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Fx={element:Ex,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:Ax,sourceCode:Mx},Dn=e=>e.display==="cover",da=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},oc=100,_x=.2,rc=8,qd=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,d]=s.useState(!1),c=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?oc:Math.max(oc,window.innerHeight*_x),[]),x=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),w=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),m=s.useCallback($=>{const T=typeof window<"u"?window.innerHeight:800,A=Math.max(.88,1-$/T*.12);return`translateY(${$}px) scale(${A})`},[]),h=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),v=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;d(!0),r($),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),C=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(c.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),y=s.useCallback($=>{const T=c.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const A=$.clientX-T.startX,_=$.clientY-T.startY;if(T.isLocked===null){if(Math.abs(A)<rc&&Math.abs(_)<rc)return;if(_>0&&_>Math.abs(A))T.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{T.isLocked=!1,h();return}}if(!T.isLocked)return;$.preventDefault();const g=Math.max(0,_);u.current=g,r(g)},[e,h]),S=s.useCallback($=>{const T=c.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const A=T.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!A){h();return}$.clientY-T.startY>=p?v():f()},[p,v,e,h,f]),G=s.useCallback($=>{S($)},[S]),W=s.useCallback($=>{S($)},[S]),U=o>0,H=l?`transform ${n}ms ease`:"none",I=l?`opacity ${n}ms ease`:"none",z=o>0||l;return{isSwipeDragging:U,backdropStyle:{opacity:x(o),transition:I},mediaAreaStyle:{transform:m(o),transition:H,touchAction:U?"none":void 0,willChange:U?"transform":void 0},overlayContentStyle:z?{opacity:w(o),transition:I}:void 0,swipeHandlers:e?{onPointerDown:C,onPointerMove:y,onPointerUp:G,onPointerCancel:W}:{},dismissAreaStyle:e?{touchAction:U?"none":"pan-x"}:void 0}},Nx="[data-lightbox-scrollable]",Ud=()=>{s.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,r=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 l=d=>{const c=d.target;c instanceof Element&&c.closest(Nx)||d.preventDefault()};return document.addEventListener("touchmove",l,{passive:!1}),()=>{document.removeEventListener("touchmove",l),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=r,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},Wx=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Hx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Dx=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Ox=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,f)=>{Hx(t),e.scrollLeft=h,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,x=0;const w=()=>{t.removeEventListener("transitionend",m),clearTimeout(x)},m=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,w(),u(n,!0))};return t.addEventListener("transitionend",m),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(()=>{p||(p=!0,w(),u(n,!0))},i+64),()=>{p||(p=!0,w(),u(l-Dx(t),!1))}},Eo=300,Bx=900,zx=1500,jx="cubic-bezier(0.16, 1, 0.3, 1)",Vx=3e3,Gx=2,Xx=16,Yx=.05,qx=1,fr=.3,Ux=50,Kx=20,Ai=.004,ro=["title1","title2","title3"],Zx={title1:"1",title2:"2",title3:"3"},Jx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Qx={title1:.02,title2:.02,title3:.02},yr=e=>`max(${e}, ${Kx}px)`,ev=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]}},tv=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=ev(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},jt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,nv=e=>[jt(e,"fontFamily"),jt(e,"fontSettings"),{type:"row",items:[jt(e,"fontSize"),jt(e,"lineHeight"),jt(e,"letterSpacing"),jt(e,"wordSpacing")]},jt(e,"textAlign"),jt(e,"textAppearance")],iv=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ro.map(e=>[Zx[e],nv(e)]))}),el=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Kd=(e,t)=>el(e,t),xr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ac=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:el(e.length,n),effective:Kd(e.length,n)}},ov=(e,t,n,i,o,r,l)=>{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:r,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},_a=(e,t)=>{const n=i=>{const o=jt(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[Jx[t]]}},rv=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),Na=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Qx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return qt(i,n)},av=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:x,closeIcon:w,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:f,thumbnailTrigger:v,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailActive:S,thumbnailActiveColor:G,title1Width:W,title2Width:U,title3Width:H,title1MarginLeft:I=0,title2MarginLeft:z=0,title3MarginLeft:$=0,titleRowMarginBottom:T=0,titleHeaderLayout:A="desktop",contentMarginTop:_,iconMarginLeft:g}=n,B=R=>D.scalingValue(R,i??!1),P=c??n.thumnailSize??.03,Y=B(P),ie=B(u),L=B(p??.02),O=B(x??0),K=B(_??0),ue=yr(K),le=B(g??0),[F,pe]=s.useState(0),j=s.useRef(F);j.current=F;const se=t[F],{title1:ne,title2:ve,title3:Me}=tv(se),xe=Na("title1",_a(n,"title1"),i),b=Na("title2",_a(n,"title2"),i),M=Na("title3",_a(n,"title3"),i),E=A==="mobile",V=!o&&(!i||r),Se=V,te=V,$e=V,re=Dn(y),ge=re?{"--image-aspect-ratio":da(y)}:void 0,ye=!!(ne||ve||Me),Z=s.useMemo(()=>ov(e,ne,ve,Me,xe,b,M),[e,F,ne,ve,Me,xe,b,M]),Q=s.useMemo(()=>({title1Width:W,title2Width:U,title3Width:H}),[W,U,H]),ce=s.useMemo(()=>Z.map(R=>Q[R.widthKey]),[Z,Q]),we=s.useMemo(()=>el(Z.length,ce),[Z.length,ce]),Pe=s.useMemo(()=>Kd(Z.length,ce),[Z.length,ce]),Ce=s.useMemo(()=>Z.filter(R=>R.prefix==="title1"),[Z]),X=s.useMemo(()=>Z.filter(R=>R.prefix==="title2"||R.prefix==="title3"),[Z]),me=s.useMemo(()=>ac(Ce,Q),[Ce,Q]),ae=s.useMemo(()=>ac(X,Q),[X,Q]),q=s.useCallback((R,oe)=>{const fe=Z.indexOf(R);if(!E||oe==="single-row")return{effectiveWidth:Pe[fe]??0,resolvedWidth:we[fe]??0,maxWidth:xr(fe,we)};if(oe==="two-row-top"){const Ge=Ce.indexOf(R);return{effectiveWidth:me.effective[Ge]??0,resolvedWidth:me.resolved[Ge]??0,maxWidth:xr(Ge,me.resolved)}}const Le=X.indexOf(R);return{effectiveWidth:ae.effective[Le]??0,resolvedWidth:ae.resolved[Le]??0,maxWidth:xr(Le,ae.resolved)}},[X,ae,Pe,we,Z,Ce,me,E]),de=s.useCallback(R=>D.scalingValue(R,i??!1),[i]),ke=de(T??0),he=s.useMemo(()=>({title1MarginLeft:I,title2MarginLeft:z,title3MarginLeft:$}),[I,z,$]),J=s.useCallback(R=>Z.slice(0,R+1).reduce((oe,fe,Le)=>oe+(fe!=null&&fe.marginLeftKey?he[fe.marginLeftKey]??0:0)+(we[Le]??0),0)+(E?0:I??0),[Z,he,we,E,I]),Ne=s.useCallback(()=>E?0:I??0,[E,I]),Fe=s.useCallback(R=>X.slice(0,R).reduce((oe,fe,Le)=>oe+(fe.marginLeftKey?he[fe.marginLeftKey]??0:0)+(ae.resolved[Le]??0),0),[X,ae.resolved,he]),et=s.useCallback(R=>{const oe=X[R];return Fe(R)+(oe.marginLeftKey?he[oe.marginLeftKey]??0:0)+(ae.resolved[R]??0)},[X,ae.resolved,Fe,he]),Je=(R,oe)=>{const fe=R.marginLeftKey?he[R.marginLeftKey]??0:0,{effectiveWidth:Le,resolvedWidth:Ge,maxWidth:Qe}=q(R,oe),bt=o&&oe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":R.prefix,style:{...oe==="single-row"?{gridArea:R.prefix}:{},width:de(Le),...fe>0?{marginLeft:de(fe)}:{}},children:[a.jsx("p",{className:R.className,style:R.style,children:R.text}),bt&&R.marginLeftKey&&a.jsx("div",{"data-controls":R.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ge),style:{position:"absolute",top:0,left:de(-fe),width:`max(${de(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Qe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:de(-Ai/2),width:de(Ai),height:"100%",pointerEvents:"auto"}})]},R.className)},dt=()=>{const R=E?-1:Z.findIndex(Le=>Le.prefix==="title1"),oe=!E&&(o||(I??0)>0)?(()=>{const Le=I??0,Ge=R>=0?we[R]:W??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ge),style:{position:"absolute",top:0,left:0,width:`max(${de(Le)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,fe=Z.flatMap((Le,Ge)=>{if(!Le.marginLeftKey)return[];const Qe=he[Le.marginLeftKey]??0,bt=rv(Z,we,he,Ge)+Ne();return a.jsx("div",{"data-controls":Le.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we[Ge]),style:{position:"absolute",top:0,left:de(bt),width:`max(${de(Qe)}, 10px)`,height:"100%",pointerEvents:"auto"}},Le.marginLeftKey)});return oe?[oe,...fe]:fe},tt=()=>Z.map((R,oe)=>{const fe=xr(oe,we),Ge=J(oe)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:de(Ge),width:de(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),De=()=>X.flatMap((R,oe)=>{if(!R.marginLeftKey)return[];const fe=he[R.marginLeftKey]??0,Le=Fe(oe),{resolvedWidth:Ge}=q(R,"two-row-bottom");return a.jsx("div",{"data-controls":R.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ge),style:{position:"absolute",top:0,left:de(Le),width:`max(${de(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}},R.marginLeftKey)}),Ie=()=>X.map((R,oe)=>{const{maxWidth:fe}=q(R,"two-row-bottom"),Ge=et(oe)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:de(Ge),width:de(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),We=s.useRef(null),je=s.useRef(null),Ue=s.useRef(null),k=s.useRef(null),ee=s.useRef([]),Te=s.useRef([]),He=s.useRef(0),Be=s.useRef(null),Ve=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),rt=s.useRef(null),Ze=s.useRef(null),_e=s.useRef(0),qe=s.useRef("forward"),Oe=s.useRef(0),nt=s.useRef(null),at=s.useRef(!1),st=t.length>1&&(!o||!!r),St=st?3:1,Yt=s.useMemo(()=>Array.from({length:St},()=>t).flat(),[t,St]),[Zt,vt]=s.useState(!1),[wt,Bt]=s.useState(!1),[At,xt]=s.useState(!0),Ft=s.useRef(null),Nt=s.useRef(null),Ut=s.useRef(!1),Jt=s.useRef(!1),Tt=s.useRef(null),Wt=s.useRef(null),rn=Se&&!At,gt=s.useCallback(()=>{Se&&(xt(!0),Wt.current&&clearTimeout(Wt.current),Wt.current=setTimeout(()=>{Ve.current.isActive||xt(!1)},Vx))},[Se]),Ee=s.useCallback(()=>{o||Jt.current||(Jt.current=!0,Bt(!1),Tt.current=setTimeout(()=>{l()},Eo))},[o,l]),Xe=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:D.scalingValue(m??0,i),height:D.scalingValue(m??0,i),marginRight:le,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Ee,"aria-label":"Close",children:a.jsx(sn,{url:w,fill:h,hoverFill:i&&!r?h:f,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:le,height:"100%",pointerEvents:"auto"}})]}),lt=(R="two-row")=>a.jsx("div",{...R==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:de(I??0),flexShrink:0,...R==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...R==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ht=()=>{const R=Z.find(Le=>Le.prefix==="title1"),oe=Z.filter(Le=>Le.prefix==="title2"||Le.prefix==="title3"),fe=oe.length>0||o||(T??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(I??0)>0||o?lt():null,R&&Je(R,"two-row-top"),w&&Xe()]}),fe?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[oe.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[oe.map(Le=>Je(Le,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[De(),Ie()]})]}):null,a.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:ke,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ft=()=>a.jsxs(a.Fragment,{children:[(I??0)>0||o?lt("single-row"):null,Z.map(R=>Je(R,"single-row")),o?a.jsxs(a.Fragment,{children:[dt(),tt()]}):null,w?Xe():null]}),Lt=s.useCallback(R=>!!(R.closest("[data-controls]")||R.closest(`.${e}-thumbnails`)||R.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:mt,backdropStyle:zt,mediaAreaStyle:kt,overlayContentStyle:Mt,swipeHandlers:Vt,dismissAreaStyle:Gt}=qd({enabled:V??!1,onClose:Ee,animMs:Eo,isBlockedTarget:Lt}),Ht=()=>{if(!st||t.length===0)return He.current=0,0;const R=Te.current[0],oe=Te.current[t.length];if(!R||!oe)return He.current;const fe=oe.offsetLeft-R.offsetLeft;return fe>0&&(He.current=fe),He.current},Dt=(R=!1)=>{if(!st)return;const oe=je.current,fe=Ht();!oe||fe<=0||fe<oe.clientWidth*.25||(oe.scrollLeft<=0?(oe.scrollLeft+=fe,R&&(Ve.current.scrollLeft+=fe),at.current&&(Oe.current+=fe)):oe.scrollLeft>=fe*2&&(oe.scrollLeft-=fe,R&&(Ve.current.scrollLeft-=fe),at.current&&(Oe.current-=fe)))},_t=(R,oe=(fe=>(fe=je.current)==null?void 0:fe.scrollLeft)()??0)=>{if(!st)return R;let Le=t.length+R,Ge=1/0;for(let Qe=0;Qe<St;Qe++){const bt=Qe*t.length+R,Rt=Te.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-oe);tn<Ge&&(Ge=tn,Le=bt)}return Le},Ct=R=>{const oe=je.current;return!R||!oe?!1:R.offsetWidth>oe.clientWidth+1},N=R=>{const oe=je.current;if(!R||!oe||!Ct(R))return!1;const fe=R.offsetLeft,Le=fe+R.offsetWidth;return oe.scrollLeft>=fe-1&&oe.scrollLeft+oe.clientWidth<=Le+1},Re=(R=(oe=>(oe=je.current)==null?void 0:oe.scrollLeft)()??0)=>{for(let Le=0;Le<Te.current.length;Le+=1){const Ge=Te.current[Le];if(Ge&&N(Ge))return Le}let fe={flatIndex:0,distance:1/0};return Te.current.forEach((Le,Ge)=>{if(!Le)return;const Qe=Math.abs(Le.offsetLeft-R);Qe<fe.distance&&(fe={flatIndex:Ge,distance:Qe})}),fe.flatIndex},Ae=R=>{je.current&&Te.current.forEach(oe=>{oe&&(oe.style.scrollSnapAlign=Ct(oe)&&R==="backward"?"end":"start")})},ze=(R,oe,fe)=>{const Le=R-oe,Ge=Re(oe),Qe=Te.current[Ge];if(N(Qe))return Re(R)%t.length;const bt=Te.current[Ge+1],Rt=Qe?bt?bt.offsetLeft-Qe.offsetLeft:Qe.offsetWidth:0,tn=Rt>0?Le>Rt*fr?1:Le<-Rt*fr?-1:0:0;return tn===0?fe:st?(fe+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,fe+tn))},ct=s.useCallback((R=!1)=>{if(C!=="on"||o)return;const oe=k.current,fe=j.current,Le=ee.current[fe];if(!oe||!Le||oe.scrollWidth<=oe.clientWidth)return;const Ge=oe.scrollLeft,Qe=Ge+oe.clientWidth,bt=Le.offsetLeft,Rt=bt+Le.offsetWidth;if(bt>=Ge&&Rt<=Qe)return;const tn=oe.scrollWidth-oe.clientWidth;let Qt=Ge;if(!R&&Ft.current===null){const Ei=ee.current[fe-1],ho=ee.current[fe+1],ar=Ei?Le.offsetLeft-Ei.offsetLeft:ho?ho.offsetLeft-Le.offsetLeft:Le.offsetWidth;Rt>Qe?Qt+=ar:bt<Ge&&(Qt-=ar)}else Rt>Qe?Qt=Rt-oe.clientWidth:Qt=bt;oe.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,C]),Et=s.useCallback((R=!1)=>{R&&(Ut.current=!0),Nt.current===null&&(Nt.current=requestAnimationFrame(()=>{Nt.current=null;const oe=Ut.current;Ut.current=!1,ct(oe)}))},[ct]),it=s.useCallback(R=>{if(R===j.current)return;const oe=j.current;j.current=R;const fe=Math.abs(R-oe)>1,Le=st&&t.length>1&&(oe===t.length-1&&R===0||oe===0&&R===t.length-1);pe(R),Et(fe||Le)},[t.length,st,Et]),yt=()=>{if(!je.current||t.length===0||Ft.current!==null||Ve.current.isActive&&Ve.current.hasMoved)return;const R=je.current.scrollLeft,oe=Re(R)%t.length;oe!==j.current&&it(oe)},Ot=()=>{Ft.current=null},It=R=>{const oe=je.current;oe&&(oe.style.scrollSnapType=R?"":"none")},nn=()=>{var R;(R=Ze.current)==null||R.call(Ze),Ze.current=null},un=()=>{nt.current!==null&&(cancelAnimationFrame(nt.current),nt.current=null),at.current=!1},ci=()=>{const R=je.current;if(!R){nt.current=null,at.current=!1;return}const oe=Oe.current-R.scrollLeft;if(Math.abs(oe)<.5){R.scrollLeft=Oe.current,Dt(),yt(),nt.current=null,at.current=!1;return}R.scrollLeft+=oe*Yx,Dt(),yt(),gt(),nt.current=requestAnimationFrame(ci)},di=()=>{const R=Ue.current;R&&(R.style.transition="",R.style.transform="",R.style.willChange="")},nr=(R,oe,fe,Le)=>{di(),R.scrollLeft=oe,_e.current=R.scrollLeft,Dt(),fe!==void 0?(j.current=fe,pe(fe)):yt(),It(!0),Le==null||Le()},ir=(R,{behavior:oe="smooth",activeIndex:fe,onComplete:Le}={})=>{const Ge=je.current,Qe=Ue.current;if(!Ge||!Qe)return;if(un(),nn(),It(!1),oe==="auto"){nr(Ge,R,fe,Le);return}const bt=Math.abs(R-Ge.scrollLeft),Rt=Wx(bt,Bx,zx,Ge.clientWidth*.55);Ze.current=Ox(Ge,Qe,R,{duration:Rt,easing:jx,onComplete:()=>{Ze.current=null,nr(Ge,R,fe,Le)}})},pa=(R="smooth")=>{const oe=je.current;if(!oe||t.length===0)return;const fe=Re()%t.length,Le=_t(fe,oe.scrollLeft),Ge=Te.current[Le];Ge&&ir(Ge.offsetLeft,{behavior:R,activeIndex:fe})},ma=(R,oe="smooth",fe,Le)=>{const Ge=je.current;if(!Ge||t.length===0)return;const Qe=(Le??Ge.scrollLeft)-R,bt=Re(R),Rt=Te.current[bt];if(N(Rt)){It(!0),yt();return}const tn=Te.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?Qe>Qt*fr?1:Qe<-Qt*fr?-1:0:0)!==0){const Cu=fe??bt%t.length,$u=ze(Le??Ge.scrollLeft,R,Cu);$n($u,oe);return}const ho=Le??Ge.scrollLeft,ar=Re(ho),il=Te.current[ar];if(il&&Math.abs(il.offsetLeft-ho)<1){It(!0),yt();return}pa("auto")},$n=(R,oe="smooth")=>{const fe=je.current;if(!fe||t.length===0)return;const Le=_t(R,fe.scrollLeft),Ge=Te.current[Le];Ge&&(oe==="smooth"?Ft.current=R:Ft.current=null,j.current=R,pe(R),Et(!0),ir(Ge.offsetLeft,{behavior:oe,activeIndex:R,onComplete:oe==="smooth"?Ot:void 0}))},Pi=()=>{rt.current&&(window.removeEventListener("pointerup",rt.current),window.removeEventListener("pointercancel",rt.current),rt.current=null)},or=(R,oe,fe,Le,Ge)=>{const Qe=fe-R,bt=Le-oe,Rt=Math.abs(Qe),tn=Math.abs(bt);if(Rt<Ux||Rt<=tn)return!1;const Qt=Qe<0?1:-1,Ei=st?(Ge+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ge+Qt));return Ei===Ge?!1:($n(Ei),!0)},ui=R=>{if(!Ve.current.isActive)return;Pi();const oe=je.current;if(!oe)return;const{scrollLeft:fe,startActiveIndex:Le,hasMoved:Ge}=Ve.current,Qe=oe.scrollLeft;Dt(!0),Ve.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},vt(!1),R!==void 0&&oe.hasPointerCapture(R)&&oe.releasePointerCapture(R),Ge?ma(fe,"smooth",Le,Qe):(It(!0),yt()),gt()},rr=(R,oe)=>{const fe=Be.current;Be.current=null,fe&&(or(fe.startX,fe.startY,R,oe,fe.startActiveIndex),gt())},ga=R=>{if(!te)return;if(R.pointerType==="touch"){if(un(),It(!0),Lt(R.target))return;Be.current={startX:R.clientX,startY:R.clientY,startActiveIndex:j.current};return}if(R.pointerType!=="mouse"||R.button!==0||Lt(R.target))return;const oe=je.current;if(!oe)return;un(),nn(),di(),Ft.current=null,Ve.current={isActive:!0,startX:R.clientX,scrollLeft:oe.scrollLeft,startActiveIndex:j.current,hasMoved:!1},It(!1),gt(),oe.setPointerCapture(R.pointerId),Pi();const fe=Le=>{Le.pointerType==="mouse"&&ui(Le.pointerId)};rt.current=fe,window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe)},ha=R=>{if(!te||R.pointerType!=="mouse")return;const oe=je.current;if(!oe||!Ve.current.isActive)return;if(R.buttons===0){ui(R.pointerId);return}const fe=R.clientX-Ve.current.startX;Math.abs(fe)>qx&&(Ve.current.hasMoved=!0,vt(!0)),Ve.current.hasMoved&&(R.preventDefault(),oe.scrollLeft=Ve.current.scrollLeft-fe,Dt(!0),yt(),gt())},be=R=>{if(te){if(R.pointerType==="touch"){R.type==="pointerup"?rr(R.clientX,R.clientY):Be.current=null;return}R.pointerType==="mouse"&&ui(R.pointerId)}},Ye=R=>{!te||R.pointerType!=="mouse"||ui(R.pointerId)};return Ud(),s.useEffect(()=>{const R=requestAnimationFrame(()=>Bt(!0));return()=>{cancelAnimationFrame(R),nn(),Pi(),Nt.current!==null&&(cancelAnimationFrame(Nt.current),Nt.current=null),Tt.current&&clearTimeout(Tt.current),Wt.current&&clearTimeout(Wt.current)}},[]),s.useEffect(()=>{if(!Se){xt(!0);return}gt();const R=We.current;if(!R)return;const oe=()=>gt();return R.addEventListener("pointermove",oe),R.addEventListener("pointerdown",oe),()=>{R.removeEventListener("pointermove",oe),R.removeEventListener("pointerdown",oe),Wt.current&&clearTimeout(Wt.current)}},[Se,gt]),s.useEffect(()=>{const R=oe=>{oe.key==="Escape"&&Ee()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[Ee]),s.useLayoutEffect(()=>{Ht()},[O,t.length,st]),s.useLayoutEffect(()=>{o||$n(j.current,"auto")},[O,o]),s.useLayoutEffect(()=>{$n(0,"auto")},[t.length,st]),s.useEffect(()=>{const R=je.current;if(!R||o||!V)return;const oe=fe=>{if(fe.preventDefault(),Math.abs(fe.deltaY)<=Math.abs(fe.deltaX))return;const Le=fe.deltaMode===1?Xx:fe.deltaMode===2?R.clientHeight:1,Ge=fe.deltaY*Le*Gx;if(Ge!==0){if(nn(),at.current||(at.current=!0,Oe.current=R.scrollLeft,Ft.current=null,It(!1)),Oe.current+=Ge,!st){const Qe=R.scrollWidth-R.clientWidth;Oe.current=Math.max(0,Math.min(Qe,Oe.current))}gt(),nt.current===null&&(nt.current=requestAnimationFrame(ci))}};return R.addEventListener("wheel",oe,{passive:!1}),()=>{R.removeEventListener("wheel",oe),un()}},[o,V,st]),s.useEffect(()=>{const R=je.current;if(!R)return;const oe=()=>{Dt(Ve.current.isActive);const Le=R.scrollLeft,Ge=Le-_e.current;_e.current=Le;const Qe=He.current>0?He.current*.5:1/0;if(Ge!==0&&Math.abs(Ge)<Qe){const bt=Ge>0?"forward":"backward";bt!==qe.current&&(qe.current=bt,Ae(bt))}Ve.current.isActive&&Ve.current.hasMoved||yt()};R.addEventListener("scroll",oe,{passive:!0});const fe=new ResizeObserver(()=>{Ht(),Dt(Ve.current.isActive),Ae(qe.current),yt()});return fe.observe(R),()=>{nn(),R.removeEventListener("scroll",oe),fe.disconnect()}},[t.length,st]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{mt||Ee()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:wt?1:0,transition:`opacity ${Eo}ms ease`,pointerEvents:wt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...zt}}),a.jsxs("div",{ref:We,className:`${e}-lightbox-dismiss-area`,style:Gt,...Vt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:R=>R.stopPropagation(),children:a.jsx("div",{ref:je,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":te&&t.length>0?"true":"false","data-mouse-dragging":Zt?"true":"false",onPointerDown:ga,onPointerMove:ha,onPointerUp:be,onPointerCancel:be,onLostPointerCapture:Ye,children:a.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:O},children:Yt.map((R,oe)=>{const fe=R.image.objectFit??"contain",Le=oe%t.length,Ge=Math.floor(oe/t.length),Qe=yr(O),bt=`calc(-0.5 * (${Qe} + ${O}))`;return a.jsxs("div",{ref:Rt=>Te.current[oe]=Rt,className:`${e}-strip-item`,style:{height:A==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:R.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:fe}}),o&&Le<t.length-1&&Ge===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:Qe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ge}-${R.image.url}-${Le}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":rn?"true":"false",style:Mt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:K,flexShrink:0,pointerEvents:"none"},children:o&&a.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:ue,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${E?` ${e}-lightbox-content-area-stacked`:""}`,children:(ye||w)&&a.jsx("div",{className:`${e}-header ${E?`${e}-header-two-row`:`${e}-header-single-row`}`,children:E?ht():ye||w?ft():null})})})]}),t.length>1&&C==="on"&&(()=>{const R=yr(L),oe=`calc(-0.5 * (${L} + ${R}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:L},children:a.jsx("div",{ref:k,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:fe=>fe.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:ie,"--thumbnail-active-color":G},children:[t.map((fe,Le)=>{const Ge=yr(ie),Qe=`calc(-0.5 * (${Ge} + ${ie}))`;return a.jsxs("div",{ref:bt=>{ee.current[Le]=bt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":F===Le?"true":"false",onClick:()=>V&&v==="click"&&$n(Le),onMouseEnter:()=>$e&&v==="hover"&&$n(Le),"aria-label":fe.image.name?`View ${fe.image.name}`:`View image ${Le+1}`,"aria-current":F===Le?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${re?` ${e}-thumb-image-cover`:""}`,src:fe.image.url,alt:"",draggable:!1,style:{...ge,maxWidth:Y,maxHeight:Y,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Le<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Qe,width:Ge,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${fe.image.url}-${Le}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:oe,height:R,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function sv(e){return`
14229
+ `;function Gn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ic={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},kx=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Ax={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:Gn("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:{...ic.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:{...ic.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:Gn("Question Padding Left"),questionPaddingTop:Gn("Question Padding Top"),questionPaddingBottom:Gn("Question Padding Bottom"),answerPaddingLeft:Gn("Answer Padding Left"),answerPaddingRight:Gn("Answer Padding Right"),answerPaddingTop:Gn("Answer Padding Top"),answerPaddingBottom:Gn("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01M0GB8Z9EQFMGYA20F2J0ACA8.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:[...kx],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Fx={element:Ex,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:Ax,sourceCode:Mx},Dn=e=>e.display==="cover",da=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},oc=100,_x=.2,rc=8,qd=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,d]=s.useState(!1),c=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?oc:Math.max(oc,window.innerHeight*_x),[]),x=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),w=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),m=s.useCallback($=>{const T=typeof window<"u"?window.innerHeight:800,k=Math.max(.88,1-$/T*.12);return`translateY(${$}px) scale(${k})`},[]),h=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),v=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;d(!0),r($),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),C=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(c.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),y=s.useCallback($=>{const T=c.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const k=$.clientX-T.startX,_=$.clientY-T.startY;if(T.isLocked===null){if(Math.abs(k)<rc&&Math.abs(_)<rc)return;if(_>0&&_>Math.abs(k))T.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{T.isLocked=!1,h();return}}if(!T.isLocked)return;$.preventDefault();const g=Math.max(0,_);u.current=g,r(g)},[e,h]),S=s.useCallback($=>{const T=c.current;if(!e||!T||$.pointerType!=="touch"||T.pointerId!==$.pointerId)return;const k=T.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!k){h();return}$.clientY-T.startY>=p?v():f()},[p,v,e,h,f]),G=s.useCallback($=>{S($)},[S]),W=s.useCallback($=>{S($)},[S]),U=o>0,H=l?`transform ${n}ms ease`:"none",I=l?`opacity ${n}ms ease`:"none",z=o>0||l;return{isSwipeDragging:U,backdropStyle:{opacity:x(o),transition:I},mediaAreaStyle:{transform:m(o),transition:H,touchAction:U?"none":void 0,willChange:U?"transform":void 0},overlayContentStyle:z?{opacity:w(o),transition:I}:void 0,swipeHandlers:e?{onPointerDown:C,onPointerMove:y,onPointerUp:G,onPointerCancel:W}:{},dismissAreaStyle:e?{touchAction:U?"none":"pan-x"}:void 0}},Nx="[data-lightbox-scrollable]",Ud=()=>{s.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,r=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 l=d=>{const c=d.target;c instanceof Element&&c.closest(Nx)||d.preventDefault()};return document.addEventListener("touchmove",l,{passive:!1}),()=>{document.removeEventListener("touchmove",l),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=r,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},Wx=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Hx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Dx=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Ox=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,f)=>{Hx(t),e.scrollLeft=h,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,x=0;const w=()=>{t.removeEventListener("transitionend",m),clearTimeout(x)},m=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,w(),u(n,!0))};return t.addEventListener("transitionend",m),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(()=>{p||(p=!0,w(),u(n,!0))},i+64),()=>{p||(p=!0,w(),u(l-Dx(t),!1))}},Eo=300,Bx=900,zx=1500,jx="cubic-bezier(0.16, 1, 0.3, 1)",Vx=3e3,Gx=2,Xx=16,Yx=.05,qx=1,fr=.3,Ux=50,Kx=20,Ai=.004,ro=["title1","title2","title3"],Zx={title1:"1",title2:"2",title3:"3"},Jx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Qx={title1:.02,title2:.02,title3:.02},yr=e=>`max(${e}, ${Kx}px)`,ev=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]}},tv=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=ev(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},jt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,nv=e=>[jt(e,"fontFamily"),jt(e,"fontSettings"),{type:"row",items:[jt(e,"fontSize"),jt(e,"lineHeight"),jt(e,"letterSpacing"),jt(e,"wordSpacing")]},jt(e,"textAlign"),jt(e,"textAppearance")],iv=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ro.map(e=>[Zx[e],nv(e)]))}),el=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,l)=>r+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:l},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Kd=(e,t)=>el(e,t),xr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ac=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:el(e.length,n),effective:Kd(e.length,n)}},ov=(e,t,n,i,o,r,l)=>{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:r,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},_a=(e,t)=>{const n=i=>{const o=jt(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[Jx[t]]}},rv=(e,t,n,i)=>e.slice(0,i).reduce((o,r,l)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[l]??0),0),Na=(e,t,n)=>{var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Qx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return qt(i,n)},av=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:x,closeIcon:w,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:f,thumbnailTrigger:v,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailActive:S,thumbnailActiveColor:G,title1Width:W,title2Width:U,title3Width:H,title1MarginLeft:I=0,title2MarginLeft:z=0,title3MarginLeft:$=0,titleRowMarginBottom:T=0,titleHeaderLayout:k="desktop",contentMarginTop:_,iconMarginLeft:g}=n,D=R=>O.scalingValue(R,i??!1),P=c??n.thumnailSize??.03,q=D(P),ie=D(u),L=D(p??.02),B=D(x??0),K=D(_??0),ue=yr(K),le=D(g??0),[F,pe]=s.useState(0),j=s.useRef(F);j.current=F;const se=t[F],{title1:ne,title2:ve,title3:ke}=tv(se),xe=Na("title1",_a(n,"title1"),i),b=Na("title2",_a(n,"title2"),i),M=Na("title3",_a(n,"title3"),i),E=k==="mobile",V=!o&&(!i||r),Ce=V,te=V,$e=V,ae=Dn(y),ge=ae?{"--image-aspect-ratio":da(y)}:void 0,ye=!!(ne||ve||ke),Z=s.useMemo(()=>ov(e,ne,ve,ke,xe,b,M),[e,F,ne,ve,ke,xe,b,M]),J=s.useMemo(()=>({title1Width:W,title2Width:U,title3Width:H}),[W,U,H]),de=s.useMemo(()=>Z.map(R=>J[R.widthKey]),[Z,J]),be=s.useMemo(()=>el(Z.length,de),[Z.length,de]),Pe=s.useMemo(()=>Kd(Z.length,de),[Z.length,de]),Se=s.useMemo(()=>Z.filter(R=>R.prefix==="title1"),[Z]),X=s.useMemo(()=>Z.filter(R=>R.prefix==="title2"||R.prefix==="title3"),[Z]),me=s.useMemo(()=>ac(Se,J),[Se,J]),re=s.useMemo(()=>ac(X,J),[X,J]),Y=s.useCallback((R,oe)=>{const fe=Z.indexOf(R);if(!E||oe==="single-row")return{effectiveWidth:Pe[fe]??0,resolvedWidth:be[fe]??0,maxWidth:xr(fe,be)};if(oe==="two-row-top"){const Ge=Se.indexOf(R);return{effectiveWidth:me.effective[Ge]??0,resolvedWidth:me.resolved[Ge]??0,maxWidth:xr(Ge,me.resolved)}}const Le=X.indexOf(R);return{effectiveWidth:re.effective[Le]??0,resolvedWidth:re.resolved[Le]??0,maxWidth:xr(Le,re.resolved)}},[X,re,Pe,be,Z,Se,me,E]),ce=s.useCallback(R=>O.scalingValue(R,i??!1),[i]),Ee=ce(T??0),he=s.useMemo(()=>({title1MarginLeft:I,title2MarginLeft:z,title3MarginLeft:$}),[I,z,$]),Q=s.useCallback(R=>Z.slice(0,R+1).reduce((oe,fe,Le)=>oe+(fe!=null&&fe.marginLeftKey?he[fe.marginLeftKey]??0:0)+(be[Le]??0),0)+(E?0:I??0),[Z,he,be,E,I]),Ne=s.useCallback(()=>E?0:I??0,[E,I]),Fe=s.useCallback(R=>X.slice(0,R).reduce((oe,fe,Le)=>oe+(fe.marginLeftKey?he[fe.marginLeftKey]??0:0)+(re.resolved[Le]??0),0),[X,re.resolved,he]),et=s.useCallback(R=>{const oe=X[R];return Fe(R)+(oe.marginLeftKey?he[oe.marginLeftKey]??0:0)+(re.resolved[R]??0)},[X,re.resolved,Fe,he]),Je=(R,oe)=>{const fe=R.marginLeftKey?he[R.marginLeftKey]??0:0,{effectiveWidth:Le,resolvedWidth:Ge,maxWidth:Qe}=Y(R,oe),bt=o&&oe==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":R.prefix,style:{...oe==="single-row"?{gridArea:R.prefix}:{},width:ce(Le),...fe>0?{marginLeft:ce(fe)}:{}},children:[a.jsx("p",{className:R.className,style:R.style,children:R.text}),bt&&R.marginLeftKey&&a.jsx("div",{"data-controls":R.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ge),style:{position:"absolute",top:0,left:ce(-fe),width:`max(${ce(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Qe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:ce(-Ai/2),width:ce(Ai),height:"100%",pointerEvents:"auto"}})]},R.className)},dt=()=>{const R=E?-1:Z.findIndex(Le=>Le.prefix==="title1"),oe=!E&&(o||(I??0)>0)?(()=>{const Le=I??0,Ge=R>=0?be[R]:W??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ge),style:{position:"absolute",top:0,left:0,width:`max(${ce(Le)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,fe=Z.flatMap((Le,Ge)=>{if(!Le.marginLeftKey)return[];const Qe=he[Le.marginLeftKey]??0,bt=rv(Z,be,he,Ge)+Ne();return a.jsx("div",{"data-controls":Le.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(be[Ge]),style:{position:"absolute",top:0,left:ce(bt),width:`max(${ce(Qe)}, 10px)`,height:"100%",pointerEvents:"auto"}},Le.marginLeftKey)});return oe?[oe,...fe]:fe},tt=()=>Z.map((R,oe)=>{const fe=xr(oe,be),Ge=Q(oe)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ce(Ge),width:ce(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),De=()=>X.flatMap((R,oe)=>{if(!R.marginLeftKey)return[];const fe=he[R.marginLeftKey]??0,Le=Fe(oe),{resolvedWidth:Ge}=Y(R,"two-row-bottom");return a.jsx("div",{"data-controls":R.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ge),style:{position:"absolute",top:0,left:ce(Le),width:`max(${ce(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}},R.marginLeftKey)}),Ie=()=>X.map((R,oe)=>{const{maxWidth:fe}=Y(R,"two-row-bottom"),Ge=et(oe)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ce(Ge),width:ce(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),We=s.useRef(null),je=s.useRef(null),Ue=s.useRef(null),A=s.useRef(null),ee=s.useRef([]),Te=s.useRef([]),He=s.useRef(0),Be=s.useRef(null),Ve=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),rt=s.useRef(null),Ze=s.useRef(null),_e=s.useRef(0),qe=s.useRef("forward"),Oe=s.useRef(0),nt=s.useRef(null),at=s.useRef(!1),st=t.length>1&&(!o||!!r),St=st?3:1,Yt=s.useMemo(()=>Array.from({length:St},()=>t).flat(),[t,St]),[Zt,vt]=s.useState(!1),[wt,Bt]=s.useState(!1),[At,xt]=s.useState(!0),Ft=s.useRef(null),Nt=s.useRef(null),Ut=s.useRef(!1),Jt=s.useRef(!1),Tt=s.useRef(null),Wt=s.useRef(null),rn=Ce&&!At,gt=s.useCallback(()=>{Ce&&(xt(!0),Wt.current&&clearTimeout(Wt.current),Wt.current=setTimeout(()=>{Ve.current.isActive||xt(!1)},Vx))},[Ce]),Me=s.useCallback(()=>{o||Jt.current||(Jt.current=!0,Bt(!1),Tt.current=setTimeout(()=>{l()},Eo))},[o,l]),Xe=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:O.scalingValue(m??0,i),height:O.scalingValue(m??0,i),marginRight:le,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Me,"aria-label":"Close",children:a.jsx(sn,{url:w,fill:h,hoverFill:i&&!r?h:f,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:le,height:"100%",pointerEvents:"auto"}})]}),lt=(R="two-row")=>a.jsx("div",{...R==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:ce(I??0),flexShrink:0,...R==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...R==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ht=()=>{const R=Z.find(Le=>Le.prefix==="title1"),oe=Z.filter(Le=>Le.prefix==="title2"||Le.prefix==="title3"),fe=oe.length>0||o||(T??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(I??0)>0||o?lt():null,R&&Je(R,"two-row-top"),w&&Xe()]}),fe?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[oe.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[oe.map(Le=>Je(Le,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[De(),Ie()]})]}):null,a.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:Ee,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ft=()=>a.jsxs(a.Fragment,{children:[(I??0)>0||o?lt("single-row"):null,Z.map(R=>Je(R,"single-row")),o?a.jsxs(a.Fragment,{children:[dt(),tt()]}):null,w?Xe():null]}),Lt=s.useCallback(R=>!!(R.closest("[data-controls]")||R.closest(`.${e}-thumbnails`)||R.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:mt,backdropStyle:zt,mediaAreaStyle:kt,overlayContentStyle:Mt,swipeHandlers:Vt,dismissAreaStyle:Gt}=qd({enabled:V??!1,onClose:Me,animMs:Eo,isBlockedTarget:Lt}),Ht=()=>{if(!st||t.length===0)return He.current=0,0;const R=Te.current[0],oe=Te.current[t.length];if(!R||!oe)return He.current;const fe=oe.offsetLeft-R.offsetLeft;return fe>0&&(He.current=fe),He.current},Dt=(R=!1)=>{if(!st)return;const oe=je.current,fe=Ht();!oe||fe<=0||fe<oe.clientWidth*.25||(oe.scrollLeft<=0?(oe.scrollLeft+=fe,R&&(Ve.current.scrollLeft+=fe),at.current&&(Oe.current+=fe)):oe.scrollLeft>=fe*2&&(oe.scrollLeft-=fe,R&&(Ve.current.scrollLeft-=fe),at.current&&(Oe.current-=fe)))},_t=(R,oe=(fe=>(fe=je.current)==null?void 0:fe.scrollLeft)()??0)=>{if(!st)return R;let Le=t.length+R,Ge=1/0;for(let Qe=0;Qe<St;Qe++){const bt=Qe*t.length+R,Rt=Te.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-oe);tn<Ge&&(Ge=tn,Le=bt)}return Le},Ct=R=>{const oe=je.current;return!R||!oe?!1:R.offsetWidth>oe.clientWidth+1},N=R=>{const oe=je.current;if(!R||!oe||!Ct(R))return!1;const fe=R.offsetLeft,Le=fe+R.offsetWidth;return oe.scrollLeft>=fe-1&&oe.scrollLeft+oe.clientWidth<=Le+1},Re=(R=(oe=>(oe=je.current)==null?void 0:oe.scrollLeft)()??0)=>{for(let Le=0;Le<Te.current.length;Le+=1){const Ge=Te.current[Le];if(Ge&&N(Ge))return Le}let fe={flatIndex:0,distance:1/0};return Te.current.forEach((Le,Ge)=>{if(!Le)return;const Qe=Math.abs(Le.offsetLeft-R);Qe<fe.distance&&(fe={flatIndex:Ge,distance:Qe})}),fe.flatIndex},Ae=R=>{je.current&&Te.current.forEach(oe=>{oe&&(oe.style.scrollSnapAlign=Ct(oe)&&R==="backward"?"end":"start")})},ze=(R,oe,fe)=>{const Le=R-oe,Ge=Re(oe),Qe=Te.current[Ge];if(N(Qe))return Re(R)%t.length;const bt=Te.current[Ge+1],Rt=Qe?bt?bt.offsetLeft-Qe.offsetLeft:Qe.offsetWidth:0,tn=Rt>0?Le>Rt*fr?1:Le<-Rt*fr?-1:0:0;return tn===0?fe:st?(fe+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,fe+tn))},ct=s.useCallback((R=!1)=>{if(C!=="on"||o)return;const oe=A.current,fe=j.current,Le=ee.current[fe];if(!oe||!Le||oe.scrollWidth<=oe.clientWidth)return;const Ge=oe.scrollLeft,Qe=Ge+oe.clientWidth,bt=Le.offsetLeft,Rt=bt+Le.offsetWidth;if(bt>=Ge&&Rt<=Qe)return;const tn=oe.scrollWidth-oe.clientWidth;let Qt=Ge;if(!R&&Ft.current===null){const Ei=ee.current[fe-1],ho=ee.current[fe+1],ar=Ei?Le.offsetLeft-Ei.offsetLeft:ho?ho.offsetLeft-Le.offsetLeft:Le.offsetWidth;Rt>Qe?Qt+=ar:bt<Ge&&(Qt-=ar)}else Rt>Qe?Qt=Rt-oe.clientWidth:Qt=bt;oe.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,C]),Et=s.useCallback((R=!1)=>{R&&(Ut.current=!0),Nt.current===null&&(Nt.current=requestAnimationFrame(()=>{Nt.current=null;const oe=Ut.current;Ut.current=!1,ct(oe)}))},[ct]),it=s.useCallback(R=>{if(R===j.current)return;const oe=j.current;j.current=R;const fe=Math.abs(R-oe)>1,Le=st&&t.length>1&&(oe===t.length-1&&R===0||oe===0&&R===t.length-1);pe(R),Et(fe||Le)},[t.length,st,Et]),yt=()=>{if(!je.current||t.length===0||Ft.current!==null||Ve.current.isActive&&Ve.current.hasMoved)return;const R=je.current.scrollLeft,oe=Re(R)%t.length;oe!==j.current&&it(oe)},Ot=()=>{Ft.current=null},It=R=>{const oe=je.current;oe&&(oe.style.scrollSnapType=R?"":"none")},nn=()=>{var R;(R=Ze.current)==null||R.call(Ze),Ze.current=null},un=()=>{nt.current!==null&&(cancelAnimationFrame(nt.current),nt.current=null),at.current=!1},ci=()=>{const R=je.current;if(!R){nt.current=null,at.current=!1;return}const oe=Oe.current-R.scrollLeft;if(Math.abs(oe)<.5){R.scrollLeft=Oe.current,Dt(),yt(),nt.current=null,at.current=!1;return}R.scrollLeft+=oe*Yx,Dt(),yt(),gt(),nt.current=requestAnimationFrame(ci)},di=()=>{const R=Ue.current;R&&(R.style.transition="",R.style.transform="",R.style.willChange="")},nr=(R,oe,fe,Le)=>{di(),R.scrollLeft=oe,_e.current=R.scrollLeft,Dt(),fe!==void 0?(j.current=fe,pe(fe)):yt(),It(!0),Le==null||Le()},ir=(R,{behavior:oe="smooth",activeIndex:fe,onComplete:Le}={})=>{const Ge=je.current,Qe=Ue.current;if(!Ge||!Qe)return;if(un(),nn(),It(!1),oe==="auto"){nr(Ge,R,fe,Le);return}const bt=Math.abs(R-Ge.scrollLeft),Rt=Wx(bt,Bx,zx,Ge.clientWidth*.55);Ze.current=Ox(Ge,Qe,R,{duration:Rt,easing:jx,onComplete:()=>{Ze.current=null,nr(Ge,R,fe,Le)}})},pa=(R="smooth")=>{const oe=je.current;if(!oe||t.length===0)return;const fe=Re()%t.length,Le=_t(fe,oe.scrollLeft),Ge=Te.current[Le];Ge&&ir(Ge.offsetLeft,{behavior:R,activeIndex:fe})},ma=(R,oe="smooth",fe,Le)=>{const Ge=je.current;if(!Ge||t.length===0)return;const Qe=(Le??Ge.scrollLeft)-R,bt=Re(R),Rt=Te.current[bt];if(N(Rt)){It(!0),yt();return}const tn=Te.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?Qe>Qt*fr?1:Qe<-Qt*fr?-1:0:0)!==0){const Cu=fe??bt%t.length,$u=ze(Le??Ge.scrollLeft,R,Cu);$n($u,oe);return}const ho=Le??Ge.scrollLeft,ar=Re(ho),il=Te.current[ar];if(il&&Math.abs(il.offsetLeft-ho)<1){It(!0),yt();return}pa("auto")},$n=(R,oe="smooth")=>{const fe=je.current;if(!fe||t.length===0)return;const Le=_t(R,fe.scrollLeft),Ge=Te.current[Le];Ge&&(oe==="smooth"?Ft.current=R:Ft.current=null,j.current=R,pe(R),Et(!0),ir(Ge.offsetLeft,{behavior:oe,activeIndex:R,onComplete:oe==="smooth"?Ot:void 0}))},Pi=()=>{rt.current&&(window.removeEventListener("pointerup",rt.current),window.removeEventListener("pointercancel",rt.current),rt.current=null)},or=(R,oe,fe,Le,Ge)=>{const Qe=fe-R,bt=Le-oe,Rt=Math.abs(Qe),tn=Math.abs(bt);if(Rt<Ux||Rt<=tn)return!1;const Qt=Qe<0?1:-1,Ei=st?(Ge+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ge+Qt));return Ei===Ge?!1:($n(Ei),!0)},ui=R=>{if(!Ve.current.isActive)return;Pi();const oe=je.current;if(!oe)return;const{scrollLeft:fe,startActiveIndex:Le,hasMoved:Ge}=Ve.current,Qe=oe.scrollLeft;Dt(!0),Ve.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},vt(!1),R!==void 0&&oe.hasPointerCapture(R)&&oe.releasePointerCapture(R),Ge?ma(fe,"smooth",Le,Qe):(It(!0),yt()),gt()},rr=(R,oe)=>{const fe=Be.current;Be.current=null,fe&&(or(fe.startX,fe.startY,R,oe,fe.startActiveIndex),gt())},ga=R=>{if(!te)return;if(R.pointerType==="touch"){if(un(),It(!0),Lt(R.target))return;Be.current={startX:R.clientX,startY:R.clientY,startActiveIndex:j.current};return}if(R.pointerType!=="mouse"||R.button!==0||Lt(R.target))return;const oe=je.current;if(!oe)return;un(),nn(),di(),Ft.current=null,Ve.current={isActive:!0,startX:R.clientX,scrollLeft:oe.scrollLeft,startActiveIndex:j.current,hasMoved:!1},It(!1),gt(),oe.setPointerCapture(R.pointerId),Pi();const fe=Le=>{Le.pointerType==="mouse"&&ui(Le.pointerId)};rt.current=fe,window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe)},ha=R=>{if(!te||R.pointerType!=="mouse")return;const oe=je.current;if(!oe||!Ve.current.isActive)return;if(R.buttons===0){ui(R.pointerId);return}const fe=R.clientX-Ve.current.startX;Math.abs(fe)>qx&&(Ve.current.hasMoved=!0,vt(!0)),Ve.current.hasMoved&&(R.preventDefault(),oe.scrollLeft=Ve.current.scrollLeft-fe,Dt(!0),yt(),gt())},we=R=>{if(te){if(R.pointerType==="touch"){R.type==="pointerup"?rr(R.clientX,R.clientY):Be.current=null;return}R.pointerType==="mouse"&&ui(R.pointerId)}},Ye=R=>{!te||R.pointerType!=="mouse"||ui(R.pointerId)};return Ud(),s.useEffect(()=>{const R=requestAnimationFrame(()=>Bt(!0));return()=>{cancelAnimationFrame(R),nn(),Pi(),Nt.current!==null&&(cancelAnimationFrame(Nt.current),Nt.current=null),Tt.current&&clearTimeout(Tt.current),Wt.current&&clearTimeout(Wt.current)}},[]),s.useEffect(()=>{if(!Ce){xt(!0);return}gt();const R=We.current;if(!R)return;const oe=()=>gt();return R.addEventListener("pointermove",oe),R.addEventListener("pointerdown",oe),()=>{R.removeEventListener("pointermove",oe),R.removeEventListener("pointerdown",oe),Wt.current&&clearTimeout(Wt.current)}},[Ce,gt]),s.useEffect(()=>{const R=oe=>{oe.key==="Escape"&&Me()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[Me]),s.useLayoutEffect(()=>{Ht()},[B,t.length,st]),s.useLayoutEffect(()=>{o||$n(j.current,"auto")},[B,o]),s.useLayoutEffect(()=>{$n(0,"auto")},[t.length,st]),s.useEffect(()=>{const R=je.current;if(!R||o||!V)return;const oe=fe=>{if(fe.preventDefault(),Math.abs(fe.deltaY)<=Math.abs(fe.deltaX))return;const Le=fe.deltaMode===1?Xx:fe.deltaMode===2?R.clientHeight:1,Ge=fe.deltaY*Le*Gx;if(Ge!==0){if(nn(),at.current||(at.current=!0,Oe.current=R.scrollLeft,Ft.current=null,It(!1)),Oe.current+=Ge,!st){const Qe=R.scrollWidth-R.clientWidth;Oe.current=Math.max(0,Math.min(Qe,Oe.current))}gt(),nt.current===null&&(nt.current=requestAnimationFrame(ci))}};return R.addEventListener("wheel",oe,{passive:!1}),()=>{R.removeEventListener("wheel",oe),un()}},[o,V,st]),s.useEffect(()=>{const R=je.current;if(!R)return;const oe=()=>{Dt(Ve.current.isActive);const Le=R.scrollLeft,Ge=Le-_e.current;_e.current=Le;const Qe=He.current>0?He.current*.5:1/0;if(Ge!==0&&Math.abs(Ge)<Qe){const bt=Ge>0?"forward":"backward";bt!==qe.current&&(qe.current=bt,Ae(bt))}Ve.current.isActive&&Ve.current.hasMoved||yt()};R.addEventListener("scroll",oe,{passive:!0});const fe=new ResizeObserver(()=>{Ht(),Dt(Ve.current.isActive),Ae(qe.current),yt()});return fe.observe(R),()=>{nn(),R.removeEventListener("scroll",oe),fe.disconnect()}},[t.length,st]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{mt||Me()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:wt?1:0,transition:`opacity ${Eo}ms ease`,pointerEvents:wt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...zt}}),a.jsxs("div",{ref:We,className:`${e}-lightbox-dismiss-area`,style:Gt,...Vt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:R=>R.stopPropagation(),children:a.jsx("div",{ref:je,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":te&&t.length>0?"true":"false","data-mouse-dragging":Zt?"true":"false",onPointerDown:ga,onPointerMove:ha,onPointerUp:we,onPointerCancel:we,onLostPointerCapture:Ye,children:a.jsx("div",{ref:Ue,className:`${e}-lightbox-strip-track`,style:{gap:B},children:Yt.map((R,oe)=>{const fe=R.image.objectFit??"contain",Le=oe%t.length,Ge=Math.floor(oe/t.length),Qe=yr(B),bt=`calc(-0.5 * (${Qe} + ${B}))`;return a.jsxs("div",{ref:Rt=>Te.current[oe]=Rt,className:`${e}-strip-item`,style:{height:k==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:R.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:fe}}),o&&Le<t.length-1&&Ge===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:Qe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ge}-${R.image.url}-${Le}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":rn?"true":"false",style:Mt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:K,flexShrink:0,pointerEvents:"none"},children:o&&a.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:ue,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${E?` ${e}-lightbox-content-area-stacked`:""}`,children:(ye||w)&&a.jsx("div",{className:`${e}-header ${E?`${e}-header-two-row`:`${e}-header-single-row`}`,children:E?ht():ye||w?ft():null})})})]}),t.length>1&&C==="on"&&(()=>{const R=yr(L),oe=`calc(-0.5 * (${L} + ${R}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:L},children:a.jsx("div",{ref:A,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:fe=>fe.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:ie,"--thumbnail-active-color":G},children:[t.map((fe,Le)=>{const Ge=yr(ie),Qe=`calc(-0.5 * (${Ge} + ${ie}))`;return a.jsxs("div",{ref:bt=>{ee.current[Le]=bt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":F===Le?"true":"false",onClick:()=>V&&v==="click"&&$n(Le),onMouseEnter:()=>$e&&v==="hover"&&$n(Le),"aria-label":fe.image.name?`View ${fe.image.name}`:`View image ${Le+1}`,"aria-current":F===Le?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${ae?` ${e}-thumb-image-cover`:""}`,src:fe.image.url,alt:"",draggable:!1,style:{...ge,maxWidth:q,maxHeight:q,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Le<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Qe,width:Ge,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${fe.image.url}-${Le}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:oe,height:R,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function sv(e){return`
14230
14230
  .${e}-wrapper {
14231
14231
  position: relative;
14232
14232
  width: 100%;
@@ -14611,7 +14611,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
14611
14611
  pointer-events: auto;
14612
14612
  z-index: 10;
14613
14613
  }
14614
- `}const lv=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=D.useScopedStyles(),{cover:d,coverFit:c}=e,u=s.useRef(null),[p,x]=s.useState(!1),w=t??[],m=p&&w.length>0,h=()=>{w.length!==0&&x(!0)};return s.useEffect(()=>{!n||i||o||x(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:sv(l)}}),d&&a.jsx("div",{className:`${l}-cover ${Dn(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>h(),style:{...Dn(c)?{"--image-aspect-ratio":da(c)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${l}-cover-image ${Dn(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),m&&typeof document<"u"&&(()=>{const f=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx(av,{prefix:l,images:w,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>x(!1)}),f)})()]})},cv=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
14614
+ `}const lv=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=O.useScopedStyles(),{cover:d,coverFit:c}=e,u=s.useRef(null),[p,x]=s.useState(!1),w=t??[],m=p&&w.length>0,h=()=>{w.length!==0&&x(!0)};return s.useEffect(()=>{!n||i||o||x(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:sv(l)}}),d&&a.jsx("div",{className:`${l}-cover ${Dn(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>h(),style:{...Dn(c)?{"--image-aspect-ratio":da(c)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${l}-cover-image ${Dn(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),m&&typeof document<"u"&&(()=>{const f=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx(av,{prefix:l,images:w,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>x(!1)}),f)})()]})},cv=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
14615
14615
  import { createPortal } from 'react-dom';
14616
14616
  import { CommonComponentProps } from '../props';
14617
14617
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -15157,7 +15157,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
15157
15157
  </>
15158
15158
  );
15159
15159
  };
15160
- `,dv="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>'),fi={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 uv(e){const t={};return t[jt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[jt(e,"fontSettings")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[jt(e,"fontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[jt(e,"lineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[jt(e,"letterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[jt(e,"wordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[jt(e,"textAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[jt(e,"textAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const pv=ro.reduce((e,t)=>({...e,...uv(t)}),{}),mv=ro.reduce((e,t)=>({...e,[jt(t,"fontFamily")]:"Goudy Bookletter 1911",[jt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[jt(t,"letterSpacing")]:0,[jt(t,"wordSpacing")]:0,[jt(t,"textAlign")]:"left",[jt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Wa(e){return ro.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[jt(n,"fontSize")]=i),o!==void 0&&(t[jt(n,"lineHeight")]=o),t},{})}const gv=iv(),hv={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"}},...pv,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:dv,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...mv},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,...Wa({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,...Wa({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,...Wa({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:[gv]}],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"}]}},fv={element:lv,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:hv,sourceCode:cv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ro.map(e=>({path:`${jt(e,"fontFamily")}`}))]},fontRelations:{...ro.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${jt(t,"fontFamily")}`}),{})}},yv=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:x,coverFit:w,backgroundColor:m,imageGap:h,maxWidth:f,maxHeight:v,textTransition:C,title1Width:y,title2Width:S,title3Width:G,title1MarginLeft:W=0,title2MarginLeft:U=0,title3MarginLeft:H=0,titleRowMarginBottom:I=0,titleHeaderLayout:z="single-row",countCloseGap:$=0,closeIcon:T,closeIconMaxWidth:A,closeIconColor:_,closeIconHoverColor:g,contentMarginTop:B=0,iconMarginRight:P=0}=n,Y=s.useCallback(be=>D.scalingValue(be,i??!1),[i]),ie=Y(h??0),L=`${f}%`,O=`${v}%`,K=Y($),ue=Y(B),le=Y(P),F=wi("title1",bi(n,"title1"),i),pe=wi("title2",bi(n,"title2"),i),j=wi("title3",bi(n,"title3"),i),se=wi("count",bi(n,"count"),i),ne=z==="mobile",ve=!i||!!r,Me=!o&&(!i||!!r),xe=s.useMemo(()=>Er(t,x),[t,x]),[b,M]=s.useState(l),E=xe[b],V=E==null?void 0:E.entry,[Se,te]=s.useState(!1),[$e,re]=s.useState(null),[ge,ye]=s.useState(!1),[Z,Q]=s.useState(null),[ce,we]=s.useState(!1),[Pe,Ce]=s.useState(0),[X,me]=s.useState(),[ae,q]=s.useState(),[de,ke]=s.useState(null),he=s.useRef(null),J=s.useRef(0),Ne=s.useRef(0),Fe=s.useRef(0),et=s.useRef(!1),Je=s.useRef(null),dt=s.useRef(null),tt=s.useRef(null),De=s.useRef(null),Ie=s.useRef(null),We=s.useRef(null),je=s.useRef(null),Ue=s.useCallback(()=>{const be=dt.current;if(!be)return;const Ye=be.closest(`.${e}-lightbox-content-area`);if(!Ye)return be.getBoundingClientRect().width;const R=Array.from(Ye.children).reduce((oe,fe)=>!(fe instanceof HTMLElement)||fe.contains(be)?oe:oe+fe.getBoundingClientRect().width,0);return Ye.getBoundingClientRect().width-R},[e]),k=s.useCallback(()=>{he.current&&(clearTimeout(he.current),he.current=null)},[]),ee=s.useCallback(be=>{be===J.current&&(Q(null),we(!1))},[]),Te=s.useCallback(()=>{o||et.current||(et.current=!0,u==null||u(),te(!1),Je.current=setTimeout(()=>{p()},300))},[o,u,p]),He=s.useCallback(be=>!!(be.closest("[data-controls]")||be.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Be,backdropStyle:Ve,mediaAreaStyle:rt,overlayContentStyle:Ze,swipeHandlers:_e,dismissAreaStyle:qe}=qd({enabled:Me,onClose:Te,animMs:300,isBlockedTarget:He}),Oe=s.useCallback(be=>{d&&Ed(be+1,c,!0)},[d,c]),nt=s.useCallback(be=>{if(be)return be.getBoundingClientRect().height},[]),at=s.useCallback(be=>{if(xe.length===0)return;const Ye=(be%xe.length+xe.length)%xe.length;if(Ye===b)return;const R=xe[b],oe=xe[Ye];J.current+=1;const fe=J.current,Le=C==="fade"&&_l(R==null?void 0:R.entry)!==_l(oe==null?void 0:oe.entry),Ge=nt(tt.current),Qe=Le?(()=>{const Rt=Ue();zn.flushSync(()=>{ke(oe.entry)}),tt.current&&Rt&&(tt.current.style.width=`${Rt}px`);const tn=nt(tt.current);return tt.current&&(tt.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(Ge??0,(Qe==null?void 0:Qe.measuredIncomingTitlesHeight)??0)||void 0;Ce(fe),Q(b),we(!0),M(Ye),Oe(Ye),Fe.current=Ye,Le?(k(),bt&&me(bt),Qe!=null&&Qe.incomingTitlesMeasureWidth&&q(Qe.incomingTitlesMeasureWidth),re((R==null?void 0:R.entryIndex)??null),ye(!0),Ne.current=oe.entryIndex,he.current=setTimeout(()=>{re(null),ye(!1),me(void 0),q(void 0),ke(null),he.current=null},400)):(k(),re(null),ye(!1),me(void 0),q(void 0),ke(null),Ne.current=oe.entryIndex)},[b,k,Ue,nt,xe,Oe,C]),st=s.useCallback(()=>{je.current=null},[]),St=s.useCallback(be=>{!ve||xe.length<=1||be.pointerType==="mouse"&&be.button!==0||be.target.closest("[data-controls]")||(je.current={startX:be.clientX,startY:be.clientY,pointerId:be.pointerId})},[ve,xe.length]),Yt=s.useCallback(be=>{var Rt;if(!ve||xe.length<=1||be.pointerType==="mouse"&&be.button!==0)return;if(Be){st();return}const Ye=je.current;if(!Ye||Ye.pointerId!==be.pointerId||(st(),be.target.closest("[data-controls]")))return;const oe=be.clientX-Ye.startX,fe=be.clientY-Ye.startY,Le=Math.abs(oe),Ge=Math.abs(fe);if(Le>=Pf&&Le>Ge){at(oe>0?b-1:b+1);return}if(Le>Ml||Ge>Ml)return;const Qe=(Rt=De.current)==null?void 0:Rt.getBoundingClientRect(),bt=Qe?Qe.left+Qe.width/2:window.innerWidth/2;at(be.clientX<bt?b-1:b+1)},[b,ve,at,Be,st,xe.length]),Zt=s.useCallback(be=>{const Ye=je.current;(Ye==null?void 0:Ye.pointerId)===be.pointerId&&st()},[st]);Ud(),s.useEffect(()=>{We.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const be=requestAnimationFrame(()=>{te(!0),requestAnimationFrame(()=>{Ie.current?Ie.current.focus():De.current&&De.current.focus()})});return()=>{cancelAnimationFrame(be),Je.current&&clearTimeout(Je.current),he.current&&clearTimeout(he.current);const Ye=We.current;Ye&&document.contains(Ye)&&Ye.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var be;C!=="fade"&&(Ne.current=((be=xe[b])==null?void 0:be.entryIndex)??0,k(),re(null),ye(!1),me(void 0),q(void 0))},[b,k,xe,C]),s.useEffect(()=>{const be=Ye=>{if(Ye.key==="Escape"){Te();return}if(Ye.key==="ArrowLeft"&&xe.length>1){at(b-1);return}if(Ye.key==="ArrowRight"&&xe.length>1){at(b+1);return}if(Ye.key==="Tab"&&De.current){const R=De.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),oe=Array.from(R).filter(Qe=>!Qe.closest('[aria-hidden="true"]'));if(oe.length===0)return;const fe=oe[0],Le=oe[oe.length-1],Ge=document.activeElement;Ye.shiftKey?(Ge===fe||!De.current.contains(Ge))&&(Ye.preventDefault(),Le.focus()):(Ge===Le||!De.current.contains(Ge))&&(Ye.preventDefault(),fe.focus())}};return window.addEventListener("keydown",be),()=>window.removeEventListener("keydown",be)},[at,Te,b,xe.length]),s.useLayoutEffect(()=>{k(),J.current=0,Ce(0),Q(null),we(!1),re(null),ye(!1),me(void 0),q(void 0),ke(null),M(be=>{const Ye=Math.max(0,xe.length-1);return Math.min(be,Ye)})},[k,t.length,x,xe.length]),s.useLayoutEffect(()=>{var R;const be=Math.max(0,xe.length-1),Ye=Math.min(Math.max(0,l),be);Fe.current=Ye,Ne.current=((R=xe[Ye])==null?void 0:R.entryIndex)??0,M(Ye)},[l]);const vt=$e!==null?t[$e]:null,wt=Z!==null?xe[Z]:null,Bt=(V==null?void 0:V.title1)||(V==null?void 0:V.title2)||(V==null?void 0:V.title3)||(vt==null?void 0:vt.title1)||(vt==null?void 0:vt.title2)||(vt==null?void 0:vt.title3),At=Wf(x,xe,t),xt=T!==null,Ft=Bt||At||xt,Nt=At&&xt?{gap:K}:void 0,Ut=`${e}-titles-stack${ne?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${ne?` ${e}-titles-layer-out-stacked`:""}`,Tt=`${e}-titles-layer-out`,Wt=(W??0)>0||o,rn=Y(I),gt=s.useMemo(()=>({title1Width:y??Yi.title1Width,title2Width:S??Yi.title2Width,title3Width:G??Yi.title3Width}),[y,S,G]),Ee=s.useMemo(()=>({title2MarginLeft:U,title3MarginLeft:H}),[U,H]),Xe=s.useMemo(()=>V?Kn(e,V,F,pe,j):[],[e,V,F,pe,j]),lt=s.useMemo(()=>Xe.map(be=>gt[be.widthKey]),[Xe,gt]),ht=s.useMemo(()=>Qi(Xe.length,lt),[Xe.length,lt]),ft=s.useMemo(()=>Ho(Xe.length,lt),[Xe.length,lt]),Lt=s.useMemo(()=>Xe.filter(be=>be.prefix==="title1"),[Xe]),mt=s.useMemo(()=>Xe.filter(be=>be.prefix==="title2"||be.prefix==="title3"),[Xe]),zt=s.useMemo(()=>Zn(Lt,gt),[Lt,gt]),kt=s.useMemo(()=>Zn(mt,gt),[mt,gt]),Mt=s.useCallback((be,Ye)=>{const R=Xe.findIndex(fe=>fe.prefix===be.prefix);if(!ne||Ye==="single-row")return{effectiveWidth:ft[R]??0,resolvedWidth:ht[R]??0,maxWidth:cn(R,ht)};if(Ye==="two-row-top"){const fe=Lt.findIndex(Le=>Le.prefix===be.prefix);return{effectiveWidth:zt.effective[fe]??0,resolvedWidth:zt.resolved[fe]??0,maxWidth:cn(fe,zt.resolved)}}const oe=mt.findIndex(fe=>fe.prefix===be.prefix);return{effectiveWidth:kt.effective[oe]??0,resolvedWidth:kt.resolved[oe]??0,maxWidth:cn(oe,kt.resolved)}},[Xe,mt,kt,ft,ht,Lt,zt,ne]),Vt=s.useCallback(be=>Fd(Xe,ht,Ee,be)+(ne?0:W??0),[Xe,ht,Ee,ne,W]),Gt=s.useCallback(()=>ne?0:W??0,[ne,W]),Ht=s.useCallback(be=>mt.slice(0,be).reduce((Ye,R,oe)=>Ye+(R.marginLeftKey?Ee[R.marginLeftKey]??0:0)+(kt.resolved[oe]??0),0),[mt,kt.resolved,Ee]),Dt=s.useCallback(be=>{const Ye=mt[be];return Ht(be)+(Ye.marginLeftKey?Ee[Ye.marginLeftKey]??0:0)+(kt.resolved[be]??0)},[mt,kt.resolved,Ht,Ee]),_t=s.useCallback((be,Ye,R)=>{if(!ne||R==="single-row"){const Qe=be.findIndex(Qt=>Qt.prefix===Ye.prefix),bt=be.map(Qt=>gt[Qt.widthKey]),Rt=Qi(be.length,bt);return{effectiveWidth:Ho(be.length,bt)[Qe]??0,resolvedWidth:Rt[Qe]??0,maxWidth:cn(Qe,Rt)}}if(R==="two-row-top"){const Qe=be.filter(Qt=>Qt.prefix==="title1"),bt=Qe.findIndex(Qt=>Qt.prefix===Ye.prefix),{resolved:Rt,effective:tn}=Zn(Qe,gt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:cn(bt,Rt)}}const oe=be.filter(Qe=>Qe.prefix==="title2"||Qe.prefix==="title3"),fe=oe.findIndex(Qe=>Qe.prefix===Ye.prefix),{resolved:Le,effective:Ge}=Zn(oe,gt);return{effectiveWidth:Ge[fe]??0,resolvedWidth:Le[fe]??0,maxWidth:cn(fe,Le)}},[gt,ne]),Ct=(be,Ye,R)=>{const oe=be.marginLeftKey?Ee[be.marginLeftKey]??0:0,{effectiveWidth:fe,resolvedWidth:Le,maxWidth:Ge}=R??Mt(be,Ye),Qe=Math.max(oe,Un),bt=o&&Ye==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":be.prefix,style:{width:Y(fe),...oe>0?{marginLeft:Y(oe)}:{}},children:[a.jsx("p",{className:be.className,style:be.style,children:be.text}),bt&&be.marginLeftKey?a.jsx("div",{"data-controls":be.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:Y(-oe),width:Y(Qe),height:"100%",pointerEvents:"auto"}}):null,bt?a.jsx("div",{"data-controls":be.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:Y(-fn/2),width:Y(fn),height:"100%",pointerEvents:"auto"}}):null]},be.className)},N=(be="two-row")=>{const Ye=Xe.findIndex(fe=>fe.prefix==="title1"),R=Ye>=0?ht[Ye]:gt.title1Width,oe=be==="two-row"&&o;return a.jsx("div",{...oe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(R)}:{},style:{width:Y(W??0),flexShrink:0,alignSelf:"stretch",...oe?{pointerEvents:"auto"}:{}}})},Re=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:F,"aria-hidden":"true",children:" "}),Ae=()=>a.jsx("span",{className:`${e}-entry-counter`,style:se,"aria-live":"polite","aria-atomic":"true",children:Nf(xe,b,x,t)}),ze=()=>At?o&&xt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ae(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Ra(K)} + ${K}))`,width:Ra(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ae():null,ct=()=>!At&&!xt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Nt,children:[ze(),xt?yt():null]}),Et=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?Re():null,Wt?N("single-row"):null,It(V),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),ct(),$n()]}),it=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?Re():null,Wt?N("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:ge&&X?{minHeight:X}:void 0,children:[a.jsx("div",{ref:tt,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:di(de||V)}),a.jsxs("div",{ref:dt,className:Ut,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%",...ge&&ae?{width:ae,maxWidth:"100%"}:void 0},children:[vt&&ge?a.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:di(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:di(V)})]})]}),ct(),$n()]}),yt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(A??0,i),height:D.scalingValue(A??0,i),marginRight:le,"--close-icon-hover-color":g},children:[a.jsx("button",{ref:Ie,type:"button",className:`${e}-close-icon-inner`,onClick:Te,"aria-label":"Close",children:a.jsx(sn,{url:T??"",fill:_,hoverFill:i&&!r?_:g,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:le,height:"100%",pointerEvents:"auto"}})]}),Ot=(be,Ye)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||Bt?Re():null,Wt?N("two-row"):null,Ye!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ye},children:be}):a.jsxs(a.Fragment,{children:[be,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),ct()]}),It=be=>{if(!be)return null;const Ye=Kn(e,be,F,pe,j);return a.jsx(a.Fragment,{children:Ye.map(R=>Ct(R,"single-row",_t(Ye,R,"single-row")))})},nn=be=>{if(!be)return null;const Ye=Kn(e,be,F,pe,j),R=Ye.find(oe=>oe.prefix==="title1");return R?Ct(R,"two-row-top",_t(Ye,R,"two-row-top")):null},un=(be,Ye=!1)=>{const R=be?Kn(e,be,F,pe,j):[],oe=R.filter(Ge=>Ge.prefix==="title2"||Ge.prefix==="title3"),fe=o&&Ye;return oe.length>0||fe||(I??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[oe.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[oe.map(Ge=>Ct(Ge,"two-row-bottom",_t(R,Ge,"two-row-bottom"))),Ye&&o?a.jsxs(a.Fragment,{children:[pa(),ma()]}):null]}):null,(I??0)>0||fe?a.jsx("div",{"data-controls":fe?"titleRowMarginBottom":void 0,"data-controls-axis":fe?"y":void 0,"data-controls-reverse":fe?"":void 0,className:fe?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:fe?"auto":"none"}}):null]}):null},ci=(be,Ye=!1)=>a.jsxs(a.Fragment,{children:[Ot(nn(be)),un(be,Ye)]}),di=be=>ne?a.jsx("div",{className:`${e}-titles-row-two-row`,children:ci(be)}):be?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:It(be)}):null,nr=()=>{const be=ne?-1:Xe.findIndex(oe=>oe.prefix==="title1"),Ye=!ne&&(o||(W??0)>0)?(()=>{const oe=W??0,fe=be>=0?ht[be]:gt.title1Width,Le=Math.max(oe,Un);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(fe),style:{position:"absolute",top:0,left:0,width:Y(Le),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,R=Xe.flatMap((oe,fe)=>{if(!oe.marginLeftKey)return[];const Le=Ee[oe.marginLeftKey]??0,Ge=Ad(Xe,ht,Ee,fe)+Gt(),Qe=Math.max(Le,Un);return a.jsx("div",{"data-controls":oe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ht[fe]),style:{position:"absolute",top:0,left:Y(Ge),width:Y(Qe),height:"100%",pointerEvents:"auto"}},oe.marginLeftKey)});return Ye?[Ye,...R]:R},ir=()=>Xe.map((be,Ye)=>{const R=cn(Ye,ht),fe=Vt(Ye)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":be.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(R),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:Y(fe),width:Y(fn),height:"100%",pointerEvents:"auto"}})},`${be.widthKey}-junction`)}),pa=()=>mt.flatMap((be,Ye)=>{if(!be.marginLeftKey)return[];const R=Ee[be.marginLeftKey]??0,oe=Ht(Ye),fe=Math.max(R,Un),{resolvedWidth:Le}=Mt(be,"two-row-bottom");return a.jsx("div",{"data-controls":be.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:Y(oe),width:Y(fe),height:"100%",pointerEvents:"auto"}},be.marginLeftKey)}),ma=()=>mt.map((be,Ye)=>{const{maxWidth:R}=Mt(be,"two-row-bottom"),fe=Dt(Ye)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":be.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(R),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:Y(fe),width:Y(fn),height:"100%",pointerEvents:"auto"}})},`${be.widthKey}-junction`)}),$n=()=>!o||ne?null:a.jsxs(a.Fragment,{children:[nr(),ir()]}),Pi=be=>{const Ye=!be.objectFit&&Dn(w);return{className:`${e}-slide-image-cell${Ye?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:L,maxHeight:O,...Ye?{"--image-aspect-ratio":da(w)}:{}}}},or=be=>be.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":be.objectFit}}:Dn(w)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ui=be=>{if(be.length===0)return null;const Ye=be.length>1,R=Ra(ie),oe=`calc(-0.5 * (${R} + ${ie}))`;if(be.length===1){const fe=be[0];return a.jsx("div",{...Pi(fe),children:a.jsx("img",{...or(fe),src:fe.url,alt:fe.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ye?{gap:ie}:void 0,children:be.map((fe,Le)=>a.jsxs("div",{...Pi(fe),children:[a.jsx("img",{...or(fe),src:fe.url,alt:fe.name??"",draggable:!1}),o&&Ye&&Le<be.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:oe,width:R,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${fe.url}-${Le}`))})},rr=!!(V!=null&&V.title2||V!=null&&V.title3||vt!=null&&vt.title2||vt!=null&&vt.title3||(I??0)>0||o),ga=()=>a.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[a.jsx("div",{ref:tt,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ci(de||V)}),a.jsxs("div",{ref:dt,className:`${e}-titles-row-two-row`,style:{...ge&&X?{minHeight:X}:void 0,...ge&&ae?{width:ae,maxWidth:"100%"}:void 0},children:[Ot(a.jsxs("div",{className:Ut,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%"},children:[vt&&ge?a.jsx("div",{className:`${Tt} ${e}-titles-fade-out`,children:nn(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(V)})]}),ge&&X?X:void 0),rr?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[vt&&ge?a.jsx("div",{className:`${Jt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ne?` ${e}-titles-layer-in-stacked`:""}`,children:un(V,!0)})]}):null]})]}),ha=()=>{const be=rr;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...be?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:be?void 0:{flex:"0 0 auto",height:"auto"},children:ci(V,!0)}),$n()]})};return a.jsxs("div",{ref:De,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Be||Te()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Se?1:0,transition:"opacity 300ms ease",pointerEvents:Se?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...Ve}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,..._e,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:rt,onClick:be=>be.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ve&&xe.length>1?"true":"false",onPointerDown:ve?St:void 0,onPointerUp:ve?Yt:void 0,onPointerCancel:ve?Zt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&ce?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:be=>{be.target===be.currentTarget&&ee(Pe)},children:a.jsx("div",{className:`${e}-slide-area`,children:ui(wt.images)})},`slide-out-${Pe}`):null,a.jsx("div",{className:`${e}-slide-layer-in${ce?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:E?ui(E.images):null})},`slide-in-${Pe}-${b}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ze,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ue,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ne?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${ne?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&a.jsx("div",{className:`${e}-text-bar-cell${ne?` ${e}-text-bar-cell-stacked`:""}`,style:ne?void 0:{flex:1,minWidth:0,width:"100%"},children:ne?C==="fade"?ga():ha():C==="fade"?it():Et()})})})]})]})]})};function xv(e){return`
15160
+ `,dv="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>'),fi={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 uv(e){const t={};return t[jt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[jt(e,"fontSettings")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[jt(e,"fontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[jt(e,"lineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[jt(e,"letterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[jt(e,"wordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[jt(e,"textAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[jt(e,"textAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const pv=ro.reduce((e,t)=>({...e,...uv(t)}),{}),mv=ro.reduce((e,t)=>({...e,[jt(t,"fontFamily")]:"Goudy Bookletter 1911",[jt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[jt(t,"letterSpacing")]:0,[jt(t,"wordSpacing")]:0,[jt(t,"textAlign")]:"left",[jt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Wa(e){return ro.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[jt(n,"fontSize")]=i),o!==void 0&&(t[jt(n,"lineHeight")]=o),t},{})}const gv=iv(),hv={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"}},...pv,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:dv,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...mv},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,...Wa({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,...Wa({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,...Wa({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:[gv]}],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"}]}},fv={element:lv,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:hv,sourceCode:cv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ro.map(e=>({path:`${jt(e,"fontFamily")}`}))]},fontRelations:{...ro.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${jt(t,"fontFamily")}`}),{})}},yv=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:x,coverFit:w,backgroundColor:m,imageGap:h,maxWidth:f,maxHeight:v,textTransition:C,title1Width:y,title2Width:S,title3Width:G,title1MarginLeft:W=0,title2MarginLeft:U=0,title3MarginLeft:H=0,titleRowMarginBottom:I=0,titleHeaderLayout:z="single-row",countCloseGap:$=0,closeIcon:T,closeIconMaxWidth:k,closeIconColor:_,closeIconHoverColor:g,contentMarginTop:D=0,iconMarginRight:P=0}=n,q=s.useCallback(we=>O.scalingValue(we,i??!1),[i]),ie=q(h??0),L=`${f}%`,B=`${v}%`,K=q($),ue=q(D),le=q(P),F=wi("title1",bi(n,"title1"),i),pe=wi("title2",bi(n,"title2"),i),j=wi("title3",bi(n,"title3"),i),se=wi("count",bi(n,"count"),i),ne=z==="mobile",ve=!i||!!r,ke=!o&&(!i||!!r),xe=s.useMemo(()=>Er(t,x),[t,x]),[b,M]=s.useState(l),E=xe[b],V=E==null?void 0:E.entry,[Ce,te]=s.useState(!1),[$e,ae]=s.useState(null),[ge,ye]=s.useState(!1),[Z,J]=s.useState(null),[de,be]=s.useState(!1),[Pe,Se]=s.useState(0),[X,me]=s.useState(),[re,Y]=s.useState(),[ce,Ee]=s.useState(null),he=s.useRef(null),Q=s.useRef(0),Ne=s.useRef(0),Fe=s.useRef(0),et=s.useRef(!1),Je=s.useRef(null),dt=s.useRef(null),tt=s.useRef(null),De=s.useRef(null),Ie=s.useRef(null),We=s.useRef(null),je=s.useRef(null),Ue=s.useCallback(()=>{const we=dt.current;if(!we)return;const Ye=we.closest(`.${e}-lightbox-content-area`);if(!Ye)return we.getBoundingClientRect().width;const R=Array.from(Ye.children).reduce((oe,fe)=>!(fe instanceof HTMLElement)||fe.contains(we)?oe:oe+fe.getBoundingClientRect().width,0);return Ye.getBoundingClientRect().width-R},[e]),A=s.useCallback(()=>{he.current&&(clearTimeout(he.current),he.current=null)},[]),ee=s.useCallback(we=>{we===Q.current&&(J(null),be(!1))},[]),Te=s.useCallback(()=>{o||et.current||(et.current=!0,u==null||u(),te(!1),Je.current=setTimeout(()=>{p()},300))},[o,u,p]),He=s.useCallback(we=>!!(we.closest("[data-controls]")||we.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Be,backdropStyle:Ve,mediaAreaStyle:rt,overlayContentStyle:Ze,swipeHandlers:_e,dismissAreaStyle:qe}=qd({enabled:ke,onClose:Te,animMs:300,isBlockedTarget:He}),Oe=s.useCallback(we=>{d&&Ed(we+1,c,!0)},[d,c]),nt=s.useCallback(we=>{if(we)return we.getBoundingClientRect().height},[]),at=s.useCallback(we=>{if(xe.length===0)return;const Ye=(we%xe.length+xe.length)%xe.length;if(Ye===b)return;const R=xe[b],oe=xe[Ye];Q.current+=1;const fe=Q.current,Le=C==="fade"&&_l(R==null?void 0:R.entry)!==_l(oe==null?void 0:oe.entry),Ge=nt(tt.current),Qe=Le?(()=>{const Rt=Ue();zn.flushSync(()=>{Ee(oe.entry)}),tt.current&&Rt&&(tt.current.style.width=`${Rt}px`);const tn=nt(tt.current);return tt.current&&(tt.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(Ge??0,(Qe==null?void 0:Qe.measuredIncomingTitlesHeight)??0)||void 0;Se(fe),J(b),be(!0),M(Ye),Oe(Ye),Fe.current=Ye,Le?(A(),bt&&me(bt),Qe!=null&&Qe.incomingTitlesMeasureWidth&&Y(Qe.incomingTitlesMeasureWidth),ae((R==null?void 0:R.entryIndex)??null),ye(!0),Ne.current=oe.entryIndex,he.current=setTimeout(()=>{ae(null),ye(!1),me(void 0),Y(void 0),Ee(null),he.current=null},400)):(A(),ae(null),ye(!1),me(void 0),Y(void 0),Ee(null),Ne.current=oe.entryIndex)},[b,A,Ue,nt,xe,Oe,C]),st=s.useCallback(()=>{je.current=null},[]),St=s.useCallback(we=>{!ve||xe.length<=1||we.pointerType==="mouse"&&we.button!==0||we.target.closest("[data-controls]")||(je.current={startX:we.clientX,startY:we.clientY,pointerId:we.pointerId})},[ve,xe.length]),Yt=s.useCallback(we=>{var Rt;if(!ve||xe.length<=1||we.pointerType==="mouse"&&we.button!==0)return;if(Be){st();return}const Ye=je.current;if(!Ye||Ye.pointerId!==we.pointerId||(st(),we.target.closest("[data-controls]")))return;const oe=we.clientX-Ye.startX,fe=we.clientY-Ye.startY,Le=Math.abs(oe),Ge=Math.abs(fe);if(Le>=Pf&&Le>Ge){at(oe>0?b-1:b+1);return}if(Le>Ml||Ge>Ml)return;const Qe=(Rt=De.current)==null?void 0:Rt.getBoundingClientRect(),bt=Qe?Qe.left+Qe.width/2:window.innerWidth/2;at(we.clientX<bt?b-1:b+1)},[b,ve,at,Be,st,xe.length]),Zt=s.useCallback(we=>{const Ye=je.current;(Ye==null?void 0:Ye.pointerId)===we.pointerId&&st()},[st]);Ud(),s.useEffect(()=>{We.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const we=requestAnimationFrame(()=>{te(!0),requestAnimationFrame(()=>{Ie.current?Ie.current.focus():De.current&&De.current.focus()})});return()=>{cancelAnimationFrame(we),Je.current&&clearTimeout(Je.current),he.current&&clearTimeout(he.current);const Ye=We.current;Ye&&document.contains(Ye)&&Ye.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var we;C!=="fade"&&(Ne.current=((we=xe[b])==null?void 0:we.entryIndex)??0,A(),ae(null),ye(!1),me(void 0),Y(void 0))},[b,A,xe,C]),s.useEffect(()=>{const we=Ye=>{if(Ye.key==="Escape"){Te();return}if(Ye.key==="ArrowLeft"&&xe.length>1){at(b-1);return}if(Ye.key==="ArrowRight"&&xe.length>1){at(b+1);return}if(Ye.key==="Tab"&&De.current){const R=De.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),oe=Array.from(R).filter(Qe=>!Qe.closest('[aria-hidden="true"]'));if(oe.length===0)return;const fe=oe[0],Le=oe[oe.length-1],Ge=document.activeElement;Ye.shiftKey?(Ge===fe||!De.current.contains(Ge))&&(Ye.preventDefault(),Le.focus()):(Ge===Le||!De.current.contains(Ge))&&(Ye.preventDefault(),fe.focus())}};return window.addEventListener("keydown",we),()=>window.removeEventListener("keydown",we)},[at,Te,b,xe.length]),s.useLayoutEffect(()=>{A(),Q.current=0,Se(0),J(null),be(!1),ae(null),ye(!1),me(void 0),Y(void 0),Ee(null),M(we=>{const Ye=Math.max(0,xe.length-1);return Math.min(we,Ye)})},[A,t.length,x,xe.length]),s.useLayoutEffect(()=>{var R;const we=Math.max(0,xe.length-1),Ye=Math.min(Math.max(0,l),we);Fe.current=Ye,Ne.current=((R=xe[Ye])==null?void 0:R.entryIndex)??0,M(Ye)},[l]);const vt=$e!==null?t[$e]:null,wt=Z!==null?xe[Z]:null,Bt=(V==null?void 0:V.title1)||(V==null?void 0:V.title2)||(V==null?void 0:V.title3)||(vt==null?void 0:vt.title1)||(vt==null?void 0:vt.title2)||(vt==null?void 0:vt.title3),At=Wf(x,xe,t),xt=T!==null,Ft=Bt||At||xt,Nt=At&&xt?{gap:K}:void 0,Ut=`${e}-titles-stack${ne?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${ne?` ${e}-titles-layer-out-stacked`:""}`,Tt=`${e}-titles-layer-out`,Wt=(W??0)>0||o,rn=q(I),gt=s.useMemo(()=>({title1Width:y??Yi.title1Width,title2Width:S??Yi.title2Width,title3Width:G??Yi.title3Width}),[y,S,G]),Me=s.useMemo(()=>({title2MarginLeft:U,title3MarginLeft:H}),[U,H]),Xe=s.useMemo(()=>V?Kn(e,V,F,pe,j):[],[e,V,F,pe,j]),lt=s.useMemo(()=>Xe.map(we=>gt[we.widthKey]),[Xe,gt]),ht=s.useMemo(()=>Qi(Xe.length,lt),[Xe.length,lt]),ft=s.useMemo(()=>Ho(Xe.length,lt),[Xe.length,lt]),Lt=s.useMemo(()=>Xe.filter(we=>we.prefix==="title1"),[Xe]),mt=s.useMemo(()=>Xe.filter(we=>we.prefix==="title2"||we.prefix==="title3"),[Xe]),zt=s.useMemo(()=>Zn(Lt,gt),[Lt,gt]),kt=s.useMemo(()=>Zn(mt,gt),[mt,gt]),Mt=s.useCallback((we,Ye)=>{const R=Xe.findIndex(fe=>fe.prefix===we.prefix);if(!ne||Ye==="single-row")return{effectiveWidth:ft[R]??0,resolvedWidth:ht[R]??0,maxWidth:cn(R,ht)};if(Ye==="two-row-top"){const fe=Lt.findIndex(Le=>Le.prefix===we.prefix);return{effectiveWidth:zt.effective[fe]??0,resolvedWidth:zt.resolved[fe]??0,maxWidth:cn(fe,zt.resolved)}}const oe=mt.findIndex(fe=>fe.prefix===we.prefix);return{effectiveWidth:kt.effective[oe]??0,resolvedWidth:kt.resolved[oe]??0,maxWidth:cn(oe,kt.resolved)}},[Xe,mt,kt,ft,ht,Lt,zt,ne]),Vt=s.useCallback(we=>Fd(Xe,ht,Me,we)+(ne?0:W??0),[Xe,ht,Me,ne,W]),Gt=s.useCallback(()=>ne?0:W??0,[ne,W]),Ht=s.useCallback(we=>mt.slice(0,we).reduce((Ye,R,oe)=>Ye+(R.marginLeftKey?Me[R.marginLeftKey]??0:0)+(kt.resolved[oe]??0),0),[mt,kt.resolved,Me]),Dt=s.useCallback(we=>{const Ye=mt[we];return Ht(we)+(Ye.marginLeftKey?Me[Ye.marginLeftKey]??0:0)+(kt.resolved[we]??0)},[mt,kt.resolved,Ht,Me]),_t=s.useCallback((we,Ye,R)=>{if(!ne||R==="single-row"){const Qe=we.findIndex(Qt=>Qt.prefix===Ye.prefix),bt=we.map(Qt=>gt[Qt.widthKey]),Rt=Qi(we.length,bt);return{effectiveWidth:Ho(we.length,bt)[Qe]??0,resolvedWidth:Rt[Qe]??0,maxWidth:cn(Qe,Rt)}}if(R==="two-row-top"){const Qe=we.filter(Qt=>Qt.prefix==="title1"),bt=Qe.findIndex(Qt=>Qt.prefix===Ye.prefix),{resolved:Rt,effective:tn}=Zn(Qe,gt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:cn(bt,Rt)}}const oe=we.filter(Qe=>Qe.prefix==="title2"||Qe.prefix==="title3"),fe=oe.findIndex(Qe=>Qe.prefix===Ye.prefix),{resolved:Le,effective:Ge}=Zn(oe,gt);return{effectiveWidth:Ge[fe]??0,resolvedWidth:Le[fe]??0,maxWidth:cn(fe,Le)}},[gt,ne]),Ct=(we,Ye,R)=>{const oe=we.marginLeftKey?Me[we.marginLeftKey]??0:0,{effectiveWidth:fe,resolvedWidth:Le,maxWidth:Ge}=R??Mt(we,Ye),Qe=Math.max(oe,Un),bt=o&&Ye==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":we.prefix,style:{width:q(fe),...oe>0?{marginLeft:q(oe)}:{}},children:[a.jsx("p",{className:we.className,style:we.style,children:we.text}),bt&&we.marginLeftKey?a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:q(-oe),width:q(Qe),height:"100%",pointerEvents:"auto"}}):null,bt?a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:q(-fn/2),width:q(fn),height:"100%",pointerEvents:"auto"}}):null]},we.className)},N=(we="two-row")=>{const Ye=Xe.findIndex(fe=>fe.prefix==="title1"),R=Ye>=0?ht[Ye]:gt.title1Width,oe=we==="two-row"&&o;return a.jsx("div",{...oe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(R)}:{},style:{width:q(W??0),flexShrink:0,alignSelf:"stretch",...oe?{pointerEvents:"auto"}:{}}})},Re=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:F,"aria-hidden":"true",children:" "}),Ae=()=>a.jsx("span",{className:`${e}-entry-counter`,style:se,"aria-live":"polite","aria-atomic":"true",children:Nf(xe,b,x,t)}),ze=()=>At?o&&xt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ae(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Ra(K)} + ${K}))`,width:Ra(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ae():null,ct=()=>!At&&!xt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Nt,children:[ze(),xt?yt():null]}),Et=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?Re():null,Wt?N("single-row"):null,It(V),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),ct(),$n()]}),it=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?Re():null,Wt?N("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:ge&&X?{minHeight:X}:void 0,children:[a.jsx("div",{ref:tt,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:di(ce||V)}),a.jsxs("div",{ref:dt,className:Ut,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%",...ge&&re?{width:re,maxWidth:"100%"}:void 0},children:[vt&&ge?a.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:di(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:di(V)})]})]}),ct(),$n()]}),yt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:O.scalingValue(k??0,i),height:O.scalingValue(k??0,i),marginRight:le,"--close-icon-hover-color":g},children:[a.jsx("button",{ref:Ie,type:"button",className:`${e}-close-icon-inner`,onClick:Te,"aria-label":"Close",children:a.jsx(sn,{url:T??"",fill:_,hoverFill:i&&!r?_:g,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:le,height:"100%",pointerEvents:"auto"}})]}),Ot=(we,Ye)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||Bt?Re():null,Wt?N("two-row"):null,Ye!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ye},children:we}):a.jsxs(a.Fragment,{children:[we,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),ct()]}),It=we=>{if(!we)return null;const Ye=Kn(e,we,F,pe,j);return a.jsx(a.Fragment,{children:Ye.map(R=>Ct(R,"single-row",_t(Ye,R,"single-row")))})},nn=we=>{if(!we)return null;const Ye=Kn(e,we,F,pe,j),R=Ye.find(oe=>oe.prefix==="title1");return R?Ct(R,"two-row-top",_t(Ye,R,"two-row-top")):null},un=(we,Ye=!1)=>{const R=we?Kn(e,we,F,pe,j):[],oe=R.filter(Ge=>Ge.prefix==="title2"||Ge.prefix==="title3"),fe=o&&Ye;return oe.length>0||fe||(I??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[oe.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[oe.map(Ge=>Ct(Ge,"two-row-bottom",_t(R,Ge,"two-row-bottom"))),Ye&&o?a.jsxs(a.Fragment,{children:[pa(),ma()]}):null]}):null,(I??0)>0||fe?a.jsx("div",{"data-controls":fe?"titleRowMarginBottom":void 0,"data-controls-axis":fe?"y":void 0,"data-controls-reverse":fe?"":void 0,className:fe?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:fe?"auto":"none"}}):null]}):null},ci=(we,Ye=!1)=>a.jsxs(a.Fragment,{children:[Ot(nn(we)),un(we,Ye)]}),di=we=>ne?a.jsx("div",{className:`${e}-titles-row-two-row`,children:ci(we)}):we?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:It(we)}):null,nr=()=>{const we=ne?-1:Xe.findIndex(oe=>oe.prefix==="title1"),Ye=!ne&&(o||(W??0)>0)?(()=>{const oe=W??0,fe=we>=0?ht[we]:gt.title1Width,Le=Math.max(oe,Un);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(fe),style:{position:"absolute",top:0,left:0,width:q(Le),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,R=Xe.flatMap((oe,fe)=>{if(!oe.marginLeftKey)return[];const Le=Me[oe.marginLeftKey]??0,Ge=Ad(Xe,ht,Me,fe)+Gt(),Qe=Math.max(Le,Un);return a.jsx("div",{"data-controls":oe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ht[fe]),style:{position:"absolute",top:0,left:q(Ge),width:q(Qe),height:"100%",pointerEvents:"auto"}},oe.marginLeftKey)});return Ye?[Ye,...R]:R},ir=()=>Xe.map((we,Ye)=>{const R=cn(Ye,ht),fe=Vt(Ye)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(R),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:q(fe),width:q(fn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),pa=()=>mt.flatMap((we,Ye)=>{if(!we.marginLeftKey)return[];const R=Me[we.marginLeftKey]??0,oe=Ht(Ye),fe=Math.max(R,Un),{resolvedWidth:Le}=Mt(we,"two-row-bottom");return a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le),style:{position:"absolute",top:0,left:q(oe),width:q(fe),height:"100%",pointerEvents:"auto"}},we.marginLeftKey)}),ma=()=>mt.map((we,Ye)=>{const{maxWidth:R}=Mt(we,"two-row-bottom"),fe=Dt(Ye)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(R),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:q(fe),width:q(fn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),$n=()=>!o||ne?null:a.jsxs(a.Fragment,{children:[nr(),ir()]}),Pi=we=>{const Ye=!we.objectFit&&Dn(w);return{className:`${e}-slide-image-cell${Ye?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:L,maxHeight:B,...Ye?{"--image-aspect-ratio":da(w)}:{}}}},or=we=>we.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":we.objectFit}}:Dn(w)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ui=we=>{if(we.length===0)return null;const Ye=we.length>1,R=Ra(ie),oe=`calc(-0.5 * (${R} + ${ie}))`;if(we.length===1){const fe=we[0];return a.jsx("div",{...Pi(fe),children:a.jsx("img",{...or(fe),src:fe.url,alt:fe.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ye?{gap:ie}:void 0,children:we.map((fe,Le)=>a.jsxs("div",{...Pi(fe),children:[a.jsx("img",{...or(fe),src:fe.url,alt:fe.name??"",draggable:!1}),o&&Ye&&Le<we.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:oe,width:R,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${fe.url}-${Le}`))})},rr=!!(V!=null&&V.title2||V!=null&&V.title3||vt!=null&&vt.title2||vt!=null&&vt.title3||(I??0)>0||o),ga=()=>a.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[a.jsx("div",{ref:tt,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ci(ce||V)}),a.jsxs("div",{ref:dt,className:`${e}-titles-row-two-row`,style:{...ge&&X?{minHeight:X}:void 0,...ge&&re?{width:re,maxWidth:"100%"}:void 0},children:[Ot(a.jsxs("div",{className:Ut,style:{position:ge?"absolute":"relative",inset:ge?0:void 0,width:"100%"},children:[vt&&ge?a.jsx("div",{className:`${Tt} ${e}-titles-fade-out`,children:nn(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(V)})]}),ge&&X?X:void 0),rr?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[vt&&ge?a.jsx("div",{className:`${Jt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(vt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ge?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ne?` ${e}-titles-layer-in-stacked`:""}`,children:un(V,!0)})]}):null]})]}),ha=()=>{const we=rr;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...we?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:we?void 0:{flex:"0 0 auto",height:"auto"},children:ci(V,!0)}),$n()]})};return a.jsxs("div",{ref:De,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Be||Te()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Ce?1:0,transition:"opacity 300ms ease",pointerEvents:Ce?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...Ve}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,..._e,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:rt,onClick:we=>we.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ve&&xe.length>1?"true":"false",onPointerDown:ve?St:void 0,onPointerUp:ve?Yt:void 0,onPointerCancel:ve?Zt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&de?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:we=>{we.target===we.currentTarget&&ee(Pe)},children:a.jsx("div",{className:`${e}-slide-area`,children:ui(wt.images)})},`slide-out-${Pe}`):null,a.jsx("div",{className:`${e}-slide-layer-in${de?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:E?ui(E.images):null})},`slide-in-${Pe}-${b}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ze,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ue,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ne?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${ne?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&a.jsx("div",{className:`${e}-text-bar-cell${ne?` ${e}-text-bar-cell-stacked`:""}`,style:ne?void 0:{flex:1,minWidth:0,width:"100%"},children:ne?C==="fade"?ga():ha():C==="fade"?it():Et()})})})]})]})]})};function xv(e){return`
15161
15161
  .${e}-wrapper {
15162
15162
  position: relative;
15163
15163
  width: 100%;
@@ -15679,7 +15679,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
15679
15679
  pointer-events: auto;
15680
15680
  z-index: 10;
15681
15681
  }
15682
- `}const vv=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=D.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:x}=e,w=s.useRef(null),[m,h]=s.useState(!1),[f,v]=s.useState(0),C=s.useRef(!1),y=s.useRef(!1),S=s.useRef(!1),G=s.useMemo(()=>(t??[]).filter($=>Ji($).length>0),[t]),W=m&&G.length>0,U=!n,H=s.useCallback(()=>{U&&(S.current=!0,Mf(y.current,c),y.current=!1)},[U,c]),I=($=0)=>{if(G.length===0||n&&!i&&!o)return;const T=Er(G,x),A=Math.max(0,Math.min($,T.length-1));if(v(A),U){const _=Md();Ed(A+1,c,_),y.current=!_}h(!0)},z=s.useCallback(()=>{h(!1),S.current=!1},[]);return s.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),s.useEffect(()=>{if(!U||C.current)return;C.current=!0;const $=Al(c);if(!$)return;const T=Fl($,Er(G,x).length);T<0||(v(T),h(!0))},[G,c,U,x]),s.useEffect(()=>{if(!U)return;const $=()=>{if(S.current){S.current=!1,h(!1);return}const T=Al(c);if(!T){h(!1);return}const A=Fl(T,Er(G,x).length);if(A<0){h(!1);return}y.current=!1,v(A),h(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[G,c,U,x]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:w,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:xv(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${Dn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>I(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Dn(p)?{"--image-aspect-ratio":da(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${Dn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),W&&typeof document<"u"&&(()=>{const $=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx(yv,{prefix:d,entries:G,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:U,journalItemId:c,onBeforeClose:H,onClose:z}),$)})()]})},bv=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
15682
+ `}const vv=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=O.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:x}=e,w=s.useRef(null),[m,h]=s.useState(!1),[f,v]=s.useState(0),C=s.useRef(!1),y=s.useRef(!1),S=s.useRef(!1),G=s.useMemo(()=>(t??[]).filter($=>Ji($).length>0),[t]),W=m&&G.length>0,U=!n,H=s.useCallback(()=>{U&&(S.current=!0,Mf(y.current,c),y.current=!1)},[U,c]),I=($=0)=>{if(G.length===0||n&&!i&&!o)return;const T=Er(G,x),k=Math.max(0,Math.min($,T.length-1));if(v(k),U){const _=Md();Ed(k+1,c,_),y.current=!_}h(!0)},z=s.useCallback(()=>{h(!1),S.current=!1},[]);return s.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),s.useEffect(()=>{if(!U||C.current)return;C.current=!0;const $=Al(c);if(!$)return;const T=Fl($,Er(G,x).length);T<0||(v(T),h(!0))},[G,c,U,x]),s.useEffect(()=>{if(!U)return;const $=()=>{if(S.current){S.current=!1,h(!1);return}const T=Al(c);if(!T){h(!1);return}const k=Fl(T,Er(G,x).length);if(k<0){h(!1);return}y.current=!1,v(k),h(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[G,c,U,x]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:w,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:xv(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${Dn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>I(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Dn(p)?{"--image-aspect-ratio":da(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${Dn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),W&&typeof document<"u"&&(()=>{const $=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx(yv,{prefix:d,entries:G,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:U,journalItemId:c,onBeforeClose:H,onClose:z}),$)})()]})},bv=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
15683
15683
  import { createPortal } from 'react-dom';
15684
15684
  import { CommonComponentProps } from '../props';
15685
15685
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -16470,7 +16470,7 @@ export type LightboxJournalSettings = {
16470
16470
  width: 32px;
16471
16471
  height: 32px;
16472
16472
  }
16473
- `}function Mv(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 kv(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Mv(i)]));return new Map(n)}function Av({settings:e,content:t=[],isEditor:n}){const{prefix:i}=D.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[x,w]=s.useState({x:0,y:0}),[m,h]=s.useState("none"),f=s.useRef({x:0,y:0}),[v,C]=s.useState(!1),[y,S]=s.useState(!1),G=s.useRef(new Map),{imageSize:W=Lv,cursor:U="system",target:H="area",position:I="random",visible:z="all",defaultCursor:$=null,hoverCursor:T=null}=e,A=t.filter(L=>{var O;return!!((O=L==null?void 0:L.image)!=null&&O.url)}),_=s.useMemo(()=>Ev(i),[i]),g=s.useCallback((L,O,K=l)=>{if(!o)return;const ue=o.getBoundingClientRect(),le=L-ue.left,F=O-ue.top;w({x:le,y:F}),h(Pv(le,F,K,o,U,H,T,$))},[o,l,U,H,T,$]);s.useEffect(()=>{const L=[...A.map(K=>K.image.url),$,T].filter(K=>!!K);if(L.length===0){G.current=new Map,S(!0);return}let O=!1;return S(!1),kv(L).then(K=>{O||(G.current=K,S(!0))}),()=>{O=!0}},[t,$,T]),s.useEffect(()=>{if(!o)return;const L=K=>{K.stopPropagation(),f.current={x:K.clientX,y:K.clientY},g(K.clientX,K.clientY)},O=()=>{v&&g(f.current.x,f.current.y)};return o.addEventListener("mousemove",L),window.addEventListener("scroll",O,!0),()=>{o.removeEventListener("mousemove",L),window.removeEventListener("scroll",O,!0)}},[o,v,g]),s.useEffect(()=>{!o||!v||g(f.current.x,f.current.y)},[l,o,v,g]),s.useEffect(()=>{v||h("none")},[v]);const B=(L,O,K,ue={})=>{var ne,ve;if(!((ne=L==null?void 0:L.image)!=null&&ne.url))return null;const le=((ve=G.current.get(L.image.url))==null?void 0:ve.aspectRatio)??1,F=lc(L.image.url,W,G.current),{heightPx:pe}=jr(F,le);let j=0,se=0;return I==="same"?{x:j,y:se}=sc(O,K,F,le):(j=ue.x??Math.random()*O,se=ue.y??Math.random()*K,{x:j,y:se}=cs(j,se,O,K,F,pe)),{id:p.current++,url:L.image.url,link:L.link,name:L.image.name,x:j,y:se,xRatio:j/O,yRatio:se/K,aspectRatio:le,widthPx:F}},P=()=>{if(!o)return;const L=o.getBoundingClientRect(),O=L.width,K=L.height;O===0||K===0||d(ue=>ue.length===0?ue:ue.map(le=>{const F=W.sizeType==="random"?le.widthPx:lc(le.url,W,G.current),{heightPx:pe}=jr(F,le.aspectRatio);if(I==="same"){const{x:ne,y:ve}=sc(O,K,F,le.aspectRatio);return{...le,x:ne,y:ve,widthPx:F}}const{x:j,y:se}=cs(le.xRatio*O,le.yRatio*K,O,K,F,pe);return{...le,x:j,y:se,widthPx:F}}))};s.useEffect(()=>{if(!o||A.length===0||!y)return;const L=o.getBoundingClientRect(),O=L.width,K=L.height,ue=B(A[0],O,K);ue&&(d([ue]),u(A.length>1?1:0))},[W,I,o,t,y]),s.useEffect(()=>{if(!o)return;P();const L=new ResizeObserver(P);return L.observe(o),window.addEventListener("resize",P),()=>{L.disconnect(),window.removeEventListener("resize",P)}},[o,I,W,l.length]),s.useEffect(()=>{z==="last One"&&d(L=>L.length>0?[L[L.length-1]]:[])},[z]);const Y=L=>{if(!o||A.length===0||!y)return;const O=o.getBoundingClientRect(),K=L.clientX-O.left,ue=L.clientY-O.top;if(H==="image"&&!Zd(K,ue,l))return;let le=0,F=0;I==="on Click"?(le=K,F=ue):I==="same"?(le=O.width/2,F=O.height/2):(le=Math.random()*O.width,F=Math.random()*O.height);const pe=A[c%A.length],j=B(pe,O.width,O.height,{x:le,y:F});if(!j)return;const se=z==="all"?[...l,j]:[j];d(se),u(ne=>(ne+1)%A.length),g(L.clientX,L.clientY,se)},ie=U==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_}}),a.jsxs("div",{ref:r,onClick:Y,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:`${i}-root`,style:{cursor:ie?"none":"default"},children:[l.map(L=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${L.y}px`,left:`${L.x}px`,width:`${L.widthPx}px`,cursor:ie?"none":"default"},children:H==="area"&&L.link?a.jsx("a",{href:L.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:L.url,alt:L.name,className:`${i}-image`})}):a.jsx("img",{src:L.url,alt:L.name,className:`${i}-image`})},L.id)),v&&ie&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${x.x}px`,top:`${x.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Fv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16473
+ `}function Mv(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 kv(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Mv(i)]));return new Map(n)}function Av({settings:e,content:t=[],isEditor:n}){const{prefix:i}=O.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[x,w]=s.useState({x:0,y:0}),[m,h]=s.useState("none"),f=s.useRef({x:0,y:0}),[v,C]=s.useState(!1),[y,S]=s.useState(!1),G=s.useRef(new Map),{imageSize:W=Lv,cursor:U="system",target:H="area",position:I="random",visible:z="all",defaultCursor:$=null,hoverCursor:T=null}=e,k=t.filter(L=>{var B;return!!((B=L==null?void 0:L.image)!=null&&B.url)}),_=s.useMemo(()=>Ev(i),[i]),g=s.useCallback((L,B,K=l)=>{if(!o)return;const ue=o.getBoundingClientRect(),le=L-ue.left,F=B-ue.top;w({x:le,y:F}),h(Pv(le,F,K,o,U,H,T,$))},[o,l,U,H,T,$]);s.useEffect(()=>{const L=[...k.map(K=>K.image.url),$,T].filter(K=>!!K);if(L.length===0){G.current=new Map,S(!0);return}let B=!1;return S(!1),kv(L).then(K=>{B||(G.current=K,S(!0))}),()=>{B=!0}},[t,$,T]),s.useEffect(()=>{if(!o)return;const L=K=>{K.stopPropagation(),f.current={x:K.clientX,y:K.clientY},g(K.clientX,K.clientY)},B=()=>{v&&g(f.current.x,f.current.y)};return o.addEventListener("mousemove",L),window.addEventListener("scroll",B,!0),()=>{o.removeEventListener("mousemove",L),window.removeEventListener("scroll",B,!0)}},[o,v,g]),s.useEffect(()=>{!o||!v||g(f.current.x,f.current.y)},[l,o,v,g]),s.useEffect(()=>{v||h("none")},[v]);const D=(L,B,K,ue={})=>{var ne,ve;if(!((ne=L==null?void 0:L.image)!=null&&ne.url))return null;const le=((ve=G.current.get(L.image.url))==null?void 0:ve.aspectRatio)??1,F=lc(L.image.url,W,G.current),{heightPx:pe}=jr(F,le);let j=0,se=0;return I==="same"?{x:j,y:se}=sc(B,K,F,le):(j=ue.x??Math.random()*B,se=ue.y??Math.random()*K,{x:j,y:se}=cs(j,se,B,K,F,pe)),{id:p.current++,url:L.image.url,link:L.link,name:L.image.name,x:j,y:se,xRatio:j/B,yRatio:se/K,aspectRatio:le,widthPx:F}},P=()=>{if(!o)return;const L=o.getBoundingClientRect(),B=L.width,K=L.height;B===0||K===0||d(ue=>ue.length===0?ue:ue.map(le=>{const F=W.sizeType==="random"?le.widthPx:lc(le.url,W,G.current),{heightPx:pe}=jr(F,le.aspectRatio);if(I==="same"){const{x:ne,y:ve}=sc(B,K,F,le.aspectRatio);return{...le,x:ne,y:ve,widthPx:F}}const{x:j,y:se}=cs(le.xRatio*B,le.yRatio*K,B,K,F,pe);return{...le,x:j,y:se,widthPx:F}}))};s.useEffect(()=>{if(!o||k.length===0||!y)return;const L=o.getBoundingClientRect(),B=L.width,K=L.height,ue=D(k[0],B,K);ue&&(d([ue]),u(k.length>1?1:0))},[W,I,o,t,y]),s.useEffect(()=>{if(!o)return;P();const L=new ResizeObserver(P);return L.observe(o),window.addEventListener("resize",P),()=>{L.disconnect(),window.removeEventListener("resize",P)}},[o,I,W,l.length]),s.useEffect(()=>{z==="last One"&&d(L=>L.length>0?[L[L.length-1]]:[])},[z]);const q=L=>{if(!o||k.length===0||!y)return;const B=o.getBoundingClientRect(),K=L.clientX-B.left,ue=L.clientY-B.top;if(H==="image"&&!Zd(K,ue,l))return;let le=0,F=0;I==="on Click"?(le=K,F=ue):I==="same"?(le=B.width/2,F=B.height/2):(le=Math.random()*B.width,F=Math.random()*B.height);const pe=k[c%k.length],j=D(pe,B.width,B.height,{x:le,y:F});if(!j)return;const se=z==="all"?[...l,j]:[j];d(se),u(ne=>(ne+1)%k.length),g(L.clientX,L.clientY,se)},ie=U==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_}}),a.jsxs("div",{ref:r,onClick:q,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:`${i}-root`,style:{cursor:ie?"none":"default"},children:[l.map(L=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${L.y}px`,left:`${L.x}px`,width:`${L.widthPx}px`,cursor:ie?"none":"default"},children:H==="area"&&L.link?a.jsx("a",{href:L.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:L.url,alt:L.name,className:`${i}-image`})}):a.jsx("img",{src:L.url,alt:L.name,className:`${i}-image`})},L.id)),v&&ie&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${x.x}px`,top:`${x.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Fv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16474
16474
  import { CommonComponentProps } from '../props';
16475
16475
  import { useScopedStyles } from '../utils/index';
16476
16476
 
@@ -17110,7 +17110,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
17110
17110
  display: block;
17111
17111
  pointer-events: none;
17112
17112
  }
17113
- `}function Ov(e){return e==="blur"?Hv:e==="greyscale"?Wv:0}function xo(e,t=1,n=1){const i=Ov(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 cc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Bv(e,t){return t<=1?0:(e-1+t)%t}function zv(e,t=1){return!e||e.height===0?t:e.width/e.height}function jv(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const r=e*i/100,l=t*o/100;let d=r,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function dc(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 Jd(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function uc(e,t,n){return{...Jd(e),[`--${n}-stage-scale`]:t}}function Vv(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 Gv({settings:e,content:t,isEditor:n,isPreviewMode:i}){var ye,Z,Q,ce,we,Pe,Ce;const{prefix:o}=D.useScopedStyles(),r=s.useMemo(()=>Dv(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,x=t??[],w=cc(x.length),[m,h]=s.useState(w.activeIndex),[f,v]=s.useState(w.backgroundIndex),[C,y]=s.useState(!1),[S,G]=s.useState(!1),[W,U]=s.useState(null),[H,I]=s.useState(null),[z,$]=s.useState(0),[T,A]=s.useState(1),[_,g]=s.useState("none"),[B,P]=s.useState("next"),[Y,ie]=s.useState({}),[L,O]=s.useState({width:0,height:0}),K=s.useRef(null),ue=s.useRef(null),le=!n||!!i,F=l??60,pe=Math.max(10,Math.min(100,d??F)),j=Math.max(10,Math.min(100,c??F)),se=Math.max(100,u),ne=xo(p),ve=s.useCallback(X=>{const me=zv(X?Y[X]:void 0);return jv(L.width,L.height,me,pe,j)},[L.height,L.width,Y,j,pe]);s.useEffect(()=>{const X=ue.current;if(!X)return;const me=new ResizeObserver(([ae])=>{const{width:q,height:de}=ae.contentRect;O({width:q,height:de})});return me.observe(X),()=>me.disconnect()},[]),s.useEffect(()=>{const X=(t??[]).map(me=>{var ae;return(ae=me.image)==null?void 0:ae.url}).filter(me=>!!me);Vv(X,(me,ae)=>{ie(q=>{var de,ke;return((de=q[me])==null?void 0:de.width)===ae.width&&((ke=q[me])==null?void 0:ke.height)===ae.height?q:{...q,[me]:ae}})})},[t]),s.useEffect(()=>{const{backgroundIndex:X,activeIndex:me}=cc(x.length);h(me),v(X),y(!1),G(!1),U(null),I(null),$(0),A(1),g("none"),P("next")},[x.length,t]),s.useEffect(()=>()=>{K.current&&clearTimeout(K.current)},[]);const Me=s.useCallback(X=>{var he,J,Ne,Fe;if(!le||C||x.length<=1)return;const me=X==="next"?(m+1)%x.length:(m-1+x.length)%x.length,ae=ve((J=(he=x[m])==null?void 0:he.image)==null?void 0:J.url),q=ve((Fe=(Ne=x[me])==null?void 0:Ne.image)==null?void 0:Fe.url),de=dc(L.width,L.height,ae),ke=dc(L.width,L.height,q);K.current&&clearTimeout(K.current),P(X),G(!0),y(!0),X==="next"?(U(m),I(me),$(0),A(1),g(xo(p,0,1))):(v(Bv(me,x.length)),U(me),I(m),$(1),A(ke),g(xo(p,1,ke))),requestAnimationFrame(()=>{G(!1),requestAnimationFrame(()=>{X==="next"?($(1),A(de),g(xo(p,1,de))):($(0),A(1),g(xo(p,0,1)))})}),K.current=setTimeout(()=>{X==="next"&&v(m),h(me),U(null),I(null),y(!1)},se)},[m,p,L.height,L.width,ve,C,le,x,se]),xe=x[m],b=f!==null?x[f]:null,M=W!==null?x[W]:null,E=H!==null?x[H]:null,V=x.length<=1?0:(m-1+x.length)%x.length,Se=x.length<=1?0:(m+1)%x.length,te=ve((ye=xe==null?void 0:xe.image)==null?void 0:ye.url),$e=ve((Z=M==null?void 0:M.image)==null?void 0:Z.url),re=ve((Q=E==null?void 0:E.image)==null?void 0:Q.url),ge={[`--${o}-transition-ms`]:`${se}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:ue,className:pt(`${o}-wrapper`,S&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ge,"aria-label":"Zoom gallery",children:[((ce=b==null?void 0:b.image)==null?void 0:ce.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:b.image.url,alt:"",style:{filter:ne}})}),C&&((we=M==null?void 0:M.image)==null?void 0:we.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${B}`),style:uc($e,T,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:M.image.url,alt:"",style:{filter:_}})}),C&&((Pe=E==null?void 0:E.image)==null?void 0:Pe.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${B}`),style:uc(re,z,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:E.image.url,alt:""})}),!C&&((Ce=xe==null?void 0:xe.image)==null?void 0:Ce.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-foreground`),style:Jd(te),children:a.jsx("img",{className:`${o}-image`,src:xe.image.url,alt:xe.image.name??""})}),le&&x.length>1&&!C&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Me("prev"),"aria-label":`Show previous image (${V+1} of ${x.length})`}),a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Me("next"),"aria-label":`Show next image (${Se+1} of ${x.length})`})]})]})]})}const Xv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17113
+ `}function Ov(e){return e==="blur"?Hv:e==="greyscale"?Wv:0}function xo(e,t=1,n=1){const i=Ov(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 cc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Bv(e,t){return t<=1?0:(e-1+t)%t}function zv(e,t=1){return!e||e.height===0?t:e.width/e.height}function jv(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const r=e*i/100,l=t*o/100;let d=r,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function dc(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 Jd(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function uc(e,t,n){return{...Jd(e),[`--${n}-stage-scale`]:t}}function Vv(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 Gv({settings:e,content:t,isEditor:n,isPreviewMode:i}){var ye,Z,J,de,be,Pe,Se;const{prefix:o}=O.useScopedStyles(),r=s.useMemo(()=>Dv(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,x=t??[],w=cc(x.length),[m,h]=s.useState(w.activeIndex),[f,v]=s.useState(w.backgroundIndex),[C,y]=s.useState(!1),[S,G]=s.useState(!1),[W,U]=s.useState(null),[H,I]=s.useState(null),[z,$]=s.useState(0),[T,k]=s.useState(1),[_,g]=s.useState("none"),[D,P]=s.useState("next"),[q,ie]=s.useState({}),[L,B]=s.useState({width:0,height:0}),K=s.useRef(null),ue=s.useRef(null),le=!n||!!i,F=l??60,pe=Math.max(10,Math.min(100,d??F)),j=Math.max(10,Math.min(100,c??F)),se=Math.max(100,u),ne=xo(p),ve=s.useCallback(X=>{const me=zv(X?q[X]:void 0);return jv(L.width,L.height,me,pe,j)},[L.height,L.width,q,j,pe]);s.useEffect(()=>{const X=ue.current;if(!X)return;const me=new ResizeObserver(([re])=>{const{width:Y,height:ce}=re.contentRect;B({width:Y,height:ce})});return me.observe(X),()=>me.disconnect()},[]),s.useEffect(()=>{const X=(t??[]).map(me=>{var re;return(re=me.image)==null?void 0:re.url}).filter(me=>!!me);Vv(X,(me,re)=>{ie(Y=>{var ce,Ee;return((ce=Y[me])==null?void 0:ce.width)===re.width&&((Ee=Y[me])==null?void 0:Ee.height)===re.height?Y:{...Y,[me]:re}})})},[t]),s.useEffect(()=>{const{backgroundIndex:X,activeIndex:me}=cc(x.length);h(me),v(X),y(!1),G(!1),U(null),I(null),$(0),k(1),g("none"),P("next")},[x.length,t]),s.useEffect(()=>()=>{K.current&&clearTimeout(K.current)},[]);const ke=s.useCallback(X=>{var he,Q,Ne,Fe;if(!le||C||x.length<=1)return;const me=X==="next"?(m+1)%x.length:(m-1+x.length)%x.length,re=ve((Q=(he=x[m])==null?void 0:he.image)==null?void 0:Q.url),Y=ve((Fe=(Ne=x[me])==null?void 0:Ne.image)==null?void 0:Fe.url),ce=dc(L.width,L.height,re),Ee=dc(L.width,L.height,Y);K.current&&clearTimeout(K.current),P(X),G(!0),y(!0),X==="next"?(U(m),I(me),$(0),k(1),g(xo(p,0,1))):(v(Bv(me,x.length)),U(me),I(m),$(1),k(Ee),g(xo(p,1,Ee))),requestAnimationFrame(()=>{G(!1),requestAnimationFrame(()=>{X==="next"?($(1),k(ce),g(xo(p,1,ce))):($(0),k(1),g(xo(p,0,1)))})}),K.current=setTimeout(()=>{X==="next"&&v(m),h(me),U(null),I(null),y(!1)},se)},[m,p,L.height,L.width,ve,C,le,x,se]),xe=x[m],b=f!==null?x[f]:null,M=W!==null?x[W]:null,E=H!==null?x[H]:null,V=x.length<=1?0:(m-1+x.length)%x.length,Ce=x.length<=1?0:(m+1)%x.length,te=ve((ye=xe==null?void 0:xe.image)==null?void 0:ye.url),$e=ve((Z=M==null?void 0:M.image)==null?void 0:Z.url),ae=ve((J=E==null?void 0:E.image)==null?void 0:J.url),ge={[`--${o}-transition-ms`]:`${se}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:ue,className:pt(`${o}-wrapper`,S&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ge,"aria-label":"Zoom gallery",children:[((de=b==null?void 0:b.image)==null?void 0:de.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:b.image.url,alt:"",style:{filter:ne}})}),C&&((be=M==null?void 0:M.image)==null?void 0:be.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${D}`),style:uc($e,T,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:M.image.url,alt:"",style:{filter:_}})}),C&&((Pe=E==null?void 0:E.image)==null?void 0:Pe.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${D}`),style:uc(ae,z,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:E.image.url,alt:""})}),!C&&((Se=xe==null?void 0:xe.image)==null?void 0:Se.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-foreground`),style:Jd(te),children:a.jsx("img",{className:`${o}-image`,src:xe.image.url,alt:xe.image.name??""})}),le&&x.length>1&&!C&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>ke("prev"),"aria-label":`Show previous image (${V+1} of ${x.length})`}),a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-next`),onClick:()=>ke("next"),"aria-label":`Show next image (${Ce+1} of ${x.length})`})]})]})]})}const Xv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17114
17114
  import cn from 'classnames';
17115
17115
  import { CommonComponentProps } from '../props';
17116
17116
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -17869,7 +17869,7 @@ a:active .${e}-button .${e}-icon-image,
17869
17869
  height: calc(1em * var(--${e}-icon-scale, 1));
17870
17870
  width: calc(1em * var(--${e}-icon-scale, 1));
17871
17871
  }
17872
- `}function Oa(e,t,n="",i,o){const r=t();return a.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[a.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:r}),a.jsxs("span",{className:`${e}-content-roll-viewport`,children:[a.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),a.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function pc(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(sn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return a.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const d=D.scalingValue(o,r);return a.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return a.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function e0({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=D.useScopedStyles(),l=s.useMemo(()=>Qv(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:x,order:w="text-icon",gap:m=0,iconSize:h=0,iconWidthC:f=0,dimensions:v=!1,padding:C={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:S={top:0,left:0,right:0,bottom:0},boxShadowColor:G="rgba(0, 0, 0, 0)",innerBoxShadow:W={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:U="rgba(0, 0, 0, 0)",stroke:H=0,backgroundColor:I="#000000",textColor:z="#ffffff",borderColor:$="#ffffff",iconColor:T="#ffffff",hoverEffect:A="none",fontFamily:_,fontSettings:g,fontSize:B,lineHeight:P,letterSpacing:Y=0,wordSpacing:ie=0,textAppearance:L,stateOverrides:O,minWidth:K=0,minHeight:ue=0,width:le=0,height:F=0}=e,pe=D.buildColorVars(r,{backgroundColor:I,textColor:z,borderColor:$,iconColor:T,boxShadowColor:G,innerBoxShadowColor:U},Uv,Kv,O),j=i&&i!=="default"?`${r}-state-${i}`:"",se=t&&!n?`${r}-editing`:"",ne=A!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${A}`:"",ve=A==="reveal"||A==="swipe",Me=A==="content-roll",xe=A==="reveal"&&(!t||n),b=v===!0,E=d==="a"?x??p:p,V=d==="c",Se=d!=="b",te={fontSettings:{fontFamily:_,fontWeight:(g==null?void 0:g.fontWeight)??400,fontStyle:(g==null?void 0:g.fontStyle)??"normal"},fontSize:B??.01,lineHeight:P,letterSpacing:Y,wordSpacing:ie,textAppearance:L,color:z},re={...Se?an(qt(te,t)):{},[`--${r}-box-shadow-x`]:D.scalingValue(S.left,t),[`--${r}-box-shadow-y`]:D.scalingValue(S.top,t),[`--${r}-box-shadow-blur`]:D.scalingValue(S.right,t),[`--${r}-box-shadow-spread`]:D.scalingValue(S.bottom,t),[`--${r}-inner-box-shadow-x`]:D.scalingValue(W.left,t),[`--${r}-inner-box-shadow-y`]:D.scalingValue(W.top,t),[`--${r}-inner-box-shadow-blur`]:D.scalingValue(W.right,t),[`--${r}-inner-box-shadow-spread`]:D.scalingValue(W.bottom,t),paddingTop:D.scalingValue(C.top,t),paddingRight:D.scalingValue(C.right,t),paddingBottom:D.scalingValue(C.bottom,t),paddingLeft:D.scalingValue(C.left,t),borderRadius:D.scalingValue(y,t),borderWidth:D.scalingValue(H,t),...V?{}:{justifyContent:Da[E],textAlign:E},...V&&!Me?{gap:D.scalingValue(m,t)}:{},...b?{width:D.scalingValue(le,t),height:D.scalingValue(F,t)}:{minWidth:D.scalingValue(K,t),minHeight:D.scalingValue(ue,t),...V?{width:"100%"}:{}}};let ge;const ye={display:"inline-flex",alignItems:"center",justifyContent:V?Da[E]:Da[d==="a"?E:"center"],gap:V?D.scalingValue(m,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:E}:{}};if(d==="b"){const ce=()=>pc(r,u,h>0?"fixed":"fill",100,h,t);ge=Me?Oa(r,ce,`${r}-icon-roll`,void 0,ye):ce()}else if(d==="c"){const ce=()=>{const we=a.jsx("span",{className:`${r}-text`,style:{textAlign:E},children:c}),Pe=pc(r,u,f>0?"fixed":"fill",100,f,t);return w==="icon-text"?a.jsxs(a.Fragment,{children:[Pe,we]}):a.jsxs(a.Fragment,{children:[we,Pe]})};ge=Me?Oa(r,ce,`${r}-icon-text-roll`,void 0,ye):ce()}else ge=Me?Oa(r,()=>c,`${r}-label-roll`,void 0,ye):ve?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const Z=xe?ce=>Zv(ce,r):void 0,Q=xe?ce=>Jv(ce,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:pe,children:a.jsx("div",{className:`${r}-wrapper ${j} ${se}`.trim(),children:a.jsx("div",{className:`${r}-button ${ne}`.trim(),style:re,onMouseEnter:Z,onMouseLeave:Q,role:"button",tabIndex:o||t&&!n?void 0:0,children:ge})})})]})}const t0=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
17872
+ `}function Oa(e,t,n="",i,o){const r=t();return a.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[a.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:r}),a.jsxs("span",{className:`${e}-content-roll-viewport`,children:[a.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),a.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function pc(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(sn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return a.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const d=O.scalingValue(o,r);return a.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return a.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function e0({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=O.useScopedStyles(),l=s.useMemo(()=>Qv(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:x,order:w="text-icon",gap:m=0,iconSize:h=0,iconWidthC:f=0,dimensions:v=!1,padding:C={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:S={top:0,left:0,right:0,bottom:0},boxShadowColor:G="rgba(0, 0, 0, 0)",innerBoxShadow:W={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:U="rgba(0, 0, 0, 0)",stroke:H=0,backgroundColor:I="#000000",textColor:z="#ffffff",borderColor:$="#ffffff",iconColor:T="#ffffff",hoverEffect:k="none",fontFamily:_,fontSettings:g,fontSize:D,lineHeight:P,letterSpacing:q=0,wordSpacing:ie=0,textAppearance:L,stateOverrides:B,minWidth:K=0,minHeight:ue=0,width:le=0,height:F=0}=e,pe=O.buildColorVars(r,{backgroundColor:I,textColor:z,borderColor:$,iconColor:T,boxShadowColor:G,innerBoxShadowColor:U},Uv,Kv,B),j=i&&i!=="default"?`${r}-state-${i}`:"",se=t&&!n?`${r}-editing`:"",ne=k!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${k}`:"",ve=k==="reveal"||k==="swipe",ke=k==="content-roll",xe=k==="reveal"&&(!t||n),b=v===!0,E=d==="a"?x??p:p,V=d==="c",Ce=d!=="b",te={fontSettings:{fontFamily:_,fontWeight:(g==null?void 0:g.fontWeight)??400,fontStyle:(g==null?void 0:g.fontStyle)??"normal"},fontSize:D??.01,lineHeight:P,letterSpacing:q,wordSpacing:ie,textAppearance:L,color:z},ae={...Ce?an(qt(te,t)):{},[`--${r}-box-shadow-x`]:O.scalingValue(S.left,t),[`--${r}-box-shadow-y`]:O.scalingValue(S.top,t),[`--${r}-box-shadow-blur`]:O.scalingValue(S.right,t),[`--${r}-box-shadow-spread`]:O.scalingValue(S.bottom,t),[`--${r}-inner-box-shadow-x`]:O.scalingValue(W.left,t),[`--${r}-inner-box-shadow-y`]:O.scalingValue(W.top,t),[`--${r}-inner-box-shadow-blur`]:O.scalingValue(W.right,t),[`--${r}-inner-box-shadow-spread`]:O.scalingValue(W.bottom,t),paddingTop:O.scalingValue(C.top,t),paddingRight:O.scalingValue(C.right,t),paddingBottom:O.scalingValue(C.bottom,t),paddingLeft:O.scalingValue(C.left,t),borderRadius:O.scalingValue(y,t),borderWidth:O.scalingValue(H,t),...V?{}:{justifyContent:Da[E],textAlign:E},...V&&!ke?{gap:O.scalingValue(m,t)}:{},...b?{width:O.scalingValue(le,t),height:O.scalingValue(F,t)}:{minWidth:O.scalingValue(K,t),minHeight:O.scalingValue(ue,t),...V?{width:"100%"}:{}}};let ge;const ye={display:"inline-flex",alignItems:"center",justifyContent:V?Da[E]:Da[d==="a"?E:"center"],gap:V?O.scalingValue(m,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:E}:{}};if(d==="b"){const de=()=>pc(r,u,h>0?"fixed":"fill",100,h,t);ge=ke?Oa(r,de,`${r}-icon-roll`,void 0,ye):de()}else if(d==="c"){const de=()=>{const be=a.jsx("span",{className:`${r}-text`,style:{textAlign:E},children:c}),Pe=pc(r,u,f>0?"fixed":"fill",100,f,t);return w==="icon-text"?a.jsxs(a.Fragment,{children:[Pe,be]}):a.jsxs(a.Fragment,{children:[be,Pe]})};ge=ke?Oa(r,de,`${r}-icon-text-roll`,void 0,ye):de()}else ge=ke?Oa(r,()=>c,`${r}-label-roll`,void 0,ye):ve?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const Z=xe?de=>Zv(de,r):void 0,J=xe?de=>Jv(de,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:pe,children:a.jsx("div",{className:`${r}-wrapper ${j} ${se}`.trim(),children:a.jsx("div",{className:`${r}-button ${ne}`.trim(),style:ae,onMouseEnter:Z,onMouseLeave:J,role:"button",tabIndex:o||t&&!n?void 0:0,children:ge})})})]})}const t0=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
17873
17873
  import { SvgImage } from '../helpers/SvgImage/SvgImage';
17874
17874
  import { CommonComponentProps } from '../props';
17875
17875
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
@@ -18694,7 +18694,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
18694
18694
  pointer-events: auto;
18695
18695
  flex-shrink: 0;
18696
18696
  }
18697
- `}const In=500,vo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",s0=72,l0=50,c0=1e4,d0=650,u0=500;function p0(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function Qd(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 m0(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Qd(i,n):null}function g0(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 To(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 mc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return To(e,i,n)}const h0=.03;function eu(e){return e.width*h0}const Ba={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function vr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function gc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function f0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ds(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function y0(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ds(e,t.width,t.height)}function x0(e,t){if(ua(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 v0(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 b0({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>ua(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function ao(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=eu(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function Vr(e,t,n){const i=ao(e,t,n);return{...i,left:2*i.left-e.left}}function w0(e,t,n){const{left:i,width:o}=n,r=eu(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function tu(e,t,n,i){const o=ao(e,"left",i),r=ao(e,"right",i),l=Vr(e,"left",i),d=Vr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function S0(e,t,n,i){const{start:o,end:r}=tu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function C0(e,t,n){const i=ao(e,t,n),o=Vr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function ua(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function $0({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function br({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ua(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function T0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:v}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),G=s.useRef(new Map),[W,U]=s.useState(0),H=s.useRef(null),I=s.useRef(0),z=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),A=s.useRef(!1),_=s.useRef(!1),g=s.useRef(null),B=s.useRef(null),P=s.useRef(null),Y=s.useRef(()=>{}),ie=s.useRef(null),L=s.useRef(null),O=s.useRef(null),K=s.useRef(!1),[ue,le]=s.useState(null),[F,pe]=s.useState(Ba),[j,se]=s.useState(0),[ne,ve]=s.useState("opening"),[Me,xe]=s.useState(0),[b,M]=s.useState(0),[E,V]=s.useState(!1),[Se,te]=s.useState(null),[$e,re]=s.useState(null),[ge,ye]=s.useState(null),[Z,Q]=s.useState(!1),[ce,we]=s.useState(null),[Pe,Ce]=s.useState(!1),X=s.useRef(!1),[me,ae]=s.useState(!1),[q,de]=s.useState(!1),ke=s.useRef(n),he=s.useRef(void 0),J=t[n],Ne=J?ua(J):!1,Fe=b!==0||E,et=!l&&(!r||!!d),Je=c&&!l,dt=u.length>1,tt=s.useCallback((N,Re)=>t.length<=1?null:t[(N+Re+t.length)%t.length]??null,[t]),De=dt?To(u,p,-1):tt(n,-1),Ie=dt?To(u,p,1):tt(n,1),We=Se===-1&&Fe?dt&&$e!==null?To(u,$e,-1):ge!==null?tt(ge,-1):null:null,je=Se===1&&Fe?dt&&$e!==null?To(u,$e,1):ge!==null?tt(ge,1):null:null,Ue=We&&We.url!==(De==null?void 0:De.url)?We:null,k=je&&je.url!==(Ie==null?void 0:Ie.url)?je:null,ee=De&&Je?(()=>{const N=dt?mc(u,p,-1):t.length>2?tt((n-1+t.length)%t.length,-1):null;return N&&N.url!==De.url?N:null})():null,Te=Ie&&Je?(()=>{const N=dt?mc(u,p,1):t.length>2?tt((n+1)%t.length,1):null;return N&&N.url!==Ie.url?N:null})():null,He=Ue??ee,Be=k??Te,Ve=s.useCallback((N,Re,Ae)=>{if(!N||!Re||!Ae)return;const ze=G.current,ct=ze.get(N);(ct==null?void 0:ct.width)===Re&&(ct==null?void 0:ct.height)===Ae||(ze.set(N,{width:Re,height:Ae}),U(Et=>Et+1))},[]),rt=s.useCallback(N=>{if(!(N!=null&&N.url))return null;const Re=G.current.get(N.url);return y0(y.current,Re)},[W,j]),Ze=s.useCallback(()=>{if(!J)return;const N=rt(J);if(N){le(N);return}const Re=y.current;Re&&le(gc(Re))},[J,rt]),_e=s.useCallback(N=>{if(dt){const Re=u.length;re((p+N+Re)%Re),ye(null);return}t.length>1&&(ye((n+N+t.length)%t.length),re(null))},[dt,u.length,p,t.length,n]),qe=s.useCallback(N=>{_.current=N,V(N)},[]),Oe=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),nt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{Oe(),qe(!1)},vo+32)},[Oe,qe]),at=s.useCallback(()=>{const N=C.current;if(!N){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ba.width,height:typeof window<"u"?window.innerHeight:Ba.height});return}const Re=N.getBoundingClientRect();pe({left:Re.left,top:Re.top,width:Re.width,height:Re.height})},[]),st=s.useCallback((N,Re)=>{if(Fe){if(me&&!E)return`translate(${b}px, 0px)`;if(E&&Se!==null){const Ae=rt(N);if(!Ae)return;const{x:ze,y:ct}=S0(Ae,Re,Se,F);return`translate(${ze}px, ${ct}px)`}if(E)return"translate(0px, 0px)"}},[Fe,me,E,b,Se,F,rt]),St=s.useCallback(()=>{const N=B.current;B.current=null,Oe(),qe(!1),te(null),re(null),ye(null),M(0),ae(!1),T.current=!1,z.current=0,$.current="none",N===-1?f():N===1&&v()},[Oe,qe,f,v]),Yt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{B.current!==null&&St()},vo+32)},[Oe,St]),Zt=s.useCallback(()=>{Oe(),B.current=null,qe(!1),te(null),re(null),ye(null),M(0),ae(!1),T.current=!1,z.current=0,$.current="none"},[Oe,qe]),vt=s.useCallback(N=>{if(!(!Je||!ue)){if(_.current){if(B.current===N){P.current=N,St();return}Zt()}Oe(),_e(N),B.current=N,te(N),qe(!0),Yt()}},[Je,ue,St,Zt,Oe,_e,qe,Yt]);Y.current=vt;const wt=s.useCallback(()=>{ie.current=null,K.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),O.current!==null&&(window.clearTimeout(O.current),O.current=null)},[]),Bt=s.useCallback(N=>{L.current!==null&&window.clearInterval(L.current);const Re=K.current?u0:d0;L.current=window.setInterval(()=>{Y.current(N)},Re)},[]),At=s.useCallback(N=>{ie.current!==N&&(wt(),ie.current=N,K.current=!1,Y.current(N),Bt(N),O.current=window.setTimeout(()=>{O.current=null,ie.current===N&&(K.current=!0,Bt(N))},c0))},[wt,Bt]),xt=s.useCallback(()=>{const N=y.current;if(!N)return;const Re=J==null?void 0:J.url,Ae=Re?G.current.get(Re):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){le(ds(N,Ae.width,Ae.height));return}const ze=S.current;if(ze&&Re&&(ze.src===Re||ze.currentSrc===Re)){const{width:Et,height:it}=f0(ze);if(Et&&it){Ve(Re,Et,it),le(ds(N,Et,it));return}}const ct=gc(N);!ct.width||!ct.height||le(ct)},[J==null?void 0:J.url,Ve]),Ft=s.useCallback(N=>{if(S.current=N,!!N){if(N instanceof HTMLVideoElement){N.readyState>=1&&N.videoWidth>0&&xt();return}N.complete&&N.naturalWidth>0&&xt()}},[xt]),Nt=s.useCallback(()=>{at(),xt(),se(N=>N+1)},[at,xt]);s.useEffect(()=>{Nt();const N=y.current,Re=C.current,Ae=new ResizeObserver(()=>Nt());return N&&Ae.observe(N),Re&&Ae.observe(Re),window.addEventListener("resize",Nt),()=>{Ae.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,x]),s.useLayoutEffect(()=>{if(!J)return;const N=S.current;if(N){if(N instanceof HTMLImageElement&&N.complete&&N.naturalWidth>0){xt();return}N instanceof HTMLVideoElement&&N.readyState>=1&&N.videoWidth>0&&xt()}},[J==null?void 0:J.url,n,xt]),s.useEffect(()=>{Ze()},[Ze,W]),s.useEffect(()=>{const N=new Set,Re=[],Ae=ze=>{!(ze!=null&&ze.url)||N.has(ze.url)||(N.add(ze.url),Re.push(ze))};t.forEach(Ae),u.forEach(ze=>ze.items.forEach(Ae)),Re.forEach(ze=>{G.current.has(ze.url)||x0(ze,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(ne!=="opening"||!ue)return;if(!w){ve("open");return}Q(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Q(!0),ve("open")})});return()=>cancelAnimationFrame(N)},[ne,ue,w]),s.useEffect(()=>{if(ne!=="closing")return;const N=setTimeout(()=>h(),In);return()=>clearTimeout(N)},[ne,h]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{ke.current===n&&he.current===(J==null?void 0:J.url)||(Oe(),B.current=null,te(null),re(null),ye(null),xe(0),M(0),qe(!1),de(!1),ae(!1),I.current=0,z.current=0,$.current="none",T.current=!1,H.current=null,A.current=!1,S.current=null,Ze(),ke.current=n,he.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,qe,Oe,Ze]),s.useLayoutEffect(()=>{const N=P.current;N!==null&&(P.current=null,requestAnimationFrame(()=>{Y.current(N)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(ne==="opening"){X.current=!1,Ce(!1);return}if(ne!=="open"||X.current)return;if(!De&&!Ie){X.current=!0;return}Ce(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),X.current=!0})});return()=>cancelAnimationFrame(N)},[ne,De==null?void 0:De.url,Ie==null?void 0:Ie.url]),s.useEffect(()=>{if(ne!=="open")return;const N=()=>{const it=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",it,!0)};document.addEventListener("click",it,!0)},Re=it=>{const yt=it<0?1:-1;Oe(),_e(yt),B.current=yt,te(yt),qe(!0),Yt()},Ae=it=>{if(Math.abs(it)>l0&&Je){Re(it);return}B.current=null,te(null),re(null),ye(null),qe(!0),M(0),nt()},ze=it=>{if(it.touches.length!==1||_.current)return;const yt=it.touches[0];A.current=!0,H.current={x:yt.clientX,y:yt.clientY},$.current="none",z.current=0,T.current=!1},ct=it=>{if(!H.current||it.touches.length!==1||_.current)return;const yt=it.touches[0],Ot=yt.clientX-H.current.x,It=yt.clientY-H.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Je)return;$.current="horizontal"}else if(It>0){if(!et)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,ae(!0),z.current=Ot,M(Ot),it.preventDefault();return}$.current==="vertical"&&(T.current=!0,ae(!0),I.current=It,xe(It),it.preventDefault())},Et=()=>{if(!H.current)return;const it=$.current,yt=T.current;if(yt&&it==="horizontal")Ae(z.current),N();else if(yt&&it==="vertical"){const Ot=I.current;if(et&&Ot>s0){const It=window.innerHeight;I.current=It,de(!0),xe(It),ve("closing")}else I.current=0,xe(0);N()}else it==="horizontal"&&Math.abs(z.current)>0&&(Ae(z.current),N());H.current=null,$.current="none",z.current=0,T.current=!1,ae(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",ct,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",ct),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[ne,Je,qe,nt,Oe,et,Yt,_e]);const Ut=s.useCallback(()=>{const N=(m==null?void 0:m())??w??null;N&&ue&&(we(N),Q(!0)),ve("closing")},[m,w,ue]);s.useEffect(()=>{const N=ze=>{if(ze.key==="Escape"){if(r&&d||ne==="closing")return;wt(),Ut();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||ne!=="open"||!Je)return;ze.preventDefault();const ct=ze.key==="ArrowLeft"?-1:1;ze.repeat&&ie.current===ct||At(ct)},Re=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const ct=ze.key==="ArrowLeft"?-1:1;ie.current===ct&&wt()},Ae=()=>{wt()};return window.addEventListener("keydown",N),window.addEventListener("keyup",Re),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",Re),window.removeEventListener("blur",Ae),wt()}},[ne,r,d,Ut,Je,At,wt]),s.useEffect(()=>{ne!=="open"&&wt()},[ne,wt]);const Jt=()=>{ne==="closing"||l||Ut()},Tt=ne==="open",Wt=ne==="closing",rn=Me>0?Math.max(0,1-Me/500):1,gt=Me>0?Math.max(.35,1-Me/500):1,Ee=s.useCallback(N=>{if(!(N.propertyName!=="transform"||!_.current)){if(B.current!==null){St();return}Oe(),qe(!1)}},[Oe,qe,St]),Xe=ne==="closing"?ce??w:w,lt=Xe&&ue&&(ne==="opening"||Wt)?p0(Xe,ue):void 0,ht=Fe&&J?st(J,"center"):Me>0?`translateY(${Me}px)`:lt,ft=ue?vr(ue,F):null,Lt=!!(Xe&&ue),mt=Lt&&(ne==="closing"||ne==="open"&&Z),zt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:Me>0?gt:Lt?1:ne==="opening"||Wt?0:1,transition:me&&!E?"none":E?`transform ${vo}ms ${mn}`:q?`transform ${In}ms ${mn}, opacity ${In}ms ${mn}`:mt?`transform ${In}ms ${mn}`:ne==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:Ne&&Tt&&!Fe?"auto":"none",touchAction:Ne&&Tt?"none":void 0,zIndex:1,overflow:Ne?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!Fe?"auto":"none"},Mt=(N,Re,Ae="adjacent")=>{const ze=rt(N);if(!ze)return{display:"none"};const ct=Ae==="far"?Re==="left"?"far-left":"far-right":Re==="left"?"left-adjacent":"right-adjacent",{start:Et}=Se!==null?tu(ze,ct,Se,F):{start:Ae==="far"?Vr(ze,Re,F):ao(ze,Re,F)},it=vr(Et,F),yt=st(N,ct),Ot=!Fe&&Ae==="adjacent"&&Tt&&!Pe?C0(ze,Re,F):null,It=Ae==="far"&&Fe&&Se===(Re==="left"?-1:1),nn=me&&!E?!1:E,un=Ae==="adjacent"&&Tt&&Pe&&!Fe;return{position:"absolute",top:it.top,left:it.left,width:it.width,height:it.height,objectFit:"contain",transform:yt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ae==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Ae==="far"?`transform ${vo}ms ${mn}`:`transform ${vo}ms ${mn}, opacity ${In}ms ${mn}`:un?`transform ${In}ms ${mn}`:ne==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(N,Re)=>{const Ae=rt(N);return Ae?w0(ao(Ae,Re,F),Re,F):null},Gt=N=>Re=>{if(!l){if(A.current){A.current=!1;return}Re.stopPropagation(),vt(N)}},Ht=De?Vt(De,"left"):null,Dt=Ie?Vt(Ie,"right"):null,_t=Ht?vr(Ht,F):null,Ct=Dt?vr(Dt,F):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ne==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:me?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Tt?1:0,transition:me?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"},children:a.jsx(_d,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&He&&a.jsx(br,{media:He,style:Mt(He,"left","far"),onMeasure:Ve,onTransitionEnd:Ee},`far-prev-${He.url}`),Tt&&De&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:De,style:Mt(De,"left"),onMeasure:Ve,onTransitionEnd:Ee},`prev-${De.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Tt&&Ie&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:Ie,style:Mt(Ie,"right"),onMeasure:Ve,onTransitionEnd:Ee},`next-${Ie.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Tt&&Be&&a.jsx(br,{media:Be,style:Mt(Be,"right","far"),onMeasure:Ve,onTransitionEnd:Ee},`far-next-${Be.url}`),ue&&J&&(Ne?a.jsx($0,{src:J.url,phase:ne,onMediaElement:Ft,wrapperStyle:zt,videoStyle:kt,onLoadedMetadata:xt,onTransitionEnd:Ee},`${n}-${J.url}`):a.jsx("img",{ref:Ft,src:J.url,alt:J.name,onLoad:xt,onTransitionEnd:Ee,style:zt},`${n}-${J.url}`))]})}const I0=20,R0=.18;function L0(e){return`
18697
+ `}const In=500,vo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",s0=72,l0=50,c0=1e4,d0=650,u0=500;function p0(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,r=e.top-t.top;return`translate(${o}px, ${r}px) scale(${n}, ${i})`}function Qd(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 m0(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Qd(i,n):null}function g0(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 To(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 mc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return To(e,i,n)}const h0=.03;function eu(e){return e.width*h0}const Ba={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function vr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function gc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function f0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ds(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function y0(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ds(e,t.width,t.height)}function x0(e,t){if(ua(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 v0(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 b0({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>ua(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function ao(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=eu(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function Vr(e,t,n){const i=ao(e,t,n);return{...i,left:2*i.left-e.left}}function w0(e,t,n){const{left:i,width:o}=n,r=eu(n);return t==="left"?{left:i,top:e.top,width:r,height:e.height}:{left:i+o-r,top:e.top,width:r,height:e.height}}function tu(e,t,n,i){const o=ao(e,"left",i),r=ao(e,"right",i),l=Vr(e,"left",i),d=Vr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:r,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:r};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:r};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:r,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function S0(e,t,n,i){const{start:o,end:r}=tu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function C0(e,t,n){const i=ao(e,t,n),o=Vr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function ua(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function $0({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function br({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ua(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function T0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:w,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:v}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),G=s.useRef(new Map),[W,U]=s.useState(0),H=s.useRef(null),I=s.useRef(0),z=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),k=s.useRef(!1),_=s.useRef(!1),g=s.useRef(null),D=s.useRef(null),P=s.useRef(null),q=s.useRef(()=>{}),ie=s.useRef(null),L=s.useRef(null),B=s.useRef(null),K=s.useRef(!1),[ue,le]=s.useState(null),[F,pe]=s.useState(Ba),[j,se]=s.useState(0),[ne,ve]=s.useState("opening"),[ke,xe]=s.useState(0),[b,M]=s.useState(0),[E,V]=s.useState(!1),[Ce,te]=s.useState(null),[$e,ae]=s.useState(null),[ge,ye]=s.useState(null),[Z,J]=s.useState(!1),[de,be]=s.useState(null),[Pe,Se]=s.useState(!1),X=s.useRef(!1),[me,re]=s.useState(!1),[Y,ce]=s.useState(!1),Ee=s.useRef(n),he=s.useRef(void 0),Q=t[n],Ne=Q?ua(Q):!1,Fe=b!==0||E,et=!l&&(!r||!!d),Je=c&&!l,dt=u.length>1,tt=s.useCallback((N,Re)=>t.length<=1?null:t[(N+Re+t.length)%t.length]??null,[t]),De=dt?To(u,p,-1):tt(n,-1),Ie=dt?To(u,p,1):tt(n,1),We=Ce===-1&&Fe?dt&&$e!==null?To(u,$e,-1):ge!==null?tt(ge,-1):null:null,je=Ce===1&&Fe?dt&&$e!==null?To(u,$e,1):ge!==null?tt(ge,1):null:null,Ue=We&&We.url!==(De==null?void 0:De.url)?We:null,A=je&&je.url!==(Ie==null?void 0:Ie.url)?je:null,ee=De&&Je?(()=>{const N=dt?mc(u,p,-1):t.length>2?tt((n-1+t.length)%t.length,-1):null;return N&&N.url!==De.url?N:null})():null,Te=Ie&&Je?(()=>{const N=dt?mc(u,p,1):t.length>2?tt((n+1)%t.length,1):null;return N&&N.url!==Ie.url?N:null})():null,He=Ue??ee,Be=A??Te,Ve=s.useCallback((N,Re,Ae)=>{if(!N||!Re||!Ae)return;const ze=G.current,ct=ze.get(N);(ct==null?void 0:ct.width)===Re&&(ct==null?void 0:ct.height)===Ae||(ze.set(N,{width:Re,height:Ae}),U(Et=>Et+1))},[]),rt=s.useCallback(N=>{if(!(N!=null&&N.url))return null;const Re=G.current.get(N.url);return y0(y.current,Re)},[W,j]),Ze=s.useCallback(()=>{if(!Q)return;const N=rt(Q);if(N){le(N);return}const Re=y.current;Re&&le(gc(Re))},[Q,rt]),_e=s.useCallback(N=>{if(dt){const Re=u.length;ae((p+N+Re)%Re),ye(null);return}t.length>1&&(ye((n+N+t.length)%t.length),ae(null))},[dt,u.length,p,t.length,n]),qe=s.useCallback(N=>{_.current=N,V(N)},[]),Oe=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),nt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{Oe(),qe(!1)},vo+32)},[Oe,qe]),at=s.useCallback(()=>{const N=C.current;if(!N){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ba.width,height:typeof window<"u"?window.innerHeight:Ba.height});return}const Re=N.getBoundingClientRect();pe({left:Re.left,top:Re.top,width:Re.width,height:Re.height})},[]),st=s.useCallback((N,Re)=>{if(Fe){if(me&&!E)return`translate(${b}px, 0px)`;if(E&&Ce!==null){const Ae=rt(N);if(!Ae)return;const{x:ze,y:ct}=S0(Ae,Re,Ce,F);return`translate(${ze}px, ${ct}px)`}if(E)return"translate(0px, 0px)"}},[Fe,me,E,b,Ce,F,rt]),St=s.useCallback(()=>{const N=D.current;D.current=null,Oe(),qe(!1),te(null),ae(null),ye(null),M(0),re(!1),T.current=!1,z.current=0,$.current="none",N===-1?f():N===1&&v()},[Oe,qe,f,v]),Yt=s.useCallback(()=>{Oe(),g.current=window.setTimeout(()=>{D.current!==null&&St()},vo+32)},[Oe,St]),Zt=s.useCallback(()=>{Oe(),D.current=null,qe(!1),te(null),ae(null),ye(null),M(0),re(!1),T.current=!1,z.current=0,$.current="none"},[Oe,qe]),vt=s.useCallback(N=>{if(!(!Je||!ue)){if(_.current){if(D.current===N){P.current=N,St();return}Zt()}Oe(),_e(N),D.current=N,te(N),qe(!0),Yt()}},[Je,ue,St,Zt,Oe,_e,qe,Yt]);q.current=vt;const wt=s.useCallback(()=>{ie.current=null,K.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),B.current!==null&&(window.clearTimeout(B.current),B.current=null)},[]),Bt=s.useCallback(N=>{L.current!==null&&window.clearInterval(L.current);const Re=K.current?u0:d0;L.current=window.setInterval(()=>{q.current(N)},Re)},[]),At=s.useCallback(N=>{ie.current!==N&&(wt(),ie.current=N,K.current=!1,q.current(N),Bt(N),B.current=window.setTimeout(()=>{B.current=null,ie.current===N&&(K.current=!0,Bt(N))},c0))},[wt,Bt]),xt=s.useCallback(()=>{const N=y.current;if(!N)return;const Re=Q==null?void 0:Q.url,Ae=Re?G.current.get(Re):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){le(ds(N,Ae.width,Ae.height));return}const ze=S.current;if(ze&&Re&&(ze.src===Re||ze.currentSrc===Re)){const{width:Et,height:it}=f0(ze);if(Et&&it){Ve(Re,Et,it),le(ds(N,Et,it));return}}const ct=gc(N);!ct.width||!ct.height||le(ct)},[Q==null?void 0:Q.url,Ve]),Ft=s.useCallback(N=>{if(S.current=N,!!N){if(N instanceof HTMLVideoElement){N.readyState>=1&&N.videoWidth>0&&xt();return}N.complete&&N.naturalWidth>0&&xt()}},[xt]),Nt=s.useCallback(()=>{at(),xt(),se(N=>N+1)},[at,xt]);s.useEffect(()=>{Nt();const N=y.current,Re=C.current,Ae=new ResizeObserver(()=>Nt());return N&&Ae.observe(N),Re&&Ae.observe(Re),window.addEventListener("resize",Nt),()=>{Ae.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,x]),s.useLayoutEffect(()=>{if(!Q)return;const N=S.current;if(N){if(N instanceof HTMLImageElement&&N.complete&&N.naturalWidth>0){xt();return}N instanceof HTMLVideoElement&&N.readyState>=1&&N.videoWidth>0&&xt()}},[Q==null?void 0:Q.url,n,xt]),s.useEffect(()=>{Ze()},[Ze,W]),s.useEffect(()=>{const N=new Set,Re=[],Ae=ze=>{!(ze!=null&&ze.url)||N.has(ze.url)||(N.add(ze.url),Re.push(ze))};t.forEach(Ae),u.forEach(ze=>ze.items.forEach(Ae)),Re.forEach(ze=>{G.current.has(ze.url)||x0(ze,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(ne!=="opening"||!ue)return;if(!w){ve("open");return}J(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{J(!0),ve("open")})});return()=>cancelAnimationFrame(N)},[ne,ue,w]),s.useEffect(()=>{if(ne!=="closing")return;const N=setTimeout(()=>h(),In);return()=>clearTimeout(N)},[ne,h]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{Ee.current===n&&he.current===(Q==null?void 0:Q.url)||(Oe(),D.current=null,te(null),ae(null),ye(null),xe(0),M(0),qe(!1),ce(!1),re(!1),I.current=0,z.current=0,$.current="none",T.current=!1,H.current=null,k.current=!1,S.current=null,Ze(),Ee.current=n,he.current=Q==null?void 0:Q.url)},[n,Q==null?void 0:Q.url,qe,Oe,Ze]),s.useLayoutEffect(()=>{const N=P.current;N!==null&&(P.current=null,requestAnimationFrame(()=>{q.current(N)}))},[n,p,Q==null?void 0:Q.url]),s.useLayoutEffect(()=>{if(ne==="opening"){X.current=!1,Se(!1);return}if(ne!=="open"||X.current)return;if(!De&&!Ie){X.current=!0;return}Se(!1);const N=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Se(!0),X.current=!0})});return()=>cancelAnimationFrame(N)},[ne,De==null?void 0:De.url,Ie==null?void 0:Ie.url]),s.useEffect(()=>{if(ne!=="open")return;const N=()=>{const it=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",it,!0)};document.addEventListener("click",it,!0)},Re=it=>{const yt=it<0?1:-1;Oe(),_e(yt),D.current=yt,te(yt),qe(!0),Yt()},Ae=it=>{if(Math.abs(it)>l0&&Je){Re(it);return}D.current=null,te(null),ae(null),ye(null),qe(!0),M(0),nt()},ze=it=>{if(it.touches.length!==1||_.current)return;const yt=it.touches[0];k.current=!0,H.current={x:yt.clientX,y:yt.clientY},$.current="none",z.current=0,T.current=!1},ct=it=>{if(!H.current||it.touches.length!==1||_.current)return;const yt=it.touches[0],Ot=yt.clientX-H.current.x,It=yt.clientY-H.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Je)return;$.current="horizontal"}else if(It>0){if(!et)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,re(!0),z.current=Ot,M(Ot),it.preventDefault();return}$.current==="vertical"&&(T.current=!0,re(!0),I.current=It,xe(It),it.preventDefault())},Et=()=>{if(!H.current)return;const it=$.current,yt=T.current;if(yt&&it==="horizontal")Ae(z.current),N();else if(yt&&it==="vertical"){const Ot=I.current;if(et&&Ot>s0){const It=window.innerHeight;I.current=It,ce(!0),xe(It),ve("closing")}else I.current=0,xe(0);N()}else it==="horizontal"&&Math.abs(z.current)>0&&(Ae(z.current),N());H.current=null,$.current="none",z.current=0,T.current=!1,re(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",ct,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",ct),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[ne,Je,qe,nt,Oe,et,Yt,_e]);const Ut=s.useCallback(()=>{const N=(m==null?void 0:m())??w??null;N&&ue&&(be(N),J(!0)),ve("closing")},[m,w,ue]);s.useEffect(()=>{const N=ze=>{if(ze.key==="Escape"){if(r&&d||ne==="closing")return;wt(),Ut();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||ne!=="open"||!Je)return;ze.preventDefault();const ct=ze.key==="ArrowLeft"?-1:1;ze.repeat&&ie.current===ct||At(ct)},Re=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const ct=ze.key==="ArrowLeft"?-1:1;ie.current===ct&&wt()},Ae=()=>{wt()};return window.addEventListener("keydown",N),window.addEventListener("keyup",Re),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",Re),window.removeEventListener("blur",Ae),wt()}},[ne,r,d,Ut,Je,At,wt]),s.useEffect(()=>{ne!=="open"&&wt()},[ne,wt]);const Jt=()=>{ne==="closing"||l||Ut()},Tt=ne==="open",Wt=ne==="closing",rn=ke>0?Math.max(0,1-ke/500):1,gt=ke>0?Math.max(.35,1-ke/500):1,Me=s.useCallback(N=>{if(!(N.propertyName!=="transform"||!_.current)){if(D.current!==null){St();return}Oe(),qe(!1)}},[Oe,qe,St]),Xe=ne==="closing"?de??w:w,lt=Xe&&ue&&(ne==="opening"||Wt)?p0(Xe,ue):void 0,ht=Fe&&Q?st(Q,"center"):ke>0?`translateY(${ke}px)`:lt,ft=ue?vr(ue,F):null,Lt=!!(Xe&&ue),mt=Lt&&(ne==="closing"||ne==="open"&&Z),zt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:ke>0?gt:Lt?1:ne==="opening"||Wt?0:1,transition:me&&!E?"none":E?`transform ${vo}ms ${mn}`:Y?`transform ${In}ms ${mn}, opacity ${In}ms ${mn}`:mt?`transform ${In}ms ${mn}`:ne==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:Ne&&Tt&&!Fe?"auto":"none",touchAction:Ne&&Tt?"none":void 0,zIndex:1,overflow:Ne?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!Fe?"auto":"none"},Mt=(N,Re,Ae="adjacent")=>{const ze=rt(N);if(!ze)return{display:"none"};const ct=Ae==="far"?Re==="left"?"far-left":"far-right":Re==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ce!==null?tu(ze,ct,Ce,F):{start:Ae==="far"?Vr(ze,Re,F):ao(ze,Re,F)},it=vr(Et,F),yt=st(N,ct),Ot=!Fe&&Ae==="adjacent"&&Tt&&!Pe?C0(ze,Re,F):null,It=Ae==="far"&&Fe&&Ce===(Re==="left"?-1:1),nn=me&&!E?!1:E,un=Ae==="adjacent"&&Tt&&Pe&&!Fe;return{position:"absolute",top:it.top,left:it.left,width:it.width,height:it.height,objectFit:"contain",transform:yt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ae==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Ae==="far"?`transform ${vo}ms ${mn}`:`transform ${vo}ms ${mn}, opacity ${In}ms ${mn}`:un?`transform ${In}ms ${mn}`:ne==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(N,Re)=>{const Ae=rt(N);return Ae?w0(ao(Ae,Re,F),Re,F):null},Gt=N=>Re=>{if(!l){if(k.current){k.current=!1;return}Re.stopPropagation(),vt(N)}},Ht=De?Vt(De,"left"):null,Dt=Ie?Vt(Ie,"right"):null,_t=Ht?vr(Ht,F):null,Ct=Dt?vr(Dt,F):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ne==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:me?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[a.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Tt?1:0,transition:me?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"},children:a.jsx(_d,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&He&&a.jsx(br,{media:He,style:Mt(He,"left","far"),onMeasure:Ve,onTransitionEnd:Me},`far-prev-${He.url}`),Tt&&De&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:De,style:Mt(De,"left"),onMeasure:Ve,onTransitionEnd:Me},`prev-${De.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Tt&&Ie&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:Ie,style:Mt(Ie,"right"),onMeasure:Ve,onTransitionEnd:Me},`next-${Ie.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Tt&&Be&&a.jsx(br,{media:Be,style:Mt(Be,"right","far"),onMeasure:Ve,onTransitionEnd:Me},`far-next-${Be.url}`),ue&&Q&&(Ne?a.jsx($0,{src:Q.url,phase:ne,onMediaElement:Ft,wrapperStyle:zt,videoStyle:kt,onLoadedMetadata:xt,onTransitionEnd:Me},`${n}-${Q.url}`):a.jsx("img",{ref:Ft,src:Q.url,alt:Q.name,onLoad:xt,onTransitionEnd:Me,style:zt},`${n}-${Q.url}`))]})}const I0=20,R0=.18;function L0(e){return`
18698
18698
  .${e}-wrapper {
18699
18699
  box-sizing: border-box;
18700
18700
  max-width: 100%;
@@ -18782,7 +18782,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
18782
18782
  pointer-events: auto;
18783
18783
  }
18784
18784
  ${a0(e)}
18785
- `}function P0(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,r]=n.split(":").map(Number),l=i?r:o,d=i?o:r;return d>0?l/d:1}function E0(e){const t=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,n=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight;return!t||!n?null:t/n}function M0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:D.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:D.scalingValue(i*R0,n??!1),[`--${t}-image-aspect`]:P0(e)}}function k0(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 qt(n,t)}function A0(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 F0(e,t,n,i,o,r){if(!(!e||!t))return l=>{var c;const d=((c=l.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(l.currentTarget instanceof HTMLImageElement||l.currentTarget instanceof HTMLVideoElement?l.currentTarget:null);r(n,d?Qd(d,o):void 0)}}function _0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>L0(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",x=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,w=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=D.scalingValue(w,n??!1),h=`max(${m}, ${I0}px)`,{objectFitMode:f,imageStyle:v}=A0(e),C=k0(e,n),y=s.useRef(null),[S,G]=s.useState(!1),[W,U]=s.useState([]),[H,I]=s.useState(0),[z,$]=s.useState(0),[T,A]=s.useState(null),[_,g]=s.useState({title1:"",title2:"",title3:""}),B=(!n||i)&&!S,P=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},Y=P.sizeType??"none",ie=B&&Y!=="none"?`${d}-item-image-hover-${Y}`:void 0,L=(P.value??120)/100,O=s.useCallback(b=>{!b||Y!=="scale"||(b.style.transformOrigin=Pg(b))},[Y]),K=s.useCallback(b=>{if(b){if(f==="contain"){const M=E0(b);if(M){const E=b.closest(`.${d}-item-image`);E instanceof HTMLElement&&E.style.setProperty(`--${d}-item-media-aspect`,String(M))}}O(b)}},[d,O,f]),ue={width:D.scalingValue(x,n??!1),...C,...M0(e,d,n),[`--${d}-image-hover-scale`]:String(L)},le=(()=>{const b={},M=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return M&&(b["--cntrl-article-width"]=M),b})(),F=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),pe=s.useMemo(()=>g0(u),[u]),j=s.useMemo(()=>v0(u),[u]),se=(b,M)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const E=pe.findIndex(Se=>Se.gridIndex===b);if(E<0)return;const V=pe[E];$(E),U(V.items),I(0),g(V.entry),A(M??null),G(!0)},ne=s.useCallback(()=>{G(!1),A(null)},[]),ve=s.useCallback(()=>{const b=pe[z];return!b||!y.current?T:m0(y.current,b.gridIndex,f)??T},[pe,z,T,f]),Me=s.useCallback(b=>{if(pe.length>1){const M=pe.length,E=(z+b+M)%M,V=pe[E];$(E),U(V.items),I(0),g(V.entry);return}I(M=>(M+b+W.length)%W.length)},[pe,z,W.length]),xe=pe.length>1||W.length>1;return s.useEffect(()=>{if(!S||typeof document>"u")return;const b=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=b}},[S]),s.useEffect(()=>{!n||o||i||G(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&G(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(b0,{mediaList:j}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:ue,children:u.map((b,M)=>{var Se,te;const E=!!((Se=b.image)!=null&&Se.url),V=F0(!!F,E,M,d,f,se);return a.jsxs("div",{className:`${d}-item`,children:[b.title?a.jsx("span",{className:`${d}-item-title`,onClick:V,style:V?{cursor:"pointer"}:void 0,children:b.title}):null,(te=b.image)!=null&&te.url?a.jsx("span",{className:[`${d}-item-image`,f==="contain"?`${d}-item-image-fit`:void 0,ie].filter(Boolean).join(" "),children:b.image.type==="video"?a.jsx("video",{ref:K,src:b.image.url,"data-waterfall-index":M,style:v,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:V,onLoadedData:$e=>K($e.currentTarget)}):a.jsx("img",{ref:K,src:b.image.url,alt:b.image.name??"","data-waterfall-index":M,style:v,onClick:V,onLoad:$e=>K($e.currentTarget)})}):null,M<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:m},children:o&&!S&&a.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:h,height:"100%"}})})]},M)})}),S&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const b=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:le,"data-selection":"none",children:a.jsx(T0,{prefix:d,items:W,index:H,entry:_,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:xe,lightboxEntries:pe,entryIdx:z,layoutId:r,sourceRect:T,resolveCloseSourceRect:ve,onClose:ne,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),b)})()]})}const N0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
18785
+ `}function P0(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,r]=n.split(":").map(Number),l=i?r:o,d=i?o:r;return d>0?l/d:1}function E0(e){const t=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,n=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight;return!t||!n?null:t/n}function M0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:O.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:O.scalingValue(i*R0,n??!1),[`--${t}-image-aspect`]:P0(e)}}function k0(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 qt(n,t)}function A0(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 F0(e,t,n,i,o,r){if(!(!e||!t))return l=>{var c;const d=((c=l.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(l.currentTarget instanceof HTMLImageElement||l.currentTarget instanceof HTMLVideoElement?l.currentTarget:null);r(n,d?Qd(d,o):void 0)}}function _0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=O.useScopedStyles(),c=s.useMemo(()=>L0(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",x=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,w=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=O.scalingValue(w,n??!1),h=`max(${m}, ${I0}px)`,{objectFitMode:f,imageStyle:v}=A0(e),C=k0(e,n),y=s.useRef(null),[S,G]=s.useState(!1),[W,U]=s.useState([]),[H,I]=s.useState(0),[z,$]=s.useState(0),[T,k]=s.useState(null),[_,g]=s.useState({title1:"",title2:"",title3:""}),D=(!n||i)&&!S,P=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},q=P.sizeType??"none",ie=D&&q!=="none"?`${d}-item-image-hover-${q}`:void 0,L=(P.value??120)/100,B=s.useCallback(b=>{!b||q!=="scale"||(b.style.transformOrigin=Pg(b))},[q]),K=s.useCallback(b=>{if(b){if(f==="contain"){const M=E0(b);if(M){const E=b.closest(`.${d}-item-image`);E instanceof HTMLElement&&E.style.setProperty(`--${d}-item-media-aspect`,String(M))}}B(b)}},[d,B,f]),ue={width:O.scalingValue(x,n??!1),...C,...M0(e,d,n),[`--${d}-image-hover-scale`]:String(L)},le=(()=>{const b={},M=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return M&&(b["--cntrl-article-width"]=M),b})(),F=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),pe=s.useMemo(()=>g0(u),[u]),j=s.useMemo(()=>v0(u),[u]),se=(b,M)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const E=pe.findIndex(Ce=>Ce.gridIndex===b);if(E<0)return;const V=pe[E];$(E),U(V.items),I(0),g(V.entry),k(M??null),G(!0)},ne=s.useCallback(()=>{G(!1),k(null)},[]),ve=s.useCallback(()=>{const b=pe[z];return!b||!y.current?T:m0(y.current,b.gridIndex,f)??T},[pe,z,T,f]),ke=s.useCallback(b=>{if(pe.length>1){const M=pe.length,E=(z+b+M)%M,V=pe[E];$(E),U(V.items),I(0),g(V.entry);return}I(M=>(M+b+W.length)%W.length)},[pe,z,W.length]),xe=pe.length>1||W.length>1;return s.useEffect(()=>{if(!S||typeof document>"u")return;const b=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=b}},[S]),s.useEffect(()=>{!n||o||i||G(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&G(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(b0,{mediaList:j}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:ue,children:u.map((b,M)=>{var Ce,te;const E=!!((Ce=b.image)!=null&&Ce.url),V=F0(!!F,E,M,d,f,se);return a.jsxs("div",{className:`${d}-item`,children:[b.title?a.jsx("span",{className:`${d}-item-title`,onClick:V,style:V?{cursor:"pointer"}:void 0,children:b.title}):null,(te=b.image)!=null&&te.url?a.jsx("span",{className:[`${d}-item-image`,f==="contain"?`${d}-item-image-fit`:void 0,ie].filter(Boolean).join(" "),children:b.image.type==="video"?a.jsx("video",{ref:K,src:b.image.url,"data-waterfall-index":M,style:v,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:V,onLoadedData:$e=>K($e.currentTarget)}):a.jsx("img",{ref:K,src:b.image.url,alt:b.image.name??"","data-waterfall-index":M,style:v,onClick:V,onLoad:$e=>K($e.currentTarget)})}):null,M<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:m},children:o&&!S&&a.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:h,height:"100%"}})})]},M)})}),S&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const b=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:le,"data-selection":"none",children:a.jsx(T0,{prefix:d,items:W,index:H,entry:_,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:xe,lightboxEntries:pe,entryIdx:z,layoutId:r,sourceRect:T,resolveCloseSourceRect:ve,onClose:ne,onPrev:()=>ke(-1),onNext:()=>ke(1)})}),b)})()]})}const N0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
18786
18786
  import type React from 'react';
18787
18787
  import { createPortal } from 'react-dom';
18788
18788
  import { CommonComponentProps } from '../props';
@@ -19296,7 +19296,7 @@ export function Waterfall({
19296
19296
  </>
19297
19297
  );
19298
19298
  }
19299
- `,W0="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>'),Yn={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 H0(e){const t={};return t[ot(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSettings")]={...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSize")]={...Yn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ot(e,"lineHeight")]={...Yn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ot(e,"letterSpacing")]={...Yn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ot(e,"wordSpacing")]={...Yn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ot(e,"textAlign")]={...Yn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ot(e,"textAppearance")]={...Yn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const so=oi.filter(e=>e!=="count"),D0=so.reduce((e,t)=>({...e,...H0(t)}),{}),O0=so.reduce((e,t)=>({...e,[ot(t,"fontFamily")]:"Arial",[ot(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ot(t,"letterSpacing")]:0,[ot(t,"wordSpacing")]:0,[ot(t,"textAlign")]:"left",[ot(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function za(e){return so.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ot(n,"fontSize")]=i),o!==void 0&&(t[ot(n,"lineHeight")]=o),t},{})}const B0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(so.map(e=>[Xs[e],Ys(e)]))},wr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},z0=[{title:"Salton Sea from Above",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],j0={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"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}},required:["image"]},default:z0},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageHoverEffect:{type:"object",scope:"common",title:"Hover",display:{type:"toggle-cycle-numeric-input",enum:["none","scale","saturate"],inputs:{none:"none",scale:"single",saturate:"none"},defaultValue:120,showDash:!1},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},horizontalGap:{type:"number",scope:"layout",title:"Gutter",min:0,display:{type:"range-control"}},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"]}},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"}},titleColor:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title1Color:{type:"string",scope:"common",title:"Title Lightbox",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Lightbox",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Lightbox",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},...D0},defaults:{type:"a",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightbox:"on",imageHoverEffect:{sizeType:"none",value:120,min:100,max:200},titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:W0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...O0},layoutDefaults:{d:{wrapperWidth:1,horizontalGap:.006944,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,titleFontSize:.0625,titleLineHeight:.05555,titleLetterSpacing:-34722e-8,...za({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},m:{wrapperWidth:1,horizontalGap:.026666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,titleFontSize:.16,titleLineHeight:.13333,...za({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{wrapperWidth:1,horizontalGap:.01302,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.03906,iconMarginRight:.026,titleFontSize:.07,titleLineHeight:.07,...za({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","type","wrapperWidth","imageDisplay","lightbox","imageHoverEffect","horizontalGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["wrapperWidth","lightbox"]},{type:"row",title:"Image",items:["imageDisplay","imageHoverEffect"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Lightbox",items:[B0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},V0={element:_0,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},...so.map(e=>({path:`${ot(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...so.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ot(t,"fontFamily")}`}),{})},schema:j0,sourceCode:N0},qi=500,nu="cubic-bezier(0.25, 1, 0.5, 1)",G0=300,X0=5,Y0=.15,q0=.4,U0=100,Fi=100,hc={color:"#000000",hover:"#cccccc"},bo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},K0={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},ja={offset:{x:0,y:0},linkColor:"#cccccc"},fc={sizeType:"drag",value:3},Z0="left";function J0(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)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:Z0,color:(e==null?void 0:e.titleColor)??"#000000"};return qt(n,t)}function _i(e,t,n){return`${e}: ${D.scalingValue(t/1440,n)};`}function Io(e,t){return t<=0?0:(e%t+t)%t}function Q0(e,t,n,i){if(!i)return{position:Io(e+t,n),hitBoundary:!1};const o=e+t;return o>=0&&o<=n+1?{position:o,hitBoundary:!1}:{position:t>0?n+1:0,hitBoundary:!0}}function eb(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function tb(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,x)=>{n.style.transform=`translate(${p}px, ${x}px)`;const w=n.getBoundingClientRect();return{x:w.left,y:w.top}},o=i(0,0),r=i(Fi,0),l=i(0,Fi);e.removeChild(n);const d={x:(r.x-o.x)/Fi,y:(r.y-o.y)/Fi},c={x:(l.x-o.x)/Fi,y:(l.y-o.y)/Fi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function nb(e,t,n){const{ex:i,ey:o,det:r}=e;return{x:(t*o.y-n*o.x)/r,y:(i.x*n-i.y*t)/r}}function ib(e,t){return`
19299
+ `,W0="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>'),Yn={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 H0(e){const t={};return t[ot(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSettings")]={...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ot(e,"fontSize")]={...Yn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ot(e,"lineHeight")]={...Yn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ot(e,"letterSpacing")]={...Yn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ot(e,"wordSpacing")]={...Yn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ot(e,"textAlign")]={...Yn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ot(e,"textAppearance")]={...Yn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const so=oi.filter(e=>e!=="count"),D0=so.reduce((e,t)=>({...e,...H0(t)}),{}),O0=so.reduce((e,t)=>({...e,[ot(t,"fontFamily")]:"Arial",[ot(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ot(t,"letterSpacing")]:0,[ot(t,"wordSpacing")]:0,[ot(t,"textAlign")]:"left",[ot(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function za(e){return so.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ot(n,"fontSize")]=i),o!==void 0&&(t[ot(n,"lineHeight")]=o),t},{})}const B0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(so.map(e=>[Xs[e],Ys(e)]))},wr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},z0=[{title:"Salton Sea from Above",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],j0={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"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}},required:["image"]},default:z0},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageHoverEffect:{type:"object",scope:"common",title:"Hover",display:{type:"toggle-cycle-numeric-input",enum:["none","scale","saturate"],inputs:{none:"none",scale:"single",saturate:"none"},defaultValue:120,showDash:!1},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},horizontalGap:{type:"number",scope:"layout",title:"Gutter",min:0,display:{type:"range-control"}},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"]}},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"}},titleColor:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title1Color:{type:"string",scope:"common",title:"Title Lightbox",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Lightbox",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Lightbox",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},...D0},defaults:{type:"a",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightbox:"on",imageHoverEffect:{sizeType:"none",value:120,min:100,max:200},titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:W0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...O0},layoutDefaults:{d:{wrapperWidth:1,horizontalGap:.006944,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,titleFontSize:.0625,titleLineHeight:.05555,titleLetterSpacing:-34722e-8,...za({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},m:{wrapperWidth:1,horizontalGap:.026666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,titleFontSize:.16,titleLineHeight:.13333,...za({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{wrapperWidth:1,horizontalGap:.01302,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.03906,iconMarginRight:.026,titleFontSize:.07,titleLineHeight:.07,...za({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","type","wrapperWidth","imageDisplay","lightbox","imageHoverEffect","horizontalGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["wrapperWidth","lightbox"]},{type:"row",title:"Image",items:["imageDisplay","imageHoverEffect"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Lightbox",items:[B0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},V0={element:_0,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},...so.map(e=>({path:`${ot(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...so.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ot(t,"fontFamily")}`}),{})},schema:j0,sourceCode:N0},qi=500,nu="cubic-bezier(0.25, 1, 0.5, 1)",G0=300,X0=5,Y0=.15,q0=.4,U0=100,Fi=100,hc={color:"#000000",hover:"#cccccc"},bo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},K0={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},ja={offset:{x:0,y:0},linkColor:"#cccccc"},fc={sizeType:"drag",value:3},Z0="left";function J0(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)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:Z0,color:(e==null?void 0:e.titleColor)??"#000000"};return qt(n,t)}function _i(e,t,n){return`${e}: ${O.scalingValue(t/1440,n)};`}function Io(e,t){return t<=0?0:(e%t+t)%t}function Q0(e,t,n,i){if(!i)return{position:Io(e+t,n),hitBoundary:!1};const o=e+t;return o>=0&&o<=n+1?{position:o,hitBoundary:!1}:{position:t>0?n+1:0,hitBoundary:!0}}function eb(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function tb(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,x)=>{n.style.transform=`translate(${p}px, ${x}px)`;const w=n.getBoundingClientRect();return{x:w.left,y:w.top}},o=i(0,0),r=i(Fi,0),l=i(0,Fi);e.removeChild(n);const d={x:(r.x-o.x)/Fi,y:(r.y-o.y)/Fi},c={x:(l.x-o.x)/Fi,y:(l.y-o.y)/Fi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function nb(e,t,n){const{ex:i,ey:o,det:r}=e;return{x:(t*o.y-n*o.x)/r,y:(i.x*n-i.y*t)/r}}function ib(e,t){return`
19300
19300
  .${e}-wrapper {
19301
19301
  position: relative;
19302
19302
  width: 100%;
@@ -19566,7 +19566,7 @@ export function Waterfall({
19566
19566
  from { clip-path: inset(100% 0 0 0); }
19567
19567
  to { clip-path: inset(0 0 0 0); }
19568
19568
  }
19569
- `}function ob({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=D.useScopedStyles(),l=J0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??fc,p=u.sizeType??"drag",x=u.value??fc.value,w=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",v=K0[f],C=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Ie=>D.scalingValue(Ie*C,n),S=(e==null?void 0:e.show)??"always",G=(e==null?void 0:e.controls)??null,W=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,U=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,H=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,I=(e==null?void 0:e.controlsColor)??hc.color,z=(e==null?void 0:e.controlsHoverColor)??hc.hover,$=(e==null?void 0:e.navColor)??bo.colors.inactive,T=(e==null?void 0:e.navPaginationColor)??bo.colors.pagination,A=(e==null?void 0:e.navBackgroundColor)??bo.colors.background,_=(e==null?void 0:e.linkColor)??ja.linkColor,g=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,B=w==="horizontal",P=p==="click",Y=p==="drag",ie=p==="auto"&&(!n||!!i),L=!n,O=m==="slide",K=h==="classic",ue=S!=="never",le=S==="on hover",F=D.scalingValue(W,n),pe={width:F,height:F,maxWidth:F},j=O&&c>1,[se,ne]=s.useState(0),[ve,Me]=s.useState(j?1:0),[xe,b]=s.useState(!1),[M,E]=s.useState(!1),[V,Se]=s.useState(!1),[te,$e]=s.useState(0),[re,ge]=s.useState(!1),[ye,Z]=s.useState(!1),Q=s.useRef(!1),ce=s.useRef(ve);ce.current=ve;const we=s.useRef(null),Pe=s.useRef(0),Ce=s.useRef(null),X=s.useRef(null),me=s.useRef(null),ae=s.useRef(null),q=s.useCallback(Ie=>{Q.current=Ie,b(Ie)},[]),de=s.useCallback(Ie=>{if(c<2||Ie===0)return;const We=Ie>0?1:-1,je=Math.abs(Ie);if(ge(!0),q(!0),!O){ne(Be=>Io(Be+Ie,c));return}let Ue=ce.current;const k=j&&(Ue===0||Ue===c+1),ee=k?se+1:null;k&&(Ue=se+1);let Te=je;for(;Te>0;){const Be=Q0(Ue,We,c,j);if(Ue=Be.position,Te-=1,Be.hitBoundary){Pe.current=Te*We;break}}const He=je-Te;if(He>0&&ne(Be=>Io(Be+He*We,c)),ce.current=Ue,ee!==null){if(ce.current=ee,Ue===ee){E(!0),Me(Ue);return}we.current=Ue,E(!0),Me(ee);return}E(!1),Me(Ue)},[se,c,j,O,q]),ke=s.useCallback(Ie=>{de(Ie)},[de]),he=s.useCallback(Ie=>{if(c<2)return;const We=Io(Ie,c);if(!(We===se&&!Q.current)&&(ge(!0),q(!0),ne(We),O)){const je=We+(j?1:0);we.current=null,Pe.current=0,ce.current=je,E(!1),Me(je)}},[se,c,j,O,q]);s.useEffect(()=>{if(!xe)return;const Ie=window.setTimeout(()=>{if(j&&(ve===0||ve===c+1)){we.current=null,E(!0),Me(se+1);return}q(!1)},qi);return()=>window.clearTimeout(Ie)},[se,c,j,xe,q,ve]),s.useEffect(()=>{if(!M)return;let Ie=0;const We=requestAnimationFrame(()=>{Ie=requestAnimationFrame(()=>{const je=we.current;we.current=null;const Ue=Pe.current;if(Pe.current=0,E(!1),je!==null){ce.current=je,Me(je);return}if(Ue!==0){de(Ue);return}q(!1)})});return()=>{cancelAnimationFrame(We),cancelAnimationFrame(Ie)}},[de,q,M]);const J=`${j}:${c}`,Ne=s.useRef(J);s.useEffect(()=>{if(Ne.current===J)return;Ne.current=J;const Ie=c>0?Math.min(se,c-1):0;me.current=null,ae.current=null,Se(!1),$e(0),ne(Ie),E(!0),Me(Ie+(j?1:0))},[se,c,j,J]),s.useEffect(()=>{if(!re)return;const Ie=window.setTimeout(()=>ge(!1),G0);return()=>window.clearTimeout(Ie)},[re,se]),s.useEffect(()=>{if(!ie||c<2)return;const Ie=Math.max(x,.1)*1e3,We=window.setInterval(()=>{L&&ye||ke(1)},Ie);return()=>window.clearInterval(We)},[x,c,ke,ie,ye,L]);const Fe=s.useCallback(Ie=>{const We=me.current;if(!We||We.pointerId!==Ie.pointerId)return;me.current=null,ae.current=null;const je=Ce.current;if(je!=null&&je.hasPointerCapture(Ie.pointerId)&&je.releasePointerCapture(Ie.pointerId),!We.isActive){O&&$e(0);return}const k=!(Ie.timeStamp-We.lastTime>U0)&&Math.abs(We.velocity)>q0,ee=We.size>0&&Math.abs(We.offset-We.baseOffset)>We.size*Y0;if(Se(!1),!k&&!ee){$e(0);return}const Te=ee?We.offset-We.baseOffset:We.velocity;let He=1;ee&&We.size>0&&(He=Math.max(1,Math.round(Math.abs(Te)/We.size))),$e(0),de(Te<0?He:-He)},[de,O]);s.useEffect(()=>{const Ie=We=>{ae.current===null||We.pointerId!==ae.current||Fe(We)};return window.addEventListener("pointerup",Ie),window.addEventListener("pointercancel",Ie),()=>{window.removeEventListener("pointerup",Ie),window.removeEventListener("pointercancel",Ie)}},[Fe]);const et=Ie=>{const We=Ce.current;if(!Y||c<2||!We||Ie.pointerType==="mouse"&&Ie.button!==0)return;we.current=null,Pe.current=0,Q.current&&q(!1);let je=0;const Ue=X.current;if(O&&Ue){const k=B?Ue.offsetWidth:Ue.offsetHeight;if(k>0){const ee=eb(Ue,B);let Te=ce.current;j&&(Te===0||Te===c+1)?(Te=se+1,ce.current=Te,E(!0),Me(Te),je=0):je=ee+Te*k,$e(je)}}We.setPointerCapture(Ie.pointerId),ae.current=Ie.pointerId,me.current={pointerId:Ie.pointerId,startClientX:Ie.clientX,startClientY:Ie.clientY,axes:tb(We,`${r}-axis-probe`),size:B?We.offsetWidth:We.offsetHeight,isActive:!1,baseOffset:je,offset:je,lastTime:Ie.timeStamp,velocity:0}},Je=Ie=>{const We=me.current;if(!We||We.pointerId!==Ie.pointerId)return;if(Ie.pointerType==="mouse"&&Ie.buttons===0){Fe(Ie);return}const je=Ie.clientX-We.startClientX,Ue=Ie.clientY-We.startClientY,k=We.axes?nb(We.axes,je,Ue):{x:je,y:Ue},ee=B?k.x:k.y,Te=B?k.y:k.x,He=We.baseOffset+ee;if(!We.isActive){if(Math.max(Math.abs(ee),Math.abs(Te))<X0)return;if(Math.abs(Te)>Math.abs(ee)){const Ve=Ce.current;Ve!=null&&Ve.hasPointerCapture(We.pointerId)&&Ve.releasePointerCapture(We.pointerId),me.current=null,ae.current=null,O&&$e(0);return}We.isActive=!0,Se(!0)}const Be=Ie.timeStamp-We.lastTime;Be>0&&(We.velocity=(He-We.offset)/Be,We.lastTime=Ie.timeStamp),We.offset=He,O&&$e(He)},dt=Ie=>{Fe(Ie)},tt=B?`translate3d(calc(${-ve*100}% + ${te}px), 0, 0)`:`translate3d(0, calc(${-ve*100}% + ${te}px), 0)`,De=j?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ib(r,n)}}),a.jsxs("div",{className:pt(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!B}),onMouseEnter:()=>Z(!0),onMouseLeave:()=>Z(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:Ce,className:pt(`${r}-track`,{[`${r}-track-draggable`]:Y,[`${r}-track-draggable-vertical`]:Y&&!B}),onPointerDown:et,onPointerMove:Je,onPointerUp:dt,onPointerCancel:dt,onLostPointerCapture:Ie=>{ae.current===Ie.pointerId&&Fe(Ie)},children:a.jsx("div",{ref:X,className:pt(`${r}-list`,{[`${r}-list-slide`]:O,[`${r}-list-slide-vertical`]:O&&!B,[`${r}-list-fade`]:!O}),style:O?{transform:tt,transition:V||M?"none":`transform ${qi}ms ${nu}`}:void 0,children:De.map((Ie,We)=>{const je=j?Io(We-1,c):We,k=j&&(We===0||We===c+1)?`clone-${We===0?"start":"end"}`:`slide-${je}`;return a.jsx("div",{className:pt(`${r}-slide`,{[`${r}-is-active`]:!O&&je===se}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:pt(`${r}-slider-image`,{[`${r}-contain`]:Ie.image.objectFit==="contain",[`${r}-cover`]:Ie.image.objectFit==="cover"}),src:Ie.image.url,alt:Ie.image.name??"",draggable:!1})})})},k)})})}),ue&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-prev`]:B,[`${r}-arrow-prev-vertical`]:!B,[`${r}-hover-arrow`]:le}),style:{color:I,"--arrow-hover-color":z,...pe},children:a.jsxs("button",{onClick:Ie=>{Ie.stopPropagation(),ke(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${D.scalingValue(U,n)}, ${D.scalingValue(H*(B?1:-1),n)}) rotate(${B?"0deg":"90deg"})`},children:[G&&a.jsx(sn,{url:G,fill:I,hoverFill:z,className:pt(`${r}-arrow-img`,`${r}-mirror`),style:pe}),!G&&a.jsx(yc,{color:I,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-next`]:B,[`${r}-arrow-next-vertical`]:!B,[`${r}-hover-arrow`]:le}),style:{color:I,"--arrow-hover-color":z,...pe},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Ie=>{Ie.stopPropagation(),ke(1)},style:{transform:`translate(${D.scalingValue(U*(B?-1:1),n)}, ${D.scalingValue(H,n)}) rotate(${B?"0deg":"90deg"})`},children:[G&&a.jsx(sn,{url:G,fill:I,hoverFill:z,className:`${r}-arrow-img`,style:pe}),!G&&a.jsx(yc,{color:I,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),P&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>ke(1)}),K&&a.jsx("div",{className:pt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:B,[`${r}-pagination-inside-left`]:!B}),style:B?{bottom:y(v.inset)}:{left:y(v.inset)},children:a.jsx("div",{className:pt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!B,[`${r}-animate-dots`]:re}),style:{backgroundColor:A,gap:y(v.gapInactive-v.activeDot+v.dot),...B?{height:y(v.activeDot+v.paddingY*2),paddingTop:y(v.paddingY),paddingBottom:y(v.paddingY),paddingLeft:y(v.paddingActive),paddingRight:y(v.paddingActive)}:{width:y(v.activeDot+v.paddingY*2),paddingLeft:y(v.paddingY),paddingRight:y(v.paddingY),paddingTop:y(v.paddingActive),paddingBottom:y(v.paddingActive)},borderRadius:y(v.borderRadius),transform:`translate(${D.scalingValue(bo.offset.x,n)}, ${D.scalingValue(bo.offset.y,n)})`},children:d.map((Ie,We)=>{const je=We===se,Ue=je?v.activeDot:v.dot;return a.jsx("button",{onClick:()=>he(We),className:`${r}-pagination-item`,style:{width:y(v.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:je?T:$,width:y(Ue)}})},We)})},`${f}-${w}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:D.scalingValue(g,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((Ie,We)=>a.jsx("div",{className:pt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:We===se&&n,[`${r}-active`]:We===se}),style:{...l,width:"max-content",transitionDuration:`${Math.round(qi/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":_,"--link-hover-color":_,position:"relative",top:D.scalingValue(ja.offset.y,n),left:D.scalingValue(ja.offset.x,n)},children:a.jsx(Ri,{content:Ie.imageCaption})})},We))})]})]})]})}function yc({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.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 rb=`import React, { useCallback, useEffect, useRef, useState } from 'react';
19569
+ `}function ob({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=O.useScopedStyles(),l=J0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??fc,p=u.sizeType??"drag",x=u.value??fc.value,w=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",v=K0[f],C=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Ie=>O.scalingValue(Ie*C,n),S=(e==null?void 0:e.show)??"always",G=(e==null?void 0:e.controls)??null,W=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,U=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,H=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,I=(e==null?void 0:e.controlsColor)??hc.color,z=(e==null?void 0:e.controlsHoverColor)??hc.hover,$=(e==null?void 0:e.navColor)??bo.colors.inactive,T=(e==null?void 0:e.navPaginationColor)??bo.colors.pagination,k=(e==null?void 0:e.navBackgroundColor)??bo.colors.background,_=(e==null?void 0:e.linkColor)??ja.linkColor,g=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,D=w==="horizontal",P=p==="click",q=p==="drag",ie=p==="auto"&&(!n||!!i),L=!n,B=m==="slide",K=h==="classic",ue=S!=="never",le=S==="on hover",F=O.scalingValue(W,n),pe={width:F,height:F,maxWidth:F},j=B&&c>1,[se,ne]=s.useState(0),[ve,ke]=s.useState(j?1:0),[xe,b]=s.useState(!1),[M,E]=s.useState(!1),[V,Ce]=s.useState(!1),[te,$e]=s.useState(0),[ae,ge]=s.useState(!1),[ye,Z]=s.useState(!1),J=s.useRef(!1),de=s.useRef(ve);de.current=ve;const be=s.useRef(null),Pe=s.useRef(0),Se=s.useRef(null),X=s.useRef(null),me=s.useRef(null),re=s.useRef(null),Y=s.useCallback(Ie=>{J.current=Ie,b(Ie)},[]),ce=s.useCallback(Ie=>{if(c<2||Ie===0)return;const We=Ie>0?1:-1,je=Math.abs(Ie);if(ge(!0),Y(!0),!B){ne(Be=>Io(Be+Ie,c));return}let Ue=de.current;const A=j&&(Ue===0||Ue===c+1),ee=A?se+1:null;A&&(Ue=se+1);let Te=je;for(;Te>0;){const Be=Q0(Ue,We,c,j);if(Ue=Be.position,Te-=1,Be.hitBoundary){Pe.current=Te*We;break}}const He=je-Te;if(He>0&&ne(Be=>Io(Be+He*We,c)),de.current=Ue,ee!==null){if(de.current=ee,Ue===ee){E(!0),ke(Ue);return}be.current=Ue,E(!0),ke(ee);return}E(!1),ke(Ue)},[se,c,j,B,Y]),Ee=s.useCallback(Ie=>{ce(Ie)},[ce]),he=s.useCallback(Ie=>{if(c<2)return;const We=Io(Ie,c);if(!(We===se&&!J.current)&&(ge(!0),Y(!0),ne(We),B)){const je=We+(j?1:0);be.current=null,Pe.current=0,de.current=je,E(!1),ke(je)}},[se,c,j,B,Y]);s.useEffect(()=>{if(!xe)return;const Ie=window.setTimeout(()=>{if(j&&(ve===0||ve===c+1)){be.current=null,E(!0),ke(se+1);return}Y(!1)},qi);return()=>window.clearTimeout(Ie)},[se,c,j,xe,Y,ve]),s.useEffect(()=>{if(!M)return;let Ie=0;const We=requestAnimationFrame(()=>{Ie=requestAnimationFrame(()=>{const je=be.current;be.current=null;const Ue=Pe.current;if(Pe.current=0,E(!1),je!==null){de.current=je,ke(je);return}if(Ue!==0){ce(Ue);return}Y(!1)})});return()=>{cancelAnimationFrame(We),cancelAnimationFrame(Ie)}},[ce,Y,M]);const Q=`${j}:${c}`,Ne=s.useRef(Q);s.useEffect(()=>{if(Ne.current===Q)return;Ne.current=Q;const Ie=c>0?Math.min(se,c-1):0;me.current=null,re.current=null,Ce(!1),$e(0),ne(Ie),E(!0),ke(Ie+(j?1:0))},[se,c,j,Q]),s.useEffect(()=>{if(!ae)return;const Ie=window.setTimeout(()=>ge(!1),G0);return()=>window.clearTimeout(Ie)},[ae,se]),s.useEffect(()=>{if(!ie||c<2)return;const Ie=Math.max(x,.1)*1e3,We=window.setInterval(()=>{L&&ye||Ee(1)},Ie);return()=>window.clearInterval(We)},[x,c,Ee,ie,ye,L]);const Fe=s.useCallback(Ie=>{const We=me.current;if(!We||We.pointerId!==Ie.pointerId)return;me.current=null,re.current=null;const je=Se.current;if(je!=null&&je.hasPointerCapture(Ie.pointerId)&&je.releasePointerCapture(Ie.pointerId),!We.isActive){B&&$e(0);return}const A=!(Ie.timeStamp-We.lastTime>U0)&&Math.abs(We.velocity)>q0,ee=We.size>0&&Math.abs(We.offset-We.baseOffset)>We.size*Y0;if(Ce(!1),!A&&!ee){$e(0);return}const Te=ee?We.offset-We.baseOffset:We.velocity;let He=1;ee&&We.size>0&&(He=Math.max(1,Math.round(Math.abs(Te)/We.size))),$e(0),ce(Te<0?He:-He)},[ce,B]);s.useEffect(()=>{const Ie=We=>{re.current===null||We.pointerId!==re.current||Fe(We)};return window.addEventListener("pointerup",Ie),window.addEventListener("pointercancel",Ie),()=>{window.removeEventListener("pointerup",Ie),window.removeEventListener("pointercancel",Ie)}},[Fe]);const et=Ie=>{const We=Se.current;if(!q||c<2||!We||Ie.pointerType==="mouse"&&Ie.button!==0)return;be.current=null,Pe.current=0,J.current&&Y(!1);let je=0;const Ue=X.current;if(B&&Ue){const A=D?Ue.offsetWidth:Ue.offsetHeight;if(A>0){const ee=eb(Ue,D);let Te=de.current;j&&(Te===0||Te===c+1)?(Te=se+1,de.current=Te,E(!0),ke(Te),je=0):je=ee+Te*A,$e(je)}}We.setPointerCapture(Ie.pointerId),re.current=Ie.pointerId,me.current={pointerId:Ie.pointerId,startClientX:Ie.clientX,startClientY:Ie.clientY,axes:tb(We,`${r}-axis-probe`),size:D?We.offsetWidth:We.offsetHeight,isActive:!1,baseOffset:je,offset:je,lastTime:Ie.timeStamp,velocity:0}},Je=Ie=>{const We=me.current;if(!We||We.pointerId!==Ie.pointerId)return;if(Ie.pointerType==="mouse"&&Ie.buttons===0){Fe(Ie);return}const je=Ie.clientX-We.startClientX,Ue=Ie.clientY-We.startClientY,A=We.axes?nb(We.axes,je,Ue):{x:je,y:Ue},ee=D?A.x:A.y,Te=D?A.y:A.x,He=We.baseOffset+ee;if(!We.isActive){if(Math.max(Math.abs(ee),Math.abs(Te))<X0)return;if(Math.abs(Te)>Math.abs(ee)){const Ve=Se.current;Ve!=null&&Ve.hasPointerCapture(We.pointerId)&&Ve.releasePointerCapture(We.pointerId),me.current=null,re.current=null,B&&$e(0);return}We.isActive=!0,Ce(!0)}const Be=Ie.timeStamp-We.lastTime;Be>0&&(We.velocity=(He-We.offset)/Be,We.lastTime=Ie.timeStamp),We.offset=He,B&&$e(He)},dt=Ie=>{Fe(Ie)},tt=D?`translate3d(calc(${-ve*100}% + ${te}px), 0, 0)`:`translate3d(0, calc(${-ve*100}% + ${te}px), 0)`,De=j?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ib(r,n)}}),a.jsxs("div",{className:pt(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!D}),onMouseEnter:()=>Z(!0),onMouseLeave:()=>Z(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:Se,className:pt(`${r}-track`,{[`${r}-track-draggable`]:q,[`${r}-track-draggable-vertical`]:q&&!D}),onPointerDown:et,onPointerMove:Je,onPointerUp:dt,onPointerCancel:dt,onLostPointerCapture:Ie=>{re.current===Ie.pointerId&&Fe(Ie)},children:a.jsx("div",{ref:X,className:pt(`${r}-list`,{[`${r}-list-slide`]:B,[`${r}-list-slide-vertical`]:B&&!D,[`${r}-list-fade`]:!B}),style:B?{transform:tt,transition:V||M?"none":`transform ${qi}ms ${nu}`}:void 0,children:De.map((Ie,We)=>{const je=j?Io(We-1,c):We,A=j&&(We===0||We===c+1)?`clone-${We===0?"start":"end"}`:`slide-${je}`;return a.jsx("div",{className:pt(`${r}-slide`,{[`${r}-is-active`]:!B&&je===se}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:pt(`${r}-slider-image`,{[`${r}-contain`]:Ie.image.objectFit==="contain",[`${r}-cover`]:Ie.image.objectFit==="cover"}),src:Ie.image.url,alt:Ie.image.name??"",draggable:!1})})})},A)})})}),ue&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-prev`]:D,[`${r}-arrow-prev-vertical`]:!D,[`${r}-hover-arrow`]:le}),style:{color:I,"--arrow-hover-color":z,...pe},children:a.jsxs("button",{onClick:Ie=>{Ie.stopPropagation(),Ee(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${O.scalingValue(U,n)}, ${O.scalingValue(H*(D?1:-1),n)}) rotate(${D?"0deg":"90deg"})`},children:[G&&a.jsx(sn,{url:G,fill:I,hoverFill:z,className:pt(`${r}-arrow-img`,`${r}-mirror`),style:pe}),!G&&a.jsx(yc,{color:I,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-next`]:D,[`${r}-arrow-next-vertical`]:!D,[`${r}-hover-arrow`]:le}),style:{color:I,"--arrow-hover-color":z,...pe},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Ie=>{Ie.stopPropagation(),Ee(1)},style:{transform:`translate(${O.scalingValue(U*(D?-1:1),n)}, ${O.scalingValue(H,n)}) rotate(${D?"0deg":"90deg"})`},children:[G&&a.jsx(sn,{url:G,fill:I,hoverFill:z,className:`${r}-arrow-img`,style:pe}),!G&&a.jsx(yc,{color:I,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),P&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Ee(1)}),K&&a.jsx("div",{className:pt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:D,[`${r}-pagination-inside-left`]:!D}),style:D?{bottom:y(v.inset)}:{left:y(v.inset)},children:a.jsx("div",{className:pt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!D,[`${r}-animate-dots`]:ae}),style:{backgroundColor:k,gap:y(v.gapInactive-v.activeDot+v.dot),...D?{height:y(v.activeDot+v.paddingY*2),paddingTop:y(v.paddingY),paddingBottom:y(v.paddingY),paddingLeft:y(v.paddingActive),paddingRight:y(v.paddingActive)}:{width:y(v.activeDot+v.paddingY*2),paddingLeft:y(v.paddingY),paddingRight:y(v.paddingY),paddingTop:y(v.paddingActive),paddingBottom:y(v.paddingActive)},borderRadius:y(v.borderRadius),transform:`translate(${O.scalingValue(bo.offset.x,n)}, ${O.scalingValue(bo.offset.y,n)})`},children:d.map((Ie,We)=>{const je=We===se,Ue=je?v.activeDot:v.dot;return a.jsx("button",{onClick:()=>he(We),className:`${r}-pagination-item`,style:{width:y(v.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:je?T:$,width:y(Ue)}})},We)})},`${f}-${w}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:O.scalingValue(g,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((Ie,We)=>a.jsx("div",{className:pt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:We===se&&n,[`${r}-active`]:We===se}),style:{...l,width:"max-content",transitionDuration:`${Math.round(qi/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":_,"--link-hover-color":_,position:"relative",top:O.scalingValue(ja.offset.y,n),left:O.scalingValue(ja.offset.x,n)},children:a.jsx(Ri,{content:Ie.imageCaption})})},We))})]})]})]})}function yc({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.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 rb=`import React, { useCallback, useEffect, useRef, useState } from 'react';
19570
19570
  import cn from 'classnames';
19571
19571
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
19572
19572
  import { scalingValue } from '../utils/scalingValue';
@@ -20747,7 +20747,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
20747
20747
  </svg>
20748
20748
  );
20749
20749
  }
20750
- `,ab={type:"object",version:1,settings:{sizing:"manual",properties:{trigger:{type:"object",scope:"common",title:"Trigger",display:{type:"toggle-cycle-numeric-input",enum:["click","drag","auto"],inputs:{click:"none",drag:"none",auto:"single"},defaultValue:3,showDash:!1},min:1,max:5,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical"]}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["slide","fade in","reveal"]}},nav:{type:"string",scope:"common",title:"Nav",display:{type:"toggle-cycle",enum:["classic","no"]}},navSize:{type:"string",scope:"layout",title:"Nav Size",display:{type:"toggle-cycle",enum:["s","m","l"]}},navUnit:{type:"number",scope:"layout",title:"",display:{type:"numeric-input",visible:!1},min:0,max:1},controls:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},controlsMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},show:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","on hover","never"]}},paddingX:{type:"number",scope:"layout",title:"Padding X",display:{type:"numeric-input"},min:-9999,max:9999},paddingY:{type:"number",scope:"layout",title:"Padding Y",display:{type:"numeric-input"},min:-9999,max:9999},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"palette-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"palette-color-picker"}},navColor:{type:"string",scope:"common",title:"Dot Nav",display:{type:"palette-color-picker"}},navPaginationColor:{type:"string",scope:"common",title:"Active Nav",display:{type:"palette-color-picker"}},navBackgroundColor:{type:"string",scope:"common",title:"BG Nav",display:{type:"palette-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"palette-color-picker"}},titleColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{type:"object",scope:"common",title:"",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},defaults:{trigger:{sizeType:"drag",value:3,min:1,max:5},direction:"horizontal",transition:"slide",nav:"classic",controls:null,show:"always",controlsColor:"#000000",controlsHoverColor:"#3F3F3F",navColor:"#A4A4A4",navPaginationColor:"#FFFFFF",navBackgroundColor:"#000000",linkColor:"#2E12F0",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{controlsMaxWidth:30/1440,paddingX:0,paddingY:0,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,titleFontSize:16/375,titleLineHeight:16/375,navSize:"m",navUnit:1/375}},displayRules:[{if:{name:"show",value:"never"},then:{name:"properties.controlsColor.display.visible",value:!1}},{if:{name:"show",value:"never"},then:{name:"properties.controlsHoverColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navPaginationColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navBackgroundColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navSize.display.visible",value:!1}}],layout:["__componentName__","trigger","direction","transition","nav","navSize","controls","controlsMaxWidth","show","paddingX","paddingY","captionMarginTop","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["trigger","direction"]},{type:"row",title:"",items:["transition","nav"]},{type:"row",title:"",items:["navSize"]},{type:"group",title:"Controls",items:[{type:"row",title:"",items:["controls","controlsMaxWidth"]},{type:"row",title:"",items:["paddingX","paddingY"]},{type:"row",title:"",items:["show"]}]}]},{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"]}]}],paletteBookmark:{items:["controlsColor","controlsHoverColor","navPaginationColor","navColor","navBackgroundColor","titleColor","linkColor"],panelIds:["general","typeStyle"]},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/Component-default-1.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Earth-orbital mission"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Salton Sea from Above"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module Pilot"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module 3 porch"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Command Module"}]}]}]}},sb={element:ob,id:"slider-2-0",name:"Slider 2.0",category:"galleries",version:1,defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},schema:ab,sourceCode:rb,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},Oi=300/1440,lb=8/1440,vi=.004;function cb(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function xc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function vc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:D.scalingValue((o-t)/2,i)}}function db(e){return`
20750
+ `,ab={type:"object",version:1,settings:{sizing:"manual",properties:{trigger:{type:"object",scope:"common",title:"Trigger",display:{type:"toggle-cycle-numeric-input",enum:["click","drag","auto"],inputs:{click:"none",drag:"none",auto:"single"},defaultValue:3,showDash:!1},min:1,max:5,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical"]}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["slide","fade in","reveal"]}},nav:{type:"string",scope:"common",title:"Nav",display:{type:"toggle-cycle",enum:["classic","no"]}},navSize:{type:"string",scope:"layout",title:"Nav Size",display:{type:"toggle-cycle",enum:["s","m","l"]}},navUnit:{type:"number",scope:"layout",title:"",display:{type:"numeric-input",visible:!1},min:0,max:1},controls:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},controlsMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},show:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","on hover","never"]}},paddingX:{type:"number",scope:"layout",title:"Padding X",display:{type:"numeric-input"},min:-9999,max:9999},paddingY:{type:"number",scope:"layout",title:"Padding Y",display:{type:"numeric-input"},min:-9999,max:9999},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"palette-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"palette-color-picker"}},navColor:{type:"string",scope:"common",title:"Dot Nav",display:{type:"palette-color-picker"}},navPaginationColor:{type:"string",scope:"common",title:"Active Nav",display:{type:"palette-color-picker"}},navBackgroundColor:{type:"string",scope:"common",title:"BG Nav",display:{type:"palette-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"palette-color-picker"}},titleColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{type:"object",scope:"common",title:"",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},defaults:{trigger:{sizeType:"drag",value:3,min:1,max:5},direction:"horizontal",transition:"slide",nav:"classic",controls:null,show:"always",controlsColor:"#000000",controlsHoverColor:"#3F3F3F",navColor:"#A4A4A4",navPaginationColor:"#FFFFFF",navBackgroundColor:"#000000",linkColor:"#2E12F0",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{controlsMaxWidth:30/1440,paddingX:0,paddingY:0,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,titleFontSize:16/375,titleLineHeight:16/375,navSize:"m",navUnit:1/375}},displayRules:[{if:{name:"show",value:"never"},then:{name:"properties.controlsColor.display.visible",value:!1}},{if:{name:"show",value:"never"},then:{name:"properties.controlsHoverColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navPaginationColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navBackgroundColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navSize.display.visible",value:!1}}],layout:["__componentName__","trigger","direction","transition","nav","navSize","controls","controlsMaxWidth","show","paddingX","paddingY","captionMarginTop","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["trigger","direction"]},{type:"row",title:"",items:["transition","nav"]},{type:"row",title:"",items:["navSize"]},{type:"group",title:"Controls",items:[{type:"row",title:"",items:["controls","controlsMaxWidth"]},{type:"row",title:"",items:["paddingX","paddingY"]},{type:"row",title:"",items:["show"]}]}]},{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"]}]}],paletteBookmark:{items:["controlsColor","controlsHoverColor","navPaginationColor","navColor","navBackgroundColor","titleColor","linkColor"],panelIds:["general","typeStyle"]},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/Component-default-1.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Earth-orbital mission"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Salton Sea from Above"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module Pilot"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module 3 porch"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Command Module"}]}]}]}},sb={element:ob,id:"slider-2-0",name:"Slider 2.0",category:"galleries",version:1,defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},schema:ab,sourceCode:rb,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},Oi=300/1440,lb=8/1440,vi=.004;function cb(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function xc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function vc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:O.scalingValue((o-t)/2,i)}}function db(e){return`
20751
20751
  .${e}-wrapper {
20752
20752
  box-sizing: border-box;
20753
20753
  display: flex;
@@ -20964,7 +20964,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
20964
20964
  width: var(--cntrl-article-width, 100vw) !important;
20965
20965
  height: var(--cntrl-viewport-height, 100vh) !important;
20966
20966
  }
20967
- `}const ub="rgba(28,31,34,0.9)",An=500,xi="cubic-bezier(0.22, 1, 0.36, 1)",pb=72,mb=50,gb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},hb=[];function fb(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 yb(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function xb(e){const[t]=e.media;return t!=null&&t.url?t:null}function vb(e){if(!Array.isArray(e)||e.length===0)return[];if(fb(e)){const t=[];for(const n of e){const i=yb(n);if(!i)continue;const o=xb(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 us(e){return e.type==="video"}function bb(e){e.pause(),e.removeAttribute("src"),e.load()}function Sr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function wb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const Sb=1140/1440;function Cb(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function $b(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function Tb(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Ib({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{bb(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d,style:i})}function Rb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const x=i==="cover",w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),v=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),G=s.useRef(!1),W=s.useRef(null),[U,H]=s.useState(null),[I,z]=s.useState("opening"),[$,T]=s.useState(0),[A,_]=s.useState(0),[g,B]=s.useState(!1),[P,Y]=s.useState(!1),[ie,L]=s.useState(!1),O=s.useRef(n),K=t[n],ue=K?us(K):!1,le=A!==0||g,F=s.useCallback(re=>{G.current=re,B(re)},[]),pe=s.useCallback(()=>{W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),j=s.useCallback(()=>{pe(),W.current=window.setTimeout(()=>{pe(),F(!1)},An+32)},[pe,F]),se=s.useCallback(()=>{const re=w.current,ge=m.current;if(!re)return;const ye=re.getBoundingClientRect(),Z=ye.width,Q=ye.height;if(!Z||!Q)return;if(i==="cover"){H({width:Z,height:Q,left:ye.left,top:ye.top});return}if(!ge){H(Sr(re));return}const{width:ce,height:we}=wb(ge);if(!ce||!we){H(Sr(re));return}const Pe=ce/we,Ce=Z/Q;if(Pe>Ce){const X=Z/Pe;H({width:Z,height:X,left:ye.left,top:ye.top+(Q-X)/2})}else{const X=Q*Pe;H({width:X,height:Q,left:ye.left+(Z-X)/2,top:ye.top})}},[i]);s.useEffect(()=>{se();const re=w.current;if(!re)return;const ge=new ResizeObserver(()=>se());return ge.observe(re),()=>ge.disconnect()},[se,n]),s.useEffect(()=>{I==="opening"&&U&&z("open")},[I,U]),s.useEffect(()=>{if(I!=="closing")return;const re=setTimeout(()=>r(),An);return()=>clearTimeout(re)},[I,r]),s.useEffect(()=>()=>{pe()},[pe]),s.useLayoutEffect(()=>{if(O.current===n)return;pe(),T(0),_(0),F(!1),L(!1),Y(!1),f.current=0,v.current=0,C.current="none",y.current=!1,h.current=null,S.current=!1;const re=w.current;re&&H(Sr(re)),O.current=n},[n,F,pe]),s.useEffect(()=>{if(I!=="open")return;let re=null;const ge=()=>{re&&(document.removeEventListener("click",re,!0),re=null)},ye=()=>{ge(),re=Ce=>{Ce.stopPropagation(),Ce.preventDefault(),ge()},document.addEventListener("click",re,!0)},Z=Ce=>{pe(),G.current=!1,B(!1),_(0),Y(!1),y.current=!1,v.current=0,C.current="none";const X=w.current;X&&H(Sr(X)),Ce<0?d():l()},Q=Ce=>{if(Math.abs(Ce)>mb&&t.length>1){Z(Ce);return}F(!0),_(0),j()},ce=Ce=>{if(Ce.touches.length!==1||G.current)return;const X=Ce.touches[0];S.current=!0,h.current={x:X.clientX,y:X.clientY},C.current="none",v.current=0,y.current=!1},we=Ce=>{if(!h.current||Ce.touches.length!==1||G.current)return;const X=Ce.touches[0],me=X.clientX-h.current.x,ae=X.clientY-h.current.y;if(C.current==="none"){if(Math.abs(me)<10&&Math.abs(ae)<10)return;if(Math.abs(me)>Math.abs(ae)){if(t.length<=1)return;C.current="horizontal"}else if(ae>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,Y(!0),v.current=me,_(me),Ce.preventDefault();return}C.current==="vertical"&&(y.current=!0,Y(!0),f.current=ae,T(ae),Ce.preventDefault())},Pe=()=>{if(!h.current)return;const Ce=C.current,X=y.current;if(X&&Ce==="horizontal")Q(v.current),ye();else if(X&&Ce==="vertical")if(f.current>pb){const ae=window.innerHeight;f.current=ae,L(!0),T(ae),z("closing")}else f.current=0,T(0),ye();else Ce==="horizontal"&&Math.abs(v.current)>0&&(Q(v.current),ye());h.current=null,C.current="none",v.current=0,y.current=!1,Y(!1)};return document.addEventListener("touchstart",ce,{passive:!0}),document.addEventListener("touchmove",we,{passive:!1}),document.addEventListener("touchend",Pe),document.addEventListener("touchcancel",Pe),()=>{document.removeEventListener("touchstart",ce),document.removeEventListener("touchmove",we),document.removeEventListener("touchend",Pe),document.removeEventListener("touchcancel",Pe),ge()}},[I,t.length,d,l,F,j,pe]),s.useEffect(()=>{const re=ge=>{ge.key==="Escape"&&(ge.preventDefault(),ge.stopPropagation(),I!=="closing"&&z("closing"))};return window.addEventListener("keydown",re,!0),()=>window.removeEventListener("keydown",re,!0)},[I]);const ne=()=>{I!=="closing"&&z("closing")},ve=I==="open",Me=I==="closing",xe=$>0?Math.max(0,1-$/500):1,b=$>0?Math.max(.35,1-$/500):1,M=re=>{if(re.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ge=re.currentTarget.getBoundingClientRect(),ye=re.clientY-ge.top,Z=Math.min(52,ge.height*.2);if(!(ye>ge.height-Z)){if(re.clientX-ge.left<ge.width/2){l();return}d()}},E=re=>{if(t.length<=1)return;const ge=re.currentTarget.getBoundingClientRect(),ye=re.clientX-ge.left,Z=re.clientY-ge.top,Q=Math.min(52,ge.height*.2);if(Z>ge.height-Q){re.currentTarget.style.cursor="default";return}re.currentTarget.style.cursor=ye<ge.width/2?"w-resize":"e-resize"},V=s.useCallback(re=>{re.propertyName!=="transform"||!G.current||(pe(),F(!1))},[pe,F]),Se=le?`translateX(${A}px)`:$>0?`translateY(${$}px)`:void 0,te={position:"fixed",top:U==null?void 0:U.top,left:U==null?void 0:U.left,width:U==null?void 0:U.width,height:U==null?void 0:U.height,objectFit:i==="cover"?"cover":"contain",transform:Se,opacity:$>0?b:I==="opening"||Me?0:1,transition:P&&!g?"none":g?`transform ${An}ms ${xi}`:ie?`transform ${An}ms ${xi}, opacity ${An}ms ${xi}`:I==="opening"||Me?`opacity ${An}ms ${xi}`:"none",pointerEvents:ue&&ve&&!le?"auto":"none",touchAction:ue&&ve?"none":void 0,zIndex:9998},$e=U?{position:"fixed",top:U.top,height:U.height,width:U.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:I==="open"?"none":void 0},onClick:ne,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:ve?xe:0,transition:P?"none":`opacity ${An}ms ${xi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:x?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:w,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${An}ms ${xi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:w,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${An}ms ${xi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),U&&K&&(ue?a.jsx(Ib,{src:K.url,phase:I,mediaRef:m,mediaStyle:te,onLoadedMetadata:se,onClick:M,onMouseMove:E,onTransitionEnd:V},`${n}-${K.url}`):a.jsx("img",{ref:m,src:K.url,alt:K.name,onLoad:se,onTransitionEnd:V,style:te},`${n}-${K.url}`)),ve&&$e&&t.length>1&&!ue&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...$e,left:U.left,cursor:"w-resize",pointerEvents:le?"none":"auto"},onClick:re=>{if(S.current){S.current=!1;return}re.stopPropagation(),l()}}),a.jsx("div",{style:{...$e,left:U.left+U.width/2,cursor:"e-resize",pointerEvents:le?"none":"auto"},onClick:re=>{if(S.current){S.current=!1;return}re.stopPropagation(),d()}})]})]})}function bc({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const x=`${e}-gallery-${us(t)?"video":"image"}`,w=r.display==="cover",m=$b(r),h=I=>D.scalingValue(I,l??!1),f=n??Oi,v=o?{width:"100%",maxWidth:"100%"}:{width:h(f),maxWidth:"100%"},C=i?{borderRadius:h(i)}:{},y={...v,...w?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...C},S={...w?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...w?{}:C},W={className:x,style:S,onClick:p?I=>{I.stopPropagation(),p()}:void 0},U=Math.max(d,vi),H=us(t)?a.jsx("video",{...W,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...W,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[w?a.jsx("div",{style:y,children:H}):H,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:h(U)}})]})}function Lb({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const x=t==="a"?i:t==="c"?o:0,w=x>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&w&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"aria-hidden":"true"}),c&&t==="c"&&a.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),a.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&w&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"aria-hidden":"true"}),c&&t==="a"&&a.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function Pb(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function wc({P:e,scaled:t,height:n,paired:i}){return a.jsx("div",{"data-controls":"titleTopPadding",...i?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:t(n)}})}function Sc({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:d}){return a.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...r==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...r==="left"?{left:0}:{right:0},width:n(i),height:"100%",...d}})}function Va({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:r,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=s.useRef(null),[x,w]=s.useState(0),m=t??"",h=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!h)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const v=()=>w(f.offsetHeight);v();const C=new ResizeObserver(v);return C.observe(f),()=>C.disconnect()},[m,h]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${x}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:d,children:m})})]})})}const Cc=45;function $c(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const r=parseFloat(o);if(!Number.isNaN(r))return r}i=i.parentElement}return n}function Eb(e){const t=$c(e,"--cntrl-viewport-height",window.innerHeight),n=$c(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function Mb(e,t,n){const{top:i,centerY:o}=Eb(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const r=e.top+e.height/2;return Math.abs(r-o)}function kb(e,t,n){const i=Array.from({length:t},(l,d)=>{const c=e.current[d];if(!c)return 0;const u=c.getBoundingClientRect(),p=Mb(u,n,c);return Math.exp(-(p*p)/(2*Cc*Cc))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function Ab(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(c,u)=>u===0?1:0),dominantIndex:0}));return s.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let c=0;const u=()=>{l(kb(i,e,n))},p=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:c=>u=>{i.current[c]=u},opacities:o,dominantIndex:r}}function Fb(e,t){const[n,i]=s.useState(e),o=s.useRef(e);return s.useEffect(()=>{if(!t){o.current=e,i(e);return}const r=Array.from(o.current),l=Array.from(e),d=Math.max(r.length,l.length);if(d===0||o.current===e)return;let c=0;const u=window.setInterval(()=>{c+=1;const p=[...l.slice(0,c),...r.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function _b({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var nt;const{prefix:l}=D.useScopedStyles(),d=s.useMemo(()=>db(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",x=(e==null?void 0:e.imgWidth)??Oi,w=(e==null?void 0:e.titleWidth)??Sb,m=Cb(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??lb,f=(e==null?void 0:e.position)??"center",v=(e==null?void 0:e.titleTopPadding)??0,C=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,S=Pb(e==null?void 0:e.transition),G=(e==null?void 0:e.lightbox)??"on",W=p==="b",U=S==="fade"||S==="retype",{setTitleRef:H,dominantIndex:I}=Ab(c.length,U,f),z=((nt=c[I])==null?void 0:nt.title)??"",$=Fb(z,S==="retype"),T=S==="fade"||S==="retype",A=S==="retype"?$:z,_=W?void 0:{width:D.scalingValue(x,n??!1)},g=G==="on"&&(!n||i||o),B=o??!1,P=(e==null?void 0:e.galleryPaddingRight)??0,Y=(e==null?void 0:e.galleryPaddingLeft)??0,ie=(e==null?void 0:e.galleryPaddingBetween)??0,L=at=>D.scalingValue(at,n??!1),K={width:L(w)},ue=p==="a"?P:Y,le=W?{width:"100%"}:{width:`calc(100% - ${L(x)} - ${L(ue)})`,...p==="c"?{marginLeft:"auto"}:{}},F=Math.max(P,vi),pe=Math.max(Y,vi),j=Math.max(ie,vi),se=Math.max(v,vi),ne=Math.max(C,vi),ve=Math.max(y,vi),Me=Math.max(0,(u??1)-(x??Oi)),xe=p==="a"?Math.max(0,(u??1)-(x??Oi)-P):p==="c"?Math.max(0,(u??1)-(x??Oi)-Y):p==="b"?u??1:1,b=B&&(p==="a"||p==="b"||p==="c")&&f==="top",M=B&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),E=B&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),V=c.length>1,Se=W?void 0:L((p==="c"?Y:P)+(x??Oi)),te=p==="c"&&Se?{left:Se}:void 0,$e=p==="a"&&Se?{right:Se}:void 0,re=W?{left:0,width:"100%"}:p==="a"?{right:L(P),width:L(x)}:{left:L(Y),width:L(x)},{titleColor:ge,titleFontFamily:ye,titleFontSettings:Z,titleFontSize:Q,titleLineHeight:ce,titleLetterSpacing:we,titleWordSpacing:Pe,titleAlign:Ce,titleTextAppearance:X,lightboxCounterColor:me,lightboxCounterFontFamily:ae,lightboxCounterFontSettings:q,lightboxCounterFontSize:de,lightboxCounterLineHeight:ke,lightboxCounterLetterSpacing:he,lightboxCounterWordSpacing:J,lightboxCounterTextAppearance:Ne}=e??{},Fe={fontSettings:{fontFamily:ye,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:ce,letterSpacing:we??0,wordSpacing:Pe??0,textAlign:Ce??"left",textAppearance:X,color:ge??"#000000"},Je=an(qt(Fe,n)),dt=K,tt=vc(Q,ce,l,n),De=xc(Q,ce,`${l}-title`,`${l}-text-tight-leading`),Ie={fontSettings:{fontFamily:ae,fontWeight:(q==null?void 0:q.fontWeight)??400,fontStyle:(q==null?void 0:q.fontStyle)??"normal"},fontSize:de??.01,lineHeight:ke,letterSpacing:he??0,wordSpacing:J??0,textAppearance:Ne,color:me??"#DEDDDD"},je={...an(qt(Ie,n)),...vc(de,ke,l,n)},Ue=xc(de,ke,`${l}-lightbox-counter`,`${l}-text-tight-leading`),k=D.buildColorVars(l,{titleColor:ge??"#000000",lightboxCounterColor:me??"#DEDDDD"},gb,hb),ee=s.useRef(null),[Te,He]=s.useState(!1),[Be,Ve]=s.useState([]),[rt,Ze]=s.useState(0),_e=s.useCallback((at,st)=>{g&&(Ve(at),Ze(st),He(!0))},[g]),qe=s.useCallback(()=>{He(!1)},[]),Oe=s.useMemo(()=>{const at={...k},st=ee.current?getComputedStyle(ee.current).getPropertyValue("--cntrl-article-width").trim():"";return st&&(at["--cntrl-article-width"]=st),at},[k,Te]);return s.useEffect(()=>{if(!Te||G!=="on"||typeof document>"u")return;const at=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=at}},[Te,G]),s.useEffect(()=>{!n||o||i||He(!1)},[n,o,i]),s.useEffect(()=>{G==="off"&&He(!1)},[G]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:k,children:a.jsxs("div",{ref:ee,className:`${l}-wrapper`,style:{width:D.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?L(v):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?L(C):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?L(y):void 0},children:[T&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Va,{P:l,title:A,position:f,titleRef:()=>{},titleClassName:`${De} ${l}-single-title`,titleContainerStyle:{...tt,...le},titleTextBoxStyle:dt,titleStyle:Je,showTextBoxOutline:B,topPaddingControl:b?wc({P:l,scaled:L,height:se,paired:!1}):void 0})}),c.map((at,st)=>{const St=vb(at.gallery),Yt=st<c.length-1,Zt=St.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),vt={P:l,position:f,titleRef:H(st),titleClassName:De,titleContainerStyle:tt,titleTextBoxStyle:T?{maxWidth:"100%"}:dt,titleStyle:Je,showTextBoxOutline:B&&!T,topPaddingControl:b&&!T?wc({P:l,scaled:L,height:se,paired:V}):void 0};return a.jsxs("div",{"data-item-index":st,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Yt?L(ie):void 0},children:[M&&Sc({P:l,controlKey:"titleLeftPadding",scaled:L,width:ne,maxFraction:xe,side:"left",paired:V,anchorStyle:te}),E&&Sc({P:l,controlKey:"titleRightPadding",scaled:L,width:ve,maxFraction:xe,side:"right",paired:V,anchorStyle:$e}),B&&Yt&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-control-anchor`,style:{bottom:0,height:L(j),...re}}),W?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:St.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const xt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(bc,{P:l,media:wt,imgWidth:x||void 0,cornerRadius:h||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<St.length-1,showControls:B,onMediaClick:g&&xt>=0?()=>_e(Zt,xt):void 0},`${wt.url}-${At}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Va,{...vt,title:T?"":at.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Va,{...vt,title:T?"":at.title}),St.length>0&&a.jsx(Lb,{P:l,layoutType:p,galleryWidthStyle:_,galleryPaddingRight:P,galleryPaddingLeft:Y,galleryPaddingRightWidth:F,galleryPaddingLeftWidth:pe,galleryPaddingMaxFraction:Me,showControls:B,scaled:L,children:St.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const xt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(bc,{P:l,media:wt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<St.length-1,showControls:B,onMediaClick:g&&xt>=0?()=>_e(Zt,xt):void 0},`${wt.url}-${At}`)})})]})]},st)})]})}),Te&&G==="on"&&typeof document<"u"&&e&&(()=>{const at=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx("div",{style:Oe,"data-selection":"none",children:a.jsx(Rb,{prefix:l,items:Be,index:rt,imageDisplay:Tb(e.lightboxImageDisplay),isEditor:n,onClose:qe,onPrev:()=>Ze(st=>(st-1+Be.length)%Be.length),onNext:()=>Ze(st=>(st+1)%Be.length),counterClassName:Ue,counterStyle:je,backgroundColor:e.backgroundColor??ub})}),at)})()]})}const Nb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
20967
+ `}const ub="rgba(28,31,34,0.9)",An=500,xi="cubic-bezier(0.22, 1, 0.36, 1)",pb=72,mb=50,gb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},hb=[];function fb(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 yb(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function xb(e){const[t]=e.media;return t!=null&&t.url?t:null}function vb(e){if(!Array.isArray(e)||e.length===0)return[];if(fb(e)){const t=[];for(const n of e){const i=yb(n);if(!i)continue;const o=xb(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 us(e){return e.type==="video"}function bb(e){e.pause(),e.removeAttribute("src"),e.load()}function Sr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function wb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const Sb=1140/1440;function Cb(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function $b(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function Tb(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Ib({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{bb(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d,style:i})}function Rb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const x=i==="cover",w=s.useRef(null),m=s.useRef(null),h=s.useRef(null),f=s.useRef(0),v=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),S=s.useRef(!1),G=s.useRef(!1),W=s.useRef(null),[U,H]=s.useState(null),[I,z]=s.useState("opening"),[$,T]=s.useState(0),[k,_]=s.useState(0),[g,D]=s.useState(!1),[P,q]=s.useState(!1),[ie,L]=s.useState(!1),B=s.useRef(n),K=t[n],ue=K?us(K):!1,le=k!==0||g,F=s.useCallback(ae=>{G.current=ae,D(ae)},[]),pe=s.useCallback(()=>{W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),j=s.useCallback(()=>{pe(),W.current=window.setTimeout(()=>{pe(),F(!1)},An+32)},[pe,F]),se=s.useCallback(()=>{const ae=w.current,ge=m.current;if(!ae)return;const ye=ae.getBoundingClientRect(),Z=ye.width,J=ye.height;if(!Z||!J)return;if(i==="cover"){H({width:Z,height:J,left:ye.left,top:ye.top});return}if(!ge){H(Sr(ae));return}const{width:de,height:be}=wb(ge);if(!de||!be){H(Sr(ae));return}const Pe=de/be,Se=Z/J;if(Pe>Se){const X=Z/Pe;H({width:Z,height:X,left:ye.left,top:ye.top+(J-X)/2})}else{const X=J*Pe;H({width:X,height:J,left:ye.left+(Z-X)/2,top:ye.top})}},[i]);s.useEffect(()=>{se();const ae=w.current;if(!ae)return;const ge=new ResizeObserver(()=>se());return ge.observe(ae),()=>ge.disconnect()},[se,n]),s.useEffect(()=>{I==="opening"&&U&&z("open")},[I,U]),s.useEffect(()=>{if(I!=="closing")return;const ae=setTimeout(()=>r(),An);return()=>clearTimeout(ae)},[I,r]),s.useEffect(()=>()=>{pe()},[pe]),s.useLayoutEffect(()=>{if(B.current===n)return;pe(),T(0),_(0),F(!1),L(!1),q(!1),f.current=0,v.current=0,C.current="none",y.current=!1,h.current=null,S.current=!1;const ae=w.current;ae&&H(Sr(ae)),B.current=n},[n,F,pe]),s.useEffect(()=>{if(I!=="open")return;let ae=null;const ge=()=>{ae&&(document.removeEventListener("click",ae,!0),ae=null)},ye=()=>{ge(),ae=Se=>{Se.stopPropagation(),Se.preventDefault(),ge()},document.addEventListener("click",ae,!0)},Z=Se=>{pe(),G.current=!1,D(!1),_(0),q(!1),y.current=!1,v.current=0,C.current="none";const X=w.current;X&&H(Sr(X)),Se<0?d():l()},J=Se=>{if(Math.abs(Se)>mb&&t.length>1){Z(Se);return}F(!0),_(0),j()},de=Se=>{if(Se.touches.length!==1||G.current)return;const X=Se.touches[0];S.current=!0,h.current={x:X.clientX,y:X.clientY},C.current="none",v.current=0,y.current=!1},be=Se=>{if(!h.current||Se.touches.length!==1||G.current)return;const X=Se.touches[0],me=X.clientX-h.current.x,re=X.clientY-h.current.y;if(C.current==="none"){if(Math.abs(me)<10&&Math.abs(re)<10)return;if(Math.abs(me)>Math.abs(re)){if(t.length<=1)return;C.current="horizontal"}else if(re>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,q(!0),v.current=me,_(me),Se.preventDefault();return}C.current==="vertical"&&(y.current=!0,q(!0),f.current=re,T(re),Se.preventDefault())},Pe=()=>{if(!h.current)return;const Se=C.current,X=y.current;if(X&&Se==="horizontal")J(v.current),ye();else if(X&&Se==="vertical")if(f.current>pb){const re=window.innerHeight;f.current=re,L(!0),T(re),z("closing")}else f.current=0,T(0),ye();else Se==="horizontal"&&Math.abs(v.current)>0&&(J(v.current),ye());h.current=null,C.current="none",v.current=0,y.current=!1,q(!1)};return document.addEventListener("touchstart",de,{passive:!0}),document.addEventListener("touchmove",be,{passive:!1}),document.addEventListener("touchend",Pe),document.addEventListener("touchcancel",Pe),()=>{document.removeEventListener("touchstart",de),document.removeEventListener("touchmove",be),document.removeEventListener("touchend",Pe),document.removeEventListener("touchcancel",Pe),ge()}},[I,t.length,d,l,F,j,pe]),s.useEffect(()=>{const ae=ge=>{ge.key==="Escape"&&(ge.preventDefault(),ge.stopPropagation(),I!=="closing"&&z("closing"))};return window.addEventListener("keydown",ae,!0),()=>window.removeEventListener("keydown",ae,!0)},[I]);const ne=()=>{I!=="closing"&&z("closing")},ve=I==="open",ke=I==="closing",xe=$>0?Math.max(0,1-$/500):1,b=$>0?Math.max(.35,1-$/500):1,M=ae=>{if(ae.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ge=ae.currentTarget.getBoundingClientRect(),ye=ae.clientY-ge.top,Z=Math.min(52,ge.height*.2);if(!(ye>ge.height-Z)){if(ae.clientX-ge.left<ge.width/2){l();return}d()}},E=ae=>{if(t.length<=1)return;const ge=ae.currentTarget.getBoundingClientRect(),ye=ae.clientX-ge.left,Z=ae.clientY-ge.top,J=Math.min(52,ge.height*.2);if(Z>ge.height-J){ae.currentTarget.style.cursor="default";return}ae.currentTarget.style.cursor=ye<ge.width/2?"w-resize":"e-resize"},V=s.useCallback(ae=>{ae.propertyName!=="transform"||!G.current||(pe(),F(!1))},[pe,F]),Ce=le?`translateX(${k}px)`:$>0?`translateY(${$}px)`:void 0,te={position:"fixed",top:U==null?void 0:U.top,left:U==null?void 0:U.left,width:U==null?void 0:U.width,height:U==null?void 0:U.height,objectFit:i==="cover"?"cover":"contain",transform:Ce,opacity:$>0?b:I==="opening"||ke?0:1,transition:P&&!g?"none":g?`transform ${An}ms ${xi}`:ie?`transform ${An}ms ${xi}, opacity ${An}ms ${xi}`:I==="opening"||ke?`opacity ${An}ms ${xi}`:"none",pointerEvents:ue&&ve&&!le?"auto":"none",touchAction:ue&&ve?"none":void 0,zIndex:9998},$e=U?{position:"fixed",top:U.top,height:U.height,width:U.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:I==="open"?"none":void 0},onClick:ne,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:ve?xe:0,transition:P?"none":`opacity ${An}ms ${xi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:x?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:w,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${An}ms ${xi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:w,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${An}ms ${xi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),U&&K&&(ue?a.jsx(Ib,{src:K.url,phase:I,mediaRef:m,mediaStyle:te,onLoadedMetadata:se,onClick:M,onMouseMove:E,onTransitionEnd:V},`${n}-${K.url}`):a.jsx("img",{ref:m,src:K.url,alt:K.name,onLoad:se,onTransitionEnd:V,style:te},`${n}-${K.url}`)),ve&&$e&&t.length>1&&!ue&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...$e,left:U.left,cursor:"w-resize",pointerEvents:le?"none":"auto"},onClick:ae=>{if(S.current){S.current=!1;return}ae.stopPropagation(),l()}}),a.jsx("div",{style:{...$e,left:U.left+U.width/2,cursor:"e-resize",pointerEvents:le?"none":"auto"},onClick:ae=>{if(S.current){S.current=!1;return}ae.stopPropagation(),d()}})]})]})}function bc({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const x=`${e}-gallery-${us(t)?"video":"image"}`,w=r.display==="cover",m=$b(r),h=I=>O.scalingValue(I,l??!1),f=n??Oi,v=o?{width:"100%",maxWidth:"100%"}:{width:h(f),maxWidth:"100%"},C=i?{borderRadius:h(i)}:{},y={...v,...w?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...C},S={...w?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...w?{}:C},W={className:x,style:S,onClick:p?I=>{I.stopPropagation(),p()}:void 0},U=Math.max(d,vi),H=us(t)?a.jsx("video",{...W,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...W,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[w?a.jsx("div",{style:y,children:H}):H,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:h(U)}})]})}function Lb({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const x=t==="a"?i:t==="c"?o:0,w=x>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&w&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"aria-hidden":"true"}),c&&t==="c"&&a.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),a.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&w&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"aria-hidden":"true"}),c&&t==="a"&&a.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function Pb(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function wc({P:e,scaled:t,height:n,paired:i}){return a.jsx("div",{"data-controls":"titleTopPadding",...i?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:t(n)}})}function Sc({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:d}){return a.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...r==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...r==="left"?{left:0}:{right:0},width:n(i),height:"100%",...d}})}function Va({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:r,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=s.useRef(null),[x,w]=s.useState(0),m=t??"",h=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!h)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const v=()=>w(f.offsetHeight);v();const C=new ResizeObserver(v);return C.observe(f),()=>C.disconnect()},[m,h]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${x}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:d,children:m})})]})})}const Cc=45;function $c(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const r=parseFloat(o);if(!Number.isNaN(r))return r}i=i.parentElement}return n}function Eb(e){const t=$c(e,"--cntrl-viewport-height",window.innerHeight),n=$c(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function Mb(e,t,n){const{top:i,centerY:o}=Eb(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const r=e.top+e.height/2;return Math.abs(r-o)}function kb(e,t,n){const i=Array.from({length:t},(l,d)=>{const c=e.current[d];if(!c)return 0;const u=c.getBoundingClientRect(),p=Mb(u,n,c);return Math.exp(-(p*p)/(2*Cc*Cc))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function Ab(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(c,u)=>u===0?1:0),dominantIndex:0}));return s.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let c=0;const u=()=>{l(kb(i,e,n))},p=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:c=>u=>{i.current[c]=u},opacities:o,dominantIndex:r}}function Fb(e,t){const[n,i]=s.useState(e),o=s.useRef(e);return s.useEffect(()=>{if(!t){o.current=e,i(e);return}const r=Array.from(o.current),l=Array.from(e),d=Math.max(r.length,l.length);if(d===0||o.current===e)return;let c=0;const u=window.setInterval(()=>{c+=1;const p=[...l.slice(0,c),...r.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function _b({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var nt;const{prefix:l}=O.useScopedStyles(),d=s.useMemo(()=>db(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",x=(e==null?void 0:e.imgWidth)??Oi,w=(e==null?void 0:e.titleWidth)??Sb,m=Cb(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??lb,f=(e==null?void 0:e.position)??"center",v=(e==null?void 0:e.titleTopPadding)??0,C=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,S=Pb(e==null?void 0:e.transition),G=(e==null?void 0:e.lightbox)??"on",W=p==="b",U=S==="fade"||S==="retype",{setTitleRef:H,dominantIndex:I}=Ab(c.length,U,f),z=((nt=c[I])==null?void 0:nt.title)??"",$=Fb(z,S==="retype"),T=S==="fade"||S==="retype",k=S==="retype"?$:z,_=W?void 0:{width:O.scalingValue(x,n??!1)},g=G==="on"&&(!n||i||o),D=o??!1,P=(e==null?void 0:e.galleryPaddingRight)??0,q=(e==null?void 0:e.galleryPaddingLeft)??0,ie=(e==null?void 0:e.galleryPaddingBetween)??0,L=at=>O.scalingValue(at,n??!1),K={width:L(w)},ue=p==="a"?P:q,le=W?{width:"100%"}:{width:`calc(100% - ${L(x)} - ${L(ue)})`,...p==="c"?{marginLeft:"auto"}:{}},F=Math.max(P,vi),pe=Math.max(q,vi),j=Math.max(ie,vi),se=Math.max(v,vi),ne=Math.max(C,vi),ve=Math.max(y,vi),ke=Math.max(0,(u??1)-(x??Oi)),xe=p==="a"?Math.max(0,(u??1)-(x??Oi)-P):p==="c"?Math.max(0,(u??1)-(x??Oi)-q):p==="b"?u??1:1,b=D&&(p==="a"||p==="b"||p==="c")&&f==="top",M=D&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),E=D&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),V=c.length>1,Ce=W?void 0:L((p==="c"?q:P)+(x??Oi)),te=p==="c"&&Ce?{left:Ce}:void 0,$e=p==="a"&&Ce?{right:Ce}:void 0,ae=W?{left:0,width:"100%"}:p==="a"?{right:L(P),width:L(x)}:{left:L(q),width:L(x)},{titleColor:ge,titleFontFamily:ye,titleFontSettings:Z,titleFontSize:J,titleLineHeight:de,titleLetterSpacing:be,titleWordSpacing:Pe,titleAlign:Se,titleTextAppearance:X,lightboxCounterColor:me,lightboxCounterFontFamily:re,lightboxCounterFontSettings:Y,lightboxCounterFontSize:ce,lightboxCounterLineHeight:Ee,lightboxCounterLetterSpacing:he,lightboxCounterWordSpacing:Q,lightboxCounterTextAppearance:Ne}=e??{},Fe={fontSettings:{fontFamily:ye,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:J??.01,lineHeight:de,letterSpacing:be??0,wordSpacing:Pe??0,textAlign:Se??"left",textAppearance:X,color:ge??"#000000"},Je=an(qt(Fe,n)),dt=K,tt=vc(J,de,l,n),De=xc(J,de,`${l}-title`,`${l}-text-tight-leading`),Ie={fontSettings:{fontFamily:re,fontWeight:(Y==null?void 0:Y.fontWeight)??400,fontStyle:(Y==null?void 0:Y.fontStyle)??"normal"},fontSize:ce??.01,lineHeight:Ee,letterSpacing:he??0,wordSpacing:Q??0,textAppearance:Ne,color:me??"#DEDDDD"},je={...an(qt(Ie,n)),...vc(ce,Ee,l,n)},Ue=xc(ce,Ee,`${l}-lightbox-counter`,`${l}-text-tight-leading`),A=O.buildColorVars(l,{titleColor:ge??"#000000",lightboxCounterColor:me??"#DEDDDD"},gb,hb),ee=s.useRef(null),[Te,He]=s.useState(!1),[Be,Ve]=s.useState([]),[rt,Ze]=s.useState(0),_e=s.useCallback((at,st)=>{g&&(Ve(at),Ze(st),He(!0))},[g]),qe=s.useCallback(()=>{He(!1)},[]),Oe=s.useMemo(()=>{const at={...A},st=ee.current?getComputedStyle(ee.current).getPropertyValue("--cntrl-article-width").trim():"";return st&&(at["--cntrl-article-width"]=st),at},[A,Te]);return s.useEffect(()=>{if(!Te||G!=="on"||typeof document>"u")return;const at=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=at}},[Te,G]),s.useEffect(()=>{!n||o||i||He(!1)},[n,o,i]),s.useEffect(()=>{G==="off"&&He(!1)},[G]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:A,children:a.jsxs("div",{ref:ee,className:`${l}-wrapper`,style:{width:O.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?L(v):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?L(C):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?L(y):void 0},children:[T&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Va,{P:l,title:k,position:f,titleRef:()=>{},titleClassName:`${De} ${l}-single-title`,titleContainerStyle:{...tt,...le},titleTextBoxStyle:dt,titleStyle:Je,showTextBoxOutline:D,topPaddingControl:b?wc({P:l,scaled:L,height:se,paired:!1}):void 0})}),c.map((at,st)=>{const St=vb(at.gallery),Yt=st<c.length-1,Zt=St.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),vt={P:l,position:f,titleRef:H(st),titleClassName:De,titleContainerStyle:tt,titleTextBoxStyle:T?{maxWidth:"100%"}:dt,titleStyle:Je,showTextBoxOutline:D&&!T,topPaddingControl:b&&!T?wc({P:l,scaled:L,height:se,paired:V}):void 0};return a.jsxs("div",{"data-item-index":st,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Yt?L(ie):void 0},children:[M&&Sc({P:l,controlKey:"titleLeftPadding",scaled:L,width:ne,maxFraction:xe,side:"left",paired:V,anchorStyle:te}),E&&Sc({P:l,controlKey:"titleRightPadding",scaled:L,width:ve,maxFraction:xe,side:"right",paired:V,anchorStyle:$e}),D&&Yt&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-control-anchor`,style:{bottom:0,height:L(j),...ae}}),W?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:St.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const xt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(bc,{P:l,media:wt,imgWidth:x||void 0,cornerRadius:h||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<St.length-1,showControls:D,onMediaClick:g&&xt>=0?()=>_e(Zt,xt):void 0},`${wt.url}-${At}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Va,{...vt,title:T?"":at.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Va,{...vt,title:T?"":at.title}),St.length>0&&a.jsx(Lb,{P:l,layoutType:p,galleryWidthStyle:_,galleryPaddingRight:P,galleryPaddingLeft:q,galleryPaddingRightWidth:F,galleryPaddingLeftWidth:pe,galleryPaddingMaxFraction:ke,showControls:D,scaled:L,children:St.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const xt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(bc,{P:l,media:wt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<St.length-1,showControls:D,onMediaClick:g&&xt>=0?()=>_e(Zt,xt):void 0},`${wt.url}-${At}`)})})]})]},st)})]})}),Te&&G==="on"&&typeof document<"u"&&e&&(()=>{const at=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx("div",{style:Oe,"data-selection":"none",children:a.jsx(Rb,{prefix:l,items:Be,index:rt,imageDisplay:Tb(e.lightboxImageDisplay),isEditor:n,onClose:qe,onPrev:()=>Ze(st=>(st-1+Be.length)%Be.length),onNext:()=>Ze(st=>(st+1)%Be.length),counterClassName:Ue,counterStyle:je,backgroundColor:e.backgroundColor??ub})}),at)})()]})}const Nb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
20968
20968
  import { createPortal } from 'react-dom';
20969
20969
  import type React from 'react';
20970
20970
  import { CommonComponentProps } from '../props';
@@ -23062,7 +23062,7 @@ ${t}
23062
23062
  `}function er(e){return Number(e.toFixed(4))}function Ic(e,t,n,i){const r=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(r)?Math.min(i,Math.max(n,Math.round(r))):t}function Xa(e,t,n=0,i=9999){const r=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(r)?Math.min(i,Math.max(n,r)):t}function nw(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function iw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function ow(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name??"")||/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")}function ru(e,t){return(1-e)/(1-e*Math.cos(t))}function rw(e){let t=0;for(let n=0;n<360;n+=1){const i=n*Math.PI/180;t=Math.max(t,Math.abs(Math.sin(i)*ru(e,i)))}return t||1}function aw(e,t){return e?1:1+ou*(.35+t)}function sw(e,t,n,i){const o=t*aw(n,i);return Math.max(0,(e-o)/2)}function au(e,t,n){const i=ru(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function su(e,t,n){return e/2+t*n}function lw(e,t,n){return e(t-n/2)}function cw(e,t){return e*t}function lu(e){return Math.round(e*1e3)}function cu(e,t,n){const i=Math.cos(e),o=Math.cos(ew*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return er(t+(n-t)*r)}function du(e){return cu(e,Kb,Zb)}function dw(e){return cu(e,Jb,Qb)}function uu(e,t){if(!t)return"none";const n=dw(e);return n<=0?"none":`blur(${n}px)`}function uw(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=au(i,o,r*Math.PI*2),p=r*Math.PI*2,x=su(t,n,c),w=er(u),m=`calc(${e(x)} - var(--helix-base-w) * ${w} / 2)`,h=`calc(var(--helix-base-w) * ${w})`,f=l?`height: calc(var(--helix-base-h) * ${w});`:"";return`left: ${m}; width: ${h}; ${f} z-index: ${lu(u)}; transform: translateY(-50%); opacity: ${du(p)}; filter: ${uu(p,d)};`}function pw(e,t,n,i,o,r,l,d){const c=[];for(let u=0;u<=Tc;u+=1){const p=u/Tc;c.push(` ${er(p*100)}% { ${uw(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
23063
23063
  ${c.join(`
23064
23064
  `)}
23065
- }`}function pu(e,t){return(e%t+t)%t}function mw(e,t){return tl(e,t)/t}function tl(e,t){return pu(e,t)}function gw(e,t){return Math.floor(e/t)}function hw(e,t,n,i){return gw(e,t)*n+tl(e,t)*i}function fw(e,t,n){const i=n==="left"?1-e:e;return`${er(-i*t)}s`}function Rc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function mu(e){const t=e%1;return t<0?t+1:t}function yw(e,t,n){const i=t/iu,o=n==="left"?-e*i:e*i;return mu(o)}function xw({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=D.useScopedStyles(),r=s.useRef(null),l=Xa((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),zb),d=Xa(e==null?void 0:e.imageWidth,jb),c=Xa(e==null?void 0:e.turnHeight,Vb),u=Ic(e==null?void 0:e.itemsPerTurn,Gb,3,40),p=Ic(e==null?void 0:e.turns,Xb,1,30),x=Math.min(Ub,Math.max(0,Yb)),w=Math.min(1,Math.max(0,qb)),m=Math.max(0,(e==null?void 0:e.speed)??iu),h=(e==null?void 0:e.direction)==="left"?"left":"right",f=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",v=(e==null?void 0:e.cornerRadius)??0,C=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>nw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),S=y.display==="cover",G=le=>D.scalingValue(le,n??!1),W=s.useMemo(()=>rw(x),[x]),U=s.useMemo(()=>sw(l,d,S,w),[l,d,S,w]),H=s.useMemo(()=>tw(o,pw(o,G,l,U,x,W,S,C)),[o,l,U,x,W,S,C,n]),I=s.useMemo(()=>(t??[]).filter(le=>{var F;return!!((F=le.image)!=null&&F.url)}),[t]),z=c/u,$=d*iw(y),T=Math.min(Ob,p*u),A=Bb*u,_=T+A*2,B=Math.max(0,p-1)*c+(u-1)*z,P=m>0,Y=f==="scroll"&&P,ie=f==="autoplay"&&P&&(n?!!i:!0),[L,O]=s.useState(0);s.useEffect(()=>{if(!Y)return;const le=r.current;if(!le)return;const F=()=>{const j=le.getBoundingClientRect(),se=window.innerHeight||document.documentElement.clientHeight,ne=se+j.height;ne<=0||O(Math.min(1,Math.max(0,(se-j.top)/ne)))};F(),window.addEventListener("scroll",F,{passive:!0}),window.addEventListener("resize",F);const pe=new ResizeObserver(F);return pe.observe(le),()=>{window.removeEventListener("scroll",F),window.removeEventListener("resize",F),pe.disconnect()}},[Y]);const K=Y?yw(L,m,h):0,ue=P&&f==="autoplay"?360/(m*Db):0;return I.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:H}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:G(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:H}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:G(l),height:G(B),marginInline:"auto"},children:Array.from({length:_},(le,F)=>{const pe=F-A,se=I[pu(pe,I.length)].image,ne=tl(pe,u),ve=mw(pe,u),Me=Y?mu(ve+K):ve,xe=hw(pe,u,c,z),b=w===0?0:(Rc(ne+7.3)-.5)*w*z,M=S?1:1+(Rc(ne+3.1)-.5)*2*ou*(.35+w),E=Me*Math.PI*2,{offset:V,scale:Se}=au(x,W,E),te=d*M,$e=cw(te,Se),re=su(l,U,V),ge={"--helix-base-w":G(te),...S?{"--helix-base-h":G($)}:{}},ye={top:G(xe+b),transform:"translateY(-50%)",...ge,...ie?{animationDuration:`${er(ue)}s`,animationDelay:fw(ve,ue,h),animationDirection:h==="left"?"reverse":"normal"}:{left:lw(G,re,$e),width:G($e),...S?{height:G($*Se)}:{},zIndex:lu(Se),opacity:du(E),filter:uu(E,C)}},Z=v>0?{borderRadius:G(v)}:{},Q=S?{...Z,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:Z,ce=ow(se)?a.jsx("video",{className:`${o}-media`,style:Q,src:se.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:Q,src:se.url,alt:se.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:ie?`${o}-item`:`${o}-item ${o}-item-static`,style:ye,children:S?a.jsx("div",{className:`${o}-cover`,style:Z,children:ce}):ce},`${p}-${u}-${pe}`)})})]})}const vw=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
23065
+ }`}function pu(e,t){return(e%t+t)%t}function mw(e,t){return tl(e,t)/t}function tl(e,t){return pu(e,t)}function gw(e,t){return Math.floor(e/t)}function hw(e,t,n,i){return gw(e,t)*n+tl(e,t)*i}function fw(e,t,n){const i=n==="left"?1-e:e;return`${er(-i*t)}s`}function Rc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function mu(e){const t=e%1;return t<0?t+1:t}function yw(e,t,n){const i=t/iu,o=n==="left"?-e*i:e*i;return mu(o)}function xw({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=O.useScopedStyles(),r=s.useRef(null),l=Xa((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),zb),d=Xa(e==null?void 0:e.imageWidth,jb),c=Xa(e==null?void 0:e.turnHeight,Vb),u=Ic(e==null?void 0:e.itemsPerTurn,Gb,3,40),p=Ic(e==null?void 0:e.turns,Xb,1,30),x=Math.min(Ub,Math.max(0,Yb)),w=Math.min(1,Math.max(0,qb)),m=Math.max(0,(e==null?void 0:e.speed)??iu),h=(e==null?void 0:e.direction)==="left"?"left":"right",f=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",v=(e==null?void 0:e.cornerRadius)??0,C=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>nw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),S=y.display==="cover",G=le=>O.scalingValue(le,n??!1),W=s.useMemo(()=>rw(x),[x]),U=s.useMemo(()=>sw(l,d,S,w),[l,d,S,w]),H=s.useMemo(()=>tw(o,pw(o,G,l,U,x,W,S,C)),[o,l,U,x,W,S,C,n]),I=s.useMemo(()=>(t??[]).filter(le=>{var F;return!!((F=le.image)!=null&&F.url)}),[t]),z=c/u,$=d*iw(y),T=Math.min(Ob,p*u),k=Bb*u,_=T+k*2,D=Math.max(0,p-1)*c+(u-1)*z,P=m>0,q=f==="scroll"&&P,ie=f==="autoplay"&&P&&(n?!!i:!0),[L,B]=s.useState(0);s.useEffect(()=>{if(!q)return;const le=r.current;if(!le)return;const F=()=>{const j=le.getBoundingClientRect(),se=window.innerHeight||document.documentElement.clientHeight,ne=se+j.height;ne<=0||B(Math.min(1,Math.max(0,(se-j.top)/ne)))};F(),window.addEventListener("scroll",F,{passive:!0}),window.addEventListener("resize",F);const pe=new ResizeObserver(F);return pe.observe(le),()=>{window.removeEventListener("scroll",F),window.removeEventListener("resize",F),pe.disconnect()}},[q]);const K=q?yw(L,m,h):0,ue=P&&f==="autoplay"?360/(m*Db):0;return I.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:H}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:G(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:H}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:G(l),height:G(D),marginInline:"auto"},children:Array.from({length:_},(le,F)=>{const pe=F-k,se=I[pu(pe,I.length)].image,ne=tl(pe,u),ve=mw(pe,u),ke=q?mu(ve+K):ve,xe=hw(pe,u,c,z),b=w===0?0:(Rc(ne+7.3)-.5)*w*z,M=S?1:1+(Rc(ne+3.1)-.5)*2*ou*(.35+w),E=ke*Math.PI*2,{offset:V,scale:Ce}=au(x,W,E),te=d*M,$e=cw(te,Ce),ae=su(l,U,V),ge={"--helix-base-w":G(te),...S?{"--helix-base-h":G($)}:{}},ye={top:G(xe+b),transform:"translateY(-50%)",...ge,...ie?{animationDuration:`${er(ue)}s`,animationDelay:fw(ve,ue,h),animationDirection:h==="left"?"reverse":"normal"}:{left:lw(G,ae,$e),width:G($e),...S?{height:G($*Ce)}:{},zIndex:lu(Ce),opacity:du(E),filter:uu(E,C)}},Z=v>0?{borderRadius:G(v)}:{},J=S?{...Z,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:Z,de=ow(se)?a.jsx("video",{className:`${o}-media`,style:J,src:se.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:J,src:se.url,alt:se.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:ie?`${o}-item`:`${o}-item ${o}-item-static`,style:ye,children:S?a.jsx("div",{className:`${o}-cover`,style:Z,children:de}):de},`${p}-${u}-${pe}`)})})]})}const vw=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
23066
23066
  import { CommonComponentProps } from '../props';
23067
23067
  import { scalingValue } from '../utils/scalingValue';
23068
23068
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -23600,7 +23600,7 @@ export function Helix({
23600
23600
  </>
23601
23601
  );
23602
23602
  }
23603
- `,bw=["https://cdn.cntrl.site/component-assets/Helix-default-1.png","https://cdn.cntrl.site/component-assets/Helix-default-2.png","https://cdn.cntrl.site/component-assets/Helix-default-3.png","https://cdn.cntrl.site/component-assets/Helix-default-4.png","https://cdn.cntrl.site/component-assets/Helix-default-5.png"],ww={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}}}},default:bw.map(e=>({image:{url:e,name:""}}))},settings:{sizing:"auto auto",properties:{width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},turnHeight:{type:"number",scope:"layout",title:"Turn height",display:{type:"numeric-input"},min:0,max:9999},itemsPerTurn:{type:"number",scope:"common",title:"Per turn",display:{type:"common-numeric-input"},min:3,max:40},turns:{type:"number",scope:"common",title:"Turns",display:{type:"common-numeric-input"},min:1,max:30},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},playback:{type:"string",scope:"common",title:"Playback",display:{type:"toggle-cycle",enum:["autoplay","scroll"]}},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"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"string",scope:"common",title:"Blur",display:{type:"toggle-cycle",enum:["on","off"]}}},defaults:{itemsPerTurn:14,turns:3,direction:"right",playback:"autoplay",blur:"off",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1}},layoutDefaults:{d:{defaultPaddingTop:30/1440,width:800/1440,imageWidth:160/1440,turnHeight:380/1440,speed:2.2,cornerRadius:0},m:{defaultPaddingTop:10/375,width:320/375,imageWidth:75/375,turnHeight:310/375,speed:2.8,cornerRadius:0},t:{defaultPaddingTop:20/768,width:620/768,imageWidth:100/768,turnHeight:280/768,speed:2.8,cornerRadius:0}},layout:["__componentName__","width","imageWidth","turnHeight","itemsPerTurn","turns","playback","speed","direction","imageDisplay","cornerRadius","blur"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",items:["direction","speed"]},{type:"row",items:["width"]},{type:"row",items:["imageWidth","turnHeight"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",items:["itemsPerTurn","turns"]},{type:"row",items:["playback","blur"]}]}]},Sw={element:xw,id:"helix",name:"Helix",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Helix.mp4"},version:1,defaultSize:{d:{width:720,height:540}},schema:ww,sourceCode:vw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Cr=typeof window>"u"?s.useEffect:s.useLayoutEffect,jo=120,Lc=3,Cw=.12,Ya=.25,$w=10,Tw=4e3,Iw=.12,Rw=3,Lw=2,gu=["rectangle","ellipse","circle","triangle-up","triangle-down","diamond","hourglass","teardrop","leaf","wave","custom"];function Gr(e){return e<0?0:e>1?1:e}function Pw(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function Ew(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,x=u.y*t.height;p<n&&(n=p),p>o&&(o=p),x<i&&(i=x),x>r&&(r=x)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function wo(e){return e.map(([t,n])=>({x:t,y:n}))}function qa(e,t=jo){const n=[];for(let i=0;i<t;i+=1)n.push(e(i/t));return n}function Ar(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const d of e)for(const c of d)c.x<t&&(t=c.x),c.x>i&&(i=c.x),c.y<n&&(n=c.y),c.y>o&&(o=c.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(d=>d.map(c=>({x:(c.x-t)/r,y:(c.y-n)/l})))}function ps(e,t){switch(e){case"ellipse":return[qa(n=>{const i=n*Math.PI*2;return{x:.5+Math.cos(i)*.5,y:.5+Math.sin(i)*.5}})];case"circle":{const n=t>=1?.5/t:.5,i=t>=1?.5:.5*t;return[qa(o=>{const r=o*Math.PI*2;return{x:.5+Math.cos(r)*n,y:.5+Math.sin(r)*i}})]}case"triangle-up":return[wo([[.5,0],[1,1],[0,1]])];case"triangle-down":return[wo([[0,0],[1,0],[.5,1]])];case"diamond":return[wo([[.5,0],[1,.5],[.5,1],[0,.5]])];case"hourglass":return[wo([[0,0],[1,0],[.56,.5],[1,1],[0,1],[.44,.5]])];case"teardrop":return Ar([qa(n=>{const i=n*Math.PI*2,o=Math.cos(i);return{x:.5+Math.sin(i)*Math.pow(Math.sin(i/2),2)*.5,y:.5-o*.5}})]);case"leaf":{const n=Math.round(jo/2),i=[];for(let o=0;o<=n;o+=1){const r=o/n;i.push({x:.5+Math.sin(Math.PI*r)*.5,y:r})}for(let o=n;o>=0;o-=1){const r=o/n;i.push({x:.5-Math.sin(Math.PI*r)*.5,y:r})}return[i]}case"wave":{const o=jo,r=[];for(let l=0;l<=o;l+=1){const d=l/o;r.push({x:.09+Math.sin(Math.PI*2*2*d)*.09,y:d})}for(let l=o;l>=0;l-=1){const d=l/o;r.push({x:1-.09+Math.sin(Math.PI*2*2*d+Math.PI/3)*.09,y:d})}return[r]}case"rectangle":case"custom":default:return[wo([[0,0],[1,0],[1,1],[0,1]])]}}const hu={x:0,y:0,width:100,height:100};function Mw(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?hu:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Fr(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}const ms=16,kw=12,Aw=16,Xr="0 0 100 100",Yr=100,Ua=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Fw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function _w(e){const t=e.match(Fw);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function gn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function gs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function on(e){return{x:e.x,y:e.y}}function Nw(e){return{p:on(e.p),in:e.in?on(e.in):null,out:e.out?on(e.out):null}}function Pn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(Nw)}))}function ti(e,t){return e.map(n=>({closed:n.closed,nodes:n.nodes.map(i=>({p:t(i.p),in:i.in?t(i.in):null,out:i.out?t(i.out):null}))}))}function Pc(e,t,n,i=n){return ti(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function Ww(e,t,n,i,o,r,l){let d=Math.abs(t),c=Math.abs(n);if(!d||!c||e.x===l.x&&e.y===l.y)return[{c1:on(e),c2:on(l),p:on(l)}];const u=i*Math.PI/180,p=Math.cos(u),x=Math.sin(u),w=(e.x-l.x)/2,m=(e.y-l.y)/2,h=p*w+x*m,f=-x*w+p*m,v=h*h/(d*d)+f*f/(c*c);if(v>1){const ie=Math.sqrt(v);d*=ie,c*=ie}const C=o===r?-1:1,y=d*d*f*f+c*c*h*h,S=Math.max(0,d*d*c*c-y),G=y===0?0:C*Math.sqrt(S/y),W=G*d*f/c,U=-G*c*h/d,H=p*W-x*U+(e.x+l.x)/2,I=x*W+p*U+(e.y+l.y)/2,z=Math.atan2((f-U)/c,(h-W)/d);let T=Math.atan2((-f-U)/c,(-h-W)/d)-z;!r&&T>0&&(T-=Math.PI*2),r&&T<0&&(T+=Math.PI*2);const A=Math.max(1,Math.ceil(Math.abs(T)/(Math.PI/2))),_=T/A,g=4/3*Math.tan(_/4),B=(ie,L)=>({x:H+p*d*ie-x*c*L,y:I+x*d*ie+p*c*L}),P=[];let Y=z;for(let ie=0;ie<A;ie+=1){const L=Y+_,O=Math.cos(Y),K=Math.sin(Y),ue=Math.cos(L),le=Math.sin(L);P.push({c1:B(O-g*K,K+g*O),c2:B(ue+g*le,le-g*ue),p:ie===A-1?on(l):B(ue,le)}),Y=L}return P}function Vo(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=null;const u=()=>{if(o&&i.length>2){const m=i[0],h=i[i.length-1];Math.abs(m.p.x-h.p.x)<1e-6&&Math.abs(m.p.y-h.p.y)<1e-6&&(m.in=h.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,h)=>{i.push({p:m,in:h??null,out:null}),r=m},x=m=>{i.length&&(i[i.length-1].out=m)};Ua.lastIndex=0;let w=Ua.exec(t);for(;w!==null;){const m=w[1],h=m.toUpperCase(),f=m!==h,v=_w(w[2]),C=y=>f?{x:r.x+v[y],y:r.y+v[y+1]}:{x:v[y],y:v[y+1]};if(h==="Z")o=!0,u(),r=on(l),d=null,c=null;else if(h==="M"){for(let y=0;y+1<v.length;y+=2){const S=C(y);y===0&&(u(),l=on(S)),p(S)}d=null,c=null}else if(h==="L"){for(let y=0;y+1<v.length;y+=2)p(C(y));d=null,c=null}else if(h==="H"){for(const y of v)p({x:f?r.x+y:y,y:r.y});d=null,c=null}else if(h==="V"){for(const y of v)p({x:r.x,y:f?r.y+y:y});d=null,c=null}else if(h==="C"){for(let y=0;y+5<v.length;y+=6){const S=C(y),G=C(y+2),W=C(y+4);x(S),p(W,G),d=G}c=null}else if(h==="S"){for(let y=0;y+3<v.length;y+=4){const S=d?gs(d,r):on(r),G=C(y),W=C(y+2);x(S),p(W,G),d=G}c=null}else if(h==="Q")for(let y=0;y+3<v.length;y+=4){const S=C(y),G=C(y+2);x(gn(r,S,2/3)),p(G,gn(G,S,2/3)),c=S,d=null}else if(h==="T")for(let y=0;y+1<v.length;y+=2){const S=c?gs(c,r):on(r),G=C(y);x(gn(r,S,2/3)),p(G,gn(G,S,2/3)),c=S,d=null}else if(h==="A")for(let y=0;y+6<v.length;y+=7){const S=f?{x:r.x+v[y+5],y:r.y+v[y+6]}:{x:v[y+5],y:v[y+6]};for(const G of Ww(r,v[y],v[y+1],v[y+2],v[y+3]!==0,v[y+4]!==0,S))x(G.c1),p(G.p,G.c2);d=null,c=null}w=Ua.exec(t)}return u(),n}function Rn(e){return`${Number(e.toFixed(2))}`}function tr(e,t){return!e.out&&!t.in}function Ec(e,t){if(tr(e,t))return`L${Rn(t.p.x)},${Rn(t.p.y)}`;const n=e.out??e.p,i=t.in??t.p;return`C${Rn(n.x)},${Rn(n.y)} ${Rn(i.x)},${Rn(i.y)} ${Rn(t.p.x)},${Rn(t.p.y)}`}function Go(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${Rn(i.p.x)},${Rn(i.p.y)}`);let r=i;for(const l of o)t.push(Ec(r,l)),r=l;if(n.closed){const l=Ec(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function fu(e){const t=[];for(let n=0;n+1<e.nodes.length;n+=1)t.push({from:e.nodes[n],to:e.nodes[n+1],index:n});if(e.closed&&e.nodes.length>2){const n=e.nodes.length-1;t.push({from:e.nodes[n],to:e.nodes[0],index:n})}return t}function hs(e,t,n){if(tr(e,t))return gn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,d=3*r*r*n,c=3*r*n*n,u=n*n*n;return{x:l*e.p.x+d*i.x+c*o.x+u*t.p.x,y:l*e.p.y+d*i.y+c*o.y+u*t.p.y}}function nl(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of fu(n)){if(tr(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<ms;r+=1)i.push(hs(o.from,o.to,r/ms))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Jn(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of nl(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function Hw(e){const t=Jn(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function yu(e,t,n){const i={x:(n.x-e.x)/6,y:(n.y-e.y)/6};return{in:{x:t.x-i.x,y:t.y-i.y},out:{x:t.x+i.x,y:t.y+i.y}}}function xu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=kw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Aw)),i=[];for(let r=0;r<t.length;r+=n)i.push(t[r]);const o=i.length;return{closed:!0,nodes:i.map((r,l)=>({p:on(r),...yu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Dw(e){const t={x:0,y:0,width:Yr,height:Yr};if(!e||e.pathFit!=="viewbox"||e.pathViewBox!==Xr||!e.customPath)return t;const n=Vo(e.customPath);if(!n.length)return t;const i=Jn(n),o=i.maxX-i.minX,r=i.maxY-i.minY;return!isFinite(i.minX)||!isFinite(i.minY)||!(o>0)||!(r>0)?t:{x:i.minX,y:i.minY,width:o,height:r}}function vu(e,t,n=1){if(!e.length)return!1;const i=Jn(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=Math.max(n,t.width*.5),r=Math.max(n,t.height*.5);return i.minX<t.x-o||i.minY<t.y-r||i.maxX>t.x+t.width+o||i.maxY>t.y+t.height+r}function Ow(e,t){if(!e.length)return e;const n=Jn(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return ti(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Bw(e,t=1,n){const i=Dw(n),o=ps(e==="custom"?"rectangle":e,t),r=Ow(ti(xu(o),l=>({x:l.x*i.width+i.x,y:l.y*i.height+i.y})),i);return{shape:e,customPath:Go(r),pathFit:"viewbox",pathViewBox:Xr}}function $r(e,t){return t>0?Math.round(e/t)*t:e}function zw(e,t,n,i){var u;const o=(u=e[t])==null?void 0:u.nodes[n];if(!o)return e;const r=i.x-o.p.x,l=i.y-o.p.y,d=Pn(e),c=d[t].nodes[n];return c.p={x:o.p.x+r,y:o.p.y+l},c.in&&(c.in={x:c.in.x+r,y:c.in.y+l}),c.out&&(c.out={x:c.out.x+r,y:c.out.y+l}),d}function Mc(e,t,n,i){var r;if(!t.length)return e;const o=Pn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function jw(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((d,c)=>c-d);for(const d of l)i=bu(i,r,d)}),i}function Vw(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=Pn(e),c=d[t].nodes[n];if(c[i]=on(o),r){const p=i==="in"?"out":"in";c[p]=gs(o,c.p)}return d}function Gw(e,t,n,i){var l;const o=(l=e[t])==null?void 0:l.nodes[n];if(!o||!o[i])return e;const r=Pn(e);return r[t].nodes[n][i]=null,r}function Xw(e,t,n,i){const o=e[t];if(!o)return{contours:e,nodeIndex:-1};const r=o.nodes[n],l=o.nodes[(n+1)%o.nodes.length];if(!r||!l)return{contours:e,nodeIndex:-1};const d=Pn(e),c=d[t].nodes,u=n+1;if(tr(r,l))return c.splice(u,0,{p:gn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,x=l.in??l.p,w=gn(r.p,p,i),m=gn(p,x,i),h=gn(x,l.p,i),f=gn(w,m,i),v=gn(m,h,i),C=gn(f,v,i),y=(n+1)%o.nodes.length;return c[n].out=w,c[y].in=h,c.splice(u,0,{p:C,in:f,out:v}),{contours:d,nodeIndex:u}}function bu(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Pn(e);return o[t].nodes.splice(n,1),o}function kc(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Pn(e),l=r[t].nodes[n];if(l.in||l.out)return l.in=null,l.out=null,r;const d=i.nodes.length,c=i.nodes[(n-1+d)%d].p,u=i.nodes[(n+1)%d].p,p=yu(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Yw(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y)}}function qw(e,t){let n=null;return e.forEach((i,o)=>{for(const r of fu(i)){const l=tr(r.from,r.to)?1:ms;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Yw(t,hs(r.from,r.to,c),hs(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance})}}}),n}function Uw(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Ac(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Fc(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}const _c=Math.PI/4,Kw=8,Zw=Math.PI/18,Jw=8,zi=24,ji=[];function Qw(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function eS(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function fs(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function tS(e,t){const n=fs(e,t);return n?{kind:"align",a:{x:e.x-n.x*zi,y:e.y-n.y*zi},b:{x:t.x+n.x*zi,y:t.y+n.y*zi}}:{kind:"align",a:e,b:t}}function ys(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Nc(e,t,n,i,o){if(e.axis===null)return tS(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return ys(o(r)[t],t,i)}function nS(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Nc(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Nc(n,"y",l,i,o)),r}function iS(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return fs(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return fs(i(p),r)}function oS(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,x=Math.hypot(u,p);if(x<1e-6)return{point:e,guides:ji};const w=Math.atan2(p,u),m=Math.round(w/_c)*_c;let h=o?m:null,f=!1;if(!o){const U=[];n&&U.push({angle:Math.atan2(n.y,n.x),smooth:!0}),U.push({angle:m,smooth:!1});for(const H of U){const I=eS(H.angle-w);if(!(Math.abs(I)>Zw)&&!(Math.abs(Math.sin(I))*x>Kw)){h=H.angle,f=H.smooth;break}}}const v=i!==null&&i>0&&Math.abs(x-i)<=Jw;if(h===null&&!v)return{point:e,guides:ji};const C=h??w,y=v?i:x,S={x:Math.cos(C),y:Math.sin(C)},G=y+(h===null?0:zi),W=v?y:f?zi:0;return{point:l({x:d.x+S.x*y,y:d.y+S.y*y}),guides:[{kind:"angle",a:{x:d.x-S.x*W,y:d.y-S.y*W},b:{x:d.x+S.x*G,y:d.y+S.y*G}}]}}function Wc(e,t="stretch",n=hu){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Vo(i),d=nl(l);if(d.length)return t==="viewbox"?Fr(d,n):Ar(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(x=>x.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const x of c){const w=document.createElementNS("http://www.w3.org/2000/svg","path");w.setAttribute("d",x),u.appendChild(w);let m=0;try{m=w.getTotalLength()}catch{m=0}if(!m)continue;const h=[];for(let f=0;f<jo;f+=1){const v=w.getPointAtLength(f/jo*m);h.push({x:v.x,y:v.y})}p.push(h)}return p.length?t==="viewbox"?Fr(p,n):Ar(p):null}const o=i.split(/[\s,]+/).map(Number).filter(l=>!Number.isNaN(l));if(o.length<6)return null;const r=[];for(let l=0;l+1<o.length;l+=2)r.push({x:o[l],y:o[l+1]});return t==="viewbox"?Fr([r],n):Ar([r])}function rS(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],d=o[(r+1)%o.length];(l.y<=t&&d.y>t||d.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(d.y-l.y)*(d.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=Gr(n[o]),l=Gr(n[o+1]);l>r&&i.push({x0:r,x1:l})}return aS(i)}function aS(e){if(e.length<2)return e;const t=[...e].sort((i,o)=>i.x0-o.x0),n=[t[0]];for(let i=1;i<t.length;i+=1){const o=n[n.length-1],r=t[i];r.x0<=o.x1?o.x1=Math.max(o.x1,r.x1):n.push({...r})}return n}function sS(e,t){const n=[];let i=0,o=0;for(;i<e.length&&o<t.length;){const r=Math.max(e[i].x0,t[o].x0),l=Math.min(e[i].x1,t[o].x1);l>r&&n.push({x0:r,x1:l}),e[i].x1<t[o].x1?i+=1:o+=1}return n}function lS(e){const t=[];let n=0;for(const i of e)i.x0>n&&t.push({x0:n,x1:i.x0}),n=Math.max(n,i.x1);return n<1&&t.push({x0:n,x1:1}),t}function cS(e,t){const n=[];for(const i of e){if(t.x1<=i.x0||t.x0>=i.x1){n.push(i);continue}t.x0>i.x0&&n.push({x0:i.x0,x1:t.x0}),t.x1<i.x1&&n.push({x0:t.x1,x1:i.x1})}return n}function dS(e,t,n,i){let o=null;for(let r=0;r<Lc;r+=1){const l=Gr(t+(n-t)*r/Math.max(1,Lc-1)),d=rS(e,l),c=i==="avoid"?lS(d):d;if(o=o===null?c:sS(o,c),o.length===0)return[]}return o??[]}function wu(e){return!!e&&typeof e=="object"&&e.type==="link"}function uS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(wu(c)){o(c.children??[],c.value,c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const x of p.split(/\s+/))x&&t.push({text:x,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Hc(e){return{...e.fontFamily&&{fontFamily:po(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"}}}function pS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(wu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Dc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:x}=e,w=e.lineHeight*l,m=e.spaceWidth*l,h=[];if(!t.length||d<=0||w<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const f=Math.max(1,m*.5),v=w*Cw;let C=0,y=0,S=0,G=t[0].para,W=0,U=0,H=null;for(;C<t.length&&S<Tw;){const I=y+w>c;if(I&&!u)break;const z=t[C].para;if(z>G+1){y+=w*(z-G-1),G=z-1,S+=1;continue}let $=I?[{x0:0,x1:d}]:dS(i,(y+v)/c,(y+w-v)/c,o).map(A=>({x0:A.x0*d,x1:A.x1*d}));p>0&&x>0&&!I&&$.length&&(H===null&&(H=S,W=$[0].x0,U=y),S-H<x&&($=cS($,{x0:W,x1:W+p})));const T=$.reduce((A,_)=>Math.max(A,_.x1-_.x0),0);for(const A of $){const _=A.x1-A.x0;if(_<f)continue;if(C>=t.length||t[C].para!==z)break;const g=C;let B=0;for(;C<t.length&&t[C].para===z;){const P=n[C]*l,Y=C===g?P:m+P;if(B+Y>_&&!(C===g&&_>=T-.5&&P>d-.5))break;B+=Y,C+=1}if(C>g){const P=C>=t.length||t[C].para!==z;h.push({top:y,left:A.x0,width:_,from:g,to:C,justify:r==="justify"&&!P})}if(C>=t.length||t[C].para!==z)break}G=z,y+=w,S+=1}return{segments:h,placed:C,height:h.length?y:0,capLeft:W,capTop:U}}function mS(e){return`
23603
+ `,bw=["https://cdn.cntrl.site/component-assets/Helix-default-1.png","https://cdn.cntrl.site/component-assets/Helix-default-2.png","https://cdn.cntrl.site/component-assets/Helix-default-3.png","https://cdn.cntrl.site/component-assets/Helix-default-4.png","https://cdn.cntrl.site/component-assets/Helix-default-5.png"],ww={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}}}},default:bw.map(e=>({image:{url:e,name:""}}))},settings:{sizing:"auto auto",properties:{width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},turnHeight:{type:"number",scope:"layout",title:"Turn height",display:{type:"numeric-input"},min:0,max:9999},itemsPerTurn:{type:"number",scope:"common",title:"Per turn",display:{type:"common-numeric-input"},min:3,max:40},turns:{type:"number",scope:"common",title:"Turns",display:{type:"common-numeric-input"},min:1,max:30},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},playback:{type:"string",scope:"common",title:"Playback",display:{type:"toggle-cycle",enum:["autoplay","scroll"]}},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"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"string",scope:"common",title:"Blur",display:{type:"toggle-cycle",enum:["on","off"]}}},defaults:{itemsPerTurn:14,turns:3,direction:"right",playback:"autoplay",blur:"off",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1}},layoutDefaults:{d:{defaultPaddingTop:30/1440,width:800/1440,imageWidth:160/1440,turnHeight:380/1440,speed:2.2,cornerRadius:0},m:{defaultPaddingTop:10/375,width:320/375,imageWidth:75/375,turnHeight:310/375,speed:2.8,cornerRadius:0},t:{defaultPaddingTop:20/768,width:620/768,imageWidth:100/768,turnHeight:280/768,speed:2.8,cornerRadius:0}},layout:["__componentName__","width","imageWidth","turnHeight","itemsPerTurn","turns","playback","speed","direction","imageDisplay","cornerRadius","blur"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",items:["direction","speed"]},{type:"row",items:["width"]},{type:"row",items:["imageWidth","turnHeight"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",items:["itemsPerTurn","turns"]},{type:"row",items:["playback","blur"]}]}]},Sw={element:xw,id:"helix",name:"Helix",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Helix.mp4"},version:1,defaultSize:{d:{width:720,height:540}},schema:ww,sourceCode:vw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Cr=typeof window>"u"?s.useEffect:s.useLayoutEffect,jo=120,Lc=3,Cw=.12,Ya=.25,$w=10,Tw=4e3,Iw=.12,Rw=3,Lw=2,gu=["rectangle","ellipse","circle","triangle-up","triangle-down","diamond","hourglass","teardrop","leaf","wave","custom"];function Gr(e){return e<0?0:e>1?1:e}function Pw(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function Ew(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,x=u.y*t.height;p<n&&(n=p),p>o&&(o=p),x<i&&(i=x),x>r&&(r=x)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function wo(e){return e.map(([t,n])=>({x:t,y:n}))}function qa(e,t=jo){const n=[];for(let i=0;i<t;i+=1)n.push(e(i/t));return n}function Ar(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const d of e)for(const c of d)c.x<t&&(t=c.x),c.x>i&&(i=c.x),c.y<n&&(n=c.y),c.y>o&&(o=c.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(d=>d.map(c=>({x:(c.x-t)/r,y:(c.y-n)/l})))}function ps(e,t){switch(e){case"ellipse":return[qa(n=>{const i=n*Math.PI*2;return{x:.5+Math.cos(i)*.5,y:.5+Math.sin(i)*.5}})];case"circle":{const n=t>=1?.5/t:.5,i=t>=1?.5:.5*t;return[qa(o=>{const r=o*Math.PI*2;return{x:.5+Math.cos(r)*n,y:.5+Math.sin(r)*i}})]}case"triangle-up":return[wo([[.5,0],[1,1],[0,1]])];case"triangle-down":return[wo([[0,0],[1,0],[.5,1]])];case"diamond":return[wo([[.5,0],[1,.5],[.5,1],[0,.5]])];case"hourglass":return[wo([[0,0],[1,0],[.56,.5],[1,1],[0,1],[.44,.5]])];case"teardrop":return Ar([qa(n=>{const i=n*Math.PI*2,o=Math.cos(i);return{x:.5+Math.sin(i)*Math.pow(Math.sin(i/2),2)*.5,y:.5-o*.5}})]);case"leaf":{const n=Math.round(jo/2),i=[];for(let o=0;o<=n;o+=1){const r=o/n;i.push({x:.5+Math.sin(Math.PI*r)*.5,y:r})}for(let o=n;o>=0;o-=1){const r=o/n;i.push({x:.5-Math.sin(Math.PI*r)*.5,y:r})}return[i]}case"wave":{const o=jo,r=[];for(let l=0;l<=o;l+=1){const d=l/o;r.push({x:.09+Math.sin(Math.PI*2*2*d)*.09,y:d})}for(let l=o;l>=0;l-=1){const d=l/o;r.push({x:1-.09+Math.sin(Math.PI*2*2*d+Math.PI/3)*.09,y:d})}return[r]}case"rectangle":case"custom":default:return[wo([[0,0],[1,0],[1,1],[0,1]])]}}const hu={x:0,y:0,width:100,height:100};function Mw(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?hu:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Fr(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}const ms=16,kw=12,Aw=16,Xr="0 0 100 100",Yr=100,Ua=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Fw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function _w(e){const t=e.match(Fw);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function gn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function gs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function on(e){return{x:e.x,y:e.y}}function Nw(e){return{p:on(e.p),in:e.in?on(e.in):null,out:e.out?on(e.out):null}}function Pn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(Nw)}))}function ti(e,t){return e.map(n=>({closed:n.closed,nodes:n.nodes.map(i=>({p:t(i.p),in:i.in?t(i.in):null,out:i.out?t(i.out):null}))}))}function Pc(e,t,n,i=n){return ti(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function Ww(e,t,n,i,o,r,l){let d=Math.abs(t),c=Math.abs(n);if(!d||!c||e.x===l.x&&e.y===l.y)return[{c1:on(e),c2:on(l),p:on(l)}];const u=i*Math.PI/180,p=Math.cos(u),x=Math.sin(u),w=(e.x-l.x)/2,m=(e.y-l.y)/2,h=p*w+x*m,f=-x*w+p*m,v=h*h/(d*d)+f*f/(c*c);if(v>1){const ie=Math.sqrt(v);d*=ie,c*=ie}const C=o===r?-1:1,y=d*d*f*f+c*c*h*h,S=Math.max(0,d*d*c*c-y),G=y===0?0:C*Math.sqrt(S/y),W=G*d*f/c,U=-G*c*h/d,H=p*W-x*U+(e.x+l.x)/2,I=x*W+p*U+(e.y+l.y)/2,z=Math.atan2((f-U)/c,(h-W)/d);let T=Math.atan2((-f-U)/c,(-h-W)/d)-z;!r&&T>0&&(T-=Math.PI*2),r&&T<0&&(T+=Math.PI*2);const k=Math.max(1,Math.ceil(Math.abs(T)/(Math.PI/2))),_=T/k,g=4/3*Math.tan(_/4),D=(ie,L)=>({x:H+p*d*ie-x*c*L,y:I+x*d*ie+p*c*L}),P=[];let q=z;for(let ie=0;ie<k;ie+=1){const L=q+_,B=Math.cos(q),K=Math.sin(q),ue=Math.cos(L),le=Math.sin(L);P.push({c1:D(B-g*K,K+g*B),c2:D(ue+g*le,le-g*ue),p:ie===k-1?on(l):D(ue,le)}),q=L}return P}function Vo(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=null;const u=()=>{if(o&&i.length>2){const m=i[0],h=i[i.length-1];Math.abs(m.p.x-h.p.x)<1e-6&&Math.abs(m.p.y-h.p.y)<1e-6&&(m.in=h.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,h)=>{i.push({p:m,in:h??null,out:null}),r=m},x=m=>{i.length&&(i[i.length-1].out=m)};Ua.lastIndex=0;let w=Ua.exec(t);for(;w!==null;){const m=w[1],h=m.toUpperCase(),f=m!==h,v=_w(w[2]),C=y=>f?{x:r.x+v[y],y:r.y+v[y+1]}:{x:v[y],y:v[y+1]};if(h==="Z")o=!0,u(),r=on(l),d=null,c=null;else if(h==="M"){for(let y=0;y+1<v.length;y+=2){const S=C(y);y===0&&(u(),l=on(S)),p(S)}d=null,c=null}else if(h==="L"){for(let y=0;y+1<v.length;y+=2)p(C(y));d=null,c=null}else if(h==="H"){for(const y of v)p({x:f?r.x+y:y,y:r.y});d=null,c=null}else if(h==="V"){for(const y of v)p({x:r.x,y:f?r.y+y:y});d=null,c=null}else if(h==="C"){for(let y=0;y+5<v.length;y+=6){const S=C(y),G=C(y+2),W=C(y+4);x(S),p(W,G),d=G}c=null}else if(h==="S"){for(let y=0;y+3<v.length;y+=4){const S=d?gs(d,r):on(r),G=C(y),W=C(y+2);x(S),p(W,G),d=G}c=null}else if(h==="Q")for(let y=0;y+3<v.length;y+=4){const S=C(y),G=C(y+2);x(gn(r,S,2/3)),p(G,gn(G,S,2/3)),c=S,d=null}else if(h==="T")for(let y=0;y+1<v.length;y+=2){const S=c?gs(c,r):on(r),G=C(y);x(gn(r,S,2/3)),p(G,gn(G,S,2/3)),c=S,d=null}else if(h==="A")for(let y=0;y+6<v.length;y+=7){const S=f?{x:r.x+v[y+5],y:r.y+v[y+6]}:{x:v[y+5],y:v[y+6]};for(const G of Ww(r,v[y],v[y+1],v[y+2],v[y+3]!==0,v[y+4]!==0,S))x(G.c1),p(G.p,G.c2);d=null,c=null}w=Ua.exec(t)}return u(),n}function Rn(e){return`${Number(e.toFixed(2))}`}function tr(e,t){return!e.out&&!t.in}function Ec(e,t){if(tr(e,t))return`L${Rn(t.p.x)},${Rn(t.p.y)}`;const n=e.out??e.p,i=t.in??t.p;return`C${Rn(n.x)},${Rn(n.y)} ${Rn(i.x)},${Rn(i.y)} ${Rn(t.p.x)},${Rn(t.p.y)}`}function Go(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${Rn(i.p.x)},${Rn(i.p.y)}`);let r=i;for(const l of o)t.push(Ec(r,l)),r=l;if(n.closed){const l=Ec(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function fu(e){const t=[];for(let n=0;n+1<e.nodes.length;n+=1)t.push({from:e.nodes[n],to:e.nodes[n+1],index:n});if(e.closed&&e.nodes.length>2){const n=e.nodes.length-1;t.push({from:e.nodes[n],to:e.nodes[0],index:n})}return t}function hs(e,t,n){if(tr(e,t))return gn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,d=3*r*r*n,c=3*r*n*n,u=n*n*n;return{x:l*e.p.x+d*i.x+c*o.x+u*t.p.x,y:l*e.p.y+d*i.y+c*o.y+u*t.p.y}}function nl(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of fu(n)){if(tr(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<ms;r+=1)i.push(hs(o.from,o.to,r/ms))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Jn(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of nl(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function Hw(e){const t=Jn(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function yu(e,t,n){const i={x:(n.x-e.x)/6,y:(n.y-e.y)/6};return{in:{x:t.x-i.x,y:t.y-i.y},out:{x:t.x+i.x,y:t.y+i.y}}}function xu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=kw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Aw)),i=[];for(let r=0;r<t.length;r+=n)i.push(t[r]);const o=i.length;return{closed:!0,nodes:i.map((r,l)=>({p:on(r),...yu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Dw(e){const t={x:0,y:0,width:Yr,height:Yr};if(!e||e.pathFit!=="viewbox"||e.pathViewBox!==Xr||!e.customPath)return t;const n=Vo(e.customPath);if(!n.length)return t;const i=Jn(n),o=i.maxX-i.minX,r=i.maxY-i.minY;return!isFinite(i.minX)||!isFinite(i.minY)||!(o>0)||!(r>0)?t:{x:i.minX,y:i.minY,width:o,height:r}}function vu(e,t,n=1){if(!e.length)return!1;const i=Jn(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=Math.max(n,t.width*.5),r=Math.max(n,t.height*.5);return i.minX<t.x-o||i.minY<t.y-r||i.maxX>t.x+t.width+o||i.maxY>t.y+t.height+r}function Ow(e,t){if(!e.length)return e;const n=Jn(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return ti(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Bw(e,t=1,n){const i=Dw(n),o=ps(e==="custom"?"rectangle":e,t),r=Ow(ti(xu(o),l=>({x:l.x*i.width+i.x,y:l.y*i.height+i.y})),i);return{shape:e,customPath:Go(r),pathFit:"viewbox",pathViewBox:Xr}}function $r(e,t){return t>0?Math.round(e/t)*t:e}function zw(e,t,n,i){var u;const o=(u=e[t])==null?void 0:u.nodes[n];if(!o)return e;const r=i.x-o.p.x,l=i.y-o.p.y,d=Pn(e),c=d[t].nodes[n];return c.p={x:o.p.x+r,y:o.p.y+l},c.in&&(c.in={x:c.in.x+r,y:c.in.y+l}),c.out&&(c.out={x:c.out.x+r,y:c.out.y+l}),d}function Mc(e,t,n,i){var r;if(!t.length)return e;const o=Pn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function jw(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((d,c)=>c-d);for(const d of l)i=bu(i,r,d)}),i}function Vw(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=Pn(e),c=d[t].nodes[n];if(c[i]=on(o),r){const p=i==="in"?"out":"in";c[p]=gs(o,c.p)}return d}function Gw(e,t,n,i){var l;const o=(l=e[t])==null?void 0:l.nodes[n];if(!o||!o[i])return e;const r=Pn(e);return r[t].nodes[n][i]=null,r}function Xw(e,t,n,i){const o=e[t];if(!o)return{contours:e,nodeIndex:-1};const r=o.nodes[n],l=o.nodes[(n+1)%o.nodes.length];if(!r||!l)return{contours:e,nodeIndex:-1};const d=Pn(e),c=d[t].nodes,u=n+1;if(tr(r,l))return c.splice(u,0,{p:gn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,x=l.in??l.p,w=gn(r.p,p,i),m=gn(p,x,i),h=gn(x,l.p,i),f=gn(w,m,i),v=gn(m,h,i),C=gn(f,v,i),y=(n+1)%o.nodes.length;return c[n].out=w,c[y].in=h,c.splice(u,0,{p:C,in:f,out:v}),{contours:d,nodeIndex:u}}function bu(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Pn(e);return o[t].nodes.splice(n,1),o}function kc(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Pn(e),l=r[t].nodes[n];if(l.in||l.out)return l.in=null,l.out=null,r;const d=i.nodes.length,c=i.nodes[(n-1+d)%d].p,u=i.nodes[(n+1)%d].p,p=yu(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Yw(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y)}}function qw(e,t){let n=null;return e.forEach((i,o)=>{for(const r of fu(i)){const l=tr(r.from,r.to)?1:ms;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Yw(t,hs(r.from,r.to,c),hs(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance})}}}),n}function Uw(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Ac(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Fc(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}const _c=Math.PI/4,Kw=8,Zw=Math.PI/18,Jw=8,zi=24,ji=[];function Qw(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function eS(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function fs(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function tS(e,t){const n=fs(e,t);return n?{kind:"align",a:{x:e.x-n.x*zi,y:e.y-n.y*zi},b:{x:t.x+n.x*zi,y:t.y+n.y*zi}}:{kind:"align",a:e,b:t}}function ys(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Nc(e,t,n,i,o){if(e.axis===null)return tS(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return ys(o(r)[t],t,i)}function nS(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Nc(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Nc(n,"y",l,i,o)),r}function iS(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return fs(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return fs(i(p),r)}function oS(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,x=Math.hypot(u,p);if(x<1e-6)return{point:e,guides:ji};const w=Math.atan2(p,u),m=Math.round(w/_c)*_c;let h=o?m:null,f=!1;if(!o){const U=[];n&&U.push({angle:Math.atan2(n.y,n.x),smooth:!0}),U.push({angle:m,smooth:!1});for(const H of U){const I=eS(H.angle-w);if(!(Math.abs(I)>Zw)&&!(Math.abs(Math.sin(I))*x>Kw)){h=H.angle,f=H.smooth;break}}}const v=i!==null&&i>0&&Math.abs(x-i)<=Jw;if(h===null&&!v)return{point:e,guides:ji};const C=h??w,y=v?i:x,S={x:Math.cos(C),y:Math.sin(C)},G=y+(h===null?0:zi),W=v?y:f?zi:0;return{point:l({x:d.x+S.x*y,y:d.y+S.y*y}),guides:[{kind:"angle",a:{x:d.x-S.x*W,y:d.y-S.y*W},b:{x:d.x+S.x*G,y:d.y+S.y*G}}]}}function Wc(e,t="stretch",n=hu){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Vo(i),d=nl(l);if(d.length)return t==="viewbox"?Fr(d,n):Ar(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(x=>x.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const x of c){const w=document.createElementNS("http://www.w3.org/2000/svg","path");w.setAttribute("d",x),u.appendChild(w);let m=0;try{m=w.getTotalLength()}catch{m=0}if(!m)continue;const h=[];for(let f=0;f<jo;f+=1){const v=w.getPointAtLength(f/jo*m);h.push({x:v.x,y:v.y})}p.push(h)}return p.length?t==="viewbox"?Fr(p,n):Ar(p):null}const o=i.split(/[\s,]+/).map(Number).filter(l=>!Number.isNaN(l));if(o.length<6)return null;const r=[];for(let l=0;l+1<o.length;l+=2)r.push({x:o[l],y:o[l+1]});return t==="viewbox"?Fr([r],n):Ar([r])}function rS(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],d=o[(r+1)%o.length];(l.y<=t&&d.y>t||d.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(d.y-l.y)*(d.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=Gr(n[o]),l=Gr(n[o+1]);l>r&&i.push({x0:r,x1:l})}return aS(i)}function aS(e){if(e.length<2)return e;const t=[...e].sort((i,o)=>i.x0-o.x0),n=[t[0]];for(let i=1;i<t.length;i+=1){const o=n[n.length-1],r=t[i];r.x0<=o.x1?o.x1=Math.max(o.x1,r.x1):n.push({...r})}return n}function sS(e,t){const n=[];let i=0,o=0;for(;i<e.length&&o<t.length;){const r=Math.max(e[i].x0,t[o].x0),l=Math.min(e[i].x1,t[o].x1);l>r&&n.push({x0:r,x1:l}),e[i].x1<t[o].x1?i+=1:o+=1}return n}function lS(e){const t=[];let n=0;for(const i of e)i.x0>n&&t.push({x0:n,x1:i.x0}),n=Math.max(n,i.x1);return n<1&&t.push({x0:n,x1:1}),t}function cS(e,t){const n=[];for(const i of e){if(t.x1<=i.x0||t.x0>=i.x1){n.push(i);continue}t.x0>i.x0&&n.push({x0:i.x0,x1:t.x0}),t.x1<i.x1&&n.push({x0:t.x1,x1:i.x1})}return n}function dS(e,t,n,i){let o=null;for(let r=0;r<Lc;r+=1){const l=Gr(t+(n-t)*r/Math.max(1,Lc-1)),d=rS(e,l),c=i==="avoid"?lS(d):d;if(o=o===null?c:sS(o,c),o.length===0)return[]}return o??[]}function wu(e){return!!e&&typeof e=="object"&&e.type==="link"}function uS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(wu(c)){o(c.children??[],c.value,c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const x of p.split(/\s+/))x&&t.push({text:x,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Hc(e){return{...e.fontFamily&&{fontFamily:po(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"}}}function pS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(wu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Dc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:x}=e,w=e.lineHeight*l,m=e.spaceWidth*l,h=[];if(!t.length||d<=0||w<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const f=Math.max(1,m*.5),v=w*Cw;let C=0,y=0,S=0,G=t[0].para,W=0,U=0,H=null;for(;C<t.length&&S<Tw;){const I=y+w>c;if(I&&!u)break;const z=t[C].para;if(z>G+1){y+=w*(z-G-1),G=z-1,S+=1;continue}let $=I?[{x0:0,x1:d}]:dS(i,(y+v)/c,(y+w-v)/c,o).map(k=>({x0:k.x0*d,x1:k.x1*d}));p>0&&x>0&&!I&&$.length&&(H===null&&(H=S,W=$[0].x0,U=y),S-H<x&&($=cS($,{x0:W,x1:W+p})));const T=$.reduce((k,_)=>Math.max(k,_.x1-_.x0),0);for(const k of $){const _=k.x1-k.x0;if(_<f)continue;if(C>=t.length||t[C].para!==z)break;const g=C;let D=0;for(;C<t.length&&t[C].para===z;){const P=n[C]*l,q=C===g?P:m+P;if(D+q>_&&!(C===g&&_>=T-.5&&P>d-.5))break;D+=q,C+=1}if(C>g){const P=C>=t.length||t[C].para!==z;h.push({top:y,left:k.x0,width:_,from:g,to:C,justify:r==="justify"&&!P})}if(C>=t.length||t[C].para!==z)break}G=z,y+=w,S+=1}return{segments:h,placed:C,height:h.length?y:0,capLeft:W,capTop:U}}function mS(e){return`
23604
23604
  .${e}-wrapper {
23605
23605
  box-sizing: border-box;
23606
23606
  display: flex;
@@ -23829,7 +23829,7 @@ export function Helix({
23829
23829
  clip-path: inset(50%);
23830
23830
  white-space: nowrap;
23831
23831
  }
23832
- `}const So=7,gS=3.5,Co=9,Qn=8,ei=14,Oc=10,hS=24,Tr=14,fS=4,yS=1,xS=.05,qr=1.08;function Ur(e,t){switch(t){case"nw":return{x:e.minX,y:e.minY};case"ne":return{x:e.maxX,y:e.minY};case"se":return{x:e.maxX,y:e.maxY};case"sw":return{x:e.minX,y:e.maxY}}}function Su(e){switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}}function xs(e,t){const n=Ur(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Oc,y:n.y+o*Oc}}const vs=.1,bs=8,vS=4;function ws(e,t){return!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height)}function Si(e,t,n){const i=ws(e,t)*n;return{width:t.width*i,height:t.height*i}}function Ln(e,t,n){return(e-t)*n}function Vi(e,t,n){const i=e-t;return Math.abs(i)<vS?.5:Gr(n/i)}function Bc(e,t,n,i,o,r){const l=Si(e,n,r),d=e.x+Ln(e.width,l.width,i),c=e.y+Ln(e.height,l.height,o),u=ws(e,n),p=ws(t,n),x=Math.min(bs,Math.max(vs,p>0?r*(u/p):r)),w=Si(t,n,x);return{focalX:Vi(t.width,w.width,d-t.x),focalY:Vi(t.height,w.height,c-t.y),scale:x}}function bS({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,stage:l,onStageChange:d,onSelectionChange:c,onChange:u,onCommit:p}){const x=s.useRef(null),w=s.useRef(null),m=s.useRef(i);m.current=i;const h=s.useRef(null),f=s.useRef(null),v=s.useRef(null),C=s.useRef(null),[y,S]=s.useState([]),[G,W]=s.useState(ji),U=s.useCallback(b=>{W(M=>Qw(M,b)?M:b)},[]),H=l==="shape";s.useEffect(()=>{var b;H&&((b=x.current)==null||b.focus({preventScroll:!0}))},[H]),s.useEffect(()=>{H||S(b=>b.length?[]:b)},[H]);const I=y.length>0;s.useEffect(()=>{c==null||c(I)},[I,c]),s.useEffect(()=>()=>c==null?void 0:c(!1),[c]);const z=n.width>0?t.width/n.width:1,$=n.height>0?t.height/n.height:1,T=s.useCallback(b=>r?{x:(b.x-n.x)*z,y:(b.y-n.y)*$}:{x:b.x-n.x,y:b.y-n.y},[r,n,z,$]),A=s.useCallback(b=>r?{x:n.x+(z>0?b.x/z:0),y:n.y+($>0?b.y/$:0)}:{x:n.x+b.x,y:n.y+b.y},[r,n,z,$]),_=s.useMemo(()=>A({x:t.width/2,y:t.height/2}),[A,t.width,t.height]),g=s.useCallback((b,M)=>{var V;const E=(V=x.current)==null?void 0:V.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:r?{x:n.x+(b-E.left)/E.width*n.width,y:n.y+(M-E.top)/E.height*n.height}:{x:n.x+(b-E.left),y:n.y+(M-E.top)}},[r,n]),B=s.useCallback((b,M)=>{var V;const E=(V=x.current)==null?void 0:V.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:{x:(b-E.left)/E.width*t.width,y:(M-E.top)/E.height*t.height}},[t.width,t.height]),P=s.useCallback((b,M)=>{p(b,M)},[p]),Y=b=>{var Ce;const M=b.metaKey||b.ctrlKey,E=v.current;if(E&&b.pointerId===E.pointerId){if(b.stopPropagation(),b.preventDefault(),E.startDistance<=0)return;const X=g(b.clientX,b.clientY),me=Math.hypot(X.x-E.origin.x,X.y-E.origin.y),ae=Math.max(xS,me/E.startDistance);if(!E.moved&&Math.abs(ae-1)<1e-4)return;E.moved=!0,u(Pc(E.startContours,E.origin,ae));return}const V=f.current;if(V&&b.pointerId===V.pointerId){b.stopPropagation(),b.preventDefault();const X=g(b.clientX,b.clientY),{bbox:me}=V,ae=me.maxX-me.minX,q=me.maxY-me.minY,de=X.x-V.origin.x,ke=X.y-V.origin.y;let he=de,J=ke;if(isFinite(ae)&&isFinite(q))if(r){const Fe=Math.min(n.x,n.x+n.width-ae),et=Math.max(n.x,n.x+n.width-ae),Je=Math.min(n.y,n.y+n.height-q),dt=Math.max(n.y,n.y+n.height-q),tt=Math.min(et,Math.max(Fe,me.minX+de)),De=Math.min(dt,Math.max(Je,me.minY+ke));he=tt-me.minX,J=De-me.minY}else{const Fe=me.minX-n.x,et=me.minY-n.y,Je=Math.min(0,t.width-ae),dt=Math.max(0,t.width-ae),tt=Math.min(0,t.height-q),De=Math.max(0,t.height-q),Ie=Math.min(dt,Math.max(Je,Fe+de)),We=Math.min(De,Math.max(tt,et+ke));he=Ie-Fe,J=We-et}const Ne=[];if(!M&&isFinite(ae)&&isFinite(q)){const Fe=T({x:me.minX+ae/2+he,y:me.minY+q/2+J}),et={x:t.width/2,y:t.height/2};Math.abs(Fe.x-et.x)<=Tr&&(he=_.x-me.minX-ae/2,Ne.push(ys(et.x,"x",t))),Math.abs(Fe.y-et.y)<=Tr&&(J=_.y-me.minY-q/2,Ne.push(ys(et.y,"y",t)))}if(!V.moved&&he===0&&J===0)return;V.moved=!0,U(Ne.length?Ne:ji),u(ti(V.startContours,Fe=>({x:Fe.x+he,y:Fe.y+J})),{carryImage:!0});return}const Se=C.current;if(Se&&b.pointerId===Se.pointerId){b.stopPropagation(),b.preventDefault();const X=g(b.clientX,b.clientY);let me=X.x-Se.origin.x,ae=X.y-Se.origin.y;if(b.shiftKey&&(Math.abs(me)>Math.abs(ae)?ae=0:me=0),!Se.moved&&me===0&&ae===0)return;Se.moved=!0,u(Mc(Se.startContours,Se.selection,me,ae));return}const te=h.current;if(!te||b.pointerId!==te.pointerId)return;b.stopPropagation(),b.preventDefault();const $e=g(b.clientX,b.clientY);if(te.kind==="anchor"){const X={x:te.anchor.x+($e.x-te.origin.x),y:te.anchor.y+($e.y-te.origin.y)},me=M?[]:Uw(m.current,{contour:te.contour,node:te.node}),ae=M||!te.center?[]:[te.center],q=Fc(Ac(me,ae.map(he=>he.x),"x"),X,"x",T,Tr),de=Fc(Ac(me,ae.map(he=>he.y),"y"),X,"y",T,Tr),ke=M?X:{x:(q==null?void 0:q.value)??$r(X.x,o),y:(de==null?void 0:de.value)??$r(X.y,o)};if(b.shiftKey&&(Math.abs(ke.x-te.anchor.x)>Math.abs(ke.y-te.anchor.y)?ke.y=te.anchor.y:ke.x=te.anchor.x),!te.moved&&ke.x===te.anchor.x&&ke.y===te.anchor.y)return;te.moved=!0,U(nS(ke,q,de,t,T)),u(zw(m.current,te.contour,te.node,ke));return}const re=(Ce=m.current[te.contour])==null?void 0:Ce.nodes[te.node],ge=te.mirror&&!b.altKey,ye=ge||M?null:te.kind==="in"?re==null?void 0:re.out:re==null?void 0:re.in,Z=re?T(re.p):null,Q=ye?T(ye):null,ce=re&&(!M||b.shiftKey)?oS($e,re.p,ge||M?null:iS(m.current[te.contour],te.node,te.kind,T),Z&&Q?Math.hypot(Q.x-Z.x,Q.y-Z.y):null,b.shiftKey,T,A):{point:$e,guides:ji},we=ce.guides.length?ce.point:M?$e:{x:$r($e.x,o),y:$r($e.y,o)},Pe=te.kind==="in"?re==null?void 0:re.in:re==null?void 0:re.out;!te.moved&&Pe&&we.x===Pe.x&&we.y===Pe.y||(te.moved=!0,U(ce.guides),u(Vw(m.current,te.contour,te.node,te.kind,we,ge)))},ie=b=>{U(ji);const M=v.current;if(M&&b.pointerId===M.pointerId){v.current=null,b.stopPropagation();const ye=x.current;ye!=null&&ye.hasPointerCapture(M.pointerId)&&ye.releasePointerCapture(M.pointerId),M.moved&&P(m.current,{preserveShape:!0});return}const E=f.current;if(E&&b.pointerId===E.pointerId){f.current=null,b.stopPropagation();const ye=x.current;ye!=null&&ye.hasPointerCapture(E.pointerId)&&ye.releasePointerCapture(E.pointerId),E.moved?P(m.current,{preserveShape:!0}):S([]);return}const V=C.current;if(V&&b.pointerId===V.pointerId){C.current=null,b.stopPropagation();const ye=x.current;ye!=null&&ye.hasPointerCapture(V.pointerId)&&ye.releasePointerCapture(V.pointerId),V.moved&&P(m.current);return}const Se=h.current;if(!Se||b.pointerId!==Se.pointerId)return;h.current=null,b.stopPropagation();const te=x.current;te!=null&&te.hasPointerCapture(Se.pointerId)&&te.releasePointerCapture(Se.pointerId);const $e=Math.hypot(b.clientX-Se.clientOrigin.x,b.clientY-Se.clientOrigin.y);if(Se.moved||$e>fS){Se.moved&&P(m.current);return}if(!Se.toggleOnRelease||b.type!=="pointerup")return;const ge=kc(m.current,Se.contour,Se.node);ge!==m.current&&(u(ge),P(ge))},L=b=>{b.stopPropagation()},O=b=>{var M,E;b.stopPropagation(),b.preventDefault(),(M=x.current)==null||M.focus({preventScroll:!0}),f.current={pointerId:b.pointerId,origin:g(b.clientX,b.clientY),startContours:Pn(i),bbox:Jn(i),moved:!1},(E=x.current)==null||E.setPointerCapture(b.pointerId)},K=(b,M)=>{var $e,re;b.stopPropagation(),b.preventDefault(),($e=x.current)==null||$e.focus({preventScroll:!0}),S([]),d("shape");const E=Jn(i),V=Ur(E,Su(M)),Se=xs(E,M),te=Math.hypot(Se.x-V.x,Se.y-V.y);!isFinite(te)||te<=0||(v.current={pointerId:b.pointerId,corner:M,origin:V,startDistance:te,startContours:Pn(i),moved:!1},(re=x.current)==null||re.setPointerCapture(b.pointerId))},ue=(b,M,E,V)=>{var $e,re,ge,ye;b.stopPropagation(),b.preventDefault(),($e=x.current)==null||$e.focus({preventScroll:!0});const Se=(re=i[E])==null?void 0:re.nodes[V];if(!Se)return;if(b.altKey){const Z=M==="anchor"?bu(i,E,V):Gw(i,E,V,M);if(Z===i)return;S(M==="anchor"?[]:[{contour:E,node:V}]),u(Z),P(Z);return}const te=b.metaKey||b.ctrlKey;if(M==="anchor"&&b.shiftKey&&!te){S(Z=>Z.some(Q=>Q.contour===E&&Q.node===V)?Z.filter(Q=>!(Q.contour===E&&Q.node===V)):[...Z,{contour:E,node:V}]);return}if(M==="anchor"&&!te&&y.length>1&&y.some(Z=>Z.contour===E&&Z.node===V)){C.current={pointerId:b.pointerId,origin:g(b.clientX,b.clientY),startContours:Pn(i),selection:y,moved:!1},(ge=x.current)==null||ge.setPointerCapture(b.pointerId);return}S([{contour:E,node:V}]),h.current={kind:M,contour:E,node:V,pointerId:b.pointerId,origin:g(b.clientX,b.clientY),clientOrigin:{x:b.clientX,y:b.clientY},anchor:Se.p,center:Hw(i),mirror:M!=="anchor"&&!!(Se.in&&Se.out),toggleOnRelease:te,moved:!1},(ye=x.current)==null||ye.setPointerCapture(b.pointerId)},le=b=>{b.stopPropagation(),b.preventDefault();const M=ti(i,T),E=qw(M,B(b.clientX,b.clientY));if(!E||E.distance>hS)return;const{contours:V,nodeIndex:Se}=Xw(i,E.contour,E.segment,E.t);Se<0||(S([{contour:E.contour,node:Se}]),u(V),P(V))},F=b=>{if(b.key==="="||b.key==="+"||b.key==="-"||b.key==="_"){b.preventDefault(),b.stopPropagation();const te=Jn(i);if(!isFinite(te.minX)||!isFinite(te.maxX))return;const $e={x:(te.minX+te.maxX)/2,y:(te.minY+te.maxY)/2},ge=b.key==="="||b.key==="+"?qr:1/qr,ye=Pc(i,$e,ge);u(ye),P(ye,{preserveShape:!0});return}if(b.key==="Escape"){b.stopPropagation(),S([]),d("none");return}if(!y.length)return;if(b.key==="Backspace"||b.key==="Delete"){b.preventDefault(),b.stopPropagation();const te=jw(i,y);if(te===i)return;S([]),u(te),P(te);return}const M=o>0?o:yS,E=b.shiftKey?M*10:M,V={ArrowLeft:[-E,0],ArrowRight:[E,0],ArrowUp:[0,-E],ArrowDown:[0,E]}[b.key];if(!V)return;b.preventDefault(),b.stopPropagation();const Se=Mc(i,y,V[0],V[1]);u(Se),P(Se)},pe=s.useMemo(()=>Go(ti(i,T)),[i,T]),j=s.useMemo(()=>Jn(i),[i]),se=T({x:j.minX,y:j.minY}),ne={width:T({x:j.maxX,y:j.minY}).x-se.x,height:T({x:j.minX,y:j.maxY}).y-se.y},ve=H&&y.length===0&&isFinite(j.minX)&&isFinite(j.maxX)&&j.maxX>j.minX&&j.maxY>j.minY,Me=y.length>0||H,xe=Me;return a.jsxs("svg",{ref:x,className:`${e}-editor${Me?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:F,onPointerDown:()=>{var b;return(b=x.current)==null?void 0:b.focus({preventScroll:!0})},onPointerMove:Y,onPointerUp:ie,onPointerCancel:ie,onLostPointerCapture:ie,onContextMenu:b=>{b.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{S([]),d("none")},onClick:le}),xe&&a.jsx("path",{className:`${e}-editor-hit`,d:pe,onClick:le}),xe&&a.jsx("path",{className:`${e}-editor-outline`,d:pe}),xe&&G.map((b,M)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${b.kind}`,x1:b.a.x,y1:b.a.y,x2:b.b.x,y2:b.b.y},`${b.kind}-${M}`)),a.jsx("path",{ref:w,className:`${e}-editor-body`,d:pe,fillRule:"evenodd",onPointerDown:O,onClick:le}),xe&&i.map((b,M)=>b.nodes.map((E,V)=>{const Se=y.some($e=>$e.contour===M&&$e.node===V),te=T(E.p);return a.jsxs("g",{children:[Se&&y.length===1&&["in","out"].map($e=>{const re=E[$e];if(!re)return null;const ge=T(re);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:te.x,y1:te.y,x2:ge.x,y2:ge.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ge.x,cy:ge.y,r:gS}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ge.x,cy:ge.y,r:Co,onPointerDown:ye=>ue(ye,$e,M,V),onClick:L})]},$e)}),a.jsx("rect",{className:`${e}-editor-anchor${Se?` ${e}-editor-anchor-selected`:""}`,x:te.x-So/2,y:te.y-So/2,width:So,height:So,rx:E.in||E.out?So/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:te.x-Co,y:te.y-Co,width:Co*2,height:Co*2,onPointerDown:$e=>ue($e,"anchor",M,V),onClick:L,onDoubleClick:$e=>{$e.stopPropagation(),$e.preventDefault();const re=kc(i,M,V);u(re),P(re)}})]},`${M}-${V}`)})),ve&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:se.x,y:se.y,width:ne.width,height:ne.height}),["nw","ne","se","sw"].map(b=>{const M=T(xs(j,b)),E=b==="ne"||b==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:M.x-Qn/2,y:M.y-Qn/2,width:Qn,height:Qn}),a.jsx("rect",{className:`${e}-editor-scale-grab${E?` ${e}-editor-scale-grab-nesw`:""}`,x:M.x-ei/2,y:M.y-ei/2,width:ei,height:ei,onPointerDown:V=>K(V,b),onClick:L})]},b)})]})]})}function wS({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:x,onCommit:w}){const m=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),v=s.useRef(null),C=s.useRef({focalX:c,focalY:u,scale:p});C.current={focalX:c,focalY:u,scale:p};const y=l==="image";s.useEffect(()=>{var _;y&&((_=m.current)==null||_.focus({preventScroll:!0}))},[y]);const S=s.useCallback((_,g)=>{var P;const B=(P=m.current)==null?void 0:P.getBoundingClientRect();return!B||B.width<=0||B.height<=0?{x:0,y:0}:{x:(_-B.left)/B.width*t.width,y:(g-B.top)/B.height*t.height}},[t.width,t.height]),G=_=>{var B,P;if(!i)return;_.stopPropagation(),_.preventDefault(),(B=m.current)==null||B.focus({preventScroll:!0});const g=Si(n,i,p);f.current={pointerId:_.pointerId,origin:S(_.clientX,_.clientY),startX:Ln(n.width,g.width,c),startY:Ln(n.height,g.height,u),width:g.width,height:g.height,moved:!1},(P=m.current)==null||P.setPointerCapture(_.pointerId)},W=(_,g)=>{var ue,le;if(!i)return;_.stopPropagation(),_.preventDefault(),(ue=m.current)==null||ue.focus({preventScroll:!0});const B=Si(n,i,p),P=Ln(n.width,B.width,c),Y=Ln(n.height,B.height,u),ie={minX:P,minY:Y,maxX:P+B.width,maxY:Y+B.height},L=Ur(ie,Su(g)),O=Ur(ie,g),K=Math.hypot(O.x-L.x,O.y-L.y);!isFinite(K)||K<=0||(v.current={pointerId:_.pointerId,anchor:L,startDistance:K,startScale:p,startX:P,startY:Y,moved:!1},(le=m.current)==null||le.setPointerCapture(_.pointerId))},U=_=>{if(!i)return;const g=v.current;if(g&&_.pointerId===g.pointerId){_.stopPropagation(),_.preventDefault();const P=S(_.clientX,_.clientY),Y={x:P.x-n.x,y:P.y-n.y},ie=Math.hypot(Y.x-g.anchor.x,Y.y-g.anchor.y),L=Math.min(bs,Math.max(vs,g.startScale*(ie/g.startDistance)));if(!g.moved&&Math.abs(L-g.startScale)<1e-4)return;g.moved=!0;const O=L/g.startScale,K=g.anchor.x+(g.startX-g.anchor.x)*O,ue=g.anchor.y+(g.startY-g.anchor.y)*O,le=Si(n,i,L);x({focalX:Vi(n.width,le.width,K),focalY:Vi(n.height,le.height,ue),scale:L});return}const B=f.current;if(B&&_.pointerId===B.pointerId){_.stopPropagation(),_.preventDefault();const P=S(_.clientX,_.clientY),Y=P.x-B.origin.x,ie=P.y-B.origin.y;if(!B.moved&&Y===0&&ie===0)return;B.moved=!0,x({focalX:Vi(n.width,B.width,B.startX+Y),focalY:Vi(n.height,B.height,B.startY+ie),scale:p})}},H=_=>{var P,Y;const g=f.current;if(g&&_.pointerId===g.pointerId){f.current=null,_.stopPropagation(),(P=m.current)!=null&&P.hasPointerCapture(g.pointerId)&&m.current.releasePointerCapture(g.pointerId),g.moved&&w(C.current);return}const B=v.current;B&&_.pointerId===B.pointerId&&(v.current=null,_.stopPropagation(),(Y=m.current)!=null&&Y.hasPointerCapture(B.pointerId)&&m.current.releasePointerCapture(B.pointerId),B.moved&&w(C.current))},I=_=>{if(_.key==="Escape"){_.stopPropagation(),d("none");return}if(_.key==="="||_.key==="+"||_.key==="-"||_.key==="_"){_.preventDefault(),_.stopPropagation();const g=_.key==="="||_.key==="+",B=Math.min(bs,Math.max(vs,p*(g?qr:1/qr))),P={focalX:c,focalY:u,scale:B};x(P),w(P)}},z=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},T=s.useMemo(()=>{const _=i??{width:n.width,height:n.height},g=Si(n,_,p);return!(g.width>0)||!(g.height>0)?null:{x:n.x+Ln(n.width,g.width,c),y:n.y+Ln(n.height,g.height,u),width:g.width,height:g.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),A=T?{minX:T.x,minY:T.y,maxX:T.x+T.width,maxY:T.y+T.height}:$;return a.jsxs("svg",{ref:m,className:`${e}-editor${y?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:I,onPointerMove:U,onPointerUp:H,onPointerCancel:H,onLostPointerCapture:H,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),y&&o&&T&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:T.x,y:T.y,width:T.width,height:T.height,children:[a.jsx("rect",{x:T.x,y:T.y,width:T.width,height:T.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:T.x,y:T.y,width:T.width,height:T.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:T.x,y:T.y,width:T.width,height:T.height})]}),y&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:G}),z.map(_=>{const g=xs(A,_),B=_==="ne"||_==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:g.x-Qn/2,y:g.y-Qn/2,width:Qn,height:Qn}),a.jsx("rect",{className:`${e}-editor-scale-grab${B?` ${e}-editor-scale-grab-nesw`:""}`,x:g.x-ei/2,y:g.y-ei/2,width:ei,height:ei,onPointerDown:P=>W(P,_)})]},_)})]})]})}function SS(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function CS(e,t){return Math.abs(e.top-t.top)<.5&&Math.abs(e.left-t.left)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5}function $S(e,t){const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e||!t){i(null);return}let o=0,r=null;const l=()=>{const d=SS(e);(!r||!CS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function TS(){return typeof document>"u"?null:document.body}function IS({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:x,dropCapLines:w,dropCapSize:m,showGuides:h,typography:f,imageUrl:v,imageFocalX:C,imageFocalY:y,imageScale:S,imageCustomPath:G,pathDragActive:W,pathCarryImage:U,onCarryImageConsumed:H,pathEditor:I,imageEditor:z}){var je,Ue;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[T,A]=s.useState(null),_=s.useRef(null),[g,B]=s.useState({width:0,height:0}),[P,Y]=s.useState(null),[ie,L]=s.useState(0),[O,K]=s.useState("none");s.useEffect(()=>{!I&&!z&&K("none")},[I,z]);const[ue,le]=s.useState(null);s.useEffect(()=>{if(!v||typeof Image>"u"){le(null);return}let k=!1;const ee=new Image;return ee.onload=()=>{k||le({width:ee.naturalWidth,height:ee.naturalHeight})},ee.src=v,()=>{k=!0}},[v]);const F=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),pe=s.useMemo(()=>uS(F),[F]),j=s.useMemo(()=>pS(F),[F]),se=w>0?((Ue=(je=pe[0])==null?void 0:je.text)==null?void 0:Ue.charAt(0))??"":"",ne=g.height>0?g.width/g.height:1,ve=(I==null?void 0:I.contours)??null,Me=s.useMemo(()=>{if(ve){const Te=nl(ve);if(Te.length)return Fr(Te,r)}const k=i.trim(),ee=k?Wc(k,o,r):null;return ee&&ee.length?ee:ps(n==="custom"?"rectangle":n,ne)},[ve,n,i,o,r,Math.round(ne*100)/100]),xe=I==null?void 0:I.onConvert,b=(I==null?void 0:I.needsConversion)??!1,M=s.useMemo(()=>{const k=ve??(i.trim()?Vo(i):null);return!!(k&&vu(k,r))},[ve,i,r]),[E,V]=s.useState(null);Cr(()=>{if(!M){E&&V(null);return}!E&&g.width>0&&g.height>0&&V({width:g.width,height:g.height})},[M,g.width,g.height,E]);const Se=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return Me;const k=E??g,ee=r.width/k.width,Te=r.height/k.height;return Me.map(He=>He.map(Be=>({x:Be.x*ee,y:Be.y*Te})))},[Me,M,E,r.width,r.height,g.width,g.height]),te=s.useMemo(()=>{const k=G.trim(),ee=k?Wc(k,o,r):null;return ee&&ee.length?ee:ps(n==="custom"?"rectangle":n,ne)},[n,G,o,r,Math.round(ne*100)/100]),$e=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return te;const k=E??g,ee=r.width/k.width,Te=r.height/k.height;return te.map(He=>He.map(Be=>({x:Be.x*ee,y:Be.y*Te})))},[te,M,E,r.width,r.height,g.width,g.height]),re=s.useRef(null);s.useEffect(()=>{if(!(!xe||g.width<=0||g.height<=0)){if(M){if(re.current===i)return;const k=ve??(i.trim()?Vo(i):null);if(!(k!=null&&k.length))return;const ee=ti(k,Te=>({x:r.x+(Te.x-r.x)/g.width*r.width,y:r.y+(Te.y-r.y)/g.height*r.height}));re.current=Go(ee),xe(ee);return}!b||!Me.length||xe(ti(xu(Me),k=>({x:k.x*Yr,y:k.y*Yr})))}},[b,M,xe,Me,ve,i,r,g.width,g.height]),Cr(()=>{const k=T;if(!k||typeof ResizeObserver>"u")return;const ee=()=>{const He=k.getBoundingClientRect();B(Be=>Math.abs(Be.width-He.width)<.5&&Math.abs(Be.height-He.height)<.5?Be:{width:He.width,height:He.height})};ee();const Te=new ResizeObserver(ee);return Te.observe(k),()=>Te.disconnect()},[T]),s.useEffect(()=>{const k=typeof document<"u"?document.fonts:void 0;k!=null&&k.ready&&k.ready.then(()=>{L(ee=>ee+1)})},[]),Cr(()=>{const k=_.current;if(!k)return;if(!pe.length){Y(null);return}const ee=[],Te=document.createDocumentFragment();for(const st of pe){const St=document.createElement("span");Object.assign(St.style,Hc(st.leaf)),St.textContent=st.text,Te.appendChild(St),ee.push(St)}const He=document.createElement("span");He.textContent=" ",Te.appendChild(He);const Be=document.createElement("span");Be.textContent=se||"H",Be.style.lineHeight="1",Te.appendChild(Be),k.replaceChildren(Te);const Ve=window.getComputedStyle(k),rt=parseFloat(Ve.fontSize)||16,Ze=parseFloat(Ve.lineHeight),_e=Number.isNaN(Ze)?rt*1.2:Ze,qe=Math.max(_e,rt);Be.style.fontSize=`${qe*m}px`;const Oe=ee.map(st=>st.getBoundingClientRect().width),nt=He.getBoundingClientRect().width,at=se?Be.getBoundingClientRect().width:0;k.replaceChildren(),Y({widths:Oe,spaceWidth:nt,lineHeight:qe,capWidth:at})},[pe,f,se,w,m,ie,g.width]);const ge=P&&se?P.capWidth+P.lineHeight*Iw:0,ye=Math.max(w,Math.ceil(m)),Z=s.useMemo(()=>{if(!P||!pe.length||g.width<=0||g.height<=0||!u)return 1;const k=He=>Dc({tokens:pe,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Se,mode:l,align:d,scale:He,allowOverflow:!1,capInset:ge*He,capLines:se?ye:0});if(k(1).placed>=pe.length)return 1;if(k(Ya).placed<pe.length)return Ya;let ee=Ya,Te=1;for(let He=0;He<$w;He+=1){const Be=(ee+Te)/2;k(Be).placed>=pe.length?ee=Be:Te=Be}return ee},[P,pe,g.width,g.height,Se,l,d,u,ge,se,ye]);s.useEffect(()=>{x(Z)},[Z,x]);const Q=u?Math.min(p,Z):1,ce=s.useMemo(()=>!P||!pe.length||g.width<=0||g.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Dc({tokens:pe,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Se,mode:l,align:d,scale:Q,allowOverflow:c,capInset:ge*Q,capLines:se?ye:0}),[P,pe,g.width,g.height,Se,l,d,Q,c,ge,se,ye]),we=P?P.lineHeight*Q:0,Pe=d==="justify"?"left":d,Ce=!!(I&&ve&&g.width>0&&g.height>0),X=!!z,me=(Ce||X)&&g.width>0&&g.height>0,ae=$S(T,me),q=me&&ae?TS():null,de=s.useRef(!1),ke=s.useCallback(k=>{de.current=k},[]);s.useEffect(()=>{if(!Ce&&!X)return;const k=ee=>{const Te=T;if(!Te)return;const He=Te.getBoundingClientRect();ee.clientX>=He.left&&ee.clientX<=He.right&&ee.clientY>=He.top&&ee.clientY<=He.bottom&&(ee.preventDefault(),ee.stopPropagation(),K(Ve=>Ve==="shape"&&de.current?Ve:Ve==="shape"&&X?"image":Ce?"shape":"image"))};return document.addEventListener("dblclick",k,!0),()=>document.removeEventListener("dblclick",k,!0)},[Ce,X,T]);const he=s.useMemo(()=>v&&g.width>0&&g.height>0?Ew($e,g):null,[v,$e,g.width,g.height]),J=s.useRef(null),Ne=(()=>{const k=J.current;return W||U||!z||!ue||!he||!k||G===k.customPath?null:Bc(k.bounds,he,ue,k.focalX,k.focalY,k.scale)})();Cr(()=>{if(W||!z||!ue||!he)return;const k=J.current,ee=!!(k&&G!==k.customPath);ee&&Ne&&z.onCommit(Ne),ee&&U&&(H==null||H()),J.current={rings:$e,bounds:he,focalX:(Ne==null?void 0:Ne.focalX)??C,focalY:(Ne==null?void 0:Ne.focalY)??y,scale:(Ne==null?void 0:Ne.scale)??S,customPath:G}},[W,U,G,$e,he,z,ue,C,y,S,Ne,H]);const Fe=s.useMemo(()=>{if(!W||U||!ue||!he)return null;const k=J.current;return k?Bc(k.bounds,he,ue,k.focalX,k.focalY,k.scale):null},[W,U,ue,he,G,$e]),et=(Fe==null?void 0:Fe.focalX)??(Ne==null?void 0:Ne.focalX)??C,Je=(Fe==null?void 0:Fe.focalY)??(Ne==null?void 0:Ne.focalY)??y,dt=(Fe==null?void 0:Fe.scale)??(Ne==null?void 0:Ne.scale)??S,tt=s.useMemo(()=>v&&g.width>0&&g.height>0?Pw($e,g):"",[v,$e,g.width,g.height]),De=he,Ie=`${$}-clip`,We=s.useMemo(()=>{if(!De)return null;const k=ue??{width:De.width,height:De.height},ee=Si(De,k,dt);return{x:Ln(De.width,ee.width,et),y:Ln(De.height,ee.height,Je),width:ee.width,height:ee.height}},[De,ue,et,Je,dt]);return a.jsxs("div",{className:`${e}-column`,ref:A,children:[v&&tt&&De&&We?a.jsxs("svg",{className:`${e}-shape-image`,viewBox:`0 0 ${g.width} ${g.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Ie,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:tt,fillRule:"evenodd"})})}),a.jsx("image",{href:v,x:De.x+We.x,y:De.y+We.y,width:We.width,height:We.height,preserveAspectRatio:"none",clipPath:`url(#${Ie})`})]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:Q},children:[a.jsx("div",{className:`${e}-measure`,ref:_,style:f,"aria-hidden":!0}),ce.segments.map((k,ee)=>{const Te=pe.slice(k.from,k.to),He=ee===0;return a.jsx("div",{className:`${e}-line${k.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${k.top}px`,left:`${k.left}px`,width:`${k.width}px`,textAlign:k.justify?void 0:Pe},children:Te.map((Be,Ve)=>{const Ze=se&&He&&k.from===0&&Ve===0?Be.text.slice(1):Be.text,_e=Hc(Be.leaf),qe=Be.href?a.jsx("a",{className:`${e}-link`,href:Be.href,target:Be.target,style:_e,children:Ze}):a.jsx("span",{style:_e,children:Ze});return a.jsxs("span",{children:[!k.justify&&Ve>0?" ":null,qe]},Ve)})},`${k.from}-${k.to}-${ee}`)}),h&&!ve&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:Se.map((k,ee)=>a.jsx("polygon",{points:k.map(Te=>`${Te.x},${Te.y}`).join(" ")},ee))})]}),se&&P&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${ce.capTop}px`,left:`${ce.capLeft}px`,fontSize:`${we*m}px`,lineHeight:`${we*m}px`},children:se}),q&&ae&&(ve&&I||z)&&zn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:ae.top,left:ae.left,width:ae.width,height:ae.height,zIndex:Lw,pointerEvents:"none"},children:[ve&&I&&a.jsx(bS,{P:e,box:{width:ae.width,height:ae.height},viewBox:r,contours:ve,snap:I.snap,stretchToBox:!M,stage:O,onStageChange:K,onSelectionChange:ke,onChange:I.onChange,onCommit:I.onCommit}),z&&De&&a.jsx(wS,{P:e,box:{width:ae.width,height:ae.height},bounds:De,natural:ue,imageUrl:v,maskPath:tt,stage:O,onStageChange:K,focalX:et,focalY:Je,scale:dt,onChange:z.onChange,onCommit:z.onCommit})]}),q),a.jsx("div",{className:`${e}-a11y`,children:j.map((k,ee)=>a.jsx("p",{children:k},ee))})]})}function RS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>mS(d),[d]),u=n??!1,p=!!r||!!o,x=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),w=(e==null?void 0:e.shape)??"rectangle",m=(e==null?void 0:e.customPath)??"",h=(e==null?void 0:e.pathFit)??"stretch",f=s.useMemo(()=>Mw(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),v=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",C=(e==null?void 0:e.textAlign)??"left",y=((e==null?void 0:e.overflowMode)??"clip")==="visible",S=((e==null?void 0:e.fitText)??"off")==="on",G=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,W=(e==null?void 0:e.dropCapSize)??Rw,U=u&&p&&!i,[H,I]=s.useState(!1);s.useEffect(()=>{if(!u||!p){I(!1);return}const Q=()=>I(!0),ce=()=>I(!1),we=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],Pe=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const Ce of we)window.addEventListener(Ce,Q);for(const Ce of Pe)window.addEventListener(Ce,ce);return()=>{for(const Ce of we)window.removeEventListener(Ce,Q);for(const Ce of Pe)window.removeEventListener(Ce,ce)}},[u,p]);const z=u&&p&&!i&&typeof l=="function",$=!H,T=Math.max(0,(e==null?void 0:e.pathSnap)??0),A=s.useRef(e??{}),_=s.useRef(""),g=[e==null?void 0:e.customPath,e==null?void 0:e.shape,e==null?void 0:e.pathFit,e==null?void 0:e.pathViewBox,e==null?void 0:e.imageScale,e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.image].join("\0");g!==_.current&&(_.current=g,A.current=e??{});const[B,P]=s.useState(null),[Y,ie]=s.useState(!1),[L,O]=s.useState(!1),K=s.useCallback(()=>O(!1),[]),ue=s.useMemo(()=>!B||B.serialized===m?m:B.serialized,[B,m]);s.useEffect(()=>{z||(ie(!1),O(!1))},[z]);const le=s.useMemo(()=>{if(!z)return null;if(B&&(B.base===m||B.serialized===m))return B.contours;const Q=Vo(m);return Q.length?Q:null},[z,B,m]),F=h==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===Xr&&!!(le&&!vu(le,f)),pe=s.useCallback((Q,ce,we)=>{const Pe=Go(Q);if(P(Ce=>({base:Ce&&(Ce.base===m||Ce.serialized===m)?Ce.base:m,serialized:Pe,contours:Q})),ce){const Ce=A.current,X=we!=null&&we.preserveShape?Ce.shape:"custom",me={...Ce,shape:X,customPath:Pe};A.current=me,l==null||l(me)}},[m,l]),j=s.useMemo(()=>z?{contours:F?le:null,snap:T,needsConversion:!F,onConvert:Q=>{const ce=Go(Q);P({base:ce,serialized:ce,contours:Q});const we={...A.current,pathFit:"viewbox",pathViewBox:Xr,customPath:ce};A.current=we,l==null||l(we)},onChange:(Q,ce)=>{ie(!0),O(!!(ce!=null&&ce.carryImage)),pe(Q,!1)},onCommit:(Q,ce)=>{pe(Q,!0,ce),ie(!1)}}:null,[z,F,le,T,l,pe]),se=v==="avoid"&&!!(e!=null&&e.image),ne=s.useMemo(()=>({focalX:(e==null?void 0:e.imageFocalX)??.5,focalY:(e==null?void 0:e.imageFocalY)??.5,scale:(e==null?void 0:e.imageScale)??1}),[e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.imageScale]),[ve,Me]=s.useState(null),xe=ve??ne,b=s.useCallback(Q=>Me(Q),[]),M=s.useCallback(Q=>{Me(Q);const ce={...A.current,imageFocalX:Q.focalX,imageFocalY:Q.focalY,imageScale:Q.scale};A.current=ce,l==null||l(ce)},[l]);s.useEffect(()=>{ve&&Math.abs(ve.focalX-ne.focalX)<1e-9&&Math.abs(ve.focalY-ne.focalY)<1e-9&&Math.abs(ve.scale-ne.scale)<1e-9&&Me(null)},[ve,ne]);const E=s.useMemo(()=>!z||!se?null:{onChange:b,onCommit:M},[z,se,b,M]),[V,Se]=s.useState(void 0),te=s.useRef(void 0),$e=s.useCallback(Q=>{const ce=te.current;ce!==void 0&&Math.abs(ce-Q)<.005||(te.current=Q,Se(Q))},[]),re=s.useMemo(()=>S&&typeof V=="number"?V:1,[V,S]),ge=Q=>`calc(${Q} * var(--${d}-fit, 1))`,ye=s.useMemo(()=>{var we,Pe,Ce,X,me;const Q=(e==null?void 0:e.textFontSize)??.012,ce=Math.max((e==null?void 0:e.textLineHeight)??Q,Q);return{fontFamily:po(e==null?void 0:e.textFontFamily),fontWeight:(we=e==null?void 0:e.textFontSettings)==null?void 0:we.fontWeight,fontStyle:(Pe=e==null?void 0:e.textFontSettings)==null?void 0:Pe.fontStyle,fontSize:ge(D.scalingValue(Q,u)),lineHeight:ge(D.scalingValue(ce,u)),letterSpacing:ge(D.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:ge(D.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(Ce=e==null?void 0:e.textTextAppearance)==null?void 0:Ce.textTransform,textDecoration:(X=e==null?void 0:e.textTextAppearance)==null?void 0:X.textDecoration,fontVariant:(me=e==null?void 0:e.textTextAppearance)==null?void 0:me.fontVariant}},[e,u,d]),Z={[`--${d}-text-color`]:(e==null?void 0:e.textColor)??"#000000",[`--${d}-link-color`]:(e==null?void 0:e.linkColor)??(e==null?void 0:e.textColor)??"#000000",[`--${d}-background-color`]:(e==null?void 0:e.backgroundColor)??"transparent"};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{className:`${d}-wrapper`,style:{...Z},children:a.jsx(IS,{P:d,item:x,shape:w,customPath:m,pathFit:h,viewBox:f,mode:v,align:C,allowOverflow:y,fitEnabled:S,scale:re,onFitScale:$e,dropCapLines:G,dropCapSize:W,showGuides:(U||z)&&$,typography:ye,imageUrl:v==="avoid"?e==null?void 0:e.image:null,imageFocalX:xe.focalX,imageFocalY:xe.focalY,imageScale:xe.scale,imageCustomPath:ue,pathDragActive:Y,pathCarryImage:L,onCarryImageConsumed:K,pathEditor:$?j:null,imageEditor:$?E:null})})]})}const LS=`import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
23832
+ `}const So=7,gS=3.5,Co=9,Qn=8,ei=14,Oc=10,hS=24,Tr=14,fS=4,yS=1,xS=.05,qr=1.08;function Ur(e,t){switch(t){case"nw":return{x:e.minX,y:e.minY};case"ne":return{x:e.maxX,y:e.minY};case"se":return{x:e.maxX,y:e.maxY};case"sw":return{x:e.minX,y:e.maxY}}}function Su(e){switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}}function xs(e,t){const n=Ur(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Oc,y:n.y+o*Oc}}const vs=.1,bs=8,vS=4;function ws(e,t){return!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height)}function Si(e,t,n){const i=ws(e,t)*n;return{width:t.width*i,height:t.height*i}}function Ln(e,t,n){return(e-t)*n}function Vi(e,t,n){const i=e-t;return Math.abs(i)<vS?.5:Gr(n/i)}function Bc(e,t,n,i,o,r){const l=Si(e,n,r),d=e.x+Ln(e.width,l.width,i),c=e.y+Ln(e.height,l.height,o),u=ws(e,n),p=ws(t,n),x=Math.min(bs,Math.max(vs,p>0?r*(u/p):r)),w=Si(t,n,x);return{focalX:Vi(t.width,w.width,d-t.x),focalY:Vi(t.height,w.height,c-t.y),scale:x}}function bS({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,stage:l,onStageChange:d,onSelectionChange:c,onChange:u,onCommit:p}){const x=s.useRef(null),w=s.useRef(null),m=s.useRef(i);m.current=i;const h=s.useRef(null),f=s.useRef(null),v=s.useRef(null),C=s.useRef(null),[y,S]=s.useState([]),[G,W]=s.useState(ji),U=s.useCallback(b=>{W(M=>Qw(M,b)?M:b)},[]),H=l==="shape";s.useEffect(()=>{var b;H&&((b=x.current)==null||b.focus({preventScroll:!0}))},[H]),s.useEffect(()=>{H||S(b=>b.length?[]:b)},[H]);const I=y.length>0;s.useEffect(()=>{c==null||c(I)},[I,c]),s.useEffect(()=>()=>c==null?void 0:c(!1),[c]);const z=n.width>0?t.width/n.width:1,$=n.height>0?t.height/n.height:1,T=s.useCallback(b=>r?{x:(b.x-n.x)*z,y:(b.y-n.y)*$}:{x:b.x-n.x,y:b.y-n.y},[r,n,z,$]),k=s.useCallback(b=>r?{x:n.x+(z>0?b.x/z:0),y:n.y+($>0?b.y/$:0)}:{x:n.x+b.x,y:n.y+b.y},[r,n,z,$]),_=s.useMemo(()=>k({x:t.width/2,y:t.height/2}),[k,t.width,t.height]),g=s.useCallback((b,M)=>{var V;const E=(V=x.current)==null?void 0:V.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:r?{x:n.x+(b-E.left)/E.width*n.width,y:n.y+(M-E.top)/E.height*n.height}:{x:n.x+(b-E.left),y:n.y+(M-E.top)}},[r,n]),D=s.useCallback((b,M)=>{var V;const E=(V=x.current)==null?void 0:V.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:{x:(b-E.left)/E.width*t.width,y:(M-E.top)/E.height*t.height}},[t.width,t.height]),P=s.useCallback((b,M)=>{p(b,M)},[p]),q=b=>{var Se;const M=b.metaKey||b.ctrlKey,E=v.current;if(E&&b.pointerId===E.pointerId){if(b.stopPropagation(),b.preventDefault(),E.startDistance<=0)return;const X=g(b.clientX,b.clientY),me=Math.hypot(X.x-E.origin.x,X.y-E.origin.y),re=Math.max(xS,me/E.startDistance);if(!E.moved&&Math.abs(re-1)<1e-4)return;E.moved=!0,u(Pc(E.startContours,E.origin,re));return}const V=f.current;if(V&&b.pointerId===V.pointerId){b.stopPropagation(),b.preventDefault();const X=g(b.clientX,b.clientY),{bbox:me}=V,re=me.maxX-me.minX,Y=me.maxY-me.minY,ce=X.x-V.origin.x,Ee=X.y-V.origin.y;let he=ce,Q=Ee;if(isFinite(re)&&isFinite(Y))if(r){const Fe=Math.min(n.x,n.x+n.width-re),et=Math.max(n.x,n.x+n.width-re),Je=Math.min(n.y,n.y+n.height-Y),dt=Math.max(n.y,n.y+n.height-Y),tt=Math.min(et,Math.max(Fe,me.minX+ce)),De=Math.min(dt,Math.max(Je,me.minY+Ee));he=tt-me.minX,Q=De-me.minY}else{const Fe=me.minX-n.x,et=me.minY-n.y,Je=Math.min(0,t.width-re),dt=Math.max(0,t.width-re),tt=Math.min(0,t.height-Y),De=Math.max(0,t.height-Y),Ie=Math.min(dt,Math.max(Je,Fe+ce)),We=Math.min(De,Math.max(tt,et+Ee));he=Ie-Fe,Q=We-et}const Ne=[];if(!M&&isFinite(re)&&isFinite(Y)){const Fe=T({x:me.minX+re/2+he,y:me.minY+Y/2+Q}),et={x:t.width/2,y:t.height/2};Math.abs(Fe.x-et.x)<=Tr&&(he=_.x-me.minX-re/2,Ne.push(ys(et.x,"x",t))),Math.abs(Fe.y-et.y)<=Tr&&(Q=_.y-me.minY-Y/2,Ne.push(ys(et.y,"y",t)))}if(!V.moved&&he===0&&Q===0)return;V.moved=!0,U(Ne.length?Ne:ji),u(ti(V.startContours,Fe=>({x:Fe.x+he,y:Fe.y+Q})),{carryImage:!0});return}const Ce=C.current;if(Ce&&b.pointerId===Ce.pointerId){b.stopPropagation(),b.preventDefault();const X=g(b.clientX,b.clientY);let me=X.x-Ce.origin.x,re=X.y-Ce.origin.y;if(b.shiftKey&&(Math.abs(me)>Math.abs(re)?re=0:me=0),!Ce.moved&&me===0&&re===0)return;Ce.moved=!0,u(Mc(Ce.startContours,Ce.selection,me,re));return}const te=h.current;if(!te||b.pointerId!==te.pointerId)return;b.stopPropagation(),b.preventDefault();const $e=g(b.clientX,b.clientY);if(te.kind==="anchor"){const X={x:te.anchor.x+($e.x-te.origin.x),y:te.anchor.y+($e.y-te.origin.y)},me=M?[]:Uw(m.current,{contour:te.contour,node:te.node}),re=M||!te.center?[]:[te.center],Y=Fc(Ac(me,re.map(he=>he.x),"x"),X,"x",T,Tr),ce=Fc(Ac(me,re.map(he=>he.y),"y"),X,"y",T,Tr),Ee=M?X:{x:(Y==null?void 0:Y.value)??$r(X.x,o),y:(ce==null?void 0:ce.value)??$r(X.y,o)};if(b.shiftKey&&(Math.abs(Ee.x-te.anchor.x)>Math.abs(Ee.y-te.anchor.y)?Ee.y=te.anchor.y:Ee.x=te.anchor.x),!te.moved&&Ee.x===te.anchor.x&&Ee.y===te.anchor.y)return;te.moved=!0,U(nS(Ee,Y,ce,t,T)),u(zw(m.current,te.contour,te.node,Ee));return}const ae=(Se=m.current[te.contour])==null?void 0:Se.nodes[te.node],ge=te.mirror&&!b.altKey,ye=ge||M?null:te.kind==="in"?ae==null?void 0:ae.out:ae==null?void 0:ae.in,Z=ae?T(ae.p):null,J=ye?T(ye):null,de=ae&&(!M||b.shiftKey)?oS($e,ae.p,ge||M?null:iS(m.current[te.contour],te.node,te.kind,T),Z&&J?Math.hypot(J.x-Z.x,J.y-Z.y):null,b.shiftKey,T,k):{point:$e,guides:ji},be=de.guides.length?de.point:M?$e:{x:$r($e.x,o),y:$r($e.y,o)},Pe=te.kind==="in"?ae==null?void 0:ae.in:ae==null?void 0:ae.out;!te.moved&&Pe&&be.x===Pe.x&&be.y===Pe.y||(te.moved=!0,U(de.guides),u(Vw(m.current,te.contour,te.node,te.kind,be,ge)))},ie=b=>{U(ji);const M=v.current;if(M&&b.pointerId===M.pointerId){v.current=null,b.stopPropagation();const ye=x.current;ye!=null&&ye.hasPointerCapture(M.pointerId)&&ye.releasePointerCapture(M.pointerId),M.moved&&P(m.current,{preserveShape:!0});return}const E=f.current;if(E&&b.pointerId===E.pointerId){f.current=null,b.stopPropagation();const ye=x.current;ye!=null&&ye.hasPointerCapture(E.pointerId)&&ye.releasePointerCapture(E.pointerId),E.moved?P(m.current,{preserveShape:!0}):S([]);return}const V=C.current;if(V&&b.pointerId===V.pointerId){C.current=null,b.stopPropagation();const ye=x.current;ye!=null&&ye.hasPointerCapture(V.pointerId)&&ye.releasePointerCapture(V.pointerId),V.moved&&P(m.current);return}const Ce=h.current;if(!Ce||b.pointerId!==Ce.pointerId)return;h.current=null,b.stopPropagation();const te=x.current;te!=null&&te.hasPointerCapture(Ce.pointerId)&&te.releasePointerCapture(Ce.pointerId);const $e=Math.hypot(b.clientX-Ce.clientOrigin.x,b.clientY-Ce.clientOrigin.y);if(Ce.moved||$e>fS){Ce.moved&&P(m.current);return}if(!Ce.toggleOnRelease||b.type!=="pointerup")return;const ge=kc(m.current,Ce.contour,Ce.node);ge!==m.current&&(u(ge),P(ge))},L=b=>{b.stopPropagation()},B=b=>{var M,E;b.stopPropagation(),b.preventDefault(),(M=x.current)==null||M.focus({preventScroll:!0}),f.current={pointerId:b.pointerId,origin:g(b.clientX,b.clientY),startContours:Pn(i),bbox:Jn(i),moved:!1},(E=x.current)==null||E.setPointerCapture(b.pointerId)},K=(b,M)=>{var $e,ae;b.stopPropagation(),b.preventDefault(),($e=x.current)==null||$e.focus({preventScroll:!0}),S([]),d("shape");const E=Jn(i),V=Ur(E,Su(M)),Ce=xs(E,M),te=Math.hypot(Ce.x-V.x,Ce.y-V.y);!isFinite(te)||te<=0||(v.current={pointerId:b.pointerId,corner:M,origin:V,startDistance:te,startContours:Pn(i),moved:!1},(ae=x.current)==null||ae.setPointerCapture(b.pointerId))},ue=(b,M,E,V)=>{var $e,ae,ge,ye;b.stopPropagation(),b.preventDefault(),($e=x.current)==null||$e.focus({preventScroll:!0});const Ce=(ae=i[E])==null?void 0:ae.nodes[V];if(!Ce)return;if(b.altKey){const Z=M==="anchor"?bu(i,E,V):Gw(i,E,V,M);if(Z===i)return;S(M==="anchor"?[]:[{contour:E,node:V}]),u(Z),P(Z);return}const te=b.metaKey||b.ctrlKey;if(M==="anchor"&&b.shiftKey&&!te){S(Z=>Z.some(J=>J.contour===E&&J.node===V)?Z.filter(J=>!(J.contour===E&&J.node===V)):[...Z,{contour:E,node:V}]);return}if(M==="anchor"&&!te&&y.length>1&&y.some(Z=>Z.contour===E&&Z.node===V)){C.current={pointerId:b.pointerId,origin:g(b.clientX,b.clientY),startContours:Pn(i),selection:y,moved:!1},(ge=x.current)==null||ge.setPointerCapture(b.pointerId);return}S([{contour:E,node:V}]),h.current={kind:M,contour:E,node:V,pointerId:b.pointerId,origin:g(b.clientX,b.clientY),clientOrigin:{x:b.clientX,y:b.clientY},anchor:Ce.p,center:Hw(i),mirror:M!=="anchor"&&!!(Ce.in&&Ce.out),toggleOnRelease:te,moved:!1},(ye=x.current)==null||ye.setPointerCapture(b.pointerId)},le=b=>{b.stopPropagation(),b.preventDefault();const M=ti(i,T),E=qw(M,D(b.clientX,b.clientY));if(!E||E.distance>hS)return;const{contours:V,nodeIndex:Ce}=Xw(i,E.contour,E.segment,E.t);Ce<0||(S([{contour:E.contour,node:Ce}]),u(V),P(V))},F=b=>{if(b.key==="="||b.key==="+"||b.key==="-"||b.key==="_"){b.preventDefault(),b.stopPropagation();const te=Jn(i);if(!isFinite(te.minX)||!isFinite(te.maxX))return;const $e={x:(te.minX+te.maxX)/2,y:(te.minY+te.maxY)/2},ge=b.key==="="||b.key==="+"?qr:1/qr,ye=Pc(i,$e,ge);u(ye),P(ye,{preserveShape:!0});return}if(b.key==="Escape"){b.stopPropagation(),S([]),d("none");return}if(!y.length)return;if(b.key==="Backspace"||b.key==="Delete"){b.preventDefault(),b.stopPropagation();const te=jw(i,y);if(te===i)return;S([]),u(te),P(te);return}const M=o>0?o:yS,E=b.shiftKey?M*10:M,V={ArrowLeft:[-E,0],ArrowRight:[E,0],ArrowUp:[0,-E],ArrowDown:[0,E]}[b.key];if(!V)return;b.preventDefault(),b.stopPropagation();const Ce=Mc(i,y,V[0],V[1]);u(Ce),P(Ce)},pe=s.useMemo(()=>Go(ti(i,T)),[i,T]),j=s.useMemo(()=>Jn(i),[i]),se=T({x:j.minX,y:j.minY}),ne={width:T({x:j.maxX,y:j.minY}).x-se.x,height:T({x:j.minX,y:j.maxY}).y-se.y},ve=H&&y.length===0&&isFinite(j.minX)&&isFinite(j.maxX)&&j.maxX>j.minX&&j.maxY>j.minY,ke=y.length>0||H,xe=ke;return a.jsxs("svg",{ref:x,className:`${e}-editor${ke?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:F,onPointerDown:()=>{var b;return(b=x.current)==null?void 0:b.focus({preventScroll:!0})},onPointerMove:q,onPointerUp:ie,onPointerCancel:ie,onLostPointerCapture:ie,onContextMenu:b=>{b.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{S([]),d("none")},onClick:le}),xe&&a.jsx("path",{className:`${e}-editor-hit`,d:pe,onClick:le}),xe&&a.jsx("path",{className:`${e}-editor-outline`,d:pe}),xe&&G.map((b,M)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${b.kind}`,x1:b.a.x,y1:b.a.y,x2:b.b.x,y2:b.b.y},`${b.kind}-${M}`)),a.jsx("path",{ref:w,className:`${e}-editor-body`,d:pe,fillRule:"evenodd",onPointerDown:B,onClick:le}),xe&&i.map((b,M)=>b.nodes.map((E,V)=>{const Ce=y.some($e=>$e.contour===M&&$e.node===V),te=T(E.p);return a.jsxs("g",{children:[Ce&&y.length===1&&["in","out"].map($e=>{const ae=E[$e];if(!ae)return null;const ge=T(ae);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:te.x,y1:te.y,x2:ge.x,y2:ge.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ge.x,cy:ge.y,r:gS}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ge.x,cy:ge.y,r:Co,onPointerDown:ye=>ue(ye,$e,M,V),onClick:L})]},$e)}),a.jsx("rect",{className:`${e}-editor-anchor${Ce?` ${e}-editor-anchor-selected`:""}`,x:te.x-So/2,y:te.y-So/2,width:So,height:So,rx:E.in||E.out?So/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:te.x-Co,y:te.y-Co,width:Co*2,height:Co*2,onPointerDown:$e=>ue($e,"anchor",M,V),onClick:L,onDoubleClick:$e=>{$e.stopPropagation(),$e.preventDefault();const ae=kc(i,M,V);u(ae),P(ae)}})]},`${M}-${V}`)})),ve&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:se.x,y:se.y,width:ne.width,height:ne.height}),["nw","ne","se","sw"].map(b=>{const M=T(xs(j,b)),E=b==="ne"||b==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:M.x-Qn/2,y:M.y-Qn/2,width:Qn,height:Qn}),a.jsx("rect",{className:`${e}-editor-scale-grab${E?` ${e}-editor-scale-grab-nesw`:""}`,x:M.x-ei/2,y:M.y-ei/2,width:ei,height:ei,onPointerDown:V=>K(V,b),onClick:L})]},b)})]})]})}function wS({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:x,onCommit:w}){const m=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),v=s.useRef(null),C=s.useRef({focalX:c,focalY:u,scale:p});C.current={focalX:c,focalY:u,scale:p};const y=l==="image";s.useEffect(()=>{var _;y&&((_=m.current)==null||_.focus({preventScroll:!0}))},[y]);const S=s.useCallback((_,g)=>{var P;const D=(P=m.current)==null?void 0:P.getBoundingClientRect();return!D||D.width<=0||D.height<=0?{x:0,y:0}:{x:(_-D.left)/D.width*t.width,y:(g-D.top)/D.height*t.height}},[t.width,t.height]),G=_=>{var D,P;if(!i)return;_.stopPropagation(),_.preventDefault(),(D=m.current)==null||D.focus({preventScroll:!0});const g=Si(n,i,p);f.current={pointerId:_.pointerId,origin:S(_.clientX,_.clientY),startX:Ln(n.width,g.width,c),startY:Ln(n.height,g.height,u),width:g.width,height:g.height,moved:!1},(P=m.current)==null||P.setPointerCapture(_.pointerId)},W=(_,g)=>{var ue,le;if(!i)return;_.stopPropagation(),_.preventDefault(),(ue=m.current)==null||ue.focus({preventScroll:!0});const D=Si(n,i,p),P=Ln(n.width,D.width,c),q=Ln(n.height,D.height,u),ie={minX:P,minY:q,maxX:P+D.width,maxY:q+D.height},L=Ur(ie,Su(g)),B=Ur(ie,g),K=Math.hypot(B.x-L.x,B.y-L.y);!isFinite(K)||K<=0||(v.current={pointerId:_.pointerId,anchor:L,startDistance:K,startScale:p,startX:P,startY:q,moved:!1},(le=m.current)==null||le.setPointerCapture(_.pointerId))},U=_=>{if(!i)return;const g=v.current;if(g&&_.pointerId===g.pointerId){_.stopPropagation(),_.preventDefault();const P=S(_.clientX,_.clientY),q={x:P.x-n.x,y:P.y-n.y},ie=Math.hypot(q.x-g.anchor.x,q.y-g.anchor.y),L=Math.min(bs,Math.max(vs,g.startScale*(ie/g.startDistance)));if(!g.moved&&Math.abs(L-g.startScale)<1e-4)return;g.moved=!0;const B=L/g.startScale,K=g.anchor.x+(g.startX-g.anchor.x)*B,ue=g.anchor.y+(g.startY-g.anchor.y)*B,le=Si(n,i,L);x({focalX:Vi(n.width,le.width,K),focalY:Vi(n.height,le.height,ue),scale:L});return}const D=f.current;if(D&&_.pointerId===D.pointerId){_.stopPropagation(),_.preventDefault();const P=S(_.clientX,_.clientY),q=P.x-D.origin.x,ie=P.y-D.origin.y;if(!D.moved&&q===0&&ie===0)return;D.moved=!0,x({focalX:Vi(n.width,D.width,D.startX+q),focalY:Vi(n.height,D.height,D.startY+ie),scale:p})}},H=_=>{var P,q;const g=f.current;if(g&&_.pointerId===g.pointerId){f.current=null,_.stopPropagation(),(P=m.current)!=null&&P.hasPointerCapture(g.pointerId)&&m.current.releasePointerCapture(g.pointerId),g.moved&&w(C.current);return}const D=v.current;D&&_.pointerId===D.pointerId&&(v.current=null,_.stopPropagation(),(q=m.current)!=null&&q.hasPointerCapture(D.pointerId)&&m.current.releasePointerCapture(D.pointerId),D.moved&&w(C.current))},I=_=>{if(_.key==="Escape"){_.stopPropagation(),d("none");return}if(_.key==="="||_.key==="+"||_.key==="-"||_.key==="_"){_.preventDefault(),_.stopPropagation();const g=_.key==="="||_.key==="+",D=Math.min(bs,Math.max(vs,p*(g?qr:1/qr))),P={focalX:c,focalY:u,scale:D};x(P),w(P)}},z=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},T=s.useMemo(()=>{const _=i??{width:n.width,height:n.height},g=Si(n,_,p);return!(g.width>0)||!(g.height>0)?null:{x:n.x+Ln(n.width,g.width,c),y:n.y+Ln(n.height,g.height,u),width:g.width,height:g.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),k=T?{minX:T.x,minY:T.y,maxX:T.x+T.width,maxY:T.y+T.height}:$;return a.jsxs("svg",{ref:m,className:`${e}-editor${y?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:I,onPointerMove:U,onPointerUp:H,onPointerCancel:H,onLostPointerCapture:H,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),y&&o&&T&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:T.x,y:T.y,width:T.width,height:T.height,children:[a.jsx("rect",{x:T.x,y:T.y,width:T.width,height:T.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:T.x,y:T.y,width:T.width,height:T.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:T.x,y:T.y,width:T.width,height:T.height})]}),y&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:G}),z.map(_=>{const g=xs(k,_),D=_==="ne"||_==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:g.x-Qn/2,y:g.y-Qn/2,width:Qn,height:Qn}),a.jsx("rect",{className:`${e}-editor-scale-grab${D?` ${e}-editor-scale-grab-nesw`:""}`,x:g.x-ei/2,y:g.y-ei/2,width:ei,height:ei,onPointerDown:P=>W(P,_)})]},_)})]})]})}function SS(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function CS(e,t){return Math.abs(e.top-t.top)<.5&&Math.abs(e.left-t.left)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5}function $S(e,t){const[n,i]=s.useState(null);return s.useEffect(()=>{if(!e||!t){i(null);return}let o=0,r=null;const l=()=>{const d=SS(e);(!r||!CS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function TS(){return typeof document>"u"?null:document.body}function IS({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:x,dropCapLines:w,dropCapSize:m,showGuides:h,typography:f,imageUrl:v,imageFocalX:C,imageFocalY:y,imageScale:S,imageCustomPath:G,pathDragActive:W,pathCarryImage:U,onCarryImageConsumed:H,pathEditor:I,imageEditor:z}){var je,Ue;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[T,k]=s.useState(null),_=s.useRef(null),[g,D]=s.useState({width:0,height:0}),[P,q]=s.useState(null),[ie,L]=s.useState(0),[B,K]=s.useState("none");s.useEffect(()=>{!I&&!z&&K("none")},[I,z]);const[ue,le]=s.useState(null);s.useEffect(()=>{if(!v||typeof Image>"u"){le(null);return}let A=!1;const ee=new Image;return ee.onload=()=>{A||le({width:ee.naturalWidth,height:ee.naturalHeight})},ee.src=v,()=>{A=!0}},[v]);const F=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),pe=s.useMemo(()=>uS(F),[F]),j=s.useMemo(()=>pS(F),[F]),se=w>0?((Ue=(je=pe[0])==null?void 0:je.text)==null?void 0:Ue.charAt(0))??"":"",ne=g.height>0?g.width/g.height:1,ve=(I==null?void 0:I.contours)??null,ke=s.useMemo(()=>{if(ve){const Te=nl(ve);if(Te.length)return Fr(Te,r)}const A=i.trim(),ee=A?Wc(A,o,r):null;return ee&&ee.length?ee:ps(n==="custom"?"rectangle":n,ne)},[ve,n,i,o,r,Math.round(ne*100)/100]),xe=I==null?void 0:I.onConvert,b=(I==null?void 0:I.needsConversion)??!1,M=s.useMemo(()=>{const A=ve??(i.trim()?Vo(i):null);return!!(A&&vu(A,r))},[ve,i,r]),[E,V]=s.useState(null);Cr(()=>{if(!M){E&&V(null);return}!E&&g.width>0&&g.height>0&&V({width:g.width,height:g.height})},[M,g.width,g.height,E]);const Ce=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return ke;const A=E??g,ee=r.width/A.width,Te=r.height/A.height;return ke.map(He=>He.map(Be=>({x:Be.x*ee,y:Be.y*Te})))},[ke,M,E,r.width,r.height,g.width,g.height]),te=s.useMemo(()=>{const A=G.trim(),ee=A?Wc(A,o,r):null;return ee&&ee.length?ee:ps(n==="custom"?"rectangle":n,ne)},[n,G,o,r,Math.round(ne*100)/100]),$e=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return te;const A=E??g,ee=r.width/A.width,Te=r.height/A.height;return te.map(He=>He.map(Be=>({x:Be.x*ee,y:Be.y*Te})))},[te,M,E,r.width,r.height,g.width,g.height]),ae=s.useRef(null);s.useEffect(()=>{if(!(!xe||g.width<=0||g.height<=0)){if(M){if(ae.current===i)return;const A=ve??(i.trim()?Vo(i):null);if(!(A!=null&&A.length))return;const ee=ti(A,Te=>({x:r.x+(Te.x-r.x)/g.width*r.width,y:r.y+(Te.y-r.y)/g.height*r.height}));ae.current=Go(ee),xe(ee);return}!b||!ke.length||xe(ti(xu(ke),A=>({x:A.x*Yr,y:A.y*Yr})))}},[b,M,xe,ke,ve,i,r,g.width,g.height]),Cr(()=>{const A=T;if(!A||typeof ResizeObserver>"u")return;const ee=()=>{const He=A.getBoundingClientRect();D(Be=>Math.abs(Be.width-He.width)<.5&&Math.abs(Be.height-He.height)<.5?Be:{width:He.width,height:He.height})};ee();const Te=new ResizeObserver(ee);return Te.observe(A),()=>Te.disconnect()},[T]),s.useEffect(()=>{const A=typeof document<"u"?document.fonts:void 0;A!=null&&A.ready&&A.ready.then(()=>{L(ee=>ee+1)})},[]),Cr(()=>{const A=_.current;if(!A)return;if(!pe.length){q(null);return}const ee=[],Te=document.createDocumentFragment();for(const st of pe){const St=document.createElement("span");Object.assign(St.style,Hc(st.leaf)),St.textContent=st.text,Te.appendChild(St),ee.push(St)}const He=document.createElement("span");He.textContent=" ",Te.appendChild(He);const Be=document.createElement("span");Be.textContent=se||"H",Be.style.lineHeight="1",Te.appendChild(Be),A.replaceChildren(Te);const Ve=window.getComputedStyle(A),rt=parseFloat(Ve.fontSize)||16,Ze=parseFloat(Ve.lineHeight),_e=Number.isNaN(Ze)?rt*1.2:Ze,qe=Math.max(_e,rt);Be.style.fontSize=`${qe*m}px`;const Oe=ee.map(st=>st.getBoundingClientRect().width),nt=He.getBoundingClientRect().width,at=se?Be.getBoundingClientRect().width:0;A.replaceChildren(),q({widths:Oe,spaceWidth:nt,lineHeight:qe,capWidth:at})},[pe,f,se,w,m,ie,g.width]);const ge=P&&se?P.capWidth+P.lineHeight*Iw:0,ye=Math.max(w,Math.ceil(m)),Z=s.useMemo(()=>{if(!P||!pe.length||g.width<=0||g.height<=0||!u)return 1;const A=He=>Dc({tokens:pe,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Ce,mode:l,align:d,scale:He,allowOverflow:!1,capInset:ge*He,capLines:se?ye:0});if(A(1).placed>=pe.length)return 1;if(A(Ya).placed<pe.length)return Ya;let ee=Ya,Te=1;for(let He=0;He<$w;He+=1){const Be=(ee+Te)/2;A(Be).placed>=pe.length?ee=Be:Te=Be}return ee},[P,pe,g.width,g.height,Ce,l,d,u,ge,se,ye]);s.useEffect(()=>{x(Z)},[Z,x]);const J=u?Math.min(p,Z):1,de=s.useMemo(()=>!P||!pe.length||g.width<=0||g.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Dc({tokens:pe,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Ce,mode:l,align:d,scale:J,allowOverflow:c,capInset:ge*J,capLines:se?ye:0}),[P,pe,g.width,g.height,Ce,l,d,J,c,ge,se,ye]),be=P?P.lineHeight*J:0,Pe=d==="justify"?"left":d,Se=!!(I&&ve&&g.width>0&&g.height>0),X=!!z,me=(Se||X)&&g.width>0&&g.height>0,re=$S(T,me),Y=me&&re?TS():null,ce=s.useRef(!1),Ee=s.useCallback(A=>{ce.current=A},[]);s.useEffect(()=>{if(!Se&&!X)return;const A=ee=>{const Te=T;if(!Te)return;const He=Te.getBoundingClientRect();ee.clientX>=He.left&&ee.clientX<=He.right&&ee.clientY>=He.top&&ee.clientY<=He.bottom&&(ee.preventDefault(),ee.stopPropagation(),K(Ve=>Ve==="shape"&&ce.current?Ve:Ve==="shape"&&X?"image":Se?"shape":"image"))};return document.addEventListener("dblclick",A,!0),()=>document.removeEventListener("dblclick",A,!0)},[Se,X,T]);const he=s.useMemo(()=>v&&g.width>0&&g.height>0?Ew($e,g):null,[v,$e,g.width,g.height]),Q=s.useRef(null),Ne=(()=>{const A=Q.current;return W||U||!z||!ue||!he||!A||G===A.customPath?null:Bc(A.bounds,he,ue,A.focalX,A.focalY,A.scale)})();Cr(()=>{if(W||!z||!ue||!he)return;const A=Q.current,ee=!!(A&&G!==A.customPath);ee&&Ne&&z.onCommit(Ne),ee&&U&&(H==null||H()),Q.current={rings:$e,bounds:he,focalX:(Ne==null?void 0:Ne.focalX)??C,focalY:(Ne==null?void 0:Ne.focalY)??y,scale:(Ne==null?void 0:Ne.scale)??S,customPath:G}},[W,U,G,$e,he,z,ue,C,y,S,Ne,H]);const Fe=s.useMemo(()=>{if(!W||U||!ue||!he)return null;const A=Q.current;return A?Bc(A.bounds,he,ue,A.focalX,A.focalY,A.scale):null},[W,U,ue,he,G,$e]),et=(Fe==null?void 0:Fe.focalX)??(Ne==null?void 0:Ne.focalX)??C,Je=(Fe==null?void 0:Fe.focalY)??(Ne==null?void 0:Ne.focalY)??y,dt=(Fe==null?void 0:Fe.scale)??(Ne==null?void 0:Ne.scale)??S,tt=s.useMemo(()=>v&&g.width>0&&g.height>0?Pw($e,g):"",[v,$e,g.width,g.height]),De=he,Ie=`${$}-clip`,We=s.useMemo(()=>{if(!De)return null;const A=ue??{width:De.width,height:De.height},ee=Si(De,A,dt);return{x:Ln(De.width,ee.width,et),y:Ln(De.height,ee.height,Je),width:ee.width,height:ee.height}},[De,ue,et,Je,dt]);return a.jsxs("div",{className:`${e}-column`,ref:k,children:[v&&tt&&De&&We?a.jsxs("svg",{className:`${e}-shape-image`,viewBox:`0 0 ${g.width} ${g.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Ie,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:tt,fillRule:"evenodd"})})}),a.jsx("image",{href:v,x:De.x+We.x,y:De.y+We.y,width:We.width,height:We.height,preserveAspectRatio:"none",clipPath:`url(#${Ie})`})]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:J},children:[a.jsx("div",{className:`${e}-measure`,ref:_,style:f,"aria-hidden":!0}),de.segments.map((A,ee)=>{const Te=pe.slice(A.from,A.to),He=ee===0;return a.jsx("div",{className:`${e}-line${A.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${A.top}px`,left:`${A.left}px`,width:`${A.width}px`,textAlign:A.justify?void 0:Pe},children:Te.map((Be,Ve)=>{const Ze=se&&He&&A.from===0&&Ve===0?Be.text.slice(1):Be.text,_e=Hc(Be.leaf),qe=Be.href?a.jsx("a",{className:`${e}-link`,href:Be.href,target:Be.target,style:_e,children:Ze}):a.jsx("span",{style:_e,children:Ze});return a.jsxs("span",{children:[!A.justify&&Ve>0?" ":null,qe]},Ve)})},`${A.from}-${A.to}-${ee}`)}),h&&!ve&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:Ce.map((A,ee)=>a.jsx("polygon",{points:A.map(Te=>`${Te.x},${Te.y}`).join(" ")},ee))})]}),se&&P&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${de.capTop}px`,left:`${de.capLeft}px`,fontSize:`${be*m}px`,lineHeight:`${be*m}px`},children:se}),Y&&re&&(ve&&I||z)&&zn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:re.top,left:re.left,width:re.width,height:re.height,zIndex:Lw,pointerEvents:"none"},children:[ve&&I&&a.jsx(bS,{P:e,box:{width:re.width,height:re.height},viewBox:r,contours:ve,snap:I.snap,stretchToBox:!M,stage:B,onStageChange:K,onSelectionChange:Ee,onChange:I.onChange,onCommit:I.onCommit}),z&&De&&a.jsx(wS,{P:e,box:{width:re.width,height:re.height},bounds:De,natural:ue,imageUrl:v,maskPath:tt,stage:B,onStageChange:K,focalX:et,focalY:Je,scale:dt,onChange:z.onChange,onCommit:z.onCommit})]}),Y),a.jsx("div",{className:`${e}-a11y`,children:j.map((A,ee)=>a.jsx("p",{children:A},ee))})]})}function RS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=O.useScopedStyles(),c=s.useMemo(()=>mS(d),[d]),u=n??!1,p=!!r||!!o,x=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),w=(e==null?void 0:e.shape)??"rectangle",m=(e==null?void 0:e.customPath)??"",h=(e==null?void 0:e.pathFit)??"stretch",f=s.useMemo(()=>Mw(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),v=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",C=(e==null?void 0:e.textAlign)??"left",y=((e==null?void 0:e.overflowMode)??"clip")==="visible",S=((e==null?void 0:e.fitText)??"off")==="on",G=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,W=(e==null?void 0:e.dropCapSize)??Rw,U=u&&p&&!i,[H,I]=s.useState(!1);s.useEffect(()=>{if(!u||!p){I(!1);return}const J=()=>I(!0),de=()=>I(!1),be=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],Pe=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const Se of be)window.addEventListener(Se,J);for(const Se of Pe)window.addEventListener(Se,de);return()=>{for(const Se of be)window.removeEventListener(Se,J);for(const Se of Pe)window.removeEventListener(Se,de)}},[u,p]);const z=u&&p&&!i&&typeof l=="function",$=!H,T=Math.max(0,(e==null?void 0:e.pathSnap)??0),k=s.useRef(e??{}),_=s.useRef(""),g=[e==null?void 0:e.customPath,e==null?void 0:e.shape,e==null?void 0:e.pathFit,e==null?void 0:e.pathViewBox,e==null?void 0:e.imageScale,e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.image].join("\0");if(g!==_.current)_.current=g,k.current=e??{};else if(e){const{customPath:J,shape:de,pathFit:be,pathViewBox:Pe,imageScale:Se,imageFocalX:X,imageFocalY:me,image:re,...Y}=e,ce=k.current;for(const Ee of Object.keys(Y))if(ce[Ee]!==Y[Ee]){k.current={...ce,...Y};break}}const[D,P]=s.useState(null),[q,ie]=s.useState(!1),[L,B]=s.useState(!1),K=s.useCallback(()=>B(!1),[]),ue=s.useMemo(()=>!D||D.serialized===m?m:D.serialized,[D,m]);s.useEffect(()=>{z||(ie(!1),B(!1))},[z]),s.useEffect(()=>{!D||q||D.serialized===m&&P(null)},[D,m,q]);const le=s.useMemo(()=>{if(!z)return null;if(D&&(D.base===m||D.serialized===m))return D.contours;const J=Vo(m);return J.length?J:null},[z,D,m]),F=h==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===Xr&&!!(le&&!vu(le,f)),pe=s.useCallback((J,de,be)=>{const Pe=Go(J);if(P(Se=>({base:Se&&(Se.base===m||Se.serialized===m)?Se.base:m,serialized:Pe,contours:J})),de){const Se=k.current,X=be!=null&&be.preserveShape?Se.shape:"custom",me={...Se,shape:X,customPath:Pe};k.current=me,l==null||l(me)}},[m,l]),j=s.useMemo(()=>z?{contours:F?le:null,snap:T,needsConversion:!F,onConvert:J=>{const de=Go(J);P({base:de,serialized:de,contours:J});const be={...k.current,pathFit:"viewbox",pathViewBox:Xr,customPath:de};k.current=be,l==null||l(be)},onChange:(J,de)=>{ie(!0),B(!!(de!=null&&de.carryImage)),pe(J,!1)},onCommit:(J,de)=>{pe(J,!0,de),ie(!1)}}:null,[z,F,le,T,l,pe]),se=v==="avoid"&&!!(e!=null&&e.image),ne=s.useMemo(()=>({focalX:(e==null?void 0:e.imageFocalX)??.5,focalY:(e==null?void 0:e.imageFocalY)??.5,scale:(e==null?void 0:e.imageScale)??1}),[e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.imageScale]),[ve,ke]=s.useState(null),xe=ve??ne,b=s.useCallback(J=>ke(J),[]),M=s.useCallback(J=>{ke(J);const de={...k.current,imageFocalX:J.focalX,imageFocalY:J.focalY,imageScale:J.scale};k.current=de,l==null||l(de)},[l]);s.useEffect(()=>{ve&&Math.abs(ve.focalX-ne.focalX)<1e-9&&Math.abs(ve.focalY-ne.focalY)<1e-9&&Math.abs(ve.scale-ne.scale)<1e-9&&ke(null)},[ve,ne]);const E=s.useMemo(()=>!z||!se?null:{onChange:b,onCommit:M},[z,se,b,M]),[V,Ce]=s.useState(void 0),te=s.useRef(void 0),$e=s.useCallback(J=>{const de=te.current;de!==void 0&&Math.abs(de-J)<.005||(te.current=J,Ce(J))},[]),ae=s.useMemo(()=>S&&typeof V=="number"?V:1,[V,S]),ge=J=>`calc(${J} * var(--${d}-fit, 1))`,ye=s.useMemo(()=>{var be,Pe,Se,X,me;const J=(e==null?void 0:e.textFontSize)??.012,de=Math.max((e==null?void 0:e.textLineHeight)??J,J);return{fontFamily:po(e==null?void 0:e.textFontFamily),fontWeight:(be=e==null?void 0:e.textFontSettings)==null?void 0:be.fontWeight,fontStyle:(Pe=e==null?void 0:e.textFontSettings)==null?void 0:Pe.fontStyle,fontSize:ge(O.scalingValue(J,u)),lineHeight:ge(O.scalingValue(de,u)),letterSpacing:ge(O.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:ge(O.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(Se=e==null?void 0:e.textTextAppearance)==null?void 0:Se.textTransform,textDecoration:(X=e==null?void 0:e.textTextAppearance)==null?void 0:X.textDecoration,fontVariant:(me=e==null?void 0:e.textTextAppearance)==null?void 0:me.fontVariant}},[e,u,d]),Z={[`--${d}-text-color`]:(e==null?void 0:e.textColor)??"#000000",[`--${d}-link-color`]:(e==null?void 0:e.linkColor)??(e==null?void 0:e.textColor)??"#000000",[`--${d}-background-color`]:(e==null?void 0:e.backgroundColor)??"transparent"};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{className:`${d}-wrapper`,style:{...Z},children:a.jsx(IS,{P:d,item:x,shape:w,customPath:m,pathFit:h,viewBox:f,mode:v,align:C,allowOverflow:y,fitEnabled:S,scale:ae,onFitScale:$e,dropCapLines:G,dropCapSize:W,showGuides:(U||z)&&$,typography:ye,imageUrl:v==="avoid"?e==null?void 0:e.image:null,imageFocalX:xe.focalX,imageFocalY:xe.focalY,imageScale:xe.scale,imageCustomPath:ue,pathDragActive:q,pathCarryImage:L,onCarryImageConsumed:K,pathEditor:$?j:null,imageEditor:$?E:null})})]})}const LS=`import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
23833
23833
  import type React from 'react';
23834
23834
  import { createPortal } from 'react-dom';
23835
23835
  import { CommonComponentProps } from '../props';
@@ -27714,6 +27714,9 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
27714
27714
  const pathSnap = Math.max(0, settings?.pathSnap ?? 0);
27715
27715
  const settingsRef = useRef(settings ?? {});
27716
27716
  const settingsPropsKeyRef = useRef('');
27717
+ // Path/image fields are gated so in-flight local writes aren't clobbered by
27718
+ // lagging props. Everything else (e.g. shapeMode from the panel) must still
27719
+ // refresh — otherwise the next path commit spreads a stale value back.
27717
27720
  const settingsPropsKey = [
27718
27721
  settings?.customPath,
27719
27722
  settings?.shape,
@@ -27727,6 +27730,25 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
27727
27730
  if (settingsPropsKey !== settingsPropsKeyRef.current) {
27728
27731
  settingsPropsKeyRef.current = settingsPropsKey;
27729
27732
  settingsRef.current = settings ?? {};
27733
+ } else if (settings) {
27734
+ // Same fields as settingsPropsKey — keep local path/image writes; refresh the rest.
27735
+ const {
27736
+ customPath: _customPath,
27737
+ shape: _shape,
27738
+ pathFit: _pathFit,
27739
+ pathViewBox: _pathViewBox,
27740
+ imageScale: _imageScale,
27741
+ imageFocalX: _imageFocalX,
27742
+ imageFocalY: _imageFocalY,
27743
+ image: _image,
27744
+ ...ungated
27745
+ } = settings;
27746
+ const prev = settingsRef.current;
27747
+ for (const key of Object.keys(ungated) as Array<keyof typeof ungated>) {
27748
+ if (prev[key] === ungated[key]) continue;
27749
+ settingsRef.current = { ...prev, ...ungated };
27750
+ break;
27751
+ }
27730
27752
  }
27731
27753
  const [draft, setDraft] = useState<{ base: string; serialized: string; contours: VecContour[] } | null>(null);
27732
27754
  const [pathDragActive, setPathDragActive] = useState(false);
@@ -27748,6 +27770,13 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
27748
27770
  }
27749
27771
  }, [pathEditing]);
27750
27772
 
27773
+ // Drop the draft once props catch up. Leaving it around with
27774
+ // \`base === customPath\` after undo would keep showing the edited path.
27775
+ useEffect(() => {
27776
+ if (!draft || pathDragActive) return;
27777
+ if (draft.serialized === customPath) setDraft(null);
27778
+ }, [draft, customPath, pathDragActive]);
27779
+
27751
27780
  const editContours = useMemo(() => {
27752
27781
  if (!pathEditing) return null;
27753
27782
  if (draft && (draft.base === customPath || draft.serialized === customPath)) return draft.contours;
@@ -27769,7 +27798,6 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
27769
27798
  contours: next,
27770
27799
  }));
27771
27800
  if (commit) {
27772
-
27773
27801
  const latest = settingsRef.current;
27774
27802
  const nextShape = options?.preserveShape ? latest.shape : 'custom';
27775
27803
  const nextSettings = { ...latest, shape: nextShape, customPath: serialized };