@cntrl-site/components 1.0.31-alpha.0 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("react"),Je=require("classnames"),M=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Bi=require("react-dom");function ul(e){return e.type==="object"&&e.version===1}const pl="ControlSlider-module__wrapper___sHEkd",ml="ControlSlider-module__hoverArrow___A-dOH",gl="ControlSlider-module__sliderItem___QQSkR",hl="ControlSlider-module__sliderImage___9hRl-",fl="ControlSlider-module__arrow___05ghY",yl="ControlSlider-module__arrowVertical___tBfVN",vl="ControlSlider-module__nextArrow___-30Yc",bl="ControlSlider-module__arrowInner___aEra3",xl="ControlSlider-module__arrowIcon___S4ztF",wl="ControlSlider-module__arrowImg___2dwJW",$l="ControlSlider-module__mirror___brd6U",Sl="ControlSlider-module__pagination___bicLF",Cl="ControlSlider-module__paginationInner___bT-P-",Tl="ControlSlider-module__paginationVertical___zYqKw",Ll="ControlSlider-module__paginationItem___nTRbk",El="ControlSlider-module__dot___p1Qun",Pl="ControlSlider-module__activeDot___LHFaj",Il="ControlSlider-module__paginationInsideBottom___R3FWn",Rl="ControlSlider-module__paginationInsideTop___V-qb-",Ml="ControlSlider-module__paginationOutsideBottom___14w8D",kl="ControlSlider-module__paginationOutsideTop___SCLqB",Al="ControlSlider-module__paginationInsideLeft___yOBRZ",_l="ControlSlider-module__paginationInsideRight___Rtt3o",Fl="ControlSlider-module__paginationOutsideLeft___lahaw",Wl="ControlSlider-module__paginationOutsideRight___EtuQa",Nl="ControlSlider-module__imgWrapper___UjEgB",Hl="ControlSlider-module__captionBlock___dJ6-j",Ol="ControlSlider-module__captionTextWrapper___HFlpf",Bl="ControlSlider-module__captionText___uGBVc",jl="ControlSlider-module__active___WZK4G",zl="ControlSlider-module__withPointerEvents___t-18M",Vl="ControlSlider-module__topLeftAlignment___zjnGM",Dl="ControlSlider-module__topCenterAlignment___gD1xW",ql="ControlSlider-module__topRightAlignment___NMapS",Kl="ControlSlider-module__middleLeftAlignment___OnUrY",Gl="ControlSlider-module__middleCenterAlignment___Tdkl0",Ul="ControlSlider-module__middleRightAlignment___wEbfX",Xl="ControlSlider-module__bottomLeftAlignment___cTP2-",Yl="ControlSlider-module__bottomCenterAlignment___c54fB",Jl="ControlSlider-module__bottomRightAlignment___kEwrz",Zl="ControlSlider-module__clickOverlay___DZA28",Ql="ControlSlider-module__contain___pLyq7",ec="ControlSlider-module__cover___KdDat",Ee={wrapper:pl,hoverArrow:ml,sliderItem:gl,sliderImage:hl,arrow:fl,arrowVertical:yl,nextArrow:vl,arrowInner:bl,arrowIcon:xl,arrowImg:wl,mirror:$l,pagination:Sl,paginationInner:Cl,paginationVertical:Tl,paginationItem:Ll,dot:El,activeDot:Pl,paginationInsideBottom:Il,paginationInsideTop:Rl,paginationOutsideBottom:Ml,paginationOutsideTop:kl,paginationInsideLeft:Al,paginationInsideRight:_l,paginationOutsideLeft:Fl,paginationOutsideRight:Wl,imgWrapper:Nl,captionBlock:Hl,captionTextWrapper:Ol,captionText:Bl,active:jl,withPointerEvents:zl,topLeftAlignment:Vl,topCenterAlignment:Dl,topRightAlignment:ql,middleLeftAlignment:Kl,middleCenterAlignment:Gl,middleRightAlignment:Ul,bottomLeftAlignment:Xl,bottomCenterAlignment:Yl,bottomRightAlignment:Jl,clickOverlay:Zl,contain:Ql,cover:ec};function tc(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 nc(e,t,n){return t&&tc(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var sa="(prefers-reduced-motion: reduce)",ri=1,ic=2,li=3,vi=4,ji=5,vo=6,Lo=7,oc={CREATED:ri,MOUNTED:ic,IDLE:li,MOVING:vi,SCROLLING:ji,DRAGGING:vo,DESTROYED:Lo};function bn(e){e.length=0}function kn(e,t,n){return Array.prototype.slice.call(e,t,n)}function mt(e){return e.bind.apply(e,[null].concat(kn(arguments,1)))}var us=setTimeout,vr=function(){};function la(e){return requestAnimationFrame(e)}function _o(e,t){return typeof t===e}function Ii(e){return!kr(e)&&_o("object",e)}var Mr=Array.isArray,ps=mt(_o,"function"),In=mt(_o,"string"),zi=mt(_o,"undefined");function kr(e){return e===null}function ms(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Vi(e){return Mr(e)?e:[e]}function Gt(e,t){Vi(e).forEach(t)}function Ar(e,t){return e.indexOf(t)>-1}function bo(e,t){return e.push.apply(e,Vi(t)),e}function gn(e,t,n){e&&Gt(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function on(e,t){gn(e,In(t)?t.split(" "):t,!0)}function Di(e,t){Gt(t,e.appendChild.bind(e))}function _r(e,t){Gt(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Ri(e,t){return ms(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function gs(e,t){var n=e?kn(e.children):[];return t?n.filter(function(i){return Ri(i,t)}):n}function qi(e,t){return t?gs(e,t)[0]:e.firstElementChild}var Mi=Object.keys;function qn(e,t,n){return e&&(n?Mi(e).reverse():Mi(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function ki(e){return kn(arguments,1).forEach(function(t){qn(t,function(n,i){e[i]=t[i]})}),e}function Pn(e){return kn(arguments,1).forEach(function(t){qn(t,function(n,i){Mr(n)?e[i]=n.slice():Ii(n)?e[i]=Pn({},Ii(e[i])?e[i]:{},n):e[i]=n})}),e}function ca(e,t){Gt(t||Mi(e),function(n){delete e[n]})}function rn(e,t){Gt(e,function(n){Gt(t,function(i){n&&n.removeAttribute(i)})})}function Ne(e,t,n){Ii(t)?qn(t,function(i,o){Ne(e,o,i)}):Gt(e,function(i){kr(n)||n===""?rn(i,t):i.setAttribute(t,String(n))})}function ai(e,t,n){var i=document.createElement(e);return t&&(In(t)?on(i,t):Ne(i,t)),n&&Di(n,i),i}function Jt(e,t,n){if(zi(n))return getComputedStyle(e)[t];kr(n)||(e.style[t]=""+n)}function Ai(e,t){Jt(e,"display",t)}function hs(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Zt(e,t){return e.getAttribute(t)}function da(e,t){return e&&e.classList.contains(t)}function Vt(e){return e.getBoundingClientRect()}function Kn(e){Gt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function fs(e){return qi(new DOMParser().parseFromString(e,"text/html").body)}function mn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ys(e,t){return e&&e.querySelector(t)}function Fr(e,t){return t?kn(e.querySelectorAll(t)):[]}function hn(e,t){gn(e,t,!1)}function br(e){return e.timeStamp}function Hn(e){return In(e)?e:e?e+"px":""}var Ki="splide",Wr="data-"+Ki;function Ci(e,t){if(!e)throw new Error("["+Ki+"] "+(t||""))}var Rn=Math.min,Eo=Math.max,Po=Math.floor,_i=Math.ceil,jt=Math.abs;function vs(e,t,n){return jt(e-t)<n}function xo(e,t,n,i){var o=Rn(t,n),s=Eo(t,n);return i?o<e&&e<s:o<=e&&e<=s}function ni(e,t,n){var i=Rn(t,n),o=Eo(t,n);return Rn(Eo(i,e),o)}function xr(e){return+(e>0)-+(e<0)}function wr(e,t){return Gt(t,function(n){e=e.replace("%s",""+n)}),e}function Nr(e){return e<10?"0"+e:""+e}var ua={};function rc(e){return""+e+Nr(ua[e]=(ua[e]||0)+1)}function bs(){var e=[];function t(a,u,c,m){o(a,u,function(p,R,x){var L="addEventListener"in p,g=L?p.removeEventListener.bind(p,R,c,m):p.removeListener.bind(p,c);L?p.addEventListener(R,c,m):p.addListener(c),e.push([p,R,x,c,g])})}function n(a,u,c){o(a,u,function(m,p,R){e=e.filter(function(x){return x[0]===m&&x[1]===p&&x[2]===R&&(!c||x[3]===c)?(x[4](),!1):!0})})}function i(a,u,c){var m,p=!0;return typeof CustomEvent=="function"?m=new CustomEvent(u,{bubbles:p,detail:c}):(m=document.createEvent("CustomEvent"),m.initCustomEvent(u,p,!1,c)),a.dispatchEvent(m),m}function o(a,u,c){Gt(a,function(m){m&&Gt(u,function(p){p.split(" ").forEach(function(R){var x=R.split(".");c(m,x[0],x[1])})})})}function s(){e.forEach(function(a){a[4]()}),bn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var An="mounted",$r="ready",xn="move",bi="moved",Hr="click",xs="active",ws="inactive",$s="visible",Ss="hidden",Tt="refresh",Nt="updated",ci="resize",Fo="resized",Cs="drag",Ts="dragging",Ls="dragged",Wo="scroll",Un="scrolled",ac="overflow",Or="destroy",Es="arrows:mounted",Ps="arrows:updated",Is="pagination:mounted",Rs="pagination:updated",Br="navigation:mounted",jr="autoplay:play",Ms="autoplay:playing",zr="autoplay:pause",Vr="lazyload:loaded",ks="sk",As="sh",Io="ei";function bt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=bs();function i(s,a){n.bind(t,Vi(s).join(" "),function(u){a.apply(a,Mr(u.detail)?u.detail:[])})}function o(s){n.dispatch(t,s,kn(arguments,1))}return e&&e.event.on(Or,n.destroy),ki(n,{bus:t,on:i,off:mt(n.unbind,t),emit:o})}function No(e,t,n,i){var o=Date.now,s,a=0,u,c=!0,m=0;function p(){if(!c){if(a=e?Rn((o()-s)/e,1):1,n&&n(a),a>=1&&(t(),s=o(),i&&++m>=i))return x();u=la(p)}}function R($){$||g(),s=o()-($?a*e:0),c=!1,u=la(p)}function x(){c=!0}function L(){s=o(),a=0,n&&n(a)}function g(){u&&cancelAnimationFrame(u),a=0,u=0,c=!0}function y($){e=$}function w(){return c}return{start:R,rewind:L,pause:x,cancel:g,set:y,isPaused:w}}function sc(e){var t=e;function n(o){t=o}function i(o){return Ar(Vi(o),t)}return{set:n,is:i}}function lc(e,t){var n=No(0,e,null,1);return function(){n.isPaused()&&n.start()}}function cc(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},a=bs(),u=[];function c(){var g=n.mediaQuery==="min";Mi(o).sort(function(y,w){return g?+y-+w:+w-+y}).forEach(function(y){p(o[y],"("+(g?"min":"max")+"-width:"+y+"px)")}),p(s,sa),R()}function m(g){g&&a.destroy()}function p(g,y){var w=matchMedia(y);a.bind(w,"change",R),u.push([g,w])}function R(){var g=i.is(Lo),y=n.direction,w=u.reduce(function($,S){return Pn($,S[1].matches?S[0]:{})},{});ca(n),L(w),n.destroy?e.destroy(n.destroy==="completely"):g?(m(!0),e.mount()):y!==n.direction&&e.refresh()}function x(g){matchMedia(sa).matches&&(g?Pn(n,s):ca(n,Mi(s)))}function L(g,y,w){Pn(n,g),y&&Pn(Object.getPrototypeOf(n),g),(w||!i.is(ri))&&e.emit(Nt,n)}return{setup:c,destroy:m,reduce:x,set:L}}var Ho="Arrow",Oo=Ho+"Left",Bo=Ho+"Right",_s=Ho+"Up",Fs=Ho+"Down",pa="rtl",jo="ttb",tr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[_s,Bo],ArrowRight:[Fs,Oo]};function dc(e,t,n){function i(s,a,u){u=u||n.direction;var c=u===pa&&!a?1:u===jo?0:-1;return tr[s]&&tr[s][c]||s.replace(/width|left|right/i,function(m,p){var R=tr[m.toLowerCase()][c]||m;return p>0?R.charAt(0).toUpperCase()+R.slice(1):R})}function o(s){return s*(n.direction===pa?1:-1)}return{resolve:i,orient:o}}var fn="role",si="tabindex",uc="disabled",en="aria-",Gi=en+"controls",Ws=en+"current",ma=en+"selected",Dt=en+"label",Dr=en+"labelledby",Ns=en+"hidden",qr=en+"orientation",Fi=en+"roledescription",ga=en+"live",ha=en+"busy",fa=en+"atomic",Kr=[fn,si,uc,Gi,Ws,Dt,Dr,Ns,qr,Fi],an=Ki+"__",_n="is-",nr=Ki,ya=an+"track",pc=an+"list",zo=an+"slide",Hs=zo+"--clone",mc=zo+"__container",Gr=an+"arrows",Vo=an+"arrow",Os=Vo+"--prev",Bs=Vo+"--next",Do=an+"pagination",js=Do+"__page",gc=an+"progress",hc=gc+"__bar",fc=an+"toggle",yc=an+"spinner",vc=an+"sr",bc=_n+"initialized",Gn=_n+"active",zs=_n+"prev",Vs=_n+"next",Sr=_n+"visible",Cr=_n+"loading",Ds=_n+"focus-in",qs=_n+"overflow",xc=[Gn,Sr,zs,Vs,Cr,Ds,qs],wc={slide:zo,clone:Hs,arrows:Gr,arrow:Vo,prev:Os,next:Bs,pagination:Do,page:js,spinner:yc};function $c(e,t){if(ps(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Ri(n,t);)n=n.parentElement;return n}var Sc=5,va=200,Ks="touchstart mousedown",ir="touchmove mousemove",or="touchend touchcancel mouseup click";function Cc(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=e.root,u=n.i18n,c={},m=[],p=[],R=[],x,L,g;function y(){C(),k(),S()}function w(){o(Tt,$),o(Tt,y),o(Nt,S),s(document,Ks+" keydown",function(I){g=I.type==="keydown"},{capture:!0}),s(a,"focusin",function(){gn(a,Ds,!!g)})}function $(I){var E=Kr.concat("style");bn(m),hn(a,p),hn(x,R),rn([x,L],E),rn(a,I?E:["style",Fi])}function S(){hn(a,p),hn(x,R),p=H(nr),R=H(ya),on(a,p),on(x,R),Ne(a,Dt,n.label),Ne(a,Dr,n.labelledby)}function C(){x=P("."+ya),L=qi(x,"."+pc),Ci(x&&L,"A track/list element is missing."),bo(m,gs(L,"."+zo+":not(."+Hs+")")),qn({arrows:Gr,pagination:Do,prev:Os,next:Bs,bar:hc,toggle:fc},function(I,E){c[E]=P("."+I)}),ki(c,{root:a,track:x,list:L,slides:m})}function k(){var I=a.id||rc(Ki),E=n.role;a.id=I,x.id=x.id||I+"-track",L.id=L.id||I+"-list",!Zt(a,fn)&&a.tagName!=="SECTION"&&E&&Ne(a,fn,E),Ne(a,Fi,u.carousel),Ne(L,fn,"presentation")}function P(I){var E=ys(a,I);return E&&$c(E,"."+nr)===a?E:void 0}function H(I){return[I+"--"+n.type,I+"--"+n.direction,n.drag&&I+"--draggable",n.isNavigation&&I+"--nav",I===nr&&Gn]}return ki(c,{setup:y,mount:w,destroy:$})}var di="slide",xi="loop",Ui="fade";function Tc(e,t,n,i){var o=bt(e),s=o.on,a=o.emit,u=o.bind,c=e.Components,m=e.root,p=e.options,R=p.isNavigation,x=p.updateOnMove,L=p.i18n,g=p.pagination,y=p.slideFocus,w=c.Direction.resolve,$=Zt(i,"style"),S=Zt(i,Dt),C=n>-1,k=qi(i,"."+mc),P;function H(){C||(i.id=m.id+"-slide"+Nr(t+1),Ne(i,fn,g?"tabpanel":"group"),Ne(i,Fi,L.slide),Ne(i,Dt,S||wr(L.slideLabel,[t+1,e.length]))),I()}function I(){u(i,"click",mt(a,Hr,_)),u(i,"keydown",mt(a,ks,_)),s([bi,As,Un],A),s(Br,Z),x&&s(xn,v)}function E(){P=!0,o.destroy(),hn(i,xc),rn(i,Kr),Ne(i,"style",$),Ne(i,Dt,S||"")}function Z(){var N=e.splides.map(function(T){var K=T.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");Ne(i,Dt,wr(L.slideX,(C?n:t)+1)),Ne(i,Gi,N),Ne(i,fn,y?"button":""),y&&rn(i,Fi)}function v(){P||A()}function A(){if(!P){var N=e.index;B(),V(),gn(i,zs,t===N-1),gn(i,Vs,t===N+1)}}function B(){var N=ce();N!==da(i,Gn)&&(gn(i,Gn,N),Ne(i,Ws,R&&N||""),a(N?xs:ws,_))}function V(){var N=X(),T=!N&&(!ce()||C);if(e.state.is([vi,ji])||Ne(i,Ns,T||""),Ne(Fr(i,p.focusableNodes||""),si,T?-1:""),y&&Ne(i,si,T?-1:0),N!==da(i,Sr)&&(gn(i,Sr,N),a(N?$s:Ss,_)),!N&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&hs(K.slide)}}function ne(N,T,K){Jt(K&&k||i,N,T)}function ce(){var N=e.index;return N===t||p.cloneStatus&&N===n}function X(){if(e.is(Ui))return ce();var N=Vt(c.Elements.track),T=Vt(i),K=w("left",!0),Y=w("right",!0);return Po(N[K])<=_i(T[K])&&Po(T[Y])<=_i(N[Y])}function j(N,T){var K=jt(N-t);return!C&&(p.rewind||e.is(xi))&&(K=Rn(K,e.length-K)),K<=T}var _={index:t,slideIndex:n,slide:i,container:k,isClone:C,mount:H,destroy:E,update:A,style:ne,isWithin:j};return _}function Lc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=i.bind,u=t.Elements,c=u.slides,m=u.list,p=[];function R(){x(),o(Tt,L),o(Tt,x)}function x(){c.forEach(function(A,B){y(A,B,-1)})}function L(){P(function(A){A.destroy()}),bn(p)}function g(){P(function(A){A.update()})}function y(A,B,V){var ne=Tc(e,B,V,A);ne.mount(),p.push(ne),p.sort(function(ce,X){return ce.index-X.index})}function w(A){return A?H(function(B){return!B.isClone}):p}function $(A){var B=t.Controller,V=B.toIndex(A),ne=B.hasFocus()?1:n.perPage;return H(function(ce){return xo(ce.index,V,V+ne-1)})}function S(A){return H(A)[0]}function C(A,B){Gt(A,function(V){if(In(V)&&(V=fs(V)),ms(V)){var ne=c[B];ne?_r(V,ne):Di(m,V),on(V,n.classes.slide),E(V,mt(s,ci))}}),s(Tt)}function k(A){Kn(H(A).map(function(B){return B.slide})),s(Tt)}function P(A,B){w(B).forEach(A)}function H(A){return p.filter(ps(A)?A:function(B){return In(A)?Ri(B.slide,A):Ar(Vi(A),B.index)})}function I(A,B,V){P(function(ne){ne.style(A,B,V)})}function E(A,B){var V=Fr(A,"img"),ne=V.length;ne?V.forEach(function(ce){a(ce,"load error",function(){--ne||B()})}):B()}function Z(A){return A?c.length:p.length}function v(){return p.length>n.perPage}return{mount:R,destroy:L,update:g,register:y,get:w,getIn:$,getAt:S,add:C,remove:k,forEach:P,filter:H,style:I,getLength:Z,isEnough:v}}function Ec(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.emit,u=t.Slides,c=t.Direction.resolve,m=t.Elements,p=m.root,R=m.track,x=m.list,L=u.getAt,g=u.style,y,w,$;function S(){C(),s(window,"resize load",lc(mt(a,ci))),o([Nt,Tt],C),o(ci,k)}function C(){y=n.direction===jo,Jt(p,"maxWidth",Hn(n.width)),Jt(R,c("paddingLeft"),P(!1)),Jt(R,c("paddingRight"),P(!0)),k(!0)}function k(_){var N=Vt(p);(_||w.width!==N.width||w.height!==N.height)&&(Jt(R,"height",H()),g(c("marginRight"),Hn(n.gap)),g("width",E()),g("height",Z(),!0),w=N,a(Fo),$!==($=j())&&(gn(p,qs,$),a(ac,$)))}function P(_){var N=n.padding,T=c(_?"right":"left");return N&&Hn(N[T]||(Ii(N)?0:N))||"0px"}function H(){var _="";return y&&(_=I(),Ci(_,"height or heightRatio is missing."),_="calc("+_+" - "+P(!1)+" - "+P(!0)+")"),_}function I(){return Hn(n.height||Vt(x).width*n.heightRatio)}function E(){return n.autoWidth?null:Hn(n.fixedWidth)||(y?"":v())}function Z(){return Hn(n.fixedHeight)||(y?n.autoHeight?null:v():I())}function v(){var _=Hn(n.gap);return"calc((100%"+(_&&" + "+_)+")/"+(n.perPage||1)+(_&&" - "+_)+")"}function A(){return Vt(x)[c("width")]}function B(_,N){var T=L(_||0);return T?Vt(T.slide)[c("width")]+(N?0:ce()):0}function V(_,N){var T=L(_);if(T){var K=Vt(T.slide)[c("right")],Y=Vt(x)[c("left")];return jt(K-Y)+(N?0:ce())}return 0}function ne(_){return V(e.length-1)-V(0)+B(0,_)}function ce(){var _=L(0);return _&&parseFloat(Jt(_.slide,c("marginRight")))||0}function X(_){return parseFloat(Jt(R,c("padding"+(_?"Right":"Left"))))||0}function j(){return e.is(Ui)||ne(!0)>A()}return{mount:S,resize:k,listSize:A,slideSize:B,sliderSize:ne,totalSize:V,getPadding:X,isOverflow:j}}var Pc=2;function Ic(e,t,n){var i=bt(e),o=i.on,s=t.Elements,a=t.Slides,u=t.Direction.resolve,c=[],m;function p(){o(Tt,R),o([Nt,ci],L),(m=w())&&(g(m),t.Layout.resize(!0))}function R(){x(),p()}function x(){Kn(c),bn(c),i.destroy()}function L(){var $=w();m!==$&&(m<$||!$)&&i.emit(Tt)}function g($){var S=a.get().slice(),C=S.length;if(C){for(;S.length<$;)bo(S,S);bo(S.slice(-$),S.slice(0,$)).forEach(function(k,P){var H=P<$,I=y(k.slide,P);H?_r(I,S[0].slide):Di(s.list,I),bo(c,I),a.register(I,P-$+(H?0:C),k.index)})}}function y($,S){var C=$.cloneNode(!0);return on(C,n.classes.clone),C.id=e.root.id+"-clone"+Nr(S+1),C}function w(){var $=n.clones;if(!e.is(xi))$=0;else if(zi($)){var S=n[u("fixedWidth")]&&t.Layout.slideSize(0),C=S&&_i(Vt(s.track)[u("width")]/S);$=C||n[u("autoWidth")]&&e.length||n.perPage*Pc}return $}return{mount:p,destroy:x}}function Rc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=e.state.set,u=t.Layout,c=u.slideSize,m=u.getPadding,p=u.totalSize,R=u.listSize,x=u.sliderSize,L=t.Direction,g=L.resolve,y=L.orient,w=t.Elements,$=w.list,S=w.track,C;function k(){C=t.Transition,o([An,Fo,Nt,Tt],P)}function P(){t.Controller.isBusy()||(t.Scroll.cancel(),I(e.index),t.Slides.update())}function H(T,K,Y,Q){T!==K&&_(T>Y)&&(A(),E(v(ne(),T>Y),!0)),a(vi),s(xn,K,Y,T),C.start(K,function(){a(li),s(bi,K,Y,T),Q&&Q()})}function I(T){E(V(T,!0))}function E(T,K){if(!e.is(Ui)){var Y=K?T:Z(T);Jt($,"transform","translate"+g("X")+"("+Y+"px)"),T!==Y&&s(As)}}function Z(T){if(e.is(xi)){var K=B(T),Y=K>t.Controller.getEnd(),Q=K<0;(Q||Y)&&(T=v(T,Y))}return T}function v(T,K){var Y=T-j(K),Q=x();return T-=y(Q*(_i(jt(Y)/Q)||1))*(K?1:-1),T}function A(){E(ne(),!0),C.cancel()}function B(T){for(var K=t.Slides.get(),Y=0,Q=1/0,O=0;O<K.length;O++){var oe=K[O].index,h=jt(V(oe,!0)-T);if(h<=Q)Q=h,Y=oe;else break}return Y}function V(T,K){var Y=y(p(T-1)-X(T));return K?ce(Y):Y}function ne(){var T=g("left");return Vt($)[T]-Vt(S)[T]+y(m(!1))}function ce(T){return n.trimSpace&&e.is(di)&&(T=ni(T,0,y(x(!0)-R()))),T}function X(T){var K=n.focus;return K==="center"?(R()-c(T,!0))/2:+K*c(T)||0}function j(T){return V(T?t.Controller.getEnd():0,!!n.trimSpace)}function _(T){var K=y(v(ne(),T));return T?K>=0:K<=$[g("scrollWidth")]-Vt(S)[g("width")]}function N(T,K){K=zi(K)?ne():K;var Y=T!==!0&&y(K)<y(j(!1)),Q=T!==!1&&y(K)>y(j(!0));return Y||Q}return{mount:k,move:H,jump:I,translate:E,shift:v,cancel:A,toIndex:B,toPosition:V,getPosition:ne,getLimit:j,exceededLimit:N,reposition:P}}function Mc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=t.Move,u=a.getPosition,c=a.getLimit,m=a.toPosition,p=t.Slides,R=p.isEnough,x=p.getLength,L=n.omitEnd,g=e.is(xi),y=e.is(di),w=mt(ne,!1),$=mt(ne,!0),S=n.start||0,C,k=S,P,H,I;function E(){Z(),o([Nt,Tt,Io],Z),o(Fo,v)}function Z(){P=x(!0),H=n.perMove,I=n.perPage,C=_();var h=ni(S,0,L?C:P-1);h!==S&&(S=h,a.reposition())}function v(){C!==_()&&s(Io)}function A(h,ae,ye){if(!oe()){var ve=V(h),Me=j(ve);Me>-1&&(ae||Me!==S)&&(Y(Me),a.move(ve,Me,k,ye))}}function B(h,ae,ye,ve){t.Scroll.scroll(h,ae,ye,function(){var Me=j(a.toIndex(u()));Y(L?Rn(Me,C):Me),ve&&ve()})}function V(h){var ae=S;if(In(h)){var ye=h.match(/([+\-<>])(\d+)?/)||[],ve=ye[1],Me=ye[2];ve==="+"||ve==="-"?ae=ce(S+ +(""+ve+(+Me||1)),S):ve===">"?ae=Me?N(+Me):w(!0):ve==="<"&&(ae=$(!0))}else ae=g?h:ni(h,0,C);return ae}function ne(h,ae){var ye=H||(O()?1:I),ve=ce(S+ye*(h?-1:1),S,!(H||O()));return ve===-1&&y&&!vs(u(),c(!h),1)?h?0:C:ae?ve:j(ve)}function ce(h,ae,ye){if(R()||O()){var ve=X(h);ve!==h&&(ae=h,h=ve,ye=!1),h<0||h>C?!H&&(xo(0,h,ae,!0)||xo(C,ae,h,!0))?h=N(T(h)):g?h=ye?h<0?-(P%I||I):P:h:n.rewind?h=h<0?C:0:h=-1:ye&&h!==ae&&(h=N(T(ae)+(h<ae?-1:1)))}else h=-1;return h}function X(h){if(y&&n.trimSpace==="move"&&h!==S)for(var ae=u();ae===m(h,!0)&&xo(h,0,e.length-1,!n.rewind);)h<S?--h:++h;return h}function j(h){return g?(h+P)%P||0:h}function _(){for(var h=P-(O()||g&&H?1:I);L&&h-- >0;)if(m(P-1,!0)!==m(h,!0)){h++;break}return ni(h,0,P-1)}function N(h){return ni(O()?h:I*h,0,C)}function T(h){return O()?Rn(h,C):Po((h>=C?P-1:h)/I)}function K(h){var ae=a.toIndex(h);return y?ni(ae,0,C):ae}function Y(h){h!==S&&(k=S,S=h)}function Q(h){return h?k:S}function O(){return!zi(n.focus)||n.isNavigation}function oe(){return e.state.is([vi,ji])&&!!n.waitForTransition}return{mount:E,go:A,scroll:B,getNext:w,getPrev:$,getAdjacent:ne,getEnd:_,setIndex:Y,getIndex:Q,toIndex:N,toPage:T,toDest:K,hasFocus:O,isBusy:oe}}var kc="http://www.w3.org/2000/svg",Ac="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",to=40;function _c(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.emit,u=n.classes,c=n.i18n,m=t.Elements,p=t.Controller,R=m.arrows,x=m.track,L=R,g=m.prev,y=m.next,w,$,S={};function C(){P(),o(Nt,k)}function k(){H(),C()}function P(){var B=n.arrows;B&&!(g&&y)&&Z(),g&&y&&(ki(S,{prev:g,next:y}),Ai(L,B?"":"none"),on(L,$=Gr+"--"+n.direction),B&&(I(),A(),Ne([g,y],Gi,x.id),a(Es,g,y)))}function H(){i.destroy(),hn(L,$),w?(Kn(R?[g,y]:L),g=y=null):rn([g,y],Kr)}function I(){o([An,bi,Tt,Un,Io],A),s(y,"click",mt(E,">")),s(g,"click",mt(E,"<"))}function E(B){p.go(B,!0)}function Z(){L=R||ai("div",u.arrows),g=v(!0),y=v(!1),w=!0,Di(L,[g,y]),!R&&_r(L,x)}function v(B){var V='<button class="'+u.arrow+" "+(B?u.prev:u.next)+'" type="button"><svg xmlns="'+kc+'" viewBox="0 0 '+to+" "+to+'" width="'+to+'" height="'+to+'" focusable="false"><path d="'+(n.arrowPath||Ac)+'" />';return fs(V)}function A(){if(g&&y){var B=e.index,V=p.getPrev(),ne=p.getNext(),ce=V>-1&&B<V?c.last:c.prev,X=ne>-1&&B>ne?c.first:c.next;g.disabled=V<0,y.disabled=ne<0,Ne(g,Dt,ce),Ne(y,Dt,X),a(Ps,g,y,V,ne)}}return{arrows:S,mount:C,destroy:H,update:A}}var Fc=Wr+"-interval";function Wc(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.emit,u=No(n.interval,e.go.bind(e,">"),I),c=u.isPaused,m=t.Elements,p=t.Elements,R=p.root,x=p.toggle,L=n.autoplay,g,y,w=L==="pause";function $(){L&&(S(),x&&Ne(x,Gi,m.track.id),w||C(),H())}function S(){n.pauseOnHover&&s(R,"mouseenter mouseleave",function(Z){g=Z.type==="mouseenter",P()}),n.pauseOnFocus&&s(R,"focusin focusout",function(Z){y=Z.type==="focusin",P()}),x&&s(x,"click",function(){w?C():k(!0)}),o([xn,Wo,Tt],u.rewind),o(xn,E)}function C(){c()&&t.Slides.isEnough()&&(u.start(!n.resetProgress),y=g=w=!1,H(),a(jr))}function k(Z){Z===void 0&&(Z=!0),w=!!Z,H(),c()||(u.pause(),a(zr))}function P(){w||(g||y?k(!1):C())}function H(){x&&(gn(x,Gn,!w),Ne(x,Dt,n.i18n[w?"play":"pause"]))}function I(Z){var v=m.bar;v&&Jt(v,"width",Z*100+"%"),a(Ms,Z)}function E(Z){var v=t.Slides.getAt(Z);u.set(v&&+Zt(v.slide,Fc)||n.interval)}return{mount:$,destroy:u.cancel,play:C,pause:k,isPaused:c}}function Nc(e,t,n){var i=bt(e),o=i.on;function s(){n.cover&&(o(Vr,mt(u,!0)),o([An,Nt,Tt],mt(a,!0)))}function a(c){t.Slides.forEach(function(m){var p=qi(m.container||m.slide,"img");p&&p.src&&u(c,p,m)})}function u(c,m,p){p.style("background",c?'center/cover no-repeat url("'+m.src+'")':"",!0),Ai(m,c?"none":"")}return{mount:s,destroy:mt(a,!1)}}var Hc=10,Oc=600,Bc=.6,jc=1.5,zc=800;function Vc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=e.state.set,u=t.Move,c=u.getPosition,m=u.getLimit,p=u.exceededLimit,R=u.translate,x=e.is(di),L,g,y=1;function w(){o(xn,k),o([Nt,Tt],P)}function $(I,E,Z,v,A){var B=c();if(k(),Z&&(!x||!p())){var V=t.Layout.sliderSize(),ne=xr(I)*V*Po(jt(I)/V)||0;I=u.toPosition(t.Controller.toDest(I%V))+ne}var ce=vs(B,I,1);y=1,E=ce?0:E||Eo(jt(I-B)/jc,zc),g=v,L=No(E,S,mt(C,B,I,A),1),a(ji),s(Wo),L.start()}function S(){a(li),g&&g(),s(Un)}function C(I,E,Z,v){var A=c(),B=I+(E-I)*H(v),V=(B-A)*y;R(A+V),x&&!Z&&p()&&(y*=Bc,jt(V)<Hc&&$(m(p(!0)),Oc,!1,g,!0))}function k(){L&&L.cancel()}function P(){L&&!L.isPaused()&&(k(),S())}function H(I){var E=n.easingFunc;return E?E(I):1-Math.pow(1-I,4)}return{mount:w,destroy:k,scroll:$,cancel:P}}var ii={passive:!1,capture:!0};function Dc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=i.bind,u=i.unbind,c=e.state,m=t.Move,p=t.Scroll,R=t.Controller,x=t.Elements.track,L=t.Media.reduce,g=t.Direction,y=g.resolve,w=g.orient,$=m.getPosition,S=m.exceededLimit,C,k,P,H,I,E=!1,Z,v,A;function B(){a(x,ir,vr,ii),a(x,or,vr,ii),a(x,Ks,ne,ii),a(x,"click",j,{capture:!0}),a(x,"dragstart",mn),o([An,Nt],V)}function V(){var ee=n.drag;ge(!ee),H=ee==="free"}function ne(ee){if(Z=!1,!v){var J=Me(ee);ve(ee.target)&&(J||!ee.button)&&(R.isBusy()?mn(ee,!0):(A=J?x:window,I=c.is([vi,ji]),P=null,a(A,ir,ce,ii),a(A,or,X,ii),m.cancel(),p.cancel(),_(ee)))}}function ce(ee){if(c.is(vo)||(c.set(vo),s(Cs)),ee.cancelable)if(I){m.translate(C+ye(O(ee)));var J=oe(ee)>va,D=E!==(E=S());(J||D)&&_(ee),Z=!0,s(Ts),mn(ee)}else K(ee)&&(I=T(ee),mn(ee))}function X(ee){c.is(vo)&&(c.set(li),s(Ls)),I&&(N(ee),mn(ee)),u(A,ir,ce),u(A,or,X),I=!1}function j(ee){!v&&Z&&mn(ee,!0)}function _(ee){P=k,k=ee,C=$()}function N(ee){var J=Y(ee),D=Q(J),he=n.rewind&&n.rewindByDrag;L(!1),H?R.scroll(D,0,n.snap):e.is(Ui)?R.go(w(xr(J))<0?he?"<":"-":he?">":"+"):e.is(di)&&E&&he?R.go(S(!0)?">":"<"):R.go(R.toDest(D),!0),L(!0)}function T(ee){var J=n.dragMinThreshold,D=Ii(J),he=D&&J.mouse||0,re=(D?J.touch:+J)||10;return jt(O(ee))>(Me(ee)?re:he)}function K(ee){return jt(O(ee))>jt(O(ee,!0))}function Y(ee){if(e.is(xi)||!E){var J=oe(ee);if(J&&J<va)return O(ee)/J}return 0}function Q(ee){return $()+xr(ee)*Rn(jt(ee)*(n.flickPower||600),H?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function O(ee,J){return ae(ee,J)-ae(h(ee),J)}function oe(ee){return br(ee)-br(h(ee))}function h(ee){return k===ee&&P||k}function ae(ee,J){return(Me(ee)?ee.changedTouches[0]:ee)["page"+y(J?"Y":"X")]}function ye(ee){return ee/(E&&e.is(di)?Sc:1)}function ve(ee){var J=n.noDrag;return!Ri(ee,"."+js+", ."+Vo)&&(!J||!Ri(ee,J))}function Me(ee){return typeof TouchEvent<"u"&&ee instanceof TouchEvent}function ie(){return I}function ge(ee){v=ee}return{mount:B,disable:ge,isDragging:ie}}var qc={Spacebar:" ",Right:Bo,Left:Oo,Up:_s,Down:Fs};function Ur(e){return e=In(e)?e:e.key,qc[e]||e}var ba="keydown";function Kc(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.unbind,u=e.root,c=t.Direction.resolve,m,p;function R(){x(),o(Nt,L),o(Nt,x),o(xn,y)}function x(){var $=n.keyboard;$&&(m=$==="global"?window:u,s(m,ba,w))}function L(){a(m,ba)}function g($){p=$}function y(){var $=p;p=!0,us(function(){p=$})}function w($){if(!p){var S=Ur($);S===c(Oo)?e.go("<"):S===c(Bo)&&e.go(">")}}return{mount:R,destroy:L,disable:g}}var Ti=Wr+"-lazy",wo=Ti+"-srcset",Gc="["+Ti+"], ["+wo+"]";function Uc(e,t,n){var i=bt(e),o=i.on,s=i.off,a=i.bind,u=i.emit,c=n.lazyLoad==="sequential",m=[bi,Un],p=[];function R(){n.lazyLoad&&(x(),o(Tt,x))}function x(){bn(p),L(),c?$():(s(m),o(m,g),g())}function L(){t.Slides.forEach(function(S){Fr(S.slide,Gc).forEach(function(C){var k=Zt(C,Ti),P=Zt(C,wo);if(k!==C.src||P!==C.srcset){var H=n.classes.spinner,I=C.parentElement,E=qi(I,"."+H)||ai("span",H,I);p.push([C,S,E]),C.src||Ai(C,"none")}})})}function g(){p=p.filter(function(S){var C=n.perPage*((n.preloadPages||1)+1)-1;return S[1].isWithin(e.index,C)?y(S):!0}),p.length||s(m)}function y(S){var C=S[0];on(S[1].slide,Cr),a(C,"load error",mt(w,S)),Ne(C,"src",Zt(C,Ti)),Ne(C,"srcset",Zt(C,wo)),rn(C,Ti),rn(C,wo)}function w(S,C){var k=S[0],P=S[1];hn(P.slide,Cr),C.type!=="error"&&(Kn(S[2]),Ai(k,""),u(Vr,k,P),u(ci)),c&&$()}function $(){p.length&&y(p.shift())}return{mount:R,destroy:mt(bn,p),check:g}}function Xc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=i.bind,u=t.Slides,c=t.Elements,m=t.Controller,p=m.hasFocus,R=m.getIndex,x=m.go,L=t.Direction.resolve,g=c.pagination,y=[],w,$;function S(){C(),o([Nt,Tt,Io],S);var v=n.pagination;g&&Ai(g,v?"":"none"),v&&(o([xn,Wo,Un],Z),k(),Z(),s(Is,{list:w,items:y},E(e.index)))}function C(){w&&(Kn(g?kn(w.children):w),hn(w,$),bn(y),w=null),i.destroy()}function k(){var v=e.length,A=n.classes,B=n.i18n,V=n.perPage,ne=p()?m.getEnd()+1:_i(v/V);w=g||ai("ul",A.pagination,c.track.parentElement),on(w,$=Do+"--"+I()),Ne(w,fn,"tablist"),Ne(w,Dt,B.select),Ne(w,qr,I()===jo?"vertical":"");for(var ce=0;ce<ne;ce++){var X=ai("li",null,w),j=ai("button",{class:A.page,type:"button"},X),_=u.getIn(ce).map(function(T){return T.slide.id}),N=!p()&&V>1?B.pageX:B.slideX;a(j,"click",mt(P,ce)),n.paginationKeyboard&&a(j,"keydown",mt(H,ce)),Ne(X,fn,"presentation"),Ne(j,fn,"tab"),Ne(j,Gi,_.join(" ")),Ne(j,Dt,wr(N,ce+1)),Ne(j,si,-1),y.push({li:X,button:j,page:ce})}}function P(v){x(">"+v,!0)}function H(v,A){var B=y.length,V=Ur(A),ne=I(),ce=-1;V===L(Bo,!1,ne)?ce=++v%B:V===L(Oo,!1,ne)?ce=(--v+B)%B:V==="Home"?ce=0:V==="End"&&(ce=B-1);var X=y[ce];X&&(hs(X.button),x(">"+ce),mn(A,!0))}function I(){return n.paginationDirection||n.direction}function E(v){return y[m.toPage(v)]}function Z(){var v=E(R(!0)),A=E(R());if(v){var B=v.button;hn(B,Gn),rn(B,ma),Ne(B,si,-1)}if(A){var V=A.button;on(V,Gn),Ne(V,ma,!0),Ne(V,si,"")}s(Rs,{list:w,items:y},v,A)}return{items:y,mount:S,destroy:C,getAt:E,update:Z}}var Yc=[" ","Enter"];function Jc(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function a(){e.splides.forEach(function(g){g.isParent||(m(e,g.splide),m(g.splide,e))}),i&&p()}function u(){s.forEach(function(g){g.destroy()}),bn(s)}function c(){u(),a()}function m(g,y){var w=bt(g);w.on(xn,function($,S,C){y.go(y.is(xi)?C:$)}),s.push(w)}function p(){var g=bt(e),y=g.on;y(Hr,x),y(ks,L),y([An,Nt],R),s.push(g),g.emit(Br,e.splides)}function R(){Ne(t.Elements.list,qr,n.direction===jo?"vertical":"")}function x(g){e.go(g.index)}function L(g,y){Ar(Yc,Ur(y))&&(x(g),mn(y))}return{setup:mt(t.Media.set,{slideFocus:zi(o)?i:o},!0),mount:a,destroy:u,remount:c}}function Zc(e,t,n){var i=bt(e),o=i.bind,s=0;function a(){n.wheel&&o(t.Elements.track,"wheel",u,ii)}function u(m){if(m.cancelable){var p=m.deltaY,R=p<0,x=br(m),L=n.wheelMinThreshold||0,g=n.wheelSleep||0;jt(p)>L&&x-s>g&&(e.go(R?"<":">"),s=x),c(R)&&mn(m)}}function c(m){return!n.releaseWheel||e.state.is(vi)||t.Controller.getAdjacent(m)!==-1}return{mount:a}}var Qc=90;function ed(e,t,n){var i=bt(e),o=i.on,s=t.Elements.track,a=n.live&&!n.isNavigation,u=ai("span",vc),c=No(Qc,mt(p,!1));function m(){a&&(x(!t.Autoplay.isPaused()),Ne(s,fa,!0),u.textContent="…",o(jr,mt(x,!0)),o(zr,mt(x,!1)),o([bi,Un],mt(p,!0)))}function p(L){Ne(s,ha,L),L?(Di(s,u),c.start()):(Kn(u),c.cancel())}function R(){rn(s,[ga,fa,ha]),Kn(u)}function x(L){a&&Ne(s,ga,L?"off":"polite")}return{mount:m,disable:x,destroy:R}}var td=Object.freeze({__proto__:null,Media:cc,Direction:dc,Elements:Cc,Slides:Lc,Layout:Ec,Clones:Ic,Move:Rc,Controller:Mc,Arrows:_c,Autoplay:Wc,Cover:Nc,Scroll:Vc,Drag:Dc,Keyboard:Kc,LazyLoad:Uc,Pagination:Xc,Sync:Jc,Wheel:Zc,Live:ed}),nd={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"},id={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:wc,i18n:nd,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function od(e,t,n){var i=t.Slides;function o(){bt(e).on([An,Tt],s)}function s(){i.forEach(function(u){u.style("transform","translateX(-"+100*u.index+"%)")})}function a(u,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),us(c)}return{mount:o,start:a,cancel:vr}}function rd(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,a=t.Elements.list,u=mt(Jt,a,"transition"),c;function m(){bt(e).bind(a,"transitionend",function(L){L.target===a&&c&&(R(),c())})}function p(L,g){var y=i.toPosition(L,!0),w=i.getPosition(),$=x(L);jt(y-w)>=1&&$>=1?n.useScroll?s.scroll(y,$,!1,g):(u("transform "+$+"ms "+n.easing),i.translate(y,!0),c=g):(i.jump(L),g())}function R(){u(""),s.cancel()}function x(L){var g=n.rewindSpeed;if(e.is(di)&&g){var y=o.getIndex(!0),w=o.getEnd();if(y===0&&L>=w||y>=w&&L===0)return g}return n.speed}return{mount:m,start:p,cancel:R}}var ad=(function(){function e(n,i){this.event=bt(),this.Components={},this.state=sc(ri),this.splides=[],this._o={},this._E={};var o=In(n)?ys(document,n):n;Ci(o,o+" is invalid."),this.root=o,i=Pn({label:Zt(o,Dt)||"",labelledby:Zt(o,Dr)||""},id,e.defaults,i||{});try{Pn(i,JSON.parse(Zt(o,Wr)))}catch{Ci(!1,"Invalid JSON")}this._o=Object.create(Pn({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,a=this.state,u=this.Components;Ci(a.is([ri,Lo]),"Already mounted!"),a.set(ri),this._C=u,this._T=o||this._T||(this.is(Ui)?od:rd),this._E=i||this._E;var c=ki({},td,this._E,{Transition:this._T});return qn(c,function(m,p){var R=m(s,u,s._o);u[p]=R,R.setup&&R.setup()}),qn(u,function(m){m.mount&&m.mount()}),this.emit(An),on(this.root,bc),a.set(li),this.emit($r),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(li)&&(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(kn(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(Tt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,s=this.state;return s.is(ri)?bt(this).on($r,this.destroy.bind(this,i)):(qn(this._C,function(a){a.destroy&&a.destroy(i)},!0),o.emit(Or),o.destroy(),i&&bn(this.splides),s.set(Lo)),this},nc(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})(),Xr=ad;Xr.defaults={};Xr.STATES=oc;var xa=[[An,"onMounted"],[$r,"onReady"],[xn,"onMove"],[bi,"onMoved"],[Hr,"onClick"],[xs,"onActive"],[ws,"onInactive"],[$s,"onVisible"],[Ss,"onHidden"],[Tt,"onRefresh"],[Nt,"onUpdated"],[ci,"onResize"],[Fo,"onResized"],[Cs,"onDrag"],[Ts,"onDragging"],[Ls,"onDragged"],[Wo,"onScroll"],[Un,"onScrolled"],[Or,"onDestroy"],[Es,"onArrowsMounted"],[Ps,"onArrowsUpdated"],[Is,"onPaginationMounted"],[Rs,"onPaginationUpdated"],[Br,"onNavigationMounted"],[jr,"onAutoplayPlay"],[Ms,"onAutoplayPlaying"],[zr,"onAutoplayPause"],[Vr,"onLazyLoadLoaded"]];function Yr(...e){return e.filter(Boolean).join(" ")}function Ro(e){return e!==null&&typeof e=="object"}function Tr(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Tr(n,t[i]));if(Ro(e)&&Ro(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Tr(e[o],t[o]))}return e===t}function sd(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function ld(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 Lr(e,t){const n=e;return ld(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Ro(i)?n[o]=Lr(Ro(n[o])?n[o]:{},i):n[o]=i}),n}var cd=({children:e,className:t,...n})=>l.createElement("div",{className:Yr("splide__track",t),...n},l.createElement("ul",{className:"splide__list"},e)),Jr=class extends l.Component{constructor(){super(...arguments),this.splideRef=l.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Xr(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Lr({},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&&!Tr(this.options,e)&&(this.splide.options=e,this.options=Lr({},e));const t=this.getSlides();sd(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){xa.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 l.createElement(t,{className:Yr("splide",e),ref:this.splideRef,...this.omit(o,["options",...xa.map(s=>s[1])])},n?l.createElement(cd,null,i):i)}},Zr=({children:e,className:t,...n})=>l.createElement("li",{className:Yr("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("react"),Je=require("classnames"),L=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Bi=require("react-dom");function al(e){return e.type==="object"&&e.version===1}const sl="ControlSlider-module__wrapper___sHEkd",ll="ControlSlider-module__hoverArrow___A-dOH",cl="ControlSlider-module__sliderItem___QQSkR",dl="ControlSlider-module__sliderImage___9hRl-",ul="ControlSlider-module__arrow___05ghY",pl="ControlSlider-module__arrowVertical___tBfVN",ml="ControlSlider-module__nextArrow___-30Yc",gl="ControlSlider-module__arrowInner___aEra3",hl="ControlSlider-module__arrowIcon___S4ztF",fl="ControlSlider-module__arrowImg___2dwJW",yl="ControlSlider-module__mirror___brd6U",vl="ControlSlider-module__pagination___bicLF",bl="ControlSlider-module__paginationInner___bT-P-",xl="ControlSlider-module__paginationVertical___zYqKw",wl="ControlSlider-module__paginationItem___nTRbk",$l="ControlSlider-module__dot___p1Qun",Sl="ControlSlider-module__activeDot___LHFaj",Cl="ControlSlider-module__paginationInsideBottom___R3FWn",Tl="ControlSlider-module__paginationInsideTop___V-qb-",Ll="ControlSlider-module__paginationOutsideBottom___14w8D",El="ControlSlider-module__paginationOutsideTop___SCLqB",Pl="ControlSlider-module__paginationInsideLeft___yOBRZ",Il="ControlSlider-module__paginationInsideRight___Rtt3o",Rl="ControlSlider-module__paginationOutsideLeft___lahaw",Al="ControlSlider-module__paginationOutsideRight___EtuQa",kl="ControlSlider-module__imgWrapper___UjEgB",Ml="ControlSlider-module__captionBlock___dJ6-j",_l="ControlSlider-module__captionTextWrapper___HFlpf",Fl="ControlSlider-module__captionText___uGBVc",Wl="ControlSlider-module__active___WZK4G",Nl="ControlSlider-module__withPointerEvents___t-18M",Hl="ControlSlider-module__topLeftAlignment___zjnGM",Ol="ControlSlider-module__topCenterAlignment___gD1xW",Bl="ControlSlider-module__topRightAlignment___NMapS",jl="ControlSlider-module__middleLeftAlignment___OnUrY",zl="ControlSlider-module__middleCenterAlignment___Tdkl0",Vl="ControlSlider-module__middleRightAlignment___wEbfX",Dl="ControlSlider-module__bottomLeftAlignment___cTP2-",ql="ControlSlider-module__bottomCenterAlignment___c54fB",Kl="ControlSlider-module__bottomRightAlignment___kEwrz",Gl="ControlSlider-module__clickOverlay___DZA28",Ul="ControlSlider-module__contain___pLyq7",Xl="ControlSlider-module__cover___KdDat",Ee={wrapper:sl,hoverArrow:ll,sliderItem:cl,sliderImage:dl,arrow:ul,arrowVertical:pl,nextArrow:ml,arrowInner:gl,arrowIcon:hl,arrowImg:fl,mirror:yl,pagination:vl,paginationInner:bl,paginationVertical:xl,paginationItem:wl,dot:$l,activeDot:Sl,paginationInsideBottom:Cl,paginationInsideTop:Tl,paginationOutsideBottom:Ll,paginationOutsideTop:El,paginationInsideLeft:Pl,paginationInsideRight:Il,paginationOutsideLeft:Rl,paginationOutsideRight:Al,imgWrapper:kl,captionBlock:Ml,captionTextWrapper:_l,captionText:Fl,active:Wl,withPointerEvents:Nl,topLeftAlignment:Hl,topCenterAlignment:Ol,topRightAlignment:Bl,middleLeftAlignment:jl,middleCenterAlignment:zl,middleRightAlignment:Vl,bottomLeftAlignment:Dl,bottomCenterAlignment:ql,bottomRightAlignment:Kl,clickOverlay:Gl,contain:Ul,cover:Xl};function Yl(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 Jl(e,t,n){return t&&Yl(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ra="(prefers-reduced-motion: reduce)",ri=1,Zl=2,li=3,vi=4,ji=5,vo=6,Lo=7,Ql={CREATED:ri,MOUNTED:Zl,IDLE:li,MOVING:vi,SCROLLING:ji,DRAGGING:vo,DESTROYED:Lo};function bn(e){e.length=0}function kn(e,t,n){return Array.prototype.slice.call(e,t,n)}function mt(e){return e.bind.apply(e,[null].concat(kn(arguments,1)))}var ss=setTimeout,yr=function(){};function aa(e){return requestAnimationFrame(e)}function Mo(e,t){return typeof t===e}function Ii(e){return!Rr(e)&&Mo("object",e)}var Ir=Array.isArray,ls=mt(Mo,"function"),In=mt(Mo,"string"),zi=mt(Mo,"undefined");function Rr(e){return e===null}function cs(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Vi(e){return Ir(e)?e:[e]}function Gt(e,t){Vi(e).forEach(t)}function Ar(e,t){return e.indexOf(t)>-1}function bo(e,t){return e.push.apply(e,Vi(t)),e}function gn(e,t,n){e&&Gt(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function on(e,t){gn(e,In(t)?t.split(" "):t,!0)}function Di(e,t){Gt(t,e.appendChild.bind(e))}function kr(e,t){Gt(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Ri(e,t){return cs(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function ds(e,t){var n=e?kn(e.children):[];return t?n.filter(function(i){return Ri(i,t)}):n}function qi(e,t){return t?ds(e,t)[0]:e.firstElementChild}var Ai=Object.keys;function qn(e,t,n){return e&&(n?Ai(e).reverse():Ai(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function ki(e){return kn(arguments,1).forEach(function(t){qn(t,function(n,i){e[i]=t[i]})}),e}function Pn(e){return kn(arguments,1).forEach(function(t){qn(t,function(n,i){Ir(n)?e[i]=n.slice():Ii(n)?e[i]=Pn({},Ii(e[i])?e[i]:{},n):e[i]=n})}),e}function sa(e,t){Gt(t||Ai(e),function(n){delete e[n]})}function rn(e,t){Gt(e,function(n){Gt(t,function(i){n&&n.removeAttribute(i)})})}function Ne(e,t,n){Ii(t)?qn(t,function(i,o){Ne(e,o,i)}):Gt(e,function(i){Rr(n)||n===""?rn(i,t):i.setAttribute(t,String(n))})}function ai(e,t,n){var i=document.createElement(e);return t&&(In(t)?on(i,t):Ne(i,t)),n&&Di(n,i),i}function Jt(e,t,n){if(zi(n))return getComputedStyle(e)[t];Rr(n)||(e.style[t]=""+n)}function Mi(e,t){Jt(e,"display",t)}function us(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Zt(e,t){return e.getAttribute(t)}function la(e,t){return e&&e.classList.contains(t)}function Vt(e){return e.getBoundingClientRect()}function Kn(e){Gt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function ps(e){return qi(new DOMParser().parseFromString(e,"text/html").body)}function mn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ms(e,t){return e&&e.querySelector(t)}function Mr(e,t){return t?kn(e.querySelectorAll(t)):[]}function hn(e,t){gn(e,t,!1)}function vr(e){return e.timeStamp}function Hn(e){return In(e)?e:e?e+"px":""}var Ki="splide",_r="data-"+Ki;function Ci(e,t){if(!e)throw new Error("["+Ki+"] "+(t||""))}var Rn=Math.min,Eo=Math.max,Po=Math.floor,_i=Math.ceil,jt=Math.abs;function gs(e,t,n){return jt(e-t)<n}function xo(e,t,n,i){var o=Rn(t,n),s=Eo(t,n);return i?o<e&&e<s:o<=e&&e<=s}function ni(e,t,n){var i=Rn(t,n),o=Eo(t,n);return Rn(Eo(i,e),o)}function br(e){return+(e>0)-+(e<0)}function xr(e,t){return Gt(t,function(n){e=e.replace("%s",""+n)}),e}function Fr(e){return e<10?"0"+e:""+e}var ca={};function ec(e){return""+e+Fr(ca[e]=(ca[e]||0)+1)}function hs(){var e=[];function t(a,u,c,m){o(a,u,function(p,E,x){var C="addEventListener"in p,g=C?p.removeEventListener.bind(p,E,c,m):p.removeListener.bind(p,c);C?p.addEventListener(E,c,m):p.addListener(c),e.push([p,E,x,c,g])})}function n(a,u,c){o(a,u,function(m,p,E){e=e.filter(function(x){return x[0]===m&&x[1]===p&&x[2]===E&&(!c||x[3]===c)?(x[4](),!1):!0})})}function i(a,u,c){var m,p=!0;return typeof CustomEvent=="function"?m=new CustomEvent(u,{bubbles:p,detail:c}):(m=document.createEvent("CustomEvent"),m.initCustomEvent(u,p,!1,c)),a.dispatchEvent(m),m}function o(a,u,c){Gt(a,function(m){m&&Gt(u,function(p){p.split(" ").forEach(function(E){var x=E.split(".");c(m,x[0],x[1])})})})}function s(){e.forEach(function(a){a[4]()}),bn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var Mn="mounted",wr="ready",xn="move",bi="moved",Wr="click",fs="active",ys="inactive",vs="visible",bs="hidden",Tt="refresh",Nt="updated",ci="resize",_o="resized",xs="drag",ws="dragging",$s="dragged",Fo="scroll",Un="scrolled",tc="overflow",Nr="destroy",Ss="arrows:mounted",Cs="arrows:updated",Ts="pagination:mounted",Ls="pagination:updated",Hr="navigation:mounted",Or="autoplay:play",Es="autoplay:playing",Br="autoplay:pause",jr="lazyload:loaded",Ps="sk",Is="sh",Io="ei";function bt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=hs();function i(s,a){n.bind(t,Vi(s).join(" "),function(u){a.apply(a,Ir(u.detail)?u.detail:[])})}function o(s){n.dispatch(t,s,kn(arguments,1))}return e&&e.event.on(Nr,n.destroy),ki(n,{bus:t,on:i,off:mt(n.unbind,t),emit:o})}function Wo(e,t,n,i){var o=Date.now,s,a=0,u,c=!0,m=0;function p(){if(!c){if(a=e?Rn((o()-s)/e,1):1,n&&n(a),a>=1&&(t(),s=o(),i&&++m>=i))return x();u=aa(p)}}function E(w){w||g(),s=o()-(w?a*e:0),c=!1,u=aa(p)}function x(){c=!0}function C(){s=o(),a=0,n&&n(a)}function g(){u&&cancelAnimationFrame(u),a=0,u=0,c=!0}function v(w){e=w}function T(){return c}return{start:E,rewind:C,pause:x,cancel:g,set:v,isPaused:T}}function nc(e){var t=e;function n(o){t=o}function i(o){return Ar(Vi(o),t)}return{set:n,is:i}}function ic(e,t){var n=Wo(0,e,null,1);return function(){n.isPaused()&&n.start()}}function oc(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},a=hs(),u=[];function c(){var g=n.mediaQuery==="min";Ai(o).sort(function(v,T){return g?+v-+T:+T-+v}).forEach(function(v){p(o[v],"("+(g?"min":"max")+"-width:"+v+"px)")}),p(s,ra),E()}function m(g){g&&a.destroy()}function p(g,v){var T=matchMedia(v);a.bind(T,"change",E),u.push([g,T])}function E(){var g=i.is(Lo),v=n.direction,T=u.reduce(function(w,$){return Pn(w,$[1].matches?$[0]:{})},{});sa(n),C(T),n.destroy?e.destroy(n.destroy==="completely"):g?(m(!0),e.mount()):v!==n.direction&&e.refresh()}function x(g){matchMedia(ra).matches&&(g?Pn(n,s):sa(n,Ai(s)))}function C(g,v,T){Pn(n,g),v&&Pn(Object.getPrototypeOf(n),g),(T||!i.is(ri))&&e.emit(Nt,n)}return{setup:c,destroy:m,reduce:x,set:C}}var No="Arrow",Ho=No+"Left",Oo=No+"Right",Rs=No+"Up",As=No+"Down",da="rtl",Bo="ttb",er={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Rs,Oo],ArrowRight:[As,Ho]};function rc(e,t,n){function i(s,a,u){u=u||n.direction;var c=u===da&&!a?1:u===Bo?0:-1;return er[s]&&er[s][c]||s.replace(/width|left|right/i,function(m,p){var E=er[m.toLowerCase()][c]||m;return p>0?E.charAt(0).toUpperCase()+E.slice(1):E})}function o(s){return s*(n.direction===da?1:-1)}return{resolve:i,orient:o}}var fn="role",si="tabindex",ac="disabled",en="aria-",Gi=en+"controls",ks=en+"current",ua=en+"selected",Dt=en+"label",zr=en+"labelledby",Ms=en+"hidden",Vr=en+"orientation",Fi=en+"roledescription",pa=en+"live",ma=en+"busy",ga=en+"atomic",Dr=[fn,si,ac,Gi,ks,Dt,zr,Ms,Vr,Fi],an=Ki+"__",_n="is-",tr=Ki,ha=an+"track",sc=an+"list",jo=an+"slide",_s=jo+"--clone",lc=jo+"__container",qr=an+"arrows",zo=an+"arrow",Fs=zo+"--prev",Ws=zo+"--next",Vo=an+"pagination",Ns=Vo+"__page",cc=an+"progress",dc=cc+"__bar",uc=an+"toggle",pc=an+"spinner",mc=an+"sr",gc=_n+"initialized",Gn=_n+"active",Hs=_n+"prev",Os=_n+"next",$r=_n+"visible",Sr=_n+"loading",Bs=_n+"focus-in",js=_n+"overflow",hc=[Gn,$r,Hs,Os,Sr,Bs,js],fc={slide:jo,clone:_s,arrows:qr,arrow:zo,prev:Fs,next:Ws,pagination:Vo,page:Ns,spinner:pc};function yc(e,t){if(ls(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Ri(n,t);)n=n.parentElement;return n}var vc=5,fa=200,zs="touchstart mousedown",nr="touchmove mousemove",ir="touchend touchcancel mouseup click";function bc(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=e.root,u=n.i18n,c={},m=[],p=[],E=[],x,C,g;function v(){S(),_(),$()}function T(){o(Tt,w),o(Tt,v),o(Nt,$),s(document,zs+" keydown",function(P){g=P.type==="keydown"},{capture:!0}),s(a,"focusin",function(){gn(a,Bs,!!g)})}function w(P){var R=Dr.concat("style");bn(m),hn(a,p),hn(x,E),rn([x,C],R),rn(a,P?R:["style",Fi])}function $(){hn(a,p),hn(x,E),p=F(tr),E=F(ha),on(a,p),on(x,E),Ne(a,Dt,n.label),Ne(a,zr,n.labelledby)}function S(){x=I("."+ha),C=qi(x,"."+sc),Ci(x&&C,"A track/list element is missing."),bo(m,ds(C,"."+jo+":not(."+_s+")")),qn({arrows:qr,pagination:Vo,prev:Fs,next:Ws,bar:dc,toggle:uc},function(P,R){c[R]=I("."+P)}),ki(c,{root:a,track:x,list:C,slides:m})}function _(){var P=a.id||ec(Ki),R=n.role;a.id=P,x.id=x.id||P+"-track",C.id=C.id||P+"-list",!Zt(a,fn)&&a.tagName!=="SECTION"&&R&&Ne(a,fn,R),Ne(a,Fi,u.carousel),Ne(C,fn,"presentation")}function I(P){var R=ms(a,P);return R&&yc(R,"."+tr)===a?R:void 0}function F(P){return[P+"--"+n.type,P+"--"+n.direction,n.drag&&P+"--draggable",n.isNavigation&&P+"--nav",P===tr&&Gn]}return ki(c,{setup:v,mount:T,destroy:w})}var di="slide",xi="loop",Ui="fade";function xc(e,t,n,i){var o=bt(e),s=o.on,a=o.emit,u=o.bind,c=e.Components,m=e.root,p=e.options,E=p.isNavigation,x=p.updateOnMove,C=p.i18n,g=p.pagination,v=p.slideFocus,T=c.Direction.resolve,w=Zt(i,"style"),$=Zt(i,Dt),S=n>-1,_=qi(i,"."+lc),I;function F(){S||(i.id=m.id+"-slide"+Fr(t+1),Ne(i,fn,g?"tabpanel":"group"),Ne(i,Fi,C.slide),Ne(i,Dt,$||xr(C.slideLabel,[t+1,e.length]))),P()}function P(){u(i,"click",mt(a,Wr,Z)),u(i,"keydown",mt(a,Ps,Z)),s([bi,Is,Un],M),s(Hr,Y),x&&s(xn,y)}function R(){I=!0,o.destroy(),hn(i,hc),rn(i,Dr),Ne(i,"style",w),Ne(i,Dt,$||"")}function Y(){var U=e.splides.map(function(B){var J=B.splide.Components.Slides.getAt(t);return J?J.slide.id:""}).join(" ");Ne(i,Dt,xr(C.slideX,(S?n:t)+1)),Ne(i,Gi,U),Ne(i,fn,v?"button":""),v&&rn(i,Fi)}function y(){I||M()}function M(){if(!I){var U=e.index;W(),D(),gn(i,Hs,t===U-1),gn(i,Os,t===U+1)}}function W(){var U=pe();U!==la(i,Gn)&&(gn(i,Gn,U),Ne(i,ks,E&&U||""),a(U?fs:ys,Z))}function D(){var U=K(),B=!U&&(!pe()||S);if(e.state.is([vi,ji])||Ne(i,Ms,B||""),Ne(Mr(i,p.focusableNodes||""),si,B?-1:""),v&&Ne(i,si,B?-1:0),U!==la(i,$r)&&(gn(i,$r,U),a(U?vs:bs,Z)),!U&&document.activeElement===i){var J=c.Slides.getAt(e.index);J&&us(J.slide)}}function te(U,B,J){Jt(J&&_||i,U,B)}function pe(){var U=e.index;return U===t||p.cloneStatus&&U===n}function K(){if(e.is(Ui))return pe();var U=Vt(c.Elements.track),B=Vt(i),J=T("left",!0),ie=T("right",!0);return Po(U[J])<=_i(B[J])&&Po(B[ie])<=_i(U[ie])}function H(U,B){var J=jt(U-t);return!S&&(p.rewind||e.is(xi))&&(J=Rn(J,e.length-J)),J<=B}var Z={index:t,slideIndex:n,slide:i,container:_,isClone:S,mount:F,destroy:R,update:M,style:te,isWithin:H};return Z}function wc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=i.bind,u=t.Elements,c=u.slides,m=u.list,p=[];function E(){x(),o(Tt,C),o(Tt,x)}function x(){c.forEach(function(M,W){v(M,W,-1)})}function C(){I(function(M){M.destroy()}),bn(p)}function g(){I(function(M){M.update()})}function v(M,W,D){var te=xc(e,W,D,M);te.mount(),p.push(te),p.sort(function(pe,K){return pe.index-K.index})}function T(M){return M?F(function(W){return!W.isClone}):p}function w(M){var W=t.Controller,D=W.toIndex(M),te=W.hasFocus()?1:n.perPage;return F(function(pe){return xo(pe.index,D,D+te-1)})}function $(M){return F(M)[0]}function S(M,W){Gt(M,function(D){if(In(D)&&(D=ps(D)),cs(D)){var te=c[W];te?kr(D,te):Di(m,D),on(D,n.classes.slide),R(D,mt(s,ci))}}),s(Tt)}function _(M){Kn(F(M).map(function(W){return W.slide})),s(Tt)}function I(M,W){T(W).forEach(M)}function F(M){return p.filter(ls(M)?M:function(W){return In(M)?Ri(W.slide,M):Ar(Vi(M),W.index)})}function P(M,W,D){I(function(te){te.style(M,W,D)})}function R(M,W){var D=Mr(M,"img"),te=D.length;te?D.forEach(function(pe){a(pe,"load error",function(){--te||W()})}):W()}function Y(M){return M?c.length:p.length}function y(){return p.length>n.perPage}return{mount:E,destroy:C,update:g,register:v,get:T,getIn:w,getAt:$,add:S,remove:_,forEach:I,filter:F,style:P,getLength:Y,isEnough:y}}function $c(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.emit,u=t.Slides,c=t.Direction.resolve,m=t.Elements,p=m.root,E=m.track,x=m.list,C=u.getAt,g=u.style,v,T,w;function $(){S(),s(window,"resize load",ic(mt(a,ci))),o([Nt,Tt],S),o(ci,_)}function S(){v=n.direction===Bo,Jt(p,"maxWidth",Hn(n.width)),Jt(E,c("paddingLeft"),I(!1)),Jt(E,c("paddingRight"),I(!0)),_(!0)}function _(Z){var U=Vt(p);(Z||T.width!==U.width||T.height!==U.height)&&(Jt(E,"height",F()),g(c("marginRight"),Hn(n.gap)),g("width",R()),g("height",Y(),!0),T=U,a(_o),w!==(w=H())&&(gn(p,js,w),a(tc,w)))}function I(Z){var U=n.padding,B=c(Z?"right":"left");return U&&Hn(U[B]||(Ii(U)?0:U))||"0px"}function F(){var Z="";return v&&(Z=P(),Ci(Z,"height or heightRatio is missing."),Z="calc("+Z+" - "+I(!1)+" - "+I(!0)+")"),Z}function P(){return Hn(n.height||Vt(x).width*n.heightRatio)}function R(){return n.autoWidth?null:Hn(n.fixedWidth)||(v?"":y())}function Y(){return Hn(n.fixedHeight)||(v?n.autoHeight?null:y():P())}function y(){var Z=Hn(n.gap);return"calc((100%"+(Z&&" + "+Z)+")/"+(n.perPage||1)+(Z&&" - "+Z)+")"}function M(){return Vt(x)[c("width")]}function W(Z,U){var B=C(Z||0);return B?Vt(B.slide)[c("width")]+(U?0:pe()):0}function D(Z,U){var B=C(Z);if(B){var J=Vt(B.slide)[c("right")],ie=Vt(x)[c("left")];return jt(J-ie)+(U?0:pe())}return 0}function te(Z){return D(e.length-1)-D(0)+W(0,Z)}function pe(){var Z=C(0);return Z&&parseFloat(Jt(Z.slide,c("marginRight")))||0}function K(Z){return parseFloat(Jt(E,c("padding"+(Z?"Right":"Left"))))||0}function H(){return e.is(Ui)||te(!0)>M()}return{mount:$,resize:_,listSize:M,slideSize:W,sliderSize:te,totalSize:D,getPadding:K,isOverflow:H}}var Sc=2;function Cc(e,t,n){var i=bt(e),o=i.on,s=t.Elements,a=t.Slides,u=t.Direction.resolve,c=[],m;function p(){o(Tt,E),o([Nt,ci],C),(m=T())&&(g(m),t.Layout.resize(!0))}function E(){x(),p()}function x(){Kn(c),bn(c),i.destroy()}function C(){var w=T();m!==w&&(m<w||!w)&&i.emit(Tt)}function g(w){var $=a.get().slice(),S=$.length;if(S){for(;$.length<w;)bo($,$);bo($.slice(-w),$.slice(0,w)).forEach(function(_,I){var F=I<w,P=v(_.slide,I);F?kr(P,$[0].slide):Di(s.list,P),bo(c,P),a.register(P,I-w+(F?0:S),_.index)})}}function v(w,$){var S=w.cloneNode(!0);return on(S,n.classes.clone),S.id=e.root.id+"-clone"+Fr($+1),S}function T(){var w=n.clones;if(!e.is(xi))w=0;else if(zi(w)){var $=n[u("fixedWidth")]&&t.Layout.slideSize(0),S=$&&_i(Vt(s.track)[u("width")]/$);w=S||n[u("autoWidth")]&&e.length||n.perPage*Sc}return w}return{mount:p,destroy:x}}function Tc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=e.state.set,u=t.Layout,c=u.slideSize,m=u.getPadding,p=u.totalSize,E=u.listSize,x=u.sliderSize,C=t.Direction,g=C.resolve,v=C.orient,T=t.Elements,w=T.list,$=T.track,S;function _(){S=t.Transition,o([Mn,_o,Nt,Tt],I)}function I(){t.Controller.isBusy()||(t.Scroll.cancel(),P(e.index),t.Slides.update())}function F(B,J,ie,oe){B!==J&&Z(B>ie)&&(M(),R(y(te(),B>ie),!0)),a(vi),s(xn,J,ie,B),S.start(J,function(){a(li),s(bi,J,ie,B),oe&&oe()})}function P(B){R(D(B,!0))}function R(B,J){if(!e.is(Ui)){var ie=J?B:Y(B);Jt(w,"transform","translate"+g("X")+"("+ie+"px)"),B!==ie&&s(Is)}}function Y(B){if(e.is(xi)){var J=W(B),ie=J>t.Controller.getEnd(),oe=J<0;(oe||ie)&&(B=y(B,ie))}return B}function y(B,J){var ie=B-H(J),oe=x();return B-=v(oe*(_i(jt(ie)/oe)||1))*(J?1:-1),B}function M(){R(te(),!0),S.cancel()}function W(B){for(var J=t.Slides.get(),ie=0,oe=1/0,O=0;O<J.length;O++){var de=J[O].index,f=jt(D(de,!0)-B);if(f<=oe)oe=f,ie=de;else break}return ie}function D(B,J){var ie=v(p(B-1)-K(B));return J?pe(ie):ie}function te(){var B=g("left");return Vt(w)[B]-Vt($)[B]+v(m(!1))}function pe(B){return n.trimSpace&&e.is(di)&&(B=ni(B,0,v(x(!0)-E()))),B}function K(B){var J=n.focus;return J==="center"?(E()-c(B,!0))/2:+J*c(B)||0}function H(B){return D(B?t.Controller.getEnd():0,!!n.trimSpace)}function Z(B){var J=v(y(te(),B));return B?J>=0:J<=w[g("scrollWidth")]-Vt($)[g("width")]}function U(B,J){J=zi(J)?te():J;var ie=B!==!0&&v(J)<v(H(!1)),oe=B!==!1&&v(J)>v(H(!0));return ie||oe}return{mount:_,move:F,jump:P,translate:R,shift:y,cancel:M,toIndex:W,toPosition:D,getPosition:te,getLimit:H,exceededLimit:U,reposition:I}}function Lc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=t.Move,u=a.getPosition,c=a.getLimit,m=a.toPosition,p=t.Slides,E=p.isEnough,x=p.getLength,C=n.omitEnd,g=e.is(xi),v=e.is(di),T=mt(te,!1),w=mt(te,!0),$=n.start||0,S,_=$,I,F,P;function R(){Y(),o([Nt,Tt,Io],Y),o(_o,y)}function Y(){I=x(!0),F=n.perMove,P=n.perPage,S=Z();var f=ni($,0,C?S:I-1);f!==$&&($=f,a.reposition())}function y(){S!==Z()&&s(Io)}function M(f,me,ye){if(!de()){var ve=D(f),Ae=H(ve);Ae>-1&&(me||Ae!==$)&&(ie(Ae),a.move(ve,Ae,_,ye))}}function W(f,me,ye,ve){t.Scroll.scroll(f,me,ye,function(){var Ae=H(a.toIndex(u()));ie(C?Rn(Ae,S):Ae),ve&&ve()})}function D(f){var me=$;if(In(f)){var ye=f.match(/([+\-<>])(\d+)?/)||[],ve=ye[1],Ae=ye[2];ve==="+"||ve==="-"?me=pe($+ +(""+ve+(+Ae||1)),$):ve===">"?me=Ae?U(+Ae):T(!0):ve==="<"&&(me=w(!0))}else me=g?f:ni(f,0,S);return me}function te(f,me){var ye=F||(O()?1:P),ve=pe($+ye*(f?-1:1),$,!(F||O()));return ve===-1&&v&&!gs(u(),c(!f),1)?f?0:S:me?ve:H(ve)}function pe(f,me,ye){if(E()||O()){var ve=K(f);ve!==f&&(me=f,f=ve,ye=!1),f<0||f>S?!F&&(xo(0,f,me,!0)||xo(S,me,f,!0))?f=U(B(f)):g?f=ye?f<0?-(I%P||P):I:f:n.rewind?f=f<0?S:0:f=-1:ye&&f!==me&&(f=U(B(me)+(f<me?-1:1)))}else f=-1;return f}function K(f){if(v&&n.trimSpace==="move"&&f!==$)for(var me=u();me===m(f,!0)&&xo(f,0,e.length-1,!n.rewind);)f<$?--f:++f;return f}function H(f){return g?(f+I)%I||0:f}function Z(){for(var f=I-(O()||g&&F?1:P);C&&f-- >0;)if(m(I-1,!0)!==m(f,!0)){f++;break}return ni(f,0,I-1)}function U(f){return ni(O()?f:P*f,0,S)}function B(f){return O()?Rn(f,S):Po((f>=S?I-1:f)/P)}function J(f){var me=a.toIndex(f);return v?ni(me,0,S):me}function ie(f){f!==$&&(_=$,$=f)}function oe(f){return f?_:$}function O(){return!zi(n.focus)||n.isNavigation}function de(){return e.state.is([vi,ji])&&!!n.waitForTransition}return{mount:R,go:M,scroll:W,getNext:T,getPrev:w,getAdjacent:te,getEnd:Z,setIndex:ie,getIndex:oe,toIndex:U,toPage:B,toDest:J,hasFocus:O,isBusy:de}}var Ec="http://www.w3.org/2000/svg",Pc="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",to=40;function Ic(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.emit,u=n.classes,c=n.i18n,m=t.Elements,p=t.Controller,E=m.arrows,x=m.track,C=E,g=m.prev,v=m.next,T,w,$={};function S(){I(),o(Nt,_)}function _(){F(),S()}function I(){var W=n.arrows;W&&!(g&&v)&&Y(),g&&v&&(ki($,{prev:g,next:v}),Mi(C,W?"":"none"),on(C,w=qr+"--"+n.direction),W&&(P(),M(),Ne([g,v],Gi,x.id),a(Ss,g,v)))}function F(){i.destroy(),hn(C,w),T?(Kn(E?[g,v]:C),g=v=null):rn([g,v],Dr)}function P(){o([Mn,bi,Tt,Un,Io],M),s(v,"click",mt(R,">")),s(g,"click",mt(R,"<"))}function R(W){p.go(W,!0)}function Y(){C=E||ai("div",u.arrows),g=y(!0),v=y(!1),T=!0,Di(C,[g,v]),!E&&kr(C,x)}function y(W){var D='<button class="'+u.arrow+" "+(W?u.prev:u.next)+'" type="button"><svg xmlns="'+Ec+'" viewBox="0 0 '+to+" "+to+'" width="'+to+'" height="'+to+'" focusable="false"><path d="'+(n.arrowPath||Pc)+'" />';return ps(D)}function M(){if(g&&v){var W=e.index,D=p.getPrev(),te=p.getNext(),pe=D>-1&&W<D?c.last:c.prev,K=te>-1&&W>te?c.first:c.next;g.disabled=D<0,v.disabled=te<0,Ne(g,Dt,pe),Ne(v,Dt,K),a(Cs,g,v,D,te)}}return{arrows:$,mount:S,destroy:F,update:M}}var Rc=_r+"-interval";function Ac(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.emit,u=Wo(n.interval,e.go.bind(e,">"),P),c=u.isPaused,m=t.Elements,p=t.Elements,E=p.root,x=p.toggle,C=n.autoplay,g,v,T=C==="pause";function w(){C&&($(),x&&Ne(x,Gi,m.track.id),T||S(),F())}function $(){n.pauseOnHover&&s(E,"mouseenter mouseleave",function(Y){g=Y.type==="mouseenter",I()}),n.pauseOnFocus&&s(E,"focusin focusout",function(Y){v=Y.type==="focusin",I()}),x&&s(x,"click",function(){T?S():_(!0)}),o([xn,Fo,Tt],u.rewind),o(xn,R)}function S(){c()&&t.Slides.isEnough()&&(u.start(!n.resetProgress),v=g=T=!1,F(),a(Or))}function _(Y){Y===void 0&&(Y=!0),T=!!Y,F(),c()||(u.pause(),a(Br))}function I(){T||(g||v?_(!1):S())}function F(){x&&(gn(x,Gn,!T),Ne(x,Dt,n.i18n[T?"play":"pause"]))}function P(Y){var y=m.bar;y&&Jt(y,"width",Y*100+"%"),a(Es,Y)}function R(Y){var y=t.Slides.getAt(Y);u.set(y&&+Zt(y.slide,Rc)||n.interval)}return{mount:w,destroy:u.cancel,play:S,pause:_,isPaused:c}}function kc(e,t,n){var i=bt(e),o=i.on;function s(){n.cover&&(o(jr,mt(u,!0)),o([Mn,Nt,Tt],mt(a,!0)))}function a(c){t.Slides.forEach(function(m){var p=qi(m.container||m.slide,"img");p&&p.src&&u(c,p,m)})}function u(c,m,p){p.style("background",c?'center/cover no-repeat url("'+m.src+'")':"",!0),Mi(m,c?"none":"")}return{mount:s,destroy:mt(a,!1)}}var Mc=10,_c=600,Fc=.6,Wc=1.5,Nc=800;function Hc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=e.state.set,u=t.Move,c=u.getPosition,m=u.getLimit,p=u.exceededLimit,E=u.translate,x=e.is(di),C,g,v=1;function T(){o(xn,_),o([Nt,Tt],I)}function w(P,R,Y,y,M){var W=c();if(_(),Y&&(!x||!p())){var D=t.Layout.sliderSize(),te=br(P)*D*Po(jt(P)/D)||0;P=u.toPosition(t.Controller.toDest(P%D))+te}var pe=gs(W,P,1);v=1,R=pe?0:R||Eo(jt(P-W)/Wc,Nc),g=y,C=Wo(R,$,mt(S,W,P,M),1),a(ji),s(Fo),C.start()}function $(){a(li),g&&g(),s(Un)}function S(P,R,Y,y){var M=c(),W=P+(R-P)*F(y),D=(W-M)*v;E(M+D),x&&!Y&&p()&&(v*=Fc,jt(D)<Mc&&w(m(p(!0)),_c,!1,g,!0))}function _(){C&&C.cancel()}function I(){C&&!C.isPaused()&&(_(),$())}function F(P){var R=n.easingFunc;return R?R(P):1-Math.pow(1-P,4)}return{mount:T,destroy:_,scroll:w,cancel:I}}var ii={passive:!1,capture:!0};function Oc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=i.bind,u=i.unbind,c=e.state,m=t.Move,p=t.Scroll,E=t.Controller,x=t.Elements.track,C=t.Media.reduce,g=t.Direction,v=g.resolve,T=g.orient,w=m.getPosition,$=m.exceededLimit,S,_,I,F,P,R=!1,Y,y,M;function W(){a(x,nr,yr,ii),a(x,ir,yr,ii),a(x,zs,te,ii),a(x,"click",H,{capture:!0}),a(x,"dragstart",mn),o([Mn,Nt],D)}function D(){var X=n.drag;ge(!X),F=X==="free"}function te(X){if(Y=!1,!y){var G=Ae(X);ve(X.target)&&(G||!X.button)&&(E.isBusy()?mn(X,!0):(M=G?x:window,P=c.is([vi,ji]),I=null,a(M,nr,pe,ii),a(M,ir,K,ii),m.cancel(),p.cancel(),Z(X)))}}function pe(X){if(c.is(vo)||(c.set(vo),s(xs)),X.cancelable)if(P){m.translate(S+ye(O(X)));var G=de(X)>fa,j=R!==(R=$());(G||j)&&Z(X),Y=!0,s(ws),mn(X)}else J(X)&&(P=B(X),mn(X))}function K(X){c.is(vo)&&(c.set(li),s($s)),P&&(U(X),mn(X)),u(M,nr,pe),u(M,ir,K),P=!1}function H(X){!y&&Y&&mn(X,!0)}function Z(X){I=_,_=X,S=w()}function U(X){var G=ie(X),j=oe(G),he=n.rewind&&n.rewindByDrag;C(!1),F?E.scroll(j,0,n.snap):e.is(Ui)?E.go(T(br(G))<0?he?"<":"-":he?">":"+"):e.is(di)&&R&&he?E.go($(!0)?">":"<"):E.go(E.toDest(j),!0),C(!0)}function B(X){var G=n.dragMinThreshold,j=Ii(G),he=j&&G.mouse||0,ne=(j?G.touch:+G)||10;return jt(O(X))>(Ae(X)?ne:he)}function J(X){return jt(O(X))>jt(O(X,!0))}function ie(X){if(e.is(xi)||!R){var G=de(X);if(G&&G<fa)return O(X)/G}return 0}function oe(X){return w()+br(X)*Rn(jt(X)*(n.flickPower||600),F?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function O(X,G){return me(X,G)-me(f(X),G)}function de(X){return vr(X)-vr(f(X))}function f(X){return _===X&&I||_}function me(X,G){return(Ae(X)?X.changedTouches[0]:X)["page"+v(G?"Y":"X")]}function ye(X){return X/(R&&e.is(di)?vc:1)}function ve(X){var G=n.noDrag;return!Ri(X,"."+Ns+", ."+zo)&&(!G||!Ri(X,G))}function Ae(X){return typeof TouchEvent<"u"&&X instanceof TouchEvent}function ee(){return P}function ge(X){y=X}return{mount:W,disable:ge,isDragging:ee}}var Bc={Spacebar:" ",Right:Oo,Left:Ho,Up:Rs,Down:As};function Kr(e){return e=In(e)?e:e.key,Bc[e]||e}var ya="keydown";function jc(e,t,n){var i=bt(e),o=i.on,s=i.bind,a=i.unbind,u=e.root,c=t.Direction.resolve,m,p;function E(){x(),o(Nt,C),o(Nt,x),o(xn,v)}function x(){var w=n.keyboard;w&&(m=w==="global"?window:u,s(m,ya,T))}function C(){a(m,ya)}function g(w){p=w}function v(){var w=p;p=!0,ss(function(){p=w})}function T(w){if(!p){var $=Kr(w);$===c(Ho)?e.go("<"):$===c(Oo)&&e.go(">")}}return{mount:E,destroy:C,disable:g}}var Ti=_r+"-lazy",wo=Ti+"-srcset",zc="["+Ti+"], ["+wo+"]";function Vc(e,t,n){var i=bt(e),o=i.on,s=i.off,a=i.bind,u=i.emit,c=n.lazyLoad==="sequential",m=[bi,Un],p=[];function E(){n.lazyLoad&&(x(),o(Tt,x))}function x(){bn(p),C(),c?w():(s(m),o(m,g),g())}function C(){t.Slides.forEach(function($){Mr($.slide,zc).forEach(function(S){var _=Zt(S,Ti),I=Zt(S,wo);if(_!==S.src||I!==S.srcset){var F=n.classes.spinner,P=S.parentElement,R=qi(P,"."+F)||ai("span",F,P);p.push([S,$,R]),S.src||Mi(S,"none")}})})}function g(){p=p.filter(function($){var S=n.perPage*((n.preloadPages||1)+1)-1;return $[1].isWithin(e.index,S)?v($):!0}),p.length||s(m)}function v($){var S=$[0];on($[1].slide,Sr),a(S,"load error",mt(T,$)),Ne(S,"src",Zt(S,Ti)),Ne(S,"srcset",Zt(S,wo)),rn(S,Ti),rn(S,wo)}function T($,S){var _=$[0],I=$[1];hn(I.slide,Sr),S.type!=="error"&&(Kn($[2]),Mi(_,""),u(jr,_,I),u(ci)),c&&w()}function w(){p.length&&v(p.shift())}return{mount:E,destroy:mt(bn,p),check:g}}function Dc(e,t,n){var i=bt(e),o=i.on,s=i.emit,a=i.bind,u=t.Slides,c=t.Elements,m=t.Controller,p=m.hasFocus,E=m.getIndex,x=m.go,C=t.Direction.resolve,g=c.pagination,v=[],T,w;function $(){S(),o([Nt,Tt,Io],$);var y=n.pagination;g&&Mi(g,y?"":"none"),y&&(o([xn,Fo,Un],Y),_(),Y(),s(Ts,{list:T,items:v},R(e.index)))}function S(){T&&(Kn(g?kn(T.children):T),hn(T,w),bn(v),T=null),i.destroy()}function _(){var y=e.length,M=n.classes,W=n.i18n,D=n.perPage,te=p()?m.getEnd()+1:_i(y/D);T=g||ai("ul",M.pagination,c.track.parentElement),on(T,w=Vo+"--"+P()),Ne(T,fn,"tablist"),Ne(T,Dt,W.select),Ne(T,Vr,P()===Bo?"vertical":"");for(var pe=0;pe<te;pe++){var K=ai("li",null,T),H=ai("button",{class:M.page,type:"button"},K),Z=u.getIn(pe).map(function(B){return B.slide.id}),U=!p()&&D>1?W.pageX:W.slideX;a(H,"click",mt(I,pe)),n.paginationKeyboard&&a(H,"keydown",mt(F,pe)),Ne(K,fn,"presentation"),Ne(H,fn,"tab"),Ne(H,Gi,Z.join(" ")),Ne(H,Dt,xr(U,pe+1)),Ne(H,si,-1),v.push({li:K,button:H,page:pe})}}function I(y){x(">"+y,!0)}function F(y,M){var W=v.length,D=Kr(M),te=P(),pe=-1;D===C(Oo,!1,te)?pe=++y%W:D===C(Ho,!1,te)?pe=(--y+W)%W:D==="Home"?pe=0:D==="End"&&(pe=W-1);var K=v[pe];K&&(us(K.button),x(">"+pe),mn(M,!0))}function P(){return n.paginationDirection||n.direction}function R(y){return v[m.toPage(y)]}function Y(){var y=R(E(!0)),M=R(E());if(y){var W=y.button;hn(W,Gn),rn(W,ua),Ne(W,si,-1)}if(M){var D=M.button;on(D,Gn),Ne(D,ua,!0),Ne(D,si,"")}s(Ls,{list:T,items:v},y,M)}return{items:v,mount:$,destroy:S,getAt:R,update:Y}}var qc=[" ","Enter"];function Kc(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function a(){e.splides.forEach(function(g){g.isParent||(m(e,g.splide),m(g.splide,e))}),i&&p()}function u(){s.forEach(function(g){g.destroy()}),bn(s)}function c(){u(),a()}function m(g,v){var T=bt(g);T.on(xn,function(w,$,S){v.go(v.is(xi)?S:w)}),s.push(T)}function p(){var g=bt(e),v=g.on;v(Wr,x),v(Ps,C),v([Mn,Nt],E),s.push(g),g.emit(Hr,e.splides)}function E(){Ne(t.Elements.list,Vr,n.direction===Bo?"vertical":"")}function x(g){e.go(g.index)}function C(g,v){Ar(qc,Kr(v))&&(x(g),mn(v))}return{setup:mt(t.Media.set,{slideFocus:zi(o)?i:o},!0),mount:a,destroy:u,remount:c}}function Gc(e,t,n){var i=bt(e),o=i.bind,s=0;function a(){n.wheel&&o(t.Elements.track,"wheel",u,ii)}function u(m){if(m.cancelable){var p=m.deltaY,E=p<0,x=vr(m),C=n.wheelMinThreshold||0,g=n.wheelSleep||0;jt(p)>C&&x-s>g&&(e.go(E?"<":">"),s=x),c(E)&&mn(m)}}function c(m){return!n.releaseWheel||e.state.is(vi)||t.Controller.getAdjacent(m)!==-1}return{mount:a}}var Uc=90;function Xc(e,t,n){var i=bt(e),o=i.on,s=t.Elements.track,a=n.live&&!n.isNavigation,u=ai("span",mc),c=Wo(Uc,mt(p,!1));function m(){a&&(x(!t.Autoplay.isPaused()),Ne(s,ga,!0),u.textContent="…",o(Or,mt(x,!0)),o(Br,mt(x,!1)),o([bi,Un],mt(p,!0)))}function p(C){Ne(s,ma,C),C?(Di(s,u),c.start()):(Kn(u),c.cancel())}function E(){rn(s,[pa,ga,ma]),Kn(u)}function x(C){a&&Ne(s,pa,C?"off":"polite")}return{mount:m,disable:x,destroy:E}}var Yc=Object.freeze({__proto__:null,Media:oc,Direction:rc,Elements:bc,Slides:wc,Layout:$c,Clones:Cc,Move:Tc,Controller:Lc,Arrows:Ic,Autoplay:Ac,Cover:kc,Scroll:Hc,Drag:Oc,Keyboard:jc,LazyLoad:Vc,Pagination:Dc,Sync:Kc,Wheel:Gc,Live:Xc}),Jc={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"},Zc={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:fc,i18n:Jc,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Qc(e,t,n){var i=t.Slides;function o(){bt(e).on([Mn,Tt],s)}function s(){i.forEach(function(u){u.style("transform","translateX(-"+100*u.index+"%)")})}function a(u,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),ss(c)}return{mount:o,start:a,cancel:yr}}function ed(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,a=t.Elements.list,u=mt(Jt,a,"transition"),c;function m(){bt(e).bind(a,"transitionend",function(C){C.target===a&&c&&(E(),c())})}function p(C,g){var v=i.toPosition(C,!0),T=i.getPosition(),w=x(C);jt(v-T)>=1&&w>=1?n.useScroll?s.scroll(v,w,!1,g):(u("transform "+w+"ms "+n.easing),i.translate(v,!0),c=g):(i.jump(C),g())}function E(){u(""),s.cancel()}function x(C){var g=n.rewindSpeed;if(e.is(di)&&g){var v=o.getIndex(!0),T=o.getEnd();if(v===0&&C>=T||v>=T&&C===0)return g}return n.speed}return{mount:m,start:p,cancel:E}}var td=(function(){function e(n,i){this.event=bt(),this.Components={},this.state=nc(ri),this.splides=[],this._o={},this._E={};var o=In(n)?ms(document,n):n;Ci(o,o+" is invalid."),this.root=o,i=Pn({label:Zt(o,Dt)||"",labelledby:Zt(o,zr)||""},Zc,e.defaults,i||{});try{Pn(i,JSON.parse(Zt(o,_r)))}catch{Ci(!1,"Invalid JSON")}this._o=Object.create(Pn({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,a=this.state,u=this.Components;Ci(a.is([ri,Lo]),"Already mounted!"),a.set(ri),this._C=u,this._T=o||this._T||(this.is(Ui)?Qc:ed),this._E=i||this._E;var c=ki({},Yc,this._E,{Transition:this._T});return qn(c,function(m,p){var E=m(s,u,s._o);u[p]=E,E.setup&&E.setup()}),qn(u,function(m){m.mount&&m.mount()}),this.emit(Mn),on(this.root,gc),a.set(li),this.emit(wr),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(li)&&(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(kn(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(Tt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,s=this.state;return s.is(ri)?bt(this).on(wr,this.destroy.bind(this,i)):(qn(this._C,function(a){a.destroy&&a.destroy(i)},!0),o.emit(Nr),o.destroy(),i&&bn(this.splides),s.set(Lo)),this},Jl(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})(),Gr=td;Gr.defaults={};Gr.STATES=Ql;var va=[[Mn,"onMounted"],[wr,"onReady"],[xn,"onMove"],[bi,"onMoved"],[Wr,"onClick"],[fs,"onActive"],[ys,"onInactive"],[vs,"onVisible"],[bs,"onHidden"],[Tt,"onRefresh"],[Nt,"onUpdated"],[ci,"onResize"],[_o,"onResized"],[xs,"onDrag"],[ws,"onDragging"],[$s,"onDragged"],[Fo,"onScroll"],[Un,"onScrolled"],[Nr,"onDestroy"],[Ss,"onArrowsMounted"],[Cs,"onArrowsUpdated"],[Ts,"onPaginationMounted"],[Ls,"onPaginationUpdated"],[Hr,"onNavigationMounted"],[Or,"onAutoplayPlay"],[Es,"onAutoplayPlaying"],[Br,"onAutoplayPause"],[jr,"onLazyLoadLoaded"]];function Ur(...e){return e.filter(Boolean).join(" ")}function Ro(e){return e!==null&&typeof e=="object"}function Cr(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Cr(n,t[i]));if(Ro(e)&&Ro(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Cr(e[o],t[o]))}return e===t}function nd(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function id(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 Tr(e,t){const n=e;return id(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Ro(i)?n[o]=Tr(Ro(n[o])?n[o]:{},i):n[o]=i}),n}var od=({children:e,className:t,...n})=>l.createElement("div",{className:Ur("splide__track",t),...n},l.createElement("ul",{className:"splide__list"},e)),Xr=class extends l.Component{constructor(){super(...arguments),this.splideRef=l.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Gr(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Tr({},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&&!Cr(this.options,e)&&(this.splide.options=e,this.options=Tr({},e));const t=this.getSlides();nd(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){va.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 l.createElement(t,{className:Ur("splide",e),ref:this.splideRef,...this.omit(o,["options",...va.map(s=>s[1])])},n?l.createElement(od,null,i):i)}},Yr=({children:e,className:t,...n})=>l.createElement("li",{className:Ur("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 dd="RichTextRenderer-module__link___BWeZ2",ud={link:dd},pd=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))},qo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>pd(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function qt(e){const{color:t,...n}=e;return n}function kt(e,t){var o,s,a;const{fontSize:n,lineHeight:i}=e;return{fontFamily:qo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:M.scalingValue(e.letterSpacing,t),wordSpacing:M.scalingValue(e.wordSpacing,t),fontSize:M.scalingValue(n,t),lineHeight:i!==void 0?M.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(a=e.textAppearance)==null?void 0:a.fontVariant,textAlign:e.textAlign,color:e.color}}const ui=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:ud.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:md(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 md(e){return{...e.fontFamily&&{fontFamily:qo(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 gd="SvgImage-module__svg___q3xE-",hd="SvgImage-module__img___VsTm-",wa={svg:gd,img:hd},fd=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},yd=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Qt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,a]=l.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return l.useEffect(()=>{if(typeof window<"u"&&window.CSS){const u=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');a(u)}},[]),!fd(e)||!s?r.jsx("img",{src:e,alt:"",className:Je(wa.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:Je(wa.svg,i),style:{"--svg":yd(e),"--fill":t,"--hover-fill":n,...o??{}}})},vd={"top-left":Ee.topLeftAlignment,"top-center":Ee.topCenterAlignment,"top-right":Ee.topRightAlignment,"middle-left":Ee.middleLeftAlignment,"middle-center":Ee.middleCenterAlignment,"middle-right":Ee.middleRightAlignment,"bottom-left":Ee.bottomLeftAlignment,"bottom-center":Ee.bottomCenterAlignment,"bottom-right":Ee.bottomRightAlignment};function bd({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=l.useState(null),{widthSettings:a,fontSettings:u,letterSpacing:c,textAlign:m,wordSpacing:p,fontSizeLineHeight:R,textAppearance:x,color:L}=n.imageCaption??{},[g,y]=l.useState(void 0),[w,$]=l.useState(null),[S,C]=l.useState(0),[k,P]=l.useState(0),{direction:H,transition:I,controls:E,pagination:Z,imageCaption:v,triggers:A}=e,B=l.useRef(I.type),{x:V,y:ne}=e.controls.offset,ce=X=>{o&&o.go(X)};return l.useEffect(()=>{if(!w)return;const X=new ResizeObserver(j=>{if(!o)return;const[_]=j;y({width:Math.round(_.contentRect.width),height:Math.round(_.contentRect.height)})});return X.observe(w),()=>X.unobserve(w)},[w]),l.useEffect(()=>{!o||B.current===I.type||(P(X=>X+1),B.current=I.type)},[I.type]),r.jsx("div",{className:Je(Ee.wrapper,{[Ee.editor]:i}),ref:$,children:r.jsxs("div",{className:Ee.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:I.backgroundColor&&I.type==="fade in"?I.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:Je(Ee.captionBlock),children:r.jsx("div",{className:Ee.captionTextWrapper,children:t.map((X,j)=>r.jsx("div",{className:Je(Ee.captionText,vd[v.alignment],{[Ee.withPointerEvents]:j===S&&i,[Ee.active]:j===S}),style:{fontFamily:qo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:a.sizing==="auto"?"max-content":M.scalingValue(a.width,i),letterSpacing:M.scalingValue(c,i),wordSpacing:M.scalingValue(p,i),textAlign:m,fontSize:M.scalingValue(R.fontSize,i),lineHeight:M.scalingValue(R.lineHeight,i),textTransform:x.textTransform??"none",textDecoration:x.textDecoration??"none",fontVariant:x.fontVariant??"normal",color:L,transitionDuration:I.duration?`${Math.round(parseInt(I.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:Ee.captionTextInner,style:{"--link-hover-color":v.linkHoverColor,"--link-color":v.linkColor,position:"relative",top:M.scalingValue(v.offset.y,i),left:M.scalingValue(v.offset.x,i)},children:r.jsx(ui,{content:X.imageCaption})})},j))})}),r.jsx(Jr,{onMove:X=>{C(X.index)},ref:s,options:{arrows:!1,speed:I.duration?parseInt(I.duration):500,autoplay:A.autoPlay!==null,...A.autoPlay!==null&&{interval:parseInt(A.autoPlay)*1e3},direction:H==="horiz"||I.type==="fade in"?"ltr":"ttb",pagination:!1,drag:A.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:I.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((X,j)=>r.jsx(Zr,{children:r.jsx("div",{className:Ee.sliderItem,children:r.jsx("div",{className:Ee.imgWrapper,children:r.jsx("img",{className:Je(Ee.sliderImage,{[Ee.contain]:X.image.objectFit==="contain",[Ee.cover]:X.image.objectFit==="cover"}),src:X.image.url,alt:X.image.name??""})})})},j))},k),E.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Je(Ee.arrow,{[Ee.arrowVertical]:H==="vert",[Ee.hoverArrow]:E.show==="on hover"}),style:{color:E.color,"--arrow-hover-color":E.hover},children:r.jsxs("button",{onClick:()=>{ce("-1")},className:Ee.arrowInner,style:{transform:`translate(${M.scalingValue(V,i)}, ${M.scalingValue(ne*(H==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${H==="horiz"?"0deg":"90deg"})`},children:[E.arrowsImgUrl&&r.jsx(Qt,{url:E.arrowsImgUrl,fill:E.color,hoverFill:E.hover,className:Je(Ee.arrowImg,Ee.mirror)}),!E.arrowsImgUrl&&r.jsx($a,{color:E.color,className:Je(Ee.arrowIcon,Ee.arrowImg,Ee.mirror)})]})}),r.jsx("div",{className:Je(Ee.arrow,Ee.nextArrow,{[Ee.arrowVertical]:H==="vert",[Ee.hoverArrow]:E.show==="on hover"}),style:{color:E.color,"--arrow-hover-color":E.hover},children:r.jsxs("button",{className:Ee.arrowInner,onClick:()=>ce("+1"),style:{transform:`translate(${M.scalingValue(V*(H==="horiz"?-1:1),i)}, ${M.scalingValue(ne,i)}) scale(${e.controls.scale/100}) rotate(${H==="horiz"?"0deg":"90deg"})`},children:[E.arrowsImgUrl&&r.jsx(Qt,{url:E.arrowsImgUrl,fill:E.color,hoverFill:E.hover,className:Ee.arrowImg}),!E.arrowsImgUrl&&r.jsx($a,{color:E.color,className:Je(Ee.arrowIcon,Ee.arrowImg)})]})})]}),A.triggersList.click&&r.jsx("div",{className:Ee.clickOverlay,onClick:()=>{o&&o.go("+1")}}),Z.isActive&&r.jsx("div",{className:Je(Ee.pagination,{[Ee.paginationInsideBottom]:Z.position==="inside-1"&&H==="horiz",[Ee.paginationInsideTop]:Z.position==="inside-2"&&H==="horiz",[Ee.paginationOutsideBottom]:Z.position==="outside-1"&&H==="horiz",[Ee.paginationOutsideTop]:Z.position==="outside-2"&&H==="horiz",[Ee.paginationInsideLeft]:Z.position==="inside-1"&&H==="vert",[Ee.paginationInsideRight]:Z.position==="inside-2"&&H==="vert",[Ee.paginationOutsideLeft]:Z.position==="outside-1"&&H==="vert",[Ee.paginationOutsideRight]:Z.position==="outside-2"&&H==="vert",[Ee.paginationVertical]:H==="vert"}),children:r.jsx("div",{className:Ee.paginationInner,style:{backgroundColor:Z.colors[2],transform:`scale(${Z.scale/100}) translate(${M.scalingValue(Z.offset.x,i)}, ${M.scalingValue(Z.offset.y,i)}) rotate(${H==="horiz"?"0deg":"90deg"})`},children:t.map((X,j)=>r.jsx("button",{onClick:()=>{o&&o.go(j)},className:Je(Ee.paginationItem),children:r.jsx("div",{className:Je(Ee.dot,{[Ee.activeDot]:j===S}),style:{backgroundColor:j===S?Z.colors[0]:Z.colors[1],"--pagination-hover-color":Z.hover}})},j))})})]})})}function $a({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 xd={element:bd,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"]}},wd="ImageRevealSlider-module__imageRevealSlider___UE5Ob",$d="ImageRevealSlider-module__image___Qjt-e",Sd="ImageRevealSlider-module__link___N-iLG",Cd="ImageRevealSlider-module__cursor___2U03d",Qn={imageRevealSlider:wd,image:$d,link:Sd,cursor:Cd};function Sa(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,a=o.naturalHeight/o.naturalWidth*s,u=s/2,c=a/2;if(e>=i.x-u&&e<=i.x+u&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function rr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Td(e,t,n,i){let o,s;if(t==="custom"){o=n;const a=await rr(e);s=a.height/a.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const a=await rr(e);s=a.height/a.width*o}else{const a=await rr(e);o=a.width,s=a.height}return{width:o,height:s,finalWidth:`${o}px`}}function Ld({settings:e,content:t,isEditor:n}){const[i,o]=l.useState(null),[s,a]=l.useState([]),[u,c]=l.useState(0),m=l.useRef(0),[p,R]=l.useState({x:0,y:0}),[x,L]=l.useState(1),[g,y]=l.useState("none"),w=l.useRef({x:0,y:0}),[$,S]=l.useState(!1),{sizeType:C,imageWidth:k,randomRangeImageWidth:P}=e.imageSize,{revealPosition:H,visible:I}=e.position,{cursorType:E,target:Z,defaultCursorScale:v,defaultCursor:A,hoverCursorScale:B,hoverCursor:V}=e.cursor;l.useEffect(()=>{if(!i)return;const X=(N,T)=>{const K=i.getBoundingClientRect(),Y=N-K.left,Q=T-K.top;if(R({x:Y,y:Q}),E==="system"){y("none"),L(1);return}const O=Y,oe=Q,h=document.elementFromPoint(K.left+O,K.top+oe);if(h&&h.closest("a")){y("none"),L(1);return}const ae=Sa(O,oe,s)||Z==="area"?{img:V??"none",scale:B}:{img:A??"none",scale:v};y(ae.img),L(ae.scale)},j=N=>{N.stopPropagation(),w.current={x:N.clientX,y:N.clientY},X(N.clientX,N.clientY)},_=()=>{$&&X(w.current.x,w.current.y)};return i.addEventListener("mousemove",j),window.addEventListener("scroll",_,!0),()=>{i.removeEventListener("mousemove",j),window.removeEventListener("scroll",_,!0)}},[i,$,p,E,Z,V,A,B,v,s]),l.useEffect(()=>{$||(y("none"),L(0))},[$]);const ne=async(X,j,_,N={})=>{const{width:T,height:K,finalWidth:Y}=await Td(X.image.url,C,k,P);let Q=0,O=0;H==="same"?(Q=j/2,O=_/2):(Q=N.x??Math.random()*j,O=N.y??Math.random()*_);const oe=Math.min(Math.max(Q,T/2),j-T/2),h=Math.min(Math.max(O,K/2),_-K/2);return{id:m.current++,url:X.image.url,link:X.link,name:X.image.name,x:oe,y:h,width:Y}};l.useEffect(()=>{if(!i||t.length===0)return;const X=i.getBoundingClientRect(),j=X.width,_=X.height,N=[];(async()=>{const K=t[0],Y=await ne(K,j,_);N.push(Y),a(N),c(1)})()},[C,k,P,H,i]),l.useEffect(()=>{I==="last One"&&a(X=>X.length>0?[X[X.length-1]]:[])},[I]);const ce=async X=>{if(!i)return;const j=i.getBoundingClientRect(),_=X.clientX-j.left,N=X.clientY-j.top;if(Z==="image"&&!Sa(_,N,s))return;let T=0,K=0;H==="on Click"?(T=_,K=N):H==="same"?(T=j.width/2,K=j.height/2):(T=Math.random()*j.width,K=Math.random()*j.height);const Y=t[u],Q=await ne(Y,j.width,j.height,{x:T,y:K});a(O=>I==="all"?[...O,Q]:[Q]),c(O=>O>=t.length-1?0:O+1)};return r.jsxs("div",{ref:o,onClick:ce,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),className:Qn.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[s.map(X=>r.jsx("div",{className:Qn.wrapper,style:{top:`${X.y}px`,left:`${X.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:X.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:Z==="area"&&X.link?r.jsx("a",{href:X.link,target:"_blank",className:Qn.link,children:r.jsx("img",{src:X.url,alt:X.name,className:Qn.image},X.id)}):r.jsx("img",{src:X.url,alt:X.name,className:Qn.image},X.id)},X.id)),$&&r.jsx("div",{className:Qn.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${x})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Ed={element:Ld,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:""}]}}}},Pd="LightBox-module__hidden___9s-9x",Id="LightBox-module__heroImage___sTxNF",Rd="LightBox-module__background___rm9ml",Md="LightBox-module__editor___4ACaY",kd="LightBox-module__contentStyle___Bgnsq",Ad="LightBox-module__imageStyle___tLIlB",_d="LightBox-module__imgWrapper___LuFUp",Fd="LightBox-module__contain___8-yaS",Wd="LightBox-module__cover___hNvOG",Nd="LightBox-module__caption___b6L2I",Hd="LightBox-module__captionTextInner___rCGNH",Od="LightBox-module__lightboxSplide___XFuWC",Bd="LightBox-module__arrow___iz38X",jd="LightBox-module__arrowVertical___Zfz81",zd="LightBox-module__nextArrow___zkAQN",Vd="LightBox-module__arrowInner___p48sW",Dd="LightBox-module__arrowIcon___3VaFf",qd="LightBox-module__arrowImg___pNV88",Kd="LightBox-module__mirror___pjeXc",Gd="LightBox-module__thumbsWrapper___GB-nU",Ud="LightBox-module__thumbsContainerVertical___wttk5",Xd="LightBox-module__thumbsContainer___osSma",Yd="LightBox-module__thumbsAlignStart___MO6tY",Jd="LightBox-module__thumbsAlignCenter___Q4sUx",Zd="LightBox-module__thumbsAlignEnd___p4y9R",Qd="LightBox-module__thumbItem___HvnF3",eu="LightBox-module__closeButton___g2khP",tu="LightBox-module__fadeIn___0m5GW",nu="LightBox-module__slideInLeft___gPYwC",iu="LightBox-module__slideInRight___S-pPp",ou="LightBox-module__slideInTop___DFdAj",ru="LightBox-module__slideInBottom___m27kZ",au="LightBox-module__fadeOut___55qBR",su="LightBox-module__slideOutLeft___NvU7P",lu="LightBox-module__slideOutRight___SK7eC",cu="LightBox-module__slideOutTop___Vgg0z",du="LightBox-module__slideOutBottom___nJ0Ef",uu="LightBox-module__scaleSlide___vZriG",fe={hidden:Pd,heroImage:Id,background:Rd,editor:Md,contentStyle:kd,imageStyle:Ad,imgWrapper:_d,contain:Fd,cover:Wd,caption:Nd,captionTextInner:Hd,lightboxSplide:Od,arrow:Bd,arrowVertical:jd,nextArrow:zd,arrowInner:Vd,arrowIcon:Dd,arrowImg:qd,mirror:Kd,thumbsWrapper:Gd,thumbsContainerVertical:Ud,thumbsContainer:Xd,thumbsAlignStart:Yd,thumbsAlignCenter:Jd,thumbsAlignEnd:Zd,thumbItem:Qd,closeButton:eu,fadeIn:tu,slideInLeft:nu,slideInRight:iu,slideInTop:ou,slideInBottom:ru,fadeOut:au,slideOutLeft:su,slideOutRight:lu,slideOutTop:cu,slideOutBottom:du,scaleSlide:uu},no=(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% + ${M.scalingValue(t.x,n)}), calc(-50% + ${M.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${M.scalingValue(t.x,n)}, calc(-50% + ${M.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${M.scalingValue(t.x,n)}), ${M.scalingValue(t.y,n)})`:i.transform=`translate(${M.scalingValue(t.x,n)}, ${M.scalingValue(t.y,n)})`,i};function Gs(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 Ca(e){const t=e.getBoundingClientRect(),n=Gs(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,a=e.naturalHeight,u=i/o,c=s/a;let m,p;c>u?(m=i,p=i/c):(p=o,m=o*c);const R=t.left+n.left,x=t.top+n.top,L=(i-m)/2+R,g=(o-p)/2+x;return{x:L,y:g,width:m,height:p}}function Ta(e){const t=e.getBoundingClientRect(),n=Gs(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function La(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 pu(e,t){const n=(()=>{if(e==="fade in")return fe.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return fe.slideInLeft;case"right":return fe.slideInRight;case"top":return fe.slideInTop;case"bottom":return fe.slideInBottom;default:return fe.slideInRight}return fe.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return fe.fadeIn;if(e==="slide in")switch(t){case"left":return fe.slideInLeft;case"right":return fe.slideInRight;case"top":return fe.slideInTop;case"bottom":return fe.slideInBottom;default:return fe.slideInRight}return fe.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return fe.fadeOut;if(e==="slide in")switch(t){case"left":return fe.slideOutLeft;case"right":return fe.slideOutRight;case"top":return fe.slideOutTop;case"bottom":return fe.slideOutBottom;default:return fe.slideOutRight}return fe.fadeOut})(),s=(()=>{if(e==="fade in")return fe.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return fe.slideOutLeft;case"right":return fe.slideOutRight;case"top":return fe.slideOutTop;case"bottom":return fe.slideOutBottom;default:return fe.slideOutRight}return fe.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const mu=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:a})=>{const[u,c]=l.useState(!1),{url:m}=e.thumbnailBlock.cover;return l.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:m,alt:"Cover",className:fe.heroImage,onClick:()=>c(!0)}),r.jsx(gu,{isOpen:u,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},gu=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:a,metadata:u})=>{var Ie;const{widthSettings:c,fontSettings:m,letterSpacing:p,textAlign:R,wordSpacing:x,fontSizeLineHeight:L,textAppearance:g,color:y}=i.imageCaption??{},[w,$]=l.useState(0),[S,C]=l.useState(0),[k,P]=l.useState(!1),[H,I]=l.useState(!1),[E,Z]=l.useState({}),v=l.useRef(null),A=l.useRef(null),B=l.useRef(null),V=l.useRef(!1),ne=l.useRef(null),ce=l.useRef(null),X=l.useRef(null),j=l.useRef(null),_=l.useRef(!1),N=l.useRef(null),[T,K]=l.useState(!1),{appear:Y,triggers:Q,slider:O,thumbnail:oe,controls:h,area:ae,caption:ye,layout:ve}=o.lightboxBlock,{appearClass:Me,backdropAppearClass:ie,backdropDisappearClass:ge,disappearClass:ee}=pu(Y.type,Y.direction),J=(u==null?void 0:u.itemId)??null;l.useEffect(()=>{const z=()=>{setTimeout(()=>{var F,U;(U=(F=v.current)==null?void 0:F.splide)==null||U.refresh()},16)},te=()=>{C(F=>F+1)};return window.addEventListener("ArticleEditor.Layout:change",z),window.addEventListener("ArticleEditor.ComponentContent:change",te),()=>{window.removeEventListener("ArticleEditor.Layout:change",z),window.removeEventListener("ArticleEditor.ComponentContent:change",te)}},[]),l.useEffect(()=>{if(!e||!oe.isActive){K(!1);return}const z=N.current;if(!z)return;const te=()=>{O.direction==="horiz"?K(z.scrollWidth>z.clientWidth):K(z.scrollHeight>z.clientHeight)};te();const F=new ResizeObserver(te);return F.observe(z),()=>F.disconnect()},[e,oe.isActive,n.length,E,O.direction]);const D=l.useCallback(()=>{const z=window.matchMedia("(max-width: 768px)").matches,te=La(ae.color);z&&!a&&te>.9&&(document.body.style.backgroundColor=""),P(!0),V.current=!0;const F=U=>{U.target===ne.current&&U.animationName&&(ne.current&&ce.current&&ne.current.removeEventListener("animationend",ce.current),ce.current=null,V.current&&(V.current=!1,t()),P(!1))};ne.current&&(ce.current=F,ne.current.addEventListener("animationend",F))},[t,ae.color,a]),he=(z,te,F)=>{var U,G;if(z){if(Q.type==="click"&&Q.switch==="image")Q.repeat==="close"&&w===n.length-1?D():(U=v.current)==null||U.go("+1");else if(Q.type==="click"&&Q.switch==="50/50"){const le=z.getBoundingClientRect(),me=te-le.left,Te=F-le.top,Fe=le.width,Pe=le.height;let $e;O.direction==="horiz"?$e=me<Fe/2?"-1":"+1":$e=Te<Pe/2?"-1":"+1",(G=v.current)==null||G.go($e)}}},re=z=>{if(_.current){_.current=!1;return}const te=n[w],F=(te==null?void 0:te.image.objectFit)==="cover";let U,G;if("changedTouches"in z&&z.changedTouches.length>0)U=z.changedTouches[0].clientX,G=z.changedTouches[0].clientY;else if("clientX"in z)U=z.clientX,G=z.clientY;else return;let le;if(F&&B.current){const me=Ta(B.current);le=U>=me.left&&U<=me.right&&G>=me.top&&G<=me.bottom}else{const me=B.current?Ca(B.current):null;if(!me){z.target===z.currentTarget&&D();return}le=U>=me.x&&U<=me.x+me.width&&G>=me.y&&G<=me.y+me.height}le?he(B.current,U,G):D()},Ce=z=>{const te=z.target;(te.classList.contains(fe.thumbsWrapper)||te.classList.contains(fe.thumbsContainer))&&re(z)};l.useEffect(()=>{if(!e)return;const z=te=>{var F,U;if(te.key==="Escape"){D();return}if(te.key==="ArrowRight"){$(G=>(G+1)%Math.max(n.length,1)),(F=v.current)==null||F.go("+1");return}te.key==="ArrowLeft"&&($(G=>(G-1+Math.max(n.length,1))%Math.max(n.length,1)),(U=v.current)==null||U.go("-1"))};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[e,D,n.length]),l.useEffect(()=>{if(e){if($(0),C(te=>te+1),V.current=!1,P(!1),I(!1),Z({}),!J)return;const z=new CustomEvent("page-overlay",{detail:{itemId:J}});window.dispatchEvent(z)}return()=>{ne.current&&ce.current&&(ne.current.removeEventListener("animationend",ce.current),ce.current=null),I(!1)}},[e,J]),l.useEffect(()=>{A.current!==null&&A.current!==O.type&&C(z=>z+1),A.current=O.type},[O.type]),l.useEffect(()=>{if(!e)return;const z=document.body.style.overflow,te=window.matchMedia("(max-width: 768px)").matches,F=La(ae.color);document.body.style.overflow="hidden",I(!1);const U=le=>{le.target===ne.current&&!V.current&&le.animationName&&(te&&!a&&F>.9&&(document.body.style.backgroundColor=ae.color),I(!0),ne.current&&X.current&&ne.current.removeEventListener("animationend",X.current),X.current=null)};ne.current&&(X.current=U,ne.current.addEventListener("animationend",U));const G=le=>{const me=le.target;me&&(me.closest(`.${fe.thumbsWrapper}`)||me.closest(`.${fe.thumbsContainer}`))||O.type!=="slide"&&le.preventDefault()};return document.addEventListener("touchmove",G,{passive:!1}),()=>{document.body.style.overflow=z,document.removeEventListener("touchmove",G),ne.current&&X.current&&(ne.current.removeEventListener("animationend",X.current),X.current=null),I(!1)}},[e,a,ae.color,O.type]),l.useEffect(()=>{if(!e)return;const z=te=>{var U,G;if(V.current){te.stopPropagation();return}if(_.current){_.current=!1;return}const F=te.target;if(!(F&&(F.closest(`.${fe.thumbsContainer}`)||F.closest(`.${fe.thumbItem}`)||F.closest(`.${fe.arrow}`)||F.closest(`.${fe.closeButton}`)||F.closest(`.${fe.caption}`)))){if(O.type==="slide"&&Q.type==="drag"&&((G=(U=v.current)==null?void 0:U.splide)!=null&&G.root)){const le=v.current.splide.root;if(F&&(le.contains(F)||le===F))return}if(te.touches.length===0&&te.changedTouches.length>0){const le=n[w],me=(le==null?void 0:le.image.objectFit)==="cover",Te=te.changedTouches[0];let Fe;if(me&&B.current){const Pe=Ta(B.current);Fe=Te.clientX>=Pe.left&&Te.clientX<=Pe.right&&Te.clientY>=Pe.top&&Te.clientY<=Pe.bottom}else{const Pe=B.current?Ca(B.current):null;if(!Pe)return;Fe=Te.clientX>=Pe.x&&Te.clientX<=Pe.x+Pe.width&&Te.clientY>=Pe.y&&Te.clientY<=Pe.y+Pe.height}if(!Fe){te.stopPropagation(),V.current=!0;const Pe=$e=>{$e.stopPropagation(),$e.preventDefault(),document.removeEventListener("click",Pe,!0)};document.addEventListener("click",Pe,!0),D()}}}};return document.addEventListener("touchend",z,{passive:!0}),()=>{document.removeEventListener("touchend",z)}},[e,D,w,n]);const we=(O.type==="scale"||O.type==="fade")&&O.direction==="vert"&&Q.type==="drag";l.useEffect(()=>{var $e,tt;if(!e||!we||!((tt=($e=v.current)==null?void 0:$e.splide)!=null&&tt.root))return;const z=v.current.splide.root,te=30,F=(de,ke)=>{if(j.current){const ze=Math.abs(de-j.current.x),Ve=Math.abs(ke-j.current.y);(ze>0||Ve>0)&&(_.current=!0)}},U=de=>{j.current&&(de.preventDefault(),F(de.clientX,de.clientY))},G=de=>{j.current&&de.touches.length>0&&(de.preventDefault(),F(de.touches[0].clientX,de.touches[0].clientY))},le=(de,ke)=>{if(!j.current||!v.current){j.current=null;return}const ze=Math.abs(de-j.current.x),Ve=Math.abs(ke-j.current.y);Ve>te&&Ve>ze&&v.current.go(ke<j.current.y?"+1":"-1"),j.current=null},me=de=>{j.current&&le(de.clientX,de.clientY),document.removeEventListener("pointerup",me),document.removeEventListener("pointercancel",me),document.removeEventListener("pointermove",U)},Te=de=>{if(j.current){if(de.changedTouches.length>0){const ke=de.changedTouches[0];le(ke.clientX,ke.clientY)}document.removeEventListener("touchend",Te),document.removeEventListener("touchcancel",Te),document.removeEventListener("touchmove",G)}},Fe=de=>{j.current={x:de.clientX,y:de.clientY},_.current=!1,document.addEventListener("pointermove",U,{passive:!1}),document.addEventListener("pointerup",me),document.addEventListener("pointercancel",me)},Pe=de=>{de.touches.length>0&&(j.current={x:de.touches[0].clientX,y:de.touches[0].clientY},_.current=!1,document.addEventListener("touchmove",G,{passive:!1}),document.addEventListener("touchend",Te),document.addEventListener("touchcancel",Te))};return z.addEventListener("pointerdown",Fe),z.addEventListener("touchstart",Pe),()=>{z.removeEventListener("pointerdown",Fe),z.removeEventListener("touchstart",Pe),document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",me),document.removeEventListener("pointercancel",me),document.removeEventListener("touchmove",G),document.removeEventListener("touchend",Te),document.removeEventListener("touchcancel",Te),j.current=null,_.current=!1}},[e,we,S]);const xe={backgroundColor:ae.color,backdropFilter:`blur(${ae.blur}px)`,animationDuration:`${parseInt(Y.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:Bi.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:a?null:ne,className:Je(fe.background,k?ge:ie,{[fe.editor]:a},{[fe.hidden]:!e}),style:{...xe,...H&&!a&&!k?{position:"absolute"}:{}}}),r.jsxs("div",{ref:a?ne:null,className:Je(fe.contentStyle,k?ee:Me,{[fe.editor]:a},{[fe.hidden]:!e}),style:{animationDuration:`${parseInt(Y.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Jr,{onMove:z=>$(z.index),ref:v,className:fe.lightboxSplide,options:{arrows:!1,speed:O.duration?parseInt(O.duration):500,direction:O.direction==="horiz"||O.type==="fade"||O.type==="scale"?"ltr":"ttb",pagination:!1,drag:Q.type==="drag"&&!we,perPage:1,width:"100%",height:"100%",type:O.type==="fade"||O.type==="scale"?"fade":"loop",padding:0,rewind:Q.repeat!=="close",start:0},style:{"--splide-speed":O.duration},children:n.map((z,te)=>{const F=no(ve.position,ve.offset,a),U=`${M.scalingValue(ve.padding.top,a)} ${M.scalingValue(ve.padding.right,a)} ${M.scalingValue(ve.padding.bottom,a)} ${M.scalingValue(ve.padding.left,a)}`,G=O.type==="scale"?(()=>{const{transform:le,...me}=F;return{...me,position:"absolute",padding:U,boxSizing:"border-box","--position-transform":le||"none"}})():{...F,position:"absolute",padding:U,boxSizing:"border-box"};return r.jsx(Zr,{children:r.jsx("div",{className:fe.imgWrapper,onClick:re,children:r.jsx("img",{ref:te===w?B:null,className:Je(fe.imageStyle,{[fe.contain]:z.image.objectFit==="contain",[fe.cover]:z.image.objectFit==="cover",[fe.scaleSlide]:O.type==="scale"}),src:z.image.url,alt:z.image.name??"",style:{...G,pointerEvents:z.image.objectFit==="contain"?"none":"auto"}})})},te)})},S),h.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Je(fe.arrow,{[fe.arrowVertical]:O.direction==="vert"}),style:{color:h.color,"--arrow-hover-color":h.hover},children:r.jsxs("button",{className:fe.arrowInner,style:{transform:`translate(${M.scalingValue(h.offset.x,a)}, ${M.scalingValue(h.offset.y*(O.direction==="horiz"?1:-1),a)}) scale(${h.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=v.current)==null?void 0:z.go("-1")},"aria-label":"Previous",children:[h.arrowsImgUrl&&r.jsx(Qt,{url:h.arrowsImgUrl,fill:h.color,hoverFill:h.hover,className:Je(fe.arrowImg,fe.mirror)}),!h.arrowsImgUrl&&r.jsx(Ea,{color:h.color,className:Je(fe.arrowIcon,fe.arrowImg,fe.mirror)})]})}),r.jsx("div",{className:Je(fe.arrow,fe.nextArrow,{[fe.arrowVertical]:O.direction==="vert"}),style:{color:h.color,"--arrow-hover-color":h.hover},children:r.jsxs("button",{className:fe.arrowInner,style:{transform:`translate(${M.scalingValue(h.offset.x*(O.direction==="horiz"?-1:1),a)}, ${M.scalingValue(h.offset.y,a)}) scale(${h.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=v.current)==null?void 0:z.go("+1")},"aria-label":"Next",children:[h.arrowsImgUrl&&r.jsx(Qt,{url:h.arrowsImgUrl,fill:h.color,hoverFill:h.hover,className:fe.arrowImg}),!h.arrowsImgUrl&&r.jsx(Ea,{color:h.color,className:Je(fe.arrowIcon,fe.arrowImg)})]})})]}),ae.closeIconUrl&&(()=>{const z=no(ae.closeIconAlign,ae.closeIconOffset,a),te=`scale(${ae.closeIconScale})`,F=z.transform?`${z.transform} ${te}`:te;return r.jsx("button",{className:fe.closeButton,style:{...z,transform:F},onClick:D,"aria-label":"Close lightbox",children:r.jsx(Qt,{url:ae.closeIconUrl,fill:ae.closeIconColor??"#000000",hoverFill:ae.closeIconHover??"#cccccc"})})})(),ye&&ye.isActive&&i.imageCaption&&((Ie=n[w])==null?void 0:Ie.imageCaption)&&r.jsx("div",{className:fe.caption,style:{...no(ye.alignment,ye.offset,a),fontFamily:qo(m.fontFamily),fontWeight:m.fontWeight,fontStyle:m.fontStyle,width:c.sizing==="auto"?"max-content":M.scalingValue(c.width,a),letterSpacing:M.scalingValue(p,a),wordSpacing:M.scalingValue(x,a),textAlign:R,fontSize:M.scalingValue(L.fontSize,a),lineHeight:M.scalingValue(L.lineHeight,a),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:y},onClick:z=>z.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:fe.captionTextInner,style:{"--link-color":ye.linkColor,"--link-hover-color":ye.linkHoverColor},children:r.jsx(ui,{content:n[w].imageCaption})})}),oe.isActive&&(()=>{const[z,te]=oe.position.split("-"),F=O.direction==="horiz"?`${z}-left`:oe.position,U=no(F,oe.offset,a),G=()=>{if(O.direction==="horiz"){if(te==="left")return"flex-start";if(te==="center")return"center";if(te==="right")return"flex-end"}else{if(z==="top")return"flex-start";if(z==="middle")return"center";if(z==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:N,className:fe.thumbsWrapper,onClick:le=>Ce(le),style:{position:a?"absolute":"fixed",...U,...O.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:Je(fe.thumbsContainer,{[fe.thumbsContainerVertical]:O.direction==="vert",[fe.thumbsAlignStart]:oe.align==="start",[fe.thumbsAlignCenter]:oe.align==="center",[fe.thumbsAlignEnd]:oe.align==="end"}),style:{gap:M.scalingValue(oe.grid.gap,a),justifyContent:T?"flex-start":G()},children:n.map((le,me)=>{const Te=me===w,Fe=E[me],$e=oe.grid.size*(Te?oe.activeState.scale:1),tt=()=>{if(oe.fit!=="fit")return{};if(!Fe)return O.direction==="horiz"?{height:M.scalingValue($e,a)}:{width:M.scalingValue($e,a)};const de=Fe.width/Fe.height;if(O.direction==="horiz"){const ke=$e,ze=ke*de;return{width:M.scalingValue(ze,a),height:M.scalingValue(ke,a)}}else{const ke=$e,ze=ke/de;return{width:M.scalingValue(ke,a),height:M.scalingValue(ze,a)}}};return r.jsx("button",{className:fe.thumbItem,style:{...O.direction==="horiz"&&oe.fit!=="fit"?{height:M.scalingValue($e,a)}:{},...O.direction==="vert"&&oe.fit!=="fit"?{width:M.scalingValue($e,a)}:{},...oe.fit==="cover"?{width:M.scalingValue($e,a),height:M.scalingValue($e,a)}:{},...tt(),transition:Te?"all 0.25s ease-out":"none",opacity:Te?oe.activeState.opacity/100:oe.opacity/100,"--thumb-hover":oe.activeState.opacity/100},onClick:de=>{var ke;de.stopPropagation(),$(me),(ke=v.current)==null||ke.go(me)},onMouseEnter:()=>{var de;oe.triggers==="hov"&&((de=v.current)==null||de.go(me))},children:r.jsx("img",{src:le.image.url,alt:le.image.name??"",onLoad:de=>{const ke=de.currentTarget;ke.naturalWidth&&ke.naturalHeight&&Z(ze=>({...ze,[me]:{width:ke.naturalWidth,height:ke.naturalHeight}}))},style:{objectFit:oe.fit==="cover"?"cover":"contain",...oe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...oe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${le.image.name}-${me}`)})})})})()]})]}),document.getElementById(s))};function Ea({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 hu={element:mu,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 io(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function fu(e){return`
|
|
6
|
+
*/const rd="RichTextRenderer-module__link___BWeZ2",ad={link:rd},sd=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))},Do=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>sd(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function qt(e){const{color:t,...n}=e;return n}function kt(e,t){var o,s,a;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Do(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:L.scalingValue(e.letterSpacing,t),wordSpacing:L.scalingValue(e.wordSpacing,t),fontSize:L.scalingValue(n,t),lineHeight:i!==void 0?L.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(a=e.textAppearance)==null?void 0:a.fontVariant,textAlign:e.textAlign,color:e.color}}const ui=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:ad.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:ld(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 ld(e){return{...e.fontFamily&&{fontFamily:Do(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 cd="SvgImage-module__svg___q3xE-",dd="SvgImage-module__img___VsTm-",ba={svg:cd,img:dd},ud=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},pd=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Qt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,a]=l.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return l.useEffect(()=>{if(typeof window<"u"&&window.CSS){const u=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');a(u)}},[]),!ud(e)||!s?r.jsx("img",{src:e,alt:"",className:Je(ba.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:Je(ba.svg,i),style:{"--svg":pd(e),"--fill":t,"--hover-fill":n,...o??{}}})},md={"top-left":Ee.topLeftAlignment,"top-center":Ee.topCenterAlignment,"top-right":Ee.topRightAlignment,"middle-left":Ee.middleLeftAlignment,"middle-center":Ee.middleCenterAlignment,"middle-right":Ee.middleRightAlignment,"bottom-left":Ee.bottomLeftAlignment,"bottom-center":Ee.bottomCenterAlignment,"bottom-right":Ee.bottomRightAlignment};function gd({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=l.useState(null),{widthSettings:a,fontSettings:u,letterSpacing:c,textAlign:m,wordSpacing:p,fontSizeLineHeight:E,textAppearance:x,color:C}=n.imageCaption??{},[g,v]=l.useState(void 0),[T,w]=l.useState(null),[$,S]=l.useState(0),[_,I]=l.useState(0),{direction:F,transition:P,controls:R,pagination:Y,imageCaption:y,triggers:M}=e,W=l.useRef(P.type),{x:D,y:te}=e.controls.offset,pe=K=>{o&&o.go(K)};return l.useEffect(()=>{if(!T)return;const K=new ResizeObserver(H=>{if(!o)return;const[Z]=H;v({width:Math.round(Z.contentRect.width),height:Math.round(Z.contentRect.height)})});return K.observe(T),()=>K.unobserve(T)},[T]),l.useEffect(()=>{!o||W.current===P.type||(I(K=>K+1),W.current=P.type)},[P.type]),r.jsx("div",{className:Je(Ee.wrapper,{[Ee.editor]:i}),ref:w,children:r.jsxs("div",{className:Ee.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:P.backgroundColor&&P.type==="fade in"?P.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:Je(Ee.captionBlock),children:r.jsx("div",{className:Ee.captionTextWrapper,children:t.map((K,H)=>r.jsx("div",{className:Je(Ee.captionText,md[y.alignment],{[Ee.withPointerEvents]:H===$&&i,[Ee.active]:H===$}),style:{fontFamily:Do(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:a.sizing==="auto"?"max-content":L.scalingValue(a.width,i),letterSpacing:L.scalingValue(c,i),wordSpacing:L.scalingValue(p,i),textAlign:m,fontSize:L.scalingValue(E.fontSize,i),lineHeight:L.scalingValue(E.lineHeight,i),textTransform:x.textTransform??"none",textDecoration:x.textDecoration??"none",fontVariant:x.fontVariant??"normal",color:C,transitionDuration:P.duration?`${Math.round(parseInt(P.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:Ee.captionTextInner,style:{"--link-hover-color":y.linkHoverColor,"--link-color":y.linkColor,position:"relative",top:L.scalingValue(y.offset.y,i),left:L.scalingValue(y.offset.x,i)},children:r.jsx(ui,{content:K.imageCaption})})},H))})}),r.jsx(Xr,{onMove:K=>{S(K.index)},ref:s,options:{arrows:!1,speed:P.duration?parseInt(P.duration):500,autoplay:M.autoPlay!==null,...M.autoPlay!==null&&{interval:parseInt(M.autoPlay)*1e3},direction:F==="horiz"||P.type==="fade in"?"ltr":"ttb",pagination:!1,drag:M.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:P.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((K,H)=>r.jsx(Yr,{children:r.jsx("div",{className:Ee.sliderItem,children:r.jsx("div",{className:Ee.imgWrapper,children:r.jsx("img",{className:Je(Ee.sliderImage,{[Ee.contain]:K.image.objectFit==="contain",[Ee.cover]:K.image.objectFit==="cover"}),src:K.image.url,alt:K.image.name??""})})})},H))},_),R.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Je(Ee.arrow,{[Ee.arrowVertical]:F==="vert",[Ee.hoverArrow]:R.show==="on hover"}),style:{color:R.color,"--arrow-hover-color":R.hover},children:r.jsxs("button",{onClick:()=>{pe("-1")},className:Ee.arrowInner,style:{transform:`translate(${L.scalingValue(D,i)}, ${L.scalingValue(te*(F==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:[R.arrowsImgUrl&&r.jsx(Qt,{url:R.arrowsImgUrl,fill:R.color,hoverFill:R.hover,className:Je(Ee.arrowImg,Ee.mirror)}),!R.arrowsImgUrl&&r.jsx(xa,{color:R.color,className:Je(Ee.arrowIcon,Ee.arrowImg,Ee.mirror)})]})}),r.jsx("div",{className:Je(Ee.arrow,Ee.nextArrow,{[Ee.arrowVertical]:F==="vert",[Ee.hoverArrow]:R.show==="on hover"}),style:{color:R.color,"--arrow-hover-color":R.hover},children:r.jsxs("button",{className:Ee.arrowInner,onClick:()=>pe("+1"),style:{transform:`translate(${L.scalingValue(D*(F==="horiz"?-1:1),i)}, ${L.scalingValue(te,i)}) scale(${e.controls.scale/100}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:[R.arrowsImgUrl&&r.jsx(Qt,{url:R.arrowsImgUrl,fill:R.color,hoverFill:R.hover,className:Ee.arrowImg}),!R.arrowsImgUrl&&r.jsx(xa,{color:R.color,className:Je(Ee.arrowIcon,Ee.arrowImg)})]})})]}),M.triggersList.click&&r.jsx("div",{className:Ee.clickOverlay,onClick:()=>{o&&o.go("+1")}}),Y.isActive&&r.jsx("div",{className:Je(Ee.pagination,{[Ee.paginationInsideBottom]:Y.position==="inside-1"&&F==="horiz",[Ee.paginationInsideTop]:Y.position==="inside-2"&&F==="horiz",[Ee.paginationOutsideBottom]:Y.position==="outside-1"&&F==="horiz",[Ee.paginationOutsideTop]:Y.position==="outside-2"&&F==="horiz",[Ee.paginationInsideLeft]:Y.position==="inside-1"&&F==="vert",[Ee.paginationInsideRight]:Y.position==="inside-2"&&F==="vert",[Ee.paginationOutsideLeft]:Y.position==="outside-1"&&F==="vert",[Ee.paginationOutsideRight]:Y.position==="outside-2"&&F==="vert",[Ee.paginationVertical]:F==="vert"}),children:r.jsx("div",{className:Ee.paginationInner,style:{backgroundColor:Y.colors[2],transform:`scale(${Y.scale/100}) translate(${L.scalingValue(Y.offset.x,i)}, ${L.scalingValue(Y.offset.y,i)}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:t.map((K,H)=>r.jsx("button",{onClick:()=>{o&&o.go(H)},className:Je(Ee.paginationItem),children:r.jsx("div",{className:Je(Ee.dot,{[Ee.activeDot]:H===$}),style:{backgroundColor:H===$?Y.colors[0]:Y.colors[1],"--pagination-hover-color":Y.hover}})},H))})})]})})}function xa({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 hd={element:gd,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"]}},fd="ImageRevealSlider-module__imageRevealSlider___UE5Ob",yd="ImageRevealSlider-module__image___Qjt-e",vd="ImageRevealSlider-module__link___N-iLG",bd="ImageRevealSlider-module__cursor___2U03d",Qn={imageRevealSlider:fd,image:yd,link:vd,cursor:bd};function wa(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,a=o.naturalHeight/o.naturalWidth*s,u=s/2,c=a/2;if(e>=i.x-u&&e<=i.x+u&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function or(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function xd(e,t,n,i){let o,s;if(t==="custom"){o=n;const a=await or(e);s=a.height/a.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const a=await or(e);s=a.height/a.width*o}else{const a=await or(e);o=a.width,s=a.height}return{width:o,height:s,finalWidth:`${o}px`}}function wd({settings:e,content:t,isEditor:n}){const[i,o]=l.useState(null),[s,a]=l.useState([]),[u,c]=l.useState(0),m=l.useRef(0),[p,E]=l.useState({x:0,y:0}),[x,C]=l.useState(1),[g,v]=l.useState("none"),T=l.useRef({x:0,y:0}),[w,$]=l.useState(!1),{sizeType:S,imageWidth:_,randomRangeImageWidth:I}=e.imageSize,{revealPosition:F,visible:P}=e.position,{cursorType:R,target:Y,defaultCursorScale:y,defaultCursor:M,hoverCursorScale:W,hoverCursor:D}=e.cursor;l.useEffect(()=>{if(!i)return;const K=(U,B)=>{const J=i.getBoundingClientRect(),ie=U-J.left,oe=B-J.top;if(E({x:ie,y:oe}),R==="system"){v("none"),C(1);return}const O=ie,de=oe,f=document.elementFromPoint(J.left+O,J.top+de);if(f&&f.closest("a")){v("none"),C(1);return}const me=wa(O,de,s)||Y==="area"?{img:D??"none",scale:W}:{img:M??"none",scale:y};v(me.img),C(me.scale)},H=U=>{U.stopPropagation(),T.current={x:U.clientX,y:U.clientY},K(U.clientX,U.clientY)},Z=()=>{w&&K(T.current.x,T.current.y)};return i.addEventListener("mousemove",H),window.addEventListener("scroll",Z,!0),()=>{i.removeEventListener("mousemove",H),window.removeEventListener("scroll",Z,!0)}},[i,w,p,R,Y,D,M,W,y,s]),l.useEffect(()=>{w||(v("none"),C(0))},[w]);const te=async(K,H,Z,U={})=>{const{width:B,height:J,finalWidth:ie}=await xd(K.image.url,S,_,I);let oe=0,O=0;F==="same"?(oe=H/2,O=Z/2):(oe=U.x??Math.random()*H,O=U.y??Math.random()*Z);const de=Math.min(Math.max(oe,B/2),H-B/2),f=Math.min(Math.max(O,J/2),Z-J/2);return{id:m.current++,url:K.image.url,link:K.link,name:K.image.name,x:de,y:f,width:ie}};l.useEffect(()=>{if(!i||t.length===0)return;const K=i.getBoundingClientRect(),H=K.width,Z=K.height,U=[];(async()=>{const J=t[0],ie=await te(J,H,Z);U.push(ie),a(U),c(1)})()},[S,_,I,F,i]),l.useEffect(()=>{P==="last One"&&a(K=>K.length>0?[K[K.length-1]]:[])},[P]);const pe=async K=>{if(!i)return;const H=i.getBoundingClientRect(),Z=K.clientX-H.left,U=K.clientY-H.top;if(Y==="image"&&!wa(Z,U,s))return;let B=0,J=0;F==="on Click"?(B=Z,J=U):F==="same"?(B=H.width/2,J=H.height/2):(B=Math.random()*H.width,J=Math.random()*H.height);const ie=t[u],oe=await te(ie,H.width,H.height,{x:B,y:J});a(O=>P==="all"?[...O,oe]:[oe]),c(O=>O>=t.length-1?0:O+1)};return r.jsxs("div",{ref:o,onClick:pe,onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),className:Qn.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[s.map(K=>r.jsx("div",{className:Qn.wrapper,style:{top:`${K.y}px`,left:`${K.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:K.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:Y==="area"&&K.link?r.jsx("a",{href:K.link,target:"_blank",className:Qn.link,children:r.jsx("img",{src:K.url,alt:K.name,className:Qn.image},K.id)}):r.jsx("img",{src:K.url,alt:K.name,className:Qn.image},K.id)},K.id)),w&&r.jsx("div",{className:Qn.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${x})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const $d={element:wd,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:""}]}}}},Sd="LightBox-module__hidden___9s-9x",Cd="LightBox-module__heroImage___sTxNF",Td="LightBox-module__background___rm9ml",Ld="LightBox-module__editor___4ACaY",Ed="LightBox-module__contentStyle___Bgnsq",Pd="LightBox-module__imageStyle___tLIlB",Id="LightBox-module__imgWrapper___LuFUp",Rd="LightBox-module__contain___8-yaS",Ad="LightBox-module__cover___hNvOG",kd="LightBox-module__caption___b6L2I",Md="LightBox-module__captionTextInner___rCGNH",_d="LightBox-module__lightboxSplide___XFuWC",Fd="LightBox-module__arrow___iz38X",Wd="LightBox-module__arrowVertical___Zfz81",Nd="LightBox-module__nextArrow___zkAQN",Hd="LightBox-module__arrowInner___p48sW",Od="LightBox-module__arrowIcon___3VaFf",Bd="LightBox-module__arrowImg___pNV88",jd="LightBox-module__mirror___pjeXc",zd="LightBox-module__thumbsWrapper___GB-nU",Vd="LightBox-module__thumbsContainerVertical___wttk5",Dd="LightBox-module__thumbsContainer___osSma",qd="LightBox-module__thumbsAlignStart___MO6tY",Kd="LightBox-module__thumbsAlignCenter___Q4sUx",Gd="LightBox-module__thumbsAlignEnd___p4y9R",Ud="LightBox-module__thumbItem___HvnF3",Xd="LightBox-module__closeButton___g2khP",Yd="LightBox-module__fadeIn___0m5GW",Jd="LightBox-module__slideInLeft___gPYwC",Zd="LightBox-module__slideInRight___S-pPp",Qd="LightBox-module__slideInTop___DFdAj",eu="LightBox-module__slideInBottom___m27kZ",tu="LightBox-module__fadeOut___55qBR",nu="LightBox-module__slideOutLeft___NvU7P",iu="LightBox-module__slideOutRight___SK7eC",ou="LightBox-module__slideOutTop___Vgg0z",ru="LightBox-module__slideOutBottom___nJ0Ef",au="LightBox-module__scaleSlide___vZriG",fe={hidden:Sd,heroImage:Cd,background:Td,editor:Ld,contentStyle:Ed,imageStyle:Pd,imgWrapper:Id,contain:Rd,cover:Ad,caption:kd,captionTextInner:Md,lightboxSplide:_d,arrow:Fd,arrowVertical:Wd,nextArrow:Nd,arrowInner:Hd,arrowIcon:Od,arrowImg:Bd,mirror:jd,thumbsWrapper:zd,thumbsContainerVertical:Vd,thumbsContainer:Dd,thumbsAlignStart:qd,thumbsAlignCenter:Kd,thumbsAlignEnd:Gd,thumbItem:Ud,closeButton:Xd,fadeIn:Yd,slideInLeft:Jd,slideInRight:Zd,slideInTop:Qd,slideInBottom:eu,fadeOut:tu,slideOutLeft:nu,slideOutRight:iu,slideOutTop:ou,slideOutBottom:ru,scaleSlide:au},no=(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% + ${L.scalingValue(t.x,n)}), calc(-50% + ${L.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${L.scalingValue(t.x,n)}, calc(-50% + ${L.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${L.scalingValue(t.x,n)}), ${L.scalingValue(t.y,n)})`:i.transform=`translate(${L.scalingValue(t.x,n)}, ${L.scalingValue(t.y,n)})`,i};function Vs(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 $a(e){const t=e.getBoundingClientRect(),n=Vs(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,a=e.naturalHeight,u=i/o,c=s/a;let m,p;c>u?(m=i,p=i/c):(p=o,m=o*c);const E=t.left+n.left,x=t.top+n.top,C=(i-m)/2+E,g=(o-p)/2+x;return{x:C,y:g,width:m,height:p}}function Sa(e){const t=e.getBoundingClientRect(),n=Vs(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ca(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 su(e,t){const n=(()=>{if(e==="fade in")return fe.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return fe.slideInLeft;case"right":return fe.slideInRight;case"top":return fe.slideInTop;case"bottom":return fe.slideInBottom;default:return fe.slideInRight}return fe.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return fe.fadeIn;if(e==="slide in")switch(t){case"left":return fe.slideInLeft;case"right":return fe.slideInRight;case"top":return fe.slideInTop;case"bottom":return fe.slideInBottom;default:return fe.slideInRight}return fe.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return fe.fadeOut;if(e==="slide in")switch(t){case"left":return fe.slideOutLeft;case"right":return fe.slideOutRight;case"top":return fe.slideOutTop;case"bottom":return fe.slideOutBottom;default:return fe.slideOutRight}return fe.fadeOut})(),s=(()=>{if(e==="fade in")return fe.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return fe.slideOutLeft;case"right":return fe.slideOutRight;case"top":return fe.slideOutTop;case"bottom":return fe.slideOutBottom;default:return fe.slideOutRight}return fe.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const lu=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:a})=>{const[u,c]=l.useState(!1),{url:m}=e.thumbnailBlock.cover;return l.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:m,alt:"Cover",className:fe.heroImage,onClick:()=>c(!0)}),r.jsx(cu,{isOpen:u,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},cu=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:a,metadata:u})=>{var Ie;const{widthSettings:c,fontSettings:m,letterSpacing:p,textAlign:E,wordSpacing:x,fontSizeLineHeight:C,textAppearance:g,color:v}=i.imageCaption??{},[T,w]=l.useState(0),[$,S]=l.useState(0),[_,I]=l.useState(!1),[F,P]=l.useState(!1),[R,Y]=l.useState({}),y=l.useRef(null),M=l.useRef(null),W=l.useRef(null),D=l.useRef(!1),te=l.useRef(null),pe=l.useRef(null),K=l.useRef(null),H=l.useRef(null),Z=l.useRef(!1),U=l.useRef(null),[B,J]=l.useState(!1),{appear:ie,triggers:oe,slider:O,thumbnail:de,controls:f,area:me,caption:ye,layout:ve}=o.lightboxBlock,{appearClass:Ae,backdropAppearClass:ee,backdropDisappearClass:ge,disappearClass:X}=su(ie.type,ie.direction),G=(u==null?void 0:u.itemId)??null;l.useEffect(()=>{const N=()=>{setTimeout(()=>{var A,q;(q=(A=y.current)==null?void 0:A.splide)==null||q.refresh()},16)},Q=()=>{S(A=>A+1)};return window.addEventListener("ArticleEditor.Layout:change",N),window.addEventListener("ArticleEditor.ComponentContent:change",Q),()=>{window.removeEventListener("ArticleEditor.Layout:change",N),window.removeEventListener("ArticleEditor.ComponentContent:change",Q)}},[]),l.useEffect(()=>{if(!e||!de.isActive){J(!1);return}const N=U.current;if(!N)return;const Q=()=>{O.direction==="horiz"?J(N.scrollWidth>N.clientWidth):J(N.scrollHeight>N.clientHeight)};Q();const A=new ResizeObserver(Q);return A.observe(N),()=>A.disconnect()},[e,de.isActive,n.length,R,O.direction]);const j=l.useCallback(()=>{const N=window.matchMedia("(max-width: 768px)").matches,Q=Ca(me.color);N&&!a&&Q>.9&&(document.body.style.backgroundColor=""),I(!0),D.current=!0;const A=q=>{q.target===te.current&&q.animationName&&(te.current&&pe.current&&te.current.removeEventListener("animationend",pe.current),pe.current=null,D.current&&(D.current=!1,t()),I(!1))};te.current&&(pe.current=A,te.current.addEventListener("animationend",A))},[t,me.color,a]),he=(N,Q,A)=>{var q,V;if(N){if(oe.type==="click"&&oe.switch==="image")oe.repeat==="close"&&T===n.length-1?j():(q=y.current)==null||q.go("+1");else if(oe.type==="click"&&oe.switch==="50/50"){const ae=N.getBoundingClientRect(),ue=Q-ae.left,Te=A-ae.top,Fe=ae.width,Pe=ae.height;let $e;O.direction==="horiz"?$e=ue<Fe/2?"-1":"+1":$e=Te<Pe/2?"-1":"+1",(V=y.current)==null||V.go($e)}}},ne=N=>{if(Z.current){Z.current=!1;return}const Q=n[T],A=(Q==null?void 0:Q.image.objectFit)==="cover";let q,V;if("changedTouches"in N&&N.changedTouches.length>0)q=N.changedTouches[0].clientX,V=N.changedTouches[0].clientY;else if("clientX"in N)q=N.clientX,V=N.clientY;else return;let ae;if(A&&W.current){const ue=Sa(W.current);ae=q>=ue.left&&q<=ue.right&&V>=ue.top&&V<=ue.bottom}else{const ue=W.current?$a(W.current):null;if(!ue){N.target===N.currentTarget&&j();return}ae=q>=ue.x&&q<=ue.x+ue.width&&V>=ue.y&&V<=ue.y+ue.height}ae?he(W.current,q,V):j()},Ce=N=>{const Q=N.target;(Q.classList.contains(fe.thumbsWrapper)||Q.classList.contains(fe.thumbsContainer))&&ne(N)};l.useEffect(()=>{if(!e)return;const N=Q=>{var A,q;if(Q.key==="Escape"){j();return}if(Q.key==="ArrowRight"){w(V=>(V+1)%Math.max(n.length,1)),(A=y.current)==null||A.go("+1");return}Q.key==="ArrowLeft"&&(w(V=>(V-1+Math.max(n.length,1))%Math.max(n.length,1)),(q=y.current)==null||q.go("-1"))};return window.addEventListener("keydown",N),()=>{window.removeEventListener("keydown",N)}},[e,j,n.length]),l.useEffect(()=>{if(e){if(w(0),S(Q=>Q+1),D.current=!1,I(!1),P(!1),Y({}),!G)return;const N=new CustomEvent("page-overlay",{detail:{itemId:G}});window.dispatchEvent(N)}return()=>{te.current&&pe.current&&(te.current.removeEventListener("animationend",pe.current),pe.current=null),P(!1)}},[e,G]),l.useEffect(()=>{M.current!==null&&M.current!==O.type&&S(N=>N+1),M.current=O.type},[O.type]),l.useEffect(()=>{if(!e)return;const N=document.body.style.overflow,Q=window.matchMedia("(max-width: 768px)").matches,A=Ca(me.color);document.body.style.overflow="hidden",P(!1);const q=ae=>{ae.target===te.current&&!D.current&&ae.animationName&&(Q&&!a&&A>.9&&(document.body.style.backgroundColor=me.color),P(!0),te.current&&K.current&&te.current.removeEventListener("animationend",K.current),K.current=null)};te.current&&(K.current=q,te.current.addEventListener("animationend",q));const V=ae=>{const ue=ae.target;ue&&(ue.closest(`.${fe.thumbsWrapper}`)||ue.closest(`.${fe.thumbsContainer}`))||O.type!=="slide"&&ae.preventDefault()};return document.addEventListener("touchmove",V,{passive:!1}),()=>{document.body.style.overflow=N,document.removeEventListener("touchmove",V),te.current&&K.current&&(te.current.removeEventListener("animationend",K.current),K.current=null),P(!1)}},[e,a,me.color,O.type]),l.useEffect(()=>{if(!e)return;const N=Q=>{var q,V;if(D.current){Q.stopPropagation();return}if(Z.current){Z.current=!1;return}const A=Q.target;if(!(A&&(A.closest(`.${fe.thumbsContainer}`)||A.closest(`.${fe.thumbItem}`)||A.closest(`.${fe.arrow}`)||A.closest(`.${fe.closeButton}`)||A.closest(`.${fe.caption}`)))){if(O.type==="slide"&&oe.type==="drag"&&((V=(q=y.current)==null?void 0:q.splide)!=null&&V.root)){const ae=y.current.splide.root;if(A&&(ae.contains(A)||ae===A))return}if(Q.touches.length===0&&Q.changedTouches.length>0){const ae=n[T],ue=(ae==null?void 0:ae.image.objectFit)==="cover",Te=Q.changedTouches[0];let Fe;if(ue&&W.current){const Pe=Sa(W.current);Fe=Te.clientX>=Pe.left&&Te.clientX<=Pe.right&&Te.clientY>=Pe.top&&Te.clientY<=Pe.bottom}else{const Pe=W.current?$a(W.current):null;if(!Pe)return;Fe=Te.clientX>=Pe.x&&Te.clientX<=Pe.x+Pe.width&&Te.clientY>=Pe.y&&Te.clientY<=Pe.y+Pe.height}if(!Fe){Q.stopPropagation(),D.current=!0;const Pe=$e=>{$e.stopPropagation(),$e.preventDefault(),document.removeEventListener("click",Pe,!0)};document.addEventListener("click",Pe,!0),j()}}}};return document.addEventListener("touchend",N,{passive:!0}),()=>{document.removeEventListener("touchend",N)}},[e,j,T,n]);const we=(O.type==="scale"||O.type==="fade")&&O.direction==="vert"&&oe.type==="drag";l.useEffect(()=>{var $e,tt;if(!e||!we||!((tt=($e=y.current)==null?void 0:$e.splide)!=null&&tt.root))return;const N=y.current.splide.root,Q=30,A=(se,ke)=>{if(H.current){const ze=Math.abs(se-H.current.x),Ve=Math.abs(ke-H.current.y);(ze>0||Ve>0)&&(Z.current=!0)}},q=se=>{H.current&&(se.preventDefault(),A(se.clientX,se.clientY))},V=se=>{H.current&&se.touches.length>0&&(se.preventDefault(),A(se.touches[0].clientX,se.touches[0].clientY))},ae=(se,ke)=>{if(!H.current||!y.current){H.current=null;return}const ze=Math.abs(se-H.current.x),Ve=Math.abs(ke-H.current.y);Ve>Q&&Ve>ze&&y.current.go(ke<H.current.y?"+1":"-1"),H.current=null},ue=se=>{H.current&&ae(se.clientX,se.clientY),document.removeEventListener("pointerup",ue),document.removeEventListener("pointercancel",ue),document.removeEventListener("pointermove",q)},Te=se=>{if(H.current){if(se.changedTouches.length>0){const ke=se.changedTouches[0];ae(ke.clientX,ke.clientY)}document.removeEventListener("touchend",Te),document.removeEventListener("touchcancel",Te),document.removeEventListener("touchmove",V)}},Fe=se=>{H.current={x:se.clientX,y:se.clientY},Z.current=!1,document.addEventListener("pointermove",q,{passive:!1}),document.addEventListener("pointerup",ue),document.addEventListener("pointercancel",ue)},Pe=se=>{se.touches.length>0&&(H.current={x:se.touches[0].clientX,y:se.touches[0].clientY},Z.current=!1,document.addEventListener("touchmove",V,{passive:!1}),document.addEventListener("touchend",Te),document.addEventListener("touchcancel",Te))};return N.addEventListener("pointerdown",Fe),N.addEventListener("touchstart",Pe),()=>{N.removeEventListener("pointerdown",Fe),N.removeEventListener("touchstart",Pe),document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",ue),document.removeEventListener("pointercancel",ue),document.removeEventListener("touchmove",V),document.removeEventListener("touchend",Te),document.removeEventListener("touchcancel",Te),H.current=null,Z.current=!1}},[e,we,$]);const xe={backgroundColor:me.color,backdropFilter:`blur(${me.blur}px)`,animationDuration:`${parseInt(ie.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:Bi.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:a?null:te,className:Je(fe.background,_?ge:ee,{[fe.editor]:a},{[fe.hidden]:!e}),style:{...xe,...F&&!a&&!_?{position:"absolute"}:{}}}),r.jsxs("div",{ref:a?te:null,className:Je(fe.contentStyle,_?X:Ae,{[fe.editor]:a},{[fe.hidden]:!e}),style:{animationDuration:`${parseInt(ie.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Xr,{onMove:N=>w(N.index),ref:y,className:fe.lightboxSplide,options:{arrows:!1,speed:O.duration?parseInt(O.duration):500,direction:O.direction==="horiz"||O.type==="fade"||O.type==="scale"?"ltr":"ttb",pagination:!1,drag:oe.type==="drag"&&!we,perPage:1,width:"100%",height:"100%",type:O.type==="fade"||O.type==="scale"?"fade":"loop",padding:0,rewind:oe.repeat!=="close",start:0},style:{"--splide-speed":O.duration},children:n.map((N,Q)=>{const A=no(ve.position,ve.offset,a),q=`${L.scalingValue(ve.padding.top,a)} ${L.scalingValue(ve.padding.right,a)} ${L.scalingValue(ve.padding.bottom,a)} ${L.scalingValue(ve.padding.left,a)}`,V=O.type==="scale"?(()=>{const{transform:ae,...ue}=A;return{...ue,position:"absolute",padding:q,boxSizing:"border-box","--position-transform":ae||"none"}})():{...A,position:"absolute",padding:q,boxSizing:"border-box"};return r.jsx(Yr,{children:r.jsx("div",{className:fe.imgWrapper,onClick:ne,children:r.jsx("img",{ref:Q===T?W:null,className:Je(fe.imageStyle,{[fe.contain]:N.image.objectFit==="contain",[fe.cover]:N.image.objectFit==="cover",[fe.scaleSlide]:O.type==="scale"}),src:N.image.url,alt:N.image.name??"",style:{...V,pointerEvents:N.image.objectFit==="contain"?"none":"auto"}})})},Q)})},$),f.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Je(fe.arrow,{[fe.arrowVertical]:O.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:fe.arrowInner,style:{transform:`translate(${L.scalingValue(f.offset.x,a)}, ${L.scalingValue(f.offset.y*(O.direction==="horiz"?1:-1),a)}) scale(${f.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var N;return(N=y.current)==null?void 0:N.go("-1")},"aria-label":"Previous",children:[f.arrowsImgUrl&&r.jsx(Qt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:Je(fe.arrowImg,fe.mirror)}),!f.arrowsImgUrl&&r.jsx(Ta,{color:f.color,className:Je(fe.arrowIcon,fe.arrowImg,fe.mirror)})]})}),r.jsx("div",{className:Je(fe.arrow,fe.nextArrow,{[fe.arrowVertical]:O.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:fe.arrowInner,style:{transform:`translate(${L.scalingValue(f.offset.x*(O.direction==="horiz"?-1:1),a)}, ${L.scalingValue(f.offset.y,a)}) scale(${f.scale}) rotate(${O.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var N;return(N=y.current)==null?void 0:N.go("+1")},"aria-label":"Next",children:[f.arrowsImgUrl&&r.jsx(Qt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:fe.arrowImg}),!f.arrowsImgUrl&&r.jsx(Ta,{color:f.color,className:Je(fe.arrowIcon,fe.arrowImg)})]})})]}),me.closeIconUrl&&(()=>{const N=no(me.closeIconAlign,me.closeIconOffset,a),Q=`scale(${me.closeIconScale})`,A=N.transform?`${N.transform} ${Q}`:Q;return r.jsx("button",{className:fe.closeButton,style:{...N,transform:A},onClick:j,"aria-label":"Close lightbox",children:r.jsx(Qt,{url:me.closeIconUrl,fill:me.closeIconColor??"#000000",hoverFill:me.closeIconHover??"#cccccc"})})})(),ye&&ye.isActive&&i.imageCaption&&((Ie=n[T])==null?void 0:Ie.imageCaption)&&r.jsx("div",{className:fe.caption,style:{...no(ye.alignment,ye.offset,a),fontFamily:Do(m.fontFamily),fontWeight:m.fontWeight,fontStyle:m.fontStyle,width:c.sizing==="auto"?"max-content":L.scalingValue(c.width,a),letterSpacing:L.scalingValue(p,a),wordSpacing:L.scalingValue(x,a),textAlign:E,fontSize:L.scalingValue(C.fontSize,a),lineHeight:L.scalingValue(C.lineHeight,a),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:v},onClick:N=>N.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:fe.captionTextInner,style:{"--link-color":ye.linkColor,"--link-hover-color":ye.linkHoverColor},children:r.jsx(ui,{content:n[T].imageCaption})})}),de.isActive&&(()=>{const[N,Q]=de.position.split("-"),A=O.direction==="horiz"?`${N}-left`:de.position,q=no(A,de.offset,a),V=()=>{if(O.direction==="horiz"){if(Q==="left")return"flex-start";if(Q==="center")return"center";if(Q==="right")return"flex-end"}else{if(N==="top")return"flex-start";if(N==="middle")return"center";if(N==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:U,className:fe.thumbsWrapper,onClick:ae=>Ce(ae),style:{position:a?"absolute":"fixed",...q,...O.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:Je(fe.thumbsContainer,{[fe.thumbsContainerVertical]:O.direction==="vert",[fe.thumbsAlignStart]:de.align==="start",[fe.thumbsAlignCenter]:de.align==="center",[fe.thumbsAlignEnd]:de.align==="end"}),style:{gap:L.scalingValue(de.grid.gap,a),justifyContent:B?"flex-start":V()},children:n.map((ae,ue)=>{const Te=ue===T,Fe=R[ue],$e=de.grid.size*(Te?de.activeState.scale:1),tt=()=>{if(de.fit!=="fit")return{};if(!Fe)return O.direction==="horiz"?{height:L.scalingValue($e,a)}:{width:L.scalingValue($e,a)};const se=Fe.width/Fe.height;if(O.direction==="horiz"){const ke=$e,ze=ke*se;return{width:L.scalingValue(ze,a),height:L.scalingValue(ke,a)}}else{const ke=$e,ze=ke/se;return{width:L.scalingValue(ke,a),height:L.scalingValue(ze,a)}}};return r.jsx("button",{className:fe.thumbItem,style:{...O.direction==="horiz"&&de.fit!=="fit"?{height:L.scalingValue($e,a)}:{},...O.direction==="vert"&&de.fit!=="fit"?{width:L.scalingValue($e,a)}:{},...de.fit==="cover"?{width:L.scalingValue($e,a),height:L.scalingValue($e,a)}:{},...tt(),transition:Te?"all 0.25s ease-out":"none",opacity:Te?de.activeState.opacity/100:de.opacity/100,"--thumb-hover":de.activeState.opacity/100},onClick:se=>{var ke;se.stopPropagation(),w(ue),(ke=y.current)==null||ke.go(ue)},onMouseEnter:()=>{var se;de.triggers==="hov"&&((se=y.current)==null||se.go(ue))},children:r.jsx("img",{src:ae.image.url,alt:ae.image.name??"",onLoad:se=>{const ke=se.currentTarget;ke.naturalWidth&&ke.naturalHeight&&Y(ze=>({...ze,[ue]:{width:ke.naturalWidth,height:ke.naturalHeight}}))},style:{objectFit:de.fit==="cover"?"cover":"contain",...de.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...de.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ae.image.name}-${ue}`)})})})})()]})]}),document.getElementById(s))};function Ta({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 du={element:lu,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 io(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function uu(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
|
|
158
|
+
`}function pu({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:s}){const a=!!n,u=i&&t||!t,{prefix:c}=L.useScopedStyles(),{type:m="A",fieldsToShow:p=2,fields:E=[],buttonLabel:x,gap:C,fieldsGap:g,buttonCorners:v,buttonStroke:T,buttonPadding:w,isButtonFullWidth:$,inputCorners:S,inputStroke:_,inputPadding:I,inputColor:F,inputTextColor:P,inputBorderColor:R,placeholderColor:Y,buttonColor:y,buttonTextColor:M,buttonBorderColor:W,labelTextColor:D,successColor:te,errorColor:pe,fontFamily:K,inputFontSettings:H,inputFontSize:Z,inputLineHeight:U,inputLetterSpacing:B,inputWordSpacing:J,inputTextAppearance:ie,buttonFontSettings:oe,buttonFontSize:O,buttonLineHeight:de,buttonLetterSpacing:f,buttonWordSpacing:me,buttonTextAppearance:ye,labelFontSettings:ve,labelFontSize:Ae,labelLineHeight:ee,labelLetterSpacing:ge,labelWordSpacing:X,labelTextAppearance:G,statusFontSettings:j,statusFontSize:he,statusLineHeight:ne,statusLetterSpacing:Ce,statusWordSpacing:we,statusTextAppearance:xe,successMessage:Ie,errorMessage:N,stateOverrides:Q}=e,A=m==="B",q=E.slice(0,Math.min(p,E.length)),V={fontSettings:{fontFamily:K,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:Z??.01,lineHeight:U,letterSpacing:B??0,wordSpacing:J??0,textAppearance:ie,color:P},ae=qt(kt(V,t)),ue=L.scalingValue(_??0,t),Te=L.scalingValue((U??Z??.01)+((I==null?void 0:I.top)??0)+((I==null?void 0:I.bottom)??0)+(m==="C"?_??0:(_??0)*2),t),Fe={...ae,borderStyle:"solid",borderRadius:m==="C"?0:L.scalingValue(S??0,t),...m==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:ue,borderLeftWidth:0}:{borderWidth:ue},paddingTop:L.scalingValue((I==null?void 0:I.top)??0,t),paddingRight:L.scalingValue((I==null?void 0:I.right)??0,t),paddingBottom:L.scalingValue((I==null?void 0:I.bottom)??0,t),paddingLeft:L.scalingValue((I==null?void 0:I.left)??0,t),height:Te,minHeight:Te},Pe={fontSettings:{fontFamily:K,fontWeight:(oe==null?void 0:oe.fontWeight)??400,fontStyle:(oe==null?void 0:oe.fontStyle)??"normal"},fontSize:O??.01,lineHeight:de,letterSpacing:f??0,wordSpacing:me??0,textAppearance:ye,color:M},$e=qt(kt(Pe,t)),tt=L.scalingValue(T??0,t),se={fontSettings:{fontFamily:K,fontWeight:(ve==null?void 0:ve.fontWeight)??400,fontStyle:(ve==null?void 0:ve.fontStyle)??"normal"},fontSize:Ae??.01,lineHeight:ee,letterSpacing:ge??0,wordSpacing:X??0,textAppearance:G,color:D},ke=kt(se,t),ze={fontSettings:{fontFamily:K,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:he??.01,lineHeight:ne,letterSpacing:Ce??0,wordSpacing:we??0,textAppearance:xe,color:te},Ve=qt(kt(ze,t)),dt=L.buildColorVars(c,{inputColor:F,inputTextColor:P,inputBorderColor:R,placeholderColor:Y!=null&&Y.trim()?Y:"#cccccc",buttonColor:y,buttonTextColor:M,buttonBorderColor:W,labelTextColor:D,successColor:te,errorColor:pe},mu,gu,Q),[ft,Pt]=l.useState(()=>Object.fromEntries(q.map(Oe=>[Oe.name,""]))),[xt,wt]=l.useState("idle"),[Ht,Lt]=l.useState(null),Ge=s==="success"?"success":s==="error"?"error":xt,Re=s==="error"?N:Ht,Be=s==="filled",Ue=l.useMemo(()=>{if(!Be)return ft;let Oe=null;for(const gt of q)(ft[gt.name]??"").trim().length>0||(Oe=Oe??{...ft},Oe[gt.name]="Filled");return Oe??ft},[ft,Be,q]),He=Ge==="error"?L.getFormFieldValidationError(q,Ue):null,It=`${s&&s!=="default"?`${c}-state-${s}`:""}`.trim(),Ze=o==null?void 0:o.submitUrl,Mt=(Oe,gt)=>{Pt(it=>({...it,[Oe]:gt}))},Ot=async Oe=>{if(Oe.preventDefault(),!u)return;const gt=Object.fromEntries(q.map(Ye=>{var rt;return[Ye.name,((rt=ft[Ye.name])==null?void 0:rt.trim())??""]}).filter(([,Ye])=>Ye));if(!Ze){wt("error"),Lt("No integrations were found for this form.");return}if(Object.keys(gt).length===0)return;const it=L.getFormFieldValidationError(q,ft);if(it){wt("error"),Lt(it);return}wt("submitting"),Lt(null);try{const Ye=await fetch(Ze,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(gt)});if(!Ye.ok){const rt=await Ye.text();throw new Error(rt||`Request failed: ${Ye.status}`)}wt("success"),Pt(Object.fromEntries(q.map(rt=>[rt.name,""])))}catch(Ye){wt("error"),Lt(Ye instanceof Error?Ye.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${m} ${It}`.trim(),style:dt,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:uu(c)}}),r.jsxs("form",{onSubmit:Ot,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:q.map((Oe,gt)=>r.jsxs(l.Fragment,{children:[gt>0&&r.jsx("div",{"data-controls":a?"fieldsGap":void 0,className:a?`${c}-control`:void 0,style:{height:L.scalingValue(g??0,t)}}),r.jsxs("div",{className:`${c}-field-group${A?` ${c}-labeled`:""}`,children:[A&&r.jsx("span",{className:`${c}-field-label`,style:ke?{...ke,lineHeight:ke.fontSize}:void 0,children:Oe.label||Oe.name}),Oe.type==="textarea"?r.jsx("textarea",{name:Oe.name,autoComplete:"off",value:Ue[Oe.name]??"",onChange:it=>Mt(Oe.name,it.target.value),placeholder:Oe.placeholder,className:`${c}-input`,style:Fe,rows:1,"data-filled":Be||(Ue[Oe.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:Oe.type==="phone"?"tel":Oe.type==="email"?"email":"text",name:Oe.name,autoComplete:"off",value:Ue[Oe.name]??"",onChange:it=>Mt(Oe.name,it.target.value),placeholder:Oe.placeholder,required:Oe.isRequired??Oe.type==="email",className:`${c}-input`,style:Fe,"data-filled":Be||(Ue[Oe.name]??"").trim().length>0})]})]},gt))}),r.jsx("div",{"data-controls":a?"gap":void 0,className:a?`${c}-control`:void 0,style:{height:L.scalingValue(C??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:u?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:L.scalingValue(v??0,t),borderWidth:tt,paddingTop:L.scalingValue((w==null?void 0:w.top)??0,t),paddingRight:L.scalingValue((w==null?void 0:w.right)??0,t),paddingBottom:L.scalingValue((w==null?void 0:w.bottom)??0,t),paddingLeft:L.scalingValue((w==null?void 0:w.left)??0,t),pointerEvents:u?"auto":void 0,...$e,...$?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:$?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:xt==="submitting"?"...":x})})})]}),Ge==="success"&&r.jsx("p",{className:`${c}-success`,style:{...Ve},children:Ie}),Ge==="error"&&r.jsx("p",{className:`${c}-error`,style:{...Ve},role:"alert",children:He??Re??N})]})}const mu={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"},gu=["hover","focus","filled","success","error"],hu=`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';
|
|
@@ -789,7 +789,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
789
789
|
};
|
|
790
790
|
|
|
791
791
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
792
|
-
`,wu=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],oo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},$u=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Su={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...oo.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...oo.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...oo.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...oo.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:wu,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...$u],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Cu={element:yu,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:Su,sourceCode:xu,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"settings.fontFamily"}]}};function ro(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Tu(e){return`
|
|
792
|
+
`,fu=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],oo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},yu=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],vu={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...oo.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...oo.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...oo.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...oo.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:fu,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...yu],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},bu={element:pu,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:vu,sourceCode:hu,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function ro(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function xu(e){return`
|
|
793
793
|
.${e}-wrapper {
|
|
794
794
|
display: flex;
|
|
795
795
|
flex-direction: column;
|
|
@@ -980,7 +980,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
980
980
|
font-size: ${ro(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const
|
|
983
|
+
`}const wu=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:s}=L.useScopedStyles(),a=n&&t||!t,{fields:u=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:m,fieldsToShow:p=1,fontFamily:E,inputFontSettings:x,inputFontSize:C,inputLineHeight:g,inputLetterSpacing:v,inputWordSpacing:T,inputTextAppearance:w,buttonFontSettings:$,buttonFontSize:S,buttonLineHeight:_,buttonLetterSpacing:I,buttonWordSpacing:F,buttonTextAppearance:P,statusFontSettings:R,statusFontSize:Y,statusLineHeight:y,statusLetterSpacing:M,statusWordSpacing:W,statusTextAppearance:D,iconMaxWidth:te,minHeight:pe,corners:K,stroke:H,stateOverrides:Z,inputPadding:U,buttonPadding:B,successMessage:J="Thanks for subscribing!",errorMessage:ie="Please, fill all required fields."}=e,oe=u.slice(0,Math.min(p,u.length)),[O,de]=l.useState(()=>Object.fromEntries(oe.map(se=>[se.name,""]))),[f,me]=l.useState("idle"),[ye,ve]=l.useState(null),Ae=o==="success"?"success":o==="error"?"error":f,ee=o==="error"?ie:ye,ge=o==="filled",X=l.useMemo(()=>{if(!ge)return O;let se=null;for(const ke of oe)(O[ke.name]??"").trim().length>0||(se=se??{...O},se[ke.name]="Filled");return se??O},[ge,O,oe]),G=Ae==="error"?L.getFormFieldValidationError(oe,X):null,j=o&&o!=="default"?`${s}-state-${o}`:"",he=oe.some(se=>(X[se.name]??"").trim().length>0),ne=j!==`${s}-state-filled`&&he?`${s}-state-filled`:"",Ce=`${j} ${ne}`.trim(),we=i==null?void 0:i.submitUrl,xe=m??"",Ie=(c==null?void 0:c.icon)??"",N=(c==null?void 0:c.mode)==="On",Q=xe||"Submit",A={fontSettings:{fontFamily:E,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:C??.01,lineHeight:g,letterSpacing:v??0,wordSpacing:T??0,textAppearance:w,color:e.inputTextColor??"#111111"},q={fontSettings:{fontFamily:E,fontWeight:($==null?void 0:$.fontWeight)??400,fontStyle:($==null?void 0:$.fontStyle)??"normal"},fontSize:S??.01,lineHeight:_,letterSpacing:I??0,wordSpacing:F??0,textAppearance:P,color:e.buttonTextColor??"#ffffff"},V={fontSettings:{fontFamily:E,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:Y??.01,lineHeight:y,letterSpacing:M??0,wordSpacing:W??0,textAppearance:D,color:e.successColor??"#22c55e"},ae=qt(kt(A,t)),ue=qt(kt(q,t)),Te=qt(kt(V,t)),Fe=L.buildColorVars(s,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(A==null?void 0:A.color)??"#111111",buttonTextColor:e.buttonTextColor??(q==null?void 0:q.color)??"#ffffff"},$u,Su,Z),Pe={borderRadius:L.scalingValue(K,t),borderWidth:L.scalingValue(H,t),borderStyle:"solid"},$e={borderLeftWidth:L.scalingValue(H,t)},tt=async se=>{if(se.preventDefault(),!a)return;const ke=Object.fromEntries(oe.map(Ve=>{var dt;return[Ve.name,((dt=O[Ve.name])==null?void 0:dt.trim())??""]}).filter(([,Ve])=>Ve));if(!we){me("error"),ve("No integrations were found for this form.");return}if(Object.keys(ke).length===0)return;const ze=L.getFormFieldValidationError(oe,O);if(ze){me("error"),ve(ze);return}me("submitting"),ve(null);try{const Ve=await fetch(we,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ke)});if(!Ve.ok){const dt=await Ve.text();throw new Error(dt||`Request failed: ${Ve.status}`)}me("success"),de(Object.fromEntries(oe.map(dt=>[dt.name,""])))}catch(Ve){me("error"),ve(Ve instanceof Error?Ve.message:"Something went wrong")}};return r.jsxs("div",{className:`${s}-wrapper ${Ce}`.trim(),style:Fe,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:xu(s)}}),r.jsxs("form",{onSubmit:tt,className:`${s}-form`,style:{...Pe,height:L.scalingValue(pe,t),minHeight:L.scalingValue(pe,t)},children:[r.jsx("div",{className:`${s}-inputWrap ${s}-overlayAnchor`,style:{flex:1,minWidth:0},children:oe.map(se=>r.jsx("input",{type:se.type==="email"?"email":se.type==="phone"?"tel":"text",name:se.name,autoComplete:"off",value:X[se.name]??"",onChange:ke=>de(ze=>({...ze,[se.name]:ke.target.value})),placeholder:se.placeholder,required:se.isRequired??se.type==="email",className:`${s}-input`,style:{...ae,paddingRight:L.scalingValue(U.right,t),paddingLeft:L.scalingValue(U.left,t),paddingTop:L.scalingValue(U.top,t),paddingBottom:L.scalingValue(U.bottom,t)}},se.name))}),r.jsx("div",{className:`${s}-overlayAnchor`,children:r.jsx("button",{type:a?"submit":"button",className:`${s}-submitBtn`,"aria-label":Q,style:{...ue,...$e,paddingRight:L.scalingValue(B.right,t),paddingLeft:L.scalingValue(B.left,t),paddingTop:L.scalingValue(B.top,t),paddingBottom:L.scalingValue(B.bottom,t),pointerEvents:a?"auto":void 0},children:f==="submitting"?"...":N?Ie&&r.jsx(Qt,{url:Ie,className:`${s}-submitBtnIcon`,style:{maxWidth:L.scalingValue(te??0,t)},fill:`var(--${s}-button-text-color)`,hoverFill:`var(--${s}-button-text-color)`}):xe})})]}),Ae==="success"&&r.jsx("p",{className:`${s}-success`,style:{...Te},children:J}),Ae==="error"&&r.jsx("p",{className:`${s}-error`,style:{...Te},role:"alert",children:G??ee??ie})]})},$u={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"},Su=["hover","focus","filled","success","error"],Cu=`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';
|
|
@@ -1557,7 +1557,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1557
1557
|
};
|
|
1558
1558
|
|
|
1559
1559
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1560
|
-
`,Ru="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),Mu=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],ar={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ku=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Au={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...ar.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...ar.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...ar.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:Mu,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Ru},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:0,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...ku],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},_u={element:Lu,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"settings.fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:Au,sourceCode:Iu};function Fu(e){return`
|
|
1560
|
+
`,Tu="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),Lu=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],rr={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Eu=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Pu={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...rr.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...rr.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...rr.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:Lu,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Tu},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:0,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Eu],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Iu={element:wu,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:Pu,sourceCode:Cu};function Ru(e){return`
|
|
1561
1561
|
.${e}-marquee-wrapper {
|
|
1562
1562
|
overflow: hidden;
|
|
1563
1563
|
width: 100%;
|
|
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1689
1689
|
.${e}-image-hover-grayscale:hover img {
|
|
1690
1690
|
filter: grayscale(100%);
|
|
1691
1691
|
}
|
|
1692
|
-
`}const
|
|
1692
|
+
`}const Au=30,ku=20,ar=3,Mu=3,_u=(e,t)=>Array.from({length:t},()=>e).flat(),Fu=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Wu=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Fu(i,e))},Nu=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,imageHoverClass:s,isFirstSet:a,scaled:u,onFirstSetImageDone:c})=>{var P,R,Y;const m=l.useRef(null);l.useLayoutEffect(()=>{if(!a)return;const y=m.current;y!=null&&y.complete&&(c==null||c())},[a,(P=e.image)==null?void 0:P.url,c]);const p=n.display==="cover",E=n.ratioValue??"1:1",x=n.reversed??!1,[C,g]=E.split(":").map(Number),w=(x?g:C)/(x?C:g);let $=i,S=$/w;S>o&&(S=o,$=S*w);const _=u($),I=u(S),F=((R=e.image)==null?void 0:R.url)&&r.jsx("img",{ref:m,src:e.image.url,alt:((Y=e.image)==null?void 0:Y.name)??"",style:p?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:u(i),objectFit:"contain"},onLoad:a?c:void 0,onError:a?c:void 0});return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...p?{width:_}:{width:"fit-content",maxWidth:u(i),minWidth:0}},children:r.jsx("div",{className:s,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...p?{width:_,height:I,overflow:"hidden"}:{width:"fit-content",maxWidth:u(i),height:u(o)}},children:F&&e.link?r.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:Je(`${t}-marquee-link`,!p&&`${t}-marquee-link-contain`),children:F}):F})})},Hu=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=L.useScopedStyles(),a=l.useMemo(()=>Ru(s),[s]),{speed:u,direction:c,pauseOnHover:m,gap:p,imageMaxWidth:E,imageMaxHeight:x,imageFit:C,hoverEffect:g}=e,v=!!o,T=!n||!!i,w=T&&g!=="off"&&g!=="randomize"?`${s}-image-hover-${g}`:void 0,$=n?!!i:!0,_=((t==null?void 0:t.length)??0)>0&&($||!!n),I=Math.max(0,u)*Au,F=G=>L.scalingValue(G,n??!1),P=l.useRef(null),R=l.useRef(null),Y=l.useRef(null),[y,M]=l.useState(0),[W,D]=l.useState(0),te=$&&m==="on",[pe,K]=l.useState(!1),[H,Z]=l.useState({}),U=l.useRef(H);U.current=H;const B=l.useRef(null),J=l.useRef(0),ie=l.useRef(null),oe=l.useMemo(()=>(t??[]).map(G=>{var j;return((j=G.image)==null?void 0:j.url)??""}).join("\0"),[t]),[O,de]=l.useState(ar),f=l.useMemo(()=>{const G=t??[];return!$||G.length===0?G:_u(G,O)},[t,$,O]),me=l.useMemo(()=>f.filter(G=>{var j;return!!((j=G.image)!=null&&j.url)}).length,[f]),ye=_?Mu:1;l.useLayoutEffect(()=>{J.current=0,Z({}),B.current=null,de(ar),M(0)},[oe]),l.useEffect(()=>{if(!T||g!=="randomize")return;const G=P.current;if(!G)return;const j=we=>{Z(xe=>{let Ie=null;for(const N of we)N in xe&&(Wu(G,N)||(Ie||(Ie={...xe}),delete Ie[N]));return Ie??xe})},he=new IntersectionObserver(we=>{const xe=new Set;for(const Ie of we){const N=Ie.target.dataset.marqueeItemIndex,Q=N!==void 0?Number(N):NaN;Number.isNaN(Q)||xe.add(Q)}xe.size>0&&j(xe)},{root:G,threshold:0});Object.keys(H).forEach(we=>{const xe=Number(we);G.querySelectorAll(`[data-marquee-item-index="${xe}"]`).forEach(Ie=>he.observe(Ie))});let ne=0;const Ce=()=>{const we=Object.keys(U.current);we.length!==0&&(j(we.map(Number)),ne=requestAnimationFrame(Ce))};return Object.keys(U.current).length>0&&(ne=requestAnimationFrame(Ce)),()=>{cancelAnimationFrame(ne),he.disconnect()}},[g,H,T]),l.useLayoutEffect(()=>{if(!_)return;const G=P.current,j=Y.current;if(!G||!j)return;let he=0;const ne=()=>{const xe=G.getBoundingClientRect().width,Ie=j.getBoundingClientRect().width,N=B.current,Q=typeof N=="number"&&Math.abs(N-Ie)<=.25;if(B.current=Ie,$&&Ie>0&&O>0){const A=Ie/O;if(A>0&&xe>0){const q=Math.max(ar,Math.ceil(xe/A)+1);if(q!==O){de(q);return}}}if(Ie>0&&y<=0){M(Ie);return}Q&&Ie!==y?M(Ie):!Q&&y<=0&&(cancelAnimationFrame(he),he=requestAnimationFrame(ne))},Ce=()=>{cancelAnimationFrame(he),he=requestAnimationFrame(ne)};ie.current=Ce,Ce();const we=new ResizeObserver(Ce);return we.observe(G),we.observe(j),()=>{ie.current=null,cancelAnimationFrame(he),we.disconnect()}},[$,_,y,oe,O]),l.useLayoutEffect(()=>{const G=R.current;if(!_||!G)return;const j=y>0?y:0,he=j>0&&I>0?j/I*1e3:0,ne=`${Math.max(0,he)/1e3}s`;G.style.setProperty("--marquee-distance",`${j}px`),G.style.setProperty("--marquee-duration",ne)},[$,_,I,y]),l.useLayoutEffect(()=>{if(!_){D(0);return}if(y<=0){D(0);return}const G=R.current;if(!G)return;const j=()=>{const ne=G.getBoundingClientRect().height;D(ne>0?ne:0)};j();const he=new ResizeObserver(j);return he.observe(G),()=>he.disconnect()},[_,ye,f,n,p,E,x,y,C,H]),l.useLayoutEffect(()=>{if(!n||!v||!_||typeof window>"u")return;const G=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(G)},[n,v,_,c,y,W,p,f]);const ve=()=>{te&&K(!0)},Ae=()=>{te&&K(!1)},ee=l.useCallback(()=>{var G;J.current=Math.min(me,J.current+1),(G=ie.current)==null||G.call(ie)},[me]),ge=l.useCallback((G,j)=>{Z(he=>{const ne=he[G]??j,Ce=(t??[]).filter(xe=>xe!==ne);if(Ce.length===0)return he;const we=Ce[Math.floor(Math.random()*Ce.length)];return{...he,[G]:we}})},[t]),X=(G,j,he,ne)=>{const Ce=T&&g==="randomize"&&C.display==="cover"?H[he]??G:G,we=`max(${F(p)}, ${ku}px)`,xe=`calc(-0.5 * (${we} + ${F(p)}))`;return r.jsxs("div",{className:`${s}-marquee-card`,"data-marquee-item-index":he,onMouseEnter:T&&g==="randomize"&&C.display==="cover"?()=>ge(he,G):void 0,children:[r.jsx(Nu,{item:Ce,prefix:s,imageFit:C,imageMaxWidth:E,imageMaxHeight:x,imageHoverClass:w,isEditor:n,isFirstSet:ne,scaled:F,onFirstSetImageDone:ee}),v&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${s}-gap-control`,style:{position:"absolute",top:0,right:xe,width:we,height:"100%"}})]},`${j}-${he}`)};if(_){const G=$?te&&pe?"paused":"running":"paused";return r.jsxs("div",{ref:P,className:Je(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Marquee",style:y>0&&W>0?{height:W}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:a}}),r.jsx("div",{ref:R,className:`${s}-marquee-track`,"data-direction":c,onMouseEnter:ve,onMouseLeave:Ae,style:{"--marquee-play-state":G},children:Array.from({length:ye},(j,he)=>r.jsx("div",{ref:he===0?Y:void 0,className:Je(`${s}-marquee-row`,`${s}-marquee-set`),style:{gap:F(p),paddingRight:F(p)},"aria-hidden":he>0,children:f.map((ne,Ce)=>X(ne,he,Ce,he===0))},`set-${he}`))},"marquee-track")]})}return r.jsxs("div",{ref:P,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:a}}),r.jsx("div",{className:Je(`${s}-marquee-row`,`${s}-marquee-static`),style:{gap:F(p),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((G,j)=>X(G,0,j))},"marquee-static")]})},Ou=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
1693
1693
|
import cn from 'classnames';
|
|
1694
1694
|
import { CommonComponentProps } from '../props';
|
|
1695
1695
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2329,7 +2329,7 @@ type MarqueeProps = {
|
|
|
2329
2329
|
isPreviewMode?: boolean;
|
|
2330
2330
|
isEditMode?: boolean;
|
|
2331
2331
|
} & CommonComponentProps;
|
|
2332
|
-
`,
|
|
2332
|
+
`,Bu={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"}}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.21},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278}},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"]},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",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:""},link:""}]}},ju={element:Hu,id:"marquee",name:"Simple Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%"},m:{width:390}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple_Marquee.mp4"},schema:Bu,sourceCode:Ou,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function La(e){return`
|
|
2333
2333
|
.${e}-marquee-wrapper {
|
|
2334
2334
|
overflow: hidden;
|
|
2335
2335
|
width: 100%;
|
|
@@ -2416,7 +2416,7 @@ type MarqueeProps = {
|
|
|
2416
2416
|
pointer-events: auto;
|
|
2417
2417
|
z-index: 10;
|
|
2418
2418
|
}
|
|
2419
|
-
`}const
|
|
2419
|
+
`}const zu=30,Ea=2,Vu=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=L.useScopedStyles(),{align:a,speed:u,direction:c,pauseOnHover:m,gap:p,cardWidth:E,corners:x,stroke:C,strokeColor:g,bgColor:v,padding:T,logoMarginTop:w,logoWidth:$,logoHeight:S,captionMarginTop:_}=e,I=!!o,F=((t==null?void 0:t.length)??0)>0,P=u>0&&(!n||i),R=F&&(P||n),Y=Math.max(0,u)*zu,y=A=>L.scalingValue(A,n??!1),M=l.useRef(null),W=l.useRef(null),D=l.useRef(null),[te,pe]=l.useState(0),[K,H]=l.useState(0),[Z,U]=l.useState(0),B=P&&m==="on",[J,ie]=l.useState(!1),oe=l.useRef(null),[O,de]=l.useState(0),[f,me]=l.useState(0),ye=l.useRef(null),ve=A=>{var V,ae,ue,Te,Fe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${A}FontFamily`])??"Arial",fontWeight:((V=e==null?void 0:e[`${A}FontSettings`])==null?void 0:V.fontWeight)??400,fontStyle:((ae=e==null?void 0:e[`${A}FontSettings`])==null?void 0:ae.fontStyle)??"normal"},textAppearance:{textTransform:((ue=e==null?void 0:e[`${A}TextAppearance`])==null?void 0:ue.textTransform)??"none",textDecoration:((Te=e==null?void 0:e[`${A}TextAppearance`])==null?void 0:Te.textDecoration)??"none",fontVariant:((Fe=e==null?void 0:e[`${A}TextAppearance`])==null?void 0:Fe.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${A}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${A}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${A}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${A}LineHeight`])??.01,color:(e==null?void 0:e[`${A}Color`])??"#000000"}},Ae=ve("text"),ee=ve("caption"),ge=l.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(A=>{var q,V;return(((q=A.text)==null?void 0:q.length)??0)>0||(((V=A.caption)==null?void 0:V.length)??0)>0}),[t]),X=l.useMemo(()=>!R||(t==null?void 0:t.length)===0?1:K<=0||te<=0?Ea:Math.max(Ea,Math.ceil(te/K)+1),[R,t==null?void 0:t.length,K,te]);l.useLayoutEffect(()=>{if(!R)return;const A=M.current,q=D.current;if(!A||!q)return;let V=0;const ae=()=>{const Fe=A.getBoundingClientRect().width,Pe=q.getBoundingClientRect().width,$e=ye.current,tt=typeof $e=="number"&&Math.abs($e-Pe)<=.25;if(ye.current=Pe,pe(Fe),typeof Pe=="number"&&Pe>0&&K<=0){H(Pe);return}tt&&Pe!==K?H(Pe):!tt&&K<=0&&(cancelAnimationFrame(V),V=requestAnimationFrame(ae))},ue=()=>{cancelAnimationFrame(V),V=requestAnimationFrame(ae)};ue();const Te=new ResizeObserver(ue);return Te.observe(A),Te.observe(q),()=>{cancelAnimationFrame(V),Te.disconnect()}},[P,R,K]),l.useLayoutEffect(()=>{const A=W.current;if(!R||!A)return;const q=K>0?K:0,V=q>0&&Y>0?q/Y*1e3:0,ae=`${Math.max(0,V)/1e3}s`;A.style.setProperty("--marquee-distance",`${q}px`),A.style.setProperty("--marquee-duration",ae)},[P,R,Y,K]),l.useLayoutEffect(()=>{if(!R){U(0);return}const A=D.current,q=W.current;if(!A||!q)return;const V=()=>{let ue=0;for(let Te=0;Te<A.children.length;Te++){const Pe=A.children[Te].firstElementChild;Pe&&(ue=Math.max(ue,Pe.offsetHeight))}ue<=0&&(ue=q.offsetHeight),U(ue>0?ue:0)};V();const ae=new ResizeObserver(V);return ae.observe(A),ae.observe(q),()=>{ae.disconnect()}},[R,X,t,n,p,E,T,C,x,$,S,O,f]);const G=()=>{B&&ie(!0)},j=()=>{B&&ie(!1)},he=l.useMemo(()=>{switch(a){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[a]),ne=l.useMemo(()=>{switch(a){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[a]),Ce=l.useCallback((A,q,V,ae)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:he,width:"100%"},children:[r.jsx("div",{"data-controls":I?ae==null?void 0:ae.controlsName:void 0,"data-controls-axis":I?"y":void 0,className:I?`${s}-control`:void 0,style:{height:y((ae==null?void 0:ae.marginTop)??0)}}),r.jsx("div",{...ae!=null&&ae.dataMeasureKind?{"data-testimonial-measure":ae.dataMeasureKind}:{},style:{...kt(A,n),textAlign:ne,pointerEvents:"auto",...typeof(ae==null?void 0:ae.minHeightPx)=="number"&&ae.minHeightPx>0?{minHeight:ae.minHeightPx}:{}},children:r.jsx(ui,{content:q})})]},V),[he,ne,n,I,s,y]),we=l.useCallback((A,q,V)=>{var ae,ue,Te;return r.jsxs("div",{style:{padding:`${y(T.top)} ${y(T.right)} ${y(T.bottom)} ${y(T.left)}`,width:y(E+C*2),height:"100%",borderRadius:y(x),border:`${y(C)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${s}-cover`,style:{background:v}}),r.jsxs("div",{className:`${s}-elements-overlay`,style:{alignItems:he,textAlign:ne},children:[A.text&&Ce(Ae,A.text,"text",V!=null&&V.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(V==null?void 0:V.textMinHeightPx)=="number"&&V.textMinHeightPx>0?{minHeightPx:V.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:he,width:"100%"},children:[r.jsx("div",{"data-controls":I&&!(V!=null&&V.dataMeasureAttrs)?"logoMarginTop":void 0,className:I&&!(V!=null&&V.dataMeasureAttrs)?`${s}-control`:void 0,style:{height:y(w)}}),r.jsx("div",{style:{width:y($),height:y(S)},children:((ae=A.logo)==null?void 0:ae.url)&&r.jsx("img",{src:A.logo.url,alt:((ue=A.logo)==null?void 0:ue.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Te=A.logo)==null?void 0:Te.objectFit)||"contain"}})})]}),A.caption&&Ce(ee,A.caption,"caption",{...V!=null&&V.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:_,...V!=null&&V.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(V==null?void 0:V.captionMinHeightPx)=="number"&&V.captionMinHeightPx>0?{minHeightPx:V.captionMinHeightPx}:{}})]})]},q)},[v,_,ee,E,x,S,w,$,he,ne,T.bottom,T.left,T.right,T.top,Ce,C,g,Ae,n,I,s]),xe=l.useCallback(A=>{de(A.maxTextPx),me(A.maxCaptionPx)},[]);l.useLayoutEffect(()=>{if(!ge){xe({maxTextPx:0,maxCaptionPx:0});return}const A=oe.current;if(!A)return;const q=()=>{L.readTestimonialTextMeasure(A,xe)};q();const V=new ResizeObserver(q);return V.observe(A),()=>{V.disconnect()}},[ge,xe,t,we]);const Ie=ge?{textMinHeightPx:O,captionMinHeightPx:f}:void 0,N=ge?r.jsx("div",{ref:oe,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((A,q)=>we(A,`measure-${q}`,{dataMeasureAttrs:!0}))}):null,Q=(A,q)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[we(A,`card-${q}`,Ie),I&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${y(p)})`,width:y(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},q);if(R){const A=P?B&&J?"paused":"running":"paused";return r.jsxs("div",{ref:M,className:Je(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...Z>0?{height:Z}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:La(s)}}),N,r.jsx("div",{ref:W,className:`${s}-marquee-track`,"data-direction":c,onMouseEnter:G,onMouseLeave:j,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px","--marquee-play-state":A},children:Array.from({length:X},(q,V)=>r.jsx("div",{ref:V===0?D:void 0,className:`${s}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:y(p),paddingRight:y(p)},"aria-hidden":V>0,children:t==null?void 0:t.map((ae,ue)=>Q(ae,`${V}-${ue}`))},`set-${V}`))})]})}return r.jsxs("div",{className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:La(s)}}),N,r.jsx("div",{style:{gap:y(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((A,q)=>Q(A,q))})]})},Du=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2420
2420
|
import cn from 'classnames';
|
|
2421
2421
|
import { CommonComponentProps } from '../props';
|
|
2422
2422
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3031,7 +3031,7 @@ type TestimonialsSettings = {
|
|
|
3031
3031
|
logoHeight: number;
|
|
3032
3032
|
captionMarginTop: number;
|
|
3033
3033
|
};
|
|
3034
|
-
`,
|
|
3034
|
+
`,Pa={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},qu={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:"Fill Text",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Fill Caption",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:{...Pa.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:{...Pa.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:.058,textLineHeight:.088,captionFontSize:.053,captionLineHeight:.069},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"}]}]}]}},Ku={element:Vu,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:qu,sourceCode:Du,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Gu(e){return`
|
|
3035
3035
|
.${e}-container {
|
|
3036
3036
|
position: relative;
|
|
3037
3037
|
overflow-x: clip;
|
|
@@ -3155,7 +3155,7 @@ type TestimonialsSettings = {
|
|
|
3155
3155
|
width: 100%;
|
|
3156
3156
|
height: 100%;
|
|
3157
3157
|
}
|
|
3158
|
-
`}const
|
|
3158
|
+
`}const Uu=3e3,Xu=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=L.useScopedStyles(),a=t||[],{speed:u,align:c,width:m,imageMarginTop:p,textMarginTop:E,captionMarginTop:x,imageWidth:C,imageHeight:g,controlsWidth:v,controlsColor:T,controlsHoverColor:w}=e,$=u>0&&(!n||!!i),[S,_]=l.useState(0),[I,F]=l.useState(null),[P,R]=l.useState(!1),Y=l.useRef(null),y=l.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),M=l.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);l.useEffect(()=>{_(0),F(null),R(!1)},[a.length]);const W=a[S],D=I===null?null:a[I],te=ee=>{var X,G,j,he,ne;return{fontSettings:{fontFamily:(e==null?void 0:e[`${ee}FontFamily`])??"Arial",fontWeight:((X=e==null?void 0:e[`${ee}FontSettings`])==null?void 0:X.fontWeight)??400,fontStyle:((G=e==null?void 0:e[`${ee}FontSettings`])==null?void 0:G.fontStyle)??"normal"},textAppearance:{textTransform:((j=e==null?void 0:e[`${ee}TextAppearance`])==null?void 0:j.textTransform)??"none",textDecoration:((he=e==null?void 0:e[`${ee}TextAppearance`])==null?void 0:he.textDecoration)??"none",fontVariant:((ne=e==null?void 0:e[`${ee}TextAppearance`])==null?void 0:ne.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${ee}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${ee}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${ee}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${ee}WordSpacing`])??0,color:(e==null?void 0:e[`${ee}Color`])??"#000000"}},pe=te("text"),K=te("caption"),H=a.length>1&&a.some(ee=>{var ge,X;return(((ge=ee.text)==null?void 0:ge.length)??0)>0||(((X=ee.caption)==null?void 0:X.length)??0)>0}),Z=l.useRef(null),[U,B]=l.useState(0),[J,ie]=l.useState(0),oe=e.controls??{mode:"Off",icon:null},O=a.length>1,de=l.useCallback((ee,ge)=>!O||ge===ee?ee:(Y.current&&window.clearTimeout(Y.current),F(ee),R(!0),Y.current=window.setTimeout(()=>{F(null),R(!1),Y.current=null},300),ge),[O]),f=l.useCallback(()=>{O&&_(ee=>de(ee,(ee-1+a.length)%a.length))},[O,de,a.length]),me=l.useCallback(()=>{O&&_(ee=>de(ee,(ee+1)%a.length))},[O,de,a.length]);l.useEffect(()=>{if(!$||!O)return;const ee=Math.max(300,Uu/u),ge=window.setInterval(()=>{_(X=>de(X,(X+1)%a.length))},ee);return()=>{window.clearInterval(ge)}},[$,O,de,a.length,u]),l.useEffect(()=>()=>{Y.current&&window.clearTimeout(Y.current)},[]);const ye=(ee,ge)=>{var ne,Ce,we,xe;const X=ge==null?void 0:ge.textMinHeightPx,G=ge==null?void 0:ge.captionMinHeightPx,j=ge==null?void 0:ge.dataMeasureAttrs,he=o&&!(ge!=null&&ge.dataMeasureAttrs)&&!(ge!=null&&ge.hideControls);return r.jsxs(r.Fragment,{children:[ee.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[r.jsx("div",{"data-controls":he?"textMarginTop":void 0,className:he?`${s}-control`:void 0,style:{height:L.scalingValue(E??0,n??!1)}}),r.jsx("div",{...j&&{"data-testimonial-measure":"text"},style:{...kt(pe,n),...X&&X>0?{minHeight:X}:{},textAlign:M,pointerEvents:"auto"},children:r.jsx(ui,{content:ee.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[r.jsx("div",{"data-controls":he?"imageMarginTop":void 0,className:he?`${s}-control`:void 0,style:{height:L.scalingValue(p??0,n??!1)}}),r.jsx("div",{style:{width:L.scalingValue(C??0,n??!1),height:L.scalingValue(g??0,n??!1)},children:((ne=ee.image)==null?void 0:ne.url)&&r.jsx("img",{src:(Ce=ee.image)==null?void 0:Ce.url,alt:((we=ee.image)==null?void 0:we.name)??"",className:`${s}-icon`,style:{objectFit:((xe=ee.image)==null?void 0:xe.objectFit)||"contain"}})})]}),ee.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[r.jsx("div",{"data-controls":he?"captionMarginTop":void 0,className:he?`${s}-control`:void 0,style:{height:L.scalingValue(x??0,n??!1)}}),r.jsx("div",{...j?{"data-testimonial-measure":"caption"}:{},style:{...kt(K,n),...G&&G>0?{minHeight:G}:{},textAlign:M,pointerEvents:"auto"},children:r.jsx(ui,{content:ee.caption})})]})]})},ve=l.useCallback(ee=>{B(ee.maxTextPx),ie(ee.maxCaptionPx)},[]);if(l.useLayoutEffect(()=>{if(!H){ve({maxTextPx:0,maxCaptionPx:0});return}const ee=Z.current;if(!ee)return;const ge=()=>{L.readTestimonialTextMeasure(ee,ve)};ge();const X=new ResizeObserver(ge);return X.observe(ee),()=>{X.disconnect()}},[H,ve,t]),!W)return r.jsx(r.Fragment,{});const Ae=H?{textMinHeightPx:U,captionMinHeightPx:J}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${s}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Gu(s)}}),r.jsxs("div",{className:`${s}-wrapper`,style:{width:L.scalingValue(m??0,n??!1),alignItems:y},children:[H&&r.jsx("div",{ref:Z,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:a.map((ee,ge)=>r.jsx("div",{style:{width:"100%"},children:ye(ee,{dataMeasureAttrs:!0})},ge))}),r.jsxs("div",{className:`${s}-fade-stack`,children:[D&&P&&r.jsx("div",{className:Je(`${s}-fade-item-prev`,`${s}-fade-out`),children:ye(D,{...Ae,hideControls:!0})}),r.jsx("div",{className:Je(`${s}-fade-item-current`,P?`${s}-fade-in`:void 0),children:ye(W,Ae)})]})]}),oe.mode==="On"&&r.jsxs("div",{className:`${s}-controls`,children:[r.jsx("div",{className:`${s}-arrow`,style:{width:L.scalingValue(v??.02,n??!1),height:L.scalingValue(v??.02,n??!1),"--arrow-hover-color":w},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:f,disabled:!O,"aria-label":"Previous testimonial",children:oe.icon&&r.jsx(Qt,{url:oe.icon,fill:T,hoverFill:w,className:Je(`${s}-arrow-img`,`${s}-mirror`)})})}),r.jsx("div",{className:Je(`${s}-arrow`,`${s}-next-arrow`),style:{width:L.scalingValue(v??.02,n??!1),height:L.scalingValue(v??.02,n??!1),"--arrow-hover-color":w},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:me,disabled:!O,"aria-label":"Next testimonial",children:oe.icon&&r.jsx(Qt,{url:oe.icon,fill:T,hoverFill:w,className:`${s}-arrow-img`})})})]})]})})},Yu=`import cn from 'classnames';
|
|
3159
3159
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3160
3160
|
import { CommonComponentProps } from '../props';
|
|
3161
3161
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3651,11 +3651,11 @@ type TestimonialsSettings = {
|
|
|
3651
3651
|
icon?: string | null;
|
|
3652
3652
|
};
|
|
3653
3653
|
};
|
|
3654
|
-
`,
|
|
3654
|
+
`,Ju="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>'),Ia={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Zu={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:"Fill Controls",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Hover Controls",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:{...Ia.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:"Fill Caption"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Ia.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:"Fill Text"}},defaults:{controls:{mode:"On",icon:Ju},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},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"}]}]}]}},Qu={element:Xu,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,height:300},t:{width:373,height:300},m:{width:334,height:300}},schema:Zu,sourceCode:Yu,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function ep(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ra(e){return((e==null?void 0:e.trim().length)??0)>0}function sr(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function lr(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:L.scalingValue((o-t)/2,i)}}function tp(e){return`
|
|
3655
3655
|
.${e}-wrapper {
|
|
3656
3656
|
display: grid;
|
|
3657
3657
|
align-items: start;
|
|
3658
|
-
min-height: ${
|
|
3658
|
+
min-height: ${ep(48)};
|
|
3659
3659
|
}
|
|
3660
3660
|
.${e}-item {
|
|
3661
3661
|
display: flex;
|
|
@@ -3992,7 +3992,7 @@ type TestimonialsSettings = {
|
|
|
3992
3992
|
pointer-events: auto;
|
|
3993
3993
|
z-index: 10;
|
|
3994
3994
|
}
|
|
3995
|
-
`}const pn=500,sp=750,On="cubic-bezier(0.22, 1, 0.36, 1)",lp=72,cp=50;function dp(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 up(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function pp(e){const[t]=e.media;return t!=null&&t.url?t:null}function mp(e){return!Array.isArray(e)||e.length===0?[]:dp(e)?e.flatMap(t=>{const n=up(t);if(!n)return[];const i=pp(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 Li(e){return e.type==="video"}function gp(e){e.pause(),e.removeAttribute("src"),e.load()}function Aa({media:e,className:t,style:n,onMediaClick:i}){return Li(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 ao(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function hp(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function fp({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:a,onTransitionEnd:u}){return l.useEffect(()=>{const c=n.current;if(c)return()=>{gp(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:a,onTransitionEnd:u,style:i})}function yp({items:e,index:t,imageDisplay:n,onClose:i,onPrev:o,onNext:s,counterClassName:a,counterStyle:u}){const c=n==="cover",m=l.useRef(null),p=l.useRef(null),R=l.useRef(null),x=l.useRef(null),L=l.useRef(0),g=l.useRef(0),y=l.useRef("none"),w=l.useRef(!1),$=l.useRef(!1),S=l.useRef(!1),C=l.useRef(null),[k,P]=l.useState(null),[H,I]=l.useState("opening"),[E,Z]=l.useState(0),[v,A]=l.useState(0),[B,V]=l.useState(!1),[ne,ce]=l.useState(!1),[X,j]=l.useState(!1),_=l.useRef(t),N=e[t],T=N?Li(N):!1,K=v!==0||B,Y=l.useCallback(re=>{S.current=re,V(re)},[]),Q=l.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),O=l.useCallback(()=>{Q(),C.current=window.setTimeout(()=>{Q(),Y(!1)},pn+32)},[Q,Y]),oe=l.useCallback(()=>{const re=p.current,Ce=R.current;if(!re)return;const we=re.getBoundingClientRect(),xe=we.width,Ie=we.height;if(!xe||!Ie)return;if(n==="cover"){P({width:xe,height:Ie,left:we.left,top:we.top});return}if(!Ce){P(ao(re));return}const{width:z,height:te}=hp(Ce);if(!z||!te){P(ao(re));return}const F=z/te,U=xe/Ie;if(F>U){const G=xe/F;P({width:xe,height:G,left:we.left,top:we.top+(Ie-G)/2})}else{const G=Ie*F;P({width:G,height:Ie,left:we.left+(xe-G)/2,top:we.top})}},[n]);l.useEffect(()=>{oe();const re=p.current;if(!re)return;const Ce=new ResizeObserver(()=>oe());return Ce.observe(re),()=>Ce.disconnect()},[oe,t]),l.useEffect(()=>{H==="opening"&&k&&I("open")},[H,k]),l.useEffect(()=>{if(H!=="closing")return;const re=setTimeout(()=>i(),pn);return()=>clearTimeout(re)},[H,i]),l.useEffect(()=>()=>{Q()},[Q]),l.useLayoutEffect(()=>{if(_.current===t)return;Q(),Z(0),A(0),Y(!1),j(!1),ce(!1),L.current=0,g.current=0,y.current="none",w.current=!1,x.current=null,$.current=!1;const re=p.current;re&&P(ao(re)),_.current=t},[t,Y,Q]),l.useEffect(()=>{if(H!=="open")return;const re=()=>{const te=F=>{F.stopPropagation(),F.preventDefault(),document.removeEventListener("click",te,!0)};document.addEventListener("click",te,!0)},Ce=te=>{Q(),S.current=!1,V(!1),A(0),ce(!1),w.current=!1,g.current=0,y.current="none";const F=p.current;F&&P(ao(F)),te<0?s():o()},we=te=>{if(Math.abs(te)>cp&&e.length>1){Ce(te);return}Y(!0),A(0),O()},xe=te=>{if(te.touches.length!==1||S.current)return;const F=te.touches[0];$.current=!0,x.current={x:F.clientX,y:F.clientY},y.current="none",g.current=0,w.current=!1},Ie=te=>{if(!x.current||te.touches.length!==1||S.current)return;const F=te.touches[0],U=F.clientX-x.current.x,G=F.clientY-x.current.y;if(y.current==="none"){if(Math.abs(U)<10&&Math.abs(G)<10)return;if(Math.abs(U)>Math.abs(G)){if(e.length<=1)return;y.current="horizontal"}else if(G>0)y.current="vertical";else return}if(y.current==="horizontal"){w.current=!0,ce(!0),g.current=U,A(U),te.preventDefault();return}y.current==="vertical"&&(w.current=!0,ce(!0),L.current=G,Z(G),te.preventDefault())},z=()=>{if(!x.current)return;const te=y.current,F=w.current;if(F&&te==="horizontal")we(g.current),re();else if(F&&te==="vertical"){if(L.current>lp){const G=window.innerHeight;L.current=G,j(!0),Z(G),I("closing")}else L.current=0,Z(0);re()}else te==="horizontal"&&Math.abs(g.current)>0&&(we(g.current),re());x.current=null,y.current="none",g.current=0,w.current=!1,ce(!1)};return document.addEventListener("touchstart",xe,{passive:!0}),document.addEventListener("touchmove",Ie,{passive:!1}),document.addEventListener("touchend",z),document.addEventListener("touchcancel",z),()=>{document.removeEventListener("touchstart",xe),document.removeEventListener("touchmove",Ie),document.removeEventListener("touchend",z),document.removeEventListener("touchcancel",z)}},[H,e.length,s,o,Y,O]),l.useEffect(()=>{const re=Ce=>{Ce.key==="Escape"&&(Ce.preventDefault(),Ce.stopPropagation(),H!=="closing"&&I("closing"))};return window.addEventListener("keydown",re,!0),()=>window.removeEventListener("keydown",re,!0)},[H]);const h=()=>{H!=="closing"&&I("closing")},ae=H==="open",ye=H==="closing",ve=E>0?Math.max(0,1-E/500):1,Me=E>0?Math.max(.35,1-E/500):1,ie=re=>{if(re.stopPropagation(),$.current){$.current=!1;return}if(e.length<=1)return;const Ce=re.currentTarget.getBoundingClientRect(),we=re.clientY-Ce.top,xe=Math.min(52,Ce.height*.2);if(!(we>Ce.height-xe)){if(re.clientX-Ce.left<Ce.width/2){o();return}s()}},ge=re=>{if(e.length<=1)return;const Ce=re.currentTarget.getBoundingClientRect(),we=re.clientX-Ce.left,xe=re.clientY-Ce.top,Ie=Math.min(52,Ce.height*.2);if(xe>Ce.height-Ie){re.currentTarget.style.cursor="default";return}re.currentTarget.style.cursor=we<Ce.width/2?"w-resize":"e-resize"},ee=l.useCallback(re=>{re.propertyName!=="transform"||!S.current||(Q(),Y(!1))},[Q,Y]),J=K?`translateX(${v}px)`:E>0?`translateY(${E}px)`:void 0,D={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,objectFit:n==="cover"?"cover":"contain",transform:J,opacity:E>0?Me:H==="opening"||ye?0:1,transition:ne&&!B?"none":B?`transform ${pn}ms ${On}`:X?`transform ${pn}ms ${On}, opacity ${pn}ms ${On}`:H==="opening"||ye?`opacity ${pn}ms ${On}`:"none",pointerEvents:T&&ae&&!K?"auto":"none",touchAction:T&&ae?"none":void 0,zIndex:9998},he=k?{position:"fixed",top:k.top,height:k.height,width:k.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:m,style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997,touchAction:H==="open"?"none":void 0},onClick:h,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:ae?ve:0,transition:ne?"none":`opacity ${pn}ms ${On}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:c?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:p,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:ae?1:0,transition:`opacity ${pn}ms ${On}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:a,style:u,children:[t+1," / ",e.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:p,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ae?1:0,transition:`opacity ${pn}ms ${On}`},children:e.length>1&&r.jsxs("p",{className:a,style:u,children:[t+1," / ",e.length]})})]})}),k&&N&&(T?r.jsx(fp,{src:N.url,phase:H,mediaRef:R,mediaStyle:D,onLoadedMetadata:oe,onClick:ie,onMouseMove:ge,onTransitionEnd:ee},`${t}-${N.url}`):r.jsx("img",{ref:R,src:N.url,alt:N.name,onLoad:oe,onTransitionEnd:ee,style:D},`${t}-${N.url}`)),ae&&he&&e.length>1&&!T&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...he,left:k.left,cursor:"w-resize",pointerEvents:K?"none":"auto"},onClick:re=>{if($.current){$.current=!1;return}re.stopPropagation(),o()}}),r.jsx("div",{style:{...he,left:k.left+k.width/2,cursor:"e-resize",pointerEvents:K?"none":"auto"},onClick:re=>{if($.current){$.current=!1;return}re.stopPropagation(),s()}})]})]})}function vp(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function bp({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:a,layoutId:u}){const{prefix:c}=M.useScopedStyles(),{type:m="a",gridLayout:p,textBoxWidth:R=100,verticalGap:x,entriesCount:L,lightbox:g,imageDisplay:y,lightboxImageDisplay:w,slider:$,sliderTiming:S,direction:C,transition:k,titleMarginTop:P,subtitleMarginTop:H,titleColor:I,subtitleColor:E,lightboxCounterColor:Z,titleFontFamily:v,titleFontSettings:A,titleFontSize:B,titleLineHeight:V,titleLetterSpacing:ne,titleWordSpacing:ce,titleTextAppearance:X,subtitleFontFamily:j,subtitleFontSettings:_,subtitleFontSize:N,subtitleLineHeight:T,subtitleLetterSpacing:K,subtitleWordSpacing:Y,subtitleTextAppearance:Q,lightboxCounterFontFamily:O,lightboxCounterFontSettings:oe,lightboxCounterFontSize:h,lightboxCounterLineHeight:ae,lightboxCounterLetterSpacing:ye,lightboxCounterWordSpacing:ve,lightboxCounterTextAppearance:Me,showText:ie="always",alignEntries:ge="off",align:ee="top"}=e,J={fontSettings:{fontFamily:v,fontWeight:(A==null?void 0:A.fontWeight)??400,fontStyle:(A==null?void 0:A.fontStyle)??"normal"},fontSize:B??.01,lineHeight:V,letterSpacing:ne??0,wordSpacing:ce??0,textAppearance:X,color:I},he={...qt(kt(J,n))},re={fontSettings:{fontFamily:j,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:N??.01,lineHeight:T,letterSpacing:K??0,wordSpacing:Y??0,textAppearance:Q,color:E},we={...qt(kt(re,n))},xe={fontSettings:{fontFamily:O,fontWeight:(oe==null?void 0:oe.fontWeight)??400,fontStyle:(oe==null?void 0:oe.fontStyle)??"normal"},fontSize:h??.01,lineHeight:ae,letterSpacing:ye??0,wordSpacing:ve??0,textAppearance:Me,color:Z},z={...qt(kt(xe,n)),...cr(h,ae,c,n)},te=lr(B,V,`${c}-item-title`,`${c}-text-tight-leading`),F=lr(N,T,`${c}-item-subtitle`,`${c}-text-tight-leading`),U=cr(B,V,c,n),G=cr(N,T,c,n),le=lr(h,ae,`${c}-lightbox-counter`,`${c}-text-tight-leading`),me=M.buildColorVars(c,{titleColor:I,subtitleColor:E,lightboxCounterColor:Z},xp,wp),Pe=`${a&&a!=="default"?`${c}-state-${a}`:""}${ie==="on hover"&&(!n||i)?` ${c}-show-text-hover`:""}`.trim(),$e=L===0?1/0:L,tt=(t??[]).slice(0,$e),de=p.entryWidth??.2,ke=(y==null?void 0:y.display)==="cover",ze=(y==null?void 0:y.ratioValue)??"1:1",Ve=(y==null?void 0:y.reversed)??!1,[dt,ft]=ze.split(":").map(Number),wt=`${Ve?ft:dt} / ${Ve?dt:ft}`,Ht=M.scalingValue(de??0,n),Lt=!ke&&$!=="off",Ge={width:Ht,...ke?{aspectRatio:wt,height:"auto",overflow:"hidden"}:{height:"auto"}},Re=`${c}-item-image-wrapper${Lt?` ${c}-item-image-wrapper-fit-slider`:""}`.trim(),Be=m==="d"||m==="e"||m==="f",Ue=ge==="on",He=`calc(${M.scalingValue(de??0,n)} * (${R} / 100))`,ut=M.scalingValue(de*R/100,n),It=ke?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[Ze,At]=l.useState("ltr"),[Ot,Oe]=l.useState(0),gt=l.useRef(null);l.useEffect(()=>{const De=gt.current;if(!De)return;const yt=new ResizeObserver(vt=>{Oe(Math.round(vt[0].contentRect.width))});return yt.observe(De),()=>yt.disconnect()},[]);const it=(()=>{const De={...me},yt=gt.current?getComputedStyle(gt.current).getPropertyValue("--cntrl-article-width").trim():"";return yt&&(De["--cntrl-article-width"]=yt),De})(),[Ye,rt]=l.useState(!1),[at,sn]=l.useState([]),[wn,ln]=l.useState(0),ot=g==="on"&&(!n||i),tn=(De,yt)=>{n&&!i||g!=="off"&&(sn(De),ln(yt),rt(!0))};l.useEffect(()=>{if(!Ye||g!=="on"||typeof document>"u")return;const De=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=De}},[Ye,g]),l.useEffect(()=>{!n||i||rt(!1)},[n,i]);const Ut=l.useMemo(()=>ap(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ut}}),r.jsx("div",{style:me,children:r.jsx("div",{ref:gt,className:`${c}-wrapper ${c}-type-${m}${Ue?` ${c}-align-entries`:""} ${c}-image-align-${ee} ${Pe}`.trim(),style:{gridTemplateColumns:`repeat(${p.columnsCount}, minmax(0, 1fr))`,rowGap:Ue?0:M.scalingValue(x??0,n),columnGap:M.scalingValue(p.horizontalGap??0,n),width:M.scalingValue(p.wrapperWidth??0,n),...Ue?{[`--${c}-align-entries-row-gap`]:M.scalingValue(x??0,n)}:{}},children:tt.map((De,yt)=>{var Rt;const vt=ka(De.title),ue=ka(De.subtitle),Se=(((Rt=De.link)==null?void 0:Rt.length)??0)>0&&g==="off"?De.link:void 0,Ae=Math.floor(yt/p.columnsCount)===Math.ceil(tt.length/p.columnsCount)-1,We=Be?r.jsxs("div",{className:`${c}-item-text-block`,children:[vt&&r.jsx("p",{className:te,style:{width:He,...he,...U},children:De.title}),vt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:M.scalingValue(P??0,n),width:ut}}),ue&&r.jsx("p",{className:F,style:{width:He,...we,...G},children:De.subtitle}),ue&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:M.scalingValue(H??0,n),width:ut}})]}):null,et=Ue?r.jsxs("div",{className:`${c}-item-title-row`,children:[!Be&&r.jsx("div",{"data-controls":o&&vt?"titleMarginTop":void 0,className:o&&vt?`${c}-control`:void 0,style:{height:vt?M.scalingValue(P??0,n):0,width:ut}}),vt&&r.jsx("p",{className:te,style:{width:He,...he,...U},children:De.title}),Be&&vt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:M.scalingValue(P??0,n),width:ut}})]}):null,$t=Ue?r.jsxs("div",{className:`${c}-item-subtitle-row`,children:[!Be&&r.jsx("div",{"data-controls":o&&ue?"subtitleMarginTop":void 0,className:o&&ue?`${c}-control`:void 0,style:{height:ue?M.scalingValue(H??0,n):0,width:ut}}),ue&&r.jsx("p",{className:F,style:{width:He,...we,...G},children:De.subtitle}),Be&&ue&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:M.scalingValue(H??0,n),width:ut}})]}):null,Le=Se?r.jsxs("a",{href:Se,target:"_blank",className:`${c}-item-text-link`,children:[et,$t]}):r.jsxs(r.Fragment,{children:[et,$t]}),Qe=mp(De.gallery),je=Qe.filter(qe=>qe.lightboxMedia).map(qe=>qe.lightboxMedia),st=r.jsx("div",{className:Re,style:Ge,children:Qe.length===0?null:$==="off"?(()=>{const{displayMedia:qe,lightboxMedia:nt}=Qe[0],Et=nt?je.findIndex(St=>St.url===nt.url):-1;return r.jsx(Aa,{media:qe,className:`${c}-item-${Li(qe)?"video":"image"}`.trim(),style:It,onMediaClick:ot&&Et>=0?()=>tn(je,Et):void 0})})():r.jsxs(r.Fragment,{children:[Lt&&Ue&&r.jsx("div",{className:`${c}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Qe.map(({displayMedia:qe})=>Li(qe)?r.jsx("video",{src:qe.url,muted:!0,playsInline:!0},`sizer-${qe.url}`):r.jsx("img",{src:qe.url,alt:""},`sizer-${qe.url}`))}),r.jsx(Jr,{className:`${c}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:S*1e3,width:"100%",height:"100%",speed:sp,type:k==="fade"?"fade":"loop",rewind:k==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:k==="fade"?"ltr":C!=="random"?C==="horizontal"?"ltr":"ttb":Ze},onMoved:qe=>{if(C!=="random"||k==="fade")return;const nt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";At(nt),setTimeout(()=>{qe.refresh()},0)},children:Qe.map(({displayMedia:qe,lightboxMedia:nt},Et)=>{const St=nt?je.findIndex(_t=>_t.url===nt.url):-1;return r.jsx(Zr,{children:r.jsx(Aa,{media:qe,className:`${c}-item-${Li(qe)?"video":"image"}`.trim(),style:It,onMediaClick:ot&&St>=0?()=>tn(je,St):void 0})},Et)})},`${k}-${de}-${C}-${S}-${Ot}-${u}`)]})}),pt=Be?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&vt?"titleMarginTop":void 0,className:o&&vt?`${c}-control`:void 0,style:{height:vt?M.scalingValue(P??0,n):0,width:ut}}),r.jsx("p",{className:te,style:{width:He,...he,...U},children:De.title}),r.jsx("div",{"data-controls":o&&ue?"subtitleMarginTop":void 0,className:o&&ue?`${c}-control`:void 0,style:{height:ue?M.scalingValue(H??0,n):0,width:ut}}),r.jsx("p",{className:F,style:{width:He,...we,...G},children:De.subtitle})]});return r.jsx("div",{className:`${c}-item`.trim(),children:r.jsx("div",{className:`${o?`${c}-item-inner`:`${c}-item-inner-hidden`}${Ue&&Ae?` ${c}-item-inner-last-row`:""}`.trim(),style:{width:(R??0)>100?`calc(${M.scalingValue(de??0,n)} * (${R} / 100))`:M.scalingValue(de??0,n)},children:Ue?r.jsx(r.Fragment,{children:Be?r.jsxs(r.Fragment,{children:[Le,r.jsx("a",{href:Se,target:"_blank",className:`${c}-item-image-link`,children:st})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:Se,target:"_blank",className:`${c}-item-image-link`,children:st}),Le]})}):Se?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:Se,target:"_blank",className:`${c}-item-image-link`,children:[We,st]}),!Be&&r.jsx("a",{href:Se,target:"_blank",className:`${c}-item-text-link`,children:pt})]}):r.jsxs(r.Fragment,{children:[We,st,pt]})})},yt)})})}),(!n||i)&&Ye&&typeof document<"u"&&g==="on"&&Bi.createPortal(r.jsx("div",{style:it,"data-selection":"none",children:r.jsx(yp,{items:at,index:wn,imageDisplay:vp(w),onClose:()=>rt(!1),onPrev:()=>ln(De=>(De-1+at.length)%at.length),onNext:()=>ln(De=>(De+1)%at.length),counterClassName:le,counterStyle:z})}),document.body)]})}const xp={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},wp=["hover","focus","filled","success","error"],$p=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3995
|
+
`}const pn=500,np=750,On="cubic-bezier(0.22, 1, 0.36, 1)",ip=72,op=50;function rp(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 ap(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function sp(e){const[t]=e.media;return t!=null&&t.url?t:null}function lp(e){return!Array.isArray(e)||e.length===0?[]:rp(e)?e.flatMap(t=>{const n=ap(t);if(!n)return[];const i=sp(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 Li(e){return e.type==="video"}function cp(e){e.pause(),e.removeAttribute("src"),e.load()}function Aa({media:e,className:t,style:n,onMediaClick:i}){return Li(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 ao(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function dp(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function up({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:a,onTransitionEnd:u}){return l.useEffect(()=>{const c=n.current;if(c)return()=>{cp(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:a,onTransitionEnd:u,style:i})}function pp({items:e,index:t,imageDisplay:n,onClose:i,onPrev:o,onNext:s,counterClassName:a,counterStyle:u}){const c=n==="cover",m=l.useRef(null),p=l.useRef(null),E=l.useRef(null),x=l.useRef(null),C=l.useRef(0),g=l.useRef(0),v=l.useRef("none"),T=l.useRef(!1),w=l.useRef(!1),$=l.useRef(!1),S=l.useRef(null),[_,I]=l.useState(null),[F,P]=l.useState("opening"),[R,Y]=l.useState(0),[y,M]=l.useState(0),[W,D]=l.useState(!1),[te,pe]=l.useState(!1),[K,H]=l.useState(!1),Z=l.useRef(t),U=e[t],B=U?Li(U):!1,J=y!==0||W,ie=l.useCallback(ne=>{$.current=ne,D(ne)},[]),oe=l.useCallback(()=>{S.current!==null&&(window.clearTimeout(S.current),S.current=null)},[]),O=l.useCallback(()=>{oe(),S.current=window.setTimeout(()=>{oe(),ie(!1)},pn+32)},[oe,ie]),de=l.useCallback(()=>{const ne=p.current,Ce=E.current;if(!ne)return;const we=ne.getBoundingClientRect(),xe=we.width,Ie=we.height;if(!xe||!Ie)return;if(n==="cover"){I({width:xe,height:Ie,left:we.left,top:we.top});return}if(!Ce){I(ao(ne));return}const{width:N,height:Q}=dp(Ce);if(!N||!Q){I(ao(ne));return}const A=N/Q,q=xe/Ie;if(A>q){const V=xe/A;I({width:xe,height:V,left:we.left,top:we.top+(Ie-V)/2})}else{const V=Ie*A;I({width:V,height:Ie,left:we.left+(xe-V)/2,top:we.top})}},[n]);l.useEffect(()=>{de();const ne=p.current;if(!ne)return;const Ce=new ResizeObserver(()=>de());return Ce.observe(ne),()=>Ce.disconnect()},[de,t]),l.useEffect(()=>{F==="opening"&&_&&P("open")},[F,_]),l.useEffect(()=>{if(F!=="closing")return;const ne=setTimeout(()=>i(),pn);return()=>clearTimeout(ne)},[F,i]),l.useEffect(()=>()=>{oe()},[oe]),l.useLayoutEffect(()=>{if(Z.current===t)return;oe(),Y(0),M(0),ie(!1),H(!1),pe(!1),C.current=0,g.current=0,v.current="none",T.current=!1,x.current=null,w.current=!1;const ne=p.current;ne&&I(ao(ne)),Z.current=t},[t,ie,oe]),l.useEffect(()=>{if(F!=="open")return;const ne=()=>{const Q=A=>{A.stopPropagation(),A.preventDefault(),document.removeEventListener("click",Q,!0)};document.addEventListener("click",Q,!0)},Ce=Q=>{oe(),$.current=!1,D(!1),M(0),pe(!1),T.current=!1,g.current=0,v.current="none";const A=p.current;A&&I(ao(A)),Q<0?s():o()},we=Q=>{if(Math.abs(Q)>op&&e.length>1){Ce(Q);return}ie(!0),M(0),O()},xe=Q=>{if(Q.touches.length!==1||$.current)return;const A=Q.touches[0];w.current=!0,x.current={x:A.clientX,y:A.clientY},v.current="none",g.current=0,T.current=!1},Ie=Q=>{if(!x.current||Q.touches.length!==1||$.current)return;const A=Q.touches[0],q=A.clientX-x.current.x,V=A.clientY-x.current.y;if(v.current==="none"){if(Math.abs(q)<10&&Math.abs(V)<10)return;if(Math.abs(q)>Math.abs(V)){if(e.length<=1)return;v.current="horizontal"}else if(V>0)v.current="vertical";else return}if(v.current==="horizontal"){T.current=!0,pe(!0),g.current=q,M(q),Q.preventDefault();return}v.current==="vertical"&&(T.current=!0,pe(!0),C.current=V,Y(V),Q.preventDefault())},N=()=>{if(!x.current)return;const Q=v.current,A=T.current;if(A&&Q==="horizontal")we(g.current),ne();else if(A&&Q==="vertical"){if(C.current>ip){const V=window.innerHeight;C.current=V,H(!0),Y(V),P("closing")}else C.current=0,Y(0);ne()}else Q==="horizontal"&&Math.abs(g.current)>0&&(we(g.current),ne());x.current=null,v.current="none",g.current=0,T.current=!1,pe(!1)};return document.addEventListener("touchstart",xe,{passive:!0}),document.addEventListener("touchmove",Ie,{passive:!1}),document.addEventListener("touchend",N),document.addEventListener("touchcancel",N),()=>{document.removeEventListener("touchstart",xe),document.removeEventListener("touchmove",Ie),document.removeEventListener("touchend",N),document.removeEventListener("touchcancel",N)}},[F,e.length,s,o,ie,O]),l.useEffect(()=>{const ne=Ce=>{Ce.key==="Escape"&&(Ce.preventDefault(),Ce.stopPropagation(),F!=="closing"&&P("closing"))};return window.addEventListener("keydown",ne,!0),()=>window.removeEventListener("keydown",ne,!0)},[F]);const f=()=>{F!=="closing"&&P("closing")},me=F==="open",ye=F==="closing",ve=R>0?Math.max(0,1-R/500):1,Ae=R>0?Math.max(.35,1-R/500):1,ee=ne=>{if(ne.stopPropagation(),w.current){w.current=!1;return}if(e.length<=1)return;const Ce=ne.currentTarget.getBoundingClientRect(),we=ne.clientY-Ce.top,xe=Math.min(52,Ce.height*.2);if(!(we>Ce.height-xe)){if(ne.clientX-Ce.left<Ce.width/2){o();return}s()}},ge=ne=>{if(e.length<=1)return;const Ce=ne.currentTarget.getBoundingClientRect(),we=ne.clientX-Ce.left,xe=ne.clientY-Ce.top,Ie=Math.min(52,Ce.height*.2);if(xe>Ce.height-Ie){ne.currentTarget.style.cursor="default";return}ne.currentTarget.style.cursor=we<Ce.width/2?"w-resize":"e-resize"},X=l.useCallback(ne=>{ne.propertyName!=="transform"||!$.current||(oe(),ie(!1))},[oe,ie]),G=J?`translateX(${y}px)`:R>0?`translateY(${R}px)`:void 0,j={position:"fixed",top:_==null?void 0:_.top,left:_==null?void 0:_.left,width:_==null?void 0:_.width,height:_==null?void 0:_.height,objectFit:n==="cover"?"cover":"contain",transform:G,opacity:R>0?Ae:F==="opening"||ye?0:1,transition:te&&!W?"none":W?`transform ${pn}ms ${On}`:K?`transform ${pn}ms ${On}, opacity ${pn}ms ${On}`:F==="opening"||ye?`opacity ${pn}ms ${On}`:"none",pointerEvents:B&&me&&!J?"auto":"none",touchAction:B&&me?"none":void 0,zIndex:9998},he=_?{position:"fixed",top:_.top,height:_.height,width:_.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:m,style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997,touchAction:F==="open"?"none":void 0},onClick:f,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:me?ve:0,transition:te?"none":`opacity ${pn}ms ${On}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:c?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:p,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:me?1:0,transition:`opacity ${pn}ms ${On}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:a,style:u,children:[t+1," / ",e.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:p,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:me?1:0,transition:`opacity ${pn}ms ${On}`},children:e.length>1&&r.jsxs("p",{className:a,style:u,children:[t+1," / ",e.length]})})]})}),_&&U&&(B?r.jsx(up,{src:U.url,phase:F,mediaRef:E,mediaStyle:j,onLoadedMetadata:de,onClick:ee,onMouseMove:ge,onTransitionEnd:X},`${t}-${U.url}`):r.jsx("img",{ref:E,src:U.url,alt:U.name,onLoad:de,onTransitionEnd:X,style:j},`${t}-${U.url}`)),me&&he&&e.length>1&&!B&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...he,left:_.left,cursor:"w-resize",pointerEvents:J?"none":"auto"},onClick:ne=>{if(w.current){w.current=!1;return}ne.stopPropagation(),o()}}),r.jsx("div",{style:{...he,left:_.left+_.width/2,cursor:"e-resize",pointerEvents:J?"none":"auto"},onClick:ne=>{if(w.current){w.current=!1;return}ne.stopPropagation(),s()}})]})]})}function mp(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function gp({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:a,layoutId:u}){const{prefix:c}=L.useScopedStyles(),{type:m="a",gridLayout:p,textBoxWidth:E=100,verticalGap:x,entriesCount:C,lightbox:g,imageDisplay:v,lightboxImageDisplay:T,slider:w,sliderTiming:$,direction:S,transition:_,titleMarginTop:I,subtitleMarginTop:F,titleColor:P,subtitleColor:R,lightboxCounterColor:Y,titleFontFamily:y,titleFontSettings:M,titleFontSize:W,titleLineHeight:D,titleLetterSpacing:te,titleWordSpacing:pe,titleTextAppearance:K,subtitleFontFamily:H,subtitleFontSettings:Z,subtitleFontSize:U,subtitleLineHeight:B,subtitleLetterSpacing:J,subtitleWordSpacing:ie,subtitleTextAppearance:oe,lightboxCounterFontFamily:O,lightboxCounterFontSettings:de,lightboxCounterFontSize:f,lightboxCounterLineHeight:me,lightboxCounterLetterSpacing:ye,lightboxCounterWordSpacing:ve,lightboxCounterTextAppearance:Ae,showText:ee="always",alignEntries:ge="off",align:X="top"}=e,G={fontSettings:{fontFamily:y,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:W??.01,lineHeight:D,letterSpacing:te??0,wordSpacing:pe??0,textAppearance:K,color:P},he={...qt(kt(G,n))},ne={fontSettings:{fontFamily:H,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:U??.01,lineHeight:B,letterSpacing:J??0,wordSpacing:ie??0,textAppearance:oe,color:R},we={...qt(kt(ne,n))},xe={fontSettings:{fontFamily:O,fontWeight:(de==null?void 0:de.fontWeight)??400,fontStyle:(de==null?void 0:de.fontStyle)??"normal"},fontSize:f??.01,lineHeight:me,letterSpacing:ye??0,wordSpacing:ve??0,textAppearance:Ae,color:Y},N={...qt(kt(xe,n)),...lr(f,me,c,n)},Q=sr(W,D,`${c}-item-title`,`${c}-text-tight-leading`),A=sr(U,B,`${c}-item-subtitle`,`${c}-text-tight-leading`),q=lr(W,D,c,n),V=lr(U,B,c,n),ae=sr(f,me,`${c}-lightbox-counter`,`${c}-text-tight-leading`),ue=L.buildColorVars(c,{titleColor:P,subtitleColor:R,lightboxCounterColor:Y},hp,fp),Pe=`${a&&a!=="default"?`${c}-state-${a}`:""}${ee==="on hover"&&(!n||i)?` ${c}-show-text-hover`:""}`.trim(),$e=C===0?1/0:C,tt=(t??[]).slice(0,$e),se=p.entryWidth??.2,ke=(v==null?void 0:v.display)==="cover",ze=(v==null?void 0:v.ratioValue)??"1:1",Ve=(v==null?void 0:v.reversed)??!1,[dt,ft]=ze.split(":").map(Number),wt=`${Ve?ft:dt} / ${Ve?dt:ft}`,Ht=L.scalingValue(se??0,n),Lt=!ke&&w!=="off",Ge={width:Ht,...ke?{aspectRatio:wt,height:"auto",overflow:"hidden"}:{height:"auto"}},Re=`${c}-item-image-wrapper${Lt?` ${c}-item-image-wrapper-fit-slider`:""}`.trim(),Be=m==="d"||m==="e"||m==="f",Ue=ge==="on",He=`calc(${L.scalingValue(se??0,n)} * (${E} / 100))`,ut=L.scalingValue(se*E/100,n),It=ke?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[Ze,Mt]=l.useState("ltr"),[Ot,Oe]=l.useState(0),gt=l.useRef(null);l.useEffect(()=>{const De=gt.current;if(!De)return;const yt=new ResizeObserver(vt=>{Oe(Math.round(vt[0].contentRect.width))});return yt.observe(De),()=>yt.disconnect()},[]);const it=(()=>{const De={...ue},yt=gt.current?getComputedStyle(gt.current).getPropertyValue("--cntrl-article-width").trim():"";return yt&&(De["--cntrl-article-width"]=yt),De})(),[Ye,rt]=l.useState(!1),[at,sn]=l.useState([]),[wn,ln]=l.useState(0),ot=g==="on"&&(!n||i),tn=(De,yt)=>{n&&!i||g!=="off"&&(sn(De),ln(yt),rt(!0))};l.useEffect(()=>{if(!Ye||g!=="on"||typeof document>"u")return;const De=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=De}},[Ye,g]),l.useEffect(()=>{!n||i||rt(!1)},[n,i]);const Ut=l.useMemo(()=>tp(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ut}}),r.jsx("div",{style:ue,children:r.jsx("div",{ref:gt,className:`${c}-wrapper ${c}-type-${m}${Ue?` ${c}-align-entries`:""} ${c}-image-align-${X} ${Pe}`.trim(),style:{gridTemplateColumns:`repeat(${p.columnsCount}, minmax(0, 1fr))`,rowGap:Ue?0:L.scalingValue(x??0,n),columnGap:L.scalingValue(p.horizontalGap??0,n),width:L.scalingValue(p.wrapperWidth??0,n),...Ue?{[`--${c}-align-entries-row-gap`]:L.scalingValue(x??0,n)}:{}},children:tt.map((De,yt)=>{var Rt;const vt=Ra(De.title),le=Ra(De.subtitle),Se=(((Rt=De.link)==null?void 0:Rt.length)??0)>0&&g==="off"?De.link:void 0,Me=Math.floor(yt/p.columnsCount)===Math.ceil(tt.length/p.columnsCount)-1,We=Be?r.jsxs("div",{className:`${c}-item-text-block`,children:[vt&&r.jsx("p",{className:Q,style:{width:He,...he,...q},children:De.title}),vt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:L.scalingValue(I??0,n),width:ut}}),le&&r.jsx("p",{className:A,style:{width:He,...we,...V},children:De.subtitle}),le&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:L.scalingValue(F??0,n),width:ut}})]}):null,et=Ue?r.jsxs("div",{className:`${c}-item-title-row`,children:[!Be&&r.jsx("div",{"data-controls":o&&vt?"titleMarginTop":void 0,className:o&&vt?`${c}-control`:void 0,style:{height:vt?L.scalingValue(I??0,n):0,width:ut}}),vt&&r.jsx("p",{className:Q,style:{width:He,...he,...q},children:De.title}),Be&&vt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:L.scalingValue(I??0,n),width:ut}})]}):null,$t=Ue?r.jsxs("div",{className:`${c}-item-subtitle-row`,children:[!Be&&r.jsx("div",{"data-controls":o&&le?"subtitleMarginTop":void 0,className:o&&le?`${c}-control`:void 0,style:{height:le?L.scalingValue(F??0,n):0,width:ut}}),le&&r.jsx("p",{className:A,style:{width:He,...we,...V},children:De.subtitle}),Be&&le&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${c}-control`:void 0,style:{height:L.scalingValue(F??0,n),width:ut}})]}):null,Le=Se?r.jsxs("a",{href:Se,target:"_blank",className:`${c}-item-text-link`,children:[et,$t]}):r.jsxs(r.Fragment,{children:[et,$t]}),Qe=lp(De.gallery),je=Qe.filter(qe=>qe.lightboxMedia).map(qe=>qe.lightboxMedia),st=r.jsx("div",{className:Re,style:Ge,children:Qe.length===0?null:w==="off"?(()=>{const{displayMedia:qe,lightboxMedia:nt}=Qe[0],Et=nt?je.findIndex(St=>St.url===nt.url):-1;return r.jsx(Aa,{media:qe,className:`${c}-item-${Li(qe)?"video":"image"}`.trim(),style:It,onMediaClick:ot&&Et>=0?()=>tn(je,Et):void 0})})():r.jsxs(r.Fragment,{children:[Lt&&Ue&&r.jsx("div",{className:`${c}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Qe.map(({displayMedia:qe})=>Li(qe)?r.jsx("video",{src:qe.url,muted:!0,playsInline:!0},`sizer-${qe.url}`):r.jsx("img",{src:qe.url,alt:""},`sizer-${qe.url}`))}),r.jsx(Xr,{className:`${c}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:$*1e3,width:"100%",height:"100%",speed:np,type:_==="fade"?"fade":"loop",rewind:_==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:_==="fade"?"ltr":S!=="random"?S==="horizontal"?"ltr":"ttb":Ze},onMoved:qe=>{if(S!=="random"||_==="fade")return;const nt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Mt(nt),setTimeout(()=>{qe.refresh()},0)},children:Qe.map(({displayMedia:qe,lightboxMedia:nt},Et)=>{const St=nt?je.findIndex(_t=>_t.url===nt.url):-1;return r.jsx(Yr,{children:r.jsx(Aa,{media:qe,className:`${c}-item-${Li(qe)?"video":"image"}`.trim(),style:It,onMediaClick:ot&&St>=0?()=>tn(je,St):void 0})},Et)})},`${_}-${se}-${S}-${$}-${Ot}-${u}`)]})}),pt=Be?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&vt?"titleMarginTop":void 0,className:o&&vt?`${c}-control`:void 0,style:{height:vt?L.scalingValue(I??0,n):0,width:ut}}),r.jsx("p",{className:Q,style:{width:He,...he,...q},children:De.title}),r.jsx("div",{"data-controls":o&&le?"subtitleMarginTop":void 0,className:o&&le?`${c}-control`:void 0,style:{height:le?L.scalingValue(F??0,n):0,width:ut}}),r.jsx("p",{className:A,style:{width:He,...we,...V},children:De.subtitle})]});return r.jsx("div",{className:`${c}-item`.trim(),children:r.jsx("div",{className:`${o?`${c}-item-inner`:`${c}-item-inner-hidden`}${Ue&&Me?` ${c}-item-inner-last-row`:""}`.trim(),style:{width:(E??0)>100?`calc(${L.scalingValue(se??0,n)} * (${E} / 100))`:L.scalingValue(se??0,n)},children:Ue?r.jsx(r.Fragment,{children:Be?r.jsxs(r.Fragment,{children:[Le,r.jsx("a",{href:Se,target:"_blank",className:`${c}-item-image-link`,children:st})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:Se,target:"_blank",className:`${c}-item-image-link`,children:st}),Le]})}):Se?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:Se,target:"_blank",className:`${c}-item-image-link`,children:[We,st]}),!Be&&r.jsx("a",{href:Se,target:"_blank",className:`${c}-item-text-link`,children:pt})]}):r.jsxs(r.Fragment,{children:[We,st,pt]})})},yt)})})}),(!n||i)&&Ye&&typeof document<"u"&&g==="on"&&Bi.createPortal(r.jsx("div",{style:it,"data-selection":"none",children:r.jsx(pp,{items:at,index:wn,imageDisplay:mp(T),onClose:()=>rt(!1),onPrev:()=>ln(De=>(De-1+at.length)%at.length),onNext:()=>ln(De=>(De+1)%at.length),counterClassName:ae,counterStyle:N})}),document.body)]})}const hp={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},fp=["hover","focus","filled","success","error"],yp=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3996
3996
|
import '@splidejs/react-splide/css/core';
|
|
3997
3997
|
import { CommonComponentProps } from '../props';
|
|
3998
3998
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -5769,7 +5769,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
5769
5769
|
};
|
|
5770
5770
|
|
|
5771
5771
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
5772
|
-
`,dr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Sp=["titleColor","subtitleColor","lightboxCounterColor"],Cp={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!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:"Flying Over the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Doors of Matera",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Cattedrale di Santa Maria",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"City Through the Cracks",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Private Stone Gardens",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/grid(7).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Leaving the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(8).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Under the Sun",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(9).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Citygates View",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(10).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Around the City",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(11).webp",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:"Gap",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...dr.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:{...dr.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:{...dr.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:"cover",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"on",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:"a",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.0506,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},d:{type:"a",gridLayout:{entryWidth:.0833,horizontalGap:0,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...Sp],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Tp={element:bp,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:"settings.titleFontFamily"},{path:"settings.subtitleFontFamily"},{path:"settings.lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:Cp,sourceCode:$p},_a=12;function Lp(e,t="50%"){const n={position:"absolute",width:_a,height:_a,pointerEvents:"none"};return e==="left-y"?{...n,left:20,top:"50%",transform:"translateY(-50%)"}:e==="center-x"?{...n,left:"50%",top:t,transform:"translate(-50%, -50%)"}:{...n,left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}function Ft({className:e,areaStyle:t,hitPlacement:n,centerXHitTop:i,...o}){return r.jsx("div",{className:e,style:{...t,pointerEvents:"none"},"data-controls-center-only-drag":"",...o,children:r.jsx("div",{style:Lp(n,i)})})}function Ep(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 Pp({media:e,className:t,style:n}){const i=l.useRef(null);return l.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 $o(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ip(e){return String(e??"").trim().length>0}function Fa(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 Wa(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 Na(e,t,n,i,o,s,a){const u=M.scalingValue(s,a),c=M.scalingValue(0,a),m=e===0,p=e===t-1&&!o;return{borderTopWidth:m&&n?u:c,borderBottomWidth:!p||i?u:c}}function Rp(e,t,n){const i=M.scalingValue(t,n),o=M.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Ha=10;function Mp(e){return`
|
|
5772
|
+
`,cr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},vp=["titleColor","subtitleColor","lightboxCounterColor"],bp={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!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:"Flying Over the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Doors of Matera",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Cattedrale di Santa Maria",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"City Through the Cracks",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Private Stone Gardens",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/grid(7).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Leaving the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(8).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Under the Sun",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(9).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Citygates View",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(10).webp",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Around the City",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/grid(11).webp",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:"Gap",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...cr.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:{...cr.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:{...cr.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:"cover",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"on",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:"a",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.0506,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},d:{type:"a",gridLayout:{entryWidth:.0833,horizontalGap:0,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...vp],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},xp={element:gp,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:bp,sourceCode:yp},ka=12;function wp(e,t="50%"){const n={position:"absolute",width:ka,height:ka,pointerEvents:"none"};return e==="left-y"?{...n,left:20,top:"50%",transform:"translateY(-50%)"}:e==="center-x"?{...n,left:"50%",top:t,transform:"translate(-50%, -50%)"}:{...n,left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}function Ft({className:e,areaStyle:t,hitPlacement:n,centerXHitTop:i,...o}){return r.jsx("div",{className:e,style:{...t,pointerEvents:"none"},"data-controls-center-only-drag":"",...o,children:r.jsx("div",{style:wp(n,i)})})}function $p(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 Sp({media:e,className:t,style:n}){const i=l.useRef(null);return l.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 $o(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Cp(e){return String(e??"").trim().length>0}function Ma(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 _a(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 Fa(e,t,n,i,o,s,a){const u=L.scalingValue(s,a),c=L.scalingValue(0,a),m=e===0,p=e===t-1&&!o;return{borderTopWidth:m&&n?u:c,borderBottomWidth:!p||i?u:c}}function Tp(e,t,n){const i=L.scalingValue(t,n),o=L.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Wa=10;function Lp(e){return`
|
|
5773
5773
|
.${e}-wrapper {
|
|
5774
5774
|
display: grid;
|
|
5775
5775
|
align-items: start;
|
|
@@ -6200,7 +6200,7 @@ a.${e}-list-item {
|
|
|
6200
6200
|
overflow-wrap: anywhere;
|
|
6201
6201
|
word-break: break-word;
|
|
6202
6202
|
}
|
|
6203
|
-
`}const Mn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Qr=["AColumn","BColumn","CColumn","DColumn","EColumn"],yn="cutLabel",Wi=[...Qr,yn],Ko=["A","B","C","D","E"];function Us(e){return`${e}ColumnVerticalAlign`}const Er=["Top","Center","Bottom"];function ea(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Ko.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function kp(e){const t=ea(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Ap(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Ko.includes(n)?n:null}function Xs(e,t,n){const i=Ap(e);return i?i===t?!1:kp(n[Us(i)]):!0}function Ni(e){const t=ea(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Ko.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function _p(e,t,n){if(Ys(e,t,n))return Ni(e);const i=Ni(e);return i.kind==="baseline"?{kind:"top"}:i}function Fp(e){const t=Ni(e);return t.kind==="baseline"?{kind:"top"}:t}function Ys(e,t,n){return Xs(e,n,t)?Ni(e).kind==="baseline":!1}function Wp(e){const t={};let n=!1;for(const i of Ko){const o=Us(i),s=e[o];if(e.type==="b"){const a=String(s??"Top").trim();a!=="Top"&&a!=="Center"&&a!=="Bottom"&&(t[o]="Top",n=!0);continue}Xs(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Np(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Hp(e){const t=Ni(e).kind;return t==="baseline"?"center":t}function Op(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Oa(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Bp(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 ur(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const a=Bp(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+a;const u=s.getBoundingClientRect(),c=o.getBoundingClientRect().height;let m=0;return e.kind==="center"?m=(u.height-c)/2:e.kind==="bottom"&&(m=u.height-c),u.top-t+m+a}function jp(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 zp(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Vp={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Xe(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Dp={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function qp(e){return[Xe(e,"textFontFamily"),Xe(e,"textFontSettings"),{type:"row",items:[Xe(e,"textFontSize"),Xe(e,"textLineHeight"),Xe(e,"textLetterSpacing"),Xe(e,"textWordSpacing")]},Xe(e,"textTextAlign"),Xe(e,"textTextAppearance"),`${e}VerticalAlign`]}function Kp(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Wi.map(e=>[Dp[e],qp(e)]))}}function Mo(e,t){const n=i=>{const o=Xe(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===yn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Ba(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 qt(kt(n,t))}function ja(e,t,n,i){const o=Mo(e,t),s=o.textFontSize??.01,a=o.textLineHeight;return a!==void 0&&a<s?`${n} ${i}`:n}function za(e,t,n,i){const o=Mo(e,t),s=o.textFontSize??.01,a=o.textLineHeight;return a===void 0||a>=s?{}:{[`--${n}-title-leading-gap`]:M.scalingValue((s-a)/2,i)}}const Kt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],pi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],mi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],gi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Gp={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Up=["hover","focus","filled","success","error"],Va=.004,oi=.004,pr=oi,ta=50,Hi=1440,Oi=ta/Hi;function Js(e){const t=typeof e=="number"&&e>0?e:Hi;return ta/t}function Xp(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 Hi}const Zs={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Ei(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Yp(e,t=1){const n=t/e;return Object.fromEntries(Kt.map(i=>[i,n]))}function Jp(){return Object.fromEntries([...pi.map(e=>[e,0]),...mi.map(e=>[e,0])])}function Zp(){return Object.fromEntries(gi.map(e=>[e,0]))}function so(e){return Object.fromEntries(Kt.map(t=>[t,typeof e[t]=="number"?e[t]:Zs[t]]))}function Qs(e,t,n){const i=e-Oi,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 So(e,t,n){const i=na(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,a)=>s+a,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Qp(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=pi[o],a=mi[o],u=typeof n[s]=="number"?n[s]:0,c=typeof n[a]=="number"?n[a]:0,m=Qs(t[o]??0,u,c);m.paddingLeft!==u&&(i[s]=m.paddingLeft),m.paddingRight!==c&&(i[a]=m.paddingRight)}return i}function na(e,t,n){if(e<=0)return[];const i=Kt.slice(0,e).map(m=>n[m]);if(e===1)return i;const o=i.slice(0,e-1),a=o.reduce((m,p)=>m+p,0)+Oi;if(t>=a)return i;const u=[...o];let c=a-t;for(let m=u.length-1;m>=0&&c>0;m-=1){const p=u[m]-Oi;if(p<=0)continue;const R=Math.min(c,p);u[m]-=R,c-=R}return[...u,i[e-1]]}function em(e,t,n){if(e<=1)return{};const i=na(e,t,n),o={};for(let s=0;s<e-1;s+=1){const a=Kt[s];i[s]!==n[a]&&(o[a]=i[s])}return o}function Da(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Mn]}function tm(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function nm(e,t,n,i){const o=Math.min(i,e.length,Kt.length),s={};for(let a=0;a<o;a+=1){const u=e[a],c=t.indexOf(u);if(c===-1)continue;const m=Kt[c],p=pi[c],R=mi[c],x=gi[c],L=Kt[a],g=pi[a],y=mi[a],w=gi[a],$=n[m],S=n[p],C=n[R],k=n[x];typeof $=="number"&&(s[L]=$),typeof S=="number"&&(s[g]=S),typeof C=="number"&&(s[y]=C),typeof k=="number"&&(s[w]=k)}return s}function el(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 im(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Ei(e),s=e.type==="b"||e.type===void 0&&t.type==="b",a={...e,...Yp(n,o),...Jp()};if(s)for(const u of gi)typeof t[u]=="number"&&(a[u]=t[u]);else Object.assign(a,Zp());return el(e,a)?a:e}function om(e,t,n){const i=Wp(e);i&&(e={...e,...i});const o=Js(n==null?void 0:n.designWidth),s=e.columns,a=t.columns,u=Ei(e),c=Ei(t),m=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof a=="number"?a:Mn.length,R=C=>{if(m)return C;const k=so({...t,...C}),P=Ei(C),H=So(p,P,k),I=Qp(p,H,{...t,...C});return Object.keys(I).length===0?C:{...C,...I}};if(typeof s=="number"&&s!==a)return e;const x=Da(e),L=Da(t);if(!tm(x,L))return R({...e,...nm(x,L,t,p)});if(u<c&&typeof p=="number"&&!m){const C=so({...t,...e});return R({...e,...em(p,u,C)})}if(m){const C=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,k=Math.max(0,(u-o)/2);return C>k?{...e,textPaddingLR:k}:e}const g=so({...t,...e}),y=So(p,c,so(t)),$=So(p,u,g).some((C,k)=>C<(y[k]??C)),S=Kt.some(C=>{const k=e[C],P=t[C];return typeof k=="number"&&typeof P=="number"&&k!==P});return $||S?R(e):e}function rm(e,t,n,i){const o=t.slice(0,e).reduce((a,u)=>a+u,0),s=n.slice(e+1,t.length-1).reduce((a,u)=>a+u,0);return Math.max(Oi,i-o-s-Oi)}function am(e,t){return Math.random()*(t-e)+e}function sm(e){return Object.fromEntries(Kt.map(t=>[t,typeof e[t]=="number"?e[t]:Zs[t]]))}function mr(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function lm(e,t,n,i,o,s){return e.slice(0,t).map((a,u)=>{const c=pi[u],m=mi[u],p=gi[u];return{key:a,textPrefix:Vp[a],widthKey:Kt[u],width:n[Kt[u]],paddingLeftKey:c,paddingRightKey:m,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[m],paddingBottom:s[p]}})}function cm({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:a,onUpdateSettings:u}){const{prefix:c}=M.useScopedStyles(),m=!!o,{columns:p,type:R,wrapperWidth:x,entriesCount:L,cellMinHeight:g,dividerWidth:y,showVisibility:w,cut:$,showCut:S,cutCellMinHeight:C,cutLabel:k,imageSize:P,imageOnHover:H,entryHoverEffect:I,entryHoverShowOption:E,rowPaddingTop:Z,rowPaddingBottom:v,rowPaddingTopB:A,columnsOrder:B,textPaddingLR:V,textColor:ne,backgroundColor:ce,dividerColor:X,textHoverColor:j,backgroundHoverColor:_,dividerHoverColor:N}=e,[T,K]=l.useState(void 0),[Y,Q]=l.useState(null),O=H==="on"&&(!n||i),oe=($??0)>0,h=R==="b",ae=l.useRef(null),ye=l.useRef(null),[ve,Me]=l.useState(null),[ie,ge]=l.useState(Hi),ee=Js(ie),J=Math.max(0,((x??0)-ee)/2),D=Math.min(V??0,J),he=Math.max(D,oi),re=((x??0)+ee)/2;l.useLayoutEffect(()=>{if(!n){ge(Hi);return}const ue=()=>{ge(Xp(ae.current))};ue();const Se=ae.current;if(!Se)return;const Ae=new ResizeObserver(ue);Ae.observe(Se);let We=Se;for(;We&&!We.style.getPropertyValue("--cntrl-article-width");)We=We.parentElement;return We&&Ae.observe(We),()=>Ae.disconnect()},[n,a]),l.useEffect(()=>{K(void 0)},[$,S,t,L]),l.useEffect(()=>{n&&!i&&K(void 0)},[n,i]);const Ce=M.buildColorVars(c,{textColor:ne,backgroundColor:ce,dividerColor:X,textHoverColor:j,backgroundHoverColor:_,dividerHoverColor:N},Gp,Up),we=s&&s!=="default"?`${c}-state-${s}`:"",Ie=`${!n||i?I==="default"?`${c}-entry-hover-default`:I==="blinds"?`${c}-entry-hover-blinds`:I==="reveal"?`${c}-entry-hover-reveal`:"":""} ${we}`.trim(),z=I==="reveal"&&(!n||i),te=(w==null?void 0:w[0])??!1,F=(w==null?void 0:w[1])??!1,U=l.useRef(e),G=l.useRef(a);l.useEffect(()=>{if(!u||!n){U.current=e,G.current=a;return}if(G.current!==a){U.current=e,G.current=a;return}const ue=U.current;if(!(ue!==e))return;if(typeof ue.columns=="number"&&typeof e.columns=="number"&&ue.columns!==e.columns){U.current=e;return}const Ae=om(e,ue,{designWidth:ie});U.current=e,el(e,Ae)&&u(Ae)},[e,u,n,a,ie]);const le=l.useMemo(()=>sm(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),me=l.useMemo(()=>mr(e,pi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),Te=l.useMemo(()=>mr(e,mi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Fe=l.useMemo(()=>mr(e,gi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Pe=l.useMemo(()=>Array.isArray(B)&&B.length>0?B:[...Mn],[B]),$e=l.useMemo(()=>lm(Pe,p,le,me,Te,Fe),[Pe,p,le,me,Te,Fe]),tt=Ei(e),de=l.useMemo(()=>Kt.slice(0,p).map(ue=>le[ue]),[p,le]),ke=l.useMemo(()=>na(p,tt,le),[p,tt,le]),ze=l.useMemo(()=>So(p,tt,le),[p,tt,le]),Ve=l.useMemo(()=>$e.map((ue,Se)=>Qs(ze[Se]??0,ue.paddingLeft,ue.paddingRight)),[$e,ze]),dt=l.useMemo(()=>{const ue=L===0?1/0:L;return(t??[]).slice(0,ue).map((Ae,We)=>({id:We,cells:Object.fromEntries(Mn.map(et=>[et,Ae[et]??""])),image:Ae.image,link:Ae.link}))},[t,L]),ft=oe?T??$:dt.length,Pt=l.useMemo(()=>oe?dt.slice(0,ft):dt,[dt,oe,ft]),xt=oe&&ft<dt.length,wt=Pt.length>1||xt,Ht=[te?`${c}-divider-top`:"",F||wt?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Lt=!n||i,Ge=()=>{if(!Lt)return;const ue=T??$;if(!S){K(dt.length);return}K(Math.min(ue+S,dt.length))},Re=ue=>M.scalingValue(ue,n??!1),Be=h?A??0:Z??0,Ue=v??0,He=g??0,ut=Be+He/2,It=Math.max(Ue,pr),Ze=Na(0,Pt.length,te,F,xt,y??0,n??!1).borderTopWidth,At=ve!=null?`${ve}px`:`calc(${Ze} + ${Re(ut)})`,Ot=h?"rowPaddingTopB":"rowPaddingTop",Oe=$e[0],gt=$e[$e.length-1],it=Ve[0],Ye=Ve[Ve.length-1],rt=Oe&&it?Math.max(it.paddingLeft,oi):0,at=gt&&Ye?Math.max(Ye.paddingRight,oi):0,sn=tt,wn=ue=>{const Se=ae.current;if(!Se)return{x:0,y:0};const Ae=Se.getBoundingClientRect();return{x:ue.clientX-Ae.left+Ha,y:ue.clientY-Ae.top+Ha}},ln=(ue,Se)=>{if(!O)return;const Ae=ue.image;if(!(Ae!=null&&Ae.url)){Q(null);return}const{x:We,y:et}=wn(Se),$t=(P==null?void 0:P.min)??80,Le=(P==null?void 0:P.max)??320,Qe=(Y==null?void 0:Y.rowId)===ue.id?Y.widthPx:am($t,Le);Q({rowId:ue.id,url:Ae.url,objectFit:"contain",isVideo:Ep(Ae),widthPx:Qe,x:We,y:et})},ot=ue=>{if(!O||!Y)return;const{x:Se,y:Ae}=wn(ue);Q(We=>!We||We.x===Se&&We.y===Ae?We:{...We,x:Se,y:Ae})},tn=()=>{Q(null)},Ut=ue=>{z&&Fa(ue,c),O&&Q(null)},De=ue=>{z&&Wa(ue,c)};l.useLayoutEffect(()=>{if(!m||h){Me(null);return}const ue=ye.current,Se=ue==null?void 0:ue.parentElement;if(!ue||!Se){Me(null);return}const Ae=()=>{const et=ue.querySelector("[data-list-row]");if(!et){Me(null);return}const $t=Se.getBoundingClientRect(),Le=et.getBoundingClientRect();Me(Le.top-$t.top+Le.height/2)};Ae();const We=new ResizeObserver(Ae);return We.observe(ue),We.observe(Se),()=>We.disconnect()},[m,h,Pt,Be,Ue,He,t,e,$e,ze,ie,y,te,F,xt]);const yt=l.useMemo(()=>!h&&Qr.some(ue=>{const Se=ue.charAt(0),Ae=e[`${ue}VerticalAlign`];return Ys(Ae,e,Se)}),[h,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);l.useLayoutEffect(()=>{var Qe;const ue=ae.current;if(!ue)return;const Se=()=>{ue.querySelectorAll("[data-list-col]").forEach(je=>{je.style.transform="";const st=je.querySelector(`.${c}-list-col`);st&&(st.style.minHeight="",st.style.height="");const pt=je.querySelector(`.${c}-list-col-title`);pt&&(pt.style.transform="")})};if(h||!yt){Se();return}const Ae=()=>{const je=Array.from(ue.querySelectorAll("[data-list-row]")),st=`${c}-list-col`,pt=`${c}-baseline-probe`;je.forEach(Rt=>{Rt.querySelectorAll("[data-list-col]").forEach(qe=>{qe.style.transform="";const nt=qe.querySelector(`.${st}`);nt&&(nt.style.minHeight="",nt.style.height="");const Et=qe.querySelector(`.${c}-list-col-title`);Et&&(Et.style.transform="")})}),je.forEach(Rt=>{const qe=Array.from(Rt.querySelectorAll("[data-list-col]"));jp(Rt,qe,st)}),ue.offsetHeight,je.forEach(Rt=>{const qe=Array.from(Rt.querySelectorAll("[data-list-col]")),nt=Rt.getBoundingClientRect().top,Et=new Map,St=qe.map(ht=>{const Bt=ht.querySelector(`.${c}-list-col-title`),Wt={el:ht,titleEl:Bt,letter:ht.getAttribute("data-col-letter")??"",kind:ht.getAttribute("data-valign")??"top",anchor:ht.getAttribute("data-valign-anchor")};return Et.set(Wt.letter,Wt),Wt}),_t=new Map,$n=(ht,Bt)=>{const Wt=_t.get(ht.letter);if(Wt!==void 0)return Wt;const cn=ht.anchor?Et.get(ht.anchor):void 0;if(ht.kind!=="baseline"||!cn||Bt.has(ht.letter)){const Xn=ur(ht,nt,st,pt);return _t.set(ht.letter,Xn),Xn}Bt.add(ht.letter);const Sn=$n(cn,Bt);Bt.delete(ht.letter);const dn=ur(ht,nt,st,pt),zt=Sn-dn;zp(ht.titleEl,zt);const Cn=ur(ht,nt,st,pt);return _t.set(ht.letter,Cn),Cn};St.forEach(ht=>$n(ht,new Set))})};let We=null;const et=()=>{We===null&&(We=requestAnimationFrame(()=>{We=null,Ae()}))};Ae();const $t=new ResizeObserver(()=>et());$t.observe(ue);let Le=!1;return typeof document<"u"&&((Qe=document.fonts)!=null&&Qe.ready)&&document.fonts.ready.then(()=>{Le||et()}),()=>{Le=!0,We!==null&&(cancelAnimationFrame(We),We=null),$t.disconnect(),Se()}},[yt,h,e,t,ie,Pt,ze]);const vt=l.useMemo(()=>Mp(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:vt}}),r.jsx("div",{style:Ce,children:r.jsxs("div",{ref:ae,className:`${c}-wrapper ${Ie}${Ht?` ${Ht}`:""}${h?` ${c}-type-b`:""}`.trim(),style:{width:M.scalingValue(x??0,n),...!h&&m?{[`--${c}-first-entry-handle-top`]:At}:{}},onMouseMove:O?ot:void 0,onMouseLeave:O?tn:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[Pt.map((ue,Se)=>{var $t;const Ae=((($t=ue.link)==null?void 0:$t.length)??0)>0,We=Ae&&(!n||i)?"a":"div",et=Na(Se,Pt.length,te,F,xt,y??0,n??!1);return r.jsxs(We,{ref:Se===0?Le=>{ye.current=Le}:void 0,className:`${c}-list-item${Ae||E==="always"?` ${c}-list-item-has-link`:""}`,...Ae?{href:ue.link,target:"_blank"}:{},style:et,onMouseEnter:Le=>{z&&(Ae||E==="always")&&Fa(Le,c),O&&ln(ue,Le)},onMouseLeave:Le=>{z&&(Ae||E==="always")&&Wa(Le,c)},children:[Be>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Re(Be)}}),r.jsxs("div",{className:`${c}-list-cols-row${h?"":` ${c}-list-cols-row-h`}${m&&Se===0&&h?` ${c}-list-cols-row-controls`:""}`,...h?{}:{"data-list-row":""},style:h?void 0:{minHeight:Re(He)},children:[$e.map((Le,Qe)=>{const je=Qe===$e.length-1,st=Ve[Qe],pt=Le.paddingBottom,Rt=Ip(ue.cells[Le.key]),qe=h&&Rt&&pt>0,nt=h?{minHeight:Re(He)}:{width:Re(ze[Qe])},Et=h?{paddingLeft:Re(D),paddingRight:Re(D)}:{paddingLeft:Re(st.paddingLeft),paddingRight:Re(st.paddingRight)},St=Le.textPrefix.charAt(0),_t=h?Fp(e[`${Le.textPrefix}VerticalAlign`]):_p(e[`${Le.textPrefix}VerticalAlign`],e,St),$n=h&&Rt&&m&&Se===0;return r.jsxs("div",{className:h?`${c}-list-col-wrap`:void 0,...h?{}:{"data-list-col":"","data-col-letter":St,"data-valign":_t.kind,..._t.kind==="baseline"?{"data-valign-anchor":_t.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${je?` ${c}-list-col-last`:""}`,style:{...Et,...nt,...h?{justifyContent:Oa(_t.kind)}:{}},"data-test":Le.width,children:r.jsx("span",{className:ja(e,Le.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Ba(Mo(e,Le.textPrefix),n),...za(e,Le.textPrefix,c,n),...h?{}:Np(_t.kind)},children:ue.cells[Le.key]??null})}),qe&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Re(pt)}}),$n&&r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Le.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Re(Math.max(pt,pr))}})]},Le.key)}),m&&Se===0&&h&&r.jsxs(r.Fragment,{children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(re),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Re(he),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(re),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Re(Math.max(he,tt-he)),width:Re(he),height:"100%"}})]})]}),!h&&Ue>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Re(Ue)}}),m&&Se===0&&!h&&r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Re(It)}})]},ue.id)}),m&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ot,"data-controls-static-handle":"",...h?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:h?"center":"left-y",areaStyle:{position:"absolute",top:Ze,left:0,width:"100%",height:Re(Math.max(Be,pr))}})},"row-padding-handles"),m&&!h&&Oe&>&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Oe.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ze[0]-((it==null?void 0:it.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Re(rt),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":gt.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ze[$e.length-1]-((Ye==null?void 0:Ye.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Re(sn-at),width:Re(at),height:"100%"}})]},"column-edge-padding-handles"),m&&!h&&$e.slice(0,-1).map((ue,Se)=>{const Ae=$e[Se+1],We=ke.slice(0,Se+1).reduce((je,st)=>je+st,0),et=Ve[Se],$t=Ve[Se+1],Le=Math.max(et.paddingRight,oi),Qe=Math.max($t.paddingLeft,oi);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":ue.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ze[Se]-et.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Re(We-Le),width:Re(Le),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ae.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ze[Se+1]-$t.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Re(We),width:Re(Qe),height:"100%"}})]},`${ue.paddingRightKey}-padding`)}),m&&!h&&$e.slice(0,-1).map((ue,Se)=>{const Ae=rm(Se,ke,de,tt),et=ke.slice(0,Se+1).reduce(($t,Le)=>$t+Le,0)-Va/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ue.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(ta),"data-controls-max-fraction":String(Ae),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Re(et),width:Re(Va),height:"calc(100%)",pointerEvents:"auto"}})},`${ue.widthKey}-junction`)})]}),xt&&(()=>{const ue=Mo(e,yn),Se=Hp(e.cutLabelVerticalAlign),Ae=ue.textTextAlign==="justify"||h;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Re(C??0),cursor:Lt?"pointer":"default",...Rp(F,y??0,n??!1)},onClick:Lt?Ge:void 0,onMouseEnter:z||O?Ut:void 0,onMouseLeave:z?De:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...h?{paddingLeft:Re(D),paddingRight:Re(D)}:{},justifyContent:Op(ue.textTextAlign),alignItems:Oa(Se)},children:r.jsx("span",{className:ja(e,yn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Ba(ue,n),...za(e,yn,c,n),...Ae?{width:"100%"}:{}},children:k})})})})(),O&&Y&&(()=>{const ue=$o(Y.widthPx),Se={width:ue,height:"auto",maxHeight:ue,objectFit:"contain",left:Y.x,top:Y.y,position:"absolute"};return r.jsx(Pp,{media:Y,className:Y.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Se},`${Y.rowId}-${Y.url}`)})()]})})]})}const dm=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
6203
|
+
`}const An=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Jr=["AColumn","BColumn","CColumn","DColumn","EColumn"],yn="cutLabel",Wi=[...Jr,yn],qo=["A","B","C","D","E"];function Ds(e){return`${e}ColumnVerticalAlign`}const Lr=["Top","Center","Bottom"];function Zr(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return qo.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Ep(e){const t=Zr(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Pp(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return qo.includes(n)?n:null}function qs(e,t,n){const i=Pp(e);return i?i===t?!1:Ep(n[Ds(i)]):!0}function Ni(e){const t=Zr(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return qo.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Ip(e,t,n){if(Ks(e,t,n))return Ni(e);const i=Ni(e);return i.kind==="baseline"?{kind:"top"}:i}function Rp(e){const t=Ni(e);return t.kind==="baseline"?{kind:"top"}:t}function Ks(e,t,n){return qs(e,n,t)?Ni(e).kind==="baseline":!1}function Ap(e){const t={};let n=!1;for(const i of qo){const o=Ds(i),s=e[o];if(e.type==="b"){const a=String(s??"Top").trim();a!=="Top"&&a!=="Center"&&a!=="Bottom"&&(t[o]="Top",n=!0);continue}qs(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function kp(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Mp(e){const t=Ni(e).kind;return t==="baseline"?"center":t}function _p(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Na(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Fp(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 dr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const a=Fp(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+a;const u=s.getBoundingClientRect(),c=o.getBoundingClientRect().height;let m=0;return e.kind==="center"?m=(u.height-c)/2:e.kind==="bottom"&&(m=u.height-c),u.top-t+m+a}function Wp(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 Np(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Hp={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Xe(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Op={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Bp(e){return[Xe(e,"textFontFamily"),Xe(e,"textFontSettings"),{type:"row",items:[Xe(e,"textFontSize"),Xe(e,"textLineHeight"),Xe(e,"textLetterSpacing"),Xe(e,"textWordSpacing")]},Xe(e,"textTextAlign"),Xe(e,"textTextAppearance"),`${e}VerticalAlign`]}function jp(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Wi.map(e=>[Op[e],Bp(e)]))}}function Ao(e,t){const n=i=>{const o=Xe(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===yn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Ha(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 qt(kt(n,t))}function Oa(e,t,n,i){const o=Ao(e,t),s=o.textFontSize??.01,a=o.textLineHeight;return a!==void 0&&a<s?`${n} ${i}`:n}function Ba(e,t,n,i){const o=Ao(e,t),s=o.textFontSize??.01,a=o.textLineHeight;return a===void 0||a>=s?{}:{[`--${n}-title-leading-gap`]:L.scalingValue((s-a)/2,i)}}const Kt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],pi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],mi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],gi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],zp={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Vp=["hover","focus","filled","success","error"],ja=.004,oi=.004,ur=oi,Qr=50,Hi=1440,Oi=Qr/Hi;function Gs(e){const t=typeof e=="number"&&e>0?e:Hi;return Qr/t}function Dp(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 Hi}const Us={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Ei(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function qp(e,t=1){const n=t/e;return Object.fromEntries(Kt.map(i=>[i,n]))}function Kp(){return Object.fromEntries([...pi.map(e=>[e,0]),...mi.map(e=>[e,0])])}function Gp(){return Object.fromEntries(gi.map(e=>[e,0]))}function so(e){return Object.fromEntries(Kt.map(t=>[t,typeof e[t]=="number"?e[t]:Us[t]]))}function Xs(e,t,n){const i=e-Oi,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 So(e,t,n){const i=ea(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,a)=>s+a,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Up(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=pi[o],a=mi[o],u=typeof n[s]=="number"?n[s]:0,c=typeof n[a]=="number"?n[a]:0,m=Xs(t[o]??0,u,c);m.paddingLeft!==u&&(i[s]=m.paddingLeft),m.paddingRight!==c&&(i[a]=m.paddingRight)}return i}function ea(e,t,n){if(e<=0)return[];const i=Kt.slice(0,e).map(m=>n[m]);if(e===1)return i;const o=i.slice(0,e-1),a=o.reduce((m,p)=>m+p,0)+Oi;if(t>=a)return i;const u=[...o];let c=a-t;for(let m=u.length-1;m>=0&&c>0;m-=1){const p=u[m]-Oi;if(p<=0)continue;const E=Math.min(c,p);u[m]-=E,c-=E}return[...u,i[e-1]]}function Xp(e,t,n){if(e<=1)return{};const i=ea(e,t,n),o={};for(let s=0;s<e-1;s+=1){const a=Kt[s];i[s]!==n[a]&&(o[a]=i[s])}return o}function za(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...An]}function Yp(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Jp(e,t,n,i){const o=Math.min(i,e.length,Kt.length),s={};for(let a=0;a<o;a+=1){const u=e[a],c=t.indexOf(u);if(c===-1)continue;const m=Kt[c],p=pi[c],E=mi[c],x=gi[c],C=Kt[a],g=pi[a],v=mi[a],T=gi[a],w=n[m],$=n[p],S=n[E],_=n[x];typeof w=="number"&&(s[C]=w),typeof $=="number"&&(s[g]=$),typeof S=="number"&&(s[v]=S),typeof _=="number"&&(s[T]=_)}return s}function Ys(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 Zp(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Ei(e),s=e.type==="b"||e.type===void 0&&t.type==="b",a={...e,...qp(n,o),...Kp()};if(s)for(const u of gi)typeof t[u]=="number"&&(a[u]=t[u]);else Object.assign(a,Gp());return Ys(e,a)?a:e}function Qp(e,t,n){const i=Ap(e);i&&(e={...e,...i});const o=Gs(n==null?void 0:n.designWidth),s=e.columns,a=t.columns,u=Ei(e),c=Ei(t),m=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof a=="number"?a:An.length,E=S=>{if(m)return S;const _=so({...t,...S}),I=Ei(S),F=So(p,I,_),P=Up(p,F,{...t,...S});return Object.keys(P).length===0?S:{...S,...P}};if(typeof s=="number"&&s!==a)return e;const x=za(e),C=za(t);if(!Yp(x,C))return E({...e,...Jp(x,C,t,p)});if(u<c&&typeof p=="number"&&!m){const S=so({...t,...e});return E({...e,...Xp(p,u,S)})}if(m){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,_=Math.max(0,(u-o)/2);return S>_?{...e,textPaddingLR:_}:e}const g=so({...t,...e}),v=So(p,c,so(t)),w=So(p,u,g).some((S,_)=>S<(v[_]??S)),$=Kt.some(S=>{const _=e[S],I=t[S];return typeof _=="number"&&typeof I=="number"&&_!==I});return w||$?E(e):e}function em(e,t,n,i){const o=t.slice(0,e).reduce((a,u)=>a+u,0),s=n.slice(e+1,t.length-1).reduce((a,u)=>a+u,0);return Math.max(Oi,i-o-s-Oi)}function tm(e,t){return Math.random()*(t-e)+e}function nm(e){return Object.fromEntries(Kt.map(t=>[t,typeof e[t]=="number"?e[t]:Us[t]]))}function pr(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function im(e,t,n,i,o,s){return e.slice(0,t).map((a,u)=>{const c=pi[u],m=mi[u],p=gi[u];return{key:a,textPrefix:Hp[a],widthKey:Kt[u],width:n[Kt[u]],paddingLeftKey:c,paddingRightKey:m,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[m],paddingBottom:s[p]}})}function om({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:a,onUpdateSettings:u}){const{prefix:c}=L.useScopedStyles(),m=!!o,{columns:p,type:E,wrapperWidth:x,entriesCount:C,cellMinHeight:g,dividerWidth:v,showVisibility:T,cut:w,showCut:$,cutCellMinHeight:S,cutLabel:_,imageSize:I,imageOnHover:F,entryHoverEffect:P,entryHoverShowOption:R,rowPaddingTop:Y,rowPaddingBottom:y,rowPaddingTopB:M,columnsOrder:W,textPaddingLR:D,textColor:te,backgroundColor:pe,dividerColor:K,textHoverColor:H,backgroundHoverColor:Z,dividerHoverColor:U}=e,[B,J]=l.useState(void 0),[ie,oe]=l.useState(null),O=F==="on"&&(!n||i),de=(w??0)>0,f=E==="b",me=l.useRef(null),ye=l.useRef(null),[ve,Ae]=l.useState(null),[ee,ge]=l.useState(Hi),X=Gs(ee),G=Math.max(0,((x??0)-X)/2),j=Math.min(D??0,G),he=Math.max(j,oi),ne=((x??0)+X)/2;l.useLayoutEffect(()=>{if(!n){ge(Hi);return}const le=()=>{ge(Dp(me.current))};le();const Se=me.current;if(!Se)return;const Me=new ResizeObserver(le);Me.observe(Se);let We=Se;for(;We&&!We.style.getPropertyValue("--cntrl-article-width");)We=We.parentElement;return We&&Me.observe(We),()=>Me.disconnect()},[n,a]),l.useEffect(()=>{J(void 0)},[w,$,t,C]),l.useEffect(()=>{n&&!i&&J(void 0)},[n,i]);const Ce=L.buildColorVars(c,{textColor:te,backgroundColor:pe,dividerColor:K,textHoverColor:H,backgroundHoverColor:Z,dividerHoverColor:U},zp,Vp),we=s&&s!=="default"?`${c}-state-${s}`:"",Ie=`${!n||i?P==="default"?`${c}-entry-hover-default`:P==="blinds"?`${c}-entry-hover-blinds`:P==="reveal"?`${c}-entry-hover-reveal`:"":""} ${we}`.trim(),N=P==="reveal"&&(!n||i),Q=(T==null?void 0:T[0])??!1,A=(T==null?void 0:T[1])??!1,q=l.useRef(e),V=l.useRef(a);l.useEffect(()=>{if(!u||!n){q.current=e,V.current=a;return}if(V.current!==a){q.current=e,V.current=a;return}const le=q.current;if(!(le!==e))return;if(typeof le.columns=="number"&&typeof e.columns=="number"&&le.columns!==e.columns){q.current=e;return}const Me=Qp(e,le,{designWidth:ee});q.current=e,Ys(e,Me)&&u(Me)},[e,u,n,a,ee]);const ae=l.useMemo(()=>nm(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ue=l.useMemo(()=>pr(e,pi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),Te=l.useMemo(()=>pr(e,mi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Fe=l.useMemo(()=>pr(e,gi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Pe=l.useMemo(()=>Array.isArray(W)&&W.length>0?W:[...An],[W]),$e=l.useMemo(()=>im(Pe,p,ae,ue,Te,Fe),[Pe,p,ae,ue,Te,Fe]),tt=Ei(e),se=l.useMemo(()=>Kt.slice(0,p).map(le=>ae[le]),[p,ae]),ke=l.useMemo(()=>ea(p,tt,ae),[p,tt,ae]),ze=l.useMemo(()=>So(p,tt,ae),[p,tt,ae]),Ve=l.useMemo(()=>$e.map((le,Se)=>Xs(ze[Se]??0,le.paddingLeft,le.paddingRight)),[$e,ze]),dt=l.useMemo(()=>{const le=C===0?1/0:C;return(t??[]).slice(0,le).map((Me,We)=>({id:We,cells:Object.fromEntries(An.map(et=>[et,Me[et]??""])),image:Me.image,link:Me.link}))},[t,C]),ft=de?B??w:dt.length,Pt=l.useMemo(()=>de?dt.slice(0,ft):dt,[dt,de,ft]),xt=de&&ft<dt.length,wt=Pt.length>1||xt,Ht=[Q?`${c}-divider-top`:"",A||wt?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Lt=!n||i,Ge=()=>{if(!Lt)return;const le=B??w;if(!$){J(dt.length);return}J(Math.min(le+$,dt.length))},Re=le=>L.scalingValue(le,n??!1),Be=f?M??0:Y??0,Ue=y??0,He=g??0,ut=Be+He/2,It=Math.max(Ue,ur),Ze=Fa(0,Pt.length,Q,A,xt,v??0,n??!1).borderTopWidth,Mt=ve!=null?`${ve}px`:`calc(${Ze} + ${Re(ut)})`,Ot=f?"rowPaddingTopB":"rowPaddingTop",Oe=$e[0],gt=$e[$e.length-1],it=Ve[0],Ye=Ve[Ve.length-1],rt=Oe&&it?Math.max(it.paddingLeft,oi):0,at=gt&&Ye?Math.max(Ye.paddingRight,oi):0,sn=tt,wn=le=>{const Se=me.current;if(!Se)return{x:0,y:0};const Me=Se.getBoundingClientRect();return{x:le.clientX-Me.left+Wa,y:le.clientY-Me.top+Wa}},ln=(le,Se)=>{if(!O)return;const Me=le.image;if(!(Me!=null&&Me.url)){oe(null);return}const{x:We,y:et}=wn(Se),$t=(I==null?void 0:I.min)??80,Le=(I==null?void 0:I.max)??320,Qe=(ie==null?void 0:ie.rowId)===le.id?ie.widthPx:tm($t,Le);oe({rowId:le.id,url:Me.url,objectFit:"contain",isVideo:$p(Me),widthPx:Qe,x:We,y:et})},ot=le=>{if(!O||!ie)return;const{x:Se,y:Me}=wn(le);oe(We=>!We||We.x===Se&&We.y===Me?We:{...We,x:Se,y:Me})},tn=()=>{oe(null)},Ut=le=>{N&&Ma(le,c),O&&oe(null)},De=le=>{N&&_a(le,c)};l.useLayoutEffect(()=>{if(!m||f){Ae(null);return}const le=ye.current,Se=le==null?void 0:le.parentElement;if(!le||!Se){Ae(null);return}const Me=()=>{const et=le.querySelector("[data-list-row]");if(!et){Ae(null);return}const $t=Se.getBoundingClientRect(),Le=et.getBoundingClientRect();Ae(Le.top-$t.top+Le.height/2)};Me();const We=new ResizeObserver(Me);return We.observe(le),We.observe(Se),()=>We.disconnect()},[m,f,Pt,Be,Ue,He,t,e,$e,ze,ee,v,Q,A,xt]);const yt=l.useMemo(()=>!f&&Jr.some(le=>{const Se=le.charAt(0),Me=e[`${le}VerticalAlign`];return Ks(Me,e,Se)}),[f,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);l.useLayoutEffect(()=>{var Qe;const le=me.current;if(!le)return;const Se=()=>{le.querySelectorAll("[data-list-col]").forEach(je=>{je.style.transform="";const st=je.querySelector(`.${c}-list-col`);st&&(st.style.minHeight="",st.style.height="");const pt=je.querySelector(`.${c}-list-col-title`);pt&&(pt.style.transform="")})};if(f||!yt){Se();return}const Me=()=>{const je=Array.from(le.querySelectorAll("[data-list-row]")),st=`${c}-list-col`,pt=`${c}-baseline-probe`;je.forEach(Rt=>{Rt.querySelectorAll("[data-list-col]").forEach(qe=>{qe.style.transform="";const nt=qe.querySelector(`.${st}`);nt&&(nt.style.minHeight="",nt.style.height="");const Et=qe.querySelector(`.${c}-list-col-title`);Et&&(Et.style.transform="")})}),je.forEach(Rt=>{const qe=Array.from(Rt.querySelectorAll("[data-list-col]"));Wp(Rt,qe,st)}),le.offsetHeight,je.forEach(Rt=>{const qe=Array.from(Rt.querySelectorAll("[data-list-col]")),nt=Rt.getBoundingClientRect().top,Et=new Map,St=qe.map(ht=>{const Bt=ht.querySelector(`.${c}-list-col-title`),Wt={el:ht,titleEl:Bt,letter:ht.getAttribute("data-col-letter")??"",kind:ht.getAttribute("data-valign")??"top",anchor:ht.getAttribute("data-valign-anchor")};return Et.set(Wt.letter,Wt),Wt}),_t=new Map,$n=(ht,Bt)=>{const Wt=_t.get(ht.letter);if(Wt!==void 0)return Wt;const cn=ht.anchor?Et.get(ht.anchor):void 0;if(ht.kind!=="baseline"||!cn||Bt.has(ht.letter)){const Xn=dr(ht,nt,st,pt);return _t.set(ht.letter,Xn),Xn}Bt.add(ht.letter);const Sn=$n(cn,Bt);Bt.delete(ht.letter);const dn=dr(ht,nt,st,pt),zt=Sn-dn;Np(ht.titleEl,zt);const Cn=dr(ht,nt,st,pt);return _t.set(ht.letter,Cn),Cn};St.forEach(ht=>$n(ht,new Set))})};let We=null;const et=()=>{We===null&&(We=requestAnimationFrame(()=>{We=null,Me()}))};Me();const $t=new ResizeObserver(()=>et());$t.observe(le);let Le=!1;return typeof document<"u"&&((Qe=document.fonts)!=null&&Qe.ready)&&document.fonts.ready.then(()=>{Le||et()}),()=>{Le=!0,We!==null&&(cancelAnimationFrame(We),We=null),$t.disconnect(),Se()}},[yt,f,e,t,ee,Pt,ze]);const vt=l.useMemo(()=>Lp(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:vt}}),r.jsx("div",{style:Ce,children:r.jsxs("div",{ref:me,className:`${c}-wrapper ${Ie}${Ht?` ${Ht}`:""}${f?` ${c}-type-b`:""}`.trim(),style:{width:L.scalingValue(x??0,n),...!f&&m?{[`--${c}-first-entry-handle-top`]:Mt}:{}},onMouseMove:O?ot:void 0,onMouseLeave:O?tn:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[Pt.map((le,Se)=>{var $t;const Me=((($t=le.link)==null?void 0:$t.length)??0)>0,We=Me&&(!n||i)?"a":"div",et=Fa(Se,Pt.length,Q,A,xt,v??0,n??!1);return r.jsxs(We,{ref:Se===0?Le=>{ye.current=Le}:void 0,className:`${c}-list-item${Me||R==="always"?` ${c}-list-item-has-link`:""}`,...Me?{href:le.link,target:"_blank"}:{},style:et,onMouseEnter:Le=>{N&&(Me||R==="always")&&Ma(Le,c),O&&ln(le,Le)},onMouseLeave:Le=>{N&&(Me||R==="always")&&_a(Le,c)},children:[Be>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Re(Be)}}),r.jsxs("div",{className:`${c}-list-cols-row${f?"":` ${c}-list-cols-row-h`}${m&&Se===0&&f?` ${c}-list-cols-row-controls`:""}`,...f?{}:{"data-list-row":""},style:f?void 0:{minHeight:Re(He)},children:[$e.map((Le,Qe)=>{const je=Qe===$e.length-1,st=Ve[Qe],pt=Le.paddingBottom,Rt=Cp(le.cells[Le.key]),qe=f&&Rt&&pt>0,nt=f?{minHeight:Re(He)}:{width:Re(ze[Qe])},Et=f?{paddingLeft:Re(j),paddingRight:Re(j)}:{paddingLeft:Re(st.paddingLeft),paddingRight:Re(st.paddingRight)},St=Le.textPrefix.charAt(0),_t=f?Rp(e[`${Le.textPrefix}VerticalAlign`]):Ip(e[`${Le.textPrefix}VerticalAlign`],e,St),$n=f&&Rt&&m&&Se===0;return r.jsxs("div",{className:f?`${c}-list-col-wrap`:void 0,...f?{}:{"data-list-col":"","data-col-letter":St,"data-valign":_t.kind,..._t.kind==="baseline"?{"data-valign-anchor":_t.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${je?` ${c}-list-col-last`:""}`,style:{...Et,...nt,...f?{justifyContent:Na(_t.kind)}:{}},"data-test":Le.width,children:r.jsx("span",{className:Oa(e,Le.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Ha(Ao(e,Le.textPrefix),n),...Ba(e,Le.textPrefix,c,n),...f?{}:kp(_t.kind)},children:le.cells[Le.key]??null})}),qe&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Re(pt)}}),$n&&r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Le.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Re(Math.max(pt,ur))}})]},Le.key)}),m&&Se===0&&f&&r.jsxs(r.Fragment,{children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ne),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Re(he),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ne),className:`${c}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Re(Math.max(he,tt-he)),width:Re(he),height:"100%"}})]})]}),!f&&Ue>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Re(Ue)}}),m&&Se===0&&!f&&r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Re(It)}})]},le.id)}),m&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Ot,"data-controls-static-handle":"",...f?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${c}-padding-control-handle`,hitPlacement:f?"center":"left-y",areaStyle:{position:"absolute",top:Ze,left:0,width:"100%",height:Re(Math.max(Be,ur))}})},"row-padding-handles"),m&&!f&&Oe&>&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Oe.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ze[0]-((it==null?void 0:it.paddingRight)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Re(rt),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":gt.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ze[$e.length-1]-((Ye==null?void 0:Ye.paddingLeft)??0)),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Re(sn-at),width:Re(at),height:"100%"}})]},"column-edge-padding-handles"),m&&!f&&$e.slice(0,-1).map((le,Se)=>{const Me=$e[Se+1],We=ke.slice(0,Se+1).reduce((je,st)=>je+st,0),et=Ve[Se],$t=Ve[Se+1],Le=Math.max(et.paddingRight,oi),Qe=Math.max($t.paddingLeft,oi);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":le.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ze[Se]-et.paddingLeft),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Re(We-Le),width:Re(Le),height:"100%"}}),r.jsx(Ft,{centerXHitTop:`var(--${c}-first-entry-handle-top, 50%)`,"data-controls":Me.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ze[Se+1]-$t.paddingRight),className:`${c}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Re(We),width:Re(Qe),height:"100%"}})]},`${le.paddingRightKey}-padding`)}),m&&!f&&$e.slice(0,-1).map((le,Se)=>{const Me=em(Se,ke,se,tt),et=ke.slice(0,Se+1).reduce(($t,Le)=>$t+Le,0)-ja/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":le.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(Qr),"data-controls-max-fraction":String(Me),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Re(et),width:Re(ja),height:"calc(100%)",pointerEvents:"auto"}})},`${le.widthKey}-junction`)})]}),xt&&(()=>{const le=Ao(e,yn),Se=Mp(e.cutLabelVerticalAlign),Me=le.textTextAlign==="justify"||f;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Re(S??0),cursor:Lt?"pointer":"default",...Tp(A,v??0,n??!1)},onClick:Lt?Ge:void 0,onMouseEnter:N||O?Ut:void 0,onMouseLeave:N?De:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...f?{paddingLeft:Re(j),paddingRight:Re(j)}:{},justifyContent:_p(le.textTextAlign),alignItems:Na(Se)},children:r.jsx("span",{className:Oa(e,yn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Ha(le,n),...Ba(e,yn,c,n),...Me?{width:"100%"}:{}},children:_})})})})(),O&&ie&&(()=>{const le=$o(ie.widthPx),Se={width:le,height:"auto",maxHeight:le,objectFit:"contain",left:ie.x,top:ie.y,position:"absolute"};return r.jsx(Sp,{media:ie,className:ie.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Se},`${ie.rowId}-${ie.url}`)})()]})})]})}const rm=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
6204
6204
|
import { CommonComponentProps } from '../props';
|
|
6205
6205
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
6206
6206
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -9157,7 +9157,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
9157
9157
|
</>
|
|
9158
9158
|
);
|
|
9159
9159
|
}
|
|
9160
|
-
`,wi=["A","B","C","D","E"],qa=[...Er,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Bn={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 um(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function lo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function pm(){return Object.fromEntries(wi.map((e,t)=>{const n=Mn[t],i=`${e} column`;return[n,um(i)]}))}function mm(){const e={};for(const t of wi)e[`${t}ColumnWidth`]=lo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=lo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=lo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=lo(`${t} column padding bottom`);return e}function Ka(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Mn]};for(const s of wi)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 gm(e){const t={};if(e===yn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Er]},enum:[...Er]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...qa],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...qa]}}return t[Xe(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Xe(e,"textFontSettings")]={...Bn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Xe(e,"textFontSize")]={...Bn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Xe(e,"textLineHeight")]={...Bn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Xe(e,"textLetterSpacing")]={...Bn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Xe(e,"textWordSpacing")]={...Bn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Xe(e,"textTextAlign")]={...Bn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Xe(e,"textTextAppearance")]={...Bn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const hm=Wi.reduce((e,t)=>({...e,...gm(t)}),{});function fm(e){return{verticalAlign:e===yn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===yn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function ym(e,t={}){var n;return{...fm(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Ga=new Set(["textFontFamily","textFontSettings"]);function vm(e,t,n){const i=s=>n===void 0?!0:n==="common"?Ga.has(s):!Ga.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=ea(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Xe(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Xe(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Xe(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Xe(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Xe(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Xe(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Xe(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Xe(e,"textTextAppearance")]=t.textTextAppearance),o}function Co(e={},t){return Wi.reduce((n,i)=>({...n,...vm(i,ym(i,e),t)}),{})}const bm=Co(),xm=Kp();function tl(e){return[Xe(e,"textFontFamily"),Xe(e,"textFontSettings"),Xe(e,"textFontSize"),Xe(e,"textLineHeight"),Xe(e,"textLetterSpacing"),Xe(e,"textWordSpacing"),Xe(e,"textTextAlign"),Xe(e,"textTextAppearance"),`${e}VerticalAlign`]}function wm(){const e=[];return Qr.forEach((t,n)=>{const i=Mn[n],o=tl(t);for(let s=1;s<Mn.length;s+=1){const a=[{name:"columns",value:s},...Array.from({length:s},(u,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(u=>{e.push({if:a,then:{name:`properties.${u}.display.visible`,value:!1}})})}}),e}const $m=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];tl(yn);const Sm=[...wi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],jn=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(1).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(2).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(3).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(4).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(5).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(8).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(9).webp"}],Cm=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:jn[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:jn[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:jn[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:jn[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:jn[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:jn[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:jn[6],link:""}],Tm=[...wi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Lm={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...pm(),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:Cm},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"]}},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"}},...mm(),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"}},...hm,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",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...bm,...Co({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Ka({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},...Co({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Ka({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},...Co({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...wm(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Sm.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}},...wi.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Tm]},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:"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__",xm]}],paletteBookmark:{items:[...$m],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Em={element:cm,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>im(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Wi.map(e=>({path:`settings.${Xe(e,"textFontFamily")}`}))]},fontRelations:{...Wi.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Xe(t,"textFontFamily")}`}),{})},schema:Lm,sourceCode:dm},Ua=300,Ln=.004,Pm={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"},Im=["hover","focus","filled","success","error"];function Rm(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Xa(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Ya(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:M.scalingValue((o-t)/2,i)}}function Mm(e){return`
|
|
9160
|
+
`,wi=["A","B","C","D","E"],Va=[...Lr,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Bn={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 am(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function lo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function sm(){return Object.fromEntries(wi.map((e,t)=>{const n=An[t],i=`${e} column`;return[n,am(i)]}))}function lm(){const e={};for(const t of wi)e[`${t}ColumnWidth`]=lo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=lo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=lo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=lo(`${t} column padding bottom`);return e}function Da(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...An]};for(const s of wi)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 cm(e){const t={};if(e===yn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Lr]},enum:[...Lr]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Va],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Va]}}return t[Xe(e,"textFontFamily")]={type:"string",scope:"layout",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Xe(e,"textFontSettings")]={...Bn.fontSettings,scope:"layout",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Xe(e,"textFontSize")]={...Bn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Xe(e,"textLineHeight")]={...Bn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Xe(e,"textLetterSpacing")]={...Bn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Xe(e,"textWordSpacing")]={...Bn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Xe(e,"textTextAlign")]={...Bn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Xe(e,"textTextAppearance")]={...Bn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const dm=Wi.reduce((e,t)=>({...e,...cm(t)}),{});function um(e){return{verticalAlign:e===yn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===yn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function pm(e,t={}){var n;return{...um(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const qa=new Set(["textFontFamily","textFontSettings"]);function mm(e,t,n){const i=s=>n===void 0?!0:n==="common"?qa.has(s):!qa.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Zr(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Xe(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Xe(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Xe(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Xe(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Xe(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Xe(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Xe(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Xe(e,"textTextAppearance")]=t.textTextAppearance),o}function Co(e={},t){return Wi.reduce((n,i)=>({...n,...mm(i,pm(i,e),t)}),{})}const gm=Co(),hm=jp();function Js(e){return[Xe(e,"textFontFamily"),Xe(e,"textFontSettings"),Xe(e,"textFontSize"),Xe(e,"textLineHeight"),Xe(e,"textLetterSpacing"),Xe(e,"textWordSpacing"),Xe(e,"textTextAlign"),Xe(e,"textTextAppearance"),`${e}VerticalAlign`]}function fm(){const e=[];return Jr.forEach((t,n)=>{const i=An[n],o=Js(t);for(let s=1;s<An.length;s+=1){const a=[{name:"columns",value:s},...Array.from({length:s},(u,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(u=>{e.push({if:a,then:{name:`properties.${u}.display.visible`,value:!1}})})}}),e}const ym=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Js(yn);const vm=[...wi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],jn=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(1).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(2).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(3).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(4).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(5).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(8).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(9).webp"}],bm=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:jn[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:jn[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:jn[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:jn[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:jn[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:jn[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:jn[6],link:""}],xm=[...wi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],wm={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...sm(),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:bm},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"]}},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"}},...lm(),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"}},...dm,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",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...gm,...Co({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Da({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},...Co({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Da({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},...Co({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...fm(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...vm.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}},...wi.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...xm]},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:"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__",hm]}],paletteBookmark:{items:[...ym],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},$m={element:om,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Zp(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Wi.map(e=>({path:`${Xe(e,"textFontFamily")}`}))]},fontRelations:{...Wi.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Xe(t,"textFontFamily")}`}),{})},schema:wm,sourceCode:rm},Ka=300,Ln=.004,Sm={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"},Cm=["hover","focus","filled","success","error"];function Tm(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ga(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Ua(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:L.scalingValue((o-t)/2,i)}}function Lm(e){return`
|
|
9161
9161
|
.${e}-wrapper {
|
|
9162
9162
|
box-sizing: border-box;
|
|
9163
9163
|
display: flex;
|
|
@@ -9219,7 +9219,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
9219
9219
|
display: flex;
|
|
9220
9220
|
align-items: center;
|
|
9221
9221
|
justify-content: space-between;
|
|
9222
|
-
gap: ${
|
|
9222
|
+
gap: ${Tm(20)};
|
|
9223
9223
|
width: 100%;
|
|
9224
9224
|
min-width: 0;
|
|
9225
9225
|
min-height: var(--${e}-question-min-height, unset);
|
|
@@ -9247,7 +9247,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
9247
9247
|
width: var(--${e}-icon-max-width);
|
|
9248
9248
|
height: var(--${e}-icon-max-width);
|
|
9249
9249
|
position: relative;
|
|
9250
|
-
transition: transform ${
|
|
9250
|
+
transition: transform ${Ka}ms ease;
|
|
9251
9251
|
}
|
|
9252
9252
|
.${e}-icon-custom {
|
|
9253
9253
|
display: flex;
|
|
@@ -9282,7 +9282,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
9282
9282
|
.${e}-panel {
|
|
9283
9283
|
display: grid;
|
|
9284
9284
|
grid-template-rows: 0fr;
|
|
9285
|
-
transition: grid-template-rows ${
|
|
9285
|
+
transition: grid-template-rows ${Ka}ms ease;
|
|
9286
9286
|
}
|
|
9287
9287
|
.${e}-item-open .${e}-panel {
|
|
9288
9288
|
grid-template-rows: 1fr;
|
|
@@ -9350,7 +9350,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
9350
9350
|
left: 20px;
|
|
9351
9351
|
transform: translateY(-50%);
|
|
9352
9352
|
}
|
|
9353
|
-
`}function
|
|
9353
|
+
`}function Xa(e,t,n,i,o,s,a,u){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:a,color:u??"#000000"}}function Em({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s}){const{prefix:a}=L.useScopedStyles(),u=o??!1,{wrapperWidth:c=1,cellMinHeight:m=0,dividerWidth:p=694e-6,dividerStyle:E="solid",entryHoverEffect:x="default",autoclose:C="off",icon:g,iconMaxWidth:v=.00833,iconPaddingRight:T=0,iconAnimation:w="rotate 45",questionColor:$="#000000",answerColor:S="#000000",dividerColor:_="#0000001F",iconColor:I="#000000",questionHoverColor:F="#666666",iconHoverColor:P="#666666",iconActiveColor:R="#000000",dividerHoverColor:Y="#000000",questionFontFamily:y,questionFontSettings:M,questionFontSize:W,questionLineHeight:D,questionLetterSpacing:te,questionWordSpacing:pe,questionTextAppearance:K,answerFontFamily:H,answerFontSettings:Z,answerFontSize:U,answerLineHeight:B,answerLetterSpacing:J,answerWordSpacing:ie,answerTextAppearance:oe,questionPaddingLeft:O=0,questionPaddingTop:de=0,questionPaddingBottom:f=0,answerPaddingLeft:me=0,answerPaddingRight:ye=0,answerPaddingTop:ve=0,answerPaddingBottom:Ae=0}=e,ee=t??[],[ge,X]=l.useState(()=>new Set),G=!n||i;l.useEffect(()=>{X(new Set)},[C]),l.useEffect(()=>{n&&!o&&!i&&X(new Set)},[n,o,i]);const j=Re=>L.scalingValue(Re,n??!1),he=Math.max(O,Ln),ne=Math.max(de,Ln),Ce=Math.max(f,Ln),we=Math.max(me,Ln),xe=Math.max(ye,Ln),Ie=Math.max(ve,Ln),N=Math.max(Ae,Ln),Q=Math.max(0,(c??1)-T-v),A=Math.max(0,(c??1)-ye),q=Math.max(0,(c??1)-me),V=Math.max(T,Ln),ae=Math.max(0,(c??1)-O-v),ue=l.useMemo(()=>ge.size===0?0:Math.min(...ge),[ge]),Te=l.useCallback(Re=>ge.has(Re),[ge]),Fe=G&&x==="default"?`${a}-entry-hover-default`:"",Pe=g??"",$e=Pe!=="",tt=w.replace(/^rotate /,""),se=`${a}-icon-anim-${tt}`,ke=qt(kt(Xa(y,M,W,D,te,pe,K,$),n)),ze=qt(kt(Xa(H,Z,U,B,J,ie,oe,S),n)),Ve=Ga(W,D,`${a}-question`,`${a}-text-tight-leading`),dt=Ga(U,B,`${a}-answer-text`,`${a}-text-tight-leading`),ft=Ua(W,D,a,n),Pt=Ua(U,B,a,n),xt=L.buildColorVars(a,{questionColor:$,answerColor:S,dividerColor:_,iconColor:I,questionHoverColor:F,iconHoverColor:P,iconActiveColor:R,dividerHoverColor:Y},Sm,Cm),wt=s&&s!=="default"?`${a}-state-${s}`:"",Ht=l.useCallback(Re=>{G&&X(Be=>{if(Be.has(Re)){const He=new Set(Be);return He.delete(Re),He}if(C==="on")return new Set([Re]);const Ue=new Set(Be);return Ue.add(Re),Ue})},[G,C]),Lt=l.useMemo(()=>Lm(a),[a]),Ge={[`--${a}-divider-width`]:L.scalingValue(p,n??!1),[`--${a}-divider-style`]:E,[`--${a}-icon-max-width`]:L.scalingValue(v,n??!1),...m>0?{[`--${a}-question-min-height`]:L.scalingValue(m,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Lt}}),r.jsx("div",{style:xt,children:r.jsx("div",{className:Je(`${a}-wrapper`,n&&!i&&`${a}-editor`,Fe,wt),style:{width:L.scalingValue(c,n??!1),maxWidth:"100%",...Ge},children:ee.map((Re,Be)=>{var Mt;const Ue=Te(Be),He=((Mt=Re.question)==null?void 0:Mt.trim())??"",ut=Re.answer,It=((ut==null?void 0:ut.length)??0)>0,Ze=u&&Be===ue;return r.jsxs("div",{className:Je(`${a}-item`,Ue&&`${a}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${a}-question-controls`,children:[Ze&&r.jsxs(r.Fragment,{children:[r.jsx(Ft,{"data-controls":"questionPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:j(ne),zIndex:2}}),r.jsx(Ft,{"data-controls":"questionPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Q),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:j(he),height:"100%",zIndex:2}}),r.jsx(Ft,{"data-controls":"iconPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ae),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:j(V),height:"100%",zIndex:2}})]}),r.jsxs("button",{type:"button",className:`${a}-question-button`,"aria-expanded":Ue,style:{...ke,...ft,paddingLeft:j(O),paddingRight:j(T)},onClick:()=>Ht(Be),children:[de>0&&r.jsx("span",{className:`${a}-padding-handle`,style:{height:j(de)},"aria-hidden":"true"}),r.jsxs("span",{className:`${a}-question-row`,children:[r.jsx("span",{className:Ve,children:He}),It&&($e?r.jsx("span",{className:`${a}-icon ${a}-icon-custom ${se}`,"aria-hidden":"true",children:r.jsx(Qt,{url:Pe,fill:I,hoverFill:P,className:`${a}-icon-image`})}):r.jsx("span",{className:`${a}-icon ${a}-icon-default ${se}`,"aria-hidden":"true"}))]}),f>0&&r.jsx("span",{className:`${a}-padding-handle`,style:{height:j(f)},"aria-hidden":"true"})]}),Ze&&r.jsx(Ft,{"data-controls":"questionPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:j(Ce),zIndex:2}})]}),It&&ut&&r.jsx("div",{className:`${a}-panel`,"aria-hidden":!Ue,children:r.jsx("div",{className:`${a}-panel-inner`,children:r.jsxs("div",{className:`${a}-answer-controls`,children:[Ze&&Ue&&r.jsxs(r.Fragment,{children:[r.jsx(Ft,{"data-controls":"answerPaddingTop","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:j(Ie),zIndex:2}}),r.jsx(Ft,{"data-controls":"answerPaddingLeft","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(A),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:j(we),height:"100%",zIndex:2}}),r.jsx(Ft,{"data-controls":"answerPaddingRight","data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(q),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,right:0,width:j(xe),height:"100%",zIndex:2}})]}),ve>0&&r.jsx("div",{className:`${a}-padding-handle`,style:{height:j(ve)}}),r.jsx("div",{className:`${a}-answer`,style:{...ze,...Pt,paddingLeft:j(me),paddingRight:j(ye)},children:r.jsx("div",{className:dt,children:r.jsx(ui,{content:ut})})}),Ae>0&&r.jsx("div",{className:`${a}-padding-handle`,style:{height:j(Ae)}}),Ze&&Ue&&r.jsx(Ft,{"data-controls":"answerPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:j(N),zIndex:2}})]})})})]},Be)})})})]})}const Pm=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
9354
9354
|
import cn from 'classnames';
|
|
9355
9355
|
import { CommonComponentProps } from '../props';
|
|
9356
9356
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -10147,7 +10147,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
10147
10147
|
</>
|
|
10148
10148
|
);
|
|
10149
10149
|
}
|
|
10150
|
-
`;function En(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Za={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},_m=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Fm={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:En("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:{...Za.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:{...Za.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:En("Question Padding Left"),questionPaddingTop:En("Question Padding Top"),questionPaddingBottom:En("Question Padding Bottom"),answerPaddingLeft:En("Answer Padding Left"),answerPaddingRight:En("Answer Padding Right"),answerPaddingTop:En("Answer Padding Top"),answerPaddingBottom:En("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/component-assets/PlusIcon.svg",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[..._m],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Wm={element:km,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:"settings.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"settings.questionFontFamily"},{path:"settings.answerFontFamily"}]},fontRelations:{questionFontSettings:"questionFontFamily",answerFontSettings:"answerFontFamily"},schema:Fm,sourceCode:Am},vn=e=>e.display==="cover",Go=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Qa=100,Nm=.2,es=8,nl=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=l.useState(0),[a,u]=l.useState(!1),c=l.useRef(null),m=l.useRef(0);m.current=o;const p=l.useMemo(()=>typeof window>"u"?Qa:Math.max(Qa,window.innerHeight*Nm),[]),R=l.useCallback(v=>Math.max(0,1-v/(p*1.5)),[p]),x=l.useCallback(v=>Math.max(0,1-v/(p*.45)),[p]),L=l.useCallback(v=>{const A=typeof window<"u"?window.innerHeight:800,B=Math.max(.88,1-v/A*.12);return`translateY(${v}px) scale(${B})`},[]),g=l.useCallback(()=>{c.current=null},[]),y=l.useCallback(()=>{u(!0),s(0),window.setTimeout(()=>u(!1),n),g()},[n,g]),w=l.useCallback(()=>{const v=typeof window<"u"?window.innerHeight:800;u(!0),s(v),window.setTimeout(()=>{t(),g(),u(!1)},Math.min(n,200))},[n,t,g]),$=l.useCallback(v=>{!e||a||v.pointerType==="touch"&&(i!=null&&i(v.target)||(c.current={startX:v.clientX,startY:v.clientY,isLocked:null,pointerId:v.pointerId}))},[e,a,i]),S=l.useCallback(v=>{const A=c.current;if(!e||!A||v.pointerType!=="touch"||A.pointerId!==v.pointerId)return;const B=v.clientX-A.startX,V=v.clientY-A.startY;if(A.isLocked===null){if(Math.abs(B)<es&&Math.abs(V)<es)return;if(V>0&&V>Math.abs(B))A.isLocked=!0,v.currentTarget.setPointerCapture(v.pointerId);else{A.isLocked=!1,g();return}}if(!A.isLocked)return;v.preventDefault();const ne=Math.max(0,V);m.current=ne,s(ne)},[e,g]),C=l.useCallback(v=>{const A=c.current;if(!e||!A||v.pointerType!=="touch"||A.pointerId!==v.pointerId)return;const B=A.isLocked===!0;if(v.currentTarget.hasPointerCapture(v.pointerId)&&v.currentTarget.releasePointerCapture(v.pointerId),!B){g();return}v.clientY-A.startY>=p?w():y()},[p,w,e,g,y]),k=l.useCallback(v=>{C(v)},[C]),P=l.useCallback(v=>{C(v)},[C]),H=o>0,I=a?`transform ${n}ms ease`:"none",E=a?`opacity ${n}ms ease`:"none",Z=o>0||a;return{isSwipeDragging:H,backdropStyle:{opacity:R(o),transition:E},mediaAreaStyle:{transform:L(o),transition:I,touchAction:H?"none":void 0,willChange:H?"transform":void 0},overlayContentStyle:Z?{opacity:x(o),transition:E}:void 0,swipeHandlers:e?{onPointerDown:$,onPointerMove:S,onPointerUp:k,onPointerCancel:P}:{},dismissAreaStyle:e?{touchAction:H?"none":"pan-x"}:void 0}},Hm="[data-lightbox-scrollable]",il=()=>{l.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 a=u=>{const c=u.target;c instanceof Element&&c.closest(Hm)||u.preventDefault()};return document.addEventListener("touchmove",a,{passive:!1}),()=>{document.removeEventListener("touchmove",a),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(0,e)}},[])},Om=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Bm=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},jm=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},zm=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const a=e.scrollLeft,u=n-a,c=a-n,m=(g,y)=>{Bm(t),e.scrollLeft=g,y&&(s==null||s())};if(Math.abs(u)<.5)return m(n,!0),()=>{};let p=!1,R=0;const x=()=>{t.removeEventListener("transitionend",L),clearTimeout(R)},L=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,x(),m(n,!0))};return t.addEventListener("transitionend",L),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)`,R=window.setTimeout(()=>{p||(p=!0,x(),m(n,!0))},i+64),()=>{p||(p=!0,x(),m(a-jm(t),!1))}},Pi=300,Vm=900,Dm=1500,qm="cubic-bezier(0.16, 1, 0.3, 1)",Km=3e3,Gm=2,Um=16,Xm=.05,Ym=1,co=.3,Jm=50,Zm=20,ei=.004,hi=["title1","title2","title3"],Qm={title1:"1",title2:"2",title3:"3"},eg={title1:"title1Color",title2:"title2Color",title3:"title3Color"},tg={title1:.02,title2:.02,title3:.02},uo=e=>`max(${e}, ${Zm}px)`,ng=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]}},ig=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=ng(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},lt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,og=e=>[lt(e,"fontFamily"),lt(e,"fontSettings"),{type:"row",items:[lt(e,"fontSize"),lt(e,"lineHeight"),lt(e,"letterSpacing"),lt(e,"wordSpacing")]},lt(e,"textAlign"),lt(e,"textAppearance")],rg=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(hi.map(e=>[Qm[e],og(e)]))}),ia=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,a)=>s+a,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:a},u)=>{if(s<=0||u<=0)return{overflow:s,widths:[u,...a]};const c=Math.min(s,u);return{overflow:s-c,widths:[u-c,...a]}},{overflow:i-1,widths:[]});return o},ol=(e,t)=>ia(e,t),po=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ts=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:ia(e.length,n),effective:ol(e.length,n)}},ag=(e,t,n,i,o,s,a)=>{const u=[];return t&&u.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&u.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:s,text:n}),i&&u.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:a,text:i}),u},gr=(e,t)=>{const n=i=>{const o=lt(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[eg[t]]}},sg=(e,t,n,i)=>e.slice(0,i).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),hr=(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??tg[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return kt(i,n)},lg=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:a})=>{const{backgroundColor:u,thumbnailSize:c,thumbnailGap:m,thumbnailMarginBottom:p,imageGap:R,closeIcon:x,closeIconMaxWidth:L,closeIconColor:g,closeIconHoverColor:y,thumbnailTrigger:w,thumbnailVisibility:$,thumbnailObjectFit:S,thumbnailActive:C,thumbnailActiveColor:k,title1Width:P,title2Width:H,title3Width:I,title1MarginLeft:E=0,title2MarginLeft:Z=0,title3MarginLeft:v=0,titleRowMarginBottom:A=0,titleHeaderLayout:B="desktop",contentMarginTop:V,iconMarginLeft:ne}=n,ce=d=>M.scalingValue(d,i??!1),X=c??n.thumnailSize??.03,j=ce(X),_=ce(m),N=ce(p??.02),T=ce(R??0),K=ce(V??0),Y=uo(K),Q=ce(ne??0),[O,oe]=l.useState(0),h=l.useRef(O);h.current=O;const ae=t[O],{title1:ye,title2:ve,title3:Me}=ig(ae),ie=hr("title1",gr(n,"title1"),i),ge=hr("title2",gr(n,"title2"),i),ee=hr("title3",gr(n,"title3"),i),J=B==="mobile",D=!o&&(!i||s),he=D,re=D,Ce=D,we=vn(S),xe=we?{"--image-aspect-ratio":Go(S)}:void 0,Ie=!!(ye||ve||Me),z=l.useMemo(()=>ag(e,ye,ve,Me,ie,ge,ee),[e,O,ye,ve,Me,ie,ge,ee]),te=l.useMemo(()=>({title1Width:P,title2Width:H,title3Width:I}),[P,H,I]),F=l.useMemo(()=>z.map(d=>te[d.widthKey]),[z,te]),U=l.useMemo(()=>ia(z.length,F),[z.length,F]),G=l.useMemo(()=>ol(z.length,F),[z.length,F]),le=l.useMemo(()=>z.filter(d=>d.prefix==="title1"),[z]),me=l.useMemo(()=>z.filter(d=>d.prefix==="title2"||d.prefix==="title3"),[z]),Te=l.useMemo(()=>ts(le,te),[le,te]),Fe=l.useMemo(()=>ts(me,te),[me,te]),Pe=l.useCallback((d,f)=>{const b=z.indexOf(d);if(!J||f==="single-row")return{effectiveWidth:G[b]??0,resolvedWidth:U[b]??0,maxWidth:po(b,U)};if(f==="two-row-top"){const se=le.indexOf(d);return{effectiveWidth:Te.effective[se]??0,resolvedWidth:Te.resolved[se]??0,maxWidth:po(se,Te.resolved)}}const q=me.indexOf(d);return{effectiveWidth:Fe.effective[q]??0,resolvedWidth:Fe.resolved[q]??0,maxWidth:po(q,Fe.resolved)}},[me,Fe,G,U,z,le,Te,J]),$e=l.useCallback(d=>M.scalingValue(d,i??!1),[i]),tt=$e(A??0),de=l.useMemo(()=>({title1MarginLeft:E,title2MarginLeft:Z,title3MarginLeft:v}),[E,Z,v]),ke=l.useCallback(d=>z.slice(0,d+1).reduce((f,b,q)=>f+(b!=null&&b.marginLeftKey?de[b.marginLeftKey]??0:0)+(U[q]??0),0)+(J?0:E??0),[z,de,U,J,E]),ze=l.useCallback(()=>J?0:E??0,[J,E]),Ve=l.useCallback(d=>me.slice(0,d).reduce((f,b,q)=>f+(b.marginLeftKey?de[b.marginLeftKey]??0:0)+(Fe.resolved[q]??0),0),[me,Fe.resolved,de]),dt=l.useCallback(d=>{const f=me[d];return Ve(d)+(f.marginLeftKey?de[f.marginLeftKey]??0:0)+(Fe.resolved[d]??0)},[me,Fe.resolved,Ve,de]),ft=(d,f)=>{const b=d.marginLeftKey?de[d.marginLeftKey]??0:0,{effectiveWidth:q,resolvedWidth:se,maxWidth:be}=Pe(d,f),_e=o&&f==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":d.prefix,style:{...f==="single-row"?{gridArea:d.prefix}:{},width:$e(q),...b>0?{marginLeft:$e(b)}:{}},children:[r.jsx("p",{className:d.className,style:d.style,children:d.text}),_e&&d.marginLeftKey&&r.jsx("div",{"data-controls":d.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(se),style:{position:"absolute",top:0,left:$e(-b),width:`max(${$e(b)}, 10px)`,height:"100%",pointerEvents:"auto"}}),_e&&r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(be),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:$e(-ei/2),width:$e(ei),height:"100%",pointerEvents:"auto"}})]},d.className)},Pt=()=>{const d=J?-1:z.findIndex(q=>q.prefix==="title1"),f=!J&&(o||(E??0)>0)?(()=>{const q=E??0,se=d>=0?U[d]:P??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(se),style:{position:"absolute",top:0,left:0,width:`max(${$e(q)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,b=z.flatMap((q,se)=>{if(!q.marginLeftKey)return[];const be=de[q.marginLeftKey]??0,_e=sg(z,U,de,se)+ze();return r.jsx("div",{"data-controls":q.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(U[se]),style:{position:"absolute",top:0,left:$e(_e),width:`max(${$e(be)}, 10px)`,height:"100%",pointerEvents:"auto"}},q.marginLeftKey)});return f?[f,...b]:b},xt=()=>z.map((d,f)=>{const b=po(f,U),se=ke(f)-ei/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(b),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:$e(se),width:$e(ei),height:"100%",pointerEvents:"auto"}})},`${d.widthKey}-junction`)}),wt=()=>me.flatMap((d,f)=>{if(!d.marginLeftKey)return[];const b=de[d.marginLeftKey]??0,q=Ve(f),{resolvedWidth:se}=Pe(d,"two-row-bottom");return r.jsx("div",{"data-controls":d.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(se),style:{position:"absolute",top:0,left:$e(q),width:`max(${$e(b)}, 10px)`,height:"100%",pointerEvents:"auto"}},d.marginLeftKey)}),Ht=()=>me.map((d,f)=>{const{maxWidth:b}=Pe(d,"two-row-bottom"),se=dt(f)-ei/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(b),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:$e(se),width:$e(ei),height:"100%",pointerEvents:"auto"}})},`${d.widthKey}-junction`)}),Lt=l.useRef(null),Ge=l.useRef(null),Re=l.useRef(null),Be=l.useRef(null),Ue=l.useRef([]),He=l.useRef([]),ut=l.useRef(0),It=l.useRef(null),Ze=l.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),At=l.useRef(null),Ot=l.useRef(null),Oe=l.useRef(0),gt=l.useRef("forward"),it=l.useRef(0),Ye=l.useRef(null),rt=l.useRef(!1),at=t.length>1&&(!o||!!s),sn=at?3:1,wn=l.useMemo(()=>Array.from({length:sn},()=>t).flat(),[t,sn]),[ln,ot]=l.useState(!1),[tn,Ut]=l.useState(!1),[De,yt]=l.useState(!0),vt=l.useRef(null),ue=l.useRef(null),Se=l.useRef(!1),Ae=l.useRef(!1),We=l.useRef(null),et=l.useRef(null),$t=he&&!De,Le=l.useCallback(()=>{he&&(yt(!0),et.current&&clearTimeout(et.current),et.current=setTimeout(()=>{Ze.current.isActive||yt(!1)},Km))},[he]),Qe=l.useCallback(()=>{o||Ae.current||(Ae.current=!0,Ut(!1),We.current=setTimeout(()=>{a()},Pi))},[o,a]),je=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":$t?"true":"false",style:{width:M.scalingValue(L??0,i),height:M.scalingValue(L??0,i),marginRight:Q,"--close-icon-hover-color":y},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Qe,"aria-label":"Close",children:r.jsx(Qt,{url:x,fill:g,hoverFill:i&&!s?g:y,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:Q,height:"100%",pointerEvents:"auto"}})]}),st=(d="two-row")=>r.jsx("div",{...d==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:$e(E??0),flexShrink:0,...d==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...d==="two-row"&&o?{pointerEvents:"auto"}:{}}}),pt=()=>{const d=z.find(q=>q.prefix==="title1"),f=z.filter(q=>q.prefix==="title2"||q.prefix==="title3"),b=f.length>0||o||(A??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(E??0)>0||o?st():null,d&&ft(d,"two-row-top"),x&&je()]}),b?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[f.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[f.map(q=>ft(q,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[wt(),Ht()]})]}):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:tt,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},Rt=()=>r.jsxs(r.Fragment,{children:[(E??0)>0||o?st("single-row"):null,z.map(d=>ft(d,"single-row")),o?r.jsxs(r.Fragment,{children:[Pt(),xt()]}):null,x?je():null]}),qe=l.useCallback(d=>!!(d.closest("[data-controls]")||d.closest(`.${e}-thumbnails`)||d.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:nt,backdropStyle:Et,mediaAreaStyle:St,overlayContentStyle:_t,swipeHandlers:$n,dismissAreaStyle:ht}=nl({enabled:D??!1,onClose:Qe,animMs:Pi,isBlockedTarget:qe}),Bt=()=>{if(!at||t.length===0)return ut.current=0,0;const d=He.current[0],f=He.current[t.length];if(!d||!f)return ut.current;const b=f.offsetLeft-d.offsetLeft;return b>0&&(ut.current=b),ut.current},Wt=(d=!1)=>{if(!at)return;const f=Ge.current,b=Bt();!f||b<=0||b<f.clientWidth*.25||(f.scrollLeft<=0?(f.scrollLeft+=b,d&&(Ze.current.scrollLeft+=b),rt.current&&(it.current+=b)):f.scrollLeft>=b*2&&(f.scrollLeft-=b,d&&(Ze.current.scrollLeft-=b),rt.current&&(it.current-=b)))},cn=(d,f=(b=>(b=Ge.current)==null?void 0:b.scrollLeft)()??0)=>{if(!at)return d;let q=t.length+d,se=1/0;for(let be=0;be<sn;be++){const _e=be*t.length+d,Ke=He.current[_e];if(!Ke)continue;const Mt=Math.abs(Ke.offsetLeft-f);Mt<se&&(se=Mt,q=_e)}return q},Sn=d=>{const f=Ge.current;return!d||!f?!1:d.offsetWidth>f.clientWidth+1},dn=d=>{const f=Ge.current;if(!d||!f||!Sn(d))return!1;const b=d.offsetLeft,q=b+d.offsetWidth;return f.scrollLeft>=b-1&&f.scrollLeft+f.clientWidth<=q+1},zt=(d=(f=>(f=Ge.current)==null?void 0:f.scrollLeft)()??0)=>{for(let q=0;q<He.current.length;q+=1){const se=He.current[q];if(se&&dn(se))return q}let b={flatIndex:0,distance:1/0};return He.current.forEach((q,se)=>{if(!q)return;const be=Math.abs(q.offsetLeft-d);be<b.distance&&(b={flatIndex:se,distance:be})}),b.flatIndex},Cn=d=>{Ge.current&&He.current.forEach(f=>{f&&(f.style.scrollSnapAlign=Sn(f)&&d==="backward"?"end":"start")})},Xn=(d,f,b)=>{const q=d-f,se=zt(f),be=He.current[se];if(dn(be))return zt(d)%t.length;const _e=He.current[se+1],Ke=be?_e?_e.offsetLeft-be.offsetLeft:be.offsetWidth:0,Mt=Ke>0?q>Ke*co?1:q<-Ke*co?-1:0:0;return Mt===0?b:at?(b+Mt+t.length)%t.length:Math.max(0,Math.min(t.length-1,b+Mt))},Yn=l.useCallback((d=!1)=>{if($!=="on"||o)return;const f=Be.current,b=h.current,q=Ue.current[b];if(!f||!q||f.scrollWidth<=f.clientWidth)return;const se=f.scrollLeft,be=se+f.clientWidth,_e=q.offsetLeft,Ke=_e+q.offsetWidth;if(_e>=se&&Ke<=be)return;const Mt=f.scrollWidth-f.clientWidth;let Ct=se;if(!d&&vt.current===null){const Zn=Ue.current[b-1],Si=Ue.current[b+1],eo=Zn?q.offsetLeft-Zn.offsetLeft:Si?Si.offsetLeft-q.offsetLeft:q.offsetWidth;Ke>be?Ct+=eo:_e<se&&(Ct-=eo)}else Ke>be?Ct=Ke-f.clientWidth:Ct=_e;f.scrollLeft=Math.max(0,Math.min(Mt,Ct))},[o,$]),$i=l.useCallback((d=!1)=>{d&&(Se.current=!0),ue.current===null&&(ue.current=requestAnimationFrame(()=>{ue.current=null;const f=Se.current;Se.current=!1,Yn(f)}))},[Yn]),Yo=l.useCallback(d=>{if(d===h.current)return;const f=h.current;h.current=d;const b=Math.abs(d-f)>1,q=at&&t.length>1&&(f===t.length-1&&d===0||f===0&&d===t.length-1);oe(d),$i(b||q)},[t.length,at,$i]),Xt=()=>{if(!Ge.current||t.length===0||vt.current!==null||Ze.current.isActive&&Ze.current.hasMoved)return;const d=Ge.current.scrollLeft,f=zt(d)%t.length;f!==h.current&&Yo(f)},Xi=()=>{vt.current=null},Yt=d=>{const f=Ge.current;f&&(f.style.scrollSnapType=d?"":"none")},un=()=>{var d;(d=Ot.current)==null||d.call(Ot),Ot.current=null},Tn=()=>{Ye.current!==null&&(cancelAnimationFrame(Ye.current),Ye.current=null),rt.current=!1},Fn=()=>{const d=Ge.current;if(!d){Ye.current=null,rt.current=!1;return}const f=it.current-d.scrollLeft;if(Math.abs(f)<.5){d.scrollLeft=it.current,Wt(),Xt(),Ye.current=null,rt.current=!1;return}d.scrollLeft+=f*Xm,Wt(),Xt(),Le(),Ye.current=requestAnimationFrame(Fn)},Wn=()=>{const d=Re.current;d&&(d.style.transition="",d.style.transform="",d.style.willChange="")},Yi=(d,f,b,q)=>{Wn(),d.scrollLeft=f,Oe.current=d.scrollLeft,Wt(),b!==void 0?(h.current=b,oe(b)):Xt(),Yt(!0),q==null||q()},Ji=(d,{behavior:f="smooth",activeIndex:b,onComplete:q}={})=>{const se=Ge.current,be=Re.current;if(!se||!be)return;if(Tn(),un(),Yt(!1),f==="auto"){Yi(se,d,b,q);return}const _e=Math.abs(d-se.scrollLeft),Ke=Om(_e,Vm,Dm,se.clientWidth*.55);Ot.current=zm(se,be,d,{duration:Ke,easing:qm,onComplete:()=>{Ot.current=null,Yi(se,d,b,q)}})},Jo=(d="smooth")=>{const f=Ge.current;if(!f||t.length===0)return;const b=zt()%t.length,q=cn(b,f.scrollLeft),se=He.current[q];se&&Ji(se.offsetLeft,{behavior:d,activeIndex:b})},Zo=(d,f="smooth",b,q)=>{const se=Ge.current;if(!se||t.length===0)return;const be=(q??se.scrollLeft)-d,_e=zt(d),Ke=He.current[_e];if(dn(Ke)){Yt(!0),Xt();return}const Mt=He.current[_e+1],Ct=Ke?Mt?Mt.offsetLeft-Ke.offsetLeft:Ke.offsetWidth:0;if((Ct>0?be>Ct*co?1:be<-Ct*co?-1:0:0)!==0){const cl=b??_e%t.length,dl=Xn(q??se.scrollLeft,d,cl);nn(dl,f);return}const Si=q??se.scrollLeft,eo=zt(Si),aa=He.current[eo];if(aa&&Math.abs(aa.offsetLeft-Si)<1){Yt(!0),Xt();return}Jo("auto")},nn=(d,f="smooth")=>{const b=Ge.current;if(!b||t.length===0)return;const q=cn(d,b.scrollLeft),se=He.current[q];se&&(f==="smooth"?vt.current=d:vt.current=null,h.current=d,oe(d),$i(!0),Ji(se.offsetLeft,{behavior:f,activeIndex:d,onComplete:f==="smooth"?Xi:void 0}))},Jn=()=>{At.current&&(window.removeEventListener("pointerup",At.current),window.removeEventListener("pointercancel",At.current),At.current=null)},Zi=(d,f,b,q,se)=>{const be=b-d,_e=q-f,Ke=Math.abs(be),Mt=Math.abs(_e);if(Ke<Jm||Ke<=Mt)return!1;const Ct=be<0?1:-1,Zn=at?(se+Ct+t.length)%t.length:Math.max(0,Math.min(t.length-1,se+Ct));return Zn===se?!1:(nn(Zn),!0)},Nn=d=>{if(!Ze.current.isActive)return;Jn();const f=Ge.current;if(!f)return;const{scrollLeft:b,startActiveIndex:q,hasMoved:se}=Ze.current,be=f.scrollLeft;Wt(!0),Ze.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ot(!1),d!==void 0&&f.hasPointerCapture(d)&&f.releasePointerCapture(d),se?Zo(b,"smooth",q,be):(Yt(!0),Xt()),Le()},Qi=(d,f)=>{const b=It.current;It.current=null,b&&(Zi(b.startX,b.startY,d,f,b.startActiveIndex),Le())},Qo=d=>{if(!re)return;if(d.pointerType==="touch"){if(Tn(),Yt(!0),qe(d.target))return;It.current={startX:d.clientX,startY:d.clientY,startActiveIndex:h.current};return}if(d.pointerType!=="mouse"||d.button!==0||qe(d.target))return;const f=Ge.current;if(!f)return;Tn(),un(),Wn(),vt.current=null,Ze.current={isActive:!0,startX:d.clientX,scrollLeft:f.scrollLeft,startActiveIndex:h.current,hasMoved:!1},Yt(!1),Le(),f.setPointerCapture(d.pointerId),Jn();const b=q=>{q.pointerType==="mouse"&&Nn(q.pointerId)};At.current=b,window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b)},er=d=>{if(!re||d.pointerType!=="mouse")return;const f=Ge.current;if(!f||!Ze.current.isActive)return;if(d.buttons===0){Nn(d.pointerId);return}const b=d.clientX-Ze.current.startX;Math.abs(b)>Ym&&(Ze.current.hasMoved=!0,ot(!0)),Ze.current.hasMoved&&(d.preventDefault(),f.scrollLeft=Ze.current.scrollLeft-b,Wt(!0),Xt(),Le())},W=d=>{if(re){if(d.pointerType==="touch"){d.type==="pointerup"?Qi(d.clientX,d.clientY):It.current=null;return}d.pointerType==="mouse"&&Nn(d.pointerId)}},pe=d=>{!re||d.pointerType!=="mouse"||Nn(d.pointerId)};return il(),l.useEffect(()=>{const d=requestAnimationFrame(()=>Ut(!0));return()=>{cancelAnimationFrame(d),un(),Jn(),ue.current!==null&&(cancelAnimationFrame(ue.current),ue.current=null),We.current&&clearTimeout(We.current),et.current&&clearTimeout(et.current)}},[]),l.useEffect(()=>{if(!he){yt(!0);return}Le();const d=Lt.current;if(!d)return;const f=()=>Le();return d.addEventListener("pointermove",f),d.addEventListener("pointerdown",f),()=>{d.removeEventListener("pointermove",f),d.removeEventListener("pointerdown",f),et.current&&clearTimeout(et.current)}},[he,Le]),l.useEffect(()=>{const d=f=>{f.key==="Escape"&&Qe()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[Qe]),l.useLayoutEffect(()=>{Bt()},[T,t.length,at]),l.useLayoutEffect(()=>{o||nn(h.current,"auto")},[T,o]),l.useLayoutEffect(()=>{nn(0,"auto")},[t.length,at]),l.useEffect(()=>{const d=Ge.current;if(!d||o||!D)return;const f=b=>{if(b.preventDefault(),Math.abs(b.deltaY)<=Math.abs(b.deltaX))return;const q=b.deltaMode===1?Um:b.deltaMode===2?d.clientHeight:1,se=b.deltaY*q*Gm;if(se!==0){if(un(),rt.current||(rt.current=!0,it.current=d.scrollLeft,vt.current=null,Yt(!1)),it.current+=se,!at){const be=d.scrollWidth-d.clientWidth;it.current=Math.max(0,Math.min(be,it.current))}Le(),Ye.current===null&&(Ye.current=requestAnimationFrame(Fn))}};return d.addEventListener("wheel",f,{passive:!1}),()=>{d.removeEventListener("wheel",f),Tn()}},[o,D,at]),l.useEffect(()=>{const d=Ge.current;if(!d)return;const f=()=>{Wt(Ze.current.isActive);const q=d.scrollLeft,se=q-Oe.current;Oe.current=q;const be=ut.current>0?ut.current*.5:1/0;if(se!==0&&Math.abs(se)<be){const _e=se>0?"forward":"backward";_e!==gt.current&&(gt.current=_e,Cn(_e))}Ze.current.isActive&&Ze.current.hasMoved||Xt()};d.addEventListener("scroll",f,{passive:!0});const b=new ResizeObserver(()=>{Bt(),Wt(Ze.current.isActive),Cn(gt.current),Xt()});return b.observe(d),()=>{un(),d.removeEventListener("scroll",f),b.disconnect()}},[t.length,at]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{nt||Qe()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:tn?1:0,transition:`opacity ${Pi}ms ease`,pointerEvents:tn?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:u,...Et}}),r.jsxs("div",{ref:Lt,className:`${e}-lightbox-dismiss-area`,style:ht,...$n,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:St,onClick:d=>d.stopPropagation(),children:r.jsx("div",{ref:Ge,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":re&&t.length>0?"true":"false","data-mouse-dragging":ln?"true":"false",onPointerDown:Qo,onPointerMove:er,onPointerUp:W,onPointerCancel:W,onLostPointerCapture:pe,children:r.jsx("div",{ref:Re,className:`${e}-lightbox-strip-track`,style:{gap:T},children:wn.map((d,f)=>{const b=d.image.objectFit??"contain",q=f%t.length,se=Math.floor(f/t.length),be=uo(T),_e=`calc(-0.5 * (${be} + ${T}))`;return r.jsxs("div",{ref:Ke=>He.current[f]=Ke,className:`${e}-strip-item`,style:{height:B==="mobile"?"75vh":"100%"},children:[r.jsx("img",{src:d.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:b}}),o&&q<t.length-1&&se===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:_e,width:be,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${se}-${d.image.url}-${q}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":$t?"true":"false",style:_t,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:K,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:Y,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${J?` ${e}-lightbox-content-area-stacked`:""}`,children:(Ie||x)&&r.jsx("div",{className:`${e}-header ${J?`${e}-header-two-row`:`${e}-header-single-row`}`,children:J?pt():Ie||x?Rt():null})})})]}),t.length>1&&$==="on"&&(()=>{const d=uo(N),f=`calc(-0.5 * (${N} + ${d}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:N},children:r.jsx("div",{ref:Be,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:b=>b.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":C,style:{gap:_,"--thumbnail-active-color":k},children:[t.map((b,q)=>{const se=uo(_),be=`calc(-0.5 * (${se} + ${_}))`;return r.jsxs("div",{ref:_e=>{Ue.current[q]=_e},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":O===q?"true":"false",onClick:()=>D&&w==="click"&&nn(q),onMouseEnter:()=>Ce&&w==="hover"&&nn(q),"aria-label":b.image.name?`View ${b.image.name}`:`View image ${q+1}`,"aria-current":O===q?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${we?` ${e}-thumb-image-cover`:""}`,src:b.image.url,alt:"",draggable:!1,style:{...xe,maxWidth:j,maxHeight:j,width:S.display==="cover"?"auto":"100%",height:"auto",objectFit:S.display==="cover"?"cover":"contain"}})}),o&&q<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:be,width:se,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${b.image.url}-${q}`)}),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:f,height:d,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function cg(e){return`
|
|
10150
|
+
`;function En(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Ya={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Im=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Rm={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:En("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:{...Ya.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:{...Ya.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:En("Question Padding Left"),questionPaddingTop:En("Question Padding Top"),questionPaddingBottom:En("Question Padding Bottom"),answerPaddingLeft:En("Answer Padding Left"),answerPaddingRight:En("Answer Padding Right"),answerPaddingTop:En("Answer Padding Top"),answerPaddingBottom:En("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/component-assets/PlusIcon.svg",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[...Im],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Am={element:Em,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:Rm,sourceCode:Pm},vn=e=>e.display==="cover",Ko=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Ja=100,km=.2,Za=8,Zs=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=l.useState(0),[a,u]=l.useState(!1),c=l.useRef(null),m=l.useRef(0);m.current=o;const p=l.useMemo(()=>typeof window>"u"?Ja:Math.max(Ja,window.innerHeight*km),[]),E=l.useCallback(y=>Math.max(0,1-y/(p*1.5)),[p]),x=l.useCallback(y=>Math.max(0,1-y/(p*.45)),[p]),C=l.useCallback(y=>{const M=typeof window<"u"?window.innerHeight:800,W=Math.max(.88,1-y/M*.12);return`translateY(${y}px) scale(${W})`},[]),g=l.useCallback(()=>{c.current=null},[]),v=l.useCallback(()=>{u(!0),s(0),window.setTimeout(()=>u(!1),n),g()},[n,g]),T=l.useCallback(()=>{const y=typeof window<"u"?window.innerHeight:800;u(!0),s(y),window.setTimeout(()=>{t(),g(),u(!1)},Math.min(n,200))},[n,t,g]),w=l.useCallback(y=>{!e||a||y.pointerType==="touch"&&(i!=null&&i(y.target)||(c.current={startX:y.clientX,startY:y.clientY,isLocked:null,pointerId:y.pointerId}))},[e,a,i]),$=l.useCallback(y=>{const M=c.current;if(!e||!M||y.pointerType!=="touch"||M.pointerId!==y.pointerId)return;const W=y.clientX-M.startX,D=y.clientY-M.startY;if(M.isLocked===null){if(Math.abs(W)<Za&&Math.abs(D)<Za)return;if(D>0&&D>Math.abs(W))M.isLocked=!0,y.currentTarget.setPointerCapture(y.pointerId);else{M.isLocked=!1,g();return}}if(!M.isLocked)return;y.preventDefault();const te=Math.max(0,D);m.current=te,s(te)},[e,g]),S=l.useCallback(y=>{const M=c.current;if(!e||!M||y.pointerType!=="touch"||M.pointerId!==y.pointerId)return;const W=M.isLocked===!0;if(y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),!W){g();return}y.clientY-M.startY>=p?T():v()},[p,T,e,g,v]),_=l.useCallback(y=>{S(y)},[S]),I=l.useCallback(y=>{S(y)},[S]),F=o>0,P=a?`transform ${n}ms ease`:"none",R=a?`opacity ${n}ms ease`:"none",Y=o>0||a;return{isSwipeDragging:F,backdropStyle:{opacity:E(o),transition:R},mediaAreaStyle:{transform:C(o),transition:P,touchAction:F?"none":void 0,willChange:F?"transform":void 0},overlayContentStyle:Y?{opacity:x(o),transition:R}:void 0,swipeHandlers:e?{onPointerDown:w,onPointerMove:$,onPointerUp:_,onPointerCancel:I}:{},dismissAreaStyle:e?{touchAction:F?"none":"pan-x"}:void 0}},Mm="[data-lightbox-scrollable]",Qs=()=>{l.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 a=u=>{const c=u.target;c instanceof Element&&c.closest(Mm)||u.preventDefault()};return document.addEventListener("touchmove",a,{passive:!1}),()=>{document.removeEventListener("touchmove",a),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(0,e)}},[])},_m=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Fm=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Wm=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Nm=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const a=e.scrollLeft,u=n-a,c=a-n,m=(g,v)=>{Fm(t),e.scrollLeft=g,v&&(s==null||s())};if(Math.abs(u)<.5)return m(n,!0),()=>{};let p=!1,E=0;const x=()=>{t.removeEventListener("transitionend",C),clearTimeout(E)},C=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,x(),m(n,!0))};return t.addEventListener("transitionend",C),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)`,E=window.setTimeout(()=>{p||(p=!0,x(),m(n,!0))},i+64),()=>{p||(p=!0,x(),m(a-Wm(t),!1))}},Pi=300,Hm=900,Om=1500,Bm="cubic-bezier(0.16, 1, 0.3, 1)",jm=3e3,zm=2,Vm=16,Dm=.05,qm=1,co=.3,Km=50,Gm=20,ei=.004,hi=["title1","title2","title3"],Um={title1:"1",title2:"2",title3:"3"},Xm={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Ym={title1:.02,title2:.02,title3:.02},uo=e=>`max(${e}, ${Gm}px)`,Jm=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]}},Zm=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=Jm(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},lt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Qm=e=>[lt(e,"fontFamily"),lt(e,"fontSettings"),{type:"row",items:[lt(e,"fontSize"),lt(e,"lineHeight"),lt(e,"letterSpacing"),lt(e,"wordSpacing")]},lt(e,"textAlign"),lt(e,"textAppearance")],eg=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(hi.map(e=>[Um[e],Qm(e)]))}),ta=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,a)=>s+a,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:a},u)=>{if(s<=0||u<=0)return{overflow:s,widths:[u,...a]};const c=Math.min(s,u);return{overflow:s-c,widths:[u-c,...a]}},{overflow:i-1,widths:[]});return o},el=(e,t)=>ta(e,t),po=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Qa=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:ta(e.length,n),effective:el(e.length,n)}},tg=(e,t,n,i,o,s,a)=>{const u=[];return t&&u.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&u.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:s,text:n}),i&&u.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:a,text:i}),u},mr=(e,t)=>{const n=i=>{const o=lt(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[Xm[t]]}},ng=(e,t,n,i)=>e.slice(0,i).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),gr=(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??Ym[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return kt(i,n)},ig=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:a})=>{const{backgroundColor:u,thumbnailSize:c,thumbnailGap:m,thumbnailMarginBottom:p,imageGap:E,closeIcon:x,closeIconMaxWidth:C,closeIconColor:g,closeIconHoverColor:v,thumbnailTrigger:T,thumbnailVisibility:w,thumbnailObjectFit:$,thumbnailActive:S,thumbnailActiveColor:_,title1Width:I,title2Width:F,title3Width:P,title1MarginLeft:R=0,title2MarginLeft:Y=0,title3MarginLeft:y=0,titleRowMarginBottom:M=0,titleHeaderLayout:W="desktop",contentMarginTop:D,iconMarginLeft:te}=n,pe=d=>L.scalingValue(d,i??!1),K=c??n.thumnailSize??.03,H=pe(K),Z=pe(m),U=pe(p??.02),B=pe(E??0),J=pe(D??0),ie=uo(J),oe=pe(te??0),[O,de]=l.useState(0),f=l.useRef(O);f.current=O;const me=t[O],{title1:ye,title2:ve,title3:Ae}=Zm(me),ee=gr("title1",mr(n,"title1"),i),ge=gr("title2",mr(n,"title2"),i),X=gr("title3",mr(n,"title3"),i),G=W==="mobile",j=!o&&(!i||s),he=j,ne=j,Ce=j,we=vn($),xe=we?{"--image-aspect-ratio":Ko($)}:void 0,Ie=!!(ye||ve||Ae),N=l.useMemo(()=>tg(e,ye,ve,Ae,ee,ge,X),[e,O,ye,ve,Ae,ee,ge,X]),Q=l.useMemo(()=>({title1Width:I,title2Width:F,title3Width:P}),[I,F,P]),A=l.useMemo(()=>N.map(d=>Q[d.widthKey]),[N,Q]),q=l.useMemo(()=>ta(N.length,A),[N.length,A]),V=l.useMemo(()=>el(N.length,A),[N.length,A]),ae=l.useMemo(()=>N.filter(d=>d.prefix==="title1"),[N]),ue=l.useMemo(()=>N.filter(d=>d.prefix==="title2"||d.prefix==="title3"),[N]),Te=l.useMemo(()=>Qa(ae,Q),[ae,Q]),Fe=l.useMemo(()=>Qa(ue,Q),[ue,Q]),Pe=l.useCallback((d,h)=>{const b=N.indexOf(d);if(!G||h==="single-row")return{effectiveWidth:V[b]??0,resolvedWidth:q[b]??0,maxWidth:po(b,q)};if(h==="two-row-top"){const re=ae.indexOf(d);return{effectiveWidth:Te.effective[re]??0,resolvedWidth:Te.resolved[re]??0,maxWidth:po(re,Te.resolved)}}const z=ue.indexOf(d);return{effectiveWidth:Fe.effective[z]??0,resolvedWidth:Fe.resolved[z]??0,maxWidth:po(z,Fe.resolved)}},[ue,Fe,V,q,N,ae,Te,G]),$e=l.useCallback(d=>L.scalingValue(d,i??!1),[i]),tt=$e(M??0),se=l.useMemo(()=>({title1MarginLeft:R,title2MarginLeft:Y,title3MarginLeft:y}),[R,Y,y]),ke=l.useCallback(d=>N.slice(0,d+1).reduce((h,b,z)=>h+(b!=null&&b.marginLeftKey?se[b.marginLeftKey]??0:0)+(q[z]??0),0)+(G?0:R??0),[N,se,q,G,R]),ze=l.useCallback(()=>G?0:R??0,[G,R]),Ve=l.useCallback(d=>ue.slice(0,d).reduce((h,b,z)=>h+(b.marginLeftKey?se[b.marginLeftKey]??0:0)+(Fe.resolved[z]??0),0),[ue,Fe.resolved,se]),dt=l.useCallback(d=>{const h=ue[d];return Ve(d)+(h.marginLeftKey?se[h.marginLeftKey]??0:0)+(Fe.resolved[d]??0)},[ue,Fe.resolved,Ve,se]),ft=(d,h)=>{const b=d.marginLeftKey?se[d.marginLeftKey]??0:0,{effectiveWidth:z,resolvedWidth:re,maxWidth:be}=Pe(d,h),_e=o&&h==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":d.prefix,style:{...h==="single-row"?{gridArea:d.prefix}:{},width:$e(z),...b>0?{marginLeft:$e(b)}:{}},children:[r.jsx("p",{className:d.className,style:d.style,children:d.text}),_e&&d.marginLeftKey&&r.jsx("div",{"data-controls":d.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(re),style:{position:"absolute",top:0,left:$e(-b),width:`max(${$e(b)}, 10px)`,height:"100%",pointerEvents:"auto"}}),_e&&r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(be),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:$e(-ei/2),width:$e(ei),height:"100%",pointerEvents:"auto"}})]},d.className)},Pt=()=>{const d=G?-1:N.findIndex(z=>z.prefix==="title1"),h=!G&&(o||(R??0)>0)?(()=>{const z=R??0,re=d>=0?q[d]:I??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(re),style:{position:"absolute",top:0,left:0,width:`max(${$e(z)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,b=N.flatMap((z,re)=>{if(!z.marginLeftKey)return[];const be=se[z.marginLeftKey]??0,_e=ng(N,q,se,re)+ze();return r.jsx("div",{"data-controls":z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(q[re]),style:{position:"absolute",top:0,left:$e(_e),width:`max(${$e(be)}, 10px)`,height:"100%",pointerEvents:"auto"}},z.marginLeftKey)});return h?[h,...b]:b},xt=()=>N.map((d,h)=>{const b=po(h,q),re=ke(h)-ei/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(b),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:$e(re),width:$e(ei),height:"100%",pointerEvents:"auto"}})},`${d.widthKey}-junction`)}),wt=()=>ue.flatMap((d,h)=>{if(!d.marginLeftKey)return[];const b=se[d.marginLeftKey]??0,z=Ve(h),{resolvedWidth:re}=Pe(d,"two-row-bottom");return r.jsx("div",{"data-controls":d.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(re),style:{position:"absolute",top:0,left:$e(z),width:`max(${$e(b)}, 10px)`,height:"100%",pointerEvents:"auto"}},d.marginLeftKey)}),Ht=()=>ue.map((d,h)=>{const{maxWidth:b}=Pe(d,"two-row-bottom"),re=dt(h)-ei/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":d.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(b),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:$e(re),width:$e(ei),height:"100%",pointerEvents:"auto"}})},`${d.widthKey}-junction`)}),Lt=l.useRef(null),Ge=l.useRef(null),Re=l.useRef(null),Be=l.useRef(null),Ue=l.useRef([]),He=l.useRef([]),ut=l.useRef(0),It=l.useRef(null),Ze=l.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Mt=l.useRef(null),Ot=l.useRef(null),Oe=l.useRef(0),gt=l.useRef("forward"),it=l.useRef(0),Ye=l.useRef(null),rt=l.useRef(!1),at=t.length>1&&(!o||!!s),sn=at?3:1,wn=l.useMemo(()=>Array.from({length:sn},()=>t).flat(),[t,sn]),[ln,ot]=l.useState(!1),[tn,Ut]=l.useState(!1),[De,yt]=l.useState(!0),vt=l.useRef(null),le=l.useRef(null),Se=l.useRef(!1),Me=l.useRef(!1),We=l.useRef(null),et=l.useRef(null),$t=he&&!De,Le=l.useCallback(()=>{he&&(yt(!0),et.current&&clearTimeout(et.current),et.current=setTimeout(()=>{Ze.current.isActive||yt(!1)},jm))},[he]),Qe=l.useCallback(()=>{o||Me.current||(Me.current=!0,Ut(!1),We.current=setTimeout(()=>{a()},Pi))},[o,a]),je=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":$t?"true":"false",style:{width:L.scalingValue(C??0,i),height:L.scalingValue(C??0,i),marginRight:oe,"--close-icon-hover-color":v},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Qe,"aria-label":"Close",children:r.jsx(Qt,{url:x,fill:g,hoverFill:i&&!s?g:v,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:oe,height:"100%",pointerEvents:"auto"}})]}),st=(d="two-row")=>r.jsx("div",{...d==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:$e(R??0),flexShrink:0,...d==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...d==="two-row"&&o?{pointerEvents:"auto"}:{}}}),pt=()=>{const d=N.find(z=>z.prefix==="title1"),h=N.filter(z=>z.prefix==="title2"||z.prefix==="title3"),b=h.length>0||o||(M??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(R??0)>0||o?st():null,d&&ft(d,"two-row-top"),x&&je()]}),b?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[h.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[h.map(z=>ft(z,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[wt(),Ht()]})]}):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:tt,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},Rt=()=>r.jsxs(r.Fragment,{children:[(R??0)>0||o?st("single-row"):null,N.map(d=>ft(d,"single-row")),o?r.jsxs(r.Fragment,{children:[Pt(),xt()]}):null,x?je():null]}),qe=l.useCallback(d=>!!(d.closest("[data-controls]")||d.closest(`.${e}-thumbnails`)||d.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:nt,backdropStyle:Et,mediaAreaStyle:St,overlayContentStyle:_t,swipeHandlers:$n,dismissAreaStyle:ht}=Zs({enabled:j??!1,onClose:Qe,animMs:Pi,isBlockedTarget:qe}),Bt=()=>{if(!at||t.length===0)return ut.current=0,0;const d=He.current[0],h=He.current[t.length];if(!d||!h)return ut.current;const b=h.offsetLeft-d.offsetLeft;return b>0&&(ut.current=b),ut.current},Wt=(d=!1)=>{if(!at)return;const h=Ge.current,b=Bt();!h||b<=0||b<h.clientWidth*.25||(h.scrollLeft<=0?(h.scrollLeft+=b,d&&(Ze.current.scrollLeft+=b),rt.current&&(it.current+=b)):h.scrollLeft>=b*2&&(h.scrollLeft-=b,d&&(Ze.current.scrollLeft-=b),rt.current&&(it.current-=b)))},cn=(d,h=(b=>(b=Ge.current)==null?void 0:b.scrollLeft)()??0)=>{if(!at)return d;let z=t.length+d,re=1/0;for(let be=0;be<sn;be++){const _e=be*t.length+d,Ke=He.current[_e];if(!Ke)continue;const At=Math.abs(Ke.offsetLeft-h);At<re&&(re=At,z=_e)}return z},Sn=d=>{const h=Ge.current;return!d||!h?!1:d.offsetWidth>h.clientWidth+1},dn=d=>{const h=Ge.current;if(!d||!h||!Sn(d))return!1;const b=d.offsetLeft,z=b+d.offsetWidth;return h.scrollLeft>=b-1&&h.scrollLeft+h.clientWidth<=z+1},zt=(d=(h=>(h=Ge.current)==null?void 0:h.scrollLeft)()??0)=>{for(let z=0;z<He.current.length;z+=1){const re=He.current[z];if(re&&dn(re))return z}let b={flatIndex:0,distance:1/0};return He.current.forEach((z,re)=>{if(!z)return;const be=Math.abs(z.offsetLeft-d);be<b.distance&&(b={flatIndex:re,distance:be})}),b.flatIndex},Cn=d=>{Ge.current&&He.current.forEach(h=>{h&&(h.style.scrollSnapAlign=Sn(h)&&d==="backward"?"end":"start")})},Xn=(d,h,b)=>{const z=d-h,re=zt(h),be=He.current[re];if(dn(be))return zt(d)%t.length;const _e=He.current[re+1],Ke=be?_e?_e.offsetLeft-be.offsetLeft:be.offsetWidth:0,At=Ke>0?z>Ke*co?1:z<-Ke*co?-1:0:0;return At===0?b:at?(b+At+t.length)%t.length:Math.max(0,Math.min(t.length-1,b+At))},Yn=l.useCallback((d=!1)=>{if(w!=="on"||o)return;const h=Be.current,b=f.current,z=Ue.current[b];if(!h||!z||h.scrollWidth<=h.clientWidth)return;const re=h.scrollLeft,be=re+h.clientWidth,_e=z.offsetLeft,Ke=_e+z.offsetWidth;if(_e>=re&&Ke<=be)return;const At=h.scrollWidth-h.clientWidth;let Ct=re;if(!d&&vt.current===null){const Zn=Ue.current[b-1],Si=Ue.current[b+1],eo=Zn?z.offsetLeft-Zn.offsetLeft:Si?Si.offsetLeft-z.offsetLeft:z.offsetWidth;Ke>be?Ct+=eo:_e<re&&(Ct-=eo)}else Ke>be?Ct=Ke-h.clientWidth:Ct=_e;h.scrollLeft=Math.max(0,Math.min(At,Ct))},[o,w]),$i=l.useCallback((d=!1)=>{d&&(Se.current=!0),le.current===null&&(le.current=requestAnimationFrame(()=>{le.current=null;const h=Se.current;Se.current=!1,Yn(h)}))},[Yn]),Xo=l.useCallback(d=>{if(d===f.current)return;const h=f.current;f.current=d;const b=Math.abs(d-h)>1,z=at&&t.length>1&&(h===t.length-1&&d===0||h===0&&d===t.length-1);de(d),$i(b||z)},[t.length,at,$i]),Xt=()=>{if(!Ge.current||t.length===0||vt.current!==null||Ze.current.isActive&&Ze.current.hasMoved)return;const d=Ge.current.scrollLeft,h=zt(d)%t.length;h!==f.current&&Xo(h)},Xi=()=>{vt.current=null},Yt=d=>{const h=Ge.current;h&&(h.style.scrollSnapType=d?"":"none")},un=()=>{var d;(d=Ot.current)==null||d.call(Ot),Ot.current=null},Tn=()=>{Ye.current!==null&&(cancelAnimationFrame(Ye.current),Ye.current=null),rt.current=!1},Fn=()=>{const d=Ge.current;if(!d){Ye.current=null,rt.current=!1;return}const h=it.current-d.scrollLeft;if(Math.abs(h)<.5){d.scrollLeft=it.current,Wt(),Xt(),Ye.current=null,rt.current=!1;return}d.scrollLeft+=h*Dm,Wt(),Xt(),Le(),Ye.current=requestAnimationFrame(Fn)},Wn=()=>{const d=Re.current;d&&(d.style.transition="",d.style.transform="",d.style.willChange="")},Yi=(d,h,b,z)=>{Wn(),d.scrollLeft=h,Oe.current=d.scrollLeft,Wt(),b!==void 0?(f.current=b,de(b)):Xt(),Yt(!0),z==null||z()},Ji=(d,{behavior:h="smooth",activeIndex:b,onComplete:z}={})=>{const re=Ge.current,be=Re.current;if(!re||!be)return;if(Tn(),un(),Yt(!1),h==="auto"){Yi(re,d,b,z);return}const _e=Math.abs(d-re.scrollLeft),Ke=_m(_e,Hm,Om,re.clientWidth*.55);Ot.current=Nm(re,be,d,{duration:Ke,easing:Bm,onComplete:()=>{Ot.current=null,Yi(re,d,b,z)}})},Yo=(d="smooth")=>{const h=Ge.current;if(!h||t.length===0)return;const b=zt()%t.length,z=cn(b,h.scrollLeft),re=He.current[z];re&&Ji(re.offsetLeft,{behavior:d,activeIndex:b})},Jo=(d,h="smooth",b,z)=>{const re=Ge.current;if(!re||t.length===0)return;const be=(z??re.scrollLeft)-d,_e=zt(d),Ke=He.current[_e];if(dn(Ke)){Yt(!0),Xt();return}const At=He.current[_e+1],Ct=Ke?At?At.offsetLeft-Ke.offsetLeft:Ke.offsetWidth:0;if((Ct>0?be>Ct*co?1:be<-Ct*co?-1:0:0)!==0){const ol=b??_e%t.length,rl=Xn(z??re.scrollLeft,d,ol);nn(rl,h);return}const Si=z??re.scrollLeft,eo=zt(Si),oa=He.current[eo];if(oa&&Math.abs(oa.offsetLeft-Si)<1){Yt(!0),Xt();return}Yo("auto")},nn=(d,h="smooth")=>{const b=Ge.current;if(!b||t.length===0)return;const z=cn(d,b.scrollLeft),re=He.current[z];re&&(h==="smooth"?vt.current=d:vt.current=null,f.current=d,de(d),$i(!0),Ji(re.offsetLeft,{behavior:h,activeIndex:d,onComplete:h==="smooth"?Xi:void 0}))},Jn=()=>{Mt.current&&(window.removeEventListener("pointerup",Mt.current),window.removeEventListener("pointercancel",Mt.current),Mt.current=null)},Zi=(d,h,b,z,re)=>{const be=b-d,_e=z-h,Ke=Math.abs(be),At=Math.abs(_e);if(Ke<Km||Ke<=At)return!1;const Ct=be<0?1:-1,Zn=at?(re+Ct+t.length)%t.length:Math.max(0,Math.min(t.length-1,re+Ct));return Zn===re?!1:(nn(Zn),!0)},Nn=d=>{if(!Ze.current.isActive)return;Jn();const h=Ge.current;if(!h)return;const{scrollLeft:b,startActiveIndex:z,hasMoved:re}=Ze.current,be=h.scrollLeft;Wt(!0),Ze.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ot(!1),d!==void 0&&h.hasPointerCapture(d)&&h.releasePointerCapture(d),re?Jo(b,"smooth",z,be):(Yt(!0),Xt()),Le()},Qi=(d,h)=>{const b=It.current;It.current=null,b&&(Zi(b.startX,b.startY,d,h,b.startActiveIndex),Le())},Zo=d=>{if(!ne)return;if(d.pointerType==="touch"){if(Tn(),Yt(!0),qe(d.target))return;It.current={startX:d.clientX,startY:d.clientY,startActiveIndex:f.current};return}if(d.pointerType!=="mouse"||d.button!==0||qe(d.target))return;const h=Ge.current;if(!h)return;Tn(),un(),Wn(),vt.current=null,Ze.current={isActive:!0,startX:d.clientX,scrollLeft:h.scrollLeft,startActiveIndex:f.current,hasMoved:!1},Yt(!1),Le(),h.setPointerCapture(d.pointerId),Jn();const b=z=>{z.pointerType==="mouse"&&Nn(z.pointerId)};Mt.current=b,window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b)},Qo=d=>{if(!ne||d.pointerType!=="mouse")return;const h=Ge.current;if(!h||!Ze.current.isActive)return;if(d.buttons===0){Nn(d.pointerId);return}const b=d.clientX-Ze.current.startX;Math.abs(b)>qm&&(Ze.current.hasMoved=!0,ot(!0)),Ze.current.hasMoved&&(d.preventDefault(),h.scrollLeft=Ze.current.scrollLeft-b,Wt(!0),Xt(),Le())},k=d=>{if(ne){if(d.pointerType==="touch"){d.type==="pointerup"?Qi(d.clientX,d.clientY):It.current=null;return}d.pointerType==="mouse"&&Nn(d.pointerId)}},ce=d=>{!ne||d.pointerType!=="mouse"||Nn(d.pointerId)};return Qs(),l.useEffect(()=>{const d=requestAnimationFrame(()=>Ut(!0));return()=>{cancelAnimationFrame(d),un(),Jn(),le.current!==null&&(cancelAnimationFrame(le.current),le.current=null),We.current&&clearTimeout(We.current),et.current&&clearTimeout(et.current)}},[]),l.useEffect(()=>{if(!he){yt(!0);return}Le();const d=Lt.current;if(!d)return;const h=()=>Le();return d.addEventListener("pointermove",h),d.addEventListener("pointerdown",h),()=>{d.removeEventListener("pointermove",h),d.removeEventListener("pointerdown",h),et.current&&clearTimeout(et.current)}},[he,Le]),l.useEffect(()=>{const d=h=>{h.key==="Escape"&&Qe()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[Qe]),l.useLayoutEffect(()=>{Bt()},[B,t.length,at]),l.useLayoutEffect(()=>{o||nn(f.current,"auto")},[B,o]),l.useLayoutEffect(()=>{nn(0,"auto")},[t.length,at]),l.useEffect(()=>{const d=Ge.current;if(!d||o||!j)return;const h=b=>{if(b.preventDefault(),Math.abs(b.deltaY)<=Math.abs(b.deltaX))return;const z=b.deltaMode===1?Vm:b.deltaMode===2?d.clientHeight:1,re=b.deltaY*z*zm;if(re!==0){if(un(),rt.current||(rt.current=!0,it.current=d.scrollLeft,vt.current=null,Yt(!1)),it.current+=re,!at){const be=d.scrollWidth-d.clientWidth;it.current=Math.max(0,Math.min(be,it.current))}Le(),Ye.current===null&&(Ye.current=requestAnimationFrame(Fn))}};return d.addEventListener("wheel",h,{passive:!1}),()=>{d.removeEventListener("wheel",h),Tn()}},[o,j,at]),l.useEffect(()=>{const d=Ge.current;if(!d)return;const h=()=>{Wt(Ze.current.isActive);const z=d.scrollLeft,re=z-Oe.current;Oe.current=z;const be=ut.current>0?ut.current*.5:1/0;if(re!==0&&Math.abs(re)<be){const _e=re>0?"forward":"backward";_e!==gt.current&&(gt.current=_e,Cn(_e))}Ze.current.isActive&&Ze.current.hasMoved||Xt()};d.addEventListener("scroll",h,{passive:!0});const b=new ResizeObserver(()=>{Bt(),Wt(Ze.current.isActive),Cn(gt.current),Xt()});return b.observe(d),()=>{un(),d.removeEventListener("scroll",h),b.disconnect()}},[t.length,at]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{nt||Qe()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:tn?1:0,transition:`opacity ${Pi}ms ease`,pointerEvents:tn?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:u,...Et}}),r.jsxs("div",{ref:Lt,className:`${e}-lightbox-dismiss-area`,style:ht,...$n,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:St,onClick:d=>d.stopPropagation(),children:r.jsx("div",{ref:Ge,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":ne&&t.length>0?"true":"false","data-mouse-dragging":ln?"true":"false",onPointerDown:Zo,onPointerMove:Qo,onPointerUp:k,onPointerCancel:k,onLostPointerCapture:ce,children:r.jsx("div",{ref:Re,className:`${e}-lightbox-strip-track`,style:{gap:B},children:wn.map((d,h)=>{const b=d.image.objectFit??"contain",z=h%t.length,re=Math.floor(h/t.length),be=uo(B),_e=`calc(-0.5 * (${be} + ${B}))`;return r.jsxs("div",{ref:Ke=>He.current[h]=Ke,className:`${e}-strip-item`,style:{height:W==="mobile"?"75vh":"100%"},children:[r.jsx("img",{src:d.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:b}}),o&&z<t.length-1&&re===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:_e,width:be,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${re}-${d.image.url}-${z}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":$t?"true":"false",style:_t,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:J,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:ie,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${G?` ${e}-lightbox-content-area-stacked`:""}`,children:(Ie||x)&&r.jsx("div",{className:`${e}-header ${G?`${e}-header-two-row`:`${e}-header-single-row`}`,children:G?pt():Ie||x?Rt():null})})})]}),t.length>1&&w==="on"&&(()=>{const d=uo(U),h=`calc(-0.5 * (${U} + ${d}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:U},children:r.jsx("div",{ref:Be,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:b=>b.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:Z,"--thumbnail-active-color":_},children:[t.map((b,z)=>{const re=uo(Z),be=`calc(-0.5 * (${re} + ${Z}))`;return r.jsxs("div",{ref:_e=>{Ue.current[z]=_e},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":O===z?"true":"false",onClick:()=>j&&T==="click"&&nn(z),onMouseEnter:()=>Ce&&T==="hover"&&nn(z),"aria-label":b.image.name?`View ${b.image.name}`:`View image ${z+1}`,"aria-current":O===z?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${we?` ${e}-thumb-image-cover`:""}`,src:b.image.url,alt:"",draggable:!1,style:{...xe,maxWidth:H,maxHeight:H,width:$.display==="cover"?"auto":"100%",height:"auto",objectFit:$.display==="cover"?"cover":"contain"}})}),o&&z<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:be,width:re,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${b.image.url}-${z}`)}),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:h,height:d,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function og(e){return`
|
|
10151
10151
|
.${e}-wrapper {
|
|
10152
10152
|
position: relative;
|
|
10153
10153
|
width: 100%;
|
|
@@ -10539,7 +10539,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
10539
10539
|
pointer-events: auto;
|
|
10540
10540
|
z-index: 10;
|
|
10541
10541
|
}
|
|
10542
|
-
`}const
|
|
10542
|
+
`}const rg=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s})=>{const{prefix:a}=L.useScopedStyles(),{cover:u,coverFit:c}=e,m=l.useRef(null),[p,E]=l.useState(!1),x=t??[],C=p&&x.length>0,g=()=>{x.length!==0&&E(!0)};return l.useEffect(()=>{!n||i||o||E(!1)},[n,i,o]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:m,className:`${a}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:og(a)}}),u&&r.jsx("div",{className:`${a}-cover ${vn(c)?`${a}-ratio-wrapper-cover`:`${a}-ratio-wrapper-fit`}`,onClick:()=>g(),style:{...vn(c)?{"--image-aspect-ratio":Ko(c)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${a}-cover-image ${vn(c)?`${a}-cover-image-cover`:`${a}-cover-image-fit`}`,src:u,alt:"cover"})})]}),C&&typeof document<"u"&&(()=>{const v=(s?document.getElementById(s):null)??document.body;return Bi.createPortal(r.jsx(ig,{prefix:a,images:x,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>E(!1)}),v)})()]})},ag=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
10543
10543
|
import { createPortal } from 'react-dom';
|
|
10544
10544
|
import { CommonComponentProps } from '../props';
|
|
10545
10545
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -11093,7 +11093,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
11093
11093
|
</>
|
|
11094
11094
|
);
|
|
11095
11095
|
};
|
|
11096
|
-
`,pg="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>'),zn={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 mg(e){const t={};return t[lt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[lt(e,"fontSettings")]={...zn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[lt(e,"fontSize")]={...zn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[lt(e,"lineHeight")]={...zn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[lt(e,"letterSpacing")]={...zn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[lt(e,"wordSpacing")]={...zn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[lt(e,"textAlign")]={...zn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[lt(e,"textAppearance")]={...zn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const gg=hi.reduce((e,t)=>({...e,...mg(t)}),{}),hg=hi.reduce((e,t)=>({...e,[lt(t,"fontFamily")]:"Goudy Bookletter 1911",[lt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[lt(t,"letterSpacing")]:0,[lt(t,"wordSpacing")]:0,[lt(t,"textAlign")]:"left",[lt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ns(e){return hi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[lt(n,"fontSize")]=i),o!==void 0&&(t[lt(n,"lineHeight")]=o),t},{})}const fg=rg(),yg={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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",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"]}},thumbnailActiveColor:{type:"string",scope:"common",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:"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"}},...gg,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/lightbox_strip_1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:pg,closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",...hg},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,backgroundColor:"#FFFFFF",contentMarginTop:.08,iconMarginLeft:.02,...ns({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,backgroundColor:"#FFFFFF",contentMarginTop:.015,iconMarginLeft:.02,...ns({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:[fg]}],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/lightbox_strip_2.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_3.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_4.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_5.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_6.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_7.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"}]}},vg={element:dg,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350,height:350},m:{width:300,height:350}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:yg,sourceCode:ug,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...hi.map(e=>({path:`settings.${lt(e,"fontFamily")}`}))]},fontRelations:{...hi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${lt(t,"fontFamily")}`}),{})}},bg=50,is=10,oa="cntrl-lightbox-journal",Uo=oa,Pr=`${oa}-`,Xo=e=>`${oa}-${e}`,ra=e=>e===Uo||e.startsWith(Pr),os=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},rs=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=os(t.get(Xo(e)));if(i)return i}const n=os(t.get(Uo));if(n)return n;for(const[i]of t){if(!i.startsWith(Pr))continue;const o=i.slice(Pr.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},as=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},rl=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(a=>{ra(a)&&i.searchParams.delete(a)}),t?i.searchParams.set(Xo(t),String(e)):i.searchParams.set(Uo,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},xg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Xo(e)||i===Uo:ra(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)}},al=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Xo(e)):[...t.keys()].some(n=>ra(n))},wg=(e,t)=>{if(al(t)){if(e){window.history.back();return}xg(t)}},$g=20,Sg=2,fr=e=>`max(${e}, ${$g}px)`,fi=e=>((e==null?void 0:e.image)??[]).slice(0,Sg),sl=e=>e.reduce((t,n)=>t+fi(n).length,0),Cg=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+fi(s).length,1),i=fi(e[t]).length;return{start:n,end:n+i-1}},Tg=(e,t)=>{const n=sl(e),{start:i,end:o}=Cg(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},To=(e,t)=>t==="B"?e.flatMap((n,i)=>fi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:fi(n)})),Lg=(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 Tg(i,o)},ss=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Eg=(e,t,n)=>e==="B"?t.length>1:sl(n)>1,ti=.004,mo=.004,yr={title1Width:.13,title2Width:.13,title3Width:.14},go=(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},ko=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,a)=>s+a,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:a},u)=>{if(s<=0||u<=0)return{overflow:s,widths:[u,...a]};const c=Math.min(s,u);return{overflow:s-c,widths:[u-c,...a]}},{overflow:i-1,widths:[]});return o},Ir=(e,t)=>ko(e,t),Vn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ho=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:ko(e.length,n),effective:Ir(e.length,n)}},Pg=(e,t,n,i)=>e.slice(0,i).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),Ig=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),yi=["title1","title2","title3","count"],ct=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Rg={title1:"1",title2:"2",title3:"3",count:"Count"},Mg=e=>[ct(e,"fontFamily"),ct(e,"fontSettings"),{type:"row",items:[ct(e,"fontSize"),ct(e,"lineHeight"),ct(e,"letterSpacing"),ct(e,"wordSpacing")]},ct(e,"textAlign"),ct(e,"textAppearance")],kg=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(yi.map(e=>[Rg[e],Mg(e)]))}),Ag={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},_g={title1:.02,title2:.02,title3:.02,count:.017},fo=(e,t)=>{const n=i=>{const o=ct(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[Ag[t]]}},yo=(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??_g[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return kt(i,n)},Fg=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:a=0,enableUrlSync:u=!1,journalItemId:c=null,onBeforeClose:m,onClose:p})=>{const{type:R,coverFit:x,backgroundColor:L,imageGap:g,maxWidth:y,maxHeight:w,textTransition:$,title1Width:S,title2Width:C,title3Width:k,title1MarginLeft:P=0,title2MarginLeft:H=0,title3MarginLeft:I=0,titleRowMarginBottom:E=0,titleHeaderLayout:Z="single-row",countCloseGap:v=0,closeIcon:A,closeIconMaxWidth:B,closeIconColor:V,closeIconHoverColor:ne,contentMarginTop:ce=0,iconMarginRight:X=0}=n,j=l.useCallback(W=>M.scalingValue(W,i??!1),[i]),_=j(g??0),N=`${y}%`,T=`${w}%`,K=j(v),Y=j(ce),Q=j(X),O=yo("title1",fo(n,"title1"),i),oe=yo("title2",fo(n,"title2"),i),h=yo("title3",fo(n,"title3"),i),ae=yo("count",fo(n,"count"),i),ye=Z==="mobile",ve=!i||!!s,Me=!o&&(!i||!!s),ie=l.useMemo(()=>To(t,R),[t,R]),[ge,ee]=l.useState(a),J=ie[ge],D=J==null?void 0:J.entry,[he,re]=l.useState(!1),[Ce,we]=l.useState(null),[xe,Ie]=l.useState(!1),[z,te]=l.useState(null),[F,U]=l.useState(!1),[G,le]=l.useState(0),[me,Te]=l.useState(),[Fe,Pe]=l.useState(),[$e,tt]=l.useState(null),de=l.useRef(null),ke=l.useRef(0),ze=l.useRef(0),Ve=l.useRef(0),dt=l.useRef(!1),ft=l.useRef(null),Pt=l.useRef(null),xt=l.useRef(null),wt=l.useRef(null),Ht=l.useRef(null),Lt=l.useRef(null),Ge=l.useRef(null),Re=l.useCallback(()=>{const W=Pt.current;if(!W)return;const pe=W.closest(`.${e}-lightbox-content-area`);if(!pe)return W.getBoundingClientRect().width;const d=Array.from(pe.children).reduce((f,b)=>!(b instanceof HTMLElement)||b.contains(W)?f:f+b.getBoundingClientRect().width,0);return pe.getBoundingClientRect().width-d},[e]),Be=l.useCallback(()=>{de.current&&(clearTimeout(de.current),de.current=null)},[]),Ue=l.useCallback(W=>{W===ke.current&&(te(null),U(!1))},[]),He=l.useCallback(()=>{o||dt.current||(dt.current=!0,m==null||m(),re(!1),ft.current=setTimeout(()=>{p()},300))},[o,m,p]),ut=l.useCallback(W=>!!(W.closest("[data-controls]")||W.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:It,backdropStyle:Ze,mediaAreaStyle:At,overlayContentStyle:Ot,swipeHandlers:Oe,dismissAreaStyle:gt}=nl({enabled:Me,onClose:He,animMs:300,isBlockedTarget:ut}),it=l.useCallback(W=>{u&&rl(W+1,c,!0)},[u,c]),Ye=l.useCallback(W=>{if(W)return W.getBoundingClientRect().height},[]),rt=l.useCallback(W=>{if(ie.length===0)return;const pe=(W%ie.length+ie.length)%ie.length;if(pe===ge)return;const d=ie[ge],f=ie[pe];ke.current+=1;const b=ke.current,q=$==="fade"&&ss(d==null?void 0:d.entry)!==ss(f==null?void 0:f.entry),se=Ye(xt.current),be=q?(()=>{const Ke=Re();Bi.flushSync(()=>{tt(f.entry)}),xt.current&&Ke&&(xt.current.style.width=`${Ke}px`);const Mt=Ye(xt.current);return xt.current&&(xt.current.style.width=""),{measuredIncomingTitlesHeight:Mt,incomingTitlesMeasureWidth:Ke}})():void 0,_e=Math.max(se??0,(be==null?void 0:be.measuredIncomingTitlesHeight)??0)||void 0;le(b),te(ge),U(!0),ee(pe),it(pe),Ve.current=pe,q?(Be(),_e&&Te(_e),be!=null&&be.incomingTitlesMeasureWidth&&Pe(be.incomingTitlesMeasureWidth),we((d==null?void 0:d.entryIndex)??null),Ie(!0),ze.current=f.entryIndex,de.current=setTimeout(()=>{we(null),Ie(!1),Te(void 0),Pe(void 0),tt(null),de.current=null},400)):(Be(),we(null),Ie(!1),Te(void 0),Pe(void 0),tt(null),ze.current=f.entryIndex)},[ge,Be,Re,Ye,ie,it,$]),at=l.useCallback(()=>{Ge.current=null},[]),sn=l.useCallback(W=>{!ve||ie.length<=1||W.pointerType==="mouse"&&W.button!==0||W.target.closest("[data-controls]")||(Ge.current={startX:W.clientX,startY:W.clientY,pointerId:W.pointerId})},[ve,ie.length]),wn=l.useCallback(W=>{var Ke;if(!ve||ie.length<=1||W.pointerType==="mouse"&&W.button!==0)return;if(It){at();return}const pe=Ge.current;if(!pe||pe.pointerId!==W.pointerId||(at(),W.target.closest("[data-controls]")))return;const f=W.clientX-pe.startX,b=W.clientY-pe.startY,q=Math.abs(f),se=Math.abs(b);if(q>=bg&&q>se){rt(f>0?ge-1:ge+1);return}if(q>is||se>is)return;const be=(Ke=wt.current)==null?void 0:Ke.getBoundingClientRect(),_e=be?be.left+be.width/2:window.innerWidth/2;rt(W.clientX<_e?ge-1:ge+1)},[ge,ve,rt,It,at,ie.length]),ln=l.useCallback(W=>{const pe=Ge.current;(pe==null?void 0:pe.pointerId)===W.pointerId&&at()},[at]);il(),l.useEffect(()=>{Lt.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const W=requestAnimationFrame(()=>{re(!0),requestAnimationFrame(()=>{Ht.current?Ht.current.focus():wt.current&&wt.current.focus()})});return()=>{cancelAnimationFrame(W),ft.current&&clearTimeout(ft.current),de.current&&clearTimeout(de.current);const pe=Lt.current;pe&&document.contains(pe)&&pe.focus()}},[]),l.useEffect(()=>{var W;$!=="fade"&&(ze.current=((W=ie[ge])==null?void 0:W.entryIndex)??0,Be(),we(null),Ie(!1),Te(void 0),Pe(void 0))},[ge,Be,ie,$]),l.useEffect(()=>{const W=pe=>{if(pe.key==="Escape"){He();return}if(pe.key==="ArrowLeft"&&ie.length>1){rt(ge-1);return}if(pe.key==="ArrowRight"&&ie.length>1){rt(ge+1);return}if(pe.key==="Tab"&&wt.current){const d=wt.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),f=Array.from(d).filter(be=>!be.closest('[aria-hidden="true"]'));if(f.length===0)return;const b=f[0],q=f[f.length-1],se=document.activeElement;pe.shiftKey?(se===b||!wt.current.contains(se))&&(pe.preventDefault(),q.focus()):(se===q||!wt.current.contains(se))&&(pe.preventDefault(),b.focus())}};return window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)},[rt,He,ge,ie.length]),l.useLayoutEffect(()=>{Be(),ke.current=0,le(0),te(null),U(!1),we(null),Ie(!1),Te(void 0),Pe(void 0),tt(null),ee(W=>{const pe=Math.max(0,ie.length-1);return Math.min(W,pe)})},[Be,t.length,R,ie.length]),l.useLayoutEffect(()=>{var d;const W=Math.max(0,ie.length-1),pe=Math.min(Math.max(0,a),W);Ve.current=pe,ze.current=((d=ie[pe])==null?void 0:d.entryIndex)??0,ee(pe)},[a]);const ot=Ce!==null?t[Ce]:null,tn=z!==null?ie[z]:null,Ut=(D==null?void 0:D.title1)||(D==null?void 0:D.title2)||(D==null?void 0:D.title3)||(ot==null?void 0:ot.title1)||(ot==null?void 0:ot.title2)||(ot==null?void 0:ot.title3),De=Eg(R,ie,t),yt=A!==null,vt=Ut||De||yt,ue=De&&yt?{gap:K}:void 0,Se=`${e}-titles-stack${ye?` ${e}-titles-stack-stacked`:""}`,Ae=`${e}-titles-layer-out${ye?` ${e}-titles-layer-out-stacked`:""}`,We=`${e}-titles-layer-out`,et=(P??0)>0||o,$t=j(E),Le=l.useMemo(()=>({title1Width:S??yr.title1Width,title2Width:C??yr.title2Width,title3Width:k??yr.title3Width}),[S,C,k]),Qe=l.useMemo(()=>({title2MarginLeft:H,title3MarginLeft:I}),[H,I]),je=l.useMemo(()=>D?go(e,D,O,oe,h):[],[e,D,O,oe,h]),st=l.useMemo(()=>je.map(W=>Le[W.widthKey]),[je,Le]),pt=l.useMemo(()=>ko(je.length,st),[je.length,st]),Rt=l.useMemo(()=>Ir(je.length,st),[je.length,st]),qe=l.useMemo(()=>je.filter(W=>W.prefix==="title1"),[je]),nt=l.useMemo(()=>je.filter(W=>W.prefix==="title2"||W.prefix==="title3"),[je]),Et=l.useMemo(()=>ho(qe,Le),[qe,Le]),St=l.useMemo(()=>ho(nt,Le),[nt,Le]),_t=l.useCallback((W,pe)=>{const d=je.findIndex(b=>b.prefix===W.prefix);if(!ye||pe==="single-row")return{effectiveWidth:Rt[d]??0,resolvedWidth:pt[d]??0,maxWidth:Vn(d,pt)};if(pe==="two-row-top"){const b=qe.findIndex(q=>q.prefix===W.prefix);return{effectiveWidth:Et.effective[b]??0,resolvedWidth:Et.resolved[b]??0,maxWidth:Vn(b,Et.resolved)}}const f=nt.findIndex(b=>b.prefix===W.prefix);return{effectiveWidth:St.effective[f]??0,resolvedWidth:St.resolved[f]??0,maxWidth:Vn(f,St.resolved)}},[je,nt,St,Rt,pt,qe,Et,ye]),$n=l.useCallback(W=>Ig(je,pt,Qe,W)+(ye?0:P??0),[je,pt,Qe,ye,P]),ht=l.useCallback(()=>ye?0:P??0,[ye,P]),Bt=l.useCallback(W=>nt.slice(0,W).reduce((pe,d,f)=>pe+(d.marginLeftKey?Qe[d.marginLeftKey]??0:0)+(St.resolved[f]??0),0),[nt,St.resolved,Qe]),Wt=l.useCallback(W=>{const pe=nt[W];return Bt(W)+(pe.marginLeftKey?Qe[pe.marginLeftKey]??0:0)+(St.resolved[W]??0)},[nt,St.resolved,Bt,Qe]),cn=l.useCallback((W,pe,d)=>{if(!ye||d==="single-row"){const be=W.findIndex(Ct=>Ct.prefix===pe.prefix),_e=W.map(Ct=>Le[Ct.widthKey]),Ke=ko(W.length,_e);return{effectiveWidth:Ir(W.length,_e)[be]??0,resolvedWidth:Ke[be]??0,maxWidth:Vn(be,Ke)}}if(d==="two-row-top"){const be=W.filter(Ct=>Ct.prefix==="title1"),_e=be.findIndex(Ct=>Ct.prefix===pe.prefix),{resolved:Ke,effective:Mt}=ho(be,Le);return{effectiveWidth:Mt[_e]??0,resolvedWidth:Ke[_e]??0,maxWidth:Vn(_e,Ke)}}const f=W.filter(be=>be.prefix==="title2"||be.prefix==="title3"),b=f.findIndex(be=>be.prefix===pe.prefix),{resolved:q,effective:se}=ho(f,Le);return{effectiveWidth:se[b]??0,resolvedWidth:q[b]??0,maxWidth:Vn(b,q)}},[Le,ye]),Sn=(W,pe,d)=>{const f=W.marginLeftKey?Qe[W.marginLeftKey]??0:0,{effectiveWidth:b,resolvedWidth:q,maxWidth:se}=d??_t(W,pe),be=Math.max(f,mo),_e=o&&pe==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":W.prefix,style:{width:j(b),...f>0?{marginLeft:j(f)}:{}},children:[r.jsx("p",{className:W.className,style:W.style,children:W.text}),_e&&W.marginLeftKey?r.jsx("div",{"data-controls":W.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(q),style:{position:"absolute",top:0,left:j(-f),width:j(be),height:"100%",pointerEvents:"auto"}}):null,_e?r.jsx("div",{"data-controls":W.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(se),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:j(-ti/2),width:j(ti),height:"100%",pointerEvents:"auto"}}):null]},W.className)},dn=(W="two-row")=>{const pe=je.findIndex(b=>b.prefix==="title1"),d=pe>=0?pt[pe]:Le.title1Width,f=W==="two-row"&&o;return r.jsx("div",{...f?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(d)}:{},style:{width:j(P??0),flexShrink:0,alignSelf:"stretch",...f?{pointerEvents:"auto"}:{}}})},zt=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:O,"aria-hidden":"true",children:" "}),Cn=()=>r.jsx("span",{className:`${e}-entry-counter`,style:ae,"aria-live":"polite","aria-atomic":"true",children:Lg(ie,ge,R,t)}),Xn=()=>De?o&&yt?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Cn(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${fr(K)} + ${K}))`,width:fr(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Cn():null,Yn=()=>!De&&!yt?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:ue,children:[Xn(),yt?Xt():null]}),$i=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[De||Ut?zt():null,et?dn("single-row"):null,Yt(D),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),Yn(),nn()]}),Yo=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[De||Ut?zt():null,et?dn("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:xe&&me?{minHeight:me}:void 0,children:[r.jsx("div",{ref:xt,className:Se,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Wn($e||D)}),r.jsxs("div",{ref:Pt,className:Se,style:{position:xe?"absolute":"relative",inset:xe?0:void 0,width:"100%",...xe&&Fe?{width:Fe,maxWidth:"100%"}:void 0},children:[ot&&xe?r.jsx("div",{className:`${Ae} ${e}-titles-fade-out`,children:Wn(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Wn(D)})]})]}),Yn(),nn()]}),Xt=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:M.scalingValue(B??0,i),height:M.scalingValue(B??0,i),marginRight:Q,"--close-icon-hover-color":ne},children:[r.jsx("button",{ref:Ht,type:"button",className:`${e}-close-icon-inner`,onClick:He,"aria-label":"Close",children:r.jsx(Qt,{url:A??"",fill:V,hoverFill:i&&!s?V:ne,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"}})]}),Xi=(W,pe)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[De||Ut?zt():null,et?dn("two-row"):null,pe!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:pe},children:W}):r.jsxs(r.Fragment,{children:[W,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),Yn()]}),Yt=W=>{if(!W)return null;const pe=go(e,W,O,oe,h);return r.jsx(r.Fragment,{children:pe.map(d=>Sn(d,"single-row",cn(pe,d,"single-row")))})},un=W=>{if(!W)return null;const pe=go(e,W,O,oe,h),d=pe.find(f=>f.prefix==="title1");return d?Sn(d,"two-row-top",cn(pe,d,"two-row-top")):null},Tn=(W,pe=!1)=>{const d=W?go(e,W,O,oe,h):[],f=d.filter(se=>se.prefix==="title2"||se.prefix==="title3"),b=o&&pe;return f.length>0||b||(E??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[f.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[f.map(se=>Sn(se,"two-row-bottom",cn(d,se,"two-row-bottom"))),pe&&o?r.jsxs(r.Fragment,{children:[Jo(),Zo()]}):null]}):null,(E??0)>0||b?r.jsx("div",{"data-controls":b?"titleRowMarginBottom":void 0,"data-controls-axis":b?"y":void 0,"data-controls-reverse":b?"":void 0,className:b?`${e}-control`:void 0,style:{height:$t,width:"100%",flexShrink:0,pointerEvents:b?"auto":"none"}}):null]}):null},Fn=(W,pe=!1)=>r.jsxs(r.Fragment,{children:[Xi(un(W)),Tn(W,pe)]}),Wn=W=>ye?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Fn(W)}):W?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Yt(W)}):null,Yi=()=>{const W=ye?-1:je.findIndex(f=>f.prefix==="title1"),pe=!ye&&(o||(P??0)>0)?(()=>{const f=P??0,b=W>=0?pt[W]:Le.title1Width,q=Math.max(f,mo);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(b),style:{position:"absolute",top:0,left:0,width:j(q),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,d=je.flatMap((f,b)=>{if(!f.marginLeftKey)return[];const q=Qe[f.marginLeftKey]??0,se=Pg(je,pt,Qe,b)+ht(),be=Math.max(q,mo);return r.jsx("div",{"data-controls":f.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(pt[b]),style:{position:"absolute",top:0,left:j(se),width:j(be),height:"100%",pointerEvents:"auto"}},f.marginLeftKey)});return pe?[pe,...d]:d},Ji=()=>je.map((W,pe)=>{const d=Vn(pe,pt),b=$n(pe)-ti/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":W.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(d),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j(b),width:j(ti),height:"100%",pointerEvents:"auto"}})},`${W.widthKey}-junction`)}),Jo=()=>nt.flatMap((W,pe)=>{if(!W.marginLeftKey)return[];const d=Qe[W.marginLeftKey]??0,f=Bt(pe),b=Math.max(d,mo),{resolvedWidth:q}=_t(W,"two-row-bottom");return r.jsx("div",{"data-controls":W.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(q),style:{position:"absolute",top:0,left:j(f),width:j(b),height:"100%",pointerEvents:"auto"}},W.marginLeftKey)}),Zo=()=>nt.map((W,pe)=>{const{maxWidth:d}=_t(W,"two-row-bottom"),b=Wt(pe)-ti/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":W.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(d),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j(b),width:j(ti),height:"100%",pointerEvents:"auto"}})},`${W.widthKey}-junction`)}),nn=()=>!o||ye?null:r.jsxs(r.Fragment,{children:[Yi(),Ji()]}),Jn=W=>{const pe=!W.objectFit&&vn(x);return{className:`${e}-slide-image-cell${pe?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:N,maxHeight:T,...pe?{"--image-aspect-ratio":Go(x)}:{}}}},Zi=W=>W.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":W.objectFit}}:vn(x)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Nn=W=>{if(W.length===0)return null;const pe=W.length>1,d=fr(_),f=`calc(-0.5 * (${d} + ${_}))`;if(W.length===1){const b=W[0];return r.jsx("div",{...Jn(b),children:r.jsx("img",{...Zi(b),src:b.url,alt:b.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:pe?{gap:_}:void 0,children:W.map((b,q)=>r.jsxs("div",{...Jn(b),children:[r.jsx("img",{...Zi(b),src:b.url,alt:b.name??"",draggable:!1}),o&&pe&&q<W.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:f,width:d,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${b.url}-${q}`))})},Qi=!!(D!=null&&D.title2||D!=null&&D.title3||ot!=null&&ot.title2||ot!=null&&ot.title3||(E??0)>0||o),Qo=()=>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:xt,className:Se,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Fn($e||D)}),r.jsxs("div",{ref:Pt,className:`${e}-titles-row-two-row`,style:{...xe&&me?{minHeight:me}:void 0,...xe&&Fe?{width:Fe,maxWidth:"100%"}:void 0},children:[Xi(r.jsxs("div",{className:Se,style:{position:xe?"absolute":"relative",inset:xe?0:void 0,width:"100%"},children:[ot&&xe?r.jsx("div",{className:`${We} ${e}-titles-fade-out`,children:un(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:un(D)})]}),xe&&me?me:void 0),Qi?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ot&&xe?r.jsx("div",{className:`${Ae} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:Tn(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ye?` ${e}-titles-layer-in-stacked`:""}`,children:Tn(D,!0)})]}):null]})]}),er=()=>{const W=Qi;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...W?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:W?void 0:{flex:"0 0 auto",height:"auto"},children:Fn(D,!0)}),nn()]})};return r.jsxs("div",{ref:wt,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{It||He()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:yt?void 0:-1,style:{opacity:he?1:0,transition:"opacity 300ms ease",pointerEvents:he?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:L,...Ze}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:gt,...Oe,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:At,onClick:W=>W.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ve&&ie.length>1?"true":"false",onPointerDown:ve?sn:void 0,onPointerUp:ve?wn:void 0,onPointerCancel:ve?ln:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[tn&&F?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:W=>{W.target===W.currentTarget&&Ue(G)},children:r.jsx("div",{className:`${e}-slide-area`,children:Nn(tn.images)})},`slide-out-${G}`):null,r.jsx("div",{className:`${e}-slide-layer-in${F?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:J?Nn(J.images):null})},`slide-in-${G}-${ge}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ot,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:Y,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ye?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${ye?` ${e}-lightbox-content-area-stacked`:""}`,children:vt&&r.jsx("div",{className:`${e}-text-bar-cell${ye?` ${e}-text-bar-cell-stacked`:""}`,style:ye?void 0:{flex:1,minWidth:0,width:"100%"},children:ye?$==="fade"?Qo():er():$==="fade"?Yo():$i()})})})]})]})]})};function Wg(e){return`
|
|
11096
|
+
`,sg="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>'),zn={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 lg(e){const t={};return t[lt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[lt(e,"fontSettings")]={...zn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[lt(e,"fontSize")]={...zn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[lt(e,"lineHeight")]={...zn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[lt(e,"letterSpacing")]={...zn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[lt(e,"wordSpacing")]={...zn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[lt(e,"textAlign")]={...zn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[lt(e,"textAppearance")]={...zn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const cg=hi.reduce((e,t)=>({...e,...lg(t)}),{}),dg=hi.reduce((e,t)=>({...e,[lt(t,"fontFamily")]:"Goudy Bookletter 1911",[lt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[lt(t,"letterSpacing")]:0,[lt(t,"wordSpacing")]:0,[lt(t,"textAlign")]:"left",[lt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function es(e){return hi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[lt(n,"fontSize")]=i),o!==void 0&&(t[lt(n,"lineHeight")]=o),t},{})}const ug=eg(),pg={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:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",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"]}},thumbnailActiveColor:{type:"string",scope:"common",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:"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"}},...cg,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/lightbox_strip_1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:sg,closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",...dg},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,backgroundColor:"#FFFFFF",contentMarginTop:.08,iconMarginLeft:.02,...es({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,backgroundColor:"#FFFFFF",contentMarginTop:.015,iconMarginLeft:.02,...es({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:[ug]}],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/lightbox_strip_2.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_3.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_4.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_5.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_6.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"},{image:{url:"https://cdn.cntrl.site/component-assets/lightbox_strip_7.jpg",name:"",objectFit:"contain"},title1:"Giovanni Andrea Vavassore",title2:"ESEMPLA",title3:"Venice, 1500"}]}},mg={element:rg,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350,height:350},m:{width:300,height:350}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:pg,sourceCode:ag,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...hi.map(e=>({path:`${lt(e,"fontFamily")}`}))]},fontRelations:{...hi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${lt(t,"fontFamily")}`}),{})}},gg=50,ts=10,na="cntrl-lightbox-journal",Go=na,Er=`${na}-`,Uo=e=>`${na}-${e}`,ia=e=>e===Go||e.startsWith(Er),ns=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},is=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=ns(t.get(Uo(e)));if(i)return i}const n=ns(t.get(Go));if(n)return n;for(const[i]of t){if(!i.startsWith(Er))continue;const o=i.slice(Er.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},os=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},tl=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(a=>{ia(a)&&i.searchParams.delete(a)}),t?i.searchParams.set(Uo(t),String(e)):i.searchParams.set(Go,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},hg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Uo(e)||i===Go:ia(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)}},nl=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Uo(e)):[...t.keys()].some(n=>ia(n))},fg=(e,t)=>{if(nl(t)){if(e){window.history.back();return}hg(t)}},yg=20,vg=2,hr=e=>`max(${e}, ${yg}px)`,fi=e=>((e==null?void 0:e.image)??[]).slice(0,vg),il=e=>e.reduce((t,n)=>t+fi(n).length,0),bg=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+fi(s).length,1),i=fi(e[t]).length;return{start:n,end:n+i-1}},xg=(e,t)=>{const n=il(e),{start:i,end:o}=bg(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},To=(e,t)=>t==="B"?e.flatMap((n,i)=>fi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:fi(n)})),wg=(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 xg(i,o)},rs=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",$g=(e,t,n)=>e==="B"?t.length>1:il(n)>1,ti=.004,mo=.004,fr={title1Width:.13,title2Width:.13,title3Width:.14},go=(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},ko=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,a)=>s+a,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:a},u)=>{if(s<=0||u<=0)return{overflow:s,widths:[u,...a]};const c=Math.min(s,u);return{overflow:s-c,widths:[u-c,...a]}},{overflow:i-1,widths:[]});return o},Pr=(e,t)=>ko(e,t),Vn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ho=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:ko(e.length,n),effective:Pr(e.length,n)}},Sg=(e,t,n,i)=>e.slice(0,i).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),Cg=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,a)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[a]??0),0),yi=["title1","title2","title3","count"],ct=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Tg={title1:"1",title2:"2",title3:"3",count:"Count"},Lg=e=>[ct(e,"fontFamily"),ct(e,"fontSettings"),{type:"row",items:[ct(e,"fontSize"),ct(e,"lineHeight"),ct(e,"letterSpacing"),ct(e,"wordSpacing")]},ct(e,"textAlign"),ct(e,"textAppearance")],Eg=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(yi.map(e=>[Tg[e],Lg(e)]))}),Pg={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Ig={title1:.02,title2:.02,title3:.02,count:.017},fo=(e,t)=>{const n=i=>{const o=ct(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[Pg[t]]}},yo=(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??Ig[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return kt(i,n)},Rg=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:a=0,enableUrlSync:u=!1,journalItemId:c=null,onBeforeClose:m,onClose:p})=>{const{type:E,coverFit:x,backgroundColor:C,imageGap:g,maxWidth:v,maxHeight:T,textTransition:w,title1Width:$,title2Width:S,title3Width:_,title1MarginLeft:I=0,title2MarginLeft:F=0,title3MarginLeft:P=0,titleRowMarginBottom:R=0,titleHeaderLayout:Y="single-row",countCloseGap:y=0,closeIcon:M,closeIconMaxWidth:W,closeIconColor:D,closeIconHoverColor:te,contentMarginTop:pe=0,iconMarginRight:K=0}=n,H=l.useCallback(k=>L.scalingValue(k,i??!1),[i]),Z=H(g??0),U=`${v}%`,B=`${T}%`,J=H(y),ie=H(pe),oe=H(K),O=yo("title1",fo(n,"title1"),i),de=yo("title2",fo(n,"title2"),i),f=yo("title3",fo(n,"title3"),i),me=yo("count",fo(n,"count"),i),ye=Y==="mobile",ve=!i||!!s,Ae=!o&&(!i||!!s),ee=l.useMemo(()=>To(t,E),[t,E]),[ge,X]=l.useState(a),G=ee[ge],j=G==null?void 0:G.entry,[he,ne]=l.useState(!1),[Ce,we]=l.useState(null),[xe,Ie]=l.useState(!1),[N,Q]=l.useState(null),[A,q]=l.useState(!1),[V,ae]=l.useState(0),[ue,Te]=l.useState(),[Fe,Pe]=l.useState(),[$e,tt]=l.useState(null),se=l.useRef(null),ke=l.useRef(0),ze=l.useRef(0),Ve=l.useRef(0),dt=l.useRef(!1),ft=l.useRef(null),Pt=l.useRef(null),xt=l.useRef(null),wt=l.useRef(null),Ht=l.useRef(null),Lt=l.useRef(null),Ge=l.useRef(null),Re=l.useCallback(()=>{const k=Pt.current;if(!k)return;const ce=k.closest(`.${e}-lightbox-content-area`);if(!ce)return k.getBoundingClientRect().width;const d=Array.from(ce.children).reduce((h,b)=>!(b instanceof HTMLElement)||b.contains(k)?h:h+b.getBoundingClientRect().width,0);return ce.getBoundingClientRect().width-d},[e]),Be=l.useCallback(()=>{se.current&&(clearTimeout(se.current),se.current=null)},[]),Ue=l.useCallback(k=>{k===ke.current&&(Q(null),q(!1))},[]),He=l.useCallback(()=>{o||dt.current||(dt.current=!0,m==null||m(),ne(!1),ft.current=setTimeout(()=>{p()},300))},[o,m,p]),ut=l.useCallback(k=>!!(k.closest("[data-controls]")||k.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:It,backdropStyle:Ze,mediaAreaStyle:Mt,overlayContentStyle:Ot,swipeHandlers:Oe,dismissAreaStyle:gt}=Zs({enabled:Ae,onClose:He,animMs:300,isBlockedTarget:ut}),it=l.useCallback(k=>{u&&tl(k+1,c,!0)},[u,c]),Ye=l.useCallback(k=>{if(k)return k.getBoundingClientRect().height},[]),rt=l.useCallback(k=>{if(ee.length===0)return;const ce=(k%ee.length+ee.length)%ee.length;if(ce===ge)return;const d=ee[ge],h=ee[ce];ke.current+=1;const b=ke.current,z=w==="fade"&&rs(d==null?void 0:d.entry)!==rs(h==null?void 0:h.entry),re=Ye(xt.current),be=z?(()=>{const Ke=Re();Bi.flushSync(()=>{tt(h.entry)}),xt.current&&Ke&&(xt.current.style.width=`${Ke}px`);const At=Ye(xt.current);return xt.current&&(xt.current.style.width=""),{measuredIncomingTitlesHeight:At,incomingTitlesMeasureWidth:Ke}})():void 0,_e=Math.max(re??0,(be==null?void 0:be.measuredIncomingTitlesHeight)??0)||void 0;ae(b),Q(ge),q(!0),X(ce),it(ce),Ve.current=ce,z?(Be(),_e&&Te(_e),be!=null&&be.incomingTitlesMeasureWidth&&Pe(be.incomingTitlesMeasureWidth),we((d==null?void 0:d.entryIndex)??null),Ie(!0),ze.current=h.entryIndex,se.current=setTimeout(()=>{we(null),Ie(!1),Te(void 0),Pe(void 0),tt(null),se.current=null},400)):(Be(),we(null),Ie(!1),Te(void 0),Pe(void 0),tt(null),ze.current=h.entryIndex)},[ge,Be,Re,Ye,ee,it,w]),at=l.useCallback(()=>{Ge.current=null},[]),sn=l.useCallback(k=>{!ve||ee.length<=1||k.pointerType==="mouse"&&k.button!==0||k.target.closest("[data-controls]")||(Ge.current={startX:k.clientX,startY:k.clientY,pointerId:k.pointerId})},[ve,ee.length]),wn=l.useCallback(k=>{var Ke;if(!ve||ee.length<=1||k.pointerType==="mouse"&&k.button!==0)return;if(It){at();return}const ce=Ge.current;if(!ce||ce.pointerId!==k.pointerId||(at(),k.target.closest("[data-controls]")))return;const h=k.clientX-ce.startX,b=k.clientY-ce.startY,z=Math.abs(h),re=Math.abs(b);if(z>=gg&&z>re){rt(h>0?ge-1:ge+1);return}if(z>ts||re>ts)return;const be=(Ke=wt.current)==null?void 0:Ke.getBoundingClientRect(),_e=be?be.left+be.width/2:window.innerWidth/2;rt(k.clientX<_e?ge-1:ge+1)},[ge,ve,rt,It,at,ee.length]),ln=l.useCallback(k=>{const ce=Ge.current;(ce==null?void 0:ce.pointerId)===k.pointerId&&at()},[at]);Qs(),l.useEffect(()=>{Lt.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const k=requestAnimationFrame(()=>{ne(!0),requestAnimationFrame(()=>{Ht.current?Ht.current.focus():wt.current&&wt.current.focus()})});return()=>{cancelAnimationFrame(k),ft.current&&clearTimeout(ft.current),se.current&&clearTimeout(se.current);const ce=Lt.current;ce&&document.contains(ce)&&ce.focus()}},[]),l.useEffect(()=>{var k;w!=="fade"&&(ze.current=((k=ee[ge])==null?void 0:k.entryIndex)??0,Be(),we(null),Ie(!1),Te(void 0),Pe(void 0))},[ge,Be,ee,w]),l.useEffect(()=>{const k=ce=>{if(ce.key==="Escape"){He();return}if(ce.key==="ArrowLeft"&&ee.length>1){rt(ge-1);return}if(ce.key==="ArrowRight"&&ee.length>1){rt(ge+1);return}if(ce.key==="Tab"&&wt.current){const d=wt.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),h=Array.from(d).filter(be=>!be.closest('[aria-hidden="true"]'));if(h.length===0)return;const b=h[0],z=h[h.length-1],re=document.activeElement;ce.shiftKey?(re===b||!wt.current.contains(re))&&(ce.preventDefault(),z.focus()):(re===z||!wt.current.contains(re))&&(ce.preventDefault(),b.focus())}};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[rt,He,ge,ee.length]),l.useLayoutEffect(()=>{Be(),ke.current=0,ae(0),Q(null),q(!1),we(null),Ie(!1),Te(void 0),Pe(void 0),tt(null),X(k=>{const ce=Math.max(0,ee.length-1);return Math.min(k,ce)})},[Be,t.length,E,ee.length]),l.useLayoutEffect(()=>{var d;const k=Math.max(0,ee.length-1),ce=Math.min(Math.max(0,a),k);Ve.current=ce,ze.current=((d=ee[ce])==null?void 0:d.entryIndex)??0,X(ce)},[a]);const ot=Ce!==null?t[Ce]:null,tn=N!==null?ee[N]:null,Ut=(j==null?void 0:j.title1)||(j==null?void 0:j.title2)||(j==null?void 0:j.title3)||(ot==null?void 0:ot.title1)||(ot==null?void 0:ot.title2)||(ot==null?void 0:ot.title3),De=$g(E,ee,t),yt=M!==null,vt=Ut||De||yt,le=De&&yt?{gap:J}:void 0,Se=`${e}-titles-stack${ye?` ${e}-titles-stack-stacked`:""}`,Me=`${e}-titles-layer-out${ye?` ${e}-titles-layer-out-stacked`:""}`,We=`${e}-titles-layer-out`,et=(I??0)>0||o,$t=H(R),Le=l.useMemo(()=>({title1Width:$??fr.title1Width,title2Width:S??fr.title2Width,title3Width:_??fr.title3Width}),[$,S,_]),Qe=l.useMemo(()=>({title2MarginLeft:F,title3MarginLeft:P}),[F,P]),je=l.useMemo(()=>j?go(e,j,O,de,f):[],[e,j,O,de,f]),st=l.useMemo(()=>je.map(k=>Le[k.widthKey]),[je,Le]),pt=l.useMemo(()=>ko(je.length,st),[je.length,st]),Rt=l.useMemo(()=>Pr(je.length,st),[je.length,st]),qe=l.useMemo(()=>je.filter(k=>k.prefix==="title1"),[je]),nt=l.useMemo(()=>je.filter(k=>k.prefix==="title2"||k.prefix==="title3"),[je]),Et=l.useMemo(()=>ho(qe,Le),[qe,Le]),St=l.useMemo(()=>ho(nt,Le),[nt,Le]),_t=l.useCallback((k,ce)=>{const d=je.findIndex(b=>b.prefix===k.prefix);if(!ye||ce==="single-row")return{effectiveWidth:Rt[d]??0,resolvedWidth:pt[d]??0,maxWidth:Vn(d,pt)};if(ce==="two-row-top"){const b=qe.findIndex(z=>z.prefix===k.prefix);return{effectiveWidth:Et.effective[b]??0,resolvedWidth:Et.resolved[b]??0,maxWidth:Vn(b,Et.resolved)}}const h=nt.findIndex(b=>b.prefix===k.prefix);return{effectiveWidth:St.effective[h]??0,resolvedWidth:St.resolved[h]??0,maxWidth:Vn(h,St.resolved)}},[je,nt,St,Rt,pt,qe,Et,ye]),$n=l.useCallback(k=>Cg(je,pt,Qe,k)+(ye?0:I??0),[je,pt,Qe,ye,I]),ht=l.useCallback(()=>ye?0:I??0,[ye,I]),Bt=l.useCallback(k=>nt.slice(0,k).reduce((ce,d,h)=>ce+(d.marginLeftKey?Qe[d.marginLeftKey]??0:0)+(St.resolved[h]??0),0),[nt,St.resolved,Qe]),Wt=l.useCallback(k=>{const ce=nt[k];return Bt(k)+(ce.marginLeftKey?Qe[ce.marginLeftKey]??0:0)+(St.resolved[k]??0)},[nt,St.resolved,Bt,Qe]),cn=l.useCallback((k,ce,d)=>{if(!ye||d==="single-row"){const be=k.findIndex(Ct=>Ct.prefix===ce.prefix),_e=k.map(Ct=>Le[Ct.widthKey]),Ke=ko(k.length,_e);return{effectiveWidth:Pr(k.length,_e)[be]??0,resolvedWidth:Ke[be]??0,maxWidth:Vn(be,Ke)}}if(d==="two-row-top"){const be=k.filter(Ct=>Ct.prefix==="title1"),_e=be.findIndex(Ct=>Ct.prefix===ce.prefix),{resolved:Ke,effective:At}=ho(be,Le);return{effectiveWidth:At[_e]??0,resolvedWidth:Ke[_e]??0,maxWidth:Vn(_e,Ke)}}const h=k.filter(be=>be.prefix==="title2"||be.prefix==="title3"),b=h.findIndex(be=>be.prefix===ce.prefix),{resolved:z,effective:re}=ho(h,Le);return{effectiveWidth:re[b]??0,resolvedWidth:z[b]??0,maxWidth:Vn(b,z)}},[Le,ye]),Sn=(k,ce,d)=>{const h=k.marginLeftKey?Qe[k.marginLeftKey]??0:0,{effectiveWidth:b,resolvedWidth:z,maxWidth:re}=d??_t(k,ce),be=Math.max(h,mo),_e=o&&ce==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":k.prefix,style:{width:H(b),...h>0?{marginLeft:H(h)}:{}},children:[r.jsx("p",{className:k.className,style:k.style,children:k.text}),_e&&k.marginLeftKey?r.jsx("div",{"data-controls":k.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(z),style:{position:"absolute",top:0,left:H(-h),width:H(be),height:"100%",pointerEvents:"auto"}}):null,_e?r.jsx("div",{"data-controls":k.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,right:H(-ti/2),width:H(ti),height:"100%",pointerEvents:"auto"}}):null]},k.className)},dn=(k="two-row")=>{const ce=je.findIndex(b=>b.prefix==="title1"),d=ce>=0?pt[ce]:Le.title1Width,h=k==="two-row"&&o;return r.jsx("div",{...h?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(d)}:{},style:{width:H(I??0),flexShrink:0,alignSelf:"stretch",...h?{pointerEvents:"auto"}:{}}})},zt=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:O,"aria-hidden":"true",children:" "}),Cn=()=>r.jsx("span",{className:`${e}-entry-counter`,style:me,"aria-live":"polite","aria-atomic":"true",children:wg(ee,ge,E,t)}),Xn=()=>De?o&&yt?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Cn(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${hr(J)} + ${J}))`,width:hr(J),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Cn():null,Yn=()=>!De&&!yt?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:le,children:[Xn(),yt?Xt():null]}),$i=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[De||Ut?zt():null,et?dn("single-row"):null,Yt(j),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),Yn(),nn()]}),Xo=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[De||Ut?zt():null,et?dn("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:xe&&ue?{minHeight:ue}:void 0,children:[r.jsx("div",{ref:xt,className:Se,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Wn($e||j)}),r.jsxs("div",{ref:Pt,className:Se,style:{position:xe?"absolute":"relative",inset:xe?0:void 0,width:"100%",...xe&&Fe?{width:Fe,maxWidth:"100%"}:void 0},children:[ot&&xe?r.jsx("div",{className:`${Me} ${e}-titles-fade-out`,children:Wn(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Wn(j)})]})]}),Yn(),nn()]}),Xt=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:L.scalingValue(W??0,i),height:L.scalingValue(W??0,i),marginRight:oe,"--close-icon-hover-color":te},children:[r.jsx("button",{ref:Ht,type:"button",className:`${e}-close-icon-inner`,onClick:He,"aria-label":"Close",children:r.jsx(Qt,{url:M??"",fill:D,hoverFill:i&&!s?D:te,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:oe,height:"100%",pointerEvents:"auto"}})]}),Xi=(k,ce)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[De||Ut?zt():null,et?dn("two-row"):null,ce!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:ce},children:k}):r.jsxs(r.Fragment,{children:[k,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),Yn()]}),Yt=k=>{if(!k)return null;const ce=go(e,k,O,de,f);return r.jsx(r.Fragment,{children:ce.map(d=>Sn(d,"single-row",cn(ce,d,"single-row")))})},un=k=>{if(!k)return null;const ce=go(e,k,O,de,f),d=ce.find(h=>h.prefix==="title1");return d?Sn(d,"two-row-top",cn(ce,d,"two-row-top")):null},Tn=(k,ce=!1)=>{const d=k?go(e,k,O,de,f):[],h=d.filter(re=>re.prefix==="title2"||re.prefix==="title3"),b=o&&ce;return h.length>0||b||(R??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[h.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[h.map(re=>Sn(re,"two-row-bottom",cn(d,re,"two-row-bottom"))),ce&&o?r.jsxs(r.Fragment,{children:[Yo(),Jo()]}):null]}):null,(R??0)>0||b?r.jsx("div",{"data-controls":b?"titleRowMarginBottom":void 0,"data-controls-axis":b?"y":void 0,"data-controls-reverse":b?"":void 0,className:b?`${e}-control`:void 0,style:{height:$t,width:"100%",flexShrink:0,pointerEvents:b?"auto":"none"}}):null]}):null},Fn=(k,ce=!1)=>r.jsxs(r.Fragment,{children:[Xi(un(k)),Tn(k,ce)]}),Wn=k=>ye?r.jsx("div",{className:`${e}-titles-row-two-row`,children:Fn(k)}):k?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Yt(k)}):null,Yi=()=>{const k=ye?-1:je.findIndex(h=>h.prefix==="title1"),ce=!ye&&(o||(I??0)>0)?(()=>{const h=I??0,b=k>=0?pt[k]:Le.title1Width,z=Math.max(h,mo);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(b),style:{position:"absolute",top:0,left:0,width:H(z),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,d=je.flatMap((h,b)=>{if(!h.marginLeftKey)return[];const z=Qe[h.marginLeftKey]??0,re=Sg(je,pt,Qe,b)+ht(),be=Math.max(z,mo);return r.jsx("div",{"data-controls":h.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(pt[b]),style:{position:"absolute",top:0,left:H(re),width:H(be),height:"100%",pointerEvents:"auto"}},h.marginLeftKey)});return ce?[ce,...d]:d},Ji=()=>je.map((k,ce)=>{const d=Vn(ce,pt),b=$n(ce)-ti/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(d),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:H(b),width:H(ti),height:"100%",pointerEvents:"auto"}})},`${k.widthKey}-junction`)}),Yo=()=>nt.flatMap((k,ce)=>{if(!k.marginLeftKey)return[];const d=Qe[k.marginLeftKey]??0,h=Bt(ce),b=Math.max(d,mo),{resolvedWidth:z}=_t(k,"two-row-bottom");return r.jsx("div",{"data-controls":k.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(z),style:{position:"absolute",top:0,left:H(h),width:H(b),height:"100%",pointerEvents:"auto"}},k.marginLeftKey)}),Jo=()=>nt.map((k,ce)=>{const{maxWidth:d}=_t(k,"two-row-bottom"),b=Wt(ce)-ti/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(d),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:H(b),width:H(ti),height:"100%",pointerEvents:"auto"}})},`${k.widthKey}-junction`)}),nn=()=>!o||ye?null:r.jsxs(r.Fragment,{children:[Yi(),Ji()]}),Jn=k=>{const ce=!k.objectFit&&vn(x);return{className:`${e}-slide-image-cell${ce?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:U,maxHeight:B,...ce?{"--image-aspect-ratio":Ko(x)}:{}}}},Zi=k=>k.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":k.objectFit}}:vn(x)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Nn=k=>{if(k.length===0)return null;const ce=k.length>1,d=hr(Z),h=`calc(-0.5 * (${d} + ${Z}))`;if(k.length===1){const b=k[0];return r.jsx("div",{...Jn(b),children:r.jsx("img",{...Zi(b),src:b.url,alt:b.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:ce?{gap:Z}:void 0,children:k.map((b,z)=>r.jsxs("div",{...Jn(b),children:[r.jsx("img",{...Zi(b),src:b.url,alt:b.name??"",draggable:!1}),o&&ce&&z<k.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:h,width:d,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${b.url}-${z}`))})},Qi=!!(j!=null&&j.title2||j!=null&&j.title3||ot!=null&&ot.title2||ot!=null&&ot.title3||(R??0)>0||o),Zo=()=>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:xt,className:Se,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Fn($e||j)}),r.jsxs("div",{ref:Pt,className:`${e}-titles-row-two-row`,style:{...xe&&ue?{minHeight:ue}:void 0,...xe&&Fe?{width:Fe,maxWidth:"100%"}:void 0},children:[Xi(r.jsxs("div",{className:Se,style:{position:xe?"absolute":"relative",inset:xe?0:void 0,width:"100%"},children:[ot&&xe?r.jsx("div",{className:`${We} ${e}-titles-fade-out`,children:un(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:un(j)})]}),xe&&ue?ue:void 0),Qi?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ot&&xe?r.jsx("div",{className:`${Me} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:Tn(ot)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ye?` ${e}-titles-layer-in-stacked`:""}`,children:Tn(j,!0)})]}):null]})]}),Qo=()=>{const k=Qi;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...k?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:k?void 0:{flex:"0 0 auto",height:"auto"},children:Fn(j,!0)}),nn()]})};return r.jsxs("div",{ref:wt,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{It||He()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:yt?void 0:-1,style:{opacity:he?1:0,transition:"opacity 300ms ease",pointerEvents:he?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:C,...Ze}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:gt,...Oe,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Mt,onClick:k=>k.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ve&&ee.length>1?"true":"false",onPointerDown:ve?sn:void 0,onPointerUp:ve?wn:void 0,onPointerCancel:ve?ln:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[tn&&A?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:k=>{k.target===k.currentTarget&&Ue(V)},children:r.jsx("div",{className:`${e}-slide-area`,children:Nn(tn.images)})},`slide-out-${V}`):null,r.jsx("div",{className:`${e}-slide-layer-in${A?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:G?Nn(G.images):null})},`slide-in-${V}-${ge}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ot,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ie,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ye?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${ye?` ${e}-lightbox-content-area-stacked`:""}`,children:vt&&r.jsx("div",{className:`${e}-text-bar-cell${ye?` ${e}-text-bar-cell-stacked`:""}`,style:ye?void 0:{flex:1,minWidth:0,width:"100%"},children:ye?w==="fade"?Zo():Qo():w==="fade"?Xo():$i()})})})]})]})]})};function Ag(e){return`
|
|
11097
11097
|
.${e}-wrapper {
|
|
11098
11098
|
position: relative;
|
|
11099
11099
|
width: 100%;
|
|
@@ -11627,7 +11627,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
11627
11627
|
pointer-events: auto;
|
|
11628
11628
|
z-index: 10;
|
|
11629
11629
|
}
|
|
11630
|
-
`}const
|
|
11630
|
+
`}const kg=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s,metadata:a})=>{const{prefix:u}=L.useScopedStyles(),c=(a==null?void 0:a.itemId)??null,{cover:m,coverFit:p,type:E}=e,x=l.useRef(null),[C,g]=l.useState(!1),[v,T]=l.useState(0),w=l.useRef(!1),$=l.useRef(!1),S=l.useRef(!1),_=l.useMemo(()=>(t??[]).filter(y=>fi(y).length>0),[t]),I=C&&_.length>0,F=!n,P=l.useCallback(()=>{F&&(S.current=!0,fg($.current,c),$.current=!1)},[F,c]),R=(y=0)=>{if(_.length===0||n&&!i&&!o)return;const M=To(_,E),W=Math.max(0,Math.min(y,M.length-1));if(T(W),F){const D=nl();tl(W+1,c,D),$.current=!D}g(!0)},Y=l.useCallback(()=>{g(!1),S.current=!1},[]);return l.useEffect(()=>{!n||i||o||g(!1)},[n,i,o]),l.useEffect(()=>{if(!F||w.current)return;w.current=!0;const y=is(c);if(!y)return;const M=os(y,To(_,E).length);M<0||(T(M),g(!0))},[_,c,F,E]),l.useEffect(()=>{if(!F)return;const y=()=>{if(S.current){S.current=!1,g(!1);return}const M=is(c);if(!M){g(!1);return}const W=os(M,To(_,E).length);if(W<0){g(!1);return}$.current=!1,T(W),g(!0)};return window.addEventListener("popstate",y),()=>window.removeEventListener("popstate",y)},[_,c,F,E]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:x,className:`${u}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ag(u)}}),m?r.jsx("button",{type:"button",className:`${u}-cover ${vn(p)?`${u}-ratio-wrapper-cover`:`${u}-ratio-wrapper-fit`}`,onClick:()=>R(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...vn(p)?{"--image-aspect-ratio":Ko(p)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${u}-cover-image ${vn(p)?`${u}-cover-image-cover`:`${u}-cover-image-fit`}`,src:m,alt:"cover"})}):null]}),I&&typeof document<"u"&&(()=>{const y=(s?document.getElementById(s):null)??document.body;return Bi.createPortal(r.jsx(Rg,{prefix:u,entries:_,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:v,enableUrlSync:F,journalItemId:c,onBeforeClose:P,onClose:Y}),y)})()]})},Mg=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
11631
11631
|
import { createPortal } from 'react-dom';
|
|
11632
11632
|
import { CommonComponentProps } from '../props';
|
|
11633
11633
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -12395,560 +12395,4 @@ export type LightboxJournalSettings = {
|
|
|
12395
12395
|
closeIconColor: string;
|
|
12396
12396
|
closeIconHoverColor: string;
|
|
12397
12397
|
};
|
|
12398
|
-
`,Og="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>'),Dn={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 Bg(e){const t={};return t[ct(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSettings")]={...Dn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSize")]={...Dn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ct(e,"lineHeight")]={...Dn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ct(e,"letterSpacing")]={...Dn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ct(e,"wordSpacing")]={...Dn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ct(e,"textAlign")]={...Dn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ct(e,"textAppearance")]={...Dn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const jg=yi.reduce((e,t)=>({...e,...Bg(t)}),{}),zg=yi.reduce((e,t)=>({...e,[ct(t,"fontFamily")]:"Goudy Bookletter 1911",[ct(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ct(t,"letterSpacing")]:0,[ct(t,"wordSpacing")]:0,[ct(t,"textAlign")]:"left",[ct(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ls(e){return yi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ct(n,"fontSize")]=i),o!==void 0&&(t[ct(n,"lineHeight")]=o),t},{})}const Vg=kg(),Dg={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"}},...jg,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/journal_1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:Og,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...zg,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.05,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.005,...ls({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},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,...ls({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:[Vg]}],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:"Dorothy Manners & Julanne Johnston",title2:"by Evans Studio",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_2.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/journal_3.jpg",name:"",objectFit:"contain"}]},{title1:"Inez Nadeau",title2:"Melbourne Spurr",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_4.jpg",name:"",objectFit:"contain"}]},{title1:"Colleen Moore",title2:"Clarence S. Bull",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_5.jpg",name:"",objectFit:"contain"}]},{title1:"Gloria Swanson",title2:"Donald Biddle Keyes",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_6.jpg",name:"",objectFit:"contain"}]}]}},qg={element:Ng,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350,height:350},m:{width:300,height:350}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:Dg,sourceCode:Hg,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...yi.map(e=>({path:`settings.${ct(e,"fontFamily")}`}))]},fontRelations:{...yi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ct(t,"fontFamily")}`}),{})}},Kg={sizeType:"custom",value:700,min:400,max:700};function Ao(e,t){return{widthPx:e,heightPx:e*t}}function Rr(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 cs(e,t,n,i){const{heightPx:o}=Ao(n,i);return Rr(e/2,t/2,e,t,n,o)}function ll(e,t,n){for(const i of n){const{heightPx:o}=Ao(i.widthPx,i.aspectRatio),s=i.widthPx/2,a=o/2;if(e>=i.x-s&&e<=i.x+s&&t>=i.y-a&&t<=i.y+a)return!0}return!1}function Gg(e,t,n,i,o,s,a,u){if(o==="system")return"none";const c=i.getBoundingClientRect(),m=document.elementFromPoint(c.left+e,c.top+t);return m&&m.closest("a")?"none":ll(e,t,n)||s==="area"?a??"none":u??"none"}function ds(e,t,n){var u;const{sizeType:i,value:o,min:s,max:a}=t;return i==="custom"?o:i==="as is"?((u=n.get(e))==null?void 0:u.naturalWidth)??o:Math.round(Math.random()*(a-s)+s)}function Ug(e){return`
|
|
12399
|
-
.${e}-root {
|
|
12400
|
-
position: absolute;
|
|
12401
|
-
top: 0;
|
|
12402
|
-
left: 0;
|
|
12403
|
-
width: 100%;
|
|
12404
|
-
height: 100%;
|
|
12405
|
-
overflow: hidden;
|
|
12406
|
-
}
|
|
12407
|
-
.${e}-wrapper {
|
|
12408
|
-
position: absolute;
|
|
12409
|
-
transform: translate(-50%, -50%);
|
|
12410
|
-
height: auto;
|
|
12411
|
-
}
|
|
12412
|
-
.${e}-image {
|
|
12413
|
-
display: block;
|
|
12414
|
-
width: 100%;
|
|
12415
|
-
height: auto;
|
|
12416
|
-
object-fit: cover;
|
|
12417
|
-
position: relative;
|
|
12418
|
-
user-select: none;
|
|
12419
|
-
pointer-events: none;
|
|
12420
|
-
}
|
|
12421
|
-
.${e}-link {
|
|
12422
|
-
width: 100%;
|
|
12423
|
-
display: block;
|
|
12424
|
-
}
|
|
12425
|
-
.${e}-cursor {
|
|
12426
|
-
position: absolute;
|
|
12427
|
-
top: 0;
|
|
12428
|
-
left: 0;
|
|
12429
|
-
pointer-events: none;
|
|
12430
|
-
width: 32px;
|
|
12431
|
-
height: 32px;
|
|
12432
|
-
}
|
|
12433
|
-
`}function Xg(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 Yg(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Xg(i)]));return new Map(n)}function Jg({settings:e,content:t=[],isEditor:n}){const{prefix:i}=M.useScopedStyles(),[o,s]=l.useState(null),[a,u]=l.useState([]),[c,m]=l.useState(0),p=l.useRef(0),[R,x]=l.useState({x:0,y:0}),[L,g]=l.useState("none"),y=l.useRef({x:0,y:0}),[w,$]=l.useState(!1),[S,C]=l.useState(!1),k=l.useRef(new Map),{imageSize:P=Kg,cursor:H="system",target:I="area",position:E="random",visible:Z="all",defaultCursor:v=null,hoverCursor:A=null}=e,B=l.useMemo(()=>Ug(i),[i]),V=l.useCallback((_,N,T=a)=>{if(!o)return;const K=o.getBoundingClientRect(),Y=_-K.left,Q=N-K.top;x({x:Y,y:Q}),g(Gg(Y,Q,T,o,H,I,A,v))},[o,a,H,I,A,v]);l.useEffect(()=>{const _=[...t.map(T=>T.image.url),v,A].filter(T=>!!T);if(_.length===0){k.current=new Map,C(!0);return}let N=!1;return C(!1),Yg(_).then(T=>{N||(k.current=T,C(!0))}),()=>{N=!0}},[t,v,A]),l.useEffect(()=>{if(!o)return;const _=T=>{T.stopPropagation(),y.current={x:T.clientX,y:T.clientY},V(T.clientX,T.clientY)},N=()=>{w&&V(y.current.x,y.current.y)};return o.addEventListener("mousemove",_),window.addEventListener("scroll",N,!0),()=>{o.removeEventListener("mousemove",_),window.removeEventListener("scroll",N,!0)}},[o,w,V]),l.useEffect(()=>{!o||!w||V(y.current.x,y.current.y)},[a,o,w,V]),l.useEffect(()=>{w||g("none")},[w]);const ne=(_,N,T,K={})=>{var ae;const Y=((ae=k.current.get(_.image.url))==null?void 0:ae.aspectRatio)??1,Q=ds(_.image.url,P,k.current),{heightPx:O}=Ao(Q,Y);let oe=0,h=0;return E==="same"?{x:oe,y:h}=cs(N,T,Q,Y):(oe=K.x??Math.random()*N,h=K.y??Math.random()*T,{x:oe,y:h}=Rr(oe,h,N,T,Q,O)),{id:p.current++,url:_.image.url,link:_.link,name:_.image.name,x:oe,y:h,xRatio:oe/N,yRatio:h/T,aspectRatio:Y,widthPx:Q}},ce=()=>{if(!o)return;const _=o.getBoundingClientRect(),N=_.width,T=_.height;N===0||T===0||u(K=>K.length===0?K:K.map(Y=>{const Q=P.sizeType==="random"?Y.widthPx:ds(Y.url,P,k.current),{heightPx:O}=Ao(Q,Y.aspectRatio);if(E==="same"){const{x:ae,y:ye}=cs(N,T,Q,Y.aspectRatio);return{...Y,x:ae,y:ye,widthPx:Q}}const{x:oe,y:h}=Rr(Y.xRatio*N,Y.yRatio*T,N,T,Q,O);return{...Y,x:oe,y:h,widthPx:Q}}))};l.useEffect(()=>{if(!o||t.length===0||!S)return;const _=o.getBoundingClientRect(),N=_.width,T=_.height,K=ne(t[0],N,T);u([K]),m(1)},[P,E,o,t,S]),l.useEffect(()=>{if(!o)return;ce();const _=new ResizeObserver(ce);return _.observe(o),window.addEventListener("resize",ce),()=>{_.disconnect(),window.removeEventListener("resize",ce)}},[o,E,P,a.length]),l.useEffect(()=>{Z==="last One"&&u(_=>_.length>0?[_[_.length-1]]:[])},[Z]);const X=_=>{if(!o||t.length===0||!S)return;const N=o.getBoundingClientRect(),T=_.clientX-N.left,K=_.clientY-N.top;if(I==="image"&&!ll(T,K,a))return;let Y=0,Q=0;E==="on Click"?(Y=T,Q=K):E==="same"?(Y=N.width/2,Q=N.height/2):(Y=Math.random()*N.width,Q=Math.random()*N.height);const O=t[c],oe=ne(O,N.width,N.height,{x:Y,y:Q}),h=Z==="all"?[...a,oe]:[oe];u(h),m(ae=>ae>=t.length-1?0:ae+1),V(_.clientX,_.clientY,h)},j=H==="custom"&&L!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:B}}),r.jsxs("div",{ref:s,onClick:X,onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),className:`${i}-root`,style:{cursor:j?"none":"default"},children:[a.map(_=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${_.y}px`,left:`${_.x}px`,width:`${_.widthPx}px`,cursor:j?"none":"default"},children:I==="area"&&_.link?r.jsx("a",{href:_.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:_.url,alt:_.name,className:`${i}-image`})}):r.jsx("img",{src:_.url,alt:_.name,className:`${i}-image`})},_.id)),w&&j&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${R.x}px`,top:`${R.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${L}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Zg=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
12434
|
-
import { CommonComponentProps } from '../props';
|
|
12435
|
-
import { useScopedStyles } from '../utils/index';
|
|
12436
|
-
|
|
12437
|
-
type ClickGallerieItem = {
|
|
12438
|
-
image: {
|
|
12439
|
-
url: string;
|
|
12440
|
-
name: string;
|
|
12441
|
-
};
|
|
12442
|
-
link: string;
|
|
12443
|
-
};
|
|
12444
|
-
|
|
12445
|
-
type ImageSizeSettings = {
|
|
12446
|
-
sizeType: 'custom' | 'as is' | 'random';
|
|
12447
|
-
value: number;
|
|
12448
|
-
min: number;
|
|
12449
|
-
max: number;
|
|
12450
|
-
};
|
|
12451
|
-
|
|
12452
|
-
type ClickGallerieSettings = {
|
|
12453
|
-
imageSize?: ImageSizeSettings;
|
|
12454
|
-
cursor?: 'system' | 'custom';
|
|
12455
|
-
target?: 'area' | 'image';
|
|
12456
|
-
position?: 'random' | 'same' | 'on Click';
|
|
12457
|
-
visible?: 'all' | 'last One';
|
|
12458
|
-
defaultCursor?: string | null;
|
|
12459
|
-
hoverCursor?: string | null;
|
|
12460
|
-
};
|
|
12461
|
-
|
|
12462
|
-
type ClickGallerieProps = {
|
|
12463
|
-
settings: ClickGallerieSettings;
|
|
12464
|
-
content?: ClickGallerieItem[];
|
|
12465
|
-
isEditor?: boolean;
|
|
12466
|
-
} & CommonComponentProps;
|
|
12467
|
-
|
|
12468
|
-
type ImageMeta = {
|
|
12469
|
-
aspectRatio: number;
|
|
12470
|
-
naturalWidth: number;
|
|
12471
|
-
};
|
|
12472
|
-
|
|
12473
|
-
interface PlacedImage {
|
|
12474
|
-
id: number;
|
|
12475
|
-
url: string;
|
|
12476
|
-
link: string;
|
|
12477
|
-
name: string;
|
|
12478
|
-
x: number;
|
|
12479
|
-
y: number;
|
|
12480
|
-
xRatio: number;
|
|
12481
|
-
yRatio: number;
|
|
12482
|
-
aspectRatio: number;
|
|
12483
|
-
widthPx: number;
|
|
12484
|
-
}
|
|
12485
|
-
|
|
12486
|
-
const DEFAULT_IMAGE_SIZE: ImageSizeSettings = {
|
|
12487
|
-
sizeType: 'custom',
|
|
12488
|
-
value: 700,
|
|
12489
|
-
min: 400,
|
|
12490
|
-
max: 700,
|
|
12491
|
-
};
|
|
12492
|
-
|
|
12493
|
-
function getImageDimensions(
|
|
12494
|
-
widthPx: number,
|
|
12495
|
-
aspectRatio: number,
|
|
12496
|
-
): { widthPx: number; heightPx: number } {
|
|
12497
|
-
return {
|
|
12498
|
-
widthPx,
|
|
12499
|
-
heightPx: widthPx * aspectRatio,
|
|
12500
|
-
};
|
|
12501
|
-
}
|
|
12502
|
-
|
|
12503
|
-
function clampPosition(
|
|
12504
|
-
x: number,
|
|
12505
|
-
y: number,
|
|
12506
|
-
containerWidth: number,
|
|
12507
|
-
containerHeight: number,
|
|
12508
|
-
widthPx: number,
|
|
12509
|
-
heightPx: number,
|
|
12510
|
-
): { x: number; y: number } {
|
|
12511
|
-
return {
|
|
12512
|
-
x: Math.min(Math.max(x, widthPx / 2), containerWidth - widthPx / 2),
|
|
12513
|
-
y: Math.min(Math.max(y, heightPx / 2), containerHeight - heightPx / 2),
|
|
12514
|
-
};
|
|
12515
|
-
}
|
|
12516
|
-
|
|
12517
|
-
function getSamePosition(
|
|
12518
|
-
containerWidth: number,
|
|
12519
|
-
containerHeight: number,
|
|
12520
|
-
widthPx: number,
|
|
12521
|
-
aspectRatio: number,
|
|
12522
|
-
): { x: number; y: number } {
|
|
12523
|
-
const { heightPx } = getImageDimensions(widthPx, aspectRatio);
|
|
12524
|
-
|
|
12525
|
-
return clampPosition(
|
|
12526
|
-
containerWidth / 2,
|
|
12527
|
-
containerHeight / 2,
|
|
12528
|
-
containerWidth,
|
|
12529
|
-
containerHeight,
|
|
12530
|
-
widthPx,
|
|
12531
|
-
heightPx,
|
|
12532
|
-
);
|
|
12533
|
-
}
|
|
12534
|
-
|
|
12535
|
-
function isMouseOverImage(
|
|
12536
|
-
mouseX: number,
|
|
12537
|
-
mouseY: number,
|
|
12538
|
-
placedImages: PlacedImage[],
|
|
12539
|
-
) {
|
|
12540
|
-
for (const img of placedImages) {
|
|
12541
|
-
const { heightPx } = getImageDimensions(img.widthPx, img.aspectRatio);
|
|
12542
|
-
const halfW = img.widthPx / 2;
|
|
12543
|
-
const halfH = heightPx / 2;
|
|
12544
|
-
|
|
12545
|
-
if (
|
|
12546
|
-
mouseX >= img.x - halfW
|
|
12547
|
-
&& mouseX <= img.x + halfW
|
|
12548
|
-
&& mouseY >= img.y - halfH
|
|
12549
|
-
&& mouseY <= img.y + halfH
|
|
12550
|
-
) {
|
|
12551
|
-
return true;
|
|
12552
|
-
}
|
|
12553
|
-
}
|
|
12554
|
-
return false;
|
|
12555
|
-
}
|
|
12556
|
-
|
|
12557
|
-
function resolveCustomCursorImg(
|
|
12558
|
-
x: number,
|
|
12559
|
-
y: number,
|
|
12560
|
-
placedImages: PlacedImage[],
|
|
12561
|
-
divRef: HTMLDivElement,
|
|
12562
|
-
cursorMode: 'system' | 'custom',
|
|
12563
|
-
target: 'area' | 'image',
|
|
12564
|
-
hoverCursor: string | null,
|
|
12565
|
-
defaultCursor: string | null,
|
|
12566
|
-
): string {
|
|
12567
|
-
if (cursorMode === 'system') {
|
|
12568
|
-
return 'none';
|
|
12569
|
-
}
|
|
12570
|
-
|
|
12571
|
-
const rect = divRef.getBoundingClientRect();
|
|
12572
|
-
const el = document.elementFromPoint(rect.left + x, rect.top + y);
|
|
12573
|
-
|
|
12574
|
-
if (el && el.closest('a')) {
|
|
12575
|
-
return 'none';
|
|
12576
|
-
}
|
|
12577
|
-
|
|
12578
|
-
return isMouseOverImage(x, y, placedImages) || target === 'area'
|
|
12579
|
-
? hoverCursor ?? 'none'
|
|
12580
|
-
: defaultCursor ?? 'none';
|
|
12581
|
-
}
|
|
12582
|
-
|
|
12583
|
-
function resolveImageWidthPx(
|
|
12584
|
-
url: string,
|
|
12585
|
-
imageSize: ImageSizeSettings,
|
|
12586
|
-
metaByUrl: Map<string, ImageMeta>,
|
|
12587
|
-
): number {
|
|
12588
|
-
const { sizeType, value, min, max } = imageSize;
|
|
12589
|
-
|
|
12590
|
-
if (sizeType === 'custom') {
|
|
12591
|
-
return value;
|
|
12592
|
-
}
|
|
12593
|
-
|
|
12594
|
-
if (sizeType === 'as is') {
|
|
12595
|
-
return metaByUrl.get(url)?.naturalWidth ?? value;
|
|
12596
|
-
}
|
|
12597
|
-
|
|
12598
|
-
return Math.round(Math.random() * (max - min) + min);
|
|
12599
|
-
}
|
|
12600
|
-
|
|
12601
|
-
function getCSS(P: string): string {
|
|
12602
|
-
return \`
|
|
12603
|
-
.\${P}-root {
|
|
12604
|
-
position: absolute;
|
|
12605
|
-
top: 0;
|
|
12606
|
-
left: 0;
|
|
12607
|
-
width: 100%;
|
|
12608
|
-
height: 100%;
|
|
12609
|
-
overflow: hidden;
|
|
12610
|
-
}
|
|
12611
|
-
.\${P}-wrapper {
|
|
12612
|
-
position: absolute;
|
|
12613
|
-
transform: translate(-50%, -50%);
|
|
12614
|
-
height: auto;
|
|
12615
|
-
}
|
|
12616
|
-
.\${P}-image {
|
|
12617
|
-
display: block;
|
|
12618
|
-
width: 100%;
|
|
12619
|
-
height: auto;
|
|
12620
|
-
object-fit: cover;
|
|
12621
|
-
position: relative;
|
|
12622
|
-
user-select: none;
|
|
12623
|
-
pointer-events: none;
|
|
12624
|
-
}
|
|
12625
|
-
.\${P}-link {
|
|
12626
|
-
width: 100%;
|
|
12627
|
-
display: block;
|
|
12628
|
-
}
|
|
12629
|
-
.\${P}-cursor {
|
|
12630
|
-
position: absolute;
|
|
12631
|
-
top: 0;
|
|
12632
|
-
left: 0;
|
|
12633
|
-
pointer-events: none;
|
|
12634
|
-
width: 32px;
|
|
12635
|
-
height: 32px;
|
|
12636
|
-
}
|
|
12637
|
-
\`;
|
|
12638
|
-
}
|
|
12639
|
-
|
|
12640
|
-
function preloadImage(url: string): Promise<ImageMeta> {
|
|
12641
|
-
return new Promise((resolve) => {
|
|
12642
|
-
const img = new Image();
|
|
12643
|
-
img.onload = () => {
|
|
12644
|
-
resolve({
|
|
12645
|
-
aspectRatio: img.naturalHeight / img.naturalWidth,
|
|
12646
|
-
naturalWidth: img.naturalWidth,
|
|
12647
|
-
});
|
|
12648
|
-
};
|
|
12649
|
-
img.onerror = () => {
|
|
12650
|
-
resolve({ aspectRatio: 1, naturalWidth: 700 });
|
|
12651
|
-
};
|
|
12652
|
-
img.src = url;
|
|
12653
|
-
});
|
|
12654
|
-
}
|
|
12655
|
-
|
|
12656
|
-
async function preloadImages(urls: string[]): Promise<Map<string, ImageMeta>> {
|
|
12657
|
-
const uniqueUrls = [...new Set(urls.filter(Boolean))];
|
|
12658
|
-
const entries = await Promise.all(
|
|
12659
|
-
uniqueUrls.map(async (url) => [url, await preloadImage(url)] as const),
|
|
12660
|
-
);
|
|
12661
|
-
|
|
12662
|
-
return new Map(entries);
|
|
12663
|
-
}
|
|
12664
|
-
|
|
12665
|
-
export function ClickGallerie({ settings, content = [], isEditor }: ClickGallerieProps) {
|
|
12666
|
-
const { prefix: P } = useScopedStyles();
|
|
12667
|
-
const [divRef, setDivRef] = useState<HTMLDivElement | null>(null);
|
|
12668
|
-
const [placedImages, setPlacedImages] = useState<PlacedImage[]>([]);
|
|
12669
|
-
const [counter, setCounter] = useState(0);
|
|
12670
|
-
const imageIdCounter = useRef(0);
|
|
12671
|
-
|
|
12672
|
-
const [cursorCenter, setCursorCenter] = useState({ x: 0, y: 0 });
|
|
12673
|
-
const [customCursorImg, setCustomCursorImg] = useState('none');
|
|
12674
|
-
const lastMousePos = useRef({ x: 0, y: 0 });
|
|
12675
|
-
const [isInside, setIsInside] = useState(false);
|
|
12676
|
-
const [imagesReady, setImagesReady] = useState(false);
|
|
12677
|
-
const imageMetaByUrlRef = useRef<Map<string, ImageMeta>>(new Map());
|
|
12678
|
-
|
|
12679
|
-
const {
|
|
12680
|
-
imageSize = DEFAULT_IMAGE_SIZE,
|
|
12681
|
-
cursor: cursorMode = 'system',
|
|
12682
|
-
target = 'area',
|
|
12683
|
-
position = 'random',
|
|
12684
|
-
visible = 'all',
|
|
12685
|
-
defaultCursor = null,
|
|
12686
|
-
hoverCursor = null,
|
|
12687
|
-
} = settings;
|
|
12688
|
-
|
|
12689
|
-
const scopedCss = useMemo(() => getCSS(P), [P]);
|
|
12690
|
-
|
|
12691
|
-
const updateCursorFromMousePosition = useCallback((
|
|
12692
|
-
clientX: number,
|
|
12693
|
-
clientY: number,
|
|
12694
|
-
images = placedImages,
|
|
12695
|
-
) => {
|
|
12696
|
-
if (!divRef) return;
|
|
12697
|
-
|
|
12698
|
-
const rect = divRef.getBoundingClientRect();
|
|
12699
|
-
const x = clientX - rect.left;
|
|
12700
|
-
const y = clientY - rect.top;
|
|
12701
|
-
|
|
12702
|
-
setCursorCenter({ x, y });
|
|
12703
|
-
setCustomCursorImg(
|
|
12704
|
-
resolveCustomCursorImg(x, y, images, divRef, cursorMode, target, hoverCursor, defaultCursor),
|
|
12705
|
-
);
|
|
12706
|
-
}, [divRef, placedImages, cursorMode, target, hoverCursor, defaultCursor]);
|
|
12707
|
-
|
|
12708
|
-
useEffect(() => {
|
|
12709
|
-
const urls = [
|
|
12710
|
-
...content.map((item) => item.image.url),
|
|
12711
|
-
defaultCursor,
|
|
12712
|
-
hoverCursor,
|
|
12713
|
-
].filter((url): url is string => Boolean(url));
|
|
12714
|
-
|
|
12715
|
-
if (urls.length === 0) {
|
|
12716
|
-
imageMetaByUrlRef.current = new Map();
|
|
12717
|
-
setImagesReady(true);
|
|
12718
|
-
return;
|
|
12719
|
-
}
|
|
12720
|
-
|
|
12721
|
-
let cancelled = false;
|
|
12722
|
-
setImagesReady(false);
|
|
12723
|
-
|
|
12724
|
-
preloadImages(urls).then((map) => {
|
|
12725
|
-
if (cancelled) return;
|
|
12726
|
-
imageMetaByUrlRef.current = map;
|
|
12727
|
-
setImagesReady(true);
|
|
12728
|
-
});
|
|
12729
|
-
|
|
12730
|
-
return () => {
|
|
12731
|
-
cancelled = true;
|
|
12732
|
-
};
|
|
12733
|
-
}, [content, defaultCursor, hoverCursor]);
|
|
12734
|
-
|
|
12735
|
-
useEffect(() => {
|
|
12736
|
-
if (!divRef) return;
|
|
12737
|
-
|
|
12738
|
-
const mouseMove = (e: MouseEvent) => {
|
|
12739
|
-
e.stopPropagation();
|
|
12740
|
-
lastMousePos.current = { x: e.clientX, y: e.clientY };
|
|
12741
|
-
updateCursorFromMousePosition(e.clientX, e.clientY);
|
|
12742
|
-
};
|
|
12743
|
-
|
|
12744
|
-
const handleScroll = () => {
|
|
12745
|
-
if (!isInside) return;
|
|
12746
|
-
updateCursorFromMousePosition(lastMousePos.current.x, lastMousePos.current.y);
|
|
12747
|
-
};
|
|
12748
|
-
|
|
12749
|
-
divRef.addEventListener('mousemove', mouseMove);
|
|
12750
|
-
window.addEventListener('scroll', handleScroll, true);
|
|
12751
|
-
|
|
12752
|
-
return () => {
|
|
12753
|
-
divRef.removeEventListener('mousemove', mouseMove);
|
|
12754
|
-
window.removeEventListener('scroll', handleScroll, true);
|
|
12755
|
-
};
|
|
12756
|
-
}, [divRef, isInside, updateCursorFromMousePosition]);
|
|
12757
|
-
|
|
12758
|
-
useEffect(() => {
|
|
12759
|
-
if (!divRef || !isInside) return;
|
|
12760
|
-
updateCursorFromMousePosition(lastMousePos.current.x, lastMousePos.current.y);
|
|
12761
|
-
}, [placedImages, divRef, isInside, updateCursorFromMousePosition]);
|
|
12762
|
-
|
|
12763
|
-
useEffect(() => {
|
|
12764
|
-
if (!isInside) {
|
|
12765
|
-
setCustomCursorImg('none');
|
|
12766
|
-
}
|
|
12767
|
-
}, [isInside]);
|
|
12768
|
-
|
|
12769
|
-
const createNewImage = (
|
|
12770
|
-
imgData: ClickGallerieItem,
|
|
12771
|
-
containerWidth: number,
|
|
12772
|
-
containerHeight: number,
|
|
12773
|
-
clickPosition: { x?: number; y?: number } = {},
|
|
12774
|
-
): PlacedImage => {
|
|
12775
|
-
const aspectRatio = imageMetaByUrlRef.current.get(imgData.image.url)?.aspectRatio ?? 1;
|
|
12776
|
-
const widthPx = resolveImageWidthPx(imgData.image.url, imageSize, imageMetaByUrlRef.current);
|
|
12777
|
-
const { heightPx } = getImageDimensions(widthPx, aspectRatio);
|
|
12778
|
-
|
|
12779
|
-
let x = 0;
|
|
12780
|
-
let y = 0;
|
|
12781
|
-
if (position === 'same') {
|
|
12782
|
-
({ x, y } = getSamePosition(containerWidth, containerHeight, widthPx, aspectRatio));
|
|
12783
|
-
} else {
|
|
12784
|
-
x = clickPosition.x ?? Math.random() * containerWidth;
|
|
12785
|
-
y = clickPosition.y ?? Math.random() * containerHeight;
|
|
12786
|
-
({ x, y } = clampPosition(x, y, containerWidth, containerHeight, widthPx, heightPx));
|
|
12787
|
-
}
|
|
12788
|
-
|
|
12789
|
-
return {
|
|
12790
|
-
id: imageIdCounter.current++,
|
|
12791
|
-
url: imgData.image.url,
|
|
12792
|
-
link: imgData.link,
|
|
12793
|
-
name: imgData.image.name,
|
|
12794
|
-
x,
|
|
12795
|
-
y,
|
|
12796
|
-
xRatio: x / containerWidth,
|
|
12797
|
-
yRatio: y / containerHeight,
|
|
12798
|
-
aspectRatio,
|
|
12799
|
-
widthPx,
|
|
12800
|
-
};
|
|
12801
|
-
};
|
|
12802
|
-
|
|
12803
|
-
const repositionPlacedImages = () => {
|
|
12804
|
-
if (!divRef) return;
|
|
12805
|
-
|
|
12806
|
-
const rect = divRef.getBoundingClientRect();
|
|
12807
|
-
const containerWidth = rect.width;
|
|
12808
|
-
const containerHeight = rect.height;
|
|
12809
|
-
if (containerWidth === 0 || containerHeight === 0) return;
|
|
12810
|
-
|
|
12811
|
-
setPlacedImages((prev) => {
|
|
12812
|
-
if (prev.length === 0) return prev;
|
|
12813
|
-
|
|
12814
|
-
return prev.map((img) => {
|
|
12815
|
-
const widthPx = imageSize.sizeType === 'random'
|
|
12816
|
-
? img.widthPx
|
|
12817
|
-
: resolveImageWidthPx(img.url, imageSize, imageMetaByUrlRef.current);
|
|
12818
|
-
const { heightPx } = getImageDimensions(widthPx, img.aspectRatio);
|
|
12819
|
-
|
|
12820
|
-
if (position === 'same') {
|
|
12821
|
-
const { x, y } = getSamePosition(containerWidth, containerHeight, widthPx, img.aspectRatio);
|
|
12822
|
-
return { ...img, x, y, widthPx };
|
|
12823
|
-
}
|
|
12824
|
-
|
|
12825
|
-
const { x, y } = clampPosition(
|
|
12826
|
-
img.xRatio * containerWidth,
|
|
12827
|
-
img.yRatio * containerHeight,
|
|
12828
|
-
containerWidth,
|
|
12829
|
-
containerHeight,
|
|
12830
|
-
widthPx,
|
|
12831
|
-
heightPx,
|
|
12832
|
-
);
|
|
12833
|
-
|
|
12834
|
-
return { ...img, x, y, widthPx };
|
|
12835
|
-
});
|
|
12836
|
-
});
|
|
12837
|
-
};
|
|
12838
|
-
|
|
12839
|
-
useEffect(() => {
|
|
12840
|
-
if (!divRef || content.length === 0 || !imagesReady) return;
|
|
12841
|
-
|
|
12842
|
-
const rect = divRef.getBoundingClientRect();
|
|
12843
|
-
const containerWidth = rect.width;
|
|
12844
|
-
const containerHeight = rect.height;
|
|
12845
|
-
|
|
12846
|
-
const newImg = createNewImage(content[0], containerWidth, containerHeight);
|
|
12847
|
-
|
|
12848
|
-
setPlacedImages([newImg]);
|
|
12849
|
-
setCounter(1);
|
|
12850
|
-
}, [imageSize, position, divRef, content, imagesReady]);
|
|
12851
|
-
|
|
12852
|
-
useEffect(() => {
|
|
12853
|
-
if (!divRef) return;
|
|
12854
|
-
|
|
12855
|
-
repositionPlacedImages();
|
|
12856
|
-
|
|
12857
|
-
const ro = new ResizeObserver(repositionPlacedImages);
|
|
12858
|
-
ro.observe(divRef);
|
|
12859
|
-
window.addEventListener('resize', repositionPlacedImages);
|
|
12860
|
-
|
|
12861
|
-
return () => {
|
|
12862
|
-
ro.disconnect();
|
|
12863
|
-
window.removeEventListener('resize', repositionPlacedImages);
|
|
12864
|
-
};
|
|
12865
|
-
}, [divRef, position, imageSize, placedImages.length]);
|
|
12866
|
-
|
|
12867
|
-
useEffect(() => {
|
|
12868
|
-
if (visible === 'last One') {
|
|
12869
|
-
setPlacedImages((prev) => (prev.length > 0 ? [prev[prev.length - 1]] : []));
|
|
12870
|
-
}
|
|
12871
|
-
}, [visible]);
|
|
12872
|
-
|
|
12873
|
-
const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
12874
|
-
if (!divRef || content.length === 0 || !imagesReady) return;
|
|
12875
|
-
|
|
12876
|
-
const rect = divRef.getBoundingClientRect();
|
|
12877
|
-
const clickX = e.clientX - rect.left;
|
|
12878
|
-
const clickY = e.clientY - rect.top;
|
|
12879
|
-
|
|
12880
|
-
if (target === 'image' && !isMouseOverImage(clickX, clickY, placedImages)) return;
|
|
12881
|
-
|
|
12882
|
-
let x = 0;
|
|
12883
|
-
let y = 0;
|
|
12884
|
-
if (position === 'on Click') {
|
|
12885
|
-
x = clickX;
|
|
12886
|
-
y = clickY;
|
|
12887
|
-
} else if (position === 'same') {
|
|
12888
|
-
x = rect.width / 2;
|
|
12889
|
-
y = rect.height / 2;
|
|
12890
|
-
} else {
|
|
12891
|
-
x = Math.random() * rect.width;
|
|
12892
|
-
y = Math.random() * rect.height;
|
|
12893
|
-
}
|
|
12894
|
-
|
|
12895
|
-
const imgData = content[counter];
|
|
12896
|
-
const newImage = createNewImage(imgData, rect.width, rect.height, { x, y });
|
|
12897
|
-
const nextPlacedImages = visible === 'all' ? [...placedImages, newImage] : [newImage];
|
|
12898
|
-
|
|
12899
|
-
setPlacedImages(nextPlacedImages);
|
|
12900
|
-
setCounter((prev) => (prev >= content.length - 1 ? 0 : prev + 1));
|
|
12901
|
-
updateCursorFromMousePosition(e.clientX, e.clientY, nextPlacedImages);
|
|
12902
|
-
};
|
|
12903
|
-
|
|
12904
|
-
const useCustomCursor = cursorMode === 'custom' && customCursorImg !== 'none';
|
|
12905
|
-
|
|
12906
|
-
return (
|
|
12907
|
-
<>
|
|
12908
|
-
<style dangerouslySetInnerHTML={{ __html: scopedCss }} />
|
|
12909
|
-
<div
|
|
12910
|
-
ref={setDivRef}
|
|
12911
|
-
onClick={handleClick}
|
|
12912
|
-
onMouseEnter={() => setIsInside(true)}
|
|
12913
|
-
onMouseLeave={() => setIsInside(false)}
|
|
12914
|
-
className={\`\${P}-root\`}
|
|
12915
|
-
style={{ cursor: useCustomCursor ? 'none' : 'default' }}
|
|
12916
|
-
>
|
|
12917
|
-
{placedImages.map((img) => (
|
|
12918
|
-
<div
|
|
12919
|
-
className={\`\${P}-wrapper\`}
|
|
12920
|
-
key={img.id}
|
|
12921
|
-
style={{
|
|
12922
|
-
top: \`\${img.y}px\`,
|
|
12923
|
-
left: \`\${img.x}px\`,
|
|
12924
|
-
width: \`\${img.widthPx}px\`,
|
|
12925
|
-
cursor: useCustomCursor ? 'none' : 'default',
|
|
12926
|
-
}}
|
|
12927
|
-
>
|
|
12928
|
-
{target === 'area' && img.link ? (
|
|
12929
|
-
<a href={img.link} target="_blank" rel="noreferrer" className={\`\${P}-link\`}>
|
|
12930
|
-
<img src={img.url} alt={img.name} className={\`\${P}-image\`} />
|
|
12931
|
-
</a>
|
|
12932
|
-
) : (
|
|
12933
|
-
<img src={img.url} alt={img.name} className={\`\${P}-image\`} />
|
|
12934
|
-
)}
|
|
12935
|
-
</div>
|
|
12936
|
-
))}
|
|
12937
|
-
{isInside && useCustomCursor && (
|
|
12938
|
-
<div
|
|
12939
|
-
className={\`\${P}-cursor\`}
|
|
12940
|
-
style={{
|
|
12941
|
-
left: \`\${cursorCenter.x}px\`,
|
|
12942
|
-
top: \`\${cursorCenter.y}px\`,
|
|
12943
|
-
transform: 'translate(-50%, -50%)',
|
|
12944
|
-
backgroundImage: \`url('\${customCursorImg}')\`,
|
|
12945
|
-
backgroundSize: 'cover',
|
|
12946
|
-
backgroundPosition: 'center',
|
|
12947
|
-
}}
|
|
12948
|
-
/>
|
|
12949
|
-
)}
|
|
12950
|
-
</div>
|
|
12951
|
-
</>
|
|
12952
|
-
);
|
|
12953
|
-
}
|
|
12954
|
-
`,Qg={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/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.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"]}]}]},eh={element:Jg,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:Qg,sourceCode:Zg,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.defaultCursor"},{path:"settings.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},th=[xd,Ed,eh,hu,Cu,_u,Ku,Ju,op,Tp,Em,Wm,vg,qg];exports.components=th;exports.isSchemaV1=ul;
|
|
12398
|
+
`,_g="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>'),Dn={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 Fg(e){const t={};return t[ct(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSettings")]={...Dn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSize")]={...Dn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ct(e,"lineHeight")]={...Dn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ct(e,"letterSpacing")]={...Dn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ct(e,"wordSpacing")]={...Dn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ct(e,"textAlign")]={...Dn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ct(e,"textAppearance")]={...Dn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Wg=yi.reduce((e,t)=>({...e,...Fg(t)}),{}),Ng=yi.reduce((e,t)=>({...e,[ct(t,"fontFamily")]:"Goudy Bookletter 1911",[ct(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ct(t,"letterSpacing")]:0,[ct(t,"wordSpacing")]:0,[ct(t,"textAlign")]:"left",[ct(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function as(e){return yi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ct(n,"fontSize")]=i),o!==void 0&&(t[ct(n,"lineHeight")]=o),t},{})}const Hg=Eg(),Og={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"}},...Wg,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/journal_1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:_g,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...Ng,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.05,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.005,...as({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},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,...as({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:[Hg]}],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:"Dorothy Manners & Julanne Johnston",title2:"by Evans Studio",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_2.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/journal_3.jpg",name:"",objectFit:"contain"}]},{title1:"Inez Nadeau",title2:"Melbourne Spurr",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_4.jpg",name:"",objectFit:"contain"}]},{title1:"Colleen Moore",title2:"Clarence S. Bull",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_5.jpg",name:"",objectFit:"contain"}]},{title1:"Gloria Swanson",title2:"Donald Biddle Keyes",title3:"Screenland",image:[{url:"https://cdn.cntrl.site/component-assets/journal_6.jpg",name:"",objectFit:"contain"}]}]}},Bg={element:kg,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350,height:350},m:{width:300,height:350}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:Og,sourceCode:Mg,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...yi.map(e=>({path:`${ct(e,"fontFamily")}`}))]},fontRelations:{...yi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ct(t,"fontFamily")}`}),{})}},jg=[hd,$d,du,bu,Iu,ju,Ku,Qu,xp,$m,Am,mg,Bg];exports.components=jg;exports.isSchemaV1=al;
|