@cntrl-site/components 1.0.66-alpha.1 → 1.0.66-alpha.2

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 +57 -40
  2. package/dist/index.mjs +2761 -2738
  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 $u(e){return e.type==="object"&&e.version===1}const Tu="ControlSlider-module__wrapper___sHEkd",Iu="ControlSlider-module__hoverArrow___A-dOH",Ru="ControlSlider-module__sliderItem___QQSkR",Lu="ControlSlider-module__sliderImage___9hRl-",Pu="ControlSlider-module__arrow___05ghY",Eu="ControlSlider-module__arrowVertical___tBfVN",Mu="ControlSlider-module__nextArrow___-30Yc",ku="ControlSlider-module__arrowInner___aEra3",Au="ControlSlider-module__arrowIcon___S4ztF",Fu="ControlSlider-module__arrowImg___2dwJW",_u="ControlSlider-module__mirror___brd6U",Nu="ControlSlider-module__pagination___bicLF",Wu="ControlSlider-module__paginationInner___bT-P-",Hu="ControlSlider-module__paginationVertical___zYqKw",Du="ControlSlider-module__paginationItem___nTRbk",Ou="ControlSlider-module__dot___p1Qun",Bu="ControlSlider-module__activeDot___LHFaj",zu="ControlSlider-module__paginationInsideBottom___R3FWn",ju="ControlSlider-module__paginationInsideTop___V-qb-",Vu="ControlSlider-module__paginationOutsideBottom___14w8D",Gu="ControlSlider-module__paginationOutsideTop___SCLqB",Xu="ControlSlider-module__paginationInsideLeft___yOBRZ",Yu="ControlSlider-module__paginationInsideRight___Rtt3o",qu="ControlSlider-module__paginationOutsideLeft___lahaw",Uu="ControlSlider-module__paginationOutsideRight___EtuQa",Ku="ControlSlider-module__imgWrapper___UjEgB",Zu="ControlSlider-module__captionBlock___dJ6-j",Ju="ControlSlider-module__captionTextWrapper___HFlpf",Qu="ControlSlider-module__captionText___uGBVc",ep="ControlSlider-module__active___WZK4G",tp="ControlSlider-module__withPointerEvents___t-18M",np="ControlSlider-module__topLeftAlignment___zjnGM",ip="ControlSlider-module__topCenterAlignment___gD1xW",op="ControlSlider-module__topRightAlignment___NMapS",rp="ControlSlider-module__middleLeftAlignment___OnUrY",ap="ControlSlider-module__middleCenterAlignment___Tdkl0",sp="ControlSlider-module__middleRightAlignment___wEbfX",lp="ControlSlider-module__bottomLeftAlignment___cTP2-",cp="ControlSlider-module__bottomCenterAlignment___c54fB",dp="ControlSlider-module__bottomRightAlignment___kEwrz",up="ControlSlider-module__clickOverlay___DZA28",pp="ControlSlider-module__contain___pLyq7",mp="ControlSlider-module__cover___KdDat",ut={wrapper:Tu,hoverArrow:Iu,sliderItem:Ru,sliderImage:Lu,arrow:Pu,arrowVertical:Eu,nextArrow:Mu,arrowInner:ku,arrowIcon:Au,arrowImg:Fu,mirror:_u,pagination:Nu,paginationInner:Wu,paginationVertical:Hu,paginationItem:Du,dot:Ou,activeDot:Bu,paginationInsideBottom:zu,paginationInsideTop:ju,paginationOutsideBottom:Vu,paginationOutsideTop:Gu,paginationInsideLeft:Xu,paginationInsideRight:Yu,paginationOutsideLeft:qu,paginationOutsideRight:Uu,imgWrapper:Ku,captionBlock:Zu,captionTextWrapper:Ju,captionText:Qu,active:ep,withPointerEvents:tp,topLeftAlignment:np,topCenterAlignment:ip,topRightAlignment:op,middleLeftAlignment:rp,middleCenterAlignment:ap,middleRightAlignment:sp,bottomLeftAlignment:lp,bottomCenterAlignment:cp,bottomRightAlignment:dp,clickOverlay:up,contain:pp,cover:mp};function gp(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 hp(e,t,n){return t&&gp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ol="(prefers-reduced-motion: reduce)",Bi=1,fp=2,Ui=3,lo=4,Xo=5,Ir=6,_r=7,yp={CREATED:Bi,MOUNTED:fp,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 qt(e){return e.bind.apply(e,[null].concat(ai(arguments,1)))}var zc=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,jc=qt(Kr,"function"),ni=qt(Kr,"string"),Yo=qt(Kr,"undefined");function Cs(e){return e===null}function Vc(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 Vc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Gc(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?Gc(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 Xc(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 Yc(e){return Ko(new DOMParser().parseFromString(e,"text/html").body)}function Fn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function qc(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 Uc(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 xp(e){return""+e+Ls(ll[e]=(ll[e]||0)+1)}function Kc(){var e=[];function t(l,d,c,u){o(l,d,function(p,x,b){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,b,c,h])})}function n(l,d,c){o(l,d,function(u,p,x){e=e.filter(function(b){return b[0]===u&&b[1]===p&&b[2]===x&&(!c||b[3]===c)?(b[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 b=x.split(".");c(u,b[0],b[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",Zc="active",Jc="inactive",Qc="visible",ed="hidden",en="refresh",ln="updated",Ki="resize",Zr="resized",td="drag",nd="dragging",id="dragged",Jr="scroll",Li="scrolled",vp="overflow",Es="destroy",od="arrows:mounted",rd="arrows:updated",ad="pagination:mounted",sd="pagination:updated",Ms="navigation:mounted",ks="autoplay:play",ld="autoplay:playing",As="autoplay:pause",Fs="lazyload:loaded",cd="sk",dd="sh",Hr="ei";function Zt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Kc();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:qt(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 b();d=rl(p)}}function x(C){C||h(),r=o()-(C?l*e:0),c=!1,d=rl(p)}function b(){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:b,cancel:h,set:f,isPaused:v}}function bp(e){var t=e;function n(o){t=o}function i(o){return $s(qo(o),t)}return{set:n,is:i}}function wp(e,t){var n=Qr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Sp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Kc(),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 b(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:b,set:m}}var ea="Arrow",ta=ea+"Left",na=ea+"Right",ud=ea+"Up",pd=ea+"Down",cl="rtl",ia="ttb",fa={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[ud,na],ArrowRight:[pd,ta]};function Cp(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",$p="disabled",Cn="aria-",Jo=Cn+"controls",md=Cn+"current",dl=Cn+"selected",yn=Cn+"label",_s=Cn+"labelledby",gd=Cn+"hidden",Ns=Cn+"orientation",Wo=Cn+"roledescription",ul=Cn+"live",pl=Cn+"busy",ml=Cn+"atomic",Ws=[Wn,Xi,$p,Jo,md,yn,_s,gd,Ns,Wo],kn=Zo+"__",li="is-",ya=Zo,gl=kn+"track",Tp=kn+"list",oa=kn+"slide",hd=oa+"--clone",Ip=oa+"__container",Hs=kn+"arrows",ra=kn+"arrow",fd=ra+"--prev",yd=ra+"--next",aa=kn+"pagination",xd=aa+"__page",Rp=kn+"progress",Lp=Rp+"__bar",Pp=kn+"toggle",Ep=kn+"spinner",Mp=kn+"sr",kp=li+"initialized",Ii=li+"active",vd=li+"prev",bd=li+"next",ts=li+"visible",ns=li+"loading",wd=li+"focus-in",Sd=li+"overflow",Ap=[Ii,ts,vd,bd,ns,wd,Sd],Fp={slide:oa,clone:hd,arrows:Hs,arrow:ra,prev:fd,next:yd,pagination:aa,page:xd,spinner:Ep};function _p(e,t){if(jc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ko(n,t);)n=n.parentElement;return n}var Np=5,hl=200,Cd="touchstart mousedown",xa="touchmove mousemove",va="touchend touchcancel mouseup click";function Wp(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],x=[],b,m,h;function f(){S(),V(),y()}function v(){o(en,C),o(en,f),o(ln,y),r(document,Cd+" keydown",function(W){h=W.type==="keydown"},{capture:!0}),r(l,"focusin",function(){_n(l,wd,!!h)})}function C(W){var I=Ws.concat("style");On(u),Nn(l,p),Nn(b,x),Mn([b,m],I),Mn(l,W?I:["style",Wo])}function y(){Nn(l,p),Nn(b,x),p=q(ya),x=q(gl),En(l,p),En(b,x),$t(l,yn,n.label),$t(l,_s,n.labelledby)}function S(){b=N("."+gl),m=Ko(b,"."+Tp),Ro(b&&m,"A track/list element is missing."),Rr(u,Gc(m,"."+oa+":not(."+hd+")")),Ci({arrows:Hs,pagination:aa,prev:fd,next:yd,bar:Lp,toggle:Pp},function(W,I){c[I]=N("."+W)}),Fo(c,{root:l,track:b,list:m,slides:u})}function V(){var W=l.id||xp(Zo),I=n.role;l.id=W,b.id=b.id||W+"-track",m.id=m.id||W+"-list",!Sn(l,Wn)&&l.tagName!=="SECTION"&&I&&$t(l,Wn,I),$t(l,Wo,d.carousel),$t(m,Wn,"presentation")}function N(W){var I=qc(l,W);return I&&_p(I,"."+ya)===l?I:void 0}function q(W){return[W+"--"+n.type,W+"--"+n.direction,n.drag&&W+"--draggable",n.isNavigation&&W+"--nav",W===ya&&Ii]}return Fo(c,{setup:f,mount:v,destroy:C})}var Zi="slide",uo="loop",Qo="fade";function Hp(e,t,n,i){var o=Zt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,x=p.isNavigation,b=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,V=Ko(i,"."+Ip),N;function q(){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]))),W()}function W(){d(i,"click",qt(l,Ps,ne)),d(i,"keydown",qt(l,cd,ne)),r([co,dd,Li],T),r(Ms,B),b&&r(Bn,$)}function I(){N=!0,o.destroy(),Nn(i,Ap),Mn(i,Ws),$t(i,"style",C),$t(i,yn,y||"")}function B(){var L=e.splides.map(function(H){var U=H.splide.Components.Slides.getAt(t);return U?U.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 $(){N||T()}function T(){if(!N){var L=e.index;k(),A(),_n(i,vd,t===L-1),_n(i,bd,t===L+1)}}function k(){var L=O();L!==sl(i,Ii)&&(_n(i,Ii,L),$t(i,md,x&&L||""),l(L?Zc:Jc,ne))}function A(){var L=P(),H=!L&&(!O()||S);if(e.state.is([lo,Xo])||$t(i,gd,H||""),$t(Is(i,p.focusableNodes||""),Xi,H?-1:""),f&&$t(i,Xi,H?-1:0),L!==sl(i,ts)&&(_n(i,ts,L),l(L?Qc:ed,ne)),!L&&document.activeElement===i){var U=c.Slides.getAt(e.index);U&&Xc(U.slide)}}function g(L,H,U){wn(U&&V||i,L,H)}function O(){var L=e.index;return L===t||p.cloneStatus&&L===n}function P(){if(e.is(Qo))return O();var L=hn(c.Elements.track),H=hn(i),U=v("left",!0),de=v("right",!0);return Wr(L[U])<=No(H[U])&&Wr(H[de])<=No(L[de])}function X(L,H){var U=dn(L-t);return!S&&(p.rewind||e.is(uo))&&(U=ii(U,e.length-U)),U<=H}var ne={index:t,slideIndex:n,slide:i,container:V,isClone:S,mount:q,destroy:I,update:T,style:g,isWithin:X};return ne}function Dp(e,t,n){var i=Zt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function x(){b(),o(en,m),o(en,b)}function b(){c.forEach(function(T,k){f(T,k,-1)})}function m(){N(function(T){T.destroy()}),On(p)}function h(){N(function(T){T.update()})}function f(T,k,A){var g=Hp(e,k,A,T);g.mount(),p.push(g),p.sort(function(O,P){return O.index-P.index})}function v(T){return T?q(function(k){return!k.isClone}):p}function C(T){var k=t.Controller,A=k.toIndex(T),g=k.hasFocus()?1:n.perPage;return q(function(O){return Lr(O.index,A,A+g-1)})}function y(T){return q(T)[0]}function S(T,k){vn(T,function(A){if(ni(A)&&(A=Yc(A)),Vc(A)){var g=c[k];g?Ts(A,g):Uo(u,A),En(A,n.classes.slide),I(A,qt(r,Ki))}}),r(en)}function V(T){Ti(q(T).map(function(k){return k.slide})),r(en)}function N(T,k){v(k).forEach(T)}function q(T){return p.filter(jc(T)?T:function(k){return ni(T)?ko(k.slide,T):$s(qo(T),k.index)})}function W(T,k,A){N(function(g){g.style(T,k,A)})}function I(T,k){var A=Is(T,"img"),g=A.length;g?A.forEach(function(O){l(O,"load error",function(){--g||k()})}):k()}function B(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:V,forEach:N,filter:q,style:W,getLength:B,isEnough:$}}function Op(e,t,n){var i=Zt(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,b=u.list,m=d.getAt,h=d.style,f,v,C;function y(){S(),r(window,"resize load",wp(qt(l,Ki))),o([ln,en],S),o(Ki,V)}function S(){f=n.direction===ia,wn(p,"maxWidth",pi(n.width)),wn(x,c("paddingLeft"),N(!1)),wn(x,c("paddingRight"),N(!0)),V(!0)}function V(ne){var L=hn(p);(ne||v.width!==L.width||v.height!==L.height)&&(wn(x,"height",q()),h(c("marginRight"),pi(n.gap)),h("width",I()),h("height",B(),!0),v=L,l(Zr),C!==(C=X())&&(_n(p,Sd,C),l(vp,C)))}function N(ne){var L=n.padding,H=c(ne?"right":"left");return L&&pi(L[H]||(Mo(L)?0:L))||"0px"}function q(){var ne="";return f&&(ne=W(),Ro(ne,"height or heightRatio is missing."),ne="calc("+ne+" - "+N(!1)+" - "+N(!0)+")"),ne}function W(){return pi(n.height||hn(b).width*n.heightRatio)}function I(){return n.autoWidth?null:pi(n.fixedWidth)||(f?"":$())}function B(){return pi(n.fixedHeight)||(f?n.autoHeight?null:$():W())}function $(){var ne=pi(n.gap);return"calc((100%"+(ne&&" + "+ne)+")/"+(n.perPage||1)+(ne&&" - "+ne)+")"}function T(){return hn(b)[c("width")]}function k(ne,L){var H=m(ne||0);return H?hn(H.slide)[c("width")]+(L?0:O()):0}function A(ne,L){var H=m(ne);if(H){var U=hn(H.slide)[c("right")],de=hn(b)[c("left")];return dn(U-de)+(L?0:O())}return 0}function g(ne){return A(e.length-1)-A(0)+k(0,ne)}function O(){var ne=m(0);return ne&&parseFloat(wn(ne.slide,c("marginRight")))||0}function P(ne){return parseFloat(wn(x,c("padding"+(ne?"Right":"Left"))))||0}function X(){return e.is(Qo)||g(!0)>T()}return{mount:y,resize:V,listSize:T,slideSize:k,sliderSize:g,totalSize:A,getPadding:P,isOverflow:X}}var Bp=2;function zp(e,t,n){var i=Zt(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(){b(),p()}function b(){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(V,N){var q=N<C,W=f(V.slide,N);q?Ts(W,y[0].slide):Uo(r.list,W),Rr(c,W),l.register(W,N-C+(q?0:S),V.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*Bp}return C}return{mount:p,destroy:b}}function jp(e,t,n){var i=Zt(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,b=d.sliderSize,m=t.Direction,h=m.resolve,f=m.orient,v=t.Elements,C=v.list,y=v.track,S;function V(){S=t.Transition,o([si,Zr,ln,en],N)}function N(){t.Controller.isBusy()||(t.Scroll.cancel(),W(e.index),t.Slides.update())}function q(H,U,de,ae){H!==U&&ne(H>de)&&(T(),I($(g(),H>de),!0)),l(lo),r(Bn,U,de,H),S.start(U,function(){l(Ui),r(co,U,de,H),ae&&ae()})}function W(H){I(A(H,!0))}function I(H,U){if(!e.is(Qo)){var de=U?H:B(H);wn(C,"transform","translate"+h("X")+"("+de+"px)"),H!==de&&r(dd)}}function B(H){if(e.is(uo)){var U=k(H),de=U>t.Controller.getEnd(),ae=U<0;(ae||de)&&(H=$(H,de))}return H}function $(H,U){var de=H-X(U),ae=b();return H-=f(ae*(No(dn(de)/ae)||1))*(U?1:-1),H}function T(){I(g(),!0),S.cancel()}function k(H){for(var U=t.Slides.get(),de=0,ae=1/0,F=0;F<U.length;F++){var ce=U[F].index,z=dn(A(ce,!0)-H);if(z<=ae)ae=z,de=ce;else break}return de}function A(H,U){var de=f(p(H-1)-P(H));return U?O(de):de}function g(){var H=h("left");return hn(C)[H]-hn(y)[H]+f(u(!1))}function O(H){return n.trimSpace&&e.is(Zi)&&(H=Wi(H,0,f(b(!0)-x()))),H}function P(H){var U=n.focus;return U==="center"?(x()-c(H,!0))/2:+U*c(H)||0}function X(H){return A(H?t.Controller.getEnd():0,!!n.trimSpace)}function ne(H){var U=f($(g(),H));return H?U>=0:U<=C[h("scrollWidth")]-hn(y)[h("width")]}function L(H,U){U=Yo(U)?g():U;var de=H!==!0&&f(U)<f(X(!1)),ae=H!==!1&&f(U)>f(X(!0));return de||ae}return{mount:V,move:q,jump:W,translate:I,shift:$,cancel:T,toIndex:k,toPosition:A,getPosition:g,getLimit:X,exceededLimit:L,reposition:N}}function Vp(e,t,n){var i=Zt(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,b=p.getLength,m=n.omitEnd,h=e.is(uo),f=e.is(Zi),v=qt(g,!1),C=qt(g,!0),y=n.start||0,S,V=y,N,q,W;function I(){B(),o([ln,en,Hr],B),o(Zr,$)}function B(){N=b(!0),q=n.perMove,W=n.perPage,S=ne();var z=Wi(y,0,m?S:N-1);z!==y&&(y=z,l.reposition())}function $(){S!==ne()&&r(Hr)}function T(z,re,te){if(!ce()){var ye=A(z),Fe=X(ye);Fe>-1&&(re||Fe!==y)&&(de(Fe),l.move(ye,Fe,V,te))}}function k(z,re,te,ye){t.Scroll.scroll(z,re,te,function(){var Fe=X(l.toIndex(d()));de(m?ii(Fe,S):Fe),ye&&ye()})}function A(z){var re=y;if(ni(z)){var te=z.match(/([+\-<>])(\d+)?/)||[],ye=te[1],Fe=te[2];ye==="+"||ye==="-"?re=O(y+ +(""+ye+(+Fe||1)),y):ye===">"?re=Fe?L(+Fe):v(!0):ye==="<"&&(re=C(!0))}else re=h?z:Wi(z,0,S);return re}function g(z,re){var te=q||(F()?1:W),ye=O(y+te*(z?-1:1),y,!(q||F()));return ye===-1&&f&&!Uc(d(),c(!z),1)?z?0:S:re?ye:X(ye)}function O(z,re,te){if(x()||F()){var ye=P(z);ye!==z&&(re=z,z=ye,te=!1),z<0||z>S?!q&&(Lr(0,z,re,!0)||Lr(S,re,z,!0))?z=L(H(z)):h?z=te?z<0?-(N%W||W):N:z:n.rewind?z=z<0?S:0:z=-1:te&&z!==re&&(z=L(H(re)+(z<re?-1:1)))}else z=-1;return z}function P(z){if(f&&n.trimSpace==="move"&&z!==y)for(var re=d();re===u(z,!0)&&Lr(z,0,e.length-1,!n.rewind);)z<y?--z:++z;return z}function X(z){return h?(z+N)%N||0:z}function ne(){for(var z=N-(F()||h&&q?1:W);m&&z-- >0;)if(u(N-1,!0)!==u(z,!0)){z++;break}return Wi(z,0,N-1)}function L(z){return Wi(F()?z:W*z,0,S)}function H(z){return F()?ii(z,S):Wr((z>=S?N-1:z)/W)}function U(z){var re=l.toIndex(z);return f?Wi(re,0,S):re}function de(z){z!==y&&(V=y,y=z)}function ae(z){return z?V:y}function F(){return!Yo(n.focus)||n.isNavigation}function ce(){return e.state.is([lo,Xo])&&!!n.waitForTransition}return{mount:I,go:T,scroll:k,getNext:v,getPrev:C,getAdjacent:g,getEnd:ne,setIndex:de,getIndex:ae,toIndex:L,toPage:H,toDest:U,hasFocus:F,isBusy:ce}}var Gp="http://www.w3.org/2000/svg",Xp="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 Yp(e,t,n){var i=Zt(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,b=u.track,m=x,h=u.prev,f=u.next,v,C,y={};function S(){N(),o(ln,V)}function V(){q(),S()}function N(){var k=n.arrows;k&&!(h&&f)&&B(),h&&f&&(Fo(y,{prev:h,next:f}),_o(m,k?"":"none"),En(m,C=Hs+"--"+n.direction),k&&(W(),T(),$t([h,f],Jo,b.id),l(od,h,f)))}function q(){i.destroy(),Nn(m,C),v?(Ti(x?[h,f]:m),h=f=null):Mn([h,f],Ws)}function W(){o([si,co,en,Li,Hr],T),r(f,"click",qt(I,">")),r(h,"click",qt(I,"<"))}function I(k){p.go(k,!0)}function B(){m=x||Gi("div",d.arrows),h=$(!0),f=$(!1),v=!0,Uo(m,[h,f]),!x&&Ts(m,b)}function $(k){var A='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+Gp+'" viewBox="0 0 '+sr+" "+sr+'" width="'+sr+'" height="'+sr+'" focusable="false"><path d="'+(n.arrowPath||Xp)+'" />';return Yc(A)}function T(){if(h&&f){var k=e.index,A=p.getPrev(),g=p.getNext(),O=A>-1&&k<A?c.last:c.prev,P=g>-1&&k>g?c.first:c.next;h.disabled=A<0,f.disabled=g<0,$t(h,yn,O),$t(f,yn,P),l(rd,h,f,A,g)}}return{arrows:y,mount:S,destroy:q,update:T}}var qp=Rs+"-interval";function Up(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.emit,d=Qr(n.interval,e.go.bind(e,">"),W),c=d.isPaused,u=t.Elements,p=t.Elements,x=p.root,b=p.toggle,m=n.autoplay,h,f,v=m==="pause";function C(){m&&(y(),b&&$t(b,Jo,u.track.id),v||S(),q())}function y(){n.pauseOnHover&&r(x,"mouseenter mouseleave",function(B){h=B.type==="mouseenter",N()}),n.pauseOnFocus&&r(x,"focusin focusout",function(B){f=B.type==="focusin",N()}),b&&r(b,"click",function(){v?S():V(!0)}),o([Bn,Jr,en],d.rewind),o(Bn,I)}function S(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=h=v=!1,q(),l(ks))}function V(B){B===void 0&&(B=!0),v=!!B,q(),c()||(d.pause(),l(As))}function N(){v||(h||f?V(!1):S())}function q(){b&&(_n(b,Ii,!v),$t(b,yn,n.i18n[v?"play":"pause"]))}function W(B){var $=u.bar;$&&wn($,"width",B*100+"%"),l(ld,B)}function I(B){var $=t.Slides.getAt(B);d.set($&&+Sn($.slide,qp)||n.interval)}return{mount:C,destroy:d.cancel,play:S,pause:V,isPaused:c}}function Kp(e,t,n){var i=Zt(e),o=i.on;function r(){n.cover&&(o(Fs,qt(d,!0)),o([si,ln,en],qt(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:qt(l,!1)}}var Zp=10,Jp=600,Qp=.6,em=1.5,tm=800;function nm(e,t,n){var i=Zt(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,b=e.is(Zi),m,h,f=1;function v(){o(Bn,V),o([ln,en],N)}function C(W,I,B,$,T){var k=c();if(V(),B&&(!b||!p())){var A=t.Layout.sliderSize(),g=Ja(W)*A*Wr(dn(W)/A)||0;W=d.toPosition(t.Controller.toDest(W%A))+g}var O=Uc(k,W,1);f=1,I=O?0:I||Nr(dn(W-k)/em,tm),h=$,m=Qr(I,y,qt(S,k,W,T),1),l(Xo),r(Jr),m.start()}function y(){l(Ui),h&&h(),r(Li)}function S(W,I,B,$){var T=c(),k=W+(I-W)*q($),A=(k-T)*f;x(T+A),b&&!B&&p()&&(f*=Qp,dn(A)<Zp&&C(u(p(!0)),Jp,!1,h,!0))}function V(){m&&m.cancel()}function N(){m&&!m.isPaused()&&(V(),y())}function q(W){var I=n.easingFunc;return I?I(W):1-Math.pow(1-W,4)}return{mount:v,destroy:V,scroll:C,cancel:N}}var Hi={passive:!1,capture:!0};function im(e,t,n){var i=Zt(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,b=t.Elements.track,m=t.Media.reduce,h=t.Direction,f=h.resolve,v=h.orient,C=u.getPosition,y=u.exceededLimit,S,V,N,q,W,I=!1,B,$,T;function k(){l(b,xa,Ka,Hi),l(b,va,Ka,Hi),l(b,Cd,g,Hi),l(b,"click",X,{capture:!0}),l(b,"dragstart",Fn),o([si,ln],A)}function A(){var M=n.drag;w(!M),q=M==="free"}function g(M){if(B=!1,!$){var E=Fe(M);ye(M.target)&&(E||!M.button)&&(x.isBusy()?Fn(M,!0):(T=E?b:window,W=c.is([lo,Xo]),N=null,l(T,xa,O,Hi),l(T,va,P,Hi),u.cancel(),p.cancel(),ne(M)))}}function O(M){if(c.is(Ir)||(c.set(Ir),r(td)),M.cancelable)if(W){u.translate(S+te(F(M)));var E=ce(M)>hl,j=I!==(I=y());(E||j)&&ne(M),B=!0,r(nd),Fn(M)}else U(M)&&(W=H(M),Fn(M))}function P(M){c.is(Ir)&&(c.set(Ui),r(id)),W&&(L(M),Fn(M)),d(T,xa,O),d(T,va,P),W=!1}function X(M){!$&&B&&Fn(M,!0)}function ne(M){N=V,V=M,S=C()}function L(M){var E=de(M),j=ae(E),Te=n.rewind&&n.rewindByDrag;m(!1),q?x.scroll(j,0,n.snap):e.is(Qo)?x.go(v(Ja(E))<0?Te?"<":"-":Te?">":"+"):e.is(Zi)&&I&&Te?x.go(y(!0)?">":"<"):x.go(x.toDest(j),!0),m(!0)}function H(M){var E=n.dragMinThreshold,j=Mo(E),Te=j&&E.mouse||0,ee=(j?E.touch:+E)||10;return dn(F(M))>(Fe(M)?ee:Te)}function U(M){return dn(F(M))>dn(F(M,!0))}function de(M){if(e.is(uo)||!I){var E=ce(M);if(E&&E<hl)return F(M)/E}return 0}function ae(M){return C()+Ja(M)*ii(dn(M)*(n.flickPower||600),q?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function F(M,E){return re(M,E)-re(z(M),E)}function ce(M){return Za(M)-Za(z(M))}function z(M){return V===M&&N||V}function re(M,E){return(Fe(M)?M.changedTouches[0]:M)["page"+f(E?"Y":"X")]}function te(M){return M/(I&&e.is(Zi)?Np:1)}function ye(M){var E=n.noDrag;return!ko(M,"."+xd+", ."+ra)&&(!E||!ko(M,E))}function Fe(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}function fe(){return W}function w(M){$=M}return{mount:k,disable:w,isDragging:fe}}var om={Spacebar:" ",Right:na,Left:ta,Up:ud,Down:pd};function Ds(e){return e=ni(e)?e:e.key,om[e]||e}var fl="keydown";function rm(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function x(){b(),o(ln,m),o(ln,b),o(Bn,f)}function b(){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,zc(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",am="["+Lo+"], ["+Pr+"]";function sm(e,t,n){var i=Zt(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&&(b(),o(en,b))}function b(){On(p),m(),c?C():(r(u),o(u,h),h())}function m(){t.Slides.forEach(function(y){Is(y.slide,am).forEach(function(S){var V=Sn(S,Lo),N=Sn(S,Pr);if(V!==S.src||N!==S.srcset){var q=n.classes.spinner,W=S.parentElement,I=Ko(W,"."+q)||Gi("span",q,W);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",qt(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 V=y[0],N=y[1];Nn(N.slide,ns),S.type!=="error"&&(Ti(y[2]),_o(V,""),d(Fs,V,N),d(Ki)),c&&C()}function C(){p.length&&f(p.shift())}return{mount:x,destroy:qt(On,p),check:h}}function lm(e,t,n){var i=Zt(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,b=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],B),V(),B(),r(ad,{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 V(){var $=e.length,T=n.classes,k=n.i18n,A=n.perPage,g=p()?u.getEnd()+1:No($/A);v=h||Gi("ul",T.pagination,c.track.parentElement),En(v,C=aa+"--"+W()),$t(v,Wn,"tablist"),$t(v,yn,k.select),$t(v,Ns,W()===ia?"vertical":"");for(var O=0;O<g;O++){var P=Gi("li",null,v),X=Gi("button",{class:T.page,type:"button"},P),ne=d.getIn(O).map(function(H){return H.slide.id}),L=!p()&&A>1?k.pageX:k.slideX;l(X,"click",qt(N,O)),n.paginationKeyboard&&l(X,"keydown",qt(q,O)),$t(P,Wn,"presentation"),$t(X,Wn,"tab"),$t(X,Jo,ne.join(" ")),$t(X,yn,Qa(L,O+1)),$t(X,Xi,-1),f.push({li:P,button:X,page:O})}}function N($){b(">"+$,!0)}function q($,T){var k=f.length,A=Ds(T),g=W(),O=-1;A===m(na,!1,g)?O=++$%k:A===m(ta,!1,g)?O=(--$+k)%k:A==="Home"?O=0:A==="End"&&(O=k-1);var P=f[O];P&&(Xc(P.button),b(">"+O),Fn(T,!0))}function W(){return n.paginationDirection||n.direction}function I($){return f[u.toPage($)]}function B(){var $=I(x(!0)),T=I(x());if($){var k=$.button;Nn(k,Ii),Mn(k,dl),$t(k,Xi,-1)}if(T){var A=T.button;En(A,Ii),$t(A,dl,!0),$t(A,Xi,"")}r(sd,{list:v,items:f},$,T)}return{items:f,mount:y,destroy:S,getAt:I,update:B}}var cm=[" ","Enter"];function dm(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=Zt(h);v.on(Bn,function(C,y,S){f.go(f.is(uo)?S:C)}),r.push(v)}function p(){var h=Zt(e),f=h.on;f(Ps,b),f(cd,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 b(h){e.go(h.index)}function m(h,f){$s(cm,Ds(f))&&(b(h),Fn(f))}return{setup:qt(t.Media.set,{slideFocus:Yo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function um(e,t,n){var i=Zt(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,b=Za(u),m=n.wheelMinThreshold||0,h=n.wheelSleep||0;dn(p)>m&&b-r>h&&(e.go(x?"<":">"),r=b),c(x)&&Fn(u)}}function c(u){return!n.releaseWheel||e.state.is(lo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var pm=90;function mm(e,t,n){var i=Zt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Gi("span",Mp),c=Qr(pm,qt(p,!1));function u(){l&&(b(!t.Autoplay.isPaused()),$t(r,ml,!0),d.textContent="…",o(ks,qt(b,!0)),o(As,qt(b,!1)),o([co,Li],qt(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 b(m){l&&$t(r,ul,m?"off":"polite")}return{mount:u,disable:b,destroy:x}}var gm=Object.freeze({__proto__:null,Media:Sp,Direction:Cp,Elements:Wp,Slides:Dp,Layout:Op,Clones:zp,Move:jp,Controller:Vp,Arrows:Yp,Autoplay:Up,Cover:Kp,Scroll:nm,Drag:im,Keyboard:rm,LazyLoad:sm,Pagination:lm,Sync:dm,Wheel:um,Live:mm}),hm={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"},fm={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:Fp,i18n:hm,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ym(e,t,n){var i=t.Slides;function o(){Zt(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),zc(c)}return{mount:o,start:l,cancel:Ka}}function xm(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=qt(wn,l,"transition"),c;function u(){Zt(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=b(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 b(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 vm=(function(){function e(n,i){this.event=Zt(),this.Components={},this.state=bp(Bi),this.splides=[],this._o={},this._E={};var o=ni(n)?qc(document,n):n;Ro(o,o+" is invalid."),this.root=o,i=qn({label:Sn(o,yn)||"",labelledby:Sn(o,_s)||""},fm,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)?ym:xm),this._E=i||this._E;var c=Fo({},gm,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,kp),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)?Zt(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},hp(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=vm;Os.defaults={};Os.STATES=yp;var yl=[[si,"onMounted"],[es,"onReady"],[Bn,"onMove"],[co,"onMoved"],[Ps,"onClick"],[Zc,"onActive"],[Jc,"onInactive"],[Qc,"onVisible"],[ed,"onHidden"],[en,"onRefresh"],[ln,"onUpdated"],[Ki,"onResize"],[Zr,"onResized"],[td,"onDrag"],[nd,"onDragging"],[id,"onDragged"],[Jr,"onScroll"],[Li,"onScrolled"],[Es,"onDestroy"],[od,"onArrowsMounted"],[rd,"onArrowsUpdated"],[ad,"onPaginationMounted"],[sd,"onPaginationUpdated"],[Ms,"onNavigationMounted"],[ks,"onAutoplayPlay"],[ld,"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 bm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function wm(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 wm(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 Sm=({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();bm(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(Sm,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"),D=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),zn=require("react-dom");function $u(e){return e.type==="object"&&e.version===1}const Tu="ControlSlider-module__wrapper___sHEkd",Iu="ControlSlider-module__hoverArrow___A-dOH",Ru="ControlSlider-module__sliderItem___QQSkR",Lu="ControlSlider-module__sliderImage___9hRl-",Pu="ControlSlider-module__arrow___05ghY",Eu="ControlSlider-module__arrowVertical___tBfVN",Mu="ControlSlider-module__nextArrow___-30Yc",ku="ControlSlider-module__arrowInner___aEra3",Au="ControlSlider-module__arrowIcon___S4ztF",Fu="ControlSlider-module__arrowImg___2dwJW",_u="ControlSlider-module__mirror___brd6U",Nu="ControlSlider-module__pagination___bicLF",Wu="ControlSlider-module__paginationInner___bT-P-",Hu="ControlSlider-module__paginationVertical___zYqKw",Du="ControlSlider-module__paginationItem___nTRbk",Ou="ControlSlider-module__dot___p1Qun",Bu="ControlSlider-module__activeDot___LHFaj",zu="ControlSlider-module__paginationInsideBottom___R3FWn",ju="ControlSlider-module__paginationInsideTop___V-qb-",Vu="ControlSlider-module__paginationOutsideBottom___14w8D",Gu="ControlSlider-module__paginationOutsideTop___SCLqB",Xu="ControlSlider-module__paginationInsideLeft___yOBRZ",Yu="ControlSlider-module__paginationInsideRight___Rtt3o",qu="ControlSlider-module__paginationOutsideLeft___lahaw",Uu="ControlSlider-module__paginationOutsideRight___EtuQa",Ku="ControlSlider-module__imgWrapper___UjEgB",Zu="ControlSlider-module__captionBlock___dJ6-j",Ju="ControlSlider-module__captionTextWrapper___HFlpf",Qu="ControlSlider-module__captionText___uGBVc",ep="ControlSlider-module__active___WZK4G",tp="ControlSlider-module__withPointerEvents___t-18M",np="ControlSlider-module__topLeftAlignment___zjnGM",ip="ControlSlider-module__topCenterAlignment___gD1xW",op="ControlSlider-module__topRightAlignment___NMapS",rp="ControlSlider-module__middleLeftAlignment___OnUrY",ap="ControlSlider-module__middleCenterAlignment___Tdkl0",sp="ControlSlider-module__middleRightAlignment___wEbfX",lp="ControlSlider-module__bottomLeftAlignment___cTP2-",cp="ControlSlider-module__bottomCenterAlignment___c54fB",dp="ControlSlider-module__bottomRightAlignment___kEwrz",up="ControlSlider-module__clickOverlay___DZA28",pp="ControlSlider-module__contain___pLyq7",mp="ControlSlider-module__cover___KdDat",ut={wrapper:Tu,hoverArrow:Iu,sliderItem:Ru,sliderImage:Lu,arrow:Pu,arrowVertical:Eu,nextArrow:Mu,arrowInner:ku,arrowIcon:Au,arrowImg:Fu,mirror:_u,pagination:Nu,paginationInner:Wu,paginationVertical:Hu,paginationItem:Du,dot:Ou,activeDot:Bu,paginationInsideBottom:zu,paginationInsideTop:ju,paginationOutsideBottom:Vu,paginationOutsideTop:Gu,paginationInsideLeft:Xu,paginationInsideRight:Yu,paginationOutsideLeft:qu,paginationOutsideRight:Uu,imgWrapper:Ku,captionBlock:Zu,captionTextWrapper:Ju,captionText:Qu,active:ep,withPointerEvents:tp,topLeftAlignment:np,topCenterAlignment:ip,topRightAlignment:op,middleLeftAlignment:rp,middleCenterAlignment:ap,middleRightAlignment:sp,bottomLeftAlignment:lp,bottomCenterAlignment:cp,bottomRightAlignment:dp,clickOverlay:up,contain:pp,cover:mp};function gp(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 hp(e,t,n){return t&&gp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ol="(prefers-reduced-motion: reduce)",Bi=1,fp=2,Ui=3,lo=4,Xo=5,Ir=6,_r=7,yp={CREATED:Bi,MOUNTED:fp,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 qt(e){return e.bind.apply(e,[null].concat(ai(arguments,1)))}var zc=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,jc=qt(Kr,"function"),ni=qt(Kr,"string"),Yo=qt(Kr,"undefined");function Cs(e){return e===null}function Vc(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 Vc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Gc(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?Gc(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 Xc(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 Yc(e){return Ko(new DOMParser().parseFromString(e,"text/html").body)}function Fn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function qc(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 Uc(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 xp(e){return""+e+Ls(ll[e]=(ll[e]||0)+1)}function Kc(){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",Zc="active",Jc="inactive",Qc="visible",ed="hidden",en="refresh",ln="updated",Ki="resize",Zr="resized",td="drag",nd="dragging",id="dragged",Jr="scroll",Li="scrolled",vp="overflow",Es="destroy",od="arrows:mounted",rd="arrows:updated",ad="pagination:mounted",sd="pagination:updated",Ms="navigation:mounted",ks="autoplay:play",ld="autoplay:playing",As="autoplay:pause",Fs="lazyload:loaded",cd="sk",dd="sh",Hr="ei";function Zt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Kc();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:qt(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 bp(e){var t=e;function n(o){t=o}function i(o){return $s(qo(o),t)}return{set:n,is:i}}function wp(e,t){var n=Qr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Sp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Kc(),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",ud=ea+"Up",pd=ea+"Down",cl="rtl",ia="ttb",fa={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[ud,na],ArrowRight:[pd,ta]};function Cp(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",$p="disabled",Cn="aria-",Jo=Cn+"controls",md=Cn+"current",dl=Cn+"selected",yn=Cn+"label",_s=Cn+"labelledby",gd=Cn+"hidden",Ns=Cn+"orientation",Wo=Cn+"roledescription",ul=Cn+"live",pl=Cn+"busy",ml=Cn+"atomic",Ws=[Wn,Xi,$p,Jo,md,yn,_s,gd,Ns,Wo],kn=Zo+"__",li="is-",ya=Zo,gl=kn+"track",Tp=kn+"list",oa=kn+"slide",hd=oa+"--clone",Ip=oa+"__container",Hs=kn+"arrows",ra=kn+"arrow",fd=ra+"--prev",yd=ra+"--next",aa=kn+"pagination",xd=aa+"__page",Rp=kn+"progress",Lp=Rp+"__bar",Pp=kn+"toggle",Ep=kn+"spinner",Mp=kn+"sr",kp=li+"initialized",Ii=li+"active",vd=li+"prev",bd=li+"next",ts=li+"visible",ns=li+"loading",wd=li+"focus-in",Sd=li+"overflow",Ap=[Ii,ts,vd,bd,ns,wd,Sd],Fp={slide:oa,clone:hd,arrows:Hs,arrow:ra,prev:fd,next:yd,pagination:aa,page:xd,spinner:Ep};function _p(e,t){if(jc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ko(n,t);)n=n.parentElement;return n}var Np=5,hl=200,Cd="touchstart mousedown",xa="touchmove mousemove",va="touchend touchcancel mouseup click";function Wp(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],x=[],w,m,h;function f(){S(),V(),y()}function v(){o(en,C),o(en,f),o(ln,y),r(document,Cd+" keydown",function(W){h=W.type==="keydown"},{capture:!0}),r(l,"focusin",function(){_n(l,wd,!!h)})}function C(W){var I=Ws.concat("style");On(u),Nn(l,p),Nn(w,x),Mn([w,m],I),Mn(l,W?I:["style",Wo])}function y(){Nn(l,p),Nn(w,x),p=q(ya),x=q(gl),En(l,p),En(w,x),$t(l,yn,n.label),$t(l,_s,n.labelledby)}function S(){w=N("."+gl),m=Ko(w,"."+Tp),Ro(w&&m,"A track/list element is missing."),Rr(u,Gc(m,"."+oa+":not(."+hd+")")),Ci({arrows:Hs,pagination:aa,prev:fd,next:yd,bar:Lp,toggle:Pp},function(W,I){c[I]=N("."+W)}),Fo(c,{root:l,track:w,list:m,slides:u})}function V(){var W=l.id||xp(Zo),I=n.role;l.id=W,w.id=w.id||W+"-track",m.id=m.id||W+"-list",!Sn(l,Wn)&&l.tagName!=="SECTION"&&I&&$t(l,Wn,I),$t(l,Wo,d.carousel),$t(m,Wn,"presentation")}function N(W){var I=qc(l,W);return I&&_p(I,"."+ya)===l?I:void 0}function q(W){return[W+"--"+n.type,W+"--"+n.direction,n.drag&&W+"--draggable",n.isNavigation&&W+"--nav",W===ya&&Ii]}return Fo(c,{setup:f,mount:v,destroy:C})}var Zi="slide",uo="loop",Qo="fade";function Hp(e,t,n,i){var o=Zt(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,V=Ko(i,"."+Ip),N;function q(){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]))),W()}function W(){d(i,"click",qt(l,Ps,te)),d(i,"keydown",qt(l,cd,te)),r([co,dd,Li],T),r(Ms,B),w&&r(Bn,$)}function I(){N=!0,o.destroy(),Nn(i,Ap),Mn(i,Ws),$t(i,"style",C),$t(i,yn,y||"")}function B(){var L=e.splides.map(function(H){var U=H.splide.Components.Slides.getAt(t);return U?U.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 $(){N||T()}function T(){if(!N){var L=e.index;k(),F(),_n(i,vd,t===L-1),_n(i,bd,t===L+1)}}function k(){var L=O();L!==sl(i,Ii)&&(_n(i,Ii,L),$t(i,md,x&&L||""),l(L?Zc:Jc,te))}function F(){var L=P(),H=!L&&(!O()||S);if(e.state.is([lo,Xo])||$t(i,gd,H||""),$t(Is(i,p.focusableNodes||""),Xi,H?-1:""),f&&$t(i,Xi,H?-1:0),L!==sl(i,ts)&&(_n(i,ts,L),l(L?Qc:ed,te)),!L&&document.activeElement===i){var U=c.Slides.getAt(e.index);U&&Xc(U.slide)}}function g(L,H,U){wn(U&&V||i,L,H)}function O(){var L=e.index;return L===t||p.cloneStatus&&L===n}function P(){if(e.is(Qo))return O();var L=hn(c.Elements.track),H=hn(i),U=v("left",!0),de=v("right",!0);return Wr(L[U])<=No(H[U])&&Wr(H[de])<=No(L[de])}function X(L,H){var U=dn(L-t);return!S&&(p.rewind||e.is(uo))&&(U=ii(U,e.length-U)),U<=H}var te={index:t,slideIndex:n,slide:i,container:V,isClone:S,mount:q,destroy:I,update:T,style:g,isWithin:X};return te}function Dp(e,t,n){var i=Zt(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(){N(function(T){T.destroy()}),On(p)}function h(){N(function(T){T.update()})}function f(T,k,F){var g=Hp(e,k,F,T);g.mount(),p.push(g),p.sort(function(O,P){return O.index-P.index})}function v(T){return T?q(function(k){return!k.isClone}):p}function C(T){var k=t.Controller,F=k.toIndex(T),g=k.hasFocus()?1:n.perPage;return q(function(O){return Lr(O.index,F,F+g-1)})}function y(T){return q(T)[0]}function S(T,k){vn(T,function(F){if(ni(F)&&(F=Yc(F)),Vc(F)){var g=c[k];g?Ts(F,g):Uo(u,F),En(F,n.classes.slide),I(F,qt(r,Ki))}}),r(en)}function V(T){Ti(q(T).map(function(k){return k.slide})),r(en)}function N(T,k){v(k).forEach(T)}function q(T){return p.filter(jc(T)?T:function(k){return ni(T)?ko(k.slide,T):$s(qo(T),k.index)})}function W(T,k,F){N(function(g){g.style(T,k,F)})}function I(T,k){var F=Is(T,"img"),g=F.length;g?F.forEach(function(O){l(O,"load error",function(){--g||k()})}):k()}function B(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:V,forEach:N,filter:q,style:W,getLength:B,isEnough:$}}function Op(e,t,n){var i=Zt(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",wp(qt(l,Ki))),o([ln,en],S),o(Ki,V)}function S(){f=n.direction===ia,wn(p,"maxWidth",pi(n.width)),wn(x,c("paddingLeft"),N(!1)),wn(x,c("paddingRight"),N(!0)),V(!0)}function V(te){var L=hn(p);(te||v.width!==L.width||v.height!==L.height)&&(wn(x,"height",q()),h(c("marginRight"),pi(n.gap)),h("width",I()),h("height",B(),!0),v=L,l(Zr),C!==(C=X())&&(_n(p,Sd,C),l(vp,C)))}function N(te){var L=n.padding,H=c(te?"right":"left");return L&&pi(L[H]||(Mo(L)?0:L))||"0px"}function q(){var te="";return f&&(te=W(),Ro(te,"height or heightRatio is missing."),te="calc("+te+" - "+N(!1)+" - "+N(!0)+")"),te}function W(){return pi(n.height||hn(w).width*n.heightRatio)}function I(){return n.autoWidth?null:pi(n.fixedWidth)||(f?"":$())}function B(){return pi(n.fixedHeight)||(f?n.autoHeight?null:$():W())}function $(){var te=pi(n.gap);return"calc((100%"+(te&&" + "+te)+")/"+(n.perPage||1)+(te&&" - "+te)+")"}function T(){return hn(w)[c("width")]}function k(te,L){var H=m(te||0);return H?hn(H.slide)[c("width")]+(L?0:O()):0}function F(te,L){var H=m(te);if(H){var U=hn(H.slide)[c("right")],de=hn(w)[c("left")];return dn(U-de)+(L?0:O())}return 0}function g(te){return F(e.length-1)-F(0)+k(0,te)}function O(){var te=m(0);return te&&parseFloat(wn(te.slide,c("marginRight")))||0}function P(te){return parseFloat(wn(x,c("padding"+(te?"Right":"Left"))))||0}function X(){return e.is(Qo)||g(!0)>T()}return{mount:y,resize:V,listSize:T,slideSize:k,sliderSize:g,totalSize:F,getPadding:P,isOverflow:X}}var Bp=2;function zp(e,t,n){var i=Zt(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(V,N){var q=N<C,W=f(V.slide,N);q?Ts(W,y[0].slide):Uo(r.list,W),Rr(c,W),l.register(W,N-C+(q?0:S),V.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*Bp}return C}return{mount:p,destroy:w}}function jp(e,t,n){var i=Zt(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 V(){S=t.Transition,o([si,Zr,ln,en],N)}function N(){t.Controller.isBusy()||(t.Scroll.cancel(),W(e.index),t.Slides.update())}function q(H,U,de,ae){H!==U&&te(H>de)&&(T(),I($(g(),H>de),!0)),l(lo),r(Bn,U,de,H),S.start(U,function(){l(Ui),r(co,U,de,H),ae&&ae()})}function W(H){I(F(H,!0))}function I(H,U){if(!e.is(Qo)){var de=U?H:B(H);wn(C,"transform","translate"+h("X")+"("+de+"px)"),H!==de&&r(dd)}}function B(H){if(e.is(uo)){var U=k(H),de=U>t.Controller.getEnd(),ae=U<0;(ae||de)&&(H=$(H,de))}return H}function $(H,U){var de=H-X(U),ae=w();return H-=f(ae*(No(dn(de)/ae)||1))*(U?1:-1),H}function T(){I(g(),!0),S.cancel()}function k(H){for(var U=t.Slides.get(),de=0,ae=1/0,A=0;A<U.length;A++){var ce=U[A].index,z=dn(F(ce,!0)-H);if(z<=ae)ae=z,de=ce;else break}return de}function F(H,U){var de=f(p(H-1)-P(H));return U?O(de):de}function g(){var H=h("left");return hn(C)[H]-hn(y)[H]+f(u(!1))}function O(H){return n.trimSpace&&e.is(Zi)&&(H=Wi(H,0,f(w(!0)-x()))),H}function P(H){var U=n.focus;return U==="center"?(x()-c(H,!0))/2:+U*c(H)||0}function X(H){return F(H?t.Controller.getEnd():0,!!n.trimSpace)}function te(H){var U=f($(g(),H));return H?U>=0:U<=C[h("scrollWidth")]-hn(y)[h("width")]}function L(H,U){U=Yo(U)?g():U;var de=H!==!0&&f(U)<f(X(!1)),ae=H!==!1&&f(U)>f(X(!0));return de||ae}return{mount:V,move:q,jump:W,translate:I,shift:$,cancel:T,toIndex:k,toPosition:F,getPosition:g,getLimit:X,exceededLimit:L,reposition:N}}function Vp(e,t,n){var i=Zt(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=qt(g,!1),C=qt(g,!0),y=n.start||0,S,V=y,N,q,W;function I(){B(),o([ln,en,Hr],B),o(Zr,$)}function B(){N=w(!0),q=n.perMove,W=n.perPage,S=te();var z=Wi(y,0,m?S:N-1);z!==y&&(y=z,l.reposition())}function $(){S!==te()&&r(Hr)}function T(z,re,ee){if(!ce()){var xe=F(z),Fe=X(xe);Fe>-1&&(re||Fe!==y)&&(de(Fe),l.move(xe,Fe,V,ee))}}function k(z,re,ee,xe){t.Scroll.scroll(z,re,ee,function(){var Fe=X(l.toIndex(d()));de(m?ii(Fe,S):Fe),xe&&xe()})}function F(z){var re=y;if(ni(z)){var ee=z.match(/([+\-<>])(\d+)?/)||[],xe=ee[1],Fe=ee[2];xe==="+"||xe==="-"?re=O(y+ +(""+xe+(+Fe||1)),y):xe===">"?re=Fe?L(+Fe):v(!0):xe==="<"&&(re=C(!0))}else re=h?z:Wi(z,0,S);return re}function g(z,re){var ee=q||(A()?1:W),xe=O(y+ee*(z?-1:1),y,!(q||A()));return xe===-1&&f&&!Uc(d(),c(!z),1)?z?0:S:re?xe:X(xe)}function O(z,re,ee){if(x()||A()){var xe=P(z);xe!==z&&(re=z,z=xe,ee=!1),z<0||z>S?!q&&(Lr(0,z,re,!0)||Lr(S,re,z,!0))?z=L(H(z)):h?z=ee?z<0?-(N%W||W):N:z:n.rewind?z=z<0?S:0:z=-1:ee&&z!==re&&(z=L(H(re)+(z<re?-1:1)))}else z=-1;return z}function P(z){if(f&&n.trimSpace==="move"&&z!==y)for(var re=d();re===u(z,!0)&&Lr(z,0,e.length-1,!n.rewind);)z<y?--z:++z;return z}function X(z){return h?(z+N)%N||0:z}function te(){for(var z=N-(A()||h&&q?1:W);m&&z-- >0;)if(u(N-1,!0)!==u(z,!0)){z++;break}return Wi(z,0,N-1)}function L(z){return Wi(A()?z:W*z,0,S)}function H(z){return A()?ii(z,S):Wr((z>=S?N-1:z)/W)}function U(z){var re=l.toIndex(z);return f?Wi(re,0,S):re}function de(z){z!==y&&(V=y,y=z)}function ae(z){return z?V:y}function A(){return!Yo(n.focus)||n.isNavigation}function ce(){return e.state.is([lo,Xo])&&!!n.waitForTransition}return{mount:I,go:T,scroll:k,getNext:v,getPrev:C,getAdjacent:g,getEnd:te,setIndex:de,getIndex:ae,toIndex:L,toPage:H,toDest:U,hasFocus:A,isBusy:ce}}var Gp="http://www.w3.org/2000/svg",Xp="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 Yp(e,t,n){var i=Zt(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(){N(),o(ln,V)}function V(){q(),S()}function N(){var k=n.arrows;k&&!(h&&f)&&B(),h&&f&&(Fo(y,{prev:h,next:f}),_o(m,k?"":"none"),En(m,C=Hs+"--"+n.direction),k&&(W(),T(),$t([h,f],Jo,w.id),l(od,h,f)))}function q(){i.destroy(),Nn(m,C),v?(Ti(x?[h,f]:m),h=f=null):Mn([h,f],Ws)}function W(){o([si,co,en,Li,Hr],T),r(f,"click",qt(I,">")),r(h,"click",qt(I,"<"))}function I(k){p.go(k,!0)}function B(){m=x||Gi("div",d.arrows),h=$(!0),f=$(!1),v=!0,Uo(m,[h,f]),!x&&Ts(m,w)}function $(k){var F='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+Gp+'" viewBox="0 0 '+sr+" "+sr+'" width="'+sr+'" height="'+sr+'" focusable="false"><path d="'+(n.arrowPath||Xp)+'" />';return Yc(F)}function T(){if(h&&f){var k=e.index,F=p.getPrev(),g=p.getNext(),O=F>-1&&k<F?c.last:c.prev,P=g>-1&&k>g?c.first:c.next;h.disabled=F<0,f.disabled=g<0,$t(h,yn,O),$t(f,yn,P),l(rd,h,f,F,g)}}return{arrows:y,mount:S,destroy:q,update:T}}var qp=Rs+"-interval";function Up(e,t,n){var i=Zt(e),o=i.on,r=i.bind,l=i.emit,d=Qr(n.interval,e.go.bind(e,">"),W),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(),q())}function y(){n.pauseOnHover&&r(x,"mouseenter mouseleave",function(B){h=B.type==="mouseenter",N()}),n.pauseOnFocus&&r(x,"focusin focusout",function(B){f=B.type==="focusin",N()}),w&&r(w,"click",function(){v?S():V(!0)}),o([Bn,Jr,en],d.rewind),o(Bn,I)}function S(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=h=v=!1,q(),l(ks))}function V(B){B===void 0&&(B=!0),v=!!B,q(),c()||(d.pause(),l(As))}function N(){v||(h||f?V(!1):S())}function q(){w&&(_n(w,Ii,!v),$t(w,yn,n.i18n[v?"play":"pause"]))}function W(B){var $=u.bar;$&&wn($,"width",B*100+"%"),l(ld,B)}function I(B){var $=t.Slides.getAt(B);d.set($&&+Sn($.slide,qp)||n.interval)}return{mount:C,destroy:d.cancel,play:S,pause:V,isPaused:c}}function Kp(e,t,n){var i=Zt(e),o=i.on;function r(){n.cover&&(o(Fs,qt(d,!0)),o([si,ln,en],qt(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:qt(l,!1)}}var Zp=10,Jp=600,Qp=.6,em=1.5,tm=800;function nm(e,t,n){var i=Zt(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,V),o([ln,en],N)}function C(W,I,B,$,T){var k=c();if(V(),B&&(!w||!p())){var F=t.Layout.sliderSize(),g=Ja(W)*F*Wr(dn(W)/F)||0;W=d.toPosition(t.Controller.toDest(W%F))+g}var O=Uc(k,W,1);f=1,I=O?0:I||Nr(dn(W-k)/em,tm),h=$,m=Qr(I,y,qt(S,k,W,T),1),l(Xo),r(Jr),m.start()}function y(){l(Ui),h&&h(),r(Li)}function S(W,I,B,$){var T=c(),k=W+(I-W)*q($),F=(k-T)*f;x(T+F),w&&!B&&p()&&(f*=Qp,dn(F)<Zp&&C(u(p(!0)),Jp,!1,h,!0))}function V(){m&&m.cancel()}function N(){m&&!m.isPaused()&&(V(),y())}function q(W){var I=n.easingFunc;return I?I(W):1-Math.pow(1-W,4)}return{mount:v,destroy:V,scroll:C,cancel:N}}var Hi={passive:!1,capture:!0};function im(e,t,n){var i=Zt(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,V,N,q,W,I=!1,B,$,T;function k(){l(w,xa,Ka,Hi),l(w,va,Ka,Hi),l(w,Cd,g,Hi),l(w,"click",X,{capture:!0}),l(w,"dragstart",Fn),o([si,ln],F)}function F(){var M=n.drag;b(!M),q=M==="free"}function g(M){if(B=!1,!$){var E=Fe(M);xe(M.target)&&(E||!M.button)&&(x.isBusy()?Fn(M,!0):(T=E?w:window,W=c.is([lo,Xo]),N=null,l(T,xa,O,Hi),l(T,va,P,Hi),u.cancel(),p.cancel(),te(M)))}}function O(M){if(c.is(Ir)||(c.set(Ir),r(td)),M.cancelable)if(W){u.translate(S+ee(A(M)));var E=ce(M)>hl,j=I!==(I=y());(E||j)&&te(M),B=!0,r(nd),Fn(M)}else U(M)&&(W=H(M),Fn(M))}function P(M){c.is(Ir)&&(c.set(Ui),r(id)),W&&(L(M),Fn(M)),d(T,xa,O),d(T,va,P),W=!1}function X(M){!$&&B&&Fn(M,!0)}function te(M){N=V,V=M,S=C()}function L(M){var E=de(M),j=ae(E),Ce=n.rewind&&n.rewindByDrag;m(!1),q?x.scroll(j,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(j),!0),m(!0)}function H(M){var E=n.dragMinThreshold,j=Mo(E),Ce=j&&E.mouse||0,Q=(j?E.touch:+E)||10;return dn(A(M))>(Fe(M)?Q:Ce)}function U(M){return dn(A(M))>dn(A(M,!0))}function de(M){if(e.is(uo)||!I){var E=ce(M);if(E&&E<hl)return A(M)/E}return 0}function ae(M){return C()+Ja(M)*ii(dn(M)*(n.flickPower||600),q?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function A(M,E){return re(M,E)-re(z(M),E)}function ce(M){return Za(M)-Za(z(M))}function z(M){return V===M&&N||V}function re(M,E){return(Fe(M)?M.changedTouches[0]:M)["page"+f(E?"Y":"X")]}function ee(M){return M/(I&&e.is(Zi)?Np:1)}function xe(M){var E=n.noDrag;return!ko(M,"."+xd+", ."+ra)&&(!E||!ko(M,E))}function Fe(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}function ye(){return W}function b(M){$=M}return{mount:k,disable:b,isDragging:ye}}var om={Spacebar:" ",Right:na,Left:ta,Up:ud,Down:pd};function Ds(e){return e=ni(e)?e:e.key,om[e]||e}var fl="keydown";function rm(e,t,n){var i=Zt(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,zc(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",am="["+Lo+"], ["+Pr+"]";function sm(e,t,n){var i=Zt(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,am).forEach(function(S){var V=Sn(S,Lo),N=Sn(S,Pr);if(V!==S.src||N!==S.srcset){var q=n.classes.spinner,W=S.parentElement,I=Ko(W,"."+q)||Gi("span",q,W);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",qt(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 V=y[0],N=y[1];Nn(N.slide,ns),S.type!=="error"&&(Ti(y[2]),_o(V,""),d(Fs,V,N),d(Ki)),c&&C()}function C(){p.length&&f(p.shift())}return{mount:x,destroy:qt(On,p),check:h}}function lm(e,t,n){var i=Zt(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],B),V(),B(),r(ad,{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 V(){var $=e.length,T=n.classes,k=n.i18n,F=n.perPage,g=p()?u.getEnd()+1:No($/F);v=h||Gi("ul",T.pagination,c.track.parentElement),En(v,C=aa+"--"+W()),$t(v,Wn,"tablist"),$t(v,yn,k.select),$t(v,Ns,W()===ia?"vertical":"");for(var O=0;O<g;O++){var P=Gi("li",null,v),X=Gi("button",{class:T.page,type:"button"},P),te=d.getIn(O).map(function(H){return H.slide.id}),L=!p()&&F>1?k.pageX:k.slideX;l(X,"click",qt(N,O)),n.paginationKeyboard&&l(X,"keydown",qt(q,O)),$t(P,Wn,"presentation"),$t(X,Wn,"tab"),$t(X,Jo,te.join(" ")),$t(X,yn,Qa(L,O+1)),$t(X,Xi,-1),f.push({li:P,button:X,page:O})}}function N($){w(">"+$,!0)}function q($,T){var k=f.length,F=Ds(T),g=W(),O=-1;F===m(na,!1,g)?O=++$%k:F===m(ta,!1,g)?O=(--$+k)%k:F==="Home"?O=0:F==="End"&&(O=k-1);var P=f[O];P&&(Xc(P.button),w(">"+O),Fn(T,!0))}function W(){return n.paginationDirection||n.direction}function I($){return f[u.toPage($)]}function B(){var $=I(x(!0)),T=I(x());if($){var k=$.button;Nn(k,Ii),Mn(k,dl),$t(k,Xi,-1)}if(T){var F=T.button;En(F,Ii),$t(F,dl,!0),$t(F,Xi,"")}r(sd,{list:v,items:f},$,T)}return{items:f,mount:y,destroy:S,getAt:I,update:B}}var cm=[" ","Enter"];function dm(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=Zt(h);v.on(Bn,function(C,y,S){f.go(f.is(uo)?S:C)}),r.push(v)}function p(){var h=Zt(e),f=h.on;f(Ps,w),f(cd,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(cm,Ds(f))&&(w(h),Fn(f))}return{setup:qt(t.Media.set,{slideFocus:Yo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function um(e,t,n){var i=Zt(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 pm=90;function mm(e,t,n){var i=Zt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Gi("span",Mp),c=Qr(pm,qt(p,!1));function u(){l&&(w(!t.Autoplay.isPaused()),$t(r,ml,!0),d.textContent="…",o(ks,qt(w,!0)),o(As,qt(w,!1)),o([co,Li],qt(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 gm=Object.freeze({__proto__:null,Media:Sp,Direction:Cp,Elements:Wp,Slides:Dp,Layout:Op,Clones:zp,Move:jp,Controller:Vp,Arrows:Yp,Autoplay:Up,Cover:Kp,Scroll:nm,Drag:im,Keyboard:rm,LazyLoad:sm,Pagination:lm,Sync:dm,Wheel:um,Live:mm}),hm={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"},fm={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:Fp,i18n:hm,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ym(e,t,n){var i=t.Slides;function o(){Zt(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),zc(c)}return{mount:o,start:l,cancel:Ka}}function xm(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=qt(wn,l,"transition"),c;function u(){Zt(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 vm=(function(){function e(n,i){this.event=Zt(),this.Components={},this.state=bp(Bi),this.splides=[],this._o={},this._E={};var o=ni(n)?qc(document,n):n;Ro(o,o+" is invalid."),this.root=o,i=qn({label:Sn(o,yn)||"",labelledby:Sn(o,_s)||""},fm,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)?ym:xm),this._E=i||this._E;var c=Fo({},gm,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,kp),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)?Zt(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},hp(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=vm;Os.defaults={};Os.STATES=yp;var yl=[[si,"onMounted"],[es,"onReady"],[Bn,"onMove"],[co,"onMoved"],[Ps,"onClick"],[Zc,"onActive"],[Jc,"onInactive"],[Qc,"onVisible"],[ed,"onHidden"],[en,"onRefresh"],[ln,"onUpdated"],[Ki,"onResize"],[Zr,"onResized"],[td,"onDrag"],[nd,"onDragging"],[id,"onDragged"],[Jr,"onScroll"],[Li,"onScrolled"],[Es,"onDestroy"],[od,"onArrowsMounted"],[rd,"onArrowsUpdated"],[ad,"onPaginationMounted"],[sd,"onPaginationUpdated"],[Ms,"onNavigationMounted"],[ks,"onAutoplayPlay"],[ld,"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 bm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function wm(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 wm(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 Sm=({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();bm(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(Sm,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 Cm="RichTextRenderer-module__link___BWeZ2",$m={link:Cm},Tm=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=>Tm(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function an(e){const{color:t,...n}=e;return n}function Ut(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:$m.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Im(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 Im(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 Rm="SvgImage-module__svg___q3xE-",Lm="SvgImage-module__img___VsTm-",xl={svg:Rm,img:Lm},Pm=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Em=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)}},[]),!Pm(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":Em(e),"--fill":t,"--hover-fill":n,...o??{}}})},Mm={"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 km({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:b,color:m}=n.imageCaption??{},[h,f]=s.useState(void 0),[v,C]=s.useState(null),[y,S]=s.useState(0),[V,N]=s.useState(0),{direction:q,transition:W,controls:I,pagination:B,imageCaption:$,triggers:T}=e,k=s.useRef(W.type),{x:A,y:g}=e.controls.offset,O=P=>{o&&o.go(P)};return s.useEffect(()=>{if(!v)return;const P=new ResizeObserver(X=>{if(!o)return;const[ne]=X;f({width:Math.round(ne.contentRect.width),height:Math.round(ne.contentRect.height)})});return P.observe(v),()=>P.unobserve(v)},[v]),s.useEffect(()=>{!o||k.current===W.type||(N(P=>P+1),k.current=W.type)},[W.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:W.backgroundColor&&W.type==="fade in"?W.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:pt(ut.captionBlock),children:a.jsx("div",{className:ut.captionTextWrapper,children:t.map((P,X)=>a.jsx("div",{className:pt(ut.captionText,Mm[$.alignment],{[ut.withPointerEvents]:X===y&&i,[ut.active]:X===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:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:m,transitionDuration:W.duration?`${Math.round(parseInt(W.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})})},X))})}),a.jsx(zs,{onMove:P=>{S(P.index)},ref:r,options:{arrows:!1,speed:W.duration?parseInt(W.duration):500,autoplay:T.autoPlay!==null,...T.autoPlay!==null&&{interval:parseInt(T.autoPlay)*1e3},direction:q==="horiz"||W.type==="fade in"?"ltr":"ttb",pagination:!1,drag:T.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:W.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((P,X)=>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??""})})})},X))},V),I.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(ut.arrow,{[ut.arrowVertical]:q==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{onClick:()=>{O("-1")},className:ut.arrowInner,style:{transform:`translate(${D.scalingValue(A,i)}, ${D.scalingValue(g*(q==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${q==="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]:q==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:ut.arrowInner,onClick:()=>O("+1"),style:{transform:`translate(${D.scalingValue(A*(q==="horiz"?-1:1),i)}, ${D.scalingValue(g,i)}) scale(${e.controls.scale/100}) rotate(${q==="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")}}),B.isActive&&a.jsx("div",{className:pt(ut.pagination,{[ut.paginationInsideBottom]:B.position==="inside-1"&&q==="horiz",[ut.paginationInsideTop]:B.position==="inside-2"&&q==="horiz",[ut.paginationOutsideBottom]:B.position==="outside-1"&&q==="horiz",[ut.paginationOutsideTop]:B.position==="outside-2"&&q==="horiz",[ut.paginationInsideLeft]:B.position==="inside-1"&&q==="vert",[ut.paginationInsideRight]:B.position==="inside-2"&&q==="vert",[ut.paginationOutsideLeft]:B.position==="outside-1"&&q==="vert",[ut.paginationOutsideRight]:B.position==="outside-2"&&q==="vert",[ut.paginationVertical]:q==="vert"}),children:a.jsx("div",{className:ut.paginationInner,style:{backgroundColor:B.colors[2],transform:`scale(${B.scale/100}) translate(${D.scalingValue(B.offset.x,i)}, ${D.scalingValue(B.offset.y,i)}) rotate(${q==="horiz"?"0deg":"90deg"})`},children:t.map((P,X)=>a.jsx("button",{onClick:()=>{o&&o.go(X)},className:pt(ut.paginationItem),children:a.jsx("div",{className:pt(ut.dot,{[ut.activeDot]:X===y}),style:{backgroundColor:X===y?B.colors[0]:B.colors[1],"--pagination-hover-color":B.hover}})},X))})})]})})}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 Am={element:km,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"]}},Fm="ImageRevealSlider-module__imageRevealSlider___UE5Ob",_m="ImageRevealSlider-module__image___Qjt-e",Nm="ImageRevealSlider-module__link___N-iLG",Wm="ImageRevealSlider-module__cursor___2U03d",Mi={imageRevealSlider:Fm,image:_m,link:Nm,cursor:Wm};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 Hm(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 Dm({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}),[b,m]=s.useState(1),[h,f]=s.useState("none"),v=s.useRef({x:0,y:0}),[C,y]=s.useState(!1),{sizeType:S,imageWidth:V,randomRangeImageWidth:N}=e.imageSize,{revealPosition:q,visible:W}=e.position,{cursorType:I,target:B,defaultCursorScale:$,defaultCursor:T,hoverCursorScale:k,hoverCursor:A}=e.cursor;s.useEffect(()=>{if(!i)return;const P=(L,H)=>{const U=i.getBoundingClientRect(),de=L-U.left,ae=H-U.top;if(x({x:de,y:ae}),I==="system"){f("none"),m(1);return}const F=de,ce=ae,z=document.elementFromPoint(U.left+F,U.top+ce);if(z&&z.closest("a")){f("none"),m(1);return}const re=bl(F,ce,r)||B==="area"?{img:A??"none",scale:k}:{img:T??"none",scale:$};f(re.img),m(re.scale)},X=L=>{L.stopPropagation(),v.current={x:L.clientX,y:L.clientY},P(L.clientX,L.clientY)},ne=()=>{C&&P(v.current.x,v.current.y)};return i.addEventListener("mousemove",X),window.addEventListener("scroll",ne,!0),()=>{i.removeEventListener("mousemove",X),window.removeEventListener("scroll",ne,!0)}},[i,C,p,I,B,A,T,k,$,r]),s.useEffect(()=>{C||(f("none"),m(0))},[C]);const g=async(P,X,ne,L={})=>{const{width:H,height:U,finalWidth:de}=await Hm(P.image.url,S,V,N);let ae=0,F=0;q==="same"?(ae=X/2,F=ne/2):(ae=L.x??Math.random()*X,F=L.y??Math.random()*ne);const ce=Math.min(Math.max(ae,H/2),X-H/2),z=Math.min(Math.max(F,U/2),ne-U/2);return{id:u.current++,url:P.image.url,link:P.link,name:P.image.name,x:ce,y:z,width:de}};s.useEffect(()=>{if(!i||t.length===0)return;const P=i.getBoundingClientRect(),X=P.width,ne=P.height,L=[];(async()=>{const U=t[0],de=await g(U,X,ne);L.push(de),l(L),c(1)})()},[S,V,N,q,i]),s.useEffect(()=>{W==="last One"&&l(P=>P.length>0?[P[P.length-1]]:[])},[W]);const O=async P=>{if(!i)return;const X=i.getBoundingClientRect(),ne=P.clientX-X.left,L=P.clientY-X.top;if(B==="image"&&!bl(ne,L,r))return;let H=0,U=0;q==="on Click"?(H=ne,U=L):q==="same"?(H=X.width/2,U=X.height/2):(H=Math.random()*X.width,U=Math.random()*X.height);const de=t[d],ae=await g(de,X.width,X.height,{x:H,y:U});l(F=>W==="all"?[...F,ae]:[ae]),c(F=>F>=t.length-1?0:F+1)};return a.jsxs("div",{ref:o,onClick:O,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:B==="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(${b})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Om={element:Dm,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:""}]}}}},Bm="LightBox-module__hidden___9s-9x",zm="LightBox-module__heroImage___sTxNF",jm="LightBox-module__background___rm9ml",Vm="LightBox-module__editor___4ACaY",Gm="LightBox-module__contentStyle___Bgnsq",Xm="LightBox-module__imageStyle___tLIlB",Ym="LightBox-module__imgWrapper___LuFUp",qm="LightBox-module__contain___8-yaS",Um="LightBox-module__cover___hNvOG",Km="LightBox-module__caption___b6L2I",Zm="LightBox-module__captionTextInner___rCGNH",Jm="LightBox-module__lightboxSplide___XFuWC",Qm="LightBox-module__arrow___iz38X",eg="LightBox-module__arrowVertical___Zfz81",tg="LightBox-module__nextArrow___zkAQN",ng="LightBox-module__arrowInner___p48sW",ig="LightBox-module__arrowIcon___3VaFf",og="LightBox-module__arrowImg___pNV88",rg="LightBox-module__mirror___pjeXc",ag="LightBox-module__thumbsWrapper___GB-nU",sg="LightBox-module__thumbsContainerVertical___wttk5",lg="LightBox-module__thumbsContainer___osSma",cg="LightBox-module__thumbsAlignStart___MO6tY",dg="LightBox-module__thumbsAlignCenter___Q4sUx",ug="LightBox-module__thumbsAlignEnd___p4y9R",pg="LightBox-module__thumbItem___HvnF3",mg="LightBox-module__closeButton___g2khP",gg="LightBox-module__fadeIn___0m5GW",hg="LightBox-module__slideInLeft___gPYwC",fg="LightBox-module__slideInRight___S-pPp",yg="LightBox-module__slideInTop___DFdAj",xg="LightBox-module__slideInBottom___m27kZ",vg="LightBox-module__fadeOut___55qBR",bg="LightBox-module__slideOutLeft___NvU7P",wg="LightBox-module__slideOutRight___SK7eC",Sg="LightBox-module__slideOutTop___Vgg0z",Cg="LightBox-module__slideOutBottom___nJ0Ef",$g="LightBox-module__scaleSlide___vZriG",Qe={hidden:Bm,heroImage:zm,background:jm,editor:Vm,contentStyle:Gm,imageStyle:Xm,imgWrapper:Ym,contain:qm,cover:Um,caption:Km,captionTextInner:Zm,lightboxSplide:Jm,arrow:Qm,arrowVertical:eg,nextArrow:tg,arrowInner:ng,arrowIcon:ig,arrowImg:og,mirror:rg,thumbsWrapper:ag,thumbsContainerVertical:sg,thumbsContainer:lg,thumbsAlignStart:cg,thumbsAlignCenter:dg,thumbsAlignEnd:ug,thumbItem:pg,closeButton:mg,fadeIn:gg,slideInLeft:hg,slideInRight:fg,slideInTop:yg,slideInBottom:xg,fadeOut:vg,slideOutLeft:bg,slideOutRight:wg,slideOutTop:Sg,slideOutBottom:Cg,scaleSlide:$g},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 $d(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 Tg(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 Td(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 Ig(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 Id(e,t,n,i,o){const{x:r,y:l}=Tg(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Rg(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"?Ig:Td,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:x,offsetY:b}=Id(n,i,u,p,d),m=(x+u/2)/n*100,h=(b+p/2)/i*100;return`${m}% ${h}%`}function Lg(e){return Rg(e)}function Or(e){const t=e.getBoundingClientRect(),n=$d(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}=Td(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:x}=Id(i,o,d,c,u),b=t.left+n.left,m=t.top+n.top;return{x:p+b,y:x+m,width:d,height:c}}function wl(e){const t=e.getBoundingClientRect(),n=$d(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 Pg(e,t){const n=(()=>{if(e==="fade in")return Qe.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Qe.slideInLeft;case"right":return Qe.slideInRight;case"top":return Qe.slideInTop;case"bottom":return Qe.slideInBottom;default:return Qe.slideInRight}return Qe.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Qe.fadeIn;if(e==="slide in")switch(t){case"left":return Qe.slideInLeft;case"right":return Qe.slideInRight;case"top":return Qe.slideInTop;case"bottom":return Qe.slideInBottom;default:return Qe.slideInRight}return Qe.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Qe.fadeOut;if(e==="slide in")switch(t){case"left":return Qe.slideOutLeft;case"right":return Qe.slideOutRight;case"top":return Qe.slideOutTop;case"bottom":return Qe.slideOutBottom;default:return Qe.slideOutRight}return Qe.fadeOut})(),r=(()=>{if(e==="fade in")return Qe.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Qe.slideOutLeft;case"right":return Qe.slideOutRight;case"top":return Qe.slideOutTop;case"bottom":return Qe.slideOutBottom;default:return Qe.slideOutRight}return Qe.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Eg=({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:Qe.heroImage,onClick:()=>c(!0)}),a.jsx(Mg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Mg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var Se;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:x,wordSpacing:b,fontSizeLineHeight:m,textAppearance:h,color:f}=i.imageCaption??{},[v,C]=s.useState(0),[y,S]=s.useState(0),[V,N]=s.useState(!1),[q,W]=s.useState(!1),[I,B]=s.useState({}),$=s.useRef(null),T=s.useRef(null),k=s.useRef(null),A=s.useRef(!1),g=s.useRef(null),O=s.useRef(null),P=s.useRef(null),X=s.useRef(null),ne=s.useRef(!1),L=s.useRef(null),[H,U]=s.useState(!1),{appear:de,triggers:ae,slider:F,thumbnail:ce,controls:z,area:re,caption:te,layout:ye}=o.lightboxBlock,{appearClass:Fe,backdropAppearClass:fe,backdropDisappearClass:w,disappearClass:M}=Pg(de.type,de.direction),E=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const K=()=>{setTimeout(()=>{var se,we;(we=(se=$.current)==null?void 0:se.splide)==null||we.refresh()},16)},Z=()=>{S(se=>se+1)};return window.addEventListener("ArticleEditor.Layout:change",K),window.addEventListener("ArticleEditor.ComponentContent:change",Z),()=>{window.removeEventListener("ArticleEditor.Layout:change",K),window.removeEventListener("ArticleEditor.ComponentContent:change",Z)}},[]),s.useEffect(()=>{if(!e||!ce.isActive){U(!1);return}const K=L.current;if(!K)return;const Z=()=>{F.direction==="horiz"?U(K.scrollWidth>K.clientWidth):U(K.scrollHeight>K.clientHeight)};Z();const se=new ResizeObserver(Z);return se.observe(K),()=>se.disconnect()},[e,ce.isActive,n.length,I,F.direction]);const j=s.useCallback(()=>{const K=window.matchMedia("(max-width: 768px)").matches,Z=Sl(re.color);K&&!l&&Z>.9&&(document.body.style.backgroundColor=""),N(!0),A.current=!0;const se=we=>{we.target===g.current&&we.animationName&&(g.current&&O.current&&g.current.removeEventListener("animationend",O.current),O.current=null,A.current&&(A.current=!1,t()),N(!1))};g.current&&(O.current=se,g.current.addEventListener("animationend",se))},[t,re.color,l]),Te=(K,Z,se)=>{var we,Me;if(K){if(ae.type==="click"&&ae.switch==="image")ae.repeat==="close"&&v===n.length-1?j():(we=$.current)==null||we.go("+1");else if(ae.type==="click"&&ae.switch==="50/50"){const Ce=K.getBoundingClientRect(),G=Z-Ce.left,ue=se-Ce.top,oe=Ce.width,Y=Ce.height;let le;F.direction==="horiz"?le=G<oe/2?"-1":"+1":le=ue<Y/2?"-1":"+1",(Me=$.current)==null||Me.go(le)}}},ee=K=>{if(ne.current){ne.current=!1;return}const Z=n[v],se=(Z==null?void 0:Z.image.objectFit)==="cover";let we,Me;if("changedTouches"in K&&K.changedTouches.length>0)we=K.changedTouches[0].clientX,Me=K.changedTouches[0].clientY;else if("clientX"in K)we=K.clientX,Me=K.clientY;else return;let Ce;if(se&&k.current){const G=wl(k.current);Ce=we>=G.left&&we<=G.right&&Me>=G.top&&Me<=G.bottom}else{const G=k.current?Or(k.current):null;if(!G){K.target===K.currentTarget&&j();return}Ce=we>=G.x&&we<=G.x+G.width&&Me>=G.y&&Me<=G.y+G.height}Ce?Te(k.current,we,Me):j()},$e=K=>{const Z=K.target;(Z.classList.contains(Qe.thumbsWrapper)||Z.classList.contains(Qe.thumbsContainer))&&ee(K)};s.useEffect(()=>{if(!e)return;const K=Z=>{var se,we;if(Z.key==="Escape"){j();return}if(Z.key==="ArrowRight"){C(Me=>(Me+1)%Math.max(n.length,1)),(se=$.current)==null||se.go("+1");return}Z.key==="ArrowLeft"&&(C(Me=>(Me-1+Math.max(n.length,1))%Math.max(n.length,1)),(we=$.current)==null||we.go("-1"))};return window.addEventListener("keydown",K),()=>{window.removeEventListener("keydown",K)}},[e,j,n.length]),s.useEffect(()=>{if(e){if(C(0),S(Z=>Z+1),A.current=!1,N(!1),W(!1),B({}),!E)return;const K=new CustomEvent("page-overlay",{detail:{itemId:E}});window.dispatchEvent(K)}return()=>{g.current&&O.current&&(g.current.removeEventListener("animationend",O.current),O.current=null),W(!1)}},[e,E]),s.useEffect(()=>{T.current!==null&&T.current!==F.type&&S(K=>K+1),T.current=F.type},[F.type]),s.useEffect(()=>{if(!e)return;const K=document.body.style.overflow,Z=window.matchMedia("(max-width: 768px)").matches,se=Sl(re.color);document.body.style.overflow="hidden",W(!1);const we=Ce=>{Ce.target===g.current&&!A.current&&Ce.animationName&&(Z&&!l&&se>.9&&(document.body.style.backgroundColor=re.color),W(!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 Me=Ce=>{const G=Ce.target;G&&(G.closest(`.${Qe.thumbsWrapper}`)||G.closest(`.${Qe.thumbsContainer}`))||F.type!=="slide"&&Ce.preventDefault()};return document.addEventListener("touchmove",Me,{passive:!1}),()=>{document.body.style.overflow=K,document.removeEventListener("touchmove",Me),g.current&&P.current&&(g.current.removeEventListener("animationend",P.current),P.current=null),W(!1)}},[e,l,re.color,F.type]),s.useEffect(()=>{if(!e)return;const K=Z=>{var we,Me;if(A.current){Z.stopPropagation();return}if(ne.current){ne.current=!1;return}const se=Z.target;if(!(se&&(se.closest(`.${Qe.thumbsContainer}`)||se.closest(`.${Qe.thumbItem}`)||se.closest(`.${Qe.arrow}`)||se.closest(`.${Qe.closeButton}`)||se.closest(`.${Qe.caption}`)))){if(F.type==="slide"&&ae.type==="drag"&&((Me=(we=$.current)==null?void 0:we.splide)!=null&&Me.root)){const Ce=$.current.splide.root;if(se&&(Ce.contains(se)||Ce===se))return}if(Z.touches.length===0&&Z.changedTouches.length>0){const Ce=n[v],G=(Ce==null?void 0:Ce.image.objectFit)==="cover",ue=Z.changedTouches[0];let oe;if(G&&k.current){const Y=wl(k.current);oe=ue.clientX>=Y.left&&ue.clientX<=Y.right&&ue.clientY>=Y.top&&ue.clientY<=Y.bottom}else{const Y=k.current?Or(k.current):null;if(!Y)return;oe=ue.clientX>=Y.x&&ue.clientX<=Y.x+Y.width&&ue.clientY>=Y.y&&ue.clientY<=Y.y+Y.height}if(!oe){Z.stopPropagation(),A.current=!0;const Y=le=>{le.stopPropagation(),le.preventDefault(),document.removeEventListener("click",Y,!0)};document.addEventListener("click",Y,!0),j()}}}};return document.addEventListener("touchend",K,{passive:!0}),()=>{document.removeEventListener("touchend",K)}},[e,j,v,n]);const J=(F.type==="scale"||F.type==="fade")&&F.direction==="vert"&&ae.type==="drag";s.useEffect(()=>{var le,_e;if(!e||!J||!((_e=(le=$.current)==null?void 0:le.splide)!=null&&_e.root))return;const K=$.current.splide.root,Z=30,se=(pe,Q)=>{if(X.current){const Ke=Math.abs(pe-X.current.x),ke=Math.abs(Q-X.current.y);(Ke>0||ke>0)&&(ne.current=!0)}},we=pe=>{X.current&&(pe.preventDefault(),se(pe.clientX,pe.clientY))},Me=pe=>{X.current&&pe.touches.length>0&&(pe.preventDefault(),se(pe.touches[0].clientX,pe.touches[0].clientY))},Ce=(pe,Q)=>{if(!X.current||!$.current){X.current=null;return}const Ke=Math.abs(pe-X.current.x),ke=Math.abs(Q-X.current.y);ke>Z&&ke>Ke&&$.current.go(Q<X.current.y?"+1":"-1"),X.current=null},G=pe=>{X.current&&Ce(pe.clientX,pe.clientY),document.removeEventListener("pointerup",G),document.removeEventListener("pointercancel",G),document.removeEventListener("pointermove",we)},ue=pe=>{if(X.current){if(pe.changedTouches.length>0){const Q=pe.changedTouches[0];Ce(Q.clientX,Q.clientY)}document.removeEventListener("touchend",ue),document.removeEventListener("touchcancel",ue),document.removeEventListener("touchmove",Me)}},oe=pe=>{X.current={x:pe.clientX,y:pe.clientY},ne.current=!1,document.addEventListener("pointermove",we,{passive:!1}),document.addEventListener("pointerup",G),document.addEventListener("pointercancel",G)},Y=pe=>{pe.touches.length>0&&(X.current={x:pe.touches[0].clientX,y:pe.touches[0].clientY},ne.current=!1,document.addEventListener("touchmove",Me,{passive:!1}),document.addEventListener("touchend",ue),document.addEventListener("touchcancel",ue))};return K.addEventListener("pointerdown",oe),K.addEventListener("touchstart",Y),()=>{K.removeEventListener("pointerdown",oe),K.removeEventListener("touchstart",Y),document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",G),document.removeEventListener("pointercancel",G),document.removeEventListener("touchmove",Me),document.removeEventListener("touchend",ue),document.removeEventListener("touchcancel",ue),X.current=null,ne.current=!1}},[e,J,y]);const me={backgroundColor:re.color,backdropFilter:`blur(${re.blur}px)`,animationDuration:`${parseInt(de.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(Qe.background,V?w:fe,{[Qe.editor]:l},{[Qe.hidden]:!e}),style:{...me,...q&&!l&&!V?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?g:null,className:pt(Qe.contentStyle,V?M:Fe,{[Qe.editor]:l},{[Qe.hidden]:!e}),style:{animationDuration:`${parseInt(de.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(zs,{onMove:K=>C(K.index),ref:$,className:Qe.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:ae.type==="drag"&&!J,perPage:1,width:"100%",height:"100%",type:F.type==="fade"||F.type==="scale"?"fade":"loop",padding:0,rewind:ae.repeat!=="close",start:0},style:{"--splide-speed":F.duration},children:n.map((K,Z)=>{const se=lr(ye.position,ye.offset,l),we=`${D.scalingValue(ye.padding.top,l)} ${D.scalingValue(ye.padding.right,l)} ${D.scalingValue(ye.padding.bottom,l)} ${D.scalingValue(ye.padding.left,l)}`,Me=F.type==="scale"?(()=>{const{transform:Ce,...G}=se;return{...G,position:"absolute",padding:we,boxSizing:"border-box","--position-transform":Ce||"none"}})():{...se,position:"absolute",padding:we,boxSizing:"border-box"};return a.jsx(js,{children:a.jsx("div",{className:Qe.imgWrapper,onClick:ee,children:a.jsx("img",{ref:Z===v?k:null,className:pt(Qe.imageStyle,{[Qe.contain]:K.image.objectFit==="contain",[Qe.cover]:K.image.objectFit==="cover",[Qe.scaleSlide]:F.type==="scale"}),src:K.image.url,alt:K.image.name??"",style:{...Me,pointerEvents:K.image.objectFit==="contain"?"none":"auto"}})})},Z)})},y),z.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(Qe.arrow,{[Qe.arrowVertical]:F.direction==="vert"}),style:{color:z.color,"--arrow-hover-color":z.hover},children:a.jsxs("button",{className:Qe.arrowInner,style:{transform:`translate(${D.scalingValue(z.offset.x,l)}, ${D.scalingValue(z.offset.y*(F.direction==="horiz"?1:-1),l)}) scale(${z.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var K;return(K=$.current)==null?void 0:K.go("-1")},"aria-label":"Previous",children:[z.arrowsImgUrl&&a.jsx(sn,{url:z.arrowsImgUrl,fill:z.color,hoverFill:z.hover,className:pt(Qe.arrowImg,Qe.mirror)}),!z.arrowsImgUrl&&a.jsx(Cl,{color:z.color,className:pt(Qe.arrowIcon,Qe.arrowImg,Qe.mirror)})]})}),a.jsx("div",{className:pt(Qe.arrow,Qe.nextArrow,{[Qe.arrowVertical]:F.direction==="vert"}),style:{color:z.color,"--arrow-hover-color":z.hover},children:a.jsxs("button",{className:Qe.arrowInner,style:{transform:`translate(${D.scalingValue(z.offset.x*(F.direction==="horiz"?-1:1),l)}, ${D.scalingValue(z.offset.y,l)}) scale(${z.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var K;return(K=$.current)==null?void 0:K.go("+1")},"aria-label":"Next",children:[z.arrowsImgUrl&&a.jsx(sn,{url:z.arrowsImgUrl,fill:z.color,hoverFill:z.hover,className:Qe.arrowImg}),!z.arrowsImgUrl&&a.jsx(Cl,{color:z.color,className:pt(Qe.arrowIcon,Qe.arrowImg)})]})})]}),re.closeIconUrl&&(()=>{const K=lr(re.closeIconAlign,re.closeIconOffset,l),Z=`scale(${re.closeIconScale})`,se=K.transform?`${K.transform} ${Z}`:Z;return a.jsx("button",{className:Qe.closeButton,style:{...K,transform:se},onClick:j,"aria-label":"Close lightbox",children:a.jsx(sn,{url:re.closeIconUrl,fill:re.closeIconColor??"#000000",hoverFill:re.closeIconHover??"#cccccc"})})})(),te&&te.isActive&&i.imageCaption&&((Se=n[v])==null?void 0:Se.imageCaption)&&a.jsx("div",{className:Qe.caption,style:{...lr(te.alignment,te.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(b,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:K=>K.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Qe.captionTextInner,style:{"--link-color":te.linkColor,"--link-hover-color":te.linkHoverColor},children:a.jsx(Ri,{content:n[v].imageCaption})})}),ce.isActive&&(()=>{const[K,Z]=ce.position.split("-"),se=F.direction==="horiz"?`${K}-left`:ce.position,we=lr(se,ce.offset,l),Me=()=>{if(F.direction==="horiz"){if(Z==="left")return"flex-start";if(Z==="center")return"center";if(Z==="right")return"flex-end"}else{if(K==="top")return"flex-start";if(K==="middle")return"center";if(K==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:L,className:Qe.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(Qe.thumbsContainer,{[Qe.thumbsContainerVertical]:F.direction==="vert",[Qe.thumbsAlignStart]:ce.align==="start",[Qe.thumbsAlignCenter]:ce.align==="center",[Qe.thumbsAlignEnd]:ce.align==="end"}),style:{gap:D.scalingValue(ce.grid.gap,l),justifyContent:H?"flex-start":Me()},children:n.map((Ce,G)=>{const ue=G===v,oe=I[G],le=ce.grid.size*(ue?ce.activeState.scale:1),_e=()=>{if(ce.fit!=="fit")return{};if(!oe)return F.direction==="horiz"?{height:D.scalingValue(le,l)}:{width:D.scalingValue(le,l)};const pe=oe.width/oe.height;if(F.direction==="horiz"){const Q=le,Ke=Q*pe;return{width:D.scalingValue(Ke,l),height:D.scalingValue(Q,l)}}else{const Q=le,Ke=Q/pe;return{width:D.scalingValue(Q,l),height:D.scalingValue(Ke,l)}}};return a.jsx("button",{className:Qe.thumbItem,style:{...F.direction==="horiz"&&ce.fit!=="fit"?{height:D.scalingValue(le,l)}:{},...F.direction==="vert"&&ce.fit!=="fit"?{width:D.scalingValue(le,l)}:{},...ce.fit==="cover"?{width:D.scalingValue(le,l),height:D.scalingValue(le,l)}:{},..._e(),transition:ue?"all 0.25s ease-out":"none",opacity:ue?ce.activeState.opacity/100:ce.opacity/100,"--thumb-hover":ce.activeState.opacity/100},onClick:pe=>{var Q;pe.stopPropagation(),C(G),(Q=$.current)==null||Q.go(G)},onMouseEnter:()=>{var pe;ce.triggers==="hov"&&((pe=$.current)==null||pe.go(G))},children:a.jsx("img",{src:Ce.image.url,alt:Ce.image.name??"",onLoad:pe=>{const Q=pe.currentTarget;Q.naturalWidth&&Q.naturalHeight&&B(Ke=>({...Ke,[G]:{width:Q.naturalWidth,height:Q.naturalHeight}}))},style:{objectFit:ce.fit==="cover"?"cover":"contain",...ce.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ce.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Ce.image.name}-${G}`)})})})})()]})]}),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 kg={element:Eg,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 Ag(e){return`
6
+ */const Cm="RichTextRenderer-module__link___BWeZ2",$m={link:Cm},Tm=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=>Tm(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function an(e){const{color:t,...n}=e;return n}function Ut(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:$m.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Im(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 Im(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 Rm="SvgImage-module__svg___q3xE-",Lm="SvgImage-module__img___VsTm-",xl={svg:Rm,img:Lm},Pm=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Em=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)}},[]),!Pm(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":Em(e),"--fill":t,"--hover-fill":n,...o??{}}})},Mm={"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 km({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),[V,N]=s.useState(0),{direction:q,transition:W,controls:I,pagination:B,imageCaption:$,triggers:T}=e,k=s.useRef(W.type),{x:F,y:g}=e.controls.offset,O=P=>{o&&o.go(P)};return s.useEffect(()=>{if(!v)return;const P=new ResizeObserver(X=>{if(!o)return;const[te]=X;f({width:Math.round(te.contentRect.width),height:Math.round(te.contentRect.height)})});return P.observe(v),()=>P.unobserve(v)},[v]),s.useEffect(()=>{!o||k.current===W.type||(N(P=>P+1),k.current=W.type)},[W.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:W.backgroundColor&&W.type==="fade in"?W.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:pt(ut.captionBlock),children:a.jsx("div",{className:ut.captionTextWrapper,children:t.map((P,X)=>a.jsx("div",{className:pt(ut.captionText,Mm[$.alignment],{[ut.withPointerEvents]:X===y&&i,[ut.active]:X===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:W.duration?`${Math.round(parseInt(W.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})})},X))})}),a.jsx(zs,{onMove:P=>{S(P.index)},ref:r,options:{arrows:!1,speed:W.duration?parseInt(W.duration):500,autoplay:T.autoPlay!==null,...T.autoPlay!==null&&{interval:parseInt(T.autoPlay)*1e3},direction:q==="horiz"||W.type==="fade in"?"ltr":"ttb",pagination:!1,drag:T.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:W.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((P,X)=>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??""})})})},X))},V),I.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(ut.arrow,{[ut.arrowVertical]:q==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{onClick:()=>{O("-1")},className:ut.arrowInner,style:{transform:`translate(${D.scalingValue(F,i)}, ${D.scalingValue(g*(q==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${q==="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]:q==="vert",[ut.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:a.jsxs("button",{className:ut.arrowInner,onClick:()=>O("+1"),style:{transform:`translate(${D.scalingValue(F*(q==="horiz"?-1:1),i)}, ${D.scalingValue(g,i)}) scale(${e.controls.scale/100}) rotate(${q==="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")}}),B.isActive&&a.jsx("div",{className:pt(ut.pagination,{[ut.paginationInsideBottom]:B.position==="inside-1"&&q==="horiz",[ut.paginationInsideTop]:B.position==="inside-2"&&q==="horiz",[ut.paginationOutsideBottom]:B.position==="outside-1"&&q==="horiz",[ut.paginationOutsideTop]:B.position==="outside-2"&&q==="horiz",[ut.paginationInsideLeft]:B.position==="inside-1"&&q==="vert",[ut.paginationInsideRight]:B.position==="inside-2"&&q==="vert",[ut.paginationOutsideLeft]:B.position==="outside-1"&&q==="vert",[ut.paginationOutsideRight]:B.position==="outside-2"&&q==="vert",[ut.paginationVertical]:q==="vert"}),children:a.jsx("div",{className:ut.paginationInner,style:{backgroundColor:B.colors[2],transform:`scale(${B.scale/100}) translate(${D.scalingValue(B.offset.x,i)}, ${D.scalingValue(B.offset.y,i)}) rotate(${q==="horiz"?"0deg":"90deg"})`},children:t.map((P,X)=>a.jsx("button",{onClick:()=>{o&&o.go(X)},className:pt(ut.paginationItem),children:a.jsx("div",{className:pt(ut.dot,{[ut.activeDot]:X===y}),style:{backgroundColor:X===y?B.colors[0]:B.colors[1],"--pagination-hover-color":B.hover}})},X))})})]})})}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 Am={element:km,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"]}},Fm="ImageRevealSlider-module__imageRevealSlider___UE5Ob",_m="ImageRevealSlider-module__image___Qjt-e",Nm="ImageRevealSlider-module__link___N-iLG",Wm="ImageRevealSlider-module__cursor___2U03d",Mi={imageRevealSlider:Fm,image:_m,link:Nm,cursor:Wm};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 Hm(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 Dm({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:V,randomRangeImageWidth:N}=e.imageSize,{revealPosition:q,visible:W}=e.position,{cursorType:I,target:B,defaultCursorScale:$,defaultCursor:T,hoverCursorScale:k,hoverCursor:F}=e.cursor;s.useEffect(()=>{if(!i)return;const P=(L,H)=>{const U=i.getBoundingClientRect(),de=L-U.left,ae=H-U.top;if(x({x:de,y:ae}),I==="system"){f("none"),m(1);return}const A=de,ce=ae,z=document.elementFromPoint(U.left+A,U.top+ce);if(z&&z.closest("a")){f("none"),m(1);return}const re=bl(A,ce,r)||B==="area"?{img:F??"none",scale:k}:{img:T??"none",scale:$};f(re.img),m(re.scale)},X=L=>{L.stopPropagation(),v.current={x:L.clientX,y:L.clientY},P(L.clientX,L.clientY)},te=()=>{C&&P(v.current.x,v.current.y)};return i.addEventListener("mousemove",X),window.addEventListener("scroll",te,!0),()=>{i.removeEventListener("mousemove",X),window.removeEventListener("scroll",te,!0)}},[i,C,p,I,B,F,T,k,$,r]),s.useEffect(()=>{C||(f("none"),m(0))},[C]);const g=async(P,X,te,L={})=>{const{width:H,height:U,finalWidth:de}=await Hm(P.image.url,S,V,N);let ae=0,A=0;q==="same"?(ae=X/2,A=te/2):(ae=L.x??Math.random()*X,A=L.y??Math.random()*te);const ce=Math.min(Math.max(ae,H/2),X-H/2),z=Math.min(Math.max(A,U/2),te-U/2);return{id:u.current++,url:P.image.url,link:P.link,name:P.image.name,x:ce,y:z,width:de}};s.useEffect(()=>{if(!i||t.length===0)return;const P=i.getBoundingClientRect(),X=P.width,te=P.height,L=[];(async()=>{const U=t[0],de=await g(U,X,te);L.push(de),l(L),c(1)})()},[S,V,N,q,i]),s.useEffect(()=>{W==="last One"&&l(P=>P.length>0?[P[P.length-1]]:[])},[W]);const O=async P=>{if(!i)return;const X=i.getBoundingClientRect(),te=P.clientX-X.left,L=P.clientY-X.top;if(B==="image"&&!bl(te,L,r))return;let H=0,U=0;q==="on Click"?(H=te,U=L):q==="same"?(H=X.width/2,U=X.height/2):(H=Math.random()*X.width,U=Math.random()*X.height);const de=t[d],ae=await g(de,X.width,X.height,{x:H,y:U});l(A=>W==="all"?[...A,ae]:[ae]),c(A=>A>=t.length-1?0:A+1)};return a.jsxs("div",{ref:o,onClick:O,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:B==="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 Om={element:Dm,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:""}]}}}},Bm="LightBox-module__hidden___9s-9x",zm="LightBox-module__heroImage___sTxNF",jm="LightBox-module__background___rm9ml",Vm="LightBox-module__editor___4ACaY",Gm="LightBox-module__contentStyle___Bgnsq",Xm="LightBox-module__imageStyle___tLIlB",Ym="LightBox-module__imgWrapper___LuFUp",qm="LightBox-module__contain___8-yaS",Um="LightBox-module__cover___hNvOG",Km="LightBox-module__caption___b6L2I",Zm="LightBox-module__captionTextInner___rCGNH",Jm="LightBox-module__lightboxSplide___XFuWC",Qm="LightBox-module__arrow___iz38X",eg="LightBox-module__arrowVertical___Zfz81",tg="LightBox-module__nextArrow___zkAQN",ng="LightBox-module__arrowInner___p48sW",ig="LightBox-module__arrowIcon___3VaFf",og="LightBox-module__arrowImg___pNV88",rg="LightBox-module__mirror___pjeXc",ag="LightBox-module__thumbsWrapper___GB-nU",sg="LightBox-module__thumbsContainerVertical___wttk5",lg="LightBox-module__thumbsContainer___osSma",cg="LightBox-module__thumbsAlignStart___MO6tY",dg="LightBox-module__thumbsAlignCenter___Q4sUx",ug="LightBox-module__thumbsAlignEnd___p4y9R",pg="LightBox-module__thumbItem___HvnF3",mg="LightBox-module__closeButton___g2khP",gg="LightBox-module__fadeIn___0m5GW",hg="LightBox-module__slideInLeft___gPYwC",fg="LightBox-module__slideInRight___S-pPp",yg="LightBox-module__slideInTop___DFdAj",xg="LightBox-module__slideInBottom___m27kZ",vg="LightBox-module__fadeOut___55qBR",bg="LightBox-module__slideOutLeft___NvU7P",wg="LightBox-module__slideOutRight___SK7eC",Sg="LightBox-module__slideOutTop___Vgg0z",Cg="LightBox-module__slideOutBottom___nJ0Ef",$g="LightBox-module__scaleSlide___vZriG",Qe={hidden:Bm,heroImage:zm,background:jm,editor:Vm,contentStyle:Gm,imageStyle:Xm,imgWrapper:Ym,contain:qm,cover:Um,caption:Km,captionTextInner:Zm,lightboxSplide:Jm,arrow:Qm,arrowVertical:eg,nextArrow:tg,arrowInner:ng,arrowIcon:ig,arrowImg:og,mirror:rg,thumbsWrapper:ag,thumbsContainerVertical:sg,thumbsContainer:lg,thumbsAlignStart:cg,thumbsAlignCenter:dg,thumbsAlignEnd:ug,thumbItem:pg,closeButton:mg,fadeIn:gg,slideInLeft:hg,slideInRight:fg,slideInTop:yg,slideInBottom:xg,fadeOut:vg,slideOutLeft:bg,slideOutRight:wg,slideOutTop:Sg,slideOutBottom:Cg,scaleSlide:$g},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 $d(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 Tg(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 Td(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 Ig(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 Id(e,t,n,i,o){const{x:r,y:l}=Tg(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Rg(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"?Ig:Td,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:x,offsetY:w}=Id(n,i,u,p,d),m=(x+u/2)/n*100,h=(w+p/2)/i*100;return`${m}% ${h}%`}function Lg(e){return Rg(e)}function Or(e){const t=e.getBoundingClientRect(),n=$d(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}=Td(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:x}=Id(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=$d(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 Pg(e,t){const n=(()=>{if(e==="fade in")return Qe.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Qe.slideInLeft;case"right":return Qe.slideInRight;case"top":return Qe.slideInTop;case"bottom":return Qe.slideInBottom;default:return Qe.slideInRight}return Qe.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Qe.fadeIn;if(e==="slide in")switch(t){case"left":return Qe.slideInLeft;case"right":return Qe.slideInRight;case"top":return Qe.slideInTop;case"bottom":return Qe.slideInBottom;default:return Qe.slideInRight}return Qe.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Qe.fadeOut;if(e==="slide in")switch(t){case"left":return Qe.slideOutLeft;case"right":return Qe.slideOutRight;case"top":return Qe.slideOutTop;case"bottom":return Qe.slideOutBottom;default:return Qe.slideOutRight}return Qe.fadeOut})(),r=(()=>{if(e==="fade in")return Qe.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Qe.slideOutLeft;case"right":return Qe.slideOutRight;case"top":return Qe.slideOutTop;case"bottom":return Qe.slideOutBottom;default:return Qe.slideOutRight}return Qe.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Eg=({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:Qe.heroImage,onClick:()=>c(!0)}),a.jsx(Mg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Mg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var fe;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),[V,N]=s.useState(!1),[q,W]=s.useState(!1),[I,B]=s.useState({}),$=s.useRef(null),T=s.useRef(null),k=s.useRef(null),F=s.useRef(!1),g=s.useRef(null),O=s.useRef(null),P=s.useRef(null),X=s.useRef(null),te=s.useRef(!1),L=s.useRef(null),[H,U]=s.useState(!1),{appear:de,triggers:ae,slider:A,thumbnail:ce,controls:z,area:re,caption:ee,layout:xe}=o.lightboxBlock,{appearClass:Fe,backdropAppearClass:ye,backdropDisappearClass:b,disappearClass:M}=Pg(de.type,de.direction),E=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const K=()=>{setTimeout(()=>{var se,Se;(Se=(se=$.current)==null?void 0:se.splide)==null||Se.refresh()},16)},Z=()=>{S(se=>se+1)};return window.addEventListener("ArticleEditor.Layout:change",K),window.addEventListener("ArticleEditor.ComponentContent:change",Z),()=>{window.removeEventListener("ArticleEditor.Layout:change",K),window.removeEventListener("ArticleEditor.ComponentContent:change",Z)}},[]),s.useEffect(()=>{if(!e||!ce.isActive){U(!1);return}const K=L.current;if(!K)return;const Z=()=>{A.direction==="horiz"?U(K.scrollWidth>K.clientWidth):U(K.scrollHeight>K.clientHeight)};Z();const se=new ResizeObserver(Z);return se.observe(K),()=>se.disconnect()},[e,ce.isActive,n.length,I,A.direction]);const j=s.useCallback(()=>{const K=window.matchMedia("(max-width: 768px)").matches,Z=Sl(re.color);K&&!l&&Z>.9&&(document.body.style.backgroundColor=""),N(!0),F.current=!0;const se=Se=>{Se.target===g.current&&Se.animationName&&(g.current&&O.current&&g.current.removeEventListener("animationend",O.current),O.current=null,F.current&&(F.current=!1,t()),N(!1))};g.current&&(O.current=se,g.current.addEventListener("animationend",se))},[t,re.color,l]),Ce=(K,Z,se)=>{var Se,Me;if(K){if(ae.type==="click"&&ae.switch==="image")ae.repeat==="close"&&v===n.length-1?j():(Se=$.current)==null||Se.go("+1");else if(ae.type==="click"&&ae.switch==="50/50"){const $e=K.getBoundingClientRect(),G=Z-$e.left,pe=se-$e.top,oe=$e.width,Y=$e.height;let le;A.direction==="horiz"?le=G<oe/2?"-1":"+1":le=pe<Y/2?"-1":"+1",(Me=$.current)==null||Me.go(le)}}},Q=K=>{if(te.current){te.current=!1;return}const Z=n[v],se=(Z==null?void 0:Z.image.objectFit)==="cover";let Se,Me;if("changedTouches"in K&&K.changedTouches.length>0)Se=K.changedTouches[0].clientX,Me=K.changedTouches[0].clientY;else if("clientX"in K)Se=K.clientX,Me=K.clientY;else return;let $e;if(se&&k.current){const G=wl(k.current);$e=Se>=G.left&&Se<=G.right&&Me>=G.top&&Me<=G.bottom}else{const G=k.current?Or(k.current):null;if(!G){K.target===K.currentTarget&&j();return}$e=Se>=G.x&&Se<=G.x+G.width&&Me>=G.y&&Me<=G.y+G.height}$e?Ce(k.current,Se,Me):j()},Te=K=>{const Z=K.target;(Z.classList.contains(Qe.thumbsWrapper)||Z.classList.contains(Qe.thumbsContainer))&&Q(K)};s.useEffect(()=>{if(!e)return;const K=Z=>{var se,Se;if(Z.key==="Escape"){j();return}if(Z.key==="ArrowRight"){C(Me=>(Me+1)%Math.max(n.length,1)),(se=$.current)==null||se.go("+1");return}Z.key==="ArrowLeft"&&(C(Me=>(Me-1+Math.max(n.length,1))%Math.max(n.length,1)),(Se=$.current)==null||Se.go("-1"))};return window.addEventListener("keydown",K),()=>{window.removeEventListener("keydown",K)}},[e,j,n.length]),s.useEffect(()=>{if(e){if(C(0),S(Z=>Z+1),F.current=!1,N(!1),W(!1),B({}),!E)return;const K=new CustomEvent("page-overlay",{detail:{itemId:E}});window.dispatchEvent(K)}return()=>{g.current&&O.current&&(g.current.removeEventListener("animationend",O.current),O.current=null),W(!1)}},[e,E]),s.useEffect(()=>{T.current!==null&&T.current!==A.type&&S(K=>K+1),T.current=A.type},[A.type]),s.useEffect(()=>{if(!e)return;const K=document.body.style.overflow,Z=window.matchMedia("(max-width: 768px)").matches,se=Sl(re.color);document.body.style.overflow="hidden",W(!1);const Se=$e=>{$e.target===g.current&&!F.current&&$e.animationName&&(Z&&!l&&se>.9&&(document.body.style.backgroundColor=re.color),W(!0),g.current&&P.current&&g.current.removeEventListener("animationend",P.current),P.current=null)};g.current&&(P.current=Se,g.current.addEventListener("animationend",Se));const Me=$e=>{const G=$e.target;G&&(G.closest(`.${Qe.thumbsWrapper}`)||G.closest(`.${Qe.thumbsContainer}`))||A.type!=="slide"&&$e.preventDefault()};return document.addEventListener("touchmove",Me,{passive:!1}),()=>{document.body.style.overflow=K,document.removeEventListener("touchmove",Me),g.current&&P.current&&(g.current.removeEventListener("animationend",P.current),P.current=null),W(!1)}},[e,l,re.color,A.type]),s.useEffect(()=>{if(!e)return;const K=Z=>{var Se,Me;if(F.current){Z.stopPropagation();return}if(te.current){te.current=!1;return}const se=Z.target;if(!(se&&(se.closest(`.${Qe.thumbsContainer}`)||se.closest(`.${Qe.thumbItem}`)||se.closest(`.${Qe.arrow}`)||se.closest(`.${Qe.closeButton}`)||se.closest(`.${Qe.caption}`)))){if(A.type==="slide"&&ae.type==="drag"&&((Me=(Se=$.current)==null?void 0:Se.splide)!=null&&Me.root)){const $e=$.current.splide.root;if(se&&($e.contains(se)||$e===se))return}if(Z.touches.length===0&&Z.changedTouches.length>0){const $e=n[v],G=($e==null?void 0:$e.image.objectFit)==="cover",pe=Z.changedTouches[0];let oe;if(G&&k.current){const Y=wl(k.current);oe=pe.clientX>=Y.left&&pe.clientX<=Y.right&&pe.clientY>=Y.top&&pe.clientY<=Y.bottom}else{const Y=k.current?Or(k.current):null;if(!Y)return;oe=pe.clientX>=Y.x&&pe.clientX<=Y.x+Y.width&&pe.clientY>=Y.y&&pe.clientY<=Y.y+Y.height}if(!oe){Z.stopPropagation(),F.current=!0;const Y=le=>{le.stopPropagation(),le.preventDefault(),document.removeEventListener("click",Y,!0)};document.addEventListener("click",Y,!0),j()}}}};return document.addEventListener("touchend",K,{passive:!0}),()=>{document.removeEventListener("touchend",K)}},[e,j,v,n]);const ie=(A.type==="scale"||A.type==="fade")&&A.direction==="vert"&&ae.type==="drag";s.useEffect(()=>{var le,_e;if(!e||!ie||!((_e=(le=$.current)==null?void 0:le.splide)!=null&&_e.root))return;const K=$.current.splide.root,Z=30,se=(me,J)=>{if(X.current){const Ke=Math.abs(me-X.current.x),ke=Math.abs(J-X.current.y);(Ke>0||ke>0)&&(te.current=!0)}},Se=me=>{X.current&&(me.preventDefault(),se(me.clientX,me.clientY))},Me=me=>{X.current&&me.touches.length>0&&(me.preventDefault(),se(me.touches[0].clientX,me.touches[0].clientY))},$e=(me,J)=>{if(!X.current||!$.current){X.current=null;return}const Ke=Math.abs(me-X.current.x),ke=Math.abs(J-X.current.y);ke>Z&&ke>Ke&&$.current.go(J<X.current.y?"+1":"-1"),X.current=null},G=me=>{X.current&&$e(me.clientX,me.clientY),document.removeEventListener("pointerup",G),document.removeEventListener("pointercancel",G),document.removeEventListener("pointermove",Se)},pe=me=>{if(X.current){if(me.changedTouches.length>0){const J=me.changedTouches[0];$e(J.clientX,J.clientY)}document.removeEventListener("touchend",pe),document.removeEventListener("touchcancel",pe),document.removeEventListener("touchmove",Me)}},oe=me=>{X.current={x:me.clientX,y:me.clientY},te.current=!1,document.addEventListener("pointermove",Se,{passive:!1}),document.addEventListener("pointerup",G),document.addEventListener("pointercancel",G)},Y=me=>{me.touches.length>0&&(X.current={x:me.touches[0].clientX,y:me.touches[0].clientY},te.current=!1,document.addEventListener("touchmove",Me,{passive:!1}),document.addEventListener("touchend",pe),document.addEventListener("touchcancel",pe))};return K.addEventListener("pointerdown",oe),K.addEventListener("touchstart",Y),()=>{K.removeEventListener("pointerdown",oe),K.removeEventListener("touchstart",Y),document.removeEventListener("pointermove",Se),document.removeEventListener("pointerup",G),document.removeEventListener("pointercancel",G),document.removeEventListener("touchmove",Me),document.removeEventListener("touchend",pe),document.removeEventListener("touchcancel",pe),X.current=null,te.current=!1}},[e,ie,y]);const ue={backgroundColor:re.color,backdropFilter:`blur(${re.blur}px)`,animationDuration:`${parseInt(de.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(Qe.background,V?b:ye,{[Qe.editor]:l},{[Qe.hidden]:!e}),style:{...ue,...q&&!l&&!V?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?g:null,className:pt(Qe.contentStyle,V?M:Fe,{[Qe.editor]:l},{[Qe.hidden]:!e}),style:{animationDuration:`${parseInt(de.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(zs,{onMove:K=>C(K.index),ref:$,className:Qe.lightboxSplide,options:{arrows:!1,speed:A.duration?parseInt(A.duration):500,direction:A.direction==="horiz"||A.type==="fade"||A.type==="scale"?"ltr":"ttb",pagination:!1,drag:ae.type==="drag"&&!ie,perPage:1,width:"100%",height:"100%",type:A.type==="fade"||A.type==="scale"?"fade":"loop",padding:0,rewind:ae.repeat!=="close",start:0},style:{"--splide-speed":A.duration},children:n.map((K,Z)=>{const se=lr(xe.position,xe.offset,l),Se=`${D.scalingValue(xe.padding.top,l)} ${D.scalingValue(xe.padding.right,l)} ${D.scalingValue(xe.padding.bottom,l)} ${D.scalingValue(xe.padding.left,l)}`,Me=A.type==="scale"?(()=>{const{transform:$e,...G}=se;return{...G,position:"absolute",padding:Se,boxSizing:"border-box","--position-transform":$e||"none"}})():{...se,position:"absolute",padding:Se,boxSizing:"border-box"};return a.jsx(js,{children:a.jsx("div",{className:Qe.imgWrapper,onClick:Q,children:a.jsx("img",{ref:Z===v?k:null,className:pt(Qe.imageStyle,{[Qe.contain]:K.image.objectFit==="contain",[Qe.cover]:K.image.objectFit==="cover",[Qe.scaleSlide]:A.type==="scale"}),src:K.image.url,alt:K.image.name??"",style:{...Me,pointerEvents:K.image.objectFit==="contain"?"none":"auto"}})})},Z)})},y),z.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(Qe.arrow,{[Qe.arrowVertical]:A.direction==="vert"}),style:{color:z.color,"--arrow-hover-color":z.hover},children:a.jsxs("button",{className:Qe.arrowInner,style:{transform:`translate(${D.scalingValue(z.offset.x,l)}, ${D.scalingValue(z.offset.y*(A.direction==="horiz"?1:-1),l)}) scale(${z.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var K;return(K=$.current)==null?void 0:K.go("-1")},"aria-label":"Previous",children:[z.arrowsImgUrl&&a.jsx(sn,{url:z.arrowsImgUrl,fill:z.color,hoverFill:z.hover,className:pt(Qe.arrowImg,Qe.mirror)}),!z.arrowsImgUrl&&a.jsx(Cl,{color:z.color,className:pt(Qe.arrowIcon,Qe.arrowImg,Qe.mirror)})]})}),a.jsx("div",{className:pt(Qe.arrow,Qe.nextArrow,{[Qe.arrowVertical]:A.direction==="vert"}),style:{color:z.color,"--arrow-hover-color":z.hover},children:a.jsxs("button",{className:Qe.arrowInner,style:{transform:`translate(${D.scalingValue(z.offset.x*(A.direction==="horiz"?-1:1),l)}, ${D.scalingValue(z.offset.y,l)}) scale(${z.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var K;return(K=$.current)==null?void 0:K.go("+1")},"aria-label":"Next",children:[z.arrowsImgUrl&&a.jsx(sn,{url:z.arrowsImgUrl,fill:z.color,hoverFill:z.hover,className:Qe.arrowImg}),!z.arrowsImgUrl&&a.jsx(Cl,{color:z.color,className:pt(Qe.arrowIcon,Qe.arrowImg)})]})})]}),re.closeIconUrl&&(()=>{const K=lr(re.closeIconAlign,re.closeIconOffset,l),Z=`scale(${re.closeIconScale})`,se=K.transform?`${K.transform} ${Z}`:Z;return a.jsx("button",{className:Qe.closeButton,style:{...K,transform:se},onClick:j,"aria-label":"Close lightbox",children:a.jsx(sn,{url:re.closeIconUrl,fill:re.closeIconColor??"#000000",hoverFill:re.closeIconHover??"#cccccc"})})})(),ee&&ee.isActive&&i.imageCaption&&((fe=n[v])==null?void 0:fe.imageCaption)&&a.jsx("div",{className:Qe.caption,style:{...lr(ee.alignment,ee.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:K=>K.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Qe.captionTextInner,style:{"--link-color":ee.linkColor,"--link-hover-color":ee.linkHoverColor},children:a.jsx(Ri,{content:n[v].imageCaption})})}),ce.isActive&&(()=>{const[K,Z]=ce.position.split("-"),se=A.direction==="horiz"?`${K}-left`:ce.position,Se=lr(se,ce.offset,l),Me=()=>{if(A.direction==="horiz"){if(Z==="left")return"flex-start";if(Z==="center")return"center";if(Z==="right")return"flex-end"}else{if(K==="top")return"flex-start";if(K==="middle")return"center";if(K==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:L,className:Qe.thumbsWrapper,onClick:$e=>Te($e),style:{position:l?"absolute":"fixed",...Se,...A.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:pt(Qe.thumbsContainer,{[Qe.thumbsContainerVertical]:A.direction==="vert",[Qe.thumbsAlignStart]:ce.align==="start",[Qe.thumbsAlignCenter]:ce.align==="center",[Qe.thumbsAlignEnd]:ce.align==="end"}),style:{gap:D.scalingValue(ce.grid.gap,l),justifyContent:H?"flex-start":Me()},children:n.map(($e,G)=>{const pe=G===v,oe=I[G],le=ce.grid.size*(pe?ce.activeState.scale:1),_e=()=>{if(ce.fit!=="fit")return{};if(!oe)return A.direction==="horiz"?{height:D.scalingValue(le,l)}:{width:D.scalingValue(le,l)};const me=oe.width/oe.height;if(A.direction==="horiz"){const J=le,Ke=J*me;return{width:D.scalingValue(Ke,l),height:D.scalingValue(J,l)}}else{const J=le,Ke=J/me;return{width:D.scalingValue(J,l),height:D.scalingValue(Ke,l)}}};return a.jsx("button",{className:Qe.thumbItem,style:{...A.direction==="horiz"&&ce.fit!=="fit"?{height:D.scalingValue(le,l)}:{},...A.direction==="vert"&&ce.fit!=="fit"?{width:D.scalingValue(le,l)}:{},...ce.fit==="cover"?{width:D.scalingValue(le,l),height:D.scalingValue(le,l)}:{},..._e(),transition:pe?"all 0.25s ease-out":"none",opacity:pe?ce.activeState.opacity/100:ce.opacity/100,"--thumb-hover":ce.activeState.opacity/100},onClick:me=>{var J;me.stopPropagation(),C(G),(J=$.current)==null||J.go(G)},onMouseEnter:()=>{var me;ce.triggers==="hov"&&((me=$.current)==null||me.go(G))},children:a.jsx("img",{src:$e.image.url,alt:$e.image.name??"",onLoad:me=>{const J=me.currentTarget;J.naturalWidth&&J.naturalHeight&&B(Ke=>({...Ke,[G]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:ce.fit==="cover"?"cover":"contain",...ce.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ce.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${$e.image.name}-${G}`)})})})})()]})]}),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 kg={element:Eg,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 Ag(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 Fg({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:b,gap:m,fieldsGap:h,buttonCorners:f,buttonStroke:v,buttonPadding:C,isButtonFullWidth:y,inputCorners:S,inputStroke:V,inputPadding:N,inputColor:q,inputTextColor:W,inputBorderColor:I,placeholderColor:B,buttonColor:$,buttonTextColor:T,buttonBorderColor:k,labelTextColor:A,successColor:g,errorColor:O,fontFamily:P,inputFontSettings:X,inputFontSize:ne,inputLineHeight:L,inputLetterSpacing:H,inputWordSpacing:U,inputTextAppearance:de,buttonFontSettings:ae,buttonFontSize:F,buttonLineHeight:ce,buttonLetterSpacing:z,buttonWordSpacing:re,buttonTextAppearance:te,labelFontSettings:ye,labelFontSize:Fe,labelLineHeight:fe,labelLetterSpacing:w,labelWordSpacing:M,labelTextAppearance:E,statusFontSettings:j,statusFontSize:Te,statusLineHeight:ee,statusLetterSpacing:$e,statusWordSpacing:J,statusTextAppearance:me,successMessage:Se,errorMessage:K,stateOverrides:Z}=e,se=u==="B",we=x.slice(0,Math.min(p,x.length)),Me={fontSettings:{fontFamily:P,fontWeight:(X==null?void 0:X.fontWeight)??400,fontStyle:(X==null?void 0:X.fontStyle)??"normal"},fontSize:ne??.01,lineHeight:L,letterSpacing:H??0,wordSpacing:U??0,textAppearance:de,color:W},Ce=an(Ut(Me,t)),G=D.scalingValue(V??0,t),ue=D.scalingValue((L??ne??.01)+((N==null?void 0:N.top)??0)+((N==null?void 0:N.bottom)??0)+(u==="C"?V??0:(V??0)*2),t),oe={...Ce,borderStyle:"solid",borderRadius:u==="C"?0:D.scalingValue(S??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:G,borderLeftWidth:0}:{borderWidth:G},paddingTop:D.scalingValue((N==null?void 0:N.top)??0,t),paddingRight:D.scalingValue((N==null?void 0:N.right)??0,t),paddingBottom:D.scalingValue((N==null?void 0:N.bottom)??0,t),paddingLeft:D.scalingValue((N==null?void 0:N.left)??0,t),height:ue,minHeight:ue},Y={fontSettings:{fontFamily:P,fontWeight:(ae==null?void 0:ae.fontWeight)??400,fontStyle:(ae==null?void 0:ae.fontStyle)??"normal"},fontSize:F??.01,lineHeight:ce,letterSpacing:z??0,wordSpacing:re??0,textAppearance:te,color:T},le=an(Ut(Y,t)),_e=D.scalingValue(v??0,t),pe={fontSettings:{fontFamily:P,fontWeight:(ye==null?void 0:ye.fontWeight)??400,fontStyle:(ye==null?void 0:ye.fontStyle)??"normal"},fontSize:Fe??.01,lineHeight:fe,letterSpacing:w??0,wordSpacing:M??0,textAppearance:E,color:A},Q=Ut(pe,t),Ke={fontSettings:{fontFamily:P,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:Te??.01,lineHeight:ee,letterSpacing:$e??0,wordSpacing:J??0,textAppearance:me,color:g},ke=an(Ut(Ke,t)),tt=D.buildColorVars(c,{inputColor:q,inputTextColor:W,inputBorderColor:I,placeholderColor:B!=null&&B.trim()?B:"#cccccc",buttonColor:$,buttonTextColor:T,buttonBorderColor:k,labelTextColor:A,successColor:g,errorColor:O},_g,Ng,Z),[Ye,dt]=s.useState(()=>Object.fromEntries(we.map(Le=>[Le.name,""]))),[ot,Ve]=s.useState("idle"),[Re,He]=s.useState(null),Be=r==="success"?"success":r==="error"?"error":ot,Ze=r==="error"?K:Re,he=r==="filled",xe=s.useMemo(()=>{if(!he)return Ye;let Le=null;for(const Ge of we)(Ye[Ge.name]??"").trim().length>0||(Le=Le??{...Ye},Le[Ge.name]="Filled");return Le??Ye},[Ye,he,we]),We=Be==="error"?D.getFormFieldValidationError(we,xe):null,ve=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),Ie=o==null?void 0:o.submitUrl,qe=(Le,Ge)=>{dt(De=>({...De,[Le]:Ge}))},ze=async Le=>{if(Le.preventDefault(),!d)return;const Ge=Object.fromEntries(we.map(nt=>{var it;return[nt.name,((it=Ye[nt.name])==null?void 0:it.trim())??""]}).filter(([,nt])=>nt));if(!Ie){Ve("error"),He("No integrations were found for this form.");return}if(Object.keys(Ge).length===0)return;const De=D.getFormFieldValidationError(we,Ye);if(De){Ve("error"),He(De);return}Ve("submitting"),He(null);try{const nt=await fetch(Ie,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ge)});if(!nt.ok){const it=await nt.text();throw new Error(it||`Request failed: ${nt.status}`)}Ve("success"),dt(Object.fromEntries(we.map(it=>[it.name,""])))}catch(nt){Ve("error"),He(nt instanceof Error?nt.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${ve}`.trim(),style:tt,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ag(c)}}),a.jsxs("form",{onSubmit:ze,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:we.map((Le,Ge)=>a.jsxs(s.Fragment,{children:[Ge>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${se?` ${c}-labeled`:""}`,children:[se&&a.jsx("span",{className:`${c}-field-label`,style:Q?{...Q,lineHeight:Q.fontSize}:void 0,children:Le.label||Le.name}),Le.type==="textarea"?a.jsx("textarea",{name:Le.name,autoComplete:"off",value:xe[Le.name]??"",onChange:De=>qe(Le.name,De.target.value),placeholder:Le.placeholder,className:`${c}-input`,style:oe,rows:1,"data-filled":he||(xe[Le.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:Le.type==="phone"?"tel":Le.type==="email"?"email":"text",name:Le.name,autoComplete:"off",value:xe[Le.name]??"",onChange:De=>qe(Le.name,De.target.value),placeholder:Le.placeholder,required:Le.isRequired??Le.type==="email",className:`${c}-input`,style:oe,"data-filled":he||(xe[Le.name]??"").trim().length>0})]})]},Ge))}),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:_e,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,...le,...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:ot==="submitting"?"...":b})})})]}),Be==="success"&&a.jsx("p",{className:`${c}-success`,style:{...ke},children:Se}),Be==="error"&&a.jsx("p",{className:`${c}-error`,style:{...ke},role:"alert",children:We??Ze??K})]})}const _g={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"},Ng=["hover","focus","filled","success","error"],Wg=`import React, { useMemo, useState } from 'react';
158
+ `}function Fg({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:V,inputPadding:N,inputColor:q,inputTextColor:W,inputBorderColor:I,placeholderColor:B,buttonColor:$,buttonTextColor:T,buttonBorderColor:k,labelTextColor:F,successColor:g,errorColor:O,fontFamily:P,inputFontSettings:X,inputFontSize:te,inputLineHeight:L,inputLetterSpacing:H,inputWordSpacing:U,inputTextAppearance:de,buttonFontSettings:ae,buttonFontSize:A,buttonLineHeight:ce,buttonLetterSpacing:z,buttonWordSpacing:re,buttonTextAppearance:ee,labelFontSettings:xe,labelFontSize:Fe,labelLineHeight:ye,labelLetterSpacing:b,labelWordSpacing:M,labelTextAppearance:E,statusFontSettings:j,statusFontSize:Ce,statusLineHeight:Q,statusLetterSpacing:Te,statusWordSpacing:ie,statusTextAppearance:ue,successMessage:fe,errorMessage:K,stateOverrides:Z}=e,se=u==="B",Se=x.slice(0,Math.min(p,x.length)),Me={fontSettings:{fontFamily:P,fontWeight:(X==null?void 0:X.fontWeight)??400,fontStyle:(X==null?void 0:X.fontStyle)??"normal"},fontSize:te??.01,lineHeight:L,letterSpacing:H??0,wordSpacing:U??0,textAppearance:de,color:W},$e=an(Ut(Me,t)),G=D.scalingValue(V??0,t),pe=D.scalingValue((L??te??.01)+((N==null?void 0:N.top)??0)+((N==null?void 0:N.bottom)??0)+(u==="C"?V??0:(V??0)*2),t),oe={...$e,borderStyle:"solid",borderRadius:u==="C"?0:D.scalingValue(S??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:G,borderLeftWidth:0}:{borderWidth:G},paddingTop:D.scalingValue((N==null?void 0:N.top)??0,t),paddingRight:D.scalingValue((N==null?void 0:N.right)??0,t),paddingBottom:D.scalingValue((N==null?void 0:N.bottom)??0,t),paddingLeft:D.scalingValue((N==null?void 0:N.left)??0,t),height:pe,minHeight:pe},Y={fontSettings:{fontFamily:P,fontWeight:(ae==null?void 0:ae.fontWeight)??400,fontStyle:(ae==null?void 0:ae.fontStyle)??"normal"},fontSize:A??.01,lineHeight:ce,letterSpacing:z??0,wordSpacing:re??0,textAppearance:ee,color:T},le=an(Ut(Y,t)),_e=D.scalingValue(v??0,t),me={fontSettings:{fontFamily:P,fontWeight:(xe==null?void 0:xe.fontWeight)??400,fontStyle:(xe==null?void 0:xe.fontStyle)??"normal"},fontSize:Fe??.01,lineHeight:ye,letterSpacing:b??0,wordSpacing:M??0,textAppearance:E,color:F},J=Ut(me,t),Ke={fontSettings:{fontFamily:P,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:Ce??.01,lineHeight:Q,letterSpacing:Te??0,wordSpacing:ie??0,textAppearance:ue,color:g},ke=an(Ut(Ke,t)),tt=D.buildColorVars(c,{inputColor:q,inputTextColor:W,inputBorderColor:I,placeholderColor:B!=null&&B.trim()?B:"#cccccc",buttonColor:$,buttonTextColor:T,buttonBorderColor:k,labelTextColor:F,successColor:g,errorColor:O},_g,Ng,Z),[Ye,dt]=s.useState(()=>Object.fromEntries(Se.map(Le=>[Le.name,""]))),[ot,Ve]=s.useState("idle"),[Re,He]=s.useState(null),Be=r==="success"?"success":r==="error"?"error":ot,Ze=r==="error"?K:Re,he=r==="filled",ve=s.useMemo(()=>{if(!he)return Ye;let Le=null;for(const Ge of Se)(Ye[Ge.name]??"").trim().length>0||(Le=Le??{...Ye},Le[Ge.name]="Filled");return Le??Ye},[Ye,he,Se]),We=Be==="error"?D.getFormFieldValidationError(Se,ve):null,be=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),Ie=o==null?void 0:o.submitUrl,qe=(Le,Ge)=>{dt(De=>({...De,[Le]:Ge}))},ze=async Le=>{if(Le.preventDefault(),!d)return;const Ge=Object.fromEntries(Se.map(nt=>{var it;return[nt.name,((it=Ye[nt.name])==null?void 0:it.trim())??""]}).filter(([,nt])=>nt));if(!Ie){Ve("error"),He("No integrations were found for this form.");return}if(Object.keys(Ge).length===0)return;const De=D.getFormFieldValidationError(Se,Ye);if(De){Ve("error"),He(De);return}Ve("submitting"),He(null);try{const nt=await fetch(Ie,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ge)});if(!nt.ok){const it=await nt.text();throw new Error(it||`Request failed: ${nt.status}`)}Ve("success"),dt(Object.fromEntries(Se.map(it=>[it.name,""])))}catch(nt){Ve("error"),He(nt instanceof Error?nt.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${be}`.trim(),style:tt,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ag(c)}}),a.jsxs("form",{onSubmit:ze,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:Se.map((Le,Ge)=>a.jsxs(s.Fragment,{children:[Ge>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${se?` ${c}-labeled`:""}`,children:[se&&a.jsx("span",{className:`${c}-field-label`,style:J?{...J,lineHeight:J.fontSize}:void 0,children:Le.label||Le.name}),Le.type==="textarea"?a.jsx("textarea",{name:Le.name,autoComplete:"off",value:ve[Le.name]??"",onChange:De=>qe(Le.name,De.target.value),placeholder:Le.placeholder,className:`${c}-input`,style:oe,rows:1,"data-filled":he||(ve[Le.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:Le.type==="phone"?"tel":Le.type==="email"?"email":"text",name:Le.name,autoComplete:"off",value:ve[Le.name]??"",onChange:De=>qe(Le.name,De.target.value),placeholder:Le.placeholder,required:Le.isRequired??Le.type==="email",className:`${c}-input`,style:oe,"data-filled":he||(ve[Le.name]??"").trim().length>0})]})]},Ge))}),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:_e,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,...le,...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:ot==="submitting"?"...":w})})})]}),Be==="success"&&a.jsx("p",{className:`${c}-success`,style:{...ke},children:fe}),Be==="error"&&a.jsx("p",{className:`${c}-error`,style:{...ke},role:"alert",children:We??Ze??K})]})}const _g={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"},Ng=["hover","focus","filled","success","error"],Wg=`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 jg=({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:b,inputFontSize:m,inputLineHeight:h,inputLetterSpacing:f,inputWordSpacing:v,inputTextAppearance:C,buttonFontSettings:y,buttonFontSize:S,buttonLineHeight:V,buttonLetterSpacing:N,buttonWordSpacing:q,buttonTextAppearance:W,statusFontSettings:I,statusFontSize:B,statusLineHeight:$,statusLetterSpacing:T,statusWordSpacing:k,statusTextAppearance:A,iconMaxWidth:g,minHeight:O,corners:P,stroke:X,stateOverrides:ne,inputPadding:L,buttonPadding:H,successMessage:U="Thanks for subscribing!",errorMessage:de="Please, fill all required fields."}=e,ae=d.slice(0,Math.min(p,d.length)),[F,ce]=s.useState(()=>Object.fromEntries(ae.map(pe=>[pe.name,""]))),[z,re]=s.useState("idle"),[te,ye]=s.useState(null),Fe=o==="success"?"success":o==="error"?"error":z,fe=o==="error"?de:te,w=o==="filled",M=s.useMemo(()=>{if(!w)return F;let pe=null;for(const Q of ae)(F[Q.name]??"").trim().length>0||(pe=pe??{...F},pe[Q.name]="Filled");return pe??F},[w,F,ae]),E=Fe==="error"?D.getFormFieldValidationError(ae,M):null,j=o&&o!=="default"?`${r}-state-${o}`:"",Te=ae.some(pe=>(M[pe.name]??"").trim().length>0),ee=j!==`${r}-state-filled`&&Te?`${r}-state-filled`:"",$e=`${j} ${ee}`.trim(),J=i==null?void 0:i.submitUrl,me=u??"",Se=(c==null?void 0:c.icon)??"",K=(c==null?void 0:c.mode)==="On",Z=me||"Submit",se={fontSettings:{fontFamily:x,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.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:V,letterSpacing:N??0,wordSpacing:q??0,textAppearance:W,color:e.buttonTextColor??"#ffffff"},Me={fontSettings:{fontFamily:x,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:B??.01,lineHeight:$,letterSpacing:T??0,wordSpacing:k??0,textAppearance:A,color:e.successColor??"#22c55e"},Ce=an(Ut(se,t)),G=an(Ut(we,t)),ue=an(Ut(Me,t)),oe=D.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(se==null?void 0:se.color)??"#111111",buttonTextColor:e.buttonTextColor??(we==null?void 0:we.color)??"#ffffff"},Vg,Gg,ne),Y={borderRadius:D.scalingValue(P,t),borderWidth:D.scalingValue(X,t),borderStyle:"solid"},le={borderLeftWidth:D.scalingValue(X,t)},_e=async pe=>{if(pe.preventDefault(),!l)return;const Q=Object.fromEntries(ae.map(ke=>{var tt;return[ke.name,((tt=F[ke.name])==null?void 0:tt.trim())??""]}).filter(([,ke])=>ke));if(!J){re("error"),ye("No integrations were found for this form.");return}if(Object.keys(Q).length===0)return;const Ke=D.getFormFieldValidationError(ae,F);if(Ke){re("error"),ye(Ke);return}re("submitting"),ye(null);try{const ke=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)});if(!ke.ok){const tt=await ke.text();throw new Error(tt||`Request failed: ${ke.status}`)}re("success"),ce(Object.fromEntries(ae.map(tt=>[tt.name,""])))}catch(ke){re("error"),ye(ke instanceof Error?ke.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${$e}`.trim(),style:oe,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:zg(r)}}),a.jsxs("form",{onSubmit:_e,className:`${r}-form`,style:{...Y,height:D.scalingValue(O,t),minHeight:D.scalingValue(O,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:ae.map(pe=>a.jsx("input",{type:pe.type==="email"?"email":pe.type==="phone"?"tel":"text",name:pe.name,autoComplete:"off",value:M[pe.name]??"",onChange:Q=>ce(Ke=>({...Ke,[pe.name]:Q.target.value})),placeholder:pe.placeholder,required:pe.isRequired??pe.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)}},pe.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":Z,style:{...G,...le,paddingRight:D.scalingValue(H.right,t),paddingLeft:D.scalingValue(H.left,t),paddingTop:D.scalingValue(H.top,t),paddingBottom:D.scalingValue(H.bottom,t),pointerEvents:l?"auto":void 0},children:z==="submitting"?"...":K?Se&&a.jsx(sn,{url:Se,className:`${r}-submitBtnIcon`,style:{maxWidth:D.scalingValue(g??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):me})})]}),Fe==="success"&&a.jsx("p",{className:`${r}-success`,style:{...ue},children:U}),Fe==="error"&&a.jsx("p",{className:`${r}-error`,style:{...ue},role:"alert",children:E??fe??de})]})},Vg={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"},Gg=["hover","focus","filled","success","error"],Xg=`import React, { useMemo, useState } from 'react';
985
+ `}const jg=({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:V,buttonLetterSpacing:N,buttonWordSpacing:q,buttonTextAppearance:W,statusFontSettings:I,statusFontSize:B,statusLineHeight:$,statusLetterSpacing:T,statusWordSpacing:k,statusTextAppearance:F,iconMaxWidth:g,minHeight:O,corners:P,stroke:X,stateOverrides:te,inputPadding:L,buttonPadding:H,successMessage:U="Thanks for subscribing!",errorMessage:de="Please, fill all required fields."}=e,ae=d.slice(0,Math.min(p,d.length)),[A,ce]=s.useState(()=>Object.fromEntries(ae.map(me=>[me.name,""]))),[z,re]=s.useState("idle"),[ee,xe]=s.useState(null),Fe=o==="success"?"success":o==="error"?"error":z,ye=o==="error"?de:ee,b=o==="filled",M=s.useMemo(()=>{if(!b)return A;let me=null;for(const J of ae)(A[J.name]??"").trim().length>0||(me=me??{...A},me[J.name]="Filled");return me??A},[b,A,ae]),E=Fe==="error"?D.getFormFieldValidationError(ae,M):null,j=o&&o!=="default"?`${r}-state-${o}`:"",Ce=ae.some(me=>(M[me.name]??"").trim().length>0),Q=j!==`${r}-state-filled`&&Ce?`${r}-state-filled`:"",Te=`${j} ${Q}`.trim(),ie=i==null?void 0:i.submitUrl,ue=u??"",fe=(c==null?void 0:c.icon)??"",K=(c==null?void 0:c.mode)==="On",Z=ue||"Submit",se={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"},Se={fontSettings:{fontFamily:x,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:S??.01,lineHeight:V,letterSpacing:N??0,wordSpacing:q??0,textAppearance:W,color:e.buttonTextColor??"#ffffff"},Me={fontSettings:{fontFamily:x,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:B??.01,lineHeight:$,letterSpacing:T??0,wordSpacing:k??0,textAppearance:F,color:e.successColor??"#22c55e"},$e=an(Ut(se,t)),G=an(Ut(Se,t)),pe=an(Ut(Me,t)),oe=D.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(se==null?void 0:se.color)??"#111111",buttonTextColor:e.buttonTextColor??(Se==null?void 0:Se.color)??"#ffffff"},Vg,Gg,te),Y={borderRadius:D.scalingValue(P,t),borderWidth:D.scalingValue(X,t),borderStyle:"solid"},le={borderLeftWidth:D.scalingValue(X,t)},_e=async me=>{if(me.preventDefault(),!l)return;const J=Object.fromEntries(ae.map(ke=>{var tt;return[ke.name,((tt=A[ke.name])==null?void 0:tt.trim())??""]}).filter(([,ke])=>ke));if(!ie){re("error"),xe("No integrations were found for this form.");return}if(Object.keys(J).length===0)return;const Ke=D.getFormFieldValidationError(ae,A);if(Ke){re("error"),xe(Ke);return}re("submitting"),xe(null);try{const ke=await fetch(ie,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!ke.ok){const tt=await ke.text();throw new Error(tt||`Request failed: ${ke.status}`)}re("success"),ce(Object.fromEntries(ae.map(tt=>[tt.name,""])))}catch(ke){re("error"),xe(ke instanceof Error?ke.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${Te}`.trim(),style:oe,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:zg(r)}}),a.jsxs("form",{onSubmit:_e,className:`${r}-form`,style:{...Y,height:D.scalingValue(O,t),minHeight:D.scalingValue(O,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:ae.map(me=>a.jsx("input",{type:me.type==="email"?"email":me.type==="phone"?"tel":"text",name:me.name,autoComplete:"off",value:M[me.name]??"",onChange:J=>ce(Ke=>({...Ke,[me.name]:J.target.value})),placeholder:me.placeholder,required:me.isRequired??me.type==="email",className:`${r}-input`,style:{...$e,paddingRight:D.scalingValue(L.right,t),paddingLeft:D.scalingValue(L.left,t),paddingTop:D.scalingValue(L.top,t),paddingBottom:D.scalingValue(L.bottom,t)}},me.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":Z,style:{...G,...le,paddingRight:D.scalingValue(H.right,t),paddingLeft:D.scalingValue(H.left,t),paddingTop:D.scalingValue(H.top,t),paddingBottom:D.scalingValue(H.bottom,t),pointerEvents:l?"auto":void 0},children:z==="submitting"?"...":K?fe&&a.jsx(sn,{url:fe,className:`${r}-submitBtnIcon`,style:{maxWidth:D.scalingValue(g??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):ue})})]}),Fe==="success"&&a.jsx("p",{className:`${r}-success`,style:{...pe},children:U}),Fe==="error"&&a.jsx("p",{className:`${r}-error`,style:{...pe},role:"alert",children:E??ye??de})]})},Vg={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"},Gg=["hover","focus","filled","success","error"],Xg=`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 Qg=30,eh=20,Sa=3,th=12,nh=32,ih=3,oh=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).flat(),ah=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},Rd=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=Rd(d);return c<=0?0:c+r*Math.max(0,t-1)},sh=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Rd(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},lh=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},ch=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>lh(i,e))},dh=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??"")},uh=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,ph=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var k,A,g,O;const p=s.useRef(null),x=!!((k=e.image)!=null&&k.url&&dh(e.image));s.useLayoutEffect(()=>{d&&uh(p.current)&&(u==null||u())},[d,(A=e.image)==null?void 0:A.url,u]);const b=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),V=i/S,N=V>o?o:V,q=V>o?o*S:i,W=c(q),I=c(N),B={borderRadius:c(r)},$=b?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...B}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...B},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:((O=e.image)==null?void 0:O.name)??"",style:$,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...b?{width:W}:{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,...b?{width:W,height:I,overflow:"hidden",...B}:{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`,!b&&`${t}-marquee-link-contain`),children:T}):T})})},mh=({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(()=>Jg(r,c),[r,c]),{speed:p,direction:x,pauseOnHover:b,gap:m,imageMaxWidth:h,imageMaxHeight:f,hoverEffect:v,cornerRadius:C=0}=e,y=s.useMemo(()=>ah(e.imageFit),[e.imageFit]),S=(t==null?void 0:t.length)??0,V=!!o,N=!n||!!i,q=N&&v!=="off"&&v!=="randomize"?`${r}-image-hover-${v}`:void 0,W=n?!!i:!0,B=((t==null?void 0:t.length)??0)>0&&(W||!!n),$=Math.max(0,p)*Qg,T=ee=>D.scalingValue(ee,n??!1),k=s.useRef(null),A=s.useRef(null),g=s.useRef(null),[O,P]=s.useState(0),X=W&&b==="on",[ne,L]=s.useState(!1),[H,U]=s.useState({}),de=s.useRef(H);de.current=H;const ae=s.useRef(null),F=s.useRef(0),ce=s.useRef(null),z=s.useMemo(()=>(t??[]).map(ee=>{var $e;return(($e=ee.image)==null?void 0:$e.url)??""}).join("\0"),[t]),[re,te]=s.useState(Sa),ye=s.useMemo(()=>{const ee=t??[];return ee.length===0||!(W||!!n)?ee:rh(ee,re)},[t,W,re,n]),Fe=s.useMemo(()=>(t??[]).filter(ee=>{var $e;return!!(($e=ee.image)!=null&&$e.url)}).length,[t]),fe=B?ih:1;s.useLayoutEffect(()=>{F.current=0,U({}),ae.current=null,te(Sa),d(0)},[z]),s.useEffect(()=>{if(!N||v!=="randomize")return;const ee=k.current;if(!ee)return;const $e=K=>{U(Z=>{const se=Array.from(K).filter(Me=>Me in Z&&!ch(ee,Me));if(se.length===0)return Z;const we={...Z};return se.forEach(Me=>{delete we[Me]}),we})},J=new IntersectionObserver(K=>{const Z=new Set;for(const se of K){const we=se.target.dataset.marqueeItemIndex,Me=we!==void 0?Number(we):NaN;Number.isNaN(Me)||Z.add(Me)}Z.size>0&&$e(Z)},{root:ee,threshold:0});Object.keys(H).forEach(K=>{const Z=Number(K);ee.querySelectorAll(`[data-marquee-item-index="${Z}"]`).forEach(se=>J.observe(se))});const me={current:0},Se=()=>{const K=Object.keys(de.current);K.length!==0&&($e(K.map(Number)),me.current=requestAnimationFrame(Se))};return Object.keys(de.current).length>0&&(me.current=requestAnimationFrame(Se)),()=>{cancelAnimationFrame(me.current),J.disconnect()}},[v,H,N]),s.useLayoutEffect(()=>{if(!B)return;const ee=k.current,$e=g.current;if(!ee||!$e)return;const J={current:0},me=()=>{const Z=ee.getBoundingClientRect().width||ee.offsetWidth,se=sh($e),we=ae.current,Me=typeof we=="number"&&Math.abs(we-se)<=.25;ae.current=se;let Ce=re,G=0;if((W||n)&&S>0&&Z>0){const Y=$l($e,S);if(Y>=nh){G=Y;const le=Math.min(th,Math.max(Sa,Math.ceil(Z/Y)+1));Ce=le,le!==re&&te(le)}}const oe=Ce!==re&&G>0?G*Ce:se>0?se:G>0?G*Ce:(()=>{const Y=$l($e,S);return Y>0?Y*Ce:0})();oe>0?d(Y=>Y<=0?oe:!Me||Math.round(Y)===Math.round(oe)?Y:oe):!Me&&l<=0&&(cancelAnimationFrame(J.current),J.current=requestAnimationFrame(me))},Se=()=>{cancelAnimationFrame(J.current),J.current=requestAnimationFrame(me)};ce.current=Se,Se();const K=new ResizeObserver(Se);return K.observe(ee),K.observe($e),()=>{ce.current=null,cancelAnimationFrame(J.current),K.disconnect()}},[W,B,l,z,re,S,n]),s.useLayoutEffect(()=>{if(!B||c<=0)return;const ee=A.current;ee&&oh(ee)},[B,c,x,$]),s.useLayoutEffect(()=>{if(!B||l<=0){P(0);return}const ee=A.current,$e=g.current;if(!ee||!$e)return;const J=()=>{const Se=ee.offsetHeight||ee.getBoundingClientRect().height,K=Array.from($e.children).reduce((se,we)=>Math.max(se,we.offsetHeight||we.getBoundingClientRect().height),0),Z=Se>0?Se:K;P(Z>0?Z:0)};J();const me=new ResizeObserver(J);return me.observe(ee),me.observe($e),()=>me.disconnect()},[B,fe,ye,n,m,h,f,l,y,H]),s.useLayoutEffect(()=>{if(!n||!V||!B||typeof window>"u")return;const ee=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(ee)},[n,V,B,x,l,O,m,ye]);const w=()=>{X&&L(!0)},M=()=>{X&&L(!1)},E=s.useCallback(()=>{var ee;F.current=Math.min(Fe,F.current+1),(ee=ce.current)==null||ee.call(ce)},[Fe]),j=s.useCallback((ee,$e)=>{U(J=>{const me=J[ee]??$e,Se=(t??[]).filter(Z=>Z!==me);if(Se.length===0)return J;const K=Se[Math.floor(Math.random()*Se.length)];return{...J,[ee]:K}})},[t]),Te=(ee,$e,J,me)=>{const Se=N&&v==="randomize"&&y.display==="cover"?H[J]??ee:ee,K=`max(${T(m)}, ${eh}px)`,Z=`calc(-0.5 * (${K} + ${T(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":J,onMouseEnter:N&&v==="randomize"&&y.display==="cover"?()=>j(J,ee):void 0,children:[a.jsx(ph,{item:Se,prefix:r,imageFit:y,imageMaxWidth:h,imageMaxHeight:f,cornerRadius:C,imageHoverClass:q,isEditor:n,isFirstSet:me,scaled:T,onFirstSetImageDone:E}),V&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:Z,width:K,height:"100%"}})]},`${$e}-${J}`)};if(B){const ee=W?X&&ne?"paused":"running":"paused",$e=c>0&&$>0?c/$*1e3:0,J=`${Math.max(0,$e)/1e3}s`;return a.jsxs("div",{ref:k,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:O>0?{height:O}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:A,className:`${r}-marquee-track`,"data-direction":x,onMouseEnter:w,onMouseLeave:M,style:{WebkitAnimationDuration:J,animationDuration:J,WebkitAnimationPlayState:ee,animationPlayState:ee},children:Array.from({length:fe},(me,Se)=>a.jsx("div",{ref:Se===0?g:void 0,className:pt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:T(m),paddingRight:T(m)},"aria-hidden":Se>0,children:ye.map((K,Z)=>Te(K,Se,Z,Se===0&&Z<S))},`set-${Se}`))})]})}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((ee,$e)=>Te(ee,0,$e))},"marquee-static")]})},gh=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1696
+ `}const Qg=30,eh=20,Sa=3,th=12,nh=32,ih=3,oh=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).flat(),ah=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},Rd=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=Rd(d);return c<=0?0:c+r*Math.max(0,t-1)},sh=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Rd(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},lh=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},ch=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>lh(i,e))},dh=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??"")},uh=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,ph=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var k,F,g,O;const p=s.useRef(null),x=!!((k=e.image)!=null&&k.url&&dh(e.image));s.useLayoutEffect(()=>{d&&uh(p.current)&&(u==null||u())},[d,(F=e.image)==null?void 0:F.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),V=i/S,N=V>o?o:V,q=V>o?o*S:i,W=c(q),I=c(N),B={borderRadius:c(r)},$=w?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...B}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...B},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:((O=e.image)==null?void 0:O.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:W}:{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:W,height:I,overflow:"hidden",...B}:{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})})},mh=({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(()=>Jg(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(()=>ah(e.imageFit),[e.imageFit]),S=(t==null?void 0:t.length)??0,V=!!o,N=!n||!!i,q=N&&v!=="off"&&v!=="randomize"?`${r}-image-hover-${v}`:void 0,W=n?!!i:!0,B=((t==null?void 0:t.length)??0)>0&&(W||!!n),$=Math.max(0,p)*Qg,T=Q=>D.scalingValue(Q,n??!1),k=s.useRef(null),F=s.useRef(null),g=s.useRef(null),[O,P]=s.useState(0),X=W&&w==="on",[te,L]=s.useState(!1),[H,U]=s.useState({}),de=s.useRef(H);de.current=H;const ae=s.useRef(null),A=s.useRef(0),ce=s.useRef(null),z=s.useMemo(()=>(t??[]).map(Q=>{var Te;return((Te=Q.image)==null?void 0:Te.url)??""}).join("\0"),[t]),[re,ee]=s.useState(Sa),xe=s.useMemo(()=>{const Q=t??[];return Q.length===0||!(W||!!n)?Q:rh(Q,re)},[t,W,re,n]),Fe=s.useMemo(()=>(t??[]).filter(Q=>{var Te;return!!((Te=Q.image)!=null&&Te.url)}).length,[t]),ye=B?ih:1;s.useLayoutEffect(()=>{A.current=0,U({}),ae.current=null,ee(Sa),d(0)},[z]),s.useEffect(()=>{if(!N||v!=="randomize")return;const Q=k.current;if(!Q)return;const Te=K=>{U(Z=>{const se=Array.from(K).filter(Me=>Me in Z&&!ch(Q,Me));if(se.length===0)return Z;const Se={...Z};return se.forEach(Me=>{delete Se[Me]}),Se})},ie=new IntersectionObserver(K=>{const Z=new Set;for(const se of K){const Se=se.target.dataset.marqueeItemIndex,Me=Se!==void 0?Number(Se):NaN;Number.isNaN(Me)||Z.add(Me)}Z.size>0&&Te(Z)},{root:Q,threshold:0});Object.keys(H).forEach(K=>{const Z=Number(K);Q.querySelectorAll(`[data-marquee-item-index="${Z}"]`).forEach(se=>ie.observe(se))});const ue={current:0},fe=()=>{const K=Object.keys(de.current);K.length!==0&&(Te(K.map(Number)),ue.current=requestAnimationFrame(fe))};return Object.keys(de.current).length>0&&(ue.current=requestAnimationFrame(fe)),()=>{cancelAnimationFrame(ue.current),ie.disconnect()}},[v,H,N]),s.useLayoutEffect(()=>{if(!B)return;const Q=k.current,Te=g.current;if(!Q||!Te)return;const ie={current:0},ue=()=>{const Z=Q.getBoundingClientRect().width||Q.offsetWidth,se=sh(Te),Se=ae.current,Me=typeof Se=="number"&&Math.abs(Se-se)<=.25;ae.current=se;let $e=re,G=0;if((W||n)&&S>0&&Z>0){const Y=$l(Te,S);if(Y>=nh){G=Y;const le=Math.min(th,Math.max(Sa,Math.ceil(Z/Y)+1));$e=le,le!==re&&ee(le)}}const oe=$e!==re&&G>0?G*$e:se>0?se:G>0?G*$e:(()=>{const Y=$l(Te,S);return Y>0?Y*$e:0})();oe>0?d(Y=>Y<=0?oe:!Me||Math.round(Y)===Math.round(oe)?Y:oe):!Me&&l<=0&&(cancelAnimationFrame(ie.current),ie.current=requestAnimationFrame(ue))},fe=()=>{cancelAnimationFrame(ie.current),ie.current=requestAnimationFrame(ue)};ce.current=fe,fe();const K=new ResizeObserver(fe);return K.observe(Q),K.observe(Te),()=>{ce.current=null,cancelAnimationFrame(ie.current),K.disconnect()}},[W,B,l,z,re,S,n]),s.useLayoutEffect(()=>{if(!B||c<=0)return;const Q=F.current;Q&&oh(Q)},[B,c,x,$]),s.useLayoutEffect(()=>{if(!B||l<=0){P(0);return}const Q=F.current,Te=g.current;if(!Q||!Te)return;const ie=()=>{const fe=Q.offsetHeight||Q.getBoundingClientRect().height,K=Array.from(Te.children).reduce((se,Se)=>Math.max(se,Se.offsetHeight||Se.getBoundingClientRect().height),0),Z=fe>0?fe:K;P(Z>0?Z:0)};ie();const ue=new ResizeObserver(ie);return ue.observe(Q),ue.observe(Te),()=>ue.disconnect()},[B,ye,xe,n,m,h,f,l,y,H]),s.useLayoutEffect(()=>{if(!n||!V||!B||typeof window>"u")return;const Q=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(Q)},[n,V,B,x,l,O,m,xe]);const b=()=>{X&&L(!0)},M=()=>{X&&L(!1)},E=s.useCallback(()=>{var Q;A.current=Math.min(Fe,A.current+1),(Q=ce.current)==null||Q.call(ce)},[Fe]),j=s.useCallback((Q,Te)=>{U(ie=>{const ue=ie[Q]??Te,fe=(t??[]).filter(Z=>Z!==ue);if(fe.length===0)return ie;const K=fe[Math.floor(Math.random()*fe.length)];return{...ie,[Q]:K}})},[t]),Ce=(Q,Te,ie,ue)=>{const fe=N&&v==="randomize"&&y.display==="cover"?H[ie]??Q:Q,K=`max(${T(m)}, ${eh}px)`,Z=`calc(-0.5 * (${K} + ${T(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":ie,onMouseEnter:N&&v==="randomize"&&y.display==="cover"?()=>j(ie,Q):void 0,children:[a.jsx(ph,{item:fe,prefix:r,imageFit:y,imageMaxWidth:h,imageMaxHeight:f,cornerRadius:C,imageHoverClass:q,isEditor:n,isFirstSet:ue,scaled:T,onFirstSetImageDone:E}),V&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:Z,width:K,height:"100%"}})]},`${Te}-${ie}`)};if(B){const Q=W?X&&te?"paused":"running":"paused",Te=c>0&&$>0?c/$*1e3:0,ie=`${Math.max(0,Te)/1e3}s`;return a.jsxs("div",{ref:k,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:O>0?{height:O}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:F,className:`${r}-marquee-track`,"data-direction":x,onMouseEnter:b,onMouseLeave:M,style:{WebkitAnimationDuration:ie,animationDuration:ie,WebkitAnimationPlayState:Q,animationPlayState:Q},children:Array.from({length:ye},(ue,fe)=>a.jsx("div",{ref:fe===0?g:void 0,className:pt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:T(m),paddingRight:T(m)},"aria-hidden":fe>0,children:xe.map((K,Z)=>Ce(K,fe,Z,fe===0&&Z<S))},`set-${fe}`))})]})}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((Q,Te)=>Ce(Q,0,Te))},"marquee-static")]})},gh=`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 xh=30,Ca=3,vh=12,bh=3,rs=.72,wh=100,Sh=10,Ch=e=>Math.max(0,e)/wh,$h=e=>Math.max(0,e)/Sh,Th=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")},Ih=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ki={ctx:void 0},Rh=()=>ki.ctx!==void 0?ki.ctx:typeof document>"u"?(ki.ctx=null,ki.ctx):(ki.ctx=document.createElement("canvas").getContext("2d"),ki.ctx),Lh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},Ph=e=>{e.style.transform=""},Eh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Mh=(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)},kh=96,Ah=(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,b=x+c;o[p+1]=b,r[p+1]=r[p]+(d(x)+d(b))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Fh=(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],b=x>0?(r-l[u])/x:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*b)},_h=(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 b=x/c*e,m=(x+1)/c*e,h=m-b,f=l(b),v=l(m),C=b+h/3,y=f+d(b)*h/3,S=m-h/3,V=v-d(m)*h/3;return`C${C.toFixed(2)} ${y.toFixed(2)} ${S.toFixed(2)} ${V.toFixed(2)} ${m.toFixed(2)} ${v.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},Nh=({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}),b=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:b}):b})},Wh=({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:b,curveAmplitude:m,curveFrequency:h,textFontFamily:f,textFontSettings:v,textFontSize:C,textLineHeight:y,textLetterSpacing:S,textWordSpacing:V,textTextAppearance:N,textColor:q,backgroundColor:W,ribbonWidth:I}=e,B=I??y,$=b==="curve",T=Ch(m),k=$h(h),A=s.useMemo(()=>yh(o,d,$),[o,d,$]),g=s.useMemo(()=>Ut({fontSettings:{fontFamily:f,fontWeight:v.fontWeight,fontStyle:v.fontStyle},letterSpacing:S,wordSpacing:V,fontSize:C,lineHeight:y,textAppearance:N,color:q},n),[f,v,S,V,C,y,N,q,n]),O=he=>D.scalingValue(he,n??!1),P=((t==null?void 0:t.length)??0)>0,X=n?!!i:!0,ne=P&&(X||!!n),L=Math.max(0,c)*xh,H=X&&p==="on",[U,de]=s.useState(!1),ae=X?H&&U?"paused":"running":"paused",F=ae==="running"&&L>0&&d>0,ce=s.useRef(null),z=s.useRef(null),re=s.useRef(null),te=s.useRef(null),ye=s.useRef(null),Fe=s.useRef(null),fe=s.useRef(F),w=s.useRef(null);fe.current=F;const[M,E]=s.useState(0),[j,Te]=s.useState(0),[ee,$e]=s.useState(0),[J,me]=s.useState(0),[Se,K]=s.useState(0),Z=s.useMemo(()=>(t??[]).map(he=>{var xe;return`${he.text}\0${((xe=he.image)==null?void 0:xe.url)??""}`}).join("\0"),[t]),[se,we]=s.useState(Ca),Me=s.useMemo(()=>{const he=t??[];return he.length===0||!(X||n)?he:Ih(he,se)},[t,X,se,n]),Ce=ne?bh:1;s.useLayoutEffect(()=>{we(Ca),l(0)},[Z]),s.useLayoutEffect(()=>{var ve;const he=Fe.current;if(!he)return;const xe=()=>{const Ie=getComputedStyle(he),qe=parseFloat(Ie.fontSize)||0;if(qe<=0)return;const ze=Rh();if(!ze){E(qe*rs),Te(0);return}ze.font=`${Ie.fontStyle} ${Ie.fontWeight} ${qe}px ${Ie.fontFamily}`;const Le=ze.measureText("H"),Ge=Le.actualBoundingBoxAscent>0?Le.actualBoundingBoxAscent:qe*rs,De=Math.max(0,Le.actualBoundingBoxDescent||0),nt=Le.fontBoundingBoxAscent||0,it=Le.fontBoundingBoxDescent||0;E(St=>Math.abs(St-Ge)>.5?Ge:St);const ct=nt>0||it>0?(it-De-(nt-Ge))/2:0;Te(St=>Math.abs(St-ct)>.25?ct:St)};xe();const We=typeof document<"u"?document.fonts:void 0;(ve=We==null?void 0:We.ready)==null||ve.then(xe).catch(()=>{});const Je=new ResizeObserver(xe);return Je.observe(he),()=>Je.disconnect()},[g.fontFamily,g.fontWeight,g.fontStyle,g.fontSize,g.lineHeight]),s.useLayoutEffect(()=>{if(!ne)return;const he=ce.current,xe=te.current;if(!he||!xe)return;const We={id:0},Je=()=>{const Ie=he.offsetWidth||he.getBoundingClientRect().width,qe=xe.offsetWidth||xe.getBoundingClientRect().width;if(P&&Ie>0&&qe>0){const ze=qe/se;if(ze>0){const Le=Math.min(vh,Math.max(Ca,Math.ceil(Ie/ze)+1));if(Le!==se){we(Le);return}}}qe>0&&l(qe)};We.id=requestAnimationFrame(Je);const ve=new ResizeObserver(()=>{cancelAnimationFrame(We.id),We.id=requestAnimationFrame(Je)});return ve.observe(he),ve.observe(xe),()=>{cancelAnimationFrame(We.id),ve.disconnect()}},[ne,Z,se,P,M]),s.useLayoutEffect(()=>{const he=ye.current;if(!he)return;const xe={id:0},We=()=>{const ve=he.offsetHeight;ve>0&&K(Ie=>Math.abs(Ie-ve)>.5?ve:Ie)};xe.id=requestAnimationFrame(We);const Je=new ResizeObserver(()=>{cancelAnimationFrame(xe.id),xe.id=requestAnimationFrame(We)});return Je.observe(he),()=>{cancelAnimationFrame(xe.id),Je.disconnect()}},[B,n]),s.useLayoutEffect(()=>{if(!$){$e(0),me(0);return}const he=ce.current,xe=te.current;if(!he||!xe)return;const We={id:0},Je=()=>{const Ie=he.offsetWidth,qe=xe.offsetHeight;Ie>0&&me(ze=>Math.abs(ze-Ie)>.5?Ie:ze),qe>0&&$e(ze=>Math.abs(ze-qe)>.5?qe:ze)};We.id=requestAnimationFrame(Je);const ve=new ResizeObserver(()=>{cancelAnimationFrame(We.id),We.id=requestAnimationFrame(Je)});return ve.observe(he),ve.observe(xe),()=>{cancelAnimationFrame(We.id),ve.disconnect()}},[$,Z,M,y,C,ne]),s.useLayoutEffect(()=>{if(!ne||d<=0)return;const he=re.current;he&&Th(he)},[ne,d,u,L]),s.useLayoutEffect(()=>{if(!$||!P)return;const he=ce.current;if(!he)return;const xe={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},We=()=>{for(const Le of xe.itemsCache)for(const Ge of Le.glyphs)Ph(Ge.inner)},Je=()=>{const Le=z.current??he;xe.itemsCache=Array.from(he.querySelectorAll("[data-marquee-text-item]"),Ge=>{const De=[];return Ge.querySelectorAll("[data-marquee-wave-node]").forEach(nt=>{const it=nt.firstElementChild;it&&De.push({inner:it,layoutLocalX:Mh(nt,Le)})}),{item:Ge,glyphs:De}}),xe.cacheDirty=!1},ve=()=>{xe.cacheDirty&&Je();const Ge=(z.current??he).offsetWidth||1,De=Ge*T,nt=2*Math.PI*k/Ge,it=`${Ge}|${De}|${nt}`;it!==xe.lutKey&&(xe.lutKey=it,xe.lut=Ah(De,nt,kh));const ct=re.current,St=ct?Eh(getComputedStyle(ct).transform):0,Bt=he.getBoundingClientRect(),zt=Bt.left,ft=Bt.right,wt=xe.lut&&xe.lut.wavelength>0?Math.max(0,(xe.lut.periodArc/xe.lut.wavelength-1)*Ge):0;for(const{item:jt,glyphs:At}of xe.itemsCache){const vt=jt.getBoundingClientRect();if(!(vt.right<zt||vt.left>ft+wt))for(const Ft of At){const Nt=Ft.layoutLocalX+St,Kt=xe.lut?Fh(xe.lut,Nt):Nt,Jt=nt*Kt,Tt=De*Math.sin(Jt),Wt=De*nt*Math.cos(Jt),rn=Math.atan(Wt)*(180/Math.PI);Lh(Ft.inner,Kt-Nt,Tt,rn)}}},Ie=()=>{xe.cancelled||(xe.raf=0,ve(),fe.current&&!document.hidden&&(xe.raf=requestAnimationFrame(Ie)))},qe=()=>{xe.cancelled||xe.raf||(xe.raf=requestAnimationFrame(Ie))};w.current=qe,qe();const ze=()=>{if(document.hidden){cancelAnimationFrame(xe.raf),xe.raf=0;return}qe()};return document.addEventListener("visibilitychange",ze),()=>{xe.cancelled=!0,w.current=null,cancelAnimationFrame(xe.raf),document.removeEventListener("visibilitychange",ze),We()}},[$,T,k,P,r,Z,se,M]),s.useLayoutEffect(()=>{var he;(he=w.current)==null||he.call(w)},[F]);const G=()=>{H&&de(!0)},ue=()=>{H&&de(!1)},oe=$?T*100:0,Y=O(B),le={minHeight:Y,...$?{paddingTop:`${oe}%`,paddingBottom:`${oe}%`}:{}},_e={height:Y,...$?{visibility:"hidden"}:{backgroundColor:W}},pe={gap:O(x),minHeight:Y},Q=J*T,Ke=Se>0?Se:ee,ke=Math.max(ee,Ke),tt=$&&J>0&&ke>0?_h(J,Q,k,Q+ke/2):"",Ye=Q*2+ke,dt=tt?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${J} ${Ye}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:tt,fill:"none",stroke:W,strokeWidth:Ke,strokeLinecap:"round",strokeLinejoin:"round"})}):null,ot=a.jsx("div",{ref:ye,className:`${o}-ribbon`,style:_e,"aria-hidden":!0}),Ve=(he,xe,We)=>a.jsx(Nh,{item:he,prefix:o,textCss:g,capHeightPx:M,opticalOffsetY:j,imageGapPx:O(x),isCurve:$},`${xe}-${We}`),Re=a.jsx("span",{ref:Fe,"aria-hidden":!0,className:`${o}-cap-ref`,style:g,children:"H"}),He=d>0&&L>0?d/L*1e3:0,Be=`${Math.max(0,He)/1e3}s`,Ze=ne?a.jsx("div",{ref:re,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:G,onMouseLeave:ue,style:{WebkitAnimationDuration:Be,animationDuration:Be,WebkitAnimationPlayState:ae,animationPlayState:ae},children:Array.from({length:Ce},(he,xe)=>a.jsx("div",{ref:xe===0?te:void 0,className:`${o}-marquee-set`,style:{...pe,paddingRight:O(x)},"aria-hidden":xe>0,children:Me.map((We,Je)=>Ve(We,xe,Je))},`set-${xe}`))}):a.jsx("div",{ref:te,className:pt(`${o}-marquee-set`,`${o}-marquee-static`),style:pe,children:t==null?void 0:t.map((he,xe)=>Ve(he,0,xe))});return a.jsxs("div",{ref:ce,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:A}}),Re,a.jsxs("div",{ref:z,className:`${o}-marquee-wrapper`,style:le,children:[ot,dt,Ze]})]})},Hh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
2608
+ `}const xh=30,Ca=3,vh=12,bh=3,rs=.72,wh=100,Sh=10,Ch=e=>Math.max(0,e)/wh,$h=e=>Math.max(0,e)/Sh,Th=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")},Ih=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ki={ctx:void 0},Rh=()=>ki.ctx!==void 0?ki.ctx:typeof document>"u"?(ki.ctx=null,ki.ctx):(ki.ctx=document.createElement("canvas").getContext("2d"),ki.ctx),Lh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},Ph=e=>{e.style.transform=""},Eh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Mh=(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)},kh=96,Ah=(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}},Fh=(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)},_h=(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,V=v-d(m)*h/3;return`C${C.toFixed(2)} ${y.toFixed(2)} ${S.toFixed(2)} ${V.toFixed(2)} ${m.toFixed(2)} ${v.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},Nh=({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})},Wh=({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:V,textTextAppearance:N,textColor:q,backgroundColor:W,ribbonWidth:I}=e,B=I??y,$=w==="curve",T=Ch(m),k=$h(h),F=s.useMemo(()=>yh(o,d,$),[o,d,$]),g=s.useMemo(()=>Ut({fontSettings:{fontFamily:f,fontWeight:v.fontWeight,fontStyle:v.fontStyle},letterSpacing:S,wordSpacing:V,fontSize:C,lineHeight:y,textAppearance:N,color:q},n),[f,v,S,V,C,y,N,q,n]),O=he=>D.scalingValue(he,n??!1),P=((t==null?void 0:t.length)??0)>0,X=n?!!i:!0,te=P&&(X||!!n),L=Math.max(0,c)*xh,H=X&&p==="on",[U,de]=s.useState(!1),ae=X?H&&U?"paused":"running":"paused",A=ae==="running"&&L>0&&d>0,ce=s.useRef(null),z=s.useRef(null),re=s.useRef(null),ee=s.useRef(null),xe=s.useRef(null),Fe=s.useRef(null),ye=s.useRef(A),b=s.useRef(null);ye.current=A;const[M,E]=s.useState(0),[j,Ce]=s.useState(0),[Q,Te]=s.useState(0),[ie,ue]=s.useState(0),[fe,K]=s.useState(0),Z=s.useMemo(()=>(t??[]).map(he=>{var ve;return`${he.text}\0${((ve=he.image)==null?void 0:ve.url)??""}`}).join("\0"),[t]),[se,Se]=s.useState(Ca),Me=s.useMemo(()=>{const he=t??[];return he.length===0||!(X||n)?he:Ih(he,se)},[t,X,se,n]),$e=te?bh:1;s.useLayoutEffect(()=>{Se(Ca),l(0)},[Z]),s.useLayoutEffect(()=>{var be;const he=Fe.current;if(!he)return;const ve=()=>{const Ie=getComputedStyle(he),qe=parseFloat(Ie.fontSize)||0;if(qe<=0)return;const ze=Rh();if(!ze){E(qe*rs),Ce(0);return}ze.font=`${Ie.fontStyle} ${Ie.fontWeight} ${qe}px ${Ie.fontFamily}`;const Le=ze.measureText("H"),Ge=Le.actualBoundingBoxAscent>0?Le.actualBoundingBoxAscent:qe*rs,De=Math.max(0,Le.actualBoundingBoxDescent||0),nt=Le.fontBoundingBoxAscent||0,it=Le.fontBoundingBoxDescent||0;E(St=>Math.abs(St-Ge)>.5?Ge:St);const ct=nt>0||it>0?(it-De-(nt-Ge))/2:0;Ce(St=>Math.abs(St-ct)>.25?ct:St)};ve();const We=typeof document<"u"?document.fonts:void 0;(be=We==null?void 0:We.ready)==null||be.then(ve).catch(()=>{});const Je=new ResizeObserver(ve);return Je.observe(he),()=>Je.disconnect()},[g.fontFamily,g.fontWeight,g.fontStyle,g.fontSize,g.lineHeight]),s.useLayoutEffect(()=>{if(!te)return;const he=ce.current,ve=ee.current;if(!he||!ve)return;const We={id:0},Je=()=>{const Ie=he.offsetWidth||he.getBoundingClientRect().width,qe=ve.offsetWidth||ve.getBoundingClientRect().width;if(P&&Ie>0&&qe>0){const ze=qe/se;if(ze>0){const Le=Math.min(vh,Math.max(Ca,Math.ceil(Ie/ze)+1));if(Le!==se){Se(Le);return}}}qe>0&&l(qe)};We.id=requestAnimationFrame(Je);const be=new ResizeObserver(()=>{cancelAnimationFrame(We.id),We.id=requestAnimationFrame(Je)});return be.observe(he),be.observe(ve),()=>{cancelAnimationFrame(We.id),be.disconnect()}},[te,Z,se,P,M]),s.useLayoutEffect(()=>{const he=xe.current;if(!he)return;const ve={id:0},We=()=>{const be=he.offsetHeight;be>0&&K(Ie=>Math.abs(Ie-be)>.5?be:Ie)};ve.id=requestAnimationFrame(We);const Je=new ResizeObserver(()=>{cancelAnimationFrame(ve.id),ve.id=requestAnimationFrame(We)});return Je.observe(he),()=>{cancelAnimationFrame(ve.id),Je.disconnect()}},[B,n]),s.useLayoutEffect(()=>{if(!$){Te(0),ue(0);return}const he=ce.current,ve=ee.current;if(!he||!ve)return;const We={id:0},Je=()=>{const Ie=he.offsetWidth,qe=ve.offsetHeight;Ie>0&&ue(ze=>Math.abs(ze-Ie)>.5?Ie:ze),qe>0&&Te(ze=>Math.abs(ze-qe)>.5?qe:ze)};We.id=requestAnimationFrame(Je);const be=new ResizeObserver(()=>{cancelAnimationFrame(We.id),We.id=requestAnimationFrame(Je)});return be.observe(he),be.observe(ve),()=>{cancelAnimationFrame(We.id),be.disconnect()}},[$,Z,M,y,C,te]),s.useLayoutEffect(()=>{if(!te||d<=0)return;const he=re.current;he&&Th(he)},[te,d,u,L]),s.useLayoutEffect(()=>{if(!$||!P)return;const he=ce.current;if(!he)return;const ve={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},We=()=>{for(const Le of ve.itemsCache)for(const Ge of Le.glyphs)Ph(Ge.inner)},Je=()=>{const Le=z.current??he;ve.itemsCache=Array.from(he.querySelectorAll("[data-marquee-text-item]"),Ge=>{const De=[];return Ge.querySelectorAll("[data-marquee-wave-node]").forEach(nt=>{const it=nt.firstElementChild;it&&De.push({inner:it,layoutLocalX:Mh(nt,Le)})}),{item:Ge,glyphs:De}}),ve.cacheDirty=!1},be=()=>{ve.cacheDirty&&Je();const Ge=(z.current??he).offsetWidth||1,De=Ge*T,nt=2*Math.PI*k/Ge,it=`${Ge}|${De}|${nt}`;it!==ve.lutKey&&(ve.lutKey=it,ve.lut=Ah(De,nt,kh));const ct=re.current,St=ct?Eh(getComputedStyle(ct).transform):0,Bt=he.getBoundingClientRect(),zt=Bt.left,ft=Bt.right,wt=ve.lut&&ve.lut.wavelength>0?Math.max(0,(ve.lut.periodArc/ve.lut.wavelength-1)*Ge):0;for(const{item:jt,glyphs:At}of ve.itemsCache){const vt=jt.getBoundingClientRect();if(!(vt.right<zt||vt.left>ft+wt))for(const Ft of At){const Nt=Ft.layoutLocalX+St,Kt=ve.lut?Fh(ve.lut,Nt):Nt,Jt=nt*Kt,Tt=De*Math.sin(Jt),Wt=De*nt*Math.cos(Jt),rn=Math.atan(Wt)*(180/Math.PI);Lh(Ft.inner,Kt-Nt,Tt,rn)}}},Ie=()=>{ve.cancelled||(ve.raf=0,be(),ye.current&&!document.hidden&&(ve.raf=requestAnimationFrame(Ie)))},qe=()=>{ve.cancelled||ve.raf||(ve.raf=requestAnimationFrame(Ie))};b.current=qe,qe();const ze=()=>{if(document.hidden){cancelAnimationFrame(ve.raf),ve.raf=0;return}qe()};return document.addEventListener("visibilitychange",ze),()=>{ve.cancelled=!0,b.current=null,cancelAnimationFrame(ve.raf),document.removeEventListener("visibilitychange",ze),We()}},[$,T,k,P,r,Z,se,M]),s.useLayoutEffect(()=>{var he;(he=b.current)==null||he.call(b)},[A]);const G=()=>{H&&de(!0)},pe=()=>{H&&de(!1)},oe=$?T*100:0,Y=O(B),le={minHeight:Y,...$?{paddingTop:`${oe}%`,paddingBottom:`${oe}%`}:{}},_e={height:Y,...$?{visibility:"hidden"}:{backgroundColor:W}},me={gap:O(x),minHeight:Y},J=ie*T,Ke=fe>0?fe:Q,ke=Math.max(Q,Ke),tt=$&&ie>0&&ke>0?_h(ie,J,k,J+ke/2):"",Ye=J*2+ke,dt=tt?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${ie} ${Ye}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:tt,fill:"none",stroke:W,strokeWidth:Ke,strokeLinecap:"round",strokeLinejoin:"round"})}):null,ot=a.jsx("div",{ref:xe,className:`${o}-ribbon`,style:_e,"aria-hidden":!0}),Ve=(he,ve,We)=>a.jsx(Nh,{item:he,prefix:o,textCss:g,capHeightPx:M,opticalOffsetY:j,imageGapPx:O(x),isCurve:$},`${ve}-${We}`),Re=a.jsx("span",{ref:Fe,"aria-hidden":!0,className:`${o}-cap-ref`,style:g,children:"H"}),He=d>0&&L>0?d/L*1e3:0,Be=`${Math.max(0,He)/1e3}s`,Ze=te?a.jsx("div",{ref:re,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:G,onMouseLeave:pe,style:{WebkitAnimationDuration:Be,animationDuration:Be,WebkitAnimationPlayState:ae,animationPlayState:ae},children:Array.from({length:$e},(he,ve)=>a.jsx("div",{ref:ve===0?ee:void 0,className:`${o}-marquee-set`,style:{...me,paddingRight:O(x)},"aria-hidden":ve>0,children:Me.map((We,Je)=>Ve(We,ve,Je))},`set-${ve}`))}):a.jsx("div",{ref:ee,className:pt(`${o}-marquee-set`,`${o}-marquee-static`),style:me,children:t==null?void 0:t.map((he,ve)=>Ve(he,0,ve))});return a.jsxs("div",{ref:ce,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:F}}),Re,a.jsxs("div",{ref:z,className:`${o}-marquee-wrapper`,style:le,children:[ot,dt,Ze]})]})},Hh=`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 jh=30,Tl=2,Vh=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")},Gh=({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:b,stroke:m,strokeColor:h,bgColor:f,padding:v,logoMarginTop:C,logoWidth:y,logoHeight:S,captionMarginTop:V}=e,N=!!o,q=((t==null?void 0:t.length)??0)>0,W=d>0&&(!n||i),I=q&&(W||n),B=Math.max(0,d)*jh,$=G=>D.scalingValue(G,n??!1),T=s.useRef(null),k=s.useRef(null),A=s.useRef(null),[g,O]=s.useState(0),[P,X]=s.useState(0),ne=P>0?P:0,L=s.useMemo(()=>zh(r,ne),[r,ne]),[H,U]=s.useState(0),de=W&&u==="on",[ae,F]=s.useState(!1),ce=s.useRef(null),[z,re]=s.useState(0),[te,ye]=s.useState(0),Fe=s.useRef(null),fe=G=>{var oe,Y,le,_e,pe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${G}FontFamily`])??"Arial",fontWeight:((oe=e==null?void 0:e[`${G}FontSettings`])==null?void 0:oe.fontWeight)??400,fontStyle:((Y=e==null?void 0:e[`${G}FontSettings`])==null?void 0:Y.fontStyle)??"normal"},textAppearance:{textTransform:((le=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:le.textTransform)??"none",textDecoration:((_e=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:_e.textDecoration)??"none",fontVariant:((pe=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:pe.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${G}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${G}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${G}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${G}LineHeight`])??.01,color:(e==null?void 0:e[`${G}Color`])??"#000000"}},w=fe("text"),M=fe("caption"),E=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(G=>{var ue,oe;return(((ue=G.text)==null?void 0:ue.length)??0)>0||(((oe=G.caption)==null?void 0:oe.length)??0)>0}),[t]),j=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 G=T.current,ue=A.current;if(!G||!ue)return;let oe=0;const Y=()=>{const pe=G.getBoundingClientRect().width,Q=ue.getBoundingClientRect().width,Ke=Fe.current,ke=typeof Ke=="number"&&Math.abs(Ke-Q)<=.25;if(Fe.current=Q,O(pe),typeof Q=="number"&&Q>0&&P<=0){X(Q);return}ke&&Q!==P?X(Q):!ke&&P<=0&&(cancelAnimationFrame(oe),oe=requestAnimationFrame(Y))},le=()=>{cancelAnimationFrame(oe),oe=requestAnimationFrame(Y)};le();const _e=new ResizeObserver(le);return _e.observe(G),_e.observe(ue),()=>{cancelAnimationFrame(oe),_e.disconnect()}},[W,I,P]);const Te=ne>0&&B>0?ne/B*1e3:0,ee=`${Math.max(0,Te)/1e3}s`;s.useLayoutEffect(()=>{if(!I||ne<=0)return;const G=k.current;G&&Vh(G)},[I,ne,c]),s.useLayoutEffect(()=>{if(!I){U(0);return}const G=A.current,ue=k.current;if(!G||!ue)return;const oe=()=>{let le=0;for(let _e=0;_e<G.children.length;_e++){const Q=G.children[_e].firstElementChild;Q&&(le=Math.max(le,Q.offsetHeight))}le<=0&&(le=ue.offsetHeight),U(le>0?le:0)};oe();const Y=new ResizeObserver(oe);return Y.observe(G),Y.observe(ue),()=>{Y.disconnect()}},[I,j,t,n,p,x,v,m,b,y,S,z,te]);const $e=()=>{de&&F(!0)},J=()=>{de&&F(!1)},me=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),Se=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),K=s.useCallback((G,ue,oe,Y)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:me,width:"100%"},children:[a.jsx("div",{"data-controls":N?Y==null?void 0:Y.controlsName:void 0,"data-controls-axis":N?"y":void 0,className:N?`${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:{...Ut(G,n),textAlign:Se,pointerEvents:"auto",...typeof(Y==null?void 0:Y.minHeightPx)=="number"&&Y.minHeightPx>0?{minHeight:Y.minHeightPx}:{}},children:a.jsx(Ri,{content:ue})})]},oe),[me,Se,n,N,r,$]),Z=s.useCallback((G,ue,oe)=>{var Y,le,_e;return a.jsxs("div",{style:{padding:`${$(v.top)} ${$(v.right)} ${$(v.bottom)} ${$(v.left)}`,width:$(x+m*2),height:"100%",borderRadius:$(b),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:me,textAlign:Se},children:[G.text&&K(w,G.text,"text",oe!=null&&oe.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(oe==null?void 0:oe.textMinHeightPx)=="number"&&oe.textMinHeightPx>0?{minHeightPx:oe.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:me,width:"100%"},children:[a.jsx("div",{"data-controls":N&&!(oe!=null&&oe.dataMeasureAttrs)?"logoMarginTop":void 0,className:N&&!(oe!=null&&oe.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:$(C)}}),a.jsx("div",{style:{width:$(y),height:$(S)},children:((Y=G.logo)==null?void 0:Y.url)&&a.jsx("img",{src:G.logo.url,alt:((le=G.logo)==null?void 0:le.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((_e=G.logo)==null?void 0:_e.objectFit)||"contain"}})})]}),G.caption&&K(M,G.caption,"caption",{...oe!=null&&oe.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:V,...oe!=null&&oe.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(oe==null?void 0:oe.captionMinHeightPx)=="number"&&oe.captionMinHeightPx>0?{minHeightPx:oe.captionMinHeightPx}:{}})]})]},ue)},[f,V,M,x,b,S,C,y,me,Se,v.bottom,v.left,v.right,v.top,K,m,h,w,n,N,r]),se=s.useCallback(G=>{re(G.maxTextPx),ye(G.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!E){se({maxTextPx:0,maxCaptionPx:0});return}const G=ce.current;if(!G)return;const ue=()=>{D.readTestimonialTextMeasure(G,se)};ue();const oe=new ResizeObserver(ue);return oe.observe(G),()=>{oe.disconnect()}},[E,se,t,Z]);const we=E?{textMinHeightPx:z,captionMinHeightPx:te}:void 0,Me=E?a.jsx("div",{ref:ce,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((G,ue)=>Z(G,`measure-${ue}`,{dataMeasureAttrs:!0}))}):null,Ce=(G,ue)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Z(G,`card-${ue}`,we),N&&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}})]},ue);if(I){const G=W?de&&ae?"paused":"running":"paused";return a.jsxs("div",{ref:T,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...H>0?{height:H}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),Me,a.jsx("div",{ref:k,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:$e,onMouseLeave:J,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:ee,WebkitAnimationDuration:ee,animationPlayState:G,WebkitAnimationPlayState:G},children:Array.from({length:j},(ue,oe)=>a.jsx("div",{ref:oe===0?A:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:$(p),paddingRight:$(p)},"aria-hidden":oe>0,children:t==null?void 0:t.map((Y,le)=>Ce(Y,`${oe}-${le}`))},`set-${oe}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),Me,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((G,ue)=>Ce(G,ue))})]})},Xh=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
3538
+ `}const jh=30,Tl=2,Vh=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")},Gh=({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:V}=e,N=!!o,q=((t==null?void 0:t.length)??0)>0,W=d>0&&(!n||i),I=q&&(W||n),B=Math.max(0,d)*jh,$=G=>D.scalingValue(G,n??!1),T=s.useRef(null),k=s.useRef(null),F=s.useRef(null),[g,O]=s.useState(0),[P,X]=s.useState(0),te=P>0?P:0,L=s.useMemo(()=>zh(r,te),[r,te]),[H,U]=s.useState(0),de=W&&u==="on",[ae,A]=s.useState(!1),ce=s.useRef(null),[z,re]=s.useState(0),[ee,xe]=s.useState(0),Fe=s.useRef(null),ye=G=>{var oe,Y,le,_e,me;return{fontSettings:{fontFamily:(e==null?void 0:e[`${G}FontFamily`])??"Arial",fontWeight:((oe=e==null?void 0:e[`${G}FontSettings`])==null?void 0:oe.fontWeight)??400,fontStyle:((Y=e==null?void 0:e[`${G}FontSettings`])==null?void 0:Y.fontStyle)??"normal"},textAppearance:{textTransform:((le=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:le.textTransform)??"none",textDecoration:((_e=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:_e.textDecoration)??"none",fontVariant:((me=e==null?void 0:e[`${G}TextAppearance`])==null?void 0:me.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${G}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${G}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${G}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${G}LineHeight`])??.01,color:(e==null?void 0:e[`${G}Color`])??"#000000"}},b=ye("text"),M=ye("caption"),E=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(G=>{var pe,oe;return(((pe=G.text)==null?void 0:pe.length)??0)>0||(((oe=G.caption)==null?void 0:oe.length)??0)>0}),[t]),j=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 G=T.current,pe=F.current;if(!G||!pe)return;let oe=0;const Y=()=>{const me=G.getBoundingClientRect().width,J=pe.getBoundingClientRect().width,Ke=Fe.current,ke=typeof Ke=="number"&&Math.abs(Ke-J)<=.25;if(Fe.current=J,O(me),typeof J=="number"&&J>0&&P<=0){X(J);return}ke&&J!==P?X(J):!ke&&P<=0&&(cancelAnimationFrame(oe),oe=requestAnimationFrame(Y))},le=()=>{cancelAnimationFrame(oe),oe=requestAnimationFrame(Y)};le();const _e=new ResizeObserver(le);return _e.observe(G),_e.observe(pe),()=>{cancelAnimationFrame(oe),_e.disconnect()}},[W,I,P]);const Ce=te>0&&B>0?te/B*1e3:0,Q=`${Math.max(0,Ce)/1e3}s`;s.useLayoutEffect(()=>{if(!I||te<=0)return;const G=k.current;G&&Vh(G)},[I,te,c]),s.useLayoutEffect(()=>{if(!I){U(0);return}const G=F.current,pe=k.current;if(!G||!pe)return;const oe=()=>{let le=0;for(let _e=0;_e<G.children.length;_e++){const J=G.children[_e].firstElementChild;J&&(le=Math.max(le,J.offsetHeight))}le<=0&&(le=pe.offsetHeight),U(le>0?le:0)};oe();const Y=new ResizeObserver(oe);return Y.observe(G),Y.observe(pe),()=>{Y.disconnect()}},[I,j,t,n,p,x,v,m,w,y,S,z,ee]);const Te=()=>{de&&A(!0)},ie=()=>{de&&A(!1)},ue=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),fe=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),K=s.useCallback((G,pe,oe,Y)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ue,width:"100%"},children:[a.jsx("div",{"data-controls":N?Y==null?void 0:Y.controlsName:void 0,"data-controls-axis":N?"y":void 0,className:N?`${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:{...Ut(G,n),textAlign:fe,pointerEvents:"auto",...typeof(Y==null?void 0:Y.minHeightPx)=="number"&&Y.minHeightPx>0?{minHeight:Y.minHeightPx}:{}},children:a.jsx(Ri,{content:pe})})]},oe),[ue,fe,n,N,r,$]),Z=s.useCallback((G,pe,oe)=>{var Y,le,_e;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:ue,textAlign:fe},children:[G.text&&K(b,G.text,"text",oe!=null&&oe.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(oe==null?void 0:oe.textMinHeightPx)=="number"&&oe.textMinHeightPx>0?{minHeightPx:oe.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ue,width:"100%"},children:[a.jsx("div",{"data-controls":N&&!(oe!=null&&oe.dataMeasureAttrs)?"logoMarginTop":void 0,className:N&&!(oe!=null&&oe.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:$(C)}}),a.jsx("div",{style:{width:$(y),height:$(S)},children:((Y=G.logo)==null?void 0:Y.url)&&a.jsx("img",{src:G.logo.url,alt:((le=G.logo)==null?void 0:le.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((_e=G.logo)==null?void 0:_e.objectFit)||"contain"}})})]}),G.caption&&K(M,G.caption,"caption",{...oe!=null&&oe.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:V,...oe!=null&&oe.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(oe==null?void 0:oe.captionMinHeightPx)=="number"&&oe.captionMinHeightPx>0?{minHeightPx:oe.captionMinHeightPx}:{}})]})]},pe)},[f,V,M,x,w,S,C,y,ue,fe,v.bottom,v.left,v.right,v.top,K,m,h,b,n,N,r]),se=s.useCallback(G=>{re(G.maxTextPx),xe(G.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!E){se({maxTextPx:0,maxCaptionPx:0});return}const G=ce.current;if(!G)return;const pe=()=>{D.readTestimonialTextMeasure(G,se)};pe();const oe=new ResizeObserver(pe);return oe.observe(G),()=>{oe.disconnect()}},[E,se,t,Z]);const Se=E?{textMinHeightPx:z,captionMinHeightPx:ee}:void 0,Me=E?a.jsx("div",{ref:ce,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((G,pe)=>Z(G,`measure-${pe}`,{dataMeasureAttrs:!0}))}):null,$e=(G,pe)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Z(G,`card-${pe}`,Se),N&&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}})]},pe);if(I){const G=W?de&&ae?"paused":"running":"paused";return a.jsxs("div",{ref:T,className:pt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...H>0?{height:H}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),Me,a.jsx("div",{ref:k,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:Te,onMouseLeave:ie,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:Q,WebkitAnimationDuration:Q,animationPlayState:G,WebkitAnimationPlayState:G},children:Array.from({length:j},(pe,oe)=>a.jsx("div",{ref:oe===0?F:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:$(p),paddingRight:$(p)},"aria-hidden":oe>0,children:t==null?void 0:t.map((Y,le)=>$e(Y,`${oe}-${le}`))},`set-${oe}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:L}}),Me,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((G,pe)=>$e(G,pe))})]})},Xh=`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 Kh=3e3,Zh=({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:b,imageWidth:m,imageHeight:h,controlsWidth:f,controlsColor:v,controlsHoverColor:C}=e,y=d>0&&(!n||!!i),[S,V]=s.useState(0),[N,q]=s.useState(null),[W,I]=s.useState(!1),B=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(()=>{V(0),q(null),I(!1)},[l.length]);const k=l[S],A=N===null?null:l[N],g=fe=>{var M,E,j,Te,ee;return{fontSettings:{fontFamily:(e==null?void 0:e[`${fe}FontFamily`])??"Arial",fontWeight:((M=e==null?void 0:e[`${fe}FontSettings`])==null?void 0:M.fontWeight)??400,fontStyle:((E=e==null?void 0:e[`${fe}FontSettings`])==null?void 0:E.fontStyle)??"normal"},textAppearance:{textTransform:((j=e==null?void 0:e[`${fe}TextAppearance`])==null?void 0:j.textTransform)??"none",textDecoration:((Te=e==null?void 0:e[`${fe}TextAppearance`])==null?void 0:Te.textDecoration)??"none",fontVariant:((ee=e==null?void 0:e[`${fe}TextAppearance`])==null?void 0:ee.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${fe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${fe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${fe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${fe}WordSpacing`])??0,color:(e==null?void 0:e[`${fe}Color`])??"#000000"}},O=g("text"),P=g("caption"),X=l.length>1&&l.some(fe=>{var w,M;return(((w=fe.text)==null?void 0:w.length)??0)>0||(((M=fe.caption)==null?void 0:M.length)??0)>0}),ne=s.useRef(null),[L,H]=s.useState(0),[U,de]=s.useState(0),ae=e.controls??{mode:"Off",icon:null},F=l.length>1,ce=s.useCallback((fe,w)=>!F||w===fe?fe:(B.current&&window.clearTimeout(B.current),q(fe),I(!0),B.current=window.setTimeout(()=>{q(null),I(!1),B.current=null},300),w),[F]),z=s.useCallback(()=>{F&&V(fe=>ce(fe,(fe-1+l.length)%l.length))},[F,ce,l.length]),re=s.useCallback(()=>{F&&V(fe=>ce(fe,(fe+1)%l.length))},[F,ce,l.length]);s.useEffect(()=>{if(!y||!F)return;const fe=Math.max(300,Kh/d),w=window.setInterval(()=>{V(M=>ce(M,(M+1)%l.length))},fe);return()=>{window.clearInterval(w)}},[y,F,ce,l.length,d]),s.useEffect(()=>()=>{B.current&&window.clearTimeout(B.current)},[]);const te=(fe,w)=>{var ee,$e,J,me;const M=w==null?void 0:w.textMinHeightPx,E=w==null?void 0:w.captionMinHeightPx,j=w==null?void 0:w.dataMeasureAttrs,Te=o&&!(w!=null&&w.dataMeasureAttrs)&&!(w!=null&&w.hideControls);return a.jsxs(a.Fragment,{children:[fe.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Te?"textMarginTop":void 0,className:Te?`${r}-control`:void 0,style:{height:D.scalingValue(x??0,n??!1)}}),a.jsx("div",{...j&&{"data-testimonial-measure":"text"},style:{...Ut(O,n),...M&&M>0?{minHeight:M}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Ri,{content:fe.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Te?"imageMarginTop":void 0,className:Te?`${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:((ee=fe.image)==null?void 0:ee.url)&&a.jsx("img",{src:($e=fe.image)==null?void 0:$e.url,alt:((J=fe.image)==null?void 0:J.name)??"",className:`${r}-icon`,style:{objectFit:((me=fe.image)==null?void 0:me.objectFit)||"contain"}})})]}),fe.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Te?"captionMarginTop":void 0,className:Te?`${r}-control`:void 0,style:{height:D.scalingValue(b??0,n??!1)}}),a.jsx("div",{...j?{"data-testimonial-measure":"caption"}:{},style:{...Ut(P,n),...E&&E>0?{minHeight:E}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Ri,{content:fe.caption})})]})]})},ye=s.useCallback(fe=>{H(fe.maxTextPx),de(fe.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!X){ye({maxTextPx:0,maxCaptionPx:0});return}const fe=ne.current;if(!fe)return;const w=()=>{D.readTestimonialTextMeasure(fe,ye)};w();const M=new ResizeObserver(w);return M.observe(fe),()=>{M.disconnect()}},[X,ye,t]),!k)return a.jsx(a.Fragment,{});const Fe=X?{textMinHeightPx:L,captionMinHeightPx:U}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Uh(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:D.scalingValue(u??0,n??!1),alignItems:$},children:[X&&a.jsx("div",{ref:ne,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((fe,w)=>a.jsx("div",{style:{width:"100%"},children:te(fe,{dataMeasureAttrs:!0})},w))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[A&&W&&a.jsx("div",{className:pt(`${r}-fade-item-prev`,`${r}-fade-out`),children:te(A,{...Fe,hideControls:!0})}),a.jsx("div",{className:pt(`${r}-fade-item-current`,W?`${r}-fade-in`:void 0),children:te(k,Fe)})]})]}),ae.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:z,disabled:!F,"aria-label":"Previous testimonial",children:ae.icon&&a.jsx(sn,{url:ae.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:re,disabled:!F,"aria-label":"Next testimonial",children:ae.icon&&a.jsx(sn,{url:ae.icon,fill:v,hoverFill:C,className:`${r}-arrow-img`})})})]})]})})},Jh=`import cn from 'classnames';
4293
+ `}const Kh=3e3,Zh=({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,V]=s.useState(0),[N,q]=s.useState(null),[W,I]=s.useState(!1),B=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(()=>{V(0),q(null),I(!1)},[l.length]);const k=l[S],F=N===null?null:l[N],g=ye=>{var M,E,j,Ce,Q;return{fontSettings:{fontFamily:(e==null?void 0:e[`${ye}FontFamily`])??"Arial",fontWeight:((M=e==null?void 0:e[`${ye}FontSettings`])==null?void 0:M.fontWeight)??400,fontStyle:((E=e==null?void 0:e[`${ye}FontSettings`])==null?void 0:E.fontStyle)??"normal"},textAppearance:{textTransform:((j=e==null?void 0:e[`${ye}TextAppearance`])==null?void 0:j.textTransform)??"none",textDecoration:((Ce=e==null?void 0:e[`${ye}TextAppearance`])==null?void 0:Ce.textDecoration)??"none",fontVariant:((Q=e==null?void 0:e[`${ye}TextAppearance`])==null?void 0:Q.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${ye}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${ye}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${ye}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${ye}WordSpacing`])??0,color:(e==null?void 0:e[`${ye}Color`])??"#000000"}},O=g("text"),P=g("caption"),X=l.length>1&&l.some(ye=>{var b,M;return(((b=ye.text)==null?void 0:b.length)??0)>0||(((M=ye.caption)==null?void 0:M.length)??0)>0}),te=s.useRef(null),[L,H]=s.useState(0),[U,de]=s.useState(0),ae=e.controls??{mode:"Off",icon:null},A=l.length>1,ce=s.useCallback((ye,b)=>!A||b===ye?ye:(B.current&&window.clearTimeout(B.current),q(ye),I(!0),B.current=window.setTimeout(()=>{q(null),I(!1),B.current=null},300),b),[A]),z=s.useCallback(()=>{A&&V(ye=>ce(ye,(ye-1+l.length)%l.length))},[A,ce,l.length]),re=s.useCallback(()=>{A&&V(ye=>ce(ye,(ye+1)%l.length))},[A,ce,l.length]);s.useEffect(()=>{if(!y||!A)return;const ye=Math.max(300,Kh/d),b=window.setInterval(()=>{V(M=>ce(M,(M+1)%l.length))},ye);return()=>{window.clearInterval(b)}},[y,A,ce,l.length,d]),s.useEffect(()=>()=>{B.current&&window.clearTimeout(B.current)},[]);const ee=(ye,b)=>{var Q,Te,ie,ue;const M=b==null?void 0:b.textMinHeightPx,E=b==null?void 0:b.captionMinHeightPx,j=b==null?void 0:b.dataMeasureAttrs,Ce=o&&!(b!=null&&b.dataMeasureAttrs)&&!(b!=null&&b.hideControls);return a.jsxs(a.Fragment,{children:[ye.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:D.scalingValue(x??0,n??!1)}}),a.jsx("div",{...j&&{"data-testimonial-measure":"text"},style:{...Ut(O,n),...M&&M>0?{minHeight:M}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Ri,{content:ye.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: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:((Q=ye.image)==null?void 0:Q.url)&&a.jsx("img",{src:(Te=ye.image)==null?void 0:Te.url,alt:((ie=ye.image)==null?void 0:ie.name)??"",className:`${r}-icon`,style:{objectFit:((ue=ye.image)==null?void 0:ue.objectFit)||"contain"}})})]}),ye.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:D.scalingValue(w??0,n??!1)}}),a.jsx("div",{...j?{"data-testimonial-measure":"caption"}:{},style:{...Ut(P,n),...E&&E>0?{minHeight:E}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Ri,{content:ye.caption})})]})]})},xe=s.useCallback(ye=>{H(ye.maxTextPx),de(ye.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!X){xe({maxTextPx:0,maxCaptionPx:0});return}const ye=te.current;if(!ye)return;const b=()=>{D.readTestimonialTextMeasure(ye,xe)};b();const M=new ResizeObserver(b);return M.observe(ye),()=>{M.disconnect()}},[X,xe,t]),!k)return a.jsx(a.Fragment,{});const Fe=X?{textMinHeightPx:L,captionMinHeightPx:U}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Uh(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:D.scalingValue(u??0,n??!1),alignItems:$},children:[X&&a.jsx("div",{ref:te,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((ye,b)=>a.jsx("div",{style:{width:"100%"},children:ee(ye,{dataMeasureAttrs:!0})},b))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[F&&W&&a.jsx("div",{className:pt(`${r}-fade-item-prev`,`${r}-fade-out`),children:ee(F,{...Fe,hideControls:!0})}),a.jsx("div",{className:pt(`${r}-fade-item-current`,W?`${r}-fade-in`:void 0),children:ee(k,Fe)})]})]}),ae.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:z,disabled:!A,"aria-label":"Previous testimonial",children:ae.icon&&a.jsx(sn,{url:ae.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:re,disabled:!A,"aria-label":"Next testimonial",children:ae.icon&&a.jsx(sn,{url:ae.icon,fill:v,hoverFill:C,className:`${r}-arrow-img`})})})]})]})})},Jh=`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';
@@ -5133,7 +5133,7 @@ type TestimonialsSettings = {
5133
5133
  z-index: 2;
5134
5134
  width: 100%;
5135
5135
  }
5136
- `}function rf(){return Math.random()<.5?"ltr":"ttb"}function af(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function sf(e){const t=rf();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{af(e)})})}const bn=500,lf=750,jn="cubic-bezier(0.22, 1, 0.36, 1)",cf=72,df=50;function uf(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 pf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function mf(e){const[t]=e.media;return t!=null&&t.url?t:null}function Ld(e){return!Array.isArray(e)||e.length===0?[]:uf(e)?e.flatMap(t=>{const n=pf(t);if(!n)return[];const i=mf(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 gf(e){const t=new Set,n=[];for(const i of e){const o=Ld(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 hf({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 ff(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 yf(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 xf({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{ff(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 vf({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),b=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),V=s.useRef(null),N=s.useRef(0),q=s.useRef(null),W=s.useRef(!1),I=s.useRef(null),B=s.useRef(null),$=s.useRef(null),T=s.useRef(()=>{}),[k,A]=s.useState(null),[g,O]=s.useState(null),[P,X]=s.useState("opening"),[ne,L]=s.useState(0),[H,U]=s.useState(0),[de,ae]=s.useState(null),[F,ce]=s.useState(!1),[z,re]=s.useState(!1),[te,ye]=s.useState(!1),[Fe,fe]=s.useState(null),w=s.useRef(n),M=s.useRef(void 0),E=t[n],j=E?$i(E):!1,Te=H!==0||F,ee=de!==null,$e=s.useCallback(he=>{const xe=he.currentTarget,We=xe instanceof HTMLVideoElement?{width:xe.videoWidth,height:xe.videoHeight}:{width:xe.naturalWidth,height:xe.naturalHeight};!We.width||!We.height||fe(We)},[]);s.useEffect(()=>{V.current=g},[g]),s.useEffect(()=>{const he=x.current;if(!he)return;const xe=()=>O(El(he));xe();const We=new ResizeObserver(xe);return We.observe(he),()=>We.disconnect()},[]);const J=s.useCallback(()=>{I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),me=s.useCallback(()=>{const he=B.current;B.current=null,J(),q.current=null,W.current=!1,ae(null),ce(!1),U(0),N.current=0,re(!1),y.current=!1,v.current=0,C.current="none",he===1?d():he===-1&&l()},[J,d,l]),Se=s.useCallback(()=>{J(),B.current=null,q.current=null,W.current=!1,ae(null),ce(!1),U(0),N.current=0},[J]),K=s.useCallback(()=>{J(),I.current=window.setTimeout(()=>{B.current!==null&&me()},bn+32)},[J,me]),Z=s.useCallback((he,xe)=>{var Je;const We=((Je=V.current)==null?void 0:Je.width)??0;if(J(),q.current=he,ae(he),W.current=!0,ce(!0),xe){B.current=he;const ve=-he*We;N.current=ve,U(ve),K();return}N.current=0,U(0),I.current=window.setTimeout(()=>{I.current=null,Se()},bn+32)},[J,Se,K]),se=s.useCallback(he=>{if(!(t.length<=1)){if(W.current){if(B.current===he){$.current=he,me();return}Se()}J(),q.current=he,ae(he),W.current=!1,ce(!1),N.current=0,U(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(he,!0)})})}},[t.length,Z,me,Se,J]);T.current=se;const we=s.useCallback(he=>{he.propertyName!=="transform"||!W.current||B.current!==null&&me()},[me]),Me=s.useCallback(()=>{const he=b.current;if(!he)return;const xe=El(he);!xe.width||!xe.height||A(xe)},[]);s.useEffect(()=>{Me();const he=b.current;if(!he)return;const xe=new ResizeObserver(()=>Me());return xe.observe(he),()=>xe.disconnect()},[Me]),s.useEffect(()=>{P==="opening"&&k&&X("open")},[P,k]),s.useEffect(()=>{if(P!=="closing")return;const he=setTimeout(()=>r(),bn);return()=>clearTimeout(he)},[P,r]),s.useEffect(()=>()=>{J()},[J]),s.useLayoutEffect(()=>{w.current===n&&M.current===(E==null?void 0:E.url)||(J(),B.current=null,ae(null),L(0),U(0),ce(!1),ye(!1),re(!1),fe(null),f.current=0,v.current=0,C.current="none",y.current=!1,W.current=!1,N.current=0,q.current=null,h.current=null,S.current=!1,w.current=n,M.current=E==null?void 0:E.url)},[n,E==null?void 0:E.url,J]),s.useLayoutEffect(()=>{const he=$.current;he!==null&&($.current=null,requestAnimationFrame(()=>{T.current(he)}))},[n,E==null?void 0:E.url]),s.useEffect(()=>{if(P!=="open")return;let he=null;const xe=()=>{he&&(document.removeEventListener("click",he,!0),he=null)},We=()=>{xe(),he=ze=>{ze.stopPropagation(),ze.preventDefault(),xe()},document.addEventListener("click",he,!0)},Je=ze=>{const Le=ze<0?1:-1;if(Math.abs(ze)>df&&t.length>1){Z(Le,!0);return}Z(Le,!1)},ve=ze=>{if(ze.touches.length!==1||W.current)return;const Le=ze.touches[0];S.current=!0,h.current={x:Le.clientX,y:Le.clientY},C.current="none",v.current=0,y.current=!1},Ie=ze=>{if(!h.current||ze.touches.length!==1||W.current)return;const Le=ze.touches[0],Ge=Le.clientX-h.current.x,De=Le.clientY-h.current.y;if(C.current==="none"){if(Math.abs(Ge)<10&&Math.abs(De)<10)return;if(Math.abs(Ge)>Math.abs(De)){if(t.length<=1)return;C.current="horizontal"}else if(De>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,re(!0),v.current=Ge;const nt=Ge<0?1:-1;q.current!==nt&&(q.current=nt,ae(nt)),N.current=Ge,U(Ge),ze.preventDefault();return}C.current==="vertical"&&(y.current=!0,re(!0),f.current=De,L(De),ze.preventDefault())},qe=()=>{if(!h.current)return;const ze=C.current,Le=y.current;if(Le&&ze==="horizontal")Je(v.current),We();else if(Le&&ze==="vertical")if(f.current>cf){const De=window.innerHeight;f.current=De,ye(!0),L(De),X("closing")}else f.current=0,L(0),We();else ze==="horizontal"&&Math.abs(v.current)>0&&(Je(v.current),We());h.current=null,C.current="none",v.current=0,y.current=!1,re(!1)};return document.addEventListener("touchstart",ve,{passive:!0}),document.addEventListener("touchmove",Ie,{passive:!1}),document.addEventListener("touchend",qe),document.addEventListener("touchcancel",qe),()=>{document.removeEventListener("touchstart",ve),document.removeEventListener("touchmove",Ie),document.removeEventListener("touchend",qe),document.removeEventListener("touchcancel",qe),xe()}},[P,t.length,Z]),s.useEffect(()=>{const he=xe=>{xe.key==="Escape"&&(xe.preventDefault(),xe.stopPropagation(),P!=="closing"&&X("closing"))};return window.addEventListener("keydown",he,!0),()=>window.removeEventListener("keydown",he,!0)},[P]);const Ce=()=>{P!=="closing"&&X("closing")},G=P==="open",ue=P==="closing",oe=ne>0?Math.max(0,1-ne/500):1,Y=ne>0?Math.max(.35,1-ne/500):1,le=k?p?k:yf(k,Fe):null,_e=he=>{if(he.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const xe=le??he.currentTarget.getBoundingClientRect(),We=he.clientY-xe.top,Je=Math.min(52,xe.height*.2);if(!(We>xe.height-Je)){if(he.clientX-xe.left<xe.width/2){se(-1);return}se(1)}},pe=he=>{if(t.length<=1)return;const xe=le??he.currentTarget.getBoundingClientRect(),We=he.clientX-xe.left,Je=he.clientY-xe.top,ve=Math.min(52,xe.height*.2);if(Je>xe.height-ve){he.currentTarget.style.cursor="default";return}he.currentTarget.style.cursor=We<xe.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},Ke=p?"cover":"contain",ke=H!==0||ne>0?`translate(${H}px, ${ne}px)`:void 0,tt=z&&!F?"none":F?`transform ${bn}ms ${jn}`:te?`transform ${bn}ms ${jn}, opacity ${bn}ms ${jn}`:P==="opening"||ue?`opacity ${bn}ms ${jn}`:"none",Ye={...Q,transform:ke,opacity:ne>0?Y:P==="opening"||ue?0:1,transition:tt,pointerEvents:"none"},dt={position:"absolute",top:((le==null?void 0:le.top)??0)-((g==null?void 0:g.top)??0),left:((le==null?void 0:le.left)??0)-((g==null?void 0:g.left)??0),width:le==null?void 0:le.width,height:le==null?void 0:le.height,objectFit:Ke,pointerEvents:j&&G&&!Te?"auto":"none",touchAction:j&&G?"none":void 0},ot=(g==null?void 0:g.width)??0,Ve=ee?(n+de+t.length)%t.length:null,Re=Ve!==null?t[Ve]:null,He={...Q,transform:ee?`translateX(${de*ot+H}px)`:void 0,opacity:1,transition:F?`transform ${bn}ms ${jn}`:"none",pointerEvents:"none"},Be={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:Ke,pointerEvents:"none"},Ze=le?{position:"fixed",top:le.top,height:le.height,width:le.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:G?oe:0,transition:z?"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:b,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:G?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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:G?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&&Re&&a.jsx("div",{style:He,onTransitionEnd:we,children:$i(Re)?a.jsx("video",{src:Re.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${Ve}-${Re.url}`):a.jsx("img",{src:Re.url,alt:Re.name,style:Be},`neighbor-${Ve}-${Re.url}`)}),k&&g&&E&&a.jsx("div",{style:Ye,onTransitionEnd:we,children:j?a.jsx(xf,{src:E.url,phase:P,mediaRef:m,mediaStyle:dt,onLoadedMetadata:$e,onClick:_e,onMouseMove:pe},`${n}-${E.url}`):a.jsx("img",{ref:m,src:E.url,alt:E.name,onLoad:$e,style:dt},`${n}-${E.url}`)}),G&&Ze&&t.length>1&&!j&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ze,left:le.left,cursor:"w-resize",pointerEvents:z?"none":"auto"},onClick:he=>{if(S.current){S.current=!1;return}he.stopPropagation(),se(-1)}}),a.jsx("div",{style:{...Ze,left:le.left+le.width/2,cursor:"e-resize",pointerEvents:z?"none":"auto"},onClick:he=>{if(S.current){S.current=!1;return}he.stopPropagation(),se(1)}})]})]})}function bf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function wf({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:b=100,verticalGap:m,entriesCount:h,lightbox:f,imageDisplay:v,imageCorners:C,lightboxImageDisplay:y,slider:S,sliderTiming:V,direction:N,transition:q,titleMarginTop:W,subtitleMarginTop:I,titleColor:B,subtitleColor:$,lightboxCounterColor:T,titleFontFamily:k,titleFontSettings:A,titleFontSize:g,titleLineHeight:O,titleLetterSpacing:P,titleWordSpacing:X,titleTextAppearance:ne,subtitleFontFamily:L,subtitleFontSettings:H,subtitleFontSize:U,subtitleLineHeight:de,subtitleLetterSpacing:ae,subtitleWordSpacing:F,subtitleTextAppearance:ce,lightboxCounterFontFamily:z,lightboxCounterFontSettings:re,lightboxCounterFontSize:te,lightboxCounterLineHeight:ye,lightboxCounterLetterSpacing:Fe,lightboxCounterWordSpacing:fe,lightboxCounterTextAppearance:w,showText:M="always",alignEntries:E="off",align:j="top"}=e,Te={fontSettings:{fontFamily:k,fontWeight:(A==null?void 0:A.fontWeight)??400,fontStyle:(A==null?void 0:A.fontStyle)??"normal"},fontSize:g??.01,lineHeight:O,letterSpacing:P??0,wordSpacing:X??0,textAppearance:ne,color:B},$e={...an(Ut(Te,n))},J={fontSettings:{fontFamily:L,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:U??.01,lineHeight:de,letterSpacing:ae??0,wordSpacing:F??0,textAppearance:ce,color:$},Se={...an(Ut(J,n))},K={fontSettings:{fontFamily:z,fontWeight:(re==null?void 0:re.fontWeight)??400,fontStyle:(re==null?void 0:re.fontStyle)??"normal"},fontSize:te??.01,lineHeight:ye,letterSpacing:Fe??0,wordSpacing:fe??0,textAppearance:w,color:T},se={...an(Ut(K,n)),...Ta(te,ye,u,n)},we=$a(g,O,`${u}-item-title`,`${u}-text-tight-leading`),Me=$a(U,de,`${u}-item-subtitle`,`${u}-text-tight-leading`),Ce=Ta(g,O,u,n),G=Ta(U,de,u,n),ue=$a(te,ye,`${u}-lightbox-counter`,`${u}-text-tight-leading`),oe=D.buildColorVars(u,{titleColor:B,subtitleColor:$,lightboxCounterColor:T},Sf,Cf),_e=`${l&&l!=="default"?`${u}-state-${l}`:""}${M==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),pe=h===0?1/0:h,Q=(t??[]).slice(0,pe),Ke=s.useMemo(()=>f==="on"?gf(Q):[],[Q,f]),ke=x.entryWidth??.2,tt=(v==null?void 0:v.display)==="cover",Ye=(v==null?void 0:v.ratioValue)??"1:1",dt=(v==null?void 0:v.reversed)??!1,[ot,Ve]=Ye.split(":").map(Number),Be=`${dt?Ve:ot} / ${dt?ot:Ve}`,Ze=x.columnsCount,he=D.scalingValue(ke??0,n),xe=he,We=!tt&&S!=="off",Je=Q.length%Ze||Ze,ve=Je<Ze&&Q.length>0,Ie=Q.length-Je,qe=ve?Math.floor((Ze-Je)/2)+1:1,ze=C?D.scalingValue(C,n):void 0,Le={width:xe,...tt?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...ze?{borderRadius:ze,overflow:"hidden"}:{}},Ge=`${u}-item-image-wrapper${We?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),De=p==="d"||p==="e"||p==="f",nt=E==="on",it=`calc(${D.scalingValue(ke??0,n)} * (${b} / 100))`,ct=D.scalingValue(ke*b/100,n),St=tt?{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}:{}},[Bt,zt]=s.useState(0),ft=s.useRef(null),wt=q==="fade"||N==="horizontal"?"ltr":N==="vertical"?"ttb":"ltr";s.useEffect(()=>{const gt=ft.current;if(!gt)return;const Ae=new ResizeObserver(Xe=>{zt(Math.round(Xe[0].contentRect.width))});return Ae.observe(gt),()=>Ae.disconnect()},[]);const jt=(()=>{const gt={...oe},Ae=ft.current?getComputedStyle(ft.current).getPropertyValue("--cntrl-article-width").trim():"";return Ae&&(gt["--cntrl-article-width"]=Ae),gt})(),[At,vt]=s.useState(!1),[Ft,Nt]=s.useState([]),[Kt,Jt]=s.useState(0),Tt=f==="on"&&(!n||i),Wt=(gt,Ae)=>{n&&!i||f!=="off"&&(Nt(gt),Jt(Ae),vt(!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||vt(!1)},[n,i]);const rn=s.useMemo(()=>of(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),f==="on"&&a.jsx(hf,{mediaList:Ke}),a.jsx("div",{style:oe,children:a.jsx("div",{ref:ft,className:`${u}-wrapper ${u}-type-${p}${nt?` ${u}-align-entries`:""} ${u}-image-align-${j} ${_e}`.trim(),style:{gridTemplateColumns:`repeat(${Ze}, ${he})`,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:Q.map((gt,Ae)=>{var _t;const Xe=Ll(gt.title),st=Ll(gt.subtitle),ht=(((_t=gt.link)==null?void 0:_t.length)??0)>0&&f==="off"?gt.link:void 0,yt=Math.floor(Ae/Ze)===Math.ceil(Q.length/Ze)-1,Lt=ve&&Ae>=Ie?`${qe+(Ae-Ie)}`:void 0,mt=De?a.jsxs("div",{className:`${u}-item-text-block`,children:[Xe&&a.jsx("p",{className:we,style:{width:it,...$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(W??0,n),width:ct}}),st&&a.jsx("p",{className:Me,style:{width:it,...Se,...G},children:gt.subtitle}),st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(I??0,n),width:ct}})]}):null,Vt=nt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!De&&a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?D.scalingValue(W??0,n):0,width:ct}}),Xe&&a.jsx("p",{className:we,style:{width:it,...$e,...Ce},children:gt.title}),De&&Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(W??0,n),width:ct}})]}):null,kt=nt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!De&&a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?D.scalingValue(I??0,n):0,width:ct}}),st&&a.jsx("p",{className:Me,style:{width:it,...Se,...G},children:gt.subtitle}),De&&st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(I??0,n),width:ct}})]}):null,Mt=ht?a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:[Vt,kt]}):a.jsxs(a.Fragment,{children:[Vt,kt]}),Xt=Ld(gt.gallery),Yt=Xt.filter(Ct=>Ct.lightboxMedia).map(Ct=>Ct.lightboxMedia),Ht=a.jsx("div",{className:Ge,style:Le,children:Xt.length===0?null:S==="off"?(()=>{const{displayMedia:Ct,lightboxMedia:_}=Xt[0],Pe=_?Yt.findIndex(Ne=>Ne.url===_.url):-1;return a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Pe>=0?()=>Wt(Yt,Pe):void 0})})():a.jsxs(a.Fragment,{children:[We&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Xt.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:V*1e3,width:"100%",height:"100%",speed:lf,type:q==="fade"?"fade":"loop",rewind:q==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:Ct=>{N!=="random"||q==="fade"||sf(Ct)},children:Xt.map(({displayMedia:Ct,lightboxMedia:_},Pe)=>{const Ne=_?Yt.findIndex(Oe=>Oe.url===_.url):-1;return a.jsx(js,{children:a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Ne>=0?()=>Wt(Yt,Ne):void 0})},Pe)})},`${q}-${ke}-${N}-${V}-${Bt}-${d}`)]})}),Dt=De?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(W??0,n):0,width:ct}}),a.jsx("p",{className:we,style:{width:it,...$e,...Ce},children:gt.title}),a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?D.scalingValue(I??0,n):0,width:ct}}),a.jsx("p",{className:Me,style:{width:it,...Se,...G},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&&yt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(b??0)>100?`calc(${he} * (${b} / 100))`:he,...Lt&&nt?{gridColumn:Lt}:{}},children:nt?a.jsx(a.Fragment,{children:De?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]}),!De&&a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[mt,Ht,Dt]})})},Ae)})})}),(!n||i)&&At&&typeof document<"u"&&f==="on"&&(()=>{const gt=(c?document.getElementById(c):null)??document.body;return zn.createPortal(a.jsx("div",{style:jt,"data-selection":"none",children:a.jsx(vf,{prefix:u,items:Ft,index:Kt,imageDisplay:bf(y),isEditor:n,onClose:()=>vt(!1),onPrev:()=>Jt(Ae=>(Ae-1+Ft.length)%Ft.length),onNext:()=>Jt(Ae=>(Ae+1)%Ft.length),counterClassName:ue,counterStyle:se})}),gt)})()]})}const Sf={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Cf=["hover","focus","filled","success","error"],$f=`import { Splide, SplideSlide } from '@splidejs/react-splide';
5136
+ `}function rf(){return Math.random()<.5?"ltr":"ttb"}function af(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function sf(e){const t=rf();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{af(e)})})}const bn=500,lf=750,jn="cubic-bezier(0.22, 1, 0.36, 1)",cf=72,df=50;function uf(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 pf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function mf(e){const[t]=e.media;return t!=null&&t.url?t:null}function Ld(e){return!Array.isArray(e)||e.length===0?[]:uf(e)?e.flatMap(t=>{const n=pf(t);if(!n)return[];const i=mf(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 gf(e){const t=new Set,n=[];for(const i of e){const o=Ld(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 hf({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 ff(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 yf(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 xf({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{ff(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 vf({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),V=s.useRef(null),N=s.useRef(0),q=s.useRef(null),W=s.useRef(!1),I=s.useRef(null),B=s.useRef(null),$=s.useRef(null),T=s.useRef(()=>{}),[k,F]=s.useState(null),[g,O]=s.useState(null),[P,X]=s.useState("opening"),[te,L]=s.useState(0),[H,U]=s.useState(0),[de,ae]=s.useState(null),[A,ce]=s.useState(!1),[z,re]=s.useState(!1),[ee,xe]=s.useState(!1),[Fe,ye]=s.useState(null),b=s.useRef(n),M=s.useRef(void 0),E=t[n],j=E?$i(E):!1,Ce=H!==0||A,Q=de!==null,Te=s.useCallback(he=>{const ve=he.currentTarget,We=ve instanceof HTMLVideoElement?{width:ve.videoWidth,height:ve.videoHeight}:{width:ve.naturalWidth,height:ve.naturalHeight};!We.width||!We.height||ye(We)},[]);s.useEffect(()=>{V.current=g},[g]),s.useEffect(()=>{const he=x.current;if(!he)return;const ve=()=>O(El(he));ve();const We=new ResizeObserver(ve);return We.observe(he),()=>We.disconnect()},[]);const ie=s.useCallback(()=>{I.current!==null&&(window.clearTimeout(I.current),I.current=null)},[]),ue=s.useCallback(()=>{const he=B.current;B.current=null,ie(),q.current=null,W.current=!1,ae(null),ce(!1),U(0),N.current=0,re(!1),y.current=!1,v.current=0,C.current="none",he===1?d():he===-1&&l()},[ie,d,l]),fe=s.useCallback(()=>{ie(),B.current=null,q.current=null,W.current=!1,ae(null),ce(!1),U(0),N.current=0},[ie]),K=s.useCallback(()=>{ie(),I.current=window.setTimeout(()=>{B.current!==null&&ue()},bn+32)},[ie,ue]),Z=s.useCallback((he,ve)=>{var Je;const We=((Je=V.current)==null?void 0:Je.width)??0;if(ie(),q.current=he,ae(he),W.current=!0,ce(!0),ve){B.current=he;const be=-he*We;N.current=be,U(be),K();return}N.current=0,U(0),I.current=window.setTimeout(()=>{I.current=null,fe()},bn+32)},[ie,fe,K]),se=s.useCallback(he=>{if(!(t.length<=1)){if(W.current){if(B.current===he){$.current=he,ue();return}fe()}ie(),q.current=he,ae(he),W.current=!1,ce(!1),N.current=0,U(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(he,!0)})})}},[t.length,Z,ue,fe,ie]);T.current=se;const Se=s.useCallback(he=>{he.propertyName!=="transform"||!W.current||B.current!==null&&ue()},[ue]),Me=s.useCallback(()=>{const he=w.current;if(!he)return;const ve=El(he);!ve.width||!ve.height||F(ve)},[]);s.useEffect(()=>{Me();const he=w.current;if(!he)return;const ve=new ResizeObserver(()=>Me());return ve.observe(he),()=>ve.disconnect()},[Me]),s.useEffect(()=>{P==="opening"&&k&&X("open")},[P,k]),s.useEffect(()=>{if(P!=="closing")return;const he=setTimeout(()=>r(),bn);return()=>clearTimeout(he)},[P,r]),s.useEffect(()=>()=>{ie()},[ie]),s.useLayoutEffect(()=>{b.current===n&&M.current===(E==null?void 0:E.url)||(ie(),B.current=null,ae(null),L(0),U(0),ce(!1),xe(!1),re(!1),ye(null),f.current=0,v.current=0,C.current="none",y.current=!1,W.current=!1,N.current=0,q.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,ie]),s.useLayoutEffect(()=>{const he=$.current;he!==null&&($.current=null,requestAnimationFrame(()=>{T.current(he)}))},[n,E==null?void 0:E.url]),s.useEffect(()=>{if(P!=="open")return;let he=null;const ve=()=>{he&&(document.removeEventListener("click",he,!0),he=null)},We=()=>{ve(),he=ze=>{ze.stopPropagation(),ze.preventDefault(),ve()},document.addEventListener("click",he,!0)},Je=ze=>{const Le=ze<0?1:-1;if(Math.abs(ze)>df&&t.length>1){Z(Le,!0);return}Z(Le,!1)},be=ze=>{if(ze.touches.length!==1||W.current)return;const Le=ze.touches[0];S.current=!0,h.current={x:Le.clientX,y:Le.clientY},C.current="none",v.current=0,y.current=!1},Ie=ze=>{if(!h.current||ze.touches.length!==1||W.current)return;const Le=ze.touches[0],Ge=Le.clientX-h.current.x,De=Le.clientY-h.current.y;if(C.current==="none"){if(Math.abs(Ge)<10&&Math.abs(De)<10)return;if(Math.abs(Ge)>Math.abs(De)){if(t.length<=1)return;C.current="horizontal"}else if(De>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,re(!0),v.current=Ge;const nt=Ge<0?1:-1;q.current!==nt&&(q.current=nt,ae(nt)),N.current=Ge,U(Ge),ze.preventDefault();return}C.current==="vertical"&&(y.current=!0,re(!0),f.current=De,L(De),ze.preventDefault())},qe=()=>{if(!h.current)return;const ze=C.current,Le=y.current;if(Le&&ze==="horizontal")Je(v.current),We();else if(Le&&ze==="vertical")if(f.current>cf){const De=window.innerHeight;f.current=De,xe(!0),L(De),X("closing")}else f.current=0,L(0),We();else ze==="horizontal"&&Math.abs(v.current)>0&&(Je(v.current),We());h.current=null,C.current="none",v.current=0,y.current=!1,re(!1)};return document.addEventListener("touchstart",be,{passive:!0}),document.addEventListener("touchmove",Ie,{passive:!1}),document.addEventListener("touchend",qe),document.addEventListener("touchcancel",qe),()=>{document.removeEventListener("touchstart",be),document.removeEventListener("touchmove",Ie),document.removeEventListener("touchend",qe),document.removeEventListener("touchcancel",qe),ve()}},[P,t.length,Z]),s.useEffect(()=>{const he=ve=>{ve.key==="Escape"&&(ve.preventDefault(),ve.stopPropagation(),P!=="closing"&&X("closing"))};return window.addEventListener("keydown",he,!0),()=>window.removeEventListener("keydown",he,!0)},[P]);const $e=()=>{P!=="closing"&&X("closing")},G=P==="open",pe=P==="closing",oe=te>0?Math.max(0,1-te/500):1,Y=te>0?Math.max(.35,1-te/500):1,le=k?p?k:yf(k,Fe):null,_e=he=>{if(he.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ve=le??he.currentTarget.getBoundingClientRect(),We=he.clientY-ve.top,Je=Math.min(52,ve.height*.2);if(!(We>ve.height-Je)){if(he.clientX-ve.left<ve.width/2){se(-1);return}se(1)}},me=he=>{if(t.length<=1)return;const ve=le??he.currentTarget.getBoundingClientRect(),We=he.clientX-ve.left,Je=he.clientY-ve.top,be=Math.min(52,ve.height*.2);if(Je>ve.height-be){he.currentTarget.style.cursor="default";return}he.currentTarget.style.cursor=We<ve.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},Ke=p?"cover":"contain",ke=H!==0||te>0?`translate(${H}px, ${te}px)`:void 0,tt=z&&!A?"none":A?`transform ${bn}ms ${jn}`:ee?`transform ${bn}ms ${jn}, opacity ${bn}ms ${jn}`:P==="opening"||pe?`opacity ${bn}ms ${jn}`:"none",Ye={...J,transform:ke,opacity:te>0?Y:P==="opening"||pe?0:1,transition:tt,pointerEvents:"none"},dt={position:"absolute",top:((le==null?void 0:le.top)??0)-((g==null?void 0:g.top)??0),left:((le==null?void 0:le.left)??0)-((g==null?void 0:g.left)??0),width:le==null?void 0:le.width,height:le==null?void 0:le.height,objectFit:Ke,pointerEvents:j&&G&&!Ce?"auto":"none",touchAction:j&&G?"none":void 0},ot=(g==null?void 0:g.width)??0,Ve=Q?(n+de+t.length)%t.length:null,Re=Ve!==null?t[Ve]:null,He={...J,transform:Q?`translateX(${de*ot+H}px)`:void 0,opacity:1,transition:A?`transform ${bn}ms ${jn}`:"none",pointerEvents:"none"},Be={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:Ke,pointerEvents:"none"},Ze=le?{position:"fixed",top:le.top,height:le.height,width:le.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:$e,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:G?oe:0,transition:z?"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:G?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:G?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&&Re&&a.jsx("div",{style:He,onTransitionEnd:Se,children:$i(Re)?a.jsx("video",{src:Re.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${Ve}-${Re.url}`):a.jsx("img",{src:Re.url,alt:Re.name,style:Be},`neighbor-${Ve}-${Re.url}`)}),k&&g&&E&&a.jsx("div",{style:Ye,onTransitionEnd:Se,children:j?a.jsx(xf,{src:E.url,phase:P,mediaRef:m,mediaStyle:dt,onLoadedMetadata:Te,onClick:_e,onMouseMove:me},`${n}-${E.url}`):a.jsx("img",{ref:m,src:E.url,alt:E.name,onLoad:Te,style:dt},`${n}-${E.url}`)}),G&&Ze&&t.length>1&&!j&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ze,left:le.left,cursor:"w-resize",pointerEvents:z?"none":"auto"},onClick:he=>{if(S.current){S.current=!1;return}he.stopPropagation(),se(-1)}}),a.jsx("div",{style:{...Ze,left:le.left+le.width/2,cursor:"e-resize",pointerEvents:z?"none":"auto"},onClick:he=>{if(S.current){S.current=!1;return}he.stopPropagation(),se(1)}})]})]})}function bf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function wf({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:V,direction:N,transition:q,titleMarginTop:W,subtitleMarginTop:I,titleColor:B,subtitleColor:$,lightboxCounterColor:T,titleFontFamily:k,titleFontSettings:F,titleFontSize:g,titleLineHeight:O,titleLetterSpacing:P,titleWordSpacing:X,titleTextAppearance:te,subtitleFontFamily:L,subtitleFontSettings:H,subtitleFontSize:U,subtitleLineHeight:de,subtitleLetterSpacing:ae,subtitleWordSpacing:A,subtitleTextAppearance:ce,lightboxCounterFontFamily:z,lightboxCounterFontSettings:re,lightboxCounterFontSize:ee,lightboxCounterLineHeight:xe,lightboxCounterLetterSpacing:Fe,lightboxCounterWordSpacing:ye,lightboxCounterTextAppearance:b,showText:M="always",alignEntries:E="off",align:j="top"}=e,Ce={fontSettings:{fontFamily:k,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:g??.01,lineHeight:O,letterSpacing:P??0,wordSpacing:X??0,textAppearance:te,color:B},Te={...an(Ut(Ce,n))},ie={fontSettings:{fontFamily:L,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:U??.01,lineHeight:de,letterSpacing:ae??0,wordSpacing:A??0,textAppearance:ce,color:$},fe={...an(Ut(ie,n))},K={fontSettings:{fontFamily:z,fontWeight:(re==null?void 0:re.fontWeight)??400,fontStyle:(re==null?void 0:re.fontStyle)??"normal"},fontSize:ee??.01,lineHeight:xe,letterSpacing:Fe??0,wordSpacing:ye??0,textAppearance:b,color:T},se={...an(Ut(K,n)),...Ta(ee,xe,u,n)},Se=$a(g,O,`${u}-item-title`,`${u}-text-tight-leading`),Me=$a(U,de,`${u}-item-subtitle`,`${u}-text-tight-leading`),$e=Ta(g,O,u,n),G=Ta(U,de,u,n),pe=$a(ee,xe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),oe=D.buildColorVars(u,{titleColor:B,subtitleColor:$,lightboxCounterColor:T},Sf,Cf),_e=`${l&&l!=="default"?`${u}-state-${l}`:""}${M==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),me=h===0?1/0:h,J=(t??[]).slice(0,me),Ke=s.useMemo(()=>f==="on"?gf(J):[],[J,f]),ke=x.entryWidth??.2,tt=(v==null?void 0:v.display)==="cover",Ye=(v==null?void 0:v.ratioValue)??"1:1",dt=(v==null?void 0:v.reversed)??!1,[ot,Ve]=Ye.split(":").map(Number),Be=`${dt?Ve:ot} / ${dt?ot:Ve}`,Ze=x.columnsCount,he=D.scalingValue(ke??0,n),ve=he,We=!tt&&S!=="off",Je=J.length%Ze||Ze,be=Je<Ze&&J.length>0,Ie=J.length-Je,qe=be?Math.floor((Ze-Je)/2)+1:1,ze=C?D.scalingValue(C,n):void 0,Le={width:ve,...tt?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...ze?{borderRadius:ze,overflow:"hidden"}:{}},Ge=`${u}-item-image-wrapper${We?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),De=p==="d"||p==="e"||p==="f",nt=E==="on",it=`calc(${D.scalingValue(ke??0,n)} * (${w} / 100))`,ct=D.scalingValue(ke*w/100,n),St=tt?{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}:{}},[Bt,zt]=s.useState(0),ft=s.useRef(null),wt=q==="fade"||N==="horizontal"?"ltr":N==="vertical"?"ttb":"ltr";s.useEffect(()=>{const gt=ft.current;if(!gt)return;const Ae=new ResizeObserver(Xe=>{zt(Math.round(Xe[0].contentRect.width))});return Ae.observe(gt),()=>Ae.disconnect()},[]);const jt=(()=>{const gt={...oe},Ae=ft.current?getComputedStyle(ft.current).getPropertyValue("--cntrl-article-width").trim():"";return Ae&&(gt["--cntrl-article-width"]=Ae),gt})(),[At,vt]=s.useState(!1),[Ft,Nt]=s.useState([]),[Kt,Jt]=s.useState(0),Tt=f==="on"&&(!n||i),Wt=(gt,Ae)=>{n&&!i||f!=="off"&&(Nt(gt),Jt(Ae),vt(!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||vt(!1)},[n,i]);const rn=s.useMemo(()=>of(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),f==="on"&&a.jsx(hf,{mediaList:Ke}),a.jsx("div",{style:oe,children:a.jsx("div",{ref:ft,className:`${u}-wrapper ${u}-type-${p}${nt?` ${u}-align-entries`:""} ${u}-image-align-${j} ${_e}`.trim(),style:{gridTemplateColumns:`repeat(${Ze}, ${he})`,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,Ae)=>{var _t;const Xe=Ll(gt.title),st=Ll(gt.subtitle),ht=(((_t=gt.link)==null?void 0:_t.length)??0)>0&&f==="off"?gt.link:void 0,yt=Math.floor(Ae/Ze)===Math.ceil(J.length/Ze)-1,Lt=be&&Ae>=Ie?`${qe+(Ae-Ie)}`:void 0,mt=De?a.jsxs("div",{className:`${u}-item-text-block`,children:[Xe&&a.jsx("p",{className:Se,style:{width:it,...Te,...$e},children:gt.title}),Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(W??0,n),width:ct}}),st&&a.jsx("p",{className:Me,style:{width:it,...fe,...G},children:gt.subtitle}),st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(I??0,n),width:ct}})]}):null,Vt=nt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!De&&a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?D.scalingValue(W??0,n):0,width:ct}}),Xe&&a.jsx("p",{className:Se,style:{width:it,...Te,...$e},children:gt.title}),De&&Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(W??0,n),width:ct}})]}):null,kt=nt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!De&&a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?D.scalingValue(I??0,n):0,width:ct}}),st&&a.jsx("p",{className:Me,style:{width:it,...fe,...G},children:gt.subtitle}),De&&st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(I??0,n),width:ct}})]}):null,Mt=ht?a.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:[Vt,kt]}):a.jsxs(a.Fragment,{children:[Vt,kt]}),Xt=Ld(gt.gallery),Yt=Xt.filter(Ct=>Ct.lightboxMedia).map(Ct=>Ct.lightboxMedia),Ht=a.jsx("div",{className:Ge,style:Le,children:Xt.length===0?null:S==="off"?(()=>{const{displayMedia:Ct,lightboxMedia:_}=Xt[0],Pe=_?Yt.findIndex(Ne=>Ne.url===_.url):-1;return a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Pe>=0?()=>Wt(Yt,Pe):void 0})})():a.jsxs(a.Fragment,{children:[We&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Xt.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:V*1e3,width:"100%",height:"100%",speed:lf,type:q==="fade"?"fade":"loop",rewind:q==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:Ct=>{N!=="random"||q==="fade"||sf(Ct)},children:Xt.map(({displayMedia:Ct,lightboxMedia:_},Pe)=>{const Ne=_?Yt.findIndex(Oe=>Oe.url===_.url):-1;return a.jsx(js,{children:a.jsx(Pl,{media:Ct,className:`${u}-item-${$i(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Tt&&Ne>=0?()=>Wt(Yt,Ne):void 0})},Pe)})},`${q}-${ke}-${N}-${V}-${Bt}-${d}`)]})}),Dt=De?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(W??0,n):0,width:ct}}),a.jsx("p",{className:Se,style:{width:it,...Te,...$e},children:gt.title}),a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?D.scalingValue(I??0,n):0,width:ct}}),a.jsx("p",{className:Me,style:{width:it,...fe,...G},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&&yt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(w??0)>100?`calc(${he} * (${w} / 100))`:he,...Lt&&nt?{gridColumn:Lt}:{}},children:nt?a.jsx(a.Fragment,{children:De?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]}),!De&&a.jsx("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[mt,Ht,Dt]})})},Ae)})})}),(!n||i)&&At&&typeof document<"u"&&f==="on"&&(()=>{const gt=(c?document.getElementById(c):null)??document.body;return zn.createPortal(a.jsx("div",{style:jt,"data-selection":"none",children:a.jsx(vf,{prefix:u,items:Ft,index:Kt,imageDisplay:bf(y),isEditor:n,onClose:()=>vt(!1),onPrev:()=>Jt(Ae=>(Ae-1+Ft.length)%Ft.length),onNext:()=>Jt(Ae=>(Ae+1)%Ft.length),counterClassName:pe,counterStyle:se})}),gt)})()]})}const Sf={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Cf=["hover","focus","filled","success","error"],$f=`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"}}}},Tf=["titleColor","subtitleColor","lightboxCounterColor"],If={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:[...Tf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Rf={element:wf,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:If,sourceCode:$f},Lf=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},Pd=(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)},Pf=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)}},Ed=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))},Ef=(e,t)=>{if(Ed(t)){if(e){window.history.back();return}Pf(t)}},Mf=20,kf=2,Ra=e=>`max(${e}, ${Mf}px)`,Ji=e=>((e==null?void 0:e.image)??[]).slice(0,kf),Md=e=>e.reduce((t,n)=>t+Ji(n).length,0),Af=(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}},Ff=(e,t)=>{const n=Md(e),{start:i,end:o}=Af(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)})),_f=(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 Ff(i,o)},_l=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Nf=(e,t,n)=>e==="B"?t.length>1:Md(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)}},kd=(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),Ad=(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"],at=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Xs={title1:"1",title2:"2",title3:"3",count:"Count"},Ys=e=>[at(e,"fontFamily"),at(e,"fontSettings"),{type:"row",items:[at(e,"fontSize"),at(e,"lineHeight"),at(e,"letterSpacing"),at(e,"wordSpacing")]},at(e,"textAlign"),at(e,"textAppearance")],Wf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(oi.map(e=>[Xs[e],Ys(e)]))}),Hf={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Df={title1:.02,title2:.02,title3:.02,count:.017},bi=(e,t)=>{const n=i=>{const o=at(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[Hf[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??Df[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)};function Fd({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:b=0,titleRowMarginBottom:m=0,titleHeaderLayout:h="desktop",contentMarginTop:f=0,iconMarginRight:v=0,closeIcon:C=null,closeIconMaxWidth:y=0,closeIconColor:S="#000000",closeIconHoverColor:V="#cccccc"}=n,N=D.scalingValue(f,i),q=D.scalingValue(v,i),W=D.scalingValue(m,i),I=h==="mobile",B=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]),A=s.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:b}),[x,b]),g=s.useMemo(()=>Kn(e,t,B,$,T),[e,t,B,$,T]),O=s.useMemo(()=>g.map(Y=>k[Y.widthKey]),[g,k]),P=s.useMemo(()=>Qi(g.length,O),[g.length,O]),X=s.useMemo(()=>Ho(g.length,O),[g.length,O]),ne=s.useMemo(()=>g.filter(Y=>Y.prefix==="title1"),[g]),L=s.useMemo(()=>g.filter(Y=>Y.prefix==="title2"||Y.prefix==="title3"),[g]),H=s.useMemo(()=>Zn(ne,k),[ne,k]),U=s.useMemo(()=>Zn(L,k),[L,k]),de=!!(t.title1||t.title2||t.title3),ae=C!==null;if(!(de||ae))return null;const ce=(p??0)>0||o,z=(Y,le)=>{const _e=g.findIndex(Q=>Q.prefix===Y.prefix);if(!I||le==="single-row")return{effectiveWidth:X[_e]??0,resolvedWidth:P[_e]??0,maxWidth:cn(_e,P)};if(le==="two-row-top"){const Q=ne.findIndex(Ke=>Ke.prefix===Y.prefix);return{effectiveWidth:H.effective[Q]??0,resolvedWidth:H.resolved[Q]??0,maxWidth:cn(Q,H.resolved)}}const pe=L.findIndex(Q=>Q.prefix===Y.prefix);return{effectiveWidth:U.effective[pe]??0,resolvedWidth:U.resolved[pe]??0,maxWidth:cn(pe,U.resolved)}},re=(Y,le,_e)=>{if(!I||_e==="single-row"){const tt=Y.findIndex(Ve=>Ve.prefix===le.prefix),Ye=Y.map(Ve=>k[Ve.widthKey]),dt=Qi(Y.length,Ye);return{effectiveWidth:Ho(Y.length,Ye)[tt]??0,resolvedWidth:dt[tt]??0,maxWidth:cn(tt,dt)}}if(_e==="two-row-top"){const tt=Y.filter(Ve=>Ve.prefix==="title1"),Ye=tt.findIndex(Ve=>Ve.prefix===le.prefix),{resolved:dt,effective:ot}=Zn(tt,k);return{effectiveWidth:ot[Ye]??0,resolvedWidth:dt[Ye]??0,maxWidth:cn(Ye,dt)}}const pe=Y.filter(tt=>tt.prefix==="title2"||tt.prefix==="title3"),Q=pe.findIndex(tt=>tt.prefix===le.prefix),{resolved:Ke,effective:ke}=Zn(pe,k);return{effectiveWidth:ke[Q]??0,resolvedWidth:Ke[Q]??0,maxWidth:cn(Q,Ke)}},te=Y=>Ad(g,P,A,Y)+(I?0:p??0),ye=()=>I?0:p??0,Fe=Y=>L.slice(0,Y).reduce((le,_e,pe)=>le+(_e.marginLeftKey?A[_e.marginLeftKey]??0:0)+(U.resolved[pe]??0),0),fe=Y=>{const le=L[Y];return Fe(Y)+(le.marginLeftKey?A[le.marginLeftKey]??0:0)+(U.resolved[Y]??0)},w=(Y,le,_e)=>{const pe=Y.marginLeftKey?A[Y.marginLeftKey]??0:0,{effectiveWidth:Q,resolvedWidth:Ke,maxWidth:ke}=_e??z(Y,le),tt=Math.max(pe,Un),Ye=o&&le==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Y.prefix,style:{width:D.scalingValue(Q,i),...pe>0?{marginLeft:D.scalingValue(pe,i)}:{}},children:[a.jsx("p",{className:Y.className,style:Y.style,children:Y.text}),Ye&&Y.marginLeftKey?a.jsx("div",{"data-controls":Y.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:D.scalingValue(-pe,i),width:D.scalingValue(tt,i),height:"100%",pointerEvents:"auto"}}):null,Ye?a.jsx("div",{"data-controls":Y.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,right:D.scalingValue(-fn/2,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},Y.className)},M=(Y="two-row")=>{const le=g.findIndex(Q=>Q.prefix==="title1"),_e=le>=0?P[le]:k.title1Width,pe=Y==="two-row"&&o;return a.jsx("div",{...pe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(_e)}:{},style:{width:D.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...pe?{pointerEvents:"auto"}:{}}})},E=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:B,"aria-hidden":"true",children:" "}),j=Y=>{const le=Kn(e,Y,B,$,T);return a.jsx(a.Fragment,{children:le.map(_e=>w(_e,"single-row",re(le,_e,"single-row")))})},Te=Y=>{const le=Kn(e,Y,B,$,T),_e=le.find(pe=>pe.prefix==="title1");return _e?w(_e,"two-row-top",re(le,_e,"two-row-top")):null},ee=(Y,le=!1)=>{const _e=Kn(e,Y,B,$,T),pe=_e.filter(ke=>ke.prefix==="title2"||ke.prefix==="title3"),Q=o&&le;return pe.length>0||Q||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[pe.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:pe.map(ke=>w(ke,"two-row-bottom",re(_e,ke,"two-row-bottom")))}),le&&o?a.jsxs(a.Fragment,{children:[we(),Me()]}):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:W,width:"100%",flexShrink:0,pointerEvents:Q?"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:q,"--close-icon-hover-color":V},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:V,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:q,height:"100%",pointerEvents:"auto"}})]}),J=()=>ae?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:$e()}):null,me=Y=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:Y})}),Se=Y=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[ae||de?E():null,ce?M("two-row"):null,me(Y),J()]}),K=(Y,le=!1)=>a.jsxs(a.Fragment,{children:[Se(Te(Y)),ee(Y,le)]}),Z=()=>{const Y=I?-1:g.findIndex(pe=>pe.prefix==="title1"),le=!I&&(o||(p??0)>0)?(()=>{const pe=p??0,Q=Y>=0?P[Y]:k.title1Width,Ke=Math.max(pe,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:D.scalingValue(Ke,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,_e=g.flatMap((pe,Q)=>{if(!pe.marginLeftKey)return[];const Ke=A[pe.marginLeftKey]??0,ke=kd(g,P,A,Q)+ye(),tt=Math.max(Ke,Un);return a.jsx("div",{"data-controls":pe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(P[Q]),style:{position:"absolute",top:0,left:D.scalingValue(ke,i),width:D.scalingValue(tt,i),height:"100%",pointerEvents:"auto"}},pe.marginLeftKey)});return le?[le,..._e]:_e},se=()=>g.map((Y,le)=>{const _e=cn(le,P),Q=te(le)-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(_e),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D.scalingValue(Q,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${Y.widthKey}-junction`)}),we=()=>L.flatMap((Y,le)=>{if(!Y.marginLeftKey)return[];const _e=A[Y.marginLeftKey]??0,pe=Fe(le),Q=Math.max(_e,Un),{resolvedWidth:Ke}=z(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(Ke),style:{position:"absolute",top:0,left:D.scalingValue(pe,i),width:D.scalingValue(Q,i),height:"100%",pointerEvents:"auto"}},Y.marginLeftKey)}),Me=()=>L.map((Y,le)=>{const{maxWidth:_e}=z(Y,"two-row-bottom"),Q=fe(le)-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(_e),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D.scalingValue(Q,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${Y.widthKey}-junction`)}),Ce=()=>!o||I?null:a.jsxs(a.Fragment,{children:[Z(),se()]}),G=!!(t.title2||t.title3||(m??0)>0||o),ue=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ae||de?E():null,ce?M("single-row"):null,de?me(j(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),J(),Ce()]}),oe=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...G?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:G?void 0:{flex:"0 0 auto",height:"auto"},children:K(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:N,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?oe():ue()})})})]})}function Of(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Bf(e){return`
7189
+ `,Ia={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Tf=["titleColor","subtitleColor","lightboxCounterColor"],If={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:[...Tf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Rf={element:wf,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:If,sourceCode:$f},Lf=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},Pd=(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)},Pf=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)}},Ed=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))},Ef=(e,t)=>{if(Ed(t)){if(e){window.history.back();return}Pf(t)}},Mf=20,kf=2,Ra=e=>`max(${e}, ${Mf}px)`,Ji=e=>((e==null?void 0:e.image)??[]).slice(0,kf),Md=e=>e.reduce((t,n)=>t+Ji(n).length,0),Af=(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}},Ff=(e,t)=>{const n=Md(e),{start:i,end:o}=Af(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)})),_f=(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 Ff(i,o)},_l=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Nf=(e,t,n)=>e==="B"?t.length>1:Md(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)}},kd=(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),Ad=(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"],at=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Xs={title1:"1",title2:"2",title3:"3",count:"Count"},Ys=e=>[at(e,"fontFamily"),at(e,"fontSettings"),{type:"row",items:[at(e,"fontSize"),at(e,"lineHeight"),at(e,"letterSpacing"),at(e,"wordSpacing")]},at(e,"textAlign"),at(e,"textAppearance")],Wf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(oi.map(e=>[Xs[e],Ys(e)]))}),Hf={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Df={title1:.02,title2:.02,title3:.02,count:.017},bi=(e,t)=>{const n=i=>{const o=at(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[Hf[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??Df[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)};function Fd({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:V="#cccccc"}=n,N=D.scalingValue(f,i),q=D.scalingValue(v,i),W=D.scalingValue(m,i),I=h==="mobile",B=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]),F=s.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:w}),[x,w]),g=s.useMemo(()=>Kn(e,t,B,$,T),[e,t,B,$,T]),O=s.useMemo(()=>g.map(Y=>k[Y.widthKey]),[g,k]),P=s.useMemo(()=>Qi(g.length,O),[g.length,O]),X=s.useMemo(()=>Ho(g.length,O),[g.length,O]),te=s.useMemo(()=>g.filter(Y=>Y.prefix==="title1"),[g]),L=s.useMemo(()=>g.filter(Y=>Y.prefix==="title2"||Y.prefix==="title3"),[g]),H=s.useMemo(()=>Zn(te,k),[te,k]),U=s.useMemo(()=>Zn(L,k),[L,k]),de=!!(t.title1||t.title2||t.title3),ae=C!==null;if(!(de||ae))return null;const ce=(p??0)>0||o,z=(Y,le)=>{const _e=g.findIndex(J=>J.prefix===Y.prefix);if(!I||le==="single-row")return{effectiveWidth:X[_e]??0,resolvedWidth:P[_e]??0,maxWidth:cn(_e,P)};if(le==="two-row-top"){const J=te.findIndex(Ke=>Ke.prefix===Y.prefix);return{effectiveWidth:H.effective[J]??0,resolvedWidth:H.resolved[J]??0,maxWidth:cn(J,H.resolved)}}const me=L.findIndex(J=>J.prefix===Y.prefix);return{effectiveWidth:U.effective[me]??0,resolvedWidth:U.resolved[me]??0,maxWidth:cn(me,U.resolved)}},re=(Y,le,_e)=>{if(!I||_e==="single-row"){const tt=Y.findIndex(Ve=>Ve.prefix===le.prefix),Ye=Y.map(Ve=>k[Ve.widthKey]),dt=Qi(Y.length,Ye);return{effectiveWidth:Ho(Y.length,Ye)[tt]??0,resolvedWidth:dt[tt]??0,maxWidth:cn(tt,dt)}}if(_e==="two-row-top"){const tt=Y.filter(Ve=>Ve.prefix==="title1"),Ye=tt.findIndex(Ve=>Ve.prefix===le.prefix),{resolved:dt,effective:ot}=Zn(tt,k);return{effectiveWidth:ot[Ye]??0,resolvedWidth:dt[Ye]??0,maxWidth:cn(Ye,dt)}}const me=Y.filter(tt=>tt.prefix==="title2"||tt.prefix==="title3"),J=me.findIndex(tt=>tt.prefix===le.prefix),{resolved:Ke,effective:ke}=Zn(me,k);return{effectiveWidth:ke[J]??0,resolvedWidth:Ke[J]??0,maxWidth:cn(J,Ke)}},ee=Y=>Ad(g,P,F,Y)+(I?0:p??0),xe=()=>I?0:p??0,Fe=Y=>L.slice(0,Y).reduce((le,_e,me)=>le+(_e.marginLeftKey?F[_e.marginLeftKey]??0:0)+(U.resolved[me]??0),0),ye=Y=>{const le=L[Y];return Fe(Y)+(le.marginLeftKey?F[le.marginLeftKey]??0:0)+(U.resolved[Y]??0)},b=(Y,le,_e)=>{const me=Y.marginLeftKey?F[Y.marginLeftKey]??0:0,{effectiveWidth:J,resolvedWidth:Ke,maxWidth:ke}=_e??z(Y,le),tt=Math.max(me,Un),Ye=o&&le==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Y.prefix,style:{width:D.scalingValue(J,i),...me>0?{marginLeft:D.scalingValue(me,i)}:{}},children:[a.jsx("p",{className:Y.className,style:Y.style,children:Y.text}),Ye&&Y.marginLeftKey?a.jsx("div",{"data-controls":Y.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:D.scalingValue(-me,i),width:D.scalingValue(tt,i),height:"100%",pointerEvents:"auto"}}):null,Ye?a.jsx("div",{"data-controls":Y.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,right:D.scalingValue(-fn/2,i),width:D.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},Y.className)},M=(Y="two-row")=>{const le=g.findIndex(J=>J.prefix==="title1"),_e=le>=0?P[le]:k.title1Width,me=Y==="two-row"&&o;return a.jsx("div",{...me?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(_e)}:{},style:{width:D.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...me?{pointerEvents:"auto"}:{}}})},E=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:B,"aria-hidden":"true",children:" "}),j=Y=>{const le=Kn(e,Y,B,$,T);return a.jsx(a.Fragment,{children:le.map(_e=>b(_e,"single-row",re(le,_e,"single-row")))})},Ce=Y=>{const le=Kn(e,Y,B,$,T),_e=le.find(me=>me.prefix==="title1");return _e?b(_e,"two-row-top",re(le,_e,"two-row-top")):null},Q=(Y,le=!1)=>{const _e=Kn(e,Y,B,$,T),me=_e.filter(ke=>ke.prefix==="title2"||ke.prefix==="title3"),J=o&&le;return me.length>0||J||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[me.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:me.map(ke=>b(ke,"two-row-bottom",re(_e,ke,"two-row-bottom")))}),le&&o?a.jsxs(a.Fragment,{children:[Se(),Me()]}):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:W,width:"100%",flexShrink:0,pointerEvents:J?"auto":"none"}}):null]}):null},Te=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(y??0,i),height:D.scalingValue(y??0,i),marginRight:q,"--close-icon-hover-color":V},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:V,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:q,height:"100%",pointerEvents:"auto"}})]}),ie=()=>ae?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:Te()}):null,ue=Y=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:Y})}),fe=Y=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[ae||de?E():null,ce?M("two-row"):null,ue(Y),ie()]}),K=(Y,le=!1)=>a.jsxs(a.Fragment,{children:[fe(Ce(Y)),Q(Y,le)]}),Z=()=>{const Y=I?-1:g.findIndex(me=>me.prefix==="title1"),le=!I&&(o||(p??0)>0)?(()=>{const me=p??0,J=Y>=0?P[Y]:k.title1Width,Ke=Math.max(me,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(Ke,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,_e=g.flatMap((me,J)=>{if(!me.marginLeftKey)return[];const Ke=F[me.marginLeftKey]??0,ke=kd(g,P,F,J)+xe(),tt=Math.max(Ke,Un);return a.jsx("div",{"data-controls":me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(P[J]),style:{position:"absolute",top:0,left:D.scalingValue(ke,i),width:D.scalingValue(tt,i),height:"100%",pointerEvents:"auto"}},me.marginLeftKey)});return le?[le,..._e]:_e},se=()=>g.map((Y,le)=>{const _e=cn(le,P),J=ee(le)-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(_e),"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"}})},`${Y.widthKey}-junction`)}),Se=()=>L.flatMap((Y,le)=>{if(!Y.marginLeftKey)return[];const _e=F[Y.marginLeftKey]??0,me=Fe(le),J=Math.max(_e,Un),{resolvedWidth:Ke}=z(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(Ke),style:{position:"absolute",top:0,left:D.scalingValue(me,i),width:D.scalingValue(J,i),height:"100%",pointerEvents:"auto"}},Y.marginLeftKey)}),Me=()=>L.map((Y,le)=>{const{maxWidth:_e}=z(Y,"two-row-bottom"),J=ye(le)-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(_e),"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"}})},`${Y.widthKey}-junction`)}),$e=()=>!o||I?null:a.jsxs(a.Fragment,{children:[Z(),se()]}),G=!!(t.title2||t.title3||(m??0)>0||o),pe=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ae||de?E():null,ce?M("single-row"):null,de?ue(j(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ie(),$e()]}),oe=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...G?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:G?void 0:{flex:"0 0 auto",height:"auto"},children:K(t,!0)}),$e()]});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:N,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?oe():pe()})})})]})}function Of(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Bf(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)",zf=72,jf=50,Vf=1e4,Gf=650,Xf=500;function Yf(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 _d(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 qf(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?_d(i,n):null}function Uf(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 Kf=.03;function Nd(e){return e.width*Kf}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 Zf(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 Jf(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ss(e,t.width,t.height)}function Qf(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 ey(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 ty({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=Nd(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 ny(e,t,n){const{left:i,width:o}=n,r=Nd(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 Wd(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 iy(e,t,n,i){const{start:o,end:r}=Wd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function oy(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 Hd(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(Hd(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 ry(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function ay(e){const[t]=e.media;return t!=null&&t.url?t:null}function Us(e){if(!Array.isArray(e)||e.length===0)return[];if(Hd(e)){const t=[];for(const n of e){const i=ry(n);if(!i)continue;const o=ay(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 sy({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 ly({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 cy({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:b,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:v}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),V=s.useRef(new Map),[N,q]=s.useState(0),W=s.useRef(null),I=s.useRef(0),B=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),k=s.useRef(!1),A=s.useRef(!1),g=s.useRef(null),O=s.useRef(null),P=s.useRef(null),X=s.useRef(()=>{}),ne=s.useRef(null),L=s.useRef(null),H=s.useRef(null),U=s.useRef(!1),[de,ae]=s.useState(null),[F,ce]=s.useState(La),[z,re]=s.useState(0),[te,ye]=s.useState("opening"),[Fe,fe]=s.useState(0),[w,M]=s.useState(0),[E,j]=s.useState(!1),[Te,ee]=s.useState(null),[$e,J]=s.useState(null),[me,Se]=s.useState(null),[K,Z]=s.useState(!1),[se,we]=s.useState(null),[Me,Ce]=s.useState(!1),G=s.useRef(!1),[ue,oe]=s.useState(!1),[Y,le]=s.useState(!1),_e=s.useRef(n),pe=s.useRef(void 0),Q=t[n],Ke=Q?mo(Q):!1,ke=w!==0||E,tt=!l&&(!r||!!d),Ye=c&&!l,dt=u.length>1,ot=s.useCallback((_,Pe)=>t.length<=1?null:t[(_+Pe+t.length)%t.length]??null,[t]),Ve=dt?$o(u,p,-1):ot(n,-1),Re=dt?$o(u,p,1):ot(n,1),He=Te===-1&&ke?dt&&$e!==null?$o(u,$e,-1):me!==null?ot(me,-1):null:null,Be=Te===1&&ke?dt&&$e!==null?$o(u,$e,1):me!==null?ot(me,1):null:null,Ze=He&&He.url!==(Ve==null?void 0:Ve.url)?He:null,he=Be&&Be.url!==(Re==null?void 0:Re.url)?Be:null,xe=Ve&&Ye?(()=>{const _=dt?Wl(u,p,-1):t.length>2?ot((n-1+t.length)%t.length,-1):null;return _&&_.url!==Ve.url?_:null})():null,We=Re&&Ye?(()=>{const _=dt?Wl(u,p,1):t.length>2?ot((n+1)%t.length,1):null;return _&&_.url!==Re.url?_:null})():null,Je=Ze??xe,ve=he??We,Ie=s.useCallback((_,Pe,Ne)=>{if(!_||!Pe||!Ne)return;const Oe=V.current,lt=Oe.get(_);(lt==null?void 0:lt.width)===Pe&&(lt==null?void 0:lt.height)===Ne||(Oe.set(_,{width:Pe,height:Ne}),q(Et=>Et+1))},[]),qe=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Pe=V.current.get(_.url);return Jf(y.current,Pe)},[N,z]),ze=s.useCallback(()=>{if(!Q)return;const _=qe(Q);if(_){ae(_);return}const Pe=y.current;Pe&&ae(Hl(Pe))},[Q,qe]),Le=s.useCallback(_=>{if(dt){const Pe=u.length;J((p+_+Pe)%Pe),Se(null);return}t.length>1&&(Se((n+_+t.length)%t.length),J(null))},[dt,u.length,p,t.length,n]),Ge=s.useCallback(_=>{A.current=_,j(_)},[]),De=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),nt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{De(),Ge(!1)},fo+32)},[De,Ge]),it=s.useCallback(()=>{const _=C.current;if(!_){ce({left:0,top:0,width:typeof window<"u"?window.innerWidth:La.width,height:typeof window<"u"?window.innerHeight:La.height});return}const Pe=_.getBoundingClientRect();ce({left:Pe.left,top:Pe.top,width:Pe.width,height:Pe.height})},[]),ct=s.useCallback((_,Pe)=>{if(ke){if(ue&&!E)return`translate(${w}px, 0px)`;if(E&&Te!==null){const Ne=qe(_);if(!Ne)return;const{x:Oe,y:lt}=iy(Ne,Pe,Te,F);return`translate(${Oe}px, ${lt}px)`}if(E)return"translate(0px, 0px)"}},[ke,ue,E,w,Te,F,qe]),St=s.useCallback(()=>{const _=O.current;O.current=null,De(),Ge(!1),ee(null),J(null),Se(null),M(0),oe(!1),T.current=!1,B.current=0,$.current="none",_===-1?f():_===1&&v()},[De,Ge,f,v]),Bt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{O.current!==null&&St()},fo+32)},[De,St]),zt=s.useCallback(()=>{De(),O.current=null,Ge(!1),ee(null),J(null),Se(null),M(0),oe(!1),T.current=!1,B.current=0,$.current="none"},[De,Ge]),ft=s.useCallback(_=>{if(!(!Ye||!de)){if(A.current){if(O.current===_){P.current=_,St();return}zt()}De(),Le(_),O.current=_,ee(_),Ge(!0),Bt()}},[Ye,de,St,zt,De,Le,Ge,Bt]);X.current=ft;const wt=s.useCallback(()=>{ne.current=null,U.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),jt=s.useCallback(_=>{L.current!==null&&window.clearInterval(L.current);const Pe=U.current?Xf:Gf;L.current=window.setInterval(()=>{X.current(_)},Pe)},[]),At=s.useCallback(_=>{ne.current!==_&&(wt(),ne.current=_,U.current=!1,X.current(_),jt(_),H.current=window.setTimeout(()=>{H.current=null,ne.current===_&&(U.current=!0,jt(_))},Vf))},[wt,jt]),vt=s.useCallback(()=>{const _=y.current;if(!_)return;const Pe=Q==null?void 0:Q.url,Ne=Pe?V.current.get(Pe):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){ae(ss(_,Ne.width,Ne.height));return}const Oe=S.current;if(Oe&&Pe&&(Oe.src===Pe||Oe.currentSrc===Pe)){const{width:Et,height:rt}=Zf(Oe);if(Et&&rt){Ie(Pe,Et,rt),ae(ss(_,Et,rt));return}}const lt=Hl(_);!lt.width||!lt.height||ae(lt)},[Q==null?void 0:Q.url,Ie]),Ft=s.useCallback(_=>{if(S.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&vt();return}_.complete&&_.naturalWidth>0&&vt()}},[vt]),Nt=s.useCallback(()=>{it(),vt(),re(_=>_+1)},[it,vt]);s.useEffect(()=>{Nt();const _=y.current,Pe=C.current,Ne=new ResizeObserver(()=>Nt());return _&&Ne.observe(_),Pe&&Ne.observe(Pe),window.addEventListener("resize",Nt),()=>{Ne.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,x]),s.useLayoutEffect(()=>{if(!Q)return;const _=S.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){vt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&vt()}},[Q==null?void 0:Q.url,n,vt]),s.useEffect(()=>{ze()},[ze,N]),s.useEffect(()=>{const _=new Set,Pe=[],Ne=Oe=>{!(Oe!=null&&Oe.url)||_.has(Oe.url)||(_.add(Oe.url),Pe.push(Oe))};t.forEach(Ne),u.forEach(Oe=>Oe.items.forEach(Ne)),Pe.forEach(Oe=>{V.current.has(Oe.url)||Qf(Oe,Ie)})},[t,u,Ie]),s.useEffect(()=>{if(te!=="opening"||!de)return;if(!b){ye("open");return}Z(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(!0),ye("open")})});return()=>cancelAnimationFrame(_)},[te,de,b]),s.useEffect(()=>{if(te!=="closing")return;const _=setTimeout(()=>h(),Tn);return()=>clearTimeout(_)},[te,h]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{_e.current===n&&pe.current===(Q==null?void 0:Q.url)||(De(),O.current=null,ee(null),J(null),Se(null),fe(0),M(0),Ge(!1),le(!1),oe(!1),I.current=0,B.current=0,$.current="none",T.current=!1,W.current=null,k.current=!1,S.current=null,ze(),_e.current=n,pe.current=Q==null?void 0:Q.url)},[n,Q==null?void 0:Q.url,Ge,De,ze]),s.useLayoutEffect(()=>{const _=P.current;_!==null&&(P.current=null,requestAnimationFrame(()=>{X.current(_)}))},[n,p,Q==null?void 0:Q.url]),s.useLayoutEffect(()=>{if(te==="opening"){G.current=!1,Ce(!1);return}if(te!=="open"||G.current)return;if(!Ve&&!Re){G.current=!0;return}Ce(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),G.current=!0})});return()=>cancelAnimationFrame(_)},[te,Ve==null?void 0:Ve.url,Re==null?void 0:Re.url]),s.useEffect(()=>{if(te!=="open")return;const _=()=>{const rt=xt=>{xt.stopPropagation(),xt.preventDefault(),document.removeEventListener("click",rt,!0)};document.addEventListener("click",rt,!0)},Pe=rt=>{const xt=rt<0?1:-1;De(),Le(xt),O.current=xt,ee(xt),Ge(!0),Bt()},Ne=rt=>{if(Math.abs(rt)>jf&&Ye){Pe(rt);return}O.current=null,ee(null),J(null),Se(null),Ge(!0),M(0),nt()},Oe=rt=>{if(rt.touches.length!==1||A.current)return;const xt=rt.touches[0];k.current=!0,W.current={x:xt.clientX,y:xt.clientY},$.current="none",B.current=0,T.current=!1},lt=rt=>{if(!W.current||rt.touches.length!==1||A.current)return;const xt=rt.touches[0],Ot=xt.clientX-W.current.x,It=xt.clientY-W.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Ye)return;$.current="horizontal"}else if(It>0){if(!tt)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,oe(!0),B.current=Ot,M(Ot),rt.preventDefault();return}$.current==="vertical"&&(T.current=!0,oe(!0),I.current=It,fe(It),rt.preventDefault())},Et=()=>{if(!W.current)return;const rt=$.current,xt=T.current;if(xt&&rt==="horizontal")Ne(B.current),_();else if(xt&&rt==="vertical"){const Ot=I.current;if(tt&&Ot>zf){const It=window.innerHeight;I.current=It,le(!0),fe(It),ye("closing")}else I.current=0,fe(0);_()}else rt==="horizontal"&&Math.abs(B.current)>0&&(Ne(B.current),_());W.current=null,$.current="none",B.current=0,T.current=!1,oe(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",lt,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",lt),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[te,Ye,Ge,nt,De,tt,Bt,Le]);const Kt=s.useCallback(()=>{const _=(m==null?void 0:m())??b??null;_&&de&&(we(_),Z(!0)),ye("closing")},[m,b,de]);s.useEffect(()=>{const _=Oe=>{if(Oe.key==="Escape"){if(r&&d||te==="closing")return;wt(),Kt();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||te!=="open"||!Ye)return;Oe.preventDefault();const lt=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&ne.current===lt||At(lt)},Pe=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const lt=Oe.key==="ArrowLeft"?-1:1;ne.current===lt&&wt()},Ne=()=>{wt()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Pe),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Pe),window.removeEventListener("blur",Ne),wt()}},[te,r,d,Kt,Ye,At,wt]),s.useEffect(()=>{te!=="open"&&wt()},[te,wt]);const Jt=()=>{te==="closing"||l||Kt()},Tt=te==="open",Wt=te==="closing",rn=Fe>0?Math.max(0,1-Fe/500):1,gt=Fe>0?Math.max(.35,1-Fe/500):1,Ae=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!A.current)){if(O.current!==null){St();return}De(),Ge(!1)}},[De,Ge,St]),Xe=te==="closing"?se??b:b,st=Xe&&de&&(te==="opening"||Wt)?Yf(Xe,de):void 0,ht=ke&&Q?ct(Q,"center"):Fe>0?`translateY(${Fe}px)`:st,yt=de?pr(de,F):null,Lt=!!(Xe&&de),mt=Lt&&(te==="closing"||te==="open"&&K),Vt={position:"absolute",top:yt==null?void 0:yt.top,left:yt==null?void 0:yt.left,width:yt==null?void 0:yt.width,height:yt==null?void 0:yt.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:Fe>0?gt:Lt?1:te==="opening"||Wt?0:1,transition:ue&&!E?"none":E?`transform ${fo}ms ${pn}`:Y?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:mt?`transform ${Tn}ms ${pn}`:te==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Ke&&Tt&&!ke?"auto":"none",touchAction:Ke&&Tt?"none":void 0,zIndex:1,overflow:Ke?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!ke?"auto":"none"},Mt=(_,Pe,Ne="adjacent")=>{const Oe=qe(_);if(!Oe)return{display:"none"};const lt=Ne==="far"?Pe==="left"?"far-left":"far-right":Pe==="left"?"left-adjacent":"right-adjacent",{start:Et}=Te!==null?Wd(Oe,lt,Te,F):{start:Ne==="far"?Br(Oe,Pe,F):eo(Oe,Pe,F)},rt=pr(Et,F),xt=ct(_,lt),Ot=!ke&&Ne==="adjacent"&&Tt&&!Me?oy(Oe,Pe,F):null,It=Ne==="far"&&ke&&Te===(Pe==="left"?-1:1),nn=ue&&!E?!1:E,un=Ne==="adjacent"&&Tt&&Me&&!ke;return{position:"absolute",top:rt.top,left:rt.left,width:rt.width,height:rt.height,objectFit:"contain",transform:xt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ne==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Ne==="far"?`transform ${fo}ms ${pn}`:`transform ${fo}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:te==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Xt=(_,Pe)=>{const Ne=qe(_);return Ne?ny(eo(Ne,Pe,F),Pe,F):null},Yt=_=>Pe=>{if(!l){if(k.current){k.current=!1;return}Pe.stopPropagation(),ft(_)}},Ht=Ve?Xt(Ve,"left"):null,Dt=Re?Xt(Re,"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:te==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:ue?"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:ue?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(Fd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&Je&&a.jsx(mr,{media:Je,style:Mt(Je,"left","far"),onMeasure:Ie,onTransitionEnd:Ae},`far-prev-${Je.url}`),Tt&&Ve&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Ve,style:Mt(Ve,"left"),onMeasure:Ie,onTransitionEnd:Ae},`prev-${Ve.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||ue?"default":"pointer",pointerEvents:l||ue?"none":"auto",zIndex:3},onClick:Yt(-1)})]}),Tt&&Re&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Re,style:Mt(Re,"right"),onMeasure:Ie,onTransitionEnd:Ae},`next-${Re.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||ue?"default":"pointer",pointerEvents:l||ue?"none":"auto",zIndex:3},onClick:Yt(1)})]}),Tt&&ve&&a.jsx(mr,{media:ve,style:Mt(ve,"right","far"),onMeasure:Ie,onTransitionEnd:Ae},`far-next-${ve.url}`),de&&Q&&(Ke?a.jsx(ly,{src:Q.url,phase:te,onMediaElement:Ft,wrapperStyle:Vt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Ae},`${n}-${Q.url}`):a.jsx("img",{ref:Ft,src:Q.url,alt:Q.name,onLoad:vt,onTransitionEnd:Ae,style:Vt},`${n}-${Q.url}`))]})}function dy({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,b=(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}`,V=c.entryWidth??.2,N=c.columnsCount,q=D.scalingValue(V,n),W=D.scalingValue(c.horizontalGap??0,n),I=q,B=q,$={width:I,...b?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},T=b?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},k=s.useRef(null),[A,g]=s.useState(!1),[O,P]=s.useState([]),[X,ne]=s.useState(0),[L,H]=s.useState(0),[U,de]=s.useState(null),[ae,F]=s.useState({title1:"",title2:"",title3:""}),ce=(()=>{const me={},Se=k.current?getComputedStyle(k.current).getPropertyValue("--cntrl-article-width").trim():"";return Se&&(me["--cntrl-article-width"]=Se),me})(),z=!n||i||o,re=s.useMemo(()=>Bf(d),[d]),te=t??[],ye=te.length%N||N,Fe=ye<N&&te.length>0,fe=te.length-ye,w=Fe?Math.floor((N-ye)/2)+1:1,M=s.useMemo(()=>Uf(te),[te]),E=s.useMemo(()=>ey(te),[te]),j=(me,Se,K)=>{if(n&&!o&&!i)return;const Z=M.findIndex(we=>we.gridIndex===me);if(Z<0)return;const se=M[Z];H(Z),P(se.items),ne(Se),F(se.entry),de(K??null),g(!0)},Te=s.useCallback(()=>{g(!1),de(null)},[]),ee=s.useCallback(()=>{const me=M[L];return!me||!k.current?U:qf(k.current,me.gridIndex,b?"cover":"contain")??U},[M,L,U,b]),$e=s.useCallback(me=>{if(M.length>1){const Se=M.length,K=(L+me+Se)%Se,Z=M[K],se=Math.min(X,Z.items.length-1);H(K),P(Z.items),ne(se),F(Z.entry);return}ne(Se=>(Se+me+O.length)%O.length)},[M,L,X,O.length]),J=M.length>1||O.length>1;return s.useEffect(()=>{if(!A||typeof document>"u")return;const me=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=me}},[A]),s.useEffect(()=>{!n||o||i||g(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:re}}),a.jsx(ty,{mediaList:E}),a.jsx("div",{ref:k,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${N}, ${q})`,rowGap:0,columnGap:W,width:D.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:D.scalingValue(u??0,n)},children:te.map((me,Se)=>{const K=qs(me.gallery),Z=Us(K),se=Z.filter(oe=>oe.lightboxMedia).map(oe=>oe.lightboxMedia),we=Math.floor(Se/N)===Math.ceil(te.length/N)-1,Me=Fe&&Se>=fe?`${w+(Se-fe)}`:void 0,Ce=Z[0],G=Ce!=null&&Ce.lightboxMedia?se.findIndex(oe=>oe.url===Ce.lightboxMedia.url):-1,ue=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:Z.length>0&&a.jsx(sy,{media:Ce.displayMedia,gridIndex:Se,className:`${d}-item-${mo(Ce.displayMedia)?"video":"image"}`.trim(),style:T,onMediaClick:z&&G>=0?oe=>j(Se,G,_d(oe.currentTarget,b?"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:q,...Me?{gridColumn:Me}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:B}})}),a.jsx("a",{className:`${d}-item-image-link`,children:ue}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:B}})})]})},Se)})}),A&&typeof document<"u"&&(()=>{const me=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:ce,"data-selection":"none",children:a.jsx(cy,{prefix:d,items:O,index:X,entry:ae,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:J,lightboxEntries:M,entryIdx:L,layoutId:r,sourceRect:U,resolveCloseSourceRect:ee,onClose:Te,onPrev:()=>$e(-1),onNext:()=>$e(1)})}),me)})()]})}const uy=`import { CommonComponentProps } from '../props';
7509
+ `}const Nl={url:"",name:"",objectFit:"cover"},Tn=500,fo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",zf=72,jf=50,Vf=1e4,Gf=650,Xf=500;function Yf(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 _d(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 qf(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?_d(i,n):null}function Uf(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 Kf=.03;function Nd(e){return e.width*Kf}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 Zf(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 Jf(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ss(e,t.width,t.height)}function Qf(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 ey(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 ty({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=Nd(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 ny(e,t,n){const{left:i,width:o}=n,r=Nd(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 Wd(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 iy(e,t,n,i){const{start:o,end:r}=Wd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function oy(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 Hd(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(Hd(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 ry(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function ay(e){const[t]=e.media;return t!=null&&t.url?t:null}function Us(e){if(!Array.isArray(e)||e.length===0)return[];if(Hd(e)){const t=[];for(const n of e){const i=ry(n);if(!i)continue;const o=ay(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 sy({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 ly({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 cy({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),V=s.useRef(new Map),[N,q]=s.useState(0),W=s.useRef(null),I=s.useRef(0),B=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),k=s.useRef(!1),F=s.useRef(!1),g=s.useRef(null),O=s.useRef(null),P=s.useRef(null),X=s.useRef(()=>{}),te=s.useRef(null),L=s.useRef(null),H=s.useRef(null),U=s.useRef(!1),[de,ae]=s.useState(null),[A,ce]=s.useState(La),[z,re]=s.useState(0),[ee,xe]=s.useState("opening"),[Fe,ye]=s.useState(0),[b,M]=s.useState(0),[E,j]=s.useState(!1),[Ce,Q]=s.useState(null),[Te,ie]=s.useState(null),[ue,fe]=s.useState(null),[K,Z]=s.useState(!1),[se,Se]=s.useState(null),[Me,$e]=s.useState(!1),G=s.useRef(!1),[pe,oe]=s.useState(!1),[Y,le]=s.useState(!1),_e=s.useRef(n),me=s.useRef(void 0),J=t[n],Ke=J?mo(J):!1,ke=b!==0||E,tt=!l&&(!r||!!d),Ye=c&&!l,dt=u.length>1,ot=s.useCallback((_,Pe)=>t.length<=1?null:t[(_+Pe+t.length)%t.length]??null,[t]),Ve=dt?$o(u,p,-1):ot(n,-1),Re=dt?$o(u,p,1):ot(n,1),He=Ce===-1&&ke?dt&&Te!==null?$o(u,Te,-1):ue!==null?ot(ue,-1):null:null,Be=Ce===1&&ke?dt&&Te!==null?$o(u,Te,1):ue!==null?ot(ue,1):null:null,Ze=He&&He.url!==(Ve==null?void 0:Ve.url)?He:null,he=Be&&Be.url!==(Re==null?void 0:Re.url)?Be:null,ve=Ve&&Ye?(()=>{const _=dt?Wl(u,p,-1):t.length>2?ot((n-1+t.length)%t.length,-1):null;return _&&_.url!==Ve.url?_:null})():null,We=Re&&Ye?(()=>{const _=dt?Wl(u,p,1):t.length>2?ot((n+1)%t.length,1):null;return _&&_.url!==Re.url?_:null})():null,Je=Ze??ve,be=he??We,Ie=s.useCallback((_,Pe,Ne)=>{if(!_||!Pe||!Ne)return;const Oe=V.current,lt=Oe.get(_);(lt==null?void 0:lt.width)===Pe&&(lt==null?void 0:lt.height)===Ne||(Oe.set(_,{width:Pe,height:Ne}),q(Et=>Et+1))},[]),qe=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Pe=V.current.get(_.url);return Jf(y.current,Pe)},[N,z]),ze=s.useCallback(()=>{if(!J)return;const _=qe(J);if(_){ae(_);return}const Pe=y.current;Pe&&ae(Hl(Pe))},[J,qe]),Le=s.useCallback(_=>{if(dt){const Pe=u.length;ie((p+_+Pe)%Pe),fe(null);return}t.length>1&&(fe((n+_+t.length)%t.length),ie(null))},[dt,u.length,p,t.length,n]),Ge=s.useCallback(_=>{F.current=_,j(_)},[]),De=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),nt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{De(),Ge(!1)},fo+32)},[De,Ge]),it=s.useCallback(()=>{const _=C.current;if(!_){ce({left:0,top:0,width:typeof window<"u"?window.innerWidth:La.width,height:typeof window<"u"?window.innerHeight:La.height});return}const Pe=_.getBoundingClientRect();ce({left:Pe.left,top:Pe.top,width:Pe.width,height:Pe.height})},[]),ct=s.useCallback((_,Pe)=>{if(ke){if(pe&&!E)return`translate(${b}px, 0px)`;if(E&&Ce!==null){const Ne=qe(_);if(!Ne)return;const{x:Oe,y:lt}=iy(Ne,Pe,Ce,A);return`translate(${Oe}px, ${lt}px)`}if(E)return"translate(0px, 0px)"}},[ke,pe,E,b,Ce,A,qe]),St=s.useCallback(()=>{const _=O.current;O.current=null,De(),Ge(!1),Q(null),ie(null),fe(null),M(0),oe(!1),T.current=!1,B.current=0,$.current="none",_===-1?f():_===1&&v()},[De,Ge,f,v]),Bt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{O.current!==null&&St()},fo+32)},[De,St]),zt=s.useCallback(()=>{De(),O.current=null,Ge(!1),Q(null),ie(null),fe(null),M(0),oe(!1),T.current=!1,B.current=0,$.current="none"},[De,Ge]),ft=s.useCallback(_=>{if(!(!Ye||!de)){if(F.current){if(O.current===_){P.current=_,St();return}zt()}De(),Le(_),O.current=_,Q(_),Ge(!0),Bt()}},[Ye,de,St,zt,De,Le,Ge,Bt]);X.current=ft;const wt=s.useCallback(()=>{te.current=null,U.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),jt=s.useCallback(_=>{L.current!==null&&window.clearInterval(L.current);const Pe=U.current?Xf:Gf;L.current=window.setInterval(()=>{X.current(_)},Pe)},[]),At=s.useCallback(_=>{te.current!==_&&(wt(),te.current=_,U.current=!1,X.current(_),jt(_),H.current=window.setTimeout(()=>{H.current=null,te.current===_&&(U.current=!0,jt(_))},Vf))},[wt,jt]),vt=s.useCallback(()=>{const _=y.current;if(!_)return;const Pe=J==null?void 0:J.url,Ne=Pe?V.current.get(Pe):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){ae(ss(_,Ne.width,Ne.height));return}const Oe=S.current;if(Oe&&Pe&&(Oe.src===Pe||Oe.currentSrc===Pe)){const{width:Et,height:rt}=Zf(Oe);if(Et&&rt){Ie(Pe,Et,rt),ae(ss(_,Et,rt));return}}const lt=Hl(_);!lt.width||!lt.height||ae(lt)},[J==null?void 0:J.url,Ie]),Ft=s.useCallback(_=>{if(S.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&vt();return}_.complete&&_.naturalWidth>0&&vt()}},[vt]),Nt=s.useCallback(()=>{it(),vt(),re(_=>_+1)},[it,vt]);s.useEffect(()=>{Nt();const _=y.current,Pe=C.current,Ne=new ResizeObserver(()=>Nt());return _&&Ne.observe(_),Pe&&Ne.observe(Pe),window.addEventListener("resize",Nt),()=>{Ne.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,x]),s.useLayoutEffect(()=>{if(!J)return;const _=S.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){vt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&vt()}},[J==null?void 0:J.url,n,vt]),s.useEffect(()=>{ze()},[ze,N]),s.useEffect(()=>{const _=new Set,Pe=[],Ne=Oe=>{!(Oe!=null&&Oe.url)||_.has(Oe.url)||(_.add(Oe.url),Pe.push(Oe))};t.forEach(Ne),u.forEach(Oe=>Oe.items.forEach(Ne)),Pe.forEach(Oe=>{V.current.has(Oe.url)||Qf(Oe,Ie)})},[t,u,Ie]),s.useEffect(()=>{if(ee!=="opening"||!de)return;if(!w){xe("open");return}Z(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(!0),xe("open")})});return()=>cancelAnimationFrame(_)},[ee,de,w]),s.useEffect(()=>{if(ee!=="closing")return;const _=setTimeout(()=>h(),Tn);return()=>clearTimeout(_)},[ee,h]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{_e.current===n&&me.current===(J==null?void 0:J.url)||(De(),O.current=null,Q(null),ie(null),fe(null),ye(0),M(0),Ge(!1),le(!1),oe(!1),I.current=0,B.current=0,$.current="none",T.current=!1,W.current=null,k.current=!1,S.current=null,ze(),_e.current=n,me.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,Ge,De,ze]),s.useLayoutEffect(()=>{const _=P.current;_!==null&&(P.current=null,requestAnimationFrame(()=>{X.current(_)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(ee==="opening"){G.current=!1,$e(!1);return}if(ee!=="open"||G.current)return;if(!Ve&&!Re){G.current=!0;return}$e(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{$e(!0),G.current=!0})});return()=>cancelAnimationFrame(_)},[ee,Ve==null?void 0:Ve.url,Re==null?void 0:Re.url]),s.useEffect(()=>{if(ee!=="open")return;const _=()=>{const rt=xt=>{xt.stopPropagation(),xt.preventDefault(),document.removeEventListener("click",rt,!0)};document.addEventListener("click",rt,!0)},Pe=rt=>{const xt=rt<0?1:-1;De(),Le(xt),O.current=xt,Q(xt),Ge(!0),Bt()},Ne=rt=>{if(Math.abs(rt)>jf&&Ye){Pe(rt);return}O.current=null,Q(null),ie(null),fe(null),Ge(!0),M(0),nt()},Oe=rt=>{if(rt.touches.length!==1||F.current)return;const xt=rt.touches[0];k.current=!0,W.current={x:xt.clientX,y:xt.clientY},$.current="none",B.current=0,T.current=!1},lt=rt=>{if(!W.current||rt.touches.length!==1||F.current)return;const xt=rt.touches[0],Ot=xt.clientX-W.current.x,It=xt.clientY-W.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Ye)return;$.current="horizontal"}else if(It>0){if(!tt)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,oe(!0),B.current=Ot,M(Ot),rt.preventDefault();return}$.current==="vertical"&&(T.current=!0,oe(!0),I.current=It,ye(It),rt.preventDefault())},Et=()=>{if(!W.current)return;const rt=$.current,xt=T.current;if(xt&&rt==="horizontal")Ne(B.current),_();else if(xt&&rt==="vertical"){const Ot=I.current;if(tt&&Ot>zf){const It=window.innerHeight;I.current=It,le(!0),ye(It),xe("closing")}else I.current=0,ye(0);_()}else rt==="horizontal"&&Math.abs(B.current)>0&&(Ne(B.current),_());W.current=null,$.current="none",B.current=0,T.current=!1,oe(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",lt,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",lt),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[ee,Ye,Ge,nt,De,tt,Bt,Le]);const Kt=s.useCallback(()=>{const _=(m==null?void 0:m())??w??null;_&&de&&(Se(_),Z(!0)),xe("closing")},[m,w,de]);s.useEffect(()=>{const _=Oe=>{if(Oe.key==="Escape"){if(r&&d||ee==="closing")return;wt(),Kt();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||ee!=="open"||!Ye)return;Oe.preventDefault();const lt=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&te.current===lt||At(lt)},Pe=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const lt=Oe.key==="ArrowLeft"?-1:1;te.current===lt&&wt()},Ne=()=>{wt()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Pe),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Pe),window.removeEventListener("blur",Ne),wt()}},[ee,r,d,Kt,Ye,At,wt]),s.useEffect(()=>{ee!=="open"&&wt()},[ee,wt]);const Jt=()=>{ee==="closing"||l||Kt()},Tt=ee==="open",Wt=ee==="closing",rn=Fe>0?Math.max(0,1-Fe/500):1,gt=Fe>0?Math.max(.35,1-Fe/500):1,Ae=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!F.current)){if(O.current!==null){St();return}De(),Ge(!1)}},[De,Ge,St]),Xe=ee==="closing"?se??w:w,st=Xe&&de&&(ee==="opening"||Wt)?Yf(Xe,de):void 0,ht=ke&&J?ct(J,"center"):Fe>0?`translateY(${Fe}px)`:st,yt=de?pr(de,A):null,Lt=!!(Xe&&de),mt=Lt&&(ee==="closing"||ee==="open"&&K),Vt={position:"absolute",top:yt==null?void 0:yt.top,left:yt==null?void 0:yt.left,width:yt==null?void 0:yt.width,height:yt==null?void 0:yt.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:Fe>0?gt:Lt?1:ee==="opening"||Wt?0:1,transition:pe&&!E?"none":E?`transform ${fo}ms ${pn}`:Y?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:mt?`transform ${Tn}ms ${pn}`:ee==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Ke&&Tt&&!ke?"auto":"none",touchAction:Ke&&Tt?"none":void 0,zIndex:1,overflow:Ke?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!ke?"auto":"none"},Mt=(_,Pe,Ne="adjacent")=>{const Oe=qe(_);if(!Oe)return{display:"none"};const lt=Ne==="far"?Pe==="left"?"far-left":"far-right":Pe==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ce!==null?Wd(Oe,lt,Ce,A):{start:Ne==="far"?Br(Oe,Pe,A):eo(Oe,Pe,A)},rt=pr(Et,A),xt=ct(_,lt),Ot=!ke&&Ne==="adjacent"&&Tt&&!Me?oy(Oe,Pe,A):null,It=Ne==="far"&&ke&&Ce===(Pe==="left"?-1:1),nn=pe&&!E?!1:E,un=Ne==="adjacent"&&Tt&&Me&&!ke;return{position:"absolute",top:rt.top,left:rt.left,width:rt.width,height:rt.height,objectFit:"contain",transform:xt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ne==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Ne==="far"?`transform ${fo}ms ${pn}`:`transform ${fo}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:ee==="opening"||Wt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Xt=(_,Pe)=>{const Ne=qe(_);return Ne?ny(eo(Ne,Pe,A),Pe,A):null},Yt=_=>Pe=>{if(!l){if(k.current){k.current=!1;return}Pe.stopPropagation(),ft(_)}},Ht=Ve?Xt(Ve,"left"):null,Dt=Re?Xt(Re,"right"):null,_t=Ht?pr(Ht,A):null,Ct=Dt?pr(Dt,A):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ee==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:pe?"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:pe?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(Fd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&Je&&a.jsx(mr,{media:Je,style:Mt(Je,"left","far"),onMeasure:Ie,onTransitionEnd:Ae},`far-prev-${Je.url}`),Tt&&Ve&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Ve,style:Mt(Ve,"left"),onMeasure:Ie,onTransitionEnd:Ae},`prev-${Ve.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Yt(-1)})]}),Tt&&Re&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Re,style:Mt(Re,"right"),onMeasure:Ie,onTransitionEnd:Ae},`next-${Re.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Yt(1)})]}),Tt&&be&&a.jsx(mr,{media:be,style:Mt(be,"right","far"),onMeasure:Ie,onTransitionEnd:Ae},`far-next-${be.url}`),de&&J&&(Ke?a.jsx(ly,{src:J.url,phase:ee,onMediaElement:Ft,wrapperStyle:Vt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Ae},`${n}-${J.url}`):a.jsx("img",{ref:Ft,src:J.url,alt:J.name,onLoad:vt,onTransitionEnd:Ae,style:Vt},`${n}-${J.url}`))]})}function dy({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}`,V=c.entryWidth??.2,N=c.columnsCount,q=D.scalingValue(V,n),W=D.scalingValue(c.horizontalGap??0,n),I=q,B=q,$={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),[F,g]=s.useState(!1),[O,P]=s.useState([]),[X,te]=s.useState(0),[L,H]=s.useState(0),[U,de]=s.useState(null),[ae,A]=s.useState({title1:"",title2:"",title3:""}),ce=(()=>{const ue={},fe=k.current?getComputedStyle(k.current).getPropertyValue("--cntrl-article-width").trim():"";return fe&&(ue["--cntrl-article-width"]=fe),ue})(),z=!n||i||o,re=s.useMemo(()=>Bf(d),[d]),ee=t??[],xe=ee.length%N||N,Fe=xe<N&&ee.length>0,ye=ee.length-xe,b=Fe?Math.floor((N-xe)/2)+1:1,M=s.useMemo(()=>Uf(ee),[ee]),E=s.useMemo(()=>ey(ee),[ee]),j=(ue,fe,K)=>{if(n&&!o&&!i)return;const Z=M.findIndex(Se=>Se.gridIndex===ue);if(Z<0)return;const se=M[Z];H(Z),P(se.items),te(fe),A(se.entry),de(K??null),g(!0)},Ce=s.useCallback(()=>{g(!1),de(null)},[]),Q=s.useCallback(()=>{const ue=M[L];return!ue||!k.current?U:qf(k.current,ue.gridIndex,w?"cover":"contain")??U},[M,L,U,w]),Te=s.useCallback(ue=>{if(M.length>1){const fe=M.length,K=(L+ue+fe)%fe,Z=M[K],se=Math.min(X,Z.items.length-1);H(K),P(Z.items),te(se),A(Z.entry);return}te(fe=>(fe+ue+O.length)%O.length)},[M,L,X,O.length]),ie=M.length>1||O.length>1;return s.useEffect(()=>{if(!F||typeof document>"u")return;const ue=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ue}},[F]),s.useEffect(()=>{!n||o||i||g(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:re}}),a.jsx(ty,{mediaList:E}),a.jsx("div",{ref:k,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${N}, ${q})`,rowGap:0,columnGap:W,width:D.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:D.scalingValue(u??0,n)},children:ee.map((ue,fe)=>{const K=qs(ue.gallery),Z=Us(K),se=Z.filter(oe=>oe.lightboxMedia).map(oe=>oe.lightboxMedia),Se=Math.floor(fe/N)===Math.ceil(ee.length/N)-1,Me=Fe&&fe>=ye?`${b+(fe-ye)}`:void 0,$e=Z[0],G=$e!=null&&$e.lightboxMedia?se.findIndex(oe=>oe.url===$e.lightboxMedia.url):-1,pe=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:Z.length>0&&a.jsx(sy,{media:$e.displayMedia,gridIndex:fe,className:`${d}-item-${mo($e.displayMedia)?"video":"image"}`.trim(),style:T,onMediaClick:z&&G>=0?oe=>j(fe,G,_d(oe.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`,Se?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:q,...Me?{gridColumn:Me}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:B}})}),a.jsx("a",{className:`${d}-item-image-link`,children:pe}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:B}})})]})},fe)})}),F&&typeof document<"u"&&(()=>{const ue=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:ce,"data-selection":"none",children:a.jsx(cy,{prefix:d,items:O,index:X,entry:ae,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ie,lightboxEntries:M,entryIdx:L,layoutId:r,sourceRect:U,resolveCloseSourceRect:Q,onClose:Ce,onPrev:()=>Te(-1),onNext:()=>Te(1)})}),ue)})()]})}const uy=`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
- `,py="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 my(e){const t={};return t[at(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSettings")]={...mi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSize")]={...mi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[at(e,"lineHeight")]={...mi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[at(e,"letterSpacing")]={...mi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[at(e,"wordSpacing")]={...mi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[at(e,"textAlign")]={...mi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[at(e,"textAppearance")]={...mi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const to=oi.filter(e=>e!=="count"),gy=to.reduce((e,t)=>({...e,...my(t)}),{}),hy=to.reduce((e,t)=>({...e,[at(t,"fontFamily")]:"Arial",[at(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[at(t,"letterSpacing")]:0,[at(t,"wordSpacing")]:0,[at(t,"textAlign")]:"left",[at(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[at(n,"fontSize")]=i),o!==void 0&&(t[at(n,"lineHeight")]=o),t},{})}const fy={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(to.map(e=>[Xs[e],Ys(e)]))},yy={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},xy=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...yy,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),vy={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:xy},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"}},...gy},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:py,closeIconColor:"#000000",closeIconHoverColor:"#999999",...hy},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:[fy]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},by={element:dy,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:`${at(e,"fontFamily")}`}))]},fontRelations:{...to.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${at(t,"fontFamily")}`}),{})},schema:vy,sourceCode:uy};function wy(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 Sy({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 Cy(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 $y(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 Ty(e,t,n){return Math.max(t,Math.min(n,e))}function Ma(e,t,n){return e+(t-e)*n}function Iy(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 Ry(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=Ty(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]),b=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||b(),l),[e,b,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:x,reset:b}}function Ly(e){return`
9852
+ `,py="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 my(e){const t={};return t[at(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSettings")]={...mi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSize")]={...mi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[at(e,"lineHeight")]={...mi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[at(e,"letterSpacing")]={...mi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[at(e,"wordSpacing")]={...mi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[at(e,"textAlign")]={...mi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[at(e,"textAppearance")]={...mi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const to=oi.filter(e=>e!=="count"),gy=to.reduce((e,t)=>({...e,...my(t)}),{}),hy=to.reduce((e,t)=>({...e,[at(t,"fontFamily")]:"Arial",[at(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[at(t,"letterSpacing")]:0,[at(t,"wordSpacing")]:0,[at(t,"textAlign")]:"left",[at(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[at(n,"fontSize")]=i),o!==void 0&&(t[at(n,"lineHeight")]=o),t},{})}const fy={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(to.map(e=>[Xs[e],Ys(e)]))},yy={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},xy=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...yy,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),vy={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:xy},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"}},...gy},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:py,closeIconColor:"#000000",closeIconHoverColor:"#999999",...hy},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:[fy]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},by={element:dy,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:`${at(e,"fontFamily")}`}))]},fontRelations:{...to.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${at(t,"fontFamily")}`}),{})},schema:vy,sourceCode:uy};function wy(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 Sy({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 Cy(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 $y(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 Ty(e,t,n){return Math.max(t,Math.min(n,e))}function Ma(e,t,n){return e+(t-e)*n}function Iy(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 Ry(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=Ty(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 Ly(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 Dd(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 Py(e){const t=Zs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Ey(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 Od(e,t,n){const i=Ey(e);return i?i===t?!1:Py(n[Dd(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 My(e,t,n){if(Bd(e,t,n))return Oo(e);const i=Oo(e);return i.kind==="baseline"?{kind:"top"}:i}function ky(e){const t=Oo(e);return t.kind==="baseline"?{kind:"top"}:t}function Bd(e,t,n){return Od(e,n,t)?Oo(e).kind==="baseline":!1}function Ay(e){const t={};let n=!1;for(const i of ca){const o=Dd(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}Od(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Fy(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function _y(e){const t=Oo(e).kind;return t==="baseline"?"center":t}function Ny(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 Wy(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=Wy(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 Hy(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 Dy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Oy={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const By={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function zy(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 jy(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Do.map(e=>[By[e],zy(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(Ut(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"],Vy={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Gy=["hover","focus","filled","success","error"],ql=.004,Di=.004,Aa=Di,Js=50,Bo=1440,zo=Js/Bo;function zd(e){const t=typeof e=="number"&&e>0?e:Bo;return Js/t}function Xy(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 jd={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 Yy(e,t=1){const n=t/e;return Object.fromEntries(xn.map(i=>[i,n]))}function qy(){return Object.fromEntries([...no.map(e=>[e,0]),...io.map(e=>[e,0])])}function Uy(){return Object.fromEntries(oo.map(e=>[e,0]))}function gr(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:jd[t]]))}function Vd(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 Ky(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=Vd(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 Zy(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 Jy(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Qy(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],b=oo[c],m=xn[l],h=no[l],f=io[l],v=oo[l],C=n[u],y=n[p],S=n[x],V=n[b];typeof C=="number"&&(r[m]=C),typeof y=="number"&&(r[h]=y),typeof S=="number"&&(r[f]=S),typeof V=="number"&&(r[v]=V)}return r}function Gd(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 ex(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,...Yy(n,o),...qy()};if(r)for(const d of oo)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Uy());return Gd(e,l)?l:e}function tx(e,t,n){const i=Ay(e);i&&(e={...e,...i});const o=zd(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 V=gr({...t,...S}),N=Po(S),q=Mr(p,N,V),W=Ky(p,q,{...t,...S});return Object.keys(W).length===0?S:{...S,...W}};if(typeof r=="number"&&r!==l)return e;const b=Ul(e),m=Ul(t);if(!Jy(b,m))return x({...e,...Qy(b,m,t,p)});if(d<c&&typeof p=="number"&&!u){const S=gr({...t,...e});return x({...e,...Zy(p,d,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,V=Math.max(0,(d-o)/2);return S>V?{...e,textPaddingLR:V}:e}const h=gr({...t,...e}),f=Mr(p,c,gr(t)),C=Mr(p,d,h).some((S,V)=>S<(f[V]??S)),y=xn.some(S=>{const V=e[S],N=t[S];return typeof V=="number"&&typeof N=="number"&&V!==N});return C||y?x(e):e}function nx(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 ix(e,t){return Math.random()*(t-e)+e}function ox(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:jd[t]]))}function Fa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function rx(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:Oy[l],widthKey:xn[d],width:n[xn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function ax({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:b,entriesCount:m,cellMinHeight:h,dividerWidth:f,showVisibility:v,cut:C,showCut:y,cutCellMinHeight:S,cutLabel:V,imageSize:N,imageOnHover:q,imagePosition:W="cursor",imageInterpolation:I="on",entryHoverEffect:B,entryHoverShowOption:$,rowPaddingTop:T,rowPaddingBottom:k,rowPaddingTopB:A,columnsOrder:g,textPaddingLR:O,textColor:P,backgroundColor:X,dividerColor:ne,textHoverColor:L,backgroundHoverColor:H,dividerHoverColor:U}=e,[de,ae]=s.useState(void 0),[F,ce]=s.useState(null),z=s.useRef(null),re=q==="on"&&(!n||i),te=W==="cursor",ye=te&&I==="on",{anchorRef:Fe,onShow:fe,onCursorMove:w,exit:M}=Ry(!!(re&&F!==null),ye),E=(C??0)>0,j=x==="b",Te=s.useRef(null),ee=s.useRef(null),[$e,J]=s.useState(null),[me,Se]=s.useState(Bo),K=zd(me),Z=Math.max(0,((b??0)-K)/2),se=Math.min(O??0,Z),we=Math.max(se,Di),Me=((b??0)+K)/2;s.useLayoutEffect(()=>{if(!n){Se(Bo);return}const Ae=()=>{Se(Xy(Te.current))};Ae();const Xe=Te.current;if(!Xe)return;const st=new ResizeObserver(Ae);st.observe(Xe);let ht=Xe;for(;ht&&!ht.style.getPropertyValue("--cntrl-article-width");)ht=ht.parentElement;return ht&&st.observe(ht),()=>st.disconnect()},[n,l]),s.useEffect(()=>{ae(void 0)},[C,y,t,m]),s.useEffect(()=>{n&&!i&&ae(void 0)},[n,i]);const Ce=D.buildColorVars(c,{textColor:P,backgroundColor:X,dividerColor:ne,textHoverColor:L,backgroundHoverColor:H,dividerHoverColor:U},Vy,Gy),G=r&&r!=="default"?`${c}-state-${r}`:"",oe=`${!n||i?B==="default"?`${c}-entry-hover-default`:B==="blinds"?`${c}-entry-hover-blinds`:B==="reveal"?`${c}-entry-hover-reveal`:"":""} ${G}`.trim(),Y=B==="reveal"&&(!n||i),le=(v==null?void 0:v[0])??!1,_e=(v==null?void 0:v[1])??!1,pe=s.useRef(e),Q=s.useRef(l);s.useEffect(()=>{if(!d||!n){pe.current=e,Q.current=l;return}if(Q.current!==l){pe.current=e,Q.current=l;return}const Ae=pe.current;if(!(Ae!==e))return;if(typeof Ae.columns=="number"&&typeof e.columns=="number"&&Ae.columns!==e.columns){pe.current=e;return}const st=tx(e,Ae,{designWidth:me});pe.current=e,Gd(e,st)&&d(st)},[e,d,n,l,me]);const Ke=s.useMemo(()=>ox(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ke=s.useMemo(()=>Fa(e,no),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),tt=s.useMemo(()=>Fa(e,io),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ye=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]),ot=s.useMemo(()=>rx(dt,p,Ke,ke,tt,Ye),[dt,p,Ke,ke,tt,Ye]),Ve=Po(e),Re=s.useMemo(()=>xn.slice(0,p).map(Ae=>Ke[Ae]),[p,Ke]),He=s.useMemo(()=>Qs(p,Ve,Ke),[p,Ve,Ke]),Be=s.useMemo(()=>Mr(p,Ve,Ke),[p,Ve,Ke]),Ze=s.useMemo(()=>ot.map((Ae,Xe)=>Vd(Be[Xe]??0,Ae.paddingLeft,Ae.paddingRight)),[ot,Be]),he=s.useMemo(()=>{const Ae=m===0?1/0:m;return(t??[]).slice(0,Ae).map((st,ht)=>({id:ht,cells:Object.fromEntries(ri.map(yt=>[yt,st[yt]??""])),image:st.image,link:st.link}))},[t,m]),xe=E?de??C:he.length,We=s.useMemo(()=>E?he.slice(0,xe):he,[he,E,xe]),Je=E&&xe<he.length,ve=We.length>1||Je,Ie=[le?`${c}-divider-top`:"",_e||ve?`${c}-divider-bottom`:""].filter(Boolean).join(" "),qe=!n||i,ze=()=>{if(!qe)return;const Ae=de??C;if(!y){ae(he.length);return}ae(Math.min(Ae+y,he.length))},Le=Ae=>D.scalingValue(Ae,n??!1),Ge=j?A??0:T??0,De=k??0,nt=h??0,it=Math.max(De,Aa),ct=Bl(0,We.length,le,_e,Je,f??0,n??!1).borderTopWidth,St=j?"rowPaddingTopB":"rowPaddingTop",Bt=ot[0],zt=ot[ot.length-1],ft=Ze[0],wt=Ze[Ze.length-1],jt=Bt&&ft?Math.max(ft.paddingLeft,Di):0,At=zt&&wt?Math.max(wt.paddingRight,Di):0,vt=Ve,Ft=(Ae,Xe)=>Iy(W,Te.current,te?Ae:null,Xe),Nt=(Ae,Xe)=>{if(!re)return;const st=Ae.image;if(!(st!=null&&st.url)){M(()=>ce(null));return}const ht=(N==null?void 0:N.min)??80,yt=(N==null?void 0:N.max)??320,Lt=(F==null?void 0:F.rowId)===Ae.id,mt=Lt?F.widthPx:ix(ht,yt),{x:Vt,y:kt}=Ft(Xe,mt);if(Lt&&te){w(Vt,kt);return}ce({rowId:Ae.id,url:st.url,objectFit:"contain",isVideo:wy(st),widthPx:mt}),z.current={x:Vt,y:kt}},Kt=Ae=>{if(!re||!F||!te)return;const{x:Xe,y:st}=Ft(Ae,F.widthPx);w(Xe,st)},Jt=()=>{F&&M(()=>ce(null))},Tt=Ae=>{Y&&Dl(Ae,c),!(!re||!F)&&M(()=>ce(null))},Wt=Ae=>{Y&&Ol(Ae,c)};s.useLayoutEffect(()=>{if(!F||!z.current)return;const{x:Ae,y:Xe}=z.current;z.current=null,fe(Ae,Xe)},[F==null?void 0:F.rowId,F==null?void 0:F.url,fe]),s.useLayoutEffect(()=>{if(!u||j){J(null);return}const Ae=ee.current,Xe=Ae==null?void 0:Ae.parentElement;if(!Ae||!Xe){J(null);return}const st=()=>{const yt=Ae.querySelector("[data-list-row]");if(!yt){J(null);return}const Lt=Xe.getBoundingClientRect(),mt=yt.getBoundingClientRect();J(mt.top-Lt.top+mt.height/2)};st();const ht=new ResizeObserver(st);return ht.observe(Ae),ht.observe(Xe),()=>ht.disconnect()},[u,j,We,Ge,De,nt,t,e,ot,Be,me,f,le,_e,Je]);const rn=s.useMemo(()=>!j&&Ks.some(Ae=>{const Xe=Ae.charAt(0),st=e[`${Ae}VerticalAlign`];return Bd(st,e,Xe)}),[j,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Vt;const Ae=Te.current;if(!Ae)return;const Xe=()=>{Ae.querySelectorAll("[data-list-col]").forEach(kt=>{kt.style.transform="";const Mt=kt.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Xt=kt.querySelector(`.${c}-list-col-title`);Xt&&(Xt.style.transform="")})};if(j||!rn){Xe();return}const st=()=>{const kt=Array.from(Ae.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Xt=`${c}-baseline-probe`;kt.forEach(Yt=>{Yt.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(Yt=>{const Ht=Array.from(Yt.querySelectorAll("[data-list-col]"));Hy(Yt,Ht,Mt)}),Ae.offsetHeight,kt.forEach(Yt=>{const Ht=Array.from(Yt.querySelectorAll("[data-list-col]")),Dt=Yt.getBoundingClientRect().top,_t=new Map,Ct=Ht.map(Ne=>{const Oe=Ne.querySelector(`.${c}-list-col-title`),lt={el:Ne,titleEl:Oe,letter:Ne.getAttribute("data-col-letter")??"",kind:Ne.getAttribute("data-valign")??"top",anchor:Ne.getAttribute("data-valign-anchor")};return _t.set(lt.letter,lt),lt}),_=new Map,Pe=(Ne,Oe)=>{const lt=_.get(Ne.letter);if(lt!==void 0)return lt;const Et=Ne.anchor?_t.get(Ne.anchor):void 0;if(Ne.kind!=="baseline"||!Et||Oe.has(Ne.letter)){const nn=ka(Ne,Dt,Mt,Xt);return _.set(Ne.letter,nn),nn}Oe.add(Ne.letter);const rt=Pe(Et,Oe);Oe.delete(Ne.letter);const xt=ka(Ne,Dt,Mt,Xt),Ot=rt-xt;Dy(Ne.titleEl,Ot);const It=ka(Ne,Dt,Mt,Xt);return _.set(Ne.letter,It),It};Ct.forEach(Ne=>Pe(Ne,new Set))})};let ht=null;const yt=()=>{ht===null&&(ht=requestAnimationFrame(()=>{ht=null,st()}))};st();const Lt=new ResizeObserver(()=>yt());Lt.observe(Ae);let mt=!1;return typeof document<"u"&&((Vt=document.fonts)!=null&&Vt.ready)&&document.fonts.ready.then(()=>{mt||yt()}),()=>{mt=!0,ht!==null&&(cancelAnimationFrame(ht),ht=null),Lt.disconnect(),Xe()}},[rn,j,e,t,me,We,Be]);const gt=s.useMemo(()=>Ly(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gt}}),a.jsx("div",{style:Ce,children:a.jsxs("div",{ref:Te,className:`${c}-wrapper ${oe}${Ie?` ${Ie}`:""}${j?` ${c}-type-b`:""}`.trim(),style:{width:D.scalingValue(b??0,n)},onMouseMove:re?Kt:void 0,onMouseLeave:re?Jt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[We.map((Ae,Xe)=>{var Lt;const st=(((Lt=Ae.link)==null?void 0:Lt.length)??0)>0,ht=st&&(!n||i)?"a":"div",yt=Bl(Xe,We.length,le,_e,Je,f??0,n??!1);return a.jsxs(ht,{ref:Xe===0?mt=>{ee.current=mt}:void 0,className:`${c}-list-item${st||$==="always"?` ${c}-list-item-has-link`:""}${Je&&Xe===We.length-1?` ${c}-list-item-before-cut`:""}`,...st?{href:Ae.link,target:"_blank"}:{},style:yt,onMouseEnter:mt=>{Y&&(st||$==="always")&&Dl(mt,c),re&&Nt(Ae,mt)},onMouseLeave:mt=>{Y&&(st||$==="always")&&Ol(mt,c)},children:[Ge>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Le(Ge)}}),a.jsxs("div",{className:`${c}-list-cols-row${j?"":` ${c}-list-cols-row-h`}${u&&Xe===0&&j?` ${c}-list-cols-row-controls`:""}`,...j?{}:{"data-list-row":""},style:j?void 0:{minHeight:Le(nt)},children:[ot.map((mt,Vt)=>{const kt=Vt===ot.length-1,Mt=Ze[Vt],Xt=mt.paddingBottom,Yt=Cy(Ae.cells[mt.key]),Ht=j&&Yt&&Xt>0,Dt=j?{minHeight:Le(nt)}:{width:Le(Be[Vt])},_t=j?{paddingLeft:Le(se),paddingRight:Le(se)}:{paddingLeft:Le(Mt.paddingLeft),paddingRight:Le(Mt.paddingRight)},Ct=mt.textPrefix.charAt(0),_=j?ky(e[`${mt.textPrefix}VerticalAlign`]):My(e[`${mt.textPrefix}VerticalAlign`],e,Ct),Pe=j&&Yt&&u&&Xe===0;return j&&!Yt?null:a.jsxs("div",{className:j?`${c}-list-col-wrap`:void 0,...j?{}:{"data-list-col":"","data-col-letter":Ct,"data-valign":_.kind,..._.kind==="baseline"?{"data-valign-anchor":_.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{..._t,...Dt,...j?{justifyContent:Vl(_.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),...j?{}:Fy(_.kind)},children:Ae.cells[mt.key]??null})}),Ht&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Le(Xt)}}),Pe&&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:Le(Math.max(Xt,Aa))}})]},mt.key)}),u&&Xe===0&&j&&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(Me),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Le(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(Me),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Le(Math.max(we,Ve-we)),width:Le(we),height:"100%"}})]})]}),!j&&De>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Le(De)}}),u&&Xe===0&&!j&&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:Le(it)}})]},Ae.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":j?"center":"left-y",className:`${c}-control-anchor`,style:{top:ct,left:0,width:"100%",height:Le(Math.max(Ge,Aa))}})},"row-padding-handles"),u&&!j&&Bt&&zt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Bt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[0]-((ft==null?void 0:ft.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:Le(jt),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(Be[ot.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:Le(vt-At),width:Le(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!j&&ot.slice(0,-1).map((Ae,Xe)=>{const st=ot[Xe+1],ht=He.slice(0,Xe+1).reduce((kt,Mt)=>kt+Mt,0),yt=Ze[Xe],Lt=Ze[Xe+1],mt=Math.max(yt.paddingRight,Di),Vt=Math.max(Lt.paddingLeft,Di);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ae.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[Xe]-yt.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:Le(ht-mt),width:Le(mt),height:"100%"}}),a.jsx("div",{"data-controls":st.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[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:Le(ht),width:Le(Vt),height:"100%"}})]},`${Ae.paddingRightKey}-padding`)}),u&&!j&&ot.slice(0,-1).map((Ae,Xe)=>{const st=nx(Xe,He,Re,Ve),yt=He.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":Ae.widthKey,"data-controls-axis":"x","data-controls-min":String(Js),"data-controls-max-fraction":String(st),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Le(yt),width:Le(ql),height:"calc(100%)",pointerEvents:"auto"}})},`${Ae.widthKey}-junction`)})]}),Je&&(()=>{const Ae=zr(e,Hn),Xe=_y(e.cutLabelVerticalAlign),st=Ae.textTextAlign==="justify"||j;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Le(S??0),cursor:qe?"pointer":"default",...$y(_e,f??0,n??!1)},onClick:qe?ze:void 0,onMouseEnter:Y||re?Tt:void 0,onMouseLeave:Y?Wt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...j?{paddingLeft:Le(se),paddingRight:Le(se)}:{},justifyContent:Ny(Ae.textTextAlign),alignItems:Vl(Xe)},children:a.jsx("span",{className:Xl(e,Hn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Gl(Ae,n),...Yl(e,Hn,c,n),...st?{width:"100%"}:{}},children:V})})})})(),re&&F&&(()=>{const Ae=`${F.widthPx}px`,Xe={width:Ae,height:"auto",maxHeight:Ae,objectFit:"contain"};return a.jsx("div",{ref:Fe,className:`${c}-hover-media-anchor`,children:a.jsx(Sy,{media:F,className:F.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Xe},`${F.rowId}-${F.url}`)})})()]})})]})}const sx=`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 Dd(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 Py(e){const t=Zs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Ey(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 Od(e,t,n){const i=Ey(e);return i?i===t?!1:Py(n[Dd(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 My(e,t,n){if(Bd(e,t,n))return Oo(e);const i=Oo(e);return i.kind==="baseline"?{kind:"top"}:i}function ky(e){const t=Oo(e);return t.kind==="baseline"?{kind:"top"}:t}function Bd(e,t,n){return Od(e,n,t)?Oo(e).kind==="baseline":!1}function Ay(e){const t={};let n=!1;for(const i of ca){const o=Dd(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}Od(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Fy(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function _y(e){const t=Oo(e).kind;return t==="baseline"?"center":t}function Ny(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 Wy(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=Wy(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 Hy(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 Dy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Oy={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const By={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function zy(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 jy(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Do.map(e=>[By[e],zy(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(Ut(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"],Vy={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Gy=["hover","focus","filled","success","error"],ql=.004,Di=.004,Aa=Di,Js=50,Bo=1440,zo=Js/Bo;function zd(e){const t=typeof e=="number"&&e>0?e:Bo;return Js/t}function Xy(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 jd={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 Yy(e,t=1){const n=t/e;return Object.fromEntries(xn.map(i=>[i,n]))}function qy(){return Object.fromEntries([...no.map(e=>[e,0]),...io.map(e=>[e,0])])}function Uy(){return Object.fromEntries(oo.map(e=>[e,0]))}function gr(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:jd[t]]))}function Vd(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 Ky(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=Vd(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 Zy(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 Jy(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Qy(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],V=n[w];typeof C=="number"&&(r[m]=C),typeof y=="number"&&(r[h]=y),typeof S=="number"&&(r[f]=S),typeof V=="number"&&(r[v]=V)}return r}function Gd(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 ex(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,...Yy(n,o),...qy()};if(r)for(const d of oo)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Uy());return Gd(e,l)?l:e}function tx(e,t,n){const i=Ay(e);i&&(e={...e,...i});const o=zd(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 V=gr({...t,...S}),N=Po(S),q=Mr(p,N,V),W=Ky(p,q,{...t,...S});return Object.keys(W).length===0?S:{...S,...W}};if(typeof r=="number"&&r!==l)return e;const w=Ul(e),m=Ul(t);if(!Jy(w,m))return x({...e,...Qy(w,m,t,p)});if(d<c&&typeof p=="number"&&!u){const S=gr({...t,...e});return x({...e,...Zy(p,d,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,V=Math.max(0,(d-o)/2);return S>V?{...e,textPaddingLR:V}:e}const h=gr({...t,...e}),f=Mr(p,c,gr(t)),C=Mr(p,d,h).some((S,V)=>S<(f[V]??S)),y=xn.some(S=>{const V=e[S],N=t[S];return typeof V=="number"&&typeof N=="number"&&V!==N});return C||y?x(e):e}function nx(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 ix(e,t){return Math.random()*(t-e)+e}function ox(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:jd[t]]))}function Fa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function rx(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:Oy[l],widthKey:xn[d],width:n[xn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function ax({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:V,imageSize:N,imageOnHover:q,imagePosition:W="cursor",imageInterpolation:I="on",entryHoverEffect:B,entryHoverShowOption:$,rowPaddingTop:T,rowPaddingBottom:k,rowPaddingTopB:F,columnsOrder:g,textPaddingLR:O,textColor:P,backgroundColor:X,dividerColor:te,textHoverColor:L,backgroundHoverColor:H,dividerHoverColor:U}=e,[de,ae]=s.useState(void 0),[A,ce]=s.useState(null),z=s.useRef(null),re=q==="on"&&(!n||i),ee=W==="cursor",xe=ee&&I==="on",{anchorRef:Fe,onShow:ye,onCursorMove:b,exit:M}=Ry(!!(re&&A!==null),xe),E=(C??0)>0,j=x==="b",Ce=s.useRef(null),Q=s.useRef(null),[Te,ie]=s.useState(null),[ue,fe]=s.useState(Bo),K=zd(ue),Z=Math.max(0,((w??0)-K)/2),se=Math.min(O??0,Z),Se=Math.max(se,Di),Me=((w??0)+K)/2;s.useLayoutEffect(()=>{if(!n){fe(Bo);return}const Ae=()=>{fe(Xy(Ce.current))};Ae();const Xe=Ce.current;if(!Xe)return;const st=new ResizeObserver(Ae);st.observe(Xe);let ht=Xe;for(;ht&&!ht.style.getPropertyValue("--cntrl-article-width");)ht=ht.parentElement;return ht&&st.observe(ht),()=>st.disconnect()},[n,l]),s.useEffect(()=>{ae(void 0)},[C,y,t,m]),s.useEffect(()=>{n&&!i&&ae(void 0)},[n,i]);const $e=D.buildColorVars(c,{textColor:P,backgroundColor:X,dividerColor:te,textHoverColor:L,backgroundHoverColor:H,dividerHoverColor:U},Vy,Gy),G=r&&r!=="default"?`${c}-state-${r}`:"",oe=`${!n||i?B==="default"?`${c}-entry-hover-default`:B==="blinds"?`${c}-entry-hover-blinds`:B==="reveal"?`${c}-entry-hover-reveal`:"":""} ${G}`.trim(),Y=B==="reveal"&&(!n||i),le=(v==null?void 0:v[0])??!1,_e=(v==null?void 0:v[1])??!1,me=s.useRef(e),J=s.useRef(l);s.useEffect(()=>{if(!d||!n){me.current=e,J.current=l;return}if(J.current!==l){me.current=e,J.current=l;return}const Ae=me.current;if(!(Ae!==e))return;if(typeof Ae.columns=="number"&&typeof e.columns=="number"&&Ae.columns!==e.columns){me.current=e;return}const st=tx(e,Ae,{designWidth:ue});me.current=e,Gd(e,st)&&d(st)},[e,d,n,l,ue]);const Ke=s.useMemo(()=>ox(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ke=s.useMemo(()=>Fa(e,no),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),tt=s.useMemo(()=>Fa(e,io),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ye=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]),ot=s.useMemo(()=>rx(dt,p,Ke,ke,tt,Ye),[dt,p,Ke,ke,tt,Ye]),Ve=Po(e),Re=s.useMemo(()=>xn.slice(0,p).map(Ae=>Ke[Ae]),[p,Ke]),He=s.useMemo(()=>Qs(p,Ve,Ke),[p,Ve,Ke]),Be=s.useMemo(()=>Mr(p,Ve,Ke),[p,Ve,Ke]),Ze=s.useMemo(()=>ot.map((Ae,Xe)=>Vd(Be[Xe]??0,Ae.paddingLeft,Ae.paddingRight)),[ot,Be]),he=s.useMemo(()=>{const Ae=m===0?1/0:m;return(t??[]).slice(0,Ae).map((st,ht)=>({id:ht,cells:Object.fromEntries(ri.map(yt=>[yt,st[yt]??""])),image:st.image,link:st.link}))},[t,m]),ve=E?de??C:he.length,We=s.useMemo(()=>E?he.slice(0,ve):he,[he,E,ve]),Je=E&&ve<he.length,be=We.length>1||Je,Ie=[le?`${c}-divider-top`:"",_e||be?`${c}-divider-bottom`:""].filter(Boolean).join(" "),qe=!n||i,ze=()=>{if(!qe)return;const Ae=de??C;if(!y){ae(he.length);return}ae(Math.min(Ae+y,he.length))},Le=Ae=>D.scalingValue(Ae,n??!1),Ge=j?F??0:T??0,De=k??0,nt=h??0,it=Math.max(De,Aa),ct=Bl(0,We.length,le,_e,Je,f??0,n??!1).borderTopWidth,St=j?"rowPaddingTopB":"rowPaddingTop",Bt=ot[0],zt=ot[ot.length-1],ft=Ze[0],wt=Ze[Ze.length-1],jt=Bt&&ft?Math.max(ft.paddingLeft,Di):0,At=zt&&wt?Math.max(wt.paddingRight,Di):0,vt=Ve,Ft=(Ae,Xe)=>Iy(W,Ce.current,ee?Ae:null,Xe),Nt=(Ae,Xe)=>{if(!re)return;const st=Ae.image;if(!(st!=null&&st.url)){M(()=>ce(null));return}const ht=(N==null?void 0:N.min)??80,yt=(N==null?void 0:N.max)??320,Lt=(A==null?void 0:A.rowId)===Ae.id,mt=Lt?A.widthPx:ix(ht,yt),{x:Vt,y:kt}=Ft(Xe,mt);if(Lt&&ee){b(Vt,kt);return}ce({rowId:Ae.id,url:st.url,objectFit:"contain",isVideo:wy(st),widthPx:mt}),z.current={x:Vt,y:kt}},Kt=Ae=>{if(!re||!A||!ee)return;const{x:Xe,y:st}=Ft(Ae,A.widthPx);b(Xe,st)},Jt=()=>{A&&M(()=>ce(null))},Tt=Ae=>{Y&&Dl(Ae,c),!(!re||!A)&&M(()=>ce(null))},Wt=Ae=>{Y&&Ol(Ae,c)};s.useLayoutEffect(()=>{if(!A||!z.current)return;const{x:Ae,y:Xe}=z.current;z.current=null,ye(Ae,Xe)},[A==null?void 0:A.rowId,A==null?void 0:A.url,ye]),s.useLayoutEffect(()=>{if(!u||j){ie(null);return}const Ae=Q.current,Xe=Ae==null?void 0:Ae.parentElement;if(!Ae||!Xe){ie(null);return}const st=()=>{const yt=Ae.querySelector("[data-list-row]");if(!yt){ie(null);return}const Lt=Xe.getBoundingClientRect(),mt=yt.getBoundingClientRect();ie(mt.top-Lt.top+mt.height/2)};st();const ht=new ResizeObserver(st);return ht.observe(Ae),ht.observe(Xe),()=>ht.disconnect()},[u,j,We,Ge,De,nt,t,e,ot,Be,ue,f,le,_e,Je]);const rn=s.useMemo(()=>!j&&Ks.some(Ae=>{const Xe=Ae.charAt(0),st=e[`${Ae}VerticalAlign`];return Bd(st,e,Xe)}),[j,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Vt;const Ae=Ce.current;if(!Ae)return;const Xe=()=>{Ae.querySelectorAll("[data-list-col]").forEach(kt=>{kt.style.transform="";const Mt=kt.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Xt=kt.querySelector(`.${c}-list-col-title`);Xt&&(Xt.style.transform="")})};if(j||!rn){Xe();return}const st=()=>{const kt=Array.from(Ae.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Xt=`${c}-baseline-probe`;kt.forEach(Yt=>{Yt.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(Yt=>{const Ht=Array.from(Yt.querySelectorAll("[data-list-col]"));Hy(Yt,Ht,Mt)}),Ae.offsetHeight,kt.forEach(Yt=>{const Ht=Array.from(Yt.querySelectorAll("[data-list-col]")),Dt=Yt.getBoundingClientRect().top,_t=new Map,Ct=Ht.map(Ne=>{const Oe=Ne.querySelector(`.${c}-list-col-title`),lt={el:Ne,titleEl:Oe,letter:Ne.getAttribute("data-col-letter")??"",kind:Ne.getAttribute("data-valign")??"top",anchor:Ne.getAttribute("data-valign-anchor")};return _t.set(lt.letter,lt),lt}),_=new Map,Pe=(Ne,Oe)=>{const lt=_.get(Ne.letter);if(lt!==void 0)return lt;const Et=Ne.anchor?_t.get(Ne.anchor):void 0;if(Ne.kind!=="baseline"||!Et||Oe.has(Ne.letter)){const nn=ka(Ne,Dt,Mt,Xt);return _.set(Ne.letter,nn),nn}Oe.add(Ne.letter);const rt=Pe(Et,Oe);Oe.delete(Ne.letter);const xt=ka(Ne,Dt,Mt,Xt),Ot=rt-xt;Dy(Ne.titleEl,Ot);const It=ka(Ne,Dt,Mt,Xt);return _.set(Ne.letter,It),It};Ct.forEach(Ne=>Pe(Ne,new Set))})};let ht=null;const yt=()=>{ht===null&&(ht=requestAnimationFrame(()=>{ht=null,st()}))};st();const Lt=new ResizeObserver(()=>yt());Lt.observe(Ae);let mt=!1;return typeof document<"u"&&((Vt=document.fonts)!=null&&Vt.ready)&&document.fonts.ready.then(()=>{mt||yt()}),()=>{mt=!0,ht!==null&&(cancelAnimationFrame(ht),ht=null),Lt.disconnect(),Xe()}},[rn,j,e,t,ue,We,Be]);const gt=s.useMemo(()=>Ly(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gt}}),a.jsx("div",{style:$e,children:a.jsxs("div",{ref:Ce,className:`${c}-wrapper ${oe}${Ie?` ${Ie}`:""}${j?` ${c}-type-b`:""}`.trim(),style:{width:D.scalingValue(w??0,n)},onMouseMove:re?Kt:void 0,onMouseLeave:re?Jt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[We.map((Ae,Xe)=>{var Lt;const st=(((Lt=Ae.link)==null?void 0:Lt.length)??0)>0,ht=st&&(!n||i)?"a":"div",yt=Bl(Xe,We.length,le,_e,Je,f??0,n??!1);return a.jsxs(ht,{ref:Xe===0?mt=>{Q.current=mt}:void 0,className:`${c}-list-item${st||$==="always"?` ${c}-list-item-has-link`:""}${Je&&Xe===We.length-1?` ${c}-list-item-before-cut`:""}`,...st?{href:Ae.link,target:"_blank"}:{},style:yt,onMouseEnter:mt=>{Y&&(st||$==="always")&&Dl(mt,c),re&&Nt(Ae,mt)},onMouseLeave:mt=>{Y&&(st||$==="always")&&Ol(mt,c)},children:[Ge>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Le(Ge)}}),a.jsxs("div",{className:`${c}-list-cols-row${j?"":` ${c}-list-cols-row-h`}${u&&Xe===0&&j?` ${c}-list-cols-row-controls`:""}`,...j?{}:{"data-list-row":""},style:j?void 0:{minHeight:Le(nt)},children:[ot.map((mt,Vt)=>{const kt=Vt===ot.length-1,Mt=Ze[Vt],Xt=mt.paddingBottom,Yt=Cy(Ae.cells[mt.key]),Ht=j&&Yt&&Xt>0,Dt=j?{minHeight:Le(nt)}:{width:Le(Be[Vt])},_t=j?{paddingLeft:Le(se),paddingRight:Le(se)}:{paddingLeft:Le(Mt.paddingLeft),paddingRight:Le(Mt.paddingRight)},Ct=mt.textPrefix.charAt(0),_=j?ky(e[`${mt.textPrefix}VerticalAlign`]):My(e[`${mt.textPrefix}VerticalAlign`],e,Ct),Pe=j&&Yt&&u&&Xe===0;return j&&!Yt?null:a.jsxs("div",{className:j?`${c}-list-col-wrap`:void 0,...j?{}:{"data-list-col":"","data-col-letter":Ct,"data-valign":_.kind,..._.kind==="baseline"?{"data-valign-anchor":_.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{..._t,...Dt,...j?{justifyContent:Vl(_.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),...j?{}:Fy(_.kind)},children:Ae.cells[mt.key]??null})}),Ht&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Le(Xt)}}),Pe&&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:Le(Math.max(Xt,Aa))}})]},mt.key)}),u&&Xe===0&&j&&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(Me),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Le(Se),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(Me),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Le(Math.max(Se,Ve-Se)),width:Le(Se),height:"100%"}})]})]}),!j&&De>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Le(De)}}),u&&Xe===0&&!j&&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:Le(it)}})]},Ae.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":j?"center":"left-y",className:`${c}-control-anchor`,style:{top:ct,left:0,width:"100%",height:Le(Math.max(Ge,Aa))}})},"row-padding-handles"),u&&!j&&Bt&&zt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Bt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[0]-((ft==null?void 0:ft.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Te??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Le(jt),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(Be[ot.length-1]-((wt==null?void 0:wt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Te??void 0,className:`${c}-control-anchor`,style:{top:0,left:Le(vt-At),width:Le(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!j&&ot.slice(0,-1).map((Ae,Xe)=>{const st=ot[Xe+1],ht=He.slice(0,Xe+1).reduce((kt,Mt)=>kt+Mt,0),yt=Ze[Xe],Lt=Ze[Xe+1],mt=Math.max(yt.paddingRight,Di),Vt=Math.max(Lt.paddingLeft,Di);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ae.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[Xe]-yt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Te??void 0,className:`${c}-control-anchor`,style:{top:0,left:Le(ht-mt),width:Le(mt),height:"100%"}}),a.jsx("div",{"data-controls":st.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[Xe+1]-Lt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Te??void 0,className:`${c}-control-anchor`,style:{top:0,left:Le(ht),width:Le(Vt),height:"100%"}})]},`${Ae.paddingRightKey}-padding`)}),u&&!j&&ot.slice(0,-1).map((Ae,Xe)=>{const st=nx(Xe,He,Re,Ve),yt=He.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":Ae.widthKey,"data-controls-axis":"x","data-controls-min":String(Js),"data-controls-max-fraction":String(st),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Le(yt),width:Le(ql),height:"calc(100%)",pointerEvents:"auto"}})},`${Ae.widthKey}-junction`)})]}),Je&&(()=>{const Ae=zr(e,Hn),Xe=_y(e.cutLabelVerticalAlign),st=Ae.textTextAlign==="justify"||j;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Le(S??0),cursor:qe?"pointer":"default",...$y(_e,f??0,n??!1)},onClick:qe?ze:void 0,onMouseEnter:Y||re?Tt:void 0,onMouseLeave:Y?Wt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...j?{paddingLeft:Le(se),paddingRight:Le(se)}:{},justifyContent:Ny(Ae.textTextAlign),alignItems:Vl(Xe)},children:a.jsx("span",{className:Xl(e,Hn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Gl(Ae,n),...Yl(e,Hn,c,n),...st?{width:"100%"}:{}},children:V})})})})(),re&&A&&(()=>{const Ae=`${A.widthPx}px`,Xe={width:Ae,height:"auto",maxHeight:Ae,objectFit:"contain"};return a.jsx("div",{ref:Fe,className:`${c}-hover-media-anchor`,children:a.jsx(Sy,{media:A,className:A.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Xe},`${A.rowId}-${A.url}`)})})()]})})]})}const sx=`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';
@@ -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 Px({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:b="default",autoclose:m="off",icon:h,iconMaxWidth:f=.00833,iconPaddingRight:v=0,iconAnimation:C="rotate 45",questionColor:y="#000000",answerColor:S="#000000",dividerColor:V="#0000001F",iconColor:N="#000000",questionHoverColor:q="#666666",iconHoverColor:W="#666666",iconActiveColor:I="#000000",dividerHoverColor:B="#000000",questionFontFamily:$,questionFontSettings:T,questionFontSize:k,questionLineHeight:A,questionLetterSpacing:g,questionWordSpacing:O,questionTextAppearance:P,answerFontFamily:X,answerFontSettings:ne,answerFontSize:L,answerLineHeight:H,answerLetterSpacing:U,answerWordSpacing:de,answerTextAppearance:ae,questionPaddingLeft:F=0,questionPaddingTop:ce=0,questionPaddingBottom:z=0,answerPaddingLeft:re=0,answerPaddingRight:te=0,answerPaddingTop:ye=0,answerPaddingBottom:Fe=0}=e,fe=t??[],[w,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 j=Ze=>D.scalingValue(Ze,n??!1),Te=Math.max(F,Vn),ee=Math.max(ce,Vn),$e=Math.max(z,Vn),J=Math.max(re,Vn),me=Math.max(te,Vn),Se=Math.max(ye,Vn),K=Math.max(Fe,Vn),Z=Math.max(0,(c??1)-v-f),se=Math.max(0,(c??1)-te),we=Math.max(0,(c??1)-re),Me=Math.max(v,Vn),Ce=Math.max(0,(c??1)-F-f),G=s.useMemo(()=>w.size===0?0:Math.min(...w),[w]),ue=s.useCallback(Ze=>w.has(Ze),[w]),oe=E&&b==="default"?`${l}-entry-hover-default`:"",Y=h??"",le=Y!=="",_e=C.replace(/^rotate /,""),pe=`${l}-icon-anim-${_e}`,Q=an(Ut(nc($,T,k,A,g,O,P,y),n)),Ke=an(Ut(nc(X,ne,L,H,U,de,ae,S),n)),ke=ec(k,A,`${l}-question`,`${l}-text-tight-leading`),tt=ec(L,H,`${l}-answer-text`,`${l}-text-tight-leading`),Ye=tc(k,A,l,n),dt=tc(L,H,l,n),ot=D.buildColorVars(l,{questionColor:y,answerColor:S,dividerColor:V,iconColor:N,questionHoverColor:q,iconHoverColor:W,iconActiveColor:I,dividerHoverColor:B},Tx,Ix),Ve=r&&r!=="default"?`${l}-state-${r}`:"",Re=s.useCallback(Ze=>{E&&M(he=>{if(he.has(Ze)){const We=new Set(he);return We.delete(Ze),We}if(m==="on")return new Set([Ze]);const xe=new Set(he);return xe.add(Ze),xe})},[E,m]),He=s.useMemo(()=>Lx(l),[l]),Be={[`--${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:He}}),a.jsx("div",{style:ot,children:a.jsx("div",{className:pt(`${l}-wrapper`,n&&!i&&`${l}-editor`,oe,Ve),style:{width:D.scalingValue(c,n??!1),maxWidth:"100%",...Be},children:fe.map((Ze,he)=>{var qe;const xe=ue(he),We=((qe=Ze.question)==null?void 0:qe.trim())??"",Je=Ze.answer,ve=((Je==null?void 0:Je.length)??0)>0,Ie=d&&he===G;return a.jsxs("div",{className:pt(`${l}-item`,xe&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[Ie&&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:j(ee)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Z),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:j(Te),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:j(Me),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":xe,style:{...Q,...Ye,paddingLeft:j(F),paddingRight:j(v)},onClick:()=>Re(he),children:[ce>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:j(ce)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:ke,children:We}),ve&&(le?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${pe}`,"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 ${pe}`,"aria-hidden":"true"}))]}),z>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:j(z)},"aria-hidden":"true"})]}),Ie&&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:j($e)}})]}),ve&&Je&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!xe,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[Ie&&xe&&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:j(Se)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","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,left:0,width:j(J),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:j(me),height:"100%"}})]}),ye>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:j(ye)}}),a.jsx("div",{className:`${l}-answer`,style:{...Ke,...dt,paddingLeft:j(re),paddingRight:j(te)},children:a.jsx("div",{className:tt,children:a.jsx(Ri,{content:Je})})}),Fe>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:j(Fe)}}),Ie&&xe&&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:j(K)}})]})})})]},he)})})})]})}const Ex=`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 Px({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:V="#0000001F",iconColor:N="#000000",questionHoverColor:q="#666666",iconHoverColor:W="#666666",iconActiveColor:I="#000000",dividerHoverColor:B="#000000",questionFontFamily:$,questionFontSettings:T,questionFontSize:k,questionLineHeight:F,questionLetterSpacing:g,questionWordSpacing:O,questionTextAppearance:P,answerFontFamily:X,answerFontSettings:te,answerFontSize:L,answerLineHeight:H,answerLetterSpacing:U,answerWordSpacing:de,answerTextAppearance:ae,questionPaddingLeft:A=0,questionPaddingTop:ce=0,questionPaddingBottom:z=0,answerPaddingLeft:re=0,answerPaddingRight:ee=0,answerPaddingTop:xe=0,answerPaddingBottom:Fe=0}=e,ye=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 j=Ze=>D.scalingValue(Ze,n??!1),Ce=Math.max(A,Vn),Q=Math.max(ce,Vn),Te=Math.max(z,Vn),ie=Math.max(re,Vn),ue=Math.max(ee,Vn),fe=Math.max(xe,Vn),K=Math.max(Fe,Vn),Z=Math.max(0,(c??1)-v-f),se=Math.max(0,(c??1)-ee),Se=Math.max(0,(c??1)-re),Me=Math.max(v,Vn),$e=Math.max(0,(c??1)-A-f),G=s.useMemo(()=>b.size===0?0:Math.min(...b),[b]),pe=s.useCallback(Ze=>b.has(Ze),[b]),oe=E&&w==="default"?`${l}-entry-hover-default`:"",Y=h??"",le=Y!=="",_e=C.replace(/^rotate /,""),me=`${l}-icon-anim-${_e}`,J=an(Ut(nc($,T,k,F,g,O,P,y),n)),Ke=an(Ut(nc(X,te,L,H,U,de,ae,S),n)),ke=ec(k,F,`${l}-question`,`${l}-text-tight-leading`),tt=ec(L,H,`${l}-answer-text`,`${l}-text-tight-leading`),Ye=tc(k,F,l,n),dt=tc(L,H,l,n),ot=D.buildColorVars(l,{questionColor:y,answerColor:S,dividerColor:V,iconColor:N,questionHoverColor:q,iconHoverColor:W,iconActiveColor:I,dividerHoverColor:B},Tx,Ix),Ve=r&&r!=="default"?`${l}-state-${r}`:"",Re=s.useCallback(Ze=>{E&&M(he=>{if(he.has(Ze)){const We=new Set(he);return We.delete(Ze),We}if(m==="on")return new Set([Ze]);const ve=new Set(he);return ve.add(Ze),ve})},[E,m]),He=s.useMemo(()=>Lx(l),[l]),Be={[`--${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:He}}),a.jsx("div",{style:ot,children:a.jsx("div",{className:pt(`${l}-wrapper`,n&&!i&&`${l}-editor`,oe,Ve),style:{width:D.scalingValue(c,n??!1),maxWidth:"100%",...Be},children:ye.map((Ze,he)=>{var qe;const ve=pe(he),We=((qe=Ze.question)==null?void 0:qe.trim())??"",Je=Ze.answer,be=((Je==null?void 0:Je.length)??0)>0,Ie=d&&he===G;return a.jsxs("div",{className:pt(`${l}-item`,ve&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[Ie&&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:j(Q)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Z),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:j(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($e),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:j(Me),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":ve,style:{...J,...Ye,paddingLeft:j(A),paddingRight:j(v)},onClick:()=>Re(he),children:[ce>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:j(ce)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:ke,children:We}),be&&(le?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${me}`,"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 ${me}`,"aria-hidden":"true"}))]}),z>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:j(z)},"aria-hidden":"true"})]}),Ie&&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:j(Te)}})]}),be&&Je&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!ve,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[Ie&&ve&&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:j(fe)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","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,left:0,width:j(ie),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(Se),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:j(ue),height:"100%"}})]}),xe>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:j(xe)}}),a.jsx("div",{className:`${l}-answer`,style:{...Ke,...dt,paddingLeft:j(re),paddingRight:j(ee)},children:a.jsx("div",{className:tt,children:a.jsx(Ri,{content:Je})})}),Fe>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:j(Fe)}}),Ie&&ve&&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:j(K)}})]})})})]},he)})})})]})}const Ex=`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"}}}},Mx=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],kx={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:[...Mx],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Ax={element:Px,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:kx,sourceCode:Ex},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,Fx=.2,rc=8,Yd=({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*Fx),[]),x=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),b=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,A=$.clientY-T.startY;if(T.isLocked===null){if(Math.abs(k)<rc&&Math.abs(A)<rc)return;if(A>0&&A>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,A);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]),V=s.useCallback($=>{S($)},[S]),N=s.useCallback($=>{S($)},[S]),q=o>0,W=l?`transform ${n}ms ease`:"none",I=l?`opacity ${n}ms ease`:"none",B=o>0||l;return{isSwipeDragging:q,backdropStyle:{opacity:x(o),transition:I},mediaAreaStyle:{transform:m(o),transition:W,touchAction:q?"none":void 0,willChange:q?"transform":void 0},overlayContentStyle:B?{opacity:b(o),transition:I}:void 0,swipeHandlers:e?{onPointerDown:C,onPointerMove:y,onPointerUp:V,onPointerCancel:N}:{},dismissAreaStyle:e?{touchAction:q?"none":"pan-x"}:void 0}},_x="[data-lightbox-scrollable]",qd=()=>{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(_x)||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"})}},[])},Nx=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Wx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Hx=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Dx=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,f)=>{Wx(t),e.scrollLeft=h,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,x=0;const b=()=>{t.removeEventListener("transitionend",m),clearTimeout(x)},m=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,b(),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,b(),u(n,!0))},i+64),()=>{p||(p=!0,b(),u(l-Hx(t),!1))}},Eo=300,Ox=900,Bx=1500,zx="cubic-bezier(0.16, 1, 0.3, 1)",jx=3e3,Vx=2,Gx=16,Xx=.05,Yx=1,fr=.3,qx=50,Ux=20,Ai=.004,ro=["title1","title2","title3"],Kx={title1:"1",title2:"2",title3:"3"},Zx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Jx={title1:.02,title2:.02,title3:.02},yr=e=>`max(${e}, ${Ux}px)`,Qx=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]}},ev=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=Qx(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Gt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,tv=e=>[Gt(e,"fontFamily"),Gt(e,"fontSettings"),{type:"row",items:[Gt(e,"fontSize"),Gt(e,"lineHeight"),Gt(e,"letterSpacing"),Gt(e,"wordSpacing")]},Gt(e,"textAlign"),Gt(e,"textAppearance")],nv=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ro.map(e=>[Kx[e],tv(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},Ud=(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:Ud(e.length,n)}},iv=(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=Gt(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[Zx[t]]}},ov=(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??Jx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)},rv=({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:b,closeIconMaxWidth:m,closeIconColor:h,closeIconHoverColor:f,thumbnailTrigger:v,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailActive:S,thumbnailActiveColor:V,title1Width:N,title2Width:q,title3Width:W,title1MarginLeft:I=0,title2MarginLeft:B=0,title3MarginLeft:$=0,titleRowMarginBottom:T=0,titleHeaderLayout:k="desktop",contentMarginTop:A,iconMarginLeft:g}=n,O=R=>D.scalingValue(R,i??!1),P=c??n.thumnailSize??.03,X=O(P),ne=O(u),L=O(p??.02),H=O(x??0),U=O(A??0),de=yr(U),ae=O(g??0),[F,ce]=s.useState(0),z=s.useRef(F);z.current=F;const re=t[F],{title1:te,title2:ye,title3:Fe}=ev(re),fe=Na("title1",_a(n,"title1"),i),w=Na("title2",_a(n,"title2"),i),M=Na("title3",_a(n,"title3"),i),E=k==="mobile",j=!o&&(!i||r),Te=j,ee=j,$e=j,J=Dn(y),me=J?{"--image-aspect-ratio":da(y)}:void 0,Se=!!(te||ye||Fe),K=s.useMemo(()=>iv(e,te,ye,Fe,fe,w,M),[e,F,te,ye,Fe,fe,w,M]),Z=s.useMemo(()=>({title1Width:N,title2Width:q,title3Width:W}),[N,q,W]),se=s.useMemo(()=>K.map(R=>Z[R.widthKey]),[K,Z]),we=s.useMemo(()=>el(K.length,se),[K.length,se]),Me=s.useMemo(()=>Ud(K.length,se),[K.length,se]),Ce=s.useMemo(()=>K.filter(R=>R.prefix==="title1"),[K]),G=s.useMemo(()=>K.filter(R=>R.prefix==="title2"||R.prefix==="title3"),[K]),ue=s.useMemo(()=>ac(Ce,Z),[Ce,Z]),oe=s.useMemo(()=>ac(G,Z),[G,Z]),Y=s.useCallback((R,ie)=>{const ge=K.indexOf(R);if(!E||ie==="single-row")return{effectiveWidth:Me[ge]??0,resolvedWidth:we[ge]??0,maxWidth:xr(ge,we)};if(ie==="two-row-top"){const je=Ce.indexOf(R);return{effectiveWidth:ue.effective[je]??0,resolvedWidth:ue.resolved[je]??0,maxWidth:xr(je,ue.resolved)}}const Ee=G.indexOf(R);return{effectiveWidth:oe.effective[Ee]??0,resolvedWidth:oe.resolved[Ee]??0,maxWidth:xr(Ee,oe.resolved)}},[G,oe,Me,we,K,Ce,ue,E]),le=s.useCallback(R=>D.scalingValue(R,i??!1),[i]),_e=le(T??0),pe=s.useMemo(()=>({title1MarginLeft:I,title2MarginLeft:B,title3MarginLeft:$}),[I,B,$]),Q=s.useCallback(R=>K.slice(0,R+1).reduce((ie,ge,Ee)=>ie+(ge!=null&&ge.marginLeftKey?pe[ge.marginLeftKey]??0:0)+(we[Ee]??0),0)+(E?0:I??0),[K,pe,we,E,I]),Ke=s.useCallback(()=>E?0:I??0,[E,I]),ke=s.useCallback(R=>G.slice(0,R).reduce((ie,ge,Ee)=>ie+(ge.marginLeftKey?pe[ge.marginLeftKey]??0:0)+(oe.resolved[Ee]??0),0),[G,oe.resolved,pe]),tt=s.useCallback(R=>{const ie=G[R];return ke(R)+(ie.marginLeftKey?pe[ie.marginLeftKey]??0:0)+(oe.resolved[R]??0)},[G,oe.resolved,ke,pe]),Ye=(R,ie)=>{const ge=R.marginLeftKey?pe[R.marginLeftKey]??0:0,{effectiveWidth:Ee,resolvedWidth:je,maxWidth:et}=Y(R,ie),bt=o&&ie==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":R.prefix,style:{...ie==="single-row"?{gridArea:R.prefix}:{},width:le(Ee),...ge>0?{marginLeft:le(ge)}:{}},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(je),style:{position:"absolute",top:0,left:le(-ge),width:`max(${le(ge)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(et),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:le(-Ai/2),width:le(Ai),height:"100%",pointerEvents:"auto"}})]},R.className)},dt=()=>{const R=E?-1:K.findIndex(Ee=>Ee.prefix==="title1"),ie=!E&&(o||(I??0)>0)?(()=>{const Ee=I??0,je=R>=0?we[R]:N??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:0,width:`max(${le(Ee)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ge=K.flatMap((Ee,je)=>{if(!Ee.marginLeftKey)return[];const et=pe[Ee.marginLeftKey]??0,bt=ov(K,we,pe,je)+Ke();return a.jsx("div",{"data-controls":Ee.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we[je]),style:{position:"absolute",top:0,left:le(bt),width:`max(${le(et)}, 10px)`,height:"100%",pointerEvents:"auto"}},Ee.marginLeftKey)});return ie?[ie,...ge]:ge},ot=()=>K.map((R,ie)=>{const ge=xr(ie,we),je=Q(ie)-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(ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(je),width:le(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),Ve=()=>G.flatMap((R,ie)=>{if(!R.marginLeftKey)return[];const ge=pe[R.marginLeftKey]??0,Ee=ke(ie),{resolvedWidth:je}=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(je),style:{position:"absolute",top:0,left:le(Ee),width:`max(${le(ge)}, 10px)`,height:"100%",pointerEvents:"auto"}},R.marginLeftKey)}),Re=()=>G.map((R,ie)=>{const{maxWidth:ge}=Y(R,"two-row-bottom"),je=tt(ie)-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(ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(je),width:le(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),He=s.useRef(null),Be=s.useRef(null),Ze=s.useRef(null),he=s.useRef(null),xe=s.useRef([]),We=s.useRef([]),Je=s.useRef(0),ve=s.useRef(null),Ie=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),qe=s.useRef(null),ze=s.useRef(null),Le=s.useRef(0),Ge=s.useRef("forward"),De=s.useRef(0),nt=s.useRef(null),it=s.useRef(!1),ct=t.length>1&&(!o||!!r),St=ct?3:1,Bt=s.useMemo(()=>Array.from({length:St},()=>t).flat(),[t,St]),[zt,ft]=s.useState(!1),[wt,jt]=s.useState(!1),[At,vt]=s.useState(!0),Ft=s.useRef(null),Nt=s.useRef(null),Kt=s.useRef(!1),Jt=s.useRef(!1),Tt=s.useRef(null),Wt=s.useRef(null),rn=Te&&!At,gt=s.useCallback(()=>{Te&&(vt(!0),Wt.current&&clearTimeout(Wt.current),Wt.current=setTimeout(()=>{Ie.current.isActive||vt(!1)},jx))},[Te]),Ae=s.useCallback(()=>{o||Jt.current||(Jt.current=!0,jt(!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:ae,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Ae,"aria-label":"Close",children:a.jsx(sn,{url:b,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:ae,height:"100%",pointerEvents:"auto"}})]}),st=(R="two-row")=>a.jsx("div",{...R==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:le(I??0),flexShrink:0,...R==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...R==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ht=()=>{const R=K.find(Ee=>Ee.prefix==="title1"),ie=K.filter(Ee=>Ee.prefix==="title2"||Ee.prefix==="title3"),ge=ie.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?st():null,R&&Ye(R,"two-row-top"),b&&Xe()]}),ge?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[ie.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[ie.map(Ee=>Ye(Ee,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ve(),Re()]})]}):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:_e,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},yt=()=>a.jsxs(a.Fragment,{children:[(I??0)>0||o?st("single-row"):null,K.map(R=>Ye(R,"single-row")),o?a.jsxs(a.Fragment,{children:[dt(),ot()]}):null,b?Xe():null]}),Lt=s.useCallback(R=>!!(R.closest("[data-controls]")||R.closest(`.${e}-thumbnails`)||R.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:mt,backdropStyle:Vt,mediaAreaStyle:kt,overlayContentStyle:Mt,swipeHandlers:Xt,dismissAreaStyle:Yt}=Yd({enabled:j??!1,onClose:Ae,animMs:Eo,isBlockedTarget:Lt}),Ht=()=>{if(!ct||t.length===0)return Je.current=0,0;const R=We.current[0],ie=We.current[t.length];if(!R||!ie)return Je.current;const ge=ie.offsetLeft-R.offsetLeft;return ge>0&&(Je.current=ge),Je.current},Dt=(R=!1)=>{if(!ct)return;const ie=Be.current,ge=Ht();!ie||ge<=0||ge<ie.clientWidth*.25||(ie.scrollLeft<=0?(ie.scrollLeft+=ge,R&&(Ie.current.scrollLeft+=ge),it.current&&(De.current+=ge)):ie.scrollLeft>=ge*2&&(ie.scrollLeft-=ge,R&&(Ie.current.scrollLeft-=ge),it.current&&(De.current-=ge)))},_t=(R,ie=(ge=>(ge=Be.current)==null?void 0:ge.scrollLeft)()??0)=>{if(!ct)return R;let Ee=t.length+R,je=1/0;for(let et=0;et<St;et++){const bt=et*t.length+R,Rt=We.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-ie);tn<je&&(je=tn,Ee=bt)}return Ee},Ct=R=>{const ie=Be.current;return!R||!ie?!1:R.offsetWidth>ie.clientWidth+1},_=R=>{const ie=Be.current;if(!R||!ie||!Ct(R))return!1;const ge=R.offsetLeft,Ee=ge+R.offsetWidth;return ie.scrollLeft>=ge-1&&ie.scrollLeft+ie.clientWidth<=Ee+1},Pe=(R=(ie=>(ie=Be.current)==null?void 0:ie.scrollLeft)()??0)=>{for(let Ee=0;Ee<We.current.length;Ee+=1){const je=We.current[Ee];if(je&&_(je))return Ee}let ge={flatIndex:0,distance:1/0};return We.current.forEach((Ee,je)=>{if(!Ee)return;const et=Math.abs(Ee.offsetLeft-R);et<ge.distance&&(ge={flatIndex:je,distance:et})}),ge.flatIndex},Ne=R=>{Be.current&&We.current.forEach(ie=>{ie&&(ie.style.scrollSnapAlign=Ct(ie)&&R==="backward"?"end":"start")})},Oe=(R,ie,ge)=>{const Ee=R-ie,je=Pe(ie),et=We.current[je];if(_(et))return Pe(R)%t.length;const bt=We.current[je+1],Rt=et?bt?bt.offsetLeft-et.offsetLeft:et.offsetWidth:0,tn=Rt>0?Ee>Rt*fr?1:Ee<-Rt*fr?-1:0:0;return tn===0?ge:ct?(ge+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,ge+tn))},lt=s.useCallback((R=!1)=>{if(C!=="on"||o)return;const ie=he.current,ge=z.current,Ee=xe.current[ge];if(!ie||!Ee||ie.scrollWidth<=ie.clientWidth)return;const je=ie.scrollLeft,et=je+ie.clientWidth,bt=Ee.offsetLeft,Rt=bt+Ee.offsetWidth;if(bt>=je&&Rt<=et)return;const tn=ie.scrollWidth-ie.clientWidth;let Qt=je;if(!R&&Ft.current===null){const Ei=xe.current[ge-1],ho=xe.current[ge+1],ar=Ei?Ee.offsetLeft-Ei.offsetLeft:ho?ho.offsetLeft-Ee.offsetLeft:Ee.offsetWidth;Rt>et?Qt+=ar:bt<je&&(Qt-=ar)}else Rt>et?Qt=Rt-ie.clientWidth:Qt=bt;ie.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,C]),Et=s.useCallback((R=!1)=>{R&&(Kt.current=!0),Nt.current===null&&(Nt.current=requestAnimationFrame(()=>{Nt.current=null;const ie=Kt.current;Kt.current=!1,lt(ie)}))},[lt]),rt=s.useCallback(R=>{if(R===z.current)return;const ie=z.current;z.current=R;const ge=Math.abs(R-ie)>1,Ee=ct&&t.length>1&&(ie===t.length-1&&R===0||ie===0&&R===t.length-1);ce(R),Et(ge||Ee)},[t.length,ct,Et]),xt=()=>{if(!Be.current||t.length===0||Ft.current!==null||Ie.current.isActive&&Ie.current.hasMoved)return;const R=Be.current.scrollLeft,ie=Pe(R)%t.length;ie!==z.current&&rt(ie)},Ot=()=>{Ft.current=null},It=R=>{const ie=Be.current;ie&&(ie.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),it.current=!1},ci=()=>{const R=Be.current;if(!R){nt.current=null,it.current=!1;return}const ie=De.current-R.scrollLeft;if(Math.abs(ie)<.5){R.scrollLeft=De.current,Dt(),xt(),nt.current=null,it.current=!1;return}R.scrollLeft+=ie*Xx,Dt(),xt(),gt(),nt.current=requestAnimationFrame(ci)},di=()=>{const R=Ze.current;R&&(R.style.transition="",R.style.transform="",R.style.willChange="")},nr=(R,ie,ge,Ee)=>{di(),R.scrollLeft=ie,Le.current=R.scrollLeft,Dt(),ge!==void 0?(z.current=ge,ce(ge)):xt(),It(!0),Ee==null||Ee()},ir=(R,{behavior:ie="smooth",activeIndex:ge,onComplete:Ee}={})=>{const je=Be.current,et=Ze.current;if(!je||!et)return;if(un(),nn(),It(!1),ie==="auto"){nr(je,R,ge,Ee);return}const bt=Math.abs(R-je.scrollLeft),Rt=Nx(bt,Ox,Bx,je.clientWidth*.55);ze.current=Dx(je,et,R,{duration:Rt,easing:zx,onComplete:()=>{ze.current=null,nr(je,R,ge,Ee)}})},pa=(R="smooth")=>{const ie=Be.current;if(!ie||t.length===0)return;const ge=Pe()%t.length,Ee=_t(ge,ie.scrollLeft),je=We.current[Ee];je&&ir(je.offsetLeft,{behavior:R,activeIndex:ge})},ma=(R,ie="smooth",ge,Ee)=>{const je=Be.current;if(!je||t.length===0)return;const et=(Ee??je.scrollLeft)-R,bt=Pe(R),Rt=We.current[bt];if(_(Rt)){It(!0),xt();return}const tn=We.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?et>Qt*fr?1:et<-Qt*fr?-1:0:0)!==0){const Su=ge??bt%t.length,Cu=Oe(Ee??je.scrollLeft,R,Su);$n(Cu,ie);return}const ho=Ee??je.scrollLeft,ar=Pe(ho),il=We.current[ar];if(il&&Math.abs(il.offsetLeft-ho)<1){It(!0),xt();return}pa("auto")},$n=(R,ie="smooth")=>{const ge=Be.current;if(!ge||t.length===0)return;const Ee=_t(R,ge.scrollLeft),je=We.current[Ee];je&&(ie==="smooth"?Ft.current=R:Ft.current=null,z.current=R,ce(R),Et(!0),ir(je.offsetLeft,{behavior:ie,activeIndex:R,onComplete:ie==="smooth"?Ot:void 0}))},Pi=()=>{qe.current&&(window.removeEventListener("pointerup",qe.current),window.removeEventListener("pointercancel",qe.current),qe.current=null)},or=(R,ie,ge,Ee,je)=>{const et=ge-R,bt=Ee-ie,Rt=Math.abs(et),tn=Math.abs(bt);if(Rt<qx||Rt<=tn)return!1;const Qt=et<0?1:-1,Ei=ct?(je+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,je+Qt));return Ei===je?!1:($n(Ei),!0)},ui=R=>{if(!Ie.current.isActive)return;Pi();const ie=Be.current;if(!ie)return;const{scrollLeft:ge,startActiveIndex:Ee,hasMoved:je}=Ie.current,et=ie.scrollLeft;Dt(!0),Ie.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ft(!1),R!==void 0&&ie.hasPointerCapture(R)&&ie.releasePointerCapture(R),je?ma(ge,"smooth",Ee,et):(It(!0),xt()),gt()},rr=(R,ie)=>{const ge=ve.current;ve.current=null,ge&&(or(ge.startX,ge.startY,R,ie,ge.startActiveIndex),gt())},ga=R=>{if(!ee)return;if(R.pointerType==="touch"){if(un(),It(!0),Lt(R.target))return;ve.current={startX:R.clientX,startY:R.clientY,startActiveIndex:z.current};return}if(R.pointerType!=="mouse"||R.button!==0||Lt(R.target))return;const ie=Be.current;if(!ie)return;un(),nn(),di(),Ft.current=null,Ie.current={isActive:!0,startX:R.clientX,scrollLeft:ie.scrollLeft,startActiveIndex:z.current,hasMoved:!1},It(!1),gt(),ie.setPointerCapture(R.pointerId),Pi();const ge=Ee=>{Ee.pointerType==="mouse"&&ui(Ee.pointerId)};qe.current=ge,window.addEventListener("pointerup",ge),window.addEventListener("pointercancel",ge)},ha=R=>{if(!ee||R.pointerType!=="mouse")return;const ie=Be.current;if(!ie||!Ie.current.isActive)return;if(R.buttons===0){ui(R.pointerId);return}const ge=R.clientX-Ie.current.startX;Math.abs(ge)>Yx&&(Ie.current.hasMoved=!0,ft(!0)),Ie.current.hasMoved&&(R.preventDefault(),ie.scrollLeft=Ie.current.scrollLeft-ge,Dt(!0),xt(),gt())},be=R=>{if(ee){if(R.pointerType==="touch"){R.type==="pointerup"?rr(R.clientX,R.clientY):ve.current=null;return}R.pointerType==="mouse"&&ui(R.pointerId)}},Ue=R=>{!ee||R.pointerType!=="mouse"||ui(R.pointerId)};return qd(),s.useEffect(()=>{const R=requestAnimationFrame(()=>jt(!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(!Te){vt(!0);return}gt();const R=He.current;if(!R)return;const ie=()=>gt();return R.addEventListener("pointermove",ie),R.addEventListener("pointerdown",ie),()=>{R.removeEventListener("pointermove",ie),R.removeEventListener("pointerdown",ie),Wt.current&&clearTimeout(Wt.current)}},[Te,gt]),s.useEffect(()=>{const R=ie=>{ie.key==="Escape"&&Ae()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[Ae]),s.useLayoutEffect(()=>{Ht()},[H,t.length,ct]),s.useLayoutEffect(()=>{o||$n(z.current,"auto")},[H,o]),s.useLayoutEffect(()=>{$n(0,"auto")},[t.length,ct]),s.useEffect(()=>{const R=Be.current;if(!R||o||!j)return;const ie=ge=>{if(ge.preventDefault(),Math.abs(ge.deltaY)<=Math.abs(ge.deltaX))return;const Ee=ge.deltaMode===1?Gx:ge.deltaMode===2?R.clientHeight:1,je=ge.deltaY*Ee*Vx;if(je!==0){if(nn(),it.current||(it.current=!0,De.current=R.scrollLeft,Ft.current=null,It(!1)),De.current+=je,!ct){const et=R.scrollWidth-R.clientWidth;De.current=Math.max(0,Math.min(et,De.current))}gt(),nt.current===null&&(nt.current=requestAnimationFrame(ci))}};return R.addEventListener("wheel",ie,{passive:!1}),()=>{R.removeEventListener("wheel",ie),un()}},[o,j,ct]),s.useEffect(()=>{const R=Be.current;if(!R)return;const ie=()=>{Dt(Ie.current.isActive);const Ee=R.scrollLeft,je=Ee-Le.current;Le.current=Ee;const et=Je.current>0?Je.current*.5:1/0;if(je!==0&&Math.abs(je)<et){const bt=je>0?"forward":"backward";bt!==Ge.current&&(Ge.current=bt,Ne(bt))}Ie.current.isActive&&Ie.current.hasMoved||xt()};R.addEventListener("scroll",ie,{passive:!0});const ge=new ResizeObserver(()=>{Ht(),Dt(Ie.current.isActive),Ne(Ge.current),xt()});return ge.observe(R),()=>{nn(),R.removeEventListener("scroll",ie),ge.disconnect()}},[t.length,ct]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{mt||Ae()},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,...Vt}}),a.jsxs("div",{ref:He,className:`${e}-lightbox-dismiss-area`,style:Yt,...Xt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:R=>R.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":ee&&t.length>0?"true":"false","data-mouse-dragging":zt?"true":"false",onPointerDown:ga,onPointerMove:ha,onPointerUp:be,onPointerCancel:be,onLostPointerCapture:Ue,children:a.jsx("div",{ref:Ze,className:`${e}-lightbox-strip-track`,style:{gap:H},children:Bt.map((R,ie)=>{const ge=R.image.objectFit??"contain",Ee=ie%t.length,je=Math.floor(ie/t.length),et=yr(H),bt=`calc(-0.5 * (${et} + ${H}))`;return a.jsxs("div",{ref:Rt=>We.current[ie]=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:ge}}),o&&Ee<t.length-1&&je===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:et,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${je}-${R.image.url}-${Ee}`)})})})}),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:U,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:de,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:(Se||b)&&a.jsx("div",{className:`${e}-header ${E?`${e}-header-two-row`:`${e}-header-single-row`}`,children:E?ht():Se||b?yt():null})})})]}),t.length>1&&C==="on"&&(()=>{const R=yr(L),ie=`calc(-0.5 * (${L} + ${R}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:L},children:a.jsx("div",{ref:he,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ge=>ge.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:ne,"--thumbnail-active-color":V},children:[t.map((ge,Ee)=>{const je=yr(ne),et=`calc(-0.5 * (${je} + ${ne}))`;return a.jsxs("div",{ref:bt=>{xe.current[Ee]=bt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":F===Ee?"true":"false",onClick:()=>j&&v==="click"&&$n(Ee),onMouseEnter:()=>$e&&v==="hover"&&$n(Ee),"aria-label":ge.image.name?`View ${ge.image.name}`:`View image ${Ee+1}`,"aria-current":F===Ee?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${J?` ${e}-thumb-image-cover`:""}`,src:ge.image.url,alt:"",draggable:!1,style:{...me,maxWidth:X,maxHeight:X,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Ee<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:et,width:je,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ge.image.url}-${Ee}`)}),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:ie,height:R,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function av(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"}}}},Mx=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],kx={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:[...Mx],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Ax={element:Px,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:kx,sourceCode:Ex},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,Fx=.2,rc=8,Yd=({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*Fx),[]),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,F=$.clientY-T.startY;if(T.isLocked===null){if(Math.abs(k)<rc&&Math.abs(F)<rc)return;if(F>0&&F>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,F);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]),V=s.useCallback($=>{S($)},[S]),N=s.useCallback($=>{S($)},[S]),q=o>0,W=l?`transform ${n}ms ease`:"none",I=l?`opacity ${n}ms ease`:"none",B=o>0||l;return{isSwipeDragging:q,backdropStyle:{opacity:x(o),transition:I},mediaAreaStyle:{transform:m(o),transition:W,touchAction:q?"none":void 0,willChange:q?"transform":void 0},overlayContentStyle:B?{opacity:w(o),transition:I}:void 0,swipeHandlers:e?{onPointerDown:C,onPointerMove:y,onPointerUp:V,onPointerCancel:N}:{},dismissAreaStyle:e?{touchAction:q?"none":"pan-x"}:void 0}},_x="[data-lightbox-scrollable]",qd=()=>{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(_x)||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"})}},[])},Nx=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Wx=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Hx=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Dx=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,f)=>{Wx(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-Hx(t),!1))}},Eo=300,Ox=900,Bx=1500,zx="cubic-bezier(0.16, 1, 0.3, 1)",jx=3e3,Vx=2,Gx=16,Xx=.05,Yx=1,fr=.3,qx=50,Ux=20,Ai=.004,ro=["title1","title2","title3"],Kx={title1:"1",title2:"2",title3:"3"},Zx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Jx={title1:.02,title2:.02,title3:.02},yr=e=>`max(${e}, ${Ux}px)`,Qx=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]}},ev=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=Qx(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Gt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,tv=e=>[Gt(e,"fontFamily"),Gt(e,"fontSettings"),{type:"row",items:[Gt(e,"fontSize"),Gt(e,"lineHeight"),Gt(e,"letterSpacing"),Gt(e,"wordSpacing")]},Gt(e,"textAlign"),Gt(e,"textAppearance")],nv=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ro.map(e=>[Kx[e],tv(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},Ud=(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:Ud(e.length,n)}},iv=(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=Gt(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[Zx[t]]}},ov=(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??Jx[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)},rv=({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:V,title1Width:N,title2Width:q,title3Width:W,title1MarginLeft:I=0,title2MarginLeft:B=0,title3MarginLeft:$=0,titleRowMarginBottom:T=0,titleHeaderLayout:k="desktop",contentMarginTop:F,iconMarginLeft:g}=n,O=R=>D.scalingValue(R,i??!1),P=c??n.thumnailSize??.03,X=O(P),te=O(u),L=O(p??.02),H=O(x??0),U=O(F??0),de=yr(U),ae=O(g??0),[A,ce]=s.useState(0),z=s.useRef(A);z.current=A;const re=t[A],{title1:ee,title2:xe,title3:Fe}=ev(re),ye=Na("title1",_a(n,"title1"),i),b=Na("title2",_a(n,"title2"),i),M=Na("title3",_a(n,"title3"),i),E=k==="mobile",j=!o&&(!i||r),Ce=j,Q=j,Te=j,ie=Dn(y),ue=ie?{"--image-aspect-ratio":da(y)}:void 0,fe=!!(ee||xe||Fe),K=s.useMemo(()=>iv(e,ee,xe,Fe,ye,b,M),[e,A,ee,xe,Fe,ye,b,M]),Z=s.useMemo(()=>({title1Width:N,title2Width:q,title3Width:W}),[N,q,W]),se=s.useMemo(()=>K.map(R=>Z[R.widthKey]),[K,Z]),Se=s.useMemo(()=>el(K.length,se),[K.length,se]),Me=s.useMemo(()=>Ud(K.length,se),[K.length,se]),$e=s.useMemo(()=>K.filter(R=>R.prefix==="title1"),[K]),G=s.useMemo(()=>K.filter(R=>R.prefix==="title2"||R.prefix==="title3"),[K]),pe=s.useMemo(()=>ac($e,Z),[$e,Z]),oe=s.useMemo(()=>ac(G,Z),[G,Z]),Y=s.useCallback((R,ne)=>{const ge=K.indexOf(R);if(!E||ne==="single-row")return{effectiveWidth:Me[ge]??0,resolvedWidth:Se[ge]??0,maxWidth:xr(ge,Se)};if(ne==="two-row-top"){const je=$e.indexOf(R);return{effectiveWidth:pe.effective[je]??0,resolvedWidth:pe.resolved[je]??0,maxWidth:xr(je,pe.resolved)}}const Ee=G.indexOf(R);return{effectiveWidth:oe.effective[Ee]??0,resolvedWidth:oe.resolved[Ee]??0,maxWidth:xr(Ee,oe.resolved)}},[G,oe,Me,Se,K,$e,pe,E]),le=s.useCallback(R=>D.scalingValue(R,i??!1),[i]),_e=le(T??0),me=s.useMemo(()=>({title1MarginLeft:I,title2MarginLeft:B,title3MarginLeft:$}),[I,B,$]),J=s.useCallback(R=>K.slice(0,R+1).reduce((ne,ge,Ee)=>ne+(ge!=null&&ge.marginLeftKey?me[ge.marginLeftKey]??0:0)+(Se[Ee]??0),0)+(E?0:I??0),[K,me,Se,E,I]),Ke=s.useCallback(()=>E?0:I??0,[E,I]),ke=s.useCallback(R=>G.slice(0,R).reduce((ne,ge,Ee)=>ne+(ge.marginLeftKey?me[ge.marginLeftKey]??0:0)+(oe.resolved[Ee]??0),0),[G,oe.resolved,me]),tt=s.useCallback(R=>{const ne=G[R];return ke(R)+(ne.marginLeftKey?me[ne.marginLeftKey]??0:0)+(oe.resolved[R]??0)},[G,oe.resolved,ke,me]),Ye=(R,ne)=>{const ge=R.marginLeftKey?me[R.marginLeftKey]??0:0,{effectiveWidth:Ee,resolvedWidth:je,maxWidth:et}=Y(R,ne),bt=o&&ne==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":R.prefix,style:{...ne==="single-row"?{gridArea:R.prefix}:{},width:le(Ee),...ge>0?{marginLeft:le(ge)}:{}},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(je),style:{position:"absolute",top:0,left:le(-ge),width:`max(${le(ge)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&a.jsx("div",{"data-controls":R.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(et),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:le(-Ai/2),width:le(Ai),height:"100%",pointerEvents:"auto"}})]},R.className)},dt=()=>{const R=E?-1:K.findIndex(Ee=>Ee.prefix==="title1"),ne=!E&&(o||(I??0)>0)?(()=>{const Ee=I??0,je=R>=0?Se[R]:N??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:0,width:`max(${le(Ee)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ge=K.flatMap((Ee,je)=>{if(!Ee.marginLeftKey)return[];const et=me[Ee.marginLeftKey]??0,bt=ov(K,Se,me,je)+Ke();return a.jsx("div",{"data-controls":Ee.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Se[je]),style:{position:"absolute",top:0,left:le(bt),width:`max(${le(et)}, 10px)`,height:"100%",pointerEvents:"auto"}},Ee.marginLeftKey)});return ne?[ne,...ge]:ge},ot=()=>K.map((R,ne)=>{const ge=xr(ne,Se),je=J(ne)-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(ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(je),width:le(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),Ve=()=>G.flatMap((R,ne)=>{if(!R.marginLeftKey)return[];const ge=me[R.marginLeftKey]??0,Ee=ke(ne),{resolvedWidth:je}=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(je),style:{position:"absolute",top:0,left:le(Ee),width:`max(${le(ge)}, 10px)`,height:"100%",pointerEvents:"auto"}},R.marginLeftKey)}),Re=()=>G.map((R,ne)=>{const{maxWidth:ge}=Y(R,"two-row-bottom"),je=tt(ne)-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(ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(je),width:le(Ai),height:"100%",pointerEvents:"auto"}})},`${R.widthKey}-junction`)}),He=s.useRef(null),Be=s.useRef(null),Ze=s.useRef(null),he=s.useRef(null),ve=s.useRef([]),We=s.useRef([]),Je=s.useRef(0),be=s.useRef(null),Ie=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),qe=s.useRef(null),ze=s.useRef(null),Le=s.useRef(0),Ge=s.useRef("forward"),De=s.useRef(0),nt=s.useRef(null),it=s.useRef(!1),ct=t.length>1&&(!o||!!r),St=ct?3:1,Bt=s.useMemo(()=>Array.from({length:St},()=>t).flat(),[t,St]),[zt,ft]=s.useState(!1),[wt,jt]=s.useState(!1),[At,vt]=s.useState(!0),Ft=s.useRef(null),Nt=s.useRef(null),Kt=s.useRef(!1),Jt=s.useRef(!1),Tt=s.useRef(null),Wt=s.useRef(null),rn=Ce&&!At,gt=s.useCallback(()=>{Ce&&(vt(!0),Wt.current&&clearTimeout(Wt.current),Wt.current=setTimeout(()=>{Ie.current.isActive||vt(!1)},jx))},[Ce]),Ae=s.useCallback(()=>{o||Jt.current||(Jt.current=!0,jt(!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:ae,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Ae,"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:ae,height:"100%",pointerEvents:"auto"}})]}),st=(R="two-row")=>a.jsx("div",{...R==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:le(I??0),flexShrink:0,...R==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...R==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ht=()=>{const R=K.find(Ee=>Ee.prefix==="title1"),ne=K.filter(Ee=>Ee.prefix==="title2"||Ee.prefix==="title3"),ge=ne.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?st():null,R&&Ye(R,"two-row-top"),w&&Xe()]}),ge?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[ne.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[ne.map(Ee=>Ye(Ee,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ve(),Re()]})]}):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:_e,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},yt=()=>a.jsxs(a.Fragment,{children:[(I??0)>0||o?st("single-row"):null,K.map(R=>Ye(R,"single-row")),o?a.jsxs(a.Fragment,{children:[dt(),ot()]}):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:Vt,mediaAreaStyle:kt,overlayContentStyle:Mt,swipeHandlers:Xt,dismissAreaStyle:Yt}=Yd({enabled:j??!1,onClose:Ae,animMs:Eo,isBlockedTarget:Lt}),Ht=()=>{if(!ct||t.length===0)return Je.current=0,0;const R=We.current[0],ne=We.current[t.length];if(!R||!ne)return Je.current;const ge=ne.offsetLeft-R.offsetLeft;return ge>0&&(Je.current=ge),Je.current},Dt=(R=!1)=>{if(!ct)return;const ne=Be.current,ge=Ht();!ne||ge<=0||ge<ne.clientWidth*.25||(ne.scrollLeft<=0?(ne.scrollLeft+=ge,R&&(Ie.current.scrollLeft+=ge),it.current&&(De.current+=ge)):ne.scrollLeft>=ge*2&&(ne.scrollLeft-=ge,R&&(Ie.current.scrollLeft-=ge),it.current&&(De.current-=ge)))},_t=(R,ne=(ge=>(ge=Be.current)==null?void 0:ge.scrollLeft)()??0)=>{if(!ct)return R;let Ee=t.length+R,je=1/0;for(let et=0;et<St;et++){const bt=et*t.length+R,Rt=We.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-ne);tn<je&&(je=tn,Ee=bt)}return Ee},Ct=R=>{const ne=Be.current;return!R||!ne?!1:R.offsetWidth>ne.clientWidth+1},_=R=>{const ne=Be.current;if(!R||!ne||!Ct(R))return!1;const ge=R.offsetLeft,Ee=ge+R.offsetWidth;return ne.scrollLeft>=ge-1&&ne.scrollLeft+ne.clientWidth<=Ee+1},Pe=(R=(ne=>(ne=Be.current)==null?void 0:ne.scrollLeft)()??0)=>{for(let Ee=0;Ee<We.current.length;Ee+=1){const je=We.current[Ee];if(je&&_(je))return Ee}let ge={flatIndex:0,distance:1/0};return We.current.forEach((Ee,je)=>{if(!Ee)return;const et=Math.abs(Ee.offsetLeft-R);et<ge.distance&&(ge={flatIndex:je,distance:et})}),ge.flatIndex},Ne=R=>{Be.current&&We.current.forEach(ne=>{ne&&(ne.style.scrollSnapAlign=Ct(ne)&&R==="backward"?"end":"start")})},Oe=(R,ne,ge)=>{const Ee=R-ne,je=Pe(ne),et=We.current[je];if(_(et))return Pe(R)%t.length;const bt=We.current[je+1],Rt=et?bt?bt.offsetLeft-et.offsetLeft:et.offsetWidth:0,tn=Rt>0?Ee>Rt*fr?1:Ee<-Rt*fr?-1:0:0;return tn===0?ge:ct?(ge+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,ge+tn))},lt=s.useCallback((R=!1)=>{if(C!=="on"||o)return;const ne=he.current,ge=z.current,Ee=ve.current[ge];if(!ne||!Ee||ne.scrollWidth<=ne.clientWidth)return;const je=ne.scrollLeft,et=je+ne.clientWidth,bt=Ee.offsetLeft,Rt=bt+Ee.offsetWidth;if(bt>=je&&Rt<=et)return;const tn=ne.scrollWidth-ne.clientWidth;let Qt=je;if(!R&&Ft.current===null){const Ei=ve.current[ge-1],ho=ve.current[ge+1],ar=Ei?Ee.offsetLeft-Ei.offsetLeft:ho?ho.offsetLeft-Ee.offsetLeft:Ee.offsetWidth;Rt>et?Qt+=ar:bt<je&&(Qt-=ar)}else Rt>et?Qt=Rt-ne.clientWidth:Qt=bt;ne.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,C]),Et=s.useCallback((R=!1)=>{R&&(Kt.current=!0),Nt.current===null&&(Nt.current=requestAnimationFrame(()=>{Nt.current=null;const ne=Kt.current;Kt.current=!1,lt(ne)}))},[lt]),rt=s.useCallback(R=>{if(R===z.current)return;const ne=z.current;z.current=R;const ge=Math.abs(R-ne)>1,Ee=ct&&t.length>1&&(ne===t.length-1&&R===0||ne===0&&R===t.length-1);ce(R),Et(ge||Ee)},[t.length,ct,Et]),xt=()=>{if(!Be.current||t.length===0||Ft.current!==null||Ie.current.isActive&&Ie.current.hasMoved)return;const R=Be.current.scrollLeft,ne=Pe(R)%t.length;ne!==z.current&&rt(ne)},Ot=()=>{Ft.current=null},It=R=>{const ne=Be.current;ne&&(ne.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),it.current=!1},ci=()=>{const R=Be.current;if(!R){nt.current=null,it.current=!1;return}const ne=De.current-R.scrollLeft;if(Math.abs(ne)<.5){R.scrollLeft=De.current,Dt(),xt(),nt.current=null,it.current=!1;return}R.scrollLeft+=ne*Xx,Dt(),xt(),gt(),nt.current=requestAnimationFrame(ci)},di=()=>{const R=Ze.current;R&&(R.style.transition="",R.style.transform="",R.style.willChange="")},nr=(R,ne,ge,Ee)=>{di(),R.scrollLeft=ne,Le.current=R.scrollLeft,Dt(),ge!==void 0?(z.current=ge,ce(ge)):xt(),It(!0),Ee==null||Ee()},ir=(R,{behavior:ne="smooth",activeIndex:ge,onComplete:Ee}={})=>{const je=Be.current,et=Ze.current;if(!je||!et)return;if(un(),nn(),It(!1),ne==="auto"){nr(je,R,ge,Ee);return}const bt=Math.abs(R-je.scrollLeft),Rt=Nx(bt,Ox,Bx,je.clientWidth*.55);ze.current=Dx(je,et,R,{duration:Rt,easing:zx,onComplete:()=>{ze.current=null,nr(je,R,ge,Ee)}})},pa=(R="smooth")=>{const ne=Be.current;if(!ne||t.length===0)return;const ge=Pe()%t.length,Ee=_t(ge,ne.scrollLeft),je=We.current[Ee];je&&ir(je.offsetLeft,{behavior:R,activeIndex:ge})},ma=(R,ne="smooth",ge,Ee)=>{const je=Be.current;if(!je||t.length===0)return;const et=(Ee??je.scrollLeft)-R,bt=Pe(R),Rt=We.current[bt];if(_(Rt)){It(!0),xt();return}const tn=We.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?et>Qt*fr?1:et<-Qt*fr?-1:0:0)!==0){const Su=ge??bt%t.length,Cu=Oe(Ee??je.scrollLeft,R,Su);$n(Cu,ne);return}const ho=Ee??je.scrollLeft,ar=Pe(ho),il=We.current[ar];if(il&&Math.abs(il.offsetLeft-ho)<1){It(!0),xt();return}pa("auto")},$n=(R,ne="smooth")=>{const ge=Be.current;if(!ge||t.length===0)return;const Ee=_t(R,ge.scrollLeft),je=We.current[Ee];je&&(ne==="smooth"?Ft.current=R:Ft.current=null,z.current=R,ce(R),Et(!0),ir(je.offsetLeft,{behavior:ne,activeIndex:R,onComplete:ne==="smooth"?Ot:void 0}))},Pi=()=>{qe.current&&(window.removeEventListener("pointerup",qe.current),window.removeEventListener("pointercancel",qe.current),qe.current=null)},or=(R,ne,ge,Ee,je)=>{const et=ge-R,bt=Ee-ne,Rt=Math.abs(et),tn=Math.abs(bt);if(Rt<qx||Rt<=tn)return!1;const Qt=et<0?1:-1,Ei=ct?(je+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,je+Qt));return Ei===je?!1:($n(Ei),!0)},ui=R=>{if(!Ie.current.isActive)return;Pi();const ne=Be.current;if(!ne)return;const{scrollLeft:ge,startActiveIndex:Ee,hasMoved:je}=Ie.current,et=ne.scrollLeft;Dt(!0),Ie.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ft(!1),R!==void 0&&ne.hasPointerCapture(R)&&ne.releasePointerCapture(R),je?ma(ge,"smooth",Ee,et):(It(!0),xt()),gt()},rr=(R,ne)=>{const ge=be.current;be.current=null,ge&&(or(ge.startX,ge.startY,R,ne,ge.startActiveIndex),gt())},ga=R=>{if(!Q)return;if(R.pointerType==="touch"){if(un(),It(!0),Lt(R.target))return;be.current={startX:R.clientX,startY:R.clientY,startActiveIndex:z.current};return}if(R.pointerType!=="mouse"||R.button!==0||Lt(R.target))return;const ne=Be.current;if(!ne)return;un(),nn(),di(),Ft.current=null,Ie.current={isActive:!0,startX:R.clientX,scrollLeft:ne.scrollLeft,startActiveIndex:z.current,hasMoved:!1},It(!1),gt(),ne.setPointerCapture(R.pointerId),Pi();const ge=Ee=>{Ee.pointerType==="mouse"&&ui(Ee.pointerId)};qe.current=ge,window.addEventListener("pointerup",ge),window.addEventListener("pointercancel",ge)},ha=R=>{if(!Q||R.pointerType!=="mouse")return;const ne=Be.current;if(!ne||!Ie.current.isActive)return;if(R.buttons===0){ui(R.pointerId);return}const ge=R.clientX-Ie.current.startX;Math.abs(ge)>Yx&&(Ie.current.hasMoved=!0,ft(!0)),Ie.current.hasMoved&&(R.preventDefault(),ne.scrollLeft=Ie.current.scrollLeft-ge,Dt(!0),xt(),gt())},we=R=>{if(Q){if(R.pointerType==="touch"){R.type==="pointerup"?rr(R.clientX,R.clientY):be.current=null;return}R.pointerType==="mouse"&&ui(R.pointerId)}},Ue=R=>{!Q||R.pointerType!=="mouse"||ui(R.pointerId)};return qd(),s.useEffect(()=>{const R=requestAnimationFrame(()=>jt(!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){vt(!0);return}gt();const R=He.current;if(!R)return;const ne=()=>gt();return R.addEventListener("pointermove",ne),R.addEventListener("pointerdown",ne),()=>{R.removeEventListener("pointermove",ne),R.removeEventListener("pointerdown",ne),Wt.current&&clearTimeout(Wt.current)}},[Ce,gt]),s.useEffect(()=>{const R=ne=>{ne.key==="Escape"&&Ae()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[Ae]),s.useLayoutEffect(()=>{Ht()},[H,t.length,ct]),s.useLayoutEffect(()=>{o||$n(z.current,"auto")},[H,o]),s.useLayoutEffect(()=>{$n(0,"auto")},[t.length,ct]),s.useEffect(()=>{const R=Be.current;if(!R||o||!j)return;const ne=ge=>{if(ge.preventDefault(),Math.abs(ge.deltaY)<=Math.abs(ge.deltaX))return;const Ee=ge.deltaMode===1?Gx:ge.deltaMode===2?R.clientHeight:1,je=ge.deltaY*Ee*Vx;if(je!==0){if(nn(),it.current||(it.current=!0,De.current=R.scrollLeft,Ft.current=null,It(!1)),De.current+=je,!ct){const et=R.scrollWidth-R.clientWidth;De.current=Math.max(0,Math.min(et,De.current))}gt(),nt.current===null&&(nt.current=requestAnimationFrame(ci))}};return R.addEventListener("wheel",ne,{passive:!1}),()=>{R.removeEventListener("wheel",ne),un()}},[o,j,ct]),s.useEffect(()=>{const R=Be.current;if(!R)return;const ne=()=>{Dt(Ie.current.isActive);const Ee=R.scrollLeft,je=Ee-Le.current;Le.current=Ee;const et=Je.current>0?Je.current*.5:1/0;if(je!==0&&Math.abs(je)<et){const bt=je>0?"forward":"backward";bt!==Ge.current&&(Ge.current=bt,Ne(bt))}Ie.current.isActive&&Ie.current.hasMoved||xt()};R.addEventListener("scroll",ne,{passive:!0});const ge=new ResizeObserver(()=>{Ht(),Dt(Ie.current.isActive),Ne(Ge.current),xt()});return ge.observe(R),()=>{nn(),R.removeEventListener("scroll",ne),ge.disconnect()}},[t.length,ct]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{mt||Ae()},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,...Vt}}),a.jsxs("div",{ref:He,className:`${e}-lightbox-dismiss-area`,style:Yt,...Xt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:R=>R.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Q&&t.length>0?"true":"false","data-mouse-dragging":zt?"true":"false",onPointerDown:ga,onPointerMove:ha,onPointerUp:we,onPointerCancel:we,onLostPointerCapture:Ue,children:a.jsx("div",{ref:Ze,className:`${e}-lightbox-strip-track`,style:{gap:H},children:Bt.map((R,ne)=>{const ge=R.image.objectFit??"contain",Ee=ne%t.length,je=Math.floor(ne/t.length),et=yr(H),bt=`calc(-0.5 * (${et} + ${H}))`;return a.jsxs("div",{ref:Rt=>We.current[ne]=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:ge}}),o&&Ee<t.length-1&&je===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:et,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${je}-${R.image.url}-${Ee}`)})})})}),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:U,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:de,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:(fe||w)&&a.jsx("div",{className:`${e}-header ${E?`${e}-header-two-row`:`${e}-header-single-row`}`,children:E?ht():fe||w?yt():null})})})]}),t.length>1&&C==="on"&&(()=>{const R=yr(L),ne=`calc(-0.5 * (${L} + ${R}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:L},children:a.jsx("div",{ref:he,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ge=>ge.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:te,"--thumbnail-active-color":V},children:[t.map((ge,Ee)=>{const je=yr(te),et=`calc(-0.5 * (${je} + ${te}))`;return a.jsxs("div",{ref:bt=>{ve.current[Ee]=bt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":A===Ee?"true":"false",onClick:()=>j&&v==="click"&&$n(Ee),onMouseEnter:()=>Te&&v==="hover"&&$n(Ee),"aria-label":ge.image.name?`View ${ge.image.name}`:`View image ${Ee+1}`,"aria-current":A===Ee?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${ie?` ${e}-thumb-image-cover`:""}`,src:ge.image.url,alt:"",draggable:!1,style:{...ue,maxWidth:X,maxHeight:X,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Ee<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:et,width:je,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ge.image.url}-${Ee}`)}),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:ne,height:R,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function av(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 sv=({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),b=t??[],m=p&&b.length>0,h=()=>{b.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:av(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(rv,{prefix:l,images:b,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>x(!1)}),f)})()]})},lv=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
14614
+ `}const sv=({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:av(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(rv,{prefix:l,images:w,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>x(!1)}),f)})()]})},lv=`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
- `,cv="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 dv(e){const t={};return t[Gt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSettings")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Gt(e,"lineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Gt(e,"letterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Gt(e,"wordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Gt(e,"textAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Gt(e,"textAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const uv=ro.reduce((e,t)=>({...e,...dv(t)}),{}),pv=ro.reduce((e,t)=>({...e,[Gt(t,"fontFamily")]:"Goudy Bookletter 1911",[Gt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Gt(t,"letterSpacing")]:0,[Gt(t,"wordSpacing")]:0,[Gt(t,"textAlign")]:"left",[Gt(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[Gt(n,"fontSize")]=i),o!==void 0&&(t[Gt(n,"lineHeight")]=o),t},{})}const mv=nv(),gv={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"}},...uv,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:cv,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...pv},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:[mv]}],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"}]}},hv={element:sv,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:gv,sourceCode:lv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ro.map(e=>({path:`${Gt(e,"fontFamily")}`}))]},fontRelations:{...ro.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Gt(t,"fontFamily")}`}),{})}},fv=({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:b,backgroundColor:m,imageGap:h,maxWidth:f,maxHeight:v,textTransition:C,title1Width:y,title2Width:S,title3Width:V,title1MarginLeft:N=0,title2MarginLeft:q=0,title3MarginLeft:W=0,titleRowMarginBottom:I=0,titleHeaderLayout:B="single-row",countCloseGap:$=0,closeIcon:T,closeIconMaxWidth:k,closeIconColor:A,closeIconHoverColor:g,contentMarginTop:O=0,iconMarginRight:P=0}=n,X=s.useCallback(be=>D.scalingValue(be,i??!1),[i]),ne=X(h??0),L=`${f}%`,H=`${v}%`,U=X($),de=X(O),ae=X(P),F=wi("title1",bi(n,"title1"),i),ce=wi("title2",bi(n,"title2"),i),z=wi("title3",bi(n,"title3"),i),re=wi("count",bi(n,"count"),i),te=B==="mobile",ye=!i||!!r,Fe=!o&&(!i||!!r),fe=s.useMemo(()=>Er(t,x),[t,x]),[w,M]=s.useState(l),E=fe[w],j=E==null?void 0:E.entry,[Te,ee]=s.useState(!1),[$e,J]=s.useState(null),[me,Se]=s.useState(!1),[K,Z]=s.useState(null),[se,we]=s.useState(!1),[Me,Ce]=s.useState(0),[G,ue]=s.useState(),[oe,Y]=s.useState(),[le,_e]=s.useState(null),pe=s.useRef(null),Q=s.useRef(0),Ke=s.useRef(0),ke=s.useRef(0),tt=s.useRef(!1),Ye=s.useRef(null),dt=s.useRef(null),ot=s.useRef(null),Ve=s.useRef(null),Re=s.useRef(null),He=s.useRef(null),Be=s.useRef(null),Ze=s.useCallback(()=>{const be=dt.current;if(!be)return;const Ue=be.closest(`.${e}-lightbox-content-area`);if(!Ue)return be.getBoundingClientRect().width;const R=Array.from(Ue.children).reduce((ie,ge)=>!(ge instanceof HTMLElement)||ge.contains(be)?ie:ie+ge.getBoundingClientRect().width,0);return Ue.getBoundingClientRect().width-R},[e]),he=s.useCallback(()=>{pe.current&&(clearTimeout(pe.current),pe.current=null)},[]),xe=s.useCallback(be=>{be===Q.current&&(Z(null),we(!1))},[]),We=s.useCallback(()=>{o||tt.current||(tt.current=!0,u==null||u(),ee(!1),Ye.current=setTimeout(()=>{p()},300))},[o,u,p]),Je=s.useCallback(be=>!!(be.closest("[data-controls]")||be.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ve,backdropStyle:Ie,mediaAreaStyle:qe,overlayContentStyle:ze,swipeHandlers:Le,dismissAreaStyle:Ge}=Yd({enabled:Fe,onClose:We,animMs:300,isBlockedTarget:Je}),De=s.useCallback(be=>{d&&Pd(be+1,c,!0)},[d,c]),nt=s.useCallback(be=>{if(be)return be.getBoundingClientRect().height},[]),it=s.useCallback(be=>{if(fe.length===0)return;const Ue=(be%fe.length+fe.length)%fe.length;if(Ue===w)return;const R=fe[w],ie=fe[Ue];Q.current+=1;const ge=Q.current,Ee=C==="fade"&&_l(R==null?void 0:R.entry)!==_l(ie==null?void 0:ie.entry),je=nt(ot.current),et=Ee?(()=>{const Rt=Ze();zn.flushSync(()=>{_e(ie.entry)}),ot.current&&Rt&&(ot.current.style.width=`${Rt}px`);const tn=nt(ot.current);return ot.current&&(ot.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(je??0,(et==null?void 0:et.measuredIncomingTitlesHeight)??0)||void 0;Ce(ge),Z(w),we(!0),M(Ue),De(Ue),ke.current=Ue,Ee?(he(),bt&&ue(bt),et!=null&&et.incomingTitlesMeasureWidth&&Y(et.incomingTitlesMeasureWidth),J((R==null?void 0:R.entryIndex)??null),Se(!0),Ke.current=ie.entryIndex,pe.current=setTimeout(()=>{J(null),Se(!1),ue(void 0),Y(void 0),_e(null),pe.current=null},400)):(he(),J(null),Se(!1),ue(void 0),Y(void 0),_e(null),Ke.current=ie.entryIndex)},[w,he,Ze,nt,fe,De,C]),ct=s.useCallback(()=>{Be.current=null},[]),St=s.useCallback(be=>{!ye||fe.length<=1||be.pointerType==="mouse"&&be.button!==0||be.target.closest("[data-controls]")||(Be.current={startX:be.clientX,startY:be.clientY,pointerId:be.pointerId})},[ye,fe.length]),Bt=s.useCallback(be=>{var Rt;if(!ye||fe.length<=1||be.pointerType==="mouse"&&be.button!==0)return;if(ve){ct();return}const Ue=Be.current;if(!Ue||Ue.pointerId!==be.pointerId||(ct(),be.target.closest("[data-controls]")))return;const ie=be.clientX-Ue.startX,ge=be.clientY-Ue.startY,Ee=Math.abs(ie),je=Math.abs(ge);if(Ee>=Lf&&Ee>je){it(ie>0?w-1:w+1);return}if(Ee>Ml||je>Ml)return;const et=(Rt=Ve.current)==null?void 0:Rt.getBoundingClientRect(),bt=et?et.left+et.width/2:window.innerWidth/2;it(be.clientX<bt?w-1:w+1)},[w,ye,it,ve,ct,fe.length]),zt=s.useCallback(be=>{const Ue=Be.current;(Ue==null?void 0:Ue.pointerId)===be.pointerId&&ct()},[ct]);qd(),s.useEffect(()=>{He.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const be=requestAnimationFrame(()=>{ee(!0),requestAnimationFrame(()=>{Re.current?Re.current.focus():Ve.current&&Ve.current.focus()})});return()=>{cancelAnimationFrame(be),Ye.current&&clearTimeout(Ye.current),pe.current&&clearTimeout(pe.current);const Ue=He.current;Ue&&document.contains(Ue)&&Ue.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var be;C!=="fade"&&(Ke.current=((be=fe[w])==null?void 0:be.entryIndex)??0,he(),J(null),Se(!1),ue(void 0),Y(void 0))},[w,he,fe,C]),s.useEffect(()=>{const be=Ue=>{if(Ue.key==="Escape"){We();return}if(Ue.key==="ArrowLeft"&&fe.length>1){it(w-1);return}if(Ue.key==="ArrowRight"&&fe.length>1){it(w+1);return}if(Ue.key==="Tab"&&Ve.current){const R=Ve.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),ie=Array.from(R).filter(et=>!et.closest('[aria-hidden="true"]'));if(ie.length===0)return;const ge=ie[0],Ee=ie[ie.length-1],je=document.activeElement;Ue.shiftKey?(je===ge||!Ve.current.contains(je))&&(Ue.preventDefault(),Ee.focus()):(je===Ee||!Ve.current.contains(je))&&(Ue.preventDefault(),ge.focus())}};return window.addEventListener("keydown",be),()=>window.removeEventListener("keydown",be)},[it,We,w,fe.length]),s.useLayoutEffect(()=>{he(),Q.current=0,Ce(0),Z(null),we(!1),J(null),Se(!1),ue(void 0),Y(void 0),_e(null),M(be=>{const Ue=Math.max(0,fe.length-1);return Math.min(be,Ue)})},[he,t.length,x,fe.length]),s.useLayoutEffect(()=>{var R;const be=Math.max(0,fe.length-1),Ue=Math.min(Math.max(0,l),be);ke.current=Ue,Ke.current=((R=fe[Ue])==null?void 0:R.entryIndex)??0,M(Ue)},[l]);const ft=$e!==null?t[$e]:null,wt=K!==null?fe[K]:null,jt=(j==null?void 0:j.title1)||(j==null?void 0:j.title2)||(j==null?void 0:j.title3)||(ft==null?void 0:ft.title1)||(ft==null?void 0:ft.title2)||(ft==null?void 0:ft.title3),At=Nf(x,fe,t),vt=T!==null,Ft=jt||At||vt,Nt=At&&vt?{gap:U}:void 0,Kt=`${e}-titles-stack${te?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${te?` ${e}-titles-layer-out-stacked`:""}`,Tt=`${e}-titles-layer-out`,Wt=(N??0)>0||o,rn=X(I),gt=s.useMemo(()=>({title1Width:y??Yi.title1Width,title2Width:S??Yi.title2Width,title3Width:V??Yi.title3Width}),[y,S,V]),Ae=s.useMemo(()=>({title2MarginLeft:q,title3MarginLeft:W}),[q,W]),Xe=s.useMemo(()=>j?Kn(e,j,F,ce,z):[],[e,j,F,ce,z]),st=s.useMemo(()=>Xe.map(be=>gt[be.widthKey]),[Xe,gt]),ht=s.useMemo(()=>Qi(Xe.length,st),[Xe.length,st]),yt=s.useMemo(()=>Ho(Xe.length,st),[Xe.length,st]),Lt=s.useMemo(()=>Xe.filter(be=>be.prefix==="title1"),[Xe]),mt=s.useMemo(()=>Xe.filter(be=>be.prefix==="title2"||be.prefix==="title3"),[Xe]),Vt=s.useMemo(()=>Zn(Lt,gt),[Lt,gt]),kt=s.useMemo(()=>Zn(mt,gt),[mt,gt]),Mt=s.useCallback((be,Ue)=>{const R=Xe.findIndex(ge=>ge.prefix===be.prefix);if(!te||Ue==="single-row")return{effectiveWidth:yt[R]??0,resolvedWidth:ht[R]??0,maxWidth:cn(R,ht)};if(Ue==="two-row-top"){const ge=Lt.findIndex(Ee=>Ee.prefix===be.prefix);return{effectiveWidth:Vt.effective[ge]??0,resolvedWidth:Vt.resolved[ge]??0,maxWidth:cn(ge,Vt.resolved)}}const ie=mt.findIndex(ge=>ge.prefix===be.prefix);return{effectiveWidth:kt.effective[ie]??0,resolvedWidth:kt.resolved[ie]??0,maxWidth:cn(ie,kt.resolved)}},[Xe,mt,kt,yt,ht,Lt,Vt,te]),Xt=s.useCallback(be=>Ad(Xe,ht,Ae,be)+(te?0:N??0),[Xe,ht,Ae,te,N]),Yt=s.useCallback(()=>te?0:N??0,[te,N]),Ht=s.useCallback(be=>mt.slice(0,be).reduce((Ue,R,ie)=>Ue+(R.marginLeftKey?Ae[R.marginLeftKey]??0:0)+(kt.resolved[ie]??0),0),[mt,kt.resolved,Ae]),Dt=s.useCallback(be=>{const Ue=mt[be];return Ht(be)+(Ue.marginLeftKey?Ae[Ue.marginLeftKey]??0:0)+(kt.resolved[be]??0)},[mt,kt.resolved,Ht,Ae]),_t=s.useCallback((be,Ue,R)=>{if(!te||R==="single-row"){const et=be.findIndex(Qt=>Qt.prefix===Ue.prefix),bt=be.map(Qt=>gt[Qt.widthKey]),Rt=Qi(be.length,bt);return{effectiveWidth:Ho(be.length,bt)[et]??0,resolvedWidth:Rt[et]??0,maxWidth:cn(et,Rt)}}if(R==="two-row-top"){const et=be.filter(Qt=>Qt.prefix==="title1"),bt=et.findIndex(Qt=>Qt.prefix===Ue.prefix),{resolved:Rt,effective:tn}=Zn(et,gt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:cn(bt,Rt)}}const ie=be.filter(et=>et.prefix==="title2"||et.prefix==="title3"),ge=ie.findIndex(et=>et.prefix===Ue.prefix),{resolved:Ee,effective:je}=Zn(ie,gt);return{effectiveWidth:je[ge]??0,resolvedWidth:Ee[ge]??0,maxWidth:cn(ge,Ee)}},[gt,te]),Ct=(be,Ue,R)=>{const ie=be.marginLeftKey?Ae[be.marginLeftKey]??0:0,{effectiveWidth:ge,resolvedWidth:Ee,maxWidth:je}=R??Mt(be,Ue),et=Math.max(ie,Un),bt=o&&Ue==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":be.prefix,style:{width:X(ge),...ie>0?{marginLeft:X(ie)}:{}},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(Ee),style:{position:"absolute",top:0,left:X(-ie),width:X(et),height:"100%",pointerEvents:"auto"}}):null,bt?a.jsx("div",{"data-controls":be.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(je),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:X(-fn/2),width:X(fn),height:"100%",pointerEvents:"auto"}}):null]},be.className)},_=(be="two-row")=>{const Ue=Xe.findIndex(ge=>ge.prefix==="title1"),R=Ue>=0?ht[Ue]:gt.title1Width,ie=be==="two-row"&&o;return a.jsx("div",{...ie?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(R)}:{},style:{width:X(N??0),flexShrink:0,alignSelf:"stretch",...ie?{pointerEvents:"auto"}:{}}})},Pe=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:F,"aria-hidden":"true",children:" "}),Ne=()=>a.jsx("span",{className:`${e}-entry-counter`,style:re,"aria-live":"polite","aria-atomic":"true",children:_f(fe,w,x,t)}),Oe=()=>At?o&&vt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ne(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Ra(U)} + ${U}))`,width:Ra(U),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ne():null,lt=()=>!At&&!vt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Nt,children:[Oe(),vt?xt():null]}),Et=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||jt?Pe():null,Wt?_("single-row"):null,It(j),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),lt(),$n()]}),rt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||jt?Pe():null,Wt?_("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:me&&G?{minHeight:G}:void 0,children:[a.jsx("div",{ref:ot,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:di(le||j)}),a.jsxs("div",{ref:dt,className:Kt,style:{position:me?"absolute":"relative",inset:me?0:void 0,width:"100%",...me&&oe?{width:oe,maxWidth:"100%"}:void 0},children:[ft&&me?a.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:di(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${me?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:di(j)})]})]}),lt(),$n()]}),xt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(k??0,i),height:D.scalingValue(k??0,i),marginRight:ae,"--close-icon-hover-color":g},children:[a.jsx("button",{ref:Re,type:"button",className:`${e}-close-icon-inner`,onClick:We,"aria-label":"Close",children:a.jsx(sn,{url:T??"",fill:A,hoverFill:i&&!r?A: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:ae,height:"100%",pointerEvents:"auto"}})]}),Ot=(be,Ue)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||jt?Pe():null,Wt?_("two-row"):null,Ue!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ue},children:be}):a.jsxs(a.Fragment,{children:[be,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),lt()]}),It=be=>{if(!be)return null;const Ue=Kn(e,be,F,ce,z);return a.jsx(a.Fragment,{children:Ue.map(R=>Ct(R,"single-row",_t(Ue,R,"single-row")))})},nn=be=>{if(!be)return null;const Ue=Kn(e,be,F,ce,z),R=Ue.find(ie=>ie.prefix==="title1");return R?Ct(R,"two-row-top",_t(Ue,R,"two-row-top")):null},un=(be,Ue=!1)=>{const R=be?Kn(e,be,F,ce,z):[],ie=R.filter(je=>je.prefix==="title2"||je.prefix==="title3"),ge=o&&Ue;return ie.length>0||ge||(I??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ie.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[ie.map(je=>Ct(je,"two-row-bottom",_t(R,je,"two-row-bottom"))),Ue&&o?a.jsxs(a.Fragment,{children:[pa(),ma()]}):null]}):null,(I??0)>0||ge?a.jsx("div",{"data-controls":ge?"titleRowMarginBottom":void 0,"data-controls-axis":ge?"y":void 0,"data-controls-reverse":ge?"":void 0,className:ge?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:ge?"auto":"none"}}):null]}):null},ci=(be,Ue=!1)=>a.jsxs(a.Fragment,{children:[Ot(nn(be)),un(be,Ue)]}),di=be=>te?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=te?-1:Xe.findIndex(ie=>ie.prefix==="title1"),Ue=!te&&(o||(N??0)>0)?(()=>{const ie=N??0,ge=be>=0?ht[be]:gt.title1Width,Ee=Math.max(ie,Un);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:X(Ee),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,R=Xe.flatMap((ie,ge)=>{if(!ie.marginLeftKey)return[];const Ee=Ae[ie.marginLeftKey]??0,je=kd(Xe,ht,Ae,ge)+Yt(),et=Math.max(Ee,Un);return a.jsx("div",{"data-controls":ie.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ht[ge]),style:{position:"absolute",top:0,left:X(je),width:X(et),height:"100%",pointerEvents:"auto"}},ie.marginLeftKey)});return Ue?[Ue,...R]:R},ir=()=>Xe.map((be,Ue)=>{const R=cn(Ue,ht),ge=Xt(Ue)-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:X(ge),width:X(fn),height:"100%",pointerEvents:"auto"}})},`${be.widthKey}-junction`)}),pa=()=>mt.flatMap((be,Ue)=>{if(!be.marginLeftKey)return[];const R=Ae[be.marginLeftKey]??0,ie=Ht(Ue),ge=Math.max(R,Un),{resolvedWidth:Ee}=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(Ee),style:{position:"absolute",top:0,left:X(ie),width:X(ge),height:"100%",pointerEvents:"auto"}},be.marginLeftKey)}),ma=()=>mt.map((be,Ue)=>{const{maxWidth:R}=Mt(be,"two-row-bottom"),ge=Dt(Ue)-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:X(ge),width:X(fn),height:"100%",pointerEvents:"auto"}})},`${be.widthKey}-junction`)}),$n=()=>!o||te?null:a.jsxs(a.Fragment,{children:[nr(),ir()]}),Pi=be=>{const Ue=!be.objectFit&&Dn(b);return{className:`${e}-slide-image-cell${Ue?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:L,maxHeight:H,...Ue?{"--image-aspect-ratio":da(b)}:{}}}},or=be=>be.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":be.objectFit}}:Dn(b)?{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 Ue=be.length>1,R=Ra(ne),ie=`calc(-0.5 * (${R} + ${ne}))`;if(be.length===1){const ge=be[0];return a.jsx("div",{...Pi(ge),children:a.jsx("img",{...or(ge),src:ge.url,alt:ge.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ue?{gap:ne}:void 0,children:be.map((ge,Ee)=>a.jsxs("div",{...Pi(ge),children:[a.jsx("img",{...or(ge),src:ge.url,alt:ge.name??"",draggable:!1}),o&&Ue&&Ee<be.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ie,width:R,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ge.url}-${Ee}`))})},rr=!!(j!=null&&j.title2||j!=null&&j.title3||ft!=null&&ft.title2||ft!=null&&ft.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:ot,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ci(le||j)}),a.jsxs("div",{ref:dt,className:`${e}-titles-row-two-row`,style:{...me&&G?{minHeight:G}:void 0,...me&&oe?{width:oe,maxWidth:"100%"}:void 0},children:[Ot(a.jsxs("div",{className:Kt,style:{position:me?"absolute":"relative",inset:me?0:void 0,width:"100%"},children:[ft&&me?a.jsx("div",{className:`${Tt} ${e}-titles-fade-out`,children:nn(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${me?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(j)})]}),me&&G?G:void 0),rr?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ft&&me?a.jsx("div",{className:`${Jt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${me?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${te?` ${e}-titles-layer-in-stacked`:""}`,children:un(j,!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(j,!0)}),$n()]})};return a.jsxs("div",{ref:Ve,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ve||We()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:vt?void 0:-1,style:{opacity:Te?1:0,transition:"opacity 300ms ease",pointerEvents:Te?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...Ie}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ge,...Le,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:qe,onClick:be=>be.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ye&&fe.length>1?"true":"false",onPointerDown:ye?St:void 0,onPointerUp:ye?Bt:void 0,onPointerCancel:ye?zt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&se?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:be=>{be.target===be.currentTarget&&xe(Me)},children:a.jsx("div",{className:`${e}-slide-area`,children:ui(wt.images)})},`slide-out-${Me}`):null,a.jsx("div",{className:`${e}-slide-layer-in${se?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:E?ui(E.images):null})},`slide-in-${Me}-${w}`)]})})}),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:de,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...te?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${te?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&a.jsx("div",{className:`${e}-text-bar-cell${te?` ${e}-text-bar-cell-stacked`:""}`,style:te?void 0:{flex:1,minWidth:0,width:"100%"},children:te?C==="fade"?ga():ha():C==="fade"?rt():Et()})})})]})]})]})};function yv(e){return`
15160
+ `,cv="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 dv(e){const t={};return t[Gt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSettings")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Gt(e,"lineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Gt(e,"letterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Gt(e,"wordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Gt(e,"textAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Gt(e,"textAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const uv=ro.reduce((e,t)=>({...e,...dv(t)}),{}),pv=ro.reduce((e,t)=>({...e,[Gt(t,"fontFamily")]:"Goudy Bookletter 1911",[Gt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Gt(t,"letterSpacing")]:0,[Gt(t,"wordSpacing")]:0,[Gt(t,"textAlign")]:"left",[Gt(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[Gt(n,"fontSize")]=i),o!==void 0&&(t[Gt(n,"lineHeight")]=o),t},{})}const mv=nv(),gv={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"}},...uv,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:cv,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...pv},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:[mv]}],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"}]}},hv={element:sv,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:gv,sourceCode:lv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ro.map(e=>({path:`${Gt(e,"fontFamily")}`}))]},fontRelations:{...ro.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Gt(t,"fontFamily")}`}),{})}},fv=({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:V,title1MarginLeft:N=0,title2MarginLeft:q=0,title3MarginLeft:W=0,titleRowMarginBottom:I=0,titleHeaderLayout:B="single-row",countCloseGap:$=0,closeIcon:T,closeIconMaxWidth:k,closeIconColor:F,closeIconHoverColor:g,contentMarginTop:O=0,iconMarginRight:P=0}=n,X=s.useCallback(we=>D.scalingValue(we,i??!1),[i]),te=X(h??0),L=`${f}%`,H=`${v}%`,U=X($),de=X(O),ae=X(P),A=wi("title1",bi(n,"title1"),i),ce=wi("title2",bi(n,"title2"),i),z=wi("title3",bi(n,"title3"),i),re=wi("count",bi(n,"count"),i),ee=B==="mobile",xe=!i||!!r,Fe=!o&&(!i||!!r),ye=s.useMemo(()=>Er(t,x),[t,x]),[b,M]=s.useState(l),E=ye[b],j=E==null?void 0:E.entry,[Ce,Q]=s.useState(!1),[Te,ie]=s.useState(null),[ue,fe]=s.useState(!1),[K,Z]=s.useState(null),[se,Se]=s.useState(!1),[Me,$e]=s.useState(0),[G,pe]=s.useState(),[oe,Y]=s.useState(),[le,_e]=s.useState(null),me=s.useRef(null),J=s.useRef(0),Ke=s.useRef(0),ke=s.useRef(0),tt=s.useRef(!1),Ye=s.useRef(null),dt=s.useRef(null),ot=s.useRef(null),Ve=s.useRef(null),Re=s.useRef(null),He=s.useRef(null),Be=s.useRef(null),Ze=s.useCallback(()=>{const we=dt.current;if(!we)return;const Ue=we.closest(`.${e}-lightbox-content-area`);if(!Ue)return we.getBoundingClientRect().width;const R=Array.from(Ue.children).reduce((ne,ge)=>!(ge instanceof HTMLElement)||ge.contains(we)?ne:ne+ge.getBoundingClientRect().width,0);return Ue.getBoundingClientRect().width-R},[e]),he=s.useCallback(()=>{me.current&&(clearTimeout(me.current),me.current=null)},[]),ve=s.useCallback(we=>{we===J.current&&(Z(null),Se(!1))},[]),We=s.useCallback(()=>{o||tt.current||(tt.current=!0,u==null||u(),Q(!1),Ye.current=setTimeout(()=>{p()},300))},[o,u,p]),Je=s.useCallback(we=>!!(we.closest("[data-controls]")||we.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:be,backdropStyle:Ie,mediaAreaStyle:qe,overlayContentStyle:ze,swipeHandlers:Le,dismissAreaStyle:Ge}=Yd({enabled:Fe,onClose:We,animMs:300,isBlockedTarget:Je}),De=s.useCallback(we=>{d&&Pd(we+1,c,!0)},[d,c]),nt=s.useCallback(we=>{if(we)return we.getBoundingClientRect().height},[]),it=s.useCallback(we=>{if(ye.length===0)return;const Ue=(we%ye.length+ye.length)%ye.length;if(Ue===b)return;const R=ye[b],ne=ye[Ue];J.current+=1;const ge=J.current,Ee=C==="fade"&&_l(R==null?void 0:R.entry)!==_l(ne==null?void 0:ne.entry),je=nt(ot.current),et=Ee?(()=>{const Rt=Ze();zn.flushSync(()=>{_e(ne.entry)}),ot.current&&Rt&&(ot.current.style.width=`${Rt}px`);const tn=nt(ot.current);return ot.current&&(ot.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(je??0,(et==null?void 0:et.measuredIncomingTitlesHeight)??0)||void 0;$e(ge),Z(b),Se(!0),M(Ue),De(Ue),ke.current=Ue,Ee?(he(),bt&&pe(bt),et!=null&&et.incomingTitlesMeasureWidth&&Y(et.incomingTitlesMeasureWidth),ie((R==null?void 0:R.entryIndex)??null),fe(!0),Ke.current=ne.entryIndex,me.current=setTimeout(()=>{ie(null),fe(!1),pe(void 0),Y(void 0),_e(null),me.current=null},400)):(he(),ie(null),fe(!1),pe(void 0),Y(void 0),_e(null),Ke.current=ne.entryIndex)},[b,he,Ze,nt,ye,De,C]),ct=s.useCallback(()=>{Be.current=null},[]),St=s.useCallback(we=>{!xe||ye.length<=1||we.pointerType==="mouse"&&we.button!==0||we.target.closest("[data-controls]")||(Be.current={startX:we.clientX,startY:we.clientY,pointerId:we.pointerId})},[xe,ye.length]),Bt=s.useCallback(we=>{var Rt;if(!xe||ye.length<=1||we.pointerType==="mouse"&&we.button!==0)return;if(be){ct();return}const Ue=Be.current;if(!Ue||Ue.pointerId!==we.pointerId||(ct(),we.target.closest("[data-controls]")))return;const ne=we.clientX-Ue.startX,ge=we.clientY-Ue.startY,Ee=Math.abs(ne),je=Math.abs(ge);if(Ee>=Lf&&Ee>je){it(ne>0?b-1:b+1);return}if(Ee>Ml||je>Ml)return;const et=(Rt=Ve.current)==null?void 0:Rt.getBoundingClientRect(),bt=et?et.left+et.width/2:window.innerWidth/2;it(we.clientX<bt?b-1:b+1)},[b,xe,it,be,ct,ye.length]),zt=s.useCallback(we=>{const Ue=Be.current;(Ue==null?void 0:Ue.pointerId)===we.pointerId&&ct()},[ct]);qd(),s.useEffect(()=>{He.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const we=requestAnimationFrame(()=>{Q(!0),requestAnimationFrame(()=>{Re.current?Re.current.focus():Ve.current&&Ve.current.focus()})});return()=>{cancelAnimationFrame(we),Ye.current&&clearTimeout(Ye.current),me.current&&clearTimeout(me.current);const Ue=He.current;Ue&&document.contains(Ue)&&Ue.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var we;C!=="fade"&&(Ke.current=((we=ye[b])==null?void 0:we.entryIndex)??0,he(),ie(null),fe(!1),pe(void 0),Y(void 0))},[b,he,ye,C]),s.useEffect(()=>{const we=Ue=>{if(Ue.key==="Escape"){We();return}if(Ue.key==="ArrowLeft"&&ye.length>1){it(b-1);return}if(Ue.key==="ArrowRight"&&ye.length>1){it(b+1);return}if(Ue.key==="Tab"&&Ve.current){const R=Ve.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),ne=Array.from(R).filter(et=>!et.closest('[aria-hidden="true"]'));if(ne.length===0)return;const ge=ne[0],Ee=ne[ne.length-1],je=document.activeElement;Ue.shiftKey?(je===ge||!Ve.current.contains(je))&&(Ue.preventDefault(),Ee.focus()):(je===Ee||!Ve.current.contains(je))&&(Ue.preventDefault(),ge.focus())}};return window.addEventListener("keydown",we),()=>window.removeEventListener("keydown",we)},[it,We,b,ye.length]),s.useLayoutEffect(()=>{he(),J.current=0,$e(0),Z(null),Se(!1),ie(null),fe(!1),pe(void 0),Y(void 0),_e(null),M(we=>{const Ue=Math.max(0,ye.length-1);return Math.min(we,Ue)})},[he,t.length,x,ye.length]),s.useLayoutEffect(()=>{var R;const we=Math.max(0,ye.length-1),Ue=Math.min(Math.max(0,l),we);ke.current=Ue,Ke.current=((R=ye[Ue])==null?void 0:R.entryIndex)??0,M(Ue)},[l]);const ft=Te!==null?t[Te]:null,wt=K!==null?ye[K]:null,jt=(j==null?void 0:j.title1)||(j==null?void 0:j.title2)||(j==null?void 0:j.title3)||(ft==null?void 0:ft.title1)||(ft==null?void 0:ft.title2)||(ft==null?void 0:ft.title3),At=Nf(x,ye,t),vt=T!==null,Ft=jt||At||vt,Nt=At&&vt?{gap:U}:void 0,Kt=`${e}-titles-stack${ee?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${ee?` ${e}-titles-layer-out-stacked`:""}`,Tt=`${e}-titles-layer-out`,Wt=(N??0)>0||o,rn=X(I),gt=s.useMemo(()=>({title1Width:y??Yi.title1Width,title2Width:S??Yi.title2Width,title3Width:V??Yi.title3Width}),[y,S,V]),Ae=s.useMemo(()=>({title2MarginLeft:q,title3MarginLeft:W}),[q,W]),Xe=s.useMemo(()=>j?Kn(e,j,A,ce,z):[],[e,j,A,ce,z]),st=s.useMemo(()=>Xe.map(we=>gt[we.widthKey]),[Xe,gt]),ht=s.useMemo(()=>Qi(Xe.length,st),[Xe.length,st]),yt=s.useMemo(()=>Ho(Xe.length,st),[Xe.length,st]),Lt=s.useMemo(()=>Xe.filter(we=>we.prefix==="title1"),[Xe]),mt=s.useMemo(()=>Xe.filter(we=>we.prefix==="title2"||we.prefix==="title3"),[Xe]),Vt=s.useMemo(()=>Zn(Lt,gt),[Lt,gt]),kt=s.useMemo(()=>Zn(mt,gt),[mt,gt]),Mt=s.useCallback((we,Ue)=>{const R=Xe.findIndex(ge=>ge.prefix===we.prefix);if(!ee||Ue==="single-row")return{effectiveWidth:yt[R]??0,resolvedWidth:ht[R]??0,maxWidth:cn(R,ht)};if(Ue==="two-row-top"){const ge=Lt.findIndex(Ee=>Ee.prefix===we.prefix);return{effectiveWidth:Vt.effective[ge]??0,resolvedWidth:Vt.resolved[ge]??0,maxWidth:cn(ge,Vt.resolved)}}const ne=mt.findIndex(ge=>ge.prefix===we.prefix);return{effectiveWidth:kt.effective[ne]??0,resolvedWidth:kt.resolved[ne]??0,maxWidth:cn(ne,kt.resolved)}},[Xe,mt,kt,yt,ht,Lt,Vt,ee]),Xt=s.useCallback(we=>Ad(Xe,ht,Ae,we)+(ee?0:N??0),[Xe,ht,Ae,ee,N]),Yt=s.useCallback(()=>ee?0:N??0,[ee,N]),Ht=s.useCallback(we=>mt.slice(0,we).reduce((Ue,R,ne)=>Ue+(R.marginLeftKey?Ae[R.marginLeftKey]??0:0)+(kt.resolved[ne]??0),0),[mt,kt.resolved,Ae]),Dt=s.useCallback(we=>{const Ue=mt[we];return Ht(we)+(Ue.marginLeftKey?Ae[Ue.marginLeftKey]??0:0)+(kt.resolved[we]??0)},[mt,kt.resolved,Ht,Ae]),_t=s.useCallback((we,Ue,R)=>{if(!ee||R==="single-row"){const et=we.findIndex(Qt=>Qt.prefix===Ue.prefix),bt=we.map(Qt=>gt[Qt.widthKey]),Rt=Qi(we.length,bt);return{effectiveWidth:Ho(we.length,bt)[et]??0,resolvedWidth:Rt[et]??0,maxWidth:cn(et,Rt)}}if(R==="two-row-top"){const et=we.filter(Qt=>Qt.prefix==="title1"),bt=et.findIndex(Qt=>Qt.prefix===Ue.prefix),{resolved:Rt,effective:tn}=Zn(et,gt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:cn(bt,Rt)}}const ne=we.filter(et=>et.prefix==="title2"||et.prefix==="title3"),ge=ne.findIndex(et=>et.prefix===Ue.prefix),{resolved:Ee,effective:je}=Zn(ne,gt);return{effectiveWidth:je[ge]??0,resolvedWidth:Ee[ge]??0,maxWidth:cn(ge,Ee)}},[gt,ee]),Ct=(we,Ue,R)=>{const ne=we.marginLeftKey?Ae[we.marginLeftKey]??0:0,{effectiveWidth:ge,resolvedWidth:Ee,maxWidth:je}=R??Mt(we,Ue),et=Math.max(ne,Un),bt=o&&Ue==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":we.prefix,style:{width:X(ge),...ne>0?{marginLeft:X(ne)}:{}},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(Ee),style:{position:"absolute",top:0,left:X(-ne),width:X(et),height:"100%",pointerEvents:"auto"}}):null,bt?a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(je),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:X(-fn/2),width:X(fn),height:"100%",pointerEvents:"auto"}}):null]},we.className)},_=(we="two-row")=>{const Ue=Xe.findIndex(ge=>ge.prefix==="title1"),R=Ue>=0?ht[Ue]:gt.title1Width,ne=we==="two-row"&&o;return a.jsx("div",{...ne?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(R)}:{},style:{width:X(N??0),flexShrink:0,alignSelf:"stretch",...ne?{pointerEvents:"auto"}:{}}})},Pe=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:A,"aria-hidden":"true",children:" "}),Ne=()=>a.jsx("span",{className:`${e}-entry-counter`,style:re,"aria-live":"polite","aria-atomic":"true",children:_f(ye,b,x,t)}),Oe=()=>At?o&&vt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ne(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Ra(U)} + ${U}))`,width:Ra(U),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ne():null,lt=()=>!At&&!vt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Nt,children:[Oe(),vt?xt():null]}),Et=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||jt?Pe():null,Wt?_("single-row"):null,It(j),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),lt(),$n()]}),rt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||jt?Pe():null,Wt?_("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:ue&&G?{minHeight:G}:void 0,children:[a.jsx("div",{ref:ot,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:di(le||j)}),a.jsxs("div",{ref:dt,className:Kt,style:{position:ue?"absolute":"relative",inset:ue?0:void 0,width:"100%",...ue&&oe?{width:oe,maxWidth:"100%"}:void 0},children:[ft&&ue?a.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:di(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:di(j)})]})]}),lt(),$n()]}),xt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(k??0,i),height:D.scalingValue(k??0,i),marginRight:ae,"--close-icon-hover-color":g},children:[a.jsx("button",{ref:Re,type:"button",className:`${e}-close-icon-inner`,onClick:We,"aria-label":"Close",children:a.jsx(sn,{url:T??"",fill:F,hoverFill:i&&!r?F: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:ae,height:"100%",pointerEvents:"auto"}})]}),Ot=(we,Ue)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||jt?Pe():null,Wt?_("two-row"):null,Ue!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ue},children:we}):a.jsxs(a.Fragment,{children:[we,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),lt()]}),It=we=>{if(!we)return null;const Ue=Kn(e,we,A,ce,z);return a.jsx(a.Fragment,{children:Ue.map(R=>Ct(R,"single-row",_t(Ue,R,"single-row")))})},nn=we=>{if(!we)return null;const Ue=Kn(e,we,A,ce,z),R=Ue.find(ne=>ne.prefix==="title1");return R?Ct(R,"two-row-top",_t(Ue,R,"two-row-top")):null},un=(we,Ue=!1)=>{const R=we?Kn(e,we,A,ce,z):[],ne=R.filter(je=>je.prefix==="title2"||je.prefix==="title3"),ge=o&&Ue;return ne.length>0||ge||(I??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ne.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[ne.map(je=>Ct(je,"two-row-bottom",_t(R,je,"two-row-bottom"))),Ue&&o?a.jsxs(a.Fragment,{children:[pa(),ma()]}):null]}):null,(I??0)>0||ge?a.jsx("div",{"data-controls":ge?"titleRowMarginBottom":void 0,"data-controls-axis":ge?"y":void 0,"data-controls-reverse":ge?"":void 0,className:ge?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:ge?"auto":"none"}}):null]}):null},ci=(we,Ue=!1)=>a.jsxs(a.Fragment,{children:[Ot(nn(we)),un(we,Ue)]}),di=we=>ee?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=ee?-1:Xe.findIndex(ne=>ne.prefix==="title1"),Ue=!ee&&(o||(N??0)>0)?(()=>{const ne=N??0,ge=we>=0?ht[we]:gt.title1Width,Ee=Math.max(ne,Un);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:X(Ee),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,R=Xe.flatMap((ne,ge)=>{if(!ne.marginLeftKey)return[];const Ee=Ae[ne.marginLeftKey]??0,je=kd(Xe,ht,Ae,ge)+Yt(),et=Math.max(Ee,Un);return a.jsx("div",{"data-controls":ne.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ht[ge]),style:{position:"absolute",top:0,left:X(je),width:X(et),height:"100%",pointerEvents:"auto"}},ne.marginLeftKey)});return Ue?[Ue,...R]:R},ir=()=>Xe.map((we,Ue)=>{const R=cn(Ue,ht),ge=Xt(Ue)-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:X(ge),width:X(fn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),pa=()=>mt.flatMap((we,Ue)=>{if(!we.marginLeftKey)return[];const R=Ae[we.marginLeftKey]??0,ne=Ht(Ue),ge=Math.max(R,Un),{resolvedWidth:Ee}=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(Ee),style:{position:"absolute",top:0,left:X(ne),width:X(ge),height:"100%",pointerEvents:"auto"}},we.marginLeftKey)}),ma=()=>mt.map((we,Ue)=>{const{maxWidth:R}=Mt(we,"two-row-bottom"),ge=Dt(Ue)-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:X(ge),width:X(fn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),$n=()=>!o||ee?null:a.jsxs(a.Fragment,{children:[nr(),ir()]}),Pi=we=>{const Ue=!we.objectFit&&Dn(w);return{className:`${e}-slide-image-cell${Ue?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:L,maxHeight:H,...Ue?{"--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 Ue=we.length>1,R=Ra(te),ne=`calc(-0.5 * (${R} + ${te}))`;if(we.length===1){const ge=we[0];return a.jsx("div",{...Pi(ge),children:a.jsx("img",{...or(ge),src:ge.url,alt:ge.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ue?{gap:te}:void 0,children:we.map((ge,Ee)=>a.jsxs("div",{...Pi(ge),children:[a.jsx("img",{...or(ge),src:ge.url,alt:ge.name??"",draggable:!1}),o&&Ue&&Ee<we.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ne,width:R,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ge.url}-${Ee}`))})},rr=!!(j!=null&&j.title2||j!=null&&j.title3||ft!=null&&ft.title2||ft!=null&&ft.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:ot,className:Kt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ci(le||j)}),a.jsxs("div",{ref:dt,className:`${e}-titles-row-two-row`,style:{...ue&&G?{minHeight:G}:void 0,...ue&&oe?{width:oe,maxWidth:"100%"}:void 0},children:[Ot(a.jsxs("div",{className:Kt,style:{position:ue?"absolute":"relative",inset:ue?0:void 0,width:"100%"},children:[ft&&ue?a.jsx("div",{className:`${Tt} ${e}-titles-fade-out`,children:nn(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(j)})]}),ue&&G?G:void 0),rr?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ft&&ue?a.jsx("div",{className:`${Jt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(ft)}):null,a.jsx("div",{className:`${e}-titles-layer-in${ue?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ee?` ${e}-titles-layer-in-stacked`:""}`,children:un(j,!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(j,!0)}),$n()]})};return a.jsxs("div",{ref:Ve,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{be||We()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:vt?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,...Ie}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ge,...Le,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:qe,onClick:we=>we.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":xe&&ye.length>1?"true":"false",onPointerDown:xe?St:void 0,onPointerUp:xe?Bt:void 0,onPointerCancel:xe?zt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&se?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:we=>{we.target===we.currentTarget&&ve(Me)},children:a.jsx("div",{className:`${e}-slide-area`,children:ui(wt.images)})},`slide-out-${Me}`):null,a.jsx("div",{className:`${e}-slide-layer-in${se?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:E?ui(E.images):null})},`slide-in-${Me}-${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:de,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ee?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${ee?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&a.jsx("div",{className:`${e}-text-bar-cell${ee?` ${e}-text-bar-cell-stacked`:""}`,style:ee?void 0:{flex:1,minWidth:0,width:"100%"},children:ee?C==="fade"?ga():ha():C==="fade"?rt():Et()})})})]})]})]})};function yv(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 xv=({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,b=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),V=s.useMemo(()=>(t??[]).filter($=>Ji($).length>0),[t]),N=m&&V.length>0,q=!n,W=s.useCallback(()=>{q&&(S.current=!0,Ef(y.current,c),y.current=!1)},[q,c]),I=($=0)=>{if(V.length===0||n&&!i&&!o)return;const T=Er(V,x),k=Math.max(0,Math.min($,T.length-1));if(v(k),q){const A=Ed();Pd(k+1,c,A),y.current=!A}h(!0)},B=s.useCallback(()=>{h(!1),S.current=!1},[]);return s.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),s.useEffect(()=>{if(!q||C.current)return;C.current=!0;const $=Al(c);if(!$)return;const T=Fl($,Er(V,x).length);T<0||(v(T),h(!0))},[V,c,q,x]),s.useEffect(()=>{if(!q)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(V,x).length);if(k<0){h(!1);return}y.current=!1,v(k),h(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[V,c,q,x]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:b,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:yv(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]}),N&&typeof document<"u"&&(()=>{const $=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx(fv,{prefix:d,entries:V,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:q,journalItemId:c,onBeforeClose:W,onClose:B}),$)})()]})},vv=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
15682
+ `}const xv=({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),V=s.useMemo(()=>(t??[]).filter($=>Ji($).length>0),[t]),N=m&&V.length>0,q=!n,W=s.useCallback(()=>{q&&(S.current=!0,Ef(y.current,c),y.current=!1)},[q,c]),I=($=0)=>{if(V.length===0||n&&!i&&!o)return;const T=Er(V,x),k=Math.max(0,Math.min($,T.length-1));if(v(k),q){const F=Ed();Pd(k+1,c,F),y.current=!F}h(!0)},B=s.useCallback(()=>{h(!1),S.current=!1},[]);return s.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),s.useEffect(()=>{if(!q||C.current)return;C.current=!0;const $=Al(c);if(!$)return;const T=Fl($,Er(V,x).length);T<0||(v(T),h(!0))},[V,c,q,x]),s.useEffect(()=>{if(!q)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(V,x).length);if(k<0){h(!1);return}y.current=!1,v(k),h(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[V,c,q,x]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:w,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:yv(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]}),N&&typeof document<"u"&&(()=>{const $=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx(fv,{prefix:d,entries:V,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:q,journalItemId:c,onBeforeClose:W,onClose:B}),$)})()]})},vv=`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 Ev(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 Mv(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Ev(i)]));return new Map(n)}function kv({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,b]=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),V=s.useRef(new Map),{imageSize:N=Rv,cursor:q="system",target:W="area",position:I="random",visible:B="all",defaultCursor:$=null,hoverCursor:T=null}=e,k=t.filter(L=>{var H;return!!((H=L==null?void 0:L.image)!=null&&H.url)}),A=s.useMemo(()=>Pv(i),[i]),g=s.useCallback((L,H,U=l)=>{if(!o)return;const de=o.getBoundingClientRect(),ae=L-de.left,F=H-de.top;b({x:ae,y:F}),h(Lv(ae,F,U,o,q,W,T,$))},[o,l,q,W,T,$]);s.useEffect(()=>{const L=[...k.map(U=>U.image.url),$,T].filter(U=>!!U);if(L.length===0){V.current=new Map,S(!0);return}let H=!1;return S(!1),Mv(L).then(U=>{H||(V.current=U,S(!0))}),()=>{H=!0}},[t,$,T]),s.useEffect(()=>{if(!o)return;const L=U=>{U.stopPropagation(),f.current={x:U.clientX,y:U.clientY},g(U.clientX,U.clientY)},H=()=>{v&&g(f.current.x,f.current.y)};return o.addEventListener("mousemove",L),window.addEventListener("scroll",H,!0),()=>{o.removeEventListener("mousemove",L),window.removeEventListener("scroll",H,!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 O=(L,H,U,de={})=>{var te,ye;if(!((te=L==null?void 0:L.image)!=null&&te.url))return null;const ae=((ye=V.current.get(L.image.url))==null?void 0:ye.aspectRatio)??1,F=lc(L.image.url,N,V.current),{heightPx:ce}=jr(F,ae);let z=0,re=0;return I==="same"?{x:z,y:re}=sc(H,U,F,ae):(z=de.x??Math.random()*H,re=de.y??Math.random()*U,{x:z,y:re}=cs(z,re,H,U,F,ce)),{id:p.current++,url:L.image.url,link:L.link,name:L.image.name,x:z,y:re,xRatio:z/H,yRatio:re/U,aspectRatio:ae,widthPx:F}},P=()=>{if(!o)return;const L=o.getBoundingClientRect(),H=L.width,U=L.height;H===0||U===0||d(de=>de.length===0?de:de.map(ae=>{const F=N.sizeType==="random"?ae.widthPx:lc(ae.url,N,V.current),{heightPx:ce}=jr(F,ae.aspectRatio);if(I==="same"){const{x:te,y:ye}=sc(H,U,F,ae.aspectRatio);return{...ae,x:te,y:ye,widthPx:F}}const{x:z,y:re}=cs(ae.xRatio*H,ae.yRatio*U,H,U,F,ce);return{...ae,x:z,y:re,widthPx:F}}))};s.useEffect(()=>{if(!o||k.length===0||!y)return;const L=o.getBoundingClientRect(),H=L.width,U=L.height,de=O(k[0],H,U);de&&(d([de]),u(k.length>1?1:0))},[N,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,N,l.length]),s.useEffect(()=>{B==="last One"&&d(L=>L.length>0?[L[L.length-1]]:[])},[B]);const X=L=>{if(!o||k.length===0||!y)return;const H=o.getBoundingClientRect(),U=L.clientX-H.left,de=L.clientY-H.top;if(W==="image"&&!Kd(U,de,l))return;let ae=0,F=0;I==="on Click"?(ae=U,F=de):I==="same"?(ae=H.width/2,F=H.height/2):(ae=Math.random()*H.width,F=Math.random()*H.height);const ce=k[c%k.length],z=O(ce,H.width,H.height,{x:ae,y:F});if(!z)return;const re=B==="all"?[...l,z]:[z];d(re),u(te=>(te+1)%k.length),g(L.clientX,L.clientY,re)},ne=q==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:A}}),a.jsxs("div",{ref:r,onClick:X,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:`${i}-root`,style:{cursor:ne?"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:ne?"none":"default"},children:W==="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&&ne&&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 Av=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16473
+ `}function Ev(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 Mv(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Ev(i)]));return new Map(n)}function kv({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),V=s.useRef(new Map),{imageSize:N=Rv,cursor:q="system",target:W="area",position:I="random",visible:B="all",defaultCursor:$=null,hoverCursor:T=null}=e,k=t.filter(L=>{var H;return!!((H=L==null?void 0:L.image)!=null&&H.url)}),F=s.useMemo(()=>Pv(i),[i]),g=s.useCallback((L,H,U=l)=>{if(!o)return;const de=o.getBoundingClientRect(),ae=L-de.left,A=H-de.top;w({x:ae,y:A}),h(Lv(ae,A,U,o,q,W,T,$))},[o,l,q,W,T,$]);s.useEffect(()=>{const L=[...k.map(U=>U.image.url),$,T].filter(U=>!!U);if(L.length===0){V.current=new Map,S(!0);return}let H=!1;return S(!1),Mv(L).then(U=>{H||(V.current=U,S(!0))}),()=>{H=!0}},[t,$,T]),s.useEffect(()=>{if(!o)return;const L=U=>{U.stopPropagation(),f.current={x:U.clientX,y:U.clientY},g(U.clientX,U.clientY)},H=()=>{v&&g(f.current.x,f.current.y)};return o.addEventListener("mousemove",L),window.addEventListener("scroll",H,!0),()=>{o.removeEventListener("mousemove",L),window.removeEventListener("scroll",H,!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 O=(L,H,U,de={})=>{var ee,xe;if(!((ee=L==null?void 0:L.image)!=null&&ee.url))return null;const ae=((xe=V.current.get(L.image.url))==null?void 0:xe.aspectRatio)??1,A=lc(L.image.url,N,V.current),{heightPx:ce}=jr(A,ae);let z=0,re=0;return I==="same"?{x:z,y:re}=sc(H,U,A,ae):(z=de.x??Math.random()*H,re=de.y??Math.random()*U,{x:z,y:re}=cs(z,re,H,U,A,ce)),{id:p.current++,url:L.image.url,link:L.link,name:L.image.name,x:z,y:re,xRatio:z/H,yRatio:re/U,aspectRatio:ae,widthPx:A}},P=()=>{if(!o)return;const L=o.getBoundingClientRect(),H=L.width,U=L.height;H===0||U===0||d(de=>de.length===0?de:de.map(ae=>{const A=N.sizeType==="random"?ae.widthPx:lc(ae.url,N,V.current),{heightPx:ce}=jr(A,ae.aspectRatio);if(I==="same"){const{x:ee,y:xe}=sc(H,U,A,ae.aspectRatio);return{...ae,x:ee,y:xe,widthPx:A}}const{x:z,y:re}=cs(ae.xRatio*H,ae.yRatio*U,H,U,A,ce);return{...ae,x:z,y:re,widthPx:A}}))};s.useEffect(()=>{if(!o||k.length===0||!y)return;const L=o.getBoundingClientRect(),H=L.width,U=L.height,de=O(k[0],H,U);de&&(d([de]),u(k.length>1?1:0))},[N,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,N,l.length]),s.useEffect(()=>{B==="last One"&&d(L=>L.length>0?[L[L.length-1]]:[])},[B]);const X=L=>{if(!o||k.length===0||!y)return;const H=o.getBoundingClientRect(),U=L.clientX-H.left,de=L.clientY-H.top;if(W==="image"&&!Kd(U,de,l))return;let ae=0,A=0;I==="on Click"?(ae=U,A=de):I==="same"?(ae=H.width/2,A=H.height/2):(ae=Math.random()*H.width,A=Math.random()*H.height);const ce=k[c%k.length],z=O(ce,H.width,H.height,{x:ae,y:A});if(!z)return;const re=B==="all"?[...l,z]:[z];d(re),u(ee=>(ee+1)%k.length),g(L.clientX,L.clientY,re)},te=q==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:F}}),a.jsxs("div",{ref:r,onClick:X,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:`${i}-root`,style:{cursor:te?"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:te?"none":"default"},children:W==="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&&te&&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 Av=`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 Dv(e){return e==="blur"?Wv:e==="greyscale"?Nv:0}function xo(e,t=1,n=1){const i=Dv(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 Ov(e,t){return t<=1?0:(e-1+t)%t}function Bv(e,t=1){return!e||e.height===0?t:e.width/e.height}function zv(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 Zd(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function uc(e,t,n){return{...Zd(e),[`--${n}-stage-scale`]:t}}function jv(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 Vv({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Se,K,Z,se,we,Me,Ce;const{prefix:o}=D.useScopedStyles(),r=s.useMemo(()=>Hv(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,x=t??[],b=cc(x.length),[m,h]=s.useState(b.activeIndex),[f,v]=s.useState(b.backgroundIndex),[C,y]=s.useState(!1),[S,V]=s.useState(!1),[N,q]=s.useState(null),[W,I]=s.useState(null),[B,$]=s.useState(0),[T,k]=s.useState(1),[A,g]=s.useState("none"),[O,P]=s.useState("next"),[X,ne]=s.useState({}),[L,H]=s.useState({width:0,height:0}),U=s.useRef(null),de=s.useRef(null),ae=!n||!!i,F=l??60,ce=Math.max(10,Math.min(100,d??F)),z=Math.max(10,Math.min(100,c??F)),re=Math.max(100,u),te=xo(p),ye=s.useCallback(G=>{const ue=Bv(G?X[G]:void 0);return zv(L.width,L.height,ue,ce,z)},[L.height,L.width,X,z,ce]);s.useEffect(()=>{const G=de.current;if(!G)return;const ue=new ResizeObserver(([oe])=>{const{width:Y,height:le}=oe.contentRect;H({width:Y,height:le})});return ue.observe(G),()=>ue.disconnect()},[]),s.useEffect(()=>{const G=(t??[]).map(ue=>{var oe;return(oe=ue.image)==null?void 0:oe.url}).filter(ue=>!!ue);jv(G,(ue,oe)=>{ne(Y=>{var le,_e;return((le=Y[ue])==null?void 0:le.width)===oe.width&&((_e=Y[ue])==null?void 0:_e.height)===oe.height?Y:{...Y,[ue]:oe}})})},[t]),s.useEffect(()=>{const{backgroundIndex:G,activeIndex:ue}=cc(x.length);h(ue),v(G),y(!1),V(!1),q(null),I(null),$(0),k(1),g("none"),P("next")},[x.length,t]),s.useEffect(()=>()=>{U.current&&clearTimeout(U.current)},[]);const Fe=s.useCallback(G=>{var pe,Q,Ke,ke;if(!ae||C||x.length<=1)return;const ue=G==="next"?(m+1)%x.length:(m-1+x.length)%x.length,oe=ye((Q=(pe=x[m])==null?void 0:pe.image)==null?void 0:Q.url),Y=ye((ke=(Ke=x[ue])==null?void 0:Ke.image)==null?void 0:ke.url),le=dc(L.width,L.height,oe),_e=dc(L.width,L.height,Y);U.current&&clearTimeout(U.current),P(G),V(!0),y(!0),G==="next"?(q(m),I(ue),$(0),k(1),g(xo(p,0,1))):(v(Ov(ue,x.length)),q(ue),I(m),$(1),k(_e),g(xo(p,1,_e))),requestAnimationFrame(()=>{V(!1),requestAnimationFrame(()=>{G==="next"?($(1),k(le),g(xo(p,1,le))):($(0),k(1),g(xo(p,0,1)))})}),U.current=setTimeout(()=>{G==="next"&&v(m),h(ue),q(null),I(null),y(!1)},re)},[m,p,L.height,L.width,ye,C,ae,x,re]),fe=x[m],w=f!==null?x[f]:null,M=N!==null?x[N]:null,E=W!==null?x[W]:null,j=x.length<=1?0:(m-1+x.length)%x.length,Te=x.length<=1?0:(m+1)%x.length,ee=ye((Se=fe==null?void 0:fe.image)==null?void 0:Se.url),$e=ye((K=M==null?void 0:M.image)==null?void 0:K.url),J=ye((Z=E==null?void 0:E.image)==null?void 0:Z.url),me={[`--${o}-transition-ms`]:`${re}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:de,className:pt(`${o}-wrapper`,S&&`${o}-snap`,n&&!i&&`${o}-editor`),style:me,"aria-label":"Zoom gallery",children:[((se=w==null?void 0:w.image)==null?void 0:se.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:w.image.url,alt:"",style:{filter:te}})}),C&&((we=M==null?void 0:M.image)==null?void 0:we.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${O}`),style:uc($e,T,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:M.image.url,alt:"",style:{filter:A}})}),C&&((Me=E==null?void 0:E.image)==null?void 0:Me.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${O}`),style:uc(J,B,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:E.image.url,alt:""})}),!C&&((Ce=fe==null?void 0:fe.image)==null?void 0:Ce.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-foreground`),style:Zd(ee),children:a.jsx("img",{className:`${o}-image`,src:fe.image.url,alt:fe.image.name??""})}),ae&&x.length>1&&!C&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Fe("prev"),"aria-label":`Show previous image (${j+1} of ${x.length})`}),a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Fe("next"),"aria-label":`Show next image (${Te+1} of ${x.length})`})]})]})]})}const Gv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17113
+ `}function Dv(e){return e==="blur"?Wv:e==="greyscale"?Nv:0}function xo(e,t=1,n=1){const i=Dv(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 Ov(e,t){return t<=1?0:(e-1+t)%t}function Bv(e,t=1){return!e||e.height===0?t:e.width/e.height}function zv(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 Zd(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function uc(e,t,n){return{...Zd(e),[`--${n}-stage-scale`]:t}}function jv(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 Vv({settings:e,content:t,isEditor:n,isPreviewMode:i}){var fe,K,Z,se,Se,Me,$e;const{prefix:o}=D.useScopedStyles(),r=s.useMemo(()=>Hv(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,V]=s.useState(!1),[N,q]=s.useState(null),[W,I]=s.useState(null),[B,$]=s.useState(0),[T,k]=s.useState(1),[F,g]=s.useState("none"),[O,P]=s.useState("next"),[X,te]=s.useState({}),[L,H]=s.useState({width:0,height:0}),U=s.useRef(null),de=s.useRef(null),ae=!n||!!i,A=l??60,ce=Math.max(10,Math.min(100,d??A)),z=Math.max(10,Math.min(100,c??A)),re=Math.max(100,u),ee=xo(p),xe=s.useCallback(G=>{const pe=Bv(G?X[G]:void 0);return zv(L.width,L.height,pe,ce,z)},[L.height,L.width,X,z,ce]);s.useEffect(()=>{const G=de.current;if(!G)return;const pe=new ResizeObserver(([oe])=>{const{width:Y,height:le}=oe.contentRect;H({width:Y,height:le})});return pe.observe(G),()=>pe.disconnect()},[]),s.useEffect(()=>{const G=(t??[]).map(pe=>{var oe;return(oe=pe.image)==null?void 0:oe.url}).filter(pe=>!!pe);jv(G,(pe,oe)=>{te(Y=>{var le,_e;return((le=Y[pe])==null?void 0:le.width)===oe.width&&((_e=Y[pe])==null?void 0:_e.height)===oe.height?Y:{...Y,[pe]:oe}})})},[t]),s.useEffect(()=>{const{backgroundIndex:G,activeIndex:pe}=cc(x.length);h(pe),v(G),y(!1),V(!1),q(null),I(null),$(0),k(1),g("none"),P("next")},[x.length,t]),s.useEffect(()=>()=>{U.current&&clearTimeout(U.current)},[]);const Fe=s.useCallback(G=>{var me,J,Ke,ke;if(!ae||C||x.length<=1)return;const pe=G==="next"?(m+1)%x.length:(m-1+x.length)%x.length,oe=xe((J=(me=x[m])==null?void 0:me.image)==null?void 0:J.url),Y=xe((ke=(Ke=x[pe])==null?void 0:Ke.image)==null?void 0:ke.url),le=dc(L.width,L.height,oe),_e=dc(L.width,L.height,Y);U.current&&clearTimeout(U.current),P(G),V(!0),y(!0),G==="next"?(q(m),I(pe),$(0),k(1),g(xo(p,0,1))):(v(Ov(pe,x.length)),q(pe),I(m),$(1),k(_e),g(xo(p,1,_e))),requestAnimationFrame(()=>{V(!1),requestAnimationFrame(()=>{G==="next"?($(1),k(le),g(xo(p,1,le))):($(0),k(1),g(xo(p,0,1)))})}),U.current=setTimeout(()=>{G==="next"&&v(m),h(pe),q(null),I(null),y(!1)},re)},[m,p,L.height,L.width,xe,C,ae,x,re]),ye=x[m],b=f!==null?x[f]:null,M=N!==null?x[N]:null,E=W!==null?x[W]:null,j=x.length<=1?0:(m-1+x.length)%x.length,Ce=x.length<=1?0:(m+1)%x.length,Q=xe((fe=ye==null?void 0:ye.image)==null?void 0:fe.url),Te=xe((K=M==null?void 0:M.image)==null?void 0:K.url),ie=xe((Z=E==null?void 0:E.image)==null?void 0:Z.url),ue={[`--${o}-transition-ms`]:`${re}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:de,className:pt(`${o}-wrapper`,S&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ue,"aria-label":"Zoom gallery",children:[((se=b==null?void 0:b.image)==null?void 0:se.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:ee}})}),C&&((Se=M==null?void 0:M.image)==null?void 0:Se.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${O}`),style:uc(Te,T,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:M.image.url,alt:"",style:{filter:F}})}),C&&((Me=E==null?void 0:E.image)==null?void 0:Me.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${O}`),style:uc(ie,B,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:E.image.url,alt:""})}),!C&&(($e=ye==null?void 0:ye.image)==null?void 0:$e.url)&&a.jsx("div",{className:pt(`${o}-stage`,`${o}-foreground`),style:Zd(Q),children:a.jsx("img",{className:`${o}-image`,src:ye.image.url,alt:ye.image.name??""})}),ae&&x.length>1&&!C&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Fe("prev"),"aria-label":`Show previous image (${j+1} of ${x.length})`}),a.jsx("button",{type:"button",className:pt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Fe("next"),"aria-label":`Show next image (${Ce+1} of ${x.length})`})]})]})]})}const Gv=`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';
@@ -17629,7 +17629,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
17629
17629
  </>
17630
17630
  );
17631
17631
  }
17632
- `,Xv={type:"object",version:1,settings:{sizing:"manual",properties:{maxWidth:{type:"number",scope:"common",title:"Max width (%)",display:{type:"percentage-input"},min:10,max:100},maxHeight:{type:"number",scope:"common",title:"Max height (%)",display:{type:"percentage-input"},min:10,max:100},transition:{type:"number",scope:"common",title:"Transition (ms)",display:{type:"common-numeric-input"},min:100,max:9999},bgImage:{type:"string",scope:"common",title:"BG image",display:{type:"toggle-cycle",enum:["greyscale","blur","as is"]}}},defaults:{maxWidth:60,maxHeight:60,transition:700,bgImage:"greyscale"},layout:["__componentName__","maxWidth","maxHeight","transition","bgImage"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["maxWidth","maxHeight"]},{type:"row",title:"",items:["transition","bgImage"]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",isObjectFitEditable:!1}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""}}]}},Yv={element:Vv,id:"scale",name:"Scale",category:"galleries",version:1,defaultSize:{d:{width:920,height:540},m:{width:"100%",height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Scale.mp4"},schema:Xv,sourceCode:Gv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},qv={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},Uv=["hover","active"],Da={left:"flex-start",center:"center",right:"flex-end"};function Kv(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 Zv(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 Jv(e){const t=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-box-shadow-color, transparent)`,n=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-inner-box-shadow-color, transparent)`,i=`${t}, ${n}`,o=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-hover-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,r=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-hover-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,l=`${o}, ${r}`,d=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-active-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,c=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-active-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,u=`${d}, ${c}`,p=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`,x=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,b=`.${e}-button:hover, ${x}`,m=h=>`.${e}-hover-effect-${h}:hover, .${e}-hover-effect-${h}:focus-visible, a:focus-visible .${e}-hover-effect-${h}`;return`
17632
+ `,Xv={type:"object",version:1,settings:{sizing:"manual",properties:{maxWidth:{type:"number",scope:"common",title:"Max width (%)",display:{type:"percentage-input"},min:10,max:100},maxHeight:{type:"number",scope:"common",title:"Max height (%)",display:{type:"percentage-input"},min:10,max:100},transition:{type:"number",scope:"common",title:"Transition (ms)",display:{type:"common-numeric-input"},min:100,max:9999},bgImage:{type:"string",scope:"common",title:"BG image",display:{type:"toggle-cycle",enum:["greyscale","blur","as is"]}}},defaults:{maxWidth:60,maxHeight:60,transition:700,bgImage:"greyscale"},layout:["__componentName__","maxWidth","maxHeight","transition","bgImage"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["maxWidth","maxHeight"]},{type:"row",title:"",items:["transition","bgImage"]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",isObjectFitEditable:!1}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""}}]}},Yv={element:Vv,id:"scale",name:"Scale",category:"galleries",version:1,defaultSize:{d:{width:920,height:540},m:{width:"100%",height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Scale.mp4"},schema:Xv,sourceCode:Gv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},qv={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},Uv=["hover","active"],Da={left:"flex-start",center:"center",right:"flex-end"};function Kv(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 Zv(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 Jv(e){const t=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-box-shadow-color, transparent)`,n=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-inner-box-shadow-color, transparent)`,i=`${t}, ${n}`,o=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-hover-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,r=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-hover-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,l=`${o}, ${r}`,d=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-active-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,c=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-active-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,u=`${d}, ${c}`,p=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`,x=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,w=`.${e}-button:hover, ${x}`,m=h=>`.${e}-hover-effect-${h}:hover, .${e}-hover-effect-${h}:focus-visible, a:focus-visible .${e}-hover-effect-${h}`;return`
17633
17633
  .${e}-root {
17634
17634
  line-height: 0;
17635
17635
  }
@@ -17790,7 +17790,7 @@ a:focus-visible .${e}-hover-effect-content-roll .${e}-content-roll-layer-hover,
17790
17790
  transform: translateY(-50%);
17791
17791
  opacity: 1;
17792
17792
  }
17793
- ${b} {
17793
+ ${w} {
17794
17794
  background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
17795
17795
  color: var(--${e}-hover-text-color, var(--${e}-text-color));
17796
17796
  border-color: var(--${e}-hover-border-color, var(--${e}-border-color));
@@ -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 Qv({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=D.useScopedStyles(),l=s.useMemo(()=>Jv(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:x,order:b="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:V="rgba(0, 0, 0, 0)",innerBoxShadow:N={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:q="rgba(0, 0, 0, 0)",stroke:W=0,backgroundColor:I="#000000",textColor:B="#ffffff",borderColor:$="#ffffff",iconColor:T="#ffffff",hoverEffect:k="none",fontFamily:A,fontSettings:g,fontSize:O,lineHeight:P,letterSpacing:X=0,wordSpacing:ne=0,textAppearance:L,stateOverrides:H,minWidth:U=0,minHeight:de=0,width:ae=0,height:F=0}=e,ce=D.buildColorVars(r,{backgroundColor:I,textColor:B,borderColor:$,iconColor:T,boxShadowColor:V,innerBoxShadowColor:q},qv,Uv,H),z=i&&i!=="default"?`${r}-state-${i}`:"",re=t&&!n?`${r}-editing`:"",te=k!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${k}`:"",ye=k==="reveal"||k==="swipe",Fe=k==="content-roll",fe=k==="reveal"&&(!t||n),w=v===!0,E=d==="a"?x??p:p,j=d==="c",Te=d!=="b",ee={fontSettings:{fontFamily:A,fontWeight:(g==null?void 0:g.fontWeight)??400,fontStyle:(g==null?void 0:g.fontStyle)??"normal"},fontSize:O??.01,lineHeight:P,letterSpacing:X,wordSpacing:ne,textAppearance:L,color:B},J={...Te?an(Ut(ee,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(N.left,t),[`--${r}-inner-box-shadow-y`]:D.scalingValue(N.top,t),[`--${r}-inner-box-shadow-blur`]:D.scalingValue(N.right,t),[`--${r}-inner-box-shadow-spread`]:D.scalingValue(N.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(W,t),...j?{}:{justifyContent:Da[E],textAlign:E},...j&&!Fe?{gap:D.scalingValue(m,t)}:{},...w?{width:D.scalingValue(ae,t),height:D.scalingValue(F,t)}:{minWidth:D.scalingValue(U,t),minHeight:D.scalingValue(de,t),...j?{width:"100%"}:{}}};let me;const Se={display:"inline-flex",alignItems:"center",justifyContent:j?Da[E]:Da[d==="a"?E:"center"],gap:j?D.scalingValue(m,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:E}:{}};if(d==="b"){const se=()=>pc(r,u,h>0?"fixed":"fill",100,h,t);me=Fe?Oa(r,se,`${r}-icon-roll`,void 0,Se):se()}else if(d==="c"){const se=()=>{const we=a.jsx("span",{className:`${r}-text`,style:{textAlign:E},children:c}),Me=pc(r,u,f>0?"fixed":"fill",100,f,t);return b==="icon-text"?a.jsxs(a.Fragment,{children:[Me,we]}):a.jsxs(a.Fragment,{children:[we,Me]})};me=Fe?Oa(r,se,`${r}-icon-text-roll`,void 0,Se):se()}else me=Fe?Oa(r,()=>c,`${r}-label-roll`,void 0,Se):ye?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const K=fe?se=>Kv(se,r):void 0,Z=fe?se=>Zv(se,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:ce,children:a.jsx("div",{className:`${r}-wrapper ${z} ${re}`.trim(),children:a.jsx("div",{className:`${r}-button ${te}`.trim(),style:J,onMouseEnter:K,onMouseLeave:Z,role:"button",tabIndex:o||t&&!n?void 0:0,children:me})})})]})}const e0=`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=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 Qv({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=D.useScopedStyles(),l=s.useMemo(()=>Jv(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:V="rgba(0, 0, 0, 0)",innerBoxShadow:N={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:q="rgba(0, 0, 0, 0)",stroke:W=0,backgroundColor:I="#000000",textColor:B="#ffffff",borderColor:$="#ffffff",iconColor:T="#ffffff",hoverEffect:k="none",fontFamily:F,fontSettings:g,fontSize:O,lineHeight:P,letterSpacing:X=0,wordSpacing:te=0,textAppearance:L,stateOverrides:H,minWidth:U=0,minHeight:de=0,width:ae=0,height:A=0}=e,ce=D.buildColorVars(r,{backgroundColor:I,textColor:B,borderColor:$,iconColor:T,boxShadowColor:V,innerBoxShadowColor:q},qv,Uv,H),z=i&&i!=="default"?`${r}-state-${i}`:"",re=t&&!n?`${r}-editing`:"",ee=k!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${k}`:"",xe=k==="reveal"||k==="swipe",Fe=k==="content-roll",ye=k==="reveal"&&(!t||n),b=v===!0,E=d==="a"?x??p:p,j=d==="c",Ce=d!=="b",Q={fontSettings:{fontFamily:F,fontWeight:(g==null?void 0:g.fontWeight)??400,fontStyle:(g==null?void 0:g.fontStyle)??"normal"},fontSize:O??.01,lineHeight:P,letterSpacing:X,wordSpacing:te,textAppearance:L,color:B},ie={...Ce?an(Ut(Q,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(N.left,t),[`--${r}-inner-box-shadow-y`]:D.scalingValue(N.top,t),[`--${r}-inner-box-shadow-blur`]:D.scalingValue(N.right,t),[`--${r}-inner-box-shadow-spread`]:D.scalingValue(N.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(W,t),...j?{}:{justifyContent:Da[E],textAlign:E},...j&&!Fe?{gap:D.scalingValue(m,t)}:{},...b?{width:D.scalingValue(ae,t),height:D.scalingValue(A,t)}:{minWidth:D.scalingValue(U,t),minHeight:D.scalingValue(de,t),...j?{width:"100%"}:{}}};let ue;const fe={display:"inline-flex",alignItems:"center",justifyContent:j?Da[E]:Da[d==="a"?E:"center"],gap:j?D.scalingValue(m,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:E}:{}};if(d==="b"){const se=()=>pc(r,u,h>0?"fixed":"fill",100,h,t);ue=Fe?Oa(r,se,`${r}-icon-roll`,void 0,fe):se()}else if(d==="c"){const se=()=>{const Se=a.jsx("span",{className:`${r}-text`,style:{textAlign:E},children:c}),Me=pc(r,u,f>0?"fixed":"fill",100,f,t);return w==="icon-text"?a.jsxs(a.Fragment,{children:[Me,Se]}):a.jsxs(a.Fragment,{children:[Se,Me]})};ue=Fe?Oa(r,se,`${r}-icon-text-roll`,void 0,fe):se()}else ue=Fe?Oa(r,()=>c,`${r}-label-roll`,void 0,fe):xe?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const K=ye?se=>Kv(se,r):void 0,Z=ye?se=>Zv(se,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:ce,children:a.jsx("div",{className:`${r}-wrapper ${z} ${re}`.trim(),children:a.jsx("div",{className:`${r}-button ${ee}`.trim(),style:ie,onMouseEnter:K,onMouseLeave:Z,role:"button",tabIndex:o||t&&!n?void 0:0,children:ue})})})]})}const e0=`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)",a0=72,s0=50,l0=1e4,c0=650,d0=500;function u0(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 Jd(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 p0(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Jd(i,n):null}function m0(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 g0=.03;function Qd(e){return e.width*g0}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 h0(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 f0(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ds(e,t.width,t.height)}function y0(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 x0(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 v0({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=Qd(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 b0(e,t,n){const{left:i,width:o}=n,r=Qd(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 eu(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 w0(e,t,n,i){const{start:o,end:r}=eu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function S0(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 C0({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 $0({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:b,resolveCloseSourceRect:m,onClose:h,onPrev:f,onNext:v}){const C=s.useRef(null),y=s.useRef(null),S=s.useRef(null),V=s.useRef(new Map),[N,q]=s.useState(0),W=s.useRef(null),I=s.useRef(0),B=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),k=s.useRef(!1),A=s.useRef(!1),g=s.useRef(null),O=s.useRef(null),P=s.useRef(null),X=s.useRef(()=>{}),ne=s.useRef(null),L=s.useRef(null),H=s.useRef(null),U=s.useRef(!1),[de,ae]=s.useState(null),[F,ce]=s.useState(Ba),[z,re]=s.useState(0),[te,ye]=s.useState("opening"),[Fe,fe]=s.useState(0),[w,M]=s.useState(0),[E,j]=s.useState(!1),[Te,ee]=s.useState(null),[$e,J]=s.useState(null),[me,Se]=s.useState(null),[K,Z]=s.useState(!1),[se,we]=s.useState(null),[Me,Ce]=s.useState(!1),G=s.useRef(!1),[ue,oe]=s.useState(!1),[Y,le]=s.useState(!1),_e=s.useRef(n),pe=s.useRef(void 0),Q=t[n],Ke=Q?ua(Q):!1,ke=w!==0||E,tt=!l&&(!r||!!d),Ye=c&&!l,dt=u.length>1,ot=s.useCallback((_,Pe)=>t.length<=1?null:t[(_+Pe+t.length)%t.length]??null,[t]),Ve=dt?To(u,p,-1):ot(n,-1),Re=dt?To(u,p,1):ot(n,1),He=Te===-1&&ke?dt&&$e!==null?To(u,$e,-1):me!==null?ot(me,-1):null:null,Be=Te===1&&ke?dt&&$e!==null?To(u,$e,1):me!==null?ot(me,1):null:null,Ze=He&&He.url!==(Ve==null?void 0:Ve.url)?He:null,he=Be&&Be.url!==(Re==null?void 0:Re.url)?Be:null,xe=Ve&&Ye?(()=>{const _=dt?mc(u,p,-1):t.length>2?ot((n-1+t.length)%t.length,-1):null;return _&&_.url!==Ve.url?_:null})():null,We=Re&&Ye?(()=>{const _=dt?mc(u,p,1):t.length>2?ot((n+1)%t.length,1):null;return _&&_.url!==Re.url?_:null})():null,Je=Ze??xe,ve=he??We,Ie=s.useCallback((_,Pe,Ne)=>{if(!_||!Pe||!Ne)return;const Oe=V.current,lt=Oe.get(_);(lt==null?void 0:lt.width)===Pe&&(lt==null?void 0:lt.height)===Ne||(Oe.set(_,{width:Pe,height:Ne}),q(Et=>Et+1))},[]),qe=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Pe=V.current.get(_.url);return f0(y.current,Pe)},[N,z]),ze=s.useCallback(()=>{if(!Q)return;const _=qe(Q);if(_){ae(_);return}const Pe=y.current;Pe&&ae(gc(Pe))},[Q,qe]),Le=s.useCallback(_=>{if(dt){const Pe=u.length;J((p+_+Pe)%Pe),Se(null);return}t.length>1&&(Se((n+_+t.length)%t.length),J(null))},[dt,u.length,p,t.length,n]),Ge=s.useCallback(_=>{A.current=_,j(_)},[]),De=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),nt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{De(),Ge(!1)},vo+32)},[De,Ge]),it=s.useCallback(()=>{const _=C.current;if(!_){ce({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ba.width,height:typeof window<"u"?window.innerHeight:Ba.height});return}const Pe=_.getBoundingClientRect();ce({left:Pe.left,top:Pe.top,width:Pe.width,height:Pe.height})},[]),ct=s.useCallback((_,Pe)=>{if(ke){if(ue&&!E)return`translate(${w}px, 0px)`;if(E&&Te!==null){const Ne=qe(_);if(!Ne)return;const{x:Oe,y:lt}=w0(Ne,Pe,Te,F);return`translate(${Oe}px, ${lt}px)`}if(E)return"translate(0px, 0px)"}},[ke,ue,E,w,Te,F,qe]),St=s.useCallback(()=>{const _=O.current;O.current=null,De(),Ge(!1),ee(null),J(null),Se(null),M(0),oe(!1),T.current=!1,B.current=0,$.current="none",_===-1?f():_===1&&v()},[De,Ge,f,v]),Bt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{O.current!==null&&St()},vo+32)},[De,St]),zt=s.useCallback(()=>{De(),O.current=null,Ge(!1),ee(null),J(null),Se(null),M(0),oe(!1),T.current=!1,B.current=0,$.current="none"},[De,Ge]),ft=s.useCallback(_=>{if(!(!Ye||!de)){if(A.current){if(O.current===_){P.current=_,St();return}zt()}De(),Le(_),O.current=_,ee(_),Ge(!0),Bt()}},[Ye,de,St,zt,De,Le,Ge,Bt]);X.current=ft;const wt=s.useCallback(()=>{ne.current=null,U.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),jt=s.useCallback(_=>{L.current!==null&&window.clearInterval(L.current);const Pe=U.current?d0:c0;L.current=window.setInterval(()=>{X.current(_)},Pe)},[]),At=s.useCallback(_=>{ne.current!==_&&(wt(),ne.current=_,U.current=!1,X.current(_),jt(_),H.current=window.setTimeout(()=>{H.current=null,ne.current===_&&(U.current=!0,jt(_))},l0))},[wt,jt]),vt=s.useCallback(()=>{const _=y.current;if(!_)return;const Pe=Q==null?void 0:Q.url,Ne=Pe?V.current.get(Pe):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){ae(ds(_,Ne.width,Ne.height));return}const Oe=S.current;if(Oe&&Pe&&(Oe.src===Pe||Oe.currentSrc===Pe)){const{width:Et,height:rt}=h0(Oe);if(Et&&rt){Ie(Pe,Et,rt),ae(ds(_,Et,rt));return}}const lt=gc(_);!lt.width||!lt.height||ae(lt)},[Q==null?void 0:Q.url,Ie]),Ft=s.useCallback(_=>{if(S.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&vt();return}_.complete&&_.naturalWidth>0&&vt()}},[vt]),Nt=s.useCallback(()=>{it(),vt(),re(_=>_+1)},[it,vt]);s.useEffect(()=>{Nt();const _=y.current,Pe=C.current,Ne=new ResizeObserver(()=>Nt());return _&&Ne.observe(_),Pe&&Ne.observe(Pe),window.addEventListener("resize",Nt),()=>{Ne.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,x]),s.useLayoutEffect(()=>{if(!Q)return;const _=S.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){vt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&vt()}},[Q==null?void 0:Q.url,n,vt]),s.useEffect(()=>{ze()},[ze,N]),s.useEffect(()=>{const _=new Set,Pe=[],Ne=Oe=>{!(Oe!=null&&Oe.url)||_.has(Oe.url)||(_.add(Oe.url),Pe.push(Oe))};t.forEach(Ne),u.forEach(Oe=>Oe.items.forEach(Ne)),Pe.forEach(Oe=>{V.current.has(Oe.url)||y0(Oe,Ie)})},[t,u,Ie]),s.useEffect(()=>{if(te!=="opening"||!de)return;if(!b){ye("open");return}Z(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(!0),ye("open")})});return()=>cancelAnimationFrame(_)},[te,de,b]),s.useEffect(()=>{if(te!=="closing")return;const _=setTimeout(()=>h(),In);return()=>clearTimeout(_)},[te,h]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{_e.current===n&&pe.current===(Q==null?void 0:Q.url)||(De(),O.current=null,ee(null),J(null),Se(null),fe(0),M(0),Ge(!1),le(!1),oe(!1),I.current=0,B.current=0,$.current="none",T.current=!1,W.current=null,k.current=!1,S.current=null,ze(),_e.current=n,pe.current=Q==null?void 0:Q.url)},[n,Q==null?void 0:Q.url,Ge,De,ze]),s.useLayoutEffect(()=>{const _=P.current;_!==null&&(P.current=null,requestAnimationFrame(()=>{X.current(_)}))},[n,p,Q==null?void 0:Q.url]),s.useLayoutEffect(()=>{if(te==="opening"){G.current=!1,Ce(!1);return}if(te!=="open"||G.current)return;if(!Ve&&!Re){G.current=!0;return}Ce(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),G.current=!0})});return()=>cancelAnimationFrame(_)},[te,Ve==null?void 0:Ve.url,Re==null?void 0:Re.url]),s.useEffect(()=>{if(te!=="open")return;const _=()=>{const rt=xt=>{xt.stopPropagation(),xt.preventDefault(),document.removeEventListener("click",rt,!0)};document.addEventListener("click",rt,!0)},Pe=rt=>{const xt=rt<0?1:-1;De(),Le(xt),O.current=xt,ee(xt),Ge(!0),Bt()},Ne=rt=>{if(Math.abs(rt)>s0&&Ye){Pe(rt);return}O.current=null,ee(null),J(null),Se(null),Ge(!0),M(0),nt()},Oe=rt=>{if(rt.touches.length!==1||A.current)return;const xt=rt.touches[0];k.current=!0,W.current={x:xt.clientX,y:xt.clientY},$.current="none",B.current=0,T.current=!1},lt=rt=>{if(!W.current||rt.touches.length!==1||A.current)return;const xt=rt.touches[0],Ot=xt.clientX-W.current.x,It=xt.clientY-W.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Ye)return;$.current="horizontal"}else if(It>0){if(!tt)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,oe(!0),B.current=Ot,M(Ot),rt.preventDefault();return}$.current==="vertical"&&(T.current=!0,oe(!0),I.current=It,fe(It),rt.preventDefault())},Et=()=>{if(!W.current)return;const rt=$.current,xt=T.current;if(xt&&rt==="horizontal")Ne(B.current),_();else if(xt&&rt==="vertical"){const Ot=I.current;if(tt&&Ot>a0){const It=window.innerHeight;I.current=It,le(!0),fe(It),ye("closing")}else I.current=0,fe(0);_()}else rt==="horizontal"&&Math.abs(B.current)>0&&(Ne(B.current),_());W.current=null,$.current="none",B.current=0,T.current=!1,oe(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",lt,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",lt),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[te,Ye,Ge,nt,De,tt,Bt,Le]);const Kt=s.useCallback(()=>{const _=(m==null?void 0:m())??b??null;_&&de&&(we(_),Z(!0)),ye("closing")},[m,b,de]);s.useEffect(()=>{const _=Oe=>{if(Oe.key==="Escape"){if(r&&d||te==="closing")return;wt(),Kt();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||te!=="open"||!Ye)return;Oe.preventDefault();const lt=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&ne.current===lt||At(lt)},Pe=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const lt=Oe.key==="ArrowLeft"?-1:1;ne.current===lt&&wt()},Ne=()=>{wt()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Pe),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Pe),window.removeEventListener("blur",Ne),wt()}},[te,r,d,Kt,Ye,At,wt]),s.useEffect(()=>{te!=="open"&&wt()},[te,wt]);const Jt=()=>{te==="closing"||l||Kt()},Tt=te==="open",Wt=te==="closing",rn=Fe>0?Math.max(0,1-Fe/500):1,gt=Fe>0?Math.max(.35,1-Fe/500):1,Ae=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!A.current)){if(O.current!==null){St();return}De(),Ge(!1)}},[De,Ge,St]),Xe=te==="closing"?se??b:b,st=Xe&&de&&(te==="opening"||Wt)?u0(Xe,de):void 0,ht=ke&&Q?ct(Q,"center"):Fe>0?`translateY(${Fe}px)`:st,yt=de?vr(de,F):null,Lt=!!(Xe&&de),mt=Lt&&(te==="closing"||te==="open"&&K),Vt={position:"absolute",top:yt==null?void 0:yt.top,left:yt==null?void 0:yt.left,width:yt==null?void 0:yt.width,height:yt==null?void 0:yt.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:Fe>0?gt:Lt?1:te==="opening"||Wt?0:1,transition:ue&&!E?"none":E?`transform ${vo}ms ${mn}`:Y?`transform ${In}ms ${mn}, opacity ${In}ms ${mn}`:mt?`transform ${In}ms ${mn}`:te==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:Ke&&Tt&&!ke?"auto":"none",touchAction:Ke&&Tt?"none":void 0,zIndex:1,overflow:Ke?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!ke?"auto":"none"},Mt=(_,Pe,Ne="adjacent")=>{const Oe=qe(_);if(!Oe)return{display:"none"};const lt=Ne==="far"?Pe==="left"?"far-left":"far-right":Pe==="left"?"left-adjacent":"right-adjacent",{start:Et}=Te!==null?eu(Oe,lt,Te,F):{start:Ne==="far"?Vr(Oe,Pe,F):ao(Oe,Pe,F)},rt=vr(Et,F),xt=ct(_,lt),Ot=!ke&&Ne==="adjacent"&&Tt&&!Me?S0(Oe,Pe,F):null,It=Ne==="far"&&ke&&Te===(Pe==="left"?-1:1),nn=ue&&!E?!1:E,un=Ne==="adjacent"&&Tt&&Me&&!ke;return{position:"absolute",top:rt.top,left:rt.left,width:rt.width,height:rt.height,objectFit:"contain",transform:xt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ne==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Ne==="far"?`transform ${vo}ms ${mn}`:`transform ${vo}ms ${mn}, opacity ${In}ms ${mn}`:un?`transform ${In}ms ${mn}`:te==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Xt=(_,Pe)=>{const Ne=qe(_);return Ne?b0(ao(Ne,Pe,F),Pe,F):null},Yt=_=>Pe=>{if(!l){if(k.current){k.current=!1;return}Pe.stopPropagation(),ft(_)}},Ht=Ve?Xt(Ve,"left"):null,Dt=Re?Xt(Re,"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:te==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:ue?"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:ue?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"},children:a.jsx(Fd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&Je&&a.jsx(br,{media:Je,style:Mt(Je,"left","far"),onMeasure:Ie,onTransitionEnd:Ae},`far-prev-${Je.url}`),Tt&&Ve&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:Ve,style:Mt(Ve,"left"),onMeasure:Ie,onTransitionEnd:Ae},`prev-${Ve.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||ue?"default":"pointer",pointerEvents:l||ue?"none":"auto",zIndex:3},onClick:Yt(-1)})]}),Tt&&Re&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:Re,style:Mt(Re,"right"),onMeasure:Ie,onTransitionEnd:Ae},`next-${Re.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||ue?"default":"pointer",pointerEvents:l||ue?"none":"auto",zIndex:3},onClick:Yt(1)})]}),Tt&&ve&&a.jsx(br,{media:ve,style:Mt(ve,"right","far"),onMeasure:Ie,onTransitionEnd:Ae},`far-next-${ve.url}`),de&&Q&&(Ke?a.jsx(C0,{src:Q.url,phase:te,onMediaElement:Ft,wrapperStyle:Vt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Ae},`${n}-${Q.url}`):a.jsx("img",{ref:Ft,src:Q.url,alt:Q.name,onLoad:vt,onTransitionEnd:Ae,style:Vt},`${n}-${Q.url}`))]})}const T0=20,I0=.18;function R0(e){return`
18697
+ `}const In=500,vo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",a0=72,s0=50,l0=1e4,c0=650,d0=500;function u0(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 Jd(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 p0(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Jd(i,n):null}function m0(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 g0=.03;function Qd(e){return e.width*g0}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 h0(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 f0(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ds(e,t.width,t.height)}function y0(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 x0(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 v0({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=Qd(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 b0(e,t,n){const{left:i,width:o}=n,r=Qd(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 eu(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 w0(e,t,n,i){const{start:o,end:r}=eu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function S0(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 C0({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 $0({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),V=s.useRef(new Map),[N,q]=s.useState(0),W=s.useRef(null),I=s.useRef(0),B=s.useRef(0),$=s.useRef("none"),T=s.useRef(!1),k=s.useRef(!1),F=s.useRef(!1),g=s.useRef(null),O=s.useRef(null),P=s.useRef(null),X=s.useRef(()=>{}),te=s.useRef(null),L=s.useRef(null),H=s.useRef(null),U=s.useRef(!1),[de,ae]=s.useState(null),[A,ce]=s.useState(Ba),[z,re]=s.useState(0),[ee,xe]=s.useState("opening"),[Fe,ye]=s.useState(0),[b,M]=s.useState(0),[E,j]=s.useState(!1),[Ce,Q]=s.useState(null),[Te,ie]=s.useState(null),[ue,fe]=s.useState(null),[K,Z]=s.useState(!1),[se,Se]=s.useState(null),[Me,$e]=s.useState(!1),G=s.useRef(!1),[pe,oe]=s.useState(!1),[Y,le]=s.useState(!1),_e=s.useRef(n),me=s.useRef(void 0),J=t[n],Ke=J?ua(J):!1,ke=b!==0||E,tt=!l&&(!r||!!d),Ye=c&&!l,dt=u.length>1,ot=s.useCallback((_,Pe)=>t.length<=1?null:t[(_+Pe+t.length)%t.length]??null,[t]),Ve=dt?To(u,p,-1):ot(n,-1),Re=dt?To(u,p,1):ot(n,1),He=Ce===-1&&ke?dt&&Te!==null?To(u,Te,-1):ue!==null?ot(ue,-1):null:null,Be=Ce===1&&ke?dt&&Te!==null?To(u,Te,1):ue!==null?ot(ue,1):null:null,Ze=He&&He.url!==(Ve==null?void 0:Ve.url)?He:null,he=Be&&Be.url!==(Re==null?void 0:Re.url)?Be:null,ve=Ve&&Ye?(()=>{const _=dt?mc(u,p,-1):t.length>2?ot((n-1+t.length)%t.length,-1):null;return _&&_.url!==Ve.url?_:null})():null,We=Re&&Ye?(()=>{const _=dt?mc(u,p,1):t.length>2?ot((n+1)%t.length,1):null;return _&&_.url!==Re.url?_:null})():null,Je=Ze??ve,be=he??We,Ie=s.useCallback((_,Pe,Ne)=>{if(!_||!Pe||!Ne)return;const Oe=V.current,lt=Oe.get(_);(lt==null?void 0:lt.width)===Pe&&(lt==null?void 0:lt.height)===Ne||(Oe.set(_,{width:Pe,height:Ne}),q(Et=>Et+1))},[]),qe=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Pe=V.current.get(_.url);return f0(y.current,Pe)},[N,z]),ze=s.useCallback(()=>{if(!J)return;const _=qe(J);if(_){ae(_);return}const Pe=y.current;Pe&&ae(gc(Pe))},[J,qe]),Le=s.useCallback(_=>{if(dt){const Pe=u.length;ie((p+_+Pe)%Pe),fe(null);return}t.length>1&&(fe((n+_+t.length)%t.length),ie(null))},[dt,u.length,p,t.length,n]),Ge=s.useCallback(_=>{F.current=_,j(_)},[]),De=s.useCallback(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),nt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{De(),Ge(!1)},vo+32)},[De,Ge]),it=s.useCallback(()=>{const _=C.current;if(!_){ce({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ba.width,height:typeof window<"u"?window.innerHeight:Ba.height});return}const Pe=_.getBoundingClientRect();ce({left:Pe.left,top:Pe.top,width:Pe.width,height:Pe.height})},[]),ct=s.useCallback((_,Pe)=>{if(ke){if(pe&&!E)return`translate(${b}px, 0px)`;if(E&&Ce!==null){const Ne=qe(_);if(!Ne)return;const{x:Oe,y:lt}=w0(Ne,Pe,Ce,A);return`translate(${Oe}px, ${lt}px)`}if(E)return"translate(0px, 0px)"}},[ke,pe,E,b,Ce,A,qe]),St=s.useCallback(()=>{const _=O.current;O.current=null,De(),Ge(!1),Q(null),ie(null),fe(null),M(0),oe(!1),T.current=!1,B.current=0,$.current="none",_===-1?f():_===1&&v()},[De,Ge,f,v]),Bt=s.useCallback(()=>{De(),g.current=window.setTimeout(()=>{O.current!==null&&St()},vo+32)},[De,St]),zt=s.useCallback(()=>{De(),O.current=null,Ge(!1),Q(null),ie(null),fe(null),M(0),oe(!1),T.current=!1,B.current=0,$.current="none"},[De,Ge]),ft=s.useCallback(_=>{if(!(!Ye||!de)){if(F.current){if(O.current===_){P.current=_,St();return}zt()}De(),Le(_),O.current=_,Q(_),Ge(!0),Bt()}},[Ye,de,St,zt,De,Le,Ge,Bt]);X.current=ft;const wt=s.useCallback(()=>{te.current=null,U.current=!1,L.current!==null&&(window.clearInterval(L.current),L.current=null),H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),jt=s.useCallback(_=>{L.current!==null&&window.clearInterval(L.current);const Pe=U.current?d0:c0;L.current=window.setInterval(()=>{X.current(_)},Pe)},[]),At=s.useCallback(_=>{te.current!==_&&(wt(),te.current=_,U.current=!1,X.current(_),jt(_),H.current=window.setTimeout(()=>{H.current=null,te.current===_&&(U.current=!0,jt(_))},l0))},[wt,jt]),vt=s.useCallback(()=>{const _=y.current;if(!_)return;const Pe=J==null?void 0:J.url,Ne=Pe?V.current.get(Pe):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){ae(ds(_,Ne.width,Ne.height));return}const Oe=S.current;if(Oe&&Pe&&(Oe.src===Pe||Oe.currentSrc===Pe)){const{width:Et,height:rt}=h0(Oe);if(Et&&rt){Ie(Pe,Et,rt),ae(ds(_,Et,rt));return}}const lt=gc(_);!lt.width||!lt.height||ae(lt)},[J==null?void 0:J.url,Ie]),Ft=s.useCallback(_=>{if(S.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&vt();return}_.complete&&_.naturalWidth>0&&vt()}},[vt]),Nt=s.useCallback(()=>{it(),vt(),re(_=>_+1)},[it,vt]);s.useEffect(()=>{Nt();const _=y.current,Pe=C.current,Ne=new ResizeObserver(()=>Nt());return _&&Ne.observe(_),Pe&&Ne.observe(Pe),window.addEventListener("resize",Nt),()=>{Ne.disconnect(),window.removeEventListener("resize",Nt)}},[Nt,n,x]),s.useLayoutEffect(()=>{if(!J)return;const _=S.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){vt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&vt()}},[J==null?void 0:J.url,n,vt]),s.useEffect(()=>{ze()},[ze,N]),s.useEffect(()=>{const _=new Set,Pe=[],Ne=Oe=>{!(Oe!=null&&Oe.url)||_.has(Oe.url)||(_.add(Oe.url),Pe.push(Oe))};t.forEach(Ne),u.forEach(Oe=>Oe.items.forEach(Ne)),Pe.forEach(Oe=>{V.current.has(Oe.url)||y0(Oe,Ie)})},[t,u,Ie]),s.useEffect(()=>{if(ee!=="opening"||!de)return;if(!w){xe("open");return}Z(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Z(!0),xe("open")})});return()=>cancelAnimationFrame(_)},[ee,de,w]),s.useEffect(()=>{if(ee!=="closing")return;const _=setTimeout(()=>h(),In);return()=>clearTimeout(_)},[ee,h]),s.useEffect(()=>()=>{De()},[De]),s.useLayoutEffect(()=>{_e.current===n&&me.current===(J==null?void 0:J.url)||(De(),O.current=null,Q(null),ie(null),fe(null),ye(0),M(0),Ge(!1),le(!1),oe(!1),I.current=0,B.current=0,$.current="none",T.current=!1,W.current=null,k.current=!1,S.current=null,ze(),_e.current=n,me.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,Ge,De,ze]),s.useLayoutEffect(()=>{const _=P.current;_!==null&&(P.current=null,requestAnimationFrame(()=>{X.current(_)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(ee==="opening"){G.current=!1,$e(!1);return}if(ee!=="open"||G.current)return;if(!Ve&&!Re){G.current=!0;return}$e(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{$e(!0),G.current=!0})});return()=>cancelAnimationFrame(_)},[ee,Ve==null?void 0:Ve.url,Re==null?void 0:Re.url]),s.useEffect(()=>{if(ee!=="open")return;const _=()=>{const rt=xt=>{xt.stopPropagation(),xt.preventDefault(),document.removeEventListener("click",rt,!0)};document.addEventListener("click",rt,!0)},Pe=rt=>{const xt=rt<0?1:-1;De(),Le(xt),O.current=xt,Q(xt),Ge(!0),Bt()},Ne=rt=>{if(Math.abs(rt)>s0&&Ye){Pe(rt);return}O.current=null,Q(null),ie(null),fe(null),Ge(!0),M(0),nt()},Oe=rt=>{if(rt.touches.length!==1||F.current)return;const xt=rt.touches[0];k.current=!0,W.current={x:xt.clientX,y:xt.clientY},$.current="none",B.current=0,T.current=!1},lt=rt=>{if(!W.current||rt.touches.length!==1||F.current)return;const xt=rt.touches[0],Ot=xt.clientX-W.current.x,It=xt.clientY-W.current.y;if($.current==="none"){if(Math.abs(Ot)<10&&Math.abs(It)<10)return;if(Math.abs(Ot)>Math.abs(It)){if(!Ye)return;$.current="horizontal"}else if(It>0){if(!tt)return;$.current="vertical"}else return}if($.current==="horizontal"){T.current=!0,oe(!0),B.current=Ot,M(Ot),rt.preventDefault();return}$.current==="vertical"&&(T.current=!0,oe(!0),I.current=It,ye(It),rt.preventDefault())},Et=()=>{if(!W.current)return;const rt=$.current,xt=T.current;if(xt&&rt==="horizontal")Ne(B.current),_();else if(xt&&rt==="vertical"){const Ot=I.current;if(tt&&Ot>a0){const It=window.innerHeight;I.current=It,le(!0),ye(It),xe("closing")}else I.current=0,ye(0);_()}else rt==="horizontal"&&Math.abs(B.current)>0&&(Ne(B.current),_());W.current=null,$.current="none",B.current=0,T.current=!1,oe(!1)};return document.addEventListener("touchstart",Oe,{passive:!0}),document.addEventListener("touchmove",lt,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Oe),document.removeEventListener("touchmove",lt),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[ee,Ye,Ge,nt,De,tt,Bt,Le]);const Kt=s.useCallback(()=>{const _=(m==null?void 0:m())??w??null;_&&de&&(Se(_),Z(!0)),xe("closing")},[m,w,de]);s.useEffect(()=>{const _=Oe=>{if(Oe.key==="Escape"){if(r&&d||ee==="closing")return;wt(),Kt();return}if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight"||ee!=="open"||!Ye)return;Oe.preventDefault();const lt=Oe.key==="ArrowLeft"?-1:1;Oe.repeat&&te.current===lt||At(lt)},Pe=Oe=>{if(Oe.key!=="ArrowLeft"&&Oe.key!=="ArrowRight")return;const lt=Oe.key==="ArrowLeft"?-1:1;te.current===lt&&wt()},Ne=()=>{wt()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Pe),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Pe),window.removeEventListener("blur",Ne),wt()}},[ee,r,d,Kt,Ye,At,wt]),s.useEffect(()=>{ee!=="open"&&wt()},[ee,wt]);const Jt=()=>{ee==="closing"||l||Kt()},Tt=ee==="open",Wt=ee==="closing",rn=Fe>0?Math.max(0,1-Fe/500):1,gt=Fe>0?Math.max(.35,1-Fe/500):1,Ae=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!F.current)){if(O.current!==null){St();return}De(),Ge(!1)}},[De,Ge,St]),Xe=ee==="closing"?se??w:w,st=Xe&&de&&(ee==="opening"||Wt)?u0(Xe,de):void 0,ht=ke&&J?ct(J,"center"):Fe>0?`translateY(${Fe}px)`:st,yt=de?vr(de,A):null,Lt=!!(Xe&&de),mt=Lt&&(ee==="closing"||ee==="open"&&K),Vt={position:"absolute",top:yt==null?void 0:yt.top,left:yt==null?void 0:yt.left,width:yt==null?void 0:yt.width,height:yt==null?void 0:yt.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:Fe>0?gt:Lt?1:ee==="opening"||Wt?0:1,transition:pe&&!E?"none":E?`transform ${vo}ms ${mn}`:Y?`transform ${In}ms ${mn}, opacity ${In}ms ${mn}`:mt?`transform ${In}ms ${mn}`:ee==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:Ke&&Tt&&!ke?"auto":"none",touchAction:Ke&&Tt?"none":void 0,zIndex:1,overflow:Ke?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Tt&&!ke?"auto":"none"},Mt=(_,Pe,Ne="adjacent")=>{const Oe=qe(_);if(!Oe)return{display:"none"};const lt=Ne==="far"?Pe==="left"?"far-left":"far-right":Pe==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ce!==null?eu(Oe,lt,Ce,A):{start:Ne==="far"?Vr(Oe,Pe,A):ao(Oe,Pe,A)},rt=vr(Et,A),xt=ct(_,lt),Ot=!ke&&Ne==="adjacent"&&Tt&&!Me?S0(Oe,Pe,A):null,It=Ne==="far"&&ke&&Ce===(Pe==="left"?-1:1),nn=pe&&!E?!1:E,un=Ne==="adjacent"&&Tt&&Me&&!ke;return{position:"absolute",top:rt.top,left:rt.left,width:rt.width,height:rt.height,objectFit:"contain",transform:xt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ne==="far"?Tt&&It?1:0:Tt?1:0,transition:nn?Ne==="far"?`transform ${vo}ms ${mn}`:`transform ${vo}ms ${mn}, opacity ${In}ms ${mn}`:un?`transform ${In}ms ${mn}`:ee==="opening"||Wt?`opacity ${In}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Xt=(_,Pe)=>{const Ne=qe(_);return Ne?b0(ao(Ne,Pe,A),Pe,A):null},Yt=_=>Pe=>{if(!l){if(k.current){k.current=!1;return}Pe.stopPropagation(),ft(_)}},Ht=Ve?Xt(Ve,"left"):null,Dt=Re?Xt(Re,"right"):null,_t=Ht?vr(Ht,A):null,Ct=Dt?vr(Dt,A):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ee==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Tt?rn:0,transition:pe?"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:pe?"none":`opacity ${In}ms ${mn}`,pointerEvents:"none"},children:a.jsx(Fd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Tt&&Je&&a.jsx(br,{media:Je,style:Mt(Je,"left","far"),onMeasure:Ie,onTransitionEnd:Ae},`far-prev-${Je.url}`),Tt&&Ve&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:Ve,style:Mt(Ve,"left"),onMeasure:Ie,onTransitionEnd:Ae},`prev-${Ve.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Yt(-1)})]}),Tt&&Re&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:Re,style:Mt(Re,"right"),onMeasure:Ie,onTransitionEnd:Ae},`next-${Re.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Yt(1)})]}),Tt&&be&&a.jsx(br,{media:be,style:Mt(be,"right","far"),onMeasure:Ie,onTransitionEnd:Ae},`far-next-${be.url}`),de&&J&&(Ke?a.jsx(C0,{src:J.url,phase:ee,onMediaElement:Ft,wrapperStyle:Vt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Ae},`${n}-${J.url}`):a.jsx("img",{ref:Ft,src:J.url,alt:J.name,onLoad:vt,onTransitionEnd:Ae,style:Vt},`${n}-${J.url}`))]})}const T0=20,I0=.18;function R0(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
  ${r0(e)}
18785
- `}function L0(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 P0(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 E0(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*I0,n??!1),[`--${t}-image-aspect`]:L0(e)}}function M0(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 Ut(n,t)}function k0(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 A0(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?Jd(d,o):void 0)}}function F0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>R0(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",x=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,b=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=D.scalingValue(b,n??!1),h=`max(${m}, ${T0}px)`,{objectFitMode:f,imageStyle:v}=k0(e),C=M0(e,n),y=s.useRef(null),[S,V]=s.useState(!1),[N,q]=s.useState([]),[W,I]=s.useState(0),[B,$]=s.useState(0),[T,k]=s.useState(null),[A,g]=s.useState({title1:"",title2:"",title3:""}),O=(!n||i)&&!S,P=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},X=P.sizeType??"none",ne=O&&X!=="none"?`${d}-item-image-hover-${X}`:void 0,L=(P.value??120)/100,H=s.useCallback(w=>{!w||X!=="scale"||(w.style.transformOrigin=Lg(w))},[X]),U=s.useCallback(w=>{if(w){if(f==="contain"){const M=P0(w);if(M){const E=w.closest(`.${d}-item-image`);E instanceof HTMLElement&&E.style.setProperty(`--${d}-item-media-aspect`,String(M))}}H(w)}},[d,H,f]),de={width:D.scalingValue(x,n??!1),...C,...E0(e,d,n),[`--${d}-image-hover-scale`]:String(L)},ae=(()=>{const w={},M=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return M&&(w["--cntrl-article-width"]=M),w})(),F=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),ce=s.useMemo(()=>m0(u),[u]),z=s.useMemo(()=>x0(u),[u]),re=(w,M)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const E=ce.findIndex(Te=>Te.gridIndex===w);if(E<0)return;const j=ce[E];$(E),q(j.items),I(0),g(j.entry),k(M??null),V(!0)},te=s.useCallback(()=>{V(!1),k(null)},[]),ye=s.useCallback(()=>{const w=ce[B];return!w||!y.current?T:p0(y.current,w.gridIndex,f)??T},[ce,B,T,f]),Fe=s.useCallback(w=>{if(ce.length>1){const M=ce.length,E=(B+w+M)%M,j=ce[E];$(E),q(j.items),I(0),g(j.entry);return}I(M=>(M+w+N.length)%N.length)},[ce,B,N.length]),fe=ce.length>1||N.length>1;return s.useEffect(()=>{if(!S||typeof document>"u")return;const w=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=w}},[S]),s.useEffect(()=>{!n||o||i||V(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&V(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(v0,{mediaList:z}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:de,children:u.map((w,M)=>{var Te,ee;const E=!!((Te=w.image)!=null&&Te.url),j=A0(!!F,E,M,d,f,re);return a.jsxs("div",{className:`${d}-item`,children:[w.title?a.jsx("span",{className:`${d}-item-title`,onClick:j,style:j?{cursor:"pointer"}:void 0,children:w.title}):null,(ee=w.image)!=null&&ee.url?a.jsx("span",{className:[`${d}-item-image`,f==="contain"?`${d}-item-image-fit`:void 0,ne].filter(Boolean).join(" "),children:w.image.type==="video"?a.jsx("video",{ref:U,src:w.image.url,"data-waterfall-index":M,style:v,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:j,onLoadedData:$e=>U($e.currentTarget)}):a.jsx("img",{ref:U,src:w.image.url,alt:w.image.name??"","data-waterfall-index":M,style:v,onClick:j,onLoad:$e=>U($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 w=(l?document.getElementById(l):null)??document.body;return zn.createPortal(a.jsx("div",{style:ae,"data-selection":"none",children:a.jsx($0,{prefix:d,items:N,index:W,entry:A,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:fe,lightboxEntries:ce,entryIdx:B,layoutId:r,sourceRect:T,resolveCloseSourceRect:ye,onClose:te,onPrev:()=>Fe(-1),onNext:()=>Fe(1)})}),w)})()]})}const _0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
18785
+ `}function L0(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 P0(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 E0(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*I0,n??!1),[`--${t}-image-aspect`]:L0(e)}}function M0(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 Ut(n,t)}function k0(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 A0(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?Jd(d,o):void 0)}}function F0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>R0(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}, ${T0}px)`,{objectFitMode:f,imageStyle:v}=k0(e),C=M0(e,n),y=s.useRef(null),[S,V]=s.useState(!1),[N,q]=s.useState([]),[W,I]=s.useState(0),[B,$]=s.useState(0),[T,k]=s.useState(null),[F,g]=s.useState({title1:"",title2:"",title3:""}),O=(!n||i)&&!S,P=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},X=P.sizeType??"none",te=O&&X!=="none"?`${d}-item-image-hover-${X}`:void 0,L=(P.value??120)/100,H=s.useCallback(b=>{!b||X!=="scale"||(b.style.transformOrigin=Lg(b))},[X]),U=s.useCallback(b=>{if(b){if(f==="contain"){const M=P0(b);if(M){const E=b.closest(`.${d}-item-image`);E instanceof HTMLElement&&E.style.setProperty(`--${d}-item-media-aspect`,String(M))}}H(b)}},[d,H,f]),de={width:D.scalingValue(x,n??!1),...C,...E0(e,d,n),[`--${d}-image-hover-scale`]:String(L)},ae=(()=>{const b={},M=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return M&&(b["--cntrl-article-width"]=M),b})(),A=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),ce=s.useMemo(()=>m0(u),[u]),z=s.useMemo(()=>x0(u),[u]),re=(b,M)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const E=ce.findIndex(Ce=>Ce.gridIndex===b);if(E<0)return;const j=ce[E];$(E),q(j.items),I(0),g(j.entry),k(M??null),V(!0)},ee=s.useCallback(()=>{V(!1),k(null)},[]),xe=s.useCallback(()=>{const b=ce[B];return!b||!y.current?T:p0(y.current,b.gridIndex,f)??T},[ce,B,T,f]),Fe=s.useCallback(b=>{if(ce.length>1){const M=ce.length,E=(B+b+M)%M,j=ce[E];$(E),q(j.items),I(0),g(j.entry);return}I(M=>(M+b+N.length)%N.length)},[ce,B,N.length]),ye=ce.length>1||N.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||V(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&V(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(v0,{mediaList:z}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:de,children:u.map((b,M)=>{var Ce,Q;const E=!!((Ce=b.image)!=null&&Ce.url),j=A0(!!A,E,M,d,f,re);return a.jsxs("div",{className:`${d}-item`,children:[b.title?a.jsx("span",{className:`${d}-item-title`,onClick:j,style:j?{cursor:"pointer"}:void 0,children:b.title}):null,(Q=b.image)!=null&&Q.url?a.jsx("span",{className:[`${d}-item-image`,f==="contain"?`${d}-item-image-fit`:void 0,te].filter(Boolean).join(" "),children:b.image.type==="video"?a.jsx("video",{ref:U,src:b.image.url,"data-waterfall-index":M,style:v,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:j,onLoadedData:Te=>U(Te.currentTarget)}):a.jsx("img",{ref:U,src:b.image.url,alt:b.image.name??"","data-waterfall-index":M,style:v,onClick:j,onLoad:Te=>U(Te.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:ae,"data-selection":"none",children:a.jsx($0,{prefix:d,items:N,index:W,entry:F,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ye,lightboxEntries:ce,entryIdx:B,layoutId:r,sourceRect:T,resolveCloseSourceRect:xe,onClose:ee,onPrev:()=>Fe(-1),onNext:()=>Fe(1)})}),b)})()]})}const _0=`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
- `,N0="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 W0(e){const t={};return t[at(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSettings")]={...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSize")]={...Yn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[at(e,"lineHeight")]={...Yn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[at(e,"letterSpacing")]={...Yn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[at(e,"wordSpacing")]={...Yn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[at(e,"textAlign")]={...Yn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[at(e,"textAppearance")]={...Yn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const so=oi.filter(e=>e!=="count"),H0=so.reduce((e,t)=>({...e,...W0(t)}),{}),D0=so.reduce((e,t)=>({...e,[at(t,"fontFamily")]:"Arial",[at(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[at(t,"letterSpacing")]:0,[at(t,"wordSpacing")]:0,[at(t,"textAlign")]:"left",[at(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[at(n,"fontSize")]=i),o!==void 0&&(t[at(n,"lineHeight")]=o),t},{})}const O0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(so.map(e=>[Xs[e],Ys(e)]))},wr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},B0=[{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"}}],z0={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:B0},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"]}}},...H0},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:N0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...D0},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:[O0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},j0={element:F0,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:`${at(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...so.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${at(t,"fontFamily")}`}),{})},schema:z0,sourceCode:_0},qi=500,tu="cubic-bezier(0.25, 1, 0.5, 1)",V0=300,G0=5,X0=.15,Y0=.4,q0=100,Fi=100,hc={color:"#000000",hover:"#cccccc"},bo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},U0={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},K0="left";function Z0(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:K0,color:(e==null?void 0:e.titleColor)??"#000000"};return Ut(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 J0(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 Q0(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function eb(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 b=n.getBoundingClientRect();return{x:b.left,y:b.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 tb(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 nb(e,t){return`
19299
+ `,N0="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 W0(e){const t={};return t[at(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSettings")]={...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSize")]={...Yn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[at(e,"lineHeight")]={...Yn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[at(e,"letterSpacing")]={...Yn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[at(e,"wordSpacing")]={...Yn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[at(e,"textAlign")]={...Yn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[at(e,"textAppearance")]={...Yn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const so=oi.filter(e=>e!=="count"),H0=so.reduce((e,t)=>({...e,...W0(t)}),{}),D0=so.reduce((e,t)=>({...e,[at(t,"fontFamily")]:"Arial",[at(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[at(t,"letterSpacing")]:0,[at(t,"wordSpacing")]:0,[at(t,"textAlign")]:"left",[at(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[at(n,"fontSize")]=i),o!==void 0&&(t[at(n,"lineHeight")]=o),t},{})}const O0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(so.map(e=>[Xs[e],Ys(e)]))},wr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},B0=[{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"}}],z0={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:B0},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"]}}},...H0},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:N0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...D0},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:[O0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},j0={element:F0,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:`${at(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...so.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${at(t,"fontFamily")}`}),{})},schema:z0,sourceCode:_0},qi=500,tu="cubic-bezier(0.25, 1, 0.5, 1)",V0=300,G0=5,X0=.15,Y0=.4,q0=100,Fi=100,hc={color:"#000000",hover:"#cccccc"},bo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},U0={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},K0="left";function Z0(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:K0,color:(e==null?void 0:e.titleColor)??"#000000"};return Ut(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 J0(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 Q0(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function eb(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 tb(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 nb(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 ib({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=D.useScopedStyles(),l=Z0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??fc,p=u.sizeType??"drag",x=u.value??fc.value,b=(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=U0[f],C=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Re=>D.scalingValue(Re*C,n),S=(e==null?void 0:e.show)??"always",V=(e==null?void 0:e.controls)??null,N=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,q=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,W=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,I=(e==null?void 0:e.controlsColor)??hc.color,B=(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,A=(e==null?void 0:e.linkColor)??ja.linkColor,g=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,O=b==="horizontal",P=p==="click",X=p==="drag",ne=p==="auto"&&(!n||!!i),L=!n,H=m==="slide",U=h==="classic",de=S!=="never",ae=S==="on hover",F=D.scalingValue(N,n),ce={width:F,height:F,maxWidth:F},z=H&&c>1,[re,te]=s.useState(0),[ye,Fe]=s.useState(z?1:0),[fe,w]=s.useState(!1),[M,E]=s.useState(!1),[j,Te]=s.useState(!1),[ee,$e]=s.useState(0),[J,me]=s.useState(!1),[Se,K]=s.useState(!1),Z=s.useRef(!1),se=s.useRef(ye);se.current=ye;const we=s.useRef(null),Me=s.useRef(0),Ce=s.useRef(null),G=s.useRef(null),ue=s.useRef(null),oe=s.useRef(null),Y=s.useCallback(Re=>{Z.current=Re,w(Re)},[]),le=s.useCallback(Re=>{if(c<2||Re===0)return;const He=Re>0?1:-1,Be=Math.abs(Re);if(me(!0),Y(!0),!H){te(ve=>Io(ve+Re,c));return}let Ze=se.current;const he=z&&(Ze===0||Ze===c+1),xe=he?re+1:null;he&&(Ze=re+1);let We=Be;for(;We>0;){const ve=J0(Ze,He,c,z);if(Ze=ve.position,We-=1,ve.hitBoundary){Me.current=We*He;break}}const Je=Be-We;if(Je>0&&te(ve=>Io(ve+Je*He,c)),se.current=Ze,xe!==null){if(se.current=xe,Ze===xe){E(!0),Fe(Ze);return}we.current=Ze,E(!0),Fe(xe);return}E(!1),Fe(Ze)},[re,c,z,H,Y]),_e=s.useCallback(Re=>{le(Re)},[le]),pe=s.useCallback(Re=>{if(c<2)return;const He=Io(Re,c);if(!(He===re&&!Z.current)&&(me(!0),Y(!0),te(He),H)){const Be=He+(z?1:0);we.current=null,Me.current=0,se.current=Be,E(!1),Fe(Be)}},[re,c,z,H,Y]);s.useEffect(()=>{if(!fe)return;const Re=window.setTimeout(()=>{if(z&&(ye===0||ye===c+1)){we.current=null,E(!0),Fe(re+1);return}Y(!1)},qi);return()=>window.clearTimeout(Re)},[re,c,z,fe,Y,ye]),s.useEffect(()=>{if(!M)return;let Re=0;const He=requestAnimationFrame(()=>{Re=requestAnimationFrame(()=>{const Be=we.current;we.current=null;const Ze=Me.current;if(Me.current=0,E(!1),Be!==null){se.current=Be,Fe(Be);return}if(Ze!==0){le(Ze);return}Y(!1)})});return()=>{cancelAnimationFrame(He),cancelAnimationFrame(Re)}},[le,Y,M]);const Q=`${z}:${c}`,Ke=s.useRef(Q);s.useEffect(()=>{if(Ke.current===Q)return;Ke.current=Q;const Re=c>0?Math.min(re,c-1):0;ue.current=null,oe.current=null,Te(!1),$e(0),te(Re),E(!0),Fe(Re+(z?1:0))},[re,c,z,Q]),s.useEffect(()=>{if(!J)return;const Re=window.setTimeout(()=>me(!1),V0);return()=>window.clearTimeout(Re)},[J,re]),s.useEffect(()=>{if(!ne||c<2)return;const Re=Math.max(x,.1)*1e3,He=window.setInterval(()=>{L&&Se||_e(1)},Re);return()=>window.clearInterval(He)},[x,c,_e,ne,Se,L]);const ke=s.useCallback(Re=>{const He=ue.current;if(!He||He.pointerId!==Re.pointerId)return;ue.current=null,oe.current=null;const Be=Ce.current;if(Be!=null&&Be.hasPointerCapture(Re.pointerId)&&Be.releasePointerCapture(Re.pointerId),!He.isActive){H&&$e(0);return}const he=!(Re.timeStamp-He.lastTime>q0)&&Math.abs(He.velocity)>Y0,xe=He.size>0&&Math.abs(He.offset-He.baseOffset)>He.size*X0;if(Te(!1),!he&&!xe){$e(0);return}const We=xe?He.offset-He.baseOffset:He.velocity;let Je=1;xe&&He.size>0&&(Je=Math.max(1,Math.round(Math.abs(We)/He.size))),$e(0),le(We<0?Je:-Je)},[le,H]);s.useEffect(()=>{const Re=He=>{oe.current===null||He.pointerId!==oe.current||ke(He)};return window.addEventListener("pointerup",Re),window.addEventListener("pointercancel",Re),()=>{window.removeEventListener("pointerup",Re),window.removeEventListener("pointercancel",Re)}},[ke]);const tt=Re=>{const He=Ce.current;if(!X||c<2||!He||Re.pointerType==="mouse"&&Re.button!==0)return;we.current=null,Me.current=0,Z.current&&Y(!1);let Be=0;const Ze=G.current;if(H&&Ze){const he=O?Ze.offsetWidth:Ze.offsetHeight;if(he>0){const xe=Q0(Ze,O);let We=se.current;z&&(We===0||We===c+1)?(We=re+1,se.current=We,E(!0),Fe(We),Be=0):Be=xe+We*he,$e(Be)}}He.setPointerCapture(Re.pointerId),oe.current=Re.pointerId,ue.current={pointerId:Re.pointerId,startClientX:Re.clientX,startClientY:Re.clientY,axes:eb(He,`${r}-axis-probe`),size:O?He.offsetWidth:He.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:Re.timeStamp,velocity:0}},Ye=Re=>{const He=ue.current;if(!He||He.pointerId!==Re.pointerId)return;if(Re.pointerType==="mouse"&&Re.buttons===0){ke(Re);return}const Be=Re.clientX-He.startClientX,Ze=Re.clientY-He.startClientY,he=He.axes?tb(He.axes,Be,Ze):{x:Be,y:Ze},xe=O?he.x:he.y,We=O?he.y:he.x,Je=He.baseOffset+xe;if(!He.isActive){if(Math.max(Math.abs(xe),Math.abs(We))<G0)return;if(Math.abs(We)>Math.abs(xe)){const Ie=Ce.current;Ie!=null&&Ie.hasPointerCapture(He.pointerId)&&Ie.releasePointerCapture(He.pointerId),ue.current=null,oe.current=null,H&&$e(0);return}He.isActive=!0,Te(!0)}const ve=Re.timeStamp-He.lastTime;ve>0&&(He.velocity=(Je-He.offset)/ve,He.lastTime=Re.timeStamp),He.offset=Je,H&&$e(Je)},dt=Re=>{ke(Re)},ot=O?`translate3d(calc(${-ye*100}% + ${ee}px), 0, 0)`:`translate3d(0, calc(${-ye*100}% + ${ee}px), 0)`,Ve=z?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:nb(r,n)}}),a.jsxs("div",{className:pt(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!O}),onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!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`]:X,[`${r}-track-draggable-vertical`]:X&&!O}),onPointerDown:tt,onPointerMove:Ye,onPointerUp:dt,onPointerCancel:dt,onLostPointerCapture:Re=>{oe.current===Re.pointerId&&ke(Re)},children:a.jsx("div",{ref:G,className:pt(`${r}-list`,{[`${r}-list-slide`]:H,[`${r}-list-slide-vertical`]:H&&!O,[`${r}-list-fade`]:!H}),style:H?{transform:ot,transition:j||M?"none":`transform ${qi}ms ${tu}`}:void 0,children:Ve.map((Re,He)=>{const Be=z?Io(He-1,c):He,he=z&&(He===0||He===c+1)?`clone-${He===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:pt(`${r}-slide`,{[`${r}-is-active`]:!H&&Be===re}),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`]:Re.image.objectFit==="contain",[`${r}-cover`]:Re.image.objectFit==="cover"}),src:Re.image.url,alt:Re.image.name??"",draggable:!1})})})},he)})})}),de&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-prev`]:O,[`${r}-arrow-prev-vertical`]:!O,[`${r}-hover-arrow`]:ae}),style:{color:I,"--arrow-hover-color":B,...ce},children:a.jsxs("button",{onClick:Re=>{Re.stopPropagation(),_e(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${D.scalingValue(q,n)}, ${D.scalingValue(W*(O?1:-1),n)}) rotate(${O?"0deg":"90deg"})`},children:[V&&a.jsx(sn,{url:V,fill:I,hoverFill:B,className:pt(`${r}-arrow-img`,`${r}-mirror`),style:ce}),!V&&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`]:O,[`${r}-arrow-next-vertical`]:!O,[`${r}-hover-arrow`]:ae}),style:{color:I,"--arrow-hover-color":B,...ce},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Re=>{Re.stopPropagation(),_e(1)},style:{transform:`translate(${D.scalingValue(q*(O?-1:1),n)}, ${D.scalingValue(W,n)}) rotate(${O?"0deg":"90deg"})`},children:[V&&a.jsx(sn,{url:V,fill:I,hoverFill:B,className:`${r}-arrow-img`,style:ce}),!V&&a.jsx(yc,{color:I,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),P&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>_e(1)}),U&&a.jsx("div",{className:pt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:O,[`${r}-pagination-inside-left`]:!O}),style:O?{bottom:y(v.inset)}:{left:y(v.inset)},children:a.jsx("div",{className:pt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!O,[`${r}-animate-dots`]:J}),style:{backgroundColor:k,gap:y(v.gapInactive-v.activeDot+v.dot),...O?{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((Re,He)=>{const Be=He===re,Ze=Be?v.activeDot:v.dot;return a.jsx("button",{onClick:()=>pe(He),className:`${r}-pagination-item`,style:{width:y(v.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?T:$,width:y(Ze)}})},He)})},`${f}-${b}`)})]}),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((Re,He)=>a.jsx("div",{className:pt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:He===re&&n,[`${r}-active`]:He===re}),style:{...l,width:"max-content",transitionDuration:`${Math.round(qi/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":A,"--link-hover-color":A,position:"relative",top:D.scalingValue(ja.offset.y,n),left:D.scalingValue(ja.offset.x,n)},children:a.jsx(Ri,{content:Re.imageCaption})})},He))})]})]})]})}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 ob=`import React, { useCallback, useEffect, useRef, useState } from 'react';
19569
+ `}function ib({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=D.useScopedStyles(),l=Z0(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=U0[f],C=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Re=>D.scalingValue(Re*C,n),S=(e==null?void 0:e.show)??"always",V=(e==null?void 0:e.controls)??null,N=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,q=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,W=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,I=(e==null?void 0:e.controlsColor)??hc.color,B=(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,F=(e==null?void 0:e.linkColor)??ja.linkColor,g=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,O=w==="horizontal",P=p==="click",X=p==="drag",te=p==="auto"&&(!n||!!i),L=!n,H=m==="slide",U=h==="classic",de=S!=="never",ae=S==="on hover",A=D.scalingValue(N,n),ce={width:A,height:A,maxWidth:A},z=H&&c>1,[re,ee]=s.useState(0),[xe,Fe]=s.useState(z?1:0),[ye,b]=s.useState(!1),[M,E]=s.useState(!1),[j,Ce]=s.useState(!1),[Q,Te]=s.useState(0),[ie,ue]=s.useState(!1),[fe,K]=s.useState(!1),Z=s.useRef(!1),se=s.useRef(xe);se.current=xe;const Se=s.useRef(null),Me=s.useRef(0),$e=s.useRef(null),G=s.useRef(null),pe=s.useRef(null),oe=s.useRef(null),Y=s.useCallback(Re=>{Z.current=Re,b(Re)},[]),le=s.useCallback(Re=>{if(c<2||Re===0)return;const He=Re>0?1:-1,Be=Math.abs(Re);if(ue(!0),Y(!0),!H){ee(be=>Io(be+Re,c));return}let Ze=se.current;const he=z&&(Ze===0||Ze===c+1),ve=he?re+1:null;he&&(Ze=re+1);let We=Be;for(;We>0;){const be=J0(Ze,He,c,z);if(Ze=be.position,We-=1,be.hitBoundary){Me.current=We*He;break}}const Je=Be-We;if(Je>0&&ee(be=>Io(be+Je*He,c)),se.current=Ze,ve!==null){if(se.current=ve,Ze===ve){E(!0),Fe(Ze);return}Se.current=Ze,E(!0),Fe(ve);return}E(!1),Fe(Ze)},[re,c,z,H,Y]),_e=s.useCallback(Re=>{le(Re)},[le]),me=s.useCallback(Re=>{if(c<2)return;const He=Io(Re,c);if(!(He===re&&!Z.current)&&(ue(!0),Y(!0),ee(He),H)){const Be=He+(z?1:0);Se.current=null,Me.current=0,se.current=Be,E(!1),Fe(Be)}},[re,c,z,H,Y]);s.useEffect(()=>{if(!ye)return;const Re=window.setTimeout(()=>{if(z&&(xe===0||xe===c+1)){Se.current=null,E(!0),Fe(re+1);return}Y(!1)},qi);return()=>window.clearTimeout(Re)},[re,c,z,ye,Y,xe]),s.useEffect(()=>{if(!M)return;let Re=0;const He=requestAnimationFrame(()=>{Re=requestAnimationFrame(()=>{const Be=Se.current;Se.current=null;const Ze=Me.current;if(Me.current=0,E(!1),Be!==null){se.current=Be,Fe(Be);return}if(Ze!==0){le(Ze);return}Y(!1)})});return()=>{cancelAnimationFrame(He),cancelAnimationFrame(Re)}},[le,Y,M]);const J=`${z}:${c}`,Ke=s.useRef(J);s.useEffect(()=>{if(Ke.current===J)return;Ke.current=J;const Re=c>0?Math.min(re,c-1):0;pe.current=null,oe.current=null,Ce(!1),Te(0),ee(Re),E(!0),Fe(Re+(z?1:0))},[re,c,z,J]),s.useEffect(()=>{if(!ie)return;const Re=window.setTimeout(()=>ue(!1),V0);return()=>window.clearTimeout(Re)},[ie,re]),s.useEffect(()=>{if(!te||c<2)return;const Re=Math.max(x,.1)*1e3,He=window.setInterval(()=>{L&&fe||_e(1)},Re);return()=>window.clearInterval(He)},[x,c,_e,te,fe,L]);const ke=s.useCallback(Re=>{const He=pe.current;if(!He||He.pointerId!==Re.pointerId)return;pe.current=null,oe.current=null;const Be=$e.current;if(Be!=null&&Be.hasPointerCapture(Re.pointerId)&&Be.releasePointerCapture(Re.pointerId),!He.isActive){H&&Te(0);return}const he=!(Re.timeStamp-He.lastTime>q0)&&Math.abs(He.velocity)>Y0,ve=He.size>0&&Math.abs(He.offset-He.baseOffset)>He.size*X0;if(Ce(!1),!he&&!ve){Te(0);return}const We=ve?He.offset-He.baseOffset:He.velocity;let Je=1;ve&&He.size>0&&(Je=Math.max(1,Math.round(Math.abs(We)/He.size))),Te(0),le(We<0?Je:-Je)},[le,H]);s.useEffect(()=>{const Re=He=>{oe.current===null||He.pointerId!==oe.current||ke(He)};return window.addEventListener("pointerup",Re),window.addEventListener("pointercancel",Re),()=>{window.removeEventListener("pointerup",Re),window.removeEventListener("pointercancel",Re)}},[ke]);const tt=Re=>{const He=$e.current;if(!X||c<2||!He||Re.pointerType==="mouse"&&Re.button!==0)return;Se.current=null,Me.current=0,Z.current&&Y(!1);let Be=0;const Ze=G.current;if(H&&Ze){const he=O?Ze.offsetWidth:Ze.offsetHeight;if(he>0){const ve=Q0(Ze,O);let We=se.current;z&&(We===0||We===c+1)?(We=re+1,se.current=We,E(!0),Fe(We),Be=0):Be=ve+We*he,Te(Be)}}He.setPointerCapture(Re.pointerId),oe.current=Re.pointerId,pe.current={pointerId:Re.pointerId,startClientX:Re.clientX,startClientY:Re.clientY,axes:eb(He,`${r}-axis-probe`),size:O?He.offsetWidth:He.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:Re.timeStamp,velocity:0}},Ye=Re=>{const He=pe.current;if(!He||He.pointerId!==Re.pointerId)return;if(Re.pointerType==="mouse"&&Re.buttons===0){ke(Re);return}const Be=Re.clientX-He.startClientX,Ze=Re.clientY-He.startClientY,he=He.axes?tb(He.axes,Be,Ze):{x:Be,y:Ze},ve=O?he.x:he.y,We=O?he.y:he.x,Je=He.baseOffset+ve;if(!He.isActive){if(Math.max(Math.abs(ve),Math.abs(We))<G0)return;if(Math.abs(We)>Math.abs(ve)){const Ie=$e.current;Ie!=null&&Ie.hasPointerCapture(He.pointerId)&&Ie.releasePointerCapture(He.pointerId),pe.current=null,oe.current=null,H&&Te(0);return}He.isActive=!0,Ce(!0)}const be=Re.timeStamp-He.lastTime;be>0&&(He.velocity=(Je-He.offset)/be,He.lastTime=Re.timeStamp),He.offset=Je,H&&Te(Je)},dt=Re=>{ke(Re)},ot=O?`translate3d(calc(${-xe*100}% + ${Q}px), 0, 0)`:`translate3d(0, calc(${-xe*100}% + ${Q}px), 0)`,Ve=z?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:nb(r,n)}}),a.jsxs("div",{className:pt(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!O}),onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:$e,className:pt(`${r}-track`,{[`${r}-track-draggable`]:X,[`${r}-track-draggable-vertical`]:X&&!O}),onPointerDown:tt,onPointerMove:Ye,onPointerUp:dt,onPointerCancel:dt,onLostPointerCapture:Re=>{oe.current===Re.pointerId&&ke(Re)},children:a.jsx("div",{ref:G,className:pt(`${r}-list`,{[`${r}-list-slide`]:H,[`${r}-list-slide-vertical`]:H&&!O,[`${r}-list-fade`]:!H}),style:H?{transform:ot,transition:j||M?"none":`transform ${qi}ms ${tu}`}:void 0,children:Ve.map((Re,He)=>{const Be=z?Io(He-1,c):He,he=z&&(He===0||He===c+1)?`clone-${He===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:pt(`${r}-slide`,{[`${r}-is-active`]:!H&&Be===re}),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`]:Re.image.objectFit==="contain",[`${r}-cover`]:Re.image.objectFit==="cover"}),src:Re.image.url,alt:Re.image.name??"",draggable:!1})})})},he)})})}),de&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:pt(`${r}-arrow`,{[`${r}-arrow-prev`]:O,[`${r}-arrow-prev-vertical`]:!O,[`${r}-hover-arrow`]:ae}),style:{color:I,"--arrow-hover-color":B,...ce},children:a.jsxs("button",{onClick:Re=>{Re.stopPropagation(),_e(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${D.scalingValue(q,n)}, ${D.scalingValue(W*(O?1:-1),n)}) rotate(${O?"0deg":"90deg"})`},children:[V&&a.jsx(sn,{url:V,fill:I,hoverFill:B,className:pt(`${r}-arrow-img`,`${r}-mirror`),style:ce}),!V&&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`]:O,[`${r}-arrow-next-vertical`]:!O,[`${r}-hover-arrow`]:ae}),style:{color:I,"--arrow-hover-color":B,...ce},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Re=>{Re.stopPropagation(),_e(1)},style:{transform:`translate(${D.scalingValue(q*(O?-1:1),n)}, ${D.scalingValue(W,n)}) rotate(${O?"0deg":"90deg"})`},children:[V&&a.jsx(sn,{url:V,fill:I,hoverFill:B,className:`${r}-arrow-img`,style:ce}),!V&&a.jsx(yc,{color:I,className:pt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),P&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>_e(1)}),U&&a.jsx("div",{className:pt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:O,[`${r}-pagination-inside-left`]:!O}),style:O?{bottom:y(v.inset)}:{left:y(v.inset)},children:a.jsx("div",{className:pt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!O,[`${r}-animate-dots`]:ie}),style:{backgroundColor:k,gap:y(v.gapInactive-v.activeDot+v.dot),...O?{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((Re,He)=>{const Be=He===re,Ze=Be?v.activeDot:v.dot;return a.jsx("button",{onClick:()=>me(He),className:`${r}-pagination-item`,style:{width:y(v.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?T:$,width:y(Ze)}})},He)})},`${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((Re,He)=>a.jsx("div",{className:pt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:He===re&&n,[`${r}-active`]:He===re}),style:{...l,width:"max-content",transitionDuration:`${Math.round(qi/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":F,"--link-hover-color":F,position:"relative",top:D.scalingValue(ja.offset.y,n),left:D.scalingValue(ja.offset.x,n)},children:a.jsx(Ri,{content:Re.imageCaption})})},He))})]})]})]})}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 ob=`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';
@@ -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 db="rgba(28,31,34,0.9)",An=500,xi="cubic-bezier(0.22, 1, 0.36, 1)",ub=72,pb=50,mb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},gb=[];function hb(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 fb(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function yb(e){const[t]=e.media;return t!=null&&t.url?t:null}function xb(e){if(!Array.isArray(e)||e.length===0)return[];if(hb(e)){const t=[];for(const n of e){const i=fb(n);if(!i)continue;const o=yb(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 vb(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 bb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const wb=1140/1440;function Sb(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 Cb(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 $b(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Tb({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()=>{vb(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 Ib({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",b=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),V=s.useRef(!1),N=s.useRef(null),[q,W]=s.useState(null),[I,B]=s.useState("opening"),[$,T]=s.useState(0),[k,A]=s.useState(0),[g,O]=s.useState(!1),[P,X]=s.useState(!1),[ne,L]=s.useState(!1),H=s.useRef(n),U=t[n],de=U?us(U):!1,ae=k!==0||g,F=s.useCallback(J=>{V.current=J,O(J)},[]),ce=s.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),z=s.useCallback(()=>{ce(),N.current=window.setTimeout(()=>{ce(),F(!1)},An+32)},[ce,F]),re=s.useCallback(()=>{const J=b.current,me=m.current;if(!J)return;const Se=J.getBoundingClientRect(),K=Se.width,Z=Se.height;if(!K||!Z)return;if(i==="cover"){W({width:K,height:Z,left:Se.left,top:Se.top});return}if(!me){W(Sr(J));return}const{width:se,height:we}=bb(me);if(!se||!we){W(Sr(J));return}const Me=se/we,Ce=K/Z;if(Me>Ce){const G=K/Me;W({width:K,height:G,left:Se.left,top:Se.top+(Z-G)/2})}else{const G=Z*Me;W({width:G,height:Z,left:Se.left+(K-G)/2,top:Se.top})}},[i]);s.useEffect(()=>{re();const J=b.current;if(!J)return;const me=new ResizeObserver(()=>re());return me.observe(J),()=>me.disconnect()},[re,n]),s.useEffect(()=>{I==="opening"&&q&&B("open")},[I,q]),s.useEffect(()=>{if(I!=="closing")return;const J=setTimeout(()=>r(),An);return()=>clearTimeout(J)},[I,r]),s.useEffect(()=>()=>{ce()},[ce]),s.useLayoutEffect(()=>{if(H.current===n)return;ce(),T(0),A(0),F(!1),L(!1),X(!1),f.current=0,v.current=0,C.current="none",y.current=!1,h.current=null,S.current=!1;const J=b.current;J&&W(Sr(J)),H.current=n},[n,F,ce]),s.useEffect(()=>{if(I!=="open")return;let J=null;const me=()=>{J&&(document.removeEventListener("click",J,!0),J=null)},Se=()=>{me(),J=Ce=>{Ce.stopPropagation(),Ce.preventDefault(),me()},document.addEventListener("click",J,!0)},K=Ce=>{ce(),V.current=!1,O(!1),A(0),X(!1),y.current=!1,v.current=0,C.current="none";const G=b.current;G&&W(Sr(G)),Ce<0?d():l()},Z=Ce=>{if(Math.abs(Ce)>pb&&t.length>1){K(Ce);return}F(!0),A(0),z()},se=Ce=>{if(Ce.touches.length!==1||V.current)return;const G=Ce.touches[0];S.current=!0,h.current={x:G.clientX,y:G.clientY},C.current="none",v.current=0,y.current=!1},we=Ce=>{if(!h.current||Ce.touches.length!==1||V.current)return;const G=Ce.touches[0],ue=G.clientX-h.current.x,oe=G.clientY-h.current.y;if(C.current==="none"){if(Math.abs(ue)<10&&Math.abs(oe)<10)return;if(Math.abs(ue)>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,X(!0),v.current=ue,A(ue),Ce.preventDefault();return}C.current==="vertical"&&(y.current=!0,X(!0),f.current=oe,T(oe),Ce.preventDefault())},Me=()=>{if(!h.current)return;const Ce=C.current,G=y.current;if(G&&Ce==="horizontal")Z(v.current),Se();else if(G&&Ce==="vertical")if(f.current>ub){const oe=window.innerHeight;f.current=oe,L(!0),T(oe),B("closing")}else f.current=0,T(0),Se();else Ce==="horizontal"&&Math.abs(v.current)>0&&(Z(v.current),Se());h.current=null,C.current="none",v.current=0,y.current=!1,X(!1)};return document.addEventListener("touchstart",se,{passive:!0}),document.addEventListener("touchmove",we,{passive:!1}),document.addEventListener("touchend",Me),document.addEventListener("touchcancel",Me),()=>{document.removeEventListener("touchstart",se),document.removeEventListener("touchmove",we),document.removeEventListener("touchend",Me),document.removeEventListener("touchcancel",Me),me()}},[I,t.length,d,l,F,z,ce]),s.useEffect(()=>{const J=me=>{me.key==="Escape"&&(me.preventDefault(),me.stopPropagation(),I!=="closing"&&B("closing"))};return window.addEventListener("keydown",J,!0),()=>window.removeEventListener("keydown",J,!0)},[I]);const te=()=>{I!=="closing"&&B("closing")},ye=I==="open",Fe=I==="closing",fe=$>0?Math.max(0,1-$/500):1,w=$>0?Math.max(.35,1-$/500):1,M=J=>{if(J.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const me=J.currentTarget.getBoundingClientRect(),Se=J.clientY-me.top,K=Math.min(52,me.height*.2);if(!(Se>me.height-K)){if(J.clientX-me.left<me.width/2){l();return}d()}},E=J=>{if(t.length<=1)return;const me=J.currentTarget.getBoundingClientRect(),Se=J.clientX-me.left,K=J.clientY-me.top,Z=Math.min(52,me.height*.2);if(K>me.height-Z){J.currentTarget.style.cursor="default";return}J.currentTarget.style.cursor=Se<me.width/2?"w-resize":"e-resize"},j=s.useCallback(J=>{J.propertyName!=="transform"||!V.current||(ce(),F(!1))},[ce,F]),Te=ae?`translateX(${k}px)`:$>0?`translateY(${$}px)`:void 0,ee={position:"fixed",top:q==null?void 0:q.top,left:q==null?void 0:q.left,width:q==null?void 0:q.width,height:q==null?void 0:q.height,objectFit:i==="cover"?"cover":"contain",transform:Te,opacity:$>0?w:I==="opening"||Fe?0:1,transition:P&&!g?"none":g?`transform ${An}ms ${xi}`:ne?`transform ${An}ms ${xi}, opacity ${An}ms ${xi}`:I==="opening"||Fe?`opacity ${An}ms ${xi}`:"none",pointerEvents:de&&ye&&!ae?"auto":"none",touchAction:de&&ye?"none":void 0,zIndex:9998},$e=q?{position:"fixed",top:q.top,height:q.height,width:q.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:te,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:ye?fe: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:b,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:ye?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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${An}ms ${xi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),q&&U&&(de?a.jsx(Tb,{src:U.url,phase:I,mediaRef:m,mediaStyle:ee,onLoadedMetadata:re,onClick:M,onMouseMove:E,onTransitionEnd:j},`${n}-${U.url}`):a.jsx("img",{ref:m,src:U.url,alt:U.name,onLoad:re,onTransitionEnd:j,style:ee},`${n}-${U.url}`)),ye&&$e&&t.length>1&&!de&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...$e,left:q.left,cursor:"w-resize",pointerEvents:ae?"none":"auto"},onClick:J=>{if(S.current){S.current=!1;return}J.stopPropagation(),l()}}),a.jsx("div",{style:{...$e,left:q.left+q.width/2,cursor:"e-resize",pointerEvents:ae?"none":"auto"},onClick:J=>{if(S.current){S.current=!1;return}J.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"}`,b=r.display==="cover",m=Cb(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,...b?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...C},S={...b?{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"}:{},...b?{}:C},N={className:x,style:S,onClick:p?I=>{I.stopPropagation(),p()}:void 0},q=Math.max(d,vi),W=us(t)?a.jsx("video",{...N,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...N,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[b?a.jsx("div",{style:y,children:W}):W,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(q)}})]})}function Rb({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,b=x>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&b&&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"&&b&&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 Lb(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,b]=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=()=>b(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 Pb(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 Eb(e,t,n){const{top:i,centerY:o}=Pb(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 Mb(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=Eb(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 kb(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(Mb(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 Ab(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 Fb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var nt;const{prefix:l}=D.useScopedStyles(),d=s.useMemo(()=>cb(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,b=(e==null?void 0:e.titleWidth)??wb,m=Sb(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??sb,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=Lb(e==null?void 0:e.transition),V=(e==null?void 0:e.lightbox)??"on",N=p==="b",q=S==="fade"||S==="retype",{setTitleRef:W,dominantIndex:I}=kb(c.length,q,f),B=((nt=c[I])==null?void 0:nt.title)??"",$=Ab(B,S==="retype"),T=S==="fade"||S==="retype",k=S==="retype"?$:B,A=N?void 0:{width:D.scalingValue(x,n??!1)},g=V==="on"&&(!n||i||o),O=o??!1,P=(e==null?void 0:e.galleryPaddingRight)??0,X=(e==null?void 0:e.galleryPaddingLeft)??0,ne=(e==null?void 0:e.galleryPaddingBetween)??0,L=it=>D.scalingValue(it,n??!1),U={width:L(b)},de=p==="a"?P:X,ae=N?{width:"100%"}:{width:`calc(100% - ${L(x)} - ${L(de)})`,...p==="c"?{marginLeft:"auto"}:{}},F=Math.max(P,vi),ce=Math.max(X,vi),z=Math.max(ne,vi),re=Math.max(v,vi),te=Math.max(C,vi),ye=Math.max(y,vi),Fe=Math.max(0,(u??1)-(x??Oi)),fe=p==="a"?Math.max(0,(u??1)-(x??Oi)-P):p==="c"?Math.max(0,(u??1)-(x??Oi)-X):p==="b"?u??1:1,w=O&&(p==="a"||p==="b"||p==="c")&&f==="top",M=O&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),E=O&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),j=c.length>1,Te=N?void 0:L((p==="c"?X:P)+(x??Oi)),ee=p==="c"&&Te?{left:Te}:void 0,$e=p==="a"&&Te?{right:Te}:void 0,J=N?{left:0,width:"100%"}:p==="a"?{right:L(P),width:L(x)}:{left:L(X),width:L(x)},{titleColor:me,titleFontFamily:Se,titleFontSettings:K,titleFontSize:Z,titleLineHeight:se,titleLetterSpacing:we,titleWordSpacing:Me,titleAlign:Ce,titleTextAppearance:G,lightboxCounterColor:ue,lightboxCounterFontFamily:oe,lightboxCounterFontSettings:Y,lightboxCounterFontSize:le,lightboxCounterLineHeight:_e,lightboxCounterLetterSpacing:pe,lightboxCounterWordSpacing:Q,lightboxCounterTextAppearance:Ke}=e??{},ke={fontSettings:{fontFamily:Se,fontWeight:(K==null?void 0:K.fontWeight)??400,fontStyle:(K==null?void 0:K.fontStyle)??"normal"},fontSize:Z??.01,lineHeight:se,letterSpacing:we??0,wordSpacing:Me??0,textAlign:Ce??"left",textAppearance:G,color:me??"#000000"},Ye=an(Ut(ke,n)),dt=U,ot=vc(Z,se,l,n),Ve=xc(Z,se,`${l}-title`,`${l}-text-tight-leading`),Re={fontSettings:{fontFamily:oe,fontWeight:(Y==null?void 0:Y.fontWeight)??400,fontStyle:(Y==null?void 0:Y.fontStyle)??"normal"},fontSize:le??.01,lineHeight:_e,letterSpacing:pe??0,wordSpacing:Q??0,textAppearance:Ke,color:ue??"#DEDDDD"},Be={...an(Ut(Re,n)),...vc(le,_e,l,n)},Ze=xc(le,_e,`${l}-lightbox-counter`,`${l}-text-tight-leading`),he=D.buildColorVars(l,{titleColor:me??"#000000",lightboxCounterColor:ue??"#DEDDDD"},mb,gb),xe=s.useRef(null),[We,Je]=s.useState(!1),[ve,Ie]=s.useState([]),[qe,ze]=s.useState(0),Le=s.useCallback((it,ct)=>{g&&(Ie(it),ze(ct),Je(!0))},[g]),Ge=s.useCallback(()=>{Je(!1)},[]),De=s.useMemo(()=>{const it={...he},ct=xe.current?getComputedStyle(xe.current).getPropertyValue("--cntrl-article-width").trim():"";return ct&&(it["--cntrl-article-width"]=ct),it},[he,We]);return s.useEffect(()=>{if(!We||V!=="on"||typeof document>"u")return;const it=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=it}},[We,V]),s.useEffect(()=>{!n||o||i||Je(!1)},[n,o,i]),s.useEffect(()=>{V==="off"&&Je(!1)},[V]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:he,children:a.jsxs("div",{ref:xe,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:k,position:f,titleRef:()=>{},titleClassName:`${Ve} ${l}-single-title`,titleContainerStyle:{...ot,...ae},titleTextBoxStyle:dt,titleStyle:Ye,showTextBoxOutline:O,topPaddingControl:w?wc({P:l,scaled:L,height:re,paired:!1}):void 0})}),c.map((it,ct)=>{const St=xb(it.gallery),Bt=ct<c.length-1,zt=St.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),ft={P:l,position:f,titleRef:W(ct),titleClassName:Ve,titleContainerStyle:ot,titleTextBoxStyle:T?{maxWidth:"100%"}:dt,titleStyle:Ye,showTextBoxOutline:O&&!T,topPaddingControl:w&&!T?wc({P:l,scaled:L,height:re,paired:j}):void 0};return a.jsxs("div",{"data-item-index":ct,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Bt?L(ne):void 0},children:[M&&Sc({P:l,controlKey:"titleLeftPadding",scaled:L,width:te,maxFraction:fe,side:"left",paired:j,anchorStyle:ee}),E&&Sc({P:l,controlKey:"titleRightPadding",scaled:L,width:ye,maxFraction:fe,side:"right",paired:j,anchorStyle:$e}),O&&Bt&&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(z),...J}}),N?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:St.map(({displayMedia:wt,lightboxMedia:jt},At)=>{const vt=jt?zt.findIndex(Ft=>Ft.url===jt.url):-1;return a.jsx(bc,{P:l,media:wt,imgWidth:x||void 0,cornerRadius:h||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ne,showPaddingAfter:At<St.length-1,showControls:O,onMediaClick:g&&vt>=0?()=>Le(zt,vt):void 0},`${wt.url}-${At}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Va,{...ft,title:T?"":it.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Va,{...ft,title:T?"":it.title}),St.length>0&&a.jsx(Rb,{P:l,layoutType:p,galleryWidthStyle:A,galleryPaddingRight:P,galleryPaddingLeft:X,galleryPaddingRightWidth:F,galleryPaddingLeftWidth:ce,galleryPaddingMaxFraction:Fe,showControls:O,scaled:L,children:St.map(({displayMedia:wt,lightboxMedia:jt},At)=>{const vt=jt?zt.findIndex(Ft=>Ft.url===jt.url):-1;return a.jsx(bc,{P:l,media:wt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:ne,showPaddingAfter:At<St.length-1,showControls:O,onMediaClick:g&&vt>=0?()=>Le(zt,vt):void 0},`${wt.url}-${At}`)})})]})]},ct)})]})}),We&&V==="on"&&typeof document<"u"&&e&&(()=>{const it=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx("div",{style:De,"data-selection":"none",children:a.jsx(Ib,{prefix:l,items:ve,index:qe,imageDisplay:$b(e.lightboxImageDisplay),isEditor:n,onClose:Ge,onPrev:()=>ze(ct=>(ct-1+ve.length)%ve.length),onNext:()=>ze(ct=>(ct+1)%ve.length),counterClassName:Ze,counterStyle:Be,backgroundColor:e.backgroundColor??db})}),it)})()]})}const _b=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
20967
+ `}const db="rgba(28,31,34,0.9)",An=500,xi="cubic-bezier(0.22, 1, 0.36, 1)",ub=72,pb=50,mb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},gb=[];function hb(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 fb(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function yb(e){const[t]=e.media;return t!=null&&t.url?t:null}function xb(e){if(!Array.isArray(e)||e.length===0)return[];if(hb(e)){const t=[];for(const n of e){const i=fb(n);if(!i)continue;const o=yb(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 vb(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 bb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const wb=1140/1440;function Sb(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 Cb(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 $b(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Tb({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()=>{vb(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 Ib({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),V=s.useRef(!1),N=s.useRef(null),[q,W]=s.useState(null),[I,B]=s.useState("opening"),[$,T]=s.useState(0),[k,F]=s.useState(0),[g,O]=s.useState(!1),[P,X]=s.useState(!1),[te,L]=s.useState(!1),H=s.useRef(n),U=t[n],de=U?us(U):!1,ae=k!==0||g,A=s.useCallback(ie=>{V.current=ie,O(ie)},[]),ce=s.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),z=s.useCallback(()=>{ce(),N.current=window.setTimeout(()=>{ce(),A(!1)},An+32)},[ce,A]),re=s.useCallback(()=>{const ie=w.current,ue=m.current;if(!ie)return;const fe=ie.getBoundingClientRect(),K=fe.width,Z=fe.height;if(!K||!Z)return;if(i==="cover"){W({width:K,height:Z,left:fe.left,top:fe.top});return}if(!ue){W(Sr(ie));return}const{width:se,height:Se}=bb(ue);if(!se||!Se){W(Sr(ie));return}const Me=se/Se,$e=K/Z;if(Me>$e){const G=K/Me;W({width:K,height:G,left:fe.left,top:fe.top+(Z-G)/2})}else{const G=Z*Me;W({width:G,height:Z,left:fe.left+(K-G)/2,top:fe.top})}},[i]);s.useEffect(()=>{re();const ie=w.current;if(!ie)return;const ue=new ResizeObserver(()=>re());return ue.observe(ie),()=>ue.disconnect()},[re,n]),s.useEffect(()=>{I==="opening"&&q&&B("open")},[I,q]),s.useEffect(()=>{if(I!=="closing")return;const ie=setTimeout(()=>r(),An);return()=>clearTimeout(ie)},[I,r]),s.useEffect(()=>()=>{ce()},[ce]),s.useLayoutEffect(()=>{if(H.current===n)return;ce(),T(0),F(0),A(!1),L(!1),X(!1),f.current=0,v.current=0,C.current="none",y.current=!1,h.current=null,S.current=!1;const ie=w.current;ie&&W(Sr(ie)),H.current=n},[n,A,ce]),s.useEffect(()=>{if(I!=="open")return;let ie=null;const ue=()=>{ie&&(document.removeEventListener("click",ie,!0),ie=null)},fe=()=>{ue(),ie=$e=>{$e.stopPropagation(),$e.preventDefault(),ue()},document.addEventListener("click",ie,!0)},K=$e=>{ce(),V.current=!1,O(!1),F(0),X(!1),y.current=!1,v.current=0,C.current="none";const G=w.current;G&&W(Sr(G)),$e<0?d():l()},Z=$e=>{if(Math.abs($e)>pb&&t.length>1){K($e);return}A(!0),F(0),z()},se=$e=>{if($e.touches.length!==1||V.current)return;const G=$e.touches[0];S.current=!0,h.current={x:G.clientX,y:G.clientY},C.current="none",v.current=0,y.current=!1},Se=$e=>{if(!h.current||$e.touches.length!==1||V.current)return;const G=$e.touches[0],pe=G.clientX-h.current.x,oe=G.clientY-h.current.y;if(C.current==="none"){if(Math.abs(pe)<10&&Math.abs(oe)<10)return;if(Math.abs(pe)>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,X(!0),v.current=pe,F(pe),$e.preventDefault();return}C.current==="vertical"&&(y.current=!0,X(!0),f.current=oe,T(oe),$e.preventDefault())},Me=()=>{if(!h.current)return;const $e=C.current,G=y.current;if(G&&$e==="horizontal")Z(v.current),fe();else if(G&&$e==="vertical")if(f.current>ub){const oe=window.innerHeight;f.current=oe,L(!0),T(oe),B("closing")}else f.current=0,T(0),fe();else $e==="horizontal"&&Math.abs(v.current)>0&&(Z(v.current),fe());h.current=null,C.current="none",v.current=0,y.current=!1,X(!1)};return document.addEventListener("touchstart",se,{passive:!0}),document.addEventListener("touchmove",Se,{passive:!1}),document.addEventListener("touchend",Me),document.addEventListener("touchcancel",Me),()=>{document.removeEventListener("touchstart",se),document.removeEventListener("touchmove",Se),document.removeEventListener("touchend",Me),document.removeEventListener("touchcancel",Me),ue()}},[I,t.length,d,l,A,z,ce]),s.useEffect(()=>{const ie=ue=>{ue.key==="Escape"&&(ue.preventDefault(),ue.stopPropagation(),I!=="closing"&&B("closing"))};return window.addEventListener("keydown",ie,!0),()=>window.removeEventListener("keydown",ie,!0)},[I]);const ee=()=>{I!=="closing"&&B("closing")},xe=I==="open",Fe=I==="closing",ye=$>0?Math.max(0,1-$/500):1,b=$>0?Math.max(.35,1-$/500):1,M=ie=>{if(ie.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const ue=ie.currentTarget.getBoundingClientRect(),fe=ie.clientY-ue.top,K=Math.min(52,ue.height*.2);if(!(fe>ue.height-K)){if(ie.clientX-ue.left<ue.width/2){l();return}d()}},E=ie=>{if(t.length<=1)return;const ue=ie.currentTarget.getBoundingClientRect(),fe=ie.clientX-ue.left,K=ie.clientY-ue.top,Z=Math.min(52,ue.height*.2);if(K>ue.height-Z){ie.currentTarget.style.cursor="default";return}ie.currentTarget.style.cursor=fe<ue.width/2?"w-resize":"e-resize"},j=s.useCallback(ie=>{ie.propertyName!=="transform"||!V.current||(ce(),A(!1))},[ce,A]),Ce=ae?`translateX(${k}px)`:$>0?`translateY(${$}px)`:void 0,Q={position:"fixed",top:q==null?void 0:q.top,left:q==null?void 0:q.left,width:q==null?void 0:q.width,height:q==null?void 0:q.height,objectFit:i==="cover"?"cover":"contain",transform:Ce,opacity:$>0?b:I==="opening"||Fe?0:1,transition:P&&!g?"none":g?`transform ${An}ms ${xi}`:te?`transform ${An}ms ${xi}, opacity ${An}ms ${xi}`:I==="opening"||Fe?`opacity ${An}ms ${xi}`:"none",pointerEvents:de&&xe&&!ae?"auto":"none",touchAction:de&&xe?"none":void 0,zIndex:9998},Te=q?{position:"fixed",top:q.top,height:q.height,width:q.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:ee,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:xe?ye: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:xe?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:xe?1:0,transition:`opacity ${An}ms ${xi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),q&&U&&(de?a.jsx(Tb,{src:U.url,phase:I,mediaRef:m,mediaStyle:Q,onLoadedMetadata:re,onClick:M,onMouseMove:E,onTransitionEnd:j},`${n}-${U.url}`):a.jsx("img",{ref:m,src:U.url,alt:U.name,onLoad:re,onTransitionEnd:j,style:Q},`${n}-${U.url}`)),xe&&Te&&t.length>1&&!de&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Te,left:q.left,cursor:"w-resize",pointerEvents:ae?"none":"auto"},onClick:ie=>{if(S.current){S.current=!1;return}ie.stopPropagation(),l()}}),a.jsx("div",{style:{...Te,left:q.left+q.width/2,cursor:"e-resize",pointerEvents:ae?"none":"auto"},onClick:ie=>{if(S.current){S.current=!1;return}ie.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=Cb(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},N={className:x,style:S,onClick:p?I=>{I.stopPropagation(),p()}:void 0},q=Math.max(d,vi),W=us(t)?a.jsx("video",{...N,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...N,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[w?a.jsx("div",{style:y,children:W}):W,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(q)}})]})}function Rb({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 Lb(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 Pb(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 Eb(e,t,n){const{top:i,centerY:o}=Pb(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 Mb(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=Eb(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 kb(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(Mb(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 Ab(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 Fb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var nt;const{prefix:l}=D.useScopedStyles(),d=s.useMemo(()=>cb(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)??wb,m=Sb(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??sb,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=Lb(e==null?void 0:e.transition),V=(e==null?void 0:e.lightbox)??"on",N=p==="b",q=S==="fade"||S==="retype",{setTitleRef:W,dominantIndex:I}=kb(c.length,q,f),B=((nt=c[I])==null?void 0:nt.title)??"",$=Ab(B,S==="retype"),T=S==="fade"||S==="retype",k=S==="retype"?$:B,F=N?void 0:{width:D.scalingValue(x,n??!1)},g=V==="on"&&(!n||i||o),O=o??!1,P=(e==null?void 0:e.galleryPaddingRight)??0,X=(e==null?void 0:e.galleryPaddingLeft)??0,te=(e==null?void 0:e.galleryPaddingBetween)??0,L=it=>D.scalingValue(it,n??!1),U={width:L(w)},de=p==="a"?P:X,ae=N?{width:"100%"}:{width:`calc(100% - ${L(x)} - ${L(de)})`,...p==="c"?{marginLeft:"auto"}:{}},A=Math.max(P,vi),ce=Math.max(X,vi),z=Math.max(te,vi),re=Math.max(v,vi),ee=Math.max(C,vi),xe=Math.max(y,vi),Fe=Math.max(0,(u??1)-(x??Oi)),ye=p==="a"?Math.max(0,(u??1)-(x??Oi)-P):p==="c"?Math.max(0,(u??1)-(x??Oi)-X):p==="b"?u??1:1,b=O&&(p==="a"||p==="b"||p==="c")&&f==="top",M=O&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),E=O&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),j=c.length>1,Ce=N?void 0:L((p==="c"?X:P)+(x??Oi)),Q=p==="c"&&Ce?{left:Ce}:void 0,Te=p==="a"&&Ce?{right:Ce}:void 0,ie=N?{left:0,width:"100%"}:p==="a"?{right:L(P),width:L(x)}:{left:L(X),width:L(x)},{titleColor:ue,titleFontFamily:fe,titleFontSettings:K,titleFontSize:Z,titleLineHeight:se,titleLetterSpacing:Se,titleWordSpacing:Me,titleAlign:$e,titleTextAppearance:G,lightboxCounterColor:pe,lightboxCounterFontFamily:oe,lightboxCounterFontSettings:Y,lightboxCounterFontSize:le,lightboxCounterLineHeight:_e,lightboxCounterLetterSpacing:me,lightboxCounterWordSpacing:J,lightboxCounterTextAppearance:Ke}=e??{},ke={fontSettings:{fontFamily:fe,fontWeight:(K==null?void 0:K.fontWeight)??400,fontStyle:(K==null?void 0:K.fontStyle)??"normal"},fontSize:Z??.01,lineHeight:se,letterSpacing:Se??0,wordSpacing:Me??0,textAlign:$e??"left",textAppearance:G,color:ue??"#000000"},Ye=an(Ut(ke,n)),dt=U,ot=vc(Z,se,l,n),Ve=xc(Z,se,`${l}-title`,`${l}-text-tight-leading`),Re={fontSettings:{fontFamily:oe,fontWeight:(Y==null?void 0:Y.fontWeight)??400,fontStyle:(Y==null?void 0:Y.fontStyle)??"normal"},fontSize:le??.01,lineHeight:_e,letterSpacing:me??0,wordSpacing:J??0,textAppearance:Ke,color:pe??"#DEDDDD"},Be={...an(Ut(Re,n)),...vc(le,_e,l,n)},Ze=xc(le,_e,`${l}-lightbox-counter`,`${l}-text-tight-leading`),he=D.buildColorVars(l,{titleColor:ue??"#000000",lightboxCounterColor:pe??"#DEDDDD"},mb,gb),ve=s.useRef(null),[We,Je]=s.useState(!1),[be,Ie]=s.useState([]),[qe,ze]=s.useState(0),Le=s.useCallback((it,ct)=>{g&&(Ie(it),ze(ct),Je(!0))},[g]),Ge=s.useCallback(()=>{Je(!1)},[]),De=s.useMemo(()=>{const it={...he},ct=ve.current?getComputedStyle(ve.current).getPropertyValue("--cntrl-article-width").trim():"";return ct&&(it["--cntrl-article-width"]=ct),it},[he,We]);return s.useEffect(()=>{if(!We||V!=="on"||typeof document>"u")return;const it=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=it}},[We,V]),s.useEffect(()=>{!n||o||i||Je(!1)},[n,o,i]),s.useEffect(()=>{V==="off"&&Je(!1)},[V]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:he,children:a.jsxs("div",{ref:ve,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:k,position:f,titleRef:()=>{},titleClassName:`${Ve} ${l}-single-title`,titleContainerStyle:{...ot,...ae},titleTextBoxStyle:dt,titleStyle:Ye,showTextBoxOutline:O,topPaddingControl:b?wc({P:l,scaled:L,height:re,paired:!1}):void 0})}),c.map((it,ct)=>{const St=xb(it.gallery),Bt=ct<c.length-1,zt=St.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),ft={P:l,position:f,titleRef:W(ct),titleClassName:Ve,titleContainerStyle:ot,titleTextBoxStyle:T?{maxWidth:"100%"}:dt,titleStyle:Ye,showTextBoxOutline:O&&!T,topPaddingControl:b&&!T?wc({P:l,scaled:L,height:re,paired:j}):void 0};return a.jsxs("div",{"data-item-index":ct,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Bt?L(te):void 0},children:[M&&Sc({P:l,controlKey:"titleLeftPadding",scaled:L,width:ee,maxFraction:ye,side:"left",paired:j,anchorStyle:Q}),E&&Sc({P:l,controlKey:"titleRightPadding",scaled:L,width:xe,maxFraction:ye,side:"right",paired:j,anchorStyle:Te}),O&&Bt&&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(z),...ie}}),N?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:St.map(({displayMedia:wt,lightboxMedia:jt},At)=>{const vt=jt?zt.findIndex(Ft=>Ft.url===jt.url):-1;return a.jsx(bc,{P:l,media:wt,imgWidth:x||void 0,cornerRadius:h||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:te,showPaddingAfter:At<St.length-1,showControls:O,onMediaClick:g&&vt>=0?()=>Le(zt,vt):void 0},`${wt.url}-${At}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Va,{...ft,title:T?"":it.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Va,{...ft,title:T?"":it.title}),St.length>0&&a.jsx(Rb,{P:l,layoutType:p,galleryWidthStyle:F,galleryPaddingRight:P,galleryPaddingLeft:X,galleryPaddingRightWidth:A,galleryPaddingLeftWidth:ce,galleryPaddingMaxFraction:Fe,showControls:O,scaled:L,children:St.map(({displayMedia:wt,lightboxMedia:jt},At)=>{const vt=jt?zt.findIndex(Ft=>Ft.url===jt.url):-1;return a.jsx(bc,{P:l,media:wt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:te,showPaddingAfter:At<St.length-1,showControls:O,onMediaClick:g&&vt>=0?()=>Le(zt,vt):void 0},`${wt.url}-${At}`)})})]})]},ct)})]})}),We&&V==="on"&&typeof document<"u"&&e&&(()=>{const it=(r?document.getElementById(r):null)??document.body;return zn.createPortal(a.jsx("div",{style:De,"data-selection":"none",children:a.jsx(Ib,{prefix:l,items:be,index:qe,imageDisplay:$b(e.lightboxImageDisplay),isEditor:n,onClose:Ge,onPrev:()=>ze(ct=>(ct-1+be.length)%be.length),onNext:()=>ze(ct=>(ct+1)%be.length),counterClassName:Ze,counterStyle:Be,backgroundColor:e.backgroundColor??db})}),it)})()]})}const _b=`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';
@@ -23059,10 +23059,10 @@ export function Mercury({
23059
23059
  object-position: center;
23060
23060
  }
23061
23061
  ${t}
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 tw(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 nw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function iw(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 ou(e,t){return(1-e)/(1-e*Math.cos(t))}function ow(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)*ou(e,i)))}return t||1}function rw(e,t){return e?1:1+iu*(.35+t)}function aw(e,t,n,i){const o=t*rw(n,i);return Math.max(0,(e-o)/2)}function ru(e,t,n){const i=ou(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function au(e,t,n){return e/2+t*n}function sw(e,t,n){return e(t-n/2)}function lw(e,t){return e*t}function su(e){return Math.round(e*1e3)}function lu(e,t,n){const i=Math.cos(e),o=Math.cos(Qb*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return er(t+(n-t)*r)}function cu(e){return lu(e,Ub,Kb)}function cw(e){return lu(e,Zb,Jb)}function du(e,t){if(!t)return"none";const n=cw(e);return n<=0?"none":`blur(${n}px)`}function dw(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=ru(i,o,r*Math.PI*2),p=r*Math.PI*2,x=au(t,n,c),b=er(u),m=`calc(${e(x)} - var(--helix-base-w) * ${b} / 2)`,h=`calc(var(--helix-base-w) * ${b})`,f=l?`height: calc(var(--helix-base-h) * ${b});`:"";return`left: ${m}; width: ${h}; ${f} z-index: ${su(u)}; transform: translateY(-50%); opacity: ${cu(p)}; filter: ${du(p,d)};`}function uw(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)}% { ${dw(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
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 tw(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 nw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function iw(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 ou(e,t){return(1-e)/(1-e*Math.cos(t))}function ow(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)*ou(e,i)))}return t||1}function rw(e,t){return e?1:1+iu*(.35+t)}function aw(e,t,n,i){const o=t*rw(n,i);return Math.max(0,(e-o)/2)}function ru(e,t,n){const i=ou(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function au(e,t,n){return e/2+t*n}function sw(e,t,n){return e(t-n/2)}function lw(e,t){return e*t}function su(e){return Math.round(e*1e3)}function lu(e,t,n){const i=Math.cos(e),o=Math.cos(Qb*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return er(t+(n-t)*r)}function cu(e){return lu(e,Ub,Kb)}function cw(e){return lu(e,Zb,Jb)}function du(e,t){if(!t)return"none";const n=cw(e);return n<=0?"none":`blur(${n}px)`}function dw(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=ru(i,o,r*Math.PI*2),p=r*Math.PI*2,x=au(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: ${su(u)}; transform: translateY(-50%); opacity: ${cu(p)}; filter: ${du(p,d)};`}function uw(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)}% { ${dw(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
23063
23063
  ${c.join(`
23064
23064
  `)}
23065
- }`}function uu(e,t){return(e%t+t)%t}function pw(e,t){return tl(e,t)/t}function tl(e,t){return uu(e,t)}function mw(e,t){return Math.floor(e/t)}function gw(e,t,n,i){return mw(e,t)*n+tl(e,t)*i}function hw(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 pu(e){const t=e%1;return t<0?t+1:t}function fw(e,t,n){const i=t/nu,o=n==="left"?-e*i:e*i;return pu(o)}function yw({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),Bb),d=Xa(e==null?void 0:e.imageWidth,zb),c=Xa(e==null?void 0:e.turnHeight,jb),u=Ic(e==null?void 0:e.itemsPerTurn,Vb,3,40),p=Ic(e==null?void 0:e.turns,Gb,1,30),x=Math.min(qb,Math.max(0,Xb)),b=Math.min(1,Math.max(0,Yb)),m=Math.max(0,(e==null?void 0:e.speed)??nu),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(()=>tw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),S=y.display==="cover",V=ae=>D.scalingValue(ae,n??!1),N=s.useMemo(()=>ow(x),[x]),q=s.useMemo(()=>aw(l,d,S,b),[l,d,S,b]),W=s.useMemo(()=>ew(o,uw(o,V,l,q,x,N,S,C)),[o,l,q,x,N,S,C,n]),I=s.useMemo(()=>(t??[]).filter(ae=>{var F;return!!((F=ae.image)!=null&&F.url)}),[t]),B=c/u,$=d*nw(y),T=Math.min(Db,p*u),k=Ob*u,A=T+k*2,O=Math.max(0,p-1)*c+(u-1)*B,P=m>0,X=f==="scroll"&&P,ne=f==="autoplay"&&P&&(n?!!i:!0),[L,H]=s.useState(0);s.useEffect(()=>{if(!X)return;const ae=r.current;if(!ae)return;const F=()=>{const z=ae.getBoundingClientRect(),re=window.innerHeight||document.documentElement.clientHeight,te=re+z.height;te<=0||H(Math.min(1,Math.max(0,(re-z.top)/te)))};F(),window.addEventListener("scroll",F,{passive:!0}),window.addEventListener("resize",F);const ce=new ResizeObserver(F);return ce.observe(ae),()=>{window.removeEventListener("scroll",F),window.removeEventListener("resize",F),ce.disconnect()}},[X]);const U=X?fw(L,m,h):0,de=P&&f==="autoplay"?360/(m*Hb):0;return I.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:W}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:V(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:W}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:V(l),height:V(O),marginInline:"auto"},children:Array.from({length:A},(ae,F)=>{const ce=F-k,re=I[uu(ce,I.length)].image,te=tl(ce,u),ye=pw(ce,u),Fe=X?pu(ye+U):ye,fe=gw(ce,u,c,B),w=b===0?0:(Rc(te+7.3)-.5)*b*B,M=S?1:1+(Rc(te+3.1)-.5)*2*iu*(.35+b),E=Fe*Math.PI*2,{offset:j,scale:Te}=ru(x,N,E),ee=d*M,$e=lw(ee,Te),J=au(l,q,j),me={"--helix-base-w":V(ee),...S?{"--helix-base-h":V($)}:{}},Se={top:V(fe+w),transform:"translateY(-50%)",...me,...ne?{animationDuration:`${er(de)}s`,animationDelay:hw(ye,de,h),animationDirection:h==="left"?"reverse":"normal"}:{left:sw(V,J,$e),width:V($e),...S?{height:V($*Te)}:{},zIndex:su(Te),opacity:cu(E),filter:du(E,C)}},K=v>0?{borderRadius:V(v)}:{},Z=S?{...K,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:K,se=iw(re)?a.jsx("video",{className:`${o}-media`,style:Z,src:re.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:Z,src:re.url,alt:re.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:ne?`${o}-item`:`${o}-item ${o}-item-static`,style:Se,children:S?a.jsx("div",{className:`${o}-cover`,style:K,children:se}):se},`${p}-${u}-${ce}`)})})]})}const xw=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
23065
+ }`}function uu(e,t){return(e%t+t)%t}function pw(e,t){return tl(e,t)/t}function tl(e,t){return uu(e,t)}function mw(e,t){return Math.floor(e/t)}function gw(e,t,n,i){return mw(e,t)*n+tl(e,t)*i}function hw(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 pu(e){const t=e%1;return t<0?t+1:t}function fw(e,t,n){const i=t/nu,o=n==="left"?-e*i:e*i;return pu(o)}function yw({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),Bb),d=Xa(e==null?void 0:e.imageWidth,zb),c=Xa(e==null?void 0:e.turnHeight,jb),u=Ic(e==null?void 0:e.itemsPerTurn,Vb,3,40),p=Ic(e==null?void 0:e.turns,Gb,1,30),x=Math.min(qb,Math.max(0,Xb)),w=Math.min(1,Math.max(0,Yb)),m=Math.max(0,(e==null?void 0:e.speed)??nu),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(()=>tw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),S=y.display==="cover",V=ae=>D.scalingValue(ae,n??!1),N=s.useMemo(()=>ow(x),[x]),q=s.useMemo(()=>aw(l,d,S,w),[l,d,S,w]),W=s.useMemo(()=>ew(o,uw(o,V,l,q,x,N,S,C)),[o,l,q,x,N,S,C,n]),I=s.useMemo(()=>(t??[]).filter(ae=>{var A;return!!((A=ae.image)!=null&&A.url)}),[t]),B=c/u,$=d*nw(y),T=Math.min(Db,p*u),k=Ob*u,F=T+k*2,O=Math.max(0,p-1)*c+(u-1)*B,P=m>0,X=f==="scroll"&&P,te=f==="autoplay"&&P&&(n?!!i:!0),[L,H]=s.useState(0);s.useEffect(()=>{if(!X)return;const ae=r.current;if(!ae)return;const A=()=>{const z=ae.getBoundingClientRect(),re=window.innerHeight||document.documentElement.clientHeight,ee=re+z.height;ee<=0||H(Math.min(1,Math.max(0,(re-z.top)/ee)))};A(),window.addEventListener("scroll",A,{passive:!0}),window.addEventListener("resize",A);const ce=new ResizeObserver(A);return ce.observe(ae),()=>{window.removeEventListener("scroll",A),window.removeEventListener("resize",A),ce.disconnect()}},[X]);const U=X?fw(L,m,h):0,de=P&&f==="autoplay"?360/(m*Hb):0;return I.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:W}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:V(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:W}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:V(l),height:V(O),marginInline:"auto"},children:Array.from({length:F},(ae,A)=>{const ce=A-k,re=I[uu(ce,I.length)].image,ee=tl(ce,u),xe=pw(ce,u),Fe=X?pu(xe+U):xe,ye=gw(ce,u,c,B),b=w===0?0:(Rc(ee+7.3)-.5)*w*B,M=S?1:1+(Rc(ee+3.1)-.5)*2*iu*(.35+w),E=Fe*Math.PI*2,{offset:j,scale:Ce}=ru(x,N,E),Q=d*M,Te=lw(Q,Ce),ie=au(l,q,j),ue={"--helix-base-w":V(Q),...S?{"--helix-base-h":V($)}:{}},fe={top:V(ye+b),transform:"translateY(-50%)",...ue,...te?{animationDuration:`${er(de)}s`,animationDelay:hw(xe,de,h),animationDirection:h==="left"?"reverse":"normal"}:{left:sw(V,ie,Te),width:V(Te),...S?{height:V($*Ce)}:{},zIndex:su(Ce),opacity:cu(E),filter:du(E,C)}},K=v>0?{borderRadius:V(v)}:{},Z=S?{...K,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:K,se=iw(re)?a.jsx("video",{className:`${o}-media`,style:Z,src:re.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:Z,src:re.url,alt:re.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:te?`${o}-item`:`${o}-item ${o}-item-static`,style:fe,children:S?a.jsx("div",{className:`${o}-cover`,style:K,children:se}):se},`${p}-${u}-${ce}`)})})]})}const xw=`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
- `,vw=["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"],bw={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:vw.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"]}]}]},ww={element:yw,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:bw,sourceCode:xw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Cr=typeof window>"u"?s.useEffect:s.useLayoutEffect,jo=120,Lc=3,Sw=.12,Ya=.25,Cw=10,$w=4e3,Tw=.12,Iw=3,Rw=3,mu=["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 Lw(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 Pw(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 gu={x:0,y:0,width:100,height:100};function Ew(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?gu:{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,Mw=12,kw=16,Xr="0 0 100 100",Yr=100,Ua=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Aw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function Fw(e){const t=e.match(Aw);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 _w(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(_w)}))}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 Nw(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),b=(e.x-l.x)/2,m=(e.y-l.y)/2,h=p*b+x*m,f=-x*b+p*m,v=h*h/(d*d)+f*f/(c*c);if(v>1){const ne=Math.sqrt(v);d*=ne,c*=ne}const C=o===r?-1:1,y=d*d*f*f+c*c*h*h,S=Math.max(0,d*d*c*c-y),V=y===0?0:C*Math.sqrt(S/y),N=V*d*f/c,q=-V*c*h/d,W=p*N-x*q+(e.x+l.x)/2,I=x*N+p*q+(e.y+l.y)/2,B=Math.atan2((f-q)/c,(h-N)/d);let T=Math.atan2((-f-q)/c,(-h-N)/d)-B;!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))),A=T/k,g=4/3*Math.tan(A/4),O=(ne,L)=>({x:W+p*d*ne-x*c*L,y:I+x*d*ne+p*c*L}),P=[];let X=B;for(let ne=0;ne<k;ne+=1){const L=X+A,H=Math.cos(X),U=Math.sin(X),de=Math.cos(L),ae=Math.sin(L);P.push({c1:O(H-g*U,U+g*H),c2:O(de+g*ae,ae-g*de),p:ne===k-1?on(l):O(de,ae)}),X=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 b=Ua.exec(t);for(;b!==null;){const m=b[1],h=m.toUpperCase(),f=m!==h,v=Fw(b[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),V=C(y+2),N=C(y+4);x(S),p(N,V),d=V}c=null}else if(h==="S"){for(let y=0;y+3<v.length;y+=4){const S=d?gs(d,r):on(r),V=C(y),N=C(y+2);x(S),p(N,V),d=V}c=null}else if(h==="Q")for(let y=0;y+3<v.length;y+=4){const S=C(y),V=C(y+2);x(gn(r,S,2/3)),p(V,gn(V,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),V=C(y);x(gn(r,S,2/3)),p(V,gn(V,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 V of Nw(r,v[y],v[y+1],v[y+2],v[y+3]!==0,v[y+4]!==0,S))x(V.c1),p(V.p,V.c2);d=null,c=null}b=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 hu(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 hu(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 Ww(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 fu(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 yu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Mw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/kw)),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),...fu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Hw(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 xu(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 Dw(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 Ow(e,t=1,n){const i=Hw(n),o=ps(e==="custom"?"rectangle":e,t),r=Dw(ti(yu(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 Bw(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 zw(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=vu(i,r,d)}),i}function jw(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 Vw(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 Gw(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,b=gn(r.p,p,i),m=gn(p,x,i),h=gn(x,l.p,i),f=gn(b,m,i),v=gn(m,h,i),C=gn(f,v,i),y=(n+1)%o.nodes.length;return c[n].out=b,c[y].in=h,c.splice(u,0,{p:C,in:f,out:v}),{contours:d,nodeIndex:u}}function vu(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=fu(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Xw(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 Yw(e,t){let n=null;return e.forEach((i,o)=>{for(const r of hu(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=Xw(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 qw(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,Uw=8,Kw=Math.PI/18,Zw=8,zi=24,ji=[];function Jw(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 Qw(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 eS(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 eS(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 tS(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 nS(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 iS(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 b=Math.atan2(p,u),m=Math.round(b/_c)*_c;let h=o?m:null,f=!1;if(!o){const q=[];n&&q.push({angle:Math.atan2(n.y,n.x),smooth:!0}),q.push({angle:m,smooth:!1});for(const W of q){const I=Qw(W.angle-b);if(!(Math.abs(I)>Kw)&&!(Math.abs(Math.sin(I))*x>Uw)){h=W.angle,f=W.smooth;break}}}const v=i!==null&&i>0&&Math.abs(x-i)<=Zw;if(h===null&&!v)return{point:e,guides:ji};const C=h??b,y=v?i:x,S={x:Math.cos(C),y:Math.sin(C)},V=y+(h===null?0:zi),N=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*N,y:d.y-S.y*N},b:{x:d.x+S.x*V,y:d.y+S.y*V}}]}}function Wc(e,t="stretch",n=gu){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 b=document.createElementNS("http://www.w3.org/2000/svg","path");b.setAttribute("d",x),u.appendChild(b);let m=0;try{m=b.getTotalLength()}catch{m=0}if(!m)continue;const h=[];for(let f=0;f<jo;f+=1){const v=b.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 oS(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 rS(i)}function rS(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 aS(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 sS(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 lS(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 cS(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=oS(e,l),c=i==="avoid"?sS(d):d;if(o=o===null?c:aS(o,c),o.length===0)return[]}return o??[]}function bu(e){return!!e&&typeof e=="object"&&e.type==="link"}function dS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(bu(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 uS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(bu(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,b=e.lineHeight*l,m=e.spaceWidth*l,h=[];if(!t.length||d<=0||b<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const f=Math.max(1,m*.5),v=b*Sw;let C=0,y=0,S=0,V=t[0].para,N=0,q=0,W=null;for(;C<t.length&&S<$w;){const I=y+b>c;if(I&&!u)break;const B=t[C].para;if(B>V+1){y+=b*(B-V-1),V=B-1,S+=1;continue}let $=I?[{x0:0,x1:d}]:cS(i,(y+v)/c,(y+b-v)/c,o).map(k=>({x0:k.x0*d,x1:k.x1*d}));p>0&&x>0&&!I&&$.length&&(W===null&&(W=S,N=$[0].x0,q=y),S-W<x&&($=lS($,{x0:N,x1:N+p})));const T=$.reduce((k,A)=>Math.max(k,A.x1-A.x0),0);for(const k of $){const A=k.x1-k.x0;if(A<f)continue;if(C>=t.length||t[C].para!==B)break;const g=C;let O=0;for(;C<t.length&&t[C].para===B;){const P=n[C]*l,X=C===g?P:m+P;if(O+X>A&&!(C===g&&A>=T-.5&&P>d-.5))break;O+=X,C+=1}if(C>g){const P=C>=t.length||t[C].para!==B;h.push({top:y,left:k.x0,width:A,from:g,to:C,justify:r==="justify"&&!P})}if(C>=t.length||t[C].para!==B)break}V=B,y+=b,S+=1}return{segments:h,placed:C,height:h.length?y:0,capLeft:N,capTop:q}}function pS(e){return`
23603
+ `,vw=["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"],bw={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:vw.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"]}]}]},ww={element:yw,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:bw,sourceCode:xw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Cr=typeof window>"u"?s.useEffect:s.useLayoutEffect,jo=120,Lc=3,Sw=.12,Ya=.25,Cw=10,$w=4e3,Tw=.12,Iw=3,Rw=3,mu=["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 Lw(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 Pw(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 gu={x:0,y:0,width:100,height:100};function Ew(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?gu:{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,Mw=12,kw=16,Xr="0 0 100 100",Yr=100,Ua=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Aw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function Fw(e){const t=e.match(Aw);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 _w(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(_w)}))}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 Nw(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 te=Math.sqrt(v);d*=te,c*=te}const C=o===r?-1:1,y=d*d*f*f+c*c*h*h,S=Math.max(0,d*d*c*c-y),V=y===0?0:C*Math.sqrt(S/y),N=V*d*f/c,q=-V*c*h/d,W=p*N-x*q+(e.x+l.x)/2,I=x*N+p*q+(e.y+l.y)/2,B=Math.atan2((f-q)/c,(h-N)/d);let T=Math.atan2((-f-q)/c,(-h-N)/d)-B;!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))),F=T/k,g=4/3*Math.tan(F/4),O=(te,L)=>({x:W+p*d*te-x*c*L,y:I+x*d*te+p*c*L}),P=[];let X=B;for(let te=0;te<k;te+=1){const L=X+F,H=Math.cos(X),U=Math.sin(X),de=Math.cos(L),ae=Math.sin(L);P.push({c1:O(H-g*U,U+g*H),c2:O(de+g*ae,ae-g*de),p:te===k-1?on(l):O(de,ae)}),X=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=Fw(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),V=C(y+2),N=C(y+4);x(S),p(N,V),d=V}c=null}else if(h==="S"){for(let y=0;y+3<v.length;y+=4){const S=d?gs(d,r):on(r),V=C(y),N=C(y+2);x(S),p(N,V),d=V}c=null}else if(h==="Q")for(let y=0;y+3<v.length;y+=4){const S=C(y),V=C(y+2);x(gn(r,S,2/3)),p(V,gn(V,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),V=C(y);x(gn(r,S,2/3)),p(V,gn(V,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 V of Nw(r,v[y],v[y+1],v[y+2],v[y+3]!==0,v[y+4]!==0,S))x(V.c1),p(V.p,V.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 hu(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 hu(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 Ww(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 fu(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 yu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Mw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/kw)),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),...fu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Hw(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 xu(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 Dw(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 Ow(e,t=1,n){const i=Hw(n),o=ps(e==="custom"?"rectangle":e,t),r=Dw(ti(yu(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 Bw(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 zw(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=vu(i,r,d)}),i}function jw(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 Vw(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 Gw(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 vu(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=fu(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Xw(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 Yw(e,t){let n=null;return e.forEach((i,o)=>{for(const r of hu(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=Xw(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 qw(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,Uw=8,Kw=Math.PI/18,Zw=8,zi=24,ji=[];function Jw(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 Qw(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 eS(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 eS(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 tS(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 nS(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 iS(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 q=[];n&&q.push({angle:Math.atan2(n.y,n.x),smooth:!0}),q.push({angle:m,smooth:!1});for(const W of q){const I=Qw(W.angle-w);if(!(Math.abs(I)>Kw)&&!(Math.abs(Math.sin(I))*x>Uw)){h=W.angle,f=W.smooth;break}}}const v=i!==null&&i>0&&Math.abs(x-i)<=Zw;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)},V=y+(h===null?0:zi),N=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*N,y:d.y-S.y*N},b:{x:d.x+S.x*V,y:d.y+S.y*V}}]}}function Wc(e,t="stretch",n=gu){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 oS(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 rS(i)}function rS(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 aS(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 sS(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 lS(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 cS(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=oS(e,l),c=i==="avoid"?sS(d):d;if(o=o===null?c:aS(o,c),o.length===0)return[]}return o??[]}function bu(e){return!!e&&typeof e=="object"&&e.type==="link"}function dS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(bu(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 uS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(bu(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*Sw;let C=0,y=0,S=0,V=t[0].para,N=0,q=0,W=null;for(;C<t.length&&S<$w;){const I=y+w>c;if(I&&!u)break;const B=t[C].para;if(B>V+1){y+=w*(B-V-1),V=B-1,S+=1;continue}let $=I?[{x0:0,x1:d}]:cS(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&&(W===null&&(W=S,N=$[0].x0,q=y),S-W<x&&($=lS($,{x0:N,x1:N+p})));const T=$.reduce((k,F)=>Math.max(k,F.x1-F.x0),0);for(const k of $){const F=k.x1-k.x0;if(F<f)continue;if(C>=t.length||t[C].para!==B)break;const g=C;let O=0;for(;C<t.length&&t[C].para===B;){const P=n[C]*l,X=C===g?P:m+P;if(O+X>F&&!(C===g&&F>=T-.5&&P>d-.5))break;O+=X,C+=1}if(C>g){const P=C>=t.length||t[C].para!==B;h.push({top:y,left:k.x0,width:F,from:g,to:C,justify:r==="justify"&&!P})}if(C>=t.length||t[C].para!==B)break}V=B,y+=w,S+=1}return{segments:h,placed:C,height:h.length?y:0,capLeft:N,capTop:q}}function pS(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,mS=3.5,Co=9,Qn=8,ei=14,Oc=10,gS=24,Tr=14,hS=1,fS=.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 wu(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,yS=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)<yS?.5:Gr(n/i)}function xS(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)),b=Si(t,n,x);return{focalX:Vi(t.width,b.width,d-t.x),focalY:Vi(t.height,b.height,c-t.y),scale:x}}function vS({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),b=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([]),[V,N]=s.useState(ji),q=s.useCallback(w=>{N(M=>Jw(M,w)?M:w)},[]),W=l==="shape";s.useEffect(()=>{var w;W&&((w=x.current)==null||w.focus({preventScroll:!0}))},[W]),s.useEffect(()=>{W||S(w=>w.length?[]:w)},[W]);const I=y.length>0;s.useEffect(()=>{c==null||c(I)},[I,c]),s.useEffect(()=>()=>c==null?void 0:c(!1),[c]);const B=n.width>0?t.width/n.width:1,$=n.height>0?t.height/n.height:1,T=s.useCallback(w=>r?{x:(w.x-n.x)*B,y:(w.y-n.y)*$}:{x:w.x-n.x,y:w.y-n.y},[r,n,B,$]),k=s.useCallback(w=>r?{x:n.x+(B>0?w.x/B:0),y:n.y+($>0?w.y/$:0)}:{x:n.x+w.x,y:n.y+w.y},[r,n,B,$]),A=s.useMemo(()=>k({x:t.width/2,y:t.height/2}),[k,t.width,t.height]),g=s.useCallback((w,M)=>{var j;const E=(j=x.current)==null?void 0:j.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:r?{x:n.x+(w-E.left)/E.width*n.width,y:n.y+(M-E.top)/E.height*n.height}:{x:n.x+(w-E.left),y:n.y+(M-E.top)}},[r,n]),O=s.useCallback((w,M)=>{var j;const E=(j=x.current)==null?void 0:j.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:{x:(w-E.left)/E.width*t.width,y:(M-E.top)/E.height*t.height}},[t.width,t.height]),P=s.useCallback((w,M)=>{p(w,M)},[p]),X=w=>{var Ce;const M=w.metaKey||w.ctrlKey,E=v.current;if(E&&w.pointerId===E.pointerId){if(w.stopPropagation(),w.preventDefault(),E.startDistance<=0)return;const G=g(w.clientX,w.clientY),ue=Math.hypot(G.x-E.origin.x,G.y-E.origin.y),oe=Math.max(fS,ue/E.startDistance);if(!E.moved&&Math.abs(oe-1)<1e-4)return;E.moved=!0,u(Pc(E.startContours,E.origin,oe));return}const j=f.current;if(j&&w.pointerId===j.pointerId){w.stopPropagation(),w.preventDefault();const G=g(w.clientX,w.clientY),{bbox:ue}=j,oe=ue.maxX-ue.minX,Y=ue.maxY-ue.minY,le=G.x-j.origin.x,_e=G.y-j.origin.y;let pe=le,Q=_e;if(isFinite(oe)&&isFinite(Y))if(r){const ke=Math.min(n.x,n.x+n.width-oe),tt=Math.max(n.x,n.x+n.width-oe),Ye=Math.min(n.y,n.y+n.height-Y),dt=Math.max(n.y,n.y+n.height-Y),ot=Math.min(tt,Math.max(ke,ue.minX+le)),Ve=Math.min(dt,Math.max(Ye,ue.minY+_e));pe=ot-ue.minX,Q=Ve-ue.minY}else{const ke=ue.minX-n.x,tt=ue.minY-n.y,Ye=Math.min(0,t.width-oe),dt=Math.max(0,t.width-oe),ot=Math.min(0,t.height-Y),Ve=Math.max(0,t.height-Y),Re=Math.min(dt,Math.max(Ye,ke+le)),He=Math.min(Ve,Math.max(ot,tt+_e));pe=Re-ke,Q=He-tt}const Ke=[];if(!M&&isFinite(oe)&&isFinite(Y)){const ke=T({x:ue.minX+oe/2+pe,y:ue.minY+Y/2+Q}),tt={x:t.width/2,y:t.height/2};Math.abs(ke.x-tt.x)<=Tr&&(pe=A.x-ue.minX-oe/2,Ke.push(ys(tt.x,"x",t))),Math.abs(ke.y-tt.y)<=Tr&&(Q=A.y-ue.minY-Y/2,Ke.push(ys(tt.y,"y",t)))}if(!j.moved&&pe===0&&Q===0)return;j.moved=!0,q(Ke.length?Ke:ji),u(ti(j.startContours,ke=>({x:ke.x+pe,y:ke.y+Q})),{carryImage:!0});return}const Te=C.current;if(Te&&w.pointerId===Te.pointerId){w.stopPropagation(),w.preventDefault();const G=g(w.clientX,w.clientY);let ue=G.x-Te.origin.x,oe=G.y-Te.origin.y;if(w.shiftKey&&(Math.abs(ue)>Math.abs(oe)?oe=0:ue=0),!Te.moved&&ue===0&&oe===0)return;Te.moved=!0,u(Mc(Te.startContours,Te.selection,ue,oe));return}const ee=h.current;if(!ee||w.pointerId!==ee.pointerId)return;w.stopPropagation(),w.preventDefault();const $e=g(w.clientX,w.clientY);if(ee.kind==="anchor"){const G={x:ee.anchor.x+($e.x-ee.origin.x),y:ee.anchor.y+($e.y-ee.origin.y)},ue=M?[]:qw(m.current,{contour:ee.contour,node:ee.node}),oe=M?[]:[ee.center,A].filter(Boolean),Y=Fc(Ac(ue,oe.map(pe=>pe.x),"x"),G,"x",T,Tr),le=Fc(Ac(ue,oe.map(pe=>pe.y),"y"),G,"y",T,Tr),_e=M?G:{x:(Y==null?void 0:Y.value)??$r(G.x,o),y:(le==null?void 0:le.value)??$r(G.y,o)};if(w.shiftKey&&(Math.abs(_e.x-ee.anchor.x)>Math.abs(_e.y-ee.anchor.y)?_e.y=ee.anchor.y:_e.x=ee.anchor.x),!ee.moved&&_e.x===ee.anchor.x&&_e.y===ee.anchor.y)return;ee.moved=!0,q(tS(_e,Y,le,t,T)),u(Bw(m.current,ee.contour,ee.node,_e));return}const J=(Ce=m.current[ee.contour])==null?void 0:Ce.nodes[ee.node],me=ee.mirror&&!w.altKey,Se=me||M?null:ee.kind==="in"?J==null?void 0:J.out:J==null?void 0:J.in,K=J?T(J.p):null,Z=Se?T(Se):null,se=J&&(!M||w.shiftKey)?iS($e,J.p,me||M?null:nS(m.current[ee.contour],ee.node,ee.kind,T),K&&Z?Math.hypot(Z.x-K.x,Z.y-K.y):null,w.shiftKey,T,k):{point:$e,guides:ji},we=se.guides.length?se.point:M?$e:{x:$r($e.x,o),y:$r($e.y,o)},Me=ee.kind==="in"?J==null?void 0:J.in:J==null?void 0:J.out;!ee.moved&&Me&&we.x===Me.x&&we.y===Me.y||(ee.moved=!0,q(se.guides),u(jw(m.current,ee.contour,ee.node,ee.kind,we,me)))},ne=w=>{q(ji);const M=v.current;if(M&&w.pointerId===M.pointerId){v.current=null,w.stopPropagation();const J=x.current;J!=null&&J.hasPointerCapture(M.pointerId)&&J.releasePointerCapture(M.pointerId),M.moved&&P(m.current,{preserveShape:!0});return}const E=f.current;if(E&&w.pointerId===E.pointerId){f.current=null,w.stopPropagation();const J=x.current;J!=null&&J.hasPointerCapture(E.pointerId)&&J.releasePointerCapture(E.pointerId),E.moved?P(m.current,{preserveShape:!0}):S([]);return}const j=C.current;if(j&&w.pointerId===j.pointerId){C.current=null,w.stopPropagation();const J=x.current;J!=null&&J.hasPointerCapture(j.pointerId)&&J.releasePointerCapture(j.pointerId),j.moved&&P(m.current);return}const Te=h.current;if(!Te||w.pointerId!==Te.pointerId)return;h.current=null,w.stopPropagation();const ee=x.current;if(ee!=null&&ee.hasPointerCapture(Te.pointerId)&&ee.releasePointerCapture(Te.pointerId),Te.moved){P(m.current);return}if(!Te.toggleOnRelease)return;const $e=kc(m.current,Te.contour,Te.node);$e!==m.current&&(u($e),P($e))},L=w=>{w.stopPropagation()},H=w=>{var M,E;w.stopPropagation(),w.preventDefault(),(M=x.current)==null||M.focus({preventScroll:!0}),f.current={pointerId:w.pointerId,origin:g(w.clientX,w.clientY),startContours:Pn(i),bbox:Jn(i),moved:!1},(E=x.current)==null||E.setPointerCapture(w.pointerId)},U=(w,M)=>{var $e,J;w.stopPropagation(),w.preventDefault(),($e=x.current)==null||$e.focus({preventScroll:!0}),S([]),d("shape");const E=Jn(i),j=Ur(E,wu(M)),Te=xs(E,M),ee=Math.hypot(Te.x-j.x,Te.y-j.y);!isFinite(ee)||ee<=0||(v.current={pointerId:w.pointerId,corner:M,origin:j,startDistance:ee,startContours:Pn(i),moved:!1},(J=x.current)==null||J.setPointerCapture(w.pointerId))},de=(w,M,E,j)=>{var $e,J,me,Se;w.stopPropagation(),w.preventDefault(),($e=x.current)==null||$e.focus({preventScroll:!0});const Te=(J=i[E])==null?void 0:J.nodes[j];if(!Te)return;if(w.altKey){const K=M==="anchor"?vu(i,E,j):Vw(i,E,j,M);if(K===i)return;S(M==="anchor"?[]:[{contour:E,node:j}]),u(K),P(K);return}const ee=w.metaKey||w.ctrlKey;if(M==="anchor"&&w.shiftKey&&!ee){S(K=>K.some(Z=>Z.contour===E&&Z.node===j)?K.filter(Z=>!(Z.contour===E&&Z.node===j)):[...K,{contour:E,node:j}]);return}if(M==="anchor"&&!ee&&y.length>1&&y.some(K=>K.contour===E&&K.node===j)){C.current={pointerId:w.pointerId,origin:g(w.clientX,w.clientY),startContours:Pn(i),selection:y,moved:!1},(me=x.current)==null||me.setPointerCapture(w.pointerId);return}S([{contour:E,node:j}]),h.current={kind:M,contour:E,node:j,pointerId:w.pointerId,origin:g(w.clientX,w.clientY),anchor:Te.p,center:Ww(i),mirror:M!=="anchor"&&!!(Te.in&&Te.out),toggleOnRelease:ee,moved:!1},(Se=x.current)==null||Se.setPointerCapture(w.pointerId)},ae=w=>{w.stopPropagation(),w.preventDefault();const M=ti(i,T),E=Yw(M,O(w.clientX,w.clientY));if(!E||E.distance>gS)return;const{contours:j,nodeIndex:Te}=Gw(i,E.contour,E.segment,E.t);Te<0||(S([{contour:E.contour,node:Te}]),u(j),P(j))},F=w=>{if(w.key==="="||w.key==="+"||w.key==="-"||w.key==="_"){w.preventDefault(),w.stopPropagation();const ee=Jn(i);if(!isFinite(ee.minX)||!isFinite(ee.maxX))return;const $e={x:(ee.minX+ee.maxX)/2,y:(ee.minY+ee.maxY)/2},me=w.key==="="||w.key==="+"?qr:1/qr,Se=Pc(i,$e,me);u(Se),P(Se,{preserveShape:!0});return}if(w.key==="Escape"){w.stopPropagation(),S([]),d("none");return}if(!y.length)return;if(w.key==="Backspace"||w.key==="Delete"){w.preventDefault(),w.stopPropagation();const ee=zw(i,y);if(ee===i)return;S([]),u(ee),P(ee);return}const M=o>0?o:hS,E=w.shiftKey?M*10:M,j={ArrowLeft:[-E,0],ArrowRight:[E,0],ArrowUp:[0,-E],ArrowDown:[0,E]}[w.key];if(!j)return;w.preventDefault(),w.stopPropagation();const Te=Mc(i,y,j[0],j[1]);u(Te),P(Te)},ce=s.useMemo(()=>Go(ti(i,T)),[i,T]),z=s.useMemo(()=>Jn(i),[i]),re=T({x:z.minX,y:z.minY}),te={width:T({x:z.maxX,y:z.minY}).x-re.x,height:T({x:z.minX,y:z.maxY}).y-re.y},ye=W&&y.length===0&&isFinite(z.minX)&&isFinite(z.maxX)&&z.maxX>z.minX&&z.maxY>z.minY,Fe=y.length>0||W,fe=Fe;return a.jsxs("svg",{ref:x,className:`${e}-editor${Fe?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:F,onPointerDown:()=>{var w;return(w=x.current)==null?void 0:w.focus({preventScroll:!0})},onPointerMove:X,onPointerUp:ne,onPointerCancel:ne,onLostPointerCapture:ne,"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:ae}),fe&&a.jsx("path",{className:`${e}-editor-hit`,d:ce,onClick:ae}),fe&&a.jsx("path",{className:`${e}-editor-outline`,d:ce}),fe&&V.map((w,M)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${w.kind}`,x1:w.a.x,y1:w.a.y,x2:w.b.x,y2:w.b.y},`${w.kind}-${M}`)),a.jsx("path",{ref:b,className:`${e}-editor-body`,d:ce,fillRule:"evenodd",onPointerDown:H,onClick:ae}),fe&&i.map((w,M)=>w.nodes.map((E,j)=>{const Te=y.some($e=>$e.contour===M&&$e.node===j),ee=T(E.p);return a.jsxs("g",{children:[Te&&y.length===1&&["in","out"].map($e=>{const J=E[$e];if(!J)return null;const me=T(J);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:ee.x,y1:ee.y,x2:me.x,y2:me.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:me.x,cy:me.y,r:mS}),a.jsx("circle",{className:`${e}-editor-grab`,cx:me.x,cy:me.y,r:Co,onPointerDown:Se=>de(Se,$e,M,j),onClick:L})]},$e)}),a.jsx("rect",{className:`${e}-editor-anchor${Te?` ${e}-editor-anchor-selected`:""}`,x:ee.x-So/2,y:ee.y-So/2,width:So,height:So,rx:E.in||E.out?So/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:ee.x-Co,y:ee.y-Co,width:Co*2,height:Co*2,onPointerDown:$e=>de($e,"anchor",M,j),onClick:L,onDoubleClick:$e=>{$e.stopPropagation(),$e.preventDefault();const J=kc(i,M,j);u(J),P(J)}})]},`${M}-${j}`)})),ye&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:re.x,y:re.y,width:te.width,height:te.height}),["nw","ne","se","sw"].map(w=>{const M=T(xs(z,w)),E=w==="ne"||w==="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:j=>U(j,w),onClick:L})]},w)})]})]})}function bS({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:b}){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 A;y&&((A=m.current)==null||A.focus({preventScroll:!0}))},[y]);const S=s.useCallback((A,g)=>{var P;const O=(P=m.current)==null?void 0:P.getBoundingClientRect();return!O||O.width<=0||O.height<=0?{x:0,y:0}:{x:(A-O.left)/O.width*t.width,y:(g-O.top)/O.height*t.height}},[t.width,t.height]),V=A=>{var O,P;if(!i)return;A.stopPropagation(),A.preventDefault(),(O=m.current)==null||O.focus({preventScroll:!0});const g=Si(n,i,p);f.current={pointerId:A.pointerId,origin:S(A.clientX,A.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(A.pointerId)},N=(A,g)=>{var de,ae;if(!i)return;A.stopPropagation(),A.preventDefault(),(de=m.current)==null||de.focus({preventScroll:!0});const O=Si(n,i,p),P=Ln(n.width,O.width,c),X=Ln(n.height,O.height,u),ne={minX:P,minY:X,maxX:P+O.width,maxY:X+O.height},L=Ur(ne,wu(g)),H=Ur(ne,g),U=Math.hypot(H.x-L.x,H.y-L.y);!isFinite(U)||U<=0||(v.current={pointerId:A.pointerId,anchor:L,startDistance:U,startScale:p,startX:P,startY:X,moved:!1},(ae=m.current)==null||ae.setPointerCapture(A.pointerId))},q=A=>{if(!i)return;const g=v.current;if(g&&A.pointerId===g.pointerId){A.stopPropagation(),A.preventDefault();const P=S(A.clientX,A.clientY),X={x:P.x-n.x,y:P.y-n.y},ne=Math.hypot(X.x-g.anchor.x,X.y-g.anchor.y),L=Math.min(bs,Math.max(vs,g.startScale*(ne/g.startDistance)));if(!g.moved&&Math.abs(L-g.startScale)<1e-4)return;g.moved=!0;const H=L/g.startScale,U=g.anchor.x+(g.startX-g.anchor.x)*H,de=g.anchor.y+(g.startY-g.anchor.y)*H,ae=Si(n,i,L);x({focalX:Vi(n.width,ae.width,U),focalY:Vi(n.height,ae.height,de),scale:L});return}const O=f.current;if(O&&A.pointerId===O.pointerId){A.stopPropagation(),A.preventDefault();const P=S(A.clientX,A.clientY),X=P.x-O.origin.x,ne=P.y-O.origin.y;if(!O.moved&&X===0&&ne===0)return;O.moved=!0,x({focalX:Vi(n.width,O.width,O.startX+X),focalY:Vi(n.height,O.height,O.startY+ne),scale:p})}},W=A=>{var P,X;const g=f.current;if(g&&A.pointerId===g.pointerId){f.current=null,A.stopPropagation(),(P=m.current)!=null&&P.hasPointerCapture(g.pointerId)&&m.current.releasePointerCapture(g.pointerId),g.moved&&b(C.current);return}const O=v.current;O&&A.pointerId===O.pointerId&&(v.current=null,A.stopPropagation(),(X=m.current)!=null&&X.hasPointerCapture(O.pointerId)&&m.current.releasePointerCapture(O.pointerId),O.moved&&b(C.current))},I=A=>{if(A.key==="Escape"){A.stopPropagation(),d("none");return}if(A.key==="="||A.key==="+"||A.key==="-"||A.key==="_"){A.preventDefault(),A.stopPropagation();const g=A.key==="="||A.key==="+",O=Math.min(bs,Math.max(vs,p*(g?qr:1/qr))),P={focalX:c,focalY:u,scale:O};x(P),b(P)}},B=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},T=s.useMemo(()=>{const A=i??{width:n.width,height:n.height},g=Si(n,A,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:q,onPointerUp:W,onPointerCancel:W,onLostPointerCapture:W,"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:V}),B.map(A=>{const g=xs(k,A),O=A==="ne"||A==="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${O?` ${e}-editor-scale-grab-nesw`:""}`,x:g.x-ei/2,y:g.y-ei/2,width:ei,height:ei,onPointerDown:P=>N(P,A)})]},A)})]})]})}function wS(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function SS(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 CS(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=wS(e);(!r||!SS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function $S(){return typeof document>"u"?null:document.body}function TS({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:b,dropCapSize:m,showGuides:h,typography:f,imageUrl:v,imageFocalX:C,imageFocalY:y,imageScale:S,imageCustomPath:V,pathDragActive:N,pathCarryImage:q,onCarryImageConsumed:W,pathEditor:I,imageEditor:B}){var We,Je;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[T,k]=s.useState(null),A=s.useRef(null),[g,O]=s.useState({width:0,height:0}),[P,X]=s.useState(null),[ne,L]=s.useState(0),[H,U]=s.useState("none");s.useEffect(()=>{!I&&!B&&U("none")},[I,B]);const[de,ae]=s.useState(null);s.useEffect(()=>{if(!v||typeof Image>"u"){ae(null);return}let ve=!1;const Ie=new Image;return Ie.onload=()=>{ve||ae({width:Ie.naturalWidth,height:Ie.naturalHeight})},Ie.src=v,()=>{ve=!0}},[v]);const F=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),ce=s.useMemo(()=>dS(F),[F]),z=s.useMemo(()=>uS(F),[F]),re=b>0?((Je=(We=ce[0])==null?void 0:We.text)==null?void 0:Je.charAt(0))??"":"",te=g.height>0?g.width/g.height:1,ye=(I==null?void 0:I.contours)??null,Fe=s.useMemo(()=>{if(ye){const qe=nl(ye);if(qe.length)return Fr(qe,r)}const ve=i.trim(),Ie=ve?Wc(ve,o,r):null;return Ie&&Ie.length?Ie:ps(n==="custom"?"rectangle":n,te)},[ye,n,i,o,r,Math.round(te*100)/100]),fe=I==null?void 0:I.onConvert,w=(I==null?void 0:I.needsConversion)??!1,M=s.useMemo(()=>{const ve=ye??(i.trim()?Vo(i):null);return!!(ve&&xu(ve,r))},[ye,i,r]),[E,j]=s.useState(null);Cr(()=>{if(!M){E&&j(null);return}!E&&g.width>0&&g.height>0&&j({width:g.width,height:g.height})},[M,g.width,g.height,E]);const Te=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return Fe;const ve=E??g,Ie=r.width/ve.width,qe=r.height/ve.height;return Fe.map(ze=>ze.map(Le=>({x:Le.x*Ie,y:Le.y*qe})))},[Fe,M,E,r.width,r.height,g.width,g.height]),ee=s.useMemo(()=>{const ve=V.trim(),Ie=ve?Wc(ve,o,r):null;return Ie&&Ie.length?Ie:ps(n==="custom"?"rectangle":n,te)},[n,V,o,r,Math.round(te*100)/100]),$e=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return ee;const ve=E??g,Ie=r.width/ve.width,qe=r.height/ve.height;return ee.map(ze=>ze.map(Le=>({x:Le.x*Ie,y:Le.y*qe})))},[ee,M,E,r.width,r.height,g.width,g.height]),J=s.useRef(null);s.useEffect(()=>{if(!(!fe||g.width<=0||g.height<=0)){if(M){if(J.current===i)return;const ve=ye??(i.trim()?Vo(i):null);if(!(ve!=null&&ve.length))return;const Ie=ti(ve,qe=>({x:r.x+(qe.x-r.x)/g.width*r.width,y:r.y+(qe.y-r.y)/g.height*r.height}));J.current=Go(Ie),fe(Ie);return}!w||!Fe.length||fe(ti(yu(Fe),ve=>({x:ve.x*Yr,y:ve.y*Yr})))}},[w,M,fe,Fe,ye,i,r,g.width,g.height]),Cr(()=>{const ve=T;if(!ve||typeof ResizeObserver>"u")return;const Ie=()=>{const ze=ve.getBoundingClientRect();O(Le=>Math.abs(Le.width-ze.width)<.5&&Math.abs(Le.height-ze.height)<.5?Le:{width:ze.width,height:ze.height})};Ie();const qe=new ResizeObserver(Ie);return qe.observe(ve),()=>qe.disconnect()},[T]),s.useEffect(()=>{const ve=typeof document<"u"?document.fonts:void 0;ve!=null&&ve.ready&&ve.ready.then(()=>{L(Ie=>Ie+1)})},[]),Cr(()=>{const ve=A.current;if(!ve)return;if(!ce.length){X(null);return}const Ie=[],qe=document.createDocumentFragment();for(const zt of ce){const ft=document.createElement("span");Object.assign(ft.style,Hc(zt.leaf)),ft.textContent=zt.text,qe.appendChild(ft),Ie.push(ft)}const ze=document.createElement("span");ze.textContent=" ",qe.appendChild(ze);const Le=document.createElement("span");Le.textContent=re||"H",Le.style.lineHeight="1",qe.appendChild(Le),ve.replaceChildren(qe);const Ge=window.getComputedStyle(ve),De=parseFloat(Ge.fontSize)||16,nt=parseFloat(Ge.lineHeight),it=Number.isNaN(nt)?De*1.2:nt;Le.style.fontSize=`${it*m}px`;const ct=Ie.map(zt=>zt.getBoundingClientRect().width),St=ze.getBoundingClientRect().width,Bt=re?Le.getBoundingClientRect().width:0;ve.replaceChildren(),X({widths:ct,spaceWidth:St,lineHeight:it,capWidth:Bt})},[ce,f,re,b,m,ne,g.width]);const me=P&&re?P.capWidth+P.lineHeight*Tw:0,Se=Math.max(b,Math.ceil(m)),K=s.useMemo(()=>{if(!P||!ce.length||g.width<=0||g.height<=0||!u)return 1;const ve=ze=>Dc({tokens:ce,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Te,mode:l,align:d,scale:ze,allowOverflow:!1,capInset:me*ze,capLines:re?Se:0});if(ve(1).placed>=ce.length)return 1;if(ve(Ya).placed<ce.length)return Ya;let Ie=Ya,qe=1;for(let ze=0;ze<Cw;ze+=1){const Le=(Ie+qe)/2;ve(Le).placed>=ce.length?Ie=Le:qe=Le}return Ie},[P,ce,g.width,g.height,Te,l,d,u,me,re,Se]);s.useEffect(()=>{x(K)},[K,x]);const Z=u?Math.min(p,K):1,se=s.useMemo(()=>!P||!ce.length||g.width<=0||g.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Dc({tokens:ce,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Te,mode:l,align:d,scale:Z,allowOverflow:c,capInset:me*Z,capLines:re?Se:0}),[P,ce,g.width,g.height,Te,l,d,Z,c,me,re,Se]),we=P?P.lineHeight*Z:0,Me=d==="justify"?"left":d,Ce=!!(I&&ye&&g.width>0&&g.height>0),G=!!B,ue=(Ce||G)&&g.width>0&&g.height>0,oe=CS(T,ue),Y=ue&&oe?$S():null,le=s.useRef(!1),_e=s.useCallback(ve=>{le.current=ve},[]);s.useEffect(()=>{if(!Ce&&!G)return;const ve=Ie=>{const qe=T;if(!qe)return;const ze=qe.getBoundingClientRect();Ie.clientX>=ze.left&&Ie.clientX<=ze.right&&Ie.clientY>=ze.top&&Ie.clientY<=ze.bottom&&(Ie.preventDefault(),Ie.stopPropagation(),U(Ge=>Ge==="shape"&&le.current?Ge:Ge==="shape"&&G?"image":Ce?"shape":"image"))};return document.addEventListener("dblclick",ve,!0),()=>document.removeEventListener("dblclick",ve,!0)},[Ce,G,T]);const pe=s.useMemo(()=>v&&g.width>0&&g.height>0?Pw($e,g):null,[v,$e,g.width,g.height]),Q=N&&!q&&H!=="image",Ke=s.useRef(null);!N&&v&&pe&&(Ke.current={rings:$e,bounds:pe,focalX:C,focalY:y,scale:S,customPath:V});const ke=Q?Ke.current:null,tt=s.useRef(null),Ye=(()=>{const ve=tt.current;return N||q||!B||!de||!pe||!ve||V===ve.customPath?null:xS(ve.bounds,pe,de,ve.focalX,ve.focalY,ve.scale)})();Cr(()=>{if(N||!B||!de||!pe)return;const ve=tt.current,Ie=!!(ve&&V!==ve.customPath);Ie&&Ye&&B.onCommit(Ye),Ie&&q&&(W==null||W()),tt.current={rings:$e,bounds:pe,focalX:(Ye==null?void 0:Ye.focalX)??C,focalY:(Ye==null?void 0:Ye.focalY)??y,scale:(Ye==null?void 0:Ye.scale)??S,customPath:V}},[N,q,V,$e,pe,B,de,C,y,S,Ye,W]);const dt=(ke==null?void 0:ke.rings)??$e,ot=(ke==null?void 0:ke.bounds)??pe,Ve=(ke==null?void 0:ke.focalX)??(Ye==null?void 0:Ye.focalX)??C,Re=(ke==null?void 0:ke.focalY)??(Ye==null?void 0:Ye.focalY)??y,He=(ke==null?void 0:ke.scale)??(Ye==null?void 0:Ye.scale)??S,Be=s.useMemo(()=>v&&g.width>0&&g.height>0?Lw(dt,g):"",[v,dt,g.width,g.height]),Ze=ot,he=`${$}-clip`,xe=s.useMemo(()=>{if(!Ze)return null;const ve=de??{width:Ze.width,height:Ze.height},Ie=Si(Ze,ve,He);return{x:Ln(Ze.width,Ie.width,Ve),y:Ln(Ze.height,Ie.height,Re),width:Ie.width,height:Ie.height}},[Ze,de,Ve,Re,He]);return a.jsxs("div",{className:`${e}-column`,ref:k,children:[v&&Be&&Ze&&xe?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:he,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Be,fillRule:"evenodd"})})}),a.jsx("image",{href:v,x:Ze.x+xe.x,y:Ze.y+xe.y,width:xe.width,height:xe.height,preserveAspectRatio:"none",clipPath:`url(#${he})`})]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:Z},children:[a.jsx("div",{className:`${e}-measure`,ref:A,style:f,"aria-hidden":!0}),se.segments.map((ve,Ie)=>{const qe=ce.slice(ve.from,ve.to),ze=Ie===0;return a.jsx("div",{className:`${e}-line${ve.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${ve.top}px`,left:`${ve.left}px`,width:`${ve.width}px`,textAlign:ve.justify?void 0:Me},children:qe.map((Le,Ge)=>{const nt=re&&ze&&ve.from===0&&Ge===0?Le.text.slice(1):Le.text,it=Hc(Le.leaf),ct=Le.href?a.jsx("a",{className:`${e}-link`,href:Le.href,target:Le.target,style:it,children:nt}):a.jsx("span",{style:it,children:nt});return a.jsxs("span",{children:[!ve.justify&&Ge>0?" ":null,ct]},Ge)})},`${ve.from}-${ve.to}-${Ie}`)}),h&&!ye&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:Te.map((ve,Ie)=>a.jsx("polygon",{points:ve.map(qe=>`${qe.x},${qe.y}`).join(" ")},Ie))})]}),re&&P&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${se.capTop}px`,left:`${se.capLeft}px`,fontSize:`${we*m}px`,lineHeight:`${we*m}px`},children:re}),Y&&oe&&(ye&&I||B)&&zn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:oe.top,left:oe.left,width:oe.width,height:oe.height,zIndex:Rw,pointerEvents:"none"},children:[ye&&I&&a.jsx(vS,{P:e,box:{width:oe.width,height:oe.height},viewBox:r,contours:ye,snap:I.snap,stretchToBox:!M,stage:H,onStageChange:U,onSelectionChange:_e,onChange:I.onChange,onCommit:I.onCommit}),B&&Ze&&a.jsx(bS,{P:e,box:{width:oe.width,height:oe.height},bounds:Ze,natural:de,imageUrl:v,maskPath:Be,stage:H,onStageChange:U,focalX:Ve,focalY:Re,scale:He,onChange:B.onChange,onCommit:B.onCommit})]}),Y),a.jsx("div",{className:`${e}-a11y`,children:z.map((ve,Ie)=>a.jsx("p",{children:ve},Ie))})]})}function IS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>pS(d),[d]),u=n??!1,p=!!r||!!o,x=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),b=(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(()=>Ew(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",V=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,N=(e==null?void 0:e.dropCapSize)??Iw,q=u&&p&&!i,[W,I]=s.useState(!1);s.useEffect(()=>{if(!u||!p){I(!1);return}const Z=()=>I(!0),se=()=>I(!1),we=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],Me=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const Ce of we)window.addEventListener(Ce,Z);for(const Ce of Me)window.addEventListener(Ce,se);return()=>{for(const Ce of we)window.removeEventListener(Ce,Z);for(const Ce of Me)window.removeEventListener(Ce,se)}},[u,p]);const B=u&&p&&!i&&typeof l=="function",$=!W,T=Math.max(0,(e==null?void 0:e.pathSnap)??0),k=s.useRef(e??{}),A=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!==A.current&&(A.current=g,k.current=e??{});const[O,P]=s.useState(null),[X,ne]=s.useState(!1),[L,H]=s.useState(!1),U=s.useCallback(()=>H(!1),[]),de=s.useMemo(()=>!O||O.serialized===m?m:O.serialized,[O,m]);s.useEffect(()=>{B||(ne(!1),H(!1))},[B]);const ae=s.useMemo(()=>{if(!B)return null;if(O&&(O.base===m||O.serialized===m))return O.contours;const Z=Vo(m);return Z.length?Z:null},[B,O,m]),F=h==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===Xr&&!!(ae&&!xu(ae,f)),ce=s.useCallback((Z,se,we)=>{const Me=Go(Z);if(P(Ce=>({base:Ce&&(Ce.base===m||Ce.serialized===m)?Ce.base:m,serialized:Me,contours:Z})),se){const Ce=k.current,G=we!=null&&we.preserveShape?Ce.shape:"custom",ue={...Ce,shape:G,customPath:Me};k.current=ue,l==null||l(ue)}},[m,l]),z=s.useMemo(()=>B?{contours:F?ae:null,snap:T,needsConversion:!F,onConvert:Z=>{const se=Go(Z);P({base:se,serialized:se,contours:Z});const we={...k.current,pathFit:"viewbox",pathViewBox:Xr,customPath:se};k.current=we,l==null||l(we)},onChange:(Z,se)=>{ne(!0),H(!!(se!=null&&se.carryImage)),ce(Z,!1)},onCommit:(Z,se)=>{ce(Z,!0,se),ne(!1)}}:null,[B,F,ae,T,l,ce]),re=v==="avoid"&&!!(e!=null&&e.image),te=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]),[ye,Fe]=s.useState(null),fe=ye??te,w=s.useCallback(Z=>Fe(Z),[]),M=s.useCallback(Z=>{Fe(Z);const se={...k.current,imageFocalX:Z.focalX,imageFocalY:Z.focalY,imageScale:Z.scale};k.current=se,l==null||l(se)},[l]);s.useEffect(()=>{ye&&Math.abs(ye.focalX-te.focalX)<1e-9&&Math.abs(ye.focalY-te.focalY)<1e-9&&Math.abs(ye.scale-te.scale)<1e-9&&Fe(null)},[ye,te]);const E=s.useMemo(()=>!B||!re?null:{onChange:w,onCommit:M},[B,re,w,M]),[j,Te]=s.useState(void 0),ee=s.useRef(void 0),$e=s.useCallback(Z=>{const se=ee.current;se!==void 0&&Math.abs(se-Z)<.005||(ee.current=Z,Te(Z))},[]),J=s.useMemo(()=>S&&typeof j=="number"?j:1,[j,S]),me=Z=>`calc(${Z} * var(--${d}-fit, 1))`,Se=s.useMemo(()=>{var Z,se,we,Me,Ce;return{fontFamily:po(e==null?void 0:e.textFontFamily),fontWeight:(Z=e==null?void 0:e.textFontSettings)==null?void 0:Z.fontWeight,fontStyle:(se=e==null?void 0:e.textFontSettings)==null?void 0:se.fontStyle,fontSize:me(D.scalingValue((e==null?void 0:e.textFontSize)??.012,u)),lineHeight:me(D.scalingValue((e==null?void 0:e.textLineHeight)??(e==null?void 0:e.textFontSize)??.012,u)),letterSpacing:me(D.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:me(D.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(we=e==null?void 0:e.textTextAppearance)==null?void 0:we.textTransform,textDecoration:(Me=e==null?void 0:e.textTextAppearance)==null?void 0:Me.textDecoration,fontVariant:(Ce=e==null?void 0:e.textTextAppearance)==null?void 0:Ce.fontVariant}},[e,u,d]),K={[`--${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:{...K},children:a.jsx(TS,{P:d,item:x,shape:b,customPath:m,pathFit:h,viewBox:f,mode:v,align:C,allowOverflow:y,fitEnabled:S,scale:J,onFitScale:$e,dropCapLines:V,dropCapSize:N,showGuides:(q||B)&&$,typography:Se,imageUrl:v==="avoid"?e==null?void 0:e.image:null,imageFocalX:fe.focalX,imageFocalY:fe.focalY,imageScale:fe.scale,imageCustomPath:de,pathDragActive:X,pathCarryImage:L,onCarryImageConsumed:U,pathEditor:$?z:null,imageEditor:$?E:null})})]})}const RS=`import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
23832
+ `}const So=7,mS=3.5,Co=9,Qn=8,ei=14,Oc=10,gS=24,Tr=14,hS=4,fS=1,yS=.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 wu(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,xS=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)<xS?.5:Gr(n/i)}function vS(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([]),[V,N]=s.useState(ji),q=s.useCallback(b=>{N(M=>Jw(M,b)?M:b)},[]),W=l==="shape";s.useEffect(()=>{var b;W&&((b=x.current)==null||b.focus({preventScroll:!0}))},[W]),s.useEffect(()=>{W||S(b=>b.length?[]:b)},[W]);const I=y.length>0;s.useEffect(()=>{c==null||c(I)},[I,c]),s.useEffect(()=>()=>c==null?void 0:c(!1),[c]);const B=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)*B,y:(b.y-n.y)*$}:{x:b.x-n.x,y:b.y-n.y},[r,n,B,$]),k=s.useCallback(b=>r?{x:n.x+(B>0?b.x/B:0),y:n.y+($>0?b.y/$:0)}:{x:n.x+b.x,y:n.y+b.y},[r,n,B,$]),F=s.useMemo(()=>k({x:t.width/2,y:t.height/2}),[k,t.width,t.height]),g=s.useCallback((b,M)=>{var j;const E=(j=x.current)==null?void 0:j.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]),O=s.useCallback((b,M)=>{var j;const E=(j=x.current)==null?void 0:j.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]),X=b=>{var $e;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 G=g(b.clientX,b.clientY),pe=Math.hypot(G.x-E.origin.x,G.y-E.origin.y),oe=Math.max(yS,pe/E.startDistance);if(!E.moved&&Math.abs(oe-1)<1e-4)return;E.moved=!0,u(Pc(E.startContours,E.origin,oe));return}const j=f.current;if(j&&b.pointerId===j.pointerId){b.stopPropagation(),b.preventDefault();const G=g(b.clientX,b.clientY),{bbox:pe}=j,oe=pe.maxX-pe.minX,Y=pe.maxY-pe.minY,le=G.x-j.origin.x,_e=G.y-j.origin.y;let me=le,J=_e;if(isFinite(oe)&&isFinite(Y))if(r){const ke=Math.min(n.x,n.x+n.width-oe),tt=Math.max(n.x,n.x+n.width-oe),Ye=Math.min(n.y,n.y+n.height-Y),dt=Math.max(n.y,n.y+n.height-Y),ot=Math.min(tt,Math.max(ke,pe.minX+le)),Ve=Math.min(dt,Math.max(Ye,pe.minY+_e));me=ot-pe.minX,J=Ve-pe.minY}else{const ke=pe.minX-n.x,tt=pe.minY-n.y,Ye=Math.min(0,t.width-oe),dt=Math.max(0,t.width-oe),ot=Math.min(0,t.height-Y),Ve=Math.max(0,t.height-Y),Re=Math.min(dt,Math.max(Ye,ke+le)),He=Math.min(Ve,Math.max(ot,tt+_e));me=Re-ke,J=He-tt}const Ke=[];if(!M&&isFinite(oe)&&isFinite(Y)){const ke=T({x:pe.minX+oe/2+me,y:pe.minY+Y/2+J}),tt={x:t.width/2,y:t.height/2};Math.abs(ke.x-tt.x)<=Tr&&(me=F.x-pe.minX-oe/2,Ke.push(ys(tt.x,"x",t))),Math.abs(ke.y-tt.y)<=Tr&&(J=F.y-pe.minY-Y/2,Ke.push(ys(tt.y,"y",t)))}if(!j.moved&&me===0&&J===0)return;j.moved=!0,q(Ke.length?Ke:ji),u(ti(j.startContours,ke=>({x:ke.x+me,y:ke.y+J})),{carryImage:!0});return}const Ce=C.current;if(Ce&&b.pointerId===Ce.pointerId){b.stopPropagation(),b.preventDefault();const G=g(b.clientX,b.clientY);let pe=G.x-Ce.origin.x,oe=G.y-Ce.origin.y;if(b.shiftKey&&(Math.abs(pe)>Math.abs(oe)?oe=0:pe=0),!Ce.moved&&pe===0&&oe===0)return;Ce.moved=!0,u(Mc(Ce.startContours,Ce.selection,pe,oe));return}const Q=h.current;if(!Q||b.pointerId!==Q.pointerId)return;b.stopPropagation(),b.preventDefault();const Te=g(b.clientX,b.clientY);if(Q.kind==="anchor"){const G={x:Q.anchor.x+(Te.x-Q.origin.x),y:Q.anchor.y+(Te.y-Q.origin.y)},pe=M?[]:qw(m.current,{contour:Q.contour,node:Q.node}),oe=M||!Q.center?[]:[Q.center],Y=Fc(Ac(pe,oe.map(me=>me.x),"x"),G,"x",T,Tr),le=Fc(Ac(pe,oe.map(me=>me.y),"y"),G,"y",T,Tr),_e=M?G:{x:(Y==null?void 0:Y.value)??$r(G.x,o),y:(le==null?void 0:le.value)??$r(G.y,o)};if(b.shiftKey&&(Math.abs(_e.x-Q.anchor.x)>Math.abs(_e.y-Q.anchor.y)?_e.y=Q.anchor.y:_e.x=Q.anchor.x),!Q.moved&&_e.x===Q.anchor.x&&_e.y===Q.anchor.y)return;Q.moved=!0,q(tS(_e,Y,le,t,T)),u(Bw(m.current,Q.contour,Q.node,_e));return}const ie=($e=m.current[Q.contour])==null?void 0:$e.nodes[Q.node],ue=Q.mirror&&!b.altKey,fe=ue||M?null:Q.kind==="in"?ie==null?void 0:ie.out:ie==null?void 0:ie.in,K=ie?T(ie.p):null,Z=fe?T(fe):null,se=ie&&(!M||b.shiftKey)?iS(Te,ie.p,ue||M?null:nS(m.current[Q.contour],Q.node,Q.kind,T),K&&Z?Math.hypot(Z.x-K.x,Z.y-K.y):null,b.shiftKey,T,k):{point:Te,guides:ji},Se=se.guides.length?se.point:M?Te:{x:$r(Te.x,o),y:$r(Te.y,o)},Me=Q.kind==="in"?ie==null?void 0:ie.in:ie==null?void 0:ie.out;!Q.moved&&Me&&Se.x===Me.x&&Se.y===Me.y||(Q.moved=!0,q(se.guides),u(jw(m.current,Q.contour,Q.node,Q.kind,Se,ue)))},te=b=>{q(ji);const M=v.current;if(M&&b.pointerId===M.pointerId){v.current=null,b.stopPropagation();const fe=x.current;fe!=null&&fe.hasPointerCapture(M.pointerId)&&fe.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 fe=x.current;fe!=null&&fe.hasPointerCapture(E.pointerId)&&fe.releasePointerCapture(E.pointerId),E.moved?P(m.current,{preserveShape:!0}):S([]);return}const j=C.current;if(j&&b.pointerId===j.pointerId){C.current=null,b.stopPropagation();const fe=x.current;fe!=null&&fe.hasPointerCapture(j.pointerId)&&fe.releasePointerCapture(j.pointerId),j.moved&&P(m.current);return}const Ce=h.current;if(!Ce||b.pointerId!==Ce.pointerId)return;h.current=null,b.stopPropagation();const Q=x.current;Q!=null&&Q.hasPointerCapture(Ce.pointerId)&&Q.releasePointerCapture(Ce.pointerId);const Te=Math.hypot(b.clientX-Ce.clientOrigin.x,b.clientY-Ce.clientOrigin.y);if(Ce.moved||Te>hS){Ce.moved&&P(m.current);return}if(!Ce.toggleOnRelease||b.type!=="pointerup")return;const ue=kc(m.current,Ce.contour,Ce.node);ue!==m.current&&(u(ue),P(ue))},L=b=>{b.stopPropagation()},H=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)},U=(b,M)=>{var Te,ie;b.stopPropagation(),b.preventDefault(),(Te=x.current)==null||Te.focus({preventScroll:!0}),S([]),d("shape");const E=Jn(i),j=Ur(E,wu(M)),Ce=xs(E,M),Q=Math.hypot(Ce.x-j.x,Ce.y-j.y);!isFinite(Q)||Q<=0||(v.current={pointerId:b.pointerId,corner:M,origin:j,startDistance:Q,startContours:Pn(i),moved:!1},(ie=x.current)==null||ie.setPointerCapture(b.pointerId))},de=(b,M,E,j)=>{var Te,ie,ue,fe;b.stopPropagation(),b.preventDefault(),(Te=x.current)==null||Te.focus({preventScroll:!0});const Ce=(ie=i[E])==null?void 0:ie.nodes[j];if(!Ce)return;if(b.altKey){const K=M==="anchor"?vu(i,E,j):Vw(i,E,j,M);if(K===i)return;S(M==="anchor"?[]:[{contour:E,node:j}]),u(K),P(K);return}const Q=b.metaKey||b.ctrlKey;if(M==="anchor"&&b.shiftKey&&!Q){S(K=>K.some(Z=>Z.contour===E&&Z.node===j)?K.filter(Z=>!(Z.contour===E&&Z.node===j)):[...K,{contour:E,node:j}]);return}if(M==="anchor"&&!Q&&y.length>1&&y.some(K=>K.contour===E&&K.node===j)){C.current={pointerId:b.pointerId,origin:g(b.clientX,b.clientY),startContours:Pn(i),selection:y,moved:!1},(ue=x.current)==null||ue.setPointerCapture(b.pointerId);return}S([{contour:E,node:j}]),h.current={kind:M,contour:E,node:j,pointerId:b.pointerId,origin:g(b.clientX,b.clientY),clientOrigin:{x:b.clientX,y:b.clientY},anchor:Ce.p,center:Ww(i),mirror:M!=="anchor"&&!!(Ce.in&&Ce.out),toggleOnRelease:Q,moved:!1},(fe=x.current)==null||fe.setPointerCapture(b.pointerId)},ae=b=>{b.stopPropagation(),b.preventDefault();const M=ti(i,T),E=Yw(M,O(b.clientX,b.clientY));if(!E||E.distance>gS)return;const{contours:j,nodeIndex:Ce}=Gw(i,E.contour,E.segment,E.t);Ce<0||(S([{contour:E.contour,node:Ce}]),u(j),P(j))},A=b=>{if(b.key==="="||b.key==="+"||b.key==="-"||b.key==="_"){b.preventDefault(),b.stopPropagation();const Q=Jn(i);if(!isFinite(Q.minX)||!isFinite(Q.maxX))return;const Te={x:(Q.minX+Q.maxX)/2,y:(Q.minY+Q.maxY)/2},ue=b.key==="="||b.key==="+"?qr:1/qr,fe=Pc(i,Te,ue);u(fe),P(fe,{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 Q=zw(i,y);if(Q===i)return;S([]),u(Q),P(Q);return}const M=o>0?o:fS,E=b.shiftKey?M*10:M,j={ArrowLeft:[-E,0],ArrowRight:[E,0],ArrowUp:[0,-E],ArrowDown:[0,E]}[b.key];if(!j)return;b.preventDefault(),b.stopPropagation();const Ce=Mc(i,y,j[0],j[1]);u(Ce),P(Ce)},ce=s.useMemo(()=>Go(ti(i,T)),[i,T]),z=s.useMemo(()=>Jn(i),[i]),re=T({x:z.minX,y:z.minY}),ee={width:T({x:z.maxX,y:z.minY}).x-re.x,height:T({x:z.minX,y:z.maxY}).y-re.y},xe=W&&y.length===0&&isFinite(z.minX)&&isFinite(z.maxX)&&z.maxX>z.minX&&z.maxY>z.minY,Fe=y.length>0||W,ye=Fe;return a.jsxs("svg",{ref:x,className:`${e}-editor${Fe?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:A,onPointerDown:()=>{var b;return(b=x.current)==null?void 0:b.focus({preventScroll:!0})},onPointerMove:X,onPointerUp:te,onPointerCancel:te,onLostPointerCapture:te,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:ae}),ye&&a.jsx("path",{className:`${e}-editor-hit`,d:ce,onClick:ae}),ye&&a.jsx("path",{className:`${e}-editor-outline`,d:ce}),ye&&V.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:ce,fillRule:"evenodd",onPointerDown:H,onClick:ae}),ye&&i.map((b,M)=>b.nodes.map((E,j)=>{const Ce=y.some(Te=>Te.contour===M&&Te.node===j),Q=T(E.p);return a.jsxs("g",{children:[Ce&&y.length===1&&["in","out"].map(Te=>{const ie=E[Te];if(!ie)return null;const ue=T(ie);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:Q.x,y1:Q.y,x2:ue.x,y2:ue.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ue.x,cy:ue.y,r:mS}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ue.x,cy:ue.y,r:Co,onPointerDown:fe=>de(fe,Te,M,j),onClick:L})]},Te)}),a.jsx("rect",{className:`${e}-editor-anchor${Ce?` ${e}-editor-anchor-selected`:""}`,x:Q.x-So/2,y:Q.y-So/2,width:So,height:So,rx:E.in||E.out?So/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:Q.x-Co,y:Q.y-Co,width:Co*2,height:Co*2,onPointerDown:Te=>de(Te,"anchor",M,j),onClick:L,onDoubleClick:Te=>{Te.stopPropagation(),Te.preventDefault();const ie=kc(i,M,j);u(ie),P(ie)}})]},`${M}-${j}`)})),xe&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:re.x,y:re.y,width:ee.width,height:ee.height}),["nw","ne","se","sw"].map(b=>{const M=T(xs(z,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:j=>U(j,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 F;y&&((F=m.current)==null||F.focus({preventScroll:!0}))},[y]);const S=s.useCallback((F,g)=>{var P;const O=(P=m.current)==null?void 0:P.getBoundingClientRect();return!O||O.width<=0||O.height<=0?{x:0,y:0}:{x:(F-O.left)/O.width*t.width,y:(g-O.top)/O.height*t.height}},[t.width,t.height]),V=F=>{var O,P;if(!i)return;F.stopPropagation(),F.preventDefault(),(O=m.current)==null||O.focus({preventScroll:!0});const g=Si(n,i,p);f.current={pointerId:F.pointerId,origin:S(F.clientX,F.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(F.pointerId)},N=(F,g)=>{var de,ae;if(!i)return;F.stopPropagation(),F.preventDefault(),(de=m.current)==null||de.focus({preventScroll:!0});const O=Si(n,i,p),P=Ln(n.width,O.width,c),X=Ln(n.height,O.height,u),te={minX:P,minY:X,maxX:P+O.width,maxY:X+O.height},L=Ur(te,wu(g)),H=Ur(te,g),U=Math.hypot(H.x-L.x,H.y-L.y);!isFinite(U)||U<=0||(v.current={pointerId:F.pointerId,anchor:L,startDistance:U,startScale:p,startX:P,startY:X,moved:!1},(ae=m.current)==null||ae.setPointerCapture(F.pointerId))},q=F=>{if(!i)return;const g=v.current;if(g&&F.pointerId===g.pointerId){F.stopPropagation(),F.preventDefault();const P=S(F.clientX,F.clientY),X={x:P.x-n.x,y:P.y-n.y},te=Math.hypot(X.x-g.anchor.x,X.y-g.anchor.y),L=Math.min(bs,Math.max(vs,g.startScale*(te/g.startDistance)));if(!g.moved&&Math.abs(L-g.startScale)<1e-4)return;g.moved=!0;const H=L/g.startScale,U=g.anchor.x+(g.startX-g.anchor.x)*H,de=g.anchor.y+(g.startY-g.anchor.y)*H,ae=Si(n,i,L);x({focalX:Vi(n.width,ae.width,U),focalY:Vi(n.height,ae.height,de),scale:L});return}const O=f.current;if(O&&F.pointerId===O.pointerId){F.stopPropagation(),F.preventDefault();const P=S(F.clientX,F.clientY),X=P.x-O.origin.x,te=P.y-O.origin.y;if(!O.moved&&X===0&&te===0)return;O.moved=!0,x({focalX:Vi(n.width,O.width,O.startX+X),focalY:Vi(n.height,O.height,O.startY+te),scale:p})}},W=F=>{var P,X;const g=f.current;if(g&&F.pointerId===g.pointerId){f.current=null,F.stopPropagation(),(P=m.current)!=null&&P.hasPointerCapture(g.pointerId)&&m.current.releasePointerCapture(g.pointerId),g.moved&&w(C.current);return}const O=v.current;O&&F.pointerId===O.pointerId&&(v.current=null,F.stopPropagation(),(X=m.current)!=null&&X.hasPointerCapture(O.pointerId)&&m.current.releasePointerCapture(O.pointerId),O.moved&&w(C.current))},I=F=>{if(F.key==="Escape"){F.stopPropagation(),d("none");return}if(F.key==="="||F.key==="+"||F.key==="-"||F.key==="_"){F.preventDefault(),F.stopPropagation();const g=F.key==="="||F.key==="+",O=Math.min(bs,Math.max(vs,p*(g?qr:1/qr))),P={focalX:c,focalY:u,scale:O};x(P),w(P)}},B=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},T=s.useMemo(()=>{const F=i??{width:n.width,height:n.height},g=Si(n,F,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:q,onPointerUp:W,onPointerCancel:W,onLostPointerCapture:W,"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:V}),B.map(F=>{const g=xs(k,F),O=F==="ne"||F==="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${O?` ${e}-editor-scale-grab-nesw`:""}`,x:g.x-ei/2,y:g.y-ei/2,width:ei,height:ei,onPointerDown:P=>N(P,F)})]},F)})]})]})}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:V,pathDragActive:N,pathCarryImage:q,onCarryImageConsumed:W,pathEditor:I,imageEditor:B}){var We,Je;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[T,k]=s.useState(null),F=s.useRef(null),[g,O]=s.useState({width:0,height:0}),[P,X]=s.useState(null),[te,L]=s.useState(0),[H,U]=s.useState("none");s.useEffect(()=>{!I&&!B&&U("none")},[I,B]);const[de,ae]=s.useState(null);s.useEffect(()=>{if(!v||typeof Image>"u"){ae(null);return}let be=!1;const Ie=new Image;return Ie.onload=()=>{be||ae({width:Ie.naturalWidth,height:Ie.naturalHeight})},Ie.src=v,()=>{be=!0}},[v]);const A=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),ce=s.useMemo(()=>dS(A),[A]),z=s.useMemo(()=>uS(A),[A]),re=w>0?((Je=(We=ce[0])==null?void 0:We.text)==null?void 0:Je.charAt(0))??"":"",ee=g.height>0?g.width/g.height:1,xe=(I==null?void 0:I.contours)??null,Fe=s.useMemo(()=>{if(xe){const qe=nl(xe);if(qe.length)return Fr(qe,r)}const be=i.trim(),Ie=be?Wc(be,o,r):null;return Ie&&Ie.length?Ie:ps(n==="custom"?"rectangle":n,ee)},[xe,n,i,o,r,Math.round(ee*100)/100]),ye=I==null?void 0:I.onConvert,b=(I==null?void 0:I.needsConversion)??!1,M=s.useMemo(()=>{const be=xe??(i.trim()?Vo(i):null);return!!(be&&xu(be,r))},[xe,i,r]),[E,j]=s.useState(null);Cr(()=>{if(!M){E&&j(null);return}!E&&g.width>0&&g.height>0&&j({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 Fe;const be=E??g,Ie=r.width/be.width,qe=r.height/be.height;return Fe.map(ze=>ze.map(Le=>({x:Le.x*Ie,y:Le.y*qe})))},[Fe,M,E,r.width,r.height,g.width,g.height]),Q=s.useMemo(()=>{const be=V.trim(),Ie=be?Wc(be,o,r):null;return Ie&&Ie.length?Ie:ps(n==="custom"?"rectangle":n,ee)},[n,V,o,r,Math.round(ee*100)/100]),Te=s.useMemo(()=>{if(!M||g.width<=0||g.height<=0)return Q;const be=E??g,Ie=r.width/be.width,qe=r.height/be.height;return Q.map(ze=>ze.map(Le=>({x:Le.x*Ie,y:Le.y*qe})))},[Q,M,E,r.width,r.height,g.width,g.height]),ie=s.useRef(null);s.useEffect(()=>{if(!(!ye||g.width<=0||g.height<=0)){if(M){if(ie.current===i)return;const be=xe??(i.trim()?Vo(i):null);if(!(be!=null&&be.length))return;const Ie=ti(be,qe=>({x:r.x+(qe.x-r.x)/g.width*r.width,y:r.y+(qe.y-r.y)/g.height*r.height}));ie.current=Go(Ie),ye(Ie);return}!b||!Fe.length||ye(ti(yu(Fe),be=>({x:be.x*Yr,y:be.y*Yr})))}},[b,M,ye,Fe,xe,i,r,g.width,g.height]),Cr(()=>{const be=T;if(!be||typeof ResizeObserver>"u")return;const Ie=()=>{const ze=be.getBoundingClientRect();O(Le=>Math.abs(Le.width-ze.width)<.5&&Math.abs(Le.height-ze.height)<.5?Le:{width:ze.width,height:ze.height})};Ie();const qe=new ResizeObserver(Ie);return qe.observe(be),()=>qe.disconnect()},[T]),s.useEffect(()=>{const be=typeof document<"u"?document.fonts:void 0;be!=null&&be.ready&&be.ready.then(()=>{L(Ie=>Ie+1)})},[]),Cr(()=>{const be=F.current;if(!be)return;if(!ce.length){X(null);return}const Ie=[],qe=document.createDocumentFragment();for(const zt of ce){const ft=document.createElement("span");Object.assign(ft.style,Hc(zt.leaf)),ft.textContent=zt.text,qe.appendChild(ft),Ie.push(ft)}const ze=document.createElement("span");ze.textContent=" ",qe.appendChild(ze);const Le=document.createElement("span");Le.textContent=re||"H",Le.style.lineHeight="1",qe.appendChild(Le),be.replaceChildren(qe);const Ge=window.getComputedStyle(be),De=parseFloat(Ge.fontSize)||16,nt=parseFloat(Ge.lineHeight),it=Number.isNaN(nt)?De*1.2:nt;Le.style.fontSize=`${it*m}px`;const ct=Ie.map(zt=>zt.getBoundingClientRect().width),St=ze.getBoundingClientRect().width,Bt=re?Le.getBoundingClientRect().width:0;be.replaceChildren(),X({widths:ct,spaceWidth:St,lineHeight:it,capWidth:Bt})},[ce,f,re,w,m,te,g.width]);const ue=P&&re?P.capWidth+P.lineHeight*Tw:0,fe=Math.max(w,Math.ceil(m)),K=s.useMemo(()=>{if(!P||!ce.length||g.width<=0||g.height<=0||!u)return 1;const be=ze=>Dc({tokens:ce,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Ce,mode:l,align:d,scale:ze,allowOverflow:!1,capInset:ue*ze,capLines:re?fe:0});if(be(1).placed>=ce.length)return 1;if(be(Ya).placed<ce.length)return Ya;let Ie=Ya,qe=1;for(let ze=0;ze<Cw;ze+=1){const Le=(Ie+qe)/2;be(Le).placed>=ce.length?Ie=Le:qe=Le}return Ie},[P,ce,g.width,g.height,Ce,l,d,u,ue,re,fe]);s.useEffect(()=>{x(K)},[K,x]);const Z=u?Math.min(p,K):1,se=s.useMemo(()=>!P||!ce.length||g.width<=0||g.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Dc({tokens:ce,widths:P.widths,spaceWidth:P.spaceWidth,lineHeight:P.lineHeight,width:g.width,height:g.height,rings:Ce,mode:l,align:d,scale:Z,allowOverflow:c,capInset:ue*Z,capLines:re?fe:0}),[P,ce,g.width,g.height,Ce,l,d,Z,c,ue,re,fe]),Se=P?P.lineHeight*Z:0,Me=d==="justify"?"left":d,$e=!!(I&&xe&&g.width>0&&g.height>0),G=!!B,pe=($e||G)&&g.width>0&&g.height>0,oe=$S(T,pe),Y=pe&&oe?TS():null,le=s.useRef(!1),_e=s.useCallback(be=>{le.current=be},[]);s.useEffect(()=>{if(!$e&&!G)return;const be=Ie=>{const qe=T;if(!qe)return;const ze=qe.getBoundingClientRect();Ie.clientX>=ze.left&&Ie.clientX<=ze.right&&Ie.clientY>=ze.top&&Ie.clientY<=ze.bottom&&(Ie.preventDefault(),Ie.stopPropagation(),U(Ge=>Ge==="shape"&&le.current?Ge:Ge==="shape"&&G?"image":$e?"shape":"image"))};return document.addEventListener("dblclick",be,!0),()=>document.removeEventListener("dblclick",be,!0)},[$e,G,T]);const me=s.useMemo(()=>v&&g.width>0&&g.height>0?Pw(Te,g):null,[v,Te,g.width,g.height]),J=N&&!q&&H!=="image",Ke=s.useRef(null);!N&&v&&me&&(Ke.current={rings:Te,bounds:me,focalX:C,focalY:y,scale:S,customPath:V});const ke=J?Ke.current:null,tt=s.useRef(null),Ye=(()=>{const be=tt.current;return N||q||!B||!de||!me||!be||V===be.customPath?null:vS(be.bounds,me,de,be.focalX,be.focalY,be.scale)})();Cr(()=>{if(N||!B||!de||!me)return;const be=tt.current,Ie=!!(be&&V!==be.customPath);Ie&&Ye&&B.onCommit(Ye),Ie&&q&&(W==null||W()),tt.current={rings:Te,bounds:me,focalX:(Ye==null?void 0:Ye.focalX)??C,focalY:(Ye==null?void 0:Ye.focalY)??y,scale:(Ye==null?void 0:Ye.scale)??S,customPath:V}},[N,q,V,Te,me,B,de,C,y,S,Ye,W]);const dt=(ke==null?void 0:ke.rings)??Te,ot=(ke==null?void 0:ke.bounds)??me,Ve=(ke==null?void 0:ke.focalX)??(Ye==null?void 0:Ye.focalX)??C,Re=(ke==null?void 0:ke.focalY)??(Ye==null?void 0:Ye.focalY)??y,He=(ke==null?void 0:ke.scale)??(Ye==null?void 0:Ye.scale)??S,Be=s.useMemo(()=>v&&g.width>0&&g.height>0?Lw(dt,g):"",[v,dt,g.width,g.height]),Ze=ot,he=`${$}-clip`,ve=s.useMemo(()=>{if(!Ze)return null;const be=de??{width:Ze.width,height:Ze.height},Ie=Si(Ze,be,He);return{x:Ln(Ze.width,Ie.width,Ve),y:Ln(Ze.height,Ie.height,Re),width:Ie.width,height:Ie.height}},[Ze,de,Ve,Re,He]);return a.jsxs("div",{className:`${e}-column`,ref:k,children:[v&&Be&&Ze&&ve?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:he,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Be,fillRule:"evenodd"})})}),a.jsx("image",{href:v,x:Ze.x+ve.x,y:Ze.y+ve.y,width:ve.width,height:ve.height,preserveAspectRatio:"none",clipPath:`url(#${he})`})]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:Z},children:[a.jsx("div",{className:`${e}-measure`,ref:F,style:f,"aria-hidden":!0}),se.segments.map((be,Ie)=>{const qe=ce.slice(be.from,be.to),ze=Ie===0;return a.jsx("div",{className:`${e}-line${be.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${be.top}px`,left:`${be.left}px`,width:`${be.width}px`,textAlign:be.justify?void 0:Me},children:qe.map((Le,Ge)=>{const nt=re&&ze&&be.from===0&&Ge===0?Le.text.slice(1):Le.text,it=Hc(Le.leaf),ct=Le.href?a.jsx("a",{className:`${e}-link`,href:Le.href,target:Le.target,style:it,children:nt}):a.jsx("span",{style:it,children:nt});return a.jsxs("span",{children:[!be.justify&&Ge>0?" ":null,ct]},Ge)})},`${be.from}-${be.to}-${Ie}`)}),h&&!xe&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:Ce.map((be,Ie)=>a.jsx("polygon",{points:be.map(qe=>`${qe.x},${qe.y}`).join(" ")},Ie))})]}),re&&P&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${se.capTop}px`,left:`${se.capLeft}px`,fontSize:`${Se*m}px`,lineHeight:`${Se*m}px`},children:re}),Y&&oe&&(xe&&I||B)&&zn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:oe.top,left:oe.left,width:oe.width,height:oe.height,zIndex:Rw,pointerEvents:"none"},children:[xe&&I&&a.jsx(bS,{P:e,box:{width:oe.width,height:oe.height},viewBox:r,contours:xe,snap:I.snap,stretchToBox:!M,stage:H,onStageChange:U,onSelectionChange:_e,onChange:I.onChange,onCommit:I.onCommit}),B&&Ze&&a.jsx(wS,{P:e,box:{width:oe.width,height:oe.height},bounds:Ze,natural:de,imageUrl:v,maskPath:Be,stage:H,onStageChange:U,focalX:Ve,focalY:Re,scale:He,onChange:B.onChange,onCommit:B.onCommit})]}),Y),a.jsx("div",{className:`${e}-a11y`,children:z.map((be,Ie)=>a.jsx("p",{children:be},Ie))})]})}function RS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>pS(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(()=>Ew(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",V=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,N=(e==null?void 0:e.dropCapSize)??Iw,q=u&&p&&!i,[W,I]=s.useState(!1);s.useEffect(()=>{if(!u||!p){I(!1);return}const Z=()=>I(!0),se=()=>I(!1),Se=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],Me=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const $e of Se)window.addEventListener($e,Z);for(const $e of Me)window.addEventListener($e,se);return()=>{for(const $e of Se)window.removeEventListener($e,Z);for(const $e of Me)window.removeEventListener($e,se)}},[u,p]);const B=u&&p&&!i&&typeof l=="function",$=!W,T=Math.max(0,(e==null?void 0:e.pathSnap)??0),k=s.useRef(e??{}),F=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!==F.current&&(F.current=g,k.current=e??{});const[O,P]=s.useState(null),[X,te]=s.useState(!1),[L,H]=s.useState(!1),U=s.useCallback(()=>H(!1),[]),de=s.useMemo(()=>!O||O.serialized===m?m:O.serialized,[O,m]);s.useEffect(()=>{B||(te(!1),H(!1))},[B]);const ae=s.useMemo(()=>{if(!B)return null;if(O&&(O.base===m||O.serialized===m))return O.contours;const Z=Vo(m);return Z.length?Z:null},[B,O,m]),A=h==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===Xr&&!!(ae&&!xu(ae,f)),ce=s.useCallback((Z,se,Se)=>{const Me=Go(Z);if(P($e=>({base:$e&&($e.base===m||$e.serialized===m)?$e.base:m,serialized:Me,contours:Z})),se){const $e=k.current,G=Se!=null&&Se.preserveShape?$e.shape:"custom",pe={...$e,shape:G,customPath:Me};k.current=pe,l==null||l(pe)}},[m,l]),z=s.useMemo(()=>B?{contours:A?ae:null,snap:T,needsConversion:!A,onConvert:Z=>{const se=Go(Z);P({base:se,serialized:se,contours:Z});const Se={...k.current,pathFit:"viewbox",pathViewBox:Xr,customPath:se};k.current=Se,l==null||l(Se)},onChange:(Z,se)=>{te(!0),H(!!(se!=null&&se.carryImage)),ce(Z,!1)},onCommit:(Z,se)=>{ce(Z,!0,se),te(!1)}}:null,[B,A,ae,T,l,ce]),re=v==="avoid"&&!!(e!=null&&e.image),ee=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]),[xe,Fe]=s.useState(null),ye=xe??ee,b=s.useCallback(Z=>Fe(Z),[]),M=s.useCallback(Z=>{Fe(Z);const se={...k.current,imageFocalX:Z.focalX,imageFocalY:Z.focalY,imageScale:Z.scale};k.current=se,l==null||l(se)},[l]);s.useEffect(()=>{xe&&Math.abs(xe.focalX-ee.focalX)<1e-9&&Math.abs(xe.focalY-ee.focalY)<1e-9&&Math.abs(xe.scale-ee.scale)<1e-9&&Fe(null)},[xe,ee]);const E=s.useMemo(()=>!B||!re?null:{onChange:b,onCommit:M},[B,re,b,M]),[j,Ce]=s.useState(void 0),Q=s.useRef(void 0),Te=s.useCallback(Z=>{const se=Q.current;se!==void 0&&Math.abs(se-Z)<.005||(Q.current=Z,Ce(Z))},[]),ie=s.useMemo(()=>S&&typeof j=="number"?j:1,[j,S]),ue=Z=>`calc(${Z} * var(--${d}-fit, 1))`,fe=s.useMemo(()=>{var Z,se,Se,Me,$e;return{fontFamily:po(e==null?void 0:e.textFontFamily),fontWeight:(Z=e==null?void 0:e.textFontSettings)==null?void 0:Z.fontWeight,fontStyle:(se=e==null?void 0:e.textFontSettings)==null?void 0:se.fontStyle,fontSize:ue(D.scalingValue((e==null?void 0:e.textFontSize)??.012,u)),lineHeight:ue(D.scalingValue((e==null?void 0:e.textLineHeight)??(e==null?void 0:e.textFontSize)??.012,u)),letterSpacing:ue(D.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:ue(D.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(Se=e==null?void 0:e.textTextAppearance)==null?void 0:Se.textTransform,textDecoration:(Me=e==null?void 0:e.textTextAppearance)==null?void 0:Me.textDecoration,fontVariant:($e=e==null?void 0:e.textTextAppearance)==null?void 0:$e.fontVariant}},[e,u,d]),K={[`--${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:{...K},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:ie,onFitScale:Te,dropCapLines:V,dropCapSize:N,showGuides:(q||B)&&$,typography:fe,imageUrl:v==="avoid"?e==null?void 0:e.image:null,imageFocalX:ye.focalX,imageFocalY:ye.focalY,imageScale:ye.scale,imageCustomPath:de,pathDragActive:X,pathCarryImage:L,onCarryImageConsumed:U,pathEditor:$?z: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';
@@ -25702,6 +25702,9 @@ const SCALE_HANDLE_OUTSET = 10;
25702
25702
  const ADD_POINT_REACH = 24;
25703
25703
  /** Catch radius for snapping a dragged anchor/handle onto another node's anchor or handle, in pixels. */
25704
25704
  const NODE_SNAP_REACH = 14;
25705
+ /** Pointer travel below this (px) still counts as a click — used so ⌘/Ctrl+click can
25706
+ * toggle node type without a sub-pixel jitter counting as a free-move drag. */
25707
+ const CLICK_SLOP_PX = 4;
25705
25708
  /** Nudge step for arrow keys, in path units. */
25706
25709
  const NUDGE_STEP = 1;
25707
25710
  /** Smallest allowed uniform scale while dragging a corner (avoids collapse). */
@@ -25717,6 +25720,8 @@ type PathDrag = {
25717
25720
  node: number;
25718
25721
  pointerId: number;
25719
25722
  origin: Pt;
25723
+ /** Screen position at pointer-down — click vs drag is decided in pixels, not path space. */
25724
+ clientOrigin: Pt;
25720
25725
  anchor: Pt;
25721
25726
  /** The shape's centre when the drag began — its axis of symmetry, held still
25722
25727
  * so the point being dragged can't drag the axis along with it. */
@@ -26146,10 +26151,11 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, stretchToBox, stag
26146
26151
  y: drag.anchor.y + (point.y - drag.origin.y),
26147
26152
  };
26148
26153
  const targets = freeDrag ? [] : collectSnapTargets(contoursRef.current, { contour: drag.contour, node: drag.node });
26149
- // Two axes are worth being symmetric about: the shape's own centre, and
26150
- // the frame's. They coincide until the shape is moved off centre, and
26151
- // the guide says which one is holding when they don't.
26152
- const centers = freeDrag ? [] : [drag.center, frameCenter].filter(Boolean) as Pt[];
26154
+ // Symmetry axis for a dragged point is the shape's own centre (latched at
26155
+ // pointer-down so moving the point can't drag the axis with it). Frame
26156
+ // centering is handled by whole-shape drag — offering both here draws
26157
+ // identical centre guides at two places whenever the shape is off-centre.
26158
+ const centers = freeDrag || !drag.center ? [] : [drag.center];
26153
26159
  const snapX = nearestAxisSnap(axisCandidates(targets, centers.map(center => center.x), 'x'), raw, 'x', toPx, NODE_SNAP_REACH);
26154
26160
  const snapY = nearestAxisSnap(axisCandidates(targets, centers.map(center => center.y), 'y'), raw, 'y', toPx, NODE_SNAP_REACH);
26155
26161
  const landing = freeDrag
@@ -26246,11 +26252,16 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, stretchToBox, stag
26246
26252
  event.stopPropagation();
26247
26253
  const svg = svgRef.current;
26248
26254
  if (svg?.hasPointerCapture(drag.pointerId)) svg.releasePointerCapture(drag.pointerId);
26249
- if (drag.moved) {
26250
- commitContours(contoursRef.current);
26255
+ const clientTravel = Math.hypot(event.clientX - drag.clientOrigin.x, event.clientY - drag.clientOrigin.y);
26256
+ // Path-space \`moved\` can stay false when Control+drag on macOS loses capture
26257
+ // before any pointermove (context-menu gesture). Screen travel still means
26258
+ // this was a drag — only a real unmoved pointerup may toggle type.
26259
+ const travelled = drag.moved || clientTravel > CLICK_SLOP_PX;
26260
+ if (travelled) {
26261
+ if (drag.moved) commitContours(contoursRef.current);
26251
26262
  return;
26252
26263
  }
26253
- if (!drag.toggleOnRelease) return;
26264
+ if (!drag.toggleOnRelease || event.type !== 'pointerup') return;
26254
26265
  const next = toggleNodeSmooth(contoursRef.current, drag.contour, drag.node);
26255
26266
  if (next === contoursRef.current) return;
26256
26267
  onChange(next);
@@ -26362,6 +26373,7 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, stretchToBox, stag
26362
26373
  node: nodeIndex,
26363
26374
  pointerId: event.pointerId,
26364
26375
  origin: toPath(event.clientX, event.clientY),
26376
+ clientOrigin: { x: event.clientX, y: event.clientY },
26365
26377
  anchor: node.p,
26366
26378
  center: contoursCenter(contours),
26367
26379
  mirror: kind !== 'anchor' && Boolean(node.in && node.out),
@@ -26464,6 +26476,11 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, stretchToBox, stag
26464
26476
  onPointerUp={endDrag}
26465
26477
  onPointerCancel={endDrag}
26466
26478
  onLostPointerCapture={endDrag}
26479
+ onContextMenu={(event) => {
26480
+ // macOS treats Control+click as a context-menu gesture; without this,
26481
+ // capture is lost mid-drag and a free-move is misread as a type toggle.
26482
+ event.preventDefault();
26483
+ }}
26467
26484
  data-pretext-path-editor
26468
26485
  data-selection="none"
26469
26486
  >
@@ -27904,4 +27921,4 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
27904
27921
  </>
27905
27922
  );
27906
27923
  }
27907
- `,Bc=[...mu],LS={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},PS={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",title:"Shape",display:{type:"drop-down",label:"Shape",enum:Bc},enum:Bc},customPath:{type:"string",scope:"layout",title:"Path",tooltip:"SVG path (M…) or a point list (0,0 100,0 50,100). Used when Shape is set to custom.",display:{type:"full-width-input",placeholder:"M0,0 C…"}},pathSnap:{type:"number",scope:"common",title:"Snap",tooltip:"Grid the points snap to while dragging, in path units (the path box is 100 x 100). 0 is off.",min:0,max:25,step:.5,display:{type:"numeric-input"}},pathFit:{type:"string",scope:"common",title:"Path fit",tooltip:"Stretch — the drawing fills the box. Viewbox — the drawing keeps its position in path coordinates (0–100).",display:{type:"toggle-cycle",enum:["stretch","viewbox"]}},shapeMode:{type:"string",scope:"common",title:"",tooltip:"A — text fills the path. B — text flows around the path.",display:{type:"radio-group"},enum:["A","B"]},fitText:{type:"string",scope:"common",title:"Fit text",tooltip:"Scales the type down until all text fits the path.",display:{type:"toggle-cycle",enum:["off","on"]}},dropCap:{type:"string",scope:"common",title:"Drop cap",display:{type:"toggle-cycle",enum:["off","on"]}},dropCapLines:{type:"number",scope:"common",title:"Drop cap lines",min:2,max:8,step:1,display:{type:"numeric-input"}},dropCapSize:{type:"number",scope:"common",title:"Drop cap size",tooltip:"Height of the drop cap, in lines of body text.",min:1,max:8,step:.5,display:{type:"common-numeric-input"}},image:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},backgroundColor:{type:"string",scope:"common",title:"Background",display:{type:"settings-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...LS.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},textAlign:{type:"string",scope:"layout",title:"",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textTextAppearance:{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"]}}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"style-panel-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link",display:{type:"style-panel-color-picker"}}},defaults:{shape:"diamond",customPath:"",pathSnap:0,pathFit:"stretch",shapeMode:"A",fitText:"off",dropCap:"off",dropCapLines:3,dropCapSize:3,image:null,backgroundColor:"rgba(0, 0, 0, 0)",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textAlign:"center",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",linkColor:"#000000"},layoutDefaults:{m:{textFontSize:.037,textLineHeight:.048,textLetterSpacing:0,textWordSpacing:0},t:{textFontSize:.018,textLineHeight:.024,textLetterSpacing:0,textWordSpacing:0},d:{textFontSize:.011,textLineHeight:.0155,textLetterSpacing:0,textWordSpacing:0}},layout:["__componentName__","shape","customPath","pathSnap","pathFit","shapeMode","fitText","dropCap","dropCapLines","dropCapSize","image"],displayRules:[{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.image.display.visible",value:!1}},{if:{name:"dropCap",value:"on",isNotEqual:!0},then:{name:"properties.dropCapSize.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["shapeMode"]},{type:"row",items:["shape"]},{type:"row",items:["image","dropCap"]},{type:"row",items:["dropCapSize"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textAlign","textTextAppearance"]}]}],paletteBookmark:{items:["textColor","linkColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0,addItemFromFileExplorer:!1},display:{type:"array"},items:{type:"object",properties:{text:{label:"Text",placeholder:"Add Text...",display:{type:"rich-text"}}}},default:[{text:[{type:"paragraph",children:[{text:"Style is viewed by many as a shallow obsession with disembodied surfaces. However our activities as designers are based on style’s function as a cultural communicator. A vocabulary or set of formal characteristics constitutes a particular style, recognized most frequently in retrospect. Style itself is the visual language of a culture: in fashion, in consumer goods, in art, in literature, in all media. Style is ephemeral; it is timely. To be in style is to embody the influences and values of your time."}]}]}]}},ES={element:IS,id:"pretext",name:"Pretext",category:"typography",version:1,normalizeLayoutSettingsUpdate:(e,t)=>{const n=e.shape;return typeof n!="string"||n==="custom"||mu.indexOf(n)===-1?e:{...e,...Ow(n,1,t)}},defaultSize:{d:{width:380,height:382},t:{width:380,height:382},m:{width:334,height:336}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple-Marquee.mp4"},schema:PS,sourceCode:RS,assetsPaths:{content:[],parameters:[{path:"image",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},MS=[Am,Om,_v,kg,Bg,Zg,fh,Bh,qh,tf,Rf,by,$x,Ax,hv,Iv,Yv,j0,o0,ab,Wb,ww,ES];exports.components=MS;exports.isSchemaV1=$u;
27924
+ `,Bc=[...mu],PS={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ES={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",title:"Shape",display:{type:"drop-down",label:"Shape",enum:Bc},enum:Bc},customPath:{type:"string",scope:"layout",title:"Path",tooltip:"SVG path (M…) or a point list (0,0 100,0 50,100). Used when Shape is set to custom.",display:{type:"full-width-input",placeholder:"M0,0 C…"}},pathSnap:{type:"number",scope:"common",title:"Snap",tooltip:"Grid the points snap to while dragging, in path units (the path box is 100 x 100). 0 is off.",min:0,max:25,step:.5,display:{type:"numeric-input"}},pathFit:{type:"string",scope:"common",title:"Path fit",tooltip:"Stretch — the drawing fills the box. Viewbox — the drawing keeps its position in path coordinates (0–100).",display:{type:"toggle-cycle",enum:["stretch","viewbox"]}},shapeMode:{type:"string",scope:"common",title:"",tooltip:"A — text fills the path. B — text flows around the path.",display:{type:"radio-group"},enum:["A","B"]},fitText:{type:"string",scope:"common",title:"Fit text",tooltip:"Scales the type down until all text fits the path.",display:{type:"toggle-cycle",enum:["off","on"]}},dropCap:{type:"string",scope:"common",title:"Drop cap",display:{type:"toggle-cycle",enum:["off","on"]}},dropCapLines:{type:"number",scope:"common",title:"Drop cap lines",min:2,max:8,step:1,display:{type:"numeric-input"}},dropCapSize:{type:"number",scope:"common",title:"Drop cap size",tooltip:"Height of the drop cap, in lines of body text.",min:1,max:8,step:.5,display:{type:"common-numeric-input"}},image:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},backgroundColor:{type:"string",scope:"common",title:"Background",display:{type:"settings-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...PS.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},textAlign:{type:"string",scope:"layout",title:"",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textTextAppearance:{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"]}}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"style-panel-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link",display:{type:"style-panel-color-picker"}}},defaults:{shape:"diamond",customPath:"",pathSnap:0,pathFit:"stretch",shapeMode:"A",fitText:"off",dropCap:"off",dropCapLines:3,dropCapSize:3,image:null,backgroundColor:"rgba(0, 0, 0, 0)",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textAlign:"center",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",linkColor:"#000000"},layoutDefaults:{m:{textFontSize:.037,textLineHeight:.048,textLetterSpacing:0,textWordSpacing:0},t:{textFontSize:.018,textLineHeight:.024,textLetterSpacing:0,textWordSpacing:0},d:{textFontSize:.011,textLineHeight:.0155,textLetterSpacing:0,textWordSpacing:0}},layout:["__componentName__","shape","customPath","pathSnap","pathFit","shapeMode","fitText","dropCap","dropCapLines","dropCapSize","image"],displayRules:[{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.image.display.visible",value:!1}},{if:{name:"dropCap",value:"on",isNotEqual:!0},then:{name:"properties.dropCapSize.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["shapeMode"]},{type:"row",items:["shape"]},{type:"row",items:["image","dropCap"]},{type:"row",items:["dropCapSize"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textAlign","textTextAppearance"]}]}],paletteBookmark:{items:["textColor","linkColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0,addItemFromFileExplorer:!1},display:{type:"array"},items:{type:"object",properties:{text:{label:"Text",placeholder:"Add Text...",display:{type:"rich-text"}}}},default:[{text:[{type:"paragraph",children:[{text:"Style is viewed by many as a shallow obsession with disembodied surfaces. However our activities as designers are based on style’s function as a cultural communicator. A vocabulary or set of formal characteristics constitutes a particular style, recognized most frequently in retrospect. Style itself is the visual language of a culture: in fashion, in consumer goods, in art, in literature, in all media. Style is ephemeral; it is timely. To be in style is to embody the influences and values of your time."}]}]}]}},MS={element:RS,id:"pretext",name:"Pretext",category:"typography",version:1,normalizeLayoutSettingsUpdate:(e,t)=>{const n=e.shape;return typeof n!="string"||n==="custom"||mu.indexOf(n)===-1?e:{...e,...Ow(n,1,t)}},defaultSize:{d:{width:380,height:382},t:{width:380,height:382},m:{width:334,height:336}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple-Marquee.mp4"},schema:ES,sourceCode:LS,assetsPaths:{content:[],parameters:[{path:"image",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},kS=[Am,Om,_v,kg,Bg,Zg,fh,Bh,qh,tf,Rf,by,$x,Ax,hv,Iv,Yv,j0,o0,ab,Wb,ww,MS];exports.components=kS;exports.isSchemaV1=$u;