@cntrl-site/components 1.0.62-alpha.1 → 1.0.62-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.
- package/dist/Components/MarqueeText/MarqueeText.d.ts +1 -2
- package/dist/index.js +180 -99
- package/dist/index.mjs +5672 -5569
- 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 r=require("react/jsx-runtime"),a=require("react"),rt=require("classnames"),$=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Yn=require("react-dom");function Xc(e){return e.type==="object"&&e.version===1}const Yc="ControlSlider-module__wrapper___sHEkd",Zc="ControlSlider-module__hoverArrow___A-dOH",Jc="ControlSlider-module__sliderItem___QQSkR",Qc="ControlSlider-module__sliderImage___9hRl-",ed="ControlSlider-module__arrow___05ghY",td="ControlSlider-module__arrowVertical___tBfVN",nd="ControlSlider-module__nextArrow___-30Yc",id="ControlSlider-module__arrowInner___aEra3",od="ControlSlider-module__arrowIcon___S4ztF",rd="ControlSlider-module__arrowImg___2dwJW",ad="ControlSlider-module__mirror___brd6U",sd="ControlSlider-module__pagination___bicLF",ld="ControlSlider-module__paginationInner___bT-P-",cd="ControlSlider-module__paginationVertical___zYqKw",dd="ControlSlider-module__paginationItem___nTRbk",ud="ControlSlider-module__dot___p1Qun",pd="ControlSlider-module__activeDot___LHFaj",md="ControlSlider-module__paginationInsideBottom___R3FWn",gd="ControlSlider-module__paginationInsideTop___V-qb-",hd="ControlSlider-module__paginationOutsideBottom___14w8D",fd="ControlSlider-module__paginationOutsideTop___SCLqB",yd="ControlSlider-module__paginationInsideLeft___yOBRZ",vd="ControlSlider-module__paginationInsideRight___Rtt3o",xd="ControlSlider-module__paginationOutsideLeft___lahaw",bd="ControlSlider-module__paginationOutsideRight___EtuQa",wd="ControlSlider-module__imgWrapper___UjEgB",Sd="ControlSlider-module__captionBlock___dJ6-j",$d="ControlSlider-module__captionTextWrapper___HFlpf",Cd="ControlSlider-module__captionText___uGBVc",Td="ControlSlider-module__active___WZK4G",Ld="ControlSlider-module__withPointerEvents___t-18M",Rd="ControlSlider-module__topLeftAlignment___zjnGM",Id="ControlSlider-module__topCenterAlignment___gD1xW",Ed="ControlSlider-module__topRightAlignment___NMapS",Md="ControlSlider-module__middleLeftAlignment___OnUrY",Pd="ControlSlider-module__middleCenterAlignment___Tdkl0",kd="ControlSlider-module__middleRightAlignment___wEbfX",Ad="ControlSlider-module__bottomLeftAlignment___cTP2-",Fd="ControlSlider-module__bottomCenterAlignment___c54fB",Wd="ControlSlider-module__bottomRightAlignment___kEwrz",_d="ControlSlider-module__clickOverlay___DZA28",Nd="ControlSlider-module__contain___pLyq7",Hd="ControlSlider-module__cover___KdDat",ot={wrapper:Yc,hoverArrow:Zc,sliderItem:Jc,sliderImage:Qc,arrow:ed,arrowVertical:td,nextArrow:nd,arrowInner:id,arrowIcon:od,arrowImg:rd,mirror:ad,pagination:sd,paginationInner:ld,paginationVertical:cd,paginationItem:dd,dot:ud,activeDot:pd,paginationInsideBottom:md,paginationInsideTop:gd,paginationOutsideBottom:hd,paginationOutsideTop:fd,paginationInsideLeft:yd,paginationInsideRight:vd,paginationOutsideLeft:xd,paginationOutsideRight:bd,imgWrapper:wd,captionBlock:Sd,captionTextWrapper:$d,captionText:Cd,active:Td,withPointerEvents:Ld,topLeftAlignment:Rd,topCenterAlignment:Id,topRightAlignment:Ed,middleLeftAlignment:Md,middleCenterAlignment:Pd,middleRightAlignment:kd,bottomLeftAlignment:Ad,bottomCenterAlignment:Fd,bottomRightAlignment:Wd,clickOverlay:_d,contain:Nd,cover:Hd};function Od(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 Dd(e,t,n){return t&&Od(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var us="(prefers-reduced-motion: reduce)",Pi=1,jd=2,_i=3,Xi=4,Lo=5,tr=6,lr=7,zd={CREATED:Pi,MOUNTED:jd,IDLE:_i,MOVING:Xi,SCROLLING:Lo,DRAGGING:tr,DESTROYED:lr};function Wn(e){e.length=0}function Zn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Vt(e){return e.bind.apply(e,[null].concat(Zn(arguments,1)))}var Al=setTimeout,ha=function(){};function ps(e){return requestAnimationFrame(e)}function vr(e,t){return typeof t===e}function go(e){return!ka(e)&&vr("object",e)}var Pa=Array.isArray,Fl=Vt(vr,"function"),qn=Vt(vr,"string"),Ro=Vt(vr,"undefined");function ka(e){return e===null}function Wl(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Io(e){return Pa(e)?e:[e]}function yn(e,t){Io(e).forEach(t)}function Aa(e,t){return e.indexOf(t)>-1}function nr(e,t){return e.push.apply(e,Io(t)),e}function Mn(e,t,n){e&&yn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){Mn(e,qn(t)?t.split(" "):t,!0)}function Eo(e,t){yn(t,e.appendChild.bind(e))}function Fa(e,t){yn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ho(e,t){return Wl(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function _l(e,t){var n=e?Zn(e.children):[];return t?n.filter(function(i){return ho(i,t)}):n}function Mo(e,t){return t?_l(e,t)[0]:e.firstElementChild}var fo=Object.keys;function mi(e,t,n){return e&&(n?fo(e).reverse():fo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function yo(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){Pa(n)?e[i]=n.slice():go(n)?e[i]=zn({},go(e[i])?e[i]:{},n):e[i]=n})}),e}function ms(e,t){yn(t||fo(e),function(n){delete e[n]})}function Ln(e,t){yn(e,function(n){yn(t,function(i){n&&n.removeAttribute(i)})})}function St(e,t,n){go(t)?mi(t,function(i,o){St(e,o,i)}):yn(e,function(i){ka(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function ki(e,t,n){var i=document.createElement(e);return t&&(qn(t)?Tn(i,t):St(i,t)),n&&Eo(n,i),i}function xn(e,t,n){if(Ro(n))return getComputedStyle(e)[t];ka(n)||(e.style[t]=""+n)}function vo(e,t){xn(e,"display",t)}function Nl(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function bn(e,t){return e.getAttribute(t)}function gs(e,t){return e&&e.classList.contains(t)}function mn(e){return e.getBoundingClientRect()}function hi(e){yn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Hl(e){return Mo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Ol(e,t){return e&&e.querySelector(t)}function Wa(e,t){return t?Zn(e.querySelectorAll(t)):[]}function Pn(e,t){Mn(e,t,!1)}function fa(e){return e.timeStamp}function ii(e){return qn(e)?e:e?e+"px":""}var Po="splide",_a="data-"+Po;function co(e,t){if(!e)throw new Error("["+Po+"] "+(t||""))}var Un=Math.min,cr=Math.max,dr=Math.floor,xo=Math.ceil,ln=Math.abs;function Dl(e,t,n){return ln(e-t)<n}function ir(e,t,n,i){var o=Un(t,n),s=cr(t,n);return i?o<e&&e<s:o<=e&&e<=s}function Ri(e,t,n){var i=Un(t,n),o=cr(t,n);return Un(cr(i,e),o)}function ya(e){return+(e>0)-+(e<0)}function va(e,t){return yn(t,function(n){e=e.replace("%s",""+n)}),e}function Na(e){return e<10?"0"+e:""+e}var hs={};function Bd(e){return""+e+Na(hs[e]=(hs[e]||0)+1)}function jl(){var e=[];function t(l,d,c,u){o(l,d,function(p,w,b){var h="addEventListener"in p,g=h?p.removeEventListener.bind(p,w,c,u):p.removeListener.bind(p,c);h?p.addEventListener(w,c,u):p.addListener(c),e.push([p,w,b,c,g])})}function n(l,d,c){o(l,d,function(u,p,w){e=e.filter(function(b){return b[0]===u&&b[1]===p&&b[2]===w&&(!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){yn(l,function(u){u&&yn(d,function(p){p.split(" ").forEach(function(w){var b=w.split(".");c(u,b[0],b[1])})})})}function s(){e.forEach(function(l){l[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var Jn="mounted",xa="ready",_n="move",Yi="moved",Ha="click",zl="active",Bl="inactive",Vl="visible",Gl="hidden",Qt="refresh",an="updated",Ni="resize",xr="resized",ql="drag",Ul="dragging",Kl="dragged",br="scroll",vi="scrolled",Vd="overflow",Oa="destroy",Xl="arrows:mounted",Yl="arrows:updated",Zl="pagination:mounted",Jl="pagination:updated",Da="navigation:mounted",ja="autoplay:play",Ql="autoplay:playing",za="autoplay:pause",Ba="lazyload:loaded",ec="sk",tc="sh",ur="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=jl();function i(s,l){n.bind(t,Io(s).join(" "),function(d){l.apply(l,Pa(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,Zn(arguments,1))}return e&&e.event.on(Oa,n.destroy),yo(n,{bus:t,on:i,off:Vt(n.unbind,t),emit:o})}function wr(e,t,n,i){var o=Date.now,s,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?Un((o()-s)/e,1):1,n&&n(l),l>=1&&(t(),s=o(),i&&++u>=i))return b();d=ps(p)}}function w(M){M||g(),s=o()-(M?l*e:0),c=!1,d=ps(p)}function b(){c=!0}function h(){s=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function m(M){e=M}function x(){return c}return{start:w,rewind:h,pause:b,cancel:g,set:m,isPaused:x}}function Gd(e){var t=e;function n(o){t=o}function i(o){return Aa(Io(o),t)}return{set:n,is:i}}function qd(e,t){var n=wr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Ud(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=jl(),d=[];function c(){var g=n.mediaQuery==="min";fo(o).sort(function(m,x){return g?+m-+x:+x-+m}).forEach(function(m){p(o[m],"("+(g?"min":"max")+"-width:"+m+"px)")}),p(s,us),w()}function u(g){g&&l.destroy()}function p(g,m){var x=matchMedia(m);l.bind(x,"change",w),d.push([g,x])}function w(){var g=i.is(lr),m=n.direction,x=d.reduce(function(M,E){return zn(M,E[1].matches?E[0]:{})},{});ms(n),h(x),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):m!==n.direction&&e.refresh()}function b(g){matchMedia(us).matches&&(g?zn(n,s):ms(n,fo(s)))}function h(g,m,x){zn(n,g),m&&zn(Object.getPrototypeOf(n),g),(x||!i.is(Pi))&&e.emit(an,n)}return{setup:c,destroy:u,reduce:b,set:h}}var Sr="Arrow",$r=Sr+"Left",Cr=Sr+"Right",nc=Sr+"Up",ic=Sr+"Down",fs="rtl",Tr="ttb",Or={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[nc,Cr],ArrowRight:[ic,$r]};function Kd(e,t,n){function i(s,l,d){d=d||n.direction;var c=d===fs&&!l?1:d===Tr?0:-1;return Or[s]&&Or[s][c]||s.replace(/width|left|right/i,function(u,p){var w=Or[u.toLowerCase()][c]||u;return p>0?w.charAt(0).toUpperCase()+w.slice(1):w})}function o(s){return s*(n.direction===fs?1:-1)}return{resolve:i,orient:o}}var kn="role",Ai="tabindex",Xd="disabled",wn="aria-",ko=wn+"controls",oc=wn+"current",ys=wn+"selected",hn=wn+"label",Va=wn+"labelledby",rc=wn+"hidden",Ga=wn+"orientation",bo=wn+"roledescription",vs=wn+"live",xs=wn+"busy",bs=wn+"atomic",qa=[kn,Ai,Xd,ko,oc,hn,Va,rc,Ga,bo],Rn=Po+"__",Qn="is-",Dr=Po,ws=Rn+"track",Yd=Rn+"list",Lr=Rn+"slide",ac=Lr+"--clone",Zd=Lr+"__container",Ua=Rn+"arrows",Rr=Rn+"arrow",sc=Rr+"--prev",lc=Rr+"--next",Ir=Rn+"pagination",cc=Ir+"__page",Jd=Rn+"progress",Qd=Jd+"__bar",eu=Rn+"toggle",tu=Rn+"spinner",nu=Rn+"sr",iu=Qn+"initialized",fi=Qn+"active",dc=Qn+"prev",uc=Qn+"next",ba=Qn+"visible",wa=Qn+"loading",pc=Qn+"focus-in",mc=Qn+"overflow",ou=[fi,ba,dc,uc,wa,pc,mc],ru={slide:Lr,clone:ac,arrows:Ua,arrow:Rr,prev:sc,next:lc,pagination:Ir,page:cc,spinner:tu};function au(e,t){if(Fl(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ho(n,t);)n=n.parentElement;return n}var su=5,Ss=200,gc="touchstart mousedown",jr="touchmove mousemove",zr="touchend touchcancel mouseup click";function lu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],w=[],b,h,g;function m(){R(),Z(),E()}function x(){o(Qt,M),o(Qt,m),o(an,E),s(document,gc+" keydown",function(F){g=F.type==="keydown"},{capture:!0}),s(l,"focusin",function(){Mn(l,pc,!!g)})}function M(F){var C=qa.concat("style");Wn(u),Pn(l,p),Pn(b,w),Ln([b,h],C),Ln(l,F?C:["style",bo])}function E(){Pn(l,p),Pn(b,w),p=U(Dr),w=U(ws),Tn(l,p),Tn(b,w),St(l,hn,n.label),St(l,Va,n.labelledby)}function R(){b=_("."+ws),h=Mo(b,"."+Yd),co(b&&h,"A track/list element is missing."),nr(u,_l(h,"."+Lr+":not(."+ac+")")),mi({arrows:Ua,pagination:Ir,prev:sc,next:lc,bar:Qd,toggle:eu},function(F,C){c[C]=_("."+F)}),yo(c,{root:l,track:b,list:h,slides:u})}function Z(){var F=l.id||Bd(Po),C=n.role;l.id=F,b.id=b.id||F+"-track",h.id=h.id||F+"-list",!bn(l,kn)&&l.tagName!=="SECTION"&&C&&St(l,kn,C),St(l,bo,d.carousel),St(h,kn,"presentation")}function _(F){var C=Ol(l,F);return C&&au(C,"."+Dr)===l?C:void 0}function U(F){return[F+"--"+n.type,F+"--"+n.direction,n.drag&&F+"--draggable",n.isNavigation&&F+"--nav",F===Dr&&fi]}return yo(c,{setup:m,mount:x,destroy:M})}var Hi="slide",Zi="loop",Ao="fade";function cu(e,t,n,i){var o=Kt(e),s=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,w=p.isNavigation,b=p.updateOnMove,h=p.i18n,g=p.pagination,m=p.slideFocus,x=c.Direction.resolve,M=bn(i,"style"),E=bn(i,hn),R=n>-1,Z=Mo(i,"."+Zd),_;function U(){R||(i.id=u.id+"-slide"+Na(t+1),St(i,kn,g?"tabpanel":"group"),St(i,bo,h.slide),St(i,hn,E||va(h.slideLabel,[t+1,e.length]))),F()}function F(){d(i,"click",Vt(l,Ha,oe)),d(i,"keydown",Vt(l,ec,oe)),s([Yi,tc,vi],N),s(Da,z),b&&s(_n,y)}function C(){_=!0,o.destroy(),Pn(i,ou),Ln(i,qa),St(i,"style",M),St(i,hn,E||"")}function z(){var S=e.splides.map(function(P){var D=P.splide.Components.Slides.getAt(t);return D?D.slide.id:""}).join(" ");St(i,hn,va(h.slideX,(R?n:t)+1)),St(i,ko,S),St(i,kn,m?"button":""),m&&Ln(i,bo)}function y(){_||N()}function N(){if(!_){var S=e.index;I(),J(),Mn(i,dc,t===S-1),Mn(i,uc,t===S+1)}}function I(){var S=X();S!==gs(i,fi)&&(Mn(i,fi,S),St(i,oc,w&&S||""),l(S?zl:Bl,oe))}function J(){var S=G(),P=!S&&(!X()||R);if(e.state.is([Xi,Lo])||St(i,rc,P||""),St(Wa(i,p.focusableNodes||""),Ai,P?-1:""),m&&St(i,Ai,P?-1:0),S!==gs(i,ba)&&(Mn(i,ba,S),l(S?Vl:Gl,oe)),!S&&document.activeElement===i){var D=c.Slides.getAt(e.index);D&&Nl(D.slide)}}function k(S,P,D){xn(D&&Z||i,S,P)}function X(){var S=e.index;return S===t||p.cloneStatus&&S===n}function G(){if(e.is(Ao))return X();var S=mn(c.Elements.track),P=mn(i),D=x("left",!0),re=x("right",!0);return dr(S[D])<=xo(P[D])&&dr(P[re])<=xo(S[re])}function V(S,P){var D=ln(S-t);return!R&&(p.rewind||e.is(Zi))&&(D=Un(D,e.length-D)),D<=P}var oe={index:t,slideIndex:n,slide:i,container:Z,isClone:R,mount:U,destroy:C,update:N,style:k,isWithin:V};return oe}function du(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function w(){b(),o(Qt,h),o(Qt,b)}function b(){c.forEach(function(N,I){m(N,I,-1)})}function h(){_(function(N){N.destroy()}),Wn(p)}function g(){_(function(N){N.update()})}function m(N,I,J){var k=cu(e,I,J,N);k.mount(),p.push(k),p.sort(function(X,G){return X.index-G.index})}function x(N){return N?U(function(I){return!I.isClone}):p}function M(N){var I=t.Controller,J=I.toIndex(N),k=I.hasFocus()?1:n.perPage;return U(function(X){return ir(X.index,J,J+k-1)})}function E(N){return U(N)[0]}function R(N,I){yn(N,function(J){if(qn(J)&&(J=Hl(J)),Wl(J)){var k=c[I];k?Fa(J,k):Eo(u,J),Tn(J,n.classes.slide),C(J,Vt(s,Ni))}}),s(Qt)}function Z(N){hi(U(N).map(function(I){return I.slide})),s(Qt)}function _(N,I){x(I).forEach(N)}function U(N){return p.filter(Fl(N)?N:function(I){return qn(N)?ho(I.slide,N):Aa(Io(N),I.index)})}function F(N,I,J){_(function(k){k.style(N,I,J)})}function C(N,I){var J=Wa(N,"img"),k=J.length;k?J.forEach(function(X){l(X,"load error",function(){--k||I()})}):I()}function z(N){return N?c.length:p.length}function y(){return p.length>n.perPage}return{mount:w,destroy:h,update:g,register:m,get:x,getIn:M,getAt:E,add:R,remove:Z,forEach:_,filter:U,style:F,getLength:z,isEnough:y}}function uu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,w=u.track,b=u.list,h=d.getAt,g=d.style,m,x,M;function E(){R(),s(window,"resize load",qd(Vt(l,Ni))),o([an,Qt],R),o(Ni,Z)}function R(){m=n.direction===Tr,xn(p,"maxWidth",ii(n.width)),xn(w,c("paddingLeft"),_(!1)),xn(w,c("paddingRight"),_(!0)),Z(!0)}function Z(oe){var S=mn(p);(oe||x.width!==S.width||x.height!==S.height)&&(xn(w,"height",U()),g(c("marginRight"),ii(n.gap)),g("width",C()),g("height",z(),!0),x=S,l(xr),M!==(M=V())&&(Mn(p,mc,M),l(Vd,M)))}function _(oe){var S=n.padding,P=c(oe?"right":"left");return S&&ii(S[P]||(go(S)?0:S))||"0px"}function U(){var oe="";return m&&(oe=F(),co(oe,"height or heightRatio is missing."),oe="calc("+oe+" - "+_(!1)+" - "+_(!0)+")"),oe}function F(){return ii(n.height||mn(b).width*n.heightRatio)}function C(){return n.autoWidth?null:ii(n.fixedWidth)||(m?"":y())}function z(){return ii(n.fixedHeight)||(m?n.autoHeight?null:y():F())}function y(){var oe=ii(n.gap);return"calc((100%"+(oe&&" + "+oe)+")/"+(n.perPage||1)+(oe&&" - "+oe)+")"}function N(){return mn(b)[c("width")]}function I(oe,S){var P=h(oe||0);return P?mn(P.slide)[c("width")]+(S?0:X()):0}function J(oe,S){var P=h(oe);if(P){var D=mn(P.slide)[c("right")],re=mn(b)[c("left")];return ln(D-re)+(S?0:X())}return 0}function k(oe){return J(e.length-1)-J(0)+I(0,oe)}function X(){var oe=h(0);return oe&&parseFloat(xn(oe.slide,c("marginRight")))||0}function G(oe){return parseFloat(xn(w,c("padding"+(oe?"Right":"Left"))))||0}function V(){return e.is(Ao)||k(!0)>N()}return{mount:E,resize:Z,listSize:N,slideSize:I,sliderSize:k,totalSize:J,getPadding:G,isOverflow:V}}var pu=2;function mu(e,t,n){var i=Kt(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,w),o([an,Ni],h),(u=x())&&(g(u),t.Layout.resize(!0))}function w(){b(),p()}function b(){hi(c),Wn(c),i.destroy()}function h(){var M=x();u!==M&&(u<M||!M)&&i.emit(Qt)}function g(M){var E=l.get().slice(),R=E.length;if(R){for(;E.length<M;)nr(E,E);nr(E.slice(-M),E.slice(0,M)).forEach(function(Z,_){var U=_<M,F=m(Z.slide,_);U?Fa(F,E[0].slide):Eo(s.list,F),nr(c,F),l.register(F,_-M+(U?0:R),Z.index)})}}function m(M,E){var R=M.cloneNode(!0);return Tn(R,n.classes.clone),R.id=e.root.id+"-clone"+Na(E+1),R}function x(){var M=n.clones;if(!e.is(Zi))M=0;else if(Ro(M)){var E=n[d("fixedWidth")]&&t.Layout.slideSize(0),R=E&&xo(mn(s.track)[d("width")]/E);M=R||n[d("autoWidth")]&&e.length||n.perPage*pu}return M}return{mount:p,destroy:b}}function gu(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,w=d.listSize,b=d.sliderSize,h=t.Direction,g=h.resolve,m=h.orient,x=t.Elements,M=x.list,E=x.track,R;function Z(){R=t.Transition,o([Jn,xr,an,Qt],_)}function _(){t.Controller.isBusy()||(t.Scroll.cancel(),F(e.index),t.Slides.update())}function U(P,D,re,ae){P!==D&&oe(P>re)&&(N(),C(y(k(),P>re),!0)),l(Xi),s(_n,D,re,P),R.start(D,function(){l(_i),s(Yi,D,re,P),ae&&ae()})}function F(P){C(J(P,!0))}function C(P,D){if(!e.is(Ao)){var re=D?P:z(P);xn(M,"transform","translate"+g("X")+"("+re+"px)"),P!==re&&s(tc)}}function z(P){if(e.is(Zi)){var D=I(P),re=D>t.Controller.getEnd(),ae=D<0;(ae||re)&&(P=y(P,re))}return P}function y(P,D){var re=P-V(D),ae=b();return P-=m(ae*(xo(ln(re)/ae)||1))*(D?1:-1),P}function N(){C(k(),!0),R.cancel()}function I(P){for(var D=t.Slides.get(),re=0,ae=1/0,T=0;T<D.length;T++){var ue=D[T].index,W=ln(J(ue,!0)-P);if(W<=ae)ae=W,re=ue;else break}return re}function J(P,D){var re=m(p(P-1)-G(P));return D?X(re):re}function k(){var P=g("left");return mn(M)[P]-mn(E)[P]+m(u(!1))}function X(P){return n.trimSpace&&e.is(Hi)&&(P=Ri(P,0,m(b(!0)-w()))),P}function G(P){var D=n.focus;return D==="center"?(w()-c(P,!0))/2:+D*c(P)||0}function V(P){return J(P?t.Controller.getEnd():0,!!n.trimSpace)}function oe(P){var D=m(y(k(),P));return P?D>=0:D<=M[g("scrollWidth")]-mn(E)[g("width")]}function S(P,D){D=Ro(D)?k():D;var re=P!==!0&&m(D)<m(V(!1)),ae=P!==!1&&m(D)>m(V(!0));return re||ae}return{mount:Z,move:U,jump:F,translate:C,shift:y,cancel:N,toIndex:I,toPosition:J,getPosition:k,getLimit:V,exceededLimit:S,reposition:_}}function hu(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,w=p.isEnough,b=p.getLength,h=n.omitEnd,g=e.is(Zi),m=e.is(Hi),x=Vt(k,!1),M=Vt(k,!0),E=n.start||0,R,Z=E,_,U,F;function C(){z(),o([an,Qt,ur],z),o(xr,y)}function z(){_=b(!0),U=n.perMove,F=n.perPage,R=oe();var W=Ri(E,0,h?R:_-1);W!==E&&(E=W,l.reposition())}function y(){R!==oe()&&s(ur)}function N(W,ie,ne){if(!ue()){var ye=J(W),Pe=V(ye);Pe>-1&&(ie||Pe!==E)&&(re(Pe),l.move(ye,Pe,Z,ne))}}function I(W,ie,ne,ye){t.Scroll.scroll(W,ie,ne,function(){var Pe=V(l.toIndex(d()));re(h?Un(Pe,R):Pe),ye&&ye()})}function J(W){var ie=E;if(qn(W)){var ne=W.match(/([+\-<>])(\d+)?/)||[],ye=ne[1],Pe=ne[2];ye==="+"||ye==="-"?ie=X(E+ +(""+ye+(+Pe||1)),E):ye===">"?ie=Pe?S(+Pe):x(!0):ye==="<"&&(ie=M(!0))}else ie=g?W:Ri(W,0,R);return ie}function k(W,ie){var ne=U||(T()?1:F),ye=X(E+ne*(W?-1:1),E,!(U||T()));return ye===-1&&m&&!Dl(d(),c(!W),1)?W?0:R:ie?ye:V(ye)}function X(W,ie,ne){if(w()||T()){var ye=G(W);ye!==W&&(ie=W,W=ye,ne=!1),W<0||W>R?!U&&(ir(0,W,ie,!0)||ir(R,ie,W,!0))?W=S(P(W)):g?W=ne?W<0?-(_%F||F):_:W:n.rewind?W=W<0?R:0:W=-1:ne&&W!==ie&&(W=S(P(ie)+(W<ie?-1:1)))}else W=-1;return W}function G(W){if(m&&n.trimSpace==="move"&&W!==E)for(var ie=d();ie===u(W,!0)&&ir(W,0,e.length-1,!n.rewind);)W<E?--W:++W;return W}function V(W){return g?(W+_)%_||0:W}function oe(){for(var W=_-(T()||g&&U?1:F);h&&W-- >0;)if(u(_-1,!0)!==u(W,!0)){W++;break}return Ri(W,0,_-1)}function S(W){return Ri(T()?W:F*W,0,R)}function P(W){return T()?Un(W,R):dr((W>=R?_-1:W)/F)}function D(W){var ie=l.toIndex(W);return m?Ri(ie,0,R):ie}function re(W){W!==E&&(Z=E,E=W)}function ae(W){return W?Z:E}function T(){return!Ro(n.focus)||n.isNavigation}function ue(){return e.state.is([Xi,Lo])&&!!n.waitForTransition}return{mount:C,go:N,scroll:I,getNext:x,getPrev:M,getAdjacent:k,getEnd:oe,setIndex:re,getIndex:ae,toIndex:S,toPage:P,toDest:D,hasFocus:T,isBusy:ue}}var fu="http://www.w3.org/2000/svg",yu="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",Oo=40;function vu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,w=u.arrows,b=u.track,h=w,g=u.prev,m=u.next,x,M,E={};function R(){_(),o(an,Z)}function Z(){U(),R()}function _(){var I=n.arrows;I&&!(g&&m)&&z(),g&&m&&(yo(E,{prev:g,next:m}),vo(h,I?"":"none"),Tn(h,M=Ua+"--"+n.direction),I&&(F(),N(),St([g,m],ko,b.id),l(Xl,g,m)))}function U(){i.destroy(),Pn(h,M),x?(hi(w?[g,m]:h),g=m=null):Ln([g,m],qa)}function F(){o([Jn,Yi,Qt,vi,ur],N),s(m,"click",Vt(C,">")),s(g,"click",Vt(C,"<"))}function C(I){p.go(I,!0)}function z(){h=w||ki("div",d.arrows),g=y(!0),m=y(!1),x=!0,Eo(h,[g,m]),!w&&Fa(h,b)}function y(I){var J='<button class="'+d.arrow+" "+(I?d.prev:d.next)+'" type="button"><svg xmlns="'+fu+'" viewBox="0 0 '+Oo+" "+Oo+'" width="'+Oo+'" height="'+Oo+'" focusable="false"><path d="'+(n.arrowPath||yu)+'" />';return Hl(J)}function N(){if(g&&m){var I=e.index,J=p.getPrev(),k=p.getNext(),X=J>-1&&I<J?c.last:c.prev,G=k>-1&&I>k?c.first:c.next;g.disabled=J<0,m.disabled=k<0,St(g,hn,X),St(m,hn,G),l(Yl,g,m,J,k)}}return{arrows:E,mount:R,destroy:U,update:N}}var xu=_a+"-interval";function bu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=wr(n.interval,e.go.bind(e,">"),F),c=d.isPaused,u=t.Elements,p=t.Elements,w=p.root,b=p.toggle,h=n.autoplay,g,m,x=h==="pause";function M(){h&&(E(),b&&St(b,ko,u.track.id),x||R(),U())}function E(){n.pauseOnHover&&s(w,"mouseenter mouseleave",function(z){g=z.type==="mouseenter",_()}),n.pauseOnFocus&&s(w,"focusin focusout",function(z){m=z.type==="focusin",_()}),b&&s(b,"click",function(){x?R():Z(!0)}),o([_n,br,Qt],d.rewind),o(_n,C)}function R(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),m=g=x=!1,U(),l(ja))}function Z(z){z===void 0&&(z=!0),x=!!z,U(),c()||(d.pause(),l(za))}function _(){x||(g||m?Z(!1):R())}function U(){b&&(Mn(b,fi,!x),St(b,hn,n.i18n[x?"play":"pause"]))}function F(z){var y=u.bar;y&&xn(y,"width",z*100+"%"),l(Ql,z)}function C(z){var y=t.Slides.getAt(z);d.set(y&&+bn(y.slide,xu)||n.interval)}return{mount:M,destroy:d.cancel,play:R,pause:Z,isPaused:c}}function wu(e,t,n){var i=Kt(e),o=i.on;function s(){n.cover&&(o(Ba,Vt(d,!0)),o([Jn,an,Qt],Vt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Mo(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),vo(u,c?"none":"")}return{mount:s,destroy:Vt(l,!1)}}var Su=10,$u=600,Cu=.6,Tu=1.5,Lu=800;function Ru(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,w=d.translate,b=e.is(Hi),h,g,m=1;function x(){o(_n,Z),o([an,Qt],_)}function M(F,C,z,y,N){var I=c();if(Z(),z&&(!b||!p())){var J=t.Layout.sliderSize(),k=ya(F)*J*dr(ln(F)/J)||0;F=d.toPosition(t.Controller.toDest(F%J))+k}var X=Dl(I,F,1);m=1,C=X?0:C||cr(ln(F-I)/Tu,Lu),g=y,h=wr(C,E,Vt(R,I,F,N),1),l(Lo),s(br),h.start()}function E(){l(_i),g&&g(),s(vi)}function R(F,C,z,y){var N=c(),I=F+(C-F)*U(y),J=(I-N)*m;w(N+J),b&&!z&&p()&&(m*=Cu,ln(J)<Su&&M(u(p(!0)),$u,!1,g,!0))}function Z(){h&&h.cancel()}function _(){h&&!h.isPaused()&&(Z(),E())}function U(F){var C=n.easingFunc;return C?C(F):1-Math.pow(1-F,4)}return{mount:x,destroy:Z,scroll:M,cancel:_}}var Ii={passive:!1,capture:!0};function Iu(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,w=t.Controller,b=t.Elements.track,h=t.Media.reduce,g=t.Direction,m=g.resolve,x=g.orient,M=u.getPosition,E=u.exceededLimit,R,Z,_,U,F,C=!1,z,y,N;function I(){l(b,jr,ha,Ii),l(b,zr,ha,Ii),l(b,gc,k,Ii),l(b,"click",V,{capture:!0}),l(b,"dragstart",En),o([Jn,an],J)}function J(){var K=n.drag;le(!K),U=K==="free"}function k(K){if(z=!1,!y){var ee=Pe(K);ye(K.target)&&(ee||!K.button)&&(w.isBusy()?En(K,!0):(N=ee?b:window,F=c.is([Xi,Lo]),_=null,l(N,jr,X,Ii),l(N,zr,G,Ii),u.cancel(),p.cancel(),oe(K)))}}function X(K){if(c.is(tr)||(c.set(tr),s(ql)),K.cancelable)if(F){u.translate(R+ne(T(K)));var ee=ue(K)>Ss,Y=C!==(C=E());(ee||Y)&&oe(K),z=!0,s(Ul),En(K)}else D(K)&&(F=P(K),En(K))}function G(K){c.is(tr)&&(c.set(_i),s(Kl)),F&&(S(K),En(K)),d(N,jr,X),d(N,zr,G),F=!1}function V(K){!y&&z&&En(K,!0)}function oe(K){_=Z,Z=K,R=M()}function S(K){var ee=re(K),Y=ae(ee),We=n.rewind&&n.rewindByDrag;h(!1),U?w.scroll(Y,0,n.snap):e.is(Ao)?w.go(x(ya(ee))<0?We?"<":"-":We?">":"+"):e.is(Hi)&&C&&We?w.go(E(!0)?">":"<"):w.go(w.toDest(Y),!0),h(!0)}function P(K){var ee=n.dragMinThreshold,Y=go(ee),We=Y&&ee.mouse||0,$e=(Y?ee.touch:+ee)||10;return ln(T(K))>(Pe(K)?$e:We)}function D(K){return ln(T(K))>ln(T(K,!0))}function re(K){if(e.is(Zi)||!C){var ee=ue(K);if(ee&&ee<Ss)return T(K)/ee}return 0}function ae(K){return M()+ya(K)*Un(ln(K)*(n.flickPower||600),U?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function T(K,ee){return ie(K,ee)-ie(W(K),ee)}function ue(K){return fa(K)-fa(W(K))}function W(K){return Z===K&&_||Z}function ie(K,ee){return(Pe(K)?K.changedTouches[0]:K)["page"+m(ee?"Y":"X")]}function ne(K){return K/(C&&e.is(Hi)?su:1)}function ye(K){var ee=n.noDrag;return!ho(K,"."+cc+", ."+Rr)&&(!ee||!ho(K,ee))}function Pe(K){return typeof TouchEvent<"u"&&K instanceof TouchEvent}function me(){return F}function le(K){y=K}return{mount:I,disable:le,isDragging:me}}var Eu={Spacebar:" ",Right:Cr,Left:$r,Up:nc,Down:ic};function Ka(e){return e=qn(e)?e:e.key,Eu[e]||e}var $s="keydown";function Mu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function w(){b(),o(an,h),o(an,b),o(_n,m)}function b(){var M=n.keyboard;M&&(u=M==="global"?window:d,s(u,$s,x))}function h(){l(u,$s)}function g(M){p=M}function m(){var M=p;p=!0,Al(function(){p=M})}function x(M){if(!p){var E=Ka(M);E===c($r)?e.go("<"):E===c(Cr)&&e.go(">")}}return{mount:w,destroy:h,disable:g}}var uo=_a+"-lazy",or=uo+"-srcset",Pu="["+uo+"], ["+or+"]";function ku(e,t,n){var i=Kt(e),o=i.on,s=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Yi,vi],p=[];function w(){n.lazyLoad&&(b(),o(Qt,b))}function b(){Wn(p),h(),c?M():(s(u),o(u,g),g())}function h(){t.Slides.forEach(function(E){Wa(E.slide,Pu).forEach(function(R){var Z=bn(R,uo),_=bn(R,or);if(Z!==R.src||_!==R.srcset){var U=n.classes.spinner,F=R.parentElement,C=Mo(F,"."+U)||ki("span",U,F);p.push([R,E,C]),R.src||vo(R,"none")}})})}function g(){p=p.filter(function(E){var R=n.perPage*((n.preloadPages||1)+1)-1;return E[1].isWithin(e.index,R)?m(E):!0}),p.length||s(u)}function m(E){var R=E[0];Tn(E[1].slide,wa),l(R,"load error",Vt(x,E)),St(R,"src",bn(R,uo)),St(R,"srcset",bn(R,or)),Ln(R,uo),Ln(R,or)}function x(E,R){var Z=E[0],_=E[1];Pn(_.slide,wa),R.type!=="error"&&(hi(E[2]),vo(Z,""),d(Ba,Z,_),d(Ni)),c&&M()}function M(){p.length&&m(p.shift())}return{mount:w,destroy:Vt(Wn,p),check:g}}function Au(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,w=u.getIndex,b=u.go,h=t.Direction.resolve,g=c.pagination,m=[],x,M;function E(){R(),o([an,Qt,ur],E);var y=n.pagination;g&&vo(g,y?"":"none"),y&&(o([_n,br,vi],z),Z(),z(),s(Zl,{list:x,items:m},C(e.index)))}function R(){x&&(hi(g?Zn(x.children):x),Pn(x,M),Wn(m),x=null),i.destroy()}function Z(){var y=e.length,N=n.classes,I=n.i18n,J=n.perPage,k=p()?u.getEnd()+1:xo(y/J);x=g||ki("ul",N.pagination,c.track.parentElement),Tn(x,M=Ir+"--"+F()),St(x,kn,"tablist"),St(x,hn,I.select),St(x,Ga,F()===Tr?"vertical":"");for(var X=0;X<k;X++){var G=ki("li",null,x),V=ki("button",{class:N.page,type:"button"},G),oe=d.getIn(X).map(function(P){return P.slide.id}),S=!p()&&J>1?I.pageX:I.slideX;l(V,"click",Vt(_,X)),n.paginationKeyboard&&l(V,"keydown",Vt(U,X)),St(G,kn,"presentation"),St(V,kn,"tab"),St(V,ko,oe.join(" ")),St(V,hn,va(S,X+1)),St(V,Ai,-1),m.push({li:G,button:V,page:X})}}function _(y){b(">"+y,!0)}function U(y,N){var I=m.length,J=Ka(N),k=F(),X=-1;J===h(Cr,!1,k)?X=++y%I:J===h($r,!1,k)?X=(--y+I)%I:J==="Home"?X=0:J==="End"&&(X=I-1);var G=m[X];G&&(Nl(G.button),b(">"+X),En(N,!0))}function F(){return n.paginationDirection||n.direction}function C(y){return m[u.toPage(y)]}function z(){var y=C(w(!0)),N=C(w());if(y){var I=y.button;Pn(I,fi),Ln(I,ys),St(I,Ai,-1)}if(N){var J=N.button;Tn(J,fi),St(J,ys,!0),St(J,Ai,"")}s(Jl,{list:x,items:m},y,N)}return{items:m,mount:E,destroy:R,getAt:C,update:z}}var Fu=[" ","Enter"];function Wu(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function d(){s.forEach(function(g){g.destroy()}),Wn(s)}function c(){d(),l()}function u(g,m){var x=Kt(g);x.on(_n,function(M,E,R){m.go(m.is(Zi)?R:M)}),s.push(x)}function p(){var g=Kt(e),m=g.on;m(Ha,b),m(ec,h),m([Jn,an],w),s.push(g),g.emit(Da,e.splides)}function w(){St(t.Elements.list,Ga,n.direction===Tr?"vertical":"")}function b(g){e.go(g.index)}function h(g,m){Aa(Fu,Ka(m))&&(b(g),En(m))}return{setup:Vt(t.Media.set,{slideFocus:Ro(o)?i:o},!0),mount:l,destroy:d,remount:c}}function _u(e,t,n){var i=Kt(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Ii)}function d(u){if(u.cancelable){var p=u.deltaY,w=p<0,b=fa(u),h=n.wheelMinThreshold||0,g=n.wheelSleep||0;ln(p)>h&&b-s>g&&(e.go(w?"<":">"),s=b),c(w)&&En(u)}}function c(u){return!n.releaseWheel||e.state.is(Xi)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Nu=90;function Hu(e,t,n){var i=Kt(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=ki("span",nu),c=wr(Nu,Vt(p,!1));function u(){l&&(b(!t.Autoplay.isPaused()),St(s,bs,!0),d.textContent="…",o(ja,Vt(b,!0)),o(za,Vt(b,!1)),o([Yi,vi],Vt(p,!0)))}function p(h){St(s,xs,h),h?(Eo(s,d),c.start()):(hi(d),c.cancel())}function w(){Ln(s,[vs,bs,xs]),hi(d)}function b(h){l&&St(s,vs,h?"off":"polite")}return{mount:u,disable:b,destroy:w}}var Ou=Object.freeze({__proto__:null,Media:Ud,Direction:Kd,Elements:lu,Slides:du,Layout:uu,Clones:mu,Move:gu,Controller:hu,Arrows:vu,Autoplay:bu,Cover:wu,Scroll:Ru,Drag:Iu,Keyboard:Mu,LazyLoad:ku,Pagination:Au,Sync:Wu,Wheel:_u,Live:Hu}),Du={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"},ju={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:ru,i18n:Du,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function zu(e,t,n){var i=t.Slides;function o(){Kt(e).on([Jn,Qt],s)}function s(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Al(c)}return{mount:o,start:l,cancel:ha}}function Bu(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=Vt(xn,l,"transition"),c;function u(){Kt(e).bind(l,"transitionend",function(h){h.target===l&&c&&(w(),c())})}function p(h,g){var m=i.toPosition(h,!0),x=i.getPosition(),M=b(h);ln(m-x)>=1&&M>=1?n.useScroll?s.scroll(m,M,!1,g):(d("transform "+M+"ms "+n.easing),i.translate(m,!0),c=g):(i.jump(h),g())}function w(){d(""),s.cancel()}function b(h){var g=n.rewindSpeed;if(e.is(Hi)&&g){var m=o.getIndex(!0),x=o.getEnd();if(m===0&&h>=x||m>=x&&h===0)return g}return n.speed}return{mount:u,start:p,cancel:w}}var Vu=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=Gd(Pi),this.splides=[],this._o={},this._E={};var o=qn(n)?Ol(document,n):n;co(o,o+" is invalid."),this.root=o,i=zn({label:bn(o,hn)||"",labelledby:bn(o,Va)||""},ju,e.defaults,i||{});try{zn(i,JSON.parse(bn(o,_a)))}catch{co(!1,"Invalid JSON")}this._o=Object.create(zn({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,l=this.state,d=this.Components;co(l.is([Pi,lr]),"Already mounted!"),l.set(Pi),this._C=d,this._T=o||this._T||(this.is(Ao)?zu:Bu),this._E=i||this._E;var c=yo({},Ou,this._E,{Transition:this._T});return mi(c,function(u,p){var w=u(s,d,s._o);d[p]=w,w.setup&&w.setup()}),mi(d,function(u){u.mount&&u.mount()}),this.emit(Jn),Tn(this.root,iu),l.set(_i),this.emit(xa),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(_i)&&(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(Zn(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(Qt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,s=this.state;return s.is(Pi)?Kt(this).on(xa,this.destroy.bind(this,i)):(mi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Oa),o.destroy(),i&&Wn(this.splides),s.set(lr)),this},Dd(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})(),Xa=Vu;Xa.defaults={};Xa.STATES=zd;var Cs=[[Jn,"onMounted"],[xa,"onReady"],[_n,"onMove"],[Yi,"onMoved"],[Ha,"onClick"],[zl,"onActive"],[Bl,"onInactive"],[Vl,"onVisible"],[Gl,"onHidden"],[Qt,"onRefresh"],[an,"onUpdated"],[Ni,"onResize"],[xr,"onResized"],[ql,"onDrag"],[Ul,"onDragging"],[Kl,"onDragged"],[br,"onScroll"],[vi,"onScrolled"],[Oa,"onDestroy"],[Xl,"onArrowsMounted"],[Yl,"onArrowsUpdated"],[Zl,"onPaginationMounted"],[Jl,"onPaginationUpdated"],[Da,"onNavigationMounted"],[ja,"onAutoplayPlay"],[Ql,"onAutoplayPlaying"],[za,"onAutoplayPause"],[Ba,"onLazyLoadLoaded"]];function Ya(...e){return e.filter(Boolean).join(" ")}function pr(e){return e!==null&&typeof e=="object"}function Sa(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Sa(n,t[i]));if(pr(e)&&pr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Sa(e[o],t[o]))}return e===t}function Gu(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function qu(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 $a(e,t){const n=e;return qu(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():pr(i)?n[o]=$a(pr(n[o])?n[o]:{},i):n[o]=i}),n}var Uu=({children:e,className:t,...n})=>a.createElement("div",{className:Ya("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),Za=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Xa(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=$a({},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&&!Sa(this.options,e)&&(this.splide.options=e,this.options=$a({},e));const t=this.getSlides();Gu(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){Cs.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return a.createElement(t,{className:Ya("splide",e),ref:this.splideRef,...this.omit(o,["options",...Cs.map(s=>s[1])])},n?a.createElement(Uu,null,i):i)}},Ja=({children:e,className:t,...n})=>a.createElement("li",{className:Ya("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),st=require("classnames"),$=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Yn=require("react-dom");function Xc(e){return e.type==="object"&&e.version===1}const Yc="ControlSlider-module__wrapper___sHEkd",Zc="ControlSlider-module__hoverArrow___A-dOH",Jc="ControlSlider-module__sliderItem___QQSkR",Qc="ControlSlider-module__sliderImage___9hRl-",ed="ControlSlider-module__arrow___05ghY",td="ControlSlider-module__arrowVertical___tBfVN",nd="ControlSlider-module__nextArrow___-30Yc",id="ControlSlider-module__arrowInner___aEra3",od="ControlSlider-module__arrowIcon___S4ztF",rd="ControlSlider-module__arrowImg___2dwJW",ad="ControlSlider-module__mirror___brd6U",sd="ControlSlider-module__pagination___bicLF",ld="ControlSlider-module__paginationInner___bT-P-",cd="ControlSlider-module__paginationVertical___zYqKw",dd="ControlSlider-module__paginationItem___nTRbk",ud="ControlSlider-module__dot___p1Qun",pd="ControlSlider-module__activeDot___LHFaj",md="ControlSlider-module__paginationInsideBottom___R3FWn",gd="ControlSlider-module__paginationInsideTop___V-qb-",hd="ControlSlider-module__paginationOutsideBottom___14w8D",fd="ControlSlider-module__paginationOutsideTop___SCLqB",yd="ControlSlider-module__paginationInsideLeft___yOBRZ",vd="ControlSlider-module__paginationInsideRight___Rtt3o",xd="ControlSlider-module__paginationOutsideLeft___lahaw",bd="ControlSlider-module__paginationOutsideRight___EtuQa",wd="ControlSlider-module__imgWrapper___UjEgB",Sd="ControlSlider-module__captionBlock___dJ6-j",$d="ControlSlider-module__captionTextWrapper___HFlpf",Cd="ControlSlider-module__captionText___uGBVc",Td="ControlSlider-module__active___WZK4G",Ld="ControlSlider-module__withPointerEvents___t-18M",Rd="ControlSlider-module__topLeftAlignment___zjnGM",Id="ControlSlider-module__topCenterAlignment___gD1xW",Ed="ControlSlider-module__topRightAlignment___NMapS",Md="ControlSlider-module__middleLeftAlignment___OnUrY",Pd="ControlSlider-module__middleCenterAlignment___Tdkl0",kd="ControlSlider-module__middleRightAlignment___wEbfX",Ad="ControlSlider-module__bottomLeftAlignment___cTP2-",Fd="ControlSlider-module__bottomCenterAlignment___c54fB",Wd="ControlSlider-module__bottomRightAlignment___kEwrz",_d="ControlSlider-module__clickOverlay___DZA28",Hd="ControlSlider-module__contain___pLyq7",Nd="ControlSlider-module__cover___KdDat",rt={wrapper:Yc,hoverArrow:Zc,sliderItem:Jc,sliderImage:Qc,arrow:ed,arrowVertical:td,nextArrow:nd,arrowInner:id,arrowIcon:od,arrowImg:rd,mirror:ad,pagination:sd,paginationInner:ld,paginationVertical:cd,paginationItem:dd,dot:ud,activeDot:pd,paginationInsideBottom:md,paginationInsideTop:gd,paginationOutsideBottom:hd,paginationOutsideTop:fd,paginationInsideLeft:yd,paginationInsideRight:vd,paginationOutsideLeft:xd,paginationOutsideRight:bd,imgWrapper:wd,captionBlock:Sd,captionTextWrapper:$d,captionText:Cd,active:Td,withPointerEvents:Ld,topLeftAlignment:Rd,topCenterAlignment:Id,topRightAlignment:Ed,middleLeftAlignment:Md,middleCenterAlignment:Pd,middleRightAlignment:kd,bottomLeftAlignment:Ad,bottomCenterAlignment:Fd,bottomRightAlignment:Wd,clickOverlay:_d,contain:Hd,cover:Nd};function Od(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 Dd(e,t,n){return t&&Od(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var us="(prefers-reduced-motion: reduce)",Pi=1,jd=2,_i=3,Xi=4,Lo=5,tr=6,lr=7,zd={CREATED:Pi,MOUNTED:jd,IDLE:_i,MOVING:Xi,SCROLLING:Lo,DRAGGING:tr,DESTROYED:lr};function Wn(e){e.length=0}function Zn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Vt(e){return e.bind.apply(e,[null].concat(Zn(arguments,1)))}var Al=setTimeout,ha=function(){};function ps(e){return requestAnimationFrame(e)}function vr(e,t){return typeof t===e}function go(e){return!ka(e)&&vr("object",e)}var Pa=Array.isArray,Fl=Vt(vr,"function"),qn=Vt(vr,"string"),Ro=Vt(vr,"undefined");function ka(e){return e===null}function Wl(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Io(e){return Pa(e)?e:[e]}function yn(e,t){Io(e).forEach(t)}function Aa(e,t){return e.indexOf(t)>-1}function nr(e,t){return e.push.apply(e,Io(t)),e}function Mn(e,t,n){e&&yn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){Mn(e,qn(t)?t.split(" "):t,!0)}function Eo(e,t){yn(t,e.appendChild.bind(e))}function Fa(e,t){yn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ho(e,t){return Wl(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function _l(e,t){var n=e?Zn(e.children):[];return t?n.filter(function(i){return ho(i,t)}):n}function Mo(e,t){return t?_l(e,t)[0]:e.firstElementChild}var fo=Object.keys;function mi(e,t,n){return e&&(n?fo(e).reverse():fo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function yo(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){Pa(n)?e[i]=n.slice():go(n)?e[i]=zn({},go(e[i])?e[i]:{},n):e[i]=n})}),e}function ms(e,t){yn(t||fo(e),function(n){delete e[n]})}function Ln(e,t){yn(e,function(n){yn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){go(t)?mi(t,function(i,o){$t(e,o,i)}):yn(e,function(i){ka(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function ki(e,t,n){var i=document.createElement(e);return t&&(qn(t)?Tn(i,t):$t(i,t)),n&&Eo(n,i),i}function xn(e,t,n){if(Ro(n))return getComputedStyle(e)[t];ka(n)||(e.style[t]=""+n)}function vo(e,t){xn(e,"display",t)}function Hl(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function bn(e,t){return e.getAttribute(t)}function gs(e,t){return e&&e.classList.contains(t)}function mn(e){return e.getBoundingClientRect()}function hi(e){yn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Nl(e){return Mo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Ol(e,t){return e&&e.querySelector(t)}function Wa(e,t){return t?Zn(e.querySelectorAll(t)):[]}function Pn(e,t){Mn(e,t,!1)}function fa(e){return e.timeStamp}function ii(e){return qn(e)?e:e?e+"px":""}var Po="splide",_a="data-"+Po;function co(e,t){if(!e)throw new Error("["+Po+"] "+(t||""))}var Un=Math.min,cr=Math.max,dr=Math.floor,xo=Math.ceil,ln=Math.abs;function Dl(e,t,n){return ln(e-t)<n}function ir(e,t,n,i){var o=Un(t,n),s=cr(t,n);return i?o<e&&e<s:o<=e&&e<=s}function Ri(e,t,n){var i=Un(t,n),o=cr(t,n);return Un(cr(i,e),o)}function ya(e){return+(e>0)-+(e<0)}function va(e,t){return yn(t,function(n){e=e.replace("%s",""+n)}),e}function Ha(e){return e<10?"0"+e:""+e}var hs={};function Bd(e){return""+e+Ha(hs[e]=(hs[e]||0)+1)}function jl(){var e=[];function t(l,d,c,u){o(l,d,function(p,v,y){var g="addEventListener"in p,h=g?p.removeEventListener.bind(p,v,c,u):p.removeListener.bind(p,c);g?p.addEventListener(v,c,u):p.addListener(c),e.push([p,v,y,c,h])})}function n(l,d,c){o(l,d,function(u,p,v){e=e.filter(function(y){return y[0]===u&&y[1]===p&&y[2]===v&&(!c||y[3]===c)?(y[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){yn(l,function(u){u&&yn(d,function(p){p.split(" ").forEach(function(v){var y=v.split(".");c(u,y[0],y[1])})})})}function s(){e.forEach(function(l){l[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var Jn="mounted",xa="ready",_n="move",Yi="moved",Na="click",zl="active",Bl="inactive",Vl="visible",Gl="hidden",Qt="refresh",an="updated",Hi="resize",xr="resized",ql="drag",Ul="dragging",Kl="dragged",br="scroll",vi="scrolled",Vd="overflow",Oa="destroy",Xl="arrows:mounted",Yl="arrows:updated",Zl="pagination:mounted",Jl="pagination:updated",Da="navigation:mounted",ja="autoplay:play",Ql="autoplay:playing",za="autoplay:pause",Ba="lazyload:loaded",ec="sk",tc="sh",ur="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=jl();function i(s,l){n.bind(t,Io(s).join(" "),function(d){l.apply(l,Pa(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,Zn(arguments,1))}return e&&e.event.on(Oa,n.destroy),yo(n,{bus:t,on:i,off:Vt(n.unbind,t),emit:o})}function wr(e,t,n,i){var o=Date.now,s,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?Un((o()-s)/e,1):1,n&&n(l),l>=1&&(t(),s=o(),i&&++u>=i))return y();d=ps(p)}}function v(E){E||h(),s=o()-(E?l*e:0),c=!1,d=ps(p)}function y(){c=!0}function g(){s=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function m(E){e=E}function b(){return c}return{start:v,rewind:g,pause:y,cancel:h,set:m,isPaused:b}}function Gd(e){var t=e;function n(o){t=o}function i(o){return Aa(Io(o),t)}return{set:n,is:i}}function qd(e,t){var n=wr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Ud(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=jl(),d=[];function c(){var h=n.mediaQuery==="min";fo(o).sort(function(m,b){return h?+m-+b:+b-+m}).forEach(function(m){p(o[m],"("+(h?"min":"max")+"-width:"+m+"px)")}),p(s,us),v()}function u(h){h&&l.destroy()}function p(h,m){var b=matchMedia(m);l.bind(b,"change",v),d.push([h,b])}function v(){var h=i.is(lr),m=n.direction,b=d.reduce(function(E,R){return zn(E,R[1].matches?R[0]:{})},{});ms(n),g(b),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):m!==n.direction&&e.refresh()}function y(h){matchMedia(us).matches&&(h?zn(n,s):ms(n,fo(s)))}function g(h,m,b){zn(n,h),m&&zn(Object.getPrototypeOf(n),h),(b||!i.is(Pi))&&e.emit(an,n)}return{setup:c,destroy:u,reduce:y,set:g}}var Sr="Arrow",$r=Sr+"Left",Cr=Sr+"Right",nc=Sr+"Up",ic=Sr+"Down",fs="rtl",Tr="ttb",Or={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[nc,Cr],ArrowRight:[ic,$r]};function Kd(e,t,n){function i(s,l,d){d=d||n.direction;var c=d===fs&&!l?1:d===Tr?0:-1;return Or[s]&&Or[s][c]||s.replace(/width|left|right/i,function(u,p){var v=Or[u.toLowerCase()][c]||u;return p>0?v.charAt(0).toUpperCase()+v.slice(1):v})}function o(s){return s*(n.direction===fs?1:-1)}return{resolve:i,orient:o}}var kn="role",Ai="tabindex",Xd="disabled",wn="aria-",ko=wn+"controls",oc=wn+"current",ys=wn+"selected",hn=wn+"label",Va=wn+"labelledby",rc=wn+"hidden",Ga=wn+"orientation",bo=wn+"roledescription",vs=wn+"live",xs=wn+"busy",bs=wn+"atomic",qa=[kn,Ai,Xd,ko,oc,hn,Va,rc,Ga,bo],Rn=Po+"__",Qn="is-",Dr=Po,ws=Rn+"track",Yd=Rn+"list",Lr=Rn+"slide",ac=Lr+"--clone",Zd=Lr+"__container",Ua=Rn+"arrows",Rr=Rn+"arrow",sc=Rr+"--prev",lc=Rr+"--next",Ir=Rn+"pagination",cc=Ir+"__page",Jd=Rn+"progress",Qd=Jd+"__bar",eu=Rn+"toggle",tu=Rn+"spinner",nu=Rn+"sr",iu=Qn+"initialized",fi=Qn+"active",dc=Qn+"prev",uc=Qn+"next",ba=Qn+"visible",wa=Qn+"loading",pc=Qn+"focus-in",mc=Qn+"overflow",ou=[fi,ba,dc,uc,wa,pc,mc],ru={slide:Lr,clone:ac,arrows:Ua,arrow:Rr,prev:sc,next:lc,pagination:Ir,page:cc,spinner:tu};function au(e,t){if(Fl(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ho(n,t);)n=n.parentElement;return n}var su=5,Ss=200,gc="touchstart mousedown",jr="touchmove mousemove",zr="touchend touchcancel mouseup click";function lu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],v=[],y,g,h;function m(){L(),J(),R()}function b(){o(Qt,E),o(Qt,m),o(an,R),s(document,gc+" keydown",function(A){h=A.type==="keydown"},{capture:!0}),s(l,"focusin",function(){Mn(l,pc,!!h)})}function E(A){var C=qa.concat("style");Wn(u),Pn(l,p),Pn(y,v),Ln([y,g],C),Ln(l,A?C:["style",bo])}function R(){Pn(l,p),Pn(y,v),p=q(Dr),v=q(ws),Tn(l,p),Tn(y,v),$t(l,hn,n.label),$t(l,Va,n.labelledby)}function L(){y=W("."+ws),g=Mo(y,"."+Yd),co(y&&g,"A track/list element is missing."),nr(u,_l(g,"."+Lr+":not(."+ac+")")),mi({arrows:Ua,pagination:Ir,prev:sc,next:lc,bar:Qd,toggle:eu},function(A,C){c[C]=W("."+A)}),yo(c,{root:l,track:y,list:g,slides:u})}function J(){var A=l.id||Bd(Po),C=n.role;l.id=A,y.id=y.id||A+"-track",g.id=g.id||A+"-list",!bn(l,kn)&&l.tagName!=="SECTION"&&C&&$t(l,kn,C),$t(l,bo,d.carousel),$t(g,kn,"presentation")}function W(A){var C=Ol(l,A);return C&&au(C,"."+Dr)===l?C:void 0}function q(A){return[A+"--"+n.type,A+"--"+n.direction,n.drag&&A+"--draggable",n.isNavigation&&A+"--nav",A===Dr&&fi]}return yo(c,{setup:m,mount:b,destroy:E})}var Ni="slide",Zi="loop",Ao="fade";function cu(e,t,n,i){var o=Kt(e),s=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,v=p.isNavigation,y=p.updateOnMove,g=p.i18n,h=p.pagination,m=p.slideFocus,b=c.Direction.resolve,E=bn(i,"style"),R=bn(i,hn),L=n>-1,J=Mo(i,"."+Zd),W;function q(){L||(i.id=u.id+"-slide"+Ha(t+1),$t(i,kn,h?"tabpanel":"group"),$t(i,bo,g.slide),$t(i,hn,R||va(g.slideLabel,[t+1,e.length]))),A()}function A(){d(i,"click",Vt(l,Na,ie)),d(i,"keydown",Vt(l,ec,ie)),s([Yi,tc,vi],H),s(Da,O),y&&s(_n,w)}function C(){W=!0,o.destroy(),Pn(i,ou),Ln(i,qa),$t(i,"style",E),$t(i,hn,R||"")}function O(){var S=e.splides.map(function(M){var z=M.splide.Components.Slides.getAt(t);return z?z.slide.id:""}).join(" ");$t(i,hn,va(g.slideX,(L?n:t)+1)),$t(i,ko,S),$t(i,kn,m?"button":""),m&&Ln(i,bo)}function w(){W||H()}function H(){if(!W){var S=e.index;P(),X(),Mn(i,dc,t===S-1),Mn(i,uc,t===S+1)}}function P(){var S=Y();S!==gs(i,fi)&&(Mn(i,fi,S),$t(i,oc,v&&S||""),l(S?zl:Bl,ie))}function X(){var S=U(),M=!S&&(!Y()||L);if(e.state.is([Xi,Lo])||$t(i,rc,M||""),$t(Wa(i,p.focusableNodes||""),Ai,M?-1:""),m&&$t(i,Ai,M?-1:0),S!==gs(i,ba)&&(Mn(i,ba,S),l(S?Vl:Gl,ie)),!S&&document.activeElement===i){var z=c.Slides.getAt(e.index);z&&Hl(z.slide)}}function k(S,M,z){xn(z&&J||i,S,M)}function Y(){var S=e.index;return S===t||p.cloneStatus&&S===n}function U(){if(e.is(Ao))return Y();var S=mn(c.Elements.track),M=mn(i),z=b("left",!0),ae=b("right",!0);return dr(S[z])<=xo(M[z])&&dr(M[ae])<=xo(S[ae])}function V(S,M){var z=ln(S-t);return!L&&(p.rewind||e.is(Zi))&&(z=Un(z,e.length-z)),z<=M}var ie={index:t,slideIndex:n,slide:i,container:J,isClone:L,mount:q,destroy:C,update:H,style:k,isWithin:V};return ie}function du(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function v(){y(),o(Qt,g),o(Qt,y)}function y(){c.forEach(function(H,P){m(H,P,-1)})}function g(){W(function(H){H.destroy()}),Wn(p)}function h(){W(function(H){H.update()})}function m(H,P,X){var k=cu(e,P,X,H);k.mount(),p.push(k),p.sort(function(Y,U){return Y.index-U.index})}function b(H){return H?q(function(P){return!P.isClone}):p}function E(H){var P=t.Controller,X=P.toIndex(H),k=P.hasFocus()?1:n.perPage;return q(function(Y){return ir(Y.index,X,X+k-1)})}function R(H){return q(H)[0]}function L(H,P){yn(H,function(X){if(qn(X)&&(X=Nl(X)),Wl(X)){var k=c[P];k?Fa(X,k):Eo(u,X),Tn(X,n.classes.slide),C(X,Vt(s,Hi))}}),s(Qt)}function J(H){hi(q(H).map(function(P){return P.slide})),s(Qt)}function W(H,P){b(P).forEach(H)}function q(H){return p.filter(Fl(H)?H:function(P){return qn(H)?ho(P.slide,H):Aa(Io(H),P.index)})}function A(H,P,X){W(function(k){k.style(H,P,X)})}function C(H,P){var X=Wa(H,"img"),k=X.length;k?X.forEach(function(Y){l(Y,"load error",function(){--k||P()})}):P()}function O(H){return H?c.length:p.length}function w(){return p.length>n.perPage}return{mount:v,destroy:g,update:h,register:m,get:b,getIn:E,getAt:R,add:L,remove:J,forEach:W,filter:q,style:A,getLength:O,isEnough:w}}function uu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,v=u.track,y=u.list,g=d.getAt,h=d.style,m,b,E;function R(){L(),s(window,"resize load",qd(Vt(l,Hi))),o([an,Qt],L),o(Hi,J)}function L(){m=n.direction===Tr,xn(p,"maxWidth",ii(n.width)),xn(v,c("paddingLeft"),W(!1)),xn(v,c("paddingRight"),W(!0)),J(!0)}function J(ie){var S=mn(p);(ie||b.width!==S.width||b.height!==S.height)&&(xn(v,"height",q()),h(c("marginRight"),ii(n.gap)),h("width",C()),h("height",O(),!0),b=S,l(xr),E!==(E=V())&&(Mn(p,mc,E),l(Vd,E)))}function W(ie){var S=n.padding,M=c(ie?"right":"left");return S&&ii(S[M]||(go(S)?0:S))||"0px"}function q(){var ie="";return m&&(ie=A(),co(ie,"height or heightRatio is missing."),ie="calc("+ie+" - "+W(!1)+" - "+W(!0)+")"),ie}function A(){return ii(n.height||mn(y).width*n.heightRatio)}function C(){return n.autoWidth?null:ii(n.fixedWidth)||(m?"":w())}function O(){return ii(n.fixedHeight)||(m?n.autoHeight?null:w():A())}function w(){var ie=ii(n.gap);return"calc((100%"+(ie&&" + "+ie)+")/"+(n.perPage||1)+(ie&&" - "+ie)+")"}function H(){return mn(y)[c("width")]}function P(ie,S){var M=g(ie||0);return M?mn(M.slide)[c("width")]+(S?0:Y()):0}function X(ie,S){var M=g(ie);if(M){var z=mn(M.slide)[c("right")],ae=mn(y)[c("left")];return ln(z-ae)+(S?0:Y())}return 0}function k(ie){return X(e.length-1)-X(0)+P(0,ie)}function Y(){var ie=g(0);return ie&&parseFloat(xn(ie.slide,c("marginRight")))||0}function U(ie){return parseFloat(xn(v,c("padding"+(ie?"Right":"Left"))))||0}function V(){return e.is(Ao)||k(!0)>H()}return{mount:R,resize:J,listSize:H,slideSize:P,sliderSize:k,totalSize:X,getPadding:U,isOverflow:V}}var pu=2;function mu(e,t,n){var i=Kt(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,v),o([an,Hi],g),(u=b())&&(h(u),t.Layout.resize(!0))}function v(){y(),p()}function y(){hi(c),Wn(c),i.destroy()}function g(){var E=b();u!==E&&(u<E||!E)&&i.emit(Qt)}function h(E){var R=l.get().slice(),L=R.length;if(L){for(;R.length<E;)nr(R,R);nr(R.slice(-E),R.slice(0,E)).forEach(function(J,W){var q=W<E,A=m(J.slide,W);q?Fa(A,R[0].slide):Eo(s.list,A),nr(c,A),l.register(A,W-E+(q?0:L),J.index)})}}function m(E,R){var L=E.cloneNode(!0);return Tn(L,n.classes.clone),L.id=e.root.id+"-clone"+Ha(R+1),L}function b(){var E=n.clones;if(!e.is(Zi))E=0;else if(Ro(E)){var R=n[d("fixedWidth")]&&t.Layout.slideSize(0),L=R&&xo(mn(s.track)[d("width")]/R);E=L||n[d("autoWidth")]&&e.length||n.perPage*pu}return E}return{mount:p,destroy:y}}function gu(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,v=d.listSize,y=d.sliderSize,g=t.Direction,h=g.resolve,m=g.orient,b=t.Elements,E=b.list,R=b.track,L;function J(){L=t.Transition,o([Jn,xr,an,Qt],W)}function W(){t.Controller.isBusy()||(t.Scroll.cancel(),A(e.index),t.Slides.update())}function q(M,z,ae,re){M!==z&&ie(M>ae)&&(H(),C(w(k(),M>ae),!0)),l(Xi),s(_n,z,ae,M),L.start(z,function(){l(_i),s(Yi,z,ae,M),re&&re()})}function A(M){C(X(M,!0))}function C(M,z){if(!e.is(Ao)){var ae=z?M:O(M);xn(E,"transform","translate"+h("X")+"("+ae+"px)"),M!==ae&&s(tc)}}function O(M){if(e.is(Zi)){var z=P(M),ae=z>t.Controller.getEnd(),re=z<0;(re||ae)&&(M=w(M,ae))}return M}function w(M,z){var ae=M-V(z),re=y();return M-=m(re*(xo(ln(ae)/re)||1))*(z?1:-1),M}function H(){C(k(),!0),L.cancel()}function P(M){for(var z=t.Slides.get(),ae=0,re=1/0,I=0;I<z.length;I++){var ue=z[I].index,F=ln(X(ue,!0)-M);if(F<=re)re=F,ae=ue;else break}return ae}function X(M,z){var ae=m(p(M-1)-U(M));return z?Y(ae):ae}function k(){var M=h("left");return mn(E)[M]-mn(R)[M]+m(u(!1))}function Y(M){return n.trimSpace&&e.is(Ni)&&(M=Ri(M,0,m(y(!0)-v()))),M}function U(M){var z=n.focus;return z==="center"?(v()-c(M,!0))/2:+z*c(M)||0}function V(M){return X(M?t.Controller.getEnd():0,!!n.trimSpace)}function ie(M){var z=m(w(k(),M));return M?z>=0:z<=E[h("scrollWidth")]-mn(R)[h("width")]}function S(M,z){z=Ro(z)?k():z;var ae=M!==!0&&m(z)<m(V(!1)),re=M!==!1&&m(z)>m(V(!0));return ae||re}return{mount:J,move:q,jump:A,translate:C,shift:w,cancel:H,toIndex:P,toPosition:X,getPosition:k,getLimit:V,exceededLimit:S,reposition:W}}function hu(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,v=p.isEnough,y=p.getLength,g=n.omitEnd,h=e.is(Zi),m=e.is(Ni),b=Vt(k,!1),E=Vt(k,!0),R=n.start||0,L,J=R,W,q,A;function C(){O(),o([an,Qt,ur],O),o(xr,w)}function O(){W=y(!0),q=n.perMove,A=n.perPage,L=ie();var F=Ri(R,0,g?L:W-1);F!==R&&(R=F,l.reposition())}function w(){L!==ie()&&s(ur)}function H(F,oe,Q){if(!ue()){var ye=X(F),Pe=V(ye);Pe>-1&&(oe||Pe!==R)&&(ae(Pe),l.move(ye,Pe,J,Q))}}function P(F,oe,Q,ye){t.Scroll.scroll(F,oe,Q,function(){var Pe=V(l.toIndex(d()));ae(g?Un(Pe,L):Pe),ye&&ye()})}function X(F){var oe=R;if(qn(F)){var Q=F.match(/([+\-<>])(\d+)?/)||[],ye=Q[1],Pe=Q[2];ye==="+"||ye==="-"?oe=Y(R+ +(""+ye+(+Pe||1)),R):ye===">"?oe=Pe?S(+Pe):b(!0):ye==="<"&&(oe=E(!0))}else oe=h?F:Ri(F,0,L);return oe}function k(F,oe){var Q=q||(I()?1:A),ye=Y(R+Q*(F?-1:1),R,!(q||I()));return ye===-1&&m&&!Dl(d(),c(!F),1)?F?0:L:oe?ye:V(ye)}function Y(F,oe,Q){if(v()||I()){var ye=U(F);ye!==F&&(oe=F,F=ye,Q=!1),F<0||F>L?!q&&(ir(0,F,oe,!0)||ir(L,oe,F,!0))?F=S(M(F)):h?F=Q?F<0?-(W%A||A):W:F:n.rewind?F=F<0?L:0:F=-1:Q&&F!==oe&&(F=S(M(oe)+(F<oe?-1:1)))}else F=-1;return F}function U(F){if(m&&n.trimSpace==="move"&&F!==R)for(var oe=d();oe===u(F,!0)&&ir(F,0,e.length-1,!n.rewind);)F<R?--F:++F;return F}function V(F){return h?(F+W)%W||0:F}function ie(){for(var F=W-(I()||h&&q?1:A);g&&F-- >0;)if(u(W-1,!0)!==u(F,!0)){F++;break}return Ri(F,0,W-1)}function S(F){return Ri(I()?F:A*F,0,L)}function M(F){return I()?Un(F,L):dr((F>=L?W-1:F)/A)}function z(F){var oe=l.toIndex(F);return m?Ri(oe,0,L):oe}function ae(F){F!==R&&(J=R,R=F)}function re(F){return F?J:R}function I(){return!Ro(n.focus)||n.isNavigation}function ue(){return e.state.is([Xi,Lo])&&!!n.waitForTransition}return{mount:C,go:H,scroll:P,getNext:b,getPrev:E,getAdjacent:k,getEnd:ie,setIndex:ae,getIndex:re,toIndex:S,toPage:M,toDest:z,hasFocus:I,isBusy:ue}}var fu="http://www.w3.org/2000/svg",yu="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",Oo=40;function vu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,v=u.arrows,y=u.track,g=v,h=u.prev,m=u.next,b,E,R={};function L(){W(),o(an,J)}function J(){q(),L()}function W(){var P=n.arrows;P&&!(h&&m)&&O(),h&&m&&(yo(R,{prev:h,next:m}),vo(g,P?"":"none"),Tn(g,E=Ua+"--"+n.direction),P&&(A(),H(),$t([h,m],ko,y.id),l(Xl,h,m)))}function q(){i.destroy(),Pn(g,E),b?(hi(v?[h,m]:g),h=m=null):Ln([h,m],qa)}function A(){o([Jn,Yi,Qt,vi,ur],H),s(m,"click",Vt(C,">")),s(h,"click",Vt(C,"<"))}function C(P){p.go(P,!0)}function O(){g=v||ki("div",d.arrows),h=w(!0),m=w(!1),b=!0,Eo(g,[h,m]),!v&&Fa(g,y)}function w(P){var X='<button class="'+d.arrow+" "+(P?d.prev:d.next)+'" type="button"><svg xmlns="'+fu+'" viewBox="0 0 '+Oo+" "+Oo+'" width="'+Oo+'" height="'+Oo+'" focusable="false"><path d="'+(n.arrowPath||yu)+'" />';return Nl(X)}function H(){if(h&&m){var P=e.index,X=p.getPrev(),k=p.getNext(),Y=X>-1&&P<X?c.last:c.prev,U=k>-1&&P>k?c.first:c.next;h.disabled=X<0,m.disabled=k<0,$t(h,hn,Y),$t(m,hn,U),l(Yl,h,m,X,k)}}return{arrows:R,mount:L,destroy:q,update:H}}var xu=_a+"-interval";function bu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.emit,d=wr(n.interval,e.go.bind(e,">"),A),c=d.isPaused,u=t.Elements,p=t.Elements,v=p.root,y=p.toggle,g=n.autoplay,h,m,b=g==="pause";function E(){g&&(R(),y&&$t(y,ko,u.track.id),b||L(),q())}function R(){n.pauseOnHover&&s(v,"mouseenter mouseleave",function(O){h=O.type==="mouseenter",W()}),n.pauseOnFocus&&s(v,"focusin focusout",function(O){m=O.type==="focusin",W()}),y&&s(y,"click",function(){b?L():J(!0)}),o([_n,br,Qt],d.rewind),o(_n,C)}function L(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),m=h=b=!1,q(),l(ja))}function J(O){O===void 0&&(O=!0),b=!!O,q(),c()||(d.pause(),l(za))}function W(){b||(h||m?J(!1):L())}function q(){y&&(Mn(y,fi,!b),$t(y,hn,n.i18n[b?"play":"pause"]))}function A(O){var w=u.bar;w&&xn(w,"width",O*100+"%"),l(Ql,O)}function C(O){var w=t.Slides.getAt(O);d.set(w&&+bn(w.slide,xu)||n.interval)}return{mount:E,destroy:d.cancel,play:L,pause:J,isPaused:c}}function wu(e,t,n){var i=Kt(e),o=i.on;function s(){n.cover&&(o(Ba,Vt(d,!0)),o([Jn,an,Qt],Vt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Mo(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),vo(u,c?"none":"")}return{mount:s,destroy:Vt(l,!1)}}var Su=10,$u=600,Cu=.6,Tu=1.5,Lu=800;function Ru(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,v=d.translate,y=e.is(Ni),g,h,m=1;function b(){o(_n,J),o([an,Qt],W)}function E(A,C,O,w,H){var P=c();if(J(),O&&(!y||!p())){var X=t.Layout.sliderSize(),k=ya(A)*X*dr(ln(A)/X)||0;A=d.toPosition(t.Controller.toDest(A%X))+k}var Y=Dl(P,A,1);m=1,C=Y?0:C||cr(ln(A-P)/Tu,Lu),h=w,g=wr(C,R,Vt(L,P,A,H),1),l(Lo),s(br),g.start()}function R(){l(_i),h&&h(),s(vi)}function L(A,C,O,w){var H=c(),P=A+(C-A)*q(w),X=(P-H)*m;v(H+X),y&&!O&&p()&&(m*=Cu,ln(X)<Su&&E(u(p(!0)),$u,!1,h,!0))}function J(){g&&g.cancel()}function W(){g&&!g.isPaused()&&(J(),R())}function q(A){var C=n.easingFunc;return C?C(A):1-Math.pow(1-A,4)}return{mount:b,destroy:J,scroll:E,cancel:W}}var Ii={passive:!1,capture:!0};function Iu(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,v=t.Controller,y=t.Elements.track,g=t.Media.reduce,h=t.Direction,m=h.resolve,b=h.orient,E=u.getPosition,R=u.exceededLimit,L,J,W,q,A,C=!1,O,w,H;function P(){l(y,jr,ha,Ii),l(y,zr,ha,Ii),l(y,gc,k,Ii),l(y,"click",V,{capture:!0}),l(y,"dragstart",En),o([Jn,an],X)}function X(){var K=n.drag;ce(!K),q=K==="free"}function k(K){if(O=!1,!w){var te=Pe(K);ye(K.target)&&(te||!K.button)&&(v.isBusy()?En(K,!0):(H=te?y:window,A=c.is([Xi,Lo]),W=null,l(H,jr,Y,Ii),l(H,zr,U,Ii),u.cancel(),p.cancel(),ie(K)))}}function Y(K){if(c.is(tr)||(c.set(tr),s(ql)),K.cancelable)if(A){u.translate(L+Q(I(K)));var te=ue(K)>Ss,Z=C!==(C=R());(te||Z)&&ie(K),O=!0,s(Ul),En(K)}else z(K)&&(A=M(K),En(K))}function U(K){c.is(tr)&&(c.set(_i),s(Kl)),A&&(S(K),En(K)),d(H,jr,Y),d(H,zr,U),A=!1}function V(K){!w&&O&&En(K,!0)}function ie(K){W=J,J=K,L=E()}function S(K){var te=ae(K),Z=re(te),Fe=n.rewind&&n.rewindByDrag;g(!1),q?v.scroll(Z,0,n.snap):e.is(Ao)?v.go(b(ya(te))<0?Fe?"<":"-":Fe?">":"+"):e.is(Ni)&&C&&Fe?v.go(R(!0)?">":"<"):v.go(v.toDest(Z),!0),g(!0)}function M(K){var te=n.dragMinThreshold,Z=go(te),Fe=Z&&te.mouse||0,$e=(Z?te.touch:+te)||10;return ln(I(K))>(Pe(K)?$e:Fe)}function z(K){return ln(I(K))>ln(I(K,!0))}function ae(K){if(e.is(Zi)||!C){var te=ue(K);if(te&&te<Ss)return I(K)/te}return 0}function re(K){return E()+ya(K)*Un(ln(K)*(n.flickPower||600),q?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function I(K,te){return oe(K,te)-oe(F(K),te)}function ue(K){return fa(K)-fa(F(K))}function F(K){return J===K&&W||J}function oe(K,te){return(Pe(K)?K.changedTouches[0]:K)["page"+m(te?"Y":"X")]}function Q(K){return K/(C&&e.is(Ni)?su:1)}function ye(K){var te=n.noDrag;return!ho(K,"."+cc+", ."+Rr)&&(!te||!ho(K,te))}function Pe(K){return typeof TouchEvent<"u"&&K instanceof TouchEvent}function pe(){return A}function ce(K){w=K}return{mount:P,disable:ce,isDragging:pe}}var Eu={Spacebar:" ",Right:Cr,Left:$r,Up:nc,Down:ic};function Ka(e){return e=qn(e)?e:e.key,Eu[e]||e}var $s="keydown";function Mu(e,t,n){var i=Kt(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function v(){y(),o(an,g),o(an,y),o(_n,m)}function y(){var E=n.keyboard;E&&(u=E==="global"?window:d,s(u,$s,b))}function g(){l(u,$s)}function h(E){p=E}function m(){var E=p;p=!0,Al(function(){p=E})}function b(E){if(!p){var R=Ka(E);R===c($r)?e.go("<"):R===c(Cr)&&e.go(">")}}return{mount:v,destroy:g,disable:h}}var uo=_a+"-lazy",or=uo+"-srcset",Pu="["+uo+"], ["+or+"]";function ku(e,t,n){var i=Kt(e),o=i.on,s=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Yi,vi],p=[];function v(){n.lazyLoad&&(y(),o(Qt,y))}function y(){Wn(p),g(),c?E():(s(u),o(u,h),h())}function g(){t.Slides.forEach(function(R){Wa(R.slide,Pu).forEach(function(L){var J=bn(L,uo),W=bn(L,or);if(J!==L.src||W!==L.srcset){var q=n.classes.spinner,A=L.parentElement,C=Mo(A,"."+q)||ki("span",q,A);p.push([L,R,C]),L.src||vo(L,"none")}})})}function h(){p=p.filter(function(R){var L=n.perPage*((n.preloadPages||1)+1)-1;return R[1].isWithin(e.index,L)?m(R):!0}),p.length||s(u)}function m(R){var L=R[0];Tn(R[1].slide,wa),l(L,"load error",Vt(b,R)),$t(L,"src",bn(L,uo)),$t(L,"srcset",bn(L,or)),Ln(L,uo),Ln(L,or)}function b(R,L){var J=R[0],W=R[1];Pn(W.slide,wa),L.type!=="error"&&(hi(R[2]),vo(J,""),d(Ba,J,W),d(Hi)),c&&E()}function E(){p.length&&m(p.shift())}return{mount:v,destroy:Vt(Wn,p),check:h}}function Au(e,t,n){var i=Kt(e),o=i.on,s=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,v=u.getIndex,y=u.go,g=t.Direction.resolve,h=c.pagination,m=[],b,E;function R(){L(),o([an,Qt,ur],R);var w=n.pagination;h&&vo(h,w?"":"none"),w&&(o([_n,br,vi],O),J(),O(),s(Zl,{list:b,items:m},C(e.index)))}function L(){b&&(hi(h?Zn(b.children):b),Pn(b,E),Wn(m),b=null),i.destroy()}function J(){var w=e.length,H=n.classes,P=n.i18n,X=n.perPage,k=p()?u.getEnd()+1:xo(w/X);b=h||ki("ul",H.pagination,c.track.parentElement),Tn(b,E=Ir+"--"+A()),$t(b,kn,"tablist"),$t(b,hn,P.select),$t(b,Ga,A()===Tr?"vertical":"");for(var Y=0;Y<k;Y++){var U=ki("li",null,b),V=ki("button",{class:H.page,type:"button"},U),ie=d.getIn(Y).map(function(M){return M.slide.id}),S=!p()&&X>1?P.pageX:P.slideX;l(V,"click",Vt(W,Y)),n.paginationKeyboard&&l(V,"keydown",Vt(q,Y)),$t(U,kn,"presentation"),$t(V,kn,"tab"),$t(V,ko,ie.join(" ")),$t(V,hn,va(S,Y+1)),$t(V,Ai,-1),m.push({li:U,button:V,page:Y})}}function W(w){y(">"+w,!0)}function q(w,H){var P=m.length,X=Ka(H),k=A(),Y=-1;X===g(Cr,!1,k)?Y=++w%P:X===g($r,!1,k)?Y=(--w+P)%P:X==="Home"?Y=0:X==="End"&&(Y=P-1);var U=m[Y];U&&(Hl(U.button),y(">"+Y),En(H,!0))}function A(){return n.paginationDirection||n.direction}function C(w){return m[u.toPage(w)]}function O(){var w=C(v(!0)),H=C(v());if(w){var P=w.button;Pn(P,fi),Ln(P,ys),$t(P,Ai,-1)}if(H){var X=H.button;Tn(X,fi),$t(X,ys,!0),$t(X,Ai,"")}s(Jl,{list:b,items:m},w,H)}return{items:m,mount:R,destroy:L,getAt:C,update:O}}var Fu=[" ","Enter"];function Wu(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){s.forEach(function(h){h.destroy()}),Wn(s)}function c(){d(),l()}function u(h,m){var b=Kt(h);b.on(_n,function(E,R,L){m.go(m.is(Zi)?L:E)}),s.push(b)}function p(){var h=Kt(e),m=h.on;m(Na,y),m(ec,g),m([Jn,an],v),s.push(h),h.emit(Da,e.splides)}function v(){$t(t.Elements.list,Ga,n.direction===Tr?"vertical":"")}function y(h){e.go(h.index)}function g(h,m){Aa(Fu,Ka(m))&&(y(h),En(m))}return{setup:Vt(t.Media.set,{slideFocus:Ro(o)?i:o},!0),mount:l,destroy:d,remount:c}}function _u(e,t,n){var i=Kt(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Ii)}function d(u){if(u.cancelable){var p=u.deltaY,v=p<0,y=fa(u),g=n.wheelMinThreshold||0,h=n.wheelSleep||0;ln(p)>g&&y-s>h&&(e.go(v?"<":">"),s=y),c(v)&&En(u)}}function c(u){return!n.releaseWheel||e.state.is(Xi)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Hu=90;function Nu(e,t,n){var i=Kt(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=ki("span",nu),c=wr(Hu,Vt(p,!1));function u(){l&&(y(!t.Autoplay.isPaused()),$t(s,bs,!0),d.textContent="…",o(ja,Vt(y,!0)),o(za,Vt(y,!1)),o([Yi,vi],Vt(p,!0)))}function p(g){$t(s,xs,g),g?(Eo(s,d),c.start()):(hi(d),c.cancel())}function v(){Ln(s,[vs,bs,xs]),hi(d)}function y(g){l&&$t(s,vs,g?"off":"polite")}return{mount:u,disable:y,destroy:v}}var Ou=Object.freeze({__proto__:null,Media:Ud,Direction:Kd,Elements:lu,Slides:du,Layout:uu,Clones:mu,Move:gu,Controller:hu,Arrows:vu,Autoplay:bu,Cover:wu,Scroll:Ru,Drag:Iu,Keyboard:Mu,LazyLoad:ku,Pagination:Au,Sync:Wu,Wheel:_u,Live:Nu}),Du={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"},ju={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:ru,i18n:Du,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function zu(e,t,n){var i=t.Slides;function o(){Kt(e).on([Jn,Qt],s)}function s(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Al(c)}return{mount:o,start:l,cancel:ha}}function Bu(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=Vt(xn,l,"transition"),c;function u(){Kt(e).bind(l,"transitionend",function(g){g.target===l&&c&&(v(),c())})}function p(g,h){var m=i.toPosition(g,!0),b=i.getPosition(),E=y(g);ln(m-b)>=1&&E>=1?n.useScroll?s.scroll(m,E,!1,h):(d("transform "+E+"ms "+n.easing),i.translate(m,!0),c=h):(i.jump(g),h())}function v(){d(""),s.cancel()}function y(g){var h=n.rewindSpeed;if(e.is(Ni)&&h){var m=o.getIndex(!0),b=o.getEnd();if(m===0&&g>=b||m>=b&&g===0)return h}return n.speed}return{mount:u,start:p,cancel:v}}var Vu=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=Gd(Pi),this.splides=[],this._o={},this._E={};var o=qn(n)?Ol(document,n):n;co(o,o+" is invalid."),this.root=o,i=zn({label:bn(o,hn)||"",labelledby:bn(o,Va)||""},ju,e.defaults,i||{});try{zn(i,JSON.parse(bn(o,_a)))}catch{co(!1,"Invalid JSON")}this._o=Object.create(zn({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,l=this.state,d=this.Components;co(l.is([Pi,lr]),"Already mounted!"),l.set(Pi),this._C=d,this._T=o||this._T||(this.is(Ao)?zu:Bu),this._E=i||this._E;var c=yo({},Ou,this._E,{Transition:this._T});return mi(c,function(u,p){var v=u(s,d,s._o);d[p]=v,v.setup&&v.setup()}),mi(d,function(u){u.mount&&u.mount()}),this.emit(Jn),Tn(this.root,iu),l.set(_i),this.emit(xa),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(_i)&&(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(Zn(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(Qt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,s=this.state;return s.is(Pi)?Kt(this).on(xa,this.destroy.bind(this,i)):(mi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Oa),o.destroy(),i&&Wn(this.splides),s.set(lr)),this},Dd(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})(),Xa=Vu;Xa.defaults={};Xa.STATES=zd;var Cs=[[Jn,"onMounted"],[xa,"onReady"],[_n,"onMove"],[Yi,"onMoved"],[Na,"onClick"],[zl,"onActive"],[Bl,"onInactive"],[Vl,"onVisible"],[Gl,"onHidden"],[Qt,"onRefresh"],[an,"onUpdated"],[Hi,"onResize"],[xr,"onResized"],[ql,"onDrag"],[Ul,"onDragging"],[Kl,"onDragged"],[br,"onScroll"],[vi,"onScrolled"],[Oa,"onDestroy"],[Xl,"onArrowsMounted"],[Yl,"onArrowsUpdated"],[Zl,"onPaginationMounted"],[Jl,"onPaginationUpdated"],[Da,"onNavigationMounted"],[ja,"onAutoplayPlay"],[Ql,"onAutoplayPlaying"],[za,"onAutoplayPause"],[Ba,"onLazyLoadLoaded"]];function Ya(...e){return e.filter(Boolean).join(" ")}function pr(e){return e!==null&&typeof e=="object"}function Sa(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Sa(n,t[i]));if(pr(e)&&pr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Sa(e[o],t[o]))}return e===t}function Gu(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function qu(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 $a(e,t){const n=e;return qu(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():pr(i)?n[o]=$a(pr(n[o])?n[o]:{},i):n[o]=i}),n}var Uu=({children:e,className:t,...n})=>a.createElement("div",{className:Ya("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),Za=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Xa(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=$a({},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&&!Sa(this.options,e)&&(this.splide.options=e,this.options=$a({},e));const t=this.getSlides();Gu(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){Cs.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return a.createElement(t,{className:Ya("splide",e),ref:this.splideRef,...this.omit(o,["options",...Cs.map(s=>s[1])])},n?a.createElement(Uu,null,i):i)}},Ja=({children:e,className:t,...n})=>a.createElement("li",{className:Ya("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 Ku="RichTextRenderer-module__link___BWeZ2",Xu={link:Ku},Yu=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))},Er=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Yu(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function on(e){const{color:t,...n}=e;return n}function Ut(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Er(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:$.scalingValue(e.letterSpacing,t),wordSpacing:$.scalingValue(e.wordSpacing,t),fontSize:$.scalingValue(n,t),lineHeight:i!==void 0?$.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const yi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Xu.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Zu(i),children:i.text},o));return r.jsx(r.Fragment,{children:e.map((n,i)=>{const o=n.children;return r.jsx("div",{children:t(o)},i)})})};function Zu(e){return{...e.fontFamily&&{fontFamily:Er(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 Ju="SvgImage-module__svg___q3xE-",Qu="SvgImage-module__img___VsTm-",Ts={svg:Ju,img:Qu},ep=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},tp=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,rn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,l]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!ep(e)||!s?r.jsx("img",{src:e,alt:"",className:rt(Ts.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:rt(Ts.svg,i),style:{"--svg":tp(e),"--fill":t,"--hover-fill":n,...o??{}}})},np={"top-left":ot.topLeftAlignment,"top-center":ot.topCenterAlignment,"top-right":ot.topRightAlignment,"middle-left":ot.middleLeftAlignment,"middle-center":ot.middleCenterAlignment,"middle-right":ot.middleRightAlignment,"bottom-left":ot.bottomLeftAlignment,"bottom-center":ot.bottomCenterAlignment,"bottom-right":ot.bottomRightAlignment};function ip({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=a.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:w,textAppearance:b,color:h}=n.imageCaption??{},[g,m]=a.useState(void 0),[x,M]=a.useState(null),[E,R]=a.useState(0),[Z,_]=a.useState(0),{direction:U,transition:F,controls:C,pagination:z,imageCaption:y,triggers:N}=e,I=a.useRef(F.type),{x:J,y:k}=e.controls.offset,X=G=>{o&&o.go(G)};return a.useEffect(()=>{if(!x)return;const G=new ResizeObserver(V=>{if(!o)return;const[oe]=V;m({width:Math.round(oe.contentRect.width),height:Math.round(oe.contentRect.height)})});return G.observe(x),()=>G.unobserve(x)},[x]),a.useEffect(()=>{!o||I.current===F.type||(_(G=>G+1),I.current=F.type)},[F.type]),r.jsx("div",{className:rt(ot.wrapper,{[ot.editor]:i}),ref:M,children:r.jsxs("div",{className:ot.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:F.backgroundColor&&F.type==="fade in"?F.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:rt(ot.captionBlock),children:r.jsx("div",{className:ot.captionTextWrapper,children:t.map((G,V)=>r.jsx("div",{className:rt(ot.captionText,np[y.alignment],{[ot.withPointerEvents]:V===E&&i,[ot.active]:V===E}),style:{fontFamily:Er(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":$.scalingValue(l.width,i),letterSpacing:$.scalingValue(c,i),wordSpacing:$.scalingValue(p,i),textAlign:u,fontSize:$.scalingValue(w.fontSize,i),lineHeight:$.scalingValue(w.lineHeight,i),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:h,transitionDuration:F.duration?`${Math.round(parseInt(F.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:ot.captionTextInner,style:{"--link-hover-color":y.linkHoverColor,"--link-color":y.linkColor,position:"relative",top:$.scalingValue(y.offset.y,i),left:$.scalingValue(y.offset.x,i)},children:r.jsx(yi,{content:G.imageCaption})})},V))})}),r.jsx(Za,{onMove:G=>{R(G.index)},ref:s,options:{arrows:!1,speed:F.duration?parseInt(F.duration):500,autoplay:N.autoPlay!==null,...N.autoPlay!==null&&{interval:parseInt(N.autoPlay)*1e3},direction:U==="horiz"||F.type==="fade in"?"ltr":"ttb",pagination:!1,drag:N.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:F.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((G,V)=>r.jsx(Ja,{children:r.jsx("div",{className:ot.sliderItem,children:r.jsx("div",{className:ot.imgWrapper,children:r.jsx("img",{className:rt(ot.sliderImage,{[ot.contain]:G.image.objectFit==="contain",[ot.cover]:G.image.objectFit==="cover"}),src:G.image.url,alt:G.image.name??""})})})},V))},Z),C.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:rt(ot.arrow,{[ot.arrowVertical]:U==="vert",[ot.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{onClick:()=>{X("-1")},className:ot.arrowInner,style:{transform:`translate(${$.scalingValue(J,i)}, ${$.scalingValue(k*(U==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(rn,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:rt(ot.arrowImg,ot.mirror)}),!C.arrowsImgUrl&&r.jsx(Ls,{color:C.color,className:rt(ot.arrowIcon,ot.arrowImg,ot.mirror)})]})}),r.jsx("div",{className:rt(ot.arrow,ot.nextArrow,{[ot.arrowVertical]:U==="vert",[ot.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{className:ot.arrowInner,onClick:()=>X("+1"),style:{transform:`translate(${$.scalingValue(J*(U==="horiz"?-1:1),i)}, ${$.scalingValue(k,i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(rn,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:ot.arrowImg}),!C.arrowsImgUrl&&r.jsx(Ls,{color:C.color,className:rt(ot.arrowIcon,ot.arrowImg)})]})})]}),N.triggersList.click&&r.jsx("div",{className:ot.clickOverlay,onClick:()=>{o&&o.go("+1")}}),z.isActive&&r.jsx("div",{className:rt(ot.pagination,{[ot.paginationInsideBottom]:z.position==="inside-1"&&U==="horiz",[ot.paginationInsideTop]:z.position==="inside-2"&&U==="horiz",[ot.paginationOutsideBottom]:z.position==="outside-1"&&U==="horiz",[ot.paginationOutsideTop]:z.position==="outside-2"&&U==="horiz",[ot.paginationInsideLeft]:z.position==="inside-1"&&U==="vert",[ot.paginationInsideRight]:z.position==="inside-2"&&U==="vert",[ot.paginationOutsideLeft]:z.position==="outside-1"&&U==="vert",[ot.paginationOutsideRight]:z.position==="outside-2"&&U==="vert",[ot.paginationVertical]:U==="vert"}),children:r.jsx("div",{className:ot.paginationInner,style:{backgroundColor:z.colors[2],transform:`scale(${z.scale/100}) translate(${$.scalingValue(z.offset.x,i)}, ${$.scalingValue(z.offset.y,i)}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:t.map((G,V)=>r.jsx("button",{onClick:()=>{o&&o.go(V)},className:rt(ot.paginationItem),children:r.jsx("div",{className:rt(ot.dot,{[ot.activeDot]:V===E}),style:{backgroundColor:V===E?z.colors[0]:z.colors[1],"--pagination-hover-color":z.hover}})},V))})})]})})}function Ls({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const op={element:ip,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"]}},rp="ImageRevealSlider-module__imageRevealSlider___UE5Ob",ap="ImageRevealSlider-module__image___Qjt-e",sp="ImageRevealSlider-module__link___N-iLG",lp="ImageRevealSlider-module__cursor___2U03d",wi={imageRevealSlider:rp,image:ap,link:sp,cursor:lp};function Rs(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const s=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*s,d=s/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 Br(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function cp(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await Br(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Br(e);s=l.height/l.width*o}else{const l=await Br(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function dp({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[s,l]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[p,w]=a.useState({x:0,y:0}),[b,h]=a.useState(1),[g,m]=a.useState("none"),x=a.useRef({x:0,y:0}),[M,E]=a.useState(!1),{sizeType:R,imageWidth:Z,randomRangeImageWidth:_}=e.imageSize,{revealPosition:U,visible:F}=e.position,{cursorType:C,target:z,defaultCursorScale:y,defaultCursor:N,hoverCursorScale:I,hoverCursor:J}=e.cursor;a.useEffect(()=>{if(!i)return;const G=(S,P)=>{const D=i.getBoundingClientRect(),re=S-D.left,ae=P-D.top;if(w({x:re,y:ae}),C==="system"){m("none"),h(1);return}const T=re,ue=ae,W=document.elementFromPoint(D.left+T,D.top+ue);if(W&&W.closest("a")){m("none"),h(1);return}const ie=Rs(T,ue,s)||z==="area"?{img:J??"none",scale:I}:{img:N??"none",scale:y};m(ie.img),h(ie.scale)},V=S=>{S.stopPropagation(),x.current={x:S.clientX,y:S.clientY},G(S.clientX,S.clientY)},oe=()=>{M&&G(x.current.x,x.current.y)};return i.addEventListener("mousemove",V),window.addEventListener("scroll",oe,!0),()=>{i.removeEventListener("mousemove",V),window.removeEventListener("scroll",oe,!0)}},[i,M,p,C,z,J,N,I,y,s]),a.useEffect(()=>{M||(m("none"),h(0))},[M]);const k=async(G,V,oe,S={})=>{const{width:P,height:D,finalWidth:re}=await cp(G.image.url,R,Z,_);let ae=0,T=0;U==="same"?(ae=V/2,T=oe/2):(ae=S.x??Math.random()*V,T=S.y??Math.random()*oe);const ue=Math.min(Math.max(ae,P/2),V-P/2),W=Math.min(Math.max(T,D/2),oe-D/2);return{id:u.current++,url:G.image.url,link:G.link,name:G.image.name,x:ue,y:W,width:re}};a.useEffect(()=>{if(!i||t.length===0)return;const G=i.getBoundingClientRect(),V=G.width,oe=G.height,S=[];(async()=>{const D=t[0],re=await k(D,V,oe);S.push(re),l(S),c(1)})()},[R,Z,_,U,i]),a.useEffect(()=>{F==="last One"&&l(G=>G.length>0?[G[G.length-1]]:[])},[F]);const X=async G=>{if(!i)return;const V=i.getBoundingClientRect(),oe=G.clientX-V.left,S=G.clientY-V.top;if(z==="image"&&!Rs(oe,S,s))return;let P=0,D=0;U==="on Click"?(P=oe,D=S):U==="same"?(P=V.width/2,D=V.height/2):(P=Math.random()*V.width,D=Math.random()*V.height);const re=t[d],ae=await k(re,V.width,V.height,{x:P,y:D});l(T=>F==="all"?[...T,ae]:[ae]),c(T=>T>=t.length-1?0:T+1)};return r.jsxs("div",{ref:o,onClick:X,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),className:wi.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[s.map(G=>r.jsx("div",{className:wi.wrapper,style:{top:`${G.y}px`,left:`${G.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:G.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:z==="area"&&G.link?r.jsx("a",{href:G.link,target:"_blank",className:wi.link,children:r.jsx("img",{src:G.url,alt:G.name,className:wi.image},G.id)}):r.jsx("img",{src:G.url,alt:G.name,className:wi.image},G.id)},G.id)),M&&r.jsx("div",{className:wi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${b})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const up={element:dp,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:""}]}}}},pp="LightBox-module__hidden___9s-9x",mp="LightBox-module__heroImage___sTxNF",gp="LightBox-module__background___rm9ml",hp="LightBox-module__editor___4ACaY",fp="LightBox-module__contentStyle___Bgnsq",yp="LightBox-module__imageStyle___tLIlB",vp="LightBox-module__imgWrapper___LuFUp",xp="LightBox-module__contain___8-yaS",bp="LightBox-module__cover___hNvOG",wp="LightBox-module__caption___b6L2I",Sp="LightBox-module__captionTextInner___rCGNH",$p="LightBox-module__lightboxSplide___XFuWC",Cp="LightBox-module__arrow___iz38X",Tp="LightBox-module__arrowVertical___Zfz81",Lp="LightBox-module__nextArrow___zkAQN",Rp="LightBox-module__arrowInner___p48sW",Ip="LightBox-module__arrowIcon___3VaFf",Ep="LightBox-module__arrowImg___pNV88",Mp="LightBox-module__mirror___pjeXc",Pp="LightBox-module__thumbsWrapper___GB-nU",kp="LightBox-module__thumbsContainerVertical___wttk5",Ap="LightBox-module__thumbsContainer___osSma",Fp="LightBox-module__thumbsAlignStart___MO6tY",Wp="LightBox-module__thumbsAlignCenter___Q4sUx",_p="LightBox-module__thumbsAlignEnd___p4y9R",Np="LightBox-module__thumbItem___HvnF3",Hp="LightBox-module__closeButton___g2khP",Op="LightBox-module__fadeIn___0m5GW",Dp="LightBox-module__slideInLeft___gPYwC",jp="LightBox-module__slideInRight___S-pPp",zp="LightBox-module__slideInTop___DFdAj",Bp="LightBox-module__slideInBottom___m27kZ",Vp="LightBox-module__fadeOut___55qBR",Gp="LightBox-module__slideOutLeft___NvU7P",qp="LightBox-module__slideOutRight___SK7eC",Up="LightBox-module__slideOutTop___Vgg0z",Kp="LightBox-module__slideOutBottom___nJ0Ef",Xp="LightBox-module__scaleSlide___vZriG",Ge={hidden:pp,heroImage:mp,background:gp,editor:hp,contentStyle:fp,imageStyle:yp,imgWrapper:vp,contain:xp,cover:bp,caption:wp,captionTextInner:Sp,lightboxSplide:$p,arrow:Cp,arrowVertical:Tp,nextArrow:Lp,arrowInner:Rp,arrowIcon:Ip,arrowImg:Ep,mirror:Mp,thumbsWrapper:Pp,thumbsContainerVertical:kp,thumbsContainer:Ap,thumbsAlignStart:Fp,thumbsAlignCenter:Wp,thumbsAlignEnd:_p,thumbItem:Np,closeButton:Hp,fadeIn:Op,slideInLeft:Dp,slideInRight:jp,slideInTop:zp,slideInBottom:Bp,fadeOut:Vp,slideOutLeft:Gp,slideOutRight:qp,slideOutTop:Up,slideOutBottom:Kp,scaleSlide:Xp},Do=(e,t,n)=>{const i={},[o,s]=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"),s==="left"?(i.left="0",i.right="auto"):s==="center"?(i.left="50%",i.right="auto"):s==="right"&&(i.left="auto",i.right="0"),o==="middle"&&s==="center"?i.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), calc(-50% + ${$.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${$.scalingValue(t.x,n)}, calc(-50% + ${$.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), ${$.scalingValue(t.y,n)})`:i.transform=`translate(${$.scalingValue(t.x,n)}, ${$.scalingValue(t.y,n)})`,i};function hc(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 Yp(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 fc(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=e;return{renderedW:d,renderedH:d/s}}const l=t;return{renderedW:l*s,renderedH:l}}function Zp(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=t;return{renderedW:d*s,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/s}}function yc(e,t,n,i,o){const{x:s,y:l}=Yp(o);return{offsetX:s*(e-n),offsetY:l*(t-i)}}function Jp(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,s=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?Zp:fc,{renderedW:u,renderedH:p}=c(n,i,o,s),{offsetX:w,offsetY:b}=yc(n,i,u,p,d),h=(w+u/2)/n*100,g=(b+p/2)/i*100;return`${h}% ${g}%`}function Qp(e){return Jp(e)}function mr(e){const t=e.getBoundingClientRect(),n=hc(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=fc(i,o,s,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:w}=yc(i,o,d,c,u),b=t.left+n.left,h=t.top+n.top;return{x:p+b,y:w+h,width:d,height:c}}function Is(e){const t=e.getBoundingClientRect(),n=hc(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Es(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 em(e,t){const n=(()=>{if(e==="fade in")return Ge.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ge.slideInLeft;case"right":return Ge.slideInRight;case"top":return Ge.slideInTop;case"bottom":return Ge.slideInBottom;default:return Ge.slideInRight}return Ge.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ge.fadeIn;if(e==="slide in")switch(t){case"left":return Ge.slideInLeft;case"right":return Ge.slideInRight;case"top":return Ge.slideInTop;case"bottom":return Ge.slideInBottom;default:return Ge.slideInRight}return Ge.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ge.fadeOut;if(e==="slide in")switch(t){case"left":return Ge.slideOutLeft;case"right":return Ge.slideOutRight;case"top":return Ge.slideOutTop;case"bottom":return Ge.slideOutBottom;default:return Ge.slideOutRight}return Ge.fadeOut})(),s=(()=>{if(e==="fade in")return Ge.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ge.slideOutLeft;case"right":return Ge.slideOutRight;case"top":return Ge.slideOutTop;case"bottom":return Ge.slideOutBottom;default:return Ge.slideOutRight}return Ge.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const tm=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:l})=>{const[d,c]=a.useState(!1),{url:u}=e.thumbnailBlock.cover;return a.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:Ge.heroImage,onClick:()=>c(!0)}),r.jsx(nm,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},nm=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var be;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:w,wordSpacing:b,fontSizeLineHeight:h,textAppearance:g,color:m}=i.imageCaption??{},[x,M]=a.useState(0),[E,R]=a.useState(0),[Z,_]=a.useState(!1),[U,F]=a.useState(!1),[C,z]=a.useState({}),y=a.useRef(null),N=a.useRef(null),I=a.useRef(null),J=a.useRef(!1),k=a.useRef(null),X=a.useRef(null),G=a.useRef(null),V=a.useRef(null),oe=a.useRef(!1),S=a.useRef(null),[P,D]=a.useState(!1),{appear:re,triggers:ae,slider:T,thumbnail:ue,controls:W,area:ie,caption:ne,layout:ye}=o.lightboxBlock,{appearClass:Pe,backdropAppearClass:me,backdropDisappearClass:le,disappearClass:K}=em(re.type,re.direction),ee=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const q=()=>{setTimeout(()=>{var ge,xe;(xe=(ge=y.current)==null?void 0:ge.splide)==null||xe.refresh()},16)},se=()=>{R(ge=>ge+1)};return window.addEventListener("ArticleEditor.Layout:change",q),window.addEventListener("ArticleEditor.ComponentContent:change",se),()=>{window.removeEventListener("ArticleEditor.Layout:change",q),window.removeEventListener("ArticleEditor.ComponentContent:change",se)}},[]),a.useEffect(()=>{if(!e||!ue.isActive){D(!1);return}const q=S.current;if(!q)return;const se=()=>{T.direction==="horiz"?D(q.scrollWidth>q.clientWidth):D(q.scrollHeight>q.clientHeight)};se();const ge=new ResizeObserver(se);return ge.observe(q),()=>ge.disconnect()},[e,ue.isActive,n.length,C,T.direction]);const Y=a.useCallback(()=>{const q=window.matchMedia("(max-width: 768px)").matches,se=Es(ie.color);q&&!l&&se>.9&&(document.body.style.backgroundColor=""),_(!0),J.current=!0;const ge=xe=>{xe.target===k.current&&xe.animationName&&(k.current&&X.current&&k.current.removeEventListener("animationend",X.current),X.current=null,J.current&&(J.current=!1,t()),_(!1))};k.current&&(X.current=ge,k.current.addEventListener("animationend",ge))},[t,ie.color,l]),We=(q,se,ge)=>{var xe,Ee;if(q){if(ae.type==="click"&&ae.switch==="image")ae.repeat==="close"&&x===n.length-1?Y():(xe=y.current)==null||xe.go("+1");else if(ae.type==="click"&&ae.switch==="50/50"){const Ce=q.getBoundingClientRect(),H=se-Ce.left,pe=ge-Ce.top,O=Ce.width,L=Ce.height;let B;T.direction==="horiz"?B=H<O/2?"-1":"+1":B=pe<L/2?"-1":"+1",(Ee=y.current)==null||Ee.go(B)}}},$e=q=>{if(oe.current){oe.current=!1;return}const se=n[x],ge=(se==null?void 0:se.image.objectFit)==="cover";let xe,Ee;if("changedTouches"in q&&q.changedTouches.length>0)xe=q.changedTouches[0].clientX,Ee=q.changedTouches[0].clientY;else if("clientX"in q)xe=q.clientX,Ee=q.clientY;else return;let Ce;if(ge&&I.current){const H=Is(I.current);Ce=xe>=H.left&&xe<=H.right&&Ee>=H.top&&Ee<=H.bottom}else{const H=I.current?mr(I.current):null;if(!H){q.target===q.currentTarget&&Y();return}Ce=xe>=H.x&&xe<=H.x+H.width&&Ee>=H.y&&Ee<=H.y+H.height}Ce?We(I.current,xe,Ee):Y()},Ae=q=>{const se=q.target;(se.classList.contains(Ge.thumbsWrapper)||se.classList.contains(Ge.thumbsContainer))&&$e(q)};a.useEffect(()=>{if(!e)return;const q=se=>{var ge,xe;if(se.key==="Escape"){Y();return}if(se.key==="ArrowRight"){M(Ee=>(Ee+1)%Math.max(n.length,1)),(ge=y.current)==null||ge.go("+1");return}se.key==="ArrowLeft"&&(M(Ee=>(Ee-1+Math.max(n.length,1))%Math.max(n.length,1)),(xe=y.current)==null||xe.go("-1"))};return window.addEventListener("keydown",q),()=>{window.removeEventListener("keydown",q)}},[e,Y,n.length]),a.useEffect(()=>{if(e){if(M(0),R(se=>se+1),J.current=!1,_(!1),F(!1),z({}),!ee)return;const q=new CustomEvent("page-overlay",{detail:{itemId:ee}});window.dispatchEvent(q)}return()=>{k.current&&X.current&&(k.current.removeEventListener("animationend",X.current),X.current=null),F(!1)}},[e,ee]),a.useEffect(()=>{N.current!==null&&N.current!==T.type&&R(q=>q+1),N.current=T.type},[T.type]),a.useEffect(()=>{if(!e)return;const q=document.body.style.overflow,se=window.matchMedia("(max-width: 768px)").matches,ge=Es(ie.color);document.body.style.overflow="hidden",F(!1);const xe=Ce=>{Ce.target===k.current&&!J.current&&Ce.animationName&&(se&&!l&&ge>.9&&(document.body.style.backgroundColor=ie.color),F(!0),k.current&&G.current&&k.current.removeEventListener("animationend",G.current),G.current=null)};k.current&&(G.current=xe,k.current.addEventListener("animationend",xe));const Ee=Ce=>{const H=Ce.target;H&&(H.closest(`.${Ge.thumbsWrapper}`)||H.closest(`.${Ge.thumbsContainer}`))||T.type!=="slide"&&Ce.preventDefault()};return document.addEventListener("touchmove",Ee,{passive:!1}),()=>{document.body.style.overflow=q,document.removeEventListener("touchmove",Ee),k.current&&G.current&&(k.current.removeEventListener("animationend",G.current),G.current=null),F(!1)}},[e,l,ie.color,T.type]),a.useEffect(()=>{if(!e)return;const q=se=>{var xe,Ee;if(J.current){se.stopPropagation();return}if(oe.current){oe.current=!1;return}const ge=se.target;if(!(ge&&(ge.closest(`.${Ge.thumbsContainer}`)||ge.closest(`.${Ge.thumbItem}`)||ge.closest(`.${Ge.arrow}`)||ge.closest(`.${Ge.closeButton}`)||ge.closest(`.${Ge.caption}`)))){if(T.type==="slide"&&ae.type==="drag"&&((Ee=(xe=y.current)==null?void 0:xe.splide)!=null&&Ee.root)){const Ce=y.current.splide.root;if(ge&&(Ce.contains(ge)||Ce===ge))return}if(se.touches.length===0&&se.changedTouches.length>0){const Ce=n[x],H=(Ce==null?void 0:Ce.image.objectFit)==="cover",pe=se.changedTouches[0];let O;if(H&&I.current){const L=Is(I.current);O=pe.clientX>=L.left&&pe.clientX<=L.right&&pe.clientY>=L.top&&pe.clientY<=L.bottom}else{const L=I.current?mr(I.current):null;if(!L)return;O=pe.clientX>=L.x&&pe.clientX<=L.x+L.width&&pe.clientY>=L.y&&pe.clientY<=L.y+L.height}if(!O){se.stopPropagation(),J.current=!0;const L=B=>{B.stopPropagation(),B.preventDefault(),document.removeEventListener("click",L,!0)};document.addEventListener("click",L,!0),Y()}}}};return document.addEventListener("touchend",q,{passive:!0}),()=>{document.removeEventListener("touchend",q)}},[e,Y,x,n]);const de=(T.type==="scale"||T.type==="fade")&&T.direction==="vert"&&ae.type==="drag";a.useEffect(()=>{var B,Re;if(!e||!de||!((Re=(B=y.current)==null?void 0:B.splide)!=null&&Re.root))return;const q=y.current.splide.root,se=30,ge=(Q,A)=>{if(V.current){const Fe=Math.abs(Q-V.current.x),Me=Math.abs(A-V.current.y);(Fe>0||Me>0)&&(oe.current=!0)}},xe=Q=>{V.current&&(Q.preventDefault(),ge(Q.clientX,Q.clientY))},Ee=Q=>{V.current&&Q.touches.length>0&&(Q.preventDefault(),ge(Q.touches[0].clientX,Q.touches[0].clientY))},Ce=(Q,A)=>{if(!V.current||!y.current){V.current=null;return}const Fe=Math.abs(Q-V.current.x),Me=Math.abs(A-V.current.y);Me>se&&Me>Fe&&y.current.go(A<V.current.y?"+1":"-1"),V.current=null},H=Q=>{V.current&&Ce(Q.clientX,Q.clientY),document.removeEventListener("pointerup",H),document.removeEventListener("pointercancel",H),document.removeEventListener("pointermove",xe)},pe=Q=>{if(V.current){if(Q.changedTouches.length>0){const A=Q.changedTouches[0];Ce(A.clientX,A.clientY)}document.removeEventListener("touchend",pe),document.removeEventListener("touchcancel",pe),document.removeEventListener("touchmove",Ee)}},O=Q=>{V.current={x:Q.clientX,y:Q.clientY},oe.current=!1,document.addEventListener("pointermove",xe,{passive:!1}),document.addEventListener("pointerup",H),document.addEventListener("pointercancel",H)},L=Q=>{Q.touches.length>0&&(V.current={x:Q.touches[0].clientX,y:Q.touches[0].clientY},oe.current=!1,document.addEventListener("touchmove",Ee,{passive:!1}),document.addEventListener("touchend",pe),document.addEventListener("touchcancel",pe))};return q.addEventListener("pointerdown",O),q.addEventListener("touchstart",L),()=>{q.removeEventListener("pointerdown",O),q.removeEventListener("touchstart",L),document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",H),document.removeEventListener("pointercancel",H),document.removeEventListener("touchmove",Ee),document.removeEventListener("touchend",pe),document.removeEventListener("touchcancel",pe),V.current=null,oe.current=!1}},[e,de,E]);const he={backgroundColor:ie.color,backdropFilter:`blur(${ie.blur}px)`,animationDuration:`${parseInt(re.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:Yn.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:l?null:k,className:rt(Ge.background,Z?le:me,{[Ge.editor]:l},{[Ge.hidden]:!e}),style:{...he,...U&&!l&&!Z?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?k:null,className:rt(Ge.contentStyle,Z?K:Pe,{[Ge.editor]:l},{[Ge.hidden]:!e}),style:{animationDuration:`${parseInt(re.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Za,{onMove:q=>M(q.index),ref:y,className:Ge.lightboxSplide,options:{arrows:!1,speed:T.duration?parseInt(T.duration):500,direction:T.direction==="horiz"||T.type==="fade"||T.type==="scale"?"ltr":"ttb",pagination:!1,drag:ae.type==="drag"&&!de,perPage:1,width:"100%",height:"100%",type:T.type==="fade"||T.type==="scale"?"fade":"loop",padding:0,rewind:ae.repeat!=="close",start:0},style:{"--splide-speed":T.duration},children:n.map((q,se)=>{const ge=Do(ye.position,ye.offset,l),xe=`${$.scalingValue(ye.padding.top,l)} ${$.scalingValue(ye.padding.right,l)} ${$.scalingValue(ye.padding.bottom,l)} ${$.scalingValue(ye.padding.left,l)}`,Ee=T.type==="scale"?(()=>{const{transform:Ce,...H}=ge;return{...H,position:"absolute",padding:xe,boxSizing:"border-box","--position-transform":Ce||"none"}})():{...ge,position:"absolute",padding:xe,boxSizing:"border-box"};return r.jsx(Ja,{children:r.jsx("div",{className:Ge.imgWrapper,onClick:$e,children:r.jsx("img",{ref:se===x?I:null,className:rt(Ge.imageStyle,{[Ge.contain]:q.image.objectFit==="contain",[Ge.cover]:q.image.objectFit==="cover",[Ge.scaleSlide]:T.type==="scale"}),src:q.image.url,alt:q.image.name??"",style:{...Ee,pointerEvents:q.image.objectFit==="contain"?"none":"auto"}})})},se)})},E),W.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:rt(Ge.arrow,{[Ge.arrowVertical]:T.direction==="vert"}),style:{color:W.color,"--arrow-hover-color":W.hover},children:r.jsxs("button",{className:Ge.arrowInner,style:{transform:`translate(${$.scalingValue(W.offset.x,l)}, ${$.scalingValue(W.offset.y*(T.direction==="horiz"?1:-1),l)}) scale(${W.scale}) rotate(${T.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var q;return(q=y.current)==null?void 0:q.go("-1")},"aria-label":"Previous",children:[W.arrowsImgUrl&&r.jsx(rn,{url:W.arrowsImgUrl,fill:W.color,hoverFill:W.hover,className:rt(Ge.arrowImg,Ge.mirror)}),!W.arrowsImgUrl&&r.jsx(Ms,{color:W.color,className:rt(Ge.arrowIcon,Ge.arrowImg,Ge.mirror)})]})}),r.jsx("div",{className:rt(Ge.arrow,Ge.nextArrow,{[Ge.arrowVertical]:T.direction==="vert"}),style:{color:W.color,"--arrow-hover-color":W.hover},children:r.jsxs("button",{className:Ge.arrowInner,style:{transform:`translate(${$.scalingValue(W.offset.x*(T.direction==="horiz"?-1:1),l)}, ${$.scalingValue(W.offset.y,l)}) scale(${W.scale}) rotate(${T.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var q;return(q=y.current)==null?void 0:q.go("+1")},"aria-label":"Next",children:[W.arrowsImgUrl&&r.jsx(rn,{url:W.arrowsImgUrl,fill:W.color,hoverFill:W.hover,className:Ge.arrowImg}),!W.arrowsImgUrl&&r.jsx(Ms,{color:W.color,className:rt(Ge.arrowIcon,Ge.arrowImg)})]})})]}),ie.closeIconUrl&&(()=>{const q=Do(ie.closeIconAlign,ie.closeIconOffset,l),se=`scale(${ie.closeIconScale})`,ge=q.transform?`${q.transform} ${se}`:se;return r.jsx("button",{className:Ge.closeButton,style:{...q,transform:ge},onClick:Y,"aria-label":"Close lightbox",children:r.jsx(rn,{url:ie.closeIconUrl,fill:ie.closeIconColor??"#000000",hoverFill:ie.closeIconHover??"#cccccc"})})})(),ne&&ne.isActive&&i.imageCaption&&((be=n[x])==null?void 0:be.imageCaption)&&r.jsx("div",{className:Ge.caption,style:{...Do(ne.alignment,ne.offset,l),fontFamily:Er(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":$.scalingValue(c.width,l),letterSpacing:$.scalingValue(p,l),wordSpacing:$.scalingValue(b,l),textAlign:w,fontSize:$.scalingValue(h.fontSize,l),lineHeight:$.scalingValue(h.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:m},onClick:q=>q.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Ge.captionTextInner,style:{"--link-color":ne.linkColor,"--link-hover-color":ne.linkHoverColor},children:r.jsx(yi,{content:n[x].imageCaption})})}),ue.isActive&&(()=>{const[q,se]=ue.position.split("-"),ge=T.direction==="horiz"?`${q}-left`:ue.position,xe=Do(ge,ue.offset,l),Ee=()=>{if(T.direction==="horiz"){if(se==="left")return"flex-start";if(se==="center")return"center";if(se==="right")return"flex-end"}else{if(q==="top")return"flex-start";if(q==="middle")return"center";if(q==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:S,className:Ge.thumbsWrapper,onClick:Ce=>Ae(Ce),style:{position:l?"absolute":"fixed",...xe,...T.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:rt(Ge.thumbsContainer,{[Ge.thumbsContainerVertical]:T.direction==="vert",[Ge.thumbsAlignStart]:ue.align==="start",[Ge.thumbsAlignCenter]:ue.align==="center",[Ge.thumbsAlignEnd]:ue.align==="end"}),style:{gap:$.scalingValue(ue.grid.gap,l),justifyContent:P?"flex-start":Ee()},children:n.map((Ce,H)=>{const pe=H===x,O=C[H],B=ue.grid.size*(pe?ue.activeState.scale:1),Re=()=>{if(ue.fit!=="fit")return{};if(!O)return T.direction==="horiz"?{height:$.scalingValue(B,l)}:{width:$.scalingValue(B,l)};const Q=O.width/O.height;if(T.direction==="horiz"){const A=B,Fe=A*Q;return{width:$.scalingValue(Fe,l),height:$.scalingValue(A,l)}}else{const A=B,Fe=A/Q;return{width:$.scalingValue(A,l),height:$.scalingValue(Fe,l)}}};return r.jsx("button",{className:Ge.thumbItem,style:{...T.direction==="horiz"&&ue.fit!=="fit"?{height:$.scalingValue(B,l)}:{},...T.direction==="vert"&&ue.fit!=="fit"?{width:$.scalingValue(B,l)}:{},...ue.fit==="cover"?{width:$.scalingValue(B,l),height:$.scalingValue(B,l)}:{},...Re(),transition:pe?"all 0.25s ease-out":"none",opacity:pe?ue.activeState.opacity/100:ue.opacity/100,"--thumb-hover":ue.activeState.opacity/100},onClick:Q=>{var A;Q.stopPropagation(),M(H),(A=y.current)==null||A.go(H)},onMouseEnter:()=>{var Q;ue.triggers==="hov"&&((Q=y.current)==null||Q.go(H))},children:r.jsx("img",{src:Ce.image.url,alt:Ce.image.name??"",onLoad:Q=>{const A=Q.currentTarget;A.naturalWidth&&A.naturalHeight&&z(Fe=>({...Fe,[H]:{width:A.naturalWidth,height:A.naturalHeight}}))},style:{objectFit:ue.fit==="cover"?"cover":"contain",...ue.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ue.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Ce.image.name}-${H}`)})})})})()]})]}),document.getElementById(s))};function Ms({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const im={element:tm,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 jo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function om(e){return`
|
|
6
|
+
*/const Ku="RichTextRenderer-module__link___BWeZ2",Xu={link:Ku},Yu=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))},Er=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Yu(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function on(e){const{color:t,...n}=e;return n}function Ut(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Er(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:$.scalingValue(e.letterSpacing,t),wordSpacing:$.scalingValue(e.wordSpacing,t),fontSize:$.scalingValue(n,t),lineHeight:i!==void 0?$.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const yi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Xu.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Zu(i),children:i.text},o));return r.jsx(r.Fragment,{children:e.map((n,i)=>{const o=n.children;return r.jsx("div",{children:t(o)},i)})})};function Zu(e){return{...e.fontFamily&&{fontFamily:Er(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 Ju="SvgImage-module__svg___q3xE-",Qu="SvgImage-module__img___VsTm-",Ts={svg:Ju,img:Qu},ep=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},tp=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,rn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,l]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!ep(e)||!s?r.jsx("img",{src:e,alt:"",className:st(Ts.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:st(Ts.svg,i),style:{"--svg":tp(e),"--fill":t,"--hover-fill":n,...o??{}}})},np={"top-left":rt.topLeftAlignment,"top-center":rt.topCenterAlignment,"top-right":rt.topRightAlignment,"middle-left":rt.middleLeftAlignment,"middle-center":rt.middleCenterAlignment,"middle-right":rt.middleRightAlignment,"bottom-left":rt.bottomLeftAlignment,"bottom-center":rt.bottomCenterAlignment,"bottom-right":rt.bottomRightAlignment};function ip({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=a.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:v,textAppearance:y,color:g}=n.imageCaption??{},[h,m]=a.useState(void 0),[b,E]=a.useState(null),[R,L]=a.useState(0),[J,W]=a.useState(0),{direction:q,transition:A,controls:C,pagination:O,imageCaption:w,triggers:H}=e,P=a.useRef(A.type),{x:X,y:k}=e.controls.offset,Y=U=>{o&&o.go(U)};return a.useEffect(()=>{if(!b)return;const U=new ResizeObserver(V=>{if(!o)return;const[ie]=V;m({width:Math.round(ie.contentRect.width),height:Math.round(ie.contentRect.height)})});return U.observe(b),()=>U.unobserve(b)},[b]),a.useEffect(()=>{!o||P.current===A.type||(W(U=>U+1),P.current=A.type)},[A.type]),r.jsx("div",{className:st(rt.wrapper,{[rt.editor]:i}),ref:E,children:r.jsxs("div",{className:rt.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:A.backgroundColor&&A.type==="fade in"?A.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:st(rt.captionBlock),children:r.jsx("div",{className:rt.captionTextWrapper,children:t.map((U,V)=>r.jsx("div",{className:st(rt.captionText,np[w.alignment],{[rt.withPointerEvents]:V===R&&i,[rt.active]:V===R}),style:{fontFamily:Er(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":$.scalingValue(l.width,i),letterSpacing:$.scalingValue(c,i),wordSpacing:$.scalingValue(p,i),textAlign:u,fontSize:$.scalingValue(v.fontSize,i),lineHeight:$.scalingValue(v.lineHeight,i),textTransform:y.textTransform??"none",textDecoration:y.textDecoration??"none",fontVariant:y.fontVariant??"normal",color:g,transitionDuration:A.duration?`${Math.round(parseInt(A.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:rt.captionTextInner,style:{"--link-hover-color":w.linkHoverColor,"--link-color":w.linkColor,position:"relative",top:$.scalingValue(w.offset.y,i),left:$.scalingValue(w.offset.x,i)},children:r.jsx(yi,{content:U.imageCaption})})},V))})}),r.jsx(Za,{onMove:U=>{L(U.index)},ref:s,options:{arrows:!1,speed:A.duration?parseInt(A.duration):500,autoplay:H.autoPlay!==null,...H.autoPlay!==null&&{interval:parseInt(H.autoPlay)*1e3},direction:q==="horiz"||A.type==="fade in"?"ltr":"ttb",pagination:!1,drag:H.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:A.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((U,V)=>r.jsx(Ja,{children:r.jsx("div",{className:rt.sliderItem,children:r.jsx("div",{className:rt.imgWrapper,children:r.jsx("img",{className:st(rt.sliderImage,{[rt.contain]:U.image.objectFit==="contain",[rt.cover]:U.image.objectFit==="cover"}),src:U.image.url,alt:U.image.name??""})})})},V))},J),C.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:st(rt.arrow,{[rt.arrowVertical]:q==="vert",[rt.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{onClick:()=>{Y("-1")},className:rt.arrowInner,style:{transform:`translate(${$.scalingValue(X,i)}, ${$.scalingValue(k*(q==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${q==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(rn,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:st(rt.arrowImg,rt.mirror)}),!C.arrowsImgUrl&&r.jsx(Ls,{color:C.color,className:st(rt.arrowIcon,rt.arrowImg,rt.mirror)})]})}),r.jsx("div",{className:st(rt.arrow,rt.nextArrow,{[rt.arrowVertical]:q==="vert",[rt.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{className:rt.arrowInner,onClick:()=>Y("+1"),style:{transform:`translate(${$.scalingValue(X*(q==="horiz"?-1:1),i)}, ${$.scalingValue(k,i)}) scale(${e.controls.scale/100}) rotate(${q==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(rn,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:rt.arrowImg}),!C.arrowsImgUrl&&r.jsx(Ls,{color:C.color,className:st(rt.arrowIcon,rt.arrowImg)})]})})]}),H.triggersList.click&&r.jsx("div",{className:rt.clickOverlay,onClick:()=>{o&&o.go("+1")}}),O.isActive&&r.jsx("div",{className:st(rt.pagination,{[rt.paginationInsideBottom]:O.position==="inside-1"&&q==="horiz",[rt.paginationInsideTop]:O.position==="inside-2"&&q==="horiz",[rt.paginationOutsideBottom]:O.position==="outside-1"&&q==="horiz",[rt.paginationOutsideTop]:O.position==="outside-2"&&q==="horiz",[rt.paginationInsideLeft]:O.position==="inside-1"&&q==="vert",[rt.paginationInsideRight]:O.position==="inside-2"&&q==="vert",[rt.paginationOutsideLeft]:O.position==="outside-1"&&q==="vert",[rt.paginationOutsideRight]:O.position==="outside-2"&&q==="vert",[rt.paginationVertical]:q==="vert"}),children:r.jsx("div",{className:rt.paginationInner,style:{backgroundColor:O.colors[2],transform:`scale(${O.scale/100}) translate(${$.scalingValue(O.offset.x,i)}, ${$.scalingValue(O.offset.y,i)}) rotate(${q==="horiz"?"0deg":"90deg"})`},children:t.map((U,V)=>r.jsx("button",{onClick:()=>{o&&o.go(V)},className:st(rt.paginationItem),children:r.jsx("div",{className:st(rt.dot,{[rt.activeDot]:V===R}),style:{backgroundColor:V===R?O.colors[0]:O.colors[1],"--pagination-hover-color":O.hover}})},V))})})]})})}function Ls({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const op={element:ip,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"]}},rp="ImageRevealSlider-module__imageRevealSlider___UE5Ob",ap="ImageRevealSlider-module__image___Qjt-e",sp="ImageRevealSlider-module__link___N-iLG",lp="ImageRevealSlider-module__cursor___2U03d",wi={imageRevealSlider:rp,image:ap,link:sp,cursor:lp};function Rs(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const s=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*s,d=s/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 Br(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function cp(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await Br(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Br(e);s=l.height/l.width*o}else{const l=await Br(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function dp({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[s,l]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[p,v]=a.useState({x:0,y:0}),[y,g]=a.useState(1),[h,m]=a.useState("none"),b=a.useRef({x:0,y:0}),[E,R]=a.useState(!1),{sizeType:L,imageWidth:J,randomRangeImageWidth:W}=e.imageSize,{revealPosition:q,visible:A}=e.position,{cursorType:C,target:O,defaultCursorScale:w,defaultCursor:H,hoverCursorScale:P,hoverCursor:X}=e.cursor;a.useEffect(()=>{if(!i)return;const U=(S,M)=>{const z=i.getBoundingClientRect(),ae=S-z.left,re=M-z.top;if(v({x:ae,y:re}),C==="system"){m("none"),g(1);return}const I=ae,ue=re,F=document.elementFromPoint(z.left+I,z.top+ue);if(F&&F.closest("a")){m("none"),g(1);return}const oe=Rs(I,ue,s)||O==="area"?{img:X??"none",scale:P}:{img:H??"none",scale:w};m(oe.img),g(oe.scale)},V=S=>{S.stopPropagation(),b.current={x:S.clientX,y:S.clientY},U(S.clientX,S.clientY)},ie=()=>{E&&U(b.current.x,b.current.y)};return i.addEventListener("mousemove",V),window.addEventListener("scroll",ie,!0),()=>{i.removeEventListener("mousemove",V),window.removeEventListener("scroll",ie,!0)}},[i,E,p,C,O,X,H,P,w,s]),a.useEffect(()=>{E||(m("none"),g(0))},[E]);const k=async(U,V,ie,S={})=>{const{width:M,height:z,finalWidth:ae}=await cp(U.image.url,L,J,W);let re=0,I=0;q==="same"?(re=V/2,I=ie/2):(re=S.x??Math.random()*V,I=S.y??Math.random()*ie);const ue=Math.min(Math.max(re,M/2),V-M/2),F=Math.min(Math.max(I,z/2),ie-z/2);return{id:u.current++,url:U.image.url,link:U.link,name:U.image.name,x:ue,y:F,width:ae}};a.useEffect(()=>{if(!i||t.length===0)return;const U=i.getBoundingClientRect(),V=U.width,ie=U.height,S=[];(async()=>{const z=t[0],ae=await k(z,V,ie);S.push(ae),l(S),c(1)})()},[L,J,W,q,i]),a.useEffect(()=>{A==="last One"&&l(U=>U.length>0?[U[U.length-1]]:[])},[A]);const Y=async U=>{if(!i)return;const V=i.getBoundingClientRect(),ie=U.clientX-V.left,S=U.clientY-V.top;if(O==="image"&&!Rs(ie,S,s))return;let M=0,z=0;q==="on Click"?(M=ie,z=S):q==="same"?(M=V.width/2,z=V.height/2):(M=Math.random()*V.width,z=Math.random()*V.height);const ae=t[d],re=await k(ae,V.width,V.height,{x:M,y:z});l(I=>A==="all"?[...I,re]:[re]),c(I=>I>=t.length-1?0:I+1)};return r.jsxs("div",{ref:o,onClick:Y,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),className:wi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[s.map(U=>r.jsx("div",{className:wi.wrapper,style:{top:`${U.y}px`,left:`${U.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:U.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:O==="area"&&U.link?r.jsx("a",{href:U.link,target:"_blank",className:wi.link,children:r.jsx("img",{src:U.url,alt:U.name,className:wi.image},U.id)}):r.jsx("img",{src:U.url,alt:U.name,className:wi.image},U.id)},U.id)),E&&r.jsx("div",{className:wi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${y})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const up={element:dp,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:""}]}}}},pp="LightBox-module__hidden___9s-9x",mp="LightBox-module__heroImage___sTxNF",gp="LightBox-module__background___rm9ml",hp="LightBox-module__editor___4ACaY",fp="LightBox-module__contentStyle___Bgnsq",yp="LightBox-module__imageStyle___tLIlB",vp="LightBox-module__imgWrapper___LuFUp",xp="LightBox-module__contain___8-yaS",bp="LightBox-module__cover___hNvOG",wp="LightBox-module__caption___b6L2I",Sp="LightBox-module__captionTextInner___rCGNH",$p="LightBox-module__lightboxSplide___XFuWC",Cp="LightBox-module__arrow___iz38X",Tp="LightBox-module__arrowVertical___Zfz81",Lp="LightBox-module__nextArrow___zkAQN",Rp="LightBox-module__arrowInner___p48sW",Ip="LightBox-module__arrowIcon___3VaFf",Ep="LightBox-module__arrowImg___pNV88",Mp="LightBox-module__mirror___pjeXc",Pp="LightBox-module__thumbsWrapper___GB-nU",kp="LightBox-module__thumbsContainerVertical___wttk5",Ap="LightBox-module__thumbsContainer___osSma",Fp="LightBox-module__thumbsAlignStart___MO6tY",Wp="LightBox-module__thumbsAlignCenter___Q4sUx",_p="LightBox-module__thumbsAlignEnd___p4y9R",Hp="LightBox-module__thumbItem___HvnF3",Np="LightBox-module__closeButton___g2khP",Op="LightBox-module__fadeIn___0m5GW",Dp="LightBox-module__slideInLeft___gPYwC",jp="LightBox-module__slideInRight___S-pPp",zp="LightBox-module__slideInTop___DFdAj",Bp="LightBox-module__slideInBottom___m27kZ",Vp="LightBox-module__fadeOut___55qBR",Gp="LightBox-module__slideOutLeft___NvU7P",qp="LightBox-module__slideOutRight___SK7eC",Up="LightBox-module__slideOutTop___Vgg0z",Kp="LightBox-module__slideOutBottom___nJ0Ef",Xp="LightBox-module__scaleSlide___vZriG",Ge={hidden:pp,heroImage:mp,background:gp,editor:hp,contentStyle:fp,imageStyle:yp,imgWrapper:vp,contain:xp,cover:bp,caption:wp,captionTextInner:Sp,lightboxSplide:$p,arrow:Cp,arrowVertical:Tp,nextArrow:Lp,arrowInner:Rp,arrowIcon:Ip,arrowImg:Ep,mirror:Mp,thumbsWrapper:Pp,thumbsContainerVertical:kp,thumbsContainer:Ap,thumbsAlignStart:Fp,thumbsAlignCenter:Wp,thumbsAlignEnd:_p,thumbItem:Hp,closeButton:Np,fadeIn:Op,slideInLeft:Dp,slideInRight:jp,slideInTop:zp,slideInBottom:Bp,fadeOut:Vp,slideOutLeft:Gp,slideOutRight:qp,slideOutTop:Up,slideOutBottom:Kp,scaleSlide:Xp},Do=(e,t,n)=>{const i={},[o,s]=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"),s==="left"?(i.left="0",i.right="auto"):s==="center"?(i.left="50%",i.right="auto"):s==="right"&&(i.left="auto",i.right="0"),o==="middle"&&s==="center"?i.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), calc(-50% + ${$.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${$.scalingValue(t.x,n)}, calc(-50% + ${$.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), ${$.scalingValue(t.y,n)})`:i.transform=`translate(${$.scalingValue(t.x,n)}, ${$.scalingValue(t.y,n)})`,i};function hc(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 Yp(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 fc(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=e;return{renderedW:d,renderedH:d/s}}const l=t;return{renderedW:l*s,renderedH:l}}function Zp(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=t;return{renderedW:d*s,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/s}}function yc(e,t,n,i,o){const{x:s,y:l}=Yp(o);return{offsetX:s*(e-n),offsetY:l*(t-i)}}function Jp(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,s=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?Zp:fc,{renderedW:u,renderedH:p}=c(n,i,o,s),{offsetX:v,offsetY:y}=yc(n,i,u,p,d),g=(v+u/2)/n*100,h=(y+p/2)/i*100;return`${g}% ${h}%`}function Qp(e){return Jp(e)}function mr(e){const t=e.getBoundingClientRect(),n=hc(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=fc(i,o,s,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:v}=yc(i,o,d,c,u),y=t.left+n.left,g=t.top+n.top;return{x:p+y,y:v+g,width:d,height:c}}function Is(e){const t=e.getBoundingClientRect(),n=hc(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Es(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 em(e,t){const n=(()=>{if(e==="fade in")return Ge.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ge.slideInLeft;case"right":return Ge.slideInRight;case"top":return Ge.slideInTop;case"bottom":return Ge.slideInBottom;default:return Ge.slideInRight}return Ge.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ge.fadeIn;if(e==="slide in")switch(t){case"left":return Ge.slideInLeft;case"right":return Ge.slideInRight;case"top":return Ge.slideInTop;case"bottom":return Ge.slideInBottom;default:return Ge.slideInRight}return Ge.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ge.fadeOut;if(e==="slide in")switch(t){case"left":return Ge.slideOutLeft;case"right":return Ge.slideOutRight;case"top":return Ge.slideOutTop;case"bottom":return Ge.slideOutBottom;default:return Ge.slideOutRight}return Ge.fadeOut})(),s=(()=>{if(e==="fade in")return Ge.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ge.slideOutLeft;case"right":return Ge.slideOutRight;case"top":return Ge.slideOutTop;case"bottom":return Ge.slideOutBottom;default:return Ge.slideOutRight}return Ge.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const tm=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:l})=>{const[d,c]=a.useState(!1),{url:u}=e.thumbnailBlock.cover;return a.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:Ge.heroImage,onClick:()=>c(!0)}),r.jsx(nm,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},nm=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var be;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:v,wordSpacing:y,fontSizeLineHeight:g,textAppearance:h,color:m}=i.imageCaption??{},[b,E]=a.useState(0),[R,L]=a.useState(0),[J,W]=a.useState(!1),[q,A]=a.useState(!1),[C,O]=a.useState({}),w=a.useRef(null),H=a.useRef(null),P=a.useRef(null),X=a.useRef(!1),k=a.useRef(null),Y=a.useRef(null),U=a.useRef(null),V=a.useRef(null),ie=a.useRef(!1),S=a.useRef(null),[M,z]=a.useState(!1),{appear:ae,triggers:re,slider:I,thumbnail:ue,controls:F,area:oe,caption:Q,layout:ye}=o.lightboxBlock,{appearClass:Pe,backdropAppearClass:pe,backdropDisappearClass:ce,disappearClass:K}=em(ae.type,ae.direction),te=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const G=()=>{setTimeout(()=>{var ge,xe;(xe=(ge=w.current)==null?void 0:ge.splide)==null||xe.refresh()},16)},se=()=>{L(ge=>ge+1)};return window.addEventListener("ArticleEditor.Layout:change",G),window.addEventListener("ArticleEditor.ComponentContent:change",se),()=>{window.removeEventListener("ArticleEditor.Layout:change",G),window.removeEventListener("ArticleEditor.ComponentContent:change",se)}},[]),a.useEffect(()=>{if(!e||!ue.isActive){z(!1);return}const G=S.current;if(!G)return;const se=()=>{I.direction==="horiz"?z(G.scrollWidth>G.clientWidth):z(G.scrollHeight>G.clientHeight)};se();const ge=new ResizeObserver(se);return ge.observe(G),()=>ge.disconnect()},[e,ue.isActive,n.length,C,I.direction]);const Z=a.useCallback(()=>{const G=window.matchMedia("(max-width: 768px)").matches,se=Es(oe.color);G&&!l&&se>.9&&(document.body.style.backgroundColor=""),W(!0),X.current=!0;const ge=xe=>{xe.target===k.current&&xe.animationName&&(k.current&&Y.current&&k.current.removeEventListener("animationend",Y.current),Y.current=null,X.current&&(X.current=!1,t()),W(!1))};k.current&&(Y.current=ge,k.current.addEventListener("animationend",ge))},[t,oe.color,l]),Fe=(G,se,ge)=>{var xe,Me;if(G){if(re.type==="click"&&re.switch==="image")re.repeat==="close"&&b===n.length-1?Z():(xe=w.current)==null||xe.go("+1");else if(re.type==="click"&&re.switch==="50/50"){const Ce=G.getBoundingClientRect(),N=se-Ce.left,me=ge-Ce.top,D=Ce.width,T=Ce.height;let B;I.direction==="horiz"?B=N<D/2?"-1":"+1":B=me<T/2?"-1":"+1",(Me=w.current)==null||Me.go(B)}}},$e=G=>{if(ie.current){ie.current=!1;return}const se=n[b],ge=(se==null?void 0:se.image.objectFit)==="cover";let xe,Me;if("changedTouches"in G&&G.changedTouches.length>0)xe=G.changedTouches[0].clientX,Me=G.changedTouches[0].clientY;else if("clientX"in G)xe=G.clientX,Me=G.clientY;else return;let Ce;if(ge&&P.current){const N=Is(P.current);Ce=xe>=N.left&&xe<=N.right&&Me>=N.top&&Me<=N.bottom}else{const N=P.current?mr(P.current):null;if(!N){G.target===G.currentTarget&&Z();return}Ce=xe>=N.x&&xe<=N.x+N.width&&Me>=N.y&&Me<=N.y+N.height}Ce?Fe(P.current,xe,Me):Z()},We=G=>{const se=G.target;(se.classList.contains(Ge.thumbsWrapper)||se.classList.contains(Ge.thumbsContainer))&&$e(G)};a.useEffect(()=>{if(!e)return;const G=se=>{var ge,xe;if(se.key==="Escape"){Z();return}if(se.key==="ArrowRight"){E(Me=>(Me+1)%Math.max(n.length,1)),(ge=w.current)==null||ge.go("+1");return}se.key==="ArrowLeft"&&(E(Me=>(Me-1+Math.max(n.length,1))%Math.max(n.length,1)),(xe=w.current)==null||xe.go("-1"))};return window.addEventListener("keydown",G),()=>{window.removeEventListener("keydown",G)}},[e,Z,n.length]),a.useEffect(()=>{if(e){if(E(0),L(se=>se+1),X.current=!1,W(!1),A(!1),O({}),!te)return;const G=new CustomEvent("page-overlay",{detail:{itemId:te}});window.dispatchEvent(G)}return()=>{k.current&&Y.current&&(k.current.removeEventListener("animationend",Y.current),Y.current=null),A(!1)}},[e,te]),a.useEffect(()=>{H.current!==null&&H.current!==I.type&&L(G=>G+1),H.current=I.type},[I.type]),a.useEffect(()=>{if(!e)return;const G=document.body.style.overflow,se=window.matchMedia("(max-width: 768px)").matches,ge=Es(oe.color);document.body.style.overflow="hidden",A(!1);const xe=Ce=>{Ce.target===k.current&&!X.current&&Ce.animationName&&(se&&!l&&ge>.9&&(document.body.style.backgroundColor=oe.color),A(!0),k.current&&U.current&&k.current.removeEventListener("animationend",U.current),U.current=null)};k.current&&(U.current=xe,k.current.addEventListener("animationend",xe));const Me=Ce=>{const N=Ce.target;N&&(N.closest(`.${Ge.thumbsWrapper}`)||N.closest(`.${Ge.thumbsContainer}`))||I.type!=="slide"&&Ce.preventDefault()};return document.addEventListener("touchmove",Me,{passive:!1}),()=>{document.body.style.overflow=G,document.removeEventListener("touchmove",Me),k.current&&U.current&&(k.current.removeEventListener("animationend",U.current),U.current=null),A(!1)}},[e,l,oe.color,I.type]),a.useEffect(()=>{if(!e)return;const G=se=>{var xe,Me;if(X.current){se.stopPropagation();return}if(ie.current){ie.current=!1;return}const ge=se.target;if(!(ge&&(ge.closest(`.${Ge.thumbsContainer}`)||ge.closest(`.${Ge.thumbItem}`)||ge.closest(`.${Ge.arrow}`)||ge.closest(`.${Ge.closeButton}`)||ge.closest(`.${Ge.caption}`)))){if(I.type==="slide"&&re.type==="drag"&&((Me=(xe=w.current)==null?void 0:xe.splide)!=null&&Me.root)){const Ce=w.current.splide.root;if(ge&&(Ce.contains(ge)||Ce===ge))return}if(se.touches.length===0&&se.changedTouches.length>0){const Ce=n[b],N=(Ce==null?void 0:Ce.image.objectFit)==="cover",me=se.changedTouches[0];let D;if(N&&P.current){const T=Is(P.current);D=me.clientX>=T.left&&me.clientX<=T.right&&me.clientY>=T.top&&me.clientY<=T.bottom}else{const T=P.current?mr(P.current):null;if(!T)return;D=me.clientX>=T.x&&me.clientX<=T.x+T.width&&me.clientY>=T.y&&me.clientY<=T.y+T.height}if(!D){se.stopPropagation(),X.current=!0;const T=B=>{B.stopPropagation(),B.preventDefault(),document.removeEventListener("click",T,!0)};document.addEventListener("click",T,!0),Z()}}}};return document.addEventListener("touchend",G,{passive:!0}),()=>{document.removeEventListener("touchend",G)}},[e,Z,b,n]);const de=(I.type==="scale"||I.type==="fade")&&I.direction==="vert"&&re.type==="drag";a.useEffect(()=>{var B,Le;if(!e||!de||!((Le=(B=w.current)==null?void 0:B.splide)!=null&&Le.root))return;const G=w.current.splide.root,se=30,ge=(ne,_)=>{if(V.current){const ke=Math.abs(ne-V.current.x),Ie=Math.abs(_-V.current.y);(ke>0||Ie>0)&&(ie.current=!0)}},xe=ne=>{V.current&&(ne.preventDefault(),ge(ne.clientX,ne.clientY))},Me=ne=>{V.current&&ne.touches.length>0&&(ne.preventDefault(),ge(ne.touches[0].clientX,ne.touches[0].clientY))},Ce=(ne,_)=>{if(!V.current||!w.current){V.current=null;return}const ke=Math.abs(ne-V.current.x),Ie=Math.abs(_-V.current.y);Ie>se&&Ie>ke&&w.current.go(_<V.current.y?"+1":"-1"),V.current=null},N=ne=>{V.current&&Ce(ne.clientX,ne.clientY),document.removeEventListener("pointerup",N),document.removeEventListener("pointercancel",N),document.removeEventListener("pointermove",xe)},me=ne=>{if(V.current){if(ne.changedTouches.length>0){const _=ne.changedTouches[0];Ce(_.clientX,_.clientY)}document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),document.removeEventListener("touchmove",Me)}},D=ne=>{V.current={x:ne.clientX,y:ne.clientY},ie.current=!1,document.addEventListener("pointermove",xe,{passive:!1}),document.addEventListener("pointerup",N),document.addEventListener("pointercancel",N)},T=ne=>{ne.touches.length>0&&(V.current={x:ne.touches[0].clientX,y:ne.touches[0].clientY},ie.current=!1,document.addEventListener("touchmove",Me,{passive:!1}),document.addEventListener("touchend",me),document.addEventListener("touchcancel",me))};return G.addEventListener("pointerdown",D),G.addEventListener("touchstart",T),()=>{G.removeEventListener("pointerdown",D),G.removeEventListener("touchstart",T),document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",N),document.removeEventListener("pointercancel",N),document.removeEventListener("touchmove",Me),document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),V.current=null,ie.current=!1}},[e,de,R]);const he={backgroundColor:oe.color,backdropFilter:`blur(${oe.blur}px)`,animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:Yn.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:l?null:k,className:st(Ge.background,J?ce:pe,{[Ge.editor]:l},{[Ge.hidden]:!e}),style:{...he,...q&&!l&&!J?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?k:null,className:st(Ge.contentStyle,J?K:Pe,{[Ge.editor]:l},{[Ge.hidden]:!e}),style:{animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Za,{onMove:G=>E(G.index),ref:w,className:Ge.lightboxSplide,options:{arrows:!1,speed:I.duration?parseInt(I.duration):500,direction:I.direction==="horiz"||I.type==="fade"||I.type==="scale"?"ltr":"ttb",pagination:!1,drag:re.type==="drag"&&!de,perPage:1,width:"100%",height:"100%",type:I.type==="fade"||I.type==="scale"?"fade":"loop",padding:0,rewind:re.repeat!=="close",start:0},style:{"--splide-speed":I.duration},children:n.map((G,se)=>{const ge=Do(ye.position,ye.offset,l),xe=`${$.scalingValue(ye.padding.top,l)} ${$.scalingValue(ye.padding.right,l)} ${$.scalingValue(ye.padding.bottom,l)} ${$.scalingValue(ye.padding.left,l)}`,Me=I.type==="scale"?(()=>{const{transform:Ce,...N}=ge;return{...N,position:"absolute",padding:xe,boxSizing:"border-box","--position-transform":Ce||"none"}})():{...ge,position:"absolute",padding:xe,boxSizing:"border-box"};return r.jsx(Ja,{children:r.jsx("div",{className:Ge.imgWrapper,onClick:$e,children:r.jsx("img",{ref:se===b?P:null,className:st(Ge.imageStyle,{[Ge.contain]:G.image.objectFit==="contain",[Ge.cover]:G.image.objectFit==="cover",[Ge.scaleSlide]:I.type==="scale"}),src:G.image.url,alt:G.image.name??"",style:{...Me,pointerEvents:G.image.objectFit==="contain"?"none":"auto"}})})},se)})},R),F.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:st(Ge.arrow,{[Ge.arrowVertical]:I.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:r.jsxs("button",{className:Ge.arrowInner,style:{transform:`translate(${$.scalingValue(F.offset.x,l)}, ${$.scalingValue(F.offset.y*(I.direction==="horiz"?1:-1),l)}) scale(${F.scale}) rotate(${I.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var G;return(G=w.current)==null?void 0:G.go("-1")},"aria-label":"Previous",children:[F.arrowsImgUrl&&r.jsx(rn,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:st(Ge.arrowImg,Ge.mirror)}),!F.arrowsImgUrl&&r.jsx(Ms,{color:F.color,className:st(Ge.arrowIcon,Ge.arrowImg,Ge.mirror)})]})}),r.jsx("div",{className:st(Ge.arrow,Ge.nextArrow,{[Ge.arrowVertical]:I.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:r.jsxs("button",{className:Ge.arrowInner,style:{transform:`translate(${$.scalingValue(F.offset.x*(I.direction==="horiz"?-1:1),l)}, ${$.scalingValue(F.offset.y,l)}) scale(${F.scale}) rotate(${I.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var G;return(G=w.current)==null?void 0:G.go("+1")},"aria-label":"Next",children:[F.arrowsImgUrl&&r.jsx(rn,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:Ge.arrowImg}),!F.arrowsImgUrl&&r.jsx(Ms,{color:F.color,className:st(Ge.arrowIcon,Ge.arrowImg)})]})})]}),oe.closeIconUrl&&(()=>{const G=Do(oe.closeIconAlign,oe.closeIconOffset,l),se=`scale(${oe.closeIconScale})`,ge=G.transform?`${G.transform} ${se}`:se;return r.jsx("button",{className:Ge.closeButton,style:{...G,transform:ge},onClick:Z,"aria-label":"Close lightbox",children:r.jsx(rn,{url:oe.closeIconUrl,fill:oe.closeIconColor??"#000000",hoverFill:oe.closeIconHover??"#cccccc"})})})(),Q&&Q.isActive&&i.imageCaption&&((be=n[b])==null?void 0:be.imageCaption)&&r.jsx("div",{className:Ge.caption,style:{...Do(Q.alignment,Q.offset,l),fontFamily:Er(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":$.scalingValue(c.width,l),letterSpacing:$.scalingValue(p,l),wordSpacing:$.scalingValue(y,l),textAlign:v,fontSize:$.scalingValue(g.fontSize,l),lineHeight:$.scalingValue(g.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:m},onClick:G=>G.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Ge.captionTextInner,style:{"--link-color":Q.linkColor,"--link-hover-color":Q.linkHoverColor},children:r.jsx(yi,{content:n[b].imageCaption})})}),ue.isActive&&(()=>{const[G,se]=ue.position.split("-"),ge=I.direction==="horiz"?`${G}-left`:ue.position,xe=Do(ge,ue.offset,l),Me=()=>{if(I.direction==="horiz"){if(se==="left")return"flex-start";if(se==="center")return"center";if(se==="right")return"flex-end"}else{if(G==="top")return"flex-start";if(G==="middle")return"center";if(G==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:S,className:Ge.thumbsWrapper,onClick:Ce=>We(Ce),style:{position:l?"absolute":"fixed",...xe,...I.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:st(Ge.thumbsContainer,{[Ge.thumbsContainerVertical]:I.direction==="vert",[Ge.thumbsAlignStart]:ue.align==="start",[Ge.thumbsAlignCenter]:ue.align==="center",[Ge.thumbsAlignEnd]:ue.align==="end"}),style:{gap:$.scalingValue(ue.grid.gap,l),justifyContent:M?"flex-start":Me()},children:n.map((Ce,N)=>{const me=N===b,D=C[N],B=ue.grid.size*(me?ue.activeState.scale:1),Le=()=>{if(ue.fit!=="fit")return{};if(!D)return I.direction==="horiz"?{height:$.scalingValue(B,l)}:{width:$.scalingValue(B,l)};const ne=D.width/D.height;if(I.direction==="horiz"){const _=B,ke=_*ne;return{width:$.scalingValue(ke,l),height:$.scalingValue(_,l)}}else{const _=B,ke=_/ne;return{width:$.scalingValue(_,l),height:$.scalingValue(ke,l)}}};return r.jsx("button",{className:Ge.thumbItem,style:{...I.direction==="horiz"&&ue.fit!=="fit"?{height:$.scalingValue(B,l)}:{},...I.direction==="vert"&&ue.fit!=="fit"?{width:$.scalingValue(B,l)}:{},...ue.fit==="cover"?{width:$.scalingValue(B,l),height:$.scalingValue(B,l)}:{},...Le(),transition:me?"all 0.25s ease-out":"none",opacity:me?ue.activeState.opacity/100:ue.opacity/100,"--thumb-hover":ue.activeState.opacity/100},onClick:ne=>{var _;ne.stopPropagation(),E(N),(_=w.current)==null||_.go(N)},onMouseEnter:()=>{var ne;ue.triggers==="hov"&&((ne=w.current)==null||ne.go(N))},children:r.jsx("img",{src:Ce.image.url,alt:Ce.image.name??"",onLoad:ne=>{const _=ne.currentTarget;_.naturalWidth&&_.naturalHeight&&O(ke=>({...ke,[N]:{width:_.naturalWidth,height:_.naturalHeight}}))},style:{objectFit:ue.fit==="cover"?"cover":"contain",...ue.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ue.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Ce.image.name}-${N}`)})})})})()]})]}),document.getElementById(s))};function Ms({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const im={element:tm,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 jo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function om(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 rm({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:s}){const l=!!n,d=i&&t||!t,{prefix:c}=$.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:
|
|
158
|
+
`}function rm({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:s}){const l=!!n,d=i&&t||!t,{prefix:c}=$.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:v=[],buttonLabel:y,gap:g,fieldsGap:h,buttonCorners:m,buttonStroke:b,buttonPadding:E,isButtonFullWidth:R,inputCorners:L,inputStroke:J,inputPadding:W,inputColor:q,inputTextColor:A,inputBorderColor:C,placeholderColor:O,buttonColor:w,buttonTextColor:H,buttonBorderColor:P,labelTextColor:X,successColor:k,errorColor:Y,fontFamily:U,inputFontSettings:V,inputFontSize:ie,inputLineHeight:S,inputLetterSpacing:M,inputWordSpacing:z,inputTextAppearance:ae,buttonFontSettings:re,buttonFontSize:I,buttonLineHeight:ue,buttonLetterSpacing:F,buttonWordSpacing:oe,buttonTextAppearance:Q,labelFontSettings:ye,labelFontSize:Pe,labelLineHeight:pe,labelLetterSpacing:ce,labelWordSpacing:K,labelTextAppearance:te,statusFontSettings:Z,statusFontSize:Fe,statusLineHeight:$e,statusLetterSpacing:We,statusWordSpacing:de,statusTextAppearance:he,successMessage:be,errorMessage:G,stateOverrides:se}=e,ge=u==="B",xe=v.slice(0,Math.min(p,v.length)),Me={fontSettings:{fontFamily:U,fontWeight:(V==null?void 0:V.fontWeight)??400,fontStyle:(V==null?void 0:V.fontStyle)??"normal"},fontSize:ie??.01,lineHeight:S,letterSpacing:M??0,wordSpacing:z??0,textAppearance:ae,color:A},Ce=on(Ut(Me,t)),N=$.scalingValue(J??0,t),me=$.scalingValue((S??ie??.01)+((W==null?void 0:W.top)??0)+((W==null?void 0:W.bottom)??0)+(u==="C"?J??0:(J??0)*2),t),D={...Ce,borderStyle:"solid",borderRadius:u==="C"?0:$.scalingValue(L??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:N,borderLeftWidth:0}:{borderWidth:N},paddingTop:$.scalingValue((W==null?void 0:W.top)??0,t),paddingRight:$.scalingValue((W==null?void 0:W.right)??0,t),paddingBottom:$.scalingValue((W==null?void 0:W.bottom)??0,t),paddingLeft:$.scalingValue((W==null?void 0:W.left)??0,t),height:me,minHeight:me},T={fontSettings:{fontFamily:U,fontWeight:(re==null?void 0:re.fontWeight)??400,fontStyle:(re==null?void 0:re.fontStyle)??"normal"},fontSize:I??.01,lineHeight:ue,letterSpacing:F??0,wordSpacing:oe??0,textAppearance:Q,color:H},B=on(Ut(T,t)),Le=$.scalingValue(b??0,t),ne={fontSettings:{fontFamily:U,fontWeight:(ye==null?void 0:ye.fontWeight)??400,fontStyle:(ye==null?void 0:ye.fontStyle)??"normal"},fontSize:Pe??.01,lineHeight:pe,letterSpacing:ce??0,wordSpacing:K??0,textAppearance:te,color:X},_=Ut(ne,t),ke={fontSettings:{fontFamily:U,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:Fe??.01,lineHeight:$e,letterSpacing:We??0,wordSpacing:de??0,textAppearance:he,color:k},Ie=on(Ut(ke,t)),Ze=$.buildColorVars(c,{inputColor:q,inputTextColor:A,inputBorderColor:C,placeholderColor:O!=null&&O.trim()?O:"#cccccc",buttonColor:w,buttonTextColor:H,buttonBorderColor:P,labelTextColor:X,successColor:k,errorColor:Y},am,sm,se),[Ke,at]=a.useState(()=>Object.fromEntries(xe.map(_e=>[_e.name,""]))),[tt,Ve]=a.useState("idle"),[fe,Ee]=a.useState(null),De=s==="success"?"success":s==="error"?"error":tt,qe=s==="error"?G:fe,we=s==="filled",Oe=a.useMemo(()=>{if(!we)return Ke;let _e=null;for(const Xe of xe)(Ke[Xe.name]??"").trim().length>0||(_e=_e??{...Ke},_e[Xe.name]="Filled");return _e??Ke},[Ke,we,xe]),ze=De==="error"?$.getFormFieldValidationError(xe,Oe):null,ot=`${s&&s!=="default"?`${c}-state-${s}`:""}`.trim(),Je=o==null?void 0:o.submitUrl,bt=(_e,Xe)=>{at(Be=>({...Be,[_e]:Xe}))},lt=async _e=>{if(_e.preventDefault(),!d)return;const Xe=Object.fromEntries(xe.map(pt=>{var mt;return[pt.name,((mt=Ke[pt.name])==null?void 0:mt.trim())??""]}).filter(([,pt])=>pt));if(!Je){Ve("error"),Ee("No integrations were found for this form.");return}if(Object.keys(Xe).length===0)return;const Be=$.getFormFieldValidationError(xe,Ke);if(Be){Ve("error"),Ee(Be);return}Ve("submitting"),Ee(null);try{const pt=await fetch(Je,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Xe)});if(!pt.ok){const mt=await pt.text();throw new Error(mt||`Request failed: ${pt.status}`)}Ve("success"),at(Object.fromEntries(xe.map(mt=>[mt.name,""])))}catch(pt){Ve("error"),Ee(pt instanceof Error?pt.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${ot}`.trim(),style:Ze,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:om(c)}}),r.jsxs("form",{onSubmit:lt,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:xe.map((_e,Xe)=>r.jsxs(a.Fragment,{children:[Xe>0&&r.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:$.scalingValue(h??0,t)}}),r.jsxs("div",{className:`${c}-field-group${ge?` ${c}-labeled`:""}`,children:[ge&&r.jsx("span",{className:`${c}-field-label`,style:_?{..._,lineHeight:_.fontSize}:void 0,children:_e.label||_e.name}),_e.type==="textarea"?r.jsx("textarea",{name:_e.name,autoComplete:"off",value:Oe[_e.name]??"",onChange:Be=>bt(_e.name,Be.target.value),placeholder:_e.placeholder,className:`${c}-input`,style:D,rows:1,"data-filled":we||(Oe[_e.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:_e.type==="phone"?"tel":_e.type==="email"?"email":"text",name:_e.name,autoComplete:"off",value:Oe[_e.name]??"",onChange:Be=>bt(_e.name,Be.target.value),placeholder:_e.placeholder,required:_e.isRequired??_e.type==="email",className:`${c}-input`,style:D,"data-filled":we||(Oe[_e.name]??"").trim().length>0})]})]},Xe))}),r.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:$.scalingValue(g??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:$.scalingValue(m??0,t),borderWidth:Le,paddingTop:$.scalingValue((E==null?void 0:E.top)??0,t),paddingRight:$.scalingValue((E==null?void 0:E.right)??0,t),paddingBottom:$.scalingValue((E==null?void 0:E.bottom)??0,t),paddingLeft:$.scalingValue((E==null?void 0:E.left)??0,t),pointerEvents:d?"auto":void 0,...B,...R?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:R?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:tt==="submitting"?"...":y})})})]}),De==="success"&&r.jsx("p",{className:`${c}-success`,style:{...Ie},children:be}),De==="error"&&r.jsx("p",{className:`${c}-error`,style:{...Ie},role:"alert",children:ze??qe??G})]})}const am={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"},sm=["hover","focus","filled","success","error"],lm=`import React, { useMemo, useState } from 'react';
|
|
159
159
|
import { CommonComponentProps } from '../props';
|
|
160
160
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
161
161
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -980,7 +980,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
980
980
|
font-size: ${Bo(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const gm=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:s}=$.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:
|
|
983
|
+
`}const gm=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:s}=$.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:v,inputFontSettings:y,inputFontSize:g,inputLineHeight:h,inputLetterSpacing:m,inputWordSpacing:b,inputTextAppearance:E,buttonFontSettings:R,buttonFontSize:L,buttonLineHeight:J,buttonLetterSpacing:W,buttonWordSpacing:q,buttonTextAppearance:A,statusFontSettings:C,statusFontSize:O,statusLineHeight:w,statusLetterSpacing:H,statusWordSpacing:P,statusTextAppearance:X,iconMaxWidth:k,minHeight:Y,corners:U,stroke:V,stateOverrides:ie,inputPadding:S,buttonPadding:M,successMessage:z="Thanks for subscribing!",errorMessage:ae="Please, fill all required fields."}=e,re=d.slice(0,Math.min(p,d.length)),[I,ue]=a.useState(()=>Object.fromEntries(re.map(ne=>[ne.name,""]))),[F,oe]=a.useState("idle"),[Q,ye]=a.useState(null),Pe=o==="success"?"success":o==="error"?"error":F,pe=o==="error"?ae:Q,ce=o==="filled",K=a.useMemo(()=>{if(!ce)return I;let ne=null;for(const _ of re)(I[_.name]??"").trim().length>0||(ne=ne??{...I},ne[_.name]="Filled");return ne??I},[ce,I,re]),te=Pe==="error"?$.getFormFieldValidationError(re,K):null,Z=o&&o!=="default"?`${s}-state-${o}`:"",Fe=re.some(ne=>(K[ne.name]??"").trim().length>0),$e=Z!==`${s}-state-filled`&&Fe?`${s}-state-filled`:"",We=`${Z} ${$e}`.trim(),de=i==null?void 0:i.submitUrl,he=u??"",be=(c==null?void 0:c.icon)??"",G=(c==null?void 0:c.mode)==="On",se=he||"Submit",ge={fontSettings:{fontFamily:v,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:g??.01,lineHeight:h,letterSpacing:m??0,wordSpacing:b??0,textAppearance:E,color:e.inputTextColor??"#111111"},xe={fontSettings:{fontFamily:v,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:L??.01,lineHeight:J,letterSpacing:W??0,wordSpacing:q??0,textAppearance:A,color:e.buttonTextColor??"#ffffff"},Me={fontSettings:{fontFamily:v,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:O??.01,lineHeight:w,letterSpacing:H??0,wordSpacing:P??0,textAppearance:X,color:e.successColor??"#22c55e"},Ce=on(Ut(ge,t)),N=on(Ut(xe,t)),me=on(Ut(Me,t)),D=$.buildColorVars(s,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(ge==null?void 0:ge.color)??"#111111",buttonTextColor:e.buttonTextColor??(xe==null?void 0:xe.color)??"#ffffff"},hm,fm,ie),T={borderRadius:$.scalingValue(U,t),borderWidth:$.scalingValue(V,t),borderStyle:"solid"},B={borderLeftWidth:$.scalingValue(V,t)},Le=async ne=>{if(ne.preventDefault(),!l)return;const _=Object.fromEntries(re.map(Ie=>{var Ze;return[Ie.name,((Ze=I[Ie.name])==null?void 0:Ze.trim())??""]}).filter(([,Ie])=>Ie));if(!de){oe("error"),ye("No integrations were found for this form.");return}if(Object.keys(_).length===0)return;const ke=$.getFormFieldValidationError(re,I);if(ke){oe("error"),ye(ke);return}oe("submitting"),ye(null);try{const Ie=await fetch(de,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)});if(!Ie.ok){const Ze=await Ie.text();throw new Error(Ze||`Request failed: ${Ie.status}`)}oe("success"),ue(Object.fromEntries(re.map(Ze=>[Ze.name,""])))}catch(Ie){oe("error"),ye(Ie instanceof Error?Ie.message:"Something went wrong")}};return r.jsxs("div",{className:`${s}-wrapper ${We}`.trim(),style:D,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:mm(s)}}),r.jsxs("form",{onSubmit:Le,className:`${s}-form`,style:{...T,height:$.scalingValue(Y,t),minHeight:$.scalingValue(Y,t)},children:[r.jsx("div",{className:`${s}-inputWrap ${s}-overlayAnchor`,style:{flex:1,minWidth:0},children:re.map(ne=>r.jsx("input",{type:ne.type==="email"?"email":ne.type==="phone"?"tel":"text",name:ne.name,autoComplete:"off",value:K[ne.name]??"",onChange:_=>ue(ke=>({...ke,[ne.name]:_.target.value})),placeholder:ne.placeholder,required:ne.isRequired??ne.type==="email",className:`${s}-input`,style:{...Ce,paddingRight:$.scalingValue(S.right,t),paddingLeft:$.scalingValue(S.left,t),paddingTop:$.scalingValue(S.top,t),paddingBottom:$.scalingValue(S.bottom,t)}},ne.name))}),r.jsx("div",{className:`${s}-overlayAnchor`,children:r.jsx("button",{type:l?"submit":"button",className:`${s}-submitBtn`,"aria-label":se,style:{...N,...B,paddingRight:$.scalingValue(M.right,t),paddingLeft:$.scalingValue(M.left,t),paddingTop:$.scalingValue(M.top,t),paddingBottom:$.scalingValue(M.bottom,t),pointerEvents:l?"auto":void 0},children:F==="submitting"?"...":G?be&&r.jsx(rn,{url:be,className:`${s}-submitBtnIcon`,style:{maxWidth:$.scalingValue(k??0,t)},fill:`var(--${s}-button-text-color)`,hoverFill:`var(--${s}-button-text-color)`}):he})})]}),Pe==="success"&&r.jsx("p",{className:`${s}-success`,style:{...me},children:z}),Pe==="error"&&r.jsx("p",{className:`${s}-error`,style:{...me},role:"alert",children:te??pe??ae})]})},hm={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"},fm=["hover","focus","filled","success","error"],ym=`import React, { useMemo, useState } from 'react';
|
|
984
984
|
import { CommonComponentProps } from '../props';
|
|
985
985
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
986
986
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1689
1689
|
.${e}-image-hover-grayscale:hover video {
|
|
1690
1690
|
filter: grayscale(100%);
|
|
1691
1691
|
}
|
|
1692
|
-
`}const Cm=30,Tm=20,Gr=3,Lm=12,Rm=32,Im=3,Em=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")},Mm=(e,t)=>Array.from({length:t},()=>e).flat(),Pm=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},vc=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Ps=(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),s=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=vc(d);return c<=0?0:c+s*Math.max(0,t-1)},km=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=vc(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),s=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+s*Math.max(0,e.children.length-1)+l},Am=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Fm=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Am(i,e))},Wm=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??"")},_m=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,
|
|
1692
|
+
`}const Cm=30,Tm=20,Gr=3,Lm=12,Rm=32,Im=3,Em=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")},Mm=(e,t)=>Array.from({length:t},()=>e).flat(),Pm=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},vc=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Ps=(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),s=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=vc(d);return c<=0?0:c+s*Math.max(0,t-1)},km=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=vc(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),s=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+s*Math.max(0,e.children.length-1)+l},Am=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Fm=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Am(i,e))},Wm=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??"")},_m=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Hm=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:s,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var P,X,k,Y;const p=a.useRef(null),v=!!((P=e.image)!=null&&P.url&&Wm(e.image));a.useLayoutEffect(()=>{d&&_m(p.current)&&(u==null||u())},[d,(X=e.image)==null?void 0:X.url,u]);const y=n.display==="cover",g=n.ratioValue??"1:1",h=n.reversed??!1,[m,b]=g.split(":").map(Number),L=(h?b:m)/(h?m:b),J=i/L,W=J>o?o:J,q=J>o?o*L:i,A=c(q),C=c(W),O={borderRadius:c(s)},w=y?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...O}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...O},H=((k=e.image)==null?void 0:k.url)&&(v?r.jsx("video",{ref:U=>{p.current=U},src:e.image.url,style:w,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):r.jsx("img",{ref:U=>{p.current=U},src:e.image.url,alt:((Y=e.image)==null?void 0:Y.name)??"",style:w,onLoad:d?u:void 0,onError:d?u:void 0}));return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...y?{width:A}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:r.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...y?{width:A,height:C,overflow:"hidden",...O}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:H&&e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:st(`${t}-marquee-link`,!y&&`${t}-marquee-link-contain`),children:H}):H})})},Nm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=$.useScopedStyles(),[l,d]=a.useState(0),c=l>0?Math.round(l):0,u=a.useMemo(()=>$m(s,c),[s,c]),{speed:p,direction:v,pauseOnHover:y,gap:g,imageMaxWidth:h,imageMaxHeight:m,hoverEffect:b,cornerRadius:E=0}=e,R=a.useMemo(()=>Pm(e.imageFit),[e.imageFit]),L=(t==null?void 0:t.length)??0,J=!!o,W=!n||!!i,q=W&&b!=="off"&&b!=="randomize"?`${s}-image-hover-${b}`:void 0,A=n?!!i:!0,O=((t==null?void 0:t.length)??0)>0&&(A||!!n),w=Math.max(0,p)*Cm,H=$e=>$.scalingValue($e,n??!1),P=a.useRef(null),X=a.useRef(null),k=a.useRef(null),[Y,U]=a.useState(0),V=A&&y==="on",[ie,S]=a.useState(!1),[M,z]=a.useState({}),ae=a.useRef(M);ae.current=M;const re=a.useRef(null),I=a.useRef(0),ue=a.useRef(null),F=a.useMemo(()=>(t??[]).map($e=>{var We;return((We=$e.image)==null?void 0:We.url)??""}).join("\0"),[t]),[oe,Q]=a.useState(Gr),ye=a.useMemo(()=>{const $e=t??[];return $e.length===0||!(A||!!n)?$e:Mm($e,oe)},[t,A,oe,n]),Pe=a.useMemo(()=>(t??[]).filter($e=>{var We;return!!((We=$e.image)!=null&&We.url)}).length,[t]),pe=O?Im:1;a.useLayoutEffect(()=>{I.current=0,z({}),re.current=null,Q(Gr),d(0)},[F]),a.useEffect(()=>{if(!W||b!=="randomize")return;const $e=P.current;if(!$e)return;const We=G=>{z(se=>{const ge=Array.from(G).filter(Me=>Me in se&&!Fm($e,Me));if(ge.length===0)return se;const xe={...se};return ge.forEach(Me=>{delete xe[Me]}),xe})},de=new IntersectionObserver(G=>{const se=new Set;for(const ge of G){const xe=ge.target.dataset.marqueeItemIndex,Me=xe!==void 0?Number(xe):NaN;Number.isNaN(Me)||se.add(Me)}se.size>0&&We(se)},{root:$e,threshold:0});Object.keys(M).forEach(G=>{const se=Number(G);$e.querySelectorAll(`[data-marquee-item-index="${se}"]`).forEach(ge=>de.observe(ge))});const he={current:0},be=()=>{const G=Object.keys(ae.current);G.length!==0&&(We(G.map(Number)),he.current=requestAnimationFrame(be))};return Object.keys(ae.current).length>0&&(he.current=requestAnimationFrame(be)),()=>{cancelAnimationFrame(he.current),de.disconnect()}},[b,M,W]),a.useLayoutEffect(()=>{if(!O)return;const $e=P.current,We=k.current;if(!$e||!We)return;const de={current:0},he=()=>{const se=$e.getBoundingClientRect().width||$e.offsetWidth,ge=km(We),xe=re.current,Me=typeof xe=="number"&&Math.abs(xe-ge)<=.25;re.current=ge;let Ce=oe,N=0;if((A||n)&&L>0&&se>0){const T=Ps(We,L);if(T>=Rm){N=T;const B=Math.min(Lm,Math.max(Gr,Math.ceil(se/T)+1));Ce=B,B!==oe&&Q(B)}}const D=Ce!==oe&&N>0?N*Ce:ge>0?ge:N>0?N*Ce:(()=>{const T=Ps(We,L);return T>0?T*Ce:0})();D>0?d(T=>T<=0?D:!Me||Math.round(T)===Math.round(D)?T:D):!Me&&l<=0&&(cancelAnimationFrame(de.current),de.current=requestAnimationFrame(he))},be=()=>{cancelAnimationFrame(de.current),de.current=requestAnimationFrame(he)};ue.current=be,be();const G=new ResizeObserver(be);return G.observe($e),G.observe(We),()=>{ue.current=null,cancelAnimationFrame(de.current),G.disconnect()}},[A,O,l,F,oe,L,n]),a.useLayoutEffect(()=>{if(!O||c<=0)return;const $e=X.current;$e&&Em($e)},[O,c,v,w]),a.useLayoutEffect(()=>{if(!O||l<=0){U(0);return}const $e=X.current,We=k.current;if(!$e||!We)return;const de=()=>{const be=$e.offsetHeight||$e.getBoundingClientRect().height,G=Array.from(We.children).reduce((ge,xe)=>Math.max(ge,xe.offsetHeight||xe.getBoundingClientRect().height),0),se=be>0?be:G;U(se>0?se:0)};de();const he=new ResizeObserver(de);return he.observe($e),he.observe(We),()=>he.disconnect()},[O,pe,ye,n,g,h,m,l,R,M]),a.useLayoutEffect(()=>{if(!n||!J||!O||typeof window>"u")return;const $e=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame($e)},[n,J,O,v,l,Y,g,ye]);const ce=()=>{V&&S(!0)},K=()=>{V&&S(!1)},te=a.useCallback(()=>{var $e;I.current=Math.min(Pe,I.current+1),($e=ue.current)==null||$e.call(ue)},[Pe]),Z=a.useCallback(($e,We)=>{z(de=>{const he=de[$e]??We,be=(t??[]).filter(se=>se!==he);if(be.length===0)return de;const G=be[Math.floor(Math.random()*be.length)];return{...de,[$e]:G}})},[t]),Fe=($e,We,de,he)=>{const be=W&&b==="randomize"&&R.display==="cover"?M[de]??$e:$e,G=`max(${H(g)}, ${Tm}px)`,se=`calc(-0.5 * (${G} + ${H(g)}))`;return r.jsxs("div",{className:`${s}-marquee-card`,"data-marquee-item-index":de,onMouseEnter:W&&b==="randomize"&&R.display==="cover"?()=>Z(de,$e):void 0,children:[r.jsx(Hm,{item:be,prefix:s,imageFit:R,imageMaxWidth:h,imageMaxHeight:m,cornerRadius:E,imageHoverClass:q,isEditor:n,isFirstSet:he,scaled:H,onFirstSetImageDone:te}),J&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${s}-gap-control`,style:{position:"absolute",top:0,right:se,width:G,height:"100%"}})]},`${We}-${de}`)};if(O){const $e=A?V&&ie?"paused":"running":"paused",We=c>0&&w>0?c/w*1e3:0,de=`${Math.max(0,We)/1e3}s`;return r.jsxs("div",{ref:P,className:st(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Marquee",style:Y>0?{height:Y}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{ref:X,className:`${s}-marquee-track`,"data-direction":v,onMouseEnter:ce,onMouseLeave:K,style:{WebkitAnimationDuration:de,animationDuration:de,WebkitAnimationPlayState:$e,animationPlayState:$e},children:Array.from({length:pe},(he,be)=>r.jsx("div",{ref:be===0?k:void 0,className:st(`${s}-marquee-row`,`${s}-marquee-set`),style:{gap:H(g),paddingRight:H(g)},"aria-hidden":be>0,children:ye.map((G,se)=>Fe(G,be,se,be===0&&se<L))},`set-${be}`))})]})}return r.jsxs("div",{ref:P,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{className:st(`${s}-marquee-row`,`${s}-marquee-static`),style:{gap:H(g),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map(($e,We)=>Fe($e,0,We))},"marquee-static")]})},Om=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
1693
1693
|
import cn from 'classnames';
|
|
1694
1694
|
import { CommonComponentProps } from '../props';
|
|
1695
1695
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2472,7 +2472,7 @@ type MarqueeProps = {
|
|
|
2472
2472
|
isPreviewMode?: boolean;
|
|
2473
2473
|
isEditMode?: boolean;
|
|
2474
2474
|
} & CommonComponentProps;
|
|
2475
|
-
`,Dm={type:"object",version:1,settings:{sizing:"auto manual",properties:{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"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,display:{type:"numeric-input"}},imageFit:{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",min:0,display:{type:"numeric-input"}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.8,cornerRadius:0},t:{speed:1.64,gap:.02,imageMaxWidth:.5208,imageMaxHeight:.5208,cornerRadius:0},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278,cornerRadius:0}},displayRules:[{if:{name:"imageFit.display",value:"cover"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","randomize"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit","cornerRadius"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["cornerRadius"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},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"]}}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""},link:""}]}},jm={element:
|
|
2475
|
+
`,Dm={type:"object",version:1,settings:{sizing:"auto manual",properties:{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"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,display:{type:"numeric-input"}},imageFit:{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",min:0,display:{type:"numeric-input"}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.8,cornerRadius:0},t:{speed:1.64,gap:.02,imageMaxWidth:.5208,imageMaxHeight:.5208,cornerRadius:0},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278,cornerRadius:0}},displayRules:[{if:{name:"imageFit.display",value:"cover"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","randomize"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit","cornerRadius"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["cornerRadius"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},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"]}}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""},link:""}]}},jm={element:Nm,id:"marquee",name:"Simple Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple-Marquee.mp4"},schema:Dm,sourceCode:Om,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function zm(e,t,n){const i=t>0?`${t}px`:"0px",o=n?`
|
|
2476
2476
|
.${e}-item-image-wrap {
|
|
2477
2477
|
display: flex;
|
|
2478
2478
|
flex: 0 0 auto;
|
|
@@ -2593,7 +2593,7 @@ ${o}
|
|
|
2593
2593
|
left: -9999px;
|
|
2594
2594
|
top: 0;
|
|
2595
2595
|
}
|
|
2596
|
-
`}const Bm=30,qr=3,Vm=12,Gm=3,Ca=.72,qm=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")},
|
|
2596
|
+
`}const Bm=30,qr=3,Vm=12,Gm=3,Ca=.72,qm=100,Um=10,Km=e=>Math.max(0,e)/qm,Xm=e=>Math.max(0,e)/Um,Ym=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")},Zm=(e,t)=>{const n=[];for(let i=0;i<t;i++)n.push(...e);return n};let Si;const Jm=()=>Si!==void 0?Si:typeof document>"u"?(Si=null,Si):(Si=document.createElement("canvas").getContext("2d"),Si),Qm=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},ks=e=>{e.style.transform=""},eg=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},tg=(e,t)=>{let n=e.offsetWidth/2,i=e;for(;i&&i!==t;){n+=i.offsetLeft,n+=eg(getComputedStyle(i).transform);const o=i.offsetParent;if(!o||o===i)break;i=o}return n},ng=96,ig=(e,t,n)=>{if(t<=0||e<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),s=new Float64Array(n+1),l=e*t,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;for(let u=0;u<n;u+=1){const p=u*c,v=p+c;o[u+1]=v,s[u+1]=s[u]+(d(p)+d(v))*.5*c}return{wavelength:i,periodArc:s[n],x:o,s}},og=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),s=i-o*e.periodArc,{s:l,x:d}=e;let c=0,u=l.length-1;for(;u-c>1;){const y=c+u>>1;l[y]<=s?c=y:u=y}const p=l[u]-l[c],v=p>0?(s-l[c])/p:0;return n*(o*e.wavelength+d[c]+(d[u]-d[c])*v)},rg=(e,t,n,i)=>{const o=Math.max(0,n),s=e>0?2*Math.PI*o/e:0,l=p=>i+t*Math.sin(s*p),d=p=>t*s*Math.cos(s*p),c=Math.max(4,Math.ceil(o*4)),u=[`M0 ${l(0).toFixed(2)}`];for(let p=0;p<c;p++){const v=p/c*e,y=(p+1)/c*e,g=y-v,h=l(v),m=l(y),b=v+g/3,E=h+d(v)*g/3,R=y-g/3,L=m-d(y)*g/3;u.push(`C${b.toFixed(2)} ${E.toFixed(2)} ${R.toFixed(2)} ${L.toFixed(2)} ${y.toFixed(2)} ${m.toFixed(2)}`)}return u.join(" ")},ag=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:s,isCurve:l})=>{var g;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${Ca}em`},u=((g=e.image)==null?void 0:g.url)&&r.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?r.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),v=l?r.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((h,m)=>r.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:r.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},m))}):r.jsx("span",{className:`${t}-text`,style:d,children:e.text}),y=r.jsxs(r.Fragment,{children:[p,v]});return r.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:s},children:e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:`${t}-item-link`,style:{gap:s},children:y}):y})},sg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=$.useScopedStyles(),[l,d]=a.useState(0),c=l>0?Math.round(l):0,{speed:u,direction:p,pauseOnHover:v,gap:y,layoutType:g,curveAmplitude:h,curveFrequency:m,textFontFamily:b,textFontSettings:E,textFontSize:R,textLineHeight:L,textLetterSpacing:J,textWordSpacing:W,textTextAppearance:q,textColor:A,backgroundColor:C}=e,O=g==="curve",w=Km(h),H=Xm(m),P=a.useMemo(()=>zm(s,c,O),[s,c,O]),X=a.useMemo(()=>Ut({fontSettings:{fontFamily:b,fontWeight:E.fontWeight,fontStyle:E.fontStyle},letterSpacing:J,wordSpacing:W,fontSize:R,lineHeight:L,textAppearance:q,color:A},n),[b,E,J,W,R,L,q,A,n]),k=D=>$.scalingValue(D,n??!1),Y=(t==null?void 0:t.length)??0,U=Y>0,V=n?!!i:!0,ie=U&&(V||!!n),S=Math.max(0,u)*Bm,M=V&&v==="on",[z,ae]=a.useState(!1),re=a.useRef(null),I=a.useRef(null),ue=a.useRef(null),F=a.useRef(null),[oe,Q]=a.useState(0),[ye,Pe]=a.useState(0),[pe,ce]=a.useState(0),[K,te]=a.useState(0),Z=a.useMemo(()=>(t??[]).map(D=>{var T;return`${D.text}${((T=D.image)==null?void 0:T.url)??""}`}).join("\0"),[t]),[Fe,$e]=a.useState(qr),We=a.useMemo(()=>{const D=t??[];return D.length===0||!(V||n)?D:Zm(D,Fe)},[t,V,Fe,n]),de=ie?Gm:1;a.useLayoutEffect(()=>{$e(qr),d(0)},[Z]),a.useLayoutEffect(()=>{var ne;const D=F.current;if(!D)return;const T=()=>{const _=getComputedStyle(D),ke=parseFloat(_.fontSize)||0;if(ke<=0)return;const Ie=Jm();if(!Ie){Q(ke*Ca),Pe(0);return}Ie.font=`${_.fontStyle} ${_.fontWeight} ${ke}px ${_.fontFamily}`;const Ze=Ie.measureText("H"),Ke=Ze.actualBoundingBoxAscent>0?Ze.actualBoundingBoxAscent:ke*Ca,at=Math.max(0,Ze.actualBoundingBoxDescent||0),tt=Ze.fontBoundingBoxAscent||0,Ve=Ze.fontBoundingBoxDescent||0;Q(Ee=>Math.abs(Ee-Ke)>.5?Ke:Ee);const fe=tt>0||Ve>0?(Ve-at-(tt-Ke))/2:0;Pe(Ee=>Math.abs(Ee-fe)>.25?fe:Ee)};T();const B=typeof document<"u"?document.fonts:void 0;(ne=B==null?void 0:B.ready)==null||ne.then(T).catch(()=>{});const Le=new ResizeObserver(T);return Le.observe(D),()=>Le.disconnect()},[X.fontFamily,X.fontWeight,X.fontStyle,X.fontSize,X.lineHeight]),a.useLayoutEffect(()=>{if(!ie)return;const D=re.current,T=ue.current;if(!D||!T)return;let B=0;const Le=()=>{const _=D.getBoundingClientRect().width||D.offsetWidth,ke=T.getBoundingClientRect().width||T.offsetWidth;if(Y>0&&_>0&&ke>0){const Ie=ke/Fe;if(Ie>0){const Ze=Math.min(Vm,Math.max(qr,Math.ceil(_/Ie)+1));if(Ze!==Fe){$e(Ze);return}}}ke>0&&d(ke)};B=requestAnimationFrame(Le);const ne=new ResizeObserver(()=>{cancelAnimationFrame(B),B=requestAnimationFrame(Le)});return ne.observe(D),ne.observe(T),()=>{cancelAnimationFrame(B),ne.disconnect()}},[ie,Z,Fe,Y,oe]),a.useLayoutEffect(()=>{if(!O){ce(0),te(0);return}const D=re.current,T=ue.current;if(!D||!T)return;let B=0;const Le=()=>{const _=D.offsetWidth,ke=T.offsetHeight;_>0&&te(Ie=>Math.abs(Ie-_)>.5?_:Ie),ke>0&&ce(Ie=>Math.abs(Ie-ke)>.5?ke:Ie)};B=requestAnimationFrame(Le);const ne=new ResizeObserver(()=>{cancelAnimationFrame(B),B=requestAnimationFrame(Le)});return ne.observe(D),ne.observe(T),()=>{cancelAnimationFrame(B),ne.disconnect()}},[O,Z,oe,L,R,ie]),a.useLayoutEffect(()=>{if(!ie||c<=0)return;const D=I.current;D&&Ym(D)},[ie,c,p,S]),a.useLayoutEffect(()=>{if(!O||!U)return;const D=re.current;if(!D)return;let T=0,B=!1,Le=null,ne="";const _=()=>{if(B)return;const ke=D.querySelector(`.${s}-marquee-wrapper`)??D,Ie=ke.offsetWidth||1,Ze=Ie*w,Ke=2*Math.PI*H/Ie,at=`${Ie}|${Ze}|${Ke}`;at!==ne&&(ne=at,Le=ig(Ze,Ke,ng));const tt=D.getBoundingClientRect(),Ve=tt.left,fe=tt.right,Ee=Le&&Le.wavelength>0?Math.max(0,(Le.periodArc/Le.wavelength-1)*Ie):0;D.querySelectorAll("[data-marquee-text-item]").forEach(qe=>{const we=qe.getBoundingClientRect();if(we.right<Ve||we.left>fe+Ee)return;qe.querySelectorAll("[data-marquee-wave-node]").forEach(ze=>{const Ye=ze.firstElementChild;if(!Ye)return;const ot=tg(ze,ke),Je=Le?og(Le,ot):ot,bt=Ke*Je,lt=Ze*Math.sin(bt),_e=Ze*Ke*Math.cos(bt),Xe=Math.atan(_e)*(180/Math.PI);Qm(Ye,Je-ot,lt,Xe)})}),T=requestAnimationFrame(_)};return T=requestAnimationFrame(_),()=>{B=!0,cancelAnimationFrame(T),D.querySelectorAll("[data-marquee-wave-node]").forEach(ke=>{const Ie=ke.firstElementChild;Ie&&ks(Ie)}),D.querySelectorAll("[data-marquee-text-item]").forEach(ks)}},[O,w,H,U,l,Z,s]);const he=()=>{M&&ae(!0)},be=()=>{M&&ae(!1)},G=O?w*100:0,se={...O?{paddingTop:`${G}%`,paddingBottom:`${G}%`}:{},...O?{}:{backgroundColor:C}},ge=K*w,xe=O&&K>0&&pe>0?rg(K,ge,H,ge+pe/2):"",Me=ge*2+pe,Ce=xe?r.jsx("svg",{className:`${s}-curve-bg`,viewBox:`0 0 ${K} ${Me}`,preserveAspectRatio:"none","aria-hidden":!0,children:r.jsx("path",{d:xe,fill:"none",stroke:C,strokeWidth:pe,strokeLinecap:"round",strokeLinejoin:"round"})}):null,N=(D,T,B)=>r.jsx(ag,{item:D,prefix:s,textCss:X,capHeightPx:oe,opticalOffsetY:ye,imageGapPx:k(y),isCurve:O},`${T}-${B}`),me=r.jsx("span",{ref:F,"aria-hidden":!0,className:`${s}-cap-ref`,style:X,children:"H"});if(ie){const D=V?M&&z?"paused":"running":"paused",T=c>0&&S>0?c/S*1e3:0,B=`${Math.max(0,T)/1e3}s`;return r.jsxs("div",{ref:re,className:`${s}-wrapper`,"aria-label":"Marquee text",children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:P}}),me,r.jsxs("div",{className:`${s}-marquee-wrapper`,style:se,children:[Ce,r.jsx("div",{ref:I,className:`${s}-marquee-track`,"data-direction":p,onMouseEnter:he,onMouseLeave:be,style:{WebkitAnimationDuration:B,animationDuration:B,WebkitAnimationPlayState:D,animationPlayState:D},children:Array.from({length:de},(Le,ne)=>r.jsx("div",{ref:ne===0?ue:void 0,className:`${s}-marquee-set`,style:{gap:k(y),paddingRight:k(y)},"aria-hidden":ne>0,children:We.map((_,ke)=>N(_,ne,ke))},`set-${ne}`))})]})]})}return r.jsxs("div",{ref:re,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:P}}),me,r.jsxs("div",{className:`${s}-marquee-wrapper`,style:se,children:[Ce,r.jsx("div",{ref:ue,className:st(`${s}-marquee-set`,`${s}-marquee-static`),style:{gap:k(y)},"aria-label":"Marquee text",children:t==null?void 0:t.map((D,T)=>N(D,0,T))})]})]})},lg=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2597
2597
|
import cn from 'classnames';
|
|
2598
2598
|
import { CommonComponentProps } from '../props';
|
|
2599
2599
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2732,6 +2732,11 @@ const MIN_CONTENT_SEQUENCE_REPEAT = 3;
|
|
|
2732
2732
|
const MAX_CONTENT_SEQUENCE_REPEAT = 12;
|
|
2733
2733
|
const OUTER_SET_COPIES = 3;
|
|
2734
2734
|
const DEFAULT_CAP_HEIGHT_RATIO = 0.72;
|
|
2735
|
+
const CURVE_AMPLITUDE_SCALE = 100;
|
|
2736
|
+
const CURVE_FREQUENCY_SCALE = 10;
|
|
2737
|
+
|
|
2738
|
+
const normalizeCurveAmplitude = (value: number): number => Math.max(0, value) / CURVE_AMPLITUDE_SCALE;
|
|
2739
|
+
const normalizeCurveFrequency = (value: number): number => Math.max(0, value) / CURVE_FREQUENCY_SCALE;
|
|
2735
2740
|
|
|
2736
2741
|
const restartTrackAnimation = (track: HTMLElement) => {
|
|
2737
2742
|
track.style.setProperty('animation-name', 'none');
|
|
@@ -2768,27 +2773,106 @@ type MarqueeTextItemViewProps = {
|
|
|
2768
2773
|
isCurve: boolean;
|
|
2769
2774
|
};
|
|
2770
2775
|
|
|
2771
|
-
const applyWaveTransform = (el: HTMLElement, y: number, rotateDeg: number) => {
|
|
2772
|
-
el.style.transform = \`translate3d(
|
|
2776
|
+
const applyWaveTransform = (el: HTMLElement, x: number, y: number, rotateDeg: number) => {
|
|
2777
|
+
el.style.transform = \`translate3d(\${x}px, \${y}px, 0) rotate(\${rotateDeg}deg)\`;
|
|
2773
2778
|
};
|
|
2774
2779
|
|
|
2775
2780
|
const clearWaveTransform = (el: HTMLElement) => {
|
|
2776
2781
|
el.style.transform = '';
|
|
2777
2782
|
};
|
|
2778
2783
|
|
|
2784
|
+
const readTranslateX = (transform: string): number => {
|
|
2785
|
+
if (!transform || transform === 'none') return 0;
|
|
2786
|
+
try {
|
|
2787
|
+
return new DOMMatrixReadOnly(transform).m41;
|
|
2788
|
+
} catch {
|
|
2789
|
+
return 0;
|
|
2790
|
+
}
|
|
2791
|
+
};
|
|
2792
|
+
|
|
2793
|
+
const getLocalCenterX = (el: HTMLElement, ancestor: HTMLElement): number => {
|
|
2794
|
+
let x = el.offsetWidth / 2;
|
|
2795
|
+
let node: HTMLElement | null = el;
|
|
2796
|
+
while (node && node !== ancestor) {
|
|
2797
|
+
x += node.offsetLeft;
|
|
2798
|
+
x += readTranslateX(getComputedStyle(node).transform);
|
|
2799
|
+
const parent = node.offsetParent as HTMLElement | null;
|
|
2800
|
+
if (!parent || parent === node) break;
|
|
2801
|
+
node = parent;
|
|
2802
|
+
}
|
|
2803
|
+
return x;
|
|
2804
|
+
};
|
|
2805
|
+
|
|
2806
|
+
const WAVE_ARC_LUT_SAMPLES = 96;
|
|
2807
|
+
|
|
2808
|
+
type WaveArcLut = {
|
|
2809
|
+
wavelength: number;
|
|
2810
|
+
periodArc: number;
|
|
2811
|
+
x: Float64Array;
|
|
2812
|
+
s: Float64Array;
|
|
2813
|
+
};
|
|
2814
|
+
|
|
2815
|
+
// Invert s(x) = ∫ sqrt(1 + (A k cos(k t))²) dt so glyphs keep their layout
|
|
2816
|
+
// advance along the curve instead of along horizontal x.
|
|
2817
|
+
const buildWaveArcLut = (amplitude: number, k: number, samples: number): WaveArcLut | null => {
|
|
2818
|
+
if (k <= 0 || amplitude <= 0 || samples < 2) return null;
|
|
2819
|
+
const wavelength = (2 * Math.PI) / k;
|
|
2820
|
+
const x = new Float64Array(samples + 1);
|
|
2821
|
+
const s = new Float64Array(samples + 1);
|
|
2822
|
+
const slopeAmp = amplitude * k;
|
|
2823
|
+
const ds = (t: number) => Math.sqrt(1 + (slopeAmp * Math.cos(k * t)) ** 2);
|
|
2824
|
+
const dx = wavelength / samples;
|
|
2825
|
+
for (let i = 0; i < samples; i += 1) {
|
|
2826
|
+
const t0 = i * dx;
|
|
2827
|
+
const t1 = t0 + dx;
|
|
2828
|
+
x[i + 1] = t1;
|
|
2829
|
+
s[i + 1] = s[i] + (ds(t0) + ds(t1)) * 0.5 * dx;
|
|
2830
|
+
}
|
|
2831
|
+
return { wavelength, periodArc: s[samples], x, s };
|
|
2832
|
+
};
|
|
2833
|
+
|
|
2834
|
+
const xFromArcLength = (lut: WaveArcLut, targetS: number): number => {
|
|
2835
|
+
if (lut.periodArc <= 0) return targetS;
|
|
2836
|
+
const sign = targetS < 0 ? -1 : 1;
|
|
2837
|
+
const sAbs = Math.abs(targetS);
|
|
2838
|
+
const n = Math.floor(sAbs / lut.periodArc);
|
|
2839
|
+
const r = sAbs - n * lut.periodArc;
|
|
2840
|
+
const { s, x } = lut;
|
|
2841
|
+
let lo = 0;
|
|
2842
|
+
let hi = s.length - 1;
|
|
2843
|
+
while (hi - lo > 1) {
|
|
2844
|
+
const mid = (lo + hi) >> 1;
|
|
2845
|
+
if (s[mid] <= r) lo = mid;
|
|
2846
|
+
else hi = mid;
|
|
2847
|
+
}
|
|
2848
|
+
const span = s[hi] - s[lo];
|
|
2849
|
+
const t = span > 0 ? (r - s[lo]) / span : 0;
|
|
2850
|
+
return sign * (n * lut.wavelength + x[lo] + (x[hi] - x[lo]) * t);
|
|
2851
|
+
};
|
|
2852
|
+
|
|
2779
2853
|
const buildCurveBackgroundPath = (
|
|
2780
2854
|
width: number,
|
|
2781
2855
|
amplitude: number,
|
|
2782
2856
|
frequency: number,
|
|
2783
2857
|
centerY: number,
|
|
2784
2858
|
): string => {
|
|
2785
|
-
const
|
|
2786
|
-
const k = width > 0 ? (2 * Math.PI *
|
|
2787
|
-
const
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2859
|
+
const periods = Math.max(0, frequency);
|
|
2860
|
+
const k = width > 0 ? (2 * Math.PI * periods) / width : 0;
|
|
2861
|
+
const yAt = (x: number) => centerY + amplitude * Math.sin(k * x);
|
|
2862
|
+
const dyAt = (x: number) => amplitude * k * Math.cos(k * x);
|
|
2863
|
+
const segments = Math.max(4, Math.ceil(periods * 4));
|
|
2864
|
+
const parts: string[] = [\`M0 \${yAt(0).toFixed(2)}\`];
|
|
2865
|
+
for (let i = 0; i < segments; i++) {
|
|
2866
|
+
const x0 = (i / segments) * width;
|
|
2867
|
+
const x1 = ((i + 1) / segments) * width;
|
|
2868
|
+
const dx = x1 - x0;
|
|
2869
|
+
const y0 = yAt(x0);
|
|
2870
|
+
const y1 = yAt(x1);
|
|
2871
|
+
const c1x = x0 + dx / 3;
|
|
2872
|
+
const c1y = y0 + (dyAt(x0) * dx) / 3;
|
|
2873
|
+
const c2x = x1 - dx / 3;
|
|
2874
|
+
const c2y = y1 - (dyAt(x1) * dx) / 3;
|
|
2875
|
+
parts.push(\`C\${c1x.toFixed(2)} \${c1y.toFixed(2)} \${c2x.toFixed(2)} \${c2y.toFixed(2)} \${x1.toFixed(2)} \${y1.toFixed(2)}\`);
|
|
2792
2876
|
}
|
|
2793
2877
|
return parts.join(' ');
|
|
2794
2878
|
};
|
|
@@ -2849,7 +2933,6 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
2849
2933
|
layoutType,
|
|
2850
2934
|
curveAmplitude,
|
|
2851
2935
|
curveFrequency,
|
|
2852
|
-
angle,
|
|
2853
2936
|
textFontFamily,
|
|
2854
2937
|
textFontSettings,
|
|
2855
2938
|
textFontSize,
|
|
@@ -2861,6 +2944,8 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
2861
2944
|
backgroundColor,
|
|
2862
2945
|
} = settings;
|
|
2863
2946
|
const isCurveLayout = layoutType === 'curve';
|
|
2947
|
+
const amplitudeRatio = normalizeCurveAmplitude(curveAmplitude);
|
|
2948
|
+
const curvePeriods = normalizeCurveFrequency(curveFrequency);
|
|
2864
2949
|
const scopedCss = useMemo(() => getCSS(P, animationDistance, isCurveLayout), [P, animationDistance, isCurveLayout]);
|
|
2865
2950
|
|
|
2866
2951
|
const textCss = useMemo<CSSProperties>(() => textStylesToCss({
|
|
@@ -3001,7 +3086,7 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3001
3086
|
if (!wrapper || !set) return;
|
|
3002
3087
|
let raf = 0;
|
|
3003
3088
|
const measure = () => {
|
|
3004
|
-
const width = wrapper.
|
|
3089
|
+
const width = wrapper.offsetWidth;
|
|
3005
3090
|
const bandHeight = set.offsetHeight;
|
|
3006
3091
|
if (width > 0) setCurveWidthPx((prev) => (Math.abs(prev - width) > 0.5 ? width : prev));
|
|
3007
3092
|
if (bandHeight > 0) setCurveBandHeightPx((prev) => (Math.abs(prev - bandHeight) > 0.5 ? bandHeight : prev));
|
|
@@ -3026,39 +3111,50 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3026
3111
|
restartTrackAnimation(track);
|
|
3027
3112
|
}, [useMarqueeTrack, animationDistance, direction, pxPerSec]);
|
|
3028
3113
|
|
|
3029
|
-
// Curve layout only: a sine wave
|
|
3030
|
-
//
|
|
3031
|
-
//
|
|
3032
|
-
//
|
|
3114
|
+
// Curve layout only: a sine wave in the band's local layout space (offsetWidth
|
|
3115
|
+
// + offsetLeft), not screen getBoundingClientRect. Glyphs are placed by arc
|
|
3116
|
+
// length so layout advance (including letter-spacing) is kept along the path,
|
|
3117
|
+
// not along horizontal x. Straight never enters this loop.
|
|
3033
3118
|
useLayoutEffect(() => {
|
|
3034
3119
|
if (!isCurveLayout || !hasContent) return;
|
|
3035
3120
|
const wrapper = wrapperRef.current;
|
|
3036
3121
|
if (!wrapper) return;
|
|
3037
3122
|
let raf = 0;
|
|
3038
3123
|
let cancelled = false;
|
|
3124
|
+
let lut: WaveArcLut | null = null;
|
|
3125
|
+
let lutKey = '';
|
|
3039
3126
|
const tick = () => {
|
|
3040
3127
|
if (cancelled) return;
|
|
3128
|
+
const band = wrapper.querySelector<HTMLElement>(\`.\${P}-marquee-wrapper\`) ?? wrapper;
|
|
3129
|
+
const width = band.offsetWidth || 1;
|
|
3130
|
+
const amplitude = width * amplitudeRatio;
|
|
3131
|
+
const k = (2 * Math.PI * curvePeriods) / width;
|
|
3132
|
+
const nextLutKey = \`\${width}|\${amplitude}|\${k}\`;
|
|
3133
|
+
if (nextLutKey !== lutKey) {
|
|
3134
|
+
lutKey = nextLutKey;
|
|
3135
|
+
lut = buildWaveArcLut(amplitude, k, WAVE_ARC_LUT_SAMPLES);
|
|
3136
|
+
}
|
|
3041
3137
|
const wrapperRect = wrapper.getBoundingClientRect();
|
|
3042
|
-
const width = wrapperRect.width || 1;
|
|
3043
|
-
const amplitude = width * Math.max(0, curveAmplitude);
|
|
3044
|
-
const k = (2 * Math.PI * Math.max(0, curveFrequency)) / width;
|
|
3045
3138
|
const viewLeft = wrapperRect.left;
|
|
3046
3139
|
const viewRight = wrapperRect.right;
|
|
3140
|
+
const extraRight = lut && lut.wavelength > 0
|
|
3141
|
+
? Math.max(0, (lut.periodArc / lut.wavelength - 1) * width)
|
|
3142
|
+
: 0;
|
|
3047
3143
|
const items = wrapper.querySelectorAll<HTMLElement>('[data-marquee-text-item]');
|
|
3048
3144
|
items.forEach((item) => {
|
|
3049
3145
|
const itemRect = item.getBoundingClientRect();
|
|
3050
|
-
if (itemRect.right < viewLeft || itemRect.left > viewRight) return;
|
|
3146
|
+
if (itemRect.right < viewLeft || itemRect.left > viewRight + extraRight) return;
|
|
3051
3147
|
const nodes = item.querySelectorAll<HTMLElement>('[data-marquee-wave-node]');
|
|
3052
3148
|
nodes.forEach((el) => {
|
|
3053
3149
|
const inner = el.firstElementChild as HTMLElement | null;
|
|
3054
3150
|
if (!inner) return;
|
|
3055
|
-
const
|
|
3056
|
-
const
|
|
3057
|
-
const phase = k *
|
|
3151
|
+
const localX = getLocalCenterX(el, band);
|
|
3152
|
+
const xPath = lut ? xFromArcLength(lut, localX) : localX;
|
|
3153
|
+
const phase = k * xPath;
|
|
3058
3154
|
const y = amplitude * Math.sin(phase);
|
|
3059
3155
|
const slope = amplitude * k * Math.cos(phase);
|
|
3060
3156
|
const rotateDeg = Math.atan(slope) * (180 / Math.PI);
|
|
3061
|
-
applyWaveTransform(inner, y, rotateDeg);
|
|
3157
|
+
applyWaveTransform(inner, xPath - localX, y, rotateDeg);
|
|
3062
3158
|
});
|
|
3063
3159
|
});
|
|
3064
3160
|
raf = requestAnimationFrame(tick);
|
|
@@ -3073,7 +3169,7 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3073
3169
|
});
|
|
3074
3170
|
wrapper.querySelectorAll<HTMLElement>('[data-marquee-text-item]').forEach(clearWaveTransform);
|
|
3075
3171
|
};
|
|
3076
|
-
}, [isCurveLayout,
|
|
3172
|
+
}, [isCurveLayout, amplitudeRatio, curvePeriods, hasContent, setWidth, contentKey, P]);
|
|
3077
3173
|
|
|
3078
3174
|
const onTrackEnter = () => {
|
|
3079
3175
|
if (hoverPauseEnabled) setIsHovering(true);
|
|
@@ -3082,44 +3178,29 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3082
3178
|
if (hoverPauseEnabled) setIsHovering(false);
|
|
3083
3179
|
};
|
|
3084
3180
|
|
|
3085
|
-
// Angle layout: rotating the band in place clips its corners against the
|
|
3086
|
-
// wrapper's own box, since a CSS transform doesn't affect layout size. Instead
|
|
3087
|
-
// the wrapper gets extra top/bottom padding sized to fit the rotated band.
|
|
3088
|
-
// Percentage padding-top/bottom resolves against the containing block's WIDTH
|
|
3089
|
-
// (a CSS quirk), so this is exact without measuring anything - it's a plain
|
|
3090
|
-
// function of the \`angle\` prop, computed the same way on the server (where the
|
|
3091
|
-
// editor's "auto" height calculator renders this via renderToStaticMarkup, and
|
|
3092
|
-
// any effect/ref-based measurement would just read back zero) and the client.
|
|
3093
|
-
const anglePaddingPercent = layoutType === 'angle'
|
|
3094
|
-
? Math.abs(Math.sin((angle * Math.PI) / 180)) * 50
|
|
3095
|
-
: 0;
|
|
3096
3181
|
const curvePaddingPercent = isCurveLayout
|
|
3097
|
-
?
|
|
3182
|
+
? amplitudeRatio * 100
|
|
3098
3183
|
: 0;
|
|
3099
|
-
const wrapperStyle: CSSProperties | undefined = layoutType === 'angle'
|
|
3100
|
-
? { paddingTop: \`\${anglePaddingPercent}%\`, paddingBottom: \`\${anglePaddingPercent}%\` }
|
|
3101
|
-
: undefined;
|
|
3102
3184
|
const bandStyle: CSSProperties = {
|
|
3103
|
-
...(
|
|
3104
|
-
? {
|
|
3105
|
-
:
|
|
3106
|
-
? { paddingTop: \`\${curvePaddingPercent}%\`, paddingBottom: \`\${curvePaddingPercent}%\` }
|
|
3107
|
-
: {}),
|
|
3185
|
+
...(isCurveLayout
|
|
3186
|
+
? { paddingTop: \`\${curvePaddingPercent}%\`, paddingBottom: \`\${curvePaddingPercent}%\` }
|
|
3187
|
+
: {}),
|
|
3108
3188
|
...(!isCurveLayout ? { backgroundColor } : {}),
|
|
3109
3189
|
};
|
|
3110
|
-
const curveAmplitudePx = curveWidthPx *
|
|
3190
|
+
const curveAmplitudePx = curveWidthPx * amplitudeRatio;
|
|
3111
3191
|
const curveBgPath = isCurveLayout && curveWidthPx > 0 && curveBandHeightPx > 0
|
|
3112
3192
|
? buildCurveBackgroundPath(
|
|
3113
3193
|
curveWidthPx,
|
|
3114
3194
|
curveAmplitudePx,
|
|
3115
|
-
|
|
3195
|
+
curvePeriods,
|
|
3116
3196
|
curveAmplitudePx + curveBandHeightPx / 2,
|
|
3117
3197
|
)
|
|
3118
3198
|
: '';
|
|
3199
|
+
const curveViewBoxH = curveAmplitudePx * 2 + curveBandHeightPx;
|
|
3119
3200
|
const curveBgSvg = curveBgPath ? (
|
|
3120
3201
|
<svg
|
|
3121
3202
|
className={\`\${P}-curve-bg\`}
|
|
3122
|
-
viewBox={\`0 0 \${curveWidthPx} \${
|
|
3203
|
+
viewBox={\`0 0 \${curveWidthPx} \${curveViewBoxH}\`}
|
|
3123
3204
|
preserveAspectRatio="none"
|
|
3124
3205
|
aria-hidden
|
|
3125
3206
|
>
|
|
@@ -3128,7 +3209,8 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3128
3209
|
fill="none"
|
|
3129
3210
|
stroke={backgroundColor}
|
|
3130
3211
|
strokeWidth={curveBandHeightPx}
|
|
3131
|
-
strokeLinecap="
|
|
3212
|
+
strokeLinecap="round"
|
|
3213
|
+
strokeLinejoin="round"
|
|
3132
3214
|
/>
|
|
3133
3215
|
</svg>
|
|
3134
3216
|
) : null;
|
|
@@ -3160,7 +3242,7 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3160
3242
|
const durationS = \`\${Math.max(0, durationMs) / 1000}s\`;
|
|
3161
3243
|
|
|
3162
3244
|
return (
|
|
3163
|
-
<div ref={wrapperRef} className={\`\${P}-wrapper\`} aria-label="Marquee text"
|
|
3245
|
+
<div ref={wrapperRef} className={\`\${P}-wrapper\`} aria-label="Marquee text">
|
|
3164
3246
|
<style dangerouslySetInnerHTML={{ __html: scopedCss }} />
|
|
3165
3247
|
{capRef}
|
|
3166
3248
|
<div className={\`\${P}-marquee-wrapper\`} style={bandStyle}>
|
|
@@ -3196,7 +3278,7 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3196
3278
|
}
|
|
3197
3279
|
|
|
3198
3280
|
return (
|
|
3199
|
-
<div ref={wrapperRef} className={\`\${P}-wrapper\`}
|
|
3281
|
+
<div ref={wrapperRef} className={\`\${P}-wrapper\`}>
|
|
3200
3282
|
<style dangerouslySetInnerHTML={{ __html: scopedCss }} />
|
|
3201
3283
|
{capRef}
|
|
3202
3284
|
<div className={\`\${P}-marquee-wrapper\`} style={bandStyle}>
|
|
@@ -3228,10 +3310,9 @@ export type MarqueeTextSettings = {
|
|
|
3228
3310
|
direction: 'left' | 'right';
|
|
3229
3311
|
pauseOnHover: 'on' | 'off';
|
|
3230
3312
|
gap: number;
|
|
3231
|
-
layoutType: '
|
|
3313
|
+
layoutType: 'straight' | 'curve';
|
|
3232
3314
|
curveAmplitude: number;
|
|
3233
3315
|
curveFrequency: number;
|
|
3234
|
-
angle: number;
|
|
3235
3316
|
textFontFamily: string;
|
|
3236
3317
|
textFontSettings: {
|
|
3237
3318
|
fontWeight: number;
|
|
@@ -3257,7 +3338,7 @@ type MarqueeTextProps = {
|
|
|
3257
3338
|
isPreviewMode?: boolean;
|
|
3258
3339
|
isEditMode?: boolean;
|
|
3259
3340
|
} & CommonComponentProps;
|
|
3260
|
-
`,
|
|
3341
|
+
`,cg={fontSettings:{type:"object",scope:"common",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},dg={type:"object",version:1,settings:{sizing:"auto manual",properties:{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"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},layoutType:{type:"string",scope:"common",title:"Path Type",display:{type:"toggle-cycle",enum:["straight","curve"]}},curveAmplitude:{type:"number",scope:"layout",title:"Amplitude",min:0,max:30,step:1,display:{type:"common-numeric-input",visible:!1}},curveFrequency:{type:"number",scope:"layout",title:"Frequency",min:0,max:100,step:1,display:{type:"common-numeric-input",visible:!1}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...cg.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"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Color"},backgroundColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Background Color"}},defaults:{direction:"left",pauseOnHover:"off",layoutType:"straight",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",backgroundColor:"#FFFFFF00"},layoutDefaults:{m:{speed:.55,gap:.04,curveAmplitude:6,curveFrequency:15,textFontSize:.08,textLineHeight:.08},t:{speed:1.64,gap:.02,curveAmplitude:5,curveFrequency:15,textFontSize:.05,textLineHeight:.05},d:{speed:1.64,gap:.02,curveAmplitude:5,curveFrequency:15,textFontSize:.035,textLineHeight:.035}},displayRules:[{if:{name:"layoutType",value:"curve"},then:{name:"properties.curveAmplitude.display.visible",value:!0}},{if:{name:"layoutType",value:"curve"},then:{name:"properties.curveFrequency.display.visible",value:!0}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","layoutType","curveAmplitude","curveFrequency"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction","speed"]},{type:"row",items:["gap","pauseOnHover"]},{type:"row",items:["layoutType"]},{type:"row",items:["curveAmplitude","curveFrequency"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}],paletteBookmark:{items:["textColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{text:{placeholder:"Add text...",label:"Text",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{type:"media-input"}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}}},default:[{text:"NEW COLLECTION",image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""},link:""},{text:"SHOP NOW",image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""},link:""},{text:"LIMITED EDITION",image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""},link:""},{text:"EXPLORE MORE",image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""},link:""}]}},ug={element:sg,id:"marquee-text",name:"Marquee Text",category:"galleries",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple-Marquee.mp4"},schema:dg,sourceCode:lg,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}};function pg(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
3261
3342
|
.${e}-marquee-wrapper {
|
|
3262
3343
|
overflow: hidden;
|
|
3263
3344
|
width: 100%;
|
|
@@ -3346,7 +3427,7 @@ type MarqueeTextProps = {
|
|
|
3346
3427
|
pointer-events: auto;
|
|
3347
3428
|
z-index: 10;
|
|
3348
3429
|
}
|
|
3349
|
-
`}const
|
|
3430
|
+
`}const mg=30,As=2,gg=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")},hg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=$.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:v,corners:y,stroke:g,strokeColor:h,bgColor:m,padding:b,logoMarginTop:E,logoWidth:R,logoHeight:L,captionMarginTop:J}=e,W=!!o,q=((t==null?void 0:t.length)??0)>0,A=d>0&&(!n||i),C=q&&(A||n),O=Math.max(0,d)*mg,w=N=>$.scalingValue(N,n??!1),H=a.useRef(null),P=a.useRef(null),X=a.useRef(null),[k,Y]=a.useState(0),[U,V]=a.useState(0),ie=U>0?U:0,S=a.useMemo(()=>pg(s,ie),[s,ie]),[M,z]=a.useState(0),ae=A&&u==="on",[re,I]=a.useState(!1),ue=a.useRef(null),[F,oe]=a.useState(0),[Q,ye]=a.useState(0),Pe=a.useRef(null),pe=N=>{var D,T,B,Le,ne;return{fontSettings:{fontFamily:(e==null?void 0:e[`${N}FontFamily`])??"Arial",fontWeight:((D=e==null?void 0:e[`${N}FontSettings`])==null?void 0:D.fontWeight)??400,fontStyle:((T=e==null?void 0:e[`${N}FontSettings`])==null?void 0:T.fontStyle)??"normal"},textAppearance:{textTransform:((B=e==null?void 0:e[`${N}TextAppearance`])==null?void 0:B.textTransform)??"none",textDecoration:((Le=e==null?void 0:e[`${N}TextAppearance`])==null?void 0:Le.textDecoration)??"none",fontVariant:((ne=e==null?void 0:e[`${N}TextAppearance`])==null?void 0:ne.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${N}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${N}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${N}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${N}LineHeight`])??.01,color:(e==null?void 0:e[`${N}Color`])??"#000000"}},ce=pe("text"),K=pe("caption"),te=a.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(N=>{var me,D;return(((me=N.text)==null?void 0:me.length)??0)>0||(((D=N.caption)==null?void 0:D.length)??0)>0}),[t]),Z=a.useMemo(()=>!C||(t==null?void 0:t.length)===0?1:U<=0||k<=0?As:Math.max(As,Math.ceil(k/U)+1),[C,t==null?void 0:t.length,U,k]);a.useLayoutEffect(()=>{if(!C)return;const N=H.current,me=X.current;if(!N||!me)return;let D=0;const T=()=>{const ne=N.getBoundingClientRect().width,_=me.getBoundingClientRect().width,ke=Pe.current,Ie=typeof ke=="number"&&Math.abs(ke-_)<=.25;if(Pe.current=_,Y(ne),typeof _=="number"&&_>0&&U<=0){V(_);return}Ie&&_!==U?V(_):!Ie&&U<=0&&(cancelAnimationFrame(D),D=requestAnimationFrame(T))},B=()=>{cancelAnimationFrame(D),D=requestAnimationFrame(T)};B();const Le=new ResizeObserver(B);return Le.observe(N),Le.observe(me),()=>{cancelAnimationFrame(D),Le.disconnect()}},[A,C,U]);const Fe=ie>0&&O>0?ie/O*1e3:0,$e=`${Math.max(0,Fe)/1e3}s`;a.useLayoutEffect(()=>{if(!C||ie<=0)return;const N=P.current;N&&gg(N)},[C,ie,c]),a.useLayoutEffect(()=>{if(!C){z(0);return}const N=X.current,me=P.current;if(!N||!me)return;const D=()=>{let B=0;for(let Le=0;Le<N.children.length;Le++){const _=N.children[Le].firstElementChild;_&&(B=Math.max(B,_.offsetHeight))}B<=0&&(B=me.offsetHeight),z(B>0?B:0)};D();const T=new ResizeObserver(D);return T.observe(N),T.observe(me),()=>{T.disconnect()}},[C,Z,t,n,p,v,b,g,y,R,L,F,Q]);const We=()=>{ae&&I(!0)},de=()=>{ae&&I(!1)},he=a.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),be=a.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),G=a.useCallback((N,me,D,T)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:he,width:"100%"},children:[r.jsx("div",{"data-controls":W?T==null?void 0:T.controlsName:void 0,"data-controls-axis":W?"y":void 0,className:W?`${s}-control`:void 0,style:{height:w((T==null?void 0:T.marginTop)??0)}}),r.jsx("div",{...T!=null&&T.dataMeasureKind?{"data-testimonial-measure":T.dataMeasureKind}:{},style:{...Ut(N,n),textAlign:be,pointerEvents:"auto",...typeof(T==null?void 0:T.minHeightPx)=="number"&&T.minHeightPx>0?{minHeight:T.minHeightPx}:{}},children:r.jsx(yi,{content:me})})]},D),[he,be,n,W,s,w]),se=a.useCallback((N,me,D)=>{var T,B,Le;return r.jsxs("div",{style:{padding:`${w(b.top)} ${w(b.right)} ${w(b.bottom)} ${w(b.left)}`,width:w(v+g*2),height:"100%",borderRadius:w(y),border:`${w(g)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${s}-cover`,style:{background:m}}),r.jsxs("div",{className:`${s}-elements-overlay`,style:{alignItems:he,textAlign:be},children:[N.text&&G(ce,N.text,"text",D!=null&&D.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(D==null?void 0:D.textMinHeightPx)=="number"&&D.textMinHeightPx>0?{minHeightPx:D.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:he,width:"100%"},children:[r.jsx("div",{"data-controls":W&&!(D!=null&&D.dataMeasureAttrs)?"logoMarginTop":void 0,className:W&&!(D!=null&&D.dataMeasureAttrs)?`${s}-control`:void 0,style:{height:w(E)}}),r.jsx("div",{style:{width:w(R),height:w(L)},children:((T=N.logo)==null?void 0:T.url)&&r.jsx("img",{src:N.logo.url,alt:((B=N.logo)==null?void 0:B.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Le=N.logo)==null?void 0:Le.objectFit)||"contain"}})})]}),N.caption&&G(K,N.caption,"caption",{...D!=null&&D.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:J,...D!=null&&D.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(D==null?void 0:D.captionMinHeightPx)=="number"&&D.captionMinHeightPx>0?{minHeightPx:D.captionMinHeightPx}:{}})]})]},me)},[m,J,K,v,y,L,E,R,he,be,b.bottom,b.left,b.right,b.top,G,g,h,ce,n,W,s]),ge=a.useCallback(N=>{oe(N.maxTextPx),ye(N.maxCaptionPx)},[]);a.useLayoutEffect(()=>{if(!te){ge({maxTextPx:0,maxCaptionPx:0});return}const N=ue.current;if(!N)return;const me=()=>{$.readTestimonialTextMeasure(N,ge)};me();const D=new ResizeObserver(me);return D.observe(N),()=>{D.disconnect()}},[te,ge,t,se]);const xe=te?{textMinHeightPx:F,captionMinHeightPx:Q}:void 0,Me=te?r.jsx("div",{ref:ue,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((N,me)=>se(N,`measure-${me}`,{dataMeasureAttrs:!0}))}):null,Ce=(N,me)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[se(N,`card-${me}`,xe),W&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${w(p)})`,width:w(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},me);if(C){const N=A?ae&&re?"paused":"running":"paused";return r.jsxs("div",{ref:H,className:st(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...M>0?{height:M}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:S}}),Me,r.jsx("div",{ref:P,className:`${s}-marquee-track`,"data-direction":c,onMouseEnter:We,onMouseLeave:de,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:$e,WebkitAnimationDuration:$e,animationPlayState:N,WebkitAnimationPlayState:N},children:Array.from({length:Z},(me,D)=>r.jsx("div",{ref:D===0?X:void 0,className:`${s}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:w(p),paddingRight:w(p)},"aria-hidden":D>0,children:t==null?void 0:t.map((T,B)=>Ce(T,`${D}-${B}`))},`set-${D}`))})]})}return r.jsxs("div",{className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:S}}),Me,r.jsx("div",{style:{gap:w(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((N,me)=>Ce(N,me))})]})},fg=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3350
3431
|
import cn from 'classnames';
|
|
3351
3432
|
import { CommonComponentProps } from '../props';
|
|
3352
3433
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3977,7 +4058,7 @@ type TestimonialsSettings = {
|
|
|
3977
4058
|
logoHeight: number;
|
|
3978
4059
|
captionMarginTop: number;
|
|
3979
4060
|
};
|
|
3980
|
-
`,Fs={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},
|
|
4061
|
+
`,Fs={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},yg={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Fs.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Fs.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}}},defaults:{direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.069,textLineHeight:.093,captionFontSize:.053,captionLineHeight:.069},t:{speed:1.64,gap:.02,cardWidth:.44,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.065,left:.01},logoMarginTop:.1,logoWidth:.052,logoHeight:.052,captionMarginTop:.005,textFontSize:.035,textLineHeight:.04,captionFontSize:.023,captionLineHeight:.029},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["align","direction"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners"]},{type:"group",title:"",items:["stroke","padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},vg={element:hg,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Grid.mp4"},defaultSize:{d:{width:"100%",height:320}},schema:yg,sourceCode:fg,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function xg(e){return`
|
|
3981
4062
|
.${e}-container {
|
|
3982
4063
|
position: relative;
|
|
3983
4064
|
overflow-x: clip;
|
|
@@ -4101,7 +4182,7 @@ type TestimonialsSettings = {
|
|
|
4101
4182
|
width: 100%;
|
|
4102
4183
|
height: 100%;
|
|
4103
4184
|
}
|
|
4104
|
-
`}const
|
|
4185
|
+
`}const bg=3e3,wg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=$.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:v,captionMarginTop:y,imageWidth:g,imageHeight:h,controlsWidth:m,controlsColor:b,controlsHoverColor:E}=e,R=d>0&&(!n||!!i),[L,J]=a.useState(0),[W,q]=a.useState(null),[A,C]=a.useState(!1),O=a.useRef(null),w=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),H=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);a.useEffect(()=>{J(0),q(null),C(!1)},[l.length]);const P=l[L],X=W===null?null:l[W],k=pe=>{var K,te,Z,Fe,$e;return{fontSettings:{fontFamily:(e==null?void 0:e[`${pe}FontFamily`])??"Arial",fontWeight:((K=e==null?void 0:e[`${pe}FontSettings`])==null?void 0:K.fontWeight)??400,fontStyle:((te=e==null?void 0:e[`${pe}FontSettings`])==null?void 0:te.fontStyle)??"normal"},textAppearance:{textTransform:((Z=e==null?void 0:e[`${pe}TextAppearance`])==null?void 0:Z.textTransform)??"none",textDecoration:((Fe=e==null?void 0:e[`${pe}TextAppearance`])==null?void 0:Fe.textDecoration)??"none",fontVariant:(($e=e==null?void 0:e[`${pe}TextAppearance`])==null?void 0:$e.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${pe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${pe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${pe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${pe}WordSpacing`])??0,color:(e==null?void 0:e[`${pe}Color`])??"#000000"}},Y=k("text"),U=k("caption"),V=l.length>1&&l.some(pe=>{var ce,K;return(((ce=pe.text)==null?void 0:ce.length)??0)>0||(((K=pe.caption)==null?void 0:K.length)??0)>0}),ie=a.useRef(null),[S,M]=a.useState(0),[z,ae]=a.useState(0),re=e.controls??{mode:"Off",icon:null},I=l.length>1,ue=a.useCallback((pe,ce)=>!I||ce===pe?pe:(O.current&&window.clearTimeout(O.current),q(pe),C(!0),O.current=window.setTimeout(()=>{q(null),C(!1),O.current=null},300),ce),[I]),F=a.useCallback(()=>{I&&J(pe=>ue(pe,(pe-1+l.length)%l.length))},[I,ue,l.length]),oe=a.useCallback(()=>{I&&J(pe=>ue(pe,(pe+1)%l.length))},[I,ue,l.length]);a.useEffect(()=>{if(!R||!I)return;const pe=Math.max(300,bg/d),ce=window.setInterval(()=>{J(K=>ue(K,(K+1)%l.length))},pe);return()=>{window.clearInterval(ce)}},[R,I,ue,l.length,d]),a.useEffect(()=>()=>{O.current&&window.clearTimeout(O.current)},[]);const Q=(pe,ce)=>{var $e,We,de,he;const K=ce==null?void 0:ce.textMinHeightPx,te=ce==null?void 0:ce.captionMinHeightPx,Z=ce==null?void 0:ce.dataMeasureAttrs,Fe=o&&!(ce!=null&&ce.dataMeasureAttrs)&&!(ce!=null&&ce.hideControls);return r.jsxs(r.Fragment,{children:[pe.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[r.jsx("div",{"data-controls":Fe?"textMarginTop":void 0,className:Fe?`${s}-control`:void 0,style:{height:$.scalingValue(v??0,n??!1)}}),r.jsx("div",{...Z&&{"data-testimonial-measure":"text"},style:{...Ut(Y,n),...K&&K>0?{minHeight:K}:{},textAlign:H,pointerEvents:"auto"},children:r.jsx(yi,{content:pe.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[r.jsx("div",{"data-controls":Fe?"imageMarginTop":void 0,className:Fe?`${s}-control`:void 0,style:{height:$.scalingValue(p??0,n??!1)}}),r.jsx("div",{style:{width:$.scalingValue(g??0,n??!1),height:$.scalingValue(h??0,n??!1)},children:(($e=pe.image)==null?void 0:$e.url)&&r.jsx("img",{src:(We=pe.image)==null?void 0:We.url,alt:((de=pe.image)==null?void 0:de.name)??"",className:`${s}-icon`,style:{objectFit:((he=pe.image)==null?void 0:he.objectFit)||"contain"}})})]}),pe.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[r.jsx("div",{"data-controls":Fe?"captionMarginTop":void 0,className:Fe?`${s}-control`:void 0,style:{height:$.scalingValue(y??0,n??!1)}}),r.jsx("div",{...Z?{"data-testimonial-measure":"caption"}:{},style:{...Ut(U,n),...te&&te>0?{minHeight:te}:{},textAlign:H,pointerEvents:"auto"},children:r.jsx(yi,{content:pe.caption})})]})]})},ye=a.useCallback(pe=>{M(pe.maxTextPx),ae(pe.maxCaptionPx)},[]);if(a.useLayoutEffect(()=>{if(!V){ye({maxTextPx:0,maxCaptionPx:0});return}const pe=ie.current;if(!pe)return;const ce=()=>{$.readTestimonialTextMeasure(pe,ye)};ce();const K=new ResizeObserver(ce);return K.observe(pe),()=>{K.disconnect()}},[V,ye,t]),!P)return r.jsx(r.Fragment,{});const Pe=V?{textMinHeightPx:S,captionMinHeightPx:z}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${s}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:xg(s)}}),r.jsxs("div",{className:`${s}-wrapper`,style:{width:$.scalingValue(u??0,n??!1),alignItems:w},children:[V&&r.jsx("div",{ref:ie,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((pe,ce)=>r.jsx("div",{style:{width:"100%"},children:Q(pe,{dataMeasureAttrs:!0})},ce))}),r.jsxs("div",{className:`${s}-fade-stack`,children:[X&&A&&r.jsx("div",{className:st(`${s}-fade-item-prev`,`${s}-fade-out`),children:Q(X,{...Pe,hideControls:!0})}),r.jsx("div",{className:st(`${s}-fade-item-current`,A?`${s}-fade-in`:void 0),children:Q(P,Pe)})]})]}),re.mode==="On"&&r.jsxs("div",{className:`${s}-controls`,children:[r.jsx("div",{className:`${s}-arrow`,style:{width:$.scalingValue(m??.02,n??!1),height:$.scalingValue(m??.02,n??!1),"--arrow-hover-color":E},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:F,disabled:!I,"aria-label":"Previous testimonial",children:re.icon&&r.jsx(rn,{url:re.icon,fill:b,hoverFill:E,className:st(`${s}-arrow-img`,`${s}-mirror`)})})}),r.jsx("div",{className:st(`${s}-arrow`,`${s}-next-arrow`),style:{width:$.scalingValue(m??.02,n??!1),height:$.scalingValue(m??.02,n??!1),"--arrow-hover-color":E},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:oe,disabled:!I,"aria-label":"Next testimonial",children:re.icon&&r.jsx(rn,{url:re.icon,fill:b,hoverFill:E,className:`${s}-arrow-img`})})})]})]})})},Sg=`import cn from 'classnames';
|
|
4105
4186
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4106
4187
|
import { CommonComponentProps } from '../props';
|
|
4107
4188
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4597,12 +4678,12 @@ type TestimonialsSettings = {
|
|
|
4597
4678
|
icon?: string | null;
|
|
4598
4679
|
};
|
|
4599
4680
|
};
|
|
4600
|
-
|
|
4681
|
+
`,$g="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" d="M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),Ws={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Cg={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Ws.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Default"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Ws.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Default"}},defaults:{controls:{mode:"On",icon:$g},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{speed:1,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},t:{speed:1,width:.65,imageMarginTop:.026,captionMarginTop:.01,textMarginTop:0,textFontSize:.035,captionFontSize:.023,textLineHeight:.04,captionLineHeight:.029,imageWidth:.05,imageHeight:.05,controlsWidth:.026},d:{speed:1,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},layout:["__componentName__","speed","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","speed"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Tg={element:wg,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Single.png"},defaultSize:{d:{width:700},t:{width:700},m:{width:334}},schema:Cg,sourceCode:Sg,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Lg(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function _s(e){return((e==null?void 0:e.trim().length)??0)>0}function Ur(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Kr(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:$.scalingValue((o-t)/2,i)}}function Rg(e){return`
|
|
4601
4682
|
.${e}-wrapper {
|
|
4602
4683
|
display: grid;
|
|
4603
4684
|
align-items: start;
|
|
4604
4685
|
justify-content: center;
|
|
4605
|
-
min-height: ${
|
|
4686
|
+
min-height: ${Lg(48)};
|
|
4606
4687
|
}
|
|
4607
4688
|
.${e}-item {
|
|
4608
4689
|
display: flex;
|
|
@@ -4944,7 +5025,7 @@ type TestimonialsSettings = {
|
|
|
4944
5025
|
z-index: 2;
|
|
4945
5026
|
width: 100%;
|
|
4946
5027
|
}
|
|
4947
|
-
`}function xg(){return Math.random()<.5?"ltr":"ttb"}function bg(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function wg(e){const t=xg();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{bg(e)})})}const vn=500,Sg=750,Nn="cubic-bezier(0.22, 1, 0.36, 1)",$g=72,Cg=50;function Tg(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 Lg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Rg(e){const[t]=e.media;return t!=null&&t.url?t:null}function xc(e){return!Array.isArray(e)||e.length===0?[]:Tg(e)?e.flatMap(t=>{const n=Lg(t);if(!n)return[];const i=Rg(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 gi(e){return e.type==="video"}function Ig(e){const t=new Set,n=[];for(const i of e){const o=xc(i.gallery);for(const s of o){const l=s.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function Eg({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>gi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Mg(e){e.pause(),e.removeAttribute("src"),e.load()}function Ns({media:e,className:t,style:n,onMediaClick:i}){return gi(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Hs(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Pg(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 s=e.width/n;return{width:e.width,height:s,left:e.left,top:e.top+(e.height-s)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function kg({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l}){return a.useEffect(()=>{const d=n.current;if(d)return()=>{Mg(d)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,style:i})}function Ag({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",w=a.useRef(null),b=a.useRef(null),h=a.useRef(null),g=a.useRef(null),m=a.useRef(0),x=a.useRef(0),M=a.useRef("none"),E=a.useRef(!1),R=a.useRef(!1),Z=a.useRef(null),_=a.useRef(0),U=a.useRef(null),F=a.useRef(!1),C=a.useRef(null),z=a.useRef(null),y=a.useRef(null),N=a.useRef(()=>{}),[I,J]=a.useState(null),[k,X]=a.useState(null),[G,V]=a.useState("opening"),[oe,S]=a.useState(0),[P,D]=a.useState(0),[re,ae]=a.useState(null),[T,ue]=a.useState(!1),[W,ie]=a.useState(!1),[ne,ye]=a.useState(!1),[Pe,me]=a.useState(null),le=a.useRef(n),K=a.useRef(void 0),ee=t[n],Y=ee?gi(ee):!1,We=P!==0||T,$e=re!==null,Ae=a.useCallback(Se=>{const _e=Se.currentTarget,Ve=_e instanceof HTMLVideoElement?{width:_e.videoWidth,height:_e.videoHeight}:{width:_e.naturalWidth,height:_e.naturalHeight};!Ve.width||!Ve.height||me(Ve)},[]);a.useEffect(()=>{Z.current=k},[k]),a.useEffect(()=>{const Se=w.current;if(!Se)return;const _e=()=>X(Hs(Se));_e();const Ve=new ResizeObserver(_e);return Ve.observe(Se),()=>Ve.disconnect()},[]);const de=a.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),he=a.useCallback(()=>{const Se=z.current;z.current=null,de(),U.current=null,F.current=!1,ae(null),ue(!1),D(0),_.current=0,ie(!1),E.current=!1,x.current=0,M.current="none",Se===1?d():Se===-1&&l()},[de,d,l]),be=a.useCallback(()=>{de(),z.current=null,U.current=null,F.current=!1,ae(null),ue(!1),D(0),_.current=0},[de]),q=a.useCallback(()=>{de(),C.current=window.setTimeout(()=>{z.current!==null&&he()},vn+32)},[de,he]),se=a.useCallback((Se,_e)=>{var Xe;const Ve=((Xe=Z.current)==null?void 0:Xe.width)??0;if(de(),U.current=Se,ae(Se),F.current=!0,ue(!0),_e){z.current=Se;const at=-Se*Ve;_.current=at,D(at),q();return}_.current=0,D(0),C.current=window.setTimeout(()=>{C.current=null,be()},vn+32)},[de,be,q]),ge=a.useCallback(Se=>{if(!(t.length<=1)){if(F.current){if(z.current===Se){y.current=Se,he();return}be()}de(),U.current=Se,ae(Se),F.current=!1,ue(!1),_.current=0,D(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{se(Se,!0)})})}},[t.length,se,he,be,de]);N.current=ge;const xe=a.useCallback(Se=>{Se.propertyName!=="transform"||!F.current||z.current!==null&&he()},[he]),Ee=a.useCallback(()=>{const Se=b.current;if(!Se)return;const _e=Hs(Se);!_e.width||!_e.height||J(_e)},[]);a.useEffect(()=>{Ee();const Se=b.current;if(!Se)return;const _e=new ResizeObserver(()=>Ee());return _e.observe(Se),()=>_e.disconnect()},[Ee]),a.useEffect(()=>{G==="opening"&&I&&V("open")},[G,I]),a.useEffect(()=>{if(G!=="closing")return;const Se=setTimeout(()=>s(),vn);return()=>clearTimeout(Se)},[G,s]),a.useEffect(()=>()=>{de()},[de]),a.useLayoutEffect(()=>{le.current===n&&K.current===(ee==null?void 0:ee.url)||(de(),z.current=null,ae(null),S(0),D(0),ue(!1),ye(!1),ie(!1),me(null),m.current=0,x.current=0,M.current="none",E.current=!1,F.current=!1,_.current=0,U.current=null,g.current=null,R.current=!1,le.current=n,K.current=ee==null?void 0:ee.url)},[n,ee==null?void 0:ee.url,de]),a.useLayoutEffect(()=>{const Se=y.current;Se!==null&&(y.current=null,requestAnimationFrame(()=>{N.current(Se)}))},[n,ee==null?void 0:ee.url]),a.useEffect(()=>{if(G!=="open")return;let Se=null;const _e=()=>{Se&&(document.removeEventListener("click",Se,!0),Se=null)},Ve=()=>{_e(),Se=ut=>{ut.stopPropagation(),ut.preventDefault(),_e()},document.addEventListener("click",Se,!0)},Xe=ut=>{const He=ut<0?1:-1;if(Math.abs(ut)>Cg&&t.length>1){se(He,!0);return}se(He,!1)},at=ut=>{if(ut.touches.length!==1||F.current)return;const He=ut.touches[0];R.current=!0,g.current={x:He.clientX,y:He.clientY},M.current="none",x.current=0,E.current=!1},et=ut=>{if(!g.current||ut.touches.length!==1||F.current)return;const He=ut.touches[0],Ye=He.clientX-g.current.x,ze=He.clientY-g.current.y;if(M.current==="none"){if(Math.abs(Ye)<10&&Math.abs(ze)<10)return;if(Math.abs(Ye)>Math.abs(ze)){if(t.length<=1)return;M.current="horizontal"}else if(ze>0)M.current="vertical";else return}if(M.current==="horizontal"){E.current=!0,ie(!0),x.current=Ye;const pt=Ye<0?1:-1;U.current!==pt&&(U.current=pt,ae(pt)),_.current=Ye,D(Ye),ut.preventDefault();return}M.current==="vertical"&&(E.current=!0,ie(!0),m.current=ze,S(ze),ut.preventDefault())},$t=()=>{if(!g.current)return;const ut=M.current,He=E.current;if(He&&ut==="horizontal")Xe(x.current),Ve();else if(He&&ut==="vertical")if(m.current>$g){const ze=window.innerHeight;m.current=ze,ye(!0),S(ze),V("closing")}else m.current=0,S(0),Ve();else ut==="horizontal"&&Math.abs(x.current)>0&&(Xe(x.current),Ve());g.current=null,M.current="none",x.current=0,E.current=!1,ie(!1)};return document.addEventListener("touchstart",at,{passive:!0}),document.addEventListener("touchmove",et,{passive:!1}),document.addEventListener("touchend",$t),document.addEventListener("touchcancel",$t),()=>{document.removeEventListener("touchstart",at),document.removeEventListener("touchmove",et),document.removeEventListener("touchend",$t),document.removeEventListener("touchcancel",$t),_e()}},[G,t.length,se]),a.useEffect(()=>{const Se=_e=>{_e.key==="Escape"&&(_e.preventDefault(),_e.stopPropagation(),G!=="closing"&&V("closing"))};return window.addEventListener("keydown",Se,!0),()=>window.removeEventListener("keydown",Se,!0)},[G]);const Ce=()=>{G!=="closing"&&V("closing")},H=G==="open",pe=G==="closing",O=oe>0?Math.max(0,1-oe/500):1,L=oe>0?Math.max(.35,1-oe/500):1,B=I?p?I:Pg(I,Pe):null,Re=Se=>{if(Se.stopPropagation(),R.current){R.current=!1;return}if(t.length<=1)return;const _e=B??Se.currentTarget.getBoundingClientRect(),Ve=Se.clientY-_e.top,Xe=Math.min(52,_e.height*.2);if(!(Ve>_e.height-Xe)){if(Se.clientX-_e.left<_e.width/2){ge(-1);return}ge(1)}},Q=Se=>{if(t.length<=1)return;const _e=B??Se.currentTarget.getBoundingClientRect(),Ve=Se.clientX-_e.left,Xe=Se.clientY-_e.top,at=Math.min(52,_e.height*.2);if(Xe>_e.height-at){Se.currentTarget.style.cursor="default";return}Se.currentTarget.style.cursor=Ve<_e.width/2?"w-resize":"e-resize"},A={position:"fixed",top:k==null?void 0:k.top,left:k==null?void 0:k.left,width:k==null?void 0:k.width,height:k==null?void 0:k.height,zIndex:9998},Fe=p?"cover":"contain",Me=P!==0||oe>0?`translate(${P}px, ${oe}px)`:void 0,Qe=W&&!T?"none":T?`transform ${vn}ms ${Nn}`:ne?`transform ${vn}ms ${Nn}, opacity ${vn}ms ${Nn}`:G==="opening"||pe?`opacity ${vn}ms ${Nn}`:"none",Ke={...A,transform:Me,opacity:oe>0?L:G==="opening"||pe?0:1,transition:Qe,pointerEvents:"none"},lt={position:"absolute",top:((B==null?void 0:B.top)??0)-((k==null?void 0:k.top)??0),left:((B==null?void 0:B.left)??0)-((k==null?void 0:k.left)??0),width:B==null?void 0:B.width,height:B==null?void 0:B.height,objectFit:Fe,pointerEvents:Y&&H&&!We?"auto":"none",touchAction:Y&&H?"none":void 0},tt=(k==null?void 0:k.width)??0,Be=$e?(n+re+t.length)%t.length:null,fe=Be!==null?t[Be]:null,Ie={...A,transform:$e?`translateX(${re*tt+P}px)`:void 0,opacity:1,transition:T?`transform ${vn}ms ${Nn}`:"none",pointerEvents:"none"},De={position:"absolute",top:((I==null?void 0:I.top)??0)-((k==null?void 0:k.top)??0),left:((I==null?void 0:I.left)??0)-((k==null?void 0:k.left)??0),width:I==null?void 0:I.width,height:I==null?void 0:I.height,objectFit:Fe,pointerEvents:"none"},qe=B?{position:"fixed",top:B.top,height:B.height,width:B.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:w,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:G==="open"?"none":void 0},onClick:Ce,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:H?O:0,transition:W?"none":`opacity ${vn}ms ${Nn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:b,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:H?1:0,transition:`opacity ${vn}ms ${Nn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:b,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:H?1:0,transition:`opacity ${vn}ms ${Nn}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),I&&k&&fe&&r.jsx("div",{style:Ie,onTransitionEnd:xe,children:gi(fe)?r.jsx("video",{src:fe.url,muted:!0,playsInline:!0,preload:"auto",style:De},`neighbor-${Be}-${fe.url}`):r.jsx("img",{src:fe.url,alt:fe.name,style:De},`neighbor-${Be}-${fe.url}`)}),I&&k&&ee&&r.jsx("div",{style:Ke,onTransitionEnd:xe,children:Y?r.jsx(kg,{src:ee.url,phase:G,mediaRef:h,mediaStyle:lt,onLoadedMetadata:Ae,onClick:Re,onMouseMove:Q},`${n}-${ee.url}`):r.jsx("img",{ref:h,src:ee.url,alt:ee.name,onLoad:Ae,style:lt},`${n}-${ee.url}`)}),H&&qe&&t.length>1&&!Y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...qe,left:B.left,cursor:"w-resize",pointerEvents:W?"none":"auto"},onClick:Se=>{if(R.current){R.current=!1;return}Se.stopPropagation(),ge(-1)}}),r.jsx("div",{style:{...qe,left:B.left+B.width/2,cursor:"e-resize",pointerEvents:W?"none":"auto"},onClick:Se=>{if(R.current){R.current=!1;return}Se.stopPropagation(),ge(1)}})]})]})}function Fg(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Wg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=$.useScopedStyles(),{type:p="a",gridLayout:w,textBoxWidth:b=100,verticalGap:h,entriesCount:g,lightbox:m,imageDisplay:x,imageCorners:M,lightboxImageDisplay:E,slider:R,sliderTiming:Z,direction:_,transition:U,titleMarginTop:F,subtitleMarginTop:C,titleColor:z,subtitleColor:y,lightboxCounterColor:N,titleFontFamily:I,titleFontSettings:J,titleFontSize:k,titleLineHeight:X,titleLetterSpacing:G,titleWordSpacing:V,titleTextAppearance:oe,subtitleFontFamily:S,subtitleFontSettings:P,subtitleFontSize:D,subtitleLineHeight:re,subtitleLetterSpacing:ae,subtitleWordSpacing:T,subtitleTextAppearance:ue,lightboxCounterFontFamily:W,lightboxCounterFontSettings:ie,lightboxCounterFontSize:ne,lightboxCounterLineHeight:ye,lightboxCounterLetterSpacing:Pe,lightboxCounterWordSpacing:me,lightboxCounterTextAppearance:le,showText:K="always",alignEntries:ee="off",align:Y="top"}=e,We={fontSettings:{fontFamily:I,fontWeight:(J==null?void 0:J.fontWeight)??400,fontStyle:(J==null?void 0:J.fontStyle)??"normal"},fontSize:k??.01,lineHeight:X,letterSpacing:G??0,wordSpacing:V??0,textAppearance:oe,color:z},Ae={...on(Ut(We,n))},de={fontSettings:{fontFamily:S,fontWeight:(P==null?void 0:P.fontWeight)??400,fontStyle:(P==null?void 0:P.fontStyle)??"normal"},fontSize:D??.01,lineHeight:re,letterSpacing:ae??0,wordSpacing:T??0,textAppearance:ue,color:y},be={...on(Ut(de,n))},q={fontSettings:{fontFamily:W,fontWeight:(ie==null?void 0:ie.fontWeight)??400,fontStyle:(ie==null?void 0:ie.fontStyle)??"normal"},fontSize:ne??.01,lineHeight:ye,letterSpacing:Pe??0,wordSpacing:me??0,textAppearance:le,color:N},ge={...on(Ut(q,n)),...Kr(ne,ye,u,n)},xe=Ur(k,X,`${u}-item-title`,`${u}-text-tight-leading`),Ee=Ur(D,re,`${u}-item-subtitle`,`${u}-text-tight-leading`),Ce=Kr(k,X,u,n),H=Kr(D,re,u,n),pe=Ur(ne,ye,`${u}-lightbox-counter`,`${u}-text-tight-leading`),O=$.buildColorVars(u,{titleColor:z,subtitleColor:y,lightboxCounterColor:N},_g,Ng),Re=`${l&&l!=="default"?`${u}-state-${l}`:""}${K==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),Q=g===0?1/0:g,A=(t??[]).slice(0,Q),Fe=a.useMemo(()=>m==="on"?Ig(A):[],[A,m]),Me=w.entryWidth??.2,Qe=(x==null?void 0:x.display)==="cover",Ke=(x==null?void 0:x.ratioValue)??"1:1",lt=(x==null?void 0:x.reversed)??!1,[tt,Be]=Ke.split(":").map(Number),De=`${lt?Be:tt} / ${lt?tt:Be}`,qe=w.columnsCount,Se=$.scalingValue(Me??0,n),_e=Se,Ve=!Qe&&R!=="off",Xe=A.length%qe||qe,at=Xe<qe&&A.length>0,et=A.length-Xe,$t=at?Math.floor((qe-Xe)/2)+1:1,ut=M?$.scalingValue(M,n):void 0,He={width:_e,...Qe?{aspectRatio:De,height:"auto",overflow:"hidden"}:{height:"auto"},...ut?{borderRadius:ut,overflow:"hidden"}:{}},Ye=`${u}-item-image-wrapper${Ve?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),ze=p==="d"||p==="e"||p==="f",pt=ee==="on",mt=`calc(${$.scalingValue(Me??0,n)} * (${b} / 100))`,gt=$.scalingValue(Me*b/100,n),kt=Qe?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...ut?{borderRadius:ut}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...ut?{borderRadius:ut}:{}},[Xt,Yt]=a.useState(0),vt=a.useRef(null),bt=U==="fade"||_==="horizontal"?"ltr":_==="vertical"?"ttb":"ltr";a.useEffect(()=>{const ct=vt.current;if(!ct)return;const Te=new ResizeObserver(Oe=>{Yt(Math.round(Oe[0].contentRect.width))});return Te.observe(ct),()=>Te.disconnect()},[]);const Gt=(()=>{const ct={...O},Te=vt.current?getComputedStyle(vt.current).getPropertyValue("--cntrl-article-width").trim():"";return Te&&(ct["--cntrl-article-width"]=Te),ct})(),[Ft,xt]=a.useState(!1),[Ht,qt]=a.useState([]),[Zt,tn]=a.useState(0),Ct=m==="on"&&(!n||i),jt=(ct,Te)=>{n&&!i||m!=="off"&&(qt(ct),tn(Te),xt(!0))};a.useEffect(()=>{if(!Ft||m!=="on"||typeof document>"u")return;const ct=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ct}},[Ft,m]),a.useEffect(()=>{!n||i||xt(!1)},[n,i]);const cn=a.useMemo(()=>vg(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:cn}}),m==="on"&&r.jsx(Eg,{mediaList:Fe}),r.jsx("div",{style:O,children:r.jsx("div",{ref:vt,className:`${u}-wrapper ${u}-type-${p}${pt?` ${u}-align-entries`:""} ${u}-image-align-${Y} ${Re}`.trim(),style:{gridTemplateColumns:`repeat(${qe}, ${Se})`,rowGap:pt?0:$.scalingValue(h??0,n),columnGap:$.scalingValue(w.horizontalGap??0,n),width:$.scalingValue(w.wrapperWidth??0,n),...pt?{[`--${u}-align-entries-row-gap`]:$.scalingValue(h??0,n)}:{}},children:A.map((ct,Te)=>{var At;const Oe=_s(ct.title),nt=_s(ct.subtitle),dt=(((At=ct.link)==null?void 0:At.length)??0)>0&&m==="off"?ct.link:void 0,ht=Math.floor(Te/qe)===Math.ceil(A.length/qe)-1,Rt=at&&Te>=et?`${$t+(Te-et)}`:void 0,st=ze?r.jsxs("div",{className:`${u}-item-text-block`,children:[Oe&&r.jsx("p",{className:xe,style:{width:mt,...Ae,...Ce},children:ct.title}),Oe&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(F??0,n),width:gt}}),nt&&r.jsx("p",{className:Ee,style:{width:mt,...be,...H},children:ct.subtitle}),nt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(C??0,n),width:gt}})]}):null,Ot=pt?r.jsxs("div",{className:`${u}-item-title-row`,children:[!ze&&r.jsx("div",{"data-controls":o&&Oe?"titleMarginTop":void 0,className:o&&Oe?`${u}-control`:void 0,style:{height:Oe?$.scalingValue(F??0,n):0,width:gt}}),Oe&&r.jsx("p",{className:xe,style:{width:mt,...Ae,...Ce},children:ct.title}),ze&&Oe&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(F??0,n),width:gt}})]}):null,Pt=pt?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!ze&&r.jsx("div",{"data-controls":o&&nt?"subtitleMarginTop":void 0,className:o&&nt?`${u}-control`:void 0,style:{height:nt?$.scalingValue(C??0,n):0,width:gt}}),nt&&r.jsx("p",{className:Ee,style:{width:mt,...be,...H},children:ct.subtitle}),ze&&nt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(C??0,n),width:gt}})]}):null,Mt=dt?r.jsxs("a",{href:dt,target:"_blank",className:`${u}-item-text-link`,children:[Ot,Pt]}):r.jsxs(r.Fragment,{children:[Ot,Pt]}),zt=xc(ct.gallery),Bt=zt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),Wt=r.jsx("div",{className:Ye,style:He,children:zt.length===0?null:R==="off"?(()=>{const{displayMedia:wt,lightboxMedia:v}=zt[0],ve=v?Bt.findIndex(Le=>Le.url===v.url):-1;return r.jsx(Ns,{media:wt,className:`${u}-item-${gi(wt)?"video":"image"}`.trim(),style:kt,onMediaClick:Ct&&ve>=0?()=>jt(Bt,ve):void 0})})():r.jsxs(r.Fragment,{children:[Ve&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:zt.map(({displayMedia:wt})=>gi(wt)?r.jsx("video",{src:wt.url,muted:!0,playsInline:!0},`sizer-${wt.url}`):r.jsx("img",{src:wt.url,alt:""},`sizer-${wt.url}`))}),r.jsx(Za,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:Z*1e3,width:"100%",height:"100%",speed:Sg,type:U==="fade"?"fade":"loop",rewind:U==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:bt},onMoved:wt=>{_!=="random"||U==="fade"||wg(wt)},children:zt.map(({displayMedia:wt,lightboxMedia:v},ve)=>{const Le=v?Bt.findIndex(ke=>ke.url===v.url):-1;return r.jsx(Ja,{children:r.jsx(Ns,{media:wt,className:`${u}-item-${gi(wt)?"video":"image"}`.trim(),style:kt,onMediaClick:Ct&&Le>=0?()=>jt(Bt,Le):void 0})},ve)})},`${U}-${Me}-${_}-${Z}-${Xt}-${d}`)]})}),_t=ze?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&Oe?"titleMarginTop":void 0,className:o&&Oe?`${u}-control`:void 0,style:{height:Oe?$.scalingValue(F??0,n):0,width:gt}}),r.jsx("p",{className:xe,style:{width:mt,...Ae,...Ce},children:ct.title}),r.jsx("div",{"data-controls":o&&nt?"subtitleMarginTop":void 0,className:o&&nt?`${u}-control`:void 0,style:{height:nt?$.scalingValue(C??0,n):0,width:gt}}),r.jsx("p",{className:Ee,style:{width:mt,...be,...H},children:ct.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Rt&&!pt?{gridColumn:Rt}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${pt&&ht?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(b??0)>100?`calc(${Se} * (${b} / 100))`:Se,...Rt&&pt?{gridColumn:Rt}:{}},children:pt?r.jsx(r.Fragment,{children:ze?r.jsxs(r.Fragment,{children:[Mt,r.jsx("a",{href:dt,target:"_blank",className:`${u}-item-image-link`,children:Wt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:dt,target:"_blank",className:`${u}-item-image-link`,children:Wt}),Mt]})}):dt?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:dt,target:"_blank",className:`${u}-item-image-link`,children:[st,Wt]}),!ze&&r.jsx("a",{href:dt,target:"_blank",className:`${u}-item-text-link`,children:_t})]}):r.jsxs(r.Fragment,{children:[st,Wt,_t]})})},Te)})})}),(!n||i)&&Ft&&typeof document<"u"&&m==="on"&&(()=>{const ct=(c?document.getElementById(c):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Gt,"data-selection":"none",children:r.jsx(Ag,{prefix:u,items:Ht,index:Zt,imageDisplay:Fg(E),isEditor:n,onClose:()=>xt(!1),onPrev:()=>tn(Te=>(Te-1+Ht.length)%Ht.length),onNext:()=>tn(Te=>(Te+1)%Ht.length),counterClassName:pe,counterStyle:ge})}),ct)})()]})}const _g={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Ng=["hover","focus","filled","success","error"],Hg=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5028
|
+
`}function Ig(){return Math.random()<.5?"ltr":"ttb"}function Eg(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function Mg(e){const t=Ig();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Eg(e)})})}const vn=500,Pg=750,Hn="cubic-bezier(0.22, 1, 0.36, 1)",kg=72,Ag=50;function Fg(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 Wg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function _g(e){const[t]=e.media;return t!=null&&t.url?t:null}function xc(e){return!Array.isArray(e)||e.length===0?[]:Fg(e)?e.flatMap(t=>{const n=Wg(t);if(!n)return[];const i=_g(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 gi(e){return e.type==="video"}function Hg(e){const t=new Set,n=[];for(const i of e){const o=xc(i.gallery);for(const s of o){const l=s.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function Ng({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>gi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Og(e){e.pause(),e.removeAttribute("src"),e.load()}function Hs({media:e,className:t,style:n,onMediaClick:i}){return gi(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Ns(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Dg(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 s=e.width/n;return{width:e.width,height:s,left:e.left,top:e.top+(e.height-s)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function jg({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l}){return a.useEffect(()=>{const d=n.current;if(d)return()=>{Og(d)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,style:i})}function zg({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",v=a.useRef(null),y=a.useRef(null),g=a.useRef(null),h=a.useRef(null),m=a.useRef(0),b=a.useRef(0),E=a.useRef("none"),R=a.useRef(!1),L=a.useRef(!1),J=a.useRef(null),W=a.useRef(0),q=a.useRef(null),A=a.useRef(!1),C=a.useRef(null),O=a.useRef(null),w=a.useRef(null),H=a.useRef(()=>{}),[P,X]=a.useState(null),[k,Y]=a.useState(null),[U,V]=a.useState("opening"),[ie,S]=a.useState(0),[M,z]=a.useState(0),[ae,re]=a.useState(null),[I,ue]=a.useState(!1),[F,oe]=a.useState(!1),[Q,ye]=a.useState(!1),[Pe,pe]=a.useState(null),ce=a.useRef(n),K=a.useRef(void 0),te=t[n],Z=te?gi(te):!1,Fe=M!==0||I,$e=ae!==null,We=a.useCallback(we=>{const Oe=we.currentTarget,ze=Oe instanceof HTMLVideoElement?{width:Oe.videoWidth,height:Oe.videoHeight}:{width:Oe.naturalWidth,height:Oe.naturalHeight};!ze.width||!ze.height||pe(ze)},[]);a.useEffect(()=>{J.current=k},[k]),a.useEffect(()=>{const we=v.current;if(!we)return;const Oe=()=>Y(Ns(we));Oe();const ze=new ResizeObserver(Oe);return ze.observe(we),()=>ze.disconnect()},[]);const de=a.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),he=a.useCallback(()=>{const we=O.current;O.current=null,de(),q.current=null,A.current=!1,re(null),ue(!1),z(0),W.current=0,oe(!1),R.current=!1,b.current=0,E.current="none",we===1?d():we===-1&&l()},[de,d,l]),be=a.useCallback(()=>{de(),O.current=null,q.current=null,A.current=!1,re(null),ue(!1),z(0),W.current=0},[de]),G=a.useCallback(()=>{de(),C.current=window.setTimeout(()=>{O.current!==null&&he()},vn+32)},[de,he]),se=a.useCallback((we,Oe)=>{var Ye;const ze=((Ye=J.current)==null?void 0:Ye.width)??0;if(de(),q.current=we,re(we),A.current=!0,ue(!0),Oe){O.current=we;const ot=-we*ze;W.current=ot,z(ot),G();return}W.current=0,z(0),C.current=window.setTimeout(()=>{C.current=null,be()},vn+32)},[de,be,G]),ge=a.useCallback(we=>{if(!(t.length<=1)){if(A.current){if(O.current===we){w.current=we,he();return}be()}de(),q.current=we,re(we),A.current=!1,ue(!1),W.current=0,z(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{se(we,!0)})})}},[t.length,se,he,be,de]);H.current=ge;const xe=a.useCallback(we=>{we.propertyName!=="transform"||!A.current||O.current!==null&&he()},[he]),Me=a.useCallback(()=>{const we=y.current;if(!we)return;const Oe=Ns(we);!Oe.width||!Oe.height||X(Oe)},[]);a.useEffect(()=>{Me();const we=y.current;if(!we)return;const Oe=new ResizeObserver(()=>Me());return Oe.observe(we),()=>Oe.disconnect()},[Me]),a.useEffect(()=>{U==="opening"&&P&&V("open")},[U,P]),a.useEffect(()=>{if(U!=="closing")return;const we=setTimeout(()=>s(),vn);return()=>clearTimeout(we)},[U,s]),a.useEffect(()=>()=>{de()},[de]),a.useLayoutEffect(()=>{ce.current===n&&K.current===(te==null?void 0:te.url)||(de(),O.current=null,re(null),S(0),z(0),ue(!1),ye(!1),oe(!1),pe(null),m.current=0,b.current=0,E.current="none",R.current=!1,A.current=!1,W.current=0,q.current=null,h.current=null,L.current=!1,ce.current=n,K.current=te==null?void 0:te.url)},[n,te==null?void 0:te.url,de]),a.useLayoutEffect(()=>{const we=w.current;we!==null&&(w.current=null,requestAnimationFrame(()=>{H.current(we)}))},[n,te==null?void 0:te.url]),a.useEffect(()=>{if(U!=="open")return;let we=null;const Oe=()=>{we&&(document.removeEventListener("click",we,!0),we=null)},ze=()=>{Oe(),we=lt=>{lt.stopPropagation(),lt.preventDefault(),Oe()},document.addEventListener("click",we,!0)},Ye=lt=>{const _e=lt<0?1:-1;if(Math.abs(lt)>Ag&&t.length>1){se(_e,!0);return}se(_e,!1)},ot=lt=>{if(lt.touches.length!==1||A.current)return;const _e=lt.touches[0];L.current=!0,h.current={x:_e.clientX,y:_e.clientY},E.current="none",b.current=0,R.current=!1},Je=lt=>{if(!h.current||lt.touches.length!==1||A.current)return;const _e=lt.touches[0],Xe=_e.clientX-h.current.x,Be=_e.clientY-h.current.y;if(E.current==="none"){if(Math.abs(Xe)<10&&Math.abs(Be)<10)return;if(Math.abs(Xe)>Math.abs(Be)){if(t.length<=1)return;E.current="horizontal"}else if(Be>0)E.current="vertical";else return}if(E.current==="horizontal"){R.current=!0,oe(!0),b.current=Xe;const pt=Xe<0?1:-1;q.current!==pt&&(q.current=pt,re(pt)),W.current=Xe,z(Xe),lt.preventDefault();return}E.current==="vertical"&&(R.current=!0,oe(!0),m.current=Be,S(Be),lt.preventDefault())},bt=()=>{if(!h.current)return;const lt=E.current,_e=R.current;if(_e&<==="horizontal")Ye(b.current),ze();else if(_e&<==="vertical")if(m.current>kg){const Be=window.innerHeight;m.current=Be,ye(!0),S(Be),V("closing")}else m.current=0,S(0),ze();else lt==="horizontal"&&Math.abs(b.current)>0&&(Ye(b.current),ze());h.current=null,E.current="none",b.current=0,R.current=!1,oe(!1)};return document.addEventListener("touchstart",ot,{passive:!0}),document.addEventListener("touchmove",Je,{passive:!1}),document.addEventListener("touchend",bt),document.addEventListener("touchcancel",bt),()=>{document.removeEventListener("touchstart",ot),document.removeEventListener("touchmove",Je),document.removeEventListener("touchend",bt),document.removeEventListener("touchcancel",bt),Oe()}},[U,t.length,se]),a.useEffect(()=>{const we=Oe=>{Oe.key==="Escape"&&(Oe.preventDefault(),Oe.stopPropagation(),U!=="closing"&&V("closing"))};return window.addEventListener("keydown",we,!0),()=>window.removeEventListener("keydown",we,!0)},[U]);const Ce=()=>{U!=="closing"&&V("closing")},N=U==="open",me=U==="closing",D=ie>0?Math.max(0,1-ie/500):1,T=ie>0?Math.max(.35,1-ie/500):1,B=P?p?P:Dg(P,Pe):null,Le=we=>{if(we.stopPropagation(),L.current){L.current=!1;return}if(t.length<=1)return;const Oe=B??we.currentTarget.getBoundingClientRect(),ze=we.clientY-Oe.top,Ye=Math.min(52,Oe.height*.2);if(!(ze>Oe.height-Ye)){if(we.clientX-Oe.left<Oe.width/2){ge(-1);return}ge(1)}},ne=we=>{if(t.length<=1)return;const Oe=B??we.currentTarget.getBoundingClientRect(),ze=we.clientX-Oe.left,Ye=we.clientY-Oe.top,ot=Math.min(52,Oe.height*.2);if(Ye>Oe.height-ot){we.currentTarget.style.cursor="default";return}we.currentTarget.style.cursor=ze<Oe.width/2?"w-resize":"e-resize"},_={position:"fixed",top:k==null?void 0:k.top,left:k==null?void 0:k.left,width:k==null?void 0:k.width,height:k==null?void 0:k.height,zIndex:9998},ke=p?"cover":"contain",Ie=M!==0||ie>0?`translate(${M}px, ${ie}px)`:void 0,Ze=F&&!I?"none":I?`transform ${vn}ms ${Hn}`:Q?`transform ${vn}ms ${Hn}, opacity ${vn}ms ${Hn}`:U==="opening"||me?`opacity ${vn}ms ${Hn}`:"none",Ke={..._,transform:Ie,opacity:ie>0?T:U==="opening"||me?0:1,transition:Ze,pointerEvents:"none"},at={position:"absolute",top:((B==null?void 0:B.top)??0)-((k==null?void 0:k.top)??0),left:((B==null?void 0:B.left)??0)-((k==null?void 0:k.left)??0),width:B==null?void 0:B.width,height:B==null?void 0:B.height,objectFit:ke,pointerEvents:Z&&N&&!Fe?"auto":"none",touchAction:Z&&N?"none":void 0},tt=(k==null?void 0:k.width)??0,Ve=$e?(n+ae+t.length)%t.length:null,fe=Ve!==null?t[Ve]:null,Ee={..._,transform:$e?`translateX(${ae*tt+M}px)`:void 0,opacity:1,transition:I?`transform ${vn}ms ${Hn}`:"none",pointerEvents:"none"},De={position:"absolute",top:((P==null?void 0:P.top)??0)-((k==null?void 0:k.top)??0),left:((P==null?void 0:P.left)??0)-((k==null?void 0:k.left)??0),width:P==null?void 0:P.width,height:P==null?void 0:P.height,objectFit:ke,pointerEvents:"none"},qe=B?{position:"fixed",top:B.top,height:B.height,width:B.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:v,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:U==="open"?"none":void 0},onClick:Ce,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:N?D:0,transition:F?"none":`opacity ${vn}ms ${Hn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:y,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:N?1:0,transition:`opacity ${vn}ms ${Hn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:N?1:0,transition:`opacity ${vn}ms ${Hn}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),P&&k&&fe&&r.jsx("div",{style:Ee,onTransitionEnd:xe,children:gi(fe)?r.jsx("video",{src:fe.url,muted:!0,playsInline:!0,preload:"auto",style:De},`neighbor-${Ve}-${fe.url}`):r.jsx("img",{src:fe.url,alt:fe.name,style:De},`neighbor-${Ve}-${fe.url}`)}),P&&k&&te&&r.jsx("div",{style:Ke,onTransitionEnd:xe,children:Z?r.jsx(jg,{src:te.url,phase:U,mediaRef:g,mediaStyle:at,onLoadedMetadata:We,onClick:Le,onMouseMove:ne},`${n}-${te.url}`):r.jsx("img",{ref:g,src:te.url,alt:te.name,onLoad:We,style:at},`${n}-${te.url}`)}),N&&qe&&t.length>1&&!Z&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...qe,left:B.left,cursor:"w-resize",pointerEvents:F?"none":"auto"},onClick:we=>{if(L.current){L.current=!1;return}we.stopPropagation(),ge(-1)}}),r.jsx("div",{style:{...qe,left:B.left+B.width/2,cursor:"e-resize",pointerEvents:F?"none":"auto"},onClick:we=>{if(L.current){L.current=!1;return}we.stopPropagation(),ge(1)}})]})]})}function Bg(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Vg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=$.useScopedStyles(),{type:p="a",gridLayout:v,textBoxWidth:y=100,verticalGap:g,entriesCount:h,lightbox:m,imageDisplay:b,imageCorners:E,lightboxImageDisplay:R,slider:L,sliderTiming:J,direction:W,transition:q,titleMarginTop:A,subtitleMarginTop:C,titleColor:O,subtitleColor:w,lightboxCounterColor:H,titleFontFamily:P,titleFontSettings:X,titleFontSize:k,titleLineHeight:Y,titleLetterSpacing:U,titleWordSpacing:V,titleTextAppearance:ie,subtitleFontFamily:S,subtitleFontSettings:M,subtitleFontSize:z,subtitleLineHeight:ae,subtitleLetterSpacing:re,subtitleWordSpacing:I,subtitleTextAppearance:ue,lightboxCounterFontFamily:F,lightboxCounterFontSettings:oe,lightboxCounterFontSize:Q,lightboxCounterLineHeight:ye,lightboxCounterLetterSpacing:Pe,lightboxCounterWordSpacing:pe,lightboxCounterTextAppearance:ce,showText:K="always",alignEntries:te="off",align:Z="top"}=e,Fe={fontSettings:{fontFamily:P,fontWeight:(X==null?void 0:X.fontWeight)??400,fontStyle:(X==null?void 0:X.fontStyle)??"normal"},fontSize:k??.01,lineHeight:Y,letterSpacing:U??0,wordSpacing:V??0,textAppearance:ie,color:O},We={...on(Ut(Fe,n))},de={fontSettings:{fontFamily:S,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:z??.01,lineHeight:ae,letterSpacing:re??0,wordSpacing:I??0,textAppearance:ue,color:w},be={...on(Ut(de,n))},G={fontSettings:{fontFamily:F,fontWeight:(oe==null?void 0:oe.fontWeight)??400,fontStyle:(oe==null?void 0:oe.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:ye,letterSpacing:Pe??0,wordSpacing:pe??0,textAppearance:ce,color:H},ge={...on(Ut(G,n)),...Kr(Q,ye,u,n)},xe=Ur(k,Y,`${u}-item-title`,`${u}-text-tight-leading`),Me=Ur(z,ae,`${u}-item-subtitle`,`${u}-text-tight-leading`),Ce=Kr(k,Y,u,n),N=Kr(z,ae,u,n),me=Ur(Q,ye,`${u}-lightbox-counter`,`${u}-text-tight-leading`),D=$.buildColorVars(u,{titleColor:O,subtitleColor:w,lightboxCounterColor:H},Gg,qg),Le=`${l&&l!=="default"?`${u}-state-${l}`:""}${K==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ne=h===0?1/0:h,_=(t??[]).slice(0,ne),ke=a.useMemo(()=>m==="on"?Hg(_):[],[_,m]),Ie=v.entryWidth??.2,Ze=(b==null?void 0:b.display)==="cover",Ke=(b==null?void 0:b.ratioValue)??"1:1",at=(b==null?void 0:b.reversed)??!1,[tt,Ve]=Ke.split(":").map(Number),De=`${at?Ve:tt} / ${at?tt:Ve}`,qe=v.columnsCount,we=$.scalingValue(Ie??0,n),Oe=we,ze=!Ze&&L!=="off",Ye=_.length%qe||qe,ot=Ye<qe&&_.length>0,Je=_.length-Ye,bt=ot?Math.floor((qe-Ye)/2)+1:1,lt=E?$.scalingValue(E,n):void 0,_e={width:Oe,...Ze?{aspectRatio:De,height:"auto",overflow:"hidden"}:{height:"auto"},...lt?{borderRadius:lt,overflow:"hidden"}:{}},Xe=`${u}-item-image-wrapper${ze?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Be=p==="d"||p==="e"||p==="f",pt=te==="on",mt=`calc(${$.scalingValue(Ie??0,n)} * (${y} / 100))`,gt=$.scalingValue(Ie*y/100,n),kt=Ze?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...lt?{borderRadius:lt}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...lt?{borderRadius:lt}:{}},[Xt,Yt]=a.useState(0),vt=a.useRef(null),wt=q==="fade"||W==="horizontal"?"ltr":W==="vertical"?"ttb":"ltr";a.useEffect(()=>{const dt=vt.current;if(!dt)return;const Te=new ResizeObserver(Ne=>{Yt(Math.round(Ne[0].contentRect.width))});return Te.observe(dt),()=>Te.disconnect()},[]);const Gt=(()=>{const dt={...D},Te=vt.current?getComputedStyle(vt.current).getPropertyValue("--cntrl-article-width").trim():"";return Te&&(dt["--cntrl-article-width"]=Te),dt})(),[Ft,xt]=a.useState(!1),[Nt,qt]=a.useState([]),[Zt,tn]=a.useState(0),Ct=m==="on"&&(!n||i),jt=(dt,Te)=>{n&&!i||m!=="off"&&(qt(dt),tn(Te),xt(!0))};a.useEffect(()=>{if(!Ft||m!=="on"||typeof document>"u")return;const dt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=dt}},[Ft,m]),a.useEffect(()=>{!n||i||xt(!1)},[n,i]);const cn=a.useMemo(()=>Rg(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:cn}}),m==="on"&&r.jsx(Ng,{mediaList:ke}),r.jsx("div",{style:D,children:r.jsx("div",{ref:vt,className:`${u}-wrapper ${u}-type-${p}${pt?` ${u}-align-entries`:""} ${u}-image-align-${Z} ${Le}`.trim(),style:{gridTemplateColumns:`repeat(${qe}, ${we})`,rowGap:pt?0:$.scalingValue(g??0,n),columnGap:$.scalingValue(v.horizontalGap??0,n),width:$.scalingValue(v.wrapperWidth??0,n),...pt?{[`--${u}-align-entries-row-gap`]:$.scalingValue(g??0,n)}:{}},children:_.map((dt,Te)=>{var At;const Ne=_s(dt.title),nt=_s(dt.subtitle),ut=(((At=dt.link)==null?void 0:At.length)??0)>0&&m==="off"?dt.link:void 0,ht=Math.floor(Te/qe)===Math.ceil(_.length/qe)-1,Rt=ot&&Te>=Je?`${bt+(Te-Je)}`:void 0,ct=Be?r.jsxs("div",{className:`${u}-item-text-block`,children:[Ne&&r.jsx("p",{className:xe,style:{width:mt,...We,...Ce},children:dt.title}),Ne&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(A??0,n),width:gt}}),nt&&r.jsx("p",{className:Me,style:{width:mt,...be,...N},children:dt.subtitle}),nt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(C??0,n),width:gt}})]}):null,Ot=pt?r.jsxs("div",{className:`${u}-item-title-row`,children:[!Be&&r.jsx("div",{"data-controls":o&&Ne?"titleMarginTop":void 0,className:o&&Ne?`${u}-control`:void 0,style:{height:Ne?$.scalingValue(A??0,n):0,width:gt}}),Ne&&r.jsx("p",{className:xe,style:{width:mt,...We,...Ce},children:dt.title}),Be&&Ne&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(A??0,n),width:gt}})]}):null,Pt=pt?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Be&&r.jsx("div",{"data-controls":o&&nt?"subtitleMarginTop":void 0,className:o&&nt?`${u}-control`:void 0,style:{height:nt?$.scalingValue(C??0,n):0,width:gt}}),nt&&r.jsx("p",{className:Me,style:{width:mt,...be,...N},children:dt.subtitle}),Be&&nt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(C??0,n),width:gt}})]}):null,Mt=ut?r.jsxs("a",{href:ut,target:"_blank",className:`${u}-item-text-link`,children:[Ot,Pt]}):r.jsxs(r.Fragment,{children:[Ot,Pt]}),zt=xc(dt.gallery),Bt=zt.filter(St=>St.lightboxMedia).map(St=>St.lightboxMedia),Wt=r.jsx("div",{className:Xe,style:_e,children:zt.length===0?null:L==="off"?(()=>{const{displayMedia:St,lightboxMedia:x}=zt[0],ve=x?Bt.findIndex(Re=>Re.url===x.url):-1;return r.jsx(Hs,{media:St,className:`${u}-item-${gi(St)?"video":"image"}`.trim(),style:kt,onMediaClick:Ct&&ve>=0?()=>jt(Bt,ve):void 0})})():r.jsxs(r.Fragment,{children:[ze&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:zt.map(({displayMedia:St})=>gi(St)?r.jsx("video",{src:St.url,muted:!0,playsInline:!0},`sizer-${St.url}`):r.jsx("img",{src:St.url,alt:""},`sizer-${St.url}`))}),r.jsx(Za,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:J*1e3,width:"100%",height:"100%",speed:Pg,type:q==="fade"?"fade":"loop",rewind:q==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:St=>{W!=="random"||q==="fade"||Mg(St)},children:zt.map(({displayMedia:St,lightboxMedia:x},ve)=>{const Re=x?Bt.findIndex(Ae=>Ae.url===x.url):-1;return r.jsx(Ja,{children:r.jsx(Hs,{media:St,className:`${u}-item-${gi(St)?"video":"image"}`.trim(),style:kt,onMediaClick:Ct&&Re>=0?()=>jt(Bt,Re):void 0})},ve)})},`${q}-${Ie}-${W}-${J}-${Xt}-${d}`)]})}),_t=Be?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&Ne?"titleMarginTop":void 0,className:o&&Ne?`${u}-control`:void 0,style:{height:Ne?$.scalingValue(A??0,n):0,width:gt}}),r.jsx("p",{className:xe,style:{width:mt,...We,...Ce},children:dt.title}),r.jsx("div",{"data-controls":o&&nt?"subtitleMarginTop":void 0,className:o&&nt?`${u}-control`:void 0,style:{height:nt?$.scalingValue(C??0,n):0,width:gt}}),r.jsx("p",{className:Me,style:{width:mt,...be,...N},children:dt.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Rt&&!pt?{gridColumn:Rt}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${pt&&ht?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(y??0)>100?`calc(${we} * (${y} / 100))`:we,...Rt&&pt?{gridColumn:Rt}:{}},children:pt?r.jsx(r.Fragment,{children:Be?r.jsxs(r.Fragment,{children:[Mt,r.jsx("a",{href:ut,target:"_blank",className:`${u}-item-image-link`,children:Wt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:ut,target:"_blank",className:`${u}-item-image-link`,children:Wt}),Mt]})}):ut?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:ut,target:"_blank",className:`${u}-item-image-link`,children:[ct,Wt]}),!Be&&r.jsx("a",{href:ut,target:"_blank",className:`${u}-item-text-link`,children:_t})]}):r.jsxs(r.Fragment,{children:[ct,Wt,_t]})})},Te)})})}),(!n||i)&&Ft&&typeof document<"u"&&m==="on"&&(()=>{const dt=(c?document.getElementById(c):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Gt,"data-selection":"none",children:r.jsx(zg,{prefix:u,items:Nt,index:Zt,imageDisplay:Bg(R),isEditor:n,onClose:()=>xt(!1),onPrev:()=>tn(Te=>(Te-1+Nt.length)%Nt.length),onNext:()=>tn(Te=>(Te+1)%Nt.length),counterClassName:me,counterStyle:ge})}),dt)})()]})}const Gg={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},qg=["hover","focus","filled","success","error"],Ug=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
4948
5029
|
import '@splidejs/react-splide/css/core';
|
|
4949
5030
|
import { CommonComponentProps } from '../props';
|
|
4950
5031
|
import {
|
|
@@ -6997,12 +7078,12 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
6997
7078
|
};
|
|
6998
7079
|
|
|
6999
7080
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
7000
|
-
`,Xr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Og=["titleColor","subtitleColor","lightboxCounterColor"],Dg={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:{...Xr.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:{...Xr.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:{...Xr.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:[...Og],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},jg={element:Wg,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:Dg,sourceCode:Hg},zg=50,Os=10,Qa="cntrl-lightbox-journal",Mr=Qa,Ta=`${Qa}-`,Pr=e=>`${Qa}-${e}`,es=e=>e===Mr||e.startsWith(Ta),Ds=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},js=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Ds(t.get(Pr(e)));if(i)return i}const n=Ds(t.get(Mr));if(n)return n;for(const[i]of t){if(!i.startsWith(Ta))continue;const o=i.slice(Ta.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},zs=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},bc=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{es(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Pr(t),String(e)):i.searchParams.set(Mr,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},Bg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Pr(e)||i===Mr:es(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)}},wc=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Pr(e)):[...t.keys()].some(n=>es(n))},Vg=(e,t)=>{if(wc(t)){if(e){window.history.back();return}Bg(t)}},Gg=20,qg=2,Yr=e=>`max(${e}, ${Gg}px)`,Oi=e=>((e==null?void 0:e.image)??[]).slice(0,qg),Sc=e=>e.reduce((t,n)=>t+Oi(n).length,0),Ug=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+Oi(s).length,1),i=Oi(e[t]).length;return{start:n,end:n+i-1}},Kg=(e,t)=>{const n=Sc(e),{start:i,end:o}=Ug(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},rr=(e,t)=>t==="B"?e.flatMap((n,i)=>Oi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Oi(n)})),Xg=(e,t,n,i)=>{var s;if(n==="B")return`${t+1} / ${e.length}`;const o=((s=e[t])==null?void 0:s.entryIndex)??0;return Kg(i,o)},Bs=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Yg=(e,t,n)=>e==="B"?t.length>1:Sc(n)>1,gn=.004,Bn=.004,Fi={title1Width:.13,title2Width:.13,title3Width:.14},Vn=(e,t,n,i,o)=>{const s=[];return t.title1&&s.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&s.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&s.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),s},Di=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},wo=(e,t)=>Di(e,t),sn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Gn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Di(e.length,n),effective:wo(e.length,n)}},$c=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),Cc=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),Kn=["title1","title2","title3","count"],Je=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,ts={title1:"1",title2:"2",title3:"3",count:"Count"},ns=e=>[Je(e,"fontFamily"),Je(e,"fontSettings"),{type:"row",items:[Je(e,"fontSize"),Je(e,"lineHeight"),Je(e,"letterSpacing"),Je(e,"wordSpacing")]},Je(e,"textAlign"),Je(e,"textAppearance")],Zg=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[ts[e],ns(e)]))}),Jg={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Qg={title1:.02,title2:.02,title3:.02,count:.017},ui=(e,t)=>{const n=i=>{const o=Je(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[Jg[t]]}},pi=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??Qg[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 Tc({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:w=0,title3MarginLeft:b=0,titleRowMarginBottom:h=0,titleHeaderLayout:g="desktop",contentMarginTop:m=0,iconMarginRight:x=0,closeIcon:M=null,closeIconMaxWidth:E=0,closeIconColor:R="#000000",closeIconHoverColor:Z="#cccccc"}=n,_=$.scalingValue(m,i),U=$.scalingValue(x,i),F=$.scalingValue(h,i),C=g==="mobile",z=pi("title1",ui(n,"title1"),i),y=pi("title2",ui(n,"title2"),i),N=pi("title3",ui(n,"title3"),i),I=a.useMemo(()=>({title1Width:d??Fi.title1Width,title2Width:c??Fi.title2Width,title3Width:u??Fi.title3Width}),[d,c,u]),J=a.useMemo(()=>({title2MarginLeft:w,title3MarginLeft:b}),[w,b]),k=a.useMemo(()=>Vn(e,t,z,y,N),[e,t,z,y,N]),X=a.useMemo(()=>k.map(L=>I[L.widthKey]),[k,I]),G=a.useMemo(()=>Di(k.length,X),[k.length,X]),V=a.useMemo(()=>wo(k.length,X),[k.length,X]),oe=a.useMemo(()=>k.filter(L=>L.prefix==="title1"),[k]),S=a.useMemo(()=>k.filter(L=>L.prefix==="title2"||L.prefix==="title3"),[k]),P=a.useMemo(()=>Gn(oe,I),[oe,I]),D=a.useMemo(()=>Gn(S,I),[S,I]),re=!!(t.title1||t.title2||t.title3),ae=M!==null;if(!(re||ae))return null;const ue=(p??0)>0||o,W=(L,B)=>{const Re=k.findIndex(A=>A.prefix===L.prefix);if(!C||B==="single-row")return{effectiveWidth:V[Re]??0,resolvedWidth:G[Re]??0,maxWidth:sn(Re,G)};if(B==="two-row-top"){const A=oe.findIndex(Fe=>Fe.prefix===L.prefix);return{effectiveWidth:P.effective[A]??0,resolvedWidth:P.resolved[A]??0,maxWidth:sn(A,P.resolved)}}const Q=S.findIndex(A=>A.prefix===L.prefix);return{effectiveWidth:D.effective[Q]??0,resolvedWidth:D.resolved[Q]??0,maxWidth:sn(Q,D.resolved)}},ie=(L,B,Re)=>{if(!C||Re==="single-row"){const Qe=L.findIndex(Be=>Be.prefix===B.prefix),Ke=L.map(Be=>I[Be.widthKey]),lt=Di(L.length,Ke);return{effectiveWidth:wo(L.length,Ke)[Qe]??0,resolvedWidth:lt[Qe]??0,maxWidth:sn(Qe,lt)}}if(Re==="two-row-top"){const Qe=L.filter(Be=>Be.prefix==="title1"),Ke=Qe.findIndex(Be=>Be.prefix===B.prefix),{resolved:lt,effective:tt}=Gn(Qe,I);return{effectiveWidth:tt[Ke]??0,resolvedWidth:lt[Ke]??0,maxWidth:sn(Ke,lt)}}const Q=L.filter(Qe=>Qe.prefix==="title2"||Qe.prefix==="title3"),A=Q.findIndex(Qe=>Qe.prefix===B.prefix),{resolved:Fe,effective:Me}=Gn(Q,I);return{effectiveWidth:Me[A]??0,resolvedWidth:Fe[A]??0,maxWidth:sn(A,Fe)}},ne=L=>Cc(k,G,J,L)+(C?0:p??0),ye=()=>C?0:p??0,Pe=L=>S.slice(0,L).reduce((B,Re,Q)=>B+(Re.marginLeftKey?J[Re.marginLeftKey]??0:0)+(D.resolved[Q]??0),0),me=L=>{const B=S[L];return Pe(L)+(B.marginLeftKey?J[B.marginLeftKey]??0:0)+(D.resolved[L]??0)},le=(L,B,Re)=>{const Q=L.marginLeftKey?J[L.marginLeftKey]??0:0,{effectiveWidth:A,resolvedWidth:Fe,maxWidth:Me}=Re??W(L,B),Qe=Math.max(Q,Bn),Ke=o&&B==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":L.prefix,style:{width:$.scalingValue(A,i),...Q>0?{marginLeft:$.scalingValue(Q,i)}:{}},children:[r.jsx("p",{className:L.className,style:L.style,children:L.text}),Ke&&L.marginLeftKey?r.jsx("div",{"data-controls":L.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe),style:{position:"absolute",top:0,left:$.scalingValue(-Q,i),width:$.scalingValue(Qe,i),height:"100%",pointerEvents:"auto"}}):null,Ke?r.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Me),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:$.scalingValue(-gn/2,i),width:$.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}}):null]},L.className)},K=(L="two-row")=>{const B=k.findIndex(A=>A.prefix==="title1"),Re=B>=0?G[B]:I.title1Width,Q=L==="two-row"&&o;return r.jsx("div",{...Q?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Re)}:{},style:{width:$.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...Q?{pointerEvents:"auto"}:{}}})},ee=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:z,"aria-hidden":"true",children:" "}),Y=L=>{const B=Vn(e,L,z,y,N);return r.jsx(r.Fragment,{children:B.map(Re=>le(Re,"single-row",ie(B,Re,"single-row")))})},We=L=>{const B=Vn(e,L,z,y,N),Re=B.find(Q=>Q.prefix==="title1");return Re?le(Re,"two-row-top",ie(B,Re,"two-row-top")):null},$e=(L,B=!1)=>{const Re=Vn(e,L,z,y,N),Q=Re.filter(Me=>Me.prefix==="title2"||Me.prefix==="title3"),A=o&&B;return Q.length>0||A||(h??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[Q.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:Q.map(Me=>le(Me,"two-row-bottom",ie(Re,Me,"two-row-bottom")))}),B&&o?r.jsxs(r.Fragment,{children:[xe(),Ee()]}):null]}):null,(h??0)>0||A?r.jsx("div",{"data-controls":A?"titleRowMarginBottom":void 0,"data-controls-axis":A?"y":void 0,"data-controls-reverse":A?"":void 0,className:A?`${e}-control`:void 0,style:{height:F,width:"100%",flexShrink:0,pointerEvents:A?"auto":"none"}}):null]}):null},Ae=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:$.scalingValue(E??0,i),height:$.scalingValue(E??0,i),marginRight:U,"--close-icon-hover-color":Z},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:L=>{L.stopPropagation(),l==null||l()},"aria-label":"Close",children:r.jsx(rn,{url:M??"",fill:R,hoverFill:i&&!s?R:Z,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:U,height:"100%",pointerEvents:"auto"}})]}),de=()=>ae?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:Ae()}):null,he=L=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:L})}),be=L=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[ae||re?ee():null,ue?K("two-row"):null,he(L),de()]}),q=(L,B=!1)=>r.jsxs(r.Fragment,{children:[be(We(L)),$e(L,B)]}),se=()=>{const L=C?-1:k.findIndex(Q=>Q.prefix==="title1"),B=!C&&(o||(p??0)>0)?(()=>{const Q=p??0,A=L>=0?G[L]:I.title1Width,Fe=Math.max(Q,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(A),style:{position:"absolute",top:0,left:0,width:$.scalingValue(Fe,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Re=k.flatMap((Q,A)=>{if(!Q.marginLeftKey)return[];const Fe=J[Q.marginLeftKey]??0,Me=$c(k,G,J,A)+ye(),Qe=Math.max(Fe,Bn);return r.jsx("div",{"data-controls":Q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(G[A]),style:{position:"absolute",top:0,left:$.scalingValue(Me,i),width:$.scalingValue(Qe,i),height:"100%",pointerEvents:"auto"}},Q.marginLeftKey)});return B?[B,...Re]:Re},ge=()=>k.map((L,B)=>{const Re=sn(B,G),A=ne(B)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Re),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:$.scalingValue(A,i),width:$.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${L.widthKey}-junction`)}),xe=()=>S.flatMap((L,B)=>{if(!L.marginLeftKey)return[];const Re=J[L.marginLeftKey]??0,Q=Pe(B),A=Math.max(Re,Bn),{resolvedWidth:Fe}=W(L,"two-row-bottom");return r.jsx("div",{"data-controls":L.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe),style:{position:"absolute",top:0,left:$.scalingValue(Q,i),width:$.scalingValue(A,i),height:"100%",pointerEvents:"auto"}},L.marginLeftKey)}),Ee=()=>S.map((L,B)=>{const{maxWidth:Re}=W(L,"two-row-bottom"),A=me(B)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Re),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:$.scalingValue(A,i),width:$.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${L.widthKey}-junction`)}),Ce=()=>!o||C?null:r.jsxs(r.Fragment,{children:[se(),ge()]}),H=!!(t.title2||t.title3||(h??0)>0||o),pe=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ae||re?ee():null,ue?K("single-row"):null,re?he(Y(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),de(),Ce()]}),O=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...H?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:H?void 0:{flex:"0 0 auto",height:"auto"},children:q(t,!0)}),Ce()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:_,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...C?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${C?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${C?` ${e}-text-bar-cell-stacked`:""}`,style:C?void 0:{flex:1,minWidth:0,width:"100%"},children:C?O():pe()})})})]})}function eh(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function th(e){return`
|
|
7081
|
+
`,Xr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Kg=["titleColor","subtitleColor","lightboxCounterColor"],Xg={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:{...Xr.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:{...Xr.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:{...Xr.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:[...Kg],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Yg={element:Vg,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:Xg,sourceCode:Ug},Zg=50,Os=10,Qa="cntrl-lightbox-journal",Mr=Qa,Ta=`${Qa}-`,Pr=e=>`${Qa}-${e}`,es=e=>e===Mr||e.startsWith(Ta),Ds=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},js=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Ds(t.get(Pr(e)));if(i)return i}const n=Ds(t.get(Mr));if(n)return n;for(const[i]of t){if(!i.startsWith(Ta))continue;const o=i.slice(Ta.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},zs=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},bc=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{es(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Pr(t),String(e)):i.searchParams.set(Mr,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},Jg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Pr(e)||i===Mr:es(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)}},wc=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Pr(e)):[...t.keys()].some(n=>es(n))},Qg=(e,t)=>{if(wc(t)){if(e){window.history.back();return}Jg(t)}},eh=20,th=2,Yr=e=>`max(${e}, ${eh}px)`,Oi=e=>((e==null?void 0:e.image)??[]).slice(0,th),Sc=e=>e.reduce((t,n)=>t+Oi(n).length,0),nh=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+Oi(s).length,1),i=Oi(e[t]).length;return{start:n,end:n+i-1}},ih=(e,t)=>{const n=Sc(e),{start:i,end:o}=nh(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},rr=(e,t)=>t==="B"?e.flatMap((n,i)=>Oi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Oi(n)})),oh=(e,t,n,i)=>{var s;if(n==="B")return`${t+1} / ${e.length}`;const o=((s=e[t])==null?void 0:s.entryIndex)??0;return ih(i,o)},Bs=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",rh=(e,t,n)=>e==="B"?t.length>1:Sc(n)>1,gn=.004,Bn=.004,Fi={title1Width:.13,title2Width:.13,title3Width:.14},Vn=(e,t,n,i,o)=>{const s=[];return t.title1&&s.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&s.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&s.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),s},Di=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},wo=(e,t)=>Di(e,t),sn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Gn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Di(e.length,n),effective:wo(e.length,n)}},$c=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),Cc=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),Kn=["title1","title2","title3","count"],et=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,ts={title1:"1",title2:"2",title3:"3",count:"Count"},ns=e=>[et(e,"fontFamily"),et(e,"fontSettings"),{type:"row",items:[et(e,"fontSize"),et(e,"lineHeight"),et(e,"letterSpacing"),et(e,"wordSpacing")]},et(e,"textAlign"),et(e,"textAppearance")],ah=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[ts[e],ns(e)]))}),sh={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},lh={title1:.02,title2:.02,title3:.02,count:.017},ui=(e,t)=>{const n=i=>{const o=et(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[sh[t]]}},pi=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??lh[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 Tc({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:v=0,title3MarginLeft:y=0,titleRowMarginBottom:g=0,titleHeaderLayout:h="desktop",contentMarginTop:m=0,iconMarginRight:b=0,closeIcon:E=null,closeIconMaxWidth:R=0,closeIconColor:L="#000000",closeIconHoverColor:J="#cccccc"}=n,W=$.scalingValue(m,i),q=$.scalingValue(b,i),A=$.scalingValue(g,i),C=h==="mobile",O=pi("title1",ui(n,"title1"),i),w=pi("title2",ui(n,"title2"),i),H=pi("title3",ui(n,"title3"),i),P=a.useMemo(()=>({title1Width:d??Fi.title1Width,title2Width:c??Fi.title2Width,title3Width:u??Fi.title3Width}),[d,c,u]),X=a.useMemo(()=>({title2MarginLeft:v,title3MarginLeft:y}),[v,y]),k=a.useMemo(()=>Vn(e,t,O,w,H),[e,t,O,w,H]),Y=a.useMemo(()=>k.map(T=>P[T.widthKey]),[k,P]),U=a.useMemo(()=>Di(k.length,Y),[k.length,Y]),V=a.useMemo(()=>wo(k.length,Y),[k.length,Y]),ie=a.useMemo(()=>k.filter(T=>T.prefix==="title1"),[k]),S=a.useMemo(()=>k.filter(T=>T.prefix==="title2"||T.prefix==="title3"),[k]),M=a.useMemo(()=>Gn(ie,P),[ie,P]),z=a.useMemo(()=>Gn(S,P),[S,P]),ae=!!(t.title1||t.title2||t.title3),re=E!==null;if(!(ae||re))return null;const ue=(p??0)>0||o,F=(T,B)=>{const Le=k.findIndex(_=>_.prefix===T.prefix);if(!C||B==="single-row")return{effectiveWidth:V[Le]??0,resolvedWidth:U[Le]??0,maxWidth:sn(Le,U)};if(B==="two-row-top"){const _=ie.findIndex(ke=>ke.prefix===T.prefix);return{effectiveWidth:M.effective[_]??0,resolvedWidth:M.resolved[_]??0,maxWidth:sn(_,M.resolved)}}const ne=S.findIndex(_=>_.prefix===T.prefix);return{effectiveWidth:z.effective[ne]??0,resolvedWidth:z.resolved[ne]??0,maxWidth:sn(ne,z.resolved)}},oe=(T,B,Le)=>{if(!C||Le==="single-row"){const Ze=T.findIndex(Ve=>Ve.prefix===B.prefix),Ke=T.map(Ve=>P[Ve.widthKey]),at=Di(T.length,Ke);return{effectiveWidth:wo(T.length,Ke)[Ze]??0,resolvedWidth:at[Ze]??0,maxWidth:sn(Ze,at)}}if(Le==="two-row-top"){const Ze=T.filter(Ve=>Ve.prefix==="title1"),Ke=Ze.findIndex(Ve=>Ve.prefix===B.prefix),{resolved:at,effective:tt}=Gn(Ze,P);return{effectiveWidth:tt[Ke]??0,resolvedWidth:at[Ke]??0,maxWidth:sn(Ke,at)}}const ne=T.filter(Ze=>Ze.prefix==="title2"||Ze.prefix==="title3"),_=ne.findIndex(Ze=>Ze.prefix===B.prefix),{resolved:ke,effective:Ie}=Gn(ne,P);return{effectiveWidth:Ie[_]??0,resolvedWidth:ke[_]??0,maxWidth:sn(_,ke)}},Q=T=>Cc(k,U,X,T)+(C?0:p??0),ye=()=>C?0:p??0,Pe=T=>S.slice(0,T).reduce((B,Le,ne)=>B+(Le.marginLeftKey?X[Le.marginLeftKey]??0:0)+(z.resolved[ne]??0),0),pe=T=>{const B=S[T];return Pe(T)+(B.marginLeftKey?X[B.marginLeftKey]??0:0)+(z.resolved[T]??0)},ce=(T,B,Le)=>{const ne=T.marginLeftKey?X[T.marginLeftKey]??0:0,{effectiveWidth:_,resolvedWidth:ke,maxWidth:Ie}=Le??F(T,B),Ze=Math.max(ne,Bn),Ke=o&&B==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":T.prefix,style:{width:$.scalingValue(_,i),...ne>0?{marginLeft:$.scalingValue(ne,i)}:{}},children:[r.jsx("p",{className:T.className,style:T.style,children:T.text}),Ke&&T.marginLeftKey?r.jsx("div",{"data-controls":T.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:$.scalingValue(-ne,i),width:$.scalingValue(Ze,i),height:"100%",pointerEvents:"auto"}}):null,Ke?r.jsx("div",{"data-controls":T.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ie),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:$.scalingValue(-gn/2,i),width:$.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}}):null]},T.className)},K=(T="two-row")=>{const B=k.findIndex(_=>_.prefix==="title1"),Le=B>=0?U[B]:P.title1Width,ne=T==="two-row"&&o;return r.jsx("div",{...ne?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Le)}:{},style:{width:$.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...ne?{pointerEvents:"auto"}:{}}})},te=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:O,"aria-hidden":"true",children:" "}),Z=T=>{const B=Vn(e,T,O,w,H);return r.jsx(r.Fragment,{children:B.map(Le=>ce(Le,"single-row",oe(B,Le,"single-row")))})},Fe=T=>{const B=Vn(e,T,O,w,H),Le=B.find(ne=>ne.prefix==="title1");return Le?ce(Le,"two-row-top",oe(B,Le,"two-row-top")):null},$e=(T,B=!1)=>{const Le=Vn(e,T,O,w,H),ne=Le.filter(Ie=>Ie.prefix==="title2"||Ie.prefix==="title3"),_=o&&B;return ne.length>0||_||(g??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ne.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:ne.map(Ie=>ce(Ie,"two-row-bottom",oe(Le,Ie,"two-row-bottom")))}),B&&o?r.jsxs(r.Fragment,{children:[xe(),Me()]}):null]}):null,(g??0)>0||_?r.jsx("div",{"data-controls":_?"titleRowMarginBottom":void 0,"data-controls-axis":_?"y":void 0,"data-controls-reverse":_?"":void 0,className:_?`${e}-control`:void 0,style:{height:A,width:"100%",flexShrink:0,pointerEvents:_?"auto":"none"}}):null]}):null},We=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:$.scalingValue(R??0,i),height:$.scalingValue(R??0,i),marginRight:q,"--close-icon-hover-color":J},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:T=>{T.stopPropagation(),l==null||l()},"aria-label":"Close",children:r.jsx(rn,{url:E??"",fill:L,hoverFill:i&&!s?L:J,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:q,height:"100%",pointerEvents:"auto"}})]}),de=()=>re?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:We()}):null,he=T=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:T})}),be=T=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[re||ae?te():null,ue?K("two-row"):null,he(T),de()]}),G=(T,B=!1)=>r.jsxs(r.Fragment,{children:[be(Fe(T)),$e(T,B)]}),se=()=>{const T=C?-1:k.findIndex(ne=>ne.prefix==="title1"),B=!C&&(o||(p??0)>0)?(()=>{const ne=p??0,_=T>=0?U[T]:P.title1Width,ke=Math.max(ne,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(_),style:{position:"absolute",top:0,left:0,width:$.scalingValue(ke,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Le=k.flatMap((ne,_)=>{if(!ne.marginLeftKey)return[];const ke=X[ne.marginLeftKey]??0,Ie=$c(k,U,X,_)+ye(),Ze=Math.max(ke,Bn);return r.jsx("div",{"data-controls":ne.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(U[_]),style:{position:"absolute",top:0,left:$.scalingValue(Ie,i),width:$.scalingValue(Ze,i),height:"100%",pointerEvents:"auto"}},ne.marginLeftKey)});return B?[B,...Le]:Le},ge=()=>k.map((T,B)=>{const Le=sn(B,U),_=Q(B)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":T.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Le),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:$.scalingValue(_,i),width:$.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${T.widthKey}-junction`)}),xe=()=>S.flatMap((T,B)=>{if(!T.marginLeftKey)return[];const Le=X[T.marginLeftKey]??0,ne=Pe(B),_=Math.max(Le,Bn),{resolvedWidth:ke}=F(T,"two-row-bottom");return r.jsx("div",{"data-controls":T.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:$.scalingValue(ne,i),width:$.scalingValue(_,i),height:"100%",pointerEvents:"auto"}},T.marginLeftKey)}),Me=()=>S.map((T,B)=>{const{maxWidth:Le}=F(T,"two-row-bottom"),_=pe(B)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":T.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Le),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:$.scalingValue(_,i),width:$.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${T.widthKey}-junction`)}),Ce=()=>!o||C?null:r.jsxs(r.Fragment,{children:[se(),ge()]}),N=!!(t.title2||t.title3||(g??0)>0||o),me=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[re||ae?te():null,ue?K("single-row"):null,ae?he(Z(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),de(),Ce()]}),D=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...N?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:N?void 0:{flex:"0 0 auto",height:"auto"},children:G(t,!0)}),Ce()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:W,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...C?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${C?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${C?` ${e}-text-bar-cell-stacked`:""}`,style:C?void 0:{flex:1,minWidth:0,width:"100%"},children:C?D():me()})})})]})}function ch(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function dh(e){return`
|
|
7001
7082
|
.${e}-wrapper {
|
|
7002
7083
|
display: grid;
|
|
7003
7084
|
align-items: start;
|
|
7004
7085
|
justify-content: center;
|
|
7005
|
-
min-height: ${
|
|
7086
|
+
min-height: ${ch(48)};
|
|
7006
7087
|
}
|
|
7007
7088
|
.${e}-item {
|
|
7008
7089
|
display: flex;
|
|
@@ -7317,7 +7398,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
7317
7398
|
pointer-events: auto;
|
|
7318
7399
|
flex-shrink: 0;
|
|
7319
7400
|
}
|
|
7320
|
-
`}const Vs={url:"",name:"",objectFit:"cover"},$n=500,to=650,un="cubic-bezier(0.22, 1, 0.36, 1)",nh=72,ih=50,oh=1e4,rh=650,ah=500;function sh(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Lc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=mr(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 lh(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Lc(i,n):null}function ch(e){return e.reduce((t,n,i)=>{const o=is(n.gallery),l=os(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 ao(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 Gs(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ao(e,i,n)}const dh=.03;function Rc(e){return e.width*dh}const Zr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Vo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function qs(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function uh(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function La(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function ph(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:La(e,t.width,t.height)}function mh(e,t){if(Ji(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 gh(e){const t=new Set,n=[];for(const i of e){const o=is(i.gallery),s=os(o);for(const l of s)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 hh({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Ji(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function ji(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Rc(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function gr(e,t,n){const i=ji(e,t,n);return{...i,left:2*i.left-e.left}}function fh(e,t,n){const{left:i,width:o}=n,s=Rc(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function Ic(e,t,n,i){const o=ji(e,"left",i),s=ji(e,"right",i),l=gr(e,"left",i),d=gr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function yh(e,t,n,i){const{start:o,end:s}=Ic(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function vh(e,t,n){const i=ji(e,t,n),o=gr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Ec(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 is(e){if(!e)return;if(Ec(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??Vs,i??o??Vs]}]}function xh(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function bh(e){const[t]=e.media;return t!=null&&t.url?t:null}function os(e){if(!Array.isArray(e)||e.length===0)return[];if(Ec(e)){const t=[];for(const n of e){const i=xh(n);if(!i)continue;const o=bh(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 Ji(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function wh({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Ji(e)?r.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):r.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Sh({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Go({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Ji(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function $h({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:w,sourceRect:b,resolveCloseSourceRect:h,onClose:g,onPrev:m,onNext:x}){const M=a.useRef(null),E=a.useRef(null),R=a.useRef(null),Z=a.useRef(new Map),[_,U]=a.useState(0),F=a.useRef(null),C=a.useRef(0),z=a.useRef(0),y=a.useRef("none"),N=a.useRef(!1),I=a.useRef(!1),J=a.useRef(!1),k=a.useRef(null),X=a.useRef(null),G=a.useRef(null),V=a.useRef(()=>{}),oe=a.useRef(null),S=a.useRef(null),P=a.useRef(null),D=a.useRef(!1),[re,ae]=a.useState(null),[T,ue]=a.useState(Zr),[W,ie]=a.useState(0),[ne,ye]=a.useState("opening"),[Pe,me]=a.useState(0),[le,K]=a.useState(0),[ee,Y]=a.useState(!1),[We,$e]=a.useState(null),[Ae,de]=a.useState(null),[he,be]=a.useState(null),[q,se]=a.useState(!1),[ge,xe]=a.useState(null),[Ee,Ce]=a.useState(!1),H=a.useRef(!1),[pe,O]=a.useState(!1),[L,B]=a.useState(!1),Re=a.useRef(n),Q=a.useRef(void 0),A=t[n],Fe=A?Ji(A):!1,Me=le!==0||ee,Qe=!l&&(!s||!!d),Ke=c&&!l,lt=u.length>1,tt=a.useCallback((v,ve)=>t.length<=1?null:t[(v+ve+t.length)%t.length]??null,[t]),Be=lt?ao(u,p,-1):tt(n,-1),fe=lt?ao(u,p,1):tt(n,1),Ie=We===-1&&Me?lt&&Ae!==null?ao(u,Ae,-1):he!==null?tt(he,-1):null:null,De=We===1&&Me?lt&&Ae!==null?ao(u,Ae,1):he!==null?tt(he,1):null:null,qe=Ie&&Ie.url!==(Be==null?void 0:Be.url)?Ie:null,Se=De&&De.url!==(fe==null?void 0:fe.url)?De:null,_e=Be&&Ke?(()=>{const v=lt?Gs(u,p,-1):t.length>2?tt((n-1+t.length)%t.length,-1):null;return v&&v.url!==Be.url?v:null})():null,Ve=fe&&Ke?(()=>{const v=lt?Gs(u,p,1):t.length>2?tt((n+1)%t.length,1):null;return v&&v.url!==fe.url?v:null})():null,Xe=qe??_e,at=Se??Ve,et=a.useCallback((v,ve,Le)=>{if(!v||!ve||!Le)return;const ke=Z.current,it=ke.get(v);(it==null?void 0:it.width)===ve&&(it==null?void 0:it.height)===Le||(ke.set(v,{width:ve,height:Le}),U(Et=>Et+1))},[]),$t=a.useCallback(v=>{if(!(v!=null&&v.url))return null;const ve=Z.current.get(v.url);return ph(E.current,ve)},[_,W]),ut=a.useCallback(()=>{if(!A)return;const v=$t(A);if(v){ae(v);return}const ve=E.current;ve&&ae(qs(ve))},[A,$t]),He=a.useCallback(v=>{if(lt){const ve=u.length;de((p+v+ve)%ve),be(null);return}t.length>1&&(be((n+v+t.length)%t.length),de(null))},[lt,u.length,p,t.length,n]),Ye=a.useCallback(v=>{J.current=v,Y(v)},[]),ze=a.useCallback(()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)},[]),pt=a.useCallback(()=>{ze(),k.current=window.setTimeout(()=>{ze(),Ye(!1)},to+32)},[ze,Ye]),mt=a.useCallback(()=>{const v=M.current;if(!v){ue({left:0,top:0,width:typeof window<"u"?window.innerWidth:Zr.width,height:typeof window<"u"?window.innerHeight:Zr.height});return}const ve=v.getBoundingClientRect();ue({left:ve.left,top:ve.top,width:ve.width,height:ve.height})},[]),gt=a.useCallback((v,ve)=>{if(Me){if(pe&&!ee)return`translate(${le}px, 0px)`;if(ee&&We!==null){const Le=$t(v);if(!Le)return;const{x:ke,y:it}=yh(Le,ve,We,T);return`translate(${ke}px, ${it}px)`}if(ee)return"translate(0px, 0px)"}},[Me,pe,ee,le,We,T,$t]),kt=a.useCallback(()=>{const v=X.current;X.current=null,ze(),Ye(!1),$e(null),de(null),be(null),K(0),O(!1),N.current=!1,z.current=0,y.current="none",v===-1?m():v===1&&x()},[ze,Ye,m,x]),Xt=a.useCallback(()=>{ze(),k.current=window.setTimeout(()=>{X.current!==null&&kt()},to+32)},[ze,kt]),Yt=a.useCallback(()=>{ze(),X.current=null,Ye(!1),$e(null),de(null),be(null),K(0),O(!1),N.current=!1,z.current=0,y.current="none"},[ze,Ye]),vt=a.useCallback(v=>{if(!(!Ke||!re)){if(J.current){if(X.current===v){G.current=v,kt();return}Yt()}ze(),He(v),X.current=v,$e(v),Ye(!0),Xt()}},[Ke,re,kt,Yt,ze,He,Ye,Xt]);V.current=vt;const bt=a.useCallback(()=>{oe.current=null,D.current=!1,S.current!==null&&(window.clearInterval(S.current),S.current=null),P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),Gt=a.useCallback(v=>{S.current!==null&&window.clearInterval(S.current);const ve=D.current?ah:rh;S.current=window.setInterval(()=>{V.current(v)},ve)},[]),Ft=a.useCallback(v=>{oe.current!==v&&(bt(),oe.current=v,D.current=!1,V.current(v),Gt(v),P.current=window.setTimeout(()=>{P.current=null,oe.current===v&&(D.current=!0,Gt(v))},oh))},[bt,Gt]),xt=a.useCallback(()=>{const v=E.current;if(!v)return;const ve=A==null?void 0:A.url,Le=ve?Z.current.get(ve):void 0;if(Le!=null&&Le.width&&(Le!=null&&Le.height)){ae(La(v,Le.width,Le.height));return}const ke=R.current;if(ke&&ve&&(ke.src===ve||ke.currentSrc===ve)){const{width:Et,height:Ze}=uh(ke);if(Et&&Ze){et(ve,Et,Ze),ae(La(v,Et,Ze));return}}const it=qs(v);!it.width||!it.height||ae(it)},[A==null?void 0:A.url,et]),Ht=a.useCallback(v=>{if(R.current=v,!!v){if(v instanceof HTMLVideoElement){v.readyState>=1&&v.videoWidth>0&&xt();return}v.complete&&v.naturalWidth>0&&xt()}},[xt]),qt=a.useCallback(()=>{mt(),xt(),ie(v=>v+1)},[mt,xt]);a.useEffect(()=>{qt();const v=E.current,ve=M.current,Le=new ResizeObserver(()=>qt());return v&&Le.observe(v),ve&&Le.observe(ve),window.addEventListener("resize",qt),()=>{Le.disconnect(),window.removeEventListener("resize",qt)}},[qt,n,w]),a.useLayoutEffect(()=>{if(!A)return;const v=R.current;if(v){if(v instanceof HTMLImageElement&&v.complete&&v.naturalWidth>0){xt();return}v instanceof HTMLVideoElement&&v.readyState>=1&&v.videoWidth>0&&xt()}},[A==null?void 0:A.url,n,xt]),a.useEffect(()=>{ut()},[ut,_]),a.useEffect(()=>{const v=new Set,ve=[],Le=ke=>{!(ke!=null&&ke.url)||v.has(ke.url)||(v.add(ke.url),ve.push(ke))};t.forEach(Le),u.forEach(ke=>ke.items.forEach(Le)),ve.forEach(ke=>{Z.current.has(ke.url)||mh(ke,et)})},[t,u,et]),a.useEffect(()=>{if(ne!=="opening"||!re)return;if(!b){ye("open");return}se(!1);const v=requestAnimationFrame(()=>{requestAnimationFrame(()=>{se(!0),ye("open")})});return()=>cancelAnimationFrame(v)},[ne,re,b]),a.useEffect(()=>{if(ne!=="closing")return;const v=setTimeout(()=>g(),$n);return()=>clearTimeout(v)},[ne,g]),a.useEffect(()=>()=>{ze()},[ze]),a.useLayoutEffect(()=>{Re.current===n&&Q.current===(A==null?void 0:A.url)||(ze(),X.current=null,$e(null),de(null),be(null),me(0),K(0),Ye(!1),B(!1),O(!1),C.current=0,z.current=0,y.current="none",N.current=!1,F.current=null,I.current=!1,R.current=null,ut(),Re.current=n,Q.current=A==null?void 0:A.url)},[n,A==null?void 0:A.url,Ye,ze,ut]),a.useLayoutEffect(()=>{const v=G.current;v!==null&&(G.current=null,requestAnimationFrame(()=>{V.current(v)}))},[n,p,A==null?void 0:A.url]),a.useLayoutEffect(()=>{if(ne==="opening"){H.current=!1,Ce(!1);return}if(ne!=="open"||H.current)return;if(!Be&&!fe){H.current=!0;return}Ce(!1);const v=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),H.current=!0})});return()=>cancelAnimationFrame(v)},[ne,Be==null?void 0:Be.url,fe==null?void 0:fe.url]),a.useEffect(()=>{if(ne!=="open")return;const v=()=>{const Ze=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Ze,!0)};document.addEventListener("click",Ze,!0)},ve=Ze=>{const ft=Ze<0?1:-1;ze(),He(ft),X.current=ft,$e(ft),Ye(!0),Xt()},Le=Ze=>{if(Math.abs(Ze)>ih&&Ke){ve(Ze);return}X.current=null,$e(null),de(null),be(null),Ye(!0),K(0),pt()},ke=Ze=>{if(Ze.touches.length!==1||J.current)return;const ft=Ze.touches[0];I.current=!0,F.current={x:ft.clientX,y:ft.clientY},y.current="none",z.current=0,N.current=!1},it=Ze=>{if(!F.current||Ze.touches.length!==1||J.current)return;const ft=Ze.touches[0],Nt=ft.clientX-F.current.x,Tt=ft.clientY-F.current.y;if(y.current==="none"){if(Math.abs(Nt)<10&&Math.abs(Tt)<10)return;if(Math.abs(Nt)>Math.abs(Tt)){if(!Ke)return;y.current="horizontal"}else if(Tt>0){if(!Qe)return;y.current="vertical"}else return}if(y.current==="horizontal"){N.current=!0,O(!0),z.current=Nt,K(Nt),Ze.preventDefault();return}y.current==="vertical"&&(N.current=!0,O(!0),C.current=Tt,me(Tt),Ze.preventDefault())},Et=()=>{if(!F.current)return;const Ze=y.current,ft=N.current;if(ft&&Ze==="horizontal")Le(z.current),v();else if(ft&&Ze==="vertical"){const Nt=C.current;if(Qe&&Nt>nh){const Tt=window.innerHeight;C.current=Tt,B(!0),me(Tt),ye("closing")}else C.current=0,me(0);v()}else Ze==="horizontal"&&Math.abs(z.current)>0&&(Le(z.current),v());F.current=null,y.current="none",z.current=0,N.current=!1,O(!1)};return document.addEventListener("touchstart",ke,{passive:!0}),document.addEventListener("touchmove",it,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",ke),document.removeEventListener("touchmove",it),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[ne,Ke,Ye,pt,ze,Qe,Xt,He]);const Zt=a.useCallback(()=>{const v=(h==null?void 0:h())??b??null;v&&re&&(xe(v),se(!0)),ye("closing")},[h,b,re]);a.useEffect(()=>{const v=ke=>{if(ke.key==="Escape"){if(s&&d||ne==="closing")return;bt(),Zt();return}if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight"||ne!=="open"||!Ke)return;ke.preventDefault();const it=ke.key==="ArrowLeft"?-1:1;ke.repeat&&oe.current===it||Ft(it)},ve=ke=>{if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight")return;const it=ke.key==="ArrowLeft"?-1:1;oe.current===it&&bt()},Le=()=>{bt()};return window.addEventListener("keydown",v),window.addEventListener("keyup",ve),window.addEventListener("blur",Le),()=>{window.removeEventListener("keydown",v),window.removeEventListener("keyup",ve),window.removeEventListener("blur",Le),bt()}},[ne,s,d,Zt,Ke,Ft,bt]),a.useEffect(()=>{ne!=="open"&&bt()},[ne,bt]);const tn=()=>{ne==="closing"||l||Zt()},Ct=ne==="open",jt=ne==="closing",cn=Pe>0?Math.max(0,1-Pe/500):1,ct=Pe>0?Math.max(.35,1-Pe/500):1,Te=a.useCallback(v=>{if(!(v.propertyName!=="transform"||!J.current)){if(X.current!==null){kt();return}ze(),Ye(!1)}},[ze,Ye,kt]),Oe=ne==="closing"?ge??b:b,nt=Oe&&re&&(ne==="opening"||jt)?sh(Oe,re):void 0,dt=Me&&A?gt(A,"center"):Pe>0?`translateY(${Pe}px)`:nt,ht=re?Vo(re,T):null,Rt=!!(Oe&&re),st=Rt&&(ne==="closing"||ne==="open"&&q),Ot={position:"absolute",top:ht==null?void 0:ht.top,left:ht==null?void 0:ht.left,width:ht==null?void 0:ht.width,height:ht==null?void 0:ht.height,objectFit:"contain",transformOrigin:"top left",transform:dt,opacity:Pe>0?ct:Rt?1:ne==="opening"||jt?0:1,transition:pe&&!ee?"none":ee?`transform ${to}ms ${un}`:L?`transform ${$n}ms ${un}, opacity ${$n}ms ${un}`:st?`transform ${$n}ms ${un}`:ne==="opening"||jt?`opacity ${$n}ms ${un}`:"none",pointerEvents:Fe&&Ct&&!Me?"auto":"none",touchAction:Fe&&Ct?"none":void 0,zIndex:1,overflow:Fe?"hidden":void 0},Pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Me?"auto":"none"},Mt=(v,ve,Le="adjacent")=>{const ke=$t(v);if(!ke)return{display:"none"};const it=Le==="far"?ve==="left"?"far-left":"far-right":ve==="left"?"left-adjacent":"right-adjacent",{start:Et}=We!==null?Ic(ke,it,We,T):{start:Le==="far"?gr(ke,ve,T):ji(ke,ve,T)},Ze=Vo(Et,T),ft=gt(v,it),Nt=!Me&&Le==="adjacent"&&Ct&&!Ee?vh(ke,ve,T):null,Tt=Le==="far"&&Me&&We===(ve==="left"?-1:1),nn=pe&&!ee?!1:ee,dn=Le==="adjacent"&&Ct&&Ee&&!Me;return{position:"absolute",top:Ze.top,left:Ze.left,width:Ze.width,height:Ze.height,objectFit:"contain",transform:ft??(Nt?`translate(${Nt.x}px, ${Nt.y}px)`:void 0),opacity:Le==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Le==="far"?`transform ${to}ms ${un}`:`transform ${to}ms ${un}, opacity ${$n}ms ${un}`:dn?`transform ${$n}ms ${un}`:ne==="opening"||jt?`opacity ${$n}ms ${un}`:"none",pointerEvents:"none",zIndex:1}},zt=(v,ve)=>{const Le=$t(v);return Le?fh(ji(Le,ve,T),ve,T):null},Bt=v=>ve=>{if(!l){if(I.current){I.current=!1;return}ve.stopPropagation(),vt(v)}},Wt=Be?zt(Be,"left"):null,_t=fe?zt(fe,"right"):null,At=Wt?Vo(Wt,T):null,wt=_t?Vo(_t,T):null;return r.jsxs("div",{ref:M,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ne==="open"?"none":void 0},onClick:tn,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?cn:0,transition:pe?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:E,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:pe?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"},children:r.jsx(Tc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Xe&&r.jsx(Go,{media:Xe,style:Mt(Xe,"left","far"),onMeasure:et,onTransitionEnd:Te},`far-prev-${Xe.url}`),Ct&&Be&&r.jsxs(r.Fragment,{children:[r.jsx(Go,{media:Be,style:Mt(Be,"left"),onMeasure:et,onTransitionEnd:Te},`prev-${Be.url}`),At&&r.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Bt(-1)})]}),Ct&&fe&&r.jsxs(r.Fragment,{children:[r.jsx(Go,{media:fe,style:Mt(fe,"right"),onMeasure:et,onTransitionEnd:Te},`next-${fe.url}`),wt&&r.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Bt(1)})]}),Ct&&at&&r.jsx(Go,{media:at,style:Mt(at,"right","far"),onMeasure:et,onTransitionEnd:Te},`far-next-${at.url}`),re&&A&&(Fe?r.jsx(Sh,{src:A.url,phase:ne,onMediaElement:Ht,wrapperStyle:Ot,videoStyle:Pt,onLoadedMetadata:xt,onTransitionEnd:Te},`${n}-${A.url}`):r.jsx("img",{ref:Ht,src:A.url,alt:A.name,onLoad:xt,onTransitionEnd:Te,style:Ot},`${n}-${A.url}`))]})}function Ch({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=$.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:w}=e,b=(w==null?void 0:w.display)==="cover",h=(w==null?void 0:w.ratioValue)??"1:1",g=(w==null?void 0:w.reversed)??!1,[m,x]=h.split(":").map(Number),R=`${g?x:m} / ${g?m:x}`,Z=c.entryWidth??.2,_=c.columnsCount,U=$.scalingValue(Z,n),F=$.scalingValue(c.horizontalGap??0,n),C=U,z=U,y={width:C,...b?{aspectRatio:R,height:"auto",overflow:"hidden"}:{height:"auto"}},N=b?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},I=a.useRef(null),[J,k]=a.useState(!1),[X,G]=a.useState([]),[V,oe]=a.useState(0),[S,P]=a.useState(0),[D,re]=a.useState(null),[ae,T]=a.useState({title1:"",title2:"",title3:""}),ue=(()=>{const he={},be=I.current?getComputedStyle(I.current).getPropertyValue("--cntrl-article-width").trim():"";return be&&(he["--cntrl-article-width"]=be),he})(),W=!n||i||o,ie=a.useMemo(()=>th(d),[d]),ne=t??[],ye=ne.length%_||_,Pe=ye<_&&ne.length>0,me=ne.length-ye,le=Pe?Math.floor((_-ye)/2)+1:1,K=a.useMemo(()=>ch(ne),[ne]),ee=a.useMemo(()=>gh(ne),[ne]),Y=(he,be,q)=>{if(n&&!o&&!i)return;const se=K.findIndex(xe=>xe.gridIndex===he);if(se<0)return;const ge=K[se];P(se),G(ge.items),oe(be),T(ge.entry),re(q??null),k(!0)},We=a.useCallback(()=>{k(!1),re(null)},[]),$e=a.useCallback(()=>{const he=K[S];return!he||!I.current?D:lh(I.current,he.gridIndex,b?"cover":"contain")??D},[K,S,D,b]),Ae=a.useCallback(he=>{if(K.length>1){const be=K.length,q=(S+he+be)%be,se=K[q],ge=Math.min(V,se.items.length-1);P(q),G(se.items),oe(ge),T(se.entry);return}oe(be=>(be+he+X.length)%X.length)},[K,S,V,X.length]),de=K.length>1||X.length>1;return a.useEffect(()=>{if(!J||typeof document>"u")return;const he=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=he}},[J]),a.useEffect(()=>{!n||o||i||k(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ie}}),r.jsx(hh,{mediaList:ee}),r.jsx("div",{ref:I,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${_}, ${U})`,rowGap:0,columnGap:F,width:$.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:$.scalingValue(u??0,n)},children:ne.map((he,be)=>{const q=is(he.gallery),se=os(q),ge=se.filter(O=>O.lightboxMedia).map(O=>O.lightboxMedia),xe=Math.floor(be/_)===Math.ceil(ne.length/_)-1,Ee=Pe&&be>=me?`${le+(be-me)}`:void 0,Ce=se[0],H=Ce!=null&&Ce.lightboxMedia?ge.findIndex(O=>O.url===Ce.lightboxMedia.url):-1,pe=r.jsx("div",{className:`${d}-item-image-wrapper`,style:y,children:se.length>0&&r.jsx(wh,{media:Ce.displayMedia,gridIndex:be,className:`${d}-item-${Ji(Ce.displayMedia)?"video":"image"}`.trim(),style:N,onMediaClick:W&&H>=0?O=>Y(be,H,Lc(O.currentTarget,b?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,xe?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:U,...Ee?{gridColumn:Ee}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:z}})}),r.jsx("a",{className:`${d}-item-image-link`,children:pe}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:z}})})]})},be)})}),J&&typeof document<"u"&&(()=>{const he=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:ue,"data-selection":"none",children:r.jsx($h,{prefix:d,items:X,index:V,entry:ae,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:de,lightboxEntries:K,entryIdx:S,layoutId:s,sourceRect:D,resolveCloseSourceRect:$e,onClose:We,onPrev:()=>Ae(-1),onNext:()=>Ae(1)})}),he)})()]})}const Th=`import { CommonComponentProps } from '../props';
|
|
7401
|
+
`}const Vs={url:"",name:"",objectFit:"cover"},$n=500,to=650,un="cubic-bezier(0.22, 1, 0.36, 1)",uh=72,ph=50,mh=1e4,gh=650,hh=500;function fh(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Lc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=mr(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 yh(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Lc(i,n):null}function vh(e){return e.reduce((t,n,i)=>{const o=is(n.gallery),l=os(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 ao(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 Gs(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ao(e,i,n)}const xh=.03;function Rc(e){return e.width*xh}const Zr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Vo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function qs(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function bh(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function La(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function wh(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:La(e,t.width,t.height)}function Sh(e,t){if(Ji(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 $h(e){const t=new Set,n=[];for(const i of e){const o=is(i.gallery),s=os(o);for(const l of s)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 Ch({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Ji(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function ji(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Rc(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function gr(e,t,n){const i=ji(e,t,n);return{...i,left:2*i.left-e.left}}function Th(e,t,n){const{left:i,width:o}=n,s=Rc(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function Ic(e,t,n,i){const o=ji(e,"left",i),s=ji(e,"right",i),l=gr(e,"left",i),d=gr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Lh(e,t,n,i){const{start:o,end:s}=Ic(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function Rh(e,t,n){const i=ji(e,t,n),o=gr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Ec(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 is(e){if(!e)return;if(Ec(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??Vs,i??o??Vs]}]}function Ih(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Eh(e){const[t]=e.media;return t!=null&&t.url?t:null}function os(e){if(!Array.isArray(e)||e.length===0)return[];if(Ec(e)){const t=[];for(const n of e){const i=Ih(n);if(!i)continue;const o=Eh(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 Ji(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Mh({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Ji(e)?r.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):r.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Ph({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Go({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Ji(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function kh({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:y,resolveCloseSourceRect:g,onClose:h,onPrev:m,onNext:b}){const E=a.useRef(null),R=a.useRef(null),L=a.useRef(null),J=a.useRef(new Map),[W,q]=a.useState(0),A=a.useRef(null),C=a.useRef(0),O=a.useRef(0),w=a.useRef("none"),H=a.useRef(!1),P=a.useRef(!1),X=a.useRef(!1),k=a.useRef(null),Y=a.useRef(null),U=a.useRef(null),V=a.useRef(()=>{}),ie=a.useRef(null),S=a.useRef(null),M=a.useRef(null),z=a.useRef(!1),[ae,re]=a.useState(null),[I,ue]=a.useState(Zr),[F,oe]=a.useState(0),[Q,ye]=a.useState("opening"),[Pe,pe]=a.useState(0),[ce,K]=a.useState(0),[te,Z]=a.useState(!1),[Fe,$e]=a.useState(null),[We,de]=a.useState(null),[he,be]=a.useState(null),[G,se]=a.useState(!1),[ge,xe]=a.useState(null),[Me,Ce]=a.useState(!1),N=a.useRef(!1),[me,D]=a.useState(!1),[T,B]=a.useState(!1),Le=a.useRef(n),ne=a.useRef(void 0),_=t[n],ke=_?Ji(_):!1,Ie=ce!==0||te,Ze=!l&&(!s||!!d),Ke=c&&!l,at=u.length>1,tt=a.useCallback((x,ve)=>t.length<=1?null:t[(x+ve+t.length)%t.length]??null,[t]),Ve=at?ao(u,p,-1):tt(n,-1),fe=at?ao(u,p,1):tt(n,1),Ee=Fe===-1&&Ie?at&&We!==null?ao(u,We,-1):he!==null?tt(he,-1):null:null,De=Fe===1&&Ie?at&&We!==null?ao(u,We,1):he!==null?tt(he,1):null:null,qe=Ee&&Ee.url!==(Ve==null?void 0:Ve.url)?Ee:null,we=De&&De.url!==(fe==null?void 0:fe.url)?De:null,Oe=Ve&&Ke?(()=>{const x=at?Gs(u,p,-1):t.length>2?tt((n-1+t.length)%t.length,-1):null;return x&&x.url!==Ve.url?x:null})():null,ze=fe&&Ke?(()=>{const x=at?Gs(u,p,1):t.length>2?tt((n+1)%t.length,1):null;return x&&x.url!==fe.url?x:null})():null,Ye=qe??Oe,ot=we??ze,Je=a.useCallback((x,ve,Re)=>{if(!x||!ve||!Re)return;const Ae=J.current,it=Ae.get(x);(it==null?void 0:it.width)===ve&&(it==null?void 0:it.height)===Re||(Ae.set(x,{width:ve,height:Re}),q(Et=>Et+1))},[]),bt=a.useCallback(x=>{if(!(x!=null&&x.url))return null;const ve=J.current.get(x.url);return wh(R.current,ve)},[W,F]),lt=a.useCallback(()=>{if(!_)return;const x=bt(_);if(x){re(x);return}const ve=R.current;ve&&re(qs(ve))},[_,bt]),_e=a.useCallback(x=>{if(at){const ve=u.length;de((p+x+ve)%ve),be(null);return}t.length>1&&(be((n+x+t.length)%t.length),de(null))},[at,u.length,p,t.length,n]),Xe=a.useCallback(x=>{X.current=x,Z(x)},[]),Be=a.useCallback(()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)},[]),pt=a.useCallback(()=>{Be(),k.current=window.setTimeout(()=>{Be(),Xe(!1)},to+32)},[Be,Xe]),mt=a.useCallback(()=>{const x=E.current;if(!x){ue({left:0,top:0,width:typeof window<"u"?window.innerWidth:Zr.width,height:typeof window<"u"?window.innerHeight:Zr.height});return}const ve=x.getBoundingClientRect();ue({left:ve.left,top:ve.top,width:ve.width,height:ve.height})},[]),gt=a.useCallback((x,ve)=>{if(Ie){if(me&&!te)return`translate(${ce}px, 0px)`;if(te&&Fe!==null){const Re=bt(x);if(!Re)return;const{x:Ae,y:it}=Lh(Re,ve,Fe,I);return`translate(${Ae}px, ${it}px)`}if(te)return"translate(0px, 0px)"}},[Ie,me,te,ce,Fe,I,bt]),kt=a.useCallback(()=>{const x=Y.current;Y.current=null,Be(),Xe(!1),$e(null),de(null),be(null),K(0),D(!1),H.current=!1,O.current=0,w.current="none",x===-1?m():x===1&&b()},[Be,Xe,m,b]),Xt=a.useCallback(()=>{Be(),k.current=window.setTimeout(()=>{Y.current!==null&&kt()},to+32)},[Be,kt]),Yt=a.useCallback(()=>{Be(),Y.current=null,Xe(!1),$e(null),de(null),be(null),K(0),D(!1),H.current=!1,O.current=0,w.current="none"},[Be,Xe]),vt=a.useCallback(x=>{if(!(!Ke||!ae)){if(X.current){if(Y.current===x){U.current=x,kt();return}Yt()}Be(),_e(x),Y.current=x,$e(x),Xe(!0),Xt()}},[Ke,ae,kt,Yt,Be,_e,Xe,Xt]);V.current=vt;const wt=a.useCallback(()=>{ie.current=null,z.current=!1,S.current!==null&&(window.clearInterval(S.current),S.current=null),M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),Gt=a.useCallback(x=>{S.current!==null&&window.clearInterval(S.current);const ve=z.current?hh:gh;S.current=window.setInterval(()=>{V.current(x)},ve)},[]),Ft=a.useCallback(x=>{ie.current!==x&&(wt(),ie.current=x,z.current=!1,V.current(x),Gt(x),M.current=window.setTimeout(()=>{M.current=null,ie.current===x&&(z.current=!0,Gt(x))},mh))},[wt,Gt]),xt=a.useCallback(()=>{const x=R.current;if(!x)return;const ve=_==null?void 0:_.url,Re=ve?J.current.get(ve):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){re(La(x,Re.width,Re.height));return}const Ae=L.current;if(Ae&&ve&&(Ae.src===ve||Ae.currentSrc===ve)){const{width:Et,height:Qe}=bh(Ae);if(Et&&Qe){Je(ve,Et,Qe),re(La(x,Et,Qe));return}}const it=qs(x);!it.width||!it.height||re(it)},[_==null?void 0:_.url,Je]),Nt=a.useCallback(x=>{if(L.current=x,!!x){if(x instanceof HTMLVideoElement){x.readyState>=1&&x.videoWidth>0&&xt();return}x.complete&&x.naturalWidth>0&&xt()}},[xt]),qt=a.useCallback(()=>{mt(),xt(),oe(x=>x+1)},[mt,xt]);a.useEffect(()=>{qt();const x=R.current,ve=E.current,Re=new ResizeObserver(()=>qt());return x&&Re.observe(x),ve&&Re.observe(ve),window.addEventListener("resize",qt),()=>{Re.disconnect(),window.removeEventListener("resize",qt)}},[qt,n,v]),a.useLayoutEffect(()=>{if(!_)return;const x=L.current;if(x){if(x instanceof HTMLImageElement&&x.complete&&x.naturalWidth>0){xt();return}x instanceof HTMLVideoElement&&x.readyState>=1&&x.videoWidth>0&&xt()}},[_==null?void 0:_.url,n,xt]),a.useEffect(()=>{lt()},[lt,W]),a.useEffect(()=>{const x=new Set,ve=[],Re=Ae=>{!(Ae!=null&&Ae.url)||x.has(Ae.url)||(x.add(Ae.url),ve.push(Ae))};t.forEach(Re),u.forEach(Ae=>Ae.items.forEach(Re)),ve.forEach(Ae=>{J.current.has(Ae.url)||Sh(Ae,Je)})},[t,u,Je]),a.useEffect(()=>{if(Q!=="opening"||!ae)return;if(!y){ye("open");return}se(!1);const x=requestAnimationFrame(()=>{requestAnimationFrame(()=>{se(!0),ye("open")})});return()=>cancelAnimationFrame(x)},[Q,ae,y]),a.useEffect(()=>{if(Q!=="closing")return;const x=setTimeout(()=>h(),$n);return()=>clearTimeout(x)},[Q,h]),a.useEffect(()=>()=>{Be()},[Be]),a.useLayoutEffect(()=>{Le.current===n&&ne.current===(_==null?void 0:_.url)||(Be(),Y.current=null,$e(null),de(null),be(null),pe(0),K(0),Xe(!1),B(!1),D(!1),C.current=0,O.current=0,w.current="none",H.current=!1,A.current=null,P.current=!1,L.current=null,lt(),Le.current=n,ne.current=_==null?void 0:_.url)},[n,_==null?void 0:_.url,Xe,Be,lt]),a.useLayoutEffect(()=>{const x=U.current;x!==null&&(U.current=null,requestAnimationFrame(()=>{V.current(x)}))},[n,p,_==null?void 0:_.url]),a.useLayoutEffect(()=>{if(Q==="opening"){N.current=!1,Ce(!1);return}if(Q!=="open"||N.current)return;if(!Ve&&!fe){N.current=!0;return}Ce(!1);const x=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),N.current=!0})});return()=>cancelAnimationFrame(x)},[Q,Ve==null?void 0:Ve.url,fe==null?void 0:fe.url]),a.useEffect(()=>{if(Q!=="open")return;const x=()=>{const Qe=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},ve=Qe=>{const ft=Qe<0?1:-1;Be(),_e(ft),Y.current=ft,$e(ft),Xe(!0),Xt()},Re=Qe=>{if(Math.abs(Qe)>ph&&Ke){ve(Qe);return}Y.current=null,$e(null),de(null),be(null),Xe(!0),K(0),pt()},Ae=Qe=>{if(Qe.touches.length!==1||X.current)return;const ft=Qe.touches[0];P.current=!0,A.current={x:ft.clientX,y:ft.clientY},w.current="none",O.current=0,H.current=!1},it=Qe=>{if(!A.current||Qe.touches.length!==1||X.current)return;const ft=Qe.touches[0],Ht=ft.clientX-A.current.x,Tt=ft.clientY-A.current.y;if(w.current==="none"){if(Math.abs(Ht)<10&&Math.abs(Tt)<10)return;if(Math.abs(Ht)>Math.abs(Tt)){if(!Ke)return;w.current="horizontal"}else if(Tt>0){if(!Ze)return;w.current="vertical"}else return}if(w.current==="horizontal"){H.current=!0,D(!0),O.current=Ht,K(Ht),Qe.preventDefault();return}w.current==="vertical"&&(H.current=!0,D(!0),C.current=Tt,pe(Tt),Qe.preventDefault())},Et=()=>{if(!A.current)return;const Qe=w.current,ft=H.current;if(ft&&Qe==="horizontal")Re(O.current),x();else if(ft&&Qe==="vertical"){const Ht=C.current;if(Ze&&Ht>uh){const Tt=window.innerHeight;C.current=Tt,B(!0),pe(Tt),ye("closing")}else C.current=0,pe(0);x()}else Qe==="horizontal"&&Math.abs(O.current)>0&&(Re(O.current),x());A.current=null,w.current="none",O.current=0,H.current=!1,D(!1)};return document.addEventListener("touchstart",Ae,{passive:!0}),document.addEventListener("touchmove",it,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ae),document.removeEventListener("touchmove",it),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[Q,Ke,Xe,pt,Be,Ze,Xt,_e]);const Zt=a.useCallback(()=>{const x=(g==null?void 0:g())??y??null;x&&ae&&(xe(x),se(!0)),ye("closing")},[g,y,ae]);a.useEffect(()=>{const x=Ae=>{if(Ae.key==="Escape"){if(s&&d||Q==="closing")return;wt(),Zt();return}if(Ae.key!=="ArrowLeft"&&Ae.key!=="ArrowRight"||Q!=="open"||!Ke)return;Ae.preventDefault();const it=Ae.key==="ArrowLeft"?-1:1;Ae.repeat&&ie.current===it||Ft(it)},ve=Ae=>{if(Ae.key!=="ArrowLeft"&&Ae.key!=="ArrowRight")return;const it=Ae.key==="ArrowLeft"?-1:1;ie.current===it&&wt()},Re=()=>{wt()};return window.addEventListener("keydown",x),window.addEventListener("keyup",ve),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",x),window.removeEventListener("keyup",ve),window.removeEventListener("blur",Re),wt()}},[Q,s,d,Zt,Ke,Ft,wt]),a.useEffect(()=>{Q!=="open"&&wt()},[Q,wt]);const tn=()=>{Q==="closing"||l||Zt()},Ct=Q==="open",jt=Q==="closing",cn=Pe>0?Math.max(0,1-Pe/500):1,dt=Pe>0?Math.max(.35,1-Pe/500):1,Te=a.useCallback(x=>{if(!(x.propertyName!=="transform"||!X.current)){if(Y.current!==null){kt();return}Be(),Xe(!1)}},[Be,Xe,kt]),Ne=Q==="closing"?ge??y:y,nt=Ne&&ae&&(Q==="opening"||jt)?fh(Ne,ae):void 0,ut=Ie&&_?gt(_,"center"):Pe>0?`translateY(${Pe}px)`:nt,ht=ae?Vo(ae,I):null,Rt=!!(Ne&&ae),ct=Rt&&(Q==="closing"||Q==="open"&&G),Ot={position:"absolute",top:ht==null?void 0:ht.top,left:ht==null?void 0:ht.left,width:ht==null?void 0:ht.width,height:ht==null?void 0:ht.height,objectFit:"contain",transformOrigin:"top left",transform:ut,opacity:Pe>0?dt:Rt?1:Q==="opening"||jt?0:1,transition:me&&!te?"none":te?`transform ${to}ms ${un}`:T?`transform ${$n}ms ${un}, opacity ${$n}ms ${un}`:ct?`transform ${$n}ms ${un}`:Q==="opening"||jt?`opacity ${$n}ms ${un}`:"none",pointerEvents:ke&&Ct&&!Ie?"auto":"none",touchAction:ke&&Ct?"none":void 0,zIndex:1,overflow:ke?"hidden":void 0},Pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Ie?"auto":"none"},Mt=(x,ve,Re="adjacent")=>{const Ae=bt(x);if(!Ae)return{display:"none"};const it=Re==="far"?ve==="left"?"far-left":"far-right":ve==="left"?"left-adjacent":"right-adjacent",{start:Et}=Fe!==null?Ic(Ae,it,Fe,I):{start:Re==="far"?gr(Ae,ve,I):ji(Ae,ve,I)},Qe=Vo(Et,I),ft=gt(x,it),Ht=!Ie&&Re==="adjacent"&&Ct&&!Me?Rh(Ae,ve,I):null,Tt=Re==="far"&&Ie&&Fe===(ve==="left"?-1:1),nn=me&&!te?!1:te,dn=Re==="adjacent"&&Ct&&Me&&!Ie;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:ft??(Ht?`translate(${Ht.x}px, ${Ht.y}px)`:void 0),opacity:Re==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${to}ms ${un}`:`transform ${to}ms ${un}, opacity ${$n}ms ${un}`:dn?`transform ${$n}ms ${un}`:Q==="opening"||jt?`opacity ${$n}ms ${un}`:"none",pointerEvents:"none",zIndex:1}},zt=(x,ve)=>{const Re=bt(x);return Re?Th(ji(Re,ve,I),ve,I):null},Bt=x=>ve=>{if(!l){if(P.current){P.current=!1;return}ve.stopPropagation(),vt(x)}},Wt=Ve?zt(Ve,"left"):null,_t=fe?zt(fe,"right"):null,At=Wt?Vo(Wt,I):null,St=_t?Vo(_t,I):null;return r.jsxs("div",{ref:E,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:tn,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?cn:0,transition:me?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:R,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:me?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"},children:r.jsx(Tc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Ye&&r.jsx(Go,{media:Ye,style:Mt(Ye,"left","far"),onMeasure:Je,onTransitionEnd:Te},`far-prev-${Ye.url}`),Ct&&Ve&&r.jsxs(r.Fragment,{children:[r.jsx(Go,{media:Ve,style:Mt(Ve,"left"),onMeasure:Je,onTransitionEnd:Te},`prev-${Ve.url}`),At&&r.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Bt(-1)})]}),Ct&&fe&&r.jsxs(r.Fragment,{children:[r.jsx(Go,{media:fe,style:Mt(fe,"right"),onMeasure:Je,onTransitionEnd:Te},`next-${fe.url}`),St&&r.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Bt(1)})]}),Ct&&ot&&r.jsx(Go,{media:ot,style:Mt(ot,"right","far"),onMeasure:Je,onTransitionEnd:Te},`far-next-${ot.url}`),ae&&_&&(ke?r.jsx(Ph,{src:_.url,phase:Q,onMediaElement:Nt,wrapperStyle:Ot,videoStyle:Pt,onLoadedMetadata:xt,onTransitionEnd:Te},`${n}-${_.url}`):r.jsx("img",{ref:Nt,src:_.url,alt:_.name,onLoad:xt,onTransitionEnd:Te,style:Ot},`${n}-${_.url}`))]})}function Ah({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=$.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:v}=e,y=(v==null?void 0:v.display)==="cover",g=(v==null?void 0:v.ratioValue)??"1:1",h=(v==null?void 0:v.reversed)??!1,[m,b]=g.split(":").map(Number),L=`${h?b:m} / ${h?m:b}`,J=c.entryWidth??.2,W=c.columnsCount,q=$.scalingValue(J,n),A=$.scalingValue(c.horizontalGap??0,n),C=q,O=q,w={width:C,...y?{aspectRatio:L,height:"auto",overflow:"hidden"}:{height:"auto"}},H=y?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},P=a.useRef(null),[X,k]=a.useState(!1),[Y,U]=a.useState([]),[V,ie]=a.useState(0),[S,M]=a.useState(0),[z,ae]=a.useState(null),[re,I]=a.useState({title1:"",title2:"",title3:""}),ue=(()=>{const he={},be=P.current?getComputedStyle(P.current).getPropertyValue("--cntrl-article-width").trim():"";return be&&(he["--cntrl-article-width"]=be),he})(),F=!n||i||o,oe=a.useMemo(()=>dh(d),[d]),Q=t??[],ye=Q.length%W||W,Pe=ye<W&&Q.length>0,pe=Q.length-ye,ce=Pe?Math.floor((W-ye)/2)+1:1,K=a.useMemo(()=>vh(Q),[Q]),te=a.useMemo(()=>$h(Q),[Q]),Z=(he,be,G)=>{if(n&&!o&&!i)return;const se=K.findIndex(xe=>xe.gridIndex===he);if(se<0)return;const ge=K[se];M(se),U(ge.items),ie(be),I(ge.entry),ae(G??null),k(!0)},Fe=a.useCallback(()=>{k(!1),ae(null)},[]),$e=a.useCallback(()=>{const he=K[S];return!he||!P.current?z:yh(P.current,he.gridIndex,y?"cover":"contain")??z},[K,S,z,y]),We=a.useCallback(he=>{if(K.length>1){const be=K.length,G=(S+he+be)%be,se=K[G],ge=Math.min(V,se.items.length-1);M(G),U(se.items),ie(ge),I(se.entry);return}ie(be=>(be+he+Y.length)%Y.length)},[K,S,V,Y.length]),de=K.length>1||Y.length>1;return a.useEffect(()=>{if(!X||typeof document>"u")return;const he=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=he}},[X]),a.useEffect(()=>{!n||o||i||k(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:oe}}),r.jsx(Ch,{mediaList:te}),r.jsx("div",{ref:P,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${W}, ${q})`,rowGap:0,columnGap:A,width:$.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:$.scalingValue(u??0,n)},children:Q.map((he,be)=>{const G=is(he.gallery),se=os(G),ge=se.filter(D=>D.lightboxMedia).map(D=>D.lightboxMedia),xe=Math.floor(be/W)===Math.ceil(Q.length/W)-1,Me=Pe&&be>=pe?`${ce+(be-pe)}`:void 0,Ce=se[0],N=Ce!=null&&Ce.lightboxMedia?ge.findIndex(D=>D.url===Ce.lightboxMedia.url):-1,me=r.jsx("div",{className:`${d}-item-image-wrapper`,style:w,children:se.length>0&&r.jsx(Mh,{media:Ce.displayMedia,gridIndex:be,className:`${d}-item-${Ji(Ce.displayMedia)?"video":"image"}`.trim(),style:H,onMediaClick:F&&N>=0?D=>Z(be,N,Lc(D.currentTarget,y?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,xe?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:q,...Me?{gridColumn:Me}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:O}})}),r.jsx("a",{className:`${d}-item-image-link`,children:me}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:O}})})]})},be)})}),X&&typeof document<"u"&&(()=>{const he=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:ue,"data-selection":"none",children:r.jsx(kh,{prefix:d,items:Y,index:V,entry:re,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:de,lightboxEntries:K,entryIdx:S,layoutId:s,sourceRect:z,resolveCloseSourceRect:$e,onClose:Fe,onPrev:()=>We(-1),onNext:()=>We(1)})}),he)})()]})}const Fh=`import { CommonComponentProps } from '../props';
|
|
7321
7402
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
7322
7403
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7323
7404
|
import { createPortal } from 'react-dom';
|
|
@@ -9660,7 +9741,7 @@ export function Hive({
|
|
|
9660
9741
|
</>
|
|
9661
9742
|
);
|
|
9662
9743
|
}
|
|
9663
|
-
`,Lh="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>'),oi={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 Rh(e){const t={};return t[Je(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Je(e,"fontSettings")]={...oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Je(e,"fontSize")]={...oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Je(e,"lineHeight")]={...oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Je(e,"letterSpacing")]={...oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Je(e,"wordSpacing")]={...oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Je(e,"textAlign")]={...oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Je(e,"textAppearance")]={...oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const zi=Kn.filter(e=>e!=="count"),Ih=zi.reduce((e,t)=>({...e,...Rh(t)}),{}),Eh=zi.reduce((e,t)=>({...e,[Je(t,"fontFamily")]:"Arial",[Je(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Je(t,"letterSpacing")]:0,[Je(t,"wordSpacing")]:0,[Je(t,"textAlign")]:"left",[Je(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Jr(e){return zi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Je(n,"fontSize")]=i),o!==void 0&&(t[Je(n,"lineHeight")]=o),t},{})}const Mh={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(zi.map(e=>[ts[e],ns(e)]))},Ph={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},kh=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Ph,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),Ah={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:kh},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"}},...Ih},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Lh,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Eh},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,...Jr({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,...Jr({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,...Jr({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:[Mh]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Fh={element:Ch,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:[...zi.map(e=>({path:`${Je(e,"fontFamily")}`}))]},fontRelations:{...zi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Je(t,"fontFamily")}`}),{})},schema:Ah,sourceCode:Th};function Wh(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 _h({media:e,className:t,style:n}){const i=a.useRef(null);return a.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const s=o.play();s&&s.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Qr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Nh(e){return String(e??"").trim().length>0}function Us(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 Ks(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 Xs(e,t,n,i,o,s,l){const d=$.scalingValue(s,l),c=$.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Hh(e,t,n){const i=$.scalingValue(t,n),o=$.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Ys=10,Zs=10,no={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Oh(e,t,n){return Math.max(t,Math.min(n,e))}function ea(e,t,n){return e+(t-e)*n}function Dh(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+Ys,y:n.clientY-d.top+Ys}}switch(e){case"left":return{x:Zs+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-Zs-i/2,y:l};default:return{x:o/2,y:l}}}function jh(e,t){const n=a.useRef(null),i=a.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=a.useRef(null),s=a.useCallback(()=>{const h=n.current,g=i.current;h&&(h.style.transform=`translate3d(${g.x}px, ${g.y}px, 0) translate(-50%, -50%) rotate(${g.rotation.toFixed(3)}deg)`)},[]),l=a.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=a.useCallback(()=>{const h=i.current;t?(h.x=ea(h.x,h.targetX,no.positionEase),h.y=ea(h.y,h.targetY,no.positionEase),h.rotation=ea(h.rotation,h.targetRotation,no.rotationEase)):(h.x=h.targetX,h.y=h.targetY,h.rotation=h.targetRotation),s();const g=Math.abs(h.x-h.targetX)<.4&&Math.abs(h.y-h.targetY)<.4,m=Math.abs(h.rotation-h.targetRotation)<.08;!g||!m?o.current=requestAnimationFrame(d):o.current=null},[s,t]),c=a.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=a.useCallback((h,g)=>{const m=i.current;m.targetX=h,m.targetY=g,m.targetRotation=0,m.x=h,m.y=g,m.rotation=0,m.lastX=h,m.hasLastX=!0,s(),t&&c()},[s,t,c]),p=a.useCallback((h,g)=>{if(!e)return;const m=i.current;if(t&&m.hasLastX){const x=h-m.lastX;m.targetRotation=Oh(x*no.rotationFactor,-20,no.maxRotation)}else m.targetRotation=0;if(m.lastX=h,m.hasLastX=!0,m.targetX=h,m.targetY=g,t){c();return}m.x=h,m.y=g,m.rotation=m.targetRotation,s()},[e,s,t,c]),w=a.useCallback(h=>{l(),i.current.hasLastX=!1,h==null||h()},[l]),b=a.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 a.useEffect(()=>(e||b(),l),[e,b,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:w,reset:b}}function zh(e){return`
|
|
9744
|
+
`,Wh="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>'),oi={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 _h(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const zi=Kn.filter(e=>e!=="count"),Hh=zi.reduce((e,t)=>({...e,..._h(t)}),{}),Nh=zi.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Arial",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Jr(e){return zi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const Oh={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(zi.map(e=>[ts[e],ns(e)]))},Dh={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},jh=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Dh,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),zh={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:jh},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"}},...Hh},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Wh,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Nh},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,...Jr({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,...Jr({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,...Jr({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:[Oh]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Bh={element:Ah,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:[...zi.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{...zi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})},schema:zh,sourceCode:Fh};function Vh(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 Gh({media:e,className:t,style:n}){const i=a.useRef(null);return a.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const s=o.play();s&&s.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Qr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function qh(e){return String(e??"").trim().length>0}function Us(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 Ks(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 Xs(e,t,n,i,o,s,l){const d=$.scalingValue(s,l),c=$.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Uh(e,t,n){const i=$.scalingValue(t,n),o=$.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Ys=10,Zs=10,no={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Kh(e,t,n){return Math.max(t,Math.min(n,e))}function ea(e,t,n){return e+(t-e)*n}function Xh(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+Ys,y:n.clientY-d.top+Ys}}switch(e){case"left":return{x:Zs+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-Zs-i/2,y:l};default:return{x:o/2,y:l}}}function Yh(e,t){const n=a.useRef(null),i=a.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=a.useRef(null),s=a.useCallback(()=>{const g=n.current,h=i.current;g&&(g.style.transform=`translate3d(${h.x}px, ${h.y}px, 0) translate(-50%, -50%) rotate(${h.rotation.toFixed(3)}deg)`)},[]),l=a.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=a.useCallback(()=>{const g=i.current;t?(g.x=ea(g.x,g.targetX,no.positionEase),g.y=ea(g.y,g.targetY,no.positionEase),g.rotation=ea(g.rotation,g.targetRotation,no.rotationEase)):(g.x=g.targetX,g.y=g.targetY,g.rotation=g.targetRotation),s();const h=Math.abs(g.x-g.targetX)<.4&&Math.abs(g.y-g.targetY)<.4,m=Math.abs(g.rotation-g.targetRotation)<.08;!h||!m?o.current=requestAnimationFrame(d):o.current=null},[s,t]),c=a.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=a.useCallback((g,h)=>{const m=i.current;m.targetX=g,m.targetY=h,m.targetRotation=0,m.x=g,m.y=h,m.rotation=0,m.lastX=g,m.hasLastX=!0,s(),t&&c()},[s,t,c]),p=a.useCallback((g,h)=>{if(!e)return;const m=i.current;if(t&&m.hasLastX){const b=g-m.lastX;m.targetRotation=Kh(b*no.rotationFactor,-20,no.maxRotation)}else m.targetRotation=0;if(m.lastX=g,m.hasLastX=!0,m.targetX=g,m.targetY=h,t){c();return}m.x=g,m.y=h,m.rotation=m.targetRotation,s()},[e,s,t,c]),v=a.useCallback(g=>{l(),i.current.hasLastX=!1,g==null||g()},[l]),y=a.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 a.useEffect(()=>(e||y(),l),[e,y,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:v,reset:y}}function Zh(e){return`
|
|
9664
9745
|
.${e}-wrapper {
|
|
9665
9746
|
display: grid;
|
|
9666
9747
|
align-items: start;
|
|
@@ -10036,7 +10117,7 @@ a.${e}-list-item {
|
|
|
10036
10117
|
overflow-wrap: anywhere;
|
|
10037
10118
|
word-break: break-word;
|
|
10038
10119
|
}
|
|
10039
|
-
`}const Xn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],rs=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",So=[...rs,An],kr=["A","B","C","D","E"];function Mc(e){return`${e}ColumnVerticalAlign`}const Ra=["Top","Center","Bottom"];function as(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return kr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Bh(e){const t=as(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Vh(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return kr.includes(n)?n:null}function Pc(e,t,n){const i=Vh(e);return i?i===t?!1:Bh(n[Mc(i)]):!0}function $o(e){const t=as(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return kr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Gh(e,t,n){if(kc(e,t,n))return $o(e);const i=$o(e);return i.kind==="baseline"?{kind:"top"}:i}function qh(e){const t=$o(e);return t.kind==="baseline"?{kind:"top"}:t}function kc(e,t,n){return Pc(e,n,t)?$o(e).kind==="baseline":!1}function Uh(e){const t={};let n=!1;for(const i of kr){const o=Mc(i),s=e[o];if(e.type==="b"){const l=String(s??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}Pc(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Kh(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Xh(e){const t=$o(e).kind;return t==="baseline"?"center":t}function Yh(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Js(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Zh(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(),s=o-i;return n.remove(),s}function ta(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=Zh(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=s.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 Jh(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const s=o.querySelector(`.${n}`);s&&(s.style.minHeight=`${i}px`,s.style.height=`${i}px`)}),i)}function Qh(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const ef={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function It(e,t){return`${e}${t.replace(/^text/,"Text")}`}const tf={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function nf(e){return[It(e,"textFontFamily"),It(e,"textFontSettings"),{type:"row",items:[It(e,"textFontSize"),It(e,"textLineHeight"),It(e,"textLetterSpacing"),It(e,"textWordSpacing")]},It(e,"textTextAlign"),It(e,"textTextAppearance"),`${e}VerticalAlign`]}function of(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(So.map(e=>[tf[e],nf(e)]))}}function hr(e,t){const n=i=>{const o=It(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===An?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Qs(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 on(Ut(n,t))}function el(e,t,n,i){const o=hr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function tl(e,t,n,i){const o=hr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:$.scalingValue((s-l)/2,i)}}const fn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Bi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Vi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Gi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],rf={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},af=["hover","focus","filled","success","error"],nl=.004,Ei=.004,na=Ei,ss=50,Co=1440,To=ss/Co;function Ac(e){const t=typeof e=="number"&&e>0?e:Co;return ss/t}function sf(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 Co}const Fc={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 lf(e,t=1){const n=t/e;return Object.fromEntries(fn.map(i=>[i,n]))}function cf(){return Object.fromEntries([...Bi.map(e=>[e,0]),...Vi.map(e=>[e,0])])}function df(){return Object.fromEntries(Gi.map(e=>[e,0]))}function qo(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Fc[t]]))}function Wc(e,t,n){const i=e-To,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const s=i/o;return{paddingLeft:t*s,paddingRight:n*s}}function ar(e,t,n){const i=ls(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,l)=>s+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function uf(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=Bi[o],l=Vi[o],d=typeof n[s]=="number"?n[s]:0,c=typeof n[l]=="number"?n[l]:0,u=Wc(t[o]??0,d,c);u.paddingLeft!==d&&(i[s]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function ls(e,t,n){if(e<=0)return[];const i=fn.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)+To;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]-To;if(p<=0)continue;const w=Math.min(c,p);d[u]-=w,c-=w}return[...d,i[e-1]]}function pf(e,t,n){if(e<=1)return{};const i=ls(e,t,n),o={};for(let s=0;s<e-1;s+=1){const l=fn[s];i[s]!==n[l]&&(o[l]=i[s])}return o}function il(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Xn]}function mf(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function gf(e,t,n,i){const o=Math.min(i,e.length,fn.length),s={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=fn[c],p=Bi[c],w=Vi[c],b=Gi[c],h=fn[l],g=Bi[l],m=Vi[l],x=Gi[l],M=n[u],E=n[p],R=n[w],Z=n[b];typeof M=="number"&&(s[h]=M),typeof E=="number"&&(s[g]=E),typeof R=="number"&&(s[m]=R),typeof Z=="number"&&(s[x]=Z)}return s}function _c(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 hf(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=po(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...lf(n,o),...cf()};if(s)for(const d of Gi)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,df());return _c(e,l)?l:e}function ff(e,t,n){const i=Uh(e);i&&(e={...e,...i});const o=Ac(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=po(e),c=po(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof l=="number"?l:Xn.length,w=R=>{if(u)return R;const Z=qo({...t,...R}),_=po(R),U=ar(p,_,Z),F=uf(p,U,{...t,...R});return Object.keys(F).length===0?R:{...R,...F}};if(typeof s=="number"&&s!==l)return e;const b=il(e),h=il(t);if(!mf(b,h))return w({...e,...gf(b,h,t,p)});if(d<c&&typeof p=="number"&&!u){const R=qo({...t,...e});return w({...e,...pf(p,d,R)})}if(u){const R=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,Z=Math.max(0,(d-o)/2);return R>Z?{...e,textPaddingLR:Z}:e}const g=qo({...t,...e}),m=ar(p,c,qo(t)),M=ar(p,d,g).some((R,Z)=>R<(m[Z]??R)),E=fn.some(R=>{const Z=e[R],_=t[R];return typeof Z=="number"&&typeof _=="number"&&Z!==_});return M||E?w(e):e}function yf(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),s=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(To,i-o-s-To)}function vf(e,t){return Math.random()*(t-e)+e}function xf(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Fc[t]]))}function ia(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function bf(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const c=Bi[d],u=Vi[d],p=Gi[d];return{key:l,textPrefix:ef[l],widthKey:fn[d],width:n[fn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:s[p]}})}function wf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:c}=$.useScopedStyles(),u=!!o,{columns:p,type:w,wrapperWidth:b,entriesCount:h,cellMinHeight:g,dividerWidth:m,showVisibility:x,cut:M,showCut:E,cutCellMinHeight:R,cutLabel:Z,imageSize:_,imageOnHover:U,imagePosition:F="cursor",imageInterpolation:C="on",entryHoverEffect:z,entryHoverShowOption:y,rowPaddingTop:N,rowPaddingBottom:I,rowPaddingTopB:J,columnsOrder:k,textPaddingLR:X,textColor:G,backgroundColor:V,dividerColor:oe,textHoverColor:S,backgroundHoverColor:P,dividerHoverColor:D}=e,[re,ae]=a.useState(void 0),[T,ue]=a.useState(null),W=a.useRef(null),ie=U==="on"&&(!n||i),ne=F==="cursor",ye=ne&&C==="on",{anchorRef:Pe,onShow:me,onCursorMove:le,exit:K}=jh(!!(ie&&T!==null),ye),ee=(M??0)>0,Y=w==="b",We=a.useRef(null),$e=a.useRef(null),[Ae,de]=a.useState(null),[he,be]=a.useState(Co),q=Ac(he),se=Math.max(0,((b??0)-q)/2),ge=Math.min(X??0,se),xe=Math.max(ge,Ei),Ee=((b??0)+q)/2;a.useLayoutEffect(()=>{if(!n){be(Co);return}const Te=()=>{be(sf(We.current))};Te();const Oe=We.current;if(!Oe)return;const nt=new ResizeObserver(Te);nt.observe(Oe);let dt=Oe;for(;dt&&!dt.style.getPropertyValue("--cntrl-article-width");)dt=dt.parentElement;return dt&&nt.observe(dt),()=>nt.disconnect()},[n,l]),a.useEffect(()=>{ae(void 0)},[M,E,t,h]),a.useEffect(()=>{n&&!i&&ae(void 0)},[n,i]);const Ce=$.buildColorVars(c,{textColor:G,backgroundColor:V,dividerColor:oe,textHoverColor:S,backgroundHoverColor:P,dividerHoverColor:D},rf,af),H=s&&s!=="default"?`${c}-state-${s}`:"",O=`${!n||i?z==="default"?`${c}-entry-hover-default`:z==="blinds"?`${c}-entry-hover-blinds`:z==="reveal"?`${c}-entry-hover-reveal`:"":""} ${H}`.trim(),L=z==="reveal"&&(!n||i),B=(x==null?void 0:x[0])??!1,Re=(x==null?void 0:x[1])??!1,Q=a.useRef(e),A=a.useRef(l);a.useEffect(()=>{if(!d||!n){Q.current=e,A.current=l;return}if(A.current!==l){Q.current=e,A.current=l;return}const Te=Q.current;if(!(Te!==e))return;if(typeof Te.columns=="number"&&typeof e.columns=="number"&&Te.columns!==e.columns){Q.current=e;return}const nt=ff(e,Te,{designWidth:he});Q.current=e,_c(e,nt)&&d(nt)},[e,d,n,l,he]);const Fe=a.useMemo(()=>xf(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Me=a.useMemo(()=>ia(e,Bi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),Qe=a.useMemo(()=>ia(e,Vi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ke=a.useMemo(()=>ia(e,Gi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),lt=a.useMemo(()=>Array.isArray(k)&&k.length>0?k:[...Xn],[k]),tt=a.useMemo(()=>bf(lt,p,Fe,Me,Qe,Ke),[lt,p,Fe,Me,Qe,Ke]),Be=po(e),fe=a.useMemo(()=>fn.slice(0,p).map(Te=>Fe[Te]),[p,Fe]),Ie=a.useMemo(()=>ls(p,Be,Fe),[p,Be,Fe]),De=a.useMemo(()=>ar(p,Be,Fe),[p,Be,Fe]),qe=a.useMemo(()=>tt.map((Te,Oe)=>Wc(De[Oe]??0,Te.paddingLeft,Te.paddingRight)),[tt,De]),Se=a.useMemo(()=>{const Te=h===0?1/0:h;return(t??[]).slice(0,Te).map((nt,dt)=>({id:dt,cells:Object.fromEntries(Xn.map(ht=>[ht,nt[ht]??""])),image:nt.image,link:nt.link}))},[t,h]),_e=ee?re??M:Se.length,Ve=a.useMemo(()=>ee?Se.slice(0,_e):Se,[Se,ee,_e]),Xe=ee&&_e<Se.length,at=Ve.length>1||Xe,et=[B?`${c}-divider-top`:"",Re||at?`${c}-divider-bottom`:""].filter(Boolean).join(" "),$t=!n||i,ut=()=>{if(!$t)return;const Te=re??M;if(!E){ae(Se.length);return}ae(Math.min(Te+E,Se.length))},He=Te=>$.scalingValue(Te,n??!1),Ye=Y?J??0:N??0,ze=I??0,pt=g??0,mt=Math.max(ze,na),gt=Xs(0,Ve.length,B,Re,Xe,m??0,n??!1).borderTopWidth,kt=Y?"rowPaddingTopB":"rowPaddingTop",Xt=tt[0],Yt=tt[tt.length-1],vt=qe[0],bt=qe[qe.length-1],Gt=Xt&&vt?Math.max(vt.paddingLeft,Ei):0,Ft=Yt&&bt?Math.max(bt.paddingRight,Ei):0,xt=Be,Ht=(Te,Oe)=>Dh(F,We.current,ne?Te:null,Oe),qt=(Te,Oe)=>{if(!ie)return;const nt=Te.image;if(!(nt!=null&&nt.url)){K(()=>ue(null));return}const dt=(_==null?void 0:_.min)??80,ht=(_==null?void 0:_.max)??320,Rt=(T==null?void 0:T.rowId)===Te.id,st=Rt?T.widthPx:vf(dt,ht),{x:Ot,y:Pt}=Ht(Oe,st);if(Rt&&ne){le(Ot,Pt);return}ue({rowId:Te.id,url:nt.url,objectFit:"contain",isVideo:Wh(nt),widthPx:st}),W.current={x:Ot,y:Pt}},Zt=Te=>{if(!ie||!T||!ne)return;const{x:Oe,y:nt}=Ht(Te,T.widthPx);le(Oe,nt)},tn=()=>{T&&K(()=>ue(null))},Ct=Te=>{L&&Us(Te,c),!(!ie||!T)&&K(()=>ue(null))},jt=Te=>{L&&Ks(Te,c)};a.useLayoutEffect(()=>{if(!T||!W.current)return;const{x:Te,y:Oe}=W.current;W.current=null,me(Te,Oe)},[T==null?void 0:T.rowId,T==null?void 0:T.url,me]),a.useLayoutEffect(()=>{if(!u||Y){de(null);return}const Te=$e.current,Oe=Te==null?void 0:Te.parentElement;if(!Te||!Oe){de(null);return}const nt=()=>{const ht=Te.querySelector("[data-list-row]");if(!ht){de(null);return}const Rt=Oe.getBoundingClientRect(),st=ht.getBoundingClientRect();de(st.top-Rt.top+st.height/2)};nt();const dt=new ResizeObserver(nt);return dt.observe(Te),dt.observe(Oe),()=>dt.disconnect()},[u,Y,Ve,Ye,ze,pt,t,e,tt,De,he,m,B,Re,Xe]);const cn=a.useMemo(()=>!Y&&rs.some(Te=>{const Oe=Te.charAt(0),nt=e[`${Te}VerticalAlign`];return kc(nt,e,Oe)}),[Y,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Ot;const Te=We.current;if(!Te)return;const Oe=()=>{Te.querySelectorAll("[data-list-col]").forEach(Pt=>{Pt.style.transform="";const Mt=Pt.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const zt=Pt.querySelector(`.${c}-list-col-title`);zt&&(zt.style.transform="")})};if(Y||!cn){Oe();return}const nt=()=>{const Pt=Array.from(Te.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,zt=`${c}-baseline-probe`;Pt.forEach(Bt=>{Bt.querySelectorAll("[data-list-col]").forEach(Wt=>{Wt.style.transform="";const _t=Wt.querySelector(`.${Mt}`);_t&&(_t.style.minHeight="",_t.style.height="");const At=Wt.querySelector(`.${c}-list-col-title`);At&&(At.style.transform="")})}),Pt.forEach(Bt=>{const Wt=Array.from(Bt.querySelectorAll("[data-list-col]"));Jh(Bt,Wt,Mt)}),Te.offsetHeight,Pt.forEach(Bt=>{const Wt=Array.from(Bt.querySelectorAll("[data-list-col]")),_t=Bt.getBoundingClientRect().top,At=new Map,wt=Wt.map(Le=>{const ke=Le.querySelector(`.${c}-list-col-title`),it={el:Le,titleEl:ke,letter:Le.getAttribute("data-col-letter")??"",kind:Le.getAttribute("data-valign")??"top",anchor:Le.getAttribute("data-valign-anchor")};return At.set(it.letter,it),it}),v=new Map,ve=(Le,ke)=>{const it=v.get(Le.letter);if(it!==void 0)return it;const Et=Le.anchor?At.get(Le.anchor):void 0;if(Le.kind!=="baseline"||!Et||ke.has(Le.letter)){const nn=ta(Le,_t,Mt,zt);return v.set(Le.letter,nn),nn}ke.add(Le.letter);const Ze=ve(Et,ke);ke.delete(Le.letter);const ft=ta(Le,_t,Mt,zt),Nt=Ze-ft;Qh(Le.titleEl,Nt);const Tt=ta(Le,_t,Mt,zt);return v.set(Le.letter,Tt),Tt};wt.forEach(Le=>ve(Le,new Set))})};let dt=null;const ht=()=>{dt===null&&(dt=requestAnimationFrame(()=>{dt=null,nt()}))};nt();const Rt=new ResizeObserver(()=>ht());Rt.observe(Te);let st=!1;return typeof document<"u"&&((Ot=document.fonts)!=null&&Ot.ready)&&document.fonts.ready.then(()=>{st||ht()}),()=>{st=!0,dt!==null&&(cancelAnimationFrame(dt),dt=null),Rt.disconnect(),Oe()}},[cn,Y,e,t,he,Ve,De]);const ct=a.useMemo(()=>zh(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ct}}),r.jsx("div",{style:Ce,children:r.jsxs("div",{ref:We,className:`${c}-wrapper ${O}${et?` ${et}`:""}${Y?` ${c}-type-b`:""}`.trim(),style:{width:$.scalingValue(b??0,n)},onMouseMove:ie?Zt:void 0,onMouseLeave:ie?tn:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ve.map((Te,Oe)=>{var Rt;const nt=(((Rt=Te.link)==null?void 0:Rt.length)??0)>0,dt=nt&&(!n||i)?"a":"div",ht=Xs(Oe,Ve.length,B,Re,Xe,m??0,n??!1);return r.jsxs(dt,{ref:Oe===0?st=>{$e.current=st}:void 0,className:`${c}-list-item${nt||y==="always"?` ${c}-list-item-has-link`:""}${Xe&&Oe===Ve.length-1?` ${c}-list-item-before-cut`:""}`,...nt?{href:Te.link,target:"_blank"}:{},style:ht,onMouseEnter:st=>{L&&(nt||y==="always")&&Us(st,c),ie&&qt(Te,st)},onMouseLeave:st=>{L&&(nt||y==="always")&&Ks(st,c)},children:[Ye>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:He(Ye)}}),r.jsxs("div",{className:`${c}-list-cols-row${Y?"":` ${c}-list-cols-row-h`}${u&&Oe===0&&Y?` ${c}-list-cols-row-controls`:""}`,...Y?{}:{"data-list-row":""},style:Y?void 0:{minHeight:He(pt)},children:[tt.map((st,Ot)=>{const Pt=Ot===tt.length-1,Mt=qe[Ot],zt=st.paddingBottom,Bt=Nh(Te.cells[st.key]),Wt=Y&&Bt&&zt>0,_t=Y?{minHeight:He(pt)}:{width:He(De[Ot])},At=Y?{paddingLeft:He(ge),paddingRight:He(ge)}:{paddingLeft:He(Mt.paddingLeft),paddingRight:He(Mt.paddingRight)},wt=st.textPrefix.charAt(0),v=Y?qh(e[`${st.textPrefix}VerticalAlign`]):Gh(e[`${st.textPrefix}VerticalAlign`],e,wt),ve=Y&&Bt&&u&&Oe===0;return Y&&!Bt?null:r.jsxs("div",{className:Y?`${c}-list-col-wrap`:void 0,...Y?{}:{"data-list-col":"","data-col-letter":wt,"data-valign":v.kind,...v.kind==="baseline"?{"data-valign-anchor":v.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${Pt?` ${c}-list-col-last`:""}`,style:{...At,..._t,...Y?{justifyContent:Js(v.kind)}:{}},"data-test":st.width,children:r.jsx("span",{className:el(e,st.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Qs(hr(e,st.textPrefix),n),...tl(e,st.textPrefix,c,n),...Y?{}:Kh(v.kind)},children:Te.cells[st.key]??null})}),Wt&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:He(zt)}}),ve&&r.jsx("div",{"data-controls":st.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:He(Math.max(zt,na))}})]},st.key)}),u&&Oe===0&&Y&&r.jsxs(r.Fragment,{children:[r.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(Ee),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:He(xe),height:"100%"}}),r.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(Ee),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:He(Math.max(xe,Be-xe)),width:He(xe),height:"100%"}})]})]}),!Y&&ze>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:He(ze)}}),u&&Oe===0&&!Y&&r.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:He(mt)}})]},Te.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":kt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":Y?"center":"left-y",className:`${c}-control-anchor`,style:{top:gt,left:0,width:"100%",height:He(Math.max(Ye,na))}})},"row-padding-handles"),u&&!Y&&Xt&&Yt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Xt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[0]-((vt==null?void 0:vt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ae??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:He(Gt),height:"100%"}}),r.jsx("div",{"data-controls":Yt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[tt.length-1]-((bt==null?void 0:bt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ae??void 0,className:`${c}-control-anchor`,style:{top:0,left:He(xt-Ft),width:He(Ft),height:"100%"}})]},"column-edge-padding-handles"),u&&!Y&&tt.slice(0,-1).map((Te,Oe)=>{const nt=tt[Oe+1],dt=Ie.slice(0,Oe+1).reduce((Pt,Mt)=>Pt+Mt,0),ht=qe[Oe],Rt=qe[Oe+1],st=Math.max(ht.paddingRight,Ei),Ot=Math.max(Rt.paddingLeft,Ei);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Te.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[Oe]-ht.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ae??void 0,className:`${c}-control-anchor`,style:{top:0,left:He(dt-st),width:He(st),height:"100%"}}),r.jsx("div",{"data-controls":nt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[Oe+1]-Rt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Ae??void 0,className:`${c}-control-anchor`,style:{top:0,left:He(dt),width:He(Ot),height:"100%"}})]},`${Te.paddingRightKey}-padding`)}),u&&!Y&&tt.slice(0,-1).map((Te,Oe)=>{const nt=yf(Oe,Ie,fe,Be),ht=Ie.slice(0,Oe+1).reduce((Rt,st)=>Rt+st,0)-nl/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Te.widthKey,"data-controls-axis":"x","data-controls-min":String(ss),"data-controls-max-fraction":String(nt),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:He(ht),width:He(nl),height:"calc(100%)",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)})]}),Xe&&(()=>{const Te=hr(e,An),Oe=Xh(e.cutLabelVerticalAlign),nt=Te.textTextAlign==="justify"||Y;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:He(R??0),cursor:$t?"pointer":"default",...Hh(Re,m??0,n??!1)},onClick:$t?ut:void 0,onMouseEnter:L||ie?Ct:void 0,onMouseLeave:L?jt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...Y?{paddingLeft:He(ge),paddingRight:He(ge)}:{},justifyContent:Yh(Te.textTextAlign),alignItems:Js(Oe)},children:r.jsx("span",{className:el(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Qs(Te,n),...tl(e,An,c,n),...nt?{width:"100%"}:{}},children:Z})})})})(),ie&&T&&(()=>{const Te=`${T.widthPx}px`,Oe={width:Te,height:"auto",maxHeight:Te,objectFit:"contain"};return r.jsx("div",{ref:Pe,className:`${c}-hover-media-anchor`,children:r.jsx(_h,{media:T,className:T.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Oe},`${T.rowId}-${T.url}`)})})()]})})]})}const Sf=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10120
|
+
`}const Xn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],rs=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",So=[...rs,An],kr=["A","B","C","D","E"];function Mc(e){return`${e}ColumnVerticalAlign`}const Ra=["Top","Center","Bottom"];function as(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return kr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Jh(e){const t=as(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Qh(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return kr.includes(n)?n:null}function Pc(e,t,n){const i=Qh(e);return i?i===t?!1:Jh(n[Mc(i)]):!0}function $o(e){const t=as(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return kr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function ef(e,t,n){if(kc(e,t,n))return $o(e);const i=$o(e);return i.kind==="baseline"?{kind:"top"}:i}function tf(e){const t=$o(e);return t.kind==="baseline"?{kind:"top"}:t}function kc(e,t,n){return Pc(e,n,t)?$o(e).kind==="baseline":!1}function nf(e){const t={};let n=!1;for(const i of kr){const o=Mc(i),s=e[o];if(e.type==="b"){const l=String(s??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}Pc(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function of(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function rf(e){const t=$o(e).kind;return t==="baseline"?"center":t}function af(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Js(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function sf(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(),s=o-i;return n.remove(),s}function ta(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=sf(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=s.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 lf(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const s=o.querySelector(`.${n}`);s&&(s.style.minHeight=`${i}px`,s.style.height=`${i}px`)}),i)}function cf(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const df={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function It(e,t){return`${e}${t.replace(/^text/,"Text")}`}const uf={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function pf(e){return[It(e,"textFontFamily"),It(e,"textFontSettings"),{type:"row",items:[It(e,"textFontSize"),It(e,"textLineHeight"),It(e,"textLetterSpacing"),It(e,"textWordSpacing")]},It(e,"textTextAlign"),It(e,"textTextAppearance"),`${e}VerticalAlign`]}function mf(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(So.map(e=>[uf[e],pf(e)]))}}function hr(e,t){const n=i=>{const o=It(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===An?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Qs(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 on(Ut(n,t))}function el(e,t,n,i){const o=hr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function tl(e,t,n,i){const o=hr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:$.scalingValue((s-l)/2,i)}}const fn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Bi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Vi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Gi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],gf={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},hf=["hover","focus","filled","success","error"],nl=.004,Ei=.004,na=Ei,ss=50,Co=1440,To=ss/Co;function Ac(e){const t=typeof e=="number"&&e>0?e:Co;return ss/t}function ff(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 Co}const Fc={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 yf(e,t=1){const n=t/e;return Object.fromEntries(fn.map(i=>[i,n]))}function vf(){return Object.fromEntries([...Bi.map(e=>[e,0]),...Vi.map(e=>[e,0])])}function xf(){return Object.fromEntries(Gi.map(e=>[e,0]))}function qo(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Fc[t]]))}function Wc(e,t,n){const i=e-To,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const s=i/o;return{paddingLeft:t*s,paddingRight:n*s}}function ar(e,t,n){const i=ls(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,l)=>s+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function bf(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=Bi[o],l=Vi[o],d=typeof n[s]=="number"?n[s]:0,c=typeof n[l]=="number"?n[l]:0,u=Wc(t[o]??0,d,c);u.paddingLeft!==d&&(i[s]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function ls(e,t,n){if(e<=0)return[];const i=fn.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)+To;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]-To;if(p<=0)continue;const v=Math.min(c,p);d[u]-=v,c-=v}return[...d,i[e-1]]}function wf(e,t,n){if(e<=1)return{};const i=ls(e,t,n),o={};for(let s=0;s<e-1;s+=1){const l=fn[s];i[s]!==n[l]&&(o[l]=i[s])}return o}function il(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Xn]}function Sf(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function $f(e,t,n,i){const o=Math.min(i,e.length,fn.length),s={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=fn[c],p=Bi[c],v=Vi[c],y=Gi[c],g=fn[l],h=Bi[l],m=Vi[l],b=Gi[l],E=n[u],R=n[p],L=n[v],J=n[y];typeof E=="number"&&(s[g]=E),typeof R=="number"&&(s[h]=R),typeof L=="number"&&(s[m]=L),typeof J=="number"&&(s[b]=J)}return s}function _c(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 Cf(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=po(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...yf(n,o),...vf()};if(s)for(const d of Gi)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,xf());return _c(e,l)?l:e}function Tf(e,t,n){const i=nf(e);i&&(e={...e,...i});const o=Ac(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=po(e),c=po(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof l=="number"?l:Xn.length,v=L=>{if(u)return L;const J=qo({...t,...L}),W=po(L),q=ar(p,W,J),A=bf(p,q,{...t,...L});return Object.keys(A).length===0?L:{...L,...A}};if(typeof s=="number"&&s!==l)return e;const y=il(e),g=il(t);if(!Sf(y,g))return v({...e,...$f(y,g,t,p)});if(d<c&&typeof p=="number"&&!u){const L=qo({...t,...e});return v({...e,...wf(p,d,L)})}if(u){const L=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,J=Math.max(0,(d-o)/2);return L>J?{...e,textPaddingLR:J}:e}const h=qo({...t,...e}),m=ar(p,c,qo(t)),E=ar(p,d,h).some((L,J)=>L<(m[J]??L)),R=fn.some(L=>{const J=e[L],W=t[L];return typeof J=="number"&&typeof W=="number"&&J!==W});return E||R?v(e):e}function Lf(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),s=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(To,i-o-s-To)}function Rf(e,t){return Math.random()*(t-e)+e}function If(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Fc[t]]))}function ia(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Ef(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const c=Bi[d],u=Vi[d],p=Gi[d];return{key:l,textPrefix:df[l],widthKey:fn[d],width:n[fn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:s[p]}})}function Mf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:c}=$.useScopedStyles(),u=!!o,{columns:p,type:v,wrapperWidth:y,entriesCount:g,cellMinHeight:h,dividerWidth:m,showVisibility:b,cut:E,showCut:R,cutCellMinHeight:L,cutLabel:J,imageSize:W,imageOnHover:q,imagePosition:A="cursor",imageInterpolation:C="on",entryHoverEffect:O,entryHoverShowOption:w,rowPaddingTop:H,rowPaddingBottom:P,rowPaddingTopB:X,columnsOrder:k,textPaddingLR:Y,textColor:U,backgroundColor:V,dividerColor:ie,textHoverColor:S,backgroundHoverColor:M,dividerHoverColor:z}=e,[ae,re]=a.useState(void 0),[I,ue]=a.useState(null),F=a.useRef(null),oe=q==="on"&&(!n||i),Q=A==="cursor",ye=Q&&C==="on",{anchorRef:Pe,onShow:pe,onCursorMove:ce,exit:K}=Yh(!!(oe&&I!==null),ye),te=(E??0)>0,Z=v==="b",Fe=a.useRef(null),$e=a.useRef(null),[We,de]=a.useState(null),[he,be]=a.useState(Co),G=Ac(he),se=Math.max(0,((y??0)-G)/2),ge=Math.min(Y??0,se),xe=Math.max(ge,Ei),Me=((y??0)+G)/2;a.useLayoutEffect(()=>{if(!n){be(Co);return}const Te=()=>{be(ff(Fe.current))};Te();const Ne=Fe.current;if(!Ne)return;const nt=new ResizeObserver(Te);nt.observe(Ne);let ut=Ne;for(;ut&&!ut.style.getPropertyValue("--cntrl-article-width");)ut=ut.parentElement;return ut&&nt.observe(ut),()=>nt.disconnect()},[n,l]),a.useEffect(()=>{re(void 0)},[E,R,t,g]),a.useEffect(()=>{n&&!i&&re(void 0)},[n,i]);const Ce=$.buildColorVars(c,{textColor:U,backgroundColor:V,dividerColor:ie,textHoverColor:S,backgroundHoverColor:M,dividerHoverColor:z},gf,hf),N=s&&s!=="default"?`${c}-state-${s}`:"",D=`${!n||i?O==="default"?`${c}-entry-hover-default`:O==="blinds"?`${c}-entry-hover-blinds`:O==="reveal"?`${c}-entry-hover-reveal`:"":""} ${N}`.trim(),T=O==="reveal"&&(!n||i),B=(b==null?void 0:b[0])??!1,Le=(b==null?void 0:b[1])??!1,ne=a.useRef(e),_=a.useRef(l);a.useEffect(()=>{if(!d||!n){ne.current=e,_.current=l;return}if(_.current!==l){ne.current=e,_.current=l;return}const Te=ne.current;if(!(Te!==e))return;if(typeof Te.columns=="number"&&typeof e.columns=="number"&&Te.columns!==e.columns){ne.current=e;return}const nt=Tf(e,Te,{designWidth:he});ne.current=e,_c(e,nt)&&d(nt)},[e,d,n,l,he]);const ke=a.useMemo(()=>If(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Ie=a.useMemo(()=>ia(e,Bi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),Ze=a.useMemo(()=>ia(e,Vi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ke=a.useMemo(()=>ia(e,Gi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),at=a.useMemo(()=>Array.isArray(k)&&k.length>0?k:[...Xn],[k]),tt=a.useMemo(()=>Ef(at,p,ke,Ie,Ze,Ke),[at,p,ke,Ie,Ze,Ke]),Ve=po(e),fe=a.useMemo(()=>fn.slice(0,p).map(Te=>ke[Te]),[p,ke]),Ee=a.useMemo(()=>ls(p,Ve,ke),[p,Ve,ke]),De=a.useMemo(()=>ar(p,Ve,ke),[p,Ve,ke]),qe=a.useMemo(()=>tt.map((Te,Ne)=>Wc(De[Ne]??0,Te.paddingLeft,Te.paddingRight)),[tt,De]),we=a.useMemo(()=>{const Te=g===0?1/0:g;return(t??[]).slice(0,Te).map((nt,ut)=>({id:ut,cells:Object.fromEntries(Xn.map(ht=>[ht,nt[ht]??""])),image:nt.image,link:nt.link}))},[t,g]),Oe=te?ae??E:we.length,ze=a.useMemo(()=>te?we.slice(0,Oe):we,[we,te,Oe]),Ye=te&&Oe<we.length,ot=ze.length>1||Ye,Je=[B?`${c}-divider-top`:"",Le||ot?`${c}-divider-bottom`:""].filter(Boolean).join(" "),bt=!n||i,lt=()=>{if(!bt)return;const Te=ae??E;if(!R){re(we.length);return}re(Math.min(Te+R,we.length))},_e=Te=>$.scalingValue(Te,n??!1),Xe=Z?X??0:H??0,Be=P??0,pt=h??0,mt=Math.max(Be,na),gt=Xs(0,ze.length,B,Le,Ye,m??0,n??!1).borderTopWidth,kt=Z?"rowPaddingTopB":"rowPaddingTop",Xt=tt[0],Yt=tt[tt.length-1],vt=qe[0],wt=qe[qe.length-1],Gt=Xt&&vt?Math.max(vt.paddingLeft,Ei):0,Ft=Yt&&wt?Math.max(wt.paddingRight,Ei):0,xt=Ve,Nt=(Te,Ne)=>Xh(A,Fe.current,Q?Te:null,Ne),qt=(Te,Ne)=>{if(!oe)return;const nt=Te.image;if(!(nt!=null&&nt.url)){K(()=>ue(null));return}const ut=(W==null?void 0:W.min)??80,ht=(W==null?void 0:W.max)??320,Rt=(I==null?void 0:I.rowId)===Te.id,ct=Rt?I.widthPx:Rf(ut,ht),{x:Ot,y:Pt}=Nt(Ne,ct);if(Rt&&Q){ce(Ot,Pt);return}ue({rowId:Te.id,url:nt.url,objectFit:"contain",isVideo:Vh(nt),widthPx:ct}),F.current={x:Ot,y:Pt}},Zt=Te=>{if(!oe||!I||!Q)return;const{x:Ne,y:nt}=Nt(Te,I.widthPx);ce(Ne,nt)},tn=()=>{I&&K(()=>ue(null))},Ct=Te=>{T&&Us(Te,c),!(!oe||!I)&&K(()=>ue(null))},jt=Te=>{T&&Ks(Te,c)};a.useLayoutEffect(()=>{if(!I||!F.current)return;const{x:Te,y:Ne}=F.current;F.current=null,pe(Te,Ne)},[I==null?void 0:I.rowId,I==null?void 0:I.url,pe]),a.useLayoutEffect(()=>{if(!u||Z){de(null);return}const Te=$e.current,Ne=Te==null?void 0:Te.parentElement;if(!Te||!Ne){de(null);return}const nt=()=>{const ht=Te.querySelector("[data-list-row]");if(!ht){de(null);return}const Rt=Ne.getBoundingClientRect(),ct=ht.getBoundingClientRect();de(ct.top-Rt.top+ct.height/2)};nt();const ut=new ResizeObserver(nt);return ut.observe(Te),ut.observe(Ne),()=>ut.disconnect()},[u,Z,ze,Xe,Be,pt,t,e,tt,De,he,m,B,Le,Ye]);const cn=a.useMemo(()=>!Z&&rs.some(Te=>{const Ne=Te.charAt(0),nt=e[`${Te}VerticalAlign`];return kc(nt,e,Ne)}),[Z,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Ot;const Te=Fe.current;if(!Te)return;const Ne=()=>{Te.querySelectorAll("[data-list-col]").forEach(Pt=>{Pt.style.transform="";const Mt=Pt.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const zt=Pt.querySelector(`.${c}-list-col-title`);zt&&(zt.style.transform="")})};if(Z||!cn){Ne();return}const nt=()=>{const Pt=Array.from(Te.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,zt=`${c}-baseline-probe`;Pt.forEach(Bt=>{Bt.querySelectorAll("[data-list-col]").forEach(Wt=>{Wt.style.transform="";const _t=Wt.querySelector(`.${Mt}`);_t&&(_t.style.minHeight="",_t.style.height="");const At=Wt.querySelector(`.${c}-list-col-title`);At&&(At.style.transform="")})}),Pt.forEach(Bt=>{const Wt=Array.from(Bt.querySelectorAll("[data-list-col]"));lf(Bt,Wt,Mt)}),Te.offsetHeight,Pt.forEach(Bt=>{const Wt=Array.from(Bt.querySelectorAll("[data-list-col]")),_t=Bt.getBoundingClientRect().top,At=new Map,St=Wt.map(Re=>{const Ae=Re.querySelector(`.${c}-list-col-title`),it={el:Re,titleEl:Ae,letter:Re.getAttribute("data-col-letter")??"",kind:Re.getAttribute("data-valign")??"top",anchor:Re.getAttribute("data-valign-anchor")};return At.set(it.letter,it),it}),x=new Map,ve=(Re,Ae)=>{const it=x.get(Re.letter);if(it!==void 0)return it;const Et=Re.anchor?At.get(Re.anchor):void 0;if(Re.kind!=="baseline"||!Et||Ae.has(Re.letter)){const nn=ta(Re,_t,Mt,zt);return x.set(Re.letter,nn),nn}Ae.add(Re.letter);const Qe=ve(Et,Ae);Ae.delete(Re.letter);const ft=ta(Re,_t,Mt,zt),Ht=Qe-ft;cf(Re.titleEl,Ht);const Tt=ta(Re,_t,Mt,zt);return x.set(Re.letter,Tt),Tt};St.forEach(Re=>ve(Re,new Set))})};let ut=null;const ht=()=>{ut===null&&(ut=requestAnimationFrame(()=>{ut=null,nt()}))};nt();const Rt=new ResizeObserver(()=>ht());Rt.observe(Te);let ct=!1;return typeof document<"u"&&((Ot=document.fonts)!=null&&Ot.ready)&&document.fonts.ready.then(()=>{ct||ht()}),()=>{ct=!0,ut!==null&&(cancelAnimationFrame(ut),ut=null),Rt.disconnect(),Ne()}},[cn,Z,e,t,he,ze,De]);const dt=a.useMemo(()=>Zh(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:dt}}),r.jsx("div",{style:Ce,children:r.jsxs("div",{ref:Fe,className:`${c}-wrapper ${D}${Je?` ${Je}`:""}${Z?` ${c}-type-b`:""}`.trim(),style:{width:$.scalingValue(y??0,n)},onMouseMove:oe?Zt:void 0,onMouseLeave:oe?tn:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[ze.map((Te,Ne)=>{var Rt;const nt=(((Rt=Te.link)==null?void 0:Rt.length)??0)>0,ut=nt&&(!n||i)?"a":"div",ht=Xs(Ne,ze.length,B,Le,Ye,m??0,n??!1);return r.jsxs(ut,{ref:Ne===0?ct=>{$e.current=ct}:void 0,className:`${c}-list-item${nt||w==="always"?` ${c}-list-item-has-link`:""}${Ye&&Ne===ze.length-1?` ${c}-list-item-before-cut`:""}`,...nt?{href:Te.link,target:"_blank"}:{},style:ht,onMouseEnter:ct=>{T&&(nt||w==="always")&&Us(ct,c),oe&&qt(Te,ct)},onMouseLeave:ct=>{T&&(nt||w==="always")&&Ks(ct,c)},children:[Xe>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Xe)}}),r.jsxs("div",{className:`${c}-list-cols-row${Z?"":` ${c}-list-cols-row-h`}${u&&Ne===0&&Z?` ${c}-list-cols-row-controls`:""}`,...Z?{}:{"data-list-row":""},style:Z?void 0:{minHeight:_e(pt)},children:[tt.map((ct,Ot)=>{const Pt=Ot===tt.length-1,Mt=qe[Ot],zt=ct.paddingBottom,Bt=qh(Te.cells[ct.key]),Wt=Z&&Bt&&zt>0,_t=Z?{minHeight:_e(pt)}:{width:_e(De[Ot])},At=Z?{paddingLeft:_e(ge),paddingRight:_e(ge)}:{paddingLeft:_e(Mt.paddingLeft),paddingRight:_e(Mt.paddingRight)},St=ct.textPrefix.charAt(0),x=Z?tf(e[`${ct.textPrefix}VerticalAlign`]):ef(e[`${ct.textPrefix}VerticalAlign`],e,St),ve=Z&&Bt&&u&&Ne===0;return Z&&!Bt?null:r.jsxs("div",{className:Z?`${c}-list-col-wrap`:void 0,...Z?{}:{"data-list-col":"","data-col-letter":St,"data-valign":x.kind,...x.kind==="baseline"?{"data-valign-anchor":x.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${Pt?` ${c}-list-col-last`:""}`,style:{...At,..._t,...Z?{justifyContent:Js(x.kind)}:{}},"data-test":ct.width,children:r.jsx("span",{className:el(e,ct.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Qs(hr(e,ct.textPrefix),n),...tl(e,ct.textPrefix,c,n),...Z?{}:of(x.kind)},children:Te.cells[ct.key]??null})}),Wt&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(zt)}}),ve&&r.jsx("div",{"data-controls":ct.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:_e(Math.max(zt,na))}})]},ct.key)}),u&&Ne===0&&Z&&r.jsxs(r.Fragment,{children:[r.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:_e(xe),height:"100%"}}),r.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:_e(Math.max(xe,Ve-xe)),width:_e(xe),height:"100%"}})]})]}),!Z&&Be>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:_e(Be)}}),u&&Ne===0&&!Z&&r.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:_e(mt)}})]},Te.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":kt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":Z?"center":"left-y",className:`${c}-control-anchor`,style:{top:gt,left:0,width:"100%",height:_e(Math.max(Xe,na))}})},"row-padding-handles"),u&&!Z&&Xt&&Yt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Xt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[0]-((vt==null?void 0:vt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":We??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:_e(Gt),height:"100%"}}),r.jsx("div",{"data-controls":Yt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[tt.length-1]-((wt==null?void 0:wt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":We??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(xt-Ft),width:_e(Ft),height:"100%"}})]},"column-edge-padding-handles"),u&&!Z&&tt.slice(0,-1).map((Te,Ne)=>{const nt=tt[Ne+1],ut=Ee.slice(0,Ne+1).reduce((Pt,Mt)=>Pt+Mt,0),ht=qe[Ne],Rt=qe[Ne+1],ct=Math.max(ht.paddingRight,Ei),Ot=Math.max(Rt.paddingLeft,Ei);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Te.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[Ne]-ht.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":We??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(ut-ct),width:_e(ct),height:"100%"}}),r.jsx("div",{"data-controls":nt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[Ne+1]-Rt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":We??void 0,className:`${c}-control-anchor`,style:{top:0,left:_e(ut),width:_e(Ot),height:"100%"}})]},`${Te.paddingRightKey}-padding`)}),u&&!Z&&tt.slice(0,-1).map((Te,Ne)=>{const nt=Lf(Ne,Ee,fe,Ve),ht=Ee.slice(0,Ne+1).reduce((Rt,ct)=>Rt+ct,0)-nl/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Te.widthKey,"data-controls-axis":"x","data-controls-min":String(ss),"data-controls-max-fraction":String(nt),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:_e(ht),width:_e(nl),height:"calc(100%)",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)})]}),Ye&&(()=>{const Te=hr(e,An),Ne=rf(e.cutLabelVerticalAlign),nt=Te.textTextAlign==="justify"||Z;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:_e(L??0),cursor:bt?"pointer":"default",...Uh(Le,m??0,n??!1)},onClick:bt?lt:void 0,onMouseEnter:T||oe?Ct:void 0,onMouseLeave:T?jt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...Z?{paddingLeft:_e(ge),paddingRight:_e(ge)}:{},justifyContent:af(Te.textTextAlign),alignItems:Js(Ne)},children:r.jsx("span",{className:el(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Qs(Te,n),...tl(e,An,c,n),...nt?{width:"100%"}:{}},children:J})})})})(),oe&&I&&(()=>{const Te=`${I.widthPx}px`,Ne={width:Te,height:"auto",maxHeight:Te,objectFit:"contain"};return r.jsx("div",{ref:Pe,className:`${c}-hover-media-anchor`,children:r.jsx(Gh,{media:I,className:I.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Ne},`${I.rowId}-${I.url}`)})})()]})})]})}const Pf=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10040
10121
|
import { CommonComponentProps } from '../props';
|
|
10041
10122
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
10042
10123
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -13124,7 +13205,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13124
13205
|
</>
|
|
13125
13206
|
);
|
|
13126
13207
|
}
|
|
13127
|
-
`,Qi=["A","B","C","D","E"],ol=[...Ra,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],ri={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function $f(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Uo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Cf(){return Object.fromEntries(Qi.map((e,t)=>{const n=Xn[t],i=`${e} column`;return[n,$f(i)]}))}function Tf(){const e={};for(const t of Qi)e[`${t}ColumnWidth`]=Uo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Uo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Uo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Uo(`${t} column padding bottom`);return e}function rl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Xn]};for(const s of Qi)i[`${s}ColumnWidth`]=s==="A"?.0798:.32,i[`${s}ColumnPaddingLeft`]=0,i[`${s}ColumnPaddingRight`]=0,i[`${s}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Lf(e){const t={};if(e===An)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Ra]},enum:[...Ra]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ol],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...ol]}}return t[It(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[It(e,"textFontSettings")]={...ri.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[It(e,"textFontSize")]={...ri.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[It(e,"textLineHeight")]={...ri.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[It(e,"textLetterSpacing")]={...ri.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[It(e,"textWordSpacing")]={...ri.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[It(e,"textTextAlign")]={...ri.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[It(e,"textTextAppearance")]={...ri.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Rf=So.reduce((e,t)=>({...e,...Lf(t)}),{});function If(e){return{verticalAlign:e===An?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===An?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Ef(e,t={}){var n;return{...If(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const al=new Set(["textFontFamily","textFontSettings"]);function Mf(e,t,n){const i=s=>n===void 0?!0:n==="common"?al.has(s):!al.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=as(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[It(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[It(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[It(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[It(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[It(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[It(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[It(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[It(e,"textTextAppearance")]=t.textTextAppearance),o}function sr(e={},t){return So.reduce((n,i)=>({...n,...Mf(i,Ef(i,e),t)}),{})}const Pf=sr(),kf=of();function Nc(e){return[It(e,"textFontFamily"),It(e,"textFontSettings"),It(e,"textFontSize"),It(e,"textLineHeight"),It(e,"textLetterSpacing"),It(e,"textWordSpacing"),It(e,"textTextAlign"),It(e,"textTextAppearance"),`${e}VerticalAlign`]}function Af(){const e=[];return rs.forEach((t,n)=>{const i=Xn[n],o=Nc(t);for(let s=1;s<Xn.length;s+=1){const l=[{name:"columns",value:s},...Array.from({length:s},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const Ff=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Nc(An);const Wf=[...Qi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ai=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],_f=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ai[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ai[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ai[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ai[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ai[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ai[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ai[6],link:""}],Nf=[...Qi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Hf={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...Cf(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:_f},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Amount",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imagePosition:{type:"string",scope:"layout",title:"Image Position",display:{type:"toggle-cycle",enum:["left","center","right","cursor"]}},imageInterpolation:{type:"boolean",scope:"common",title:"Interpolation",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...Tf(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},...Rf,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",imagePosition:"cursor",imageInterpolation:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...Pf,...sr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:rl({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...sr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:rl({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...sr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Af(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Wf.map(e=>({if:{name:"type",value:"b"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...Qi.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),{if:{name:"imagePosition",value:"cursor",isNotEqual:!0},then:{name:"properties.imageInterpolation.display.enabled",value:!1}}],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imagePosition","imageInterpolation","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Nf]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"Entries",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["imagePosition","imageInterpolation"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",kf]}],paletteBookmark:{items:[...Ff],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Of={element:wf,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>hf(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...So.map(e=>({path:`${It(e,"textFontFamily")}`}))]},fontRelations:{...So.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${It(t,"textFontFamily")}`}),{})},schema:Hf,sourceCode:Sf},sl=300,Hn=.004,Df={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},jf=["hover","focus","filled","success","error"];function zf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ll(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function cl(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:$.scalingValue((o-t)/2,i)}}function Bf(e){return`
|
|
13208
|
+
`,Qi=["A","B","C","D","E"],ol=[...Ra,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],ri={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function kf(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Uo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Af(){return Object.fromEntries(Qi.map((e,t)=>{const n=Xn[t],i=`${e} column`;return[n,kf(i)]}))}function Ff(){const e={};for(const t of Qi)e[`${t}ColumnWidth`]=Uo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Uo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Uo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Uo(`${t} column padding bottom`);return e}function rl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Xn]};for(const s of Qi)i[`${s}ColumnWidth`]=s==="A"?.0798:.32,i[`${s}ColumnPaddingLeft`]=0,i[`${s}ColumnPaddingRight`]=0,i[`${s}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Wf(e){const t={};if(e===An)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Ra]},enum:[...Ra]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ol],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...ol]}}return t[It(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[It(e,"textFontSettings")]={...ri.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[It(e,"textFontSize")]={...ri.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[It(e,"textLineHeight")]={...ri.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[It(e,"textLetterSpacing")]={...ri.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[It(e,"textWordSpacing")]={...ri.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[It(e,"textTextAlign")]={...ri.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[It(e,"textTextAppearance")]={...ri.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const _f=So.reduce((e,t)=>({...e,...Wf(t)}),{});function Hf(e){return{verticalAlign:e===An?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===An?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Nf(e,t={}){var n;return{...Hf(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const al=new Set(["textFontFamily","textFontSettings"]);function Of(e,t,n){const i=s=>n===void 0?!0:n==="common"?al.has(s):!al.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=as(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[It(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[It(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[It(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[It(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[It(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[It(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[It(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[It(e,"textTextAppearance")]=t.textTextAppearance),o}function sr(e={},t){return So.reduce((n,i)=>({...n,...Of(i,Nf(i,e),t)}),{})}const Df=sr(),jf=mf();function Hc(e){return[It(e,"textFontFamily"),It(e,"textFontSettings"),It(e,"textFontSize"),It(e,"textLineHeight"),It(e,"textLetterSpacing"),It(e,"textWordSpacing"),It(e,"textTextAlign"),It(e,"textTextAppearance"),`${e}VerticalAlign`]}function zf(){const e=[];return rs.forEach((t,n)=>{const i=Xn[n],o=Hc(t);for(let s=1;s<Xn.length;s+=1){const l=[{name:"columns",value:s},...Array.from({length:s},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const Bf=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Hc(An);const Vf=[...Qi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ai=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],Gf=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ai[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ai[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ai[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ai[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ai[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ai[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ai[6],link:""}],qf=[...Qi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Uf={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...Af(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:Gf},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Amount",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imagePosition:{type:"string",scope:"layout",title:"Image Position",display:{type:"toggle-cycle",enum:["left","center","right","cursor"]}},imageInterpolation:{type:"boolean",scope:"common",title:"Interpolation",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...Ff(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},..._f,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",imagePosition:"cursor",imageInterpolation:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...Df,...sr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:rl({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...sr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:rl({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...sr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...zf(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Vf.map(e=>({if:{name:"type",value:"b"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...Qi.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),{if:{name:"imagePosition",value:"cursor",isNotEqual:!0},then:{name:"properties.imageInterpolation.display.enabled",value:!1}}],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imagePosition","imageInterpolation","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...qf]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"Entries",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["imagePosition","imageInterpolation"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",jf]}],paletteBookmark:{items:[...Bf],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Kf={element:Mf,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Cf(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...So.map(e=>({path:`${It(e,"textFontFamily")}`}))]},fontRelations:{...So.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${It(t,"textFontFamily")}`}),{})},schema:Uf,sourceCode:Pf},sl=300,Nn=.004,Xf={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},Yf=["hover","focus","filled","success","error"];function Zf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ll(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function cl(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:$.scalingValue((o-t)/2,i)}}function Jf(e){return`
|
|
13128
13209
|
.${e}-wrapper {
|
|
13129
13210
|
box-sizing: border-box;
|
|
13130
13211
|
display: flex;
|
|
@@ -13186,7 +13267,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13186
13267
|
display: flex;
|
|
13187
13268
|
align-items: center;
|
|
13188
13269
|
justify-content: space-between;
|
|
13189
|
-
gap: ${
|
|
13270
|
+
gap: ${Zf(20)};
|
|
13190
13271
|
width: 100%;
|
|
13191
13272
|
min-width: 0;
|
|
13192
13273
|
min-height: var(--${e}-question-min-height, unset);
|
|
@@ -13289,7 +13370,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13289
13370
|
pointer-events: none;
|
|
13290
13371
|
z-index: 2;
|
|
13291
13372
|
}
|
|
13292
|
-
`}function dl(e,t,n,i,o,s,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:s??0,textAppearance:l,color:d??"#000000"}}function
|
|
13373
|
+
`}function dl(e,t,n,i,o,s,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:s??0,textAppearance:l,color:d??"#000000"}}function Qf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s}){const{prefix:l}=$.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:v="solid",entryHoverEffect:y="default",autoclose:g="off",icon:h,iconMaxWidth:m=.00833,iconPaddingRight:b=0,iconAnimation:E="rotate 45",questionColor:R="#000000",answerColor:L="#000000",dividerColor:J="#0000001F",iconColor:W="#000000",questionHoverColor:q="#666666",iconHoverColor:A="#666666",iconActiveColor:C="#000000",dividerHoverColor:O="#000000",questionFontFamily:w,questionFontSettings:H,questionFontSize:P,questionLineHeight:X,questionLetterSpacing:k,questionWordSpacing:Y,questionTextAppearance:U,answerFontFamily:V,answerFontSettings:ie,answerFontSize:S,answerLineHeight:M,answerLetterSpacing:z,answerWordSpacing:ae,answerTextAppearance:re,questionPaddingLeft:I=0,questionPaddingTop:ue=0,questionPaddingBottom:F=0,answerPaddingLeft:oe=0,answerPaddingRight:Q=0,answerPaddingTop:ye=0,answerPaddingBottom:Pe=0}=e,pe=t??[],[ce,K]=a.useState(()=>new Set),te=!n||i;a.useEffect(()=>{K(new Set)},[g]),a.useEffect(()=>{n&&!o&&!i&&K(new Set)},[n,o,i]);const Z=qe=>$.scalingValue(qe,n??!1),Fe=Math.max(I,Nn),$e=Math.max(ue,Nn),We=Math.max(F,Nn),de=Math.max(oe,Nn),he=Math.max(Q,Nn),be=Math.max(ye,Nn),G=Math.max(Pe,Nn),se=Math.max(0,(c??1)-b-m),ge=Math.max(0,(c??1)-Q),xe=Math.max(0,(c??1)-oe),Me=Math.max(b,Nn),Ce=Math.max(0,(c??1)-I-m),N=a.useMemo(()=>ce.size===0?0:Math.min(...ce),[ce]),me=a.useCallback(qe=>ce.has(qe),[ce]),D=te&&y==="default"?`${l}-entry-hover-default`:"",T=h??"",B=T!=="",Le=E.replace(/^rotate /,""),ne=`${l}-icon-anim-${Le}`,_=on(Ut(dl(w,H,P,X,k,Y,U,R),n)),ke=on(Ut(dl(V,ie,S,M,z,ae,re,L),n)),Ie=ll(P,X,`${l}-question`,`${l}-text-tight-leading`),Ze=ll(S,M,`${l}-answer-text`,`${l}-text-tight-leading`),Ke=cl(P,X,l,n),at=cl(S,M,l,n),tt=$.buildColorVars(l,{questionColor:R,answerColor:L,dividerColor:J,iconColor:W,questionHoverColor:q,iconHoverColor:A,iconActiveColor:C,dividerHoverColor:O},Xf,Yf),Ve=s&&s!=="default"?`${l}-state-${s}`:"",fe=a.useCallback(qe=>{te&&K(we=>{if(we.has(qe)){const ze=new Set(we);return ze.delete(qe),ze}if(g==="on")return new Set([qe]);const Oe=new Set(we);return Oe.add(qe),Oe})},[te,g]),Ee=a.useMemo(()=>Jf(l),[l]),De={[`--${l}-divider-width`]:$.scalingValue(p,n??!1),[`--${l}-divider-style`]:v,[`--${l}-icon-max-width`]:$.scalingValue(m,n??!1),...u>0?{[`--${l}-question-min-height`]:$.scalingValue(u,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ee}}),r.jsx("div",{style:tt,children:r.jsx("div",{className:st(`${l}-wrapper`,n&&!i&&`${l}-editor`,D,Ve),style:{width:$.scalingValue(c,n??!1),maxWidth:"100%",...De},children:pe.map((qe,we)=>{var bt;const Oe=me(we),ze=((bt=qe.question)==null?void 0:bt.trim())??"",Ye=qe.answer,ot=((Ye==null?void 0:Ye.length)??0)>0,Je=d&&we===N;return r.jsxs("div",{className:st(`${l}-item`,Oe&&`${l}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${l}-question-controls`,children:[Je&&r.jsxs(r.Fragment,{children:[r.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:Z($e)}}),r.jsx("div",{"data-controls":"questionPaddingLeft","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:Z(Fe),height:"100%"}}),r.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:Z(Me),height:"100%"}})]}),r.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":Oe,style:{..._,...Ke,paddingLeft:Z(I),paddingRight:Z(b)},onClick:()=>fe(we),children:[ue>0&&r.jsx("span",{className:`${l}-padding-handle`,style:{height:Z(ue)},"aria-hidden":"true"}),r.jsxs("span",{className:`${l}-question-row`,children:[r.jsx("span",{className:Ie,children:ze}),ot&&(B?r.jsx("span",{className:`${l}-icon ${l}-icon-custom ${ne}`,"aria-hidden":"true",children:r.jsx(rn,{url:T,fill:`var(--${l}-icon-color)`,hoverFill:`var(--${l}-icon-hover-color, var(--${l}-icon-color))`,className:`${l}-icon-image`})}):r.jsx("span",{className:`${l}-icon ${l}-icon-default ${ne}`,"aria-hidden":"true"}))]}),F>0&&r.jsx("span",{className:`${l}-padding-handle`,style:{height:Z(F)},"aria-hidden":"true"})]}),Je&&r.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:Z(We)}})]}),ot&&Ye&&r.jsx("div",{className:`${l}-panel`,"aria-hidden":!Oe,children:r.jsx("div",{className:`${l}-panel-inner`,children:r.jsxs("div",{className:`${l}-answer-controls`,children:[Je&&Oe&&r.jsxs(r.Fragment,{children:[r.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:Z(be)}}),r.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ge),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:Z(de),height:"100%"}}),r.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(xe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:Z(he),height:"100%"}})]}),ye>0&&r.jsx("div",{className:`${l}-padding-handle`,style:{height:Z(ye)}}),r.jsx("div",{className:`${l}-answer`,style:{...ke,...at,paddingLeft:Z(oe),paddingRight:Z(Q)},children:r.jsx("div",{className:Ze,children:r.jsx(yi,{content:Ye})})}),Pe>0&&r.jsx("div",{className:`${l}-padding-handle`,style:{height:Z(Pe)}}),Je&&Oe&&r.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:Z(G)}})]})})})]},we)})})})]})}const ey=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13293
13374
|
import cn from 'classnames';
|
|
13294
13375
|
import { CommonComponentProps } from '../props';
|
|
13295
13376
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -14037,7 +14118,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14037
14118
|
</>
|
|
14038
14119
|
);
|
|
14039
14120
|
}
|
|
14040
|
-
`;function On(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ul={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},qf=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Uf={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:On("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:{...ul.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:{...ul.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:On("Question Padding Left"),questionPaddingTop:On("Question Padding Top"),questionPaddingBottom:On("Question Padding Bottom"),answerPaddingLeft:On("Answer Padding Left"),answerPaddingRight:On("Answer Padding Right"),answerPaddingTop:On("Answer Padding Top"),answerPaddingBottom:On("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:[...qf],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Kf={element:Vf,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:Uf,sourceCode:Gf},Fn=e=>e.display==="cover",Ar=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},pl=100,Xf=.2,ml=8,Hc=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=a.useState(0),[l,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const p=a.useMemo(()=>typeof window>"u"?pl:Math.max(pl,window.innerHeight*Xf),[]),w=a.useCallback(y=>Math.max(0,1-y/(p*1.5)),[p]),b=a.useCallback(y=>Math.max(0,1-y/(p*.45)),[p]),h=a.useCallback(y=>{const N=typeof window<"u"?window.innerHeight:800,I=Math.max(.88,1-y/N*.12);return`translateY(${y}px) scale(${I})`},[]),g=a.useCallback(()=>{c.current=null},[]),m=a.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),x=a.useCallback(()=>{const y=typeof window<"u"?window.innerHeight:800;d(!0),s(y),window.setTimeout(()=>{t(),g(),d(!1)},Math.min(n,200))},[n,t,g]),M=a.useCallback(y=>{!e||l||y.pointerType==="touch"&&(i!=null&&i(y.target)||(c.current={startX:y.clientX,startY:y.clientY,isLocked:null,pointerId:y.pointerId}))},[e,l,i]),E=a.useCallback(y=>{const N=c.current;if(!e||!N||y.pointerType!=="touch"||N.pointerId!==y.pointerId)return;const I=y.clientX-N.startX,J=y.clientY-N.startY;if(N.isLocked===null){if(Math.abs(I)<ml&&Math.abs(J)<ml)return;if(J>0&&J>Math.abs(I))N.isLocked=!0,y.currentTarget.setPointerCapture(y.pointerId);else{N.isLocked=!1,g();return}}if(!N.isLocked)return;y.preventDefault();const k=Math.max(0,J);u.current=k,s(k)},[e,g]),R=a.useCallback(y=>{const N=c.current;if(!e||!N||y.pointerType!=="touch"||N.pointerId!==y.pointerId)return;const I=N.isLocked===!0;if(y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),!I){g();return}y.clientY-N.startY>=p?x():m()},[p,x,e,g,m]),Z=a.useCallback(y=>{R(y)},[R]),_=a.useCallback(y=>{R(y)},[R]),U=o>0,F=l?`transform ${n}ms ease`:"none",C=l?`opacity ${n}ms ease`:"none",z=o>0||l;return{isSwipeDragging:U,backdropStyle:{opacity:w(o),transition:C},mediaAreaStyle:{transform:h(o),transition:F,touchAction:U?"none":void 0,willChange:U?"transform":void 0},overlayContentStyle:z?{opacity:b(o),transition:C}:void 0,swipeHandlers:e?{onPointerDown:M,onPointerMove:E,onPointerUp:Z,onPointerCancel:_}:{},dismissAreaStyle:e?{touchAction:U?"none":"pan-x"}:void 0}},Yf="[data-lightbox-scrollable]",Oc=()=>{a.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,s=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(Yf)||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=s,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},Zf=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Jf=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Qf=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},ey=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(g,m)=>{Jf(t),e.scrollLeft=g,m&&(s==null||s())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,w=0;const b=()=>{t.removeEventListener("transitionend",h),clearTimeout(w)},h=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,b(),u(n,!0))};return t.addEventListener("transitionend",h),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)`,w=window.setTimeout(()=>{p||(p=!0,b(),u(n,!0))},i+64),()=>{p||(p=!0,b(),u(l-Qf(t),!1))}},mo=300,ty=900,ny=1500,iy="cubic-bezier(0.16, 1, 0.3, 1)",oy=3e3,ry=2,ay=16,sy=.05,ly=1,Ko=.3,cy=50,dy=20,$i=.004,qi=["title1","title2","title3"],uy={title1:"1",title2:"2",title3:"3"},py={title1:"title1Color",title2:"title2Color",title3:"title3Color"},my={title1:.02,title2:.02,title3:.02},Xo=e=>`max(${e}, ${dy}px)`,gy=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]}},hy=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=gy(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Dt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,fy=e=>[Dt(e,"fontFamily"),Dt(e,"fontSettings"),{type:"row",items:[Dt(e,"fontSize"),Dt(e,"lineHeight"),Dt(e,"letterSpacing"),Dt(e,"wordSpacing")]},Dt(e,"textAlign"),Dt(e,"textAppearance")],yy=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(qi.map(e=>[uy[e],fy(e)]))}),cs=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Dc=(e,t)=>cs(e,t),Yo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},gl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:cs(e.length,n),effective:Dc(e.length,n)}},vy=(e,t,n,i,o,s,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:s,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},oa=(e,t)=>{const n=i=>{const o=Dt(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[py[t]]}},xy=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),ra=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??my[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)},by=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:w,closeIcon:b,closeIconMaxWidth:h,closeIconColor:g,closeIconHoverColor:m,thumbnailTrigger:x,thumbnailVisibility:M,thumbnailObjectFit:E,thumbnailActive:R,thumbnailActiveColor:Z,title1Width:_,title2Width:U,title3Width:F,title1MarginLeft:C=0,title2MarginLeft:z=0,title3MarginLeft:y=0,titleRowMarginBottom:N=0,titleHeaderLayout:I="desktop",contentMarginTop:J,iconMarginLeft:k}=n,X=f=>$.scalingValue(f,i??!1),G=c??n.thumnailSize??.03,V=X(G),oe=X(u),S=X(p??.02),P=X(w??0),D=X(J??0),re=Xo(D),ae=X(k??0),[T,ue]=a.useState(0),W=a.useRef(T);W.current=T;const ie=t[T],{title1:ne,title2:ye,title3:Pe}=hy(ie),me=ra("title1",oa(n,"title1"),i),le=ra("title2",oa(n,"title2"),i),K=ra("title3",oa(n,"title3"),i),ee=I==="mobile",Y=!o&&(!i||s),We=Y,$e=Y,Ae=Y,de=Fn(E),he=de?{"--image-aspect-ratio":Ar(E)}:void 0,be=!!(ne||ye||Pe),q=a.useMemo(()=>vy(e,ne,ye,Pe,me,le,K),[e,T,ne,ye,Pe,me,le,K]),se=a.useMemo(()=>({title1Width:_,title2Width:U,title3Width:F}),[_,U,F]),ge=a.useMemo(()=>q.map(f=>se[f.widthKey]),[q,se]),xe=a.useMemo(()=>cs(q.length,ge),[q.length,ge]),Ee=a.useMemo(()=>Dc(q.length,ge),[q.length,ge]),Ce=a.useMemo(()=>q.filter(f=>f.prefix==="title1"),[q]),H=a.useMemo(()=>q.filter(f=>f.prefix==="title2"||f.prefix==="title3"),[q]),pe=a.useMemo(()=>gl(Ce,se),[Ce,se]),O=a.useMemo(()=>gl(H,se),[H,se]),L=a.useCallback((f,j)=>{const te=q.indexOf(f);if(!ee||j==="single-row")return{effectiveWidth:Ee[te]??0,resolvedWidth:xe[te]??0,maxWidth:Yo(te,xe)};if(j==="two-row-top"){const Ne=Ce.indexOf(f);return{effectiveWidth:pe.effective[Ne]??0,resolvedWidth:pe.resolved[Ne]??0,maxWidth:Yo(Ne,pe.resolved)}}const we=H.indexOf(f);return{effectiveWidth:O.effective[we]??0,resolvedWidth:O.resolved[we]??0,maxWidth:Yo(we,O.resolved)}},[H,O,Ee,xe,q,Ce,pe,ee]),B=a.useCallback(f=>$.scalingValue(f,i??!1),[i]),Re=B(N??0),Q=a.useMemo(()=>({title1MarginLeft:C,title2MarginLeft:z,title3MarginLeft:y}),[C,z,y]),A=a.useCallback(f=>q.slice(0,f+1).reduce((j,te,we)=>j+(te!=null&&te.marginLeftKey?Q[te.marginLeftKey]??0:0)+(xe[we]??0),0)+(ee?0:C??0),[q,Q,xe,ee,C]),Fe=a.useCallback(()=>ee?0:C??0,[ee,C]),Me=a.useCallback(f=>H.slice(0,f).reduce((j,te,we)=>j+(te.marginLeftKey?Q[te.marginLeftKey]??0:0)+(O.resolved[we]??0),0),[H,O.resolved,Q]),Qe=a.useCallback(f=>{const j=H[f];return Me(f)+(j.marginLeftKey?Q[j.marginLeftKey]??0:0)+(O.resolved[f]??0)},[H,O.resolved,Me,Q]),Ke=(f,j)=>{const te=f.marginLeftKey?Q[f.marginLeftKey]??0:0,{effectiveWidth:we,resolvedWidth:Ne,maxWidth:Ue}=L(f,j),yt=o&&j==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":f.prefix,style:{...j==="single-row"?{gridArea:f.prefix}:{},width:B(we),...te>0?{marginLeft:B(te)}:{}},children:[r.jsx("p",{className:f.className,style:f.style,children:f.text}),yt&&f.marginLeftKey&&r.jsx("div",{"data-controls":f.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:B(-te),width:`max(${B(te)}, 10px)`,height:"100%",pointerEvents:"auto"}}),yt&&r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:B(-$i/2),width:B($i),height:"100%",pointerEvents:"auto"}})]},f.className)},lt=()=>{const f=ee?-1:q.findIndex(we=>we.prefix==="title1"),j=!ee&&(o||(C??0)>0)?(()=>{const we=C??0,Ne=f>=0?xe[f]:_??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:0,width:`max(${B(we)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,te=q.flatMap((we,Ne)=>{if(!we.marginLeftKey)return[];const Ue=Q[we.marginLeftKey]??0,yt=xy(q,xe,Q,Ne)+Fe();return r.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe[Ne]),style:{position:"absolute",top:0,left:B(yt),width:`max(${B(Ue)}, 10px)`,height:"100%",pointerEvents:"auto"}},we.marginLeftKey)});return j?[j,...te]:te},tt=()=>q.map((f,j)=>{const te=Yo(j,xe),Ne=A(j)-$i/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(te),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:B(Ne),width:B($i),height:"100%",pointerEvents:"auto"}})},`${f.widthKey}-junction`)}),Be=()=>H.flatMap((f,j)=>{if(!f.marginLeftKey)return[];const te=Q[f.marginLeftKey]??0,we=Me(j),{resolvedWidth:Ne}=L(f,"two-row-bottom");return r.jsx("div",{"data-controls":f.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:B(we),width:`max(${B(te)}, 10px)`,height:"100%",pointerEvents:"auto"}},f.marginLeftKey)}),fe=()=>H.map((f,j)=>{const{maxWidth:te}=L(f,"two-row-bottom"),Ne=Qe(j)-$i/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(te),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:B(Ne),width:B($i),height:"100%",pointerEvents:"auto"}})},`${f.widthKey}-junction`)}),Ie=a.useRef(null),De=a.useRef(null),qe=a.useRef(null),Se=a.useRef(null),_e=a.useRef([]),Ve=a.useRef([]),Xe=a.useRef(0),at=a.useRef(null),et=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),$t=a.useRef(null),ut=a.useRef(null),He=a.useRef(0),Ye=a.useRef("forward"),ze=a.useRef(0),pt=a.useRef(null),mt=a.useRef(!1),gt=t.length>1&&(!o||!!s),kt=gt?3:1,Xt=a.useMemo(()=>Array.from({length:kt},()=>t).flat(),[t,kt]),[Yt,vt]=a.useState(!1),[bt,Gt]=a.useState(!1),[Ft,xt]=a.useState(!0),Ht=a.useRef(null),qt=a.useRef(null),Zt=a.useRef(!1),tn=a.useRef(!1),Ct=a.useRef(null),jt=a.useRef(null),cn=We&&!Ft,ct=a.useCallback(()=>{We&&(xt(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{et.current.isActive||xt(!1)},oy))},[We]),Te=a.useCallback(()=>{o||tn.current||(tn.current=!0,Gt(!1),Ct.current=setTimeout(()=>{l()},mo))},[o,l]),Oe=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":cn?"true":"false",style:{width:$.scalingValue(h??0,i),height:$.scalingValue(h??0,i),marginRight:ae,"--close-icon-hover-color":m},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Te,"aria-label":"Close",children:r.jsx(rn,{url:b,fill:g,hoverFill:i&&!s?g:m,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ae,height:"100%",pointerEvents:"auto"}})]}),nt=(f="two-row")=>r.jsx("div",{...f==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:B(C??0),flexShrink:0,...f==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...f==="two-row"&&o?{pointerEvents:"auto"}:{}}}),dt=()=>{const f=q.find(we=>we.prefix==="title1"),j=q.filter(we=>we.prefix==="title2"||we.prefix==="title3"),te=j.length>0||o||(N??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(C??0)>0||o?nt():null,f&&Ke(f,"two-row-top"),b&&Oe()]}),te?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[j.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[j.map(we=>Ke(we,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[Be(),fe()]})]}):null,r.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:Re,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ht=()=>r.jsxs(r.Fragment,{children:[(C??0)>0||o?nt("single-row"):null,q.map(f=>Ke(f,"single-row")),o?r.jsxs(r.Fragment,{children:[lt(),tt()]}):null,b?Oe():null]}),Rt=a.useCallback(f=>!!(f.closest("[data-controls]")||f.closest(`.${e}-thumbnails`)||f.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:st,backdropStyle:Ot,mediaAreaStyle:Pt,overlayContentStyle:Mt,swipeHandlers:zt,dismissAreaStyle:Bt}=Hc({enabled:Y??!1,onClose:Te,animMs:mo,isBlockedTarget:Rt}),Wt=()=>{if(!gt||t.length===0)return Xe.current=0,0;const f=Ve.current[0],j=Ve.current[t.length];if(!f||!j)return Xe.current;const te=j.offsetLeft-f.offsetLeft;return te>0&&(Xe.current=te),Xe.current},_t=(f=!1)=>{if(!gt)return;const j=De.current,te=Wt();!j||te<=0||te<j.clientWidth*.25||(j.scrollLeft<=0?(j.scrollLeft+=te,f&&(et.current.scrollLeft+=te),mt.current&&(ze.current+=te)):j.scrollLeft>=te*2&&(j.scrollLeft-=te,f&&(et.current.scrollLeft-=te),mt.current&&(ze.current-=te)))},At=(f,j=(te=>(te=De.current)==null?void 0:te.scrollLeft)()??0)=>{if(!gt)return f;let we=t.length+f,Ne=1/0;for(let Ue=0;Ue<kt;Ue++){const yt=Ue*t.length+f,Lt=Ve.current[yt];if(!Lt)continue;const en=Math.abs(Lt.offsetLeft-j);en<Ne&&(Ne=en,we=yt)}return we},wt=f=>{const j=De.current;return!f||!j?!1:f.offsetWidth>j.clientWidth+1},v=f=>{const j=De.current;if(!f||!j||!wt(f))return!1;const te=f.offsetLeft,we=te+f.offsetWidth;return j.scrollLeft>=te-1&&j.scrollLeft+j.clientWidth<=we+1},ve=(f=(j=>(j=De.current)==null?void 0:j.scrollLeft)()??0)=>{for(let we=0;we<Ve.current.length;we+=1){const Ne=Ve.current[we];if(Ne&&v(Ne))return we}let te={flatIndex:0,distance:1/0};return Ve.current.forEach((we,Ne)=>{if(!we)return;const Ue=Math.abs(we.offsetLeft-f);Ue<te.distance&&(te={flatIndex:Ne,distance:Ue})}),te.flatIndex},Le=f=>{De.current&&Ve.current.forEach(j=>{j&&(j.style.scrollSnapAlign=wt(j)&&f==="backward"?"end":"start")})},ke=(f,j,te)=>{const we=f-j,Ne=ve(j),Ue=Ve.current[Ne];if(v(Ue))return ve(f)%t.length;const yt=Ve.current[Ne+1],Lt=Ue?yt?yt.offsetLeft-Ue.offsetLeft:Ue.offsetWidth:0,en=Lt>0?we>Lt*Ko?1:we<-Lt*Ko?-1:0:0;return en===0?te:gt?(te+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,te+en))},it=a.useCallback((f=!1)=>{if(M!=="on"||o)return;const j=Se.current,te=W.current,we=_e.current[te];if(!j||!we||j.scrollWidth<=j.clientWidth)return;const Ne=j.scrollLeft,Ue=Ne+j.clientWidth,yt=we.offsetLeft,Lt=yt+we.offsetWidth;if(yt>=Ne&&Lt<=Ue)return;const en=j.scrollWidth-j.clientWidth;let Jt=Ne;if(!f&&Ht.current===null){const bi=_e.current[te-1],eo=_e.current[te+1],Ho=bi?we.offsetLeft-bi.offsetLeft:eo?eo.offsetLeft-we.offsetLeft:we.offsetWidth;Lt>Ue?Jt+=Ho:yt<Ne&&(Jt-=Ho)}else Lt>Ue?Jt=Lt-j.clientWidth:Jt=yt;j.scrollLeft=Math.max(0,Math.min(en,Jt))},[o,M]),Et=a.useCallback((f=!1)=>{f&&(Zt.current=!0),qt.current===null&&(qt.current=requestAnimationFrame(()=>{qt.current=null;const j=Zt.current;Zt.current=!1,it(j)}))},[it]),Ze=a.useCallback(f=>{if(f===W.current)return;const j=W.current;W.current=f;const te=Math.abs(f-j)>1,we=gt&&t.length>1&&(j===t.length-1&&f===0||j===0&&f===t.length-1);ue(f),Et(te||we)},[t.length,gt,Et]),ft=()=>{if(!De.current||t.length===0||Ht.current!==null||et.current.isActive&&et.current.hasMoved)return;const f=De.current.scrollLeft,j=ve(f)%t.length;j!==W.current&&Ze(j)},Nt=()=>{Ht.current=null},Tt=f=>{const j=De.current;j&&(j.style.scrollSnapType=f?"":"none")},nn=()=>{var f;(f=ut.current)==null||f.call(ut),ut.current=null},dn=()=>{pt.current!==null&&(cancelAnimationFrame(pt.current),pt.current=null),mt.current=!1},ei=()=>{const f=De.current;if(!f){pt.current=null,mt.current=!1;return}const j=ze.current-f.scrollLeft;if(Math.abs(j)<.5){f.scrollLeft=ze.current,_t(),ft(),pt.current=null,mt.current=!1;return}f.scrollLeft+=j*sy,_t(),ft(),ct(),pt.current=requestAnimationFrame(ei)},ti=()=>{const f=qe.current;f&&(f.style.transition="",f.style.transform="",f.style.willChange="")},Fo=(f,j,te,we)=>{ti(),f.scrollLeft=j,He.current=f.scrollLeft,_t(),te!==void 0?(W.current=te,ue(te)):ft(),Tt(!0),we==null||we()},Wo=(f,{behavior:j="smooth",activeIndex:te,onComplete:we}={})=>{const Ne=De.current,Ue=qe.current;if(!Ne||!Ue)return;if(dn(),nn(),Tt(!1),j==="auto"){Fo(Ne,f,te,we);return}const yt=Math.abs(f-Ne.scrollLeft),Lt=Zf(yt,ty,ny,Ne.clientWidth*.55);ut.current=ey(Ne,Ue,f,{duration:Lt,easing:iy,onComplete:()=>{ut.current=null,Fo(Ne,f,te,we)}})},Wr=(f="smooth")=>{const j=De.current;if(!j||t.length===0)return;const te=ve()%t.length,we=At(te,j.scrollLeft),Ne=Ve.current[we];Ne&&Wo(Ne.offsetLeft,{behavior:f,activeIndex:te})},_r=(f,j="smooth",te,we)=>{const Ne=De.current;if(!Ne||t.length===0)return;const Ue=(we??Ne.scrollLeft)-f,yt=ve(f),Lt=Ve.current[yt];if(v(Lt)){Tt(!0),ft();return}const en=Ve.current[yt+1],Jt=Lt?en?en.offsetLeft-Lt.offsetLeft:Lt.offsetWidth:0;if((Jt>0?Ue>Jt*Ko?1:Ue<-Jt*Ko?-1:0:0)!==0){const Uc=te??yt%t.length,Kc=ke(we??Ne.scrollLeft,f,Uc);Sn(Kc,j);return}const eo=we??Ne.scrollLeft,Ho=ve(eo),ds=Ve.current[Ho];if(ds&&Math.abs(ds.offsetLeft-eo)<1){Tt(!0),ft();return}Wr("auto")},Sn=(f,j="smooth")=>{const te=De.current;if(!te||t.length===0)return;const we=At(f,te.scrollLeft),Ne=Ve.current[we];Ne&&(j==="smooth"?Ht.current=f:Ht.current=null,W.current=f,ue(f),Et(!0),Wo(Ne.offsetLeft,{behavior:j,activeIndex:f,onComplete:j==="smooth"?Nt:void 0}))},xi=()=>{$t.current&&(window.removeEventListener("pointerup",$t.current),window.removeEventListener("pointercancel",$t.current),$t.current=null)},_o=(f,j,te,we,Ne)=>{const Ue=te-f,yt=we-j,Lt=Math.abs(Ue),en=Math.abs(yt);if(Lt<cy||Lt<=en)return!1;const Jt=Ue<0?1:-1,bi=gt?(Ne+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ne+Jt));return bi===Ne?!1:(Sn(bi),!0)},ni=f=>{if(!et.current.isActive)return;xi();const j=De.current;if(!j)return;const{scrollLeft:te,startActiveIndex:we,hasMoved:Ne}=et.current,Ue=j.scrollLeft;_t(!0),et.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},vt(!1),f!==void 0&&j.hasPointerCapture(f)&&j.releasePointerCapture(f),Ne?_r(te,"smooth",we,Ue):(Tt(!0),ft()),ct()},No=(f,j)=>{const te=at.current;at.current=null,te&&(_o(te.startX,te.startY,f,j,te.startActiveIndex),ct())},Nr=f=>{if(!$e)return;if(f.pointerType==="touch"){if(dn(),Tt(!0),Rt(f.target))return;at.current={startX:f.clientX,startY:f.clientY,startActiveIndex:W.current};return}if(f.pointerType!=="mouse"||f.button!==0||Rt(f.target))return;const j=De.current;if(!j)return;dn(),nn(),ti(),Ht.current=null,et.current={isActive:!0,startX:f.clientX,scrollLeft:j.scrollLeft,startActiveIndex:W.current,hasMoved:!1},Tt(!1),ct(),j.setPointerCapture(f.pointerId),xi();const te=we=>{we.pointerType==="mouse"&&ni(we.pointerId)};$t.current=te,window.addEventListener("pointerup",te),window.addEventListener("pointercancel",te)},Hr=f=>{if(!$e||f.pointerType!=="mouse")return;const j=De.current;if(!j||!et.current.isActive)return;if(f.buttons===0){ni(f.pointerId);return}const te=f.clientX-et.current.startX;Math.abs(te)>ly&&(et.current.hasMoved=!0,vt(!0)),et.current.hasMoved&&(f.preventDefault(),j.scrollLeft=et.current.scrollLeft-te,_t(!0),ft(),ct())},ce=f=>{if($e){if(f.pointerType==="touch"){f.type==="pointerup"?No(f.clientX,f.clientY):at.current=null;return}f.pointerType==="mouse"&&ni(f.pointerId)}},je=f=>{!$e||f.pointerType!=="mouse"||ni(f.pointerId)};return Oc(),a.useEffect(()=>{const f=requestAnimationFrame(()=>Gt(!0));return()=>{cancelAnimationFrame(f),nn(),xi(),qt.current!==null&&(cancelAnimationFrame(qt.current),qt.current=null),Ct.current&&clearTimeout(Ct.current),jt.current&&clearTimeout(jt.current)}},[]),a.useEffect(()=>{if(!We){xt(!0);return}ct();const f=Ie.current;if(!f)return;const j=()=>ct();return f.addEventListener("pointermove",j),f.addEventListener("pointerdown",j),()=>{f.removeEventListener("pointermove",j),f.removeEventListener("pointerdown",j),jt.current&&clearTimeout(jt.current)}},[We,ct]),a.useEffect(()=>{const f=j=>{j.key==="Escape"&&Te()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[Te]),a.useLayoutEffect(()=>{Wt()},[P,t.length,gt]),a.useLayoutEffect(()=>{o||Sn(W.current,"auto")},[P,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,gt]),a.useEffect(()=>{const f=De.current;if(!f||o||!Y)return;const j=te=>{if(te.preventDefault(),Math.abs(te.deltaY)<=Math.abs(te.deltaX))return;const we=te.deltaMode===1?ay:te.deltaMode===2?f.clientHeight:1,Ne=te.deltaY*we*ry;if(Ne!==0){if(nn(),mt.current||(mt.current=!0,ze.current=f.scrollLeft,Ht.current=null,Tt(!1)),ze.current+=Ne,!gt){const Ue=f.scrollWidth-f.clientWidth;ze.current=Math.max(0,Math.min(Ue,ze.current))}ct(),pt.current===null&&(pt.current=requestAnimationFrame(ei))}};return f.addEventListener("wheel",j,{passive:!1}),()=>{f.removeEventListener("wheel",j),dn()}},[o,Y,gt]),a.useEffect(()=>{const f=De.current;if(!f)return;const j=()=>{_t(et.current.isActive);const we=f.scrollLeft,Ne=we-He.current;He.current=we;const Ue=Xe.current>0?Xe.current*.5:1/0;if(Ne!==0&&Math.abs(Ne)<Ue){const yt=Ne>0?"forward":"backward";yt!==Ye.current&&(Ye.current=yt,Le(yt))}et.current.isActive&&et.current.hasMoved||ft()};f.addEventListener("scroll",j,{passive:!0});const te=new ResizeObserver(()=>{Wt(),_t(et.current.isActive),Le(Ye.current),ft()});return te.observe(f),()=>{nn(),f.removeEventListener("scroll",j),te.disconnect()}},[t.length,gt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{st||Te()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:bt?1:0,transition:`opacity ${mo}ms ease`,pointerEvents:bt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Ot}}),r.jsxs("div",{ref:Ie,className:`${e}-lightbox-dismiss-area`,style:Bt,...zt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Pt,onClick:f=>f.stopPropagation(),children:r.jsx("div",{ref:De,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":$e&&t.length>0?"true":"false","data-mouse-dragging":Yt?"true":"false",onPointerDown:Nr,onPointerMove:Hr,onPointerUp:ce,onPointerCancel:ce,onLostPointerCapture:je,children:r.jsx("div",{ref:qe,className:`${e}-lightbox-strip-track`,style:{gap:P},children:Xt.map((f,j)=>{const te=f.image.objectFit??"contain",we=j%t.length,Ne=Math.floor(j/t.length),Ue=Xo(P),yt=`calc(-0.5 * (${Ue} + ${P}))`;return r.jsxs("div",{ref:Lt=>Ve.current[j]=Lt,className:`${e}-strip-item`,style:{height:I==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:f.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:te}}),o&&we<t.length-1&&Ne===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:yt,width:Ue,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ne}-${f.image.url}-${we}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":cn?"true":"false",style:Mt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:D,flexShrink:0,pointerEvents:"none"},children:o&&r.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:re,pointerEvents:"auto",zIndex:3}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:r.jsx("div",{className:`${e}-lightbox-content-area${ee?` ${e}-lightbox-content-area-stacked`:""}`,children:(be||b)&&r.jsx("div",{className:`${e}-header ${ee?`${e}-header-two-row`:`${e}-header-single-row`}`,children:ee?dt():be||b?ht():null})})})]}),t.length>1&&M==="on"&&(()=>{const f=Xo(S),j=`calc(-0.5 * (${S} + ${f}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:S},children:r.jsx("div",{ref:Se,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:te=>te.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":R,style:{gap:oe,"--thumbnail-active-color":Z},children:[t.map((te,we)=>{const Ne=Xo(oe),Ue=`calc(-0.5 * (${Ne} + ${oe}))`;return r.jsxs("div",{ref:yt=>{_e.current[we]=yt},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":T===we?"true":"false",onClick:()=>Y&&x==="click"&&Sn(we),onMouseEnter:()=>Ae&&x==="hover"&&Sn(we),"aria-label":te.image.name?`View ${te.image.name}`:`View image ${we+1}`,"aria-current":T===we?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${de?` ${e}-thumb-image-cover`:""}`,src:te.image.url,alt:"",draggable:!1,style:{...he,maxWidth:V,maxHeight:V,width:E.display==="cover"?"auto":"100%",height:"auto",objectFit:E.display==="cover"?"cover":"contain"}})}),o&&we<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ue,width:Ne,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${te.image.url}-${we}`)}),o&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:j,height:f,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function wy(e){return`
|
|
14121
|
+
`;function On(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ul={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ty=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],ny={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:On("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:{...ul.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:{...ul.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:On("Question Padding Left"),questionPaddingTop:On("Question Padding Top"),questionPaddingBottom:On("Question Padding Bottom"),answerPaddingLeft:On("Answer Padding Left"),answerPaddingRight:On("Answer Padding Right"),answerPaddingTop:On("Answer Padding Top"),answerPaddingBottom:On("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:[...ty],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},iy={element:Qf,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:ny,sourceCode:ey},Fn=e=>e.display==="cover",Ar=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},pl=100,oy=.2,ml=8,Nc=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=a.useState(0),[l,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const p=a.useMemo(()=>typeof window>"u"?pl:Math.max(pl,window.innerHeight*oy),[]),v=a.useCallback(w=>Math.max(0,1-w/(p*1.5)),[p]),y=a.useCallback(w=>Math.max(0,1-w/(p*.45)),[p]),g=a.useCallback(w=>{const H=typeof window<"u"?window.innerHeight:800,P=Math.max(.88,1-w/H*.12);return`translateY(${w}px) scale(${P})`},[]),h=a.useCallback(()=>{c.current=null},[]),m=a.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),b=a.useCallback(()=>{const w=typeof window<"u"?window.innerHeight:800;d(!0),s(w),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),E=a.useCallback(w=>{!e||l||w.pointerType==="touch"&&(i!=null&&i(w.target)||(c.current={startX:w.clientX,startY:w.clientY,isLocked:null,pointerId:w.pointerId}))},[e,l,i]),R=a.useCallback(w=>{const H=c.current;if(!e||!H||w.pointerType!=="touch"||H.pointerId!==w.pointerId)return;const P=w.clientX-H.startX,X=w.clientY-H.startY;if(H.isLocked===null){if(Math.abs(P)<ml&&Math.abs(X)<ml)return;if(X>0&&X>Math.abs(P))H.isLocked=!0,w.currentTarget.setPointerCapture(w.pointerId);else{H.isLocked=!1,h();return}}if(!H.isLocked)return;w.preventDefault();const k=Math.max(0,X);u.current=k,s(k)},[e,h]),L=a.useCallback(w=>{const H=c.current;if(!e||!H||w.pointerType!=="touch"||H.pointerId!==w.pointerId)return;const P=H.isLocked===!0;if(w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.pointerId),!P){h();return}w.clientY-H.startY>=p?b():m()},[p,b,e,h,m]),J=a.useCallback(w=>{L(w)},[L]),W=a.useCallback(w=>{L(w)},[L]),q=o>0,A=l?`transform ${n}ms ease`:"none",C=l?`opacity ${n}ms ease`:"none",O=o>0||l;return{isSwipeDragging:q,backdropStyle:{opacity:v(o),transition:C},mediaAreaStyle:{transform:g(o),transition:A,touchAction:q?"none":void 0,willChange:q?"transform":void 0},overlayContentStyle:O?{opacity:y(o),transition:C}:void 0,swipeHandlers:e?{onPointerDown:E,onPointerMove:R,onPointerUp:J,onPointerCancel:W}:{},dismissAreaStyle:e?{touchAction:q?"none":"pan-x"}:void 0}},ry="[data-lightbox-scrollable]",Oc=()=>{a.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,s=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(ry)||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=s,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},ay=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},sy=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},ly=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},cy=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,m)=>{sy(t),e.scrollLeft=h,m&&(s==null||s())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,v=0;const y=()=>{t.removeEventListener("transitionend",g),clearTimeout(v)},g=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,y(),u(n,!0))};return t.addEventListener("transitionend",g),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)`,v=window.setTimeout(()=>{p||(p=!0,y(),u(n,!0))},i+64),()=>{p||(p=!0,y(),u(l-ly(t),!1))}},mo=300,dy=900,uy=1500,py="cubic-bezier(0.16, 1, 0.3, 1)",my=3e3,gy=2,hy=16,fy=.05,yy=1,Ko=.3,vy=50,xy=20,$i=.004,qi=["title1","title2","title3"],by={title1:"1",title2:"2",title3:"3"},wy={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Sy={title1:.02,title2:.02,title3:.02},Xo=e=>`max(${e}, ${xy}px)`,$y=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]}},Cy=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=$y(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Dt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Ty=e=>[Dt(e,"fontFamily"),Dt(e,"fontSettings"),{type:"row",items:[Dt(e,"fontSize"),Dt(e,"lineHeight"),Dt(e,"letterSpacing"),Dt(e,"wordSpacing")]},Dt(e,"textAlign"),Dt(e,"textAppearance")],Ly=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(qi.map(e=>[by[e],Ty(e)]))}),cs=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Dc=(e,t)=>cs(e,t),Yo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},gl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:cs(e.length,n),effective:Dc(e.length,n)}},Ry=(e,t,n,i,o,s,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:s,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},oa=(e,t)=>{const n=i=>{const o=Dt(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[wy[t]]}},Iy=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),ra=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??Sy[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)},Ey=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:v,closeIcon:y,closeIconMaxWidth:g,closeIconColor:h,closeIconHoverColor:m,thumbnailTrigger:b,thumbnailVisibility:E,thumbnailObjectFit:R,thumbnailActive:L,thumbnailActiveColor:J,title1Width:W,title2Width:q,title3Width:A,title1MarginLeft:C=0,title2MarginLeft:O=0,title3MarginLeft:w=0,titleRowMarginBottom:H=0,titleHeaderLayout:P="desktop",contentMarginTop:X,iconMarginLeft:k}=n,Y=f=>$.scalingValue(f,i??!1),U=c??n.thumnailSize??.03,V=Y(U),ie=Y(u),S=Y(p??.02),M=Y(v??0),z=Y(X??0),ae=Xo(z),re=Y(k??0),[I,ue]=a.useState(0),F=a.useRef(I);F.current=I;const oe=t[I],{title1:Q,title2:ye,title3:Pe}=Cy(oe),pe=ra("title1",oa(n,"title1"),i),ce=ra("title2",oa(n,"title2"),i),K=ra("title3",oa(n,"title3"),i),te=P==="mobile",Z=!o&&(!i||s),Fe=Z,$e=Z,We=Z,de=Fn(R),he=de?{"--image-aspect-ratio":Ar(R)}:void 0,be=!!(Q||ye||Pe),G=a.useMemo(()=>Ry(e,Q,ye,Pe,pe,ce,K),[e,I,Q,ye,Pe,pe,ce,K]),se=a.useMemo(()=>({title1Width:W,title2Width:q,title3Width:A}),[W,q,A]),ge=a.useMemo(()=>G.map(f=>se[f.widthKey]),[G,se]),xe=a.useMemo(()=>cs(G.length,ge),[G.length,ge]),Me=a.useMemo(()=>Dc(G.length,ge),[G.length,ge]),Ce=a.useMemo(()=>G.filter(f=>f.prefix==="title1"),[G]),N=a.useMemo(()=>G.filter(f=>f.prefix==="title2"||f.prefix==="title3"),[G]),me=a.useMemo(()=>gl(Ce,se),[Ce,se]),D=a.useMemo(()=>gl(N,se),[N,se]),T=a.useCallback((f,j)=>{const ee=G.indexOf(f);if(!te||j==="single-row")return{effectiveWidth:Me[ee]??0,resolvedWidth:xe[ee]??0,maxWidth:Yo(ee,xe)};if(j==="two-row-top"){const He=Ce.indexOf(f);return{effectiveWidth:me.effective[He]??0,resolvedWidth:me.resolved[He]??0,maxWidth:Yo(He,me.resolved)}}const Se=N.indexOf(f);return{effectiveWidth:D.effective[Se]??0,resolvedWidth:D.resolved[Se]??0,maxWidth:Yo(Se,D.resolved)}},[N,D,Me,xe,G,Ce,me,te]),B=a.useCallback(f=>$.scalingValue(f,i??!1),[i]),Le=B(H??0),ne=a.useMemo(()=>({title1MarginLeft:C,title2MarginLeft:O,title3MarginLeft:w}),[C,O,w]),_=a.useCallback(f=>G.slice(0,f+1).reduce((j,ee,Se)=>j+(ee!=null&&ee.marginLeftKey?ne[ee.marginLeftKey]??0:0)+(xe[Se]??0),0)+(te?0:C??0),[G,ne,xe,te,C]),ke=a.useCallback(()=>te?0:C??0,[te,C]),Ie=a.useCallback(f=>N.slice(0,f).reduce((j,ee,Se)=>j+(ee.marginLeftKey?ne[ee.marginLeftKey]??0:0)+(D.resolved[Se]??0),0),[N,D.resolved,ne]),Ze=a.useCallback(f=>{const j=N[f];return Ie(f)+(j.marginLeftKey?ne[j.marginLeftKey]??0:0)+(D.resolved[f]??0)},[N,D.resolved,Ie,ne]),Ke=(f,j)=>{const ee=f.marginLeftKey?ne[f.marginLeftKey]??0:0,{effectiveWidth:Se,resolvedWidth:He,maxWidth:Ue}=T(f,j),yt=o&&j==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":f.prefix,style:{...j==="single-row"?{gridArea:f.prefix}:{},width:B(Se),...ee>0?{marginLeft:B(ee)}:{}},children:[r.jsx("p",{className:f.className,style:f.style,children:f.text}),yt&&f.marginLeftKey&&r.jsx("div",{"data-controls":f.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:B(-ee),width:`max(${B(ee)}, 10px)`,height:"100%",pointerEvents:"auto"}}),yt&&r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:B(-$i/2),width:B($i),height:"100%",pointerEvents:"auto"}})]},f.className)},at=()=>{const f=te?-1:G.findIndex(Se=>Se.prefix==="title1"),j=!te&&(o||(C??0)>0)?(()=>{const Se=C??0,He=f>=0?xe[f]:W??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:0,width:`max(${B(Se)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ee=G.flatMap((Se,He)=>{if(!Se.marginLeftKey)return[];const Ue=ne[Se.marginLeftKey]??0,yt=Iy(G,xe,ne,He)+ke();return r.jsx("div",{"data-controls":Se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe[He]),style:{position:"absolute",top:0,left:B(yt),width:`max(${B(Ue)}, 10px)`,height:"100%",pointerEvents:"auto"}},Se.marginLeftKey)});return j?[j,...ee]:ee},tt=()=>G.map((f,j)=>{const ee=Yo(j,xe),He=_(j)-$i/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:B(He),width:B($i),height:"100%",pointerEvents:"auto"}})},`${f.widthKey}-junction`)}),Ve=()=>N.flatMap((f,j)=>{if(!f.marginLeftKey)return[];const ee=ne[f.marginLeftKey]??0,Se=Ie(j),{resolvedWidth:He}=T(f,"two-row-bottom");return r.jsx("div",{"data-controls":f.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:B(Se),width:`max(${B(ee)}, 10px)`,height:"100%",pointerEvents:"auto"}},f.marginLeftKey)}),fe=()=>N.map((f,j)=>{const{maxWidth:ee}=T(f,"two-row-bottom"),He=Ze(j)-$i/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:B(He),width:B($i),height:"100%",pointerEvents:"auto"}})},`${f.widthKey}-junction`)}),Ee=a.useRef(null),De=a.useRef(null),qe=a.useRef(null),we=a.useRef(null),Oe=a.useRef([]),ze=a.useRef([]),Ye=a.useRef(0),ot=a.useRef(null),Je=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),bt=a.useRef(null),lt=a.useRef(null),_e=a.useRef(0),Xe=a.useRef("forward"),Be=a.useRef(0),pt=a.useRef(null),mt=a.useRef(!1),gt=t.length>1&&(!o||!!s),kt=gt?3:1,Xt=a.useMemo(()=>Array.from({length:kt},()=>t).flat(),[t,kt]),[Yt,vt]=a.useState(!1),[wt,Gt]=a.useState(!1),[Ft,xt]=a.useState(!0),Nt=a.useRef(null),qt=a.useRef(null),Zt=a.useRef(!1),tn=a.useRef(!1),Ct=a.useRef(null),jt=a.useRef(null),cn=Fe&&!Ft,dt=a.useCallback(()=>{Fe&&(xt(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{Je.current.isActive||xt(!1)},my))},[Fe]),Te=a.useCallback(()=>{o||tn.current||(tn.current=!0,Gt(!1),Ct.current=setTimeout(()=>{l()},mo))},[o,l]),Ne=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":cn?"true":"false",style:{width:$.scalingValue(g??0,i),height:$.scalingValue(g??0,i),marginRight:re,"--close-icon-hover-color":m},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Te,"aria-label":"Close",children:r.jsx(rn,{url:y,fill:h,hoverFill:i&&!s?h:m,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:re,height:"100%",pointerEvents:"auto"}})]}),nt=(f="two-row")=>r.jsx("div",{...f==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:B(C??0),flexShrink:0,...f==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...f==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ut=()=>{const f=G.find(Se=>Se.prefix==="title1"),j=G.filter(Se=>Se.prefix==="title2"||Se.prefix==="title3"),ee=j.length>0||o||(H??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(C??0)>0||o?nt():null,f&&Ke(f,"two-row-top"),y&&Ne()]}),ee?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[j.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[j.map(Se=>Ke(Se,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[Ve(),fe()]})]}):null,r.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:Le,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ht=()=>r.jsxs(r.Fragment,{children:[(C??0)>0||o?nt("single-row"):null,G.map(f=>Ke(f,"single-row")),o?r.jsxs(r.Fragment,{children:[at(),tt()]}):null,y?Ne():null]}),Rt=a.useCallback(f=>!!(f.closest("[data-controls]")||f.closest(`.${e}-thumbnails`)||f.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ct,backdropStyle:Ot,mediaAreaStyle:Pt,overlayContentStyle:Mt,swipeHandlers:zt,dismissAreaStyle:Bt}=Nc({enabled:Z??!1,onClose:Te,animMs:mo,isBlockedTarget:Rt}),Wt=()=>{if(!gt||t.length===0)return Ye.current=0,0;const f=ze.current[0],j=ze.current[t.length];if(!f||!j)return Ye.current;const ee=j.offsetLeft-f.offsetLeft;return ee>0&&(Ye.current=ee),Ye.current},_t=(f=!1)=>{if(!gt)return;const j=De.current,ee=Wt();!j||ee<=0||ee<j.clientWidth*.25||(j.scrollLeft<=0?(j.scrollLeft+=ee,f&&(Je.current.scrollLeft+=ee),mt.current&&(Be.current+=ee)):j.scrollLeft>=ee*2&&(j.scrollLeft-=ee,f&&(Je.current.scrollLeft-=ee),mt.current&&(Be.current-=ee)))},At=(f,j=(ee=>(ee=De.current)==null?void 0:ee.scrollLeft)()??0)=>{if(!gt)return f;let Se=t.length+f,He=1/0;for(let Ue=0;Ue<kt;Ue++){const yt=Ue*t.length+f,Lt=ze.current[yt];if(!Lt)continue;const en=Math.abs(Lt.offsetLeft-j);en<He&&(He=en,Se=yt)}return Se},St=f=>{const j=De.current;return!f||!j?!1:f.offsetWidth>j.clientWidth+1},x=f=>{const j=De.current;if(!f||!j||!St(f))return!1;const ee=f.offsetLeft,Se=ee+f.offsetWidth;return j.scrollLeft>=ee-1&&j.scrollLeft+j.clientWidth<=Se+1},ve=(f=(j=>(j=De.current)==null?void 0:j.scrollLeft)()??0)=>{for(let Se=0;Se<ze.current.length;Se+=1){const He=ze.current[Se];if(He&&x(He))return Se}let ee={flatIndex:0,distance:1/0};return ze.current.forEach((Se,He)=>{if(!Se)return;const Ue=Math.abs(Se.offsetLeft-f);Ue<ee.distance&&(ee={flatIndex:He,distance:Ue})}),ee.flatIndex},Re=f=>{De.current&&ze.current.forEach(j=>{j&&(j.style.scrollSnapAlign=St(j)&&f==="backward"?"end":"start")})},Ae=(f,j,ee)=>{const Se=f-j,He=ve(j),Ue=ze.current[He];if(x(Ue))return ve(f)%t.length;const yt=ze.current[He+1],Lt=Ue?yt?yt.offsetLeft-Ue.offsetLeft:Ue.offsetWidth:0,en=Lt>0?Se>Lt*Ko?1:Se<-Lt*Ko?-1:0:0;return en===0?ee:gt?(ee+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,ee+en))},it=a.useCallback((f=!1)=>{if(E!=="on"||o)return;const j=we.current,ee=F.current,Se=Oe.current[ee];if(!j||!Se||j.scrollWidth<=j.clientWidth)return;const He=j.scrollLeft,Ue=He+j.clientWidth,yt=Se.offsetLeft,Lt=yt+Se.offsetWidth;if(yt>=He&&Lt<=Ue)return;const en=j.scrollWidth-j.clientWidth;let Jt=He;if(!f&&Nt.current===null){const bi=Oe.current[ee-1],eo=Oe.current[ee+1],No=bi?Se.offsetLeft-bi.offsetLeft:eo?eo.offsetLeft-Se.offsetLeft:Se.offsetWidth;Lt>Ue?Jt+=No:yt<He&&(Jt-=No)}else Lt>Ue?Jt=Lt-j.clientWidth:Jt=yt;j.scrollLeft=Math.max(0,Math.min(en,Jt))},[o,E]),Et=a.useCallback((f=!1)=>{f&&(Zt.current=!0),qt.current===null&&(qt.current=requestAnimationFrame(()=>{qt.current=null;const j=Zt.current;Zt.current=!1,it(j)}))},[it]),Qe=a.useCallback(f=>{if(f===F.current)return;const j=F.current;F.current=f;const ee=Math.abs(f-j)>1,Se=gt&&t.length>1&&(j===t.length-1&&f===0||j===0&&f===t.length-1);ue(f),Et(ee||Se)},[t.length,gt,Et]),ft=()=>{if(!De.current||t.length===0||Nt.current!==null||Je.current.isActive&&Je.current.hasMoved)return;const f=De.current.scrollLeft,j=ve(f)%t.length;j!==F.current&&Qe(j)},Ht=()=>{Nt.current=null},Tt=f=>{const j=De.current;j&&(j.style.scrollSnapType=f?"":"none")},nn=()=>{var f;(f=lt.current)==null||f.call(lt),lt.current=null},dn=()=>{pt.current!==null&&(cancelAnimationFrame(pt.current),pt.current=null),mt.current=!1},ei=()=>{const f=De.current;if(!f){pt.current=null,mt.current=!1;return}const j=Be.current-f.scrollLeft;if(Math.abs(j)<.5){f.scrollLeft=Be.current,_t(),ft(),pt.current=null,mt.current=!1;return}f.scrollLeft+=j*fy,_t(),ft(),dt(),pt.current=requestAnimationFrame(ei)},ti=()=>{const f=qe.current;f&&(f.style.transition="",f.style.transform="",f.style.willChange="")},Fo=(f,j,ee,Se)=>{ti(),f.scrollLeft=j,_e.current=f.scrollLeft,_t(),ee!==void 0?(F.current=ee,ue(ee)):ft(),Tt(!0),Se==null||Se()},Wo=(f,{behavior:j="smooth",activeIndex:ee,onComplete:Se}={})=>{const He=De.current,Ue=qe.current;if(!He||!Ue)return;if(dn(),nn(),Tt(!1),j==="auto"){Fo(He,f,ee,Se);return}const yt=Math.abs(f-He.scrollLeft),Lt=ay(yt,dy,uy,He.clientWidth*.55);lt.current=cy(He,Ue,f,{duration:Lt,easing:py,onComplete:()=>{lt.current=null,Fo(He,f,ee,Se)}})},Wr=(f="smooth")=>{const j=De.current;if(!j||t.length===0)return;const ee=ve()%t.length,Se=At(ee,j.scrollLeft),He=ze.current[Se];He&&Wo(He.offsetLeft,{behavior:f,activeIndex:ee})},_r=(f,j="smooth",ee,Se)=>{const He=De.current;if(!He||t.length===0)return;const Ue=(Se??He.scrollLeft)-f,yt=ve(f),Lt=ze.current[yt];if(x(Lt)){Tt(!0),ft();return}const en=ze.current[yt+1],Jt=Lt?en?en.offsetLeft-Lt.offsetLeft:Lt.offsetWidth:0;if((Jt>0?Ue>Jt*Ko?1:Ue<-Jt*Ko?-1:0:0)!==0){const Uc=ee??yt%t.length,Kc=Ae(Se??He.scrollLeft,f,Uc);Sn(Kc,j);return}const eo=Se??He.scrollLeft,No=ve(eo),ds=ze.current[No];if(ds&&Math.abs(ds.offsetLeft-eo)<1){Tt(!0),ft();return}Wr("auto")},Sn=(f,j="smooth")=>{const ee=De.current;if(!ee||t.length===0)return;const Se=At(f,ee.scrollLeft),He=ze.current[Se];He&&(j==="smooth"?Nt.current=f:Nt.current=null,F.current=f,ue(f),Et(!0),Wo(He.offsetLeft,{behavior:j,activeIndex:f,onComplete:j==="smooth"?Ht:void 0}))},xi=()=>{bt.current&&(window.removeEventListener("pointerup",bt.current),window.removeEventListener("pointercancel",bt.current),bt.current=null)},_o=(f,j,ee,Se,He)=>{const Ue=ee-f,yt=Se-j,Lt=Math.abs(Ue),en=Math.abs(yt);if(Lt<vy||Lt<=en)return!1;const Jt=Ue<0?1:-1,bi=gt?(He+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,He+Jt));return bi===He?!1:(Sn(bi),!0)},ni=f=>{if(!Je.current.isActive)return;xi();const j=De.current;if(!j)return;const{scrollLeft:ee,startActiveIndex:Se,hasMoved:He}=Je.current,Ue=j.scrollLeft;_t(!0),Je.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},vt(!1),f!==void 0&&j.hasPointerCapture(f)&&j.releasePointerCapture(f),He?_r(ee,"smooth",Se,Ue):(Tt(!0),ft()),dt()},Ho=(f,j)=>{const ee=ot.current;ot.current=null,ee&&(_o(ee.startX,ee.startY,f,j,ee.startActiveIndex),dt())},Hr=f=>{if(!$e)return;if(f.pointerType==="touch"){if(dn(),Tt(!0),Rt(f.target))return;ot.current={startX:f.clientX,startY:f.clientY,startActiveIndex:F.current};return}if(f.pointerType!=="mouse"||f.button!==0||Rt(f.target))return;const j=De.current;if(!j)return;dn(),nn(),ti(),Nt.current=null,Je.current={isActive:!0,startX:f.clientX,scrollLeft:j.scrollLeft,startActiveIndex:F.current,hasMoved:!1},Tt(!1),dt(),j.setPointerCapture(f.pointerId),xi();const ee=Se=>{Se.pointerType==="mouse"&&ni(Se.pointerId)};bt.current=ee,window.addEventListener("pointerup",ee),window.addEventListener("pointercancel",ee)},Nr=f=>{if(!$e||f.pointerType!=="mouse")return;const j=De.current;if(!j||!Je.current.isActive)return;if(f.buttons===0){ni(f.pointerId);return}const ee=f.clientX-Je.current.startX;Math.abs(ee)>yy&&(Je.current.hasMoved=!0,vt(!0)),Je.current.hasMoved&&(f.preventDefault(),j.scrollLeft=Je.current.scrollLeft-ee,_t(!0),ft(),dt())},le=f=>{if($e){if(f.pointerType==="touch"){f.type==="pointerup"?Ho(f.clientX,f.clientY):ot.current=null;return}f.pointerType==="mouse"&&ni(f.pointerId)}},je=f=>{!$e||f.pointerType!=="mouse"||ni(f.pointerId)};return Oc(),a.useEffect(()=>{const f=requestAnimationFrame(()=>Gt(!0));return()=>{cancelAnimationFrame(f),nn(),xi(),qt.current!==null&&(cancelAnimationFrame(qt.current),qt.current=null),Ct.current&&clearTimeout(Ct.current),jt.current&&clearTimeout(jt.current)}},[]),a.useEffect(()=>{if(!Fe){xt(!0);return}dt();const f=Ee.current;if(!f)return;const j=()=>dt();return f.addEventListener("pointermove",j),f.addEventListener("pointerdown",j),()=>{f.removeEventListener("pointermove",j),f.removeEventListener("pointerdown",j),jt.current&&clearTimeout(jt.current)}},[Fe,dt]),a.useEffect(()=>{const f=j=>{j.key==="Escape"&&Te()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[Te]),a.useLayoutEffect(()=>{Wt()},[M,t.length,gt]),a.useLayoutEffect(()=>{o||Sn(F.current,"auto")},[M,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,gt]),a.useEffect(()=>{const f=De.current;if(!f||o||!Z)return;const j=ee=>{if(ee.preventDefault(),Math.abs(ee.deltaY)<=Math.abs(ee.deltaX))return;const Se=ee.deltaMode===1?hy:ee.deltaMode===2?f.clientHeight:1,He=ee.deltaY*Se*gy;if(He!==0){if(nn(),mt.current||(mt.current=!0,Be.current=f.scrollLeft,Nt.current=null,Tt(!1)),Be.current+=He,!gt){const Ue=f.scrollWidth-f.clientWidth;Be.current=Math.max(0,Math.min(Ue,Be.current))}dt(),pt.current===null&&(pt.current=requestAnimationFrame(ei))}};return f.addEventListener("wheel",j,{passive:!1}),()=>{f.removeEventListener("wheel",j),dn()}},[o,Z,gt]),a.useEffect(()=>{const f=De.current;if(!f)return;const j=()=>{_t(Je.current.isActive);const Se=f.scrollLeft,He=Se-_e.current;_e.current=Se;const Ue=Ye.current>0?Ye.current*.5:1/0;if(He!==0&&Math.abs(He)<Ue){const yt=He>0?"forward":"backward";yt!==Xe.current&&(Xe.current=yt,Re(yt))}Je.current.isActive&&Je.current.hasMoved||ft()};f.addEventListener("scroll",j,{passive:!0});const ee=new ResizeObserver(()=>{Wt(),_t(Je.current.isActive),Re(Xe.current),ft()});return ee.observe(f),()=>{nn(),f.removeEventListener("scroll",j),ee.disconnect()}},[t.length,gt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ct||Te()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:wt?1:0,transition:`opacity ${mo}ms ease`,pointerEvents:wt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Ot}}),r.jsxs("div",{ref:Ee,className:`${e}-lightbox-dismiss-area`,style:Bt,...zt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Pt,onClick:f=>f.stopPropagation(),children:r.jsx("div",{ref:De,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":$e&&t.length>0?"true":"false","data-mouse-dragging":Yt?"true":"false",onPointerDown:Hr,onPointerMove:Nr,onPointerUp:le,onPointerCancel:le,onLostPointerCapture:je,children:r.jsx("div",{ref:qe,className:`${e}-lightbox-strip-track`,style:{gap:M},children:Xt.map((f,j)=>{const ee=f.image.objectFit??"contain",Se=j%t.length,He=Math.floor(j/t.length),Ue=Xo(M),yt=`calc(-0.5 * (${Ue} + ${M}))`;return r.jsxs("div",{ref:Lt=>ze.current[j]=Lt,className:`${e}-strip-item`,style:{height:P==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:f.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ee}}),o&&Se<t.length-1&&He===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:yt,width:Ue,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${He}-${f.image.url}-${Se}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":cn?"true":"false",style:Mt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:z,flexShrink:0,pointerEvents:"none"},children:o&&r.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:ae,pointerEvents:"auto",zIndex:3}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:r.jsx("div",{className:`${e}-lightbox-content-area${te?` ${e}-lightbox-content-area-stacked`:""}`,children:(be||y)&&r.jsx("div",{className:`${e}-header ${te?`${e}-header-two-row`:`${e}-header-single-row`}`,children:te?ut():be||y?ht():null})})})]}),t.length>1&&E==="on"&&(()=>{const f=Xo(S),j=`calc(-0.5 * (${S} + ${f}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:S},children:r.jsx("div",{ref:we,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ee=>ee.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":L,style:{gap:ie,"--thumbnail-active-color":J},children:[t.map((ee,Se)=>{const He=Xo(ie),Ue=`calc(-0.5 * (${He} + ${ie}))`;return r.jsxs("div",{ref:yt=>{Oe.current[Se]=yt},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":I===Se?"true":"false",onClick:()=>Z&&b==="click"&&Sn(Se),onMouseEnter:()=>We&&b==="hover"&&Sn(Se),"aria-label":ee.image.name?`View ${ee.image.name}`:`View image ${Se+1}`,"aria-current":I===Se?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${de?` ${e}-thumb-image-cover`:""}`,src:ee.image.url,alt:"",draggable:!1,style:{...he,maxWidth:V,maxHeight:V,width:R.display==="cover"?"auto":"100%",height:"auto",objectFit:R.display==="cover"?"cover":"contain"}})}),o&&Se<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ue,width:He,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ee.image.url}-${Se}`)}),o&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:j,height:f,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function My(e){return`
|
|
14041
14122
|
.${e}-wrapper {
|
|
14042
14123
|
position: relative;
|
|
14043
14124
|
width: 100%;
|
|
@@ -14422,7 +14503,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14422
14503
|
pointer-events: auto;
|
|
14423
14504
|
z-index: 10;
|
|
14424
14505
|
}
|
|
14425
|
-
`}const
|
|
14506
|
+
`}const Py=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s})=>{const{prefix:l}=$.useScopedStyles(),{cover:d,coverFit:c}=e,u=a.useRef(null),[p,v]=a.useState(!1),y=t??[],g=p&&y.length>0,h=()=>{y.length!==0&&v(!0)};return a.useEffect(()=>{!n||i||o||v(!1)},[n,i,o]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:My(l)}}),d&&r.jsx("div",{className:`${l}-cover ${Fn(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>h(),style:{...Fn(c)?{"--image-aspect-ratio":Ar(c)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${l}-cover-image ${Fn(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),g&&typeof document<"u"&&(()=>{const m=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx(Ey,{prefix:l,images:y,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>v(!1)}),m)})()]})},ky=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
14426
14507
|
import { createPortal } from 'react-dom';
|
|
14427
14508
|
import { CommonComponentProps } from '../props';
|
|
14428
14509
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -14968,7 +15049,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
14968
15049
|
</>
|
|
14969
15050
|
);
|
|
14970
15051
|
};
|
|
14971
|
-
`,Cy="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>'),si={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 Ty(e){const t={};return t[Dt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Dt(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Dt(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Dt(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Dt(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Dt(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Dt(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Dt(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ly=qi.reduce((e,t)=>({...e,...Ty(t)}),{}),Ry=qi.reduce((e,t)=>({...e,[Dt(t,"fontFamily")]:"Goudy Bookletter 1911",[Dt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Dt(t,"letterSpacing")]:0,[Dt(t,"wordSpacing")]:0,[Dt(t,"textAlign")]:"left",[Dt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function aa(e){return qi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Dt(n,"fontSize")]=i),o!==void 0&&(t[Dt(n,"lineHeight")]=o),t},{})}const Iy=yy(),Ey={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"}},...Ly,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:Cy,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Ry},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,...aa({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,...aa({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,...aa({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:[Iy]}],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"}]}},My={element:Sy,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:Ey,sourceCode:$y,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...qi.map(e=>({path:`${Dt(e,"fontFamily")}`}))]},fontRelations:{...qi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Dt(t,"fontFamily")}`}),{})}},Py=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:w,coverFit:b,backgroundColor:h,imageGap:g,maxWidth:m,maxHeight:x,textTransition:M,title1Width:E,title2Width:R,title3Width:Z,title1MarginLeft:_=0,title2MarginLeft:U=0,title3MarginLeft:F=0,titleRowMarginBottom:C=0,titleHeaderLayout:z="single-row",countCloseGap:y=0,closeIcon:N,closeIconMaxWidth:I,closeIconColor:J,closeIconHoverColor:k,contentMarginTop:X=0,iconMarginRight:G=0}=n,V=a.useCallback(ce=>$.scalingValue(ce,i??!1),[i]),oe=V(g??0),S=`${m}%`,P=`${x}%`,D=V(y),re=V(X),ae=V(G),T=pi("title1",ui(n,"title1"),i),ue=pi("title2",ui(n,"title2"),i),W=pi("title3",ui(n,"title3"),i),ie=pi("count",ui(n,"count"),i),ne=z==="mobile",ye=!i||!!s,Pe=!o&&(!i||!!s),me=a.useMemo(()=>rr(t,w),[t,w]),[le,K]=a.useState(l),ee=me[le],Y=ee==null?void 0:ee.entry,[We,$e]=a.useState(!1),[Ae,de]=a.useState(null),[he,be]=a.useState(!1),[q,se]=a.useState(null),[ge,xe]=a.useState(!1),[Ee,Ce]=a.useState(0),[H,pe]=a.useState(),[O,L]=a.useState(),[B,Re]=a.useState(null),Q=a.useRef(null),A=a.useRef(0),Fe=a.useRef(0),Me=a.useRef(0),Qe=a.useRef(!1),Ke=a.useRef(null),lt=a.useRef(null),tt=a.useRef(null),Be=a.useRef(null),fe=a.useRef(null),Ie=a.useRef(null),De=a.useRef(null),qe=a.useCallback(()=>{const ce=lt.current;if(!ce)return;const je=ce.closest(`.${e}-lightbox-content-area`);if(!je)return ce.getBoundingClientRect().width;const f=Array.from(je.children).reduce((j,te)=>!(te instanceof HTMLElement)||te.contains(ce)?j:j+te.getBoundingClientRect().width,0);return je.getBoundingClientRect().width-f},[e]),Se=a.useCallback(()=>{Q.current&&(clearTimeout(Q.current),Q.current=null)},[]),_e=a.useCallback(ce=>{ce===A.current&&(se(null),xe(!1))},[]),Ve=a.useCallback(()=>{o||Qe.current||(Qe.current=!0,u==null||u(),$e(!1),Ke.current=setTimeout(()=>{p()},300))},[o,u,p]),Xe=a.useCallback(ce=>!!(ce.closest("[data-controls]")||ce.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:at,backdropStyle:et,mediaAreaStyle:$t,overlayContentStyle:ut,swipeHandlers:He,dismissAreaStyle:Ye}=Hc({enabled:Pe,onClose:Ve,animMs:300,isBlockedTarget:Xe}),ze=a.useCallback(ce=>{d&&bc(ce+1,c,!0)},[d,c]),pt=a.useCallback(ce=>{if(ce)return ce.getBoundingClientRect().height},[]),mt=a.useCallback(ce=>{if(me.length===0)return;const je=(ce%me.length+me.length)%me.length;if(je===le)return;const f=me[le],j=me[je];A.current+=1;const te=A.current,we=M==="fade"&&Bs(f==null?void 0:f.entry)!==Bs(j==null?void 0:j.entry),Ne=pt(tt.current),Ue=we?(()=>{const Lt=qe();Yn.flushSync(()=>{Re(j.entry)}),tt.current&&Lt&&(tt.current.style.width=`${Lt}px`);const en=pt(tt.current);return tt.current&&(tt.current.style.width=""),{measuredIncomingTitlesHeight:en,incomingTitlesMeasureWidth:Lt}})():void 0,yt=Math.max(Ne??0,(Ue==null?void 0:Ue.measuredIncomingTitlesHeight)??0)||void 0;Ce(te),se(le),xe(!0),K(je),ze(je),Me.current=je,we?(Se(),yt&&pe(yt),Ue!=null&&Ue.incomingTitlesMeasureWidth&&L(Ue.incomingTitlesMeasureWidth),de((f==null?void 0:f.entryIndex)??null),be(!0),Fe.current=j.entryIndex,Q.current=setTimeout(()=>{de(null),be(!1),pe(void 0),L(void 0),Re(null),Q.current=null},400)):(Se(),de(null),be(!1),pe(void 0),L(void 0),Re(null),Fe.current=j.entryIndex)},[le,Se,qe,pt,me,ze,M]),gt=a.useCallback(()=>{De.current=null},[]),kt=a.useCallback(ce=>{!ye||me.length<=1||ce.pointerType==="mouse"&&ce.button!==0||ce.target.closest("[data-controls]")||(De.current={startX:ce.clientX,startY:ce.clientY,pointerId:ce.pointerId})},[ye,me.length]),Xt=a.useCallback(ce=>{var Lt;if(!ye||me.length<=1||ce.pointerType==="mouse"&&ce.button!==0)return;if(at){gt();return}const je=De.current;if(!je||je.pointerId!==ce.pointerId||(gt(),ce.target.closest("[data-controls]")))return;const j=ce.clientX-je.startX,te=ce.clientY-je.startY,we=Math.abs(j),Ne=Math.abs(te);if(we>=zg&&we>Ne){mt(j>0?le-1:le+1);return}if(we>Os||Ne>Os)return;const Ue=(Lt=Be.current)==null?void 0:Lt.getBoundingClientRect(),yt=Ue?Ue.left+Ue.width/2:window.innerWidth/2;mt(ce.clientX<yt?le-1:le+1)},[le,ye,mt,at,gt,me.length]),Yt=a.useCallback(ce=>{const je=De.current;(je==null?void 0:je.pointerId)===ce.pointerId&>()},[gt]);Oc(),a.useEffect(()=>{Ie.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const ce=requestAnimationFrame(()=>{$e(!0),requestAnimationFrame(()=>{fe.current?fe.current.focus():Be.current&&Be.current.focus()})});return()=>{cancelAnimationFrame(ce),Ke.current&&clearTimeout(Ke.current),Q.current&&clearTimeout(Q.current);const je=Ie.current;je&&document.contains(je)&&je.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var ce;M!=="fade"&&(Fe.current=((ce=me[le])==null?void 0:ce.entryIndex)??0,Se(),de(null),be(!1),pe(void 0),L(void 0))},[le,Se,me,M]),a.useEffect(()=>{const ce=je=>{if(je.key==="Escape"){Ve();return}if(je.key==="ArrowLeft"&&me.length>1){mt(le-1);return}if(je.key==="ArrowRight"&&me.length>1){mt(le+1);return}if(je.key==="Tab"&&Be.current){const f=Be.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),j=Array.from(f).filter(Ue=>!Ue.closest('[aria-hidden="true"]'));if(j.length===0)return;const te=j[0],we=j[j.length-1],Ne=document.activeElement;je.shiftKey?(Ne===te||!Be.current.contains(Ne))&&(je.preventDefault(),we.focus()):(Ne===we||!Be.current.contains(Ne))&&(je.preventDefault(),te.focus())}};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[mt,Ve,le,me.length]),a.useLayoutEffect(()=>{Se(),A.current=0,Ce(0),se(null),xe(!1),de(null),be(!1),pe(void 0),L(void 0),Re(null),K(ce=>{const je=Math.max(0,me.length-1);return Math.min(ce,je)})},[Se,t.length,w,me.length]),a.useLayoutEffect(()=>{var f;const ce=Math.max(0,me.length-1),je=Math.min(Math.max(0,l),ce);Me.current=je,Fe.current=((f=me[je])==null?void 0:f.entryIndex)??0,K(je)},[l]);const vt=Ae!==null?t[Ae]:null,bt=q!==null?me[q]:null,Gt=(Y==null?void 0:Y.title1)||(Y==null?void 0:Y.title2)||(Y==null?void 0:Y.title3)||(vt==null?void 0:vt.title1)||(vt==null?void 0:vt.title2)||(vt==null?void 0:vt.title3),Ft=Yg(w,me,t),xt=N!==null,Ht=Gt||Ft||xt,qt=Ft&&xt?{gap:D}:void 0,Zt=`${e}-titles-stack${ne?` ${e}-titles-stack-stacked`:""}`,tn=`${e}-titles-layer-out${ne?` ${e}-titles-layer-out-stacked`:""}`,Ct=`${e}-titles-layer-out`,jt=(_??0)>0||o,cn=V(C),ct=a.useMemo(()=>({title1Width:E??Fi.title1Width,title2Width:R??Fi.title2Width,title3Width:Z??Fi.title3Width}),[E,R,Z]),Te=a.useMemo(()=>({title2MarginLeft:U,title3MarginLeft:F}),[U,F]),Oe=a.useMemo(()=>Y?Vn(e,Y,T,ue,W):[],[e,Y,T,ue,W]),nt=a.useMemo(()=>Oe.map(ce=>ct[ce.widthKey]),[Oe,ct]),dt=a.useMemo(()=>Di(Oe.length,nt),[Oe.length,nt]),ht=a.useMemo(()=>wo(Oe.length,nt),[Oe.length,nt]),Rt=a.useMemo(()=>Oe.filter(ce=>ce.prefix==="title1"),[Oe]),st=a.useMemo(()=>Oe.filter(ce=>ce.prefix==="title2"||ce.prefix==="title3"),[Oe]),Ot=a.useMemo(()=>Gn(Rt,ct),[Rt,ct]),Pt=a.useMemo(()=>Gn(st,ct),[st,ct]),Mt=a.useCallback((ce,je)=>{const f=Oe.findIndex(te=>te.prefix===ce.prefix);if(!ne||je==="single-row")return{effectiveWidth:ht[f]??0,resolvedWidth:dt[f]??0,maxWidth:sn(f,dt)};if(je==="two-row-top"){const te=Rt.findIndex(we=>we.prefix===ce.prefix);return{effectiveWidth:Ot.effective[te]??0,resolvedWidth:Ot.resolved[te]??0,maxWidth:sn(te,Ot.resolved)}}const j=st.findIndex(te=>te.prefix===ce.prefix);return{effectiveWidth:Pt.effective[j]??0,resolvedWidth:Pt.resolved[j]??0,maxWidth:sn(j,Pt.resolved)}},[Oe,st,Pt,ht,dt,Rt,Ot,ne]),zt=a.useCallback(ce=>Cc(Oe,dt,Te,ce)+(ne?0:_??0),[Oe,dt,Te,ne,_]),Bt=a.useCallback(()=>ne?0:_??0,[ne,_]),Wt=a.useCallback(ce=>st.slice(0,ce).reduce((je,f,j)=>je+(f.marginLeftKey?Te[f.marginLeftKey]??0:0)+(Pt.resolved[j]??0),0),[st,Pt.resolved,Te]),_t=a.useCallback(ce=>{const je=st[ce];return Wt(ce)+(je.marginLeftKey?Te[je.marginLeftKey]??0:0)+(Pt.resolved[ce]??0)},[st,Pt.resolved,Wt,Te]),At=a.useCallback((ce,je,f)=>{if(!ne||f==="single-row"){const Ue=ce.findIndex(Jt=>Jt.prefix===je.prefix),yt=ce.map(Jt=>ct[Jt.widthKey]),Lt=Di(ce.length,yt);return{effectiveWidth:wo(ce.length,yt)[Ue]??0,resolvedWidth:Lt[Ue]??0,maxWidth:sn(Ue,Lt)}}if(f==="two-row-top"){const Ue=ce.filter(Jt=>Jt.prefix==="title1"),yt=Ue.findIndex(Jt=>Jt.prefix===je.prefix),{resolved:Lt,effective:en}=Gn(Ue,ct);return{effectiveWidth:en[yt]??0,resolvedWidth:Lt[yt]??0,maxWidth:sn(yt,Lt)}}const j=ce.filter(Ue=>Ue.prefix==="title2"||Ue.prefix==="title3"),te=j.findIndex(Ue=>Ue.prefix===je.prefix),{resolved:we,effective:Ne}=Gn(j,ct);return{effectiveWidth:Ne[te]??0,resolvedWidth:we[te]??0,maxWidth:sn(te,we)}},[ct,ne]),wt=(ce,je,f)=>{const j=ce.marginLeftKey?Te[ce.marginLeftKey]??0:0,{effectiveWidth:te,resolvedWidth:we,maxWidth:Ne}=f??Mt(ce,je),Ue=Math.max(j,Bn),yt=o&&je==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":ce.prefix,style:{width:V(te),...j>0?{marginLeft:V(j)}:{}},children:[r.jsx("p",{className:ce.className,style:ce.style,children:ce.text}),yt&&ce.marginLeftKey?r.jsx("div",{"data-controls":ce.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we),style:{position:"absolute",top:0,left:V(-j),width:V(Ue),height:"100%",pointerEvents:"auto"}}):null,yt?r.jsx("div",{"data-controls":ce.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ne),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:V(-gn/2),width:V(gn),height:"100%",pointerEvents:"auto"}}):null]},ce.className)},v=(ce="two-row")=>{const je=Oe.findIndex(te=>te.prefix==="title1"),f=je>=0?dt[je]:ct.title1Width,j=ce==="two-row"&&o;return r.jsx("div",{...j?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f)}:{},style:{width:V(_??0),flexShrink:0,alignSelf:"stretch",...j?{pointerEvents:"auto"}:{}}})},ve=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:T,"aria-hidden":"true",children:" "}),Le=()=>r.jsx("span",{className:`${e}-entry-counter`,style:ie,"aria-live":"polite","aria-atomic":"true",children:Xg(me,le,w,t)}),ke=()=>Ft?o&&xt?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Le(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Yr(D)} + ${D}))`,width:Yr(D),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Le():null,it=()=>!Ft&&!xt?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:qt,children:[ke(),xt?ft():null]}),Et=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||Gt?ve():null,jt?v("single-row"):null,Tt(Y),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),it(),Sn()]}),Ze=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||Gt?ve():null,jt?v("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:he&&H?{minHeight:H}:void 0,children:[r.jsx("div",{ref:tt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ti(B||Y)}),r.jsxs("div",{ref:lt,className:Zt,style:{position:he?"absolute":"relative",inset:he?0:void 0,width:"100%",...he&&O?{width:O,maxWidth:"100%"}:void 0},children:[vt&&he?r.jsx("div",{className:`${tn} ${e}-titles-fade-out`,children:ti(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${he?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ti(Y)})]})]}),it(),Sn()]}),ft=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:$.scalingValue(I??0,i),height:$.scalingValue(I??0,i),marginRight:ae,"--close-icon-hover-color":k},children:[r.jsx("button",{ref:fe,type:"button",className:`${e}-close-icon-inner`,onClick:Ve,"aria-label":"Close",children:r.jsx(rn,{url:N??"",fill:J,hoverFill:i&&!s?J:k,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ae,height:"100%",pointerEvents:"auto"}})]}),Nt=(ce,je)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Ft||Gt?ve():null,jt?v("two-row"):null,je!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:je},children:ce}):r.jsxs(r.Fragment,{children:[ce,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),it()]}),Tt=ce=>{if(!ce)return null;const je=Vn(e,ce,T,ue,W);return r.jsx(r.Fragment,{children:je.map(f=>wt(f,"single-row",At(je,f,"single-row")))})},nn=ce=>{if(!ce)return null;const je=Vn(e,ce,T,ue,W),f=je.find(j=>j.prefix==="title1");return f?wt(f,"two-row-top",At(je,f,"two-row-top")):null},dn=(ce,je=!1)=>{const f=ce?Vn(e,ce,T,ue,W):[],j=f.filter(Ne=>Ne.prefix==="title2"||Ne.prefix==="title3"),te=o&&je;return j.length>0||te||(C??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[j.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[j.map(Ne=>wt(Ne,"two-row-bottom",At(f,Ne,"two-row-bottom"))),je&&o?r.jsxs(r.Fragment,{children:[Wr(),_r()]}):null]}):null,(C??0)>0||te?r.jsx("div",{"data-controls":te?"titleRowMarginBottom":void 0,"data-controls-axis":te?"y":void 0,"data-controls-reverse":te?"":void 0,className:te?`${e}-control`:void 0,style:{height:cn,width:"100%",flexShrink:0,pointerEvents:te?"auto":"none"}}):null]}):null},ei=(ce,je=!1)=>r.jsxs(r.Fragment,{children:[Nt(nn(ce)),dn(ce,je)]}),ti=ce=>ne?r.jsx("div",{className:`${e}-titles-row-two-row`,children:ei(ce)}):ce?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Tt(ce)}):null,Fo=()=>{const ce=ne?-1:Oe.findIndex(j=>j.prefix==="title1"),je=!ne&&(o||(_??0)>0)?(()=>{const j=_??0,te=ce>=0?dt[ce]:ct.title1Width,we=Math.max(j,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(te),style:{position:"absolute",top:0,left:0,width:V(we),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,f=Oe.flatMap((j,te)=>{if(!j.marginLeftKey)return[];const we=Te[j.marginLeftKey]??0,Ne=$c(Oe,dt,Te,te)+Bt(),Ue=Math.max(we,Bn);return r.jsx("div",{"data-controls":j.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(dt[te]),style:{position:"absolute",top:0,left:V(Ne),width:V(Ue),height:"100%",pointerEvents:"auto"}},j.marginLeftKey)});return je?[je,...f]:f},Wo=()=>Oe.map((ce,je)=>{const f=sn(je,dt),te=zt(je)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ce.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(f),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:V(te),width:V(gn),height:"100%",pointerEvents:"auto"}})},`${ce.widthKey}-junction`)}),Wr=()=>st.flatMap((ce,je)=>{if(!ce.marginLeftKey)return[];const f=Te[ce.marginLeftKey]??0,j=Wt(je),te=Math.max(f,Bn),{resolvedWidth:we}=Mt(ce,"two-row-bottom");return r.jsx("div",{"data-controls":ce.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we),style:{position:"absolute",top:0,left:V(j),width:V(te),height:"100%",pointerEvents:"auto"}},ce.marginLeftKey)}),_r=()=>st.map((ce,je)=>{const{maxWidth:f}=Mt(ce,"two-row-bottom"),te=_t(je)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ce.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(f),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:V(te),width:V(gn),height:"100%",pointerEvents:"auto"}})},`${ce.widthKey}-junction`)}),Sn=()=>!o||ne?null:r.jsxs(r.Fragment,{children:[Fo(),Wo()]}),xi=ce=>{const je=!ce.objectFit&&Fn(b);return{className:`${e}-slide-image-cell${je?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:S,maxHeight:P,...je?{"--image-aspect-ratio":Ar(b)}:{}}}},_o=ce=>ce.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":ce.objectFit}}:Fn(b)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ni=ce=>{if(ce.length===0)return null;const je=ce.length>1,f=Yr(oe),j=`calc(-0.5 * (${f} + ${oe}))`;if(ce.length===1){const te=ce[0];return r.jsx("div",{...xi(te),children:r.jsx("img",{..._o(te),src:te.url,alt:te.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:je?{gap:oe}:void 0,children:ce.map((te,we)=>r.jsxs("div",{...xi(te),children:[r.jsx("img",{..._o(te),src:te.url,alt:te.name??"",draggable:!1}),o&&je&&we<ce.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:j,width:f,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${te.url}-${we}`))})},No=!!(Y!=null&&Y.title2||Y!=null&&Y.title3||vt!=null&&vt.title2||vt!=null&&vt.title3||(C??0)>0||o),Nr=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:tt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ei(B||Y)}),r.jsxs("div",{ref:lt,className:`${e}-titles-row-two-row`,style:{...he&&H?{minHeight:H}:void 0,...he&&O?{width:O,maxWidth:"100%"}:void 0},children:[Nt(r.jsxs("div",{className:Zt,style:{position:he?"absolute":"relative",inset:he?0:void 0,width:"100%"},children:[vt&&he?r.jsx("div",{className:`${Ct} ${e}-titles-fade-out`,children:nn(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${he?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(Y)})]}),he&&H?H:void 0),No?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[vt&&he?r.jsx("div",{className:`${tn} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:dn(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${he?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ne?` ${e}-titles-layer-in-stacked`:""}`,children:dn(Y,!0)})]}):null]})]}),Hr=()=>{const ce=No;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ce?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:ce?void 0:{flex:"0 0 auto",height:"auto"},children:ei(Y,!0)}),Sn()]})};return r.jsxs("div",{ref:Be,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{at||Ve()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:We?1:0,transition:"opacity 300ms ease",pointerEvents:We?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:h,...et}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ye,...He,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:$t,onClick:ce=>ce.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ye&&me.length>1?"true":"false",onPointerDown:ye?kt:void 0,onPointerUp:ye?Xt:void 0,onPointerCancel:ye?Yt:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[bt&&ge?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:ce=>{ce.target===ce.currentTarget&&_e(Ee)},children:r.jsx("div",{className:`${e}-slide-area`,children:ni(bt.images)})},`slide-out-${Ee}`):null,r.jsx("div",{className:`${e}-slide-layer-in${ge?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:ee?ni(ee.images):null})},`slide-in-${Ee}-${le}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:ut,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:re,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ne?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${ne?` ${e}-lightbox-content-area-stacked`:""}`,children:Ht&&r.jsx("div",{className:`${e}-text-bar-cell${ne?` ${e}-text-bar-cell-stacked`:""}`,style:ne?void 0:{flex:1,minWidth:0,width:"100%"},children:ne?M==="fade"?Nr():Hr():M==="fade"?Ze():Et()})})})]})]})]})};function ky(e){return`
|
|
15052
|
+
`,Ay="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>'),si={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 Fy(e){const t={};return t[Dt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Dt(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Dt(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Dt(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Dt(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Dt(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Dt(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Dt(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Wy=qi.reduce((e,t)=>({...e,...Fy(t)}),{}),_y=qi.reduce((e,t)=>({...e,[Dt(t,"fontFamily")]:"Goudy Bookletter 1911",[Dt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Dt(t,"letterSpacing")]:0,[Dt(t,"wordSpacing")]:0,[Dt(t,"textAlign")]:"left",[Dt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function aa(e){return qi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Dt(n,"fontSize")]=i),o!==void 0&&(t[Dt(n,"lineHeight")]=o),t},{})}const Hy=Ly(),Ny={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"}},...Wy,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:Ay,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",..._y},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,...aa({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,...aa({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,...aa({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:[Hy]}],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"}]}},Oy={element:Py,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:Ny,sourceCode:ky,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...qi.map(e=>({path:`${Dt(e,"fontFamily")}`}))]},fontRelations:{...qi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Dt(t,"fontFamily")}`}),{})}},Dy=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:v,coverFit:y,backgroundColor:g,imageGap:h,maxWidth:m,maxHeight:b,textTransition:E,title1Width:R,title2Width:L,title3Width:J,title1MarginLeft:W=0,title2MarginLeft:q=0,title3MarginLeft:A=0,titleRowMarginBottom:C=0,titleHeaderLayout:O="single-row",countCloseGap:w=0,closeIcon:H,closeIconMaxWidth:P,closeIconColor:X,closeIconHoverColor:k,contentMarginTop:Y=0,iconMarginRight:U=0}=n,V=a.useCallback(le=>$.scalingValue(le,i??!1),[i]),ie=V(h??0),S=`${m}%`,M=`${b}%`,z=V(w),ae=V(Y),re=V(U),I=pi("title1",ui(n,"title1"),i),ue=pi("title2",ui(n,"title2"),i),F=pi("title3",ui(n,"title3"),i),oe=pi("count",ui(n,"count"),i),Q=O==="mobile",ye=!i||!!s,Pe=!o&&(!i||!!s),pe=a.useMemo(()=>rr(t,v),[t,v]),[ce,K]=a.useState(l),te=pe[ce],Z=te==null?void 0:te.entry,[Fe,$e]=a.useState(!1),[We,de]=a.useState(null),[he,be]=a.useState(!1),[G,se]=a.useState(null),[ge,xe]=a.useState(!1),[Me,Ce]=a.useState(0),[N,me]=a.useState(),[D,T]=a.useState(),[B,Le]=a.useState(null),ne=a.useRef(null),_=a.useRef(0),ke=a.useRef(0),Ie=a.useRef(0),Ze=a.useRef(!1),Ke=a.useRef(null),at=a.useRef(null),tt=a.useRef(null),Ve=a.useRef(null),fe=a.useRef(null),Ee=a.useRef(null),De=a.useRef(null),qe=a.useCallback(()=>{const le=at.current;if(!le)return;const je=le.closest(`.${e}-lightbox-content-area`);if(!je)return le.getBoundingClientRect().width;const f=Array.from(je.children).reduce((j,ee)=>!(ee instanceof HTMLElement)||ee.contains(le)?j:j+ee.getBoundingClientRect().width,0);return je.getBoundingClientRect().width-f},[e]),we=a.useCallback(()=>{ne.current&&(clearTimeout(ne.current),ne.current=null)},[]),Oe=a.useCallback(le=>{le===_.current&&(se(null),xe(!1))},[]),ze=a.useCallback(()=>{o||Ze.current||(Ze.current=!0,u==null||u(),$e(!1),Ke.current=setTimeout(()=>{p()},300))},[o,u,p]),Ye=a.useCallback(le=>!!(le.closest("[data-controls]")||le.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ot,backdropStyle:Je,mediaAreaStyle:bt,overlayContentStyle:lt,swipeHandlers:_e,dismissAreaStyle:Xe}=Nc({enabled:Pe,onClose:ze,animMs:300,isBlockedTarget:Ye}),Be=a.useCallback(le=>{d&&bc(le+1,c,!0)},[d,c]),pt=a.useCallback(le=>{if(le)return le.getBoundingClientRect().height},[]),mt=a.useCallback(le=>{if(pe.length===0)return;const je=(le%pe.length+pe.length)%pe.length;if(je===ce)return;const f=pe[ce],j=pe[je];_.current+=1;const ee=_.current,Se=E==="fade"&&Bs(f==null?void 0:f.entry)!==Bs(j==null?void 0:j.entry),He=pt(tt.current),Ue=Se?(()=>{const Lt=qe();Yn.flushSync(()=>{Le(j.entry)}),tt.current&&Lt&&(tt.current.style.width=`${Lt}px`);const en=pt(tt.current);return tt.current&&(tt.current.style.width=""),{measuredIncomingTitlesHeight:en,incomingTitlesMeasureWidth:Lt}})():void 0,yt=Math.max(He??0,(Ue==null?void 0:Ue.measuredIncomingTitlesHeight)??0)||void 0;Ce(ee),se(ce),xe(!0),K(je),Be(je),Ie.current=je,Se?(we(),yt&&me(yt),Ue!=null&&Ue.incomingTitlesMeasureWidth&&T(Ue.incomingTitlesMeasureWidth),de((f==null?void 0:f.entryIndex)??null),be(!0),ke.current=j.entryIndex,ne.current=setTimeout(()=>{de(null),be(!1),me(void 0),T(void 0),Le(null),ne.current=null},400)):(we(),de(null),be(!1),me(void 0),T(void 0),Le(null),ke.current=j.entryIndex)},[ce,we,qe,pt,pe,Be,E]),gt=a.useCallback(()=>{De.current=null},[]),kt=a.useCallback(le=>{!ye||pe.length<=1||le.pointerType==="mouse"&&le.button!==0||le.target.closest("[data-controls]")||(De.current={startX:le.clientX,startY:le.clientY,pointerId:le.pointerId})},[ye,pe.length]),Xt=a.useCallback(le=>{var Lt;if(!ye||pe.length<=1||le.pointerType==="mouse"&&le.button!==0)return;if(ot){gt();return}const je=De.current;if(!je||je.pointerId!==le.pointerId||(gt(),le.target.closest("[data-controls]")))return;const j=le.clientX-je.startX,ee=le.clientY-je.startY,Se=Math.abs(j),He=Math.abs(ee);if(Se>=Zg&&Se>He){mt(j>0?ce-1:ce+1);return}if(Se>Os||He>Os)return;const Ue=(Lt=Ve.current)==null?void 0:Lt.getBoundingClientRect(),yt=Ue?Ue.left+Ue.width/2:window.innerWidth/2;mt(le.clientX<yt?ce-1:ce+1)},[ce,ye,mt,ot,gt,pe.length]),Yt=a.useCallback(le=>{const je=De.current;(je==null?void 0:je.pointerId)===le.pointerId&>()},[gt]);Oc(),a.useEffect(()=>{Ee.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const le=requestAnimationFrame(()=>{$e(!0),requestAnimationFrame(()=>{fe.current?fe.current.focus():Ve.current&&Ve.current.focus()})});return()=>{cancelAnimationFrame(le),Ke.current&&clearTimeout(Ke.current),ne.current&&clearTimeout(ne.current);const je=Ee.current;je&&document.contains(je)&&je.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var le;E!=="fade"&&(ke.current=((le=pe[ce])==null?void 0:le.entryIndex)??0,we(),de(null),be(!1),me(void 0),T(void 0))},[ce,we,pe,E]),a.useEffect(()=>{const le=je=>{if(je.key==="Escape"){ze();return}if(je.key==="ArrowLeft"&&pe.length>1){mt(ce-1);return}if(je.key==="ArrowRight"&&pe.length>1){mt(ce+1);return}if(je.key==="Tab"&&Ve.current){const f=Ve.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),j=Array.from(f).filter(Ue=>!Ue.closest('[aria-hidden="true"]'));if(j.length===0)return;const ee=j[0],Se=j[j.length-1],He=document.activeElement;je.shiftKey?(He===ee||!Ve.current.contains(He))&&(je.preventDefault(),Se.focus()):(He===Se||!Ve.current.contains(He))&&(je.preventDefault(),ee.focus())}};return window.addEventListener("keydown",le),()=>window.removeEventListener("keydown",le)},[mt,ze,ce,pe.length]),a.useLayoutEffect(()=>{we(),_.current=0,Ce(0),se(null),xe(!1),de(null),be(!1),me(void 0),T(void 0),Le(null),K(le=>{const je=Math.max(0,pe.length-1);return Math.min(le,je)})},[we,t.length,v,pe.length]),a.useLayoutEffect(()=>{var f;const le=Math.max(0,pe.length-1),je=Math.min(Math.max(0,l),le);Ie.current=je,ke.current=((f=pe[je])==null?void 0:f.entryIndex)??0,K(je)},[l]);const vt=We!==null?t[We]:null,wt=G!==null?pe[G]:null,Gt=(Z==null?void 0:Z.title1)||(Z==null?void 0:Z.title2)||(Z==null?void 0:Z.title3)||(vt==null?void 0:vt.title1)||(vt==null?void 0:vt.title2)||(vt==null?void 0:vt.title3),Ft=rh(v,pe,t),xt=H!==null,Nt=Gt||Ft||xt,qt=Ft&&xt?{gap:z}:void 0,Zt=`${e}-titles-stack${Q?` ${e}-titles-stack-stacked`:""}`,tn=`${e}-titles-layer-out${Q?` ${e}-titles-layer-out-stacked`:""}`,Ct=`${e}-titles-layer-out`,jt=(W??0)>0||o,cn=V(C),dt=a.useMemo(()=>({title1Width:R??Fi.title1Width,title2Width:L??Fi.title2Width,title3Width:J??Fi.title3Width}),[R,L,J]),Te=a.useMemo(()=>({title2MarginLeft:q,title3MarginLeft:A}),[q,A]),Ne=a.useMemo(()=>Z?Vn(e,Z,I,ue,F):[],[e,Z,I,ue,F]),nt=a.useMemo(()=>Ne.map(le=>dt[le.widthKey]),[Ne,dt]),ut=a.useMemo(()=>Di(Ne.length,nt),[Ne.length,nt]),ht=a.useMemo(()=>wo(Ne.length,nt),[Ne.length,nt]),Rt=a.useMemo(()=>Ne.filter(le=>le.prefix==="title1"),[Ne]),ct=a.useMemo(()=>Ne.filter(le=>le.prefix==="title2"||le.prefix==="title3"),[Ne]),Ot=a.useMemo(()=>Gn(Rt,dt),[Rt,dt]),Pt=a.useMemo(()=>Gn(ct,dt),[ct,dt]),Mt=a.useCallback((le,je)=>{const f=Ne.findIndex(ee=>ee.prefix===le.prefix);if(!Q||je==="single-row")return{effectiveWidth:ht[f]??0,resolvedWidth:ut[f]??0,maxWidth:sn(f,ut)};if(je==="two-row-top"){const ee=Rt.findIndex(Se=>Se.prefix===le.prefix);return{effectiveWidth:Ot.effective[ee]??0,resolvedWidth:Ot.resolved[ee]??0,maxWidth:sn(ee,Ot.resolved)}}const j=ct.findIndex(ee=>ee.prefix===le.prefix);return{effectiveWidth:Pt.effective[j]??0,resolvedWidth:Pt.resolved[j]??0,maxWidth:sn(j,Pt.resolved)}},[Ne,ct,Pt,ht,ut,Rt,Ot,Q]),zt=a.useCallback(le=>Cc(Ne,ut,Te,le)+(Q?0:W??0),[Ne,ut,Te,Q,W]),Bt=a.useCallback(()=>Q?0:W??0,[Q,W]),Wt=a.useCallback(le=>ct.slice(0,le).reduce((je,f,j)=>je+(f.marginLeftKey?Te[f.marginLeftKey]??0:0)+(Pt.resolved[j]??0),0),[ct,Pt.resolved,Te]),_t=a.useCallback(le=>{const je=ct[le];return Wt(le)+(je.marginLeftKey?Te[je.marginLeftKey]??0:0)+(Pt.resolved[le]??0)},[ct,Pt.resolved,Wt,Te]),At=a.useCallback((le,je,f)=>{if(!Q||f==="single-row"){const Ue=le.findIndex(Jt=>Jt.prefix===je.prefix),yt=le.map(Jt=>dt[Jt.widthKey]),Lt=Di(le.length,yt);return{effectiveWidth:wo(le.length,yt)[Ue]??0,resolvedWidth:Lt[Ue]??0,maxWidth:sn(Ue,Lt)}}if(f==="two-row-top"){const Ue=le.filter(Jt=>Jt.prefix==="title1"),yt=Ue.findIndex(Jt=>Jt.prefix===je.prefix),{resolved:Lt,effective:en}=Gn(Ue,dt);return{effectiveWidth:en[yt]??0,resolvedWidth:Lt[yt]??0,maxWidth:sn(yt,Lt)}}const j=le.filter(Ue=>Ue.prefix==="title2"||Ue.prefix==="title3"),ee=j.findIndex(Ue=>Ue.prefix===je.prefix),{resolved:Se,effective:He}=Gn(j,dt);return{effectiveWidth:He[ee]??0,resolvedWidth:Se[ee]??0,maxWidth:sn(ee,Se)}},[dt,Q]),St=(le,je,f)=>{const j=le.marginLeftKey?Te[le.marginLeftKey]??0:0,{effectiveWidth:ee,resolvedWidth:Se,maxWidth:He}=f??Mt(le,je),Ue=Math.max(j,Bn),yt=o&&je==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":le.prefix,style:{width:V(ee),...j>0?{marginLeft:V(j)}:{}},children:[r.jsx("p",{className:le.className,style:le.style,children:le.text}),yt&&le.marginLeftKey?r.jsx("div",{"data-controls":le.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Se),style:{position:"absolute",top:0,left:V(-j),width:V(Ue),height:"100%",pointerEvents:"auto"}}):null,yt?r.jsx("div",{"data-controls":le.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(He),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:V(-gn/2),width:V(gn),height:"100%",pointerEvents:"auto"}}):null]},le.className)},x=(le="two-row")=>{const je=Ne.findIndex(ee=>ee.prefix==="title1"),f=je>=0?ut[je]:dt.title1Width,j=le==="two-row"&&o;return r.jsx("div",{...j?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f)}:{},style:{width:V(W??0),flexShrink:0,alignSelf:"stretch",...j?{pointerEvents:"auto"}:{}}})},ve=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:I,"aria-hidden":"true",children:" "}),Re=()=>r.jsx("span",{className:`${e}-entry-counter`,style:oe,"aria-live":"polite","aria-atomic":"true",children:oh(pe,ce,v,t)}),Ae=()=>Ft?o&&xt?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Re(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Yr(z)} + ${z}))`,width:Yr(z),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Re():null,it=()=>!Ft&&!xt?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:qt,children:[Ae(),xt?ft():null]}),Et=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||Gt?ve():null,jt?x("single-row"):null,Tt(Z),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),it(),Sn()]}),Qe=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ft||Gt?ve():null,jt?x("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:he&&N?{minHeight:N}:void 0,children:[r.jsx("div",{ref:tt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ti(B||Z)}),r.jsxs("div",{ref:at,className:Zt,style:{position:he?"absolute":"relative",inset:he?0:void 0,width:"100%",...he&&D?{width:D,maxWidth:"100%"}:void 0},children:[vt&&he?r.jsx("div",{className:`${tn} ${e}-titles-fade-out`,children:ti(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${he?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ti(Z)})]})]}),it(),Sn()]}),ft=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:$.scalingValue(P??0,i),height:$.scalingValue(P??0,i),marginRight:re,"--close-icon-hover-color":k},children:[r.jsx("button",{ref:fe,type:"button",className:`${e}-close-icon-inner`,onClick:ze,"aria-label":"Close",children:r.jsx(rn,{url:H??"",fill:X,hoverFill:i&&!s?X:k,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:re,height:"100%",pointerEvents:"auto"}})]}),Ht=(le,je)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Ft||Gt?ve():null,jt?x("two-row"):null,je!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:je},children:le}):r.jsxs(r.Fragment,{children:[le,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),it()]}),Tt=le=>{if(!le)return null;const je=Vn(e,le,I,ue,F);return r.jsx(r.Fragment,{children:je.map(f=>St(f,"single-row",At(je,f,"single-row")))})},nn=le=>{if(!le)return null;const je=Vn(e,le,I,ue,F),f=je.find(j=>j.prefix==="title1");return f?St(f,"two-row-top",At(je,f,"two-row-top")):null},dn=(le,je=!1)=>{const f=le?Vn(e,le,I,ue,F):[],j=f.filter(He=>He.prefix==="title2"||He.prefix==="title3"),ee=o&&je;return j.length>0||ee||(C??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[j.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[j.map(He=>St(He,"two-row-bottom",At(f,He,"two-row-bottom"))),je&&o?r.jsxs(r.Fragment,{children:[Wr(),_r()]}):null]}):null,(C??0)>0||ee?r.jsx("div",{"data-controls":ee?"titleRowMarginBottom":void 0,"data-controls-axis":ee?"y":void 0,"data-controls-reverse":ee?"":void 0,className:ee?`${e}-control`:void 0,style:{height:cn,width:"100%",flexShrink:0,pointerEvents:ee?"auto":"none"}}):null]}):null},ei=(le,je=!1)=>r.jsxs(r.Fragment,{children:[Ht(nn(le)),dn(le,je)]}),ti=le=>Q?r.jsx("div",{className:`${e}-titles-row-two-row`,children:ei(le)}):le?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Tt(le)}):null,Fo=()=>{const le=Q?-1:Ne.findIndex(j=>j.prefix==="title1"),je=!Q&&(o||(W??0)>0)?(()=>{const j=W??0,ee=le>=0?ut[le]:dt.title1Width,Se=Math.max(j,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ee),style:{position:"absolute",top:0,left:0,width:V(Se),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,f=Ne.flatMap((j,ee)=>{if(!j.marginLeftKey)return[];const Se=Te[j.marginLeftKey]??0,He=$c(Ne,ut,Te,ee)+Bt(),Ue=Math.max(Se,Bn);return r.jsx("div",{"data-controls":j.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ut[ee]),style:{position:"absolute",top:0,left:V(He),width:V(Ue),height:"100%",pointerEvents:"auto"}},j.marginLeftKey)});return je?[je,...f]:f},Wo=()=>Ne.map((le,je)=>{const f=sn(je,ut),ee=zt(je)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":le.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(f),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:V(ee),width:V(gn),height:"100%",pointerEvents:"auto"}})},`${le.widthKey}-junction`)}),Wr=()=>ct.flatMap((le,je)=>{if(!le.marginLeftKey)return[];const f=Te[le.marginLeftKey]??0,j=Wt(je),ee=Math.max(f,Bn),{resolvedWidth:Se}=Mt(le,"two-row-bottom");return r.jsx("div",{"data-controls":le.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Se),style:{position:"absolute",top:0,left:V(j),width:V(ee),height:"100%",pointerEvents:"auto"}},le.marginLeftKey)}),_r=()=>ct.map((le,je)=>{const{maxWidth:f}=Mt(le,"two-row-bottom"),ee=_t(je)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":le.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(f),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:V(ee),width:V(gn),height:"100%",pointerEvents:"auto"}})},`${le.widthKey}-junction`)}),Sn=()=>!o||Q?null:r.jsxs(r.Fragment,{children:[Fo(),Wo()]}),xi=le=>{const je=!le.objectFit&&Fn(y);return{className:`${e}-slide-image-cell${je?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:S,maxHeight:M,...je?{"--image-aspect-ratio":Ar(y)}:{}}}},_o=le=>le.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":le.objectFit}}:Fn(y)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ni=le=>{if(le.length===0)return null;const je=le.length>1,f=Yr(ie),j=`calc(-0.5 * (${f} + ${ie}))`;if(le.length===1){const ee=le[0];return r.jsx("div",{...xi(ee),children:r.jsx("img",{..._o(ee),src:ee.url,alt:ee.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:je?{gap:ie}:void 0,children:le.map((ee,Se)=>r.jsxs("div",{...xi(ee),children:[r.jsx("img",{..._o(ee),src:ee.url,alt:ee.name??"",draggable:!1}),o&&je&&Se<le.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:j,width:f,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ee.url}-${Se}`))})},Ho=!!(Z!=null&&Z.title2||Z!=null&&Z.title3||vt!=null&&vt.title2||vt!=null&&vt.title3||(C??0)>0||o),Hr=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:tt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ei(B||Z)}),r.jsxs("div",{ref:at,className:`${e}-titles-row-two-row`,style:{...he&&N?{minHeight:N}:void 0,...he&&D?{width:D,maxWidth:"100%"}:void 0},children:[Ht(r.jsxs("div",{className:Zt,style:{position:he?"absolute":"relative",inset:he?0:void 0,width:"100%"},children:[vt&&he?r.jsx("div",{className:`${Ct} ${e}-titles-fade-out`,children:nn(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${he?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(Z)})]}),he&&N?N:void 0),Ho?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[vt&&he?r.jsx("div",{className:`${tn} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:dn(vt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${he?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${Q?` ${e}-titles-layer-in-stacked`:""}`,children:dn(Z,!0)})]}):null]})]}),Nr=()=>{const le=Ho;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...le?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:le?void 0:{flex:"0 0 auto",height:"auto"},children:ei(Z,!0)}),Sn()]})};return r.jsxs("div",{ref:Ve,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ot||ze()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Fe?1:0,transition:"opacity 300ms ease",pointerEvents:Fe?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:g,...Je}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Xe,..._e,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:bt,onClick:le=>le.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ye&&pe.length>1?"true":"false",onPointerDown:ye?kt:void 0,onPointerUp:ye?Xt:void 0,onPointerCancel:ye?Yt:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&ge?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:le=>{le.target===le.currentTarget&&Oe(Me)},children:r.jsx("div",{className:`${e}-slide-area`,children:ni(wt.images)})},`slide-out-${Me}`):null,r.jsx("div",{className:`${e}-slide-layer-in${ge?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:te?ni(te.images):null})},`slide-in-${Me}-${ce}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:lt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ae,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...Q?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:Nt&&r.jsx("div",{className:`${e}-text-bar-cell${Q?` ${e}-text-bar-cell-stacked`:""}`,style:Q?void 0:{flex:1,minWidth:0,width:"100%"},children:Q?E==="fade"?Hr():Nr():E==="fade"?Qe():Et()})})})]})]})]})};function jy(e){return`
|
|
14972
15053
|
.${e}-wrapper {
|
|
14973
15054
|
position: relative;
|
|
14974
15055
|
width: 100%;
|
|
@@ -15490,7 +15571,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15490
15571
|
pointer-events: auto;
|
|
15491
15572
|
z-index: 10;
|
|
15492
15573
|
}
|
|
15493
|
-
`}const
|
|
15574
|
+
`}const zy=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s,metadata:l})=>{const{prefix:d}=$.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:v}=e,y=a.useRef(null),[g,h]=a.useState(!1),[m,b]=a.useState(0),E=a.useRef(!1),R=a.useRef(!1),L=a.useRef(!1),J=a.useMemo(()=>(t??[]).filter(w=>Oi(w).length>0),[t]),W=g&&J.length>0,q=!n,A=a.useCallback(()=>{q&&(L.current=!0,Qg(R.current,c),R.current=!1)},[q,c]),C=(w=0)=>{if(J.length===0||n&&!i&&!o)return;const H=rr(J,v),P=Math.max(0,Math.min(w,H.length-1));if(b(P),q){const X=wc();bc(P+1,c,X),R.current=!X}h(!0)},O=a.useCallback(()=>{h(!1),L.current=!1},[]);return a.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),a.useEffect(()=>{if(!q||E.current)return;E.current=!0;const w=js(c);if(!w)return;const H=zs(w,rr(J,v).length);H<0||(b(H),h(!0))},[J,c,q,v]),a.useEffect(()=>{if(!q)return;const w=()=>{if(L.current){L.current=!1,h(!1);return}const H=js(c);if(!H){h(!1);return}const P=zs(H,rr(J,v).length);if(P<0){h(!1);return}R.current=!1,b(P),h(!0)};return window.addEventListener("popstate",w),()=>window.removeEventListener("popstate",w)},[J,c,q,v]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:y,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:jy(d)}}),u?r.jsx("button",{type:"button",className:`${d}-cover ${Fn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>C(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Fn(p)?{"--image-aspect-ratio":Ar(p)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Fn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),W&&typeof document<"u"&&(()=>{const w=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx(Dy,{prefix:d,entries:J,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:m,enableUrlSync:q,journalItemId:c,onBeforeClose:A,onClose:O}),w)})()]})},By=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
15494
15575
|
import { createPortal } from 'react-dom';
|
|
15495
15576
|
import { CommonComponentProps } from '../props';
|
|
15496
15577
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16246,7 +16327,7 @@ export type LightboxJournalSettings = {
|
|
|
16246
16327
|
closeIconColor: string;
|
|
16247
16328
|
closeIconHoverColor: string;
|
|
16248
16329
|
};
|
|
16249
|
-
`,Wy="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>'),li={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 _y(e){const t={};return t[Je(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Je(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Je(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Je(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Je(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Je(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Je(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Je(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ny=Kn.reduce((e,t)=>({...e,..._y(t)}),{}),Hy=Kn.reduce((e,t)=>({...e,[Je(t,"fontFamily")]:"Goudy Bookletter 1911",[Je(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Je(t,"letterSpacing")]:0,[Je(t,"wordSpacing")]:0,[Je(t,"textAlign")]:"left",[Je(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function sa(e){return Kn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Je(n,"fontSize")]=i),o!==void 0&&(t[Je(n,"lineHeight")]=o),t},{})}const Oy=Zg(),Dy={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"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},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"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",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"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...Ny,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",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:Wy,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...Hy,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...sa({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},t:{type:"A",imageGap:.05,maxHeight:80,maxWidth:40,closeIconMaxWidth:.03,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.16,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.03,...sa({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208,countFontSize:.0208,countLineHeight:.0208})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...sa({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Oy]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},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"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},{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"},{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"}]}]}},jy={element:Ay,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:Dy,sourceCode:Fy,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Kn.map(e=>({path:`${Je(e,"fontFamily")}`}))]},fontRelations:{...Kn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Je(t,"fontFamily")}`}),{})}},zy={sizeType:"custom",value:700,min:400,max:700};function fr(e,t){return{widthPx:e,heightPx:e*t}}function Ia(e,t,n,i,o,s){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,s/2),i-s/2)}}function hl(e,t,n,i){const{heightPx:o}=fr(n,i);return Ia(e/2,t/2,e,t,n,o)}function jc(e,t,n){for(const i of n){const{heightPx:o}=fr(i.widthPx,i.aspectRatio),s=i.widthPx/2,l=o/2;if(e>=i.x-s&&e<=i.x+s&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function By(e,t,n,i,o,s,l,d){if(o==="system")return"none";const c=i.getBoundingClientRect(),u=document.elementFromPoint(c.left+e,c.top+t);return u&&u.closest("a")?"none":jc(e,t,n)||s==="area"?l??"none":d??"none"}function fl(e,t,n){var d;const{sizeType:i,value:o,min:s,max:l}=t;return i==="custom"?o:i==="as is"?((d=n.get(e))==null?void 0:d.naturalWidth)??o:Math.round(Math.random()*(l-s)+s)}function Vy(e){return`
|
|
16330
|
+
`,Vy="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>'),li={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Gy(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const qy=Kn.reduce((e,t)=>({...e,...Gy(t)}),{}),Uy=Kn.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Goudy Bookletter 1911",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function sa(e){return Kn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const Ky=ah(),Xy={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"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},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"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",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"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...qy,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",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:Vy,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...Uy,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...sa({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},t:{type:"A",imageGap:.05,maxHeight:80,maxWidth:40,closeIconMaxWidth:.03,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.16,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.03,...sa({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208,countFontSize:.0208,countLineHeight:.0208})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...sa({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Ky]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},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"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},{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"},{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"}]}]}},Yy={element:zy,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:Xy,sourceCode:By,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Kn.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{...Kn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})}},Zy={sizeType:"custom",value:700,min:400,max:700};function fr(e,t){return{widthPx:e,heightPx:e*t}}function Ia(e,t,n,i,o,s){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,s/2),i-s/2)}}function hl(e,t,n,i){const{heightPx:o}=fr(n,i);return Ia(e/2,t/2,e,t,n,o)}function jc(e,t,n){for(const i of n){const{heightPx:o}=fr(i.widthPx,i.aspectRatio),s=i.widthPx/2,l=o/2;if(e>=i.x-s&&e<=i.x+s&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function Jy(e,t,n,i,o,s,l,d){if(o==="system")return"none";const c=i.getBoundingClientRect(),u=document.elementFromPoint(c.left+e,c.top+t);return u&&u.closest("a")?"none":jc(e,t,n)||s==="area"?l??"none":d??"none"}function fl(e,t,n){var d;const{sizeType:i,value:o,min:s,max:l}=t;return i==="custom"?o:i==="as is"?((d=n.get(e))==null?void 0:d.naturalWidth)??o:Math.round(Math.random()*(l-s)+s)}function Qy(e){return`
|
|
16250
16331
|
.${e}-root {
|
|
16251
16332
|
position: absolute;
|
|
16252
16333
|
top: 0;
|
|
@@ -16281,7 +16362,7 @@ export type LightboxJournalSettings = {
|
|
|
16281
16362
|
width: 32px;
|
|
16282
16363
|
height: 32px;
|
|
16283
16364
|
}
|
|
16284
|
-
`}function
|
|
16365
|
+
`}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 tv(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 nv({settings:e,content:t=[],isEditor:n}){const{prefix:i}=$.useScopedStyles(),[o,s]=a.useState(null),[l,d]=a.useState([]),[c,u]=a.useState(0),p=a.useRef(0),[v,y]=a.useState({x:0,y:0}),[g,h]=a.useState("none"),m=a.useRef({x:0,y:0}),[b,E]=a.useState(!1),[R,L]=a.useState(!1),J=a.useRef(new Map),{imageSize:W=Zy,cursor:q="system",target:A="area",position:C="random",visible:O="all",defaultCursor:w=null,hoverCursor:H=null}=e,P=t.filter(S=>{var M;return!!((M=S==null?void 0:S.image)!=null&&M.url)}),X=a.useMemo(()=>Qy(i),[i]),k=a.useCallback((S,M,z=l)=>{if(!o)return;const ae=o.getBoundingClientRect(),re=S-ae.left,I=M-ae.top;y({x:re,y:I}),h(Jy(re,I,z,o,q,A,H,w))},[o,l,q,A,H,w]);a.useEffect(()=>{const S=[...P.map(z=>z.image.url),w,H].filter(z=>!!z);if(S.length===0){J.current=new Map,L(!0);return}let M=!1;return L(!1),tv(S).then(z=>{M||(J.current=z,L(!0))}),()=>{M=!0}},[t,w,H]),a.useEffect(()=>{if(!o)return;const S=z=>{z.stopPropagation(),m.current={x:z.clientX,y:z.clientY},k(z.clientX,z.clientY)},M=()=>{b&&k(m.current.x,m.current.y)};return o.addEventListener("mousemove",S),window.addEventListener("scroll",M,!0),()=>{o.removeEventListener("mousemove",S),window.removeEventListener("scroll",M,!0)}},[o,b,k]),a.useEffect(()=>{!o||!b||k(m.current.x,m.current.y)},[l,o,b,k]),a.useEffect(()=>{b||h("none")},[b]);const Y=(S,M,z,ae={})=>{var Q,ye;if(!((Q=S==null?void 0:S.image)!=null&&Q.url))return null;const re=((ye=J.current.get(S.image.url))==null?void 0:ye.aspectRatio)??1,I=fl(S.image.url,W,J.current),{heightPx:ue}=fr(I,re);let F=0,oe=0;return C==="same"?{x:F,y:oe}=hl(M,z,I,re):(F=ae.x??Math.random()*M,oe=ae.y??Math.random()*z,{x:F,y:oe}=Ia(F,oe,M,z,I,ue)),{id:p.current++,url:S.image.url,link:S.link,name:S.image.name,x:F,y:oe,xRatio:F/M,yRatio:oe/z,aspectRatio:re,widthPx:I}},U=()=>{if(!o)return;const S=o.getBoundingClientRect(),M=S.width,z=S.height;M===0||z===0||d(ae=>ae.length===0?ae:ae.map(re=>{const I=W.sizeType==="random"?re.widthPx:fl(re.url,W,J.current),{heightPx:ue}=fr(I,re.aspectRatio);if(C==="same"){const{x:Q,y:ye}=hl(M,z,I,re.aspectRatio);return{...re,x:Q,y:ye,widthPx:I}}const{x:F,y:oe}=Ia(re.xRatio*M,re.yRatio*z,M,z,I,ue);return{...re,x:F,y:oe,widthPx:I}}))};a.useEffect(()=>{if(!o||P.length===0||!R)return;const S=o.getBoundingClientRect(),M=S.width,z=S.height,ae=Y(P[0],M,z);ae&&(d([ae]),u(P.length>1?1:0))},[W,C,o,t,R]),a.useEffect(()=>{if(!o)return;U();const S=new ResizeObserver(U);return S.observe(o),window.addEventListener("resize",U),()=>{S.disconnect(),window.removeEventListener("resize",U)}},[o,C,W,l.length]),a.useEffect(()=>{O==="last One"&&d(S=>S.length>0?[S[S.length-1]]:[])},[O]);const V=S=>{if(!o||P.length===0||!R)return;const M=o.getBoundingClientRect(),z=S.clientX-M.left,ae=S.clientY-M.top;if(A==="image"&&!jc(z,ae,l))return;let re=0,I=0;C==="on Click"?(re=z,I=ae):C==="same"?(re=M.width/2,I=M.height/2):(re=Math.random()*M.width,I=Math.random()*M.height);const ue=P[c%P.length],F=Y(ue,M.width,M.height,{x:re,y:I});if(!F)return;const oe=O==="all"?[...l,F]:[F];d(oe),u(Q=>(Q+1)%P.length),k(S.clientX,S.clientY,oe)},ie=q==="custom"&&g!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:X}}),r.jsxs("div",{ref:s,onClick:V,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),className:`${i}-root`,style:{cursor:ie?"none":"default"},children:[l.map(S=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${S.y}px`,left:`${S.x}px`,width:`${S.widthPx}px`,cursor:ie?"none":"default"},children:A==="area"&&S.link?r.jsx("a",{href:S.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:S.url,alt:S.name,className:`${i}-image`})}):r.jsx("img",{src:S.url,alt:S.name,className:`${i}-image`})},S.id)),b&&ie&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${v.x}px`,top:`${v.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const iv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16285
16366
|
import { CommonComponentProps } from '../props';
|
|
16286
16367
|
import { useScopedStyles } from '../utils/index';
|
|
16287
16368
|
|
|
@@ -16811,7 +16892,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
16811
16892
|
</>
|
|
16812
16893
|
);
|
|
16813
16894
|
}
|
|
16814
|
-
`,
|
|
16895
|
+
`,ov={type:"object",version:1,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"}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"Slider-4.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"Slider-5.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"Slider-6.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"Slider-7.png"},link:""}]},settings:{sizing:"manual",properties:{imageSize:{type:"object",scope:"layout",title:"Img Size",display:{type:"toggle-cycle-numeric-input",enum:["custom","as is","random"],inputs:{custom:"single","as is":"none",random:"range"},defaultValue:700,defaultMin:400,defaultMax:700},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},cursor:{type:"string",scope:"common",title:"Cursor",display:{type:"toggle-cycle",enum:["system","custom"]}},target:{type:"string",scope:"common",title:"Target",display:{type:"toggle-cycle",enum:["area","image"]}},position:{type:"string",scope:"common",title:"Position",display:{type:"toggle-cycle",enum:["random","same","on Click"]}},visible:{type:"string",scope:"common",title:"Visible",display:{type:"toggle-cycle",enum:["all","last One"]}},defaultCursor:{type:["string","null"],scope:"common",title:"Default",display:{type:"settings-image-input",visible:!1}},hoverCursor:{type:["string","null"],scope:"common",title:"Hover",display:{type:"settings-image-input",visible:!1}}},defaults:{imageSize:{sizeType:"custom",value:700,min:400,max:700},cursor:"system",target:"area",position:"random",visible:"all",defaultCursor:null,hoverCursor:null},layoutDefaults:{m:{imageSize:{sizeType:"custom",value:500,min:400,max:700}},t:{imageSize:{sizeType:"custom",value:600,min:400,max:700}},d:{imageSize:{sizeType:"custom",value:700,min:400,max:700}}},displayRules:[{if:{name:"cursor",value:"custom"},then:{name:"properties.defaultCursor.display.visible",value:!0}},{if:{name:"cursor",value:"custom"},then:{name:"properties.hoverCursor.display.visible",value:!0}}],layout:["__componentName__","imageSize","cursor","target","position","visible","defaultCursor","hoverCursor"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["imageSize"]},{type:"row",title:"",items:["cursor","target"]},{type:"row",title:"",items:["position","visible"]},{type:"row",title:"Custom Cursor",items:["defaultCursor","hoverCursor"]}]}]},rv={element:nv,id:"click-gallerie",name:"Click",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},schema:ov,sourceCode:iv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},av=100,sv=70,Dn="cubic-bezier(0.86, 0, 0.07, 1)";function lv(e){return`
|
|
16815
16896
|
.${e}-wrapper {
|
|
16816
16897
|
position: relative;
|
|
16817
16898
|
width: 100%;
|
|
@@ -16921,7 +17002,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
16921
17002
|
display: block;
|
|
16922
17003
|
pointer-events: none;
|
|
16923
17004
|
}
|
|
16924
|
-
`}function
|
|
17005
|
+
`}function cv(e){return e==="blur"?sv:e==="greyscale"?av:0}function io(e,t=1,n=1){const i=cv(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 yl(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function dv(e,t){return t<=1?0:(e-1+t)%t}function uv(e,t=1){return!e||e.height===0?t:e.width/e.height}function pv(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const s=e*i/100,l=t*o/100;let d=s,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function vl(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 zc(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function xl(e,t,n){return{...zc(e),[`--${n}-stage-scale`]:t}}function mv(e,t){[...new Set(e.filter(Boolean))].forEach(i=>{const o=new Image;o.onload=()=>{o.naturalWidth>0&&o.naturalHeight>0&&t(i,{width:o.naturalWidth,height:o.naturalHeight})},o.src=i})}function gv({settings:e,content:t,isEditor:n,isPreviewMode:i}){var be,G,se,ge,xe,Me,Ce;const{prefix:o}=$.useScopedStyles(),s=a.useMemo(()=>lv(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,v=t??[],y=yl(v.length),[g,h]=a.useState(y.activeIndex),[m,b]=a.useState(y.backgroundIndex),[E,R]=a.useState(!1),[L,J]=a.useState(!1),[W,q]=a.useState(null),[A,C]=a.useState(null),[O,w]=a.useState(0),[H,P]=a.useState(1),[X,k]=a.useState("none"),[Y,U]=a.useState("next"),[V,ie]=a.useState({}),[S,M]=a.useState({width:0,height:0}),z=a.useRef(null),ae=a.useRef(null),re=!n||!!i,I=l??60,ue=Math.max(10,Math.min(100,d??I)),F=Math.max(10,Math.min(100,c??I)),oe=Math.max(100,u),Q=io(p),ye=a.useCallback(N=>{const me=uv(N?V[N]:void 0);return pv(S.width,S.height,me,ue,F)},[S.height,S.width,V,F,ue]);a.useEffect(()=>{const N=ae.current;if(!N)return;const me=new ResizeObserver(([D])=>{const{width:T,height:B}=D.contentRect;M({width:T,height:B})});return me.observe(N),()=>me.disconnect()},[]),a.useEffect(()=>{const N=(t??[]).map(me=>{var D;return(D=me.image)==null?void 0:D.url}).filter(me=>!!me);mv(N,(me,D)=>{ie(T=>{var B,Le;return((B=T[me])==null?void 0:B.width)===D.width&&((Le=T[me])==null?void 0:Le.height)===D.height?T:{...T,[me]:D}})})},[t]),a.useEffect(()=>{const{backgroundIndex:N,activeIndex:me}=yl(v.length);h(me),b(N),R(!1),J(!1),q(null),C(null),w(0),P(1),k("none"),U("next")},[v.length,t]),a.useEffect(()=>()=>{z.current&&clearTimeout(z.current)},[]);const Pe=a.useCallback(N=>{var ne,_,ke,Ie;if(!re||E||v.length<=1)return;const me=N==="next"?(g+1)%v.length:(g-1+v.length)%v.length,D=ye((_=(ne=v[g])==null?void 0:ne.image)==null?void 0:_.url),T=ye((Ie=(ke=v[me])==null?void 0:ke.image)==null?void 0:Ie.url),B=vl(S.width,S.height,D),Le=vl(S.width,S.height,T);z.current&&clearTimeout(z.current),U(N),J(!0),R(!0),N==="next"?(q(g),C(me),w(0),P(1),k(io(p,0,1))):(b(dv(me,v.length)),q(me),C(g),w(1),P(Le),k(io(p,1,Le))),requestAnimationFrame(()=>{J(!1),requestAnimationFrame(()=>{N==="next"?(w(1),P(B),k(io(p,1,B))):(w(0),P(1),k(io(p,0,1)))})}),z.current=setTimeout(()=>{N==="next"&&b(g),h(me),q(null),C(null),R(!1)},oe)},[g,p,S.height,S.width,ye,E,re,v,oe]),pe=v[g],ce=m!==null?v[m]:null,K=W!==null?v[W]:null,te=A!==null?v[A]:null,Z=v.length<=1?0:(g-1+v.length)%v.length,Fe=v.length<=1?0:(g+1)%v.length,$e=ye((be=pe==null?void 0:pe.image)==null?void 0:be.url),We=ye((G=K==null?void 0:K.image)==null?void 0:G.url),de=ye((se=te==null?void 0:te.image)==null?void 0:se.url),he={[`--${o}-transition-ms`]:`${oe}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsxs("div",{ref:ae,className:st(`${o}-wrapper`,L&&`${o}-snap`,n&&!i&&`${o}-editor`),style:he,"aria-label":"Zoom gallery",children:[((ge=ce==null?void 0:ce.image)==null?void 0:ge.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:ce.image.url,alt:"",style:{filter:Q}})}),E&&((xe=K==null?void 0:K.image)==null?void 0:xe.url)&&r.jsx("div",{className:st(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${Y}`),style:xl(We,H,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:K.image.url,alt:"",style:{filter:X}})}),E&&((Me=te==null?void 0:te.image)==null?void 0:Me.url)&&r.jsx("div",{className:st(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${Y}`),style:xl(de,O,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:te.image.url,alt:""})}),!E&&((Ce=pe==null?void 0:pe.image)==null?void 0:Ce.url)&&r.jsx("div",{className:st(`${o}-stage`,`${o}-foreground`),style:zc($e),children:r.jsx("img",{className:`${o}-image`,src:pe.image.url,alt:pe.image.name??""})}),re&&v.length>1&&!E&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:st(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Pe("prev"),"aria-label":`Show previous image (${Z+1} of ${v.length})`}),r.jsx("button",{type:"button",className:st(`${o}-nav`,`${o}-nav-next`),onClick:()=>Pe("next"),"aria-label":`Show next image (${Fe+1} of ${v.length})`})]})]})]})}const hv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16925
17006
|
import cn from 'classnames';
|
|
16926
17007
|
import { CommonComponentProps } from '../props';
|
|
16927
17008
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -17440,7 +17521,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
17440
17521
|
</>
|
|
17441
17522
|
);
|
|
17442
17523
|
}
|
|
17443
|
-
`,
|
|
17524
|
+
`,fv={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:gv,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:fv,sourceCode:hv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},vv={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},xv=["hover","active"],la={left:"flex-start",center:"center",right:"flex-end"};function bv(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 wv(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 Sv(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))`,s=`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}, ${s}`,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}`,v=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,y=`.${e}-button:hover, ${v}`,g=h=>`.${e}-hover-effect-${h}:hover, .${e}-hover-effect-${h}:focus-visible, a:focus-visible .${e}-hover-effect-${h}`;return`
|
|
17444
17525
|
.${e}-root {
|
|
17445
17526
|
line-height: 0;
|
|
17446
17527
|
}
|
|
@@ -17470,11 +17551,11 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
17470
17551
|
.${e}-wrapper.${e}-editing .${e}-button {
|
|
17471
17552
|
transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms;
|
|
17472
17553
|
}
|
|
17473
|
-
${
|
|
17554
|
+
${g("scale-up")},
|
|
17474
17555
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-scale-up {
|
|
17475
17556
|
transform: scale(1.05);
|
|
17476
17557
|
}
|
|
17477
|
-
${
|
|
17558
|
+
${g("lift")},
|
|
17478
17559
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-lift {
|
|
17479
17560
|
transform: translateY(-2px);
|
|
17480
17561
|
box-shadow: ${p};
|
|
@@ -17536,9 +17617,9 @@ a:focus-visible .${e}-hover-effect-swipe::before,
|
|
|
17536
17617
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-swipe::before {
|
|
17537
17618
|
transform: translateX(0);
|
|
17538
17619
|
}
|
|
17539
|
-
${
|
|
17620
|
+
${g("reveal")},
|
|
17540
17621
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-reveal,
|
|
17541
|
-
${
|
|
17622
|
+
${g("swipe")},
|
|
17542
17623
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-swipe {
|
|
17543
17624
|
background-color: var(--${e}-background-color);
|
|
17544
17625
|
}
|
|
@@ -17601,7 +17682,7 @@ a:focus-visible .${e}-hover-effect-content-roll .${e}-content-roll-layer-hover,
|
|
|
17601
17682
|
transform: translateY(-50%);
|
|
17602
17683
|
opacity: 1;
|
|
17603
17684
|
}
|
|
17604
|
-
${
|
|
17685
|
+
${y} {
|
|
17605
17686
|
background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
|
|
17606
17687
|
color: var(--${e}-hover-text-color, var(--${e}-text-color));
|
|
17607
17688
|
border-color: var(--${e}-hover-border-color, var(--${e}-border-color));
|
|
@@ -17680,7 +17761,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
17680
17761
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
17681
17762
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
17682
17763
|
}
|
|
17683
|
-
`}function ca(e,t,n="",i,o){const s=t();return r.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[r.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:s}),r.jsxs("span",{className:`${e}-content-roll-viewport`,children:[r.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),r.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function bl(e,t,n="fill",i=100,o=0,s){if(!t)return null;const l=r.jsx(rn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return r.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const d=$.scalingValue(o,s);return r.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return r.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function
|
|
17764
|
+
`}function ca(e,t,n="",i,o){const s=t();return r.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[r.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:s}),r.jsxs("span",{className:`${e}-content-roll-viewport`,children:[r.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),r.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function bl(e,t,n="fill",i=100,o=0,s){if(!t)return null;const l=r.jsx(rn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return r.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:l});if(n==="fixed"&&o>0){const d=$.scalingValue(o,s);return r.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return r.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function $v({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:s}=$.useScopedStyles(),l=a.useMemo(()=>Sv(s),[s]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:v,order:y="text-icon",gap:g=0,iconSize:h=0,iconWidthC:m=0,dimensions:b=!1,padding:E={top:0,right:0,bottom:0,left:0},cornerRadius:R=0,boxShadow:L={top:0,left:0,right:0,bottom:0},boxShadowColor:J="rgba(0, 0, 0, 0)",innerBoxShadow:W={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:q="rgba(0, 0, 0, 0)",stroke:A=0,backgroundColor:C="#000000",textColor:O="#ffffff",borderColor:w="#ffffff",iconColor:H="#ffffff",hoverEffect:P="none",fontFamily:X,fontSettings:k,fontSize:Y,lineHeight:U,letterSpacing:V=0,wordSpacing:ie=0,textAppearance:S,stateOverrides:M,minWidth:z=0,minHeight:ae=0,width:re=0,height:I=0}=e,ue=$.buildColorVars(s,{backgroundColor:C,textColor:O,borderColor:w,iconColor:H,boxShadowColor:J,innerBoxShadowColor:q},vv,xv,M),F=i&&i!=="default"?`${s}-state-${i}`:"",oe=t&&!n?`${s}-editing`:"",Q=P!=="none"&&(!t||n||i==="hover")?`${s}-hover-effect-${P}`:"",ye=P==="reveal"||P==="swipe",Pe=P==="content-roll",pe=P==="reveal"&&(!t||n),ce=b===!0,te=d==="a"?v??p:p,Z=d==="c",Fe=d!=="b",$e={fontSettings:{fontFamily:X,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:Y??.01,lineHeight:U,letterSpacing:V,wordSpacing:ie,textAppearance:S,color:O},de={...Fe?on(Ut($e,t)):{},[`--${s}-box-shadow-x`]:$.scalingValue(L.left,t),[`--${s}-box-shadow-y`]:$.scalingValue(L.top,t),[`--${s}-box-shadow-blur`]:$.scalingValue(L.right,t),[`--${s}-box-shadow-spread`]:$.scalingValue(L.bottom,t),[`--${s}-inner-box-shadow-x`]:$.scalingValue(W.left,t),[`--${s}-inner-box-shadow-y`]:$.scalingValue(W.top,t),[`--${s}-inner-box-shadow-blur`]:$.scalingValue(W.right,t),[`--${s}-inner-box-shadow-spread`]:$.scalingValue(W.bottom,t),paddingTop:$.scalingValue(E.top,t),paddingRight:$.scalingValue(E.right,t),paddingBottom:$.scalingValue(E.bottom,t),paddingLeft:$.scalingValue(E.left,t),borderRadius:$.scalingValue(R,t),borderWidth:$.scalingValue(A,t),...Z?{}:{justifyContent:la[te],textAlign:te},...Z&&!Pe?{gap:$.scalingValue(g,t)}:{},...ce?{width:$.scalingValue(re,t),height:$.scalingValue(I,t)}:{minWidth:$.scalingValue(z,t),minHeight:$.scalingValue(ae,t),...Z?{width:"100%"}:{}}};let he;const be={display:"inline-flex",alignItems:"center",justifyContent:Z?la[te]:la[d==="a"?te:"center"],gap:Z?$.scalingValue(g,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:te}:{}};if(d==="b"){const ge=()=>bl(s,u,h>0?"fixed":"fill",100,h,t);he=Pe?ca(s,ge,`${s}-icon-roll`,void 0,be):ge()}else if(d==="c"){const ge=()=>{const xe=r.jsx("span",{className:`${s}-text`,style:{textAlign:te},children:c}),Me=bl(s,u,m>0?"fixed":"fill",100,m,t);return y==="icon-text"?r.jsxs(r.Fragment,{children:[Me,xe]}):r.jsxs(r.Fragment,{children:[xe,Me]})};he=Pe?ca(s,ge,`${s}-icon-text-roll`,void 0,be):ge()}else he=Pe?ca(s,()=>c,`${s}-label-roll`,void 0,be):ye?r.jsx("span",{className:`${s}-button-inner`,children:c}):c;const G=pe?ge=>bv(ge,s):void 0,se=pe?ge=>wv(ge,s):void 0;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsx("div",{className:`${s}-root`,style:ue,children:r.jsx("div",{className:`${s}-wrapper ${F} ${oe}`.trim(),children:r.jsx("div",{className:`${s}-button ${Q}`.trim(),style:de,onMouseEnter:G,onMouseLeave:se,role:"button",tabIndex:o||t&&!n?void 0:0,children:he})})})]})}const Cv=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
17684
17765
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
17685
17766
|
import { CommonComponentProps } from '../props';
|
|
17686
17767
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -18307,7 +18388,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18307
18388
|
</>
|
|
18308
18389
|
);
|
|
18309
18390
|
}
|
|
18310
|
-
`,fv={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},yv=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],vv={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",titleByState:{default:"BG Default",hover:"BG Hover",active:"BG Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...fv.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...yv],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},xv={element:gv,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:vv,sourceCode:hv,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function bv(e){return`
|
|
18391
|
+
`,Tv={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Lv=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],Rv={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"BG Default",titleByState:{default:"BG Default",hover:"BG Hover",active:"BG Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...Tv.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...Lv],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},Iv={element:$v,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:Rv,sourceCode:Cv,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function Ev(e){return`
|
|
18311
18392
|
.${e}-titles-row {
|
|
18312
18393
|
position: relative;
|
|
18313
18394
|
flex: 0 1 auto;
|
|
@@ -18505,7 +18586,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18505
18586
|
pointer-events: auto;
|
|
18506
18587
|
flex-shrink: 0;
|
|
18507
18588
|
}
|
|
18508
|
-
`}const Cn=500,oo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",wv=72,Sv=50,$v=1e4,Cv=650,Tv=500;function Lv(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Bc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=mr(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 Rv(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Bc(i,n):null}function Iv(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 so(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 so(e,i,n)}const Ev=.03;function Vc(e){return e.width*Ev}const da={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Zo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Sl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Mv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ea(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function Pv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ea(e,t.width,t.height)}function kv(e,t){if(Fr(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 Av(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 Fv({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Fr(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Ui(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Vc(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function yr(e,t,n){const i=Ui(e,t,n);return{...i,left:2*i.left-e.left}}function Wv(e,t,n){const{left:i,width:o}=n,s=Vc(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function Gc(e,t,n,i){const o=Ui(e,"left",i),s=Ui(e,"right",i),l=yr(e,"left",i),d=yr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function _v(e,t,n,i){const{start:o,end:s}=Gc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function Nv(e,t,n){const i=Ui(e,t,n),o=yr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Fr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Hv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Jo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Fr(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function Ov({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:w,sourceRect:b,resolveCloseSourceRect:h,onClose:g,onPrev:m,onNext:x}){const M=a.useRef(null),E=a.useRef(null),R=a.useRef(null),Z=a.useRef(new Map),[_,U]=a.useState(0),F=a.useRef(null),C=a.useRef(0),z=a.useRef(0),y=a.useRef("none"),N=a.useRef(!1),I=a.useRef(!1),J=a.useRef(!1),k=a.useRef(null),X=a.useRef(null),G=a.useRef(null),V=a.useRef(()=>{}),oe=a.useRef(null),S=a.useRef(null),P=a.useRef(null),D=a.useRef(!1),[re,ae]=a.useState(null),[T,ue]=a.useState(da),[W,ie]=a.useState(0),[ne,ye]=a.useState("opening"),[Pe,me]=a.useState(0),[le,K]=a.useState(0),[ee,Y]=a.useState(!1),[We,$e]=a.useState(null),[Ae,de]=a.useState(null),[he,be]=a.useState(null),[q,se]=a.useState(!1),[ge,xe]=a.useState(null),[Ee,Ce]=a.useState(!1),H=a.useRef(!1),[pe,O]=a.useState(!1),[L,B]=a.useState(!1),Re=a.useRef(n),Q=a.useRef(void 0),A=t[n],Fe=A?Fr(A):!1,Me=le!==0||ee,Qe=!l&&(!s||!!d),Ke=c&&!l,lt=u.length>1,tt=a.useCallback((v,ve)=>t.length<=1?null:t[(v+ve+t.length)%t.length]??null,[t]),Be=lt?so(u,p,-1):tt(n,-1),fe=lt?so(u,p,1):tt(n,1),Ie=We===-1&&Me?lt&&Ae!==null?so(u,Ae,-1):he!==null?tt(he,-1):null:null,De=We===1&&Me?lt&&Ae!==null?so(u,Ae,1):he!==null?tt(he,1):null:null,qe=Ie&&Ie.url!==(Be==null?void 0:Be.url)?Ie:null,Se=De&&De.url!==(fe==null?void 0:fe.url)?De:null,_e=Be&&Ke?(()=>{const v=lt?wl(u,p,-1):t.length>2?tt((n-1+t.length)%t.length,-1):null;return v&&v.url!==Be.url?v:null})():null,Ve=fe&&Ke?(()=>{const v=lt?wl(u,p,1):t.length>2?tt((n+1)%t.length,1):null;return v&&v.url!==fe.url?v:null})():null,Xe=qe??_e,at=Se??Ve,et=a.useCallback((v,ve,Le)=>{if(!v||!ve||!Le)return;const ke=Z.current,it=ke.get(v);(it==null?void 0:it.width)===ve&&(it==null?void 0:it.height)===Le||(ke.set(v,{width:ve,height:Le}),U(Et=>Et+1))},[]),$t=a.useCallback(v=>{if(!(v!=null&&v.url))return null;const ve=Z.current.get(v.url);return Pv(E.current,ve)},[_,W]),ut=a.useCallback(()=>{if(!A)return;const v=$t(A);if(v){ae(v);return}const ve=E.current;ve&&ae(Sl(ve))},[A,$t]),He=a.useCallback(v=>{if(lt){const ve=u.length;de((p+v+ve)%ve),be(null);return}t.length>1&&(be((n+v+t.length)%t.length),de(null))},[lt,u.length,p,t.length,n]),Ye=a.useCallback(v=>{J.current=v,Y(v)},[]),ze=a.useCallback(()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)},[]),pt=a.useCallback(()=>{ze(),k.current=window.setTimeout(()=>{ze(),Ye(!1)},oo+32)},[ze,Ye]),mt=a.useCallback(()=>{const v=M.current;if(!v){ue({left:0,top:0,width:typeof window<"u"?window.innerWidth:da.width,height:typeof window<"u"?window.innerHeight:da.height});return}const ve=v.getBoundingClientRect();ue({left:ve.left,top:ve.top,width:ve.width,height:ve.height})},[]),gt=a.useCallback((v,ve)=>{if(Me){if(pe&&!ee)return`translate(${le}px, 0px)`;if(ee&&We!==null){const Le=$t(v);if(!Le)return;const{x:ke,y:it}=_v(Le,ve,We,T);return`translate(${ke}px, ${it}px)`}if(ee)return"translate(0px, 0px)"}},[Me,pe,ee,le,We,T,$t]),kt=a.useCallback(()=>{const v=X.current;X.current=null,ze(),Ye(!1),$e(null),de(null),be(null),K(0),O(!1),N.current=!1,z.current=0,y.current="none",v===-1?m():v===1&&x()},[ze,Ye,m,x]),Xt=a.useCallback(()=>{ze(),k.current=window.setTimeout(()=>{X.current!==null&&kt()},oo+32)},[ze,kt]),Yt=a.useCallback(()=>{ze(),X.current=null,Ye(!1),$e(null),de(null),be(null),K(0),O(!1),N.current=!1,z.current=0,y.current="none"},[ze,Ye]),vt=a.useCallback(v=>{if(!(!Ke||!re)){if(J.current){if(X.current===v){G.current=v,kt();return}Yt()}ze(),He(v),X.current=v,$e(v),Ye(!0),Xt()}},[Ke,re,kt,Yt,ze,He,Ye,Xt]);V.current=vt;const bt=a.useCallback(()=>{oe.current=null,D.current=!1,S.current!==null&&(window.clearInterval(S.current),S.current=null),P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),Gt=a.useCallback(v=>{S.current!==null&&window.clearInterval(S.current);const ve=D.current?Tv:Cv;S.current=window.setInterval(()=>{V.current(v)},ve)},[]),Ft=a.useCallback(v=>{oe.current!==v&&(bt(),oe.current=v,D.current=!1,V.current(v),Gt(v),P.current=window.setTimeout(()=>{P.current=null,oe.current===v&&(D.current=!0,Gt(v))},$v))},[bt,Gt]),xt=a.useCallback(()=>{const v=E.current;if(!v)return;const ve=A==null?void 0:A.url,Le=ve?Z.current.get(ve):void 0;if(Le!=null&&Le.width&&(Le!=null&&Le.height)){ae(Ea(v,Le.width,Le.height));return}const ke=R.current;if(ke&&ve&&(ke.src===ve||ke.currentSrc===ve)){const{width:Et,height:Ze}=Mv(ke);if(Et&&Ze){et(ve,Et,Ze),ae(Ea(v,Et,Ze));return}}const it=Sl(v);!it.width||!it.height||ae(it)},[A==null?void 0:A.url,et]),Ht=a.useCallback(v=>{if(R.current=v,!!v){if(v instanceof HTMLVideoElement){v.readyState>=1&&v.videoWidth>0&&xt();return}v.complete&&v.naturalWidth>0&&xt()}},[xt]),qt=a.useCallback(()=>{mt(),xt(),ie(v=>v+1)},[mt,xt]);a.useEffect(()=>{qt();const v=E.current,ve=M.current,Le=new ResizeObserver(()=>qt());return v&&Le.observe(v),ve&&Le.observe(ve),window.addEventListener("resize",qt),()=>{Le.disconnect(),window.removeEventListener("resize",qt)}},[qt,n,w]),a.useLayoutEffect(()=>{if(!A)return;const v=R.current;if(v){if(v instanceof HTMLImageElement&&v.complete&&v.naturalWidth>0){xt();return}v instanceof HTMLVideoElement&&v.readyState>=1&&v.videoWidth>0&&xt()}},[A==null?void 0:A.url,n,xt]),a.useEffect(()=>{ut()},[ut,_]),a.useEffect(()=>{const v=new Set,ve=[],Le=ke=>{!(ke!=null&&ke.url)||v.has(ke.url)||(v.add(ke.url),ve.push(ke))};t.forEach(Le),u.forEach(ke=>ke.items.forEach(Le)),ve.forEach(ke=>{Z.current.has(ke.url)||kv(ke,et)})},[t,u,et]),a.useEffect(()=>{if(ne!=="opening"||!re)return;if(!b){ye("open");return}se(!1);const v=requestAnimationFrame(()=>{requestAnimationFrame(()=>{se(!0),ye("open")})});return()=>cancelAnimationFrame(v)},[ne,re,b]),a.useEffect(()=>{if(ne!=="closing")return;const v=setTimeout(()=>g(),Cn);return()=>clearTimeout(v)},[ne,g]),a.useEffect(()=>()=>{ze()},[ze]),a.useLayoutEffect(()=>{Re.current===n&&Q.current===(A==null?void 0:A.url)||(ze(),X.current=null,$e(null),de(null),be(null),me(0),K(0),Ye(!1),B(!1),O(!1),C.current=0,z.current=0,y.current="none",N.current=!1,F.current=null,I.current=!1,R.current=null,ut(),Re.current=n,Q.current=A==null?void 0:A.url)},[n,A==null?void 0:A.url,Ye,ze,ut]),a.useLayoutEffect(()=>{const v=G.current;v!==null&&(G.current=null,requestAnimationFrame(()=>{V.current(v)}))},[n,p,A==null?void 0:A.url]),a.useLayoutEffect(()=>{if(ne==="opening"){H.current=!1,Ce(!1);return}if(ne!=="open"||H.current)return;if(!Be&&!fe){H.current=!0;return}Ce(!1);const v=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),H.current=!0})});return()=>cancelAnimationFrame(v)},[ne,Be==null?void 0:Be.url,fe==null?void 0:fe.url]),a.useEffect(()=>{if(ne!=="open")return;const v=()=>{const Ze=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Ze,!0)};document.addEventListener("click",Ze,!0)},ve=Ze=>{const ft=Ze<0?1:-1;ze(),He(ft),X.current=ft,$e(ft),Ye(!0),Xt()},Le=Ze=>{if(Math.abs(Ze)>Sv&&Ke){ve(Ze);return}X.current=null,$e(null),de(null),be(null),Ye(!0),K(0),pt()},ke=Ze=>{if(Ze.touches.length!==1||J.current)return;const ft=Ze.touches[0];I.current=!0,F.current={x:ft.clientX,y:ft.clientY},y.current="none",z.current=0,N.current=!1},it=Ze=>{if(!F.current||Ze.touches.length!==1||J.current)return;const ft=Ze.touches[0],Nt=ft.clientX-F.current.x,Tt=ft.clientY-F.current.y;if(y.current==="none"){if(Math.abs(Nt)<10&&Math.abs(Tt)<10)return;if(Math.abs(Nt)>Math.abs(Tt)){if(!Ke)return;y.current="horizontal"}else if(Tt>0){if(!Qe)return;y.current="vertical"}else return}if(y.current==="horizontal"){N.current=!0,O(!0),z.current=Nt,K(Nt),Ze.preventDefault();return}y.current==="vertical"&&(N.current=!0,O(!0),C.current=Tt,me(Tt),Ze.preventDefault())},Et=()=>{if(!F.current)return;const Ze=y.current,ft=N.current;if(ft&&Ze==="horizontal")Le(z.current),v();else if(ft&&Ze==="vertical"){const Nt=C.current;if(Qe&&Nt>wv){const Tt=window.innerHeight;C.current=Tt,B(!0),me(Tt),ye("closing")}else C.current=0,me(0);v()}else Ze==="horizontal"&&Math.abs(z.current)>0&&(Le(z.current),v());F.current=null,y.current="none",z.current=0,N.current=!1,O(!1)};return document.addEventListener("touchstart",ke,{passive:!0}),document.addEventListener("touchmove",it,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",ke),document.removeEventListener("touchmove",it),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[ne,Ke,Ye,pt,ze,Qe,Xt,He]);const Zt=a.useCallback(()=>{const v=(h==null?void 0:h())??b??null;v&&re&&(xe(v),se(!0)),ye("closing")},[h,b,re]);a.useEffect(()=>{const v=ke=>{if(ke.key==="Escape"){if(s&&d||ne==="closing")return;bt(),Zt();return}if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight"||ne!=="open"||!Ke)return;ke.preventDefault();const it=ke.key==="ArrowLeft"?-1:1;ke.repeat&&oe.current===it||Ft(it)},ve=ke=>{if(ke.key!=="ArrowLeft"&&ke.key!=="ArrowRight")return;const it=ke.key==="ArrowLeft"?-1:1;oe.current===it&&bt()},Le=()=>{bt()};return window.addEventListener("keydown",v),window.addEventListener("keyup",ve),window.addEventListener("blur",Le),()=>{window.removeEventListener("keydown",v),window.removeEventListener("keyup",ve),window.removeEventListener("blur",Le),bt()}},[ne,s,d,Zt,Ke,Ft,bt]),a.useEffect(()=>{ne!=="open"&&bt()},[ne,bt]);const tn=()=>{ne==="closing"||l||Zt()},Ct=ne==="open",jt=ne==="closing",cn=Pe>0?Math.max(0,1-Pe/500):1,ct=Pe>0?Math.max(.35,1-Pe/500):1,Te=a.useCallback(v=>{if(!(v.propertyName!=="transform"||!J.current)){if(X.current!==null){kt();return}ze(),Ye(!1)}},[ze,Ye,kt]),Oe=ne==="closing"?ge??b:b,nt=Oe&&re&&(ne==="opening"||jt)?Lv(Oe,re):void 0,dt=Me&&A?gt(A,"center"):Pe>0?`translateY(${Pe}px)`:nt,ht=re?Zo(re,T):null,Rt=!!(Oe&&re),st=Rt&&(ne==="closing"||ne==="open"&&q),Ot={position:"absolute",top:ht==null?void 0:ht.top,left:ht==null?void 0:ht.left,width:ht==null?void 0:ht.width,height:ht==null?void 0:ht.height,objectFit:"contain",transformOrigin:"top left",transform:dt,opacity:Pe>0?ct:Rt?1:ne==="opening"||jt?0:1,transition:pe&&!ee?"none":ee?`transform ${oo}ms ${pn}`:L?`transform ${Cn}ms ${pn}, opacity ${Cn}ms ${pn}`:st?`transform ${Cn}ms ${pn}`:ne==="opening"||jt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:Fe&&Ct&&!Me?"auto":"none",touchAction:Fe&&Ct?"none":void 0,zIndex:1,overflow:Fe?"hidden":void 0},Pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Me?"auto":"none"},Mt=(v,ve,Le="adjacent")=>{const ke=$t(v);if(!ke)return{display:"none"};const it=Le==="far"?ve==="left"?"far-left":"far-right":ve==="left"?"left-adjacent":"right-adjacent",{start:Et}=We!==null?Gc(ke,it,We,T):{start:Le==="far"?yr(ke,ve,T):Ui(ke,ve,T)},Ze=Zo(Et,T),ft=gt(v,it),Nt=!Me&&Le==="adjacent"&&Ct&&!Ee?Nv(ke,ve,T):null,Tt=Le==="far"&&Me&&We===(ve==="left"?-1:1),nn=pe&&!ee?!1:ee,dn=Le==="adjacent"&&Ct&&Ee&&!Me;return{position:"absolute",top:Ze.top,left:Ze.left,width:Ze.width,height:Ze.height,objectFit:"contain",transform:ft??(Nt?`translate(${Nt.x}px, ${Nt.y}px)`:void 0),opacity:Le==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Le==="far"?`transform ${oo}ms ${pn}`:`transform ${oo}ms ${pn}, opacity ${Cn}ms ${pn}`:dn?`transform ${Cn}ms ${pn}`:ne==="opening"||jt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},zt=(v,ve)=>{const Le=$t(v);return Le?Wv(Ui(Le,ve,T),ve,T):null},Bt=v=>ve=>{if(!l){if(I.current){I.current=!1;return}ve.stopPropagation(),vt(v)}},Wt=Be?zt(Be,"left"):null,_t=fe?zt(fe,"right"):null,At=Wt?Zo(Wt,T):null,wt=_t?Zo(_t,T):null;return r.jsxs("div",{ref:M,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ne==="open"?"none":void 0},onClick:tn,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?cn:0,transition:pe?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:E,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:pe?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"},children:r.jsx(Tc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Xe&&r.jsx(Jo,{media:Xe,style:Mt(Xe,"left","far"),onMeasure:et,onTransitionEnd:Te},`far-prev-${Xe.url}`),Ct&&Be&&r.jsxs(r.Fragment,{children:[r.jsx(Jo,{media:Be,style:Mt(Be,"left"),onMeasure:et,onTransitionEnd:Te},`prev-${Be.url}`),At&&r.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Bt(-1)})]}),Ct&&fe&&r.jsxs(r.Fragment,{children:[r.jsx(Jo,{media:fe,style:Mt(fe,"right"),onMeasure:et,onTransitionEnd:Te},`next-${fe.url}`),wt&&r.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||pe?"default":"pointer",pointerEvents:l||pe?"none":"auto",zIndex:3},onClick:Bt(1)})]}),Ct&&at&&r.jsx(Jo,{media:at,style:Mt(at,"right","far"),onMeasure:et,onTransitionEnd:Te},`far-next-${at.url}`),re&&A&&(Fe?r.jsx(Hv,{src:A.url,phase:ne,onMediaElement:Ht,wrapperStyle:Ot,videoStyle:Pt,onLoadedMetadata:xt,onTransitionEnd:Te},`${n}-${A.url}`):r.jsx("img",{ref:Ht,src:A.url,alt:A.name,onLoad:xt,onTransitionEnd:Te,style:Ot},`${n}-${A.url}`))]})}const Dv=20,jv=.18;function zv(e){return`
|
|
18589
|
+
`}const Cn=500,oo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Mv=72,Pv=50,kv=1e4,Av=650,Fv=500;function Wv(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Bc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=mr(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 _v(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Bc(i,n):null}function Hv(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 so(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 so(e,i,n)}const Nv=.03;function Vc(e){return e.width*Nv}const da={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Zo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Sl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Ov(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ea(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function Dv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ea(e,t.width,t.height)}function jv(e,t){if(Fr(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 zv(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 Bv({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Fr(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Ui(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Vc(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function yr(e,t,n){const i=Ui(e,t,n);return{...i,left:2*i.left-e.left}}function Vv(e,t,n){const{left:i,width:o}=n,s=Vc(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function Gc(e,t,n,i){const o=Ui(e,"left",i),s=Ui(e,"right",i),l=yr(e,"left",i),d=yr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Gv(e,t,n,i){const{start:o,end:s}=Gc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function qv(e,t,n){const i=Ui(e,t,n),o=yr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Fr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Uv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Jo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Fr(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function Kv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:y,resolveCloseSourceRect:g,onClose:h,onPrev:m,onNext:b}){const E=a.useRef(null),R=a.useRef(null),L=a.useRef(null),J=a.useRef(new Map),[W,q]=a.useState(0),A=a.useRef(null),C=a.useRef(0),O=a.useRef(0),w=a.useRef("none"),H=a.useRef(!1),P=a.useRef(!1),X=a.useRef(!1),k=a.useRef(null),Y=a.useRef(null),U=a.useRef(null),V=a.useRef(()=>{}),ie=a.useRef(null),S=a.useRef(null),M=a.useRef(null),z=a.useRef(!1),[ae,re]=a.useState(null),[I,ue]=a.useState(da),[F,oe]=a.useState(0),[Q,ye]=a.useState("opening"),[Pe,pe]=a.useState(0),[ce,K]=a.useState(0),[te,Z]=a.useState(!1),[Fe,$e]=a.useState(null),[We,de]=a.useState(null),[he,be]=a.useState(null),[G,se]=a.useState(!1),[ge,xe]=a.useState(null),[Me,Ce]=a.useState(!1),N=a.useRef(!1),[me,D]=a.useState(!1),[T,B]=a.useState(!1),Le=a.useRef(n),ne=a.useRef(void 0),_=t[n],ke=_?Fr(_):!1,Ie=ce!==0||te,Ze=!l&&(!s||!!d),Ke=c&&!l,at=u.length>1,tt=a.useCallback((x,ve)=>t.length<=1?null:t[(x+ve+t.length)%t.length]??null,[t]),Ve=at?so(u,p,-1):tt(n,-1),fe=at?so(u,p,1):tt(n,1),Ee=Fe===-1&&Ie?at&&We!==null?so(u,We,-1):he!==null?tt(he,-1):null:null,De=Fe===1&&Ie?at&&We!==null?so(u,We,1):he!==null?tt(he,1):null:null,qe=Ee&&Ee.url!==(Ve==null?void 0:Ve.url)?Ee:null,we=De&&De.url!==(fe==null?void 0:fe.url)?De:null,Oe=Ve&&Ke?(()=>{const x=at?wl(u,p,-1):t.length>2?tt((n-1+t.length)%t.length,-1):null;return x&&x.url!==Ve.url?x:null})():null,ze=fe&&Ke?(()=>{const x=at?wl(u,p,1):t.length>2?tt((n+1)%t.length,1):null;return x&&x.url!==fe.url?x:null})():null,Ye=qe??Oe,ot=we??ze,Je=a.useCallback((x,ve,Re)=>{if(!x||!ve||!Re)return;const Ae=J.current,it=Ae.get(x);(it==null?void 0:it.width)===ve&&(it==null?void 0:it.height)===Re||(Ae.set(x,{width:ve,height:Re}),q(Et=>Et+1))},[]),bt=a.useCallback(x=>{if(!(x!=null&&x.url))return null;const ve=J.current.get(x.url);return Dv(R.current,ve)},[W,F]),lt=a.useCallback(()=>{if(!_)return;const x=bt(_);if(x){re(x);return}const ve=R.current;ve&&re(Sl(ve))},[_,bt]),_e=a.useCallback(x=>{if(at){const ve=u.length;de((p+x+ve)%ve),be(null);return}t.length>1&&(be((n+x+t.length)%t.length),de(null))},[at,u.length,p,t.length,n]),Xe=a.useCallback(x=>{X.current=x,Z(x)},[]),Be=a.useCallback(()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)},[]),pt=a.useCallback(()=>{Be(),k.current=window.setTimeout(()=>{Be(),Xe(!1)},oo+32)},[Be,Xe]),mt=a.useCallback(()=>{const x=E.current;if(!x){ue({left:0,top:0,width:typeof window<"u"?window.innerWidth:da.width,height:typeof window<"u"?window.innerHeight:da.height});return}const ve=x.getBoundingClientRect();ue({left:ve.left,top:ve.top,width:ve.width,height:ve.height})},[]),gt=a.useCallback((x,ve)=>{if(Ie){if(me&&!te)return`translate(${ce}px, 0px)`;if(te&&Fe!==null){const Re=bt(x);if(!Re)return;const{x:Ae,y:it}=Gv(Re,ve,Fe,I);return`translate(${Ae}px, ${it}px)`}if(te)return"translate(0px, 0px)"}},[Ie,me,te,ce,Fe,I,bt]),kt=a.useCallback(()=>{const x=Y.current;Y.current=null,Be(),Xe(!1),$e(null),de(null),be(null),K(0),D(!1),H.current=!1,O.current=0,w.current="none",x===-1?m():x===1&&b()},[Be,Xe,m,b]),Xt=a.useCallback(()=>{Be(),k.current=window.setTimeout(()=>{Y.current!==null&&kt()},oo+32)},[Be,kt]),Yt=a.useCallback(()=>{Be(),Y.current=null,Xe(!1),$e(null),de(null),be(null),K(0),D(!1),H.current=!1,O.current=0,w.current="none"},[Be,Xe]),vt=a.useCallback(x=>{if(!(!Ke||!ae)){if(X.current){if(Y.current===x){U.current=x,kt();return}Yt()}Be(),_e(x),Y.current=x,$e(x),Xe(!0),Xt()}},[Ke,ae,kt,Yt,Be,_e,Xe,Xt]);V.current=vt;const wt=a.useCallback(()=>{ie.current=null,z.current=!1,S.current!==null&&(window.clearInterval(S.current),S.current=null),M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),Gt=a.useCallback(x=>{S.current!==null&&window.clearInterval(S.current);const ve=z.current?Fv:Av;S.current=window.setInterval(()=>{V.current(x)},ve)},[]),Ft=a.useCallback(x=>{ie.current!==x&&(wt(),ie.current=x,z.current=!1,V.current(x),Gt(x),M.current=window.setTimeout(()=>{M.current=null,ie.current===x&&(z.current=!0,Gt(x))},kv))},[wt,Gt]),xt=a.useCallback(()=>{const x=R.current;if(!x)return;const ve=_==null?void 0:_.url,Re=ve?J.current.get(ve):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){re(Ea(x,Re.width,Re.height));return}const Ae=L.current;if(Ae&&ve&&(Ae.src===ve||Ae.currentSrc===ve)){const{width:Et,height:Qe}=Ov(Ae);if(Et&&Qe){Je(ve,Et,Qe),re(Ea(x,Et,Qe));return}}const it=Sl(x);!it.width||!it.height||re(it)},[_==null?void 0:_.url,Je]),Nt=a.useCallback(x=>{if(L.current=x,!!x){if(x instanceof HTMLVideoElement){x.readyState>=1&&x.videoWidth>0&&xt();return}x.complete&&x.naturalWidth>0&&xt()}},[xt]),qt=a.useCallback(()=>{mt(),xt(),oe(x=>x+1)},[mt,xt]);a.useEffect(()=>{qt();const x=R.current,ve=E.current,Re=new ResizeObserver(()=>qt());return x&&Re.observe(x),ve&&Re.observe(ve),window.addEventListener("resize",qt),()=>{Re.disconnect(),window.removeEventListener("resize",qt)}},[qt,n,v]),a.useLayoutEffect(()=>{if(!_)return;const x=L.current;if(x){if(x instanceof HTMLImageElement&&x.complete&&x.naturalWidth>0){xt();return}x instanceof HTMLVideoElement&&x.readyState>=1&&x.videoWidth>0&&xt()}},[_==null?void 0:_.url,n,xt]),a.useEffect(()=>{lt()},[lt,W]),a.useEffect(()=>{const x=new Set,ve=[],Re=Ae=>{!(Ae!=null&&Ae.url)||x.has(Ae.url)||(x.add(Ae.url),ve.push(Ae))};t.forEach(Re),u.forEach(Ae=>Ae.items.forEach(Re)),ve.forEach(Ae=>{J.current.has(Ae.url)||jv(Ae,Je)})},[t,u,Je]),a.useEffect(()=>{if(Q!=="opening"||!ae)return;if(!y){ye("open");return}se(!1);const x=requestAnimationFrame(()=>{requestAnimationFrame(()=>{se(!0),ye("open")})});return()=>cancelAnimationFrame(x)},[Q,ae,y]),a.useEffect(()=>{if(Q!=="closing")return;const x=setTimeout(()=>h(),Cn);return()=>clearTimeout(x)},[Q,h]),a.useEffect(()=>()=>{Be()},[Be]),a.useLayoutEffect(()=>{Le.current===n&&ne.current===(_==null?void 0:_.url)||(Be(),Y.current=null,$e(null),de(null),be(null),pe(0),K(0),Xe(!1),B(!1),D(!1),C.current=0,O.current=0,w.current="none",H.current=!1,A.current=null,P.current=!1,L.current=null,lt(),Le.current=n,ne.current=_==null?void 0:_.url)},[n,_==null?void 0:_.url,Xe,Be,lt]),a.useLayoutEffect(()=>{const x=U.current;x!==null&&(U.current=null,requestAnimationFrame(()=>{V.current(x)}))},[n,p,_==null?void 0:_.url]),a.useLayoutEffect(()=>{if(Q==="opening"){N.current=!1,Ce(!1);return}if(Q!=="open"||N.current)return;if(!Ve&&!fe){N.current=!0;return}Ce(!1);const x=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),N.current=!0})});return()=>cancelAnimationFrame(x)},[Q,Ve==null?void 0:Ve.url,fe==null?void 0:fe.url]),a.useEffect(()=>{if(Q!=="open")return;const x=()=>{const Qe=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},ve=Qe=>{const ft=Qe<0?1:-1;Be(),_e(ft),Y.current=ft,$e(ft),Xe(!0),Xt()},Re=Qe=>{if(Math.abs(Qe)>Pv&&Ke){ve(Qe);return}Y.current=null,$e(null),de(null),be(null),Xe(!0),K(0),pt()},Ae=Qe=>{if(Qe.touches.length!==1||X.current)return;const ft=Qe.touches[0];P.current=!0,A.current={x:ft.clientX,y:ft.clientY},w.current="none",O.current=0,H.current=!1},it=Qe=>{if(!A.current||Qe.touches.length!==1||X.current)return;const ft=Qe.touches[0],Ht=ft.clientX-A.current.x,Tt=ft.clientY-A.current.y;if(w.current==="none"){if(Math.abs(Ht)<10&&Math.abs(Tt)<10)return;if(Math.abs(Ht)>Math.abs(Tt)){if(!Ke)return;w.current="horizontal"}else if(Tt>0){if(!Ze)return;w.current="vertical"}else return}if(w.current==="horizontal"){H.current=!0,D(!0),O.current=Ht,K(Ht),Qe.preventDefault();return}w.current==="vertical"&&(H.current=!0,D(!0),C.current=Tt,pe(Tt),Qe.preventDefault())},Et=()=>{if(!A.current)return;const Qe=w.current,ft=H.current;if(ft&&Qe==="horizontal")Re(O.current),x();else if(ft&&Qe==="vertical"){const Ht=C.current;if(Ze&&Ht>Mv){const Tt=window.innerHeight;C.current=Tt,B(!0),pe(Tt),ye("closing")}else C.current=0,pe(0);x()}else Qe==="horizontal"&&Math.abs(O.current)>0&&(Re(O.current),x());A.current=null,w.current="none",O.current=0,H.current=!1,D(!1)};return document.addEventListener("touchstart",Ae,{passive:!0}),document.addEventListener("touchmove",it,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ae),document.removeEventListener("touchmove",it),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[Q,Ke,Xe,pt,Be,Ze,Xt,_e]);const Zt=a.useCallback(()=>{const x=(g==null?void 0:g())??y??null;x&&ae&&(xe(x),se(!0)),ye("closing")},[g,y,ae]);a.useEffect(()=>{const x=Ae=>{if(Ae.key==="Escape"){if(s&&d||Q==="closing")return;wt(),Zt();return}if(Ae.key!=="ArrowLeft"&&Ae.key!=="ArrowRight"||Q!=="open"||!Ke)return;Ae.preventDefault();const it=Ae.key==="ArrowLeft"?-1:1;Ae.repeat&&ie.current===it||Ft(it)},ve=Ae=>{if(Ae.key!=="ArrowLeft"&&Ae.key!=="ArrowRight")return;const it=Ae.key==="ArrowLeft"?-1:1;ie.current===it&&wt()},Re=()=>{wt()};return window.addEventListener("keydown",x),window.addEventListener("keyup",ve),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",x),window.removeEventListener("keyup",ve),window.removeEventListener("blur",Re),wt()}},[Q,s,d,Zt,Ke,Ft,wt]),a.useEffect(()=>{Q!=="open"&&wt()},[Q,wt]);const tn=()=>{Q==="closing"||l||Zt()},Ct=Q==="open",jt=Q==="closing",cn=Pe>0?Math.max(0,1-Pe/500):1,dt=Pe>0?Math.max(.35,1-Pe/500):1,Te=a.useCallback(x=>{if(!(x.propertyName!=="transform"||!X.current)){if(Y.current!==null){kt();return}Be(),Xe(!1)}},[Be,Xe,kt]),Ne=Q==="closing"?ge??y:y,nt=Ne&&ae&&(Q==="opening"||jt)?Wv(Ne,ae):void 0,ut=Ie&&_?gt(_,"center"):Pe>0?`translateY(${Pe}px)`:nt,ht=ae?Zo(ae,I):null,Rt=!!(Ne&&ae),ct=Rt&&(Q==="closing"||Q==="open"&&G),Ot={position:"absolute",top:ht==null?void 0:ht.top,left:ht==null?void 0:ht.left,width:ht==null?void 0:ht.width,height:ht==null?void 0:ht.height,objectFit:"contain",transformOrigin:"top left",transform:ut,opacity:Pe>0?dt:Rt?1:Q==="opening"||jt?0:1,transition:me&&!te?"none":te?`transform ${oo}ms ${pn}`:T?`transform ${Cn}ms ${pn}, opacity ${Cn}ms ${pn}`:ct?`transform ${Cn}ms ${pn}`:Q==="opening"||jt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:ke&&Ct&&!Ie?"auto":"none",touchAction:ke&&Ct?"none":void 0,zIndex:1,overflow:ke?"hidden":void 0},Pt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Ie?"auto":"none"},Mt=(x,ve,Re="adjacent")=>{const Ae=bt(x);if(!Ae)return{display:"none"};const it=Re==="far"?ve==="left"?"far-left":"far-right":ve==="left"?"left-adjacent":"right-adjacent",{start:Et}=Fe!==null?Gc(Ae,it,Fe,I):{start:Re==="far"?yr(Ae,ve,I):Ui(Ae,ve,I)},Qe=Zo(Et,I),ft=gt(x,it),Ht=!Ie&&Re==="adjacent"&&Ct&&!Me?qv(Ae,ve,I):null,Tt=Re==="far"&&Ie&&Fe===(ve==="left"?-1:1),nn=me&&!te?!1:te,dn=Re==="adjacent"&&Ct&&Me&&!Ie;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:ft??(Ht?`translate(${Ht.x}px, ${Ht.y}px)`:void 0),opacity:Re==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${oo}ms ${pn}`:`transform ${oo}ms ${pn}, opacity ${Cn}ms ${pn}`:dn?`transform ${Cn}ms ${pn}`:Q==="opening"||jt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},zt=(x,ve)=>{const Re=bt(x);return Re?Vv(Ui(Re,ve,I),ve,I):null},Bt=x=>ve=>{if(!l){if(P.current){P.current=!1;return}ve.stopPropagation(),vt(x)}},Wt=Ve?zt(Ve,"left"):null,_t=fe?zt(fe,"right"):null,At=Wt?Zo(Wt,I):null,St=_t?Zo(_t,I):null;return r.jsxs("div",{ref:E,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:tn,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?cn:0,transition:me?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:R,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:me?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"},children:r.jsx(Tc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Ye&&r.jsx(Jo,{media:Ye,style:Mt(Ye,"left","far"),onMeasure:Je,onTransitionEnd:Te},`far-prev-${Ye.url}`),Ct&&Ve&&r.jsxs(r.Fragment,{children:[r.jsx(Jo,{media:Ve,style:Mt(Ve,"left"),onMeasure:Je,onTransitionEnd:Te},`prev-${Ve.url}`),At&&r.jsx("div",{style:{position:"absolute",top:At.top,left:At.left,width:At.width,height:At.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Bt(-1)})]}),Ct&&fe&&r.jsxs(r.Fragment,{children:[r.jsx(Jo,{media:fe,style:Mt(fe,"right"),onMeasure:Je,onTransitionEnd:Te},`next-${fe.url}`),St&&r.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||me?"default":"pointer",pointerEvents:l||me?"none":"auto",zIndex:3},onClick:Bt(1)})]}),Ct&&ot&&r.jsx(Jo,{media:ot,style:Mt(ot,"right","far"),onMeasure:Je,onTransitionEnd:Te},`far-next-${ot.url}`),ae&&_&&(ke?r.jsx(Uv,{src:_.url,phase:Q,onMediaElement:Nt,wrapperStyle:Ot,videoStyle:Pt,onLoadedMetadata:xt,onTransitionEnd:Te},`${n}-${_.url}`):r.jsx("img",{ref:Nt,src:_.url,alt:_.name,onLoad:xt,onTransitionEnd:Te,style:Ot},`${n}-${_.url}`))]})}const Xv=20,Yv=.18;function Zv(e){return`
|
|
18509
18590
|
.${e}-wrapper {
|
|
18510
18591
|
box-sizing: border-box;
|
|
18511
18592
|
max-width: 100%;
|
|
@@ -18592,8 +18673,8 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18592
18673
|
z-index: 2;
|
|
18593
18674
|
pointer-events: auto;
|
|
18594
18675
|
}
|
|
18595
|
-
${
|
|
18596
|
-
`}function
|
|
18676
|
+
${Ev(e)}
|
|
18677
|
+
`}function Jv(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,s]=n.split(":").map(Number),l=i?s:o,d=i?o:s;return d>0?l/d:1}function Qv(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`]:$.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:$.scalingValue(i*Yv,n??!1),[`--${t}-image-aspect`]:Jv(e)}}function t0(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 n0(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 i0(e,t,n,i,o,s){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);s(n,d?Bc(d,o):void 0)}}function o0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=$.useScopedStyles(),c=a.useMemo(()=>Zv(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",v=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,y=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,g=$.scalingValue(y,n??!1),h=`max(${g}, ${Xv}px)`,{objectFitMode:m,imageStyle:b}=n0(e),E=t0(e,n),R=a.useRef(null),[L,J]=a.useState(!1),[W,q]=a.useState([]),[A,C]=a.useState(0),[O,w]=a.useState(0),[H,P]=a.useState(null),[X,k]=a.useState({title1:"",title2:"",title3:""}),Y=(!n||i)&&!L,U=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},V=U.sizeType??"none",ie=Y&&V!=="none"?`${d}-item-image-hover-${V}`:void 0,S=(U.value??120)/100,M=a.useCallback(ce=>{!ce||V!=="scale"||(ce.style.transformOrigin=Qp(ce))},[V]),z=a.useCallback(ce=>{if(ce){if(m==="contain"){const K=Qv(ce);if(K){const te=ce.closest(`.${d}-item-image`);te instanceof HTMLElement&&te.style.setProperty(`--${d}-item-media-aspect`,String(K))}}M(ce)}},[d,M,m]),ae={width:$.scalingValue(v,n??!1),...E,...e0(e,d,n),[`--${d}-image-hover-scale`]:String(S)},re=(()=>{const ce={},K=R.current?getComputedStyle(R.current).getPropertyValue("--cntrl-article-width").trim():"";return K&&(ce["--cntrl-article-width"]=K),ce})(),I=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),ue=a.useMemo(()=>Hv(u),[u]),F=a.useMemo(()=>zv(u),[u]),oe=(ce,K)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const te=ue.findIndex(Fe=>Fe.gridIndex===ce);if(te<0)return;const Z=ue[te];w(te),q(Z.items),C(0),k(Z.entry),P(K??null),J(!0)},Q=a.useCallback(()=>{J(!1),P(null)},[]),ye=a.useCallback(()=>{const ce=ue[O];return!ce||!R.current?H:_v(R.current,ce.gridIndex,m)??H},[ue,O,H,m]),Pe=a.useCallback(ce=>{if(ue.length>1){const K=ue.length,te=(O+ce+K)%K,Z=ue[te];w(te),q(Z.items),C(0),k(Z.entry);return}C(K=>(K+ce+W.length)%W.length)},[ue,O,W.length]),pe=ue.length>1||W.length>1;return a.useEffect(()=>{if(!L||typeof document>"u")return;const ce=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ce}},[L]),a.useEffect(()=>{!n||o||i||J(!1)},[n,o,i]),a.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&J(!1)},[e==null?void 0:e.lightbox]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),r.jsx(Bv,{mediaList:F}),r.jsx("div",{ref:R,className:`${d}-wrapper ${d}-type-${p}`,style:ae,children:u.map((ce,K)=>{var Fe,$e;const te=!!((Fe=ce.image)!=null&&Fe.url),Z=i0(!!I,te,K,d,m,oe);return r.jsxs("div",{className:`${d}-item`,children:[ce.title?r.jsx("span",{className:`${d}-item-title`,onClick:Z,style:Z?{cursor:"pointer"}:void 0,children:ce.title}):null,($e=ce.image)!=null&&$e.url?r.jsx("span",{className:[`${d}-item-image`,m==="contain"?`${d}-item-image-fit`:void 0,ie].filter(Boolean).join(" "),children:ce.image.type==="video"?r.jsx("video",{ref:z,src:ce.image.url,"data-waterfall-index":K,style:b,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:Z,onLoadedData:We=>z(We.currentTarget)}):r.jsx("img",{ref:z,src:ce.image.url,alt:ce.image.name??"","data-waterfall-index":K,style:b,onClick:Z,onLoad:We=>z(We.currentTarget)})}):null,K<u.length-1&&r.jsx("div",{className:`${d}-item-gap-host`,style:{width:g},children:o&&!L&&r.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${d}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:h,height:"100%"}})})]},K)})}),L&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const ce=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:re,"data-selection":"none",children:r.jsx(Kv,{prefix:d,items:W,index:A,entry:X,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:pe,lightboxEntries:ue,entryIdx:O,layoutId:s,sourceRect:H,resolveCloseSourceRect:ye,onClose:Q,onPrev:()=>Pe(-1),onNext:()=>Pe(1)})}),ce)})()]})}const r0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
18597
18678
|
import type React from 'react';
|
|
18598
18679
|
import { createPortal } from 'react-dom';
|
|
18599
18680
|
import { CommonComponentProps } from '../props';
|
|
@@ -19107,7 +19188,7 @@ export function Waterfall({
|
|
|
19107
19188
|
</>
|
|
19108
19189
|
);
|
|
19109
19190
|
}
|
|
19110
|
-
`,Zv="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>'),jn={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 Jv(e){const t={};return t[Je(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Je(e,"fontSettings")]={...jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Je(e,"fontSize")]={...jn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Je(e,"lineHeight")]={...jn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Je(e,"letterSpacing")]={...jn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Je(e,"wordSpacing")]={...jn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Je(e,"textAlign")]={...jn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Je(e,"textAppearance")]={...jn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ki=Kn.filter(e=>e!=="count"),Qv=Ki.reduce((e,t)=>({...e,...Jv(t)}),{}),e0=Ki.reduce((e,t)=>({...e,[Je(t,"fontFamily")]:"Arial",[Je(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Je(t,"letterSpacing")]:0,[Je(t,"wordSpacing")]:0,[Je(t,"textAlign")]:"left",[Je(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ua(e){return Ki.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Je(n,"fontSize")]=i),o!==void 0&&(t[Je(n,"lineHeight")]=o),t},{})}const t0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ki.map(e=>[ts[e],ns(e)]))},Qo={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},n0=[{title:"Salton Sea from Above",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],i0={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:n0},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:{...jn.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"]}}},...Qv},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:Zv,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...e0},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,...ua({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,...ua({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,...ua({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:[t0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},o0={element:Xv,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"},...Ki.map(e=>({path:`${Je(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...Ki.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Je(t,"fontFamily")}`}),{})},schema:i0,sourceCode:Yv},Wi=500,qc="cubic-bezier(0.25, 1, 0.5, 1)",r0=300,a0=5,s0=.15,l0=.4,c0=100,Ci=100,$l={color:"#000000",hover:"#cccccc"},ro={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},d0={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}},pa={offset:{x:0,y:0},linkColor:"#cccccc"},Cl={sizeType:"drag",value:3},u0="left";function p0(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:u0,color:(e==null?void 0:e.titleColor)??"#000000"};return Ut(n,t)}function Ti(e,t,n){return`${e}: ${$.scalingValue(t/1440,n)};`}function lo(e,t){return t<=0?0:(e%t+t)%t}function m0(e,t,n,i){if(!i)return{position:lo(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 g0(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function h0(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,w)=>{n.style.transform=`translate(${p}px, ${w}px)`;const b=n.getBoundingClientRect();return{x:b.left,y:b.top}},o=i(0,0),s=i(Ci,0),l=i(0,Ci);e.removeChild(n);const d={x:(s.x-o.x)/Ci,y:(s.y-o.y)/Ci},c={x:(l.x-o.x)/Ci,y:(l.y-o.y)/Ci},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function f0(e,t,n){const{ex:i,ey:o,det:s}=e;return{x:(t*o.y-n*o.x)/s,y:(i.x*n-i.y*t)/s}}function y0(e,t){return`
|
|
19191
|
+
`,a0="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>'),jn={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 s0(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...jn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...jn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...jn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...jn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...jn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...jn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ki=Kn.filter(e=>e!=="count"),l0=Ki.reduce((e,t)=>({...e,...s0(t)}),{}),c0=Ki.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Arial",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ua(e){return Ki.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const d0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ki.map(e=>[ts[e],ns(e)]))},Qo={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},u0=[{title:"Salton Sea from Above",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],p0={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:u0},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:{...jn.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"]}}},...l0},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:a0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...c0},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,...ua({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,...ua({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,...ua({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:[d0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},m0={element:o0,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"},...Ki.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...Ki.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})},schema:p0,sourceCode:r0},Wi=500,qc="cubic-bezier(0.25, 1, 0.5, 1)",g0=300,h0=5,f0=.15,y0=.4,v0=100,Ci=100,$l={color:"#000000",hover:"#cccccc"},ro={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},x0={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}},pa={offset:{x:0,y:0},linkColor:"#cccccc"},Cl={sizeType:"drag",value:3},b0="left";function w0(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:b0,color:(e==null?void 0:e.titleColor)??"#000000"};return Ut(n,t)}function Ti(e,t,n){return`${e}: ${$.scalingValue(t/1440,n)};`}function lo(e,t){return t<=0?0:(e%t+t)%t}function S0(e,t,n,i){if(!i)return{position:lo(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 $0(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function C0(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,v)=>{n.style.transform=`translate(${p}px, ${v}px)`;const y=n.getBoundingClientRect();return{x:y.left,y:y.top}},o=i(0,0),s=i(Ci,0),l=i(0,Ci);e.removeChild(n);const d={x:(s.x-o.x)/Ci,y:(s.y-o.y)/Ci},c={x:(l.x-o.x)/Ci,y:(l.y-o.y)/Ci},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function T0(e,t,n){const{ex:i,ey:o,det:s}=e;return{x:(t*o.y-n*o.x)/s,y:(i.x*n-i.y*t)/s}}function L0(e,t){return`
|
|
19111
19192
|
.${e}-wrapper {
|
|
19112
19193
|
position: relative;
|
|
19113
19194
|
width: 100%;
|
|
@@ -19377,7 +19458,7 @@ export function Waterfall({
|
|
|
19377
19458
|
from { clip-path: inset(100% 0 0 0); }
|
|
19378
19459
|
to { clip-path: inset(0 0 0 0); }
|
|
19379
19460
|
}
|
|
19380
|
-
`}function v0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:s}=$.useScopedStyles(),l=p0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??Cl,p=u.sizeType??"drag",w=u.value??Cl.value,b=(e==null?void 0:e.direction)??"horizontal",h=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",m=(e==null?void 0:e.navSize)??"m",x=d0[m],M=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,E=fe=>$.scalingValue(fe*M,n),R=(e==null?void 0:e.show)??"always",Z=(e==null?void 0:e.controls)??null,_=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,U=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,F=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,C=(e==null?void 0:e.controlsColor)??$l.color,z=(e==null?void 0:e.controlsHoverColor)??$l.hover,y=(e==null?void 0:e.navColor)??ro.colors.inactive,N=(e==null?void 0:e.navPaginationColor)??ro.colors.pagination,I=(e==null?void 0:e.navBackgroundColor)??ro.colors.background,J=(e==null?void 0:e.linkColor)??pa.linkColor,k=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,X=b==="horizontal",G=p==="click",V=p==="drag",oe=p==="auto"&&(!n||!!i),S=!n,P=h==="slide",D=g==="classic",re=R!=="never",ae=R==="on hover",T=$.scalingValue(_,n),ue={width:T,height:T,maxWidth:T},W=P&&c>1,[ie,ne]=a.useState(0),[ye,Pe]=a.useState(W?1:0),[me,le]=a.useState(!1),[K,ee]=a.useState(!1),[Y,We]=a.useState(!1),[$e,Ae]=a.useState(0),[de,he]=a.useState(!1),[be,q]=a.useState(!1),se=a.useRef(!1),ge=a.useRef(ye);ge.current=ye;const xe=a.useRef(null),Ee=a.useRef(0),Ce=a.useRef(null),H=a.useRef(null),pe=a.useRef(null),O=a.useRef(null),L=a.useCallback(fe=>{se.current=fe,le(fe)},[]),B=a.useCallback(fe=>{if(c<2||fe===0)return;const Ie=fe>0?1:-1,De=Math.abs(fe);if(he(!0),L(!0),!P){ne(at=>lo(at+fe,c));return}let qe=ge.current;const Se=W&&(qe===0||qe===c+1),_e=Se?ie+1:null;Se&&(qe=ie+1);let Ve=De;for(;Ve>0;){const at=m0(qe,Ie,c,W);if(qe=at.position,Ve-=1,at.hitBoundary){Ee.current=Ve*Ie;break}}const Xe=De-Ve;if(Xe>0&&ne(at=>lo(at+Xe*Ie,c)),ge.current=qe,_e!==null){if(ge.current=_e,qe===_e){ee(!0),Pe(qe);return}xe.current=qe,ee(!0),Pe(_e);return}ee(!1),Pe(qe)},[ie,c,W,P,L]),Re=a.useCallback(fe=>{B(fe)},[B]),Q=a.useCallback(fe=>{if(c<2)return;const Ie=lo(fe,c);if(!(Ie===ie&&!se.current)&&(he(!0),L(!0),ne(Ie),P)){const De=Ie+(W?1:0);xe.current=null,Ee.current=0,ge.current=De,ee(!1),Pe(De)}},[ie,c,W,P,L]);a.useEffect(()=>{if(!me)return;const fe=window.setTimeout(()=>{if(W&&(ye===0||ye===c+1)){xe.current=null,ee(!0),Pe(ie+1);return}L(!1)},Wi);return()=>window.clearTimeout(fe)},[ie,c,W,me,L,ye]),a.useEffect(()=>{if(!K)return;let fe=0;const Ie=requestAnimationFrame(()=>{fe=requestAnimationFrame(()=>{const De=xe.current;xe.current=null;const qe=Ee.current;if(Ee.current=0,ee(!1),De!==null){ge.current=De,Pe(De);return}if(qe!==0){B(qe);return}L(!1)})});return()=>{cancelAnimationFrame(Ie),cancelAnimationFrame(fe)}},[B,L,K]);const A=`${W}:${c}`,Fe=a.useRef(A);a.useEffect(()=>{if(Fe.current===A)return;Fe.current=A;const fe=c>0?Math.min(ie,c-1):0;pe.current=null,O.current=null,We(!1),Ae(0),ne(fe),ee(!0),Pe(fe+(W?1:0))},[ie,c,W,A]),a.useEffect(()=>{if(!de)return;const fe=window.setTimeout(()=>he(!1),r0);return()=>window.clearTimeout(fe)},[de,ie]),a.useEffect(()=>{if(!oe||c<2)return;const fe=Math.max(w,.1)*1e3,Ie=window.setInterval(()=>{S&&be||Re(1)},fe);return()=>window.clearInterval(Ie)},[w,c,Re,oe,be,S]);const Me=a.useCallback(fe=>{const Ie=pe.current;if(!Ie||Ie.pointerId!==fe.pointerId)return;pe.current=null,O.current=null;const De=Ce.current;if(De!=null&&De.hasPointerCapture(fe.pointerId)&&De.releasePointerCapture(fe.pointerId),!Ie.isActive){P&&Ae(0);return}const Se=!(fe.timeStamp-Ie.lastTime>c0)&&Math.abs(Ie.velocity)>l0,_e=Ie.size>0&&Math.abs(Ie.offset-Ie.baseOffset)>Ie.size*s0;if(We(!1),!Se&&!_e){Ae(0);return}const Ve=_e?Ie.offset-Ie.baseOffset:Ie.velocity;let Xe=1;_e&&Ie.size>0&&(Xe=Math.max(1,Math.round(Math.abs(Ve)/Ie.size))),Ae(0),B(Ve<0?Xe:-Xe)},[B,P]);a.useEffect(()=>{const fe=Ie=>{O.current===null||Ie.pointerId!==O.current||Me(Ie)};return window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe),()=>{window.removeEventListener("pointerup",fe),window.removeEventListener("pointercancel",fe)}},[Me]);const Qe=fe=>{const Ie=Ce.current;if(!V||c<2||!Ie||fe.pointerType==="mouse"&&fe.button!==0)return;xe.current=null,Ee.current=0,se.current&&L(!1);let De=0;const qe=H.current;if(P&&qe){const Se=X?qe.offsetWidth:qe.offsetHeight;if(Se>0){const _e=g0(qe,X);let Ve=ge.current;W&&(Ve===0||Ve===c+1)?(Ve=ie+1,ge.current=Ve,ee(!0),Pe(Ve),De=0):De=_e+Ve*Se,Ae(De)}}Ie.setPointerCapture(fe.pointerId),O.current=fe.pointerId,pe.current={pointerId:fe.pointerId,startClientX:fe.clientX,startClientY:fe.clientY,axes:h0(Ie,`${s}-axis-probe`),size:X?Ie.offsetWidth:Ie.offsetHeight,isActive:!1,baseOffset:De,offset:De,lastTime:fe.timeStamp,velocity:0}},Ke=fe=>{const Ie=pe.current;if(!Ie||Ie.pointerId!==fe.pointerId)return;if(fe.pointerType==="mouse"&&fe.buttons===0){Me(fe);return}const De=fe.clientX-Ie.startClientX,qe=fe.clientY-Ie.startClientY,Se=Ie.axes?f0(Ie.axes,De,qe):{x:De,y:qe},_e=X?Se.x:Se.y,Ve=X?Se.y:Se.x,Xe=Ie.baseOffset+_e;if(!Ie.isActive){if(Math.max(Math.abs(_e),Math.abs(Ve))<a0)return;if(Math.abs(Ve)>Math.abs(_e)){const et=Ce.current;et!=null&&et.hasPointerCapture(Ie.pointerId)&&et.releasePointerCapture(Ie.pointerId),pe.current=null,O.current=null,P&&Ae(0);return}Ie.isActive=!0,We(!0)}const at=fe.timeStamp-Ie.lastTime;at>0&&(Ie.velocity=(Xe-Ie.offset)/at,Ie.lastTime=fe.timeStamp),Ie.offset=Xe,P&&Ae(Xe)},lt=fe=>{Me(fe)},tt=X?`translate3d(calc(${-ye*100}% + ${$e}px), 0, 0)`:`translate3d(0, calc(${-ye*100}% + ${$e}px), 0)`,Be=W?[d[c-1],...d,d[0]]:d;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:y0(s,n)}}),r.jsxs("div",{className:rt(`${s}-wrapper`,{[`${s}-transition-reveal`]:h==="reveal",[`${s}-transition-reveal-vertical`]:h==="reveal"&&!X}),onMouseEnter:()=>q(!0),onMouseLeave:()=>q(!1),children:[r.jsxs("div",{className:`${s}-slider-inner`,style:{backgroundColor:"transparent"},children:[r.jsx("div",{ref:Ce,className:rt(`${s}-track`,{[`${s}-track-draggable`]:V,[`${s}-track-draggable-vertical`]:V&&!X}),onPointerDown:Qe,onPointerMove:Ke,onPointerUp:lt,onPointerCancel:lt,onLostPointerCapture:fe=>{O.current===fe.pointerId&&Me(fe)},children:r.jsx("div",{ref:H,className:rt(`${s}-list`,{[`${s}-list-slide`]:P,[`${s}-list-slide-vertical`]:P&&!X,[`${s}-list-fade`]:!P}),style:P?{transform:tt,transition:Y||K?"none":`transform ${Wi}ms ${qc}`}:void 0,children:Be.map((fe,Ie)=>{const De=W?lo(Ie-1,c):Ie,Se=W&&(Ie===0||Ie===c+1)?`clone-${Ie===0?"start":"end"}`:`slide-${De}`;return r.jsx("div",{className:rt(`${s}-slide`,{[`${s}-is-active`]:!P&&De===ie}),children:r.jsx("div",{className:`${s}-slider-item`,children:r.jsx("div",{className:`${s}-img-wrapper`,children:r.jsx("img",{className:rt(`${s}-slider-image`,{[`${s}-contain`]:fe.image.objectFit==="contain",[`${s}-cover`]:fe.image.objectFit==="cover"}),src:fe.image.url,alt:fe.image.name??"",draggable:!1})})})},Se)})})}),re&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:rt(`${s}-arrow`,{[`${s}-arrow-prev`]:X,[`${s}-arrow-prev-vertical`]:!X,[`${s}-hover-arrow`]:ae}),style:{color:C,"--arrow-hover-color":z,...ue},children:r.jsxs("button",{onClick:fe=>{fe.stopPropagation(),Re(-1)},className:`${s}-arrow-inner`,style:{transform:`translate(${$.scalingValue(U,n)}, ${$.scalingValue(F*(X?1:-1),n)}) rotate(${X?"0deg":"90deg"})`},children:[Z&&r.jsx(rn,{url:Z,fill:C,hoverFill:z,className:rt(`${s}-arrow-img`,`${s}-mirror`),style:ue}),!Z&&r.jsx(Tl,{color:C,className:rt(`${s}-arrow-icon`,`${s}-arrow-img`,`${s}-mirror`)})]})}),r.jsx("div",{className:rt(`${s}-arrow`,{[`${s}-arrow-next`]:X,[`${s}-arrow-next-vertical`]:!X,[`${s}-hover-arrow`]:ae}),style:{color:C,"--arrow-hover-color":z,...ue},children:r.jsxs("button",{className:`${s}-arrow-inner`,onClick:fe=>{fe.stopPropagation(),Re(1)},style:{transform:`translate(${$.scalingValue(U*(X?-1:1),n)}, ${$.scalingValue(F,n)}) rotate(${X?"0deg":"90deg"})`},children:[Z&&r.jsx(rn,{url:Z,fill:C,hoverFill:z,className:`${s}-arrow-img`,style:ue}),!Z&&r.jsx(Tl,{color:C,className:rt(`${s}-arrow-icon`,`${s}-arrow-img`)})]})})]}),G&&r.jsx("div",{className:`${s}-click-overlay`,onClick:()=>Re(1)}),D&&r.jsx("div",{className:rt(`${s}-pagination`,{[`${s}-pagination-inside-bottom`]:X,[`${s}-pagination-inside-left`]:!X}),style:X?{bottom:E(x.inset)}:{left:E(x.inset)},children:r.jsx("div",{className:rt(`${s}-pagination-inner`,{[`${s}-pagination-vertical`]:!X,[`${s}-animate-dots`]:de}),style:{backgroundColor:I,gap:E(x.gapInactive-x.activeDot+x.dot),...X?{height:E(x.activeDot+x.paddingY*2),paddingTop:E(x.paddingY),paddingBottom:E(x.paddingY),paddingLeft:E(x.paddingActive),paddingRight:E(x.paddingActive)}:{width:E(x.activeDot+x.paddingY*2),paddingLeft:E(x.paddingY),paddingRight:E(x.paddingY),paddingTop:E(x.paddingActive),paddingBottom:E(x.paddingActive)},borderRadius:E(x.borderRadius),transform:`translate(${$.scalingValue(ro.offset.x,n)}, ${$.scalingValue(ro.offset.y,n)})`},children:d.map((fe,Ie)=>{const De=Ie===ie,qe=De?x.activeDot:x.dot;return r.jsx("button",{onClick:()=>Q(Ie),className:`${s}-pagination-item`,style:{width:E(x.activeDot)},children:r.jsx("div",{className:`${s}-dot`,style:{backgroundColor:De?N:y,width:E(qe)}})},Ie)})},`${m}-${b}`)})]}),r.jsxs("div",{className:`${s}-caption-block`,children:[r.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:$.scalingValue(k,n)}}),r.jsx("div",{className:`${s}-caption-text-wrapper`,children:d.map((fe,Ie)=>r.jsx("div",{className:rt(`${s}-caption-text`,{[`${s}-with-pointer-events`]:Ie===ie&&n,[`${s}-active`]:Ie===ie}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Wi/2)}ms`},children:r.jsx("div",{className:`${s}-caption-text-inner`,style:{"--link-color":J,"--link-hover-color":J,position:"relative",top:$.scalingValue(pa.offset.y,n),left:$.scalingValue(pa.offset.x,n)},children:r.jsx(yi,{content:fe.imageCaption})})},Ie))})]})]})]})}function Tl({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const x0=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19461
|
+
`}function R0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:s}=$.useScopedStyles(),l=w0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??Cl,p=u.sizeType??"drag",v=u.value??Cl.value,y=(e==null?void 0:e.direction)??"horizontal",g=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",m=(e==null?void 0:e.navSize)??"m",b=x0[m],E=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,R=fe=>$.scalingValue(fe*E,n),L=(e==null?void 0:e.show)??"always",J=(e==null?void 0:e.controls)??null,W=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,q=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,A=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,C=(e==null?void 0:e.controlsColor)??$l.color,O=(e==null?void 0:e.controlsHoverColor)??$l.hover,w=(e==null?void 0:e.navColor)??ro.colors.inactive,H=(e==null?void 0:e.navPaginationColor)??ro.colors.pagination,P=(e==null?void 0:e.navBackgroundColor)??ro.colors.background,X=(e==null?void 0:e.linkColor)??pa.linkColor,k=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,Y=y==="horizontal",U=p==="click",V=p==="drag",ie=p==="auto"&&(!n||!!i),S=!n,M=g==="slide",z=h==="classic",ae=L!=="never",re=L==="on hover",I=$.scalingValue(W,n),ue={width:I,height:I,maxWidth:I},F=M&&c>1,[oe,Q]=a.useState(0),[ye,Pe]=a.useState(F?1:0),[pe,ce]=a.useState(!1),[K,te]=a.useState(!1),[Z,Fe]=a.useState(!1),[$e,We]=a.useState(0),[de,he]=a.useState(!1),[be,G]=a.useState(!1),se=a.useRef(!1),ge=a.useRef(ye);ge.current=ye;const xe=a.useRef(null),Me=a.useRef(0),Ce=a.useRef(null),N=a.useRef(null),me=a.useRef(null),D=a.useRef(null),T=a.useCallback(fe=>{se.current=fe,ce(fe)},[]),B=a.useCallback(fe=>{if(c<2||fe===0)return;const Ee=fe>0?1:-1,De=Math.abs(fe);if(he(!0),T(!0),!M){Q(ot=>lo(ot+fe,c));return}let qe=ge.current;const we=F&&(qe===0||qe===c+1),Oe=we?oe+1:null;we&&(qe=oe+1);let ze=De;for(;ze>0;){const ot=S0(qe,Ee,c,F);if(qe=ot.position,ze-=1,ot.hitBoundary){Me.current=ze*Ee;break}}const Ye=De-ze;if(Ye>0&&Q(ot=>lo(ot+Ye*Ee,c)),ge.current=qe,Oe!==null){if(ge.current=Oe,qe===Oe){te(!0),Pe(qe);return}xe.current=qe,te(!0),Pe(Oe);return}te(!1),Pe(qe)},[oe,c,F,M,T]),Le=a.useCallback(fe=>{B(fe)},[B]),ne=a.useCallback(fe=>{if(c<2)return;const Ee=lo(fe,c);if(!(Ee===oe&&!se.current)&&(he(!0),T(!0),Q(Ee),M)){const De=Ee+(F?1:0);xe.current=null,Me.current=0,ge.current=De,te(!1),Pe(De)}},[oe,c,F,M,T]);a.useEffect(()=>{if(!pe)return;const fe=window.setTimeout(()=>{if(F&&(ye===0||ye===c+1)){xe.current=null,te(!0),Pe(oe+1);return}T(!1)},Wi);return()=>window.clearTimeout(fe)},[oe,c,F,pe,T,ye]),a.useEffect(()=>{if(!K)return;let fe=0;const Ee=requestAnimationFrame(()=>{fe=requestAnimationFrame(()=>{const De=xe.current;xe.current=null;const qe=Me.current;if(Me.current=0,te(!1),De!==null){ge.current=De,Pe(De);return}if(qe!==0){B(qe);return}T(!1)})});return()=>{cancelAnimationFrame(Ee),cancelAnimationFrame(fe)}},[B,T,K]);const _=`${F}:${c}`,ke=a.useRef(_);a.useEffect(()=>{if(ke.current===_)return;ke.current=_;const fe=c>0?Math.min(oe,c-1):0;me.current=null,D.current=null,Fe(!1),We(0),Q(fe),te(!0),Pe(fe+(F?1:0))},[oe,c,F,_]),a.useEffect(()=>{if(!de)return;const fe=window.setTimeout(()=>he(!1),g0);return()=>window.clearTimeout(fe)},[de,oe]),a.useEffect(()=>{if(!ie||c<2)return;const fe=Math.max(v,.1)*1e3,Ee=window.setInterval(()=>{S&&be||Le(1)},fe);return()=>window.clearInterval(Ee)},[v,c,Le,ie,be,S]);const Ie=a.useCallback(fe=>{const Ee=me.current;if(!Ee||Ee.pointerId!==fe.pointerId)return;me.current=null,D.current=null;const De=Ce.current;if(De!=null&&De.hasPointerCapture(fe.pointerId)&&De.releasePointerCapture(fe.pointerId),!Ee.isActive){M&&We(0);return}const we=!(fe.timeStamp-Ee.lastTime>v0)&&Math.abs(Ee.velocity)>y0,Oe=Ee.size>0&&Math.abs(Ee.offset-Ee.baseOffset)>Ee.size*f0;if(Fe(!1),!we&&!Oe){We(0);return}const ze=Oe?Ee.offset-Ee.baseOffset:Ee.velocity;let Ye=1;Oe&&Ee.size>0&&(Ye=Math.max(1,Math.round(Math.abs(ze)/Ee.size))),We(0),B(ze<0?Ye:-Ye)},[B,M]);a.useEffect(()=>{const fe=Ee=>{D.current===null||Ee.pointerId!==D.current||Ie(Ee)};return window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe),()=>{window.removeEventListener("pointerup",fe),window.removeEventListener("pointercancel",fe)}},[Ie]);const Ze=fe=>{const Ee=Ce.current;if(!V||c<2||!Ee||fe.pointerType==="mouse"&&fe.button!==0)return;xe.current=null,Me.current=0,se.current&&T(!1);let De=0;const qe=N.current;if(M&&qe){const we=Y?qe.offsetWidth:qe.offsetHeight;if(we>0){const Oe=$0(qe,Y);let ze=ge.current;F&&(ze===0||ze===c+1)?(ze=oe+1,ge.current=ze,te(!0),Pe(ze),De=0):De=Oe+ze*we,We(De)}}Ee.setPointerCapture(fe.pointerId),D.current=fe.pointerId,me.current={pointerId:fe.pointerId,startClientX:fe.clientX,startClientY:fe.clientY,axes:C0(Ee,`${s}-axis-probe`),size:Y?Ee.offsetWidth:Ee.offsetHeight,isActive:!1,baseOffset:De,offset:De,lastTime:fe.timeStamp,velocity:0}},Ke=fe=>{const Ee=me.current;if(!Ee||Ee.pointerId!==fe.pointerId)return;if(fe.pointerType==="mouse"&&fe.buttons===0){Ie(fe);return}const De=fe.clientX-Ee.startClientX,qe=fe.clientY-Ee.startClientY,we=Ee.axes?T0(Ee.axes,De,qe):{x:De,y:qe},Oe=Y?we.x:we.y,ze=Y?we.y:we.x,Ye=Ee.baseOffset+Oe;if(!Ee.isActive){if(Math.max(Math.abs(Oe),Math.abs(ze))<h0)return;if(Math.abs(ze)>Math.abs(Oe)){const Je=Ce.current;Je!=null&&Je.hasPointerCapture(Ee.pointerId)&&Je.releasePointerCapture(Ee.pointerId),me.current=null,D.current=null,M&&We(0);return}Ee.isActive=!0,Fe(!0)}const ot=fe.timeStamp-Ee.lastTime;ot>0&&(Ee.velocity=(Ye-Ee.offset)/ot,Ee.lastTime=fe.timeStamp),Ee.offset=Ye,M&&We(Ye)},at=fe=>{Ie(fe)},tt=Y?`translate3d(calc(${-ye*100}% + ${$e}px), 0, 0)`:`translate3d(0, calc(${-ye*100}% + ${$e}px), 0)`,Ve=F?[d[c-1],...d,d[0]]:d;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:L0(s,n)}}),r.jsxs("div",{className:st(`${s}-wrapper`,{[`${s}-transition-reveal`]:g==="reveal",[`${s}-transition-reveal-vertical`]:g==="reveal"&&!Y}),onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1),children:[r.jsxs("div",{className:`${s}-slider-inner`,style:{backgroundColor:"transparent"},children:[r.jsx("div",{ref:Ce,className:st(`${s}-track`,{[`${s}-track-draggable`]:V,[`${s}-track-draggable-vertical`]:V&&!Y}),onPointerDown:Ze,onPointerMove:Ke,onPointerUp:at,onPointerCancel:at,onLostPointerCapture:fe=>{D.current===fe.pointerId&&Ie(fe)},children:r.jsx("div",{ref:N,className:st(`${s}-list`,{[`${s}-list-slide`]:M,[`${s}-list-slide-vertical`]:M&&!Y,[`${s}-list-fade`]:!M}),style:M?{transform:tt,transition:Z||K?"none":`transform ${Wi}ms ${qc}`}:void 0,children:Ve.map((fe,Ee)=>{const De=F?lo(Ee-1,c):Ee,we=F&&(Ee===0||Ee===c+1)?`clone-${Ee===0?"start":"end"}`:`slide-${De}`;return r.jsx("div",{className:st(`${s}-slide`,{[`${s}-is-active`]:!M&&De===oe}),children:r.jsx("div",{className:`${s}-slider-item`,children:r.jsx("div",{className:`${s}-img-wrapper`,children:r.jsx("img",{className:st(`${s}-slider-image`,{[`${s}-contain`]:fe.image.objectFit==="contain",[`${s}-cover`]:fe.image.objectFit==="cover"}),src:fe.image.url,alt:fe.image.name??"",draggable:!1})})})},we)})})}),ae&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:st(`${s}-arrow`,{[`${s}-arrow-prev`]:Y,[`${s}-arrow-prev-vertical`]:!Y,[`${s}-hover-arrow`]:re}),style:{color:C,"--arrow-hover-color":O,...ue},children:r.jsxs("button",{onClick:fe=>{fe.stopPropagation(),Le(-1)},className:`${s}-arrow-inner`,style:{transform:`translate(${$.scalingValue(q,n)}, ${$.scalingValue(A*(Y?1:-1),n)}) rotate(${Y?"0deg":"90deg"})`},children:[J&&r.jsx(rn,{url:J,fill:C,hoverFill:O,className:st(`${s}-arrow-img`,`${s}-mirror`),style:ue}),!J&&r.jsx(Tl,{color:C,className:st(`${s}-arrow-icon`,`${s}-arrow-img`,`${s}-mirror`)})]})}),r.jsx("div",{className:st(`${s}-arrow`,{[`${s}-arrow-next`]:Y,[`${s}-arrow-next-vertical`]:!Y,[`${s}-hover-arrow`]:re}),style:{color:C,"--arrow-hover-color":O,...ue},children:r.jsxs("button",{className:`${s}-arrow-inner`,onClick:fe=>{fe.stopPropagation(),Le(1)},style:{transform:`translate(${$.scalingValue(q*(Y?-1:1),n)}, ${$.scalingValue(A,n)}) rotate(${Y?"0deg":"90deg"})`},children:[J&&r.jsx(rn,{url:J,fill:C,hoverFill:O,className:`${s}-arrow-img`,style:ue}),!J&&r.jsx(Tl,{color:C,className:st(`${s}-arrow-icon`,`${s}-arrow-img`)})]})})]}),U&&r.jsx("div",{className:`${s}-click-overlay`,onClick:()=>Le(1)}),z&&r.jsx("div",{className:st(`${s}-pagination`,{[`${s}-pagination-inside-bottom`]:Y,[`${s}-pagination-inside-left`]:!Y}),style:Y?{bottom:R(b.inset)}:{left:R(b.inset)},children:r.jsx("div",{className:st(`${s}-pagination-inner`,{[`${s}-pagination-vertical`]:!Y,[`${s}-animate-dots`]:de}),style:{backgroundColor:P,gap:R(b.gapInactive-b.activeDot+b.dot),...Y?{height:R(b.activeDot+b.paddingY*2),paddingTop:R(b.paddingY),paddingBottom:R(b.paddingY),paddingLeft:R(b.paddingActive),paddingRight:R(b.paddingActive)}:{width:R(b.activeDot+b.paddingY*2),paddingLeft:R(b.paddingY),paddingRight:R(b.paddingY),paddingTop:R(b.paddingActive),paddingBottom:R(b.paddingActive)},borderRadius:R(b.borderRadius),transform:`translate(${$.scalingValue(ro.offset.x,n)}, ${$.scalingValue(ro.offset.y,n)})`},children:d.map((fe,Ee)=>{const De=Ee===oe,qe=De?b.activeDot:b.dot;return r.jsx("button",{onClick:()=>ne(Ee),className:`${s}-pagination-item`,style:{width:R(b.activeDot)},children:r.jsx("div",{className:`${s}-dot`,style:{backgroundColor:De?H:w,width:R(qe)}})},Ee)})},`${m}-${y}`)})]}),r.jsxs("div",{className:`${s}-caption-block`,children:[r.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:$.scalingValue(k,n)}}),r.jsx("div",{className:`${s}-caption-text-wrapper`,children:d.map((fe,Ee)=>r.jsx("div",{className:st(`${s}-caption-text`,{[`${s}-with-pointer-events`]:Ee===oe&&n,[`${s}-active`]:Ee===oe}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Wi/2)}ms`},children:r.jsx("div",{className:`${s}-caption-text-inner`,style:{"--link-color":X,"--link-hover-color":X,position:"relative",top:$.scalingValue(pa.offset.y,n),left:$.scalingValue(pa.offset.x,n)},children:r.jsx(yi,{content:fe.imageCaption})})},Ee))})]})]})]})}function Tl({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const I0=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19381
19462
|
import cn from 'classnames';
|
|
19382
19463
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
19383
19464
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -20558,14 +20639,14 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20558
20639
|
</svg>
|
|
20559
20640
|
);
|
|
20560
20641
|
}
|
|
20561
|
-
`,
|
|
20642
|
+
`,E0={type:"object",version:1,settings:{sizing:"manual",properties:{trigger:{type:"object",scope:"common",title:"Trigger",display:{type:"toggle-cycle-numeric-input",enum:["click","drag","auto"],inputs:{click:"none",drag:"none",auto:"single"},defaultValue:3,showDash:!1},min:1,max:5,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical"]}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["slide","fade in","reveal"]}},nav:{type:"string",scope:"common",title:"Nav",display:{type:"toggle-cycle",enum:["classic","no"]}},navSize:{type:"string",scope:"layout",title:"Nav Size",display:{type:"toggle-cycle",enum:["s","m","l"]}},navUnit:{type:"number",scope:"layout",title:"",display:{type:"numeric-input",visible:!1},min:0,max:1},controls:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},controlsMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},show:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","on hover","never"]}},paddingX:{type:"number",scope:"layout",title:"Padding X",display:{type:"numeric-input"},min:-9999,max:9999},paddingY:{type:"number",scope:"layout",title:"Padding Y",display:{type:"numeric-input"},min:-9999,max:9999},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"palette-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"palette-color-picker"}},navColor:{type:"string",scope:"common",title:"Dot Nav",display:{type:"palette-color-picker"}},navPaginationColor:{type:"string",scope:"common",title:"Active Nav",display:{type:"palette-color-picker"}},navBackgroundColor:{type:"string",scope:"common",title:"BG Nav",display:{type:"palette-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"palette-color-picker"}},titleColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{type:"object",scope:"common",title:"",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},defaults:{trigger:{sizeType:"drag",value:3,min:1,max:5},direction:"horizontal",transition:"slide",nav:"classic",controls:null,show:"always",controlsColor:"#000000",controlsHoverColor:"#3F3F3F",navColor:"#A4A4A4",navPaginationColor:"#FFFFFF",navBackgroundColor:"#000000",linkColor:"#2E12F0",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{controlsMaxWidth:30/1440,paddingX:0,paddingY:0,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,titleFontSize:16/375,titleLineHeight:16/375,navSize:"m",navUnit:1/375}},displayRules:[{if:{name:"show",value:"never"},then:{name:"properties.controlsColor.display.visible",value:!1}},{if:{name:"show",value:"never"},then:{name:"properties.controlsHoverColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navPaginationColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navBackgroundColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navSize.display.visible",value:!1}}],layout:["__componentName__","trigger","direction","transition","nav","navSize","controls","controlsMaxWidth","show","paddingX","paddingY","captionMarginTop","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["trigger","direction"]},{type:"row",title:"",items:["transition","nav"]},{type:"row",title:"",items:["navSize"]},{type:"group",title:"Controls",items:[{type:"row",title:"",items:["controls","controlsMaxWidth"]},{type:"row",title:"",items:["paddingX","paddingY"]},{type:"row",title:"",items:["show"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]}]}],paletteBookmark:{items:["controlsColor","controlsHoverColor","navPaginationColor","navColor","navBackgroundColor","titleColor","linkColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Earth-orbital mission"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Salton Sea from Above"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module Pilot"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module 3 porch"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Command Module"}]}]}]}},M0={element:R0,id:"slider-2-0",name:"Slider 2.0",category:"galleries",version:1,defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},schema:E0,sourceCode:I0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},Mi=300/1440,P0=8/1440,di=.004;function k0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ll(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Rl(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:$.scalingValue((o-t)/2,i)}}function A0(e){return`
|
|
20562
20643
|
.${e}-wrapper {
|
|
20563
20644
|
box-sizing: border-box;
|
|
20564
20645
|
display: flex;
|
|
20565
20646
|
flex-direction: column;
|
|
20566
20647
|
position: relative;
|
|
20567
20648
|
width: 100%;
|
|
20568
|
-
min-height: ${
|
|
20649
|
+
min-height: ${k0(48)};
|
|
20569
20650
|
}
|
|
20570
20651
|
.${e}-single-title-layer {
|
|
20571
20652
|
position: absolute;
|
|
@@ -20775,7 +20856,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20775
20856
|
width: var(--cntrl-article-width, 100vw) !important;
|
|
20776
20857
|
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
20777
20858
|
}
|
|
20778
|
-
`}const T0="rgba(28,31,34,0.9)",In=500,ci="cubic-bezier(0.22, 1, 0.36, 1)",L0=72,R0=50,I0={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},E0=[];function M0(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 P0(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function k0(e){const[t]=e.media;return t!=null&&t.url?t:null}function A0(e){if(!Array.isArray(e)||e.length===0)return[];if(M0(e)){const t=[];for(const n of e){const i=P0(n);if(!i)continue;const o=k0(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 Ma(e){return e.type==="video"}function F0(e){e.pause(),e.removeAttribute("src"),e.load()}function er(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function W0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const _0=1140/1440;function N0(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 H0(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 O0(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function D0({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{F0(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d,style:i})}function j0({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const w=i==="cover",b=a.useRef(null),h=a.useRef(null),g=a.useRef(null),m=a.useRef(0),x=a.useRef(0),M=a.useRef("none"),E=a.useRef(!1),R=a.useRef(!1),Z=a.useRef(!1),_=a.useRef(null),[U,F]=a.useState(null),[C,z]=a.useState("opening"),[y,N]=a.useState(0),[I,J]=a.useState(0),[k,X]=a.useState(!1),[G,V]=a.useState(!1),[oe,S]=a.useState(!1),P=a.useRef(n),D=t[n],re=D?Ma(D):!1,ae=I!==0||k,T=a.useCallback(de=>{Z.current=de,X(de)},[]),ue=a.useCallback(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),W=a.useCallback(()=>{ue(),_.current=window.setTimeout(()=>{ue(),T(!1)},In+32)},[ue,T]),ie=a.useCallback(()=>{const de=b.current,he=h.current;if(!de)return;const be=de.getBoundingClientRect(),q=be.width,se=be.height;if(!q||!se)return;if(i==="cover"){F({width:q,height:se,left:be.left,top:be.top});return}if(!he){F(er(de));return}const{width:ge,height:xe}=W0(he);if(!ge||!xe){F(er(de));return}const Ee=ge/xe,Ce=q/se;if(Ee>Ce){const H=q/Ee;F({width:q,height:H,left:be.left,top:be.top+(se-H)/2})}else{const H=se*Ee;F({width:H,height:se,left:be.left+(q-H)/2,top:be.top})}},[i]);a.useEffect(()=>{ie();const de=b.current;if(!de)return;const he=new ResizeObserver(()=>ie());return he.observe(de),()=>he.disconnect()},[ie,n]),a.useEffect(()=>{C==="opening"&&U&&z("open")},[C,U]),a.useEffect(()=>{if(C!=="closing")return;const de=setTimeout(()=>s(),In);return()=>clearTimeout(de)},[C,s]),a.useEffect(()=>()=>{ue()},[ue]),a.useLayoutEffect(()=>{if(P.current===n)return;ue(),N(0),J(0),T(!1),S(!1),V(!1),m.current=0,x.current=0,M.current="none",E.current=!1,g.current=null,R.current=!1;const de=b.current;de&&F(er(de)),P.current=n},[n,T,ue]),a.useEffect(()=>{if(C!=="open")return;let de=null;const he=()=>{de&&(document.removeEventListener("click",de,!0),de=null)},be=()=>{he(),de=Ce=>{Ce.stopPropagation(),Ce.preventDefault(),he()},document.addEventListener("click",de,!0)},q=Ce=>{ue(),Z.current=!1,X(!1),J(0),V(!1),E.current=!1,x.current=0,M.current="none";const H=b.current;H&&F(er(H)),Ce<0?d():l()},se=Ce=>{if(Math.abs(Ce)>R0&&t.length>1){q(Ce);return}T(!0),J(0),W()},ge=Ce=>{if(Ce.touches.length!==1||Z.current)return;const H=Ce.touches[0];R.current=!0,g.current={x:H.clientX,y:H.clientY},M.current="none",x.current=0,E.current=!1},xe=Ce=>{if(!g.current||Ce.touches.length!==1||Z.current)return;const H=Ce.touches[0],pe=H.clientX-g.current.x,O=H.clientY-g.current.y;if(M.current==="none"){if(Math.abs(pe)<10&&Math.abs(O)<10)return;if(Math.abs(pe)>Math.abs(O)){if(t.length<=1)return;M.current="horizontal"}else if(O>0)M.current="vertical";else return}if(M.current==="horizontal"){E.current=!0,V(!0),x.current=pe,J(pe),Ce.preventDefault();return}M.current==="vertical"&&(E.current=!0,V(!0),m.current=O,N(O),Ce.preventDefault())},Ee=()=>{if(!g.current)return;const Ce=M.current,H=E.current;if(H&&Ce==="horizontal")se(x.current),be();else if(H&&Ce==="vertical")if(m.current>L0){const O=window.innerHeight;m.current=O,S(!0),N(O),z("closing")}else m.current=0,N(0),be();else Ce==="horizontal"&&Math.abs(x.current)>0&&(se(x.current),be());g.current=null,M.current="none",x.current=0,E.current=!1,V(!1)};return document.addEventListener("touchstart",ge,{passive:!0}),document.addEventListener("touchmove",xe,{passive:!1}),document.addEventListener("touchend",Ee),document.addEventListener("touchcancel",Ee),()=>{document.removeEventListener("touchstart",ge),document.removeEventListener("touchmove",xe),document.removeEventListener("touchend",Ee),document.removeEventListener("touchcancel",Ee),he()}},[C,t.length,d,l,T,W,ue]),a.useEffect(()=>{const de=he=>{he.key==="Escape"&&(he.preventDefault(),he.stopPropagation(),C!=="closing"&&z("closing"))};return window.addEventListener("keydown",de,!0),()=>window.removeEventListener("keydown",de,!0)},[C]);const ne=()=>{C!=="closing"&&z("closing")},ye=C==="open",Pe=C==="closing",me=y>0?Math.max(0,1-y/500):1,le=y>0?Math.max(.35,1-y/500):1,K=de=>{if(de.stopPropagation(),R.current){R.current=!1;return}if(t.length<=1)return;const he=de.currentTarget.getBoundingClientRect(),be=de.clientY-he.top,q=Math.min(52,he.height*.2);if(!(be>he.height-q)){if(de.clientX-he.left<he.width/2){l();return}d()}},ee=de=>{if(t.length<=1)return;const he=de.currentTarget.getBoundingClientRect(),be=de.clientX-he.left,q=de.clientY-he.top,se=Math.min(52,he.height*.2);if(q>he.height-se){de.currentTarget.style.cursor="default";return}de.currentTarget.style.cursor=be<he.width/2?"w-resize":"e-resize"},Y=a.useCallback(de=>{de.propertyName!=="transform"||!Z.current||(ue(),T(!1))},[ue,T]),We=ae?`translateX(${I}px)`:y>0?`translateY(${y}px)`:void 0,$e={position:"fixed",top:U==null?void 0:U.top,left:U==null?void 0:U.left,width:U==null?void 0:U.width,height:U==null?void 0:U.height,objectFit:i==="cover"?"cover":"contain",transform:We,opacity:y>0?le:C==="opening"||Pe?0:1,transition:G&&!k?"none":k?`transform ${In}ms ${ci}`:oe?`transform ${In}ms ${ci}, opacity ${In}ms ${ci}`:C==="opening"||Pe?`opacity ${In}ms ${ci}`:"none",pointerEvents:re&&ye&&!ae?"auto":"none",touchAction:re&&ye?"none":void 0,zIndex:9998},Ae=U?{position:"fixed",top:U.top,height:U.height,width:U.width/2,zIndex:9999}:null;return r.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:C==="open"?"none":void 0},onClick:ne,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:ye?me:0,transition:G?"none":`opacity ${In}ms ${ci}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:w?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:b,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${In}ms ${ci}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:b,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${In}ms ${ci}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),U&&D&&(re?r.jsx(D0,{src:D.url,phase:C,mediaRef:h,mediaStyle:$e,onLoadedMetadata:ie,onClick:K,onMouseMove:ee,onTransitionEnd:Y},`${n}-${D.url}`):r.jsx("img",{ref:h,src:D.url,alt:D.name,onLoad:ie,onTransitionEnd:Y,style:$e},`${n}-${D.url}`)),ye&&Ae&&t.length>1&&!re&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Ae,left:U.left,cursor:"w-resize",pointerEvents:ae?"none":"auto"},onClick:de=>{if(R.current){R.current=!1;return}de.stopPropagation(),l()}}),r.jsx("div",{style:{...Ae,left:U.left+U.width/2,cursor:"e-resize",pointerEvents:ae?"none":"auto"},onClick:de=>{if(R.current){R.current=!1;return}de.stopPropagation(),d()}})]})]})}function Il({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:s,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const w=`${e}-gallery-${Ma(t)?"video":"image"}`,b=s.display==="cover",h=H0(s),g=C=>$.scalingValue(C,l??!1),m=n??Mi,x=o?{width:"100%",maxWidth:"100%"}:{width:g(m),maxWidth:"100%"},M=i?{borderRadius:g(i)}:{},E={...x,...b?{aspectRatio:h,height:"auto",overflow:"hidden"}:{},...M},R={...b?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g(m)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...b?{}:M},_={className:w,style:R,onClick:p?C=>{C.stopPropagation(),p()}:void 0},U=Math.max(d,di),F=Ma(t)?r.jsx("video",{..._,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):r.jsx("img",{..._,src:t.url,alt:t.name??""});return r.jsxs("div",{className:`${e}-gallery-item`,children:[b?r.jsx("div",{style:E,children:F}):F,c&&d>0&&r.jsx("div",{className:`${e}-padding-handle`,style:{height:g(d)},"aria-hidden":"true"}),u&&c&&r.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:g(U)}})]})}function z0({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:s,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const w=t==="a"?i:t==="c"?o:0,b=w>0||c;return r.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&b&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(w)},"aria-hidden":"true"}),c&&t==="c"&&r.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%"}}),r.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&b&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(w)},"aria-hidden":"true"}),c&&t==="a"&&r.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(s),height:"100%"}})]})}function B0(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function El({P:e,scaled:t,height:n,paired:i}){return r.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 Ml({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:s,paired:l,anchorStyle:d}){return r.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...s==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...s==="left"?{left:0}:{right:0},width:n(i),height:"100%",...d}})}function ma({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:s,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=a.useRef(null),[w,b]=a.useState(0),h=t??"",g=n==="left"||n==="center"||n==="right";return a.useLayoutEffect(()=>{if(!g)return;const m=p.current;if(!m||typeof ResizeObserver>"u")return;const x=()=>b(m.offsetHeight);x();const M=new ResizeObserver(x);return M.observe(m),()=>M.disconnect()},[h,g]),r.jsx("div",{ref:m=>{p.current=m,i(m)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...g?{[`--${e}-title-height`]:`${w}px`}:{},...s},children:r.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,r.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:r.jsx("span",{className:`${e}-title-text`,style:d,children:h})})]})})}const Pl=45;function kl(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const s=parseFloat(o);if(!Number.isNaN(s))return s}i=i.parentElement}return n}function V0(e){const t=kl(e,"--cntrl-viewport-height",window.innerHeight),n=kl(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function G0(e,t,n){const{top:i,centerY:o}=V0(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const s=e.top+e.height/2;return Math.abs(s-o)}function q0(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=G0(u,n,c);return Math.exp(-(p*p)/(2*Pl*Pl))});let o=0,s=-1;return i.forEach((l,d)=>{l>s&&(s=l,o=d)}),{opacities:i,dominantIndex:o}}function U0(e,t,n){const i=a.useRef([]),[{opacities:o,dominantIndex:s},l]=a.useState(()=>({opacities:Array.from({length:e},(c,u)=>u===0?1:0),dominantIndex:0}));return a.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let c=0;const u=()=>{l(q0(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:s}}function K0(e,t){const[n,i]=a.useState(e),o=a.useRef(e);return a.useEffect(()=>{if(!t){o.current=e,i(e);return}const s=Array.from(o.current),l=Array.from(e),d=Math.max(s.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),...s.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function X0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:s}){var pt;const{prefix:l}=$.useScopedStyles(),d=a.useMemo(()=>C0(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",w=(e==null?void 0:e.imgWidth)??Mi,b=(e==null?void 0:e.titleWidth)??_0,h=N0(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??S0,m=(e==null?void 0:e.position)??"center",x=(e==null?void 0:e.titleTopPadding)??0,M=(e==null?void 0:e.titleLeftPadding)??0,E=(e==null?void 0:e.titleRightPadding)??0,R=B0(e==null?void 0:e.transition),Z=(e==null?void 0:e.lightbox)??"on",_=p==="b",U=R==="fade"||R==="retype",{setTitleRef:F,dominantIndex:C}=U0(c.length,U,m),z=((pt=c[C])==null?void 0:pt.title)??"",y=K0(z,R==="retype"),N=R==="fade"||R==="retype",I=R==="retype"?y:z,J=_?void 0:{width:$.scalingValue(w,n??!1)},k=Z==="on"&&(!n||i||o),X=o??!1,G=(e==null?void 0:e.galleryPaddingRight)??0,V=(e==null?void 0:e.galleryPaddingLeft)??0,oe=(e==null?void 0:e.galleryPaddingBetween)??0,S=mt=>$.scalingValue(mt,n??!1),D={width:S(b)},re=p==="a"?G:V,ae=_?{width:"100%"}:{width:`calc(100% - ${S(w)} - ${S(re)})`,...p==="c"?{marginLeft:"auto"}:{}},T=Math.max(G,di),ue=Math.max(V,di),W=Math.max(oe,di),ie=Math.max(x,di),ne=Math.max(M,di),ye=Math.max(E,di),Pe=Math.max(0,(u??1)-(w??Mi)),me=p==="a"?Math.max(0,(u??1)-(w??Mi)-G):p==="c"?Math.max(0,(u??1)-(w??Mi)-V):p==="b"?u??1:1,le=X&&(p==="a"||p==="b"||p==="c")&&m==="top",K=X&&((p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")),ee=X&&((p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"),Y=c.length>1,We=_?void 0:S((p==="c"?V:G)+(w??Mi)),$e=p==="c"&&We?{left:We}:void 0,Ae=p==="a"&&We?{right:We}:void 0,de=_?{left:0,width:"100%"}:p==="a"?{right:S(G),width:S(w)}:{left:S(V),width:S(w)},{titleColor:he,titleFontFamily:be,titleFontSettings:q,titleFontSize:se,titleLineHeight:ge,titleLetterSpacing:xe,titleWordSpacing:Ee,titleAlign:Ce,titleTextAppearance:H,lightboxCounterColor:pe,lightboxCounterFontFamily:O,lightboxCounterFontSettings:L,lightboxCounterFontSize:B,lightboxCounterLineHeight:Re,lightboxCounterLetterSpacing:Q,lightboxCounterWordSpacing:A,lightboxCounterTextAppearance:Fe}=e??{},Me={fontSettings:{fontFamily:be,fontWeight:(q==null?void 0:q.fontWeight)??400,fontStyle:(q==null?void 0:q.fontStyle)??"normal"},fontSize:se??.01,lineHeight:ge,letterSpacing:xe??0,wordSpacing:Ee??0,textAlign:Ce??"left",textAppearance:H,color:he??"#000000"},Ke=on(Ut(Me,n)),lt=D,tt=Rl(se,ge,l,n),Be=Ll(se,ge,`${l}-title`,`${l}-text-tight-leading`),fe={fontSettings:{fontFamily:O,fontWeight:(L==null?void 0:L.fontWeight)??400,fontStyle:(L==null?void 0:L.fontStyle)??"normal"},fontSize:B??.01,lineHeight:Re,letterSpacing:Q??0,wordSpacing:A??0,textAppearance:Fe,color:pe??"#DEDDDD"},De={...on(Ut(fe,n)),...Rl(B,Re,l,n)},qe=Ll(B,Re,`${l}-lightbox-counter`,`${l}-text-tight-leading`),Se=$.buildColorVars(l,{titleColor:he??"#000000",lightboxCounterColor:pe??"#DEDDDD"},I0,E0),_e=a.useRef(null),[Ve,Xe]=a.useState(!1),[at,et]=a.useState([]),[$t,ut]=a.useState(0),He=a.useCallback((mt,gt)=>{k&&(et(mt),ut(gt),Xe(!0))},[k]),Ye=a.useCallback(()=>{Xe(!1)},[]),ze=a.useMemo(()=>{const mt={...Se},gt=_e.current?getComputedStyle(_e.current).getPropertyValue("--cntrl-article-width").trim():"";return gt&&(mt["--cntrl-article-width"]=gt),mt},[Se,Ve]);return a.useEffect(()=>{if(!Ve||Z!=="on"||typeof document>"u")return;const mt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=mt}},[Ve,Z]),a.useEffect(()=>{!n||o||i||Xe(!1)},[n,o,i]),a.useEffect(()=>{Z==="off"&&Xe(!1)},[Z]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),r.jsx("div",{style:Se,children:r.jsxs("div",{ref:_e,className:`${l}-wrapper`,style:{width:$.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&m==="top"?S(x):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")?S(M):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"?S(E):void 0},children:[N&&r.jsx("div",{className:`${l}-single-title-layer`,children:r.jsx(ma,{P:l,title:I,position:m,titleRef:()=>{},titleClassName:`${Be} ${l}-single-title`,titleContainerStyle:{...tt,...ae},titleTextBoxStyle:lt,titleStyle:Ke,showTextBoxOutline:X,topPaddingControl:le?El({P:l,scaled:S,height:ie,paired:!1}):void 0})}),c.map((mt,gt)=>{const kt=A0(mt.gallery),Xt=gt<c.length-1,Yt=kt.filter(bt=>bt.lightboxMedia).map(bt=>bt.lightboxMedia),vt={P:l,position:m,titleRef:F(gt),titleClassName:Be,titleContainerStyle:tt,titleTextBoxStyle:N?{maxWidth:"100%"}:lt,titleStyle:Ke,showTextBoxOutline:X&&!N,topPaddingControl:le&&!N?El({P:l,scaled:S,height:ie,paired:Y}):void 0};return r.jsxs("div",{"data-item-index":gt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Xt?S(oe):void 0},children:[K&&Ml({P:l,controlKey:"titleLeftPadding",scaled:S,width:ne,maxFraction:me,side:"left",paired:Y,anchorStyle:$e}),ee&&Ml({P:l,controlKey:"titleRightPadding",scaled:S,width:ye,maxFraction:me,side:"right",paired:Y,anchorStyle:Ae}),X&&Xt&&r.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:S(W),...de}}),_?r.jsxs("div",{className:`${l}-gallery`,children:[r.jsx("div",{className:`${l}-gallery-media`,children:kt.map(({displayMedia:bt,lightboxMedia:Gt},Ft)=>{const xt=Gt?Yt.findIndex(Ht=>Ht.url===Gt.url):-1;return r.jsx(Il,{P:l,media:bt,imgWidth:w||void 0,cornerRadius:g||void 0,imageDisplay:h,isEditor:n,galleryPaddingBetween:oe,showPaddingAfter:Ft<kt.length-1,showControls:X,onMediaClick:k&&xt>=0?()=>He(Yt,xt):void 0},`${bt.url}-${Ft}`)})}),r.jsx("div",{className:`${l}-title-layer`,children:r.jsx(ma,{...vt,title:N?"":mt.title})})]}):r.jsxs(r.Fragment,{children:[r.jsx(ma,{...vt,title:N?"":mt.title}),kt.length>0&&r.jsx(z0,{P:l,layoutType:p,galleryWidthStyle:J,galleryPaddingRight:G,galleryPaddingLeft:V,galleryPaddingRightWidth:T,galleryPaddingLeftWidth:ue,galleryPaddingMaxFraction:Pe,showControls:X,scaled:S,children:kt.map(({displayMedia:bt,lightboxMedia:Gt},Ft)=>{const xt=Gt?Yt.findIndex(Ht=>Ht.url===Gt.url):-1;return r.jsx(Il,{P:l,media:bt,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:h,isEditor:n,galleryPaddingBetween:oe,showPaddingAfter:Ft<kt.length-1,showControls:X,onMediaClick:k&&xt>=0?()=>He(Yt,xt):void 0},`${bt.url}-${Ft}`)})})]})]},gt)})]})}),Ve&&Z==="on"&&typeof document<"u"&&e&&(()=>{const mt=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx("div",{style:ze,"data-selection":"none",children:r.jsx(j0,{prefix:l,items:at,index:$t,imageDisplay:O0(e.lightboxImageDisplay),isEditor:n,onClose:Ye,onPrev:()=>ut(gt=>(gt-1+at.length)%at.length),onNext:()=>ut(gt=>(gt+1)%at.length),counterClassName:qe,counterStyle:De,backgroundColor:e.backgroundColor??T0})}),mt)})()]})}const Y0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
20859
|
+
`}const F0="rgba(28,31,34,0.9)",In=500,ci="cubic-bezier(0.22, 1, 0.36, 1)",W0=72,_0=50,H0={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},N0=[];function O0(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 D0(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function j0(e){const[t]=e.media;return t!=null&&t.url?t:null}function z0(e){if(!Array.isArray(e)||e.length===0)return[];if(O0(e)){const t=[];for(const n of e){const i=D0(n);if(!i)continue;const o=j0(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 Ma(e){return e.type==="video"}function B0(e){e.pause(),e.removeAttribute("src"),e.load()}function er(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function V0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const G0=1140/1440;function q0(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 U0(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 K0(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function X0({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{B0(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d,style:i})}function Y0({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const v=i==="cover",y=a.useRef(null),g=a.useRef(null),h=a.useRef(null),m=a.useRef(0),b=a.useRef(0),E=a.useRef("none"),R=a.useRef(!1),L=a.useRef(!1),J=a.useRef(!1),W=a.useRef(null),[q,A]=a.useState(null),[C,O]=a.useState("opening"),[w,H]=a.useState(0),[P,X]=a.useState(0),[k,Y]=a.useState(!1),[U,V]=a.useState(!1),[ie,S]=a.useState(!1),M=a.useRef(n),z=t[n],ae=z?Ma(z):!1,re=P!==0||k,I=a.useCallback(de=>{J.current=de,Y(de)},[]),ue=a.useCallback(()=>{W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),F=a.useCallback(()=>{ue(),W.current=window.setTimeout(()=>{ue(),I(!1)},In+32)},[ue,I]),oe=a.useCallback(()=>{const de=y.current,he=g.current;if(!de)return;const be=de.getBoundingClientRect(),G=be.width,se=be.height;if(!G||!se)return;if(i==="cover"){A({width:G,height:se,left:be.left,top:be.top});return}if(!he){A(er(de));return}const{width:ge,height:xe}=V0(he);if(!ge||!xe){A(er(de));return}const Me=ge/xe,Ce=G/se;if(Me>Ce){const N=G/Me;A({width:G,height:N,left:be.left,top:be.top+(se-N)/2})}else{const N=se*Me;A({width:N,height:se,left:be.left+(G-N)/2,top:be.top})}},[i]);a.useEffect(()=>{oe();const de=y.current;if(!de)return;const he=new ResizeObserver(()=>oe());return he.observe(de),()=>he.disconnect()},[oe,n]),a.useEffect(()=>{C==="opening"&&q&&O("open")},[C,q]),a.useEffect(()=>{if(C!=="closing")return;const de=setTimeout(()=>s(),In);return()=>clearTimeout(de)},[C,s]),a.useEffect(()=>()=>{ue()},[ue]),a.useLayoutEffect(()=>{if(M.current===n)return;ue(),H(0),X(0),I(!1),S(!1),V(!1),m.current=0,b.current=0,E.current="none",R.current=!1,h.current=null,L.current=!1;const de=y.current;de&&A(er(de)),M.current=n},[n,I,ue]),a.useEffect(()=>{if(C!=="open")return;let de=null;const he=()=>{de&&(document.removeEventListener("click",de,!0),de=null)},be=()=>{he(),de=Ce=>{Ce.stopPropagation(),Ce.preventDefault(),he()},document.addEventListener("click",de,!0)},G=Ce=>{ue(),J.current=!1,Y(!1),X(0),V(!1),R.current=!1,b.current=0,E.current="none";const N=y.current;N&&A(er(N)),Ce<0?d():l()},se=Ce=>{if(Math.abs(Ce)>_0&&t.length>1){G(Ce);return}I(!0),X(0),F()},ge=Ce=>{if(Ce.touches.length!==1||J.current)return;const N=Ce.touches[0];L.current=!0,h.current={x:N.clientX,y:N.clientY},E.current="none",b.current=0,R.current=!1},xe=Ce=>{if(!h.current||Ce.touches.length!==1||J.current)return;const N=Ce.touches[0],me=N.clientX-h.current.x,D=N.clientY-h.current.y;if(E.current==="none"){if(Math.abs(me)<10&&Math.abs(D)<10)return;if(Math.abs(me)>Math.abs(D)){if(t.length<=1)return;E.current="horizontal"}else if(D>0)E.current="vertical";else return}if(E.current==="horizontal"){R.current=!0,V(!0),b.current=me,X(me),Ce.preventDefault();return}E.current==="vertical"&&(R.current=!0,V(!0),m.current=D,H(D),Ce.preventDefault())},Me=()=>{if(!h.current)return;const Ce=E.current,N=R.current;if(N&&Ce==="horizontal")se(b.current),be();else if(N&&Ce==="vertical")if(m.current>W0){const D=window.innerHeight;m.current=D,S(!0),H(D),O("closing")}else m.current=0,H(0),be();else Ce==="horizontal"&&Math.abs(b.current)>0&&(se(b.current),be());h.current=null,E.current="none",b.current=0,R.current=!1,V(!1)};return document.addEventListener("touchstart",ge,{passive:!0}),document.addEventListener("touchmove",xe,{passive:!1}),document.addEventListener("touchend",Me),document.addEventListener("touchcancel",Me),()=>{document.removeEventListener("touchstart",ge),document.removeEventListener("touchmove",xe),document.removeEventListener("touchend",Me),document.removeEventListener("touchcancel",Me),he()}},[C,t.length,d,l,I,F,ue]),a.useEffect(()=>{const de=he=>{he.key==="Escape"&&(he.preventDefault(),he.stopPropagation(),C!=="closing"&&O("closing"))};return window.addEventListener("keydown",de,!0),()=>window.removeEventListener("keydown",de,!0)},[C]);const Q=()=>{C!=="closing"&&O("closing")},ye=C==="open",Pe=C==="closing",pe=w>0?Math.max(0,1-w/500):1,ce=w>0?Math.max(.35,1-w/500):1,K=de=>{if(de.stopPropagation(),L.current){L.current=!1;return}if(t.length<=1)return;const he=de.currentTarget.getBoundingClientRect(),be=de.clientY-he.top,G=Math.min(52,he.height*.2);if(!(be>he.height-G)){if(de.clientX-he.left<he.width/2){l();return}d()}},te=de=>{if(t.length<=1)return;const he=de.currentTarget.getBoundingClientRect(),be=de.clientX-he.left,G=de.clientY-he.top,se=Math.min(52,he.height*.2);if(G>he.height-se){de.currentTarget.style.cursor="default";return}de.currentTarget.style.cursor=be<he.width/2?"w-resize":"e-resize"},Z=a.useCallback(de=>{de.propertyName!=="transform"||!J.current||(ue(),I(!1))},[ue,I]),Fe=re?`translateX(${P}px)`:w>0?`translateY(${w}px)`:void 0,$e={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:Fe,opacity:w>0?ce:C==="opening"||Pe?0:1,transition:U&&!k?"none":k?`transform ${In}ms ${ci}`:ie?`transform ${In}ms ${ci}, opacity ${In}ms ${ci}`:C==="opening"||Pe?`opacity ${In}ms ${ci}`:"none",pointerEvents:ae&&ye&&!re?"auto":"none",touchAction:ae&&ye?"none":void 0,zIndex:9998},We=q?{position:"fixed",top:q.top,height:q.height,width:q.width/2,zIndex:9999}:null;return r.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:C==="open"?"none":void 0},onClick:Q,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:ye?pe:0,transition:U?"none":`opacity ${In}ms ${ci}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:v?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:y,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${In}ms ${ci}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${In}ms ${ci}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),q&&z&&(ae?r.jsx(X0,{src:z.url,phase:C,mediaRef:g,mediaStyle:$e,onLoadedMetadata:oe,onClick:K,onMouseMove:te,onTransitionEnd:Z},`${n}-${z.url}`):r.jsx("img",{ref:g,src:z.url,alt:z.name,onLoad:oe,onTransitionEnd:Z,style:$e},`${n}-${z.url}`)),ye&&We&&t.length>1&&!ae&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...We,left:q.left,cursor:"w-resize",pointerEvents:re?"none":"auto"},onClick:de=>{if(L.current){L.current=!1;return}de.stopPropagation(),l()}}),r.jsx("div",{style:{...We,left:q.left+q.width/2,cursor:"e-resize",pointerEvents:re?"none":"auto"},onClick:de=>{if(L.current){L.current=!1;return}de.stopPropagation(),d()}})]})]})}function Il({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:s,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const v=`${e}-gallery-${Ma(t)?"video":"image"}`,y=s.display==="cover",g=U0(s),h=C=>$.scalingValue(C,l??!1),m=n??Mi,b=o?{width:"100%",maxWidth:"100%"}:{width:h(m),maxWidth:"100%"},E=i?{borderRadius:h(i)}:{},R={...b,...y?{aspectRatio:g,height:"auto",overflow:"hidden"}:{},...E},L={...y?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(m)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...y?{}:E},W={className:v,style:L,onClick:p?C=>{C.stopPropagation(),p()}:void 0},q=Math.max(d,di),A=Ma(t)?r.jsx("video",{...W,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):r.jsx("img",{...W,src:t.url,alt:t.name??""});return r.jsxs("div",{className:`${e}-gallery-item`,children:[y?r.jsx("div",{style:R,children:A}):A,c&&d>0&&r.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&r.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 Z0({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:s,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const v=t==="a"?i:t==="c"?o:0,y=v>0||c;return r.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&y&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&t==="c"&&r.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%"}}),r.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&y&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&t==="a"&&r.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(s),height:"100%"}})]})}function J0(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function El({P:e,scaled:t,height:n,paired:i}){return r.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 Ml({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:s,paired:l,anchorStyle:d}){return r.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...s==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...s==="left"?{left:0}:{right:0},width:n(i),height:"100%",...d}})}function ma({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:s,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=a.useRef(null),[v,y]=a.useState(0),g=t??"",h=n==="left"||n==="center"||n==="right";return a.useLayoutEffect(()=>{if(!h)return;const m=p.current;if(!m||typeof ResizeObserver>"u")return;const b=()=>y(m.offsetHeight);b();const E=new ResizeObserver(b);return E.observe(m),()=>E.disconnect()},[g,h]),r.jsx("div",{ref:m=>{p.current=m,i(m)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${v}px`}:{},...s},children:r.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,r.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:r.jsx("span",{className:`${e}-title-text`,style:d,children:g})})]})})}const Pl=45;function kl(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const s=parseFloat(o);if(!Number.isNaN(s))return s}i=i.parentElement}return n}function Q0(e){const t=kl(e,"--cntrl-viewport-height",window.innerHeight),n=kl(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function ex(e,t,n){const{top:i,centerY:o}=Q0(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const s=e.top+e.height/2;return Math.abs(s-o)}function tx(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=ex(u,n,c);return Math.exp(-(p*p)/(2*Pl*Pl))});let o=0,s=-1;return i.forEach((l,d)=>{l>s&&(s=l,o=d)}),{opacities:i,dominantIndex:o}}function nx(e,t,n){const i=a.useRef([]),[{opacities:o,dominantIndex:s},l]=a.useState(()=>({opacities:Array.from({length:e},(c,u)=>u===0?1:0),dominantIndex:0}));return a.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let c=0;const u=()=>{l(tx(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:s}}function ix(e,t){const[n,i]=a.useState(e),o=a.useRef(e);return a.useEffect(()=>{if(!t){o.current=e,i(e);return}const s=Array.from(o.current),l=Array.from(e),d=Math.max(s.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),...s.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function ox({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:s}){var pt;const{prefix:l}=$.useScopedStyles(),d=a.useMemo(()=>A0(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",v=(e==null?void 0:e.imgWidth)??Mi,y=(e==null?void 0:e.titleWidth)??G0,g=q0(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??P0,m=(e==null?void 0:e.position)??"center",b=(e==null?void 0:e.titleTopPadding)??0,E=(e==null?void 0:e.titleLeftPadding)??0,R=(e==null?void 0:e.titleRightPadding)??0,L=J0(e==null?void 0:e.transition),J=(e==null?void 0:e.lightbox)??"on",W=p==="b",q=L==="fade"||L==="retype",{setTitleRef:A,dominantIndex:C}=nx(c.length,q,m),O=((pt=c[C])==null?void 0:pt.title)??"",w=ix(O,L==="retype"),H=L==="fade"||L==="retype",P=L==="retype"?w:O,X=W?void 0:{width:$.scalingValue(v,n??!1)},k=J==="on"&&(!n||i||o),Y=o??!1,U=(e==null?void 0:e.galleryPaddingRight)??0,V=(e==null?void 0:e.galleryPaddingLeft)??0,ie=(e==null?void 0:e.galleryPaddingBetween)??0,S=mt=>$.scalingValue(mt,n??!1),z={width:S(y)},ae=p==="a"?U:V,re=W?{width:"100%"}:{width:`calc(100% - ${S(v)} - ${S(ae)})`,...p==="c"?{marginLeft:"auto"}:{}},I=Math.max(U,di),ue=Math.max(V,di),F=Math.max(ie,di),oe=Math.max(b,di),Q=Math.max(E,di),ye=Math.max(R,di),Pe=Math.max(0,(u??1)-(v??Mi)),pe=p==="a"?Math.max(0,(u??1)-(v??Mi)-U):p==="c"?Math.max(0,(u??1)-(v??Mi)-V):p==="b"?u??1:1,ce=Y&&(p==="a"||p==="b"||p==="c")&&m==="top",K=Y&&((p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")),te=Y&&((p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"),Z=c.length>1,Fe=W?void 0:S((p==="c"?V:U)+(v??Mi)),$e=p==="c"&&Fe?{left:Fe}:void 0,We=p==="a"&&Fe?{right:Fe}:void 0,de=W?{left:0,width:"100%"}:p==="a"?{right:S(U),width:S(v)}:{left:S(V),width:S(v)},{titleColor:he,titleFontFamily:be,titleFontSettings:G,titleFontSize:se,titleLineHeight:ge,titleLetterSpacing:xe,titleWordSpacing:Me,titleAlign:Ce,titleTextAppearance:N,lightboxCounterColor:me,lightboxCounterFontFamily:D,lightboxCounterFontSettings:T,lightboxCounterFontSize:B,lightboxCounterLineHeight:Le,lightboxCounterLetterSpacing:ne,lightboxCounterWordSpacing:_,lightboxCounterTextAppearance:ke}=e??{},Ie={fontSettings:{fontFamily:be,fontWeight:(G==null?void 0:G.fontWeight)??400,fontStyle:(G==null?void 0:G.fontStyle)??"normal"},fontSize:se??.01,lineHeight:ge,letterSpacing:xe??0,wordSpacing:Me??0,textAlign:Ce??"left",textAppearance:N,color:he??"#000000"},Ke=on(Ut(Ie,n)),at=z,tt=Rl(se,ge,l,n),Ve=Ll(se,ge,`${l}-title`,`${l}-text-tight-leading`),fe={fontSettings:{fontFamily:D,fontWeight:(T==null?void 0:T.fontWeight)??400,fontStyle:(T==null?void 0:T.fontStyle)??"normal"},fontSize:B??.01,lineHeight:Le,letterSpacing:ne??0,wordSpacing:_??0,textAppearance:ke,color:me??"#DEDDDD"},De={...on(Ut(fe,n)),...Rl(B,Le,l,n)},qe=Ll(B,Le,`${l}-lightbox-counter`,`${l}-text-tight-leading`),we=$.buildColorVars(l,{titleColor:he??"#000000",lightboxCounterColor:me??"#DEDDDD"},H0,N0),Oe=a.useRef(null),[ze,Ye]=a.useState(!1),[ot,Je]=a.useState([]),[bt,lt]=a.useState(0),_e=a.useCallback((mt,gt)=>{k&&(Je(mt),lt(gt),Ye(!0))},[k]),Xe=a.useCallback(()=>{Ye(!1)},[]),Be=a.useMemo(()=>{const mt={...we},gt=Oe.current?getComputedStyle(Oe.current).getPropertyValue("--cntrl-article-width").trim():"";return gt&&(mt["--cntrl-article-width"]=gt),mt},[we,ze]);return a.useEffect(()=>{if(!ze||J!=="on"||typeof document>"u")return;const mt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=mt}},[ze,J]),a.useEffect(()=>{!n||o||i||Ye(!1)},[n,o,i]),a.useEffect(()=>{J==="off"&&Ye(!1)},[J]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),r.jsx("div",{style:we,children:r.jsxs("div",{ref:Oe,className:`${l}-wrapper`,style:{width:$.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&m==="top"?S(b):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")?S(E):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"?S(R):void 0},children:[H&&r.jsx("div",{className:`${l}-single-title-layer`,children:r.jsx(ma,{P:l,title:P,position:m,titleRef:()=>{},titleClassName:`${Ve} ${l}-single-title`,titleContainerStyle:{...tt,...re},titleTextBoxStyle:at,titleStyle:Ke,showTextBoxOutline:Y,topPaddingControl:ce?El({P:l,scaled:S,height:oe,paired:!1}):void 0})}),c.map((mt,gt)=>{const kt=z0(mt.gallery),Xt=gt<c.length-1,Yt=kt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),vt={P:l,position:m,titleRef:A(gt),titleClassName:Ve,titleContainerStyle:tt,titleTextBoxStyle:H?{maxWidth:"100%"}:at,titleStyle:Ke,showTextBoxOutline:Y&&!H,topPaddingControl:ce&&!H?El({P:l,scaled:S,height:oe,paired:Z}):void 0};return r.jsxs("div",{"data-item-index":gt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Xt?S(ie):void 0},children:[K&&Ml({P:l,controlKey:"titleLeftPadding",scaled:S,width:Q,maxFraction:pe,side:"left",paired:Z,anchorStyle:$e}),te&&Ml({P:l,controlKey:"titleRightPadding",scaled:S,width:ye,maxFraction:pe,side:"right",paired:Z,anchorStyle:We}),Y&&Xt&&r.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:S(F),...de}}),W?r.jsxs("div",{className:`${l}-gallery`,children:[r.jsx("div",{className:`${l}-gallery-media`,children:kt.map(({displayMedia:wt,lightboxMedia:Gt},Ft)=>{const xt=Gt?Yt.findIndex(Nt=>Nt.url===Gt.url):-1;return r.jsx(Il,{P:l,media:wt,imgWidth:v||void 0,cornerRadius:h||void 0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:Ft<kt.length-1,showControls:Y,onMediaClick:k&&xt>=0?()=>_e(Yt,xt):void 0},`${wt.url}-${Ft}`)})}),r.jsx("div",{className:`${l}-title-layer`,children:r.jsx(ma,{...vt,title:H?"":mt.title})})]}):r.jsxs(r.Fragment,{children:[r.jsx(ma,{...vt,title:H?"":mt.title}),kt.length>0&&r.jsx(Z0,{P:l,layoutType:p,galleryWidthStyle:X,galleryPaddingRight:U,galleryPaddingLeft:V,galleryPaddingRightWidth:I,galleryPaddingLeftWidth:ue,galleryPaddingMaxFraction:Pe,showControls:Y,scaled:S,children:kt.map(({displayMedia:wt,lightboxMedia:Gt},Ft)=>{const xt=Gt?Yt.findIndex(Nt=>Nt.url===Gt.url):-1;return r.jsx(Il,{P:l,media:wt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:Ft<kt.length-1,showControls:Y,onMediaClick:k&&xt>=0?()=>_e(Yt,xt):void 0},`${wt.url}-${Ft}`)})})]})]},gt)})]})}),ze&&J==="on"&&typeof document<"u"&&e&&(()=>{const mt=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Be,"data-selection":"none",children:r.jsx(Y0,{prefix:l,items:ot,index:bt,imageDisplay:K0(e.lightboxImageDisplay),isEditor:n,onClose:Xe,onPrev:()=>lt(gt=>(gt-1+ot.length)%ot.length),onNext:()=>lt(gt=>(gt+1)%ot.length),counterClassName:qe,counterStyle:De,backgroundColor:e.backgroundColor??F0})}),mt)})()]})}const rx=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
20779
20860
|
import { createPortal } from 'react-dom';
|
|
20780
20861
|
import type React from 'react';
|
|
20781
20862
|
import { CommonComponentProps } from '../props';
|
|
@@ -22825,4 +22906,4 @@ export function Mercury({
|
|
|
22825
22906
|
</>
|
|
22826
22907
|
);
|
|
22827
22908
|
}
|
|
22828
|
-
`;function Li(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ga={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},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"}},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"]}}}}}}}},required:["gallery"]},default:[{title:"AX-2 Space Suit",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Earth-orbital mission",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.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"}]},{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-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Salton Sea from Above",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-12.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]}]},settings:{sizing:"auto auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},imgWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},titleWidth:{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"}}},galleryPaddingRight:Li("Gallery Padding Right"),galleryPaddingLeft:Li("Gallery Padding Left"),galleryPaddingBetween:Li("Gallery Padding Between"),cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right","top"]}},titleTopPadding:Li("Title Top Padding"),titleLeftPadding:Li("Title Left Padding"),titleRightPadding:Li("Title Right Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...ga.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"}},titleAlign:{...ga.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...ga.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:{type:"a",position:"left",transition:"scroll",titleColor:"#000000",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"center",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{defaultPaddingTop:30/1440,wrapperWidth:1,imgWidth:600/1440,titleWidth:400/1440,galleryPaddingRight:30/1440,galleryPaddingLeft:30/1440,galleryPaddingBetween:30/1440,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:4/1440,position:"center",titleFontSize:73/1440,titleLineHeight:66/1440,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{defaultPaddingTop:10/375,wrapperWidth:1,imgWidth:170/375,titleWidth:150/375,galleryPaddingRight:10/375,galleryPaddingLeft:10/375,galleryPaddingBetween:10/375,titleTopPadding:0,titleLeftPadding:10/375,titleRightPadding:10/375,cornerRadius:8/375,position:"left",titleFontSize:30/375,titleLineHeight:25/375,lightboxCounterFontSize:14/375,lightboxCounterLineHeight:14/375},t:{defaultPaddingTop:20/768,wrapperWidth:1,imgWidth:300/768,titleWidth:320/768,galleryPaddingRight:20/768,galleryPaddingLeft:20/768,galleryPaddingBetween:20/768,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:8/768,position:"center",titleFontSize:58/768,titleLineHeight:48/768,lightboxCounterFontSize:8/768,lightboxCounterLineHeight:8/768}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{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"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},J0={element:X0,id:"mercury",name:"Mercury",category:"lists",layoutMode:"structured",version:1,defaultSize:{d:{width:720,height:540}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Mercury.mp4"},schema:Z0,sourceCode:Y0,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},Q0=[op,up,Yy,im,pm,Sm,jm,ng,cg,fg,jg,Fh,Of,Kf,My,jy,lv,o0,xv,w0,J0];exports.components=Q0;exports.isSchemaV1=Xc;
|
|
22909
|
+
`;function Li(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ga={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},ax={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"}},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"]}}}}}}}},required:["gallery"]},default:[{title:"AX-2 Space Suit",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Earth-orbital mission",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.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"}]},{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-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Salton Sea from Above",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-12.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]}]},settings:{sizing:"auto auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},imgWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},titleWidth:{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"}}},galleryPaddingRight:Li("Gallery Padding Right"),galleryPaddingLeft:Li("Gallery Padding Left"),galleryPaddingBetween:Li("Gallery Padding Between"),cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right","top"]}},titleTopPadding:Li("Title Top Padding"),titleLeftPadding:Li("Title Left Padding"),titleRightPadding:Li("Title Right Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...ga.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"}},titleAlign:{...ga.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...ga.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:{type:"a",position:"left",transition:"scroll",titleColor:"#000000",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"center",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{defaultPaddingTop:30/1440,wrapperWidth:1,imgWidth:600/1440,titleWidth:400/1440,galleryPaddingRight:30/1440,galleryPaddingLeft:30/1440,galleryPaddingBetween:30/1440,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:4/1440,position:"center",titleFontSize:73/1440,titleLineHeight:66/1440,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{defaultPaddingTop:10/375,wrapperWidth:1,imgWidth:170/375,titleWidth:150/375,galleryPaddingRight:10/375,galleryPaddingLeft:10/375,galleryPaddingBetween:10/375,titleTopPadding:0,titleLeftPadding:10/375,titleRightPadding:10/375,cornerRadius:8/375,position:"left",titleFontSize:30/375,titleLineHeight:25/375,lightboxCounterFontSize:14/375,lightboxCounterLineHeight:14/375},t:{defaultPaddingTop:20/768,wrapperWidth:1,imgWidth:300/768,titleWidth:320/768,galleryPaddingRight:20/768,galleryPaddingLeft:20/768,galleryPaddingBetween:20/768,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:8/768,position:"center",titleFontSize:58/768,titleLineHeight:48/768,lightboxCounterFontSize:8/768,lightboxCounterLineHeight:8/768}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{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"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},sx={element:ox,id:"mercury",name:"Mercury",category:"lists",layoutMode:"structured",version:1,defaultSize:{d:{width:720,height:540}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Mercury.mp4"},schema:ax,sourceCode:rx,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},lx=[op,up,rv,im,pm,Sm,jm,ug,vg,Tg,Yg,Bh,Kf,iy,Oy,Yy,yv,m0,Iv,M0,sx];exports.components=lx;exports.isSchemaV1=Xc;
|