@cntrl-site/components 1.0.12-alpha.27 → 1.0.12-alpha.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/LightboxStrip/LightboxStrip.d.ts +2 -1
- package/dist/index.js +33 -30
- package/dist/index.mjs +2514 -2497
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("react"),Ne=require("classnames"),T=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Xn=require("react-dom");function qa(e){return e.type==="object"&&e.version===1}const Xa="ControlSlider-module__wrapper___sHEkd",Ya="ControlSlider-module__hoverArrow___A-dOH",Ja="ControlSlider-module__sliderItem___QQSkR",Za="ControlSlider-module__sliderImage___9hRl-",Qa="ControlSlider-module__arrow___05ghY",el="ControlSlider-module__arrowVertical___tBfVN",tl="ControlSlider-module__nextArrow___-30Yc",nl="ControlSlider-module__arrowInner___aEra3",il="ControlSlider-module__arrowIcon___S4ztF",ol="ControlSlider-module__arrowImg___2dwJW",rl="ControlSlider-module__mirror___brd6U",al="ControlSlider-module__pagination___bicLF",ll="ControlSlider-module__paginationInner___bT-P-",sl="ControlSlider-module__paginationVertical___zYqKw",cl="ControlSlider-module__paginationItem___nTRbk",dl="ControlSlider-module__dot___p1Qun",ul="ControlSlider-module__activeDot___LHFaj",pl="ControlSlider-module__paginationInsideBottom___R3FWn",ml="ControlSlider-module__paginationInsideTop___V-qb-",gl="ControlSlider-module__paginationOutsideBottom___14w8D",hl="ControlSlider-module__paginationOutsideTop___SCLqB",fl="ControlSlider-module__paginationInsideLeft___yOBRZ",yl="ControlSlider-module__paginationInsideRight___Rtt3o",vl="ControlSlider-module__paginationOutsideLeft___lahaw",bl="ControlSlider-module__paginationOutsideRight___EtuQa",xl="ControlSlider-module__imgWrapper___UjEgB",Sl="ControlSlider-module__captionBlock___dJ6-j",Cl="ControlSlider-module__captionTextWrapper___HFlpf",$l="ControlSlider-module__captionText___uGBVc",wl="ControlSlider-module__active___WZK4G",Tl="ControlSlider-module__withPointerEvents___t-18M",Ll="ControlSlider-module__topLeftAlignment___zjnGM",El="ControlSlider-module__topCenterAlignment___gD1xW",Il="ControlSlider-module__topRightAlignment___NMapS",Rl="ControlSlider-module__middleLeftAlignment___OnUrY",Pl="ControlSlider-module__middleCenterAlignment___Tdkl0",_l="ControlSlider-module__middleRightAlignment___wEbfX",Al="ControlSlider-module__bottomLeftAlignment___cTP2-",Ml="ControlSlider-module__bottomCenterAlignment___c54fB",kl="ControlSlider-module__bottomRightAlignment___kEwrz",Fl="ControlSlider-module__clickOverlay___DZA28",Wl="ControlSlider-module__contain___pLyq7",Nl="ControlSlider-module__cover___KdDat",ve={wrapper:Xa,hoverArrow:Ya,sliderItem:Ja,sliderImage:Za,arrow:Qa,arrowVertical:el,nextArrow:tl,arrowInner:nl,arrowIcon:il,arrowImg:ol,mirror:rl,pagination:al,paginationInner:ll,paginationVertical:sl,paginationItem:cl,dot:dl,activeDot:ul,paginationInsideBottom:pl,paginationInsideTop:ml,paginationOutsideBottom:gl,paginationOutsideTop:hl,paginationInsideLeft:fl,paginationInsideRight:yl,paginationOutsideLeft:vl,paginationOutsideRight:bl,imgWrapper:xl,captionBlock:Sl,captionTextWrapper:Cl,captionText:$l,active:wl,withPointerEvents:Tl,topLeftAlignment:Ll,topCenterAlignment:El,topRightAlignment:Il,middleLeftAlignment:Rl,middleCenterAlignment:Pl,middleRightAlignment:_l,bottomLeftAlignment:Al,bottomCenterAlignment:Ml,bottomRightAlignment:kl,clickOverlay:Fl,contain:Wl,cover:Nl};function Hl(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 Bl(e,t,n){return t&&Hl(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var tr="(prefers-reduced-motion: reduce)",xn=1,Ol=2,$n=3,_n=4,Yn=5,xi=6,Ii=7,jl={CREATED:xn,MOUNTED:Ol,IDLE:$n,MOVING:_n,SCROLLING:Yn,DRAGGING:xi,DESTROYED:Ii};function Dt(e){e.length=0}function Zt(e,t,n){return Array.prototype.slice.call(e,t,n)}function qe(e){return e.bind.apply(e,[null].concat(Zt(arguments,1)))}var Jr=setTimeout,go=function(){};function nr(e){return requestAnimationFrame(e)}function Fi(e,t){return typeof t===e}function Hn(e){return!Lo(e)&&Fi("object",e)}var To=Array.isArray,Zr=qe(Fi,"function"),Xt=qe(Fi,"string"),Jn=qe(Fi,"undefined");function Lo(e){return e===null}function Qr(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Zn(e){return To(e)?e:[e]}function Et(e,t){Zn(e).forEach(t)}function Eo(e,t){return e.indexOf(t)>-1}function Si(e,t){return e.push.apply(e,Zn(t)),e}function Bt(e,t,n){e&&Et(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Mt(e,t){Bt(e,Xt(t)?t.split(" "):t,!0)}function Qn(e,t){Et(t,e.appendChild.bind(e))}function Io(e,t){Et(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Bn(e,t){return Qr(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function ea(e,t){var n=e?Zt(e.children):[];return t?n.filter(function(i){return Bn(i,t)}):n}function ei(e,t){return t?ea(e,t)[0]:e.firstElementChild}var On=Object.keys;function sn(e,t,n){return e&&(n?On(e).reverse():On(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function jn(e){return Zt(arguments,1).forEach(function(t){sn(t,function(n,i){e[i]=t[i]})}),e}function qt(e){return Zt(arguments,1).forEach(function(t){sn(t,function(n,i){To(n)?e[i]=n.slice():Hn(n)?e[i]=qt({},Hn(e[i])?e[i]:{},n):e[i]=n})}),e}function ir(e,t){Et(t||On(e),function(n){delete e[n]})}function kt(e,t){Et(e,function(n){Et(t,function(i){n&&n.removeAttribute(i)})})}function Ie(e,t,n){Hn(t)?sn(t,function(i,o){Ie(e,o,i)}):Et(e,function(i){Lo(n)||n===""?kt(i,t):i.setAttribute(t,String(n))})}function Sn(e,t,n){var i=document.createElement(e);return t&&(Xt(t)?Mt(i,t):Ie(i,t)),n&&Qn(n,i),i}function It(e,t,n){if(Jn(n))return getComputedStyle(e)[t];Lo(n)||(e.style[t]=""+n)}function zn(e,t){It(e,"display",t)}function ta(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Rt(e,t){return e.getAttribute(t)}function or(e,t){return e&&e.classList.contains(t)}function wt(e){return e.getBoundingClientRect()}function cn(e){Et(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function na(e){return ei(new DOMParser().parseFromString(e,"text/html").body)}function Ht(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ia(e,t){return e&&e.querySelector(t)}function Ro(e,t){return t?Zt(e.querySelectorAll(t)):[]}function Ot(e,t){Bt(e,t,!1)}function ho(e){return e.timeStamp}function nn(e){return Xt(e)?e:e?e+"px":""}var ti="splide",Po="data-"+ti;function Fn(e,t){if(!e)throw new Error("["+ti+"] "+(t||""))}var Yt=Math.min,Ri=Math.max,Pi=Math.floor,Vn=Math.ceil,vt=Math.abs;function oa(e,t,n){return vt(e-t)<n}function Ci(e,t,n,i){var o=Yt(t,n),l=Ri(t,n);return i?o<e&&e<l:o<=e&&e<=l}function yn(e,t,n){var i=Yt(t,n),o=Ri(t,n);return Yt(Ri(i,e),o)}function fo(e){return+(e>0)-+(e<0)}function yo(e,t){return Et(t,function(n){e=e.replace("%s",""+n)}),e}function _o(e){return e<10?"0"+e:""+e}var rr={};function zl(e){return""+e+_o(rr[e]=(rr[e]||0)+1)}function ra(){var e=[];function t(s,d,a,u){o(s,d,function(p,I,x){var b="addEventListener"in p,g=b?p.removeEventListener.bind(p,I,a,u):p.removeListener.bind(p,a);b?p.addEventListener(I,a,u):p.addListener(a),e.push([p,I,x,a,g])})}function n(s,d,a){o(s,d,function(u,p,I){e=e.filter(function(x){return x[0]===u&&x[1]===p&&x[2]===I&&(!a||x[3]===a)?(x[4](),!1):!0})})}function i(s,d,a){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:a}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,a)),s.dispatchEvent(u),u}function o(s,d,a){Et(s,function(u){u&&Et(d,function(p){p.split(" ").forEach(function(I){var x=I.split(".");a(u,x[0],x[1])})})})}function l(){e.forEach(function(s){s[4]()}),Dt(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var Qt="mounted",vo="ready",Gt="move",An="moved",Ao="click",aa="active",la="inactive",sa="visible",ca="hidden",ot="refresh",gt="updated",wn="resize",Wi="resized",da="drag",ua="dragging",pa="dragged",Ni="scroll",un="scrolled",Vl="overflow",Mo="destroy",ma="arrows:mounted",ga="arrows:updated",ha="pagination:mounted",fa="pagination:updated",ko="navigation:mounted",Fo="autoplay:play",ya="autoplay:playing",Wo="autoplay:pause",No="lazyload:loaded",va="sk",ba="sh",_i="ei";function et(e){var t=e?e.event.bus:document.createDocumentFragment(),n=ra();function i(l,s){n.bind(t,Zn(l).join(" "),function(d){s.apply(s,To(d.detail)?d.detail:[])})}function o(l){n.dispatch(t,l,Zt(arguments,1))}return e&&e.event.on(Mo,n.destroy),jn(n,{bus:t,on:i,off:qe(n.unbind,t),emit:o})}function Hi(e,t,n,i){var o=Date.now,l,s=0,d,a=!0,u=0;function p(){if(!a){if(s=e?Yt((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++u>=i))return x();d=nr(p)}}function I(w){w||g(),l=o()-(w?s*e:0),a=!1,d=nr(p)}function x(){a=!0}function b(){l=o(),s=0,n&&n(s)}function g(){d&&cancelAnimationFrame(d),s=0,d=0,a=!0}function h(w){e=w}function R(){return a}return{start:I,rewind:b,pause:x,cancel:g,set:h,isPaused:R}}function Dl(e){var t=e;function n(o){t=o}function i(o){return Eo(Zn(o),t)}return{set:n,is:i}}function Gl(e,t){var n=Hi(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Kl(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=ra(),d=[];function a(){var g=n.mediaQuery==="min";On(o).sort(function(h,R){return g?+h-+R:+R-+h}).forEach(function(h){p(o[h],"("+(g?"min":"max")+"-width:"+h+"px)")}),p(l,tr),I()}function u(g){g&&s.destroy()}function p(g,h){var R=matchMedia(h);s.bind(R,"change",I),d.push([g,R])}function I(){var g=i.is(Ii),h=n.direction,R=d.reduce(function(w,y){return qt(w,y[1].matches?y[0]:{})},{});ir(n),b(R),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):h!==n.direction&&e.refresh()}function x(g){matchMedia(tr).matches&&(g?qt(n,l):ir(n,On(l)))}function b(g,h,R){qt(n,g),h&&qt(Object.getPrototypeOf(n),g),(R||!i.is(xn))&&e.emit(gt,n)}return{setup:a,destroy:u,reduce:x,set:b}}var Bi="Arrow",Oi=Bi+"Left",ji=Bi+"Right",xa=Bi+"Up",Sa=Bi+"Down",ar="rtl",zi="ttb",Zi={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[xa,ji],ArrowRight:[Sa,Oi]};function Ul(e,t,n){function i(l,s,d){d=d||n.direction;var a=d===ar&&!s?1:d===zi?0:-1;return Zi[l]&&Zi[l][a]||l.replace(/width|left|right/i,function(u,p){var I=Zi[u.toLowerCase()][a]||u;return p>0?I.charAt(0).toUpperCase()+I.slice(1):I})}function o(l){return l*(n.direction===ar?1:-1)}return{resolve:i,orient:o}}var jt="role",Cn="tabindex",ql="disabled",Pt="aria-",ni=Pt+"controls",Ca=Pt+"current",lr=Pt+"selected",Tt=Pt+"label",Ho=Pt+"labelledby",$a=Pt+"hidden",Bo=Pt+"orientation",Dn=Pt+"roledescription",sr=Pt+"live",cr=Pt+"busy",dr=Pt+"atomic",Oo=[jt,Cn,ql,ni,Ca,Tt,Ho,$a,Bo,Dn],Ft=ti+"__",en="is-",Qi=ti,ur=Ft+"track",Xl=Ft+"list",Vi=Ft+"slide",wa=Vi+"--clone",Yl=Vi+"__container",jo=Ft+"arrows",Di=Ft+"arrow",Ta=Di+"--prev",La=Di+"--next",Gi=Ft+"pagination",Ea=Gi+"__page",Jl=Ft+"progress",Zl=Jl+"__bar",Ql=Ft+"toggle",es=Ft+"spinner",ts=Ft+"sr",ns=en+"initialized",dn=en+"active",Ia=en+"prev",Ra=en+"next",bo=en+"visible",xo=en+"loading",Pa=en+"focus-in",_a=en+"overflow",is=[dn,bo,Ia,Ra,xo,Pa,_a],os={slide:Vi,clone:wa,arrows:jo,arrow:Di,prev:Ta,next:La,pagination:Gi,page:Ea,spinner:es};function rs(e,t){if(Zr(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Bn(n,t);)n=n.parentElement;return n}var as=5,pr=200,Aa="touchstart mousedown",eo="touchmove mousemove",to="touchend touchcancel mouseup click";function ls(e,t,n){var i=et(e),o=i.on,l=i.bind,s=e.root,d=n.i18n,a={},u=[],p=[],I=[],x,b,g;function h(){$(),N(),y()}function R(){o(ot,w),o(ot,h),o(gt,y),l(document,Aa+" keydown",function(S){g=S.type==="keydown"},{capture:!0}),l(s,"focusin",function(){Bt(s,Pa,!!g)})}function w(S){var P=Oo.concat("style");Dt(u),Ot(s,p),Ot(x,I),kt([x,b],P),kt(s,S?P:["style",Dn])}function y(){Ot(s,p),Ot(x,I),p=M(Qi),I=M(ur),Mt(s,p),Mt(x,I),Ie(s,Tt,n.label),Ie(s,Ho,n.labelledby)}function $(){x=_("."+ur),b=ei(x,"."+Xl),Fn(x&&b,"A track/list element is missing."),Si(u,ea(b,"."+Vi+":not(."+wa+")")),sn({arrows:jo,pagination:Gi,prev:Ta,next:La,bar:Zl,toggle:Ql},function(S,P){a[P]=_("."+S)}),jn(a,{root:s,track:x,list:b,slides:u})}function N(){var S=s.id||zl(ti),P=n.role;s.id=S,x.id=x.id||S+"-track",b.id=b.id||S+"-list",!Rt(s,jt)&&s.tagName!=="SECTION"&&P&&Ie(s,jt,P),Ie(s,Dn,d.carousel),Ie(b,jt,"presentation")}function _(S){var P=ia(s,S);return P&&rs(P,"."+Qi)===s?P:void 0}function M(S){return[S+"--"+n.type,S+"--"+n.direction,n.drag&&S+"--draggable",n.isNavigation&&S+"--nav",S===Qi&&dn]}return jn(a,{setup:h,mount:R,destroy:w})}var Tn="slide",Mn="loop",ii="fade";function ss(e,t,n,i){var o=et(e),l=o.on,s=o.emit,d=o.bind,a=e.Components,u=e.root,p=e.options,I=p.isNavigation,x=p.updateOnMove,b=p.i18n,g=p.pagination,h=p.slideFocus,R=a.Direction.resolve,w=Rt(i,"style"),y=Rt(i,Tt),$=n>-1,N=ei(i,"."+Yl),_;function M(){$||(i.id=u.id+"-slide"+_o(t+1),Ie(i,jt,g?"tabpanel":"group"),Ie(i,Dn,b.slide),Ie(i,Tt,y||yo(b.slideLabel,[t+1,e.length]))),S()}function S(){d(i,"click",qe(s,Ao,W)),d(i,"keydown",qe(s,va,W)),l([An,ba,un],F),l(ko,k),x&&l(Gt,L)}function P(){_=!0,o.destroy(),Ot(i,is),kt(i,Oo),Ie(i,"style",w),Ie(i,Tt,y||"")}function k(){var A=e.splides.map(function(C){var V=C.splide.Components.Slides.getAt(t);return V?V.slide.id:""}).join(" ");Ie(i,Tt,yo(b.slideX,($?n:t)+1)),Ie(i,ni,A),Ie(i,jt,h?"button":""),h&&kt(i,Dn)}function L(){_||F()}function F(){if(!_){var A=e.index;B(),z(),Bt(i,Ia,t===A-1),Bt(i,Ra,t===A+1)}}function B(){var A=Z();A!==or(i,dn)&&(Bt(i,dn,A),Ie(i,Ca,I&&A||""),s(A?aa:la,W))}function z(){var A=m(),C=!A&&(!Z()||$);if(e.state.is([_n,Yn])||Ie(i,$a,C||""),Ie(Ro(i,p.focusableNodes||""),Cn,C?-1:""),h&&Ie(i,Cn,C?-1:0),A!==or(i,bo)&&(Bt(i,bo,A),s(A?sa:ca,W)),!A&&document.activeElement===i){var V=a.Slides.getAt(e.index);V&&ta(V.slide)}}function K(A,C,V){It(V&&N||i,A,C)}function Z(){var A=e.index;return A===t||p.cloneStatus&&A===n}function m(){if(e.is(ii))return Z();var A=wt(a.Elements.track),C=wt(i),V=R("left",!0),q=R("right",!0);return Pi(A[V])<=Vn(C[V])&&Pi(C[q])<=Vn(A[q])}function E(A,C){var V=vt(A-t);return!$&&(p.rewind||e.is(Mn))&&(V=Yt(V,e.length-V)),V<=C}var W={index:t,slideIndex:n,slide:i,container:N,isClone:$,mount:M,destroy:P,update:F,style:K,isWithin:E};return W}function cs(e,t,n){var i=et(e),o=i.on,l=i.emit,s=i.bind,d=t.Elements,a=d.slides,u=d.list,p=[];function I(){x(),o(ot,b),o(ot,x)}function x(){a.forEach(function(F,B){h(F,B,-1)})}function b(){_(function(F){F.destroy()}),Dt(p)}function g(){_(function(F){F.update()})}function h(F,B,z){var K=ss(e,B,z,F);K.mount(),p.push(K),p.sort(function(Z,m){return Z.index-m.index})}function R(F){return F?M(function(B){return!B.isClone}):p}function w(F){var B=t.Controller,z=B.toIndex(F),K=B.hasFocus()?1:n.perPage;return M(function(Z){return Ci(Z.index,z,z+K-1)})}function y(F){return M(F)[0]}function $(F,B){Et(F,function(z){if(Xt(z)&&(z=na(z)),Qr(z)){var K=a[B];K?Io(z,K):Qn(u,z),Mt(z,n.classes.slide),P(z,qe(l,wn))}}),l(ot)}function N(F){cn(M(F).map(function(B){return B.slide})),l(ot)}function _(F,B){R(B).forEach(F)}function M(F){return p.filter(Zr(F)?F:function(B){return Xt(F)?Bn(B.slide,F):Eo(Zn(F),B.index)})}function S(F,B,z){_(function(K){K.style(F,B,z)})}function P(F,B){var z=Ro(F,"img"),K=z.length;K?z.forEach(function(Z){s(Z,"load error",function(){--K||B()})}):B()}function k(F){return F?a.length:p.length}function L(){return p.length>n.perPage}return{mount:I,destroy:b,update:g,register:h,get:R,getIn:w,getAt:y,add:$,remove:N,forEach:_,filter:M,style:S,getLength:k,isEnough:L}}function ds(e,t,n){var i=et(e),o=i.on,l=i.bind,s=i.emit,d=t.Slides,a=t.Direction.resolve,u=t.Elements,p=u.root,I=u.track,x=u.list,b=d.getAt,g=d.style,h,R,w;function y(){$(),l(window,"resize load",Gl(qe(s,wn))),o([gt,ot],$),o(wn,N)}function $(){h=n.direction===zi,It(p,"maxWidth",nn(n.width)),It(I,a("paddingLeft"),_(!1)),It(I,a("paddingRight"),_(!0)),N(!0)}function N(W){var A=wt(p);(W||R.width!==A.width||R.height!==A.height)&&(It(I,"height",M()),g(a("marginRight"),nn(n.gap)),g("width",P()),g("height",k(),!0),R=A,s(Wi),w!==(w=E())&&(Bt(p,_a,w),s(Vl,w)))}function _(W){var A=n.padding,C=a(W?"right":"left");return A&&nn(A[C]||(Hn(A)?0:A))||"0px"}function M(){var W="";return h&&(W=S(),Fn(W,"height or heightRatio is missing."),W="calc("+W+" - "+_(!1)+" - "+_(!0)+")"),W}function S(){return nn(n.height||wt(x).width*n.heightRatio)}function P(){return n.autoWidth?null:nn(n.fixedWidth)||(h?"":L())}function k(){return nn(n.fixedHeight)||(h?n.autoHeight?null:L():S())}function L(){var W=nn(n.gap);return"calc((100%"+(W&&" + "+W)+")/"+(n.perPage||1)+(W&&" - "+W)+")"}function F(){return wt(x)[a("width")]}function B(W,A){var C=b(W||0);return C?wt(C.slide)[a("width")]+(A?0:Z()):0}function z(W,A){var C=b(W);if(C){var V=wt(C.slide)[a("right")],q=wt(x)[a("left")];return vt(V-q)+(A?0:Z())}return 0}function K(W){return z(e.length-1)-z(0)+B(0,W)}function Z(){var W=b(0);return W&&parseFloat(It(W.slide,a("marginRight")))||0}function m(W){return parseFloat(It(I,a("padding"+(W?"Right":"Left"))))||0}function E(){return e.is(ii)||K(!0)>F()}return{mount:y,resize:N,listSize:F,slideSize:B,sliderSize:K,totalSize:z,getPadding:m,isOverflow:E}}var us=2;function ps(e,t,n){var i=et(e),o=i.on,l=t.Elements,s=t.Slides,d=t.Direction.resolve,a=[],u;function p(){o(ot,I),o([gt,wn],b),(u=R())&&(g(u),t.Layout.resize(!0))}function I(){x(),p()}function x(){cn(a),Dt(a),i.destroy()}function b(){var w=R();u!==w&&(u<w||!w)&&i.emit(ot)}function g(w){var y=s.get().slice(),$=y.length;if($){for(;y.length<w;)Si(y,y);Si(y.slice(-w),y.slice(0,w)).forEach(function(N,_){var M=_<w,S=h(N.slide,_);M?Io(S,y[0].slide):Qn(l.list,S),Si(a,S),s.register(S,_-w+(M?0:$),N.index)})}}function h(w,y){var $=w.cloneNode(!0);return Mt($,n.classes.clone),$.id=e.root.id+"-clone"+_o(y+1),$}function R(){var w=n.clones;if(!e.is(Mn))w=0;else if(Jn(w)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),$=y&&Vn(wt(l.track)[d("width")]/y);w=$||n[d("autoWidth")]&&e.length||n.perPage*us}return w}return{mount:p,destroy:x}}function ms(e,t,n){var i=et(e),o=i.on,l=i.emit,s=e.state.set,d=t.Layout,a=d.slideSize,u=d.getPadding,p=d.totalSize,I=d.listSize,x=d.sliderSize,b=t.Direction,g=b.resolve,h=b.orient,R=t.Elements,w=R.list,y=R.track,$;function N(){$=t.Transition,o([Qt,Wi,gt,ot],_)}function _(){t.Controller.isBusy()||(t.Scroll.cancel(),S(e.index),t.Slides.update())}function M(C,V,q,ee){C!==V&&W(C>q)&&(F(),P(L(K(),C>q),!0)),s(_n),l(Gt,V,q,C),$.start(V,function(){s($n),l(An,V,q,C),ee&&ee()})}function S(C){P(z(C,!0))}function P(C,V){if(!e.is(ii)){var q=V?C:k(C);It(w,"transform","translate"+g("X")+"("+q+"px)"),C!==q&&l(ba)}}function k(C){if(e.is(Mn)){var V=B(C),q=V>t.Controller.getEnd(),ee=V<0;(ee||q)&&(C=L(C,q))}return C}function L(C,V){var q=C-E(V),ee=x();return C-=h(ee*(Vn(vt(q)/ee)||1))*(V?1:-1),C}function F(){P(K(),!0),$.cancel()}function B(C){for(var V=t.Slides.get(),q=0,ee=1/0,J=0;J<V.length;J++){var ye=V[J].index,v=vt(z(ye,!0)-C);if(v<=ee)ee=v,q=ye;else break}return q}function z(C,V){var q=h(p(C-1)-m(C));return V?Z(q):q}function K(){var C=g("left");return wt(w)[C]-wt(y)[C]+h(u(!1))}function Z(C){return n.trimSpace&&e.is(Tn)&&(C=yn(C,0,h(x(!0)-I()))),C}function m(C){var V=n.focus;return V==="center"?(I()-a(C,!0))/2:+V*a(C)||0}function E(C){return z(C?t.Controller.getEnd():0,!!n.trimSpace)}function W(C){var V=h(L(K(),C));return C?V>=0:V<=w[g("scrollWidth")]-wt(y)[g("width")]}function A(C,V){V=Jn(V)?K():V;var q=C!==!0&&h(V)<h(E(!1)),ee=C!==!1&&h(V)>h(E(!0));return q||ee}return{mount:N,move:M,jump:S,translate:P,shift:L,cancel:F,toIndex:B,toPosition:z,getPosition:K,getLimit:E,exceededLimit:A,reposition:_}}function gs(e,t,n){var i=et(e),o=i.on,l=i.emit,s=t.Move,d=s.getPosition,a=s.getLimit,u=s.toPosition,p=t.Slides,I=p.isEnough,x=p.getLength,b=n.omitEnd,g=e.is(Mn),h=e.is(Tn),R=qe(K,!1),w=qe(K,!0),y=n.start||0,$,N=y,_,M,S;function P(){k(),o([gt,ot,_i],k),o(Wi,L)}function k(){_=x(!0),M=n.perMove,S=n.perPage,$=W();var v=yn(y,0,b?$:_-1);v!==y&&(y=v,s.reposition())}function L(){$!==W()&&l(_i)}function F(v,U,he){if(!ye()){var ue=z(v),ge=E(ue);ge>-1&&(U||ge!==y)&&(q(ge),s.move(ue,ge,N,he))}}function B(v,U,he,ue){t.Scroll.scroll(v,U,he,function(){var ge=E(s.toIndex(d()));q(b?Yt(ge,$):ge),ue&&ue()})}function z(v){var U=y;if(Xt(v)){var he=v.match(/([+\-<>])(\d+)?/)||[],ue=he[1],ge=he[2];ue==="+"||ue==="-"?U=Z(y+ +(""+ue+(+ge||1)),y):ue===">"?U=ge?A(+ge):R(!0):ue==="<"&&(U=w(!0))}else U=g?v:yn(v,0,$);return U}function K(v,U){var he=M||(J()?1:S),ue=Z(y+he*(v?-1:1),y,!(M||J()));return ue===-1&&h&&!oa(d(),a(!v),1)?v?0:$:U?ue:E(ue)}function Z(v,U,he){if(I()||J()){var ue=m(v);ue!==v&&(U=v,v=ue,he=!1),v<0||v>$?!M&&(Ci(0,v,U,!0)||Ci($,U,v,!0))?v=A(C(v)):g?v=he?v<0?-(_%S||S):_:v:n.rewind?v=v<0?$:0:v=-1:he&&v!==U&&(v=A(C(U)+(v<U?-1:1)))}else v=-1;return v}function m(v){if(h&&n.trimSpace==="move"&&v!==y)for(var U=d();U===u(v,!0)&&Ci(v,0,e.length-1,!n.rewind);)v<y?--v:++v;return v}function E(v){return g?(v+_)%_||0:v}function W(){for(var v=_-(J()||g&&M?1:S);b&&v-- >0;)if(u(_-1,!0)!==u(v,!0)){v++;break}return yn(v,0,_-1)}function A(v){return yn(J()?v:S*v,0,$)}function C(v){return J()?Yt(v,$):Pi((v>=$?_-1:v)/S)}function V(v){var U=s.toIndex(v);return h?yn(U,0,$):U}function q(v){v!==y&&(N=y,y=v)}function ee(v){return v?N:y}function J(){return!Jn(n.focus)||n.isNavigation}function ye(){return e.state.is([_n,Yn])&&!!n.waitForTransition}return{mount:P,go:F,scroll:B,getNext:R,getPrev:w,getAdjacent:K,getEnd:W,setIndex:q,getIndex:ee,toIndex:A,toPage:C,toDest:V,hasFocus:J,isBusy:ye}}var hs="http://www.w3.org/2000/svg",fs="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",ci=40;function ys(e,t,n){var i=et(e),o=i.on,l=i.bind,s=i.emit,d=n.classes,a=n.i18n,u=t.Elements,p=t.Controller,I=u.arrows,x=u.track,b=I,g=u.prev,h=u.next,R,w,y={};function $(){_(),o(gt,N)}function N(){M(),$()}function _(){var B=n.arrows;B&&!(g&&h)&&k(),g&&h&&(jn(y,{prev:g,next:h}),zn(b,B?"":"none"),Mt(b,w=jo+"--"+n.direction),B&&(S(),F(),Ie([g,h],ni,x.id),s(ma,g,h)))}function M(){i.destroy(),Ot(b,w),R?(cn(I?[g,h]:b),g=h=null):kt([g,h],Oo)}function S(){o([Qt,An,ot,un,_i],F),l(h,"click",qe(P,">")),l(g,"click",qe(P,"<"))}function P(B){p.go(B,!0)}function k(){b=I||Sn("div",d.arrows),g=L(!0),h=L(!1),R=!0,Qn(b,[g,h]),!I&&Io(b,x)}function L(B){var z='<button class="'+d.arrow+" "+(B?d.prev:d.next)+'" type="button"><svg xmlns="'+hs+'" viewBox="0 0 '+ci+" "+ci+'" width="'+ci+'" height="'+ci+'" focusable="false"><path d="'+(n.arrowPath||fs)+'" />';return na(z)}function F(){if(g&&h){var B=e.index,z=p.getPrev(),K=p.getNext(),Z=z>-1&&B<z?a.last:a.prev,m=K>-1&&B>K?a.first:a.next;g.disabled=z<0,h.disabled=K<0,Ie(g,Tt,Z),Ie(h,Tt,m),s(ga,g,h,z,K)}}return{arrows:y,mount:$,destroy:M,update:F}}var vs=Po+"-interval";function bs(e,t,n){var i=et(e),o=i.on,l=i.bind,s=i.emit,d=Hi(n.interval,e.go.bind(e,">"),S),a=d.isPaused,u=t.Elements,p=t.Elements,I=p.root,x=p.toggle,b=n.autoplay,g,h,R=b==="pause";function w(){b&&(y(),x&&Ie(x,ni,u.track.id),R||$(),M())}function y(){n.pauseOnHover&&l(I,"mouseenter mouseleave",function(k){g=k.type==="mouseenter",_()}),n.pauseOnFocus&&l(I,"focusin focusout",function(k){h=k.type==="focusin",_()}),x&&l(x,"click",function(){R?$():N(!0)}),o([Gt,Ni,ot],d.rewind),o(Gt,P)}function $(){a()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),h=g=R=!1,M(),s(Fo))}function N(k){k===void 0&&(k=!0),R=!!k,M(),a()||(d.pause(),s(Wo))}function _(){R||(g||h?N(!1):$())}function M(){x&&(Bt(x,dn,!R),Ie(x,Tt,n.i18n[R?"play":"pause"]))}function S(k){var L=u.bar;L&&It(L,"width",k*100+"%"),s(ya,k)}function P(k){var L=t.Slides.getAt(k);d.set(L&&+Rt(L.slide,vs)||n.interval)}return{mount:w,destroy:d.cancel,play:$,pause:N,isPaused:a}}function xs(e,t,n){var i=et(e),o=i.on;function l(){n.cover&&(o(No,qe(d,!0)),o([Qt,gt,ot],qe(s,!0)))}function s(a){t.Slides.forEach(function(u){var p=ei(u.container||u.slide,"img");p&&p.src&&d(a,p,u)})}function d(a,u,p){p.style("background",a?'center/cover no-repeat url("'+u.src+'")':"",!0),zn(u,a?"none":"")}return{mount:l,destroy:qe(s,!1)}}var Ss=10,Cs=600,$s=.6,ws=1.5,Ts=800;function Ls(e,t,n){var i=et(e),o=i.on,l=i.emit,s=e.state.set,d=t.Move,a=d.getPosition,u=d.getLimit,p=d.exceededLimit,I=d.translate,x=e.is(Tn),b,g,h=1;function R(){o(Gt,N),o([gt,ot],_)}function w(S,P,k,L,F){var B=a();if(N(),k&&(!x||!p())){var z=t.Layout.sliderSize(),K=fo(S)*z*Pi(vt(S)/z)||0;S=d.toPosition(t.Controller.toDest(S%z))+K}var Z=oa(B,S,1);h=1,P=Z?0:P||Ri(vt(S-B)/ws,Ts),g=L,b=Hi(P,y,qe($,B,S,F),1),s(Yn),l(Ni),b.start()}function y(){s($n),g&&g(),l(un)}function $(S,P,k,L){var F=a(),B=S+(P-S)*M(L),z=(B-F)*h;I(F+z),x&&!k&&p()&&(h*=$s,vt(z)<Ss&&w(u(p(!0)),Cs,!1,g,!0))}function N(){b&&b.cancel()}function _(){b&&!b.isPaused()&&(N(),y())}function M(S){var P=n.easingFunc;return P?P(S):1-Math.pow(1-S,4)}return{mount:R,destroy:N,scroll:w,cancel:_}}var vn={passive:!1,capture:!0};function Es(e,t,n){var i=et(e),o=i.on,l=i.emit,s=i.bind,d=i.unbind,a=e.state,u=t.Move,p=t.Scroll,I=t.Controller,x=t.Elements.track,b=t.Media.reduce,g=t.Direction,h=g.resolve,R=g.orient,w=u.getPosition,y=u.exceededLimit,$,N,_,M,S,P=!1,k,L,F;function B(){s(x,eo,go,vn),s(x,to,go,vn),s(x,Aa,K,vn),s(x,"click",E,{capture:!0}),s(x,"dragstart",Ht),o([Qt,gt],z)}function z(){var G=n.drag;fe(!G),M=G==="free"}function K(G){if(k=!1,!L){var f=ge(G);ue(G.target)&&(f||!G.button)&&(I.isBusy()?Ht(G,!0):(F=f?x:window,S=a.is([_n,Yn]),_=null,s(F,eo,Z,vn),s(F,to,m,vn),u.cancel(),p.cancel(),W(G)))}}function Z(G){if(a.is(xi)||(a.set(xi),l(da)),G.cancelable)if(S){u.translate($+he(J(G)));var f=ye(G)>pr,H=P!==(P=y());(f||H)&&W(G),k=!0,l(ua),Ht(G)}else V(G)&&(S=C(G),Ht(G))}function m(G){a.is(xi)&&(a.set($n),l(pa)),S&&(A(G),Ht(G)),d(F,eo,Z),d(F,to,m),S=!1}function E(G){!L&&k&&Ht(G,!0)}function W(G){_=N,N=G,$=w()}function A(G){var f=q(G),H=ee(f),j=n.rewind&&n.rewindByDrag;b(!1),M?I.scroll(H,0,n.snap):e.is(ii)?I.go(R(fo(f))<0?j?"<":"-":j?">":"+"):e.is(Tn)&&P&&j?I.go(y(!0)?">":"<"):I.go(I.toDest(H),!0),b(!0)}function C(G){var f=n.dragMinThreshold,H=Hn(f),j=H&&f.mouse||0,te=(H?f.touch:+f)||10;return vt(J(G))>(ge(G)?te:j)}function V(G){return vt(J(G))>vt(J(G,!0))}function q(G){if(e.is(Mn)||!P){var f=ye(G);if(f&&f<pr)return J(G)/f}return 0}function ee(G){return w()+fo(G)*Yt(vt(G)*(n.flickPower||600),M?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function J(G,f){return U(G,f)-U(v(G),f)}function ye(G){return ho(G)-ho(v(G))}function v(G){return N===G&&_||N}function U(G,f){return(ge(G)?G.changedTouches[0]:G)["page"+h(f?"Y":"X")]}function he(G){return G/(P&&e.is(Tn)?as:1)}function ue(G){var f=n.noDrag;return!Bn(G,"."+Ea+", ."+Di)&&(!f||!Bn(G,f))}function ge(G){return typeof TouchEvent<"u"&&G instanceof TouchEvent}function ie(){return S}function fe(G){L=G}return{mount:B,disable:fe,isDragging:ie}}var Is={Spacebar:" ",Right:ji,Left:Oi,Up:xa,Down:Sa};function zo(e){return e=Xt(e)?e:e.key,Is[e]||e}var mr="keydown";function Rs(e,t,n){var i=et(e),o=i.on,l=i.bind,s=i.unbind,d=e.root,a=t.Direction.resolve,u,p;function I(){x(),o(gt,b),o(gt,x),o(Gt,h)}function x(){var w=n.keyboard;w&&(u=w==="global"?window:d,l(u,mr,R))}function b(){s(u,mr)}function g(w){p=w}function h(){var w=p;p=!0,Jr(function(){p=w})}function R(w){if(!p){var y=zo(w);y===a(Oi)?e.go("<"):y===a(ji)&&e.go(">")}}return{mount:I,destroy:b,disable:g}}var Wn=Po+"-lazy",$i=Wn+"-srcset",Ps="["+Wn+"], ["+$i+"]";function _s(e,t,n){var i=et(e),o=i.on,l=i.off,s=i.bind,d=i.emit,a=n.lazyLoad==="sequential",u=[An,un],p=[];function I(){n.lazyLoad&&(x(),o(ot,x))}function x(){Dt(p),b(),a?w():(l(u),o(u,g),g())}function b(){t.Slides.forEach(function(y){Ro(y.slide,Ps).forEach(function($){var N=Rt($,Wn),_=Rt($,$i);if(N!==$.src||_!==$.srcset){var M=n.classes.spinner,S=$.parentElement,P=ei(S,"."+M)||Sn("span",M,S);p.push([$,y,P]),$.src||zn($,"none")}})})}function g(){p=p.filter(function(y){var $=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,$)?h(y):!0}),p.length||l(u)}function h(y){var $=y[0];Mt(y[1].slide,xo),s($,"load error",qe(R,y)),Ie($,"src",Rt($,Wn)),Ie($,"srcset",Rt($,$i)),kt($,Wn),kt($,$i)}function R(y,$){var N=y[0],_=y[1];Ot(_.slide,xo),$.type!=="error"&&(cn(y[2]),zn(N,""),d(No,N,_),d(wn)),a&&w()}function w(){p.length&&h(p.shift())}return{mount:I,destroy:qe(Dt,p),check:g}}function As(e,t,n){var i=et(e),o=i.on,l=i.emit,s=i.bind,d=t.Slides,a=t.Elements,u=t.Controller,p=u.hasFocus,I=u.getIndex,x=u.go,b=t.Direction.resolve,g=a.pagination,h=[],R,w;function y(){$(),o([gt,ot,_i],y);var L=n.pagination;g&&zn(g,L?"":"none"),L&&(o([Gt,Ni,un],k),N(),k(),l(ha,{list:R,items:h},P(e.index)))}function $(){R&&(cn(g?Zt(R.children):R),Ot(R,w),Dt(h),R=null),i.destroy()}function N(){var L=e.length,F=n.classes,B=n.i18n,z=n.perPage,K=p()?u.getEnd()+1:Vn(L/z);R=g||Sn("ul",F.pagination,a.track.parentElement),Mt(R,w=Gi+"--"+S()),Ie(R,jt,"tablist"),Ie(R,Tt,B.select),Ie(R,Bo,S()===zi?"vertical":"");for(var Z=0;Z<K;Z++){var m=Sn("li",null,R),E=Sn("button",{class:F.page,type:"button"},m),W=d.getIn(Z).map(function(C){return C.slide.id}),A=!p()&&z>1?B.pageX:B.slideX;s(E,"click",qe(_,Z)),n.paginationKeyboard&&s(E,"keydown",qe(M,Z)),Ie(m,jt,"presentation"),Ie(E,jt,"tab"),Ie(E,ni,W.join(" ")),Ie(E,Tt,yo(A,Z+1)),Ie(E,Cn,-1),h.push({li:m,button:E,page:Z})}}function _(L){x(">"+L,!0)}function M(L,F){var B=h.length,z=zo(F),K=S(),Z=-1;z===b(ji,!1,K)?Z=++L%B:z===b(Oi,!1,K)?Z=(--L+B)%B:z==="Home"?Z=0:z==="End"&&(Z=B-1);var m=h[Z];m&&(ta(m.button),x(">"+Z),Ht(F,!0))}function S(){return n.paginationDirection||n.direction}function P(L){return h[u.toPage(L)]}function k(){var L=P(I(!0)),F=P(I());if(L){var B=L.button;Ot(B,dn),kt(B,lr),Ie(B,Cn,-1)}if(F){var z=F.button;Mt(z,dn),Ie(z,lr,!0),Ie(z,Cn,"")}l(fa,{list:R,items:h},L,F)}return{items:h,mount:y,destroy:$,getAt:P,update:k}}var Ms=[" ","Enter"];function ks(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function d(){l.forEach(function(g){g.destroy()}),Dt(l)}function a(){d(),s()}function u(g,h){var R=et(g);R.on(Gt,function(w,y,$){h.go(h.is(Mn)?$:w)}),l.push(R)}function p(){var g=et(e),h=g.on;h(Ao,x),h(va,b),h([Qt,gt],I),l.push(g),g.emit(ko,e.splides)}function I(){Ie(t.Elements.list,Bo,n.direction===zi?"vertical":"")}function x(g){e.go(g.index)}function b(g,h){Eo(Ms,zo(h))&&(x(g),Ht(h))}return{setup:qe(t.Media.set,{slideFocus:Jn(o)?i:o},!0),mount:s,destroy:d,remount:a}}function Fs(e,t,n){var i=et(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,vn)}function d(u){if(u.cancelable){var p=u.deltaY,I=p<0,x=ho(u),b=n.wheelMinThreshold||0,g=n.wheelSleep||0;vt(p)>b&&x-l>g&&(e.go(I?"<":">"),l=x),a(I)&&Ht(u)}}function a(u){return!n.releaseWheel||e.state.is(_n)||t.Controller.getAdjacent(u)!==-1}return{mount:s}}var Ws=90;function Ns(e,t,n){var i=et(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,d=Sn("span",ts),a=Hi(Ws,qe(p,!1));function u(){s&&(x(!t.Autoplay.isPaused()),Ie(l,dr,!0),d.textContent="…",o(Fo,qe(x,!0)),o(Wo,qe(x,!1)),o([An,un],qe(p,!0)))}function p(b){Ie(l,cr,b),b?(Qn(l,d),a.start()):(cn(d),a.cancel())}function I(){kt(l,[sr,dr,cr]),cn(d)}function x(b){s&&Ie(l,sr,b?"off":"polite")}return{mount:u,disable:x,destroy:I}}var Hs=Object.freeze({__proto__:null,Media:Kl,Direction:Ul,Elements:ls,Slides:cs,Layout:ds,Clones:ps,Move:ms,Controller:gs,Arrows:ys,Autoplay:bs,Cover:xs,Scroll:Ls,Drag:Es,Keyboard:Rs,LazyLoad:_s,Pagination:As,Sync:ks,Wheel:Fs,Live:Ns}),Bs={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"},Os={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:os,i18n:Bs,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function js(e,t,n){var i=t.Slides;function o(){et(e).on([Qt,ot],l)}function l(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function s(d,a){i.style("transition","opacity "+n.speed+"ms "+n.easing),Jr(a)}return{mount:o,start:s,cancel:go}}function zs(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,d=qe(It,s,"transition"),a;function u(){et(e).bind(s,"transitionend",function(b){b.target===s&&a&&(I(),a())})}function p(b,g){var h=i.toPosition(b,!0),R=i.getPosition(),w=x(b);vt(h-R)>=1&&w>=1?n.useScroll?l.scroll(h,w,!1,g):(d("transform "+w+"ms "+n.easing),i.translate(h,!0),a=g):(i.jump(b),g())}function I(){d(""),l.cancel()}function x(b){var g=n.rewindSpeed;if(e.is(Tn)&&g){var h=o.getIndex(!0),R=o.getEnd();if(h===0&&b>=R||h>=R&&b===0)return g}return n.speed}return{mount:u,start:p,cancel:I}}var Vs=(function(){function e(n,i){this.event=et(),this.Components={},this.state=Dl(xn),this.splides=[],this._o={},this._E={};var o=Xt(n)?ia(document,n):n;Fn(o,o+" is invalid."),this.root=o,i=qt({label:Rt(o,Tt)||"",labelledby:Rt(o,Ho)||""},Os,e.defaults,i||{});try{qt(i,JSON.parse(Rt(o,Po)))}catch{Fn(!1,"Invalid JSON")}this._o=Object.create(qt({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,d=this.Components;Fn(s.is([xn,Ii]),"Already mounted!"),s.set(xn),this._C=d,this._T=o||this._T||(this.is(ii)?js:zs),this._E=i||this._E;var a=jn({},Hs,this._E,{Transition:this._T});return sn(a,function(u,p){var I=u(l,d,l._o);d[p]=I,I.setup&&I.setup()}),sn(d,function(u){u.mount&&u.mount()}),this.emit(Qt),Mt(this.root,ns),s.set($n),this.emit(vo),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is($n)&&(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(Zt(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(ot),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(xn)?et(this).on(vo,this.destroy.bind(this,i)):(sn(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(Mo),o.destroy(),i&&Dt(this.splides),l.set(Ii)),this},Bl(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})(),Vo=Vs;Vo.defaults={};Vo.STATES=jl;var gr=[[Qt,"onMounted"],[vo,"onReady"],[Gt,"onMove"],[An,"onMoved"],[Ao,"onClick"],[aa,"onActive"],[la,"onInactive"],[sa,"onVisible"],[ca,"onHidden"],[ot,"onRefresh"],[gt,"onUpdated"],[wn,"onResize"],[Wi,"onResized"],[da,"onDrag"],[ua,"onDragging"],[pa,"onDragged"],[Ni,"onScroll"],[un,"onScrolled"],[Mo,"onDestroy"],[ma,"onArrowsMounted"],[ga,"onArrowsUpdated"],[ha,"onPaginationMounted"],[fa,"onPaginationUpdated"],[ko,"onNavigationMounted"],[Fo,"onAutoplayPlay"],[ya,"onAutoplayPlaying"],[Wo,"onAutoplayPause"],[No,"onLazyLoadLoaded"]];function Do(...e){return e.filter(Boolean).join(" ")}function Ai(e){return e!==null&&typeof e=="object"}function So(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!So(n,t[i]));if(Ai(e)&&Ai(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!So(e[o],t[o]))}return e===t}function Ds(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Gs(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 Co(e,t){const n=e;return Gs(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Ai(i)?n[o]=Co(Ai(n[o])?n[o]:{},i):n[o]=i}),n}var Ks=({children:e,className:t,...n})=>c.createElement("div",{className:Do("splide__track",t),...n},c.createElement("ul",{className:"splide__list"},e)),Go=class extends c.Component{constructor(){super(...arguments),this.splideRef=c.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Vo(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Co({},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&&!So(this.options,e)&&(this.splide.options=e,this.options=Co({},e));const t=this.getSlides();Ds(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){gr.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 c.createElement(t,{className:Do("splide",e),ref:this.splideRef,...this.omit(o,["options",...gr.map(l=>l[1])])},n?c.createElement(Ks,null,i):i)}},Ko=({children:e,className:t,...n})=>c.createElement("li",{className:Do("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("react"),Be=require("classnames"),L=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Xn=require("react-dom");function qa(e){return e.type==="object"&&e.version===1}const Xa="ControlSlider-module__wrapper___sHEkd",Ya="ControlSlider-module__hoverArrow___A-dOH",Ja="ControlSlider-module__sliderItem___QQSkR",Za="ControlSlider-module__sliderImage___9hRl-",Qa="ControlSlider-module__arrow___05ghY",el="ControlSlider-module__arrowVertical___tBfVN",tl="ControlSlider-module__nextArrow___-30Yc",nl="ControlSlider-module__arrowInner___aEra3",il="ControlSlider-module__arrowIcon___S4ztF",ol="ControlSlider-module__arrowImg___2dwJW",rl="ControlSlider-module__mirror___brd6U",al="ControlSlider-module__pagination___bicLF",ll="ControlSlider-module__paginationInner___bT-P-",sl="ControlSlider-module__paginationVertical___zYqKw",cl="ControlSlider-module__paginationItem___nTRbk",dl="ControlSlider-module__dot___p1Qun",ul="ControlSlider-module__activeDot___LHFaj",pl="ControlSlider-module__paginationInsideBottom___R3FWn",ml="ControlSlider-module__paginationInsideTop___V-qb-",gl="ControlSlider-module__paginationOutsideBottom___14w8D",hl="ControlSlider-module__paginationOutsideTop___SCLqB",fl="ControlSlider-module__paginationInsideLeft___yOBRZ",yl="ControlSlider-module__paginationInsideRight___Rtt3o",vl="ControlSlider-module__paginationOutsideLeft___lahaw",bl="ControlSlider-module__paginationOutsideRight___EtuQa",xl="ControlSlider-module__imgWrapper___UjEgB",Sl="ControlSlider-module__captionBlock___dJ6-j",Cl="ControlSlider-module__captionTextWrapper___HFlpf",$l="ControlSlider-module__captionText___uGBVc",wl="ControlSlider-module__active___WZK4G",Tl="ControlSlider-module__withPointerEvents___t-18M",Ll="ControlSlider-module__topLeftAlignment___zjnGM",El="ControlSlider-module__topCenterAlignment___gD1xW",Il="ControlSlider-module__topRightAlignment___NMapS",Rl="ControlSlider-module__middleLeftAlignment___OnUrY",Pl="ControlSlider-module__middleCenterAlignment___Tdkl0",_l="ControlSlider-module__middleRightAlignment___wEbfX",Al="ControlSlider-module__bottomLeftAlignment___cTP2-",Ml="ControlSlider-module__bottomCenterAlignment___c54fB",kl="ControlSlider-module__bottomRightAlignment___kEwrz",Fl="ControlSlider-module__clickOverlay___DZA28",Wl="ControlSlider-module__contain___pLyq7",Nl="ControlSlider-module__cover___KdDat",ye={wrapper:Xa,hoverArrow:Ya,sliderItem:Ja,sliderImage:Za,arrow:Qa,arrowVertical:el,nextArrow:tl,arrowInner:nl,arrowIcon:il,arrowImg:ol,mirror:rl,pagination:al,paginationInner:ll,paginationVertical:sl,paginationItem:cl,dot:dl,activeDot:ul,paginationInsideBottom:pl,paginationInsideTop:ml,paginationOutsideBottom:gl,paginationOutsideTop:hl,paginationInsideLeft:fl,paginationInsideRight:yl,paginationOutsideLeft:vl,paginationOutsideRight:bl,imgWrapper:xl,captionBlock:Sl,captionTextWrapper:Cl,captionText:$l,active:wl,withPointerEvents:Tl,topLeftAlignment:Ll,topCenterAlignment:El,topRightAlignment:Il,middleLeftAlignment:Rl,middleCenterAlignment:Pl,middleRightAlignment:_l,bottomLeftAlignment:Al,bottomCenterAlignment:Ml,bottomRightAlignment:kl,clickOverlay:Fl,contain:Wl,cover:Nl};function Hl(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 Bl(e,t,n){return t&&Hl(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var tr="(prefers-reduced-motion: reduce)",xn=1,Ol=2,$n=3,_n=4,Yn=5,xi=6,Ii=7,jl={CREATED:xn,MOUNTED:Ol,IDLE:$n,MOVING:_n,SCROLLING:Yn,DRAGGING:xi,DESTROYED:Ii};function Dt(e){e.length=0}function Zt(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ue(e){return e.bind.apply(e,[null].concat(Zt(arguments,1)))}var Jr=setTimeout,go=function(){};function nr(e){return requestAnimationFrame(e)}function Fi(e,t){return typeof t===e}function Hn(e){return!Lo(e)&&Fi("object",e)}var To=Array.isArray,Zr=Ue(Fi,"function"),Xt=Ue(Fi,"string"),Jn=Ue(Fi,"undefined");function Lo(e){return e===null}function Qr(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Zn(e){return To(e)?e:[e]}function Et(e,t){Zn(e).forEach(t)}function Eo(e,t){return e.indexOf(t)>-1}function Si(e,t){return e.push.apply(e,Zn(t)),e}function Bt(e,t,n){e&&Et(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Mt(e,t){Bt(e,Xt(t)?t.split(" "):t,!0)}function Qn(e,t){Et(t,e.appendChild.bind(e))}function Io(e,t){Et(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Bn(e,t){return Qr(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function ea(e,t){var n=e?Zt(e.children):[];return t?n.filter(function(i){return Bn(i,t)}):n}function ei(e,t){return t?ea(e,t)[0]:e.firstElementChild}var On=Object.keys;function sn(e,t,n){return e&&(n?On(e).reverse():On(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function jn(e){return Zt(arguments,1).forEach(function(t){sn(t,function(n,i){e[i]=t[i]})}),e}function qt(e){return Zt(arguments,1).forEach(function(t){sn(t,function(n,i){To(n)?e[i]=n.slice():Hn(n)?e[i]=qt({},Hn(e[i])?e[i]:{},n):e[i]=n})}),e}function ir(e,t){Et(t||On(e),function(n){delete e[n]})}function kt(e,t){Et(e,function(n){Et(t,function(i){n&&n.removeAttribute(i)})})}function Ee(e,t,n){Hn(t)?sn(t,function(i,o){Ee(e,o,i)}):Et(e,function(i){Lo(n)||n===""?kt(i,t):i.setAttribute(t,String(n))})}function Sn(e,t,n){var i=document.createElement(e);return t&&(Xt(t)?Mt(i,t):Ee(i,t)),n&&Qn(n,i),i}function It(e,t,n){if(Jn(n))return getComputedStyle(e)[t];Lo(n)||(e.style[t]=""+n)}function zn(e,t){It(e,"display",t)}function ta(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Rt(e,t){return e.getAttribute(t)}function or(e,t){return e&&e.classList.contains(t)}function wt(e){return e.getBoundingClientRect()}function cn(e){Et(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function na(e){return ei(new DOMParser().parseFromString(e,"text/html").body)}function Ht(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ia(e,t){return e&&e.querySelector(t)}function Ro(e,t){return t?Zt(e.querySelectorAll(t)):[]}function Ot(e,t){Bt(e,t,!1)}function ho(e){return e.timeStamp}function nn(e){return Xt(e)?e:e?e+"px":""}var ti="splide",Po="data-"+ti;function Fn(e,t){if(!e)throw new Error("["+ti+"] "+(t||""))}var Yt=Math.min,Ri=Math.max,Pi=Math.floor,Vn=Math.ceil,vt=Math.abs;function oa(e,t,n){return vt(e-t)<n}function Ci(e,t,n,i){var o=Yt(t,n),l=Ri(t,n);return i?o<e&&e<l:o<=e&&e<=l}function yn(e,t,n){var i=Yt(t,n),o=Ri(t,n);return Yt(Ri(i,e),o)}function fo(e){return+(e>0)-+(e<0)}function yo(e,t){return Et(t,function(n){e=e.replace("%s",""+n)}),e}function _o(e){return e<10?"0"+e:""+e}var rr={};function zl(e){return""+e+_o(rr[e]=(rr[e]||0)+1)}function ra(){var e=[];function t(s,d,a,u){o(s,d,function(p,I,S){var v="addEventListener"in p,g=v?p.removeEventListener.bind(p,I,a,u):p.removeListener.bind(p,a);v?p.addEventListener(I,a,u):p.addListener(a),e.push([p,I,S,a,g])})}function n(s,d,a){o(s,d,function(u,p,I){e=e.filter(function(S){return S[0]===u&&S[1]===p&&S[2]===I&&(!a||S[3]===a)?(S[4](),!1):!0})})}function i(s,d,a){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:a}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,a)),s.dispatchEvent(u),u}function o(s,d,a){Et(s,function(u){u&&Et(d,function(p){p.split(" ").forEach(function(I){var S=I.split(".");a(u,S[0],S[1])})})})}function l(){e.forEach(function(s){s[4]()}),Dt(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var Qt="mounted",vo="ready",Gt="move",An="moved",Ao="click",aa="active",la="inactive",sa="visible",ca="hidden",it="refresh",gt="updated",wn="resize",Wi="resized",da="drag",ua="dragging",pa="dragged",Ni="scroll",un="scrolled",Vl="overflow",Mo="destroy",ma="arrows:mounted",ga="arrows:updated",ha="pagination:mounted",fa="pagination:updated",ko="navigation:mounted",Fo="autoplay:play",ya="autoplay:playing",Wo="autoplay:pause",No="lazyload:loaded",va="sk",ba="sh",_i="ei";function Qe(e){var t=e?e.event.bus:document.createDocumentFragment(),n=ra();function i(l,s){n.bind(t,Zn(l).join(" "),function(d){s.apply(s,To(d.detail)?d.detail:[])})}function o(l){n.dispatch(t,l,Zt(arguments,1))}return e&&e.event.on(Mo,n.destroy),jn(n,{bus:t,on:i,off:Ue(n.unbind,t),emit:o})}function Hi(e,t,n,i){var o=Date.now,l,s=0,d,a=!0,u=0;function p(){if(!a){if(s=e?Yt((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++u>=i))return S();d=nr(p)}}function I(T){T||g(),l=o()-(T?s*e:0),a=!1,d=nr(p)}function S(){a=!0}function v(){l=o(),s=0,n&&n(s)}function g(){d&&cancelAnimationFrame(d),s=0,d=0,a=!0}function h(T){e=T}function R(){return a}return{start:I,rewind:v,pause:S,cancel:g,set:h,isPaused:R}}function Dl(e){var t=e;function n(o){t=o}function i(o){return Eo(Zn(o),t)}return{set:n,is:i}}function Gl(e,t){var n=Hi(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Kl(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=ra(),d=[];function a(){var g=n.mediaQuery==="min";On(o).sort(function(h,R){return g?+h-+R:+R-+h}).forEach(function(h){p(o[h],"("+(g?"min":"max")+"-width:"+h+"px)")}),p(l,tr),I()}function u(g){g&&s.destroy()}function p(g,h){var R=matchMedia(h);s.bind(R,"change",I),d.push([g,R])}function I(){var g=i.is(Ii),h=n.direction,R=d.reduce(function(T,y){return qt(T,y[1].matches?y[0]:{})},{});ir(n),v(R),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):h!==n.direction&&e.refresh()}function S(g){matchMedia(tr).matches&&(g?qt(n,l):ir(n,On(l)))}function v(g,h,R){qt(n,g),h&&qt(Object.getPrototypeOf(n),g),(R||!i.is(xn))&&e.emit(gt,n)}return{setup:a,destroy:u,reduce:S,set:v}}var Bi="Arrow",Oi=Bi+"Left",ji=Bi+"Right",xa=Bi+"Up",Sa=Bi+"Down",ar="rtl",zi="ttb",Zi={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[xa,ji],ArrowRight:[Sa,Oi]};function Ul(e,t,n){function i(l,s,d){d=d||n.direction;var a=d===ar&&!s?1:d===zi?0:-1;return Zi[l]&&Zi[l][a]||l.replace(/width|left|right/i,function(u,p){var I=Zi[u.toLowerCase()][a]||u;return p>0?I.charAt(0).toUpperCase()+I.slice(1):I})}function o(l){return l*(n.direction===ar?1:-1)}return{resolve:i,orient:o}}var jt="role",Cn="tabindex",ql="disabled",Pt="aria-",ni=Pt+"controls",Ca=Pt+"current",lr=Pt+"selected",Tt=Pt+"label",Ho=Pt+"labelledby",$a=Pt+"hidden",Bo=Pt+"orientation",Dn=Pt+"roledescription",sr=Pt+"live",cr=Pt+"busy",dr=Pt+"atomic",Oo=[jt,Cn,ql,ni,Ca,Tt,Ho,$a,Bo,Dn],Ft=ti+"__",en="is-",Qi=ti,ur=Ft+"track",Xl=Ft+"list",Vi=Ft+"slide",wa=Vi+"--clone",Yl=Vi+"__container",jo=Ft+"arrows",Di=Ft+"arrow",Ta=Di+"--prev",La=Di+"--next",Gi=Ft+"pagination",Ea=Gi+"__page",Jl=Ft+"progress",Zl=Jl+"__bar",Ql=Ft+"toggle",es=Ft+"spinner",ts=Ft+"sr",ns=en+"initialized",dn=en+"active",Ia=en+"prev",Ra=en+"next",bo=en+"visible",xo=en+"loading",Pa=en+"focus-in",_a=en+"overflow",is=[dn,bo,Ia,Ra,xo,Pa,_a],os={slide:Vi,clone:wa,arrows:jo,arrow:Di,prev:Ta,next:La,pagination:Gi,page:Ea,spinner:es};function rs(e,t){if(Zr(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Bn(n,t);)n=n.parentElement;return n}var as=5,pr=200,Aa="touchstart mousedown",eo="touchmove mousemove",to="touchend touchcancel mouseup click";function ls(e,t,n){var i=Qe(e),o=i.on,l=i.bind,s=e.root,d=n.i18n,a={},u=[],p=[],I=[],S,v,g;function h(){w(),N(),y()}function R(){o(it,T),o(it,h),o(gt,y),l(document,Aa+" keydown",function(C){g=C.type==="keydown"},{capture:!0}),l(s,"focusin",function(){Bt(s,Pa,!!g)})}function T(C){var P=Oo.concat("style");Dt(u),Ot(s,p),Ot(S,I),kt([S,v],P),kt(s,C?P:["style",Dn])}function y(){Ot(s,p),Ot(S,I),p=W(Qi),I=W(ur),Mt(s,p),Mt(S,I),Ee(s,Tt,n.label),Ee(s,Ho,n.labelledby)}function w(){S=_("."+ur),v=ei(S,"."+Xl),Fn(S&&v,"A track/list element is missing."),Si(u,ea(v,"."+Vi+":not(."+wa+")")),sn({arrows:jo,pagination:Gi,prev:Ta,next:La,bar:Zl,toggle:Ql},function(C,P){a[P]=_("."+C)}),jn(a,{root:s,track:S,list:v,slides:u})}function N(){var C=s.id||zl(ti),P=n.role;s.id=C,S.id=S.id||C+"-track",v.id=v.id||C+"-list",!Rt(s,jt)&&s.tagName!=="SECTION"&&P&&Ee(s,jt,P),Ee(s,Dn,d.carousel),Ee(v,jt,"presentation")}function _(C){var P=ia(s,C);return P&&rs(P,"."+Qi)===s?P:void 0}function W(C){return[C+"--"+n.type,C+"--"+n.direction,n.drag&&C+"--draggable",n.isNavigation&&C+"--nav",C===Qi&&dn]}return jn(a,{setup:h,mount:R,destroy:T})}var Tn="slide",Mn="loop",ii="fade";function ss(e,t,n,i){var o=Qe(e),l=o.on,s=o.emit,d=o.bind,a=e.Components,u=e.root,p=e.options,I=p.isNavigation,S=p.updateOnMove,v=p.i18n,g=p.pagination,h=p.slideFocus,R=a.Direction.resolve,T=Rt(i,"style"),y=Rt(i,Tt),w=n>-1,N=ei(i,"."+Yl),_;function W(){w||(i.id=u.id+"-slide"+_o(t+1),Ee(i,jt,g?"tabpanel":"group"),Ee(i,Dn,v.slide),Ee(i,Tt,y||yo(v.slideLabel,[t+1,e.length]))),C()}function C(){d(i,"click",Ue(s,Ao,F)),d(i,"keydown",Ue(s,va,F)),l([An,ba,un],k),l(ko,A),S&&l(Gt,E)}function P(){_=!0,o.destroy(),Ot(i,is),kt(i,Oo),Ee(i,"style",T),Ee(i,Tt,y||"")}function A(){var M=e.splides.map(function($){var O=$.splide.Components.Slides.getAt(t);return O?O.slide.id:""}).join(" ");Ee(i,Tt,yo(v.slideX,(w?n:t)+1)),Ee(i,ni,M),Ee(i,jt,h?"button":""),h&&kt(i,Dn)}function E(){_||k()}function k(){if(!_){var M=e.index;B(),V(),Bt(i,Ia,t===M-1),Bt(i,Ra,t===M+1)}}function B(){var M=ee();M!==or(i,dn)&&(Bt(i,dn,M),Ee(i,Ca,I&&M||""),s(M?aa:la,F))}function V(){var M=m(),$=!M&&(!ee()||w);if(e.state.is([_n,Yn])||Ee(i,$a,$||""),Ee(Ro(i,p.focusableNodes||""),Cn,$?-1:""),h&&Ee(i,Cn,$?-1:0),M!==or(i,bo)&&(Bt(i,bo,M),s(M?sa:ca,F)),!M&&document.activeElement===i){var O=a.Slides.getAt(e.index);O&&ta(O.slide)}}function K(M,$,O){It(O&&N||i,M,$)}function ee(){var M=e.index;return M===t||p.cloneStatus&&M===n}function m(){if(e.is(ii))return ee();var M=wt(a.Elements.track),$=wt(i),O=R("left",!0),U=R("right",!0);return Pi(M[O])<=Vn($[O])&&Pi($[U])<=Vn(M[U])}function b(M,$){var O=vt(M-t);return!w&&(p.rewind||e.is(Mn))&&(O=Yt(O,e.length-O)),O<=$}var F={index:t,slideIndex:n,slide:i,container:N,isClone:w,mount:W,destroy:P,update:k,style:K,isWithin:b};return F}function cs(e,t,n){var i=Qe(e),o=i.on,l=i.emit,s=i.bind,d=t.Elements,a=d.slides,u=d.list,p=[];function I(){S(),o(it,v),o(it,S)}function S(){a.forEach(function(k,B){h(k,B,-1)})}function v(){_(function(k){k.destroy()}),Dt(p)}function g(){_(function(k){k.update()})}function h(k,B,V){var K=ss(e,B,V,k);K.mount(),p.push(K),p.sort(function(ee,m){return ee.index-m.index})}function R(k){return k?W(function(B){return!B.isClone}):p}function T(k){var B=t.Controller,V=B.toIndex(k),K=B.hasFocus()?1:n.perPage;return W(function(ee){return Ci(ee.index,V,V+K-1)})}function y(k){return W(k)[0]}function w(k,B){Et(k,function(V){if(Xt(V)&&(V=na(V)),Qr(V)){var K=a[B];K?Io(V,K):Qn(u,V),Mt(V,n.classes.slide),P(V,Ue(l,wn))}}),l(it)}function N(k){cn(W(k).map(function(B){return B.slide})),l(it)}function _(k,B){R(B).forEach(k)}function W(k){return p.filter(Zr(k)?k:function(B){return Xt(k)?Bn(B.slide,k):Eo(Zn(k),B.index)})}function C(k,B,V){_(function(K){K.style(k,B,V)})}function P(k,B){var V=Ro(k,"img"),K=V.length;K?V.forEach(function(ee){s(ee,"load error",function(){--K||B()})}):B()}function A(k){return k?a.length:p.length}function E(){return p.length>n.perPage}return{mount:I,destroy:v,update:g,register:h,get:R,getIn:T,getAt:y,add:w,remove:N,forEach:_,filter:W,style:C,getLength:A,isEnough:E}}function ds(e,t,n){var i=Qe(e),o=i.on,l=i.bind,s=i.emit,d=t.Slides,a=t.Direction.resolve,u=t.Elements,p=u.root,I=u.track,S=u.list,v=d.getAt,g=d.style,h,R,T;function y(){w(),l(window,"resize load",Gl(Ue(s,wn))),o([gt,it],w),o(wn,N)}function w(){h=n.direction===zi,It(p,"maxWidth",nn(n.width)),It(I,a("paddingLeft"),_(!1)),It(I,a("paddingRight"),_(!0)),N(!0)}function N(F){var M=wt(p);(F||R.width!==M.width||R.height!==M.height)&&(It(I,"height",W()),g(a("marginRight"),nn(n.gap)),g("width",P()),g("height",A(),!0),R=M,s(Wi),T!==(T=b())&&(Bt(p,_a,T),s(Vl,T)))}function _(F){var M=n.padding,$=a(F?"right":"left");return M&&nn(M[$]||(Hn(M)?0:M))||"0px"}function W(){var F="";return h&&(F=C(),Fn(F,"height or heightRatio is missing."),F="calc("+F+" - "+_(!1)+" - "+_(!0)+")"),F}function C(){return nn(n.height||wt(S).width*n.heightRatio)}function P(){return n.autoWidth?null:nn(n.fixedWidth)||(h?"":E())}function A(){return nn(n.fixedHeight)||(h?n.autoHeight?null:E():C())}function E(){var F=nn(n.gap);return"calc((100%"+(F&&" + "+F)+")/"+(n.perPage||1)+(F&&" - "+F)+")"}function k(){return wt(S)[a("width")]}function B(F,M){var $=v(F||0);return $?wt($.slide)[a("width")]+(M?0:ee()):0}function V(F,M){var $=v(F);if($){var O=wt($.slide)[a("right")],U=wt(S)[a("left")];return vt(O-U)+(M?0:ee())}return 0}function K(F){return V(e.length-1)-V(0)+B(0,F)}function ee(){var F=v(0);return F&&parseFloat(It(F.slide,a("marginRight")))||0}function m(F){return parseFloat(It(I,a("padding"+(F?"Right":"Left"))))||0}function b(){return e.is(ii)||K(!0)>k()}return{mount:y,resize:N,listSize:k,slideSize:B,sliderSize:K,totalSize:V,getPadding:m,isOverflow:b}}var us=2;function ps(e,t,n){var i=Qe(e),o=i.on,l=t.Elements,s=t.Slides,d=t.Direction.resolve,a=[],u;function p(){o(it,I),o([gt,wn],v),(u=R())&&(g(u),t.Layout.resize(!0))}function I(){S(),p()}function S(){cn(a),Dt(a),i.destroy()}function v(){var T=R();u!==T&&(u<T||!T)&&i.emit(it)}function g(T){var y=s.get().slice(),w=y.length;if(w){for(;y.length<T;)Si(y,y);Si(y.slice(-T),y.slice(0,T)).forEach(function(N,_){var W=_<T,C=h(N.slide,_);W?Io(C,y[0].slide):Qn(l.list,C),Si(a,C),s.register(C,_-T+(W?0:w),N.index)})}}function h(T,y){var w=T.cloneNode(!0);return Mt(w,n.classes.clone),w.id=e.root.id+"-clone"+_o(y+1),w}function R(){var T=n.clones;if(!e.is(Mn))T=0;else if(Jn(T)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),w=y&&Vn(wt(l.track)[d("width")]/y);T=w||n[d("autoWidth")]&&e.length||n.perPage*us}return T}return{mount:p,destroy:S}}function ms(e,t,n){var i=Qe(e),o=i.on,l=i.emit,s=e.state.set,d=t.Layout,a=d.slideSize,u=d.getPadding,p=d.totalSize,I=d.listSize,S=d.sliderSize,v=t.Direction,g=v.resolve,h=v.orient,R=t.Elements,T=R.list,y=R.track,w;function N(){w=t.Transition,o([Qt,Wi,gt,it],_)}function _(){t.Controller.isBusy()||(t.Scroll.cancel(),C(e.index),t.Slides.update())}function W($,O,U,te){$!==O&&F($>U)&&(k(),P(E(K(),$>U),!0)),s(_n),l(Gt,O,U,$),w.start(O,function(){s($n),l(An,O,U,$),te&&te()})}function C($){P(V($,!0))}function P($,O){if(!e.is(ii)){var U=O?$:A($);It(T,"transform","translate"+g("X")+"("+U+"px)"),$!==U&&l(ba)}}function A($){if(e.is(Mn)){var O=B($),U=O>t.Controller.getEnd(),te=O<0;(te||U)&&($=E($,U))}return $}function E($,O){var U=$-b(O),te=S();return $-=h(te*(Vn(vt(U)/te)||1))*(O?1:-1),$}function k(){P(K(),!0),w.cancel()}function B($){for(var O=t.Slides.get(),U=0,te=1/0,Y=0;Y<O.length;Y++){var fe=O[Y].index,x=vt(V(fe,!0)-$);if(x<=te)te=x,U=fe;else break}return U}function V($,O){var U=h(p($-1)-m($));return O?ee(U):U}function K(){var $=g("left");return wt(T)[$]-wt(y)[$]+h(u(!1))}function ee($){return n.trimSpace&&e.is(Tn)&&($=yn($,0,h(S(!0)-I()))),$}function m($){var O=n.focus;return O==="center"?(I()-a($,!0))/2:+O*a($)||0}function b($){return V($?t.Controller.getEnd():0,!!n.trimSpace)}function F($){var O=h(E(K(),$));return $?O>=0:O<=T[g("scrollWidth")]-wt(y)[g("width")]}function M($,O){O=Jn(O)?K():O;var U=$!==!0&&h(O)<h(b(!1)),te=$!==!1&&h(O)>h(b(!0));return U||te}return{mount:N,move:W,jump:C,translate:P,shift:E,cancel:k,toIndex:B,toPosition:V,getPosition:K,getLimit:b,exceededLimit:M,reposition:_}}function gs(e,t,n){var i=Qe(e),o=i.on,l=i.emit,s=t.Move,d=s.getPosition,a=s.getLimit,u=s.toPosition,p=t.Slides,I=p.isEnough,S=p.getLength,v=n.omitEnd,g=e.is(Mn),h=e.is(Tn),R=Ue(K,!1),T=Ue(K,!0),y=n.start||0,w,N=y,_,W,C;function P(){A(),o([gt,it,_i],A),o(Wi,E)}function A(){_=S(!0),W=n.perMove,C=n.perPage,w=F();var x=yn(y,0,v?w:_-1);x!==y&&(y=x,s.reposition())}function E(){w!==F()&&l(_i)}function k(x,q,he){if(!fe()){var pe=V(x),be=b(pe);be>-1&&(q||be!==y)&&(U(be),s.move(pe,be,N,he))}}function B(x,q,he,pe){t.Scroll.scroll(x,q,he,function(){var be=b(s.toIndex(d()));U(v?Yt(be,w):be),pe&&pe()})}function V(x){var q=y;if(Xt(x)){var he=x.match(/([+\-<>])(\d+)?/)||[],pe=he[1],be=he[2];pe==="+"||pe==="-"?q=ee(y+ +(""+pe+(+be||1)),y):pe===">"?q=be?M(+be):R(!0):pe==="<"&&(q=T(!0))}else q=g?x:yn(x,0,w);return q}function K(x,q){var he=W||(Y()?1:C),pe=ee(y+he*(x?-1:1),y,!(W||Y()));return pe===-1&&h&&!oa(d(),a(!x),1)?x?0:w:q?pe:b(pe)}function ee(x,q,he){if(I()||Y()){var pe=m(x);pe!==x&&(q=x,x=pe,he=!1),x<0||x>w?!W&&(Ci(0,x,q,!0)||Ci(w,q,x,!0))?x=M($(x)):g?x=he?x<0?-(_%C||C):_:x:n.rewind?x=x<0?w:0:x=-1:he&&x!==q&&(x=M($(q)+(x<q?-1:1)))}else x=-1;return x}function m(x){if(h&&n.trimSpace==="move"&&x!==y)for(var q=d();q===u(x,!0)&&Ci(x,0,e.length-1,!n.rewind);)x<y?--x:++x;return x}function b(x){return g?(x+_)%_||0:x}function F(){for(var x=_-(Y()||g&&W?1:C);v&&x-- >0;)if(u(_-1,!0)!==u(x,!0)){x++;break}return yn(x,0,_-1)}function M(x){return yn(Y()?x:C*x,0,w)}function $(x){return Y()?Yt(x,w):Pi((x>=w?_-1:x)/C)}function O(x){var q=s.toIndex(x);return h?yn(q,0,w):q}function U(x){x!==y&&(N=y,y=x)}function te(x){return x?N:y}function Y(){return!Jn(n.focus)||n.isNavigation}function fe(){return e.state.is([_n,Yn])&&!!n.waitForTransition}return{mount:P,go:k,scroll:B,getNext:R,getPrev:T,getAdjacent:K,getEnd:F,setIndex:U,getIndex:te,toIndex:M,toPage:$,toDest:O,hasFocus:Y,isBusy:fe}}var hs="http://www.w3.org/2000/svg",fs="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",ci=40;function ys(e,t,n){var i=Qe(e),o=i.on,l=i.bind,s=i.emit,d=n.classes,a=n.i18n,u=t.Elements,p=t.Controller,I=u.arrows,S=u.track,v=I,g=u.prev,h=u.next,R,T,y={};function w(){_(),o(gt,N)}function N(){W(),w()}function _(){var B=n.arrows;B&&!(g&&h)&&A(),g&&h&&(jn(y,{prev:g,next:h}),zn(v,B?"":"none"),Mt(v,T=jo+"--"+n.direction),B&&(C(),k(),Ee([g,h],ni,S.id),s(ma,g,h)))}function W(){i.destroy(),Ot(v,T),R?(cn(I?[g,h]:v),g=h=null):kt([g,h],Oo)}function C(){o([Qt,An,it,un,_i],k),l(h,"click",Ue(P,">")),l(g,"click",Ue(P,"<"))}function P(B){p.go(B,!0)}function A(){v=I||Sn("div",d.arrows),g=E(!0),h=E(!1),R=!0,Qn(v,[g,h]),!I&&Io(v,S)}function E(B){var V='<button class="'+d.arrow+" "+(B?d.prev:d.next)+'" type="button"><svg xmlns="'+hs+'" viewBox="0 0 '+ci+" "+ci+'" width="'+ci+'" height="'+ci+'" focusable="false"><path d="'+(n.arrowPath||fs)+'" />';return na(V)}function k(){if(g&&h){var B=e.index,V=p.getPrev(),K=p.getNext(),ee=V>-1&&B<V?a.last:a.prev,m=K>-1&&B>K?a.first:a.next;g.disabled=V<0,h.disabled=K<0,Ee(g,Tt,ee),Ee(h,Tt,m),s(ga,g,h,V,K)}}return{arrows:y,mount:w,destroy:W,update:k}}var vs=Po+"-interval";function bs(e,t,n){var i=Qe(e),o=i.on,l=i.bind,s=i.emit,d=Hi(n.interval,e.go.bind(e,">"),C),a=d.isPaused,u=t.Elements,p=t.Elements,I=p.root,S=p.toggle,v=n.autoplay,g,h,R=v==="pause";function T(){v&&(y(),S&&Ee(S,ni,u.track.id),R||w(),W())}function y(){n.pauseOnHover&&l(I,"mouseenter mouseleave",function(A){g=A.type==="mouseenter",_()}),n.pauseOnFocus&&l(I,"focusin focusout",function(A){h=A.type==="focusin",_()}),S&&l(S,"click",function(){R?w():N(!0)}),o([Gt,Ni,it],d.rewind),o(Gt,P)}function w(){a()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),h=g=R=!1,W(),s(Fo))}function N(A){A===void 0&&(A=!0),R=!!A,W(),a()||(d.pause(),s(Wo))}function _(){R||(g||h?N(!1):w())}function W(){S&&(Bt(S,dn,!R),Ee(S,Tt,n.i18n[R?"play":"pause"]))}function C(A){var E=u.bar;E&&It(E,"width",A*100+"%"),s(ya,A)}function P(A){var E=t.Slides.getAt(A);d.set(E&&+Rt(E.slide,vs)||n.interval)}return{mount:T,destroy:d.cancel,play:w,pause:N,isPaused:a}}function xs(e,t,n){var i=Qe(e),o=i.on;function l(){n.cover&&(o(No,Ue(d,!0)),o([Qt,gt,it],Ue(s,!0)))}function s(a){t.Slides.forEach(function(u){var p=ei(u.container||u.slide,"img");p&&p.src&&d(a,p,u)})}function d(a,u,p){p.style("background",a?'center/cover no-repeat url("'+u.src+'")':"",!0),zn(u,a?"none":"")}return{mount:l,destroy:Ue(s,!1)}}var Ss=10,Cs=600,$s=.6,ws=1.5,Ts=800;function Ls(e,t,n){var i=Qe(e),o=i.on,l=i.emit,s=e.state.set,d=t.Move,a=d.getPosition,u=d.getLimit,p=d.exceededLimit,I=d.translate,S=e.is(Tn),v,g,h=1;function R(){o(Gt,N),o([gt,it],_)}function T(C,P,A,E,k){var B=a();if(N(),A&&(!S||!p())){var V=t.Layout.sliderSize(),K=fo(C)*V*Pi(vt(C)/V)||0;C=d.toPosition(t.Controller.toDest(C%V))+K}var ee=oa(B,C,1);h=1,P=ee?0:P||Ri(vt(C-B)/ws,Ts),g=E,v=Hi(P,y,Ue(w,B,C,k),1),s(Yn),l(Ni),v.start()}function y(){s($n),g&&g(),l(un)}function w(C,P,A,E){var k=a(),B=C+(P-C)*W(E),V=(B-k)*h;I(k+V),S&&!A&&p()&&(h*=$s,vt(V)<Ss&&T(u(p(!0)),Cs,!1,g,!0))}function N(){v&&v.cancel()}function _(){v&&!v.isPaused()&&(N(),y())}function W(C){var P=n.easingFunc;return P?P(C):1-Math.pow(1-C,4)}return{mount:R,destroy:N,scroll:T,cancel:_}}var vn={passive:!1,capture:!0};function Es(e,t,n){var i=Qe(e),o=i.on,l=i.emit,s=i.bind,d=i.unbind,a=e.state,u=t.Move,p=t.Scroll,I=t.Controller,S=t.Elements.track,v=t.Media.reduce,g=t.Direction,h=g.resolve,R=g.orient,T=u.getPosition,y=u.exceededLimit,w,N,_,W,C,P=!1,A,E,k;function B(){s(S,eo,go,vn),s(S,to,go,vn),s(S,Aa,K,vn),s(S,"click",b,{capture:!0}),s(S,"dragstart",Ht),o([Qt,gt],V)}function V(){var G=n.drag;me(!G),W=G==="free"}function K(G){if(A=!1,!E){var f=be(G);pe(G.target)&&(f||!G.button)&&(I.isBusy()?Ht(G,!0):(k=f?S:window,C=a.is([_n,Yn]),_=null,s(k,eo,ee,vn),s(k,to,m,vn),u.cancel(),p.cancel(),F(G)))}}function ee(G){if(a.is(xi)||(a.set(xi),l(da)),G.cancelable)if(C){u.translate(w+he(Y(G)));var f=fe(G)>pr,H=P!==(P=y());(f||H)&&F(G),A=!0,l(ua),Ht(G)}else O(G)&&(C=$(G),Ht(G))}function m(G){a.is(xi)&&(a.set($n),l(pa)),C&&(M(G),Ht(G)),d(k,eo,ee),d(k,to,m),C=!1}function b(G){!E&&A&&Ht(G,!0)}function F(G){_=N,N=G,w=T()}function M(G){var f=U(G),H=te(f),j=n.rewind&&n.rewindByDrag;v(!1),W?I.scroll(H,0,n.snap):e.is(ii)?I.go(R(fo(f))<0?j?"<":"-":j?">":"+"):e.is(Tn)&&P&&j?I.go(y(!0)?">":"<"):I.go(I.toDest(H),!0),v(!0)}function $(G){var f=n.dragMinThreshold,H=Hn(f),j=H&&f.mouse||0,ne=(H?f.touch:+f)||10;return vt(Y(G))>(be(G)?ne:j)}function O(G){return vt(Y(G))>vt(Y(G,!0))}function U(G){if(e.is(Mn)||!P){var f=fe(G);if(f&&f<pr)return Y(G)/f}return 0}function te(G){return T()+fo(G)*Yt(vt(G)*(n.flickPower||600),W?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function Y(G,f){return q(G,f)-q(x(G),f)}function fe(G){return ho(G)-ho(x(G))}function x(G){return N===G&&_||N}function q(G,f){return(be(G)?G.changedTouches[0]:G)["page"+h(f?"Y":"X")]}function he(G){return G/(P&&e.is(Tn)?as:1)}function pe(G){var f=n.noDrag;return!Bn(G,"."+Ea+", ."+Di)&&(!f||!Bn(G,f))}function be(G){return typeof TouchEvent<"u"&&G instanceof TouchEvent}function J(){return C}function me(G){E=G}return{mount:B,disable:me,isDragging:J}}var Is={Spacebar:" ",Right:ji,Left:Oi,Up:xa,Down:Sa};function zo(e){return e=Xt(e)?e:e.key,Is[e]||e}var mr="keydown";function Rs(e,t,n){var i=Qe(e),o=i.on,l=i.bind,s=i.unbind,d=e.root,a=t.Direction.resolve,u,p;function I(){S(),o(gt,v),o(gt,S),o(Gt,h)}function S(){var T=n.keyboard;T&&(u=T==="global"?window:d,l(u,mr,R))}function v(){s(u,mr)}function g(T){p=T}function h(){var T=p;p=!0,Jr(function(){p=T})}function R(T){if(!p){var y=zo(T);y===a(Oi)?e.go("<"):y===a(ji)&&e.go(">")}}return{mount:I,destroy:v,disable:g}}var Wn=Po+"-lazy",$i=Wn+"-srcset",Ps="["+Wn+"], ["+$i+"]";function _s(e,t,n){var i=Qe(e),o=i.on,l=i.off,s=i.bind,d=i.emit,a=n.lazyLoad==="sequential",u=[An,un],p=[];function I(){n.lazyLoad&&(S(),o(it,S))}function S(){Dt(p),v(),a?T():(l(u),o(u,g),g())}function v(){t.Slides.forEach(function(y){Ro(y.slide,Ps).forEach(function(w){var N=Rt(w,Wn),_=Rt(w,$i);if(N!==w.src||_!==w.srcset){var W=n.classes.spinner,C=w.parentElement,P=ei(C,"."+W)||Sn("span",W,C);p.push([w,y,P]),w.src||zn(w,"none")}})})}function g(){p=p.filter(function(y){var w=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,w)?h(y):!0}),p.length||l(u)}function h(y){var w=y[0];Mt(y[1].slide,xo),s(w,"load error",Ue(R,y)),Ee(w,"src",Rt(w,Wn)),Ee(w,"srcset",Rt(w,$i)),kt(w,Wn),kt(w,$i)}function R(y,w){var N=y[0],_=y[1];Ot(_.slide,xo),w.type!=="error"&&(cn(y[2]),zn(N,""),d(No,N,_),d(wn)),a&&T()}function T(){p.length&&h(p.shift())}return{mount:I,destroy:Ue(Dt,p),check:g}}function As(e,t,n){var i=Qe(e),o=i.on,l=i.emit,s=i.bind,d=t.Slides,a=t.Elements,u=t.Controller,p=u.hasFocus,I=u.getIndex,S=u.go,v=t.Direction.resolve,g=a.pagination,h=[],R,T;function y(){w(),o([gt,it,_i],y);var E=n.pagination;g&&zn(g,E?"":"none"),E&&(o([Gt,Ni,un],A),N(),A(),l(ha,{list:R,items:h},P(e.index)))}function w(){R&&(cn(g?Zt(R.children):R),Ot(R,T),Dt(h),R=null),i.destroy()}function N(){var E=e.length,k=n.classes,B=n.i18n,V=n.perPage,K=p()?u.getEnd()+1:Vn(E/V);R=g||Sn("ul",k.pagination,a.track.parentElement),Mt(R,T=Gi+"--"+C()),Ee(R,jt,"tablist"),Ee(R,Tt,B.select),Ee(R,Bo,C()===zi?"vertical":"");for(var ee=0;ee<K;ee++){var m=Sn("li",null,R),b=Sn("button",{class:k.page,type:"button"},m),F=d.getIn(ee).map(function($){return $.slide.id}),M=!p()&&V>1?B.pageX:B.slideX;s(b,"click",Ue(_,ee)),n.paginationKeyboard&&s(b,"keydown",Ue(W,ee)),Ee(m,jt,"presentation"),Ee(b,jt,"tab"),Ee(b,ni,F.join(" ")),Ee(b,Tt,yo(M,ee+1)),Ee(b,Cn,-1),h.push({li:m,button:b,page:ee})}}function _(E){S(">"+E,!0)}function W(E,k){var B=h.length,V=zo(k),K=C(),ee=-1;V===v(ji,!1,K)?ee=++E%B:V===v(Oi,!1,K)?ee=(--E+B)%B:V==="Home"?ee=0:V==="End"&&(ee=B-1);var m=h[ee];m&&(ta(m.button),S(">"+ee),Ht(k,!0))}function C(){return n.paginationDirection||n.direction}function P(E){return h[u.toPage(E)]}function A(){var E=P(I(!0)),k=P(I());if(E){var B=E.button;Ot(B,dn),kt(B,lr),Ee(B,Cn,-1)}if(k){var V=k.button;Mt(V,dn),Ee(V,lr,!0),Ee(V,Cn,"")}l(fa,{list:R,items:h},E,k)}return{items:h,mount:y,destroy:w,getAt:P,update:A}}var Ms=[" ","Enter"];function ks(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function d(){l.forEach(function(g){g.destroy()}),Dt(l)}function a(){d(),s()}function u(g,h){var R=Qe(g);R.on(Gt,function(T,y,w){h.go(h.is(Mn)?w:T)}),l.push(R)}function p(){var g=Qe(e),h=g.on;h(Ao,S),h(va,v),h([Qt,gt],I),l.push(g),g.emit(ko,e.splides)}function I(){Ee(t.Elements.list,Bo,n.direction===zi?"vertical":"")}function S(g){e.go(g.index)}function v(g,h){Eo(Ms,zo(h))&&(S(g),Ht(h))}return{setup:Ue(t.Media.set,{slideFocus:Jn(o)?i:o},!0),mount:s,destroy:d,remount:a}}function Fs(e,t,n){var i=Qe(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,vn)}function d(u){if(u.cancelable){var p=u.deltaY,I=p<0,S=ho(u),v=n.wheelMinThreshold||0,g=n.wheelSleep||0;vt(p)>v&&S-l>g&&(e.go(I?"<":">"),l=S),a(I)&&Ht(u)}}function a(u){return!n.releaseWheel||e.state.is(_n)||t.Controller.getAdjacent(u)!==-1}return{mount:s}}var Ws=90;function Ns(e,t,n){var i=Qe(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,d=Sn("span",ts),a=Hi(Ws,Ue(p,!1));function u(){s&&(S(!t.Autoplay.isPaused()),Ee(l,dr,!0),d.textContent="…",o(Fo,Ue(S,!0)),o(Wo,Ue(S,!1)),o([An,un],Ue(p,!0)))}function p(v){Ee(l,cr,v),v?(Qn(l,d),a.start()):(cn(d),a.cancel())}function I(){kt(l,[sr,dr,cr]),cn(d)}function S(v){s&&Ee(l,sr,v?"off":"polite")}return{mount:u,disable:S,destroy:I}}var Hs=Object.freeze({__proto__:null,Media:Kl,Direction:Ul,Elements:ls,Slides:cs,Layout:ds,Clones:ps,Move:ms,Controller:gs,Arrows:ys,Autoplay:bs,Cover:xs,Scroll:Ls,Drag:Es,Keyboard:Rs,LazyLoad:_s,Pagination:As,Sync:ks,Wheel:Fs,Live:Ns}),Bs={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"},Os={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:os,i18n:Bs,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function js(e,t,n){var i=t.Slides;function o(){Qe(e).on([Qt,it],l)}function l(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function s(d,a){i.style("transition","opacity "+n.speed+"ms "+n.easing),Jr(a)}return{mount:o,start:s,cancel:go}}function zs(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,d=Ue(It,s,"transition"),a;function u(){Qe(e).bind(s,"transitionend",function(v){v.target===s&&a&&(I(),a())})}function p(v,g){var h=i.toPosition(v,!0),R=i.getPosition(),T=S(v);vt(h-R)>=1&&T>=1?n.useScroll?l.scroll(h,T,!1,g):(d("transform "+T+"ms "+n.easing),i.translate(h,!0),a=g):(i.jump(v),g())}function I(){d(""),l.cancel()}function S(v){var g=n.rewindSpeed;if(e.is(Tn)&&g){var h=o.getIndex(!0),R=o.getEnd();if(h===0&&v>=R||h>=R&&v===0)return g}return n.speed}return{mount:u,start:p,cancel:I}}var Vs=(function(){function e(n,i){this.event=Qe(),this.Components={},this.state=Dl(xn),this.splides=[],this._o={},this._E={};var o=Xt(n)?ia(document,n):n;Fn(o,o+" is invalid."),this.root=o,i=qt({label:Rt(o,Tt)||"",labelledby:Rt(o,Ho)||""},Os,e.defaults,i||{});try{qt(i,JSON.parse(Rt(o,Po)))}catch{Fn(!1,"Invalid JSON")}this._o=Object.create(qt({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,d=this.Components;Fn(s.is([xn,Ii]),"Already mounted!"),s.set(xn),this._C=d,this._T=o||this._T||(this.is(ii)?js:zs),this._E=i||this._E;var a=jn({},Hs,this._E,{Transition:this._T});return sn(a,function(u,p){var I=u(l,d,l._o);d[p]=I,I.setup&&I.setup()}),sn(d,function(u){u.mount&&u.mount()}),this.emit(Qt),Mt(this.root,ns),s.set($n),this.emit(vo),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is($n)&&(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(Zt(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(it),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(xn)?Qe(this).on(vo,this.destroy.bind(this,i)):(sn(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(Mo),o.destroy(),i&&Dt(this.splides),l.set(Ii)),this},Bl(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})(),Vo=Vs;Vo.defaults={};Vo.STATES=jl;var gr=[[Qt,"onMounted"],[vo,"onReady"],[Gt,"onMove"],[An,"onMoved"],[Ao,"onClick"],[aa,"onActive"],[la,"onInactive"],[sa,"onVisible"],[ca,"onHidden"],[it,"onRefresh"],[gt,"onUpdated"],[wn,"onResize"],[Wi,"onResized"],[da,"onDrag"],[ua,"onDragging"],[pa,"onDragged"],[Ni,"onScroll"],[un,"onScrolled"],[Mo,"onDestroy"],[ma,"onArrowsMounted"],[ga,"onArrowsUpdated"],[ha,"onPaginationMounted"],[fa,"onPaginationUpdated"],[ko,"onNavigationMounted"],[Fo,"onAutoplayPlay"],[ya,"onAutoplayPlaying"],[Wo,"onAutoplayPause"],[No,"onLazyLoadLoaded"]];function Do(...e){return e.filter(Boolean).join(" ")}function Ai(e){return e!==null&&typeof e=="object"}function So(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!So(n,t[i]));if(Ai(e)&&Ai(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!So(e[o],t[o]))}return e===t}function Ds(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Gs(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 Co(e,t){const n=e;return Gs(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Ai(i)?n[o]=Co(Ai(n[o])?n[o]:{},i):n[o]=i}),n}var Ks=({children:e,className:t,...n})=>c.createElement("div",{className:Do("splide__track",t),...n},c.createElement("ul",{className:"splide__list"},e)),Go=class extends c.Component{constructor(){super(...arguments),this.splideRef=c.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Vo(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Co({},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&&!So(this.options,e)&&(this.splide.options=e,this.options=Co({},e));const t=this.getSlides();Ds(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){gr.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 c.createElement(t,{className:Do("splide",e),ref:this.splideRef,...this.omit(o,["options",...gr.map(l=>l[1])])},n?c.createElement(Ks,null,i):i)}},Ko=({children:e,className:t,...n})=>c.createElement("li",{className:Do("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 Us="RichTextRenderer-module__link___BWeZ2",qs={link:Us},Xs=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))},Ki=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Xs(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function _t(e){const{color:t,...n}=e;return n}function ut(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Ki(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:T.scalingValue(e.letterSpacing,t),wordSpacing:T.scalingValue(e.wordSpacing,t),fontSize:T.scalingValue(n,t),lineHeight:i!==void 0?T.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(l=e.textAppearance)==null?void 0:l.textDecoration,fontVariant:(s=e.textAppearance)==null?void 0:s.fontVariant,textAlign:e.textAlign,color:e.color}}const Gn=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:qs.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Ys(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 Ys(e){return{...e.fontFamily&&{fontFamily:Ki(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 Js="SvgImage-module__svg___q3xE-",Zs="SvgImage-module__img___VsTm-",hr={svg:Js,img:Zs},Qs=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},ec=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,At=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[l,s]=c.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return c.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');s(d)}},[]),!Qs(e)||!l?r.jsx("img",{src:e,alt:"",className:Ne(hr.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:Ne(hr.svg,i),style:{"--svg":ec(e),"--fill":t,"--hover-fill":n,...o??{}}})},tc={"top-left":ve.topLeftAlignment,"top-center":ve.topCenterAlignment,"top-right":ve.topRightAlignment,"middle-left":ve.middleLeftAlignment,"middle-center":ve.middleCenterAlignment,"middle-right":ve.middleRightAlignment,"bottom-left":ve.bottomLeftAlignment,"bottom-center":ve.bottomCenterAlignment,"bottom-right":ve.bottomRightAlignment};function nc({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=c.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:a,textAlign:u,wordSpacing:p,fontSizeLineHeight:I,textAppearance:x,color:b}=n.imageCaption,[g,h]=c.useState(void 0),[R,w]=c.useState(null),[y,$]=c.useState(0),[N,_]=c.useState(0),{direction:M,transition:S,controls:P,pagination:k,imageCaption:L,triggers:F}=e,B=c.useRef(S.type),{x:z,y:K}=e.controls.offset,Z=m=>{o&&o.go(m)};return c.useEffect(()=>{if(!R)return;const m=new ResizeObserver(E=>{if(!o)return;const[W]=E;h({width:Math.round(W.contentRect.width),height:Math.round(W.contentRect.height)})});return m.observe(R),()=>m.unobserve(R)},[R]),c.useEffect(()=>{!o||B.current===S.type||(_(m=>m+1),B.current=S.type)},[S.type]),r.jsx("div",{className:Ne(ve.wrapper,{[ve.editor]:i}),ref:w,children:r.jsxs("div",{className:ve.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:S.backgroundColor&&S.type==="fade in"?S.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:Ne(ve.captionBlock),children:r.jsx("div",{className:ve.captionTextWrapper,children:t.map((m,E)=>r.jsx("div",{className:Ne(ve.captionText,tc[L.alignment],{[ve.withPointerEvents]:E===y&&i,[ve.active]:E===y}),style:{fontFamily:Ki(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":T.scalingValue(s.width,i),letterSpacing:T.scalingValue(a,i),wordSpacing:T.scalingValue(p,i),textAlign:u,fontSize:T.scalingValue(I.fontSize,i),lineHeight:T.scalingValue(I.lineHeight,i),textTransform:x.textTransform??"none",textDecoration:x.textDecoration??"none",fontVariant:x.fontVariant??"normal",color:b,transitionDuration:S.duration?`${Math.round(parseInt(S.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:ve.captionTextInner,style:{"--link-hover-color":L.linkHoverColor,"--link-color":L.linkColor,position:"relative",top:T.scalingValue(L.offset.y,i),left:T.scalingValue(L.offset.x,i)},children:r.jsx(Gn,{content:m.imageCaption})})},E))})}),r.jsx(Go,{onMove:m=>{$(m.index)},ref:l,options:{arrows:!1,speed:S.duration?parseInt(S.duration):500,autoplay:F.autoPlay!==null,...F.autoPlay!==null&&{interval:parseInt(F.autoPlay)*1e3},direction:M==="horiz"||S.type==="fade in"?"ltr":"ttb",pagination:!1,drag:F.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:S.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((m,E)=>r.jsx(Ko,{children:r.jsx("div",{className:ve.sliderItem,children:r.jsx("div",{className:ve.imgWrapper,children:r.jsx("img",{className:Ne(ve.sliderImage,{[ve.contain]:m.image.objectFit==="contain",[ve.cover]:m.image.objectFit==="cover"}),src:m.image.url,alt:m.image.name??""})})})},E))},N),P.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Ne(ve.arrow,{[ve.arrowVertical]:M==="vert",[ve.hoverArrow]:P.show==="on hover"}),style:{color:P.color,"--arrow-hover-color":P.hover},children:r.jsxs("button",{onClick:()=>{Z("-1")},className:ve.arrowInner,style:{transform:`translate(${T.scalingValue(z,i)}, ${T.scalingValue(K*(M==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${M==="horiz"?"0deg":"90deg"})`},children:[P.arrowsImgUrl&&r.jsx(At,{url:P.arrowsImgUrl,fill:P.color,hoverFill:P.hover,className:Ne(ve.arrowImg,ve.mirror)}),!P.arrowsImgUrl&&r.jsx(fr,{color:P.color,className:Ne(ve.arrowIcon,ve.arrowImg,ve.mirror)})]})}),r.jsx("div",{className:Ne(ve.arrow,ve.nextArrow,{[ve.arrowVertical]:M==="vert",[ve.hoverArrow]:P.show==="on hover"}),style:{color:P.color,"--arrow-hover-color":P.hover},children:r.jsxs("button",{className:ve.arrowInner,onClick:()=>Z("+1"),style:{transform:`translate(${T.scalingValue(z*(M==="horiz"?-1:1),i)}, ${T.scalingValue(K,i)}) scale(${e.controls.scale/100}) rotate(${M==="horiz"?"0deg":"90deg"})`},children:[P.arrowsImgUrl&&r.jsx(At,{url:P.arrowsImgUrl,fill:P.color,hoverFill:P.hover,className:ve.arrowImg}),!P.arrowsImgUrl&&r.jsx(fr,{color:P.color,className:Ne(ve.arrowIcon,ve.arrowImg)})]})})]}),F.triggersList.click&&r.jsx("div",{className:ve.clickOverlay,onClick:()=>{o&&o.go("+1")}}),k.isActive&&r.jsx("div",{className:Ne(ve.pagination,{[ve.paginationInsideBottom]:k.position==="inside-1"&&M==="horiz",[ve.paginationInsideTop]:k.position==="inside-2"&&M==="horiz",[ve.paginationOutsideBottom]:k.position==="outside-1"&&M==="horiz",[ve.paginationOutsideTop]:k.position==="outside-2"&&M==="horiz",[ve.paginationInsideLeft]:k.position==="inside-1"&&M==="vert",[ve.paginationInsideRight]:k.position==="inside-2"&&M==="vert",[ve.paginationOutsideLeft]:k.position==="outside-1"&&M==="vert",[ve.paginationOutsideRight]:k.position==="outside-2"&&M==="vert",[ve.paginationVertical]:M==="vert"}),children:r.jsx("div",{className:ve.paginationInner,style:{backgroundColor:k.colors[2],transform:`scale(${k.scale/100}) translate(${T.scalingValue(k.offset.x,i)}, ${T.scalingValue(k.offset.y,i)}) rotate(${M==="horiz"?"0deg":"90deg"})`},children:t.map((m,E)=>r.jsx("button",{onClick:()=>{o&&o.go(E)},className:Ne(ve.paginationItem),children:r.jsx("div",{className:Ne(ve.dot,{[ve.activeDot]:E===y}),style:{backgroundColor:E===y?k.colors[0]:k.colors[1],"--pagination-hover-color":k.hover}})},E))})})]})})}function fr({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 ic={element:nc,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"]}},oc="ImageRevealSlider-module__imageRevealSlider___UE5Ob",rc="ImageRevealSlider-module__image___Qjt-e",ac="ImageRevealSlider-module__link___N-iLG",lc="ImageRevealSlider-module__cursor___2U03d",fn={imageRevealSlider:oc,image:rc,link:ac,cursor:lc};function yr(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const l=i.width?Number.parseFloat(i.width):o.naturalWidth,s=o.naturalHeight/o.naturalWidth*l,d=l/2,a=s/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-a&&t<=i.y+a)return!0}return!1}function no(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function sc(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await no(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await no(e);l=s.height/s.width*o}else{const s=await no(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function cc({settings:e,content:t,isEditor:n}){const[i,o]=c.useState(null),[l,s]=c.useState([]),[d,a]=c.useState(0),u=c.useRef(0),[p,I]=c.useState({x:0,y:0}),[x,b]=c.useState(1),[g,h]=c.useState("none"),R=c.useRef({x:0,y:0}),[w,y]=c.useState(!1),{sizeType:$,imageWidth:N,randomRangeImageWidth:_}=e.imageSize,{revealPosition:M,visible:S}=e.position,{cursorType:P,target:k,defaultCursorScale:L,defaultCursor:F,hoverCursorScale:B,hoverCursor:z}=e.cursor;c.useEffect(()=>{if(!i)return;const m=(A,C)=>{const V=i.getBoundingClientRect(),q=A-V.left,ee=C-V.top;if(I({x:q,y:ee}),P==="system"){h("none"),b(1);return}const J=q,ye=ee,v=document.elementFromPoint(V.left+J,V.top+ye);if(v&&v.closest("a")){h("none"),b(1);return}const U=yr(J,ye,l)||k==="area"?{img:z??"none",scale:B}:{img:F??"none",scale:L};h(U.img),b(U.scale)},E=A=>{A.stopPropagation(),R.current={x:A.clientX,y:A.clientY},m(A.clientX,A.clientY)},W=()=>{w&&m(R.current.x,R.current.y)};return i.addEventListener("mousemove",E),window.addEventListener("scroll",W,!0),()=>{i.removeEventListener("mousemove",E),window.removeEventListener("scroll",W,!0)}},[i,w,p,P,k,z,F,B,L,l]),c.useEffect(()=>{w||(h("none"),b(0))},[w]);const K=async(m,E,W,A={})=>{const{width:C,height:V,finalWidth:q}=await sc(m.image.url,$,N,_);let ee=0,J=0;M==="same"?(ee=E/2,J=W/2):(ee=A.x??Math.random()*E,J=A.y??Math.random()*W);const ye=Math.min(Math.max(ee,C/2),E-C/2),v=Math.min(Math.max(J,V/2),W-V/2);return{id:u.current++,url:m.image.url,link:m.link,name:m.image.name,x:ye,y:v,width:q}};c.useEffect(()=>{if(!i||t.length===0)return;const m=i.getBoundingClientRect(),E=m.width,W=m.height,A=[];(async()=>{const V=t[0],q=await K(V,E,W);A.push(q),s(A),a(1)})()},[$,N,_,M,i]),c.useEffect(()=>{S==="last One"&&s(m=>m.length>0?[m[m.length-1]]:[])},[S]);const Z=async m=>{if(!i)return;const E=i.getBoundingClientRect(),W=m.clientX-E.left,A=m.clientY-E.top;if(k==="image"&&!yr(W,A,l))return;let C=0,V=0;M==="on Click"?(C=W,V=A):M==="same"?(C=E.width/2,V=E.height/2):(C=Math.random()*E.width,V=Math.random()*E.height);const q=t[d],ee=await K(q,E.width,E.height,{x:C,y:V});s(J=>S==="all"?[...J,ee]:[ee]),a(J=>J>=t.length-1?0:J+1)};return r.jsxs("div",{ref:o,onClick:Z,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:fn.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[l.map(m=>r.jsx("div",{className:fn.wrapper,style:{top:`${m.y}px`,left:`${m.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:m.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:k==="area"&&m.link?r.jsx("a",{href:m.link,target:"_blank",className:fn.link,children:r.jsx("img",{src:m.url,alt:m.name,className:fn.image},m.id)}):r.jsx("img",{src:m.url,alt:m.name,className:fn.image},m.id)},m.id)),w&&r.jsx("div",{className:fn.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 dc={element:cc,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:""}]}}}},uc="LightBox-module__hidden___9s-9x",pc="LightBox-module__heroImage___sTxNF",mc="LightBox-module__background___rm9ml",gc="LightBox-module__editor___4ACaY",hc="LightBox-module__contentStyle___Bgnsq",fc="LightBox-module__imageStyle___tLIlB",yc="LightBox-module__imgWrapper___LuFUp",vc="LightBox-module__contain___8-yaS",bc="LightBox-module__cover___hNvOG",xc="LightBox-module__caption___b6L2I",Sc="LightBox-module__captionTextInner___rCGNH",Cc="LightBox-module__lightboxSplide___XFuWC",$c="LightBox-module__arrow___iz38X",wc="LightBox-module__arrowVertical___Zfz81",Tc="LightBox-module__nextArrow___zkAQN",Lc="LightBox-module__arrowInner___p48sW",Ec="LightBox-module__arrowIcon___3VaFf",Ic="LightBox-module__arrowImg___pNV88",Rc="LightBox-module__mirror___pjeXc",Pc="LightBox-module__thumbsWrapper___GB-nU",_c="LightBox-module__thumbsContainerVertical___wttk5",Ac="LightBox-module__thumbsContainer___osSma",Mc="LightBox-module__thumbsAlignStart___MO6tY",kc="LightBox-module__thumbsAlignCenter___Q4sUx",Fc="LightBox-module__thumbsAlignEnd___p4y9R",Wc="LightBox-module__thumbItem___HvnF3",Nc="LightBox-module__closeButton___g2khP",Hc="LightBox-module__fadeIn___0m5GW",Bc="LightBox-module__slideInLeft___gPYwC",Oc="LightBox-module__slideInRight___S-pPp",jc="LightBox-module__slideInTop___DFdAj",zc="LightBox-module__slideInBottom___m27kZ",Vc="LightBox-module__fadeOut___55qBR",Dc="LightBox-module__slideOutLeft___NvU7P",Gc="LightBox-module__slideOutRight___SK7eC",Kc="LightBox-module__slideOutTop___Vgg0z",Uc="LightBox-module__slideOutBottom___nJ0Ef",qc="LightBox-module__scaleSlide___vZriG",le={hidden:uc,heroImage:pc,background:mc,editor:gc,contentStyle:hc,imageStyle:fc,imgWrapper:yc,contain:vc,cover:bc,caption:xc,captionTextInner:Sc,lightboxSplide:Cc,arrow:$c,arrowVertical:wc,nextArrow:Tc,arrowInner:Lc,arrowIcon:Ec,arrowImg:Ic,mirror:Rc,thumbsWrapper:Pc,thumbsContainerVertical:_c,thumbsContainer:Ac,thumbsAlignStart:Mc,thumbsAlignCenter:kc,thumbsAlignEnd:Fc,thumbItem:Wc,closeButton:Nc,fadeIn:Hc,slideInLeft:Bc,slideInRight:Oc,slideInTop:jc,slideInBottom:zc,fadeOut:Vc,slideOutLeft:Dc,slideOutRight:Gc,slideOutTop:Kc,slideOutBottom:Uc,scaleSlide:qc},di=(e,t,n)=>{const i={},[o,l]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),l==="left"?(i.left="0",i.right="auto"):l==="center"?(i.left="50%",i.right="auto"):l==="right"&&(i.left="auto",i.right="0"),o==="middle"&&l==="center"?i.transform=`translate(calc(-50% + ${T.scalingValue(t.x,n)}), calc(-50% + ${T.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${T.scalingValue(t.x,n)}, calc(-50% + ${T.scalingValue(t.y,n)}))`:l==="center"?i.transform=`translate(calc(-50% + ${T.scalingValue(t.x,n)}), ${T.scalingValue(t.y,n)})`:i.transform=`translate(${T.scalingValue(t.x,n)}, ${T.scalingValue(t.y,n)})`,i};function Ma(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 vr(e){const t=e.getBoundingClientRect(),n=Ma(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,s=e.naturalHeight,d=i/o,a=l/s;let u,p;a>d?(u=i,p=i/a):(p=o,u=o*a);const I=t.left+n.left,x=t.top+n.top,b=(i-u)/2+I,g=(o-p)/2+x;return{x:b,y:g,width:u,height:p}}function br(e){const t=e.getBoundingClientRect(),n=Ma(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function xr(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 Xc(e,t){const n=(()=>{if(e==="fade in")return le.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return le.slideInLeft;case"right":return le.slideInRight;case"top":return le.slideInTop;case"bottom":return le.slideInBottom;default:return le.slideInRight}return le.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return le.fadeIn;if(e==="slide in")switch(t){case"left":return le.slideInLeft;case"right":return le.slideInRight;case"top":return le.slideInTop;case"bottom":return le.slideInBottom;default:return le.slideInRight}return le.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return le.fadeOut;if(e==="slide in")switch(t){case"left":return le.slideOutLeft;case"right":return le.slideOutRight;case"top":return le.slideOutTop;case"bottom":return le.slideOutBottom;default:return le.slideOutRight}return le.fadeOut})(),l=(()=>{if(e==="fade in")return le.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return le.slideOutLeft;case"right":return le.slideOutRight;case"top":return le.slideOutTop;case"bottom":return le.slideOutBottom;default:return le.slideOutRight}return le.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const Yc=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:l,isPreviewMode:s})=>{const[d,a]=c.useState(!1),{url:u}=e.thumbnailBlock.cover;return c.useEffect(()=>{o==="close"&&a(!1),o==="open"&&a(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:le.heroImage,onClick:()=>a(!0)}),r.jsx(Jc,{isOpen:d,onClose:()=>a(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},Jc=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:d})=>{var G;const[a,u]=c.useState(0),[p,I]=c.useState(0),[x,b]=c.useState(!1),[g,h]=c.useState(!1),[R,w]=c.useState({}),y=c.useRef(null),$=c.useRef(null),N=c.useRef(null),_=c.useRef(!1),M=c.useRef(null),S=c.useRef(null),P=c.useRef(null),k=c.useRef(null),L=c.useRef(!1),F=c.useRef(null),[B,z]=c.useState(!1),{appear:K,triggers:Z,slider:m,thumbnail:E,controls:W,area:A,caption:C,layout:V}=o.lightboxBlock,{appearClass:q,backdropAppearClass:ee,backdropDisappearClass:J,disappearClass:ye}=Xc(K.type,K.direction),v=(d==null?void 0:d.itemId)??null;c.useEffect(()=>{const f=()=>{setTimeout(()=>{var j,te;(te=(j=y.current)==null?void 0:j.splide)==null||te.refresh()},16)},H=()=>{I(j=>j+1)};return window.addEventListener("ArticleEditor.Layout:change",f),window.addEventListener("ArticleEditor.ComponentContent:change",H),()=>{window.removeEventListener("ArticleEditor.Layout:change",f),window.removeEventListener("ArticleEditor.ComponentContent:change",H)}},[]),c.useEffect(()=>{if(!e||!E.isActive){z(!1);return}const f=F.current;if(!f)return;const H=()=>{m.direction==="horiz"?z(f.scrollWidth>f.clientWidth):z(f.scrollHeight>f.clientHeight)};H();const j=new ResizeObserver(H);return j.observe(f),()=>j.disconnect()},[e,E.isActive,n.length,R,m.direction]);const U=c.useCallback(()=>{const f=window.matchMedia("(max-width: 768px)").matches,H=xr(A.color);f&&!s&&H>.9&&(document.body.style.backgroundColor=""),b(!0),_.current=!0;const j=te=>{te.target===M.current&&te.animationName&&(M.current&&S.current&&M.current.removeEventListener("animationend",S.current),S.current=null,_.current&&(_.current=!1,t()),b(!1))};M.current&&(S.current=j,M.current.addEventListener("animationend",j))},[t,A.color,s]),he=(f,H,j)=>{var te,ce;if(f){if(Z.type==="click"&&Z.switch==="image")Z.repeat==="close"&&a===n.length-1?U():(te=y.current)==null||te.go("+1");else if(Z.type==="click"&&Z.switch==="50/50"){const ne=f.getBoundingClientRect(),Q=H-ne.left,pe=j-ne.top,Se=ne.width,be=ne.height;let D;m.direction==="horiz"?D=Q<Se/2?"-1":"+1":D=pe<be/2?"-1":"+1",(ce=y.current)==null||ce.go(D)}}},ue=f=>{if(L.current){L.current=!1;return}const H=n[a],j=(H==null?void 0:H.image.objectFit)==="cover";let te,ce;if("changedTouches"in f&&f.changedTouches.length>0)te=f.changedTouches[0].clientX,ce=f.changedTouches[0].clientY;else if("clientX"in f)te=f.clientX,ce=f.clientY;else return;let ne;if(j&&N.current){const Q=br(N.current);ne=te>=Q.left&&te<=Q.right&&ce>=Q.top&&ce<=Q.bottom}else{const Q=N.current?vr(N.current):null;if(!Q){f.target===f.currentTarget&&U();return}ne=te>=Q.x&&te<=Q.x+Q.width&&ce>=Q.y&&ce<=Q.y+Q.height}ne?he(N.current,te,ce):U()},ge=f=>{const H=f.target;(H.classList.contains(le.thumbsWrapper)||H.classList.contains(le.thumbsContainer))&&ue(f)};c.useEffect(()=>{if(!e)return;const f=H=>{var j,te;if(H.key==="Escape"){U();return}if(H.key==="ArrowRight"){u(ce=>(ce+1)%Math.max(n.length,1)),(j=y.current)==null||j.go("+1");return}H.key==="ArrowLeft"&&(u(ce=>(ce-1+Math.max(n.length,1))%Math.max(n.length,1)),(te=y.current)==null||te.go("-1"))};return window.addEventListener("keydown",f),()=>{window.removeEventListener("keydown",f)}},[e,U,n.length]),c.useEffect(()=>{if(e){if(u(0),I(H=>H+1),_.current=!1,b(!1),h(!1),w({}),!v)return;const f=new CustomEvent("page-overlay",{detail:{itemId:v}});window.dispatchEvent(f)}return()=>{M.current&&S.current&&(M.current.removeEventListener("animationend",S.current),S.current=null),h(!1)}},[e,v]),c.useEffect(()=>{$.current!==null&&$.current!==m.type&&I(f=>f+1),$.current=m.type},[m.type]),c.useEffect(()=>{if(!e)return;const f=document.body.style.overflow,H=window.matchMedia("(max-width: 768px)").matches,j=xr(A.color);document.body.style.overflow="hidden",h(!1);const te=ne=>{ne.target===M.current&&!_.current&&ne.animationName&&(H&&!s&&j>.9&&(document.body.style.backgroundColor=A.color),h(!0),M.current&&P.current&&M.current.removeEventListener("animationend",P.current),P.current=null)};M.current&&(P.current=te,M.current.addEventListener("animationend",te));const ce=ne=>{const Q=ne.target;Q&&(Q.closest(`.${le.thumbsWrapper}`)||Q.closest(`.${le.thumbsContainer}`))||m.type!=="slide"&&ne.preventDefault()};return document.addEventListener("touchmove",ce,{passive:!1}),()=>{document.body.style.overflow=f,document.removeEventListener("touchmove",ce),M.current&&P.current&&(M.current.removeEventListener("animationend",P.current),P.current=null),h(!1)}},[e,s,A.color,m.type]),c.useEffect(()=>{if(!e)return;const f=H=>{var te,ce;if(_.current){H.stopPropagation();return}if(L.current){L.current=!1;return}const j=H.target;if(!(j&&(j.closest(`.${le.thumbsContainer}`)||j.closest(`.${le.thumbItem}`)||j.closest(`.${le.arrow}`)||j.closest(`.${le.closeButton}`)||j.closest(`.${le.caption}`)))){if(m.type==="slide"&&Z.type==="drag"&&((ce=(te=y.current)==null?void 0:te.splide)!=null&&ce.root)){const ne=y.current.splide.root;if(j&&(ne.contains(j)||ne===j))return}if(H.touches.length===0&&H.changedTouches.length>0){const ne=n[a],Q=(ne==null?void 0:ne.image.objectFit)==="cover",pe=H.changedTouches[0];let Se;if(Q&&N.current){const be=br(N.current);Se=pe.clientX>=be.left&&pe.clientX<=be.right&&pe.clientY>=be.top&&pe.clientY<=be.bottom}else{const be=N.current?vr(N.current):null;if(!be)return;Se=pe.clientX>=be.x&&pe.clientX<=be.x+be.width&&pe.clientY>=be.y&&pe.clientY<=be.y+be.height}if(!Se){H.stopPropagation(),_.current=!0;const be=D=>{D.stopPropagation(),D.preventDefault(),document.removeEventListener("click",be,!0)};document.addEventListener("click",be,!0),U()}}}};return document.addEventListener("touchend",f,{passive:!0}),()=>{document.removeEventListener("touchend",f)}},[e,U,a,n]);const ie=(m.type==="scale"||m.type==="fade")&&m.direction==="vert"&&Z.type==="drag";c.useEffect(()=>{var D,de;if(!e||!ie||!((de=(D=y.current)==null?void 0:D.splide)!=null&&de.root))return;const f=y.current.splide.root,H=30,j=(O,Y)=>{if(k.current){const we=Math.abs(O-k.current.x),Pe=Math.abs(Y-k.current.y);(we>0||Pe>0)&&(L.current=!0)}},te=O=>{k.current&&(O.preventDefault(),j(O.clientX,O.clientY))},ce=O=>{k.current&&O.touches.length>0&&(O.preventDefault(),j(O.touches[0].clientX,O.touches[0].clientY))},ne=(O,Y)=>{if(!k.current||!y.current){k.current=null;return}const we=Math.abs(O-k.current.x),Pe=Math.abs(Y-k.current.y);Pe>H&&Pe>we&&y.current.go(Y<k.current.y?"+1":"-1"),k.current=null},Q=O=>{k.current&&ne(O.clientX,O.clientY),document.removeEventListener("pointerup",Q),document.removeEventListener("pointercancel",Q),document.removeEventListener("pointermove",te)},pe=O=>{if(k.current){if(O.changedTouches.length>0){const Y=O.changedTouches[0];ne(Y.clientX,Y.clientY)}document.removeEventListener("touchend",pe),document.removeEventListener("touchcancel",pe),document.removeEventListener("touchmove",ce)}},Se=O=>{k.current={x:O.clientX,y:O.clientY},L.current=!1,document.addEventListener("pointermove",te,{passive:!1}),document.addEventListener("pointerup",Q),document.addEventListener("pointercancel",Q)},be=O=>{O.touches.length>0&&(k.current={x:O.touches[0].clientX,y:O.touches[0].clientY},L.current=!1,document.addEventListener("touchmove",ce,{passive:!1}),document.addEventListener("touchend",pe),document.addEventListener("touchcancel",pe))};return f.addEventListener("pointerdown",Se),f.addEventListener("touchstart",be),()=>{f.removeEventListener("pointerdown",Se),f.removeEventListener("touchstart",be),document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",Q),document.removeEventListener("pointercancel",Q),document.removeEventListener("touchmove",ce),document.removeEventListener("touchend",pe),document.removeEventListener("touchcancel",pe),k.current=null,L.current=!1}},[e,ie,p]);const fe={backgroundColor:A.color,backdropFilter:`blur(${A.blur}px)`,animationDuration:`${parseInt(K.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:Xn.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:M,className:Ne(le.background,x?J:ee,{[le.editor]:s},{[le.hidden]:!e}),style:{...fe,...g&&!s&&!x?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?M:null,className:Ne(le.contentStyle,x?ye:q,{[le.editor]:s},{[le.hidden]:!e}),style:{animationDuration:`${parseInt(K.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Go,{onMove:f=>u(f.index),ref:y,className:le.lightboxSplide,options:{arrows:!1,speed:m.duration?parseInt(m.duration):500,direction:m.direction==="horiz"||m.type==="fade"||m.type==="scale"?"ltr":"ttb",pagination:!1,drag:Z.type==="drag"&&!ie,perPage:1,width:"100%",height:"100%",type:m.type==="fade"||m.type==="scale"?"fade":"loop",padding:0,rewind:Z.repeat!=="close",start:0},style:{"--splide-speed":m.duration},children:n.map((f,H)=>{const j=di(V.position,V.offset,s),te=`${T.scalingValue(V.padding.top,s)} ${T.scalingValue(V.padding.right,s)} ${T.scalingValue(V.padding.bottom,s)} ${T.scalingValue(V.padding.left,s)}`,ce=m.type==="scale"?(()=>{const{transform:ne,...Q}=j;return{...Q,position:"absolute",padding:te,boxSizing:"border-box","--position-transform":ne||"none"}})():{...j,position:"absolute",padding:te,boxSizing:"border-box"};return r.jsx(Ko,{children:r.jsx("div",{className:le.imgWrapper,onClick:ue,children:r.jsx("img",{ref:H===a?N:null,className:Ne(le.imageStyle,{[le.contain]:f.image.objectFit==="contain",[le.cover]:f.image.objectFit==="cover",[le.scaleSlide]:m.type==="scale"}),src:f.image.url,alt:f.image.name??"",style:{...ce,pointerEvents:f.image.objectFit==="contain"?"none":"auto"}})})},H)})},p),W.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Ne(le.arrow,{[le.arrowVertical]:m.direction==="vert"}),style:{color:W.color,"--arrow-hover-color":W.hover},children:r.jsxs("button",{className:le.arrowInner,style:{transform:`translate(${T.scalingValue(W.offset.x,s)}, ${T.scalingValue(W.offset.y*(m.direction==="horiz"?1:-1),s)}) scale(${W.scale}) rotate(${m.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var f;return(f=y.current)==null?void 0:f.go("-1")},"aria-label":"Previous",children:[W.arrowsImgUrl&&r.jsx(At,{url:W.arrowsImgUrl,fill:W.color,hoverFill:W.hover,className:Ne(le.arrowImg,le.mirror)}),!W.arrowsImgUrl&&r.jsx(Sr,{color:W.color,className:Ne(le.arrowIcon,le.arrowImg,le.mirror)})]})}),r.jsx("div",{className:Ne(le.arrow,le.nextArrow,{[le.arrowVertical]:m.direction==="vert"}),style:{color:W.color,"--arrow-hover-color":W.hover},children:r.jsxs("button",{className:le.arrowInner,style:{transform:`translate(${T.scalingValue(W.offset.x*(m.direction==="horiz"?-1:1),s)}, ${T.scalingValue(W.offset.y,s)}) scale(${W.scale}) rotate(${m.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var f;return(f=y.current)==null?void 0:f.go("+1")},"aria-label":"Next",children:[W.arrowsImgUrl&&r.jsx(At,{url:W.arrowsImgUrl,fill:W.color,hoverFill:W.hover,className:le.arrowImg}),!W.arrowsImgUrl&&r.jsx(Sr,{color:W.color,className:Ne(le.arrowIcon,le.arrowImg)})]})})]}),A.closeIconUrl&&(()=>{const f=di(A.closeIconAlign,A.closeIconOffset,s),H=`scale(${A.closeIconScale})`,j=f.transform?`${f.transform} ${H}`:H;return r.jsx("button",{className:le.closeButton,style:{...f,transform:j},onClick:U,"aria-label":"Close lightbox",children:r.jsx(At,{url:A.closeIconUrl,fill:A.closeIconColor??"#000000",hoverFill:A.closeIconHover??"#cccccc"})})})(),C&&C.isActive&&i.imageCaption&&((G=n[a])==null?void 0:G.imageCaption)&&(()=>{const{widthSettings:f,fontSettings:H,letterSpacing:j,textAlign:te,wordSpacing:ce,fontSizeLineHeight:ne,textAppearance:Q,color:pe}=i.imageCaption;return r.jsx("div",{className:le.caption,style:{...di(C.alignment,C.offset,s),fontFamily:Ki(H.fontFamily),fontWeight:H.fontWeight,fontStyle:H.fontStyle,width:f.sizing==="auto"?"max-content":T.scalingValue(f.width,s),letterSpacing:T.scalingValue(j,s),wordSpacing:T.scalingValue(ce,s),textAlign:te,fontSize:T.scalingValue(ne.fontSize,s),lineHeight:T.scalingValue(ne.lineHeight,s),textTransform:Q.textTransform??"none",textDecoration:Q.textDecoration??"none",fontVariant:Q.fontVariant??"normal",color:pe},onClick:Se=>Se.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:le.captionTextInner,style:{"--link-color":C.linkColor,"--link-hover-color":C.linkHoverColor},children:r.jsx(Gn,{content:n[a].imageCaption})})})})(),E.isActive&&(()=>{const[f,H]=E.position.split("-"),j=m.direction==="horiz"?`${f}-left`:E.position,te=di(j,E.offset,s),ce=()=>{if(m.direction==="horiz"){if(H==="left")return"flex-start";if(H==="center")return"center";if(H==="right")return"flex-end"}else{if(f==="top")return"flex-start";if(f==="middle")return"center";if(f==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:F,className:le.thumbsWrapper,onClick:ne=>ge(ne),style:{position:s?"absolute":"fixed",...te,...m.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:Ne(le.thumbsContainer,{[le.thumbsContainerVertical]:m.direction==="vert",[le.thumbsAlignStart]:E.align==="start",[le.thumbsAlignCenter]:E.align==="center",[le.thumbsAlignEnd]:E.align==="end"}),style:{gap:T.scalingValue(E.grid.gap,s),justifyContent:B?"flex-start":ce()},children:n.map((ne,Q)=>{const pe=Q===a,Se=R[Q],D=E.grid.size*(pe?E.activeState.scale:1),de=()=>{if(E.fit!=="fit")return{};if(!Se)return m.direction==="horiz"?{height:T.scalingValue(D,s)}:{width:T.scalingValue(D,s)};const O=Se.width/Se.height;if(m.direction==="horiz"){const Y=D,we=Y*O;return{width:T.scalingValue(we,s),height:T.scalingValue(Y,s)}}else{const Y=D,we=Y/O;return{width:T.scalingValue(Y,s),height:T.scalingValue(we,s)}}};return r.jsx("button",{className:le.thumbItem,style:{...m.direction==="horiz"&&E.fit!=="fit"?{height:T.scalingValue(D,s)}:{},...m.direction==="vert"&&E.fit!=="fit"?{width:T.scalingValue(D,s)}:{},...E.fit==="cover"?{width:T.scalingValue(D,s),height:T.scalingValue(D,s)}:{},...de(),transition:pe?"all 0.25s ease-out":"none",opacity:pe?E.activeState.opacity/100:E.opacity/100,"--thumb-hover":E.activeState.opacity/100},onClick:O=>{var Y;O.stopPropagation(),u(Q),(Y=y.current)==null||Y.go(Q)},onMouseEnter:()=>{var O;E.triggers==="hov"&&((O=y.current)==null||O.go(Q))},children:r.jsx("img",{src:ne.image.url,alt:ne.image.name??"",onLoad:O=>{const Y=O.currentTarget;Y.naturalWidth&&Y.naturalHeight&&w(we=>({...we,[Q]:{width:Y.naturalWidth,height:Y.naturalHeight}}))},style:{objectFit:E.fit==="cover"?"cover":"contain",...E.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...E.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ne.image.name}-${Q}`)})})})})()]})]}),document.getElementById(l))};function Sr({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 Zc={element:Yc,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 ui(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Qc(e){return`
|
|
6
|
+
*/const Us="RichTextRenderer-module__link___BWeZ2",qs={link:Us},Xs=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))},Ki=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Xs(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function _t(e){const{color:t,...n}=e;return n}function ut(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Ki(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:(l=e.textAppearance)==null?void 0:l.textDecoration,fontVariant:(s=e.textAppearance)==null?void 0:s.fontVariant,textAlign:e.textAlign,color:e.color}}const Gn=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:qs.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Ys(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 Ys(e){return{...e.fontFamily&&{fontFamily:Ki(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 Js="SvgImage-module__svg___q3xE-",Zs="SvgImage-module__img___VsTm-",hr={svg:Js,img:Zs},Qs=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},ec=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,At=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[l,s]=c.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return c.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');s(d)}},[]),!Qs(e)||!l?r.jsx("img",{src:e,alt:"",className:Be(hr.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:Be(hr.svg,i),style:{"--svg":ec(e),"--fill":t,"--hover-fill":n,...o??{}}})},tc={"top-left":ye.topLeftAlignment,"top-center":ye.topCenterAlignment,"top-right":ye.topRightAlignment,"middle-left":ye.middleLeftAlignment,"middle-center":ye.middleCenterAlignment,"middle-right":ye.middleRightAlignment,"bottom-left":ye.bottomLeftAlignment,"bottom-center":ye.bottomCenterAlignment,"bottom-right":ye.bottomRightAlignment};function nc({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=c.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:a,textAlign:u,wordSpacing:p,fontSizeLineHeight:I,textAppearance:S,color:v}=n.imageCaption,[g,h]=c.useState(void 0),[R,T]=c.useState(null),[y,w]=c.useState(0),[N,_]=c.useState(0),{direction:W,transition:C,controls:P,pagination:A,imageCaption:E,triggers:k}=e,B=c.useRef(C.type),{x:V,y:K}=e.controls.offset,ee=m=>{o&&o.go(m)};return c.useEffect(()=>{if(!R)return;const m=new ResizeObserver(b=>{if(!o)return;const[F]=b;h({width:Math.round(F.contentRect.width),height:Math.round(F.contentRect.height)})});return m.observe(R),()=>m.unobserve(R)},[R]),c.useEffect(()=>{!o||B.current===C.type||(_(m=>m+1),B.current=C.type)},[C.type]),r.jsx("div",{className:Be(ye.wrapper,{[ye.editor]:i}),ref:T,children:r.jsxs("div",{className:ye.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:C.backgroundColor&&C.type==="fade in"?C.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:Be(ye.captionBlock),children:r.jsx("div",{className:ye.captionTextWrapper,children:t.map((m,b)=>r.jsx("div",{className:Be(ye.captionText,tc[E.alignment],{[ye.withPointerEvents]:b===y&&i,[ye.active]:b===y}),style:{fontFamily:Ki(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":L.scalingValue(s.width,i),letterSpacing:L.scalingValue(a,i),wordSpacing:L.scalingValue(p,i),textAlign:u,fontSize:L.scalingValue(I.fontSize,i),lineHeight:L.scalingValue(I.lineHeight,i),textTransform:S.textTransform??"none",textDecoration:S.textDecoration??"none",fontVariant:S.fontVariant??"normal",color:v,transitionDuration:C.duration?`${Math.round(parseInt(C.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:ye.captionTextInner,style:{"--link-hover-color":E.linkHoverColor,"--link-color":E.linkColor,position:"relative",top:L.scalingValue(E.offset.y,i),left:L.scalingValue(E.offset.x,i)},children:r.jsx(Gn,{content:m.imageCaption})})},b))})}),r.jsx(Go,{onMove:m=>{w(m.index)},ref:l,options:{arrows:!1,speed:C.duration?parseInt(C.duration):500,autoplay:k.autoPlay!==null,...k.autoPlay!==null&&{interval:parseInt(k.autoPlay)*1e3},direction:W==="horiz"||C.type==="fade in"?"ltr":"ttb",pagination:!1,drag:k.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:C.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((m,b)=>r.jsx(Ko,{children:r.jsx("div",{className:ye.sliderItem,children:r.jsx("div",{className:ye.imgWrapper,children:r.jsx("img",{className:Be(ye.sliderImage,{[ye.contain]:m.image.objectFit==="contain",[ye.cover]:m.image.objectFit==="cover"}),src:m.image.url,alt:m.image.name??""})})})},b))},N),P.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Be(ye.arrow,{[ye.arrowVertical]:W==="vert",[ye.hoverArrow]:P.show==="on hover"}),style:{color:P.color,"--arrow-hover-color":P.hover},children:r.jsxs("button",{onClick:()=>{ee("-1")},className:ye.arrowInner,style:{transform:`translate(${L.scalingValue(V,i)}, ${L.scalingValue(K*(W==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${W==="horiz"?"0deg":"90deg"})`},children:[P.arrowsImgUrl&&r.jsx(At,{url:P.arrowsImgUrl,fill:P.color,hoverFill:P.hover,className:Be(ye.arrowImg,ye.mirror)}),!P.arrowsImgUrl&&r.jsx(fr,{color:P.color,className:Be(ye.arrowIcon,ye.arrowImg,ye.mirror)})]})}),r.jsx("div",{className:Be(ye.arrow,ye.nextArrow,{[ye.arrowVertical]:W==="vert",[ye.hoverArrow]:P.show==="on hover"}),style:{color:P.color,"--arrow-hover-color":P.hover},children:r.jsxs("button",{className:ye.arrowInner,onClick:()=>ee("+1"),style:{transform:`translate(${L.scalingValue(V*(W==="horiz"?-1:1),i)}, ${L.scalingValue(K,i)}) scale(${e.controls.scale/100}) rotate(${W==="horiz"?"0deg":"90deg"})`},children:[P.arrowsImgUrl&&r.jsx(At,{url:P.arrowsImgUrl,fill:P.color,hoverFill:P.hover,className:ye.arrowImg}),!P.arrowsImgUrl&&r.jsx(fr,{color:P.color,className:Be(ye.arrowIcon,ye.arrowImg)})]})})]}),k.triggersList.click&&r.jsx("div",{className:ye.clickOverlay,onClick:()=>{o&&o.go("+1")}}),A.isActive&&r.jsx("div",{className:Be(ye.pagination,{[ye.paginationInsideBottom]:A.position==="inside-1"&&W==="horiz",[ye.paginationInsideTop]:A.position==="inside-2"&&W==="horiz",[ye.paginationOutsideBottom]:A.position==="outside-1"&&W==="horiz",[ye.paginationOutsideTop]:A.position==="outside-2"&&W==="horiz",[ye.paginationInsideLeft]:A.position==="inside-1"&&W==="vert",[ye.paginationInsideRight]:A.position==="inside-2"&&W==="vert",[ye.paginationOutsideLeft]:A.position==="outside-1"&&W==="vert",[ye.paginationOutsideRight]:A.position==="outside-2"&&W==="vert",[ye.paginationVertical]:W==="vert"}),children:r.jsx("div",{className:ye.paginationInner,style:{backgroundColor:A.colors[2],transform:`scale(${A.scale/100}) translate(${L.scalingValue(A.offset.x,i)}, ${L.scalingValue(A.offset.y,i)}) rotate(${W==="horiz"?"0deg":"90deg"})`},children:t.map((m,b)=>r.jsx("button",{onClick:()=>{o&&o.go(b)},className:Be(ye.paginationItem),children:r.jsx("div",{className:Be(ye.dot,{[ye.activeDot]:b===y}),style:{backgroundColor:b===y?A.colors[0]:A.colors[1],"--pagination-hover-color":A.hover}})},b))})})]})})}function fr({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 ic={element:nc,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"]}},oc="ImageRevealSlider-module__imageRevealSlider___UE5Ob",rc="ImageRevealSlider-module__image___Qjt-e",ac="ImageRevealSlider-module__link___N-iLG",lc="ImageRevealSlider-module__cursor___2U03d",fn={imageRevealSlider:oc,image:rc,link:ac,cursor:lc};function yr(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const l=i.width?Number.parseFloat(i.width):o.naturalWidth,s=o.naturalHeight/o.naturalWidth*l,d=l/2,a=s/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-a&&t<=i.y+a)return!0}return!1}function no(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function sc(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await no(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await no(e);l=s.height/s.width*o}else{const s=await no(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function cc({settings:e,content:t,isEditor:n}){const[i,o]=c.useState(null),[l,s]=c.useState([]),[d,a]=c.useState(0),u=c.useRef(0),[p,I]=c.useState({x:0,y:0}),[S,v]=c.useState(1),[g,h]=c.useState("none"),R=c.useRef({x:0,y:0}),[T,y]=c.useState(!1),{sizeType:w,imageWidth:N,randomRangeImageWidth:_}=e.imageSize,{revealPosition:W,visible:C}=e.position,{cursorType:P,target:A,defaultCursorScale:E,defaultCursor:k,hoverCursorScale:B,hoverCursor:V}=e.cursor;c.useEffect(()=>{if(!i)return;const m=(M,$)=>{const O=i.getBoundingClientRect(),U=M-O.left,te=$-O.top;if(I({x:U,y:te}),P==="system"){h("none"),v(1);return}const Y=U,fe=te,x=document.elementFromPoint(O.left+Y,O.top+fe);if(x&&x.closest("a")){h("none"),v(1);return}const q=yr(Y,fe,l)||A==="area"?{img:V??"none",scale:B}:{img:k??"none",scale:E};h(q.img),v(q.scale)},b=M=>{M.stopPropagation(),R.current={x:M.clientX,y:M.clientY},m(M.clientX,M.clientY)},F=()=>{T&&m(R.current.x,R.current.y)};return i.addEventListener("mousemove",b),window.addEventListener("scroll",F,!0),()=>{i.removeEventListener("mousemove",b),window.removeEventListener("scroll",F,!0)}},[i,T,p,P,A,V,k,B,E,l]),c.useEffect(()=>{T||(h("none"),v(0))},[T]);const K=async(m,b,F,M={})=>{const{width:$,height:O,finalWidth:U}=await sc(m.image.url,w,N,_);let te=0,Y=0;W==="same"?(te=b/2,Y=F/2):(te=M.x??Math.random()*b,Y=M.y??Math.random()*F);const fe=Math.min(Math.max(te,$/2),b-$/2),x=Math.min(Math.max(Y,O/2),F-O/2);return{id:u.current++,url:m.image.url,link:m.link,name:m.image.name,x:fe,y:x,width:U}};c.useEffect(()=>{if(!i||t.length===0)return;const m=i.getBoundingClientRect(),b=m.width,F=m.height,M=[];(async()=>{const O=t[0],U=await K(O,b,F);M.push(U),s(M),a(1)})()},[w,N,_,W,i]),c.useEffect(()=>{C==="last One"&&s(m=>m.length>0?[m[m.length-1]]:[])},[C]);const ee=async m=>{if(!i)return;const b=i.getBoundingClientRect(),F=m.clientX-b.left,M=m.clientY-b.top;if(A==="image"&&!yr(F,M,l))return;let $=0,O=0;W==="on Click"?($=F,O=M):W==="same"?($=b.width/2,O=b.height/2):($=Math.random()*b.width,O=Math.random()*b.height);const U=t[d],te=await K(U,b.width,b.height,{x:$,y:O});s(Y=>C==="all"?[...Y,te]:[te]),a(Y=>Y>=t.length-1?0:Y+1)};return r.jsxs("div",{ref:o,onClick:ee,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:fn.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[l.map(m=>r.jsx("div",{className:fn.wrapper,style:{top:`${m.y}px`,left:`${m.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:m.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:A==="area"&&m.link?r.jsx("a",{href:m.link,target:"_blank",className:fn.link,children:r.jsx("img",{src:m.url,alt:m.name,className:fn.image},m.id)}):r.jsx("img",{src:m.url,alt:m.name,className:fn.image},m.id)},m.id)),T&&r.jsx("div",{className:fn.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${S})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const dc={element:cc,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:""}]}}}},uc="LightBox-module__hidden___9s-9x",pc="LightBox-module__heroImage___sTxNF",mc="LightBox-module__background___rm9ml",gc="LightBox-module__editor___4ACaY",hc="LightBox-module__contentStyle___Bgnsq",fc="LightBox-module__imageStyle___tLIlB",yc="LightBox-module__imgWrapper___LuFUp",vc="LightBox-module__contain___8-yaS",bc="LightBox-module__cover___hNvOG",xc="LightBox-module__caption___b6L2I",Sc="LightBox-module__captionTextInner___rCGNH",Cc="LightBox-module__lightboxSplide___XFuWC",$c="LightBox-module__arrow___iz38X",wc="LightBox-module__arrowVertical___Zfz81",Tc="LightBox-module__nextArrow___zkAQN",Lc="LightBox-module__arrowInner___p48sW",Ec="LightBox-module__arrowIcon___3VaFf",Ic="LightBox-module__arrowImg___pNV88",Rc="LightBox-module__mirror___pjeXc",Pc="LightBox-module__thumbsWrapper___GB-nU",_c="LightBox-module__thumbsContainerVertical___wttk5",Ac="LightBox-module__thumbsContainer___osSma",Mc="LightBox-module__thumbsAlignStart___MO6tY",kc="LightBox-module__thumbsAlignCenter___Q4sUx",Fc="LightBox-module__thumbsAlignEnd___p4y9R",Wc="LightBox-module__thumbItem___HvnF3",Nc="LightBox-module__closeButton___g2khP",Hc="LightBox-module__fadeIn___0m5GW",Bc="LightBox-module__slideInLeft___gPYwC",Oc="LightBox-module__slideInRight___S-pPp",jc="LightBox-module__slideInTop___DFdAj",zc="LightBox-module__slideInBottom___m27kZ",Vc="LightBox-module__fadeOut___55qBR",Dc="LightBox-module__slideOutLeft___NvU7P",Gc="LightBox-module__slideOutRight___SK7eC",Kc="LightBox-module__slideOutTop___Vgg0z",Uc="LightBox-module__slideOutBottom___nJ0Ef",qc="LightBox-module__scaleSlide___vZriG",le={hidden:uc,heroImage:pc,background:mc,editor:gc,contentStyle:hc,imageStyle:fc,imgWrapper:yc,contain:vc,cover:bc,caption:xc,captionTextInner:Sc,lightboxSplide:Cc,arrow:$c,arrowVertical:wc,nextArrow:Tc,arrowInner:Lc,arrowIcon:Ec,arrowImg:Ic,mirror:Rc,thumbsWrapper:Pc,thumbsContainerVertical:_c,thumbsContainer:Ac,thumbsAlignStart:Mc,thumbsAlignCenter:kc,thumbsAlignEnd:Fc,thumbItem:Wc,closeButton:Nc,fadeIn:Hc,slideInLeft:Bc,slideInRight:Oc,slideInTop:jc,slideInBottom:zc,fadeOut:Vc,slideOutLeft:Dc,slideOutRight:Gc,slideOutTop:Kc,slideOutBottom:Uc,scaleSlide:qc},di=(e,t,n)=>{const i={},[o,l]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),l==="left"?(i.left="0",i.right="auto"):l==="center"?(i.left="50%",i.right="auto"):l==="right"&&(i.left="auto",i.right="0"),o==="middle"&&l==="center"?i.transform=`translate(calc(-50% + ${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)}))`:l==="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 Ma(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 vr(e){const t=e.getBoundingClientRect(),n=Ma(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,s=e.naturalHeight,d=i/o,a=l/s;let u,p;a>d?(u=i,p=i/a):(p=o,u=o*a);const I=t.left+n.left,S=t.top+n.top,v=(i-u)/2+I,g=(o-p)/2+S;return{x:v,y:g,width:u,height:p}}function br(e){const t=e.getBoundingClientRect(),n=Ma(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function xr(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 Xc(e,t){const n=(()=>{if(e==="fade in")return le.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return le.slideInLeft;case"right":return le.slideInRight;case"top":return le.slideInTop;case"bottom":return le.slideInBottom;default:return le.slideInRight}return le.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return le.fadeIn;if(e==="slide in")switch(t){case"left":return le.slideInLeft;case"right":return le.slideInRight;case"top":return le.slideInTop;case"bottom":return le.slideInBottom;default:return le.slideInRight}return le.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return le.fadeOut;if(e==="slide in")switch(t){case"left":return le.slideOutLeft;case"right":return le.slideOutRight;case"top":return le.slideOutTop;case"bottom":return le.slideOutBottom;default:return le.slideOutRight}return le.fadeOut})(),l=(()=>{if(e==="fade in")return le.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return le.slideOutLeft;case"right":return le.slideOutRight;case"top":return le.slideOutTop;case"bottom":return le.slideOutBottom;default:return le.slideOutRight}return le.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const Yc=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:l,isPreviewMode:s})=>{const[d,a]=c.useState(!1),{url:u}=e.thumbnailBlock.cover;return c.useEffect(()=>{o==="close"&&a(!1),o==="open"&&a(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:le.heroImage,onClick:()=>a(!0)}),r.jsx(Jc,{isOpen:d,onClose:()=>a(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},Jc=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:d})=>{var G;const[a,u]=c.useState(0),[p,I]=c.useState(0),[S,v]=c.useState(!1),[g,h]=c.useState(!1),[R,T]=c.useState({}),y=c.useRef(null),w=c.useRef(null),N=c.useRef(null),_=c.useRef(!1),W=c.useRef(null),C=c.useRef(null),P=c.useRef(null),A=c.useRef(null),E=c.useRef(!1),k=c.useRef(null),[B,V]=c.useState(!1),{appear:K,triggers:ee,slider:m,thumbnail:b,controls:F,area:M,caption:$,layout:O}=o.lightboxBlock,{appearClass:U,backdropAppearClass:te,backdropDisappearClass:Y,disappearClass:fe}=Xc(K.type,K.direction),x=(d==null?void 0:d.itemId)??null;c.useEffect(()=>{const f=()=>{setTimeout(()=>{var j,ne;(ne=(j=y.current)==null?void 0:j.splide)==null||ne.refresh()},16)},H=()=>{I(j=>j+1)};return window.addEventListener("ArticleEditor.Layout:change",f),window.addEventListener("ArticleEditor.ComponentContent:change",H),()=>{window.removeEventListener("ArticleEditor.Layout:change",f),window.removeEventListener("ArticleEditor.ComponentContent:change",H)}},[]),c.useEffect(()=>{if(!e||!b.isActive){V(!1);return}const f=k.current;if(!f)return;const H=()=>{m.direction==="horiz"?V(f.scrollWidth>f.clientWidth):V(f.scrollHeight>f.clientHeight)};H();const j=new ResizeObserver(H);return j.observe(f),()=>j.disconnect()},[e,b.isActive,n.length,R,m.direction]);const q=c.useCallback(()=>{const f=window.matchMedia("(max-width: 768px)").matches,H=xr(M.color);f&&!s&&H>.9&&(document.body.style.backgroundColor=""),v(!0),_.current=!0;const j=ne=>{ne.target===W.current&&ne.animationName&&(W.current&&C.current&&W.current.removeEventListener("animationend",C.current),C.current=null,_.current&&(_.current=!1,t()),v(!1))};W.current&&(C.current=j,W.current.addEventListener("animationend",j))},[t,M.color,s]),he=(f,H,j)=>{var ne,de;if(f){if(ee.type==="click"&&ee.switch==="image")ee.repeat==="close"&&a===n.length-1?q():(ne=y.current)==null||ne.go("+1");else if(ee.type==="click"&&ee.switch==="50/50"){const oe=f.getBoundingClientRect(),ie=H-oe.left,ge=j-oe.top,ve=oe.width,Se=oe.height;let D;m.direction==="horiz"?D=ie<ve/2?"-1":"+1":D=ge<Se/2?"-1":"+1",(de=y.current)==null||de.go(D)}}},pe=f=>{if(E.current){E.current=!1;return}const H=n[a],j=(H==null?void 0:H.image.objectFit)==="cover";let ne,de;if("changedTouches"in f&&f.changedTouches.length>0)ne=f.changedTouches[0].clientX,de=f.changedTouches[0].clientY;else if("clientX"in f)ne=f.clientX,de=f.clientY;else return;let oe;if(j&&N.current){const ie=br(N.current);oe=ne>=ie.left&&ne<=ie.right&&de>=ie.top&&de<=ie.bottom}else{const ie=N.current?vr(N.current):null;if(!ie){f.target===f.currentTarget&&q();return}oe=ne>=ie.x&&ne<=ie.x+ie.width&&de>=ie.y&&de<=ie.y+ie.height}oe?he(N.current,ne,de):q()},be=f=>{const H=f.target;(H.classList.contains(le.thumbsWrapper)||H.classList.contains(le.thumbsContainer))&&pe(f)};c.useEffect(()=>{if(!e)return;const f=H=>{var j,ne;if(H.key==="Escape"){q();return}if(H.key==="ArrowRight"){u(de=>(de+1)%Math.max(n.length,1)),(j=y.current)==null||j.go("+1");return}H.key==="ArrowLeft"&&(u(de=>(de-1+Math.max(n.length,1))%Math.max(n.length,1)),(ne=y.current)==null||ne.go("-1"))};return window.addEventListener("keydown",f),()=>{window.removeEventListener("keydown",f)}},[e,q,n.length]),c.useEffect(()=>{if(e){if(u(0),I(H=>H+1),_.current=!1,v(!1),h(!1),T({}),!x)return;const f=new CustomEvent("page-overlay",{detail:{itemId:x}});window.dispatchEvent(f)}return()=>{W.current&&C.current&&(W.current.removeEventListener("animationend",C.current),C.current=null),h(!1)}},[e,x]),c.useEffect(()=>{w.current!==null&&w.current!==m.type&&I(f=>f+1),w.current=m.type},[m.type]),c.useEffect(()=>{if(!e)return;const f=document.body.style.overflow,H=window.matchMedia("(max-width: 768px)").matches,j=xr(M.color);document.body.style.overflow="hidden",h(!1);const ne=oe=>{oe.target===W.current&&!_.current&&oe.animationName&&(H&&!s&&j>.9&&(document.body.style.backgroundColor=M.color),h(!0),W.current&&P.current&&W.current.removeEventListener("animationend",P.current),P.current=null)};W.current&&(P.current=ne,W.current.addEventListener("animationend",ne));const de=oe=>{const ie=oe.target;ie&&(ie.closest(`.${le.thumbsWrapper}`)||ie.closest(`.${le.thumbsContainer}`))||m.type!=="slide"&&oe.preventDefault()};return document.addEventListener("touchmove",de,{passive:!1}),()=>{document.body.style.overflow=f,document.removeEventListener("touchmove",de),W.current&&P.current&&(W.current.removeEventListener("animationend",P.current),P.current=null),h(!1)}},[e,s,M.color,m.type]),c.useEffect(()=>{if(!e)return;const f=H=>{var ne,de;if(_.current){H.stopPropagation();return}if(E.current){E.current=!1;return}const j=H.target;if(!(j&&(j.closest(`.${le.thumbsContainer}`)||j.closest(`.${le.thumbItem}`)||j.closest(`.${le.arrow}`)||j.closest(`.${le.closeButton}`)||j.closest(`.${le.caption}`)))){if(m.type==="slide"&&ee.type==="drag"&&((de=(ne=y.current)==null?void 0:ne.splide)!=null&&de.root)){const oe=y.current.splide.root;if(j&&(oe.contains(j)||oe===j))return}if(H.touches.length===0&&H.changedTouches.length>0){const oe=n[a],ie=(oe==null?void 0:oe.image.objectFit)==="cover",ge=H.changedTouches[0];let ve;if(ie&&N.current){const Se=br(N.current);ve=ge.clientX>=Se.left&&ge.clientX<=Se.right&&ge.clientY>=Se.top&&ge.clientY<=Se.bottom}else{const Se=N.current?vr(N.current):null;if(!Se)return;ve=ge.clientX>=Se.x&&ge.clientX<=Se.x+Se.width&&ge.clientY>=Se.y&&ge.clientY<=Se.y+Se.height}if(!ve){H.stopPropagation(),_.current=!0;const Se=D=>{D.stopPropagation(),D.preventDefault(),document.removeEventListener("click",Se,!0)};document.addEventListener("click",Se,!0),q()}}}};return document.addEventListener("touchend",f,{passive:!0}),()=>{document.removeEventListener("touchend",f)}},[e,q,a,n]);const J=(m.type==="scale"||m.type==="fade")&&m.direction==="vert"&&ee.type==="drag";c.useEffect(()=>{var D,ue;if(!e||!J||!((ue=(D=y.current)==null?void 0:D.splide)!=null&&ue.root))return;const f=y.current.splide.root,H=30,j=(z,X)=>{if(A.current){const Ce=Math.abs(z-A.current.x),_e=Math.abs(X-A.current.y);(Ce>0||_e>0)&&(E.current=!0)}},ne=z=>{A.current&&(z.preventDefault(),j(z.clientX,z.clientY))},de=z=>{A.current&&z.touches.length>0&&(z.preventDefault(),j(z.touches[0].clientX,z.touches[0].clientY))},oe=(z,X)=>{if(!A.current||!y.current){A.current=null;return}const Ce=Math.abs(z-A.current.x),_e=Math.abs(X-A.current.y);_e>H&&_e>Ce&&y.current.go(X<A.current.y?"+1":"-1"),A.current=null},ie=z=>{A.current&&oe(z.clientX,z.clientY),document.removeEventListener("pointerup",ie),document.removeEventListener("pointercancel",ie),document.removeEventListener("pointermove",ne)},ge=z=>{if(A.current){if(z.changedTouches.length>0){const X=z.changedTouches[0];oe(X.clientX,X.clientY)}document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),document.removeEventListener("touchmove",de)}},ve=z=>{A.current={x:z.clientX,y:z.clientY},E.current=!1,document.addEventListener("pointermove",ne,{passive:!1}),document.addEventListener("pointerup",ie),document.addEventListener("pointercancel",ie)},Se=z=>{z.touches.length>0&&(A.current={x:z.touches[0].clientX,y:z.touches[0].clientY},E.current=!1,document.addEventListener("touchmove",de,{passive:!1}),document.addEventListener("touchend",ge),document.addEventListener("touchcancel",ge))};return f.addEventListener("pointerdown",ve),f.addEventListener("touchstart",Se),()=>{f.removeEventListener("pointerdown",ve),f.removeEventListener("touchstart",Se),document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",ie),document.removeEventListener("pointercancel",ie),document.removeEventListener("touchmove",de),document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),A.current=null,E.current=!1}},[e,J,p]);const me={backgroundColor:M.color,backdropFilter:`blur(${M.blur}px)`,animationDuration:`${parseInt(K.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:Xn.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:W,className:Be(le.background,S?Y:te,{[le.editor]:s},{[le.hidden]:!e}),style:{...me,...g&&!s&&!S?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?W:null,className:Be(le.contentStyle,S?fe:U,{[le.editor]:s},{[le.hidden]:!e}),style:{animationDuration:`${parseInt(K.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Go,{onMove:f=>u(f.index),ref:y,className:le.lightboxSplide,options:{arrows:!1,speed:m.duration?parseInt(m.duration):500,direction:m.direction==="horiz"||m.type==="fade"||m.type==="scale"?"ltr":"ttb",pagination:!1,drag:ee.type==="drag"&&!J,perPage:1,width:"100%",height:"100%",type:m.type==="fade"||m.type==="scale"?"fade":"loop",padding:0,rewind:ee.repeat!=="close",start:0},style:{"--splide-speed":m.duration},children:n.map((f,H)=>{const j=di(O.position,O.offset,s),ne=`${L.scalingValue(O.padding.top,s)} ${L.scalingValue(O.padding.right,s)} ${L.scalingValue(O.padding.bottom,s)} ${L.scalingValue(O.padding.left,s)}`,de=m.type==="scale"?(()=>{const{transform:oe,...ie}=j;return{...ie,position:"absolute",padding:ne,boxSizing:"border-box","--position-transform":oe||"none"}})():{...j,position:"absolute",padding:ne,boxSizing:"border-box"};return r.jsx(Ko,{children:r.jsx("div",{className:le.imgWrapper,onClick:pe,children:r.jsx("img",{ref:H===a?N:null,className:Be(le.imageStyle,{[le.contain]:f.image.objectFit==="contain",[le.cover]:f.image.objectFit==="cover",[le.scaleSlide]:m.type==="scale"}),src:f.image.url,alt:f.image.name??"",style:{...de,pointerEvents:f.image.objectFit==="contain"?"none":"auto"}})})},H)})},p),F.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Be(le.arrow,{[le.arrowVertical]:m.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:r.jsxs("button",{className:le.arrowInner,style:{transform:`translate(${L.scalingValue(F.offset.x,s)}, ${L.scalingValue(F.offset.y*(m.direction==="horiz"?1:-1),s)}) scale(${F.scale}) rotate(${m.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var f;return(f=y.current)==null?void 0:f.go("-1")},"aria-label":"Previous",children:[F.arrowsImgUrl&&r.jsx(At,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:Be(le.arrowImg,le.mirror)}),!F.arrowsImgUrl&&r.jsx(Sr,{color:F.color,className:Be(le.arrowIcon,le.arrowImg,le.mirror)})]})}),r.jsx("div",{className:Be(le.arrow,le.nextArrow,{[le.arrowVertical]:m.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:r.jsxs("button",{className:le.arrowInner,style:{transform:`translate(${L.scalingValue(F.offset.x*(m.direction==="horiz"?-1:1),s)}, ${L.scalingValue(F.offset.y,s)}) scale(${F.scale}) rotate(${m.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var f;return(f=y.current)==null?void 0:f.go("+1")},"aria-label":"Next",children:[F.arrowsImgUrl&&r.jsx(At,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:le.arrowImg}),!F.arrowsImgUrl&&r.jsx(Sr,{color:F.color,className:Be(le.arrowIcon,le.arrowImg)})]})})]}),M.closeIconUrl&&(()=>{const f=di(M.closeIconAlign,M.closeIconOffset,s),H=`scale(${M.closeIconScale})`,j=f.transform?`${f.transform} ${H}`:H;return r.jsx("button",{className:le.closeButton,style:{...f,transform:j},onClick:q,"aria-label":"Close lightbox",children:r.jsx(At,{url:M.closeIconUrl,fill:M.closeIconColor??"#000000",hoverFill:M.closeIconHover??"#cccccc"})})})(),$&&$.isActive&&i.imageCaption&&((G=n[a])==null?void 0:G.imageCaption)&&(()=>{const{widthSettings:f,fontSettings:H,letterSpacing:j,textAlign:ne,wordSpacing:de,fontSizeLineHeight:oe,textAppearance:ie,color:ge}=i.imageCaption;return r.jsx("div",{className:le.caption,style:{...di($.alignment,$.offset,s),fontFamily:Ki(H.fontFamily),fontWeight:H.fontWeight,fontStyle:H.fontStyle,width:f.sizing==="auto"?"max-content":L.scalingValue(f.width,s),letterSpacing:L.scalingValue(j,s),wordSpacing:L.scalingValue(de,s),textAlign:ne,fontSize:L.scalingValue(oe.fontSize,s),lineHeight:L.scalingValue(oe.lineHeight,s),textTransform:ie.textTransform??"none",textDecoration:ie.textDecoration??"none",fontVariant:ie.fontVariant??"normal",color:ge},onClick:ve=>ve.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:le.captionTextInner,style:{"--link-color":$.linkColor,"--link-hover-color":$.linkHoverColor},children:r.jsx(Gn,{content:n[a].imageCaption})})})})(),b.isActive&&(()=>{const[f,H]=b.position.split("-"),j=m.direction==="horiz"?`${f}-left`:b.position,ne=di(j,b.offset,s),de=()=>{if(m.direction==="horiz"){if(H==="left")return"flex-start";if(H==="center")return"center";if(H==="right")return"flex-end"}else{if(f==="top")return"flex-start";if(f==="middle")return"center";if(f==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:k,className:le.thumbsWrapper,onClick:oe=>be(oe),style:{position:s?"absolute":"fixed",...ne,...m.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:Be(le.thumbsContainer,{[le.thumbsContainerVertical]:m.direction==="vert",[le.thumbsAlignStart]:b.align==="start",[le.thumbsAlignCenter]:b.align==="center",[le.thumbsAlignEnd]:b.align==="end"}),style:{gap:L.scalingValue(b.grid.gap,s),justifyContent:B?"flex-start":de()},children:n.map((oe,ie)=>{const ge=ie===a,ve=R[ie],D=b.grid.size*(ge?b.activeState.scale:1),ue=()=>{if(b.fit!=="fit")return{};if(!ve)return m.direction==="horiz"?{height:L.scalingValue(D,s)}:{width:L.scalingValue(D,s)};const z=ve.width/ve.height;if(m.direction==="horiz"){const X=D,Ce=X*z;return{width:L.scalingValue(Ce,s),height:L.scalingValue(X,s)}}else{const X=D,Ce=X/z;return{width:L.scalingValue(X,s),height:L.scalingValue(Ce,s)}}};return r.jsx("button",{className:le.thumbItem,style:{...m.direction==="horiz"&&b.fit!=="fit"?{height:L.scalingValue(D,s)}:{},...m.direction==="vert"&&b.fit!=="fit"?{width:L.scalingValue(D,s)}:{},...b.fit==="cover"?{width:L.scalingValue(D,s),height:L.scalingValue(D,s)}:{},...ue(),transition:ge?"all 0.25s ease-out":"none",opacity:ge?b.activeState.opacity/100:b.opacity/100,"--thumb-hover":b.activeState.opacity/100},onClick:z=>{var X;z.stopPropagation(),u(ie),(X=y.current)==null||X.go(ie)},onMouseEnter:()=>{var z;b.triggers==="hov"&&((z=y.current)==null||z.go(ie))},children:r.jsx("img",{src:oe.image.url,alt:oe.image.name??"",onLoad:z=>{const X=z.currentTarget;X.naturalWidth&&X.naturalHeight&&T(Ce=>({...Ce,[ie]:{width:X.naturalWidth,height:X.naturalHeight}}))},style:{objectFit:b.fit==="cover"?"cover":"contain",...b.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...b.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${oe.image.name}-${ie}`)})})})})()]})]}),document.getElementById(l))};function Sr({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 Zc={element:Yc,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 ui(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Qc(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 ed({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:l}){const s=!!n,d=i&&t||!t,{prefix:a}=
|
|
158
|
+
`}function ed({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:l}){const s=!!n,d=i&&t||!t,{prefix:a}=L.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:I=[],buttonLabel:S,gap:v,fieldsGap:g,buttonCorners:h,buttonStroke:R,buttonPadding:T,isButtonFullWidth:y,inputCorners:w,inputStroke:N,inputPadding:_,inputColor:W,inputTextColor:C,inputBorderColor:P,placeholderColor:A,buttonColor:E,buttonTextColor:k,buttonBorderColor:B,labelTextColor:V,successColor:K,errorColor:ee,fontFamily:m,inputFontSettings:b,inputFontSize:F,inputLineHeight:M,inputLetterSpacing:$,inputWordSpacing:O,inputTextAppearance:U,buttonFontSettings:te,buttonFontSize:Y,buttonLineHeight:fe,buttonLetterSpacing:x,buttonWordSpacing:q,buttonTextAppearance:he,labelFontSettings:pe,labelFontSize:be,labelLineHeight:J,labelLetterSpacing:me,labelWordSpacing:G,labelTextAppearance:f,statusFontSettings:H,statusFontSize:j,statusLineHeight:ne,statusLetterSpacing:de,statusWordSpacing:oe,statusTextAppearance:ie,successMessage:ge,errorMessage:ve,stateOverrides:Se}=e,D=u==="B",ue=I.slice(0,Math.min(p,I.length)),z={fontSettings:{fontFamily:m,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:F??.01,lineHeight:M,letterSpacing:$??0,wordSpacing:O??0,textAppearance:U,color:C},X=_t(ut(z,t)),Ce=L.scalingValue(N??0,t),_e=L.scalingValue((M??F??.01)+((_==null?void 0:_.top)??0)+((_==null?void 0:_.bottom)??0)+(u==="C"?N??0:(N??0)*2),t),Ze={...X,borderStyle:"solid",borderRadius:u==="C"?0:L.scalingValue(w??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:Ce,borderLeftWidth:0}:{borderWidth:Ce},paddingTop:L.scalingValue((_==null?void 0:_.top)??0,t),paddingRight:L.scalingValue((_==null?void 0:_.right)??0,t),paddingBottom:L.scalingValue((_==null?void 0:_.bottom)??0,t),paddingLeft:L.scalingValue((_==null?void 0:_.left)??0,t),height:_e,minHeight:_e},We={fontSettings:{fontFamily:m,fontWeight:(te==null?void 0:te.fontWeight)??400,fontStyle:(te==null?void 0:te.fontStyle)??"normal"},fontSize:Y??.01,lineHeight:fe,letterSpacing:x??0,wordSpacing:q??0,textAppearance:he,color:k},ze=_t(ut(We,t)),Ne=L.scalingValue(R??0,t),Me={fontSettings:{fontFamily:m,fontWeight:(pe==null?void 0:pe.fontWeight)??400,fontStyle:(pe==null?void 0:pe.fontStyle)??"normal"},fontSize:be??.01,lineHeight:J,letterSpacing:me??0,wordSpacing:G??0,textAppearance:f,color:V},qe=ut(Me,t),Xe={fontSettings:{fontFamily:m,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:j??.01,lineHeight:ne,letterSpacing:de??0,wordSpacing:oe??0,textAppearance:ie,color:K},Pe=_t(ut(Xe,t)),Ve=L.buildColorVars(a,{inputColor:W,inputTextColor:C,inputBorderColor:P,placeholderColor:A!=null&&A.trim()?A:"#cccccc",buttonColor:E,buttonTextColor:k,buttonBorderColor:B,labelTextColor:V,successColor:K,errorColor:ee},td,nd,Se),[ct,pt]=c.useState(()=>Object.fromEntries(ue.map(we=>[we.name,""]))),[rt,ot]=c.useState("idle"),[Z,Q]=c.useState(null),ce=l==="success"?"success":l==="error"?"error":rt,se=l==="error"?ve:Z,Le=l==="filled",Oe=c.useMemo(()=>{if(!Le)return ct;let we=null;for(const et of ue)(ct[et.name]??"").trim().length>0||(we=we??{...ct},we[et.name]="Filled");return we??ct},[ct,Le,ue]),ae=ce==="error"?L.getFormFieldValidationError(ue,Oe):null,Ie=`${l&&l!=="default"?`${a}-state-${l}`:""}`.trim(),Re=o==null?void 0:o.submitUrl,je=(we,et)=>{pt(Ye=>({...Ye,[we]:et}))},ht=async we=>{if(we.preventDefault(),!d)return;const et=Object.fromEntries(ue.map(Je=>{var dt;return[Je.name,((dt=ct[Je.name])==null?void 0:dt.trim())??""]}).filter(([,Je])=>Je));if(!Re){ot("error"),Q("No integrations were found for this form.");return}if(Object.keys(et).length===0)return;const Ye=L.getFormFieldValidationError(ue,ct);if(Ye){ot("error"),Q(Ye);return}ot("submitting"),Q(null);try{const Je=await fetch(Re,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(et)});if(!Je.ok){const dt=await Je.text();throw new Error(dt||`Request failed: ${Je.status}`)}ot("success"),pt(Object.fromEntries(ue.map(dt=>[dt.name,""])))}catch(Je){ot("error"),Q(Je instanceof Error?Je.message:"Something went wrong")}};return r.jsxs("div",{className:`${a}-wrapper ${a}-type-${u} ${Ie}`.trim(),style:Ve,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Qc(a)}}),r.jsxs("form",{onSubmit:ht,className:`${a}-form`,children:[r.jsx("div",{className:`${a}-fields`,children:ue.map((we,et)=>r.jsxs(c.Fragment,{children:[et>0&&r.jsx("div",{"data-controls":s?"fieldsGap":void 0,className:s?`${a}-control`:void 0,style:{height:L.scalingValue(g??0,t)}}),r.jsxs("div",{className:`${a}-field-group${D?` ${a}-labeled`:""}`,children:[D&&r.jsx("span",{className:`${a}-field-label`,style:qe?{...qe,lineHeight:qe.fontSize}:void 0,children:we.label||we.name}),we.type==="textarea"?r.jsx("textarea",{name:we.name,autoComplete:"off",value:Oe[we.name]??"",onChange:Ye=>je(we.name,Ye.target.value),placeholder:we.placeholder,className:`${a}-input`,style:Ze,rows:1,"data-filled":Le||(Oe[we.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:we.type==="phone"?"tel":we.type==="email"?"email":"text",name:we.name,autoComplete:"off",value:Oe[we.name]??"",onChange:Ye=>je(we.name,Ye.target.value),placeholder:we.placeholder,required:we.isRequired??we.type==="email",className:`${a}-input`,style:Ze,"data-filled":Le||(Oe[we.name]??"").trim().length>0})]})]},et))}),r.jsx("div",{"data-controls":s?"gap":void 0,className:s?`${a}-control`:void 0,style:{height:L.scalingValue(v??0,t)}}),r.jsx("div",{className:`${a}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${a}-button`,style:{borderStyle:"solid",borderRadius:L.scalingValue(h??0,t),borderWidth:Ne,paddingTop:L.scalingValue((T==null?void 0:T.top)??0,t),paddingRight:L.scalingValue((T==null?void 0:T.right)??0,t),paddingBottom:L.scalingValue((T==null?void 0:T.bottom)??0,t),paddingLeft:L.scalingValue((T==null?void 0:T.left)??0,t),pointerEvents:d?"auto":void 0,...ze,...y?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${a}-overlay-anchor`,style:y?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:rt==="submitting"?"...":S})})})]}),ce==="success"&&r.jsx("p",{className:`${a}-success`,style:{...Pe},children:ge}),ce==="error"&&r.jsx("p",{className:`${a}-error`,style:{...Pe},role:"alert",children:ae??se??ve})]})}const td={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"},nd=["hover","focus","filled","success","error"],id=`import React, { useMemo, useState } from 'react';
|
|
159
159
|
import { CommonComponentProps } from '../props';
|
|
160
160
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
161
161
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -980,7 +980,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
980
980
|
font-size: ${mi(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const cd=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:l}=
|
|
983
|
+
`}const cd=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:l}=L.useScopedStyles(),s=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:a,buttonLabel:u,fieldsToShow:p=1,fontFamily:I,inputFontSettings:S,inputFontSize:v,inputLineHeight:g,inputLetterSpacing:h,inputWordSpacing:R,inputTextAppearance:T,buttonFontSettings:y,buttonFontSize:w,buttonLineHeight:N,buttonLetterSpacing:_,buttonWordSpacing:W,buttonTextAppearance:C,statusFontSettings:P,statusFontSize:A,statusLineHeight:E,statusLetterSpacing:k,statusWordSpacing:B,statusTextAppearance:V,iconMaxWidth:K,minHeight:ee,corners:m,stroke:b,stateOverrides:F,inputPadding:M,buttonPadding:$,successMessage:O="Thanks for subscribing!",errorMessage:U="Please, fill all required fields."}=e,te=d.slice(0,Math.min(p,d.length)),[Y,fe]=c.useState(()=>Object.fromEntries(te.map(Me=>[Me.name,""]))),[x,q]=c.useState("idle"),[he,pe]=c.useState(null),be=o==="success"?"success":o==="error"?"error":x,J=o==="error"?U:he,me=o==="filled",G=c.useMemo(()=>{if(!me)return Y;let Me=null;for(const qe of te)(Y[qe.name]??"").trim().length>0||(Me=Me??{...Y},Me[qe.name]="Filled");return Me??Y},[me,Y,te]),f=be==="error"?L.getFormFieldValidationError(te,G):null,H=o&&o!=="default"?`${l}-state-${o}`:"",j=te.some(Me=>(G[Me.name]??"").trim().length>0),ne=H!==`${l}-state-filled`&&j?`${l}-state-filled`:"",de=`${H} ${ne}`.trim(),oe=i==null?void 0:i.submitUrl,ie=u??"",ge=(a==null?void 0:a.icon)??"",ve=(a==null?void 0:a.mode)==="On",Se=ie||"Submit",D={fontSettings:{fontFamily:I,fontWeight:(S==null?void 0:S.fontWeight)??400,fontStyle:(S==null?void 0:S.fontStyle)??"normal"},fontSize:v??.01,lineHeight:g,letterSpacing:h??0,wordSpacing:R??0,textAppearance:T,color:e.inputTextColor??"#111111"},ue={fontSettings:{fontFamily:I,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:w??.01,lineHeight:N,letterSpacing:_??0,wordSpacing:W??0,textAppearance:C,color:e.buttonTextColor??"#ffffff"},z={fontSettings:{fontFamily:I,fontWeight:(P==null?void 0:P.fontWeight)??400,fontStyle:(P==null?void 0:P.fontStyle)??"normal"},fontSize:A??.01,lineHeight:E,letterSpacing:k??0,wordSpacing:B??0,textAppearance:V,color:e.successColor??"#22c55e"},X=_t(ut(D,t)),Ce=_t(ut(ue,t)),_e=_t(ut(z,t)),Ze=L.buildColorVars(l,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(D==null?void 0:D.color)??"#111111",buttonTextColor:e.buttonTextColor??(ue==null?void 0:ue.color)??"#ffffff"},dd,ud,F),We={borderRadius:L.scalingValue(m,t),borderWidth:L.scalingValue(b,t),borderStyle:"solid"},ze={borderLeftWidth:L.scalingValue(b,t)},Ne=async Me=>{if(Me.preventDefault(),!s)return;const qe=Object.fromEntries(te.map(Pe=>{var Ve;return[Pe.name,((Ve=Y[Pe.name])==null?void 0:Ve.trim())??""]}).filter(([,Pe])=>Pe));if(!oe){q("error"),pe("No integrations were found for this form.");return}if(Object.keys(qe).length===0)return;const Xe=L.getFormFieldValidationError(te,Y);if(Xe){q("error"),pe(Xe);return}q("submitting"),pe(null);try{const Pe=await fetch(oe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(!Pe.ok){const Ve=await Pe.text();throw new Error(Ve||`Request failed: ${Pe.status}`)}q("success"),fe(Object.fromEntries(te.map(Ve=>[Ve.name,""])))}catch(Pe){q("error"),pe(Pe instanceof Error?Pe.message:"Something went wrong")}};return r.jsxs("div",{className:`${l}-wrapper ${de}`.trim(),style:Ze,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:sd(l)}}),r.jsxs("form",{onSubmit:Ne,className:`${l}-form`,style:{...We,height:L.scalingValue(ee,t),minHeight:L.scalingValue(ee,t)},children:[r.jsx("div",{className:`${l}-inputWrap ${l}-overlayAnchor`,style:{flex:1,minWidth:0},children:te.map(Me=>r.jsx("input",{type:Me.type==="email"?"email":Me.type==="phone"?"tel":"text",name:Me.name,autoComplete:"off",value:G[Me.name]??"",onChange:qe=>fe(Xe=>({...Xe,[Me.name]:qe.target.value})),placeholder:Me.placeholder,required:Me.isRequired??Me.type==="email",className:`${l}-input`,style:{...X,paddingRight:L.scalingValue(M.right,t),paddingLeft:L.scalingValue(M.left,t),paddingTop:L.scalingValue(M.top,t),paddingBottom:L.scalingValue(M.bottom,t)}},Me.name))}),r.jsx("div",{className:`${l}-overlayAnchor`,children:r.jsx("button",{type:s?"submit":"button",className:`${l}-submitBtn`,"aria-label":Se,style:{...Ce,...ze,paddingRight:L.scalingValue($.right,t),paddingLeft:L.scalingValue($.left,t),paddingTop:L.scalingValue($.top,t),paddingBottom:L.scalingValue($.bottom,t),pointerEvents:s?"auto":void 0},children:x==="submitting"?"...":ve?ge&&r.jsx(At,{url:ge,className:`${l}-submitBtnIcon`,style:{maxWidth:L.scalingValue(K??0,t)},fill:`var(--${l}-button-text-color)`,hoverFill:`var(--${l}-button-text-color)`}):ie})})]}),be==="success"&&r.jsx("p",{className:`${l}-success`,style:{..._e},children:O}),be==="error"&&r.jsx("p",{className:`${l}-error`,style:{..._e},role:"alert",children:f??J??U})]})},dd={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"},ud=["hover","focus","filled","success","error"],pd=`import React, { useMemo, useState } from 'react';
|
|
984
984
|
import { CommonComponentProps } from '../props';
|
|
985
985
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
986
986
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1689
1689
|
.${e}-image-hover-grayscale:hover img {
|
|
1690
1690
|
filter: grayscale(100%);
|
|
1691
1691
|
}
|
|
1692
|
-
`}const bd=30,xd=20,oo=2,Sd=2,Cd=(e,t)=>Array.from({length:t},()=>e).flat(),$d=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},wd=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>$d(i,e))},Td=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,imageHoverClass:l,isFirstSet:s,scaled:d,onFirstSetImageDone:a})=>{var
|
|
1692
|
+
`}const bd=30,xd=20,oo=2,Sd=2,Cd=(e,t)=>Array.from({length:t},()=>e).flat(),$d=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},wd=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>$d(i,e))},Td=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,imageHoverClass:l,isFirstSet:s,scaled:d,onFirstSetImageDone:a})=>{var C,P,A;const u=c.useRef(null);c.useLayoutEffect(()=>{if(!s)return;const E=u.current;E!=null&&E.complete&&(a==null||a())},[s,(C=e.image)==null?void 0:C.url,a]);const p=n.display==="Cover",I=n.ratioValue??"1:1",S=n.reversed??!1,[v,g]=I.split(":").map(Number),T=(S?g:v)/(S?v:g);let y=i,w=y/T;w>o&&(w=o,y=w*T);const N=d(y),_=d(w),W=((P=e.image)==null?void 0:P.url)&&r.jsx("img",{ref:u,src:e.image.url,alt:((A=e.image)==null?void 0:A.name)??"",style:p?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:d(i),objectFit:"contain"},onLoad:s?a:void 0,onError:s?a:void 0});return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...p?{width:N}:{width:"fit-content",maxWidth:d(i),minWidth:0}},children:r.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...p?{width:N,height:_,overflow:"hidden"}:{width:"fit-content",maxWidth:d(i),height:d(o)}},children:W&&e.link?r.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:Be(`${t}-marquee-link`,!p&&`${t}-marquee-link-contain`),children:W}):W})})},Ld=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=L.useScopedStyles(),s=c.useMemo(()=>vd(l),[l]),{speed:d,direction:a,pauseOnHover:u,gap:p,imageMaxWidth:I,imageMaxHeight:S,imageFit:v,hoverEffect:g}=e,h=!!o,R=!n||!!i,T=R&&g!=="off"&&g!=="randomize"?`${l}-image-hover-${g}`:void 0,y=n?!!i:!0,N=((t==null?void 0:t.length)??0)>0&&(y||!!n),_=Math.max(0,d)*bd,W=f=>L.scalingValue(f,n??!1),C=c.useRef(null),P=c.useRef(null),A=c.useRef(null),[E,k]=c.useState(0),[B,V]=c.useState(0),K=y&&u==="on",[ee,m]=c.useState(!1),[b,F]=c.useState({}),M=c.useRef(b);M.current=b;const $=c.useRef(null),O=c.useRef(0),U=c.useRef(null),te=c.useMemo(()=>(t??[]).map(f=>{var H;return((H=f.image)==null?void 0:H.url)??""}).join("\0"),[t]),[Y,fe]=c.useState(oo),x=c.useMemo(()=>{const f=t??[];return!y||f.length===0?f:Cd(f,Y)},[t,y,Y]),q=c.useMemo(()=>x.filter(f=>{var H;return!!((H=f.image)!=null&&H.url)}).length,[x]),he=N?Sd:1;c.useLayoutEffect(()=>{O.current=0,F({}),$.current=null,fe(oo),k(0)},[te]),c.useEffect(()=>{if(!R||g!=="randomize")return;const f=C.current;if(!f)return;const H=oe=>{F(ie=>{let ge=null;for(const ve of oe)ve in ie&&(wd(f,ve)||(ge||(ge={...ie}),delete ge[ve]));return ge??ie})},j=new IntersectionObserver(oe=>{const ie=new Set;for(const ge of oe){const ve=ge.target.dataset.marqueeItemIndex,Se=ve!==void 0?Number(ve):NaN;Number.isNaN(Se)||ie.add(Se)}ie.size>0&&H(ie)},{root:f,threshold:0});Object.keys(b).forEach(oe=>{const ie=Number(oe);f.querySelectorAll(`[data-marquee-item-index="${ie}"]`).forEach(ge=>j.observe(ge))});let ne=0;const de=()=>{const oe=Object.keys(M.current);oe.length!==0&&(H(oe.map(Number)),ne=requestAnimationFrame(de))};return Object.keys(M.current).length>0&&(ne=requestAnimationFrame(de)),()=>{cancelAnimationFrame(ne),j.disconnect()}},[g,b,R]),c.useLayoutEffect(()=>{if(!N)return;const f=C.current,H=A.current;if(!f||!H)return;let j=0;const ne=()=>{const ie=f.getBoundingClientRect().width,ge=H.getBoundingClientRect().width,ve=$.current,Se=typeof ve=="number"&&Math.abs(ve-ge)<=.25;if($.current=ge,y&&ge>0&&Y>0){const D=ge/Y;if(D>0&&ie>0){const ue=Math.max(oo,Math.ceil(ie/D)+1);if(ue!==Y){fe(ue);return}}}if(ge>0&&E<=0){k(ge);return}Se&&ge!==E?k(ge):!Se&&E<=0&&(cancelAnimationFrame(j),j=requestAnimationFrame(ne))},de=()=>{cancelAnimationFrame(j),j=requestAnimationFrame(ne)};U.current=de,de();const oe=new ResizeObserver(de);return oe.observe(f),oe.observe(H),()=>{U.current=null,cancelAnimationFrame(j),oe.disconnect()}},[y,N,E,te,Y]),c.useLayoutEffect(()=>{const f=P.current;if(!N||!f)return;const H=E>0?E:0,j=H>0&&_>0?H/_*1e3:0,ne=`${Math.max(0,j)/1e3}s`;f.style.setProperty("--marquee-distance",`${H}px`),f.style.setProperty("--marquee-duration",ne)},[y,N,_,E]),c.useLayoutEffect(()=>{if(!N){V(0);return}if(E<=0){V(0);return}const f=P.current;if(!f)return;const H=()=>{const ne=f.getBoundingClientRect().height;V(ne>0?ne:0)};H();const j=new ResizeObserver(H);return j.observe(f),()=>j.disconnect()},[N,he,x,n,p,I,S,E,v,b]);const pe=()=>{K&&m(!0)},be=()=>{K&&m(!1)},J=c.useCallback(()=>{var f;O.current=Math.min(q,O.current+1),(f=U.current)==null||f.call(U)},[q]),me=c.useCallback((f,H)=>{F(j=>{const ne=j[f]??H,de=(t??[]).filter(ie=>ie!==ne);if(de.length===0)return j;const oe=de[Math.floor(Math.random()*de.length)];return{...j,[f]:oe}})},[t]),G=(f,H,j,ne)=>{const de=R&&g==="randomize"&&v.display==="Cover"?b[j]??f:f,oe=`max(${W(p)}, ${xd}px)`,ie=`calc(-0.5 * (${oe} + ${W(p)}))`;return r.jsxs("div",{className:`${l}-marquee-card`,"data-marquee-item-index":j,onMouseEnter:R&&g==="randomize"&&v.display==="Cover"?()=>me(j,f):void 0,children:[r.jsx(Td,{item:de,prefix:l,imageFit:v,imageMaxWidth:I,imageMaxHeight:S,imageHoverClass:T,isEditor:n,isFirstSet:ne,scaled:W,onFirstSetImageDone:J}),h&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${l}-gap-control`,style:{position:"absolute",top:0,right:ie,width:oe,height:"100%"}})]},`${H}-${j}`)};if(N){const f=y?K&&ee?"paused":"running":"paused";return r.jsxs("div",{ref:C,className:Be(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Marquee",style:E>0&&B>0?{height:B}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsx("div",{ref:P,className:`${l}-marquee-track`,"data-direction":a,onMouseEnter:pe,onMouseLeave:be,style:{"--marquee-play-state":f},children:Array.from({length:he},(H,j)=>r.jsx("div",{ref:j===0?A:void 0,className:Be(`${l}-marquee-row`,`${l}-marquee-set`),style:{gap:W(p),paddingRight:W(p)},"aria-hidden":j>0,children:x.map((ne,de)=>G(ne,j,de,j===0))},`set-${j}`))},"marquee-track")]})}return r.jsxs("div",{ref:C,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsx("div",{className:Be(`${l}-marquee-row`,`${l}-marquee-static`),style:{gap:W(p),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((f,H)=>G(f,0,H))},"marquee-static")]})},Ed=`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';
|
|
@@ -2407,7 +2407,7 @@ type MarqueeProps = {
|
|
|
2407
2407
|
pointer-events: auto;
|
|
2408
2408
|
z-index: 10;
|
|
2409
2409
|
}
|
|
2410
|
-
`}const Pd=30,$r=2,_d=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=
|
|
2410
|
+
`}const Pd=30,$r=2,_d=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=L.useScopedStyles(),{align:s,speed:d,direction:a,pauseOnHover:u,gap:p,cardWidth:I,corners:S,stroke:v,strokeColor:g,bgColor:h,padding:R,logoMarginTop:T,logoWidth:y,logoHeight:w,captionMarginTop:N}=e,_=!!o,W=((t==null?void 0:t.length)??0)>0,C=d>0&&(!n||!!i),P=W&&(C||!!n),A=Math.max(0,d)*Pd,E=D=>L.scalingValue(D,n??!1),k=c.useRef(null),B=c.useRef(null),V=c.useRef(null),[K,ee]=c.useState(0),[m,b]=c.useState(0),[F,M]=c.useState(0),$=C&&u==="on",[O,U]=c.useState(!1),te=c.useRef(null),[Y,fe]=c.useState(0),[x,q]=c.useState(0),he=c.useRef(null),pe=D=>{var z,X,Ce,_e,Ze;return{fontSettings:{fontFamily:(e==null?void 0:e[`${D}FontFamily`])??"Arial",fontWeight:((z=e==null?void 0:e[`${D}FontSettings`])==null?void 0:z.fontWeight)??400,fontStyle:((X=e==null?void 0:e[`${D}FontSettings`])==null?void 0:X.fontStyle)??"normal"},textAppearance:{textTransform:((Ce=e==null?void 0:e[`${D}TextAppearance`])==null?void 0:Ce.textTransform)??"none",textDecoration:((_e=e==null?void 0:e[`${D}TextAppearance`])==null?void 0:_e.textDecoration)??"none",fontVariant:((Ze=e==null?void 0:e[`${D}TextAppearance`])==null?void 0:Ze.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${D}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${D}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${D}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${D}LineHeight`])??.01,color:(e==null?void 0:e[`${D}Color`])??"#000000"}},be=pe("text"),J=pe("caption"),me=c.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(D=>{var ue,z;return(((ue=D.text)==null?void 0:ue.length)??0)>0||(((z=D.caption)==null?void 0:z.length)??0)>0}),[t]),G=c.useMemo(()=>!P||(t==null?void 0:t.length)===0?1:m<=0||K<=0?$r:Math.max($r,Math.ceil(K/m)+1),[P,t==null?void 0:t.length,m,K]);c.useLayoutEffect(()=>{if(!P)return;const D=k.current,ue=V.current;if(!D||!ue)return;let z=0;const X=()=>{const Ze=D.getBoundingClientRect().width,We=ue.getBoundingClientRect().width,ze=he.current,Ne=typeof ze=="number"&&Math.abs(ze-We)<=.25;if(he.current=We,ee(Ze),typeof We=="number"&&We>0&&m<=0){b(We);return}Ne&&We!==m?b(We):!Ne&&m<=0&&(cancelAnimationFrame(z),z=requestAnimationFrame(X))},Ce=()=>{cancelAnimationFrame(z),z=requestAnimationFrame(X)};Ce();const _e=new ResizeObserver(Ce);return _e.observe(D),_e.observe(ue),()=>{cancelAnimationFrame(z),_e.disconnect()}},[C,P,m]),c.useLayoutEffect(()=>{const D=B.current;if(!P||!D)return;const ue=m>0?m:0,z=ue>0&&A>0?ue/A*1e3:0,X=`${Math.max(0,z)/1e3}s`;D.style.setProperty("--marquee-distance",`${ue}px`),D.style.setProperty("--marquee-duration",X)},[C,P,A,m]),c.useLayoutEffect(()=>{if(!P){M(0);return}const D=V.current,ue=B.current;if(!D||!ue)return;const z=()=>{let Ce=0;for(let _e=0;_e<D.children.length;_e++){const We=D.children[_e].firstElementChild;We&&(Ce=Math.max(Ce,We.offsetHeight))}Ce<=0&&(Ce=ue.offsetHeight),M(Ce>0?Ce:0)};z();const X=new ResizeObserver(z);return X.observe(D),X.observe(ue),()=>{X.disconnect()}},[P,G,t,n,p,I,R,v,S,y,w,Y,x]);const f=()=>{$&&U(!0)},H=()=>{$&&U(!1)},j=c.useMemo(()=>{switch(s){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[s]),ne=c.useMemo(()=>{switch(s){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[s]),de=c.useCallback((D,ue,z,X)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:j,width:"100%"},children:[r.jsx("div",{"data-controls":_?X==null?void 0:X.controlsName:void 0,"data-controls-axis":_?"y":void 0,className:_?`${l}-control`:void 0,style:{height:E((X==null?void 0:X.marginTop)??0)}}),r.jsx("div",{...X!=null&&X.dataMeasureKind?{"data-testimonial-measure":X.dataMeasureKind}:{},style:{...ut(D,n),textAlign:ne,pointerEvents:"auto",...typeof(X==null?void 0:X.minHeightPx)=="number"&&X.minHeightPx>0?{minHeight:X.minHeightPx}:{}},children:r.jsx(Gn,{content:ue})})]},z),[j,ne,n,_,l,E]),oe=c.useCallback((D,ue,z)=>{var X,Ce,_e;return r.jsxs("div",{style:{padding:`${E(R.top)} ${E(R.right)} ${E(R.bottom)} ${E(R.left)}`,width:E(I+v*2),height:"100%",borderRadius:E(S),border:`${E(v)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${l}-cover`,style:{background:h}}),r.jsxs("div",{className:`${l}-elements-overlay`,style:{alignItems:j,textAlign:ne},children:[D.text&&de(be,D.text,"text",z!=null&&z.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(z==null?void 0:z.textMinHeightPx)=="number"&&z.textMinHeightPx>0?{minHeightPx:z.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:j,width:"100%"},children:[r.jsx("div",{"data-controls":_&&!(z!=null&&z.dataMeasureAttrs)?"logoMarginTop":void 0,className:_&&!(z!=null&&z.dataMeasureAttrs)?`${l}-control`:void 0,style:{height:E(T)}}),r.jsx("div",{style:{width:E(y),height:E(w)},children:((X=D.logo)==null?void 0:X.url)&&r.jsx("img",{src:D.logo.url,alt:((Ce=D.logo)==null?void 0:Ce.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((_e=D.logo)==null?void 0:_e.objectFit)||"contain"}})})]}),D.caption&&de(J,D.caption,"caption",{...z!=null&&z.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:N,...z!=null&&z.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(z==null?void 0:z.captionMinHeightPx)=="number"&&z.captionMinHeightPx>0?{minHeightPx:z.captionMinHeightPx}:{}})]})]},ue)},[h,N,J,I,S,w,T,y,j,ne,R.bottom,R.left,R.right,R.top,de,v,g,be,n,_,l]),ie=c.useCallback(D=>{fe(D.maxTextPx),q(D.maxCaptionPx)},[]);c.useLayoutEffect(()=>{if(!me){ie({maxTextPx:0,maxCaptionPx:0});return}const D=te.current;if(!D)return;const ue=()=>{L.readTestimonialTextMeasure(D,ie)};ue();const z=new ResizeObserver(ue);return z.observe(D),()=>{z.disconnect()}},[me,ie,t,oe]);const ge=me?{textMinHeightPx:Y,captionMinHeightPx:x}:void 0,ve=me?r.jsx("div",{ref:te,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((D,ue)=>oe(D,`measure-${ue}`,{dataMeasureAttrs:!0}))}):null,Se=(D,ue)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[oe(D,`card-${ue}`,ge),_&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${E(p)})`,width:E(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},ue);if(P){const D=C?$&&O?"paused":"running":"paused";return r.jsxs("div",{ref:k,className:Be(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...F>0?{height:F}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Cr(l)}}),ve,r.jsx("div",{ref:B,className:`${l}-marquee-track`,"data-direction":a,onMouseEnter:f,onMouseLeave:H,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":D},children:Array.from({length:G},(ue,z)=>r.jsx("div",{ref:z===0?V:void 0,className:`${l}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:E(p),paddingRight:E(p)},"aria-hidden":z>0,children:t==null?void 0:t.map((X,Ce)=>Se(X,`${z}-${Ce}`))},`set-${z}`))})]})}return r.jsxs("div",{className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Cr(l)}}),ve,r.jsx("div",{style:{gap:E(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((D,ue)=>Se(D,ue))})]})},Ad=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2411
2411
|
import cn from 'classnames';
|
|
2412
2412
|
import { CommonComponentProps } from '../props';
|
|
2413
2413
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3146,7 +3146,7 @@ type TestimonialsSettings = {
|
|
|
3146
3146
|
width: 100%;
|
|
3147
3147
|
height: 100%;
|
|
3148
3148
|
}
|
|
3149
|
-
`}const Wd=3e3,Nd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=
|
|
3149
|
+
`}const Wd=3e3,Nd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=L.useScopedStyles(),s=t||[],{speed:d,align:a,width:u,imageMarginTop:p,textMarginTop:I,captionMarginTop:S,imageWidth:v,imageHeight:g,controlsWidth:h,controlsColor:R,controlsHoverColor:T}=e,y=d>0&&(!n||!!i),[w,N]=c.useState(0),[_,W]=c.useState(null),[C,P]=c.useState(!1),A=c.useRef(null),E=c.useMemo(()=>{switch(a){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[a]),k=c.useMemo(()=>{switch(a){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[a]);c.useEffect(()=>{N(0),W(null),P(!1)},[s.length]);const B=s[w],V=_===null?null:s[_],K=J=>{var G,f,H,j,ne;return{fontSettings:{fontFamily:(e==null?void 0:e[`${J}FontFamily`])??"Arial",fontWeight:((G=e==null?void 0:e[`${J}FontSettings`])==null?void 0:G.fontWeight)??400,fontStyle:((f=e==null?void 0:e[`${J}FontSettings`])==null?void 0:f.fontStyle)??"normal"},textAppearance:{textTransform:((H=e==null?void 0:e[`${J}TextAppearance`])==null?void 0:H.textTransform)??"none",textDecoration:((j=e==null?void 0:e[`${J}TextAppearance`])==null?void 0:j.textDecoration)??"none",fontVariant:((ne=e==null?void 0:e[`${J}TextAppearance`])==null?void 0:ne.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${J}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${J}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${J}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${J}WordSpacing`])??0,color:(e==null?void 0:e[`${J}Color`])??"#000000"}},ee=K("text"),m=K("caption"),b=s.length>1&&s.some(J=>{var me,G;return(((me=J.text)==null?void 0:me.length)??0)>0||(((G=J.caption)==null?void 0:G.length)??0)>0}),F=c.useRef(null),[M,$]=c.useState(0),[O,U]=c.useState(0),te=e.controls??{mode:"Off",icon:null},Y=s.length>1,fe=c.useCallback((J,me)=>!Y||me===J?J:(A.current&&window.clearTimeout(A.current),W(J),P(!0),A.current=window.setTimeout(()=>{W(null),P(!1),A.current=null},300),me),[Y]),x=c.useCallback(()=>{Y&&N(J=>fe(J,(J-1+s.length)%s.length))},[Y,fe,s.length]),q=c.useCallback(()=>{Y&&N(J=>fe(J,(J+1)%s.length))},[Y,fe,s.length]);c.useEffect(()=>{if(!y||!Y)return;const J=Math.max(300,Wd/d),me=window.setInterval(()=>{N(G=>fe(G,(G+1)%s.length))},J);return()=>{window.clearInterval(me)}},[y,Y,fe,s.length,d]),c.useEffect(()=>()=>{A.current&&window.clearTimeout(A.current)},[]);const he=(J,me)=>{var ne,de,oe,ie;const G=me==null?void 0:me.textMinHeightPx,f=me==null?void 0:me.captionMinHeightPx,H=me==null?void 0:me.dataMeasureAttrs,j=o&&!(me!=null&&me.dataMeasureAttrs)&&!(me!=null&&me.hideControls);return r.jsxs(r.Fragment,{children:[J.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:E,width:"100%"},children:[r.jsx("div",{"data-controls":j?"textMarginTop":void 0,className:j?`${l}-control`:void 0,style:{height:L.scalingValue(I??0,n??!1)}}),r.jsx("div",{...H&&{"data-testimonial-measure":"text"},style:{...ut(ee,n),...G&&G>0?{minHeight:G}:{},textAlign:k,pointerEvents:"auto"},children:r.jsx(Gn,{content:J.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:E,width:"100%"},children:[r.jsx("div",{"data-controls":j?"imageMarginTop":void 0,className:j?`${l}-control`:void 0,style:{height:L.scalingValue(p??0,n??!1)}}),r.jsx("div",{style:{width:L.scalingValue(v??0,n??!1),height:L.scalingValue(g??0,n??!1)},children:((ne=J.image)==null?void 0:ne.url)&&r.jsx("img",{src:(de=J.image)==null?void 0:de.url,alt:((oe=J.image)==null?void 0:oe.name)??"",className:`${l}-icon`,style:{objectFit:((ie=J.image)==null?void 0:ie.objectFit)||"contain"}})})]}),J.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:E,width:"100%"},children:[r.jsx("div",{"data-controls":j?"captionMarginTop":void 0,className:j?`${l}-control`:void 0,style:{height:L.scalingValue(S??0,n??!1)}}),r.jsx("div",{...H?{"data-testimonial-measure":"caption"}:{},style:{...ut(m,n),...f&&f>0?{minHeight:f}:{},textAlign:k,pointerEvents:"auto"},children:r.jsx(Gn,{content:J.caption})})]})]})},pe=c.useCallback(J=>{$(J.maxTextPx),U(J.maxCaptionPx)},[]);if(c.useLayoutEffect(()=>{if(!b){pe({maxTextPx:0,maxCaptionPx:0});return}const J=F.current;if(!J)return;const me=()=>{L.readTestimonialTextMeasure(J,pe)};me();const G=new ResizeObserver(me);return G.observe(J),()=>{G.disconnect()}},[b,pe,t]),!B)return r.jsx(r.Fragment,{});const be=b?{textMinHeightPx:M,captionMinHeightPx:O}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${l}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Fd(l)}}),r.jsxs("div",{className:`${l}-wrapper`,style:{width:L.scalingValue(u??0,n??!1),alignItems:E},children:[b&&r.jsx("div",{ref:F,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((J,me)=>r.jsx("div",{style:{width:"100%"},children:he(J,{dataMeasureAttrs:!0})},me))}),r.jsxs("div",{className:`${l}-fade-stack`,children:[V&&C&&r.jsx("div",{className:Be(`${l}-fade-item-prev`,`${l}-fade-out`),children:he(V,{...be,hideControls:!0})}),r.jsx("div",{className:Be(`${l}-fade-item-current`,C?`${l}-fade-in`:void 0),children:he(B,be)})]})]}),te.mode==="On"&&r.jsxs("div",{className:`${l}-controls`,children:[r.jsx("div",{className:`${l}-arrow`,style:{width:L.scalingValue(h??.02,n??!1),height:L.scalingValue(h??.02,n??!1),"--arrow-hover-color":T},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:x,disabled:!Y,"aria-label":"Previous testimonial",children:te.icon&&r.jsx(At,{url:te.icon,fill:R,hoverFill:T,className:Be(`${l}-arrow-img`,`${l}-mirror`)})})}),r.jsx("div",{className:Be(`${l}-arrow`,`${l}-next-arrow`),style:{width:L.scalingValue(h??.02,n??!1),height:L.scalingValue(h??.02,n??!1),"--arrow-hover-color":T},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:q,disabled:!Y,"aria-label":"Next testimonial",children:te.icon&&r.jsx(At,{url:te.icon,fill:R,hoverFill:T,className:`${l}-arrow-img`})})})]})]})})},Hd=`import cn from 'classnames';
|
|
3150
3150
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3151
3151
|
import { CommonComponentProps } from '../props';
|
|
3152
3152
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3642,7 +3642,7 @@ type TestimonialsSettings = {
|
|
|
3642
3642
|
icon?: string | null;
|
|
3643
3643
|
};
|
|
3644
3644
|
};
|
|
3645
|
-
`,Bd="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>'),Tr={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Od={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:{...Tr.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:{...Tr.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:Bd},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"}]}]}]}},jd={element:Nd,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:Od,sourceCode:Hd,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function zd(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Lr(e){return((e==null?void 0:e.trim().length)??0)>0}function ro(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ao(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:
|
|
3645
|
+
`,Bd="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>'),Tr={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Od={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:{...Tr.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:{...Tr.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:Bd},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"}]}]}]}},jd={element:Nd,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:Od,sourceCode:Hd,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function zd(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Lr(e){return((e==null?void 0:e.trim().length)??0)>0}function ro(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ao(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 Vd(e){return`
|
|
3646
3646
|
.${e}-wrapper {
|
|
3647
3647
|
display: grid;
|
|
3648
3648
|
align-items: start;
|
|
@@ -3845,7 +3845,7 @@ type TestimonialsSettings = {
|
|
|
3845
3845
|
pointer-events: auto;
|
|
3846
3846
|
z-index: 10;
|
|
3847
3847
|
}
|
|
3848
|
-
`}const Wt=500,Dd=750,Kt="cubic-bezier(0.22, 1, 0.36, 1)";function Ut(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function Er({media:e,className:t,style:n,onImageClick:i}){return Ut(e)?r.jsx("video",{src:e.url,className:t,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:n,onClick:i})}function Gd({images:e,index:t,imageDisplay:n,originRect:i,reverseClose:o,onClose:l,onPrev:s,onNext:d,counterClassName:a,counterStyle:u}){const p=n==="cover",I=c.useRef(null),x=c.useRef(null),[b,g]=c.useState(null),[h,R]=c.useState(i?"opening":"open"),[w,y]=c.useState(!0),$=c.useRef(t),N=c.useCallback(()=>{const L=I.current,F=x.current;if(!L||!F)return;const B=L.getBoundingClientRect(),z=B.width,K=B.height,Z=F.naturalWidth,m=F.naturalHeight;if(!z||!K||!Z||!m)return;if(n==="cover"){g({width:z,height:K,left:B.left,top:B.top});return}const E=Z/m,W=z/K;if(E>W){const A=z/E;g({width:z,height:A,left:B.left,top:B.top+(K-A)/2})}else{const A=K*E;g({width:A,height:K,left:B.left+(z-A)/2,top:B.top})}},[n]);c.useEffect(()=>{N();const L=I.current;if(!L)return;const F=new ResizeObserver(()=>N());return F.observe(L),()=>F.disconnect()},[N,t]),c.useEffect(()=>{h==="opening"&&b&&R("open")},[h,b]),c.useEffect(()=>{if(h!=="closing")return;const L=setTimeout(()=>l(),Wt);return()=>clearTimeout(L)},[h,l]),c.useEffect(()=>{$.current!==t&&y(!1),$.current=t},[t]),c.useEffect(()=>{const L=F=>{F.key==="Escape"&&(F.preventDefault(),F.stopPropagation(),h!=="closing"&&R("closing"))};return window.addEventListener("keydown",L,!0),()=>window.removeEventListener("keydown",L,!0)},[h]);const _=()=>{h!=="closing"&&R("closing")},M=h==="open",S=h==="closing",P=S&&o&&!!i,k=h==="opening"?i??b:P?i:b;return r.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:_,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:M?1:0,transition:`opacity ${Wt}ms ${Kt}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:I,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:M?1:0,transition:`opacity ${Wt}ms ${Kt}`,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:I,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:M?1:0,transition:`opacity ${Wt}ms ${Kt}`},children:e.length>1&&r.jsxs("p",{className:a,style:u,children:[t+1," / ",e.length]})})]})}),k&&r.jsx("img",{ref:x,src:e[t],onLoad:N,style:{position:"fixed",top:k.top,left:k.left,width:k.width,height:k.height,objectFit:n==="cover"?"cover":"contain",opacity:S&&!P?0:1,transition:S&&!P?`opacity ${Wt}ms ${Kt}`:P||w?`top ${Wt}ms ${Kt}, left ${Wt}ms ${Kt}, width ${Wt}ms ${Kt}, height ${Wt}ms ${Kt}`:"none",pointerEvents:"none",zIndex:9998}}),M&&b&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{position:"fixed",top:b.top,left:b.left,width:b.width/2,height:b.height,cursor:"w-resize",zIndex:9999},onClick:L=>{L.stopPropagation(),s()}}),r.jsx("div",{style:{position:"fixed",top:b.top,left:b.left+b.width/2,width:b.width/2,height:b.height,cursor:"e-resize",zIndex:9999},onClick:L=>{L.stopPropagation(),d()}})]})]})}function Kd(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Ud({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:d}){const{prefix:a}=T.useScopedStyles(),{type:u="a",gridLayout:p,textBoxWidth:I=100,verticalGap:x,entriesCount:b,lightbox:g,imageDisplay:h,lightboxImageDisplay:R,slider:w,sliderTiming:y,direction:$,transition:N,titleMarginTop:_,subtitleMarginTop:M,titleColor:S,subtitleColor:P,lightboxCounterColor:k,titleFontFamily:L,titleFontSettings:F,titleFontSize:B,titleLineHeight:z,titleLetterSpacing:K,titleWordSpacing:Z,titleTextAppearance:m,subtitleFontFamily:E,subtitleFontSettings:W,subtitleFontSize:A,subtitleLineHeight:C,subtitleLetterSpacing:V,subtitleWordSpacing:q,subtitleTextAppearance:ee,lightboxCounterFontFamily:J,lightboxCounterFontSettings:ye,lightboxCounterFontSize:v,lightboxCounterLineHeight:U,lightboxCounterLetterSpacing:he,lightboxCounterWordSpacing:ue,lightboxCounterTextAppearance:ge,showText:ie="always",alignEntries:fe="off"}=e,G={fontSettings:{fontFamily:L,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:B??.01,lineHeight:z,letterSpacing:K??0,wordSpacing:Z??0,textAppearance:m,color:S},H={..._t(ut(G,n))},j={fontSettings:{fontFamily:E,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:A??.01,lineHeight:C,letterSpacing:V??0,wordSpacing:q??0,textAppearance:ee,color:P},ce={..._t(ut(j,n))},ne={fontSettings:{fontFamily:J,fontWeight:(ye==null?void 0:ye.fontWeight)??400,fontStyle:(ye==null?void 0:ye.fontStyle)??"normal"},fontSize:v??.01,lineHeight:U,letterSpacing:he??0,wordSpacing:ue??0,textAppearance:ge,color:k},pe={..._t(ut(ne,n)),...ao(v,U,a,n)},Se=ro(B,z,`${a}-item-title`,`${a}-text-tight-leading`),be=ro(A,C,`${a}-item-subtitle`,`${a}-text-tight-leading`),D=ao(B,z,a,n),de=ao(A,C,a,n),O=ro(v,U,`${a}-lightbox-counter`,`${a}-text-tight-leading`),Y=T.buildColorVars(a,{titleColor:S,subtitleColor:P,lightboxCounterColor:k},qd,Xd),Qe=`${s&&s!=="default"?`${a}-state-${s}`:""}${ie==="on hover"&&(!n||i)?` ${a}-show-text-hover`:""}`.trim(),He=b===0?1/0:b,Be=(t??[]).slice(0,He),je=p.entryWidth??.2,ke=(h==null?void 0:h.display)==="cover",Ge=(h==null?void 0:h.ratioValue)??"1:1",Ye=(h==null?void 0:h.reversed)??!1,[Ee,Je]=Ge.split(":").map(Number),rt=`${Ye?Je:Ee} / ${Ye?Ee:Je}`,X=T.scalingValue(je??0,n),re=!ke&&w!=="off",se={width:X,...ke?{aspectRatio:rt,height:"auto",overflow:"hidden"}:{height:"auto"}},Ce=`${a}-item-image-wrapper${re?` ${a}-item-image-wrapper-fit-slider`:""}`.trim(),me=u==="c",Oe=me&&fe==="on",Ve=`calc(${T.scalingValue(je??0,n)} * (${I} / 100))`,ae=T.scalingValue(je*I/100,n),$e=ke?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[_e,Re]=c.useState("ltr"),[ze,ht]=c.useState(0),Te=c.useRef(null);c.useEffect(()=>{const We=Te.current;if(!We)return;const bt=new ResizeObserver(xt=>{ht(Math.round(xt[0].contentRect.width))});return bt.observe(We),()=>bt.disconnect()},[]);const tt=(()=>{const We={...Y},bt=Te.current?getComputedStyle(Te.current).getPropertyValue("--cntrl-article-width").trim():"";return bt&&(We["--cntrl-article-width"]=bt),We})(),[Xe,Ze]=c.useState(!1),[dt,tn]=c.useState([]),[Xi,pn]=c.useState(0),[Yi,ai]=c.useState(null),li=(We,bt,xt)=>{if(n&&!i||g==="off")return;const oe=We.currentTarget.getBoundingClientRect();ai({top:oe.top,left:oe.left,width:oe.width,height:oe.height}),tn(bt),pn(xt),Ze(!0)};c.useEffect(()=>{if(!Xe||g!=="on"||typeof document>"u")return;const We=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=We}},[Xe,g]),c.useEffect(()=>{!n||i||(Ze(!1),ai(null))},[n,i]);const Ji=c.useMemo(()=>Vd(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ji}}),r.jsx("div",{style:Y,children:r.jsx("div",{ref:Te,className:`${a}-wrapper ${a}-type-${u}${Oe?` ${a}-align-entries`:""} ${Qe}`.trim(),style:{gridTemplateColumns:`repeat(${p.columnsCount}, minmax(0, 1fr))`,rowGap:Oe?0:T.scalingValue(x??0,n),columnGap:T.scalingValue(p.horizontalGap??0,n),width:T.scalingValue(p.wrapperWidth??0,n),...Oe?{[`--${a}-align-entries-row-gap`]:T.scalingValue(x??0,n)}:{}},children:Be.map((We,bt)=>{var lt,$t;const xt=Lr(We.title),oe=Lr(We.subtitle),xe=(((lt=We.link)==null?void 0:lt.length)??0)>0&&g==="off"?We.link:void 0,Le=Math.floor(bt/p.columnsCount)===Math.ceil(Be.length/p.columnsCount)-1,Ae=me?r.jsxs("div",{className:`${a}-item-text-block`,children:[xt&&r.jsx("p",{className:Se,style:{width:Ve,...H,...D},children:We.title}),xt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:T.scalingValue(_??0,n),width:ae}}),oe&&r.jsx("p",{className:be,style:{width:Ve,...ce,...de},children:We.subtitle}),oe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:T.scalingValue(M??0,n),width:ae}})]}):null,it=me?r.jsxs("div",{className:`${a}-item-title-row`,children:[xt&&r.jsx("p",{className:Se,style:{width:Ve,...H,...D},children:We.title}),xt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:T.scalingValue(_??0,n),width:ae}})]}):null,at=me?r.jsxs("div",{className:`${a}-item-subtitle-row`,children:[oe&&r.jsx("p",{className:be,style:{width:Ve,...ce,...de},children:We.subtitle}),oe&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:T.scalingValue(M??0,n),width:ae}})]}):null,Me=xe?r.jsxs("a",{href:xe,target:"_blank",className:`${a}-item-text-link`,children:[it,at]}):r.jsxs(r.Fragment,{children:[it,at]}),St=r.jsx("div",{className:Ce,style:se,children:((($t=We.image)==null?void 0:$t.length)??0)===0?null:w==="off"?(()=>{const De=We.image[0],yt=We.image.filter(mt=>!Ut(mt)).map(mt=>mt.url);return r.jsx(Er,{media:De,className:`${a}-item-${Ut(De)?"video":"image"}`.trim(),style:$e,onImageClick:Ut(De)?void 0:mt=>li(mt,yt,0)})})():r.jsxs(r.Fragment,{children:[re&&r.jsx("div",{className:`${a}-item-image-wrapper-sizer`,"aria-hidden":"true",children:We.image.map(De=>Ut(De)?r.jsx("video",{src:De.url,muted:!0,playsInline:!0},`sizer-${De.url}`):r.jsx("img",{src:De.url,alt:""},`sizer-${De.url}`))}),r.jsx(Go,{className:`${a}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:y*1e3,width:"100%",height:"100%",speed:Dd,type:N==="fade"?"fade":"loop",rewind:N==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:N==="fade"?"ltr":$!=="random"?$==="horizontal"?"ltr":"ttb":_e},onMoved:De=>{if($!=="random"||N==="fade")return;const ft=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Re(ft),setTimeout(()=>{De.refresh()},0)},children:We.image.map((De,ft)=>{const yt=We.image.filter(st=>!Ut(st)),mt=yt.map(st=>st.url),mn=yt.findIndex(st=>st.url===De.url);return r.jsx(Ko,{children:r.jsx(Er,{media:De,className:`${a}-item-${Ut(De)?"video":"image"}`.trim(),style:$e,onImageClick:Ut(De)?void 0:st=>li(st,mt,mn)})},ft)})},`${N}-${je}-${$}-${y}-${ze}-${d}`)]})}),Ct=me?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&xt?"titleMarginTop":void 0,className:o&&xt?`${a}-control`:void 0,style:{height:xt?T.scalingValue(_??0,n):0,width:ae}}),r.jsx("p",{className:Se,style:{width:Ve,...H,...D},children:We.title}),r.jsx("div",{"data-controls":o&&oe?"subtitleMarginTop":void 0,className:o&&oe?`${a}-control`:void 0,style:{height:oe?T.scalingValue(M??0,n):0,width:ae}}),r.jsx("p",{className:be,style:{width:Ve,...ce,...de},children:We.subtitle})]});return r.jsx("div",{className:`${a}-item`.trim(),children:r.jsx("div",{className:`${o?`${a}-item-inner`:`${a}-item-inner-hidden`}${Oe&&Le?` ${a}-item-inner-last-row`:""}`.trim(),style:{width:(I??0)>100?`calc(${T.scalingValue(je??0,n)} * (${I} / 100))`:T.scalingValue(je??0,n)},children:Oe?r.jsxs(r.Fragment,{children:[Me,r.jsx("a",{href:xe,target:"_blank",className:`${a}-item-image-link`,children:St})]}):r.jsxs("a",{href:xe,target:"_blank",className:`${a}-item-image-link`,children:[Ae,St,Ct]})})},bt)})})}),(!n||i)&&Xe&&typeof document<"u"&&g==="on"&&Xn.createPortal(r.jsx("div",{style:tt,"data-selection":"none",children:r.jsx(Gd,{images:dt,index:Xi,imageDisplay:Kd(R),originRect:Yi,reverseClose:w==="off",onClose:()=>Ze(!1),onPrev:()=>pn(We=>(We-1+dt.length)%dt.length),onNext:()=>pn(We=>(We+1)%dt.length),counterClassName:O,counterStyle:pe})}),document.body)]})}const qd={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Xd=["hover","focus","filled","success","error"],Yd=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3848
|
+
`}const Wt=500,Dd=750,Kt="cubic-bezier(0.22, 1, 0.36, 1)";function Ut(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function Er({media:e,className:t,style:n,onImageClick:i}){return Ut(e)?r.jsx("video",{src:e.url,className:t,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:n,onClick:i})}function Gd({images:e,index:t,imageDisplay:n,originRect:i,reverseClose:o,onClose:l,onPrev:s,onNext:d,counterClassName:a,counterStyle:u}){const p=n==="cover",I=c.useRef(null),S=c.useRef(null),[v,g]=c.useState(null),[h,R]=c.useState(i?"opening":"open"),[T,y]=c.useState(!0),w=c.useRef(t),N=c.useCallback(()=>{const E=I.current,k=S.current;if(!E||!k)return;const B=E.getBoundingClientRect(),V=B.width,K=B.height,ee=k.naturalWidth,m=k.naturalHeight;if(!V||!K||!ee||!m)return;if(n==="cover"){g({width:V,height:K,left:B.left,top:B.top});return}const b=ee/m,F=V/K;if(b>F){const M=V/b;g({width:V,height:M,left:B.left,top:B.top+(K-M)/2})}else{const M=K*b;g({width:M,height:K,left:B.left+(V-M)/2,top:B.top})}},[n]);c.useEffect(()=>{N();const E=I.current;if(!E)return;const k=new ResizeObserver(()=>N());return k.observe(E),()=>k.disconnect()},[N,t]),c.useEffect(()=>{h==="opening"&&v&&R("open")},[h,v]),c.useEffect(()=>{if(h!=="closing")return;const E=setTimeout(()=>l(),Wt);return()=>clearTimeout(E)},[h,l]),c.useEffect(()=>{w.current!==t&&y(!1),w.current=t},[t]),c.useEffect(()=>{const E=k=>{k.key==="Escape"&&(k.preventDefault(),k.stopPropagation(),h!=="closing"&&R("closing"))};return window.addEventListener("keydown",E,!0),()=>window.removeEventListener("keydown",E,!0)},[h]);const _=()=>{h!=="closing"&&R("closing")},W=h==="open",C=h==="closing",P=C&&o&&!!i,A=h==="opening"?i??v:P?i:v;return r.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:_,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:W?1:0,transition:`opacity ${Wt}ms ${Kt}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:I,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:W?1:0,transition:`opacity ${Wt}ms ${Kt}`,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:I,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:W?1:0,transition:`opacity ${Wt}ms ${Kt}`},children:e.length>1&&r.jsxs("p",{className:a,style:u,children:[t+1," / ",e.length]})})]})}),A&&r.jsx("img",{ref:S,src:e[t],onLoad:N,style:{position:"fixed",top:A.top,left:A.left,width:A.width,height:A.height,objectFit:n==="cover"?"cover":"contain",opacity:C&&!P?0:1,transition:C&&!P?`opacity ${Wt}ms ${Kt}`:P||T?`top ${Wt}ms ${Kt}, left ${Wt}ms ${Kt}, width ${Wt}ms ${Kt}, height ${Wt}ms ${Kt}`:"none",pointerEvents:"none",zIndex:9998}}),W&&v&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{position:"fixed",top:v.top,left:v.left,width:v.width/2,height:v.height,cursor:"w-resize",zIndex:9999},onClick:E=>{E.stopPropagation(),s()}}),r.jsx("div",{style:{position:"fixed",top:v.top,left:v.left+v.width/2,width:v.width/2,height:v.height,cursor:"e-resize",zIndex:9999},onClick:E=>{E.stopPropagation(),d()}})]})]})}function Kd(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Ud({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:d}){const{prefix:a}=L.useScopedStyles(),{type:u="a",gridLayout:p,textBoxWidth:I=100,verticalGap:S,entriesCount:v,lightbox:g,imageDisplay:h,lightboxImageDisplay:R,slider:T,sliderTiming:y,direction:w,transition:N,titleMarginTop:_,subtitleMarginTop:W,titleColor:C,subtitleColor:P,lightboxCounterColor:A,titleFontFamily:E,titleFontSettings:k,titleFontSize:B,titleLineHeight:V,titleLetterSpacing:K,titleWordSpacing:ee,titleTextAppearance:m,subtitleFontFamily:b,subtitleFontSettings:F,subtitleFontSize:M,subtitleLineHeight:$,subtitleLetterSpacing:O,subtitleWordSpacing:U,subtitleTextAppearance:te,lightboxCounterFontFamily:Y,lightboxCounterFontSettings:fe,lightboxCounterFontSize:x,lightboxCounterLineHeight:q,lightboxCounterLetterSpacing:he,lightboxCounterWordSpacing:pe,lightboxCounterTextAppearance:be,showText:J="always",alignEntries:me="off"}=e,G={fontSettings:{fontFamily:E,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:B??.01,lineHeight:V,letterSpacing:K??0,wordSpacing:ee??0,textAppearance:m,color:C},H={..._t(ut(G,n))},j={fontSettings:{fontFamily:b,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:M??.01,lineHeight:$,letterSpacing:O??0,wordSpacing:U??0,textAppearance:te,color:P},de={..._t(ut(j,n))},oe={fontSettings:{fontFamily:Y,fontWeight:(fe==null?void 0:fe.fontWeight)??400,fontStyle:(fe==null?void 0:fe.fontStyle)??"normal"},fontSize:x??.01,lineHeight:q,letterSpacing:he??0,wordSpacing:pe??0,textAppearance:be,color:A},ge={..._t(ut(oe,n)),...ao(x,q,a,n)},ve=ro(B,V,`${a}-item-title`,`${a}-text-tight-leading`),Se=ro(M,$,`${a}-item-subtitle`,`${a}-text-tight-leading`),D=ao(B,V,a,n),ue=ao(M,$,a,n),z=ro(x,q,`${a}-lightbox-counter`,`${a}-text-tight-leading`),X=L.buildColorVars(a,{titleColor:C,subtitleColor:P,lightboxCounterColor:A},qd,Xd),Ze=`${s&&s!=="default"?`${a}-state-${s}`:""}${J==="on hover"&&(!n||i)?` ${a}-show-text-hover`:""}`.trim(),We=v===0?1/0:v,ze=(t??[]).slice(0,We),Ne=p.entryWidth??.2,Me=(h==null?void 0:h.display)==="cover",qe=(h==null?void 0:h.ratioValue)??"1:1",Xe=(h==null?void 0:h.reversed)??!1,[Pe,Ve]=qe.split(":").map(Number),rt=`${Xe?Ve:Pe} / ${Xe?Pe:Ve}`,ot=L.scalingValue(Ne??0,n),Z=!Me&&T!=="off",Q={width:ot,...Me?{aspectRatio:rt,height:"auto",overflow:"hidden"}:{height:"auto"}},ce=`${a}-item-image-wrapper${Z?` ${a}-item-image-wrapper-fit-slider`:""}`.trim(),se=u==="c",Le=se&&me==="on",Oe=`calc(${L.scalingValue(Ne??0,n)} * (${I} / 100))`,ae=L.scalingValue(Ne*I/100,n),$e=Me?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[Ie,Re]=c.useState("ltr"),[je,ht]=c.useState(0),we=c.useRef(null);c.useEffect(()=>{const He=we.current;if(!He)return;const bt=new ResizeObserver(xt=>{ht(Math.round(xt[0].contentRect.width))});return bt.observe(He),()=>bt.disconnect()},[]);const et=(()=>{const He={...X},bt=we.current?getComputedStyle(we.current).getPropertyValue("--cntrl-article-width").trim():"";return bt&&(He["--cntrl-article-width"]=bt),He})(),[Ye,Je]=c.useState(!1),[dt,tn]=c.useState([]),[Xi,pn]=c.useState(0),[Yi,ai]=c.useState(null),li=(He,bt,xt)=>{if(n&&!i||g==="off")return;const re=He.currentTarget.getBoundingClientRect();ai({top:re.top,left:re.left,width:re.width,height:re.height}),tn(bt),pn(xt),Je(!0)};c.useEffect(()=>{if(!Ye||g!=="on"||typeof document>"u")return;const He=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=He}},[Ye,g]),c.useEffect(()=>{!n||i||(Je(!1),ai(null))},[n,i]);const Ji=c.useMemo(()=>Vd(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ji}}),r.jsx("div",{style:X,children:r.jsx("div",{ref:we,className:`${a}-wrapper ${a}-type-${u}${Le?` ${a}-align-entries`:""} ${Ze}`.trim(),style:{gridTemplateColumns:`repeat(${p.columnsCount}, minmax(0, 1fr))`,rowGap:Le?0:L.scalingValue(S??0,n),columnGap:L.scalingValue(p.horizontalGap??0,n),width:L.scalingValue(p.wrapperWidth??0,n),...Le?{[`--${a}-align-entries-row-gap`]:L.scalingValue(S??0,n)}:{}},children:ze.map((He,bt)=>{var lt,$t;const xt=Lr(He.title),re=Lr(He.subtitle),xe=(((lt=He.link)==null?void 0:lt.length)??0)>0&&g==="off"?He.link:void 0,Te=Math.floor(bt/p.columnsCount)===Math.ceil(ze.length/p.columnsCount)-1,Ae=se?r.jsxs("div",{className:`${a}-item-text-block`,children:[xt&&r.jsx("p",{className:ve,style:{width:Oe,...H,...D},children:He.title}),xt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:L.scalingValue(_??0,n),width:ae}}),re&&r.jsx("p",{className:Se,style:{width:Oe,...de,...ue},children:He.subtitle}),re&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:L.scalingValue(W??0,n),width:ae}})]}):null,nt=se?r.jsxs("div",{className:`${a}-item-title-row`,children:[xt&&r.jsx("p",{className:ve,style:{width:Oe,...H,...D},children:He.title}),xt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:L.scalingValue(_??0,n),width:ae}})]}):null,at=se?r.jsxs("div",{className:`${a}-item-subtitle-row`,children:[re&&r.jsx("p",{className:Se,style:{width:Oe,...de,...ue},children:He.subtitle}),re&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:L.scalingValue(W??0,n),width:ae}})]}):null,ke=xe?r.jsxs("a",{href:xe,target:"_blank",className:`${a}-item-text-link`,children:[nt,at]}):r.jsxs(r.Fragment,{children:[nt,at]}),St=r.jsx("div",{className:ce,style:Q,children:((($t=He.image)==null?void 0:$t.length)??0)===0?null:T==="off"?(()=>{const De=He.image[0],yt=He.image.filter(mt=>!Ut(mt)).map(mt=>mt.url);return r.jsx(Er,{media:De,className:`${a}-item-${Ut(De)?"video":"image"}`.trim(),style:$e,onImageClick:Ut(De)?void 0:mt=>li(mt,yt,0)})})():r.jsxs(r.Fragment,{children:[Z&&r.jsx("div",{className:`${a}-item-image-wrapper-sizer`,"aria-hidden":"true",children:He.image.map(De=>Ut(De)?r.jsx("video",{src:De.url,muted:!0,playsInline:!0},`sizer-${De.url}`):r.jsx("img",{src:De.url,alt:""},`sizer-${De.url}`))}),r.jsx(Go,{className:`${a}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:y*1e3,width:"100%",height:"100%",speed:Dd,type:N==="fade"?"fade":"loop",rewind:N==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:N==="fade"?"ltr":w!=="random"?w==="horizontal"?"ltr":"ttb":Ie},onMoved:De=>{if(w!=="random"||N==="fade")return;const ft=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Re(ft),setTimeout(()=>{De.refresh()},0)},children:He.image.map((De,ft)=>{const yt=He.image.filter(st=>!Ut(st)),mt=yt.map(st=>st.url),mn=yt.findIndex(st=>st.url===De.url);return r.jsx(Ko,{children:r.jsx(Er,{media:De,className:`${a}-item-${Ut(De)?"video":"image"}`.trim(),style:$e,onImageClick:Ut(De)?void 0:st=>li(st,mt,mn)})},ft)})},`${N}-${Ne}-${w}-${y}-${je}-${d}`)]})}),Ct=se?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&xt?"titleMarginTop":void 0,className:o&&xt?`${a}-control`:void 0,style:{height:xt?L.scalingValue(_??0,n):0,width:ae}}),r.jsx("p",{className:ve,style:{width:Oe,...H,...D},children:He.title}),r.jsx("div",{"data-controls":o&&re?"subtitleMarginTop":void 0,className:o&&re?`${a}-control`:void 0,style:{height:re?L.scalingValue(W??0,n):0,width:ae}}),r.jsx("p",{className:Se,style:{width:Oe,...de,...ue},children:He.subtitle})]});return r.jsx("div",{className:`${a}-item`.trim(),children:r.jsx("div",{className:`${o?`${a}-item-inner`:`${a}-item-inner-hidden`}${Le&&Te?` ${a}-item-inner-last-row`:""}`.trim(),style:{width:(I??0)>100?`calc(${L.scalingValue(Ne??0,n)} * (${I} / 100))`:L.scalingValue(Ne??0,n)},children:Le?r.jsxs(r.Fragment,{children:[ke,r.jsx("a",{href:xe,target:"_blank",className:`${a}-item-image-link`,children:St})]}):r.jsxs("a",{href:xe,target:"_blank",className:`${a}-item-image-link`,children:[Ae,St,Ct]})})},bt)})})}),(!n||i)&&Ye&&typeof document<"u"&&g==="on"&&Xn.createPortal(r.jsx("div",{style:et,"data-selection":"none",children:r.jsx(Gd,{images:dt,index:Xi,imageDisplay:Kd(R),originRect:Yi,reverseClose:T==="off",onClose:()=>Je(!1),onPrev:()=>pn(He=>(He-1+dt.length)%dt.length),onNext:()=>pn(He=>(He+1)%dt.length),counterClassName:z,counterStyle:ge})}),document.body)]})}const qd={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Xd=["hover","focus","filled","success","error"],Yd=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3849
3849
|
import '@splidejs/react-splide/css/core';
|
|
3850
3850
|
import { CommonComponentProps } from '../props';
|
|
3851
3851
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -5014,7 +5014,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
5014
5014
|
};
|
|
5015
5015
|
|
|
5016
5016
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
5017
|
-
`,lo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Jd=["titleColor","subtitleColor","lightboxCounterColor"],Zd={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"}},image:{type:"object",label:"Image",display:{type:"media-list-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:[{title:"Flying Over the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",objectFit:"cover"}],link:""},{title:"Doors of Matera",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",objectFit:"cover"}],link:""},{title:"Cattedrale di Santa Maria",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",objectFit:"cover"}],link:""},{title:"City Through the Cracks",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",objectFit:"cover"}],link:""},{title:"Private Stone Gardens",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",objectFit:"cover"},{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",objectFit:"cover"},{url:"https://cdn.cntrl.site/component-assets/grid(7).webp",objectFit:"cover"}],link:""},{title:"Exiting the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(8).webp",objectFit:"cover"}],link:""},{title:"Under the Sun",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(9).webp",objectFit:"cover"}],link:""},{title:"Citygates View",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(10).webp",objectFit:"cover"}],link:""},{title:"Around the City",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(11).webp",objectFit:"cover"}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},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"]}},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:{...lo.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:{...lo.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:{...lo.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",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:"type",value:"a"},then:{name:"properties.alignEntries.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.alignEntries.display.visible",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","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","entriesCount"]},{type:"row",title:"",items:["verticalGap","showText"]},{type:"row",title:"",items:["alignEntries"]}]},{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","sliderTiming"]},{type:"group",title:"",items:["direction","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:[...Jd],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Qd={element:Ud,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:"image.url",placeholderEnabled:!0}],parameters:[]},schema:Zd,sourceCode:Yd};function eu(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 tu({media:e,className:t,style:n}){const i=c.useRef(null);return c.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const l=o.play();l&&l.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 wi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function nu(e){return String(e??"").trim().length>0}function Ir(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 Rr(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 Pr(e,t,n,i,o,l,s){const d=T.scalingValue(l,s),a=T.scalingValue(0,s),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:a,borderBottomWidth:!p||i?d:a}}function iu(e,t,n){const i=T.scalingValue(t,n),o=T.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const _r=10;function ou(e){return`
|
|
5017
|
+
`,lo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Jd=["titleColor","subtitleColor","lightboxCounterColor"],Zd={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"}},image:{type:"object",label:"Image",display:{type:"media-list-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:[{title:"Flying Over the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",objectFit:"cover"}],link:""},{title:"Doors of Matera",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",objectFit:"cover"}],link:""},{title:"Cattedrale di Santa Maria",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",objectFit:"cover"}],link:""},{title:"City Through the Cracks",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",objectFit:"cover"}],link:""},{title:"Private Stone Gardens",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",objectFit:"cover"},{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",objectFit:"cover"},{url:"https://cdn.cntrl.site/component-assets/grid(7).webp",objectFit:"cover"}],link:""},{title:"Exiting the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(8).webp",objectFit:"cover"}],link:""},{title:"Under the Sun",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(9).webp",objectFit:"cover"}],link:""},{title:"Citygates View",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(10).webp",objectFit:"cover"}],link:""},{title:"Around the City",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(11).webp",objectFit:"cover"}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},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"]}},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:{...lo.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:{...lo.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:{...lo.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",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:"type",value:"a"},then:{name:"properties.alignEntries.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.alignEntries.display.visible",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","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","entriesCount"]},{type:"row",title:"",items:["verticalGap","showText"]},{type:"row",title:"",items:["alignEntries"]}]},{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","sliderTiming"]},{type:"group",title:"",items:["direction","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:[...Jd],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Qd={element:Ud,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:"image.url",placeholderEnabled:!0}],parameters:[]},schema:Zd,sourceCode:Yd};function eu(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 tu({media:e,className:t,style:n}){const i=c.useRef(null);return c.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const l=o.play();l&&l.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 wi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function nu(e){return String(e??"").trim().length>0}function Ir(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 Rr(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 Pr(e,t,n,i,o,l,s){const d=L.scalingValue(l,s),a=L.scalingValue(0,s),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:a,borderBottomWidth:!p||i?d:a}}function iu(e,t,n){const i=L.scalingValue(t,n),o=L.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const _r=10;function ou(e){return`
|
|
5018
5018
|
.${e}-wrapper {
|
|
5019
5019
|
display: grid;
|
|
5020
5020
|
align-items: start;
|
|
@@ -5445,7 +5445,7 @@ a.${e}-list-item {
|
|
|
5445
5445
|
overflow-wrap: anywhere;
|
|
5446
5446
|
word-break: break-word;
|
|
5447
5447
|
}
|
|
5448
|
-
`}const Jt=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Uo=["AColumn","BColumn","CColumn","DColumn","EColumn"],zt="cutLabel",qo=[...Uo,zt],Ui=["A","B","C","D","E"];function ka(e){return`${e}ColumnVerticalAlign`}const $o=["Top","Center","Bottom"];function Xo(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Ui.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function ru(e){const t=Xo(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function au(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Ui.includes(n)?n:null}function Fa(e,t,n){const i=au(e);return i?i===t?!1:ru(n[ka(i)]):!0}function Kn(e){const t=Xo(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Ui.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function lu(e,t,n){if(Wa(e,t,n))return Kn(e);const i=Kn(e);return i.kind==="baseline"?{kind:"top"}:i}function su(e){const t=Kn(e);return t.kind==="baseline"?{kind:"top"}:t}function Wa(e,t,n){return Fa(e,n,t)?Kn(e).kind==="baseline":!1}function cu(e){const t={};let n=!1;for(const i of Ui){const o=ka(i),l=e[o];if(e.type==="b"){const s=String(l??"Top").trim();s!=="Top"&&s!=="Center"&&s!=="Bottom"&&(t[o]="Top",n=!0);continue}Fa(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function du(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function uu(e){const t=Kn(e).kind;return t==="baseline"?"center":t}function pu(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Ar(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function mu(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),l=o-i;return n.remove(),l}function so(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=mu(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+s;const d=l.getBoundingClientRect(),a=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-a)/2:e.kind==="bottom"&&(u=d.height-a),d.top-t+u+s}function gu(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const l=o.querySelector(`.${n}`);l&&(l.style.minHeight=`${i}px`,l.style.height=`${i}px`)}),i)}function hu(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const fu={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Fe(e,t){return`${e}${t.replace(/^text/,"Text")}`}const yu={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function vu(e){return[Fe(e,"textFontFamily"),Fe(e,"textFontSettings"),{type:"row",items:[Fe(e,"textFontSize"),Fe(e,"textLineHeight"),Fe(e,"textLetterSpacing"),Fe(e,"textWordSpacing")]},Fe(e,"textTextAlign"),Fe(e,"textTextAppearance"),`${e}VerticalAlign`]}function bu(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(qo.map(e=>[yu[e],vu(e)]))}}function Mi(e,t){const n=i=>{const o=Fe(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===zt?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Mr(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 _t(ut(n,t))}function kr(e,t,n,i){const o=Mi(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function Fr(e,t,n,i){const o=Mi(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:T.scalingValue((l-s)/2,i)}}const Lt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ln=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],En=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],In=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],xu={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Su=["hover","focus","filled","success","error"],Wr=.004,bn=.004,co=bn,Nr=12,Yo=50,Un=1440,qn=Yo/Un;function Na(e){const t=typeof e=="number"&&e>0?e:Un;return Yo/t}function Cu(e,t){const n={position:"absolute",width:Nr,height:Nr,pointerEvents:"auto"};return t==="left-y"?{...n,left:20,top:"50%",transform:"translateY(-50%)"}:t==="center-x"?{...n,left:"50%",top:`var(--${e}-first-entry-handle-top, 50%)`,transform:"translate(-50%, -50%)"}:{...n,left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}function Nt({P:e,className:t,areaStyle:n,hitPlacement:i,...o}){return r.jsx("div",{className:t,style:{...n,pointerEvents:"none"},...o,children:r.jsx("div",{style:Cu(e,i)})})}function $u(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 Un}const Ha={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Nn(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function wu(e,t=1){const n=t/e;return Object.fromEntries(Lt.map(i=>[i,n]))}function Tu(){return Object.fromEntries([...Ln.map(e=>[e,0]),...En.map(e=>[e,0])])}function Lu(){return Object.fromEntries(In.map(e=>[e,0]))}function gi(e){return Object.fromEntries(Lt.map(t=>[t,typeof e[t]=="number"?e[t]:Ha[t]]))}function Ba(e,t,n){const i=e-qn,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const l=i/o;return{paddingLeft:t*l,paddingRight:n*l}}function Ti(e,t,n){const i=Jo(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((l,s)=>l+s,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Eu(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=Ln[o],s=En[o],d=typeof n[l]=="number"?n[l]:0,a=typeof n[s]=="number"?n[s]:0,u=Ba(t[o]??0,d,a);u.paddingLeft!==d&&(i[l]=u.paddingLeft),u.paddingRight!==a&&(i[s]=u.paddingRight)}return i}function Jo(e,t,n){if(e<=0)return[];const i=Lt.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),s=o.reduce((u,p)=>u+p,0)+qn;if(t>=s)return i;const d=[...o];let a=s-t;for(let u=d.length-1;u>=0&&a>0;u-=1){const p=d[u]-qn;if(p<=0)continue;const I=Math.min(a,p);d[u]-=I,a-=I}return[...d,i[e-1]]}function Iu(e,t,n){if(e<=1)return{};const i=Jo(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=Lt[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function Hr(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Jt]}function Ru(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Pu(e,t,n,i){const o=Math.min(i,e.length,Lt.length),l={};for(let s=0;s<o;s+=1){const d=e[s],a=t.indexOf(d);if(a===-1)continue;const u=Lt[a],p=Ln[a],I=En[a],x=In[a],b=Lt[s],g=Ln[s],h=En[s],R=In[s],w=n[u],y=n[p],$=n[I],N=n[x];typeof w=="number"&&(l[b]=w),typeof y=="number"&&(l[g]=y),typeof $=="number"&&(l[h]=$),typeof N=="number"&&(l[R]=N)}return l}function Oa(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 _u(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Nn(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...wu(n,o),...Tu()};if(l)for(const d of In)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,Lu());return Oa(e,s)?s:e}function Au(e,t,n){const i=cu(e);i&&(e={...e,...i});const o=Na(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,d=Nn(e),a=Nn(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof l=="number"?l:typeof s=="number"?s:Jt.length,I=$=>{if(u)return $;const N=gi({...t,...$}),_=Nn($),M=Ti(p,_,N),S=Eu(p,M,{...t,...$});return Object.keys(S).length===0?$:{...$,...S}};if(typeof l=="number"&&l!==s)return e;const x=Hr(e),b=Hr(t);if(!Ru(x,b))return I({...e,...Pu(x,b,t,p)});if(d<a&&typeof p=="number"&&!u){const $=gi({...t,...e});return I({...e,...Iu(p,d,$)})}if(u){const $=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,N=Math.max(0,(d-o)/2);return $>N?{...e,textPaddingLR:N}:e}const g=gi({...t,...e}),h=Ti(p,a,gi(t)),w=Ti(p,d,g).some(($,N)=>$<(h[N]??$)),y=Lt.some($=>{const N=e[$],_=t[$];return typeof N=="number"&&typeof _=="number"&&N!==_});return w||y?I(e):e}function Mu(e,t,n,i){const o=t.slice(0,e).reduce((s,d)=>s+d,0),l=n.slice(e+1,t.length-1).reduce((s,d)=>s+d,0);return Math.max(qn,i-o-l-qn)}function ku(e,t){return Math.random()*(t-e)+e}function Fu(e){return Object.fromEntries(Lt.map(t=>[t,typeof e[t]=="number"?e[t]:Ha[t]]))}function uo(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Wu(e,t,n,i,o,l){return e.slice(0,t).map((s,d)=>{const a=Ln[d],u=En[d],p=In[d];return{key:s,textPrefix:fu[s],widthKey:Lt[d],width:n[Lt[d]],paddingLeftKey:a,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[a],paddingRight:o[u],paddingBottom:l[p]}})}function Nu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:d}){const{prefix:a}=T.useScopedStyles(),u=!!o,{columns:p,type:I,wrapperWidth:x,entriesCount:b,cellMinHeight:g,dividerWidth:h,showVisibility:R,cut:w,showCut:y,cutCellMinHeight:$,cutLabel:N,imageSize:_,imageOnHover:M,entryHoverEffect:S,entryHoverShowOption:P,rowPaddingTop:k,rowPaddingBottom:L,rowPaddingTopB:F,columnsOrder:B,textPaddingLR:z,textColor:K,backgroundColor:Z,dividerColor:m,textHoverColor:E,backgroundHoverColor:W,dividerHoverColor:A}=e,[C,V]=c.useState(void 0),[q,ee]=c.useState(null),J=M==="on"&&(!n||i),ye=(w??0)>0,v=I==="b",U=c.useRef(null),he=c.useRef(null),[ue,ge]=c.useState(null),[ie,fe]=c.useState(Un),G=Na(ie),f=Math.max(0,((x??0)-G)/2),H=Math.min(z??0,f),j=Math.max(H,bn),te=((x??0)+G)/2;c.useLayoutEffect(()=>{if(!n){fe(Un);return}const oe=()=>{fe($u(U.current))};oe();const xe=U.current;if(!xe)return;const Le=new ResizeObserver(oe);Le.observe(xe);let Ae=xe;for(;Ae&&!Ae.style.getPropertyValue("--cntrl-article-width");)Ae=Ae.parentElement;return Ae&&Le.observe(Ae),()=>Le.disconnect()},[n,s]),c.useEffect(()=>{V(void 0)},[w,y,t,b]),c.useEffect(()=>{n&&!i&&V(void 0)},[n,i]);const ce=T.buildColorVars(a,{textColor:K,backgroundColor:Z,dividerColor:m,textHoverColor:E,backgroundHoverColor:W,dividerHoverColor:A},xu,Su),ne=l&&l!=="default"?`${a}-state-${l}`:"",pe=`${!n||i?S==="default"?`${a}-entry-hover-default`:S==="blinds"?`${a}-entry-hover-blinds`:S==="reveal"?`${a}-entry-hover-reveal`:"":""} ${ne}`.trim(),Se=S==="reveal"&&(!n||i),be=(R==null?void 0:R[0])??!1,D=(R==null?void 0:R[1])??!1,de=c.useRef(e),O=c.useRef(s);c.useEffect(()=>{if(!d||!n){de.current=e,O.current=s;return}if(O.current!==s){de.current=e,O.current=s;return}const oe=de.current;if(!(oe!==e))return;if(typeof oe.columns=="number"&&typeof e.columns=="number"&&oe.columns!==e.columns){de.current=e;return}const Le=Au(e,oe,{designWidth:ie});de.current=e,Oa(e,Le)&&d(Le)},[e,d,n,s,ie]);const Y=c.useMemo(()=>Fu(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),we=c.useMemo(()=>uo(e,Ln),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),Pe=c.useMemo(()=>uo(e,En),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Qe=c.useMemo(()=>uo(e,In),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),He=c.useMemo(()=>Array.isArray(B)&&B.length>0?B:[...Jt],[B]),Be=c.useMemo(()=>Wu(He,p,Y,we,Pe,Qe),[He,p,Y,we,Pe,Qe]),je=Nn(e),ke=c.useMemo(()=>Lt.slice(0,p).map(oe=>Y[oe]),[p,Y]),Ge=c.useMemo(()=>Jo(p,je,Y),[p,je,Y]),Ye=c.useMemo(()=>Ti(p,je,Y),[p,je,Y]),Ee=c.useMemo(()=>Be.map((oe,xe)=>Ba(Ye[xe]??0,oe.paddingLeft,oe.paddingRight)),[Be,Ye]),Je=c.useMemo(()=>{const oe=b===0?1/0:b;return(t??[]).slice(0,oe).map((Le,Ae)=>({id:Ae,cells:Object.fromEntries(Jt.map(it=>[it,Le[it]??""])),image:Le.image,link:Le.link}))},[t,b]),ct=ye?C??w:Je.length,pt=c.useMemo(()=>ye?Je.slice(0,ct):Je,[Je,ye,ct]),rt=ye&&ct<Je.length,X=pt.length>1||rt,re=[be?`${a}-divider-top`:"",D||X?`${a}-divider-bottom`:""].filter(Boolean).join(" "),se=!n||i,Ce=()=>{if(!se)return;const oe=C??w;if(!y){V(Je.length);return}V(Math.min(oe+y,Je.length))},me=oe=>T.scalingValue(oe,n??!1),Oe=v?F??0:k??0,Ve=L??0,ae=g??0,$e=Oe+ae/2,_e=Math.max(Ve,co),Re=Pr(0,pt.length,be,D,rt,h??0,n??!1).borderTopWidth,ze=ue!=null?`${ue}px`:`calc(${Re} + ${me($e)})`,ht=v?"rowPaddingTopB":"rowPaddingTop",Te=Be[0],tt=Be[Be.length-1],Xe=Ee[0],Ze=Ee[Ee.length-1],dt=Te&&Xe?Math.max(Xe.paddingLeft,bn):0,tn=tt&&Ze?Math.max(Ze.paddingRight,bn):0,Xi=je,pn=oe=>{const xe=U.current;if(!xe)return{x:0,y:0};const Le=xe.getBoundingClientRect();return{x:oe.clientX-Le.left+_r,y:oe.clientY-Le.top+_r}},Yi=(oe,xe)=>{if(!J)return;const Le=oe.image;if(!(Le!=null&&Le.url)){ee(null);return}const{x:Ae,y:it}=pn(xe),at=(_==null?void 0:_.min)??80,Me=(_==null?void 0:_.max)??320,St=(q==null?void 0:q.rowId)===oe.id?q.widthPx:ku(at,Me);ee({rowId:oe.id,url:Le.url,objectFit:"contain",isVideo:eu(Le),widthPx:St,x:Ae,y:it})},ai=oe=>{if(!J||!q)return;const{x:xe,y:Le}=pn(oe);ee(Ae=>!Ae||Ae.x===xe&&Ae.y===Le?Ae:{...Ae,x:xe,y:Le})},li=()=>{ee(null)},Ji=oe=>{Se&&Ir(oe,a),J&&ee(null)},We=oe=>{Se&&Rr(oe,a)};c.useLayoutEffect(()=>{if(!u||v){ge(null);return}const oe=he.current,xe=oe==null?void 0:oe.parentElement;if(!oe||!xe){ge(null);return}const Le=()=>{const it=oe.querySelector("[data-list-row]");if(!it){ge(null);return}const at=xe.getBoundingClientRect(),Me=it.getBoundingClientRect();ge(Me.top-at.top+Me.height/2)};Le();const Ae=new ResizeObserver(Le);return Ae.observe(oe),Ae.observe(xe),()=>Ae.disconnect()},[u,v,pt,Oe,Ve,ae,t,e,Be,Ye,ie,h,be,D,rt]);const bt=c.useMemo(()=>!v&&Uo.some(oe=>{const xe=oe.charAt(0),Le=e[`${oe}VerticalAlign`];return Wa(Le,e,xe)}),[v,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);c.useLayoutEffect(()=>{var St;const oe=U.current;if(!oe)return;const xe=()=>{oe.querySelectorAll("[data-list-col]").forEach(Ct=>{Ct.style.transform="";const lt=Ct.querySelector(`.${a}-list-col`);lt&&(lt.style.minHeight="",lt.style.height="");const $t=Ct.querySelector(`.${a}-list-col-title`);$t&&($t.style.transform="")})};if(v||!bt){xe();return}const Le=()=>{const Ct=Array.from(oe.querySelectorAll("[data-list-row]")),lt=`${a}-list-col`,$t=`${a}-baseline-probe`;Ct.forEach(De=>{De.querySelectorAll("[data-list-col]").forEach(ft=>{ft.style.transform="";const yt=ft.querySelector(`.${lt}`);yt&&(yt.style.minHeight="",yt.style.height="");const mt=ft.querySelector(`.${a}-list-col-title`);mt&&(mt.style.transform="")})}),Ct.forEach(De=>{const ft=Array.from(De.querySelectorAll("[data-list-col]"));gu(De,ft,lt)}),oe.offsetHeight,Ct.forEach(De=>{const ft=Array.from(De.querySelectorAll("[data-list-col]")),yt=De.getBoundingClientRect().top,mt=new Map,mn=ft.map(nt=>{const gn=nt.querySelector(`.${a}-list-col-title`),hn={el:nt,titleEl:gn,letter:nt.getAttribute("data-col-letter")??"",kind:nt.getAttribute("data-valign")??"top",anchor:nt.getAttribute("data-valign-anchor")};return mt.set(hn.letter,hn),hn}),st=new Map,si=(nt,gn)=>{const hn=st.get(nt.letter);if(hn!==void 0)return hn;const Zo=nt.anchor?mt.get(nt.anchor):void 0;if(nt.kind!=="baseline"||!Zo||gn.has(nt.letter)){const er=so(nt,yt,lt,$t);return st.set(nt.letter,er),er}gn.add(nt.letter);const Ga=si(Zo,gn);gn.delete(nt.letter);const Ka=so(nt,yt,lt,$t),Ua=Ga-Ka;hu(nt.titleEl,Ua);const Qo=so(nt,yt,lt,$t);return st.set(nt.letter,Qo),Qo};mn.forEach(nt=>si(nt,new Set))})};let Ae=null;const it=()=>{Ae===null&&(Ae=requestAnimationFrame(()=>{Ae=null,Le()}))};Le();const at=new ResizeObserver(()=>it());at.observe(oe);let Me=!1;return typeof document<"u"&&((St=document.fonts)!=null&&St.ready)&&document.fonts.ready.then(()=>{Me||it()}),()=>{Me=!0,Ae!==null&&(cancelAnimationFrame(Ae),Ae=null),at.disconnect(),xe()}},[bt,v,e,t,ie,pt,Ye]);const xt=c.useMemo(()=>ou(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:xt}}),r.jsx("div",{style:ce,children:r.jsxs("div",{ref:U,className:`${a}-wrapper ${pe}${re?` ${re}`:""}${v?` ${a}-type-b`:""}`.trim(),style:{width:T.scalingValue(x??0,n),...!v&&u?{[`--${a}-first-entry-handle-top`]:ze}:{}},onMouseMove:J?ai:void 0,onMouseLeave:J?li:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[pt.map((oe,xe)=>{var at;const Le=(((at=oe.link)==null?void 0:at.length)??0)>0,Ae=Le&&(!n||i)?"a":"div",it=Pr(xe,pt.length,be,D,rt,h??0,n??!1);return r.jsxs(Ae,{ref:xe===0?Me=>{he.current=Me}:void 0,className:`${a}-list-item${Le||P==="always"?` ${a}-list-item-has-link`:""}`,...Le?{href:oe.link,target:"_blank"}:{},style:it,onMouseEnter:Me=>{Se&&(Le||P==="always")&&Ir(Me,a),J&&Yi(oe,Me)},onMouseLeave:Me=>{Se&&(Le||P==="always")&&Rr(Me,a)},children:[Oe>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:me(Oe)}}),r.jsxs("div",{className:`${a}-list-cols-row${v?"":` ${a}-list-cols-row-h`}${u&&xe===0&&v?` ${a}-list-cols-row-controls`:""}`,...v?{}:{"data-list-row":""},style:v?void 0:{minHeight:me(ae)},children:[Be.map((Me,St)=>{const Ct=St===Be.length-1,lt=Ee[St],$t=Me.paddingBottom,De=nu(oe.cells[Me.key]),ft=v&&De&&$t>0,yt=v?{minHeight:me(ae)}:{width:me(Ye[St])},mt=v?{paddingLeft:me(H),paddingRight:me(H)}:{paddingLeft:me(lt.paddingLeft),paddingRight:me(lt.paddingRight)},mn=Me.textPrefix.charAt(0),st=v?su(e[`${Me.textPrefix}VerticalAlign`]):lu(e[`${Me.textPrefix}VerticalAlign`],e,mn),si=v&&De&&u&&xe===0;return r.jsxs("div",{className:v?`${a}-list-col-wrap`:void 0,...v?{}:{"data-list-col":"","data-col-letter":mn,"data-valign":st.kind,...st.kind==="baseline"?{"data-valign-anchor":st.anchorLetter}:{}},children:[r.jsx("div",{className:`${a}-list-col${Ct?` ${a}-list-col-last`:""}`,style:{...mt,...yt,...v?{justifyContent:Ar(st.kind)}:{}},"data-test":Me.width,children:r.jsx("span",{className:kr(e,Me.textPrefix,`${a}-list-col-title`,`${a}-text-tight-leading`),style:{...Mr(Mi(e,Me.textPrefix),n),...Fr(e,Me.textPrefix,a,n),...v?{}:du(st.kind)},children:oe.cells[Me.key]??null})}),ft&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:me($t)}}),si&&r.jsx(Nt,{P:a,"data-controls":Me.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:me(Math.max($t,co))}})]},Me.key)}),u&&xe===0&&v&&r.jsxs(r.Fragment,{children:[r.jsx(Nt,{P:a,"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(te),className:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:me(j),height:"100%"}}),r.jsx(Nt,{P:a,"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(te),className:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:me(Math.max(j,je-j)),width:me(j),height:"100%"}})]})]}),!v&&Ve>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:me(Ve)}}),u&&xe===0&&!v&&r.jsx(Nt,{P:a,"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:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:me(_e)}})]},oe.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(Nt,{P:a,"data-controls":ht,"data-controls-static-handle":"",...v?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:v?"center":"left-y",areaStyle:{position:"absolute",top:Re,left:0,width:"100%",height:me(Math.max(Oe,co))}})},"row-padding-handles"),u&&!v&&Te&&tt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Nt,{P:a,"data-controls":Te.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ye[0]-((Xe==null?void 0:Xe.paddingRight)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:me(dt),height:"100%"}}),r.jsx(Nt,{P:a,"data-controls":tt.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(Ye[Be.length-1]-((Ze==null?void 0:Ze.paddingLeft)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:me(Xi-tn),width:me(tn),height:"100%"}})]},"column-edge-padding-handles"),u&&!v&&Be.slice(0,-1).map((oe,xe)=>{const Le=Be[xe+1],Ae=Ge.slice(0,xe+1).reduce((Ct,lt)=>Ct+lt,0),it=Ee[xe],at=Ee[xe+1],Me=Math.max(it.paddingRight,bn),St=Math.max(at.paddingLeft,bn);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Nt,{P:a,"data-controls":oe.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(Ye[xe]-it.paddingLeft),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:me(Ae-Me),width:me(Me),height:"100%"}}),r.jsx(Nt,{P:a,"data-controls":Le.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ye[xe+1]-at.paddingRight),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:me(Ae),width:me(St),height:"100%"}})]},`${oe.paddingRightKey}-padding`)}),u&&!v&&Be.slice(0,-1).map((oe,xe)=>{const Le=Mu(xe,Ge,ke,je),it=Ge.slice(0,xe+1).reduce((at,Me)=>at+Me,0)-Wr/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":oe.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(Yo),"data-controls-max-fraction":String(Le),"data-controls-variant":"column-width",className:`${a}-col-resize-handle`,style:{position:"absolute",top:"0px",left:me(it),width:me(Wr),height:"calc(100%)",pointerEvents:"auto"}})},`${oe.widthKey}-junction`)})]}),rt&&(()=>{const oe=Mi(e,zt),xe=uu(e.cutLabelVerticalAlign),Le=oe.textTextAlign==="justify"||v;return r.jsx("button",{type:"button",className:`${a}-cut-item`,style:{minHeight:me($??0),cursor:se?"pointer":"default",...iu(D,h??0,n??!1)},onClick:se?Ce:void 0,onMouseEnter:Se||J?Ji:void 0,onMouseLeave:Se?We:void 0,children:r.jsx("div",{className:`${a}-list-cols-row`,style:{...v?{paddingLeft:me(H),paddingRight:me(H)}:{},justifyContent:pu(oe.textTextAlign),alignItems:Ar(xe)},children:r.jsx("span",{className:kr(e,zt,`${a}-cut-label`,`${a}-text-tight-leading`),style:{...Mr(oe,n),...Fr(e,zt,a,n),...Le?{width:"100%"}:{}},children:N})})})})(),J&&q&&(()=>{const oe=wi(q.widthPx),xe={width:oe,height:"auto",maxHeight:oe,objectFit:"contain",left:q.x,top:q.y,position:"absolute"};return r.jsx(tu,{media:q,className:q.isVideo?`${a}-hover-video`:`${a}-hover-image`,style:xe},`${q.rowId}-${q.url}`)})()]})})]})}const Hu=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ComponentPropsWithoutRef } from 'react';
|
|
5448
|
+
`}const Jt=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Uo=["AColumn","BColumn","CColumn","DColumn","EColumn"],zt="cutLabel",qo=[...Uo,zt],Ui=["A","B","C","D","E"];function ka(e){return`${e}ColumnVerticalAlign`}const $o=["Top","Center","Bottom"];function Xo(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Ui.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function ru(e){const t=Xo(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function au(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Ui.includes(n)?n:null}function Fa(e,t,n){const i=au(e);return i?i===t?!1:ru(n[ka(i)]):!0}function Kn(e){const t=Xo(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Ui.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function lu(e,t,n){if(Wa(e,t,n))return Kn(e);const i=Kn(e);return i.kind==="baseline"?{kind:"top"}:i}function su(e){const t=Kn(e);return t.kind==="baseline"?{kind:"top"}:t}function Wa(e,t,n){return Fa(e,n,t)?Kn(e).kind==="baseline":!1}function cu(e){const t={};let n=!1;for(const i of Ui){const o=ka(i),l=e[o];if(e.type==="b"){const s=String(l??"Top").trim();s!=="Top"&&s!=="Center"&&s!=="Bottom"&&(t[o]="Top",n=!0);continue}Fa(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function du(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function uu(e){const t=Kn(e).kind;return t==="baseline"?"center":t}function pu(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Ar(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function mu(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),l=o-i;return n.remove(),l}function so(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=mu(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+s;const d=l.getBoundingClientRect(),a=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-a)/2:e.kind==="bottom"&&(u=d.height-a),d.top-t+u+s}function gu(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const l=o.querySelector(`.${n}`);l&&(l.style.minHeight=`${i}px`,l.style.height=`${i}px`)}),i)}function hu(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const fu={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Fe(e,t){return`${e}${t.replace(/^text/,"Text")}`}const yu={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function vu(e){return[Fe(e,"textFontFamily"),Fe(e,"textFontSettings"),{type:"row",items:[Fe(e,"textFontSize"),Fe(e,"textLineHeight"),Fe(e,"textLetterSpacing"),Fe(e,"textWordSpacing")]},Fe(e,"textTextAlign"),Fe(e,"textTextAppearance"),`${e}VerticalAlign`]}function bu(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(qo.map(e=>[yu[e],vu(e)]))}}function Mi(e,t){const n=i=>{const o=Fe(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===zt?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Mr(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 _t(ut(n,t))}function kr(e,t,n,i){const o=Mi(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function Fr(e,t,n,i){const o=Mi(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:L.scalingValue((l-s)/2,i)}}const Lt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Ln=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],En=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],In=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],xu={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Su=["hover","focus","filled","success","error"],Wr=.004,bn=.004,co=bn,Nr=12,Yo=50,Un=1440,qn=Yo/Un;function Na(e){const t=typeof e=="number"&&e>0?e:Un;return Yo/t}function Cu(e,t){const n={position:"absolute",width:Nr,height:Nr,pointerEvents:"auto"};return t==="left-y"?{...n,left:20,top:"50%",transform:"translateY(-50%)"}:t==="center-x"?{...n,left:"50%",top:`var(--${e}-first-entry-handle-top, 50%)`,transform:"translate(-50%, -50%)"}:{...n,left:"50%",top:"50%",transform:"translate(-50%, -50%)"}}function Nt({P:e,className:t,areaStyle:n,hitPlacement:i,...o}){return r.jsx("div",{className:t,style:{...n,pointerEvents:"none"},...o,children:r.jsx("div",{style:Cu(e,i)})})}function $u(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 Un}const Ha={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Nn(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function wu(e,t=1){const n=t/e;return Object.fromEntries(Lt.map(i=>[i,n]))}function Tu(){return Object.fromEntries([...Ln.map(e=>[e,0]),...En.map(e=>[e,0])])}function Lu(){return Object.fromEntries(In.map(e=>[e,0]))}function gi(e){return Object.fromEntries(Lt.map(t=>[t,typeof e[t]=="number"?e[t]:Ha[t]]))}function Ba(e,t,n){const i=e-qn,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const l=i/o;return{paddingLeft:t*l,paddingRight:n*l}}function Ti(e,t,n){const i=Jo(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((l,s)=>l+s,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Eu(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=Ln[o],s=En[o],d=typeof n[l]=="number"?n[l]:0,a=typeof n[s]=="number"?n[s]:0,u=Ba(t[o]??0,d,a);u.paddingLeft!==d&&(i[l]=u.paddingLeft),u.paddingRight!==a&&(i[s]=u.paddingRight)}return i}function Jo(e,t,n){if(e<=0)return[];const i=Lt.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),s=o.reduce((u,p)=>u+p,0)+qn;if(t>=s)return i;const d=[...o];let a=s-t;for(let u=d.length-1;u>=0&&a>0;u-=1){const p=d[u]-qn;if(p<=0)continue;const I=Math.min(a,p);d[u]-=I,a-=I}return[...d,i[e-1]]}function Iu(e,t,n){if(e<=1)return{};const i=Jo(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=Lt[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function Hr(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Jt]}function Ru(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Pu(e,t,n,i){const o=Math.min(i,e.length,Lt.length),l={};for(let s=0;s<o;s+=1){const d=e[s],a=t.indexOf(d);if(a===-1)continue;const u=Lt[a],p=Ln[a],I=En[a],S=In[a],v=Lt[s],g=Ln[s],h=En[s],R=In[s],T=n[u],y=n[p],w=n[I],N=n[S];typeof T=="number"&&(l[v]=T),typeof y=="number"&&(l[g]=y),typeof w=="number"&&(l[h]=w),typeof N=="number"&&(l[R]=N)}return l}function Oa(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 _u(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Nn(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...wu(n,o),...Tu()};if(l)for(const d of In)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,Lu());return Oa(e,s)?s:e}function Au(e,t,n){const i=cu(e);i&&(e={...e,...i});const o=Na(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,d=Nn(e),a=Nn(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof l=="number"?l:typeof s=="number"?s:Jt.length,I=w=>{if(u)return w;const N=gi({...t,...w}),_=Nn(w),W=Ti(p,_,N),C=Eu(p,W,{...t,...w});return Object.keys(C).length===0?w:{...w,...C}};if(typeof l=="number"&&l!==s)return e;const S=Hr(e),v=Hr(t);if(!Ru(S,v))return I({...e,...Pu(S,v,t,p)});if(d<a&&typeof p=="number"&&!u){const w=gi({...t,...e});return I({...e,...Iu(p,d,w)})}if(u){const w=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,N=Math.max(0,(d-o)/2);return w>N?{...e,textPaddingLR:N}:e}const g=gi({...t,...e}),h=Ti(p,a,gi(t)),T=Ti(p,d,g).some((w,N)=>w<(h[N]??w)),y=Lt.some(w=>{const N=e[w],_=t[w];return typeof N=="number"&&typeof _=="number"&&N!==_});return T||y?I(e):e}function Mu(e,t,n,i){const o=t.slice(0,e).reduce((s,d)=>s+d,0),l=n.slice(e+1,t.length-1).reduce((s,d)=>s+d,0);return Math.max(qn,i-o-l-qn)}function ku(e,t){return Math.random()*(t-e)+e}function Fu(e){return Object.fromEntries(Lt.map(t=>[t,typeof e[t]=="number"?e[t]:Ha[t]]))}function uo(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Wu(e,t,n,i,o,l){return e.slice(0,t).map((s,d)=>{const a=Ln[d],u=En[d],p=In[d];return{key:s,textPrefix:fu[s],widthKey:Lt[d],width:n[Lt[d]],paddingLeftKey:a,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[a],paddingRight:o[u],paddingBottom:l[p]}})}function Nu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:d}){const{prefix:a}=L.useScopedStyles(),u=!!o,{columns:p,type:I,wrapperWidth:S,entriesCount:v,cellMinHeight:g,dividerWidth:h,showVisibility:R,cut:T,showCut:y,cutCellMinHeight:w,cutLabel:N,imageSize:_,imageOnHover:W,entryHoverEffect:C,entryHoverShowOption:P,rowPaddingTop:A,rowPaddingBottom:E,rowPaddingTopB:k,columnsOrder:B,textPaddingLR:V,textColor:K,backgroundColor:ee,dividerColor:m,textHoverColor:b,backgroundHoverColor:F,dividerHoverColor:M}=e,[$,O]=c.useState(void 0),[U,te]=c.useState(null),Y=W==="on"&&(!n||i),fe=(T??0)>0,x=I==="b",q=c.useRef(null),he=c.useRef(null),[pe,be]=c.useState(null),[J,me]=c.useState(Un),G=Na(J),f=Math.max(0,((S??0)-G)/2),H=Math.min(V??0,f),j=Math.max(H,bn),ne=((S??0)+G)/2;c.useLayoutEffect(()=>{if(!n){me(Un);return}const re=()=>{me($u(q.current))};re();const xe=q.current;if(!xe)return;const Te=new ResizeObserver(re);Te.observe(xe);let Ae=xe;for(;Ae&&!Ae.style.getPropertyValue("--cntrl-article-width");)Ae=Ae.parentElement;return Ae&&Te.observe(Ae),()=>Te.disconnect()},[n,s]),c.useEffect(()=>{O(void 0)},[T,y,t,v]),c.useEffect(()=>{n&&!i&&O(void 0)},[n,i]);const de=L.buildColorVars(a,{textColor:K,backgroundColor:ee,dividerColor:m,textHoverColor:b,backgroundHoverColor:F,dividerHoverColor:M},xu,Su),oe=l&&l!=="default"?`${a}-state-${l}`:"",ge=`${!n||i?C==="default"?`${a}-entry-hover-default`:C==="blinds"?`${a}-entry-hover-blinds`:C==="reveal"?`${a}-entry-hover-reveal`:"":""} ${oe}`.trim(),ve=C==="reveal"&&(!n||i),Se=(R==null?void 0:R[0])??!1,D=(R==null?void 0:R[1])??!1,ue=c.useRef(e),z=c.useRef(s);c.useEffect(()=>{if(!d||!n){ue.current=e,z.current=s;return}if(z.current!==s){ue.current=e,z.current=s;return}const re=ue.current;if(!(re!==e))return;if(typeof re.columns=="number"&&typeof e.columns=="number"&&re.columns!==e.columns){ue.current=e;return}const Te=Au(e,re,{designWidth:J});ue.current=e,Oa(e,Te)&&d(Te)},[e,d,n,s,J]);const X=c.useMemo(()=>Fu(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Ce=c.useMemo(()=>uo(e,Ln),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),_e=c.useMemo(()=>uo(e,En),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ze=c.useMemo(()=>uo(e,In),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),We=c.useMemo(()=>Array.isArray(B)&&B.length>0?B:[...Jt],[B]),ze=c.useMemo(()=>Wu(We,p,X,Ce,_e,Ze),[We,p,X,Ce,_e,Ze]),Ne=Nn(e),Me=c.useMemo(()=>Lt.slice(0,p).map(re=>X[re]),[p,X]),qe=c.useMemo(()=>Jo(p,Ne,X),[p,Ne,X]),Xe=c.useMemo(()=>Ti(p,Ne,X),[p,Ne,X]),Pe=c.useMemo(()=>ze.map((re,xe)=>Ba(Xe[xe]??0,re.paddingLeft,re.paddingRight)),[ze,Xe]),Ve=c.useMemo(()=>{const re=v===0?1/0:v;return(t??[]).slice(0,re).map((Te,Ae)=>({id:Ae,cells:Object.fromEntries(Jt.map(nt=>[nt,Te[nt]??""])),image:Te.image,link:Te.link}))},[t,v]),ct=fe?$??T:Ve.length,pt=c.useMemo(()=>fe?Ve.slice(0,ct):Ve,[Ve,fe,ct]),rt=fe&&ct<Ve.length,ot=pt.length>1||rt,Z=[Se?`${a}-divider-top`:"",D||ot?`${a}-divider-bottom`:""].filter(Boolean).join(" "),Q=!n||i,ce=()=>{if(!Q)return;const re=$??T;if(!y){O(Ve.length);return}O(Math.min(re+y,Ve.length))},se=re=>L.scalingValue(re,n??!1),Le=x?k??0:A??0,Oe=E??0,ae=g??0,$e=Le+ae/2,Ie=Math.max(Oe,co),Re=Pr(0,pt.length,Se,D,rt,h??0,n??!1).borderTopWidth,je=pe!=null?`${pe}px`:`calc(${Re} + ${se($e)})`,ht=x?"rowPaddingTopB":"rowPaddingTop",we=ze[0],et=ze[ze.length-1],Ye=Pe[0],Je=Pe[Pe.length-1],dt=we&&Ye?Math.max(Ye.paddingLeft,bn):0,tn=et&&Je?Math.max(Je.paddingRight,bn):0,Xi=Ne,pn=re=>{const xe=q.current;if(!xe)return{x:0,y:0};const Te=xe.getBoundingClientRect();return{x:re.clientX-Te.left+_r,y:re.clientY-Te.top+_r}},Yi=(re,xe)=>{if(!Y)return;const Te=re.image;if(!(Te!=null&&Te.url)){te(null);return}const{x:Ae,y:nt}=pn(xe),at=(_==null?void 0:_.min)??80,ke=(_==null?void 0:_.max)??320,St=(U==null?void 0:U.rowId)===re.id?U.widthPx:ku(at,ke);te({rowId:re.id,url:Te.url,objectFit:"contain",isVideo:eu(Te),widthPx:St,x:Ae,y:nt})},ai=re=>{if(!Y||!U)return;const{x:xe,y:Te}=pn(re);te(Ae=>!Ae||Ae.x===xe&&Ae.y===Te?Ae:{...Ae,x:xe,y:Te})},li=()=>{te(null)},Ji=re=>{ve&&Ir(re,a),Y&&te(null)},He=re=>{ve&&Rr(re,a)};c.useLayoutEffect(()=>{if(!u||x){be(null);return}const re=he.current,xe=re==null?void 0:re.parentElement;if(!re||!xe){be(null);return}const Te=()=>{const nt=re.querySelector("[data-list-row]");if(!nt){be(null);return}const at=xe.getBoundingClientRect(),ke=nt.getBoundingClientRect();be(ke.top-at.top+ke.height/2)};Te();const Ae=new ResizeObserver(Te);return Ae.observe(re),Ae.observe(xe),()=>Ae.disconnect()},[u,x,pt,Le,Oe,ae,t,e,ze,Xe,J,h,Se,D,rt]);const bt=c.useMemo(()=>!x&&Uo.some(re=>{const xe=re.charAt(0),Te=e[`${re}VerticalAlign`];return Wa(Te,e,xe)}),[x,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);c.useLayoutEffect(()=>{var St;const re=q.current;if(!re)return;const xe=()=>{re.querySelectorAll("[data-list-col]").forEach(Ct=>{Ct.style.transform="";const lt=Ct.querySelector(`.${a}-list-col`);lt&&(lt.style.minHeight="",lt.style.height="");const $t=Ct.querySelector(`.${a}-list-col-title`);$t&&($t.style.transform="")})};if(x||!bt){xe();return}const Te=()=>{const Ct=Array.from(re.querySelectorAll("[data-list-row]")),lt=`${a}-list-col`,$t=`${a}-baseline-probe`;Ct.forEach(De=>{De.querySelectorAll("[data-list-col]").forEach(ft=>{ft.style.transform="";const yt=ft.querySelector(`.${lt}`);yt&&(yt.style.minHeight="",yt.style.height="");const mt=ft.querySelector(`.${a}-list-col-title`);mt&&(mt.style.transform="")})}),Ct.forEach(De=>{const ft=Array.from(De.querySelectorAll("[data-list-col]"));gu(De,ft,lt)}),re.offsetHeight,Ct.forEach(De=>{const ft=Array.from(De.querySelectorAll("[data-list-col]")),yt=De.getBoundingClientRect().top,mt=new Map,mn=ft.map(tt=>{const gn=tt.querySelector(`.${a}-list-col-title`),hn={el:tt,titleEl:gn,letter:tt.getAttribute("data-col-letter")??"",kind:tt.getAttribute("data-valign")??"top",anchor:tt.getAttribute("data-valign-anchor")};return mt.set(hn.letter,hn),hn}),st=new Map,si=(tt,gn)=>{const hn=st.get(tt.letter);if(hn!==void 0)return hn;const Zo=tt.anchor?mt.get(tt.anchor):void 0;if(tt.kind!=="baseline"||!Zo||gn.has(tt.letter)){const er=so(tt,yt,lt,$t);return st.set(tt.letter,er),er}gn.add(tt.letter);const Ga=si(Zo,gn);gn.delete(tt.letter);const Ka=so(tt,yt,lt,$t),Ua=Ga-Ka;hu(tt.titleEl,Ua);const Qo=so(tt,yt,lt,$t);return st.set(tt.letter,Qo),Qo};mn.forEach(tt=>si(tt,new Set))})};let Ae=null;const nt=()=>{Ae===null&&(Ae=requestAnimationFrame(()=>{Ae=null,Te()}))};Te();const at=new ResizeObserver(()=>nt());at.observe(re);let ke=!1;return typeof document<"u"&&((St=document.fonts)!=null&&St.ready)&&document.fonts.ready.then(()=>{ke||nt()}),()=>{ke=!0,Ae!==null&&(cancelAnimationFrame(Ae),Ae=null),at.disconnect(),xe()}},[bt,x,e,t,J,pt,Xe]);const xt=c.useMemo(()=>ou(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:xt}}),r.jsx("div",{style:de,children:r.jsxs("div",{ref:q,className:`${a}-wrapper ${ge}${Z?` ${Z}`:""}${x?` ${a}-type-b`:""}`.trim(),style:{width:L.scalingValue(S??0,n),...!x&&u?{[`--${a}-first-entry-handle-top`]:je}:{}},onMouseMove:Y?ai:void 0,onMouseLeave:Y?li:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[pt.map((re,xe)=>{var at;const Te=(((at=re.link)==null?void 0:at.length)??0)>0,Ae=Te&&(!n||i)?"a":"div",nt=Pr(xe,pt.length,Se,D,rt,h??0,n??!1);return r.jsxs(Ae,{ref:xe===0?ke=>{he.current=ke}:void 0,className:`${a}-list-item${Te||P==="always"?` ${a}-list-item-has-link`:""}`,...Te?{href:re.link,target:"_blank"}:{},style:nt,onMouseEnter:ke=>{ve&&(Te||P==="always")&&Ir(ke,a),Y&&Yi(re,ke)},onMouseLeave:ke=>{ve&&(Te||P==="always")&&Rr(ke,a)},children:[Le>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:se(Le)}}),r.jsxs("div",{className:`${a}-list-cols-row${x?"":` ${a}-list-cols-row-h`}${u&&xe===0&&x?` ${a}-list-cols-row-controls`:""}`,...x?{}:{"data-list-row":""},style:x?void 0:{minHeight:se(ae)},children:[ze.map((ke,St)=>{const Ct=St===ze.length-1,lt=Pe[St],$t=ke.paddingBottom,De=nu(re.cells[ke.key]),ft=x&&De&&$t>0,yt=x?{minHeight:se(ae)}:{width:se(Xe[St])},mt=x?{paddingLeft:se(H),paddingRight:se(H)}:{paddingLeft:se(lt.paddingLeft),paddingRight:se(lt.paddingRight)},mn=ke.textPrefix.charAt(0),st=x?su(e[`${ke.textPrefix}VerticalAlign`]):lu(e[`${ke.textPrefix}VerticalAlign`],e,mn),si=x&&De&&u&&xe===0;return r.jsxs("div",{className:x?`${a}-list-col-wrap`:void 0,...x?{}:{"data-list-col":"","data-col-letter":mn,"data-valign":st.kind,...st.kind==="baseline"?{"data-valign-anchor":st.anchorLetter}:{}},children:[r.jsx("div",{className:`${a}-list-col${Ct?` ${a}-list-col-last`:""}`,style:{...mt,...yt,...x?{justifyContent:Ar(st.kind)}:{}},"data-test":ke.width,children:r.jsx("span",{className:kr(e,ke.textPrefix,`${a}-list-col-title`,`${a}-text-tight-leading`),style:{...Mr(Mi(e,ke.textPrefix),n),...Fr(e,ke.textPrefix,a,n),...x?{}:du(st.kind)},children:re.cells[ke.key]??null})}),ft&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:se($t)}}),si&&r.jsx(Nt,{P:a,"data-controls":ke.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:se(Math.max($t,co))}})]},ke.key)}),u&&xe===0&&x&&r.jsxs(r.Fragment,{children:[r.jsx(Nt,{P:a,"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:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:se(j),height:"100%"}}),r.jsx(Nt,{P:a,"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:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:se(Math.max(j,Ne-j)),width:se(j),height:"100%"}})]})]}),!x&&Oe>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:se(Oe)}}),u&&xe===0&&!x&&r.jsx(Nt,{P:a,"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:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:se(Ie)}})]},re.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(Nt,{P:a,"data-controls":ht,"data-controls-static-handle":"",...x?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:x?"center":"left-y",areaStyle:{position:"absolute",top:Re,left:0,width:"100%",height:se(Math.max(Le,co))}})},"row-padding-handles"),u&&!x&&we&&et&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Nt,{P:a,"data-controls":we.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Xe[0]-((Ye==null?void 0:Ye.paddingRight)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:se(dt),height:"100%"}}),r.jsx(Nt,{P:a,"data-controls":et.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(Xe[ze.length-1]-((Je==null?void 0:Je.paddingLeft)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:se(Xi-tn),width:se(tn),height:"100%"}})]},"column-edge-padding-handles"),u&&!x&&ze.slice(0,-1).map((re,xe)=>{const Te=ze[xe+1],Ae=qe.slice(0,xe+1).reduce((Ct,lt)=>Ct+lt,0),nt=Pe[xe],at=Pe[xe+1],ke=Math.max(nt.paddingRight,bn),St=Math.max(at.paddingLeft,bn);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Nt,{P:a,"data-controls":re.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(Xe[xe]-nt.paddingLeft),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:se(Ae-ke),width:se(ke),height:"100%"}}),r.jsx(Nt,{P:a,"data-controls":Te.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Xe[xe+1]-at.paddingRight),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:se(Ae),width:se(St),height:"100%"}})]},`${re.paddingRightKey}-padding`)}),u&&!x&&ze.slice(0,-1).map((re,xe)=>{const Te=Mu(xe,qe,Me,Ne),nt=qe.slice(0,xe+1).reduce((at,ke)=>at+ke,0)-Wr/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":re.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(Yo),"data-controls-max-fraction":String(Te),"data-controls-variant":"column-width",className:`${a}-col-resize-handle`,style:{position:"absolute",top:"0px",left:se(nt),width:se(Wr),height:"calc(100%)",pointerEvents:"auto"}})},`${re.widthKey}-junction`)})]}),rt&&(()=>{const re=Mi(e,zt),xe=uu(e.cutLabelVerticalAlign),Te=re.textTextAlign==="justify"||x;return r.jsx("button",{type:"button",className:`${a}-cut-item`,style:{minHeight:se(w??0),cursor:Q?"pointer":"default",...iu(D,h??0,n??!1)},onClick:Q?ce:void 0,onMouseEnter:ve||Y?Ji:void 0,onMouseLeave:ve?He:void 0,children:r.jsx("div",{className:`${a}-list-cols-row`,style:{...x?{paddingLeft:se(H),paddingRight:se(H)}:{},justifyContent:pu(re.textTextAlign),alignItems:Ar(xe)},children:r.jsx("span",{className:kr(e,zt,`${a}-cut-label`,`${a}-text-tight-leading`),style:{...Mr(re,n),...Fr(e,zt,a,n),...Te?{width:"100%"}:{}},children:N})})})})(),Y&&U&&(()=>{const re=wi(U.widthPx),xe={width:re,height:"auto",maxHeight:re,objectFit:"contain",left:U.x,top:U.y,position:"absolute"};return r.jsx(tu,{media:U,className:U.isVideo?`${a}-hover-video`:`${a}-hover-image`,style:xe},`${U.rowId}-${U.url}`)})()]})})]})}const Hu=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ComponentPropsWithoutRef } from 'react';
|
|
5449
5449
|
import { CommonComponentProps } from '../props';
|
|
5450
5450
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
5451
5451
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -8636,11 +8636,11 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8636
8636
|
opacity: 1;
|
|
8637
8637
|
}
|
|
8638
8638
|
|
|
8639
|
-
.${e}-thumbnails[data-thumbnail-active="
|
|
8640
|
-
|
|
8639
|
+
.${e}-thumbnails[data-thumbnail-active="outline"] .${e}-thumb[data-active="true"] {
|
|
8640
|
+
border-color: var(--thumbnail-active-color, #ffffff);
|
|
8641
8641
|
}
|
|
8642
8642
|
|
|
8643
|
-
.${e}-thumbnails[data-thumbnail-active="
|
|
8643
|
+
.${e}-thumbnails[data-thumbnail-active="color"] .${e}-thumb:not([data-active="true"]) .${e}-thumb-image {
|
|
8644
8644
|
filter: grayscale(1);
|
|
8645
8645
|
}
|
|
8646
8646
|
|
|
@@ -8648,9 +8648,6 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8648
8648
|
transform: scale(1.15);
|
|
8649
8649
|
}
|
|
8650
8650
|
|
|
8651
|
-
.${e}-thumbnails[data-thumbnail-active="opacity"] .${e}-thumb:not([data-active="true"]) {
|
|
8652
|
-
opacity: 0.5;
|
|
8653
|
-
}
|
|
8654
8651
|
|
|
8655
8652
|
.${e}-thumb-image {
|
|
8656
8653
|
display: block;
|
|
@@ -8771,7 +8768,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8771
8768
|
pointer-events: auto;
|
|
8772
8769
|
z-index: 10;
|
|
8773
8770
|
}
|
|
8774
|
-
`}function op(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]}}function rp(e){for(const t of e)if(t.title1||t.title2||t.title3)return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""};for(const t of e){const n=op(t.text);if(n.title1||n.title2||n.title3)return{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}return{title1:"",title2:"",title3:""}}const oi=["title1","title2","title3"];function Ke(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const ap={title1:"1",title2:"2",title3:"3"};function lp(e){return[Ke(e,"fontFamily"),Ke(e,"fontSettings"),{type:"row",items:[Ke(e,"fontSize"),Ke(e,"lineHeight"),Ke(e,"letterSpacing"),Ke(e,"wordSpacing")]},Ke(e,"textAlign"),Ke(e,"textAppearance")]}function sp(){return{type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(oi.map(e=>[ap[e],lp(e)]))}}const cp={title1:"title1Color",title2:"title2Color",title3:"title3Color"},dp={title1:.02,title2:.02,title3:.02};function po(e,t){const n=i=>{const o=Ke(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[cp[t]]}}function mo(e,t,n){var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??dp[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return ut(i,n)}const up=1,zr=.15,pp=3,mp=20,yi=e=>`max(${e}, ${mp}px)`,gp=({prefix:e,images:t,type:n,backgroundColor:i,contentBackgroundColor:o,thumbnailGap:l,thumbnailMarginBottom:s,imageGap:d,isEditor:a,isEditMode:u,isPreviewMode:p,closeIcon:I,closeIconMaxWidth:x,closeIconColor:b,closeIconHoverColor:g,thumbnailTrigger:h,thumbnailVisibility:R,thumbnailObjectFit:w,thumbnailActive:y,textMaxWidth:$,title1Gap:N,title2Gap:_,title1:M,title2:S,title3:P,title1Style:k,title2Style:L,title3Style:F,contentMarginTop:B,contentMarginLeft:z,contentMarginRight:K,onClose:Z})=>{const m=!!u,E=!u,W=!u&&(!a||!!p),A=W,C=W,V=Vt(w),q=V?{"--image-aspect-ratio":qi(w)}:void 0,ee=(X,re,se=!1)=>{const Ce=yi(re),me=`calc(-0.5 * (${Ce} + ${re}))`;return r.jsx("div",{"data-controls":X,"data-controls-axis":"x",...se?{"data-controls-reverse":"true"}:void 0,style:{position:"absolute",top:0,right:me,width:Ce,height:"100%",pointerEvents:"auto",zIndex:3}})},J=!!(M||S||P),ye=(X=!1)=>{const re=[];return M&&re.push({className:`${e}-title1`,style:k,text:M,gapKey:"title1Gap",gap:N}),S&&re.push({className:`${e}-title2`,style:L,text:S,gapKey:"title2Gap",gap:_}),P&&re.push({className:`${e}-title3`,style:F,text:P}),re.map((se,Ce)=>r.jsxs("div",{className:`${e}-title-cell`,style:Ce<re.length-1&&se.gap?{marginRight:se.gap}:void 0,children:[r.jsx("p",{className:se.className,style:{...se.style,maxWidth:$},children:se.text}),X&&m&&se.gapKey&&se.gap&&Ce<re.length-1?ee(se.gapKey,se.gap):null]},se.className))},v=c.useRef(null),U=c.useRef(null),he=c.useRef([]),ue=c.useRef(0),ge=c.useRef({isActive:!1,startX:0,scrollLeft:0,hasMoved:!1}),ie=t.length>1,fe=ie?pp:1,G=c.useMemo(()=>Array.from({length:fe},()=>t).flat(),[t,fe]),[f,H]=c.useState(!1),[j,te]=c.useState(!1),[ce,ne]=c.useState(!0),[Q,pe]=c.useState(0),Se=c.useRef(Q);Se.current=Q;const be=c.useRef(null),D=c.useRef(!1),de=c.useRef(null),O=c.useRef(null),Y=c.useCallback(()=>{E&&(ne(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{ge.current.isActive||ne(!1)},np))},[E]),we=c.useCallback(()=>{u||D.current||(D.current=!0,te(!1),de.current=setTimeout(()=>{Z()},ki))},[u,Z]),Pe=()=>{if(!ie||t.length===0)return ue.current=0,0;const X=he.current[0],re=he.current[t.length];if(!X||!re)return ue.current;const se=re.offsetLeft-X.offsetLeft;return se>0&&(ue.current=se),ue.current},Qe=(X=!1)=>{if(!ie)return;const re=U.current,se=Pe();!re||se<=0||(re.scrollLeft<=0?(re.scrollLeft+=se,X&&(ge.current.scrollLeft+=se)):re.scrollLeft>=se*2&&(re.scrollLeft-=se,X&&(ge.current.scrollLeft-=se)))},He=(X=(re=>(re=U.current)==null?void 0:re.scrollLeft)()??0)=>{let se=0,Ce=1/0;return he.current.forEach((me,Oe)=>{if(!me)return;const Ve=Math.abs(me.offsetLeft-X);Ve<Ce&&(Ce=Ve,se=Oe)}),se},Be=()=>{!U.current||t.length===0||be.current===null&&pe(He()%t.length)},je=()=>{be.current=null,Be()},ke=(X="smooth")=>{const re=U.current;if(!re||t.length===0)return;const se=He(),Ce=he.current[se];Ce&&(re.scrollTo({left:Ce.offsetLeft,behavior:X}),pe(se%t.length))},Ge=X=>{const re=U.current;re&&(re.style.scrollSnapType=X?"":"none")},Ye=(X,re="smooth")=>{const se=U.current;if(!se||t.length===0)return;const Ce=se.scrollLeft-X,me=He(se.scrollLeft),Oe=he.current[me],Ve=he.current[me+1],ae=Oe?Ve?Ve.offsetLeft-Oe.offsetLeft:Oe.offsetWidth:0;let $e=me;ae>0&&(Ce>ae*zr?$e+=1:Ce<-ae*zr&&($e-=1)),ie||($e=Math.max(0,Math.min(G.length-1,$e)));const _e=he.current[$e];if(!_e){ke(re);return}se.scrollTo({left:_e.offsetLeft,behavior:re}),pe($e%t.length)},Ee=(X,re="smooth")=>{const se=U.current,Ce=ie?t.length+X:X,me=he.current[Ce];!se||!me||(re==="smooth"?be.current=X:be.current=null,pe(X),se.scrollTo({left:me.offsetLeft,behavior:re}))},Je=X=>X.closest("[data-controls]")||X.closest(`.${e}-thumbnails`)||X.closest(`.${e}-close-icon`),ct=X=>{if(!A||X.pointerType!=="mouse"||X.button!==0||Je(X.target))return;const re=U.current,se=v.current;!re||!se||(ge.current={isActive:!0,startX:X.clientX,scrollLeft:re.scrollLeft,hasMoved:!1},Ge(!1),Y(),se.setPointerCapture(X.pointerId))},pt=X=>{if(!A||X.pointerType!=="mouse")return;const re=U.current;if(!re||!ge.current.isActive)return;const se=X.clientX-ge.current.startX;Math.abs(se)>up&&(ge.current.hasMoved=!0,H(!0)),ge.current.hasMoved&&(X.preventDefault(),re.scrollLeft=ge.current.scrollLeft-se,Qe(!0),Be(),Y())},rt=X=>{if(!A||X.pointerType!=="mouse")return;const re=U.current,se=v.current;if(!re||!se)return;const Ce=ge.current.hasMoved,me=ge.current.scrollLeft;ge.current.isActive=!1,H(!1),se.hasPointerCapture(X.pointerId)&&se.releasePointerCapture(X.pointerId),Qe(),Ge(!0),Ce?Ye(me):Be(),Y()};return c.useEffect(()=>{const X=requestAnimationFrame(()=>te(!0)),re=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{cancelAnimationFrame(X),document.body.style.overflow=re,de.current&&clearTimeout(de.current),O.current&&clearTimeout(O.current)}},[]),c.useEffect(()=>{if(!E){ne(!0);return}Y();const X=v.current;if(!X)return;const re=()=>Y();return X.addEventListener("pointermove",re),X.addEventListener("pointerdown",re),()=>{X.removeEventListener("pointermove",re),X.removeEventListener("pointerdown",re),O.current&&clearTimeout(O.current)}},[E,Y]),c.useEffect(()=>{const X=re=>{re.key==="Escape"&&we()};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[we]),c.useLayoutEffect(()=>{Pe(),Ee(Se.current,"auto")},[d]),c.useLayoutEffect(()=>{Pe(),Ee(0,"auto")},[t.length,ie]),c.useEffect(()=>{if(!u)return;const X=U.current;if(!X)return;const re=se=>{se.preventDefault()};return X.addEventListener("wheel",re,{passive:!1}),X.addEventListener("touchmove",re,{passive:!1}),()=>{X.removeEventListener("wheel",re),X.removeEventListener("touchmove",re)}},[u]),c.useEffect(()=>{const X=U.current;if(!X)return;let re=null;const se=()=>{Qe(),Be(),be.current!==null&&(re&&clearTimeout(re),re=setTimeout(()=>{be.current!==null&&je()},150))},Ce=()=>{be.current!==null&&(re&&(clearTimeout(re),re=null),je())};X.addEventListener("scroll",se,{passive:!0}),X.addEventListener("scrollend",Ce);const me=new ResizeObserver(()=>{Pe(),Qe(),Be()});return me.observe(X),()=>{re&&clearTimeout(re),X.removeEventListener("scroll",se),X.removeEventListener("scrollend",Ce),me.disconnect()}},[t.length,ie]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${a?` ${e}-lightbox-editor`:""}${u?` ${e}-lightbox-edit-mode`:""}`,onClick:we,role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:j?1:0,transition:`opacity ${ki}ms ease`,pointerEvents:j?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:i}}),r.jsxs("div",{ref:v,className:`${e}-lightbox-content`,"data-mouse-draggable":A&&t.length>0?"true":"false","data-mouse-dragging":f?"true":"false",onClick:X=>X.stopPropagation(),onPointerDown:A?ct:void 0,onPointerMove:A?pt:void 0,onPointerUp:A?rt:void 0,onPointerCancel:A?rt:void 0,children:[r.jsxs("div",{className:`${e}-lightbox-content-inner`,style:{width:"100%",height:n==="A"?"100%":"auto",top:0,bottom:n==="A"?0:"auto",...n==="B"?{backgroundColor:o,position:"relative"}:{}},children:[r.jsx("div",{"data-controls":m?"contentMarginTop":void 0,className:m?`${e}-control`:void 0,style:{height:B,width:"100%",pointerEvents:m?"auto":"none"}}),r.jsxs("div",{className:n==="B"?`${e}-lightbox-chrome-bar`:void 0,style:{display:"flex",flexDirection:"row",width:"100%"},children:[r.jsx("div",{"data-controls":m?"contentMarginLeft":void 0,"data-controls-axis":m?"x":void 0,className:m?`${e}-control`:void 0,style:{width:z,flexShrink:0}}),r.jsxs("div",{className:`${e}-lightbox-content-area`,children:[J&&r.jsx("div",{className:`${e}-titles-row`,children:ye(!0)}),I&&r.jsx("div",{className:`${e}-close-icon`,"data-chrome-hidden":E&&!ce?"true":"false",style:{width:T.scalingValue(x??0,a),height:T.scalingValue(x??0,a),"--close-icon-hover-color":g},children:r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:we,"aria-label":"Close",children:r.jsx(At,{url:I,fill:b,hoverFill:g,className:`${e}-close-icon-img`})})})]}),r.jsx("div",{"data-controls":m?"contentMarginRight":void 0,"data-controls-axis":m?"x":void 0,"data-controls-reverse":m?"":void 0,className:m?`${e}-control`:void 0,style:{width:K,flexShrink:0,pointerEvents:m?"auto":"none"}})]})]}),r.jsx("div",{ref:U,className:`${e}-lightbox-strip`,style:{gap:d},"data-mouse-dragging":f?"true":"false",children:G.map((X,re)=>{const se=X.image.objectFit??"contain",Ce=re%t.length,me=Math.floor(re/t.length),Oe=yi(d),Ve=`calc(-0.5 * (${Oe} + ${d}))`;return r.jsxs("div",{ref:ae=>he.current[re]=ae,className:`${e}-strip-item`,style:{height:"100%"},children:[r.jsx("img",{src:X.image.url,draggable:!1,style:{display:"block",width:"100%",height:"100%",objectFit:se}}),m&&Ce<t.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ve,width:Oe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${me}-${X.image.url}-${Ce}`)})}),t.length>1&&R==="on"&&(()=>{const X=yi(s),re=`calc(-0.5 * (${s} + ${X}))`;return r.jsxs("div",{className:`${e}-thumbnails`,"data-thumbnail-active":y,"data-chrome-hidden":E&&!ce?"true":"false",style:{gap:l,bottom:s},children:[t.map((se,Ce)=>{const me=yi(l),Oe=`calc(-0.5 * (${me} + ${l}))`;return r.jsxs("div",{style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":Q===Ce?"true":"false",onClick:()=>W&&h==="click"&&Ee(Ce),onMouseEnter:()=>C&&h==="hover"&&Ee(Ce),"aria-label":se.image.name?`View ${se.image.name}`:`View image ${Ce+1}`,"aria-current":Q===Ce?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${V?` ${e}-thumb-image-cover`:""}`,src:se.image.url,alt:"",draggable:!1,style:q})}),m&&Ce<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Oe,width:me,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${se.image.url}-${Ce}`)}),m&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":m?"":void 0,style:{position:"absolute",left:0,right:0,bottom:re,height:X,pointerEvents:"auto",zIndex:3}})]})})()]})]})},hp=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l})=>{const{prefix:s}=T.useScopedStyles(),{cover:d,coverFit:a,type:u,backgroundColor:p,contentBackgroundColor:I,thumbnailVisibility:x,thumbnailObjectFit:b,thumbnailTrigger:g,thumbnailActive:h,thumbnailGap:R,thumbnailMarginBottom:w,imageGap:y,textMaxWidth:$,title1Gap:N,title2Gap:_,closeIcon:M,closeIconMaxWidth:S,closeIconColor:P,closeIconHoverColor:k,contentMarginTop:L,contentMarginLeft:F,contentMarginRight:B}=e,z=c.useRef(null),[K,Z]=c.useState(!1),m=t??[],{title1:E,title2:W,title3:A}=rp(m),C=v=>T.scalingValue(v,n??!1),V=mo("title1",po(e,"title1"),n),q=mo("title2",po(e,"title2"),n),ee=mo("title3",po(e,"title3"),n),J=()=>{i||m.length===0||Z(!0)},ye=()=>{Z(!1)};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:z,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ip(s)}}),d?r.jsx("button",{type:"button",className:`${s}-cover ${Vt(a)?`${s}-ratio-wrapper-cover`:`${s}-ratio-wrapper-fit`}`,onClick:J,style:{display:"block",padding:0,border:"none",background:"transparent",...Vt(a)?{"--image-aspect-ratio":qi(a)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${s}-cover-image ${Vt(a)?`${s}-cover-image-cover`:`${s}-cover-image-fit`}`,src:d,alt:"cover"})}):null]}),K&&typeof document<"u"&&(()=>{const v=(l?document.getElementById(l):null)??document.body;return Xn.createPortal(r.jsx(gp,{prefix:s,type:u,images:m,backgroundColor:p,contentBackgroundColor:I,thumbnailGap:C(R),thumbnailMarginBottom:C(w??.02),imageGap:C(y??0),thumbnailVisibility:x,thumbnailObjectFit:b,thumbnailTrigger:g,thumbnailActive:h,textMaxWidth:C($),title1Gap:C(N??0),title2Gap:C(_??0),title1:E,title2:W,title3:A,title1Style:V,title2Style:q,title3Style:ee,contentMarginTop:C(L??0),contentMarginLeft:C(F??0),contentMarginRight:C(B??0),closeIcon:M,closeIconMaxWidth:S,closeIconColor:P,closeIconHoverColor:k,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:ye}),v)})()]})},fp=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
8771
|
+
`}function op(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]}}function rp(e){for(const t of e)if(t.title1||t.title2||t.title3)return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""};for(const t of e){const n=op(t.text);if(n.title1||n.title2||n.title3)return{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}return{title1:"",title2:"",title3:""}}const oi=["title1","title2","title3"];function Ge(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const ap={title1:"1",title2:"2",title3:"3"};function lp(e){return[Ge(e,"fontFamily"),Ge(e,"fontSettings"),{type:"row",items:[Ge(e,"fontSize"),Ge(e,"lineHeight"),Ge(e,"letterSpacing"),Ge(e,"wordSpacing")]},Ge(e,"textAlign"),Ge(e,"textAppearance")]}function sp(){return{type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(oi.map(e=>[ap[e],lp(e)]))}}const cp={title1:"title1Color",title2:"title2Color",title3:"title3Color"},dp={title1:.02,title2:.02,title3:.02};function po(e,t){const n=i=>{const o=Ge(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[cp[t]]}}function mo(e,t,n){var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??dp[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return ut(i,n)}const up=1,zr=.15,pp=3,mp=20,yi=e=>`max(${e}, ${mp}px)`,gp=({prefix:e,images:t,type:n,backgroundColor:i,contentBackgroundColor:o,thumbnailGap:l,thumbnailMarginBottom:s,imageGap:d,isEditor:a,isEditMode:u,isPreviewMode:p,closeIcon:I,closeIconMaxWidth:S,closeIconColor:v,closeIconHoverColor:g,thumbnailTrigger:h,thumbnailVisibility:R,thumbnailObjectFit:T,thumbnailActive:y,thumbnailActiveColor:w,textMaxWidth:N,title1Gap:_,title2Gap:W,title1:C,title2:P,title3:A,title1Style:E,title2Style:k,title3Style:B,contentMarginTop:V,contentMarginLeft:K,contentMarginRight:ee,onClose:m})=>{const b=!!u,F=!u,M=!u&&(!a||!!p),$=M,O=M,U=Vt(T),te=U?{"--image-aspect-ratio":qi(T)}:void 0,Y=(Z,Q,ce=!1)=>{const se=yi(Q),Le=`calc(-0.5 * (${se} + ${Q}))`;return r.jsx("div",{"data-controls":Z,"data-controls-axis":"x",...ce?{"data-controls-reverse":"true"}:void 0,style:{position:"absolute",top:0,right:Le,width:se,height:"100%",pointerEvents:"auto",zIndex:3}})},fe=!!(C||P||A),x=(Z=!1)=>{const Q=[];return C&&Q.push({className:`${e}-title1`,style:E,text:C,gapKey:"title1Gap",gap:_}),P&&Q.push({className:`${e}-title2`,style:k,text:P,gapKey:"title2Gap",gap:W}),A&&Q.push({className:`${e}-title3`,style:B,text:A}),Q.map((ce,se)=>r.jsxs("div",{className:`${e}-title-cell`,style:se<Q.length-1&&ce.gap?{marginRight:ce.gap}:void 0,children:[r.jsx("p",{className:ce.className,style:{...ce.style,maxWidth:N},children:ce.text}),Z&&b&&ce.gapKey&&ce.gap&&se<Q.length-1?Y(ce.gapKey,ce.gap):null]},ce.className))},q=c.useRef(null),he=c.useRef(null),pe=c.useRef([]),be=c.useRef(0),J=c.useRef({isActive:!1,startX:0,scrollLeft:0,hasMoved:!1}),me=t.length>1,G=me?pp:1,f=c.useMemo(()=>Array.from({length:G},()=>t).flat(),[t,G]),[H,j]=c.useState(!1),[ne,de]=c.useState(!1),[oe,ie]=c.useState(!0),[ge,ve]=c.useState(0),Se=c.useRef(ge);Se.current=ge;const D=c.useRef(null),ue=c.useRef(!1),z=c.useRef(null),X=c.useRef(null),Ce=c.useCallback(()=>{F&&(ie(!0),X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{J.current.isActive||ie(!1)},np))},[F]),_e=c.useCallback(()=>{u||ue.current||(ue.current=!0,de(!1),z.current=setTimeout(()=>{m()},ki))},[u,m]),Ze=()=>{if(!me||t.length===0)return be.current=0,0;const Z=pe.current[0],Q=pe.current[t.length];if(!Z||!Q)return be.current;const ce=Q.offsetLeft-Z.offsetLeft;return ce>0&&(be.current=ce),be.current},We=(Z=!1)=>{if(!me)return;const Q=he.current,ce=Ze();!Q||ce<=0||(Q.scrollLeft<=0?(Q.scrollLeft+=ce,Z&&(J.current.scrollLeft+=ce)):Q.scrollLeft>=ce*2&&(Q.scrollLeft-=ce,Z&&(J.current.scrollLeft-=ce)))},ze=(Z=(Q=>(Q=he.current)==null?void 0:Q.scrollLeft)()??0)=>{let ce=0,se=1/0;return pe.current.forEach((Le,Oe)=>{if(!Le)return;const ae=Math.abs(Le.offsetLeft-Z);ae<se&&(se=ae,ce=Oe)}),ce},Ne=()=>{!he.current||t.length===0||D.current===null&&ve(ze()%t.length)},Me=()=>{D.current=null,Ne()},qe=(Z="smooth")=>{const Q=he.current;if(!Q||t.length===0)return;const ce=ze(),se=pe.current[ce];se&&(Q.scrollTo({left:se.offsetLeft,behavior:Z}),ve(ce%t.length))},Xe=Z=>{const Q=he.current;Q&&(Q.style.scrollSnapType=Z?"":"none")},Pe=(Z,Q="smooth")=>{const ce=he.current;if(!ce||t.length===0)return;const se=ce.scrollLeft-Z,Le=ze(ce.scrollLeft),Oe=pe.current[Le],ae=pe.current[Le+1],$e=Oe?ae?ae.offsetLeft-Oe.offsetLeft:Oe.offsetWidth:0;let Ie=Le;$e>0&&(se>$e*zr?Ie+=1:se<-$e*zr&&(Ie-=1)),me||(Ie=Math.max(0,Math.min(f.length-1,Ie)));const Re=pe.current[Ie];if(!Re){qe(Q);return}ce.scrollTo({left:Re.offsetLeft,behavior:Q}),ve(Ie%t.length)},Ve=(Z,Q="smooth")=>{const ce=he.current,se=me?t.length+Z:Z,Le=pe.current[se];!ce||!Le||(Q==="smooth"?D.current=Z:D.current=null,ve(Z),ce.scrollTo({left:Le.offsetLeft,behavior:Q}))},ct=Z=>Z.closest("[data-controls]")||Z.closest(`.${e}-thumbnails`)||Z.closest(`.${e}-close-icon`),pt=Z=>{if(!$||Z.pointerType!=="mouse"||Z.button!==0||ct(Z.target))return;const Q=he.current,ce=q.current;!Q||!ce||(J.current={isActive:!0,startX:Z.clientX,scrollLeft:Q.scrollLeft,hasMoved:!1},Xe(!1),Ce(),ce.setPointerCapture(Z.pointerId))},rt=Z=>{if(!$||Z.pointerType!=="mouse")return;const Q=he.current;if(!Q||!J.current.isActive)return;const ce=Z.clientX-J.current.startX;Math.abs(ce)>up&&(J.current.hasMoved=!0,j(!0)),J.current.hasMoved&&(Z.preventDefault(),Q.scrollLeft=J.current.scrollLeft-ce,We(!0),Ne(),Ce())},ot=Z=>{if(!$||Z.pointerType!=="mouse")return;const Q=he.current,ce=q.current;if(!Q||!ce)return;const se=J.current.hasMoved,Le=J.current.scrollLeft;J.current.isActive=!1,j(!1),ce.hasPointerCapture(Z.pointerId)&&ce.releasePointerCapture(Z.pointerId),We(),Xe(!0),se?Pe(Le):Ne(),Ce()};return c.useEffect(()=>{const Z=requestAnimationFrame(()=>de(!0)),Q=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{cancelAnimationFrame(Z),document.body.style.overflow=Q,z.current&&clearTimeout(z.current),X.current&&clearTimeout(X.current)}},[]),c.useEffect(()=>{if(!F){ie(!0);return}Ce();const Z=q.current;if(!Z)return;const Q=()=>Ce();return Z.addEventListener("pointermove",Q),Z.addEventListener("pointerdown",Q),()=>{Z.removeEventListener("pointermove",Q),Z.removeEventListener("pointerdown",Q),X.current&&clearTimeout(X.current)}},[F,Ce]),c.useEffect(()=>{const Z=Q=>{Q.key==="Escape"&&_e()};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[_e]),c.useLayoutEffect(()=>{Ze(),Ve(Se.current,"auto")},[d]),c.useLayoutEffect(()=>{Ze(),Ve(0,"auto")},[t.length,me]),c.useEffect(()=>{if(!u)return;const Z=he.current;if(!Z)return;const Q=ce=>{ce.preventDefault()};return Z.addEventListener("wheel",Q,{passive:!1}),Z.addEventListener("touchmove",Q,{passive:!1}),()=>{Z.removeEventListener("wheel",Q),Z.removeEventListener("touchmove",Q)}},[u]),c.useEffect(()=>{const Z=he.current;if(!Z)return;let Q=null;const ce=()=>{We(),Ne(),D.current!==null&&(Q&&clearTimeout(Q),Q=setTimeout(()=>{D.current!==null&&Me()},150))},se=()=>{D.current!==null&&(Q&&(clearTimeout(Q),Q=null),Me())};Z.addEventListener("scroll",ce,{passive:!0}),Z.addEventListener("scrollend",se);const Le=new ResizeObserver(()=>{Ze(),We(),Ne()});return Le.observe(Z),()=>{Q&&clearTimeout(Q),Z.removeEventListener("scroll",ce),Z.removeEventListener("scrollend",se),Le.disconnect()}},[t.length,me]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${a?` ${e}-lightbox-editor`:""}${u?` ${e}-lightbox-edit-mode`:""}`,onClick:_e,role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:ne?1:0,transition:`opacity ${ki}ms ease`,pointerEvents:ne?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:i}}),r.jsxs("div",{ref:q,className:`${e}-lightbox-content`,"data-mouse-draggable":$&&t.length>0?"true":"false","data-mouse-dragging":H?"true":"false",onClick:Z=>Z.stopPropagation(),onPointerDown:$?pt:void 0,onPointerMove:$?rt:void 0,onPointerUp:$?ot:void 0,onPointerCancel:$?ot:void 0,children:[r.jsxs("div",{className:`${e}-lightbox-content-inner`,style:{width:"100%",height:n==="A"?"100%":"auto",top:0,bottom:n==="A"?0:"auto",...n==="B"?{backgroundColor:o,position:"relative"}:{}},children:[r.jsx("div",{"data-controls":b?"contentMarginTop":void 0,className:b?`${e}-control`:void 0,style:{height:V,width:"100%",pointerEvents:b?"auto":"none"}}),r.jsxs("div",{className:n==="B"?`${e}-lightbox-chrome-bar`:void 0,style:{display:"flex",flexDirection:"row",width:"100%"},children:[r.jsx("div",{"data-controls":b?"contentMarginLeft":void 0,"data-controls-axis":b?"x":void 0,className:b?`${e}-control`:void 0,style:{width:K,flexShrink:0}}),r.jsxs("div",{className:`${e}-lightbox-content-area`,children:[fe&&r.jsx("div",{className:`${e}-titles-row`,children:x(!0)}),I&&r.jsx("div",{className:`${e}-close-icon`,"data-chrome-hidden":F&&!oe?"true":"false",style:{width:L.scalingValue(S??0,a),height:L.scalingValue(S??0,a),"--close-icon-hover-color":g},children:r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:_e,"aria-label":"Close",children:r.jsx(At,{url:I,fill:v,hoverFill:g,className:`${e}-close-icon-img`})})})]}),r.jsx("div",{"data-controls":b?"contentMarginRight":void 0,"data-controls-axis":b?"x":void 0,"data-controls-reverse":b?"":void 0,className:b?`${e}-control`:void 0,style:{width:ee,flexShrink:0,pointerEvents:b?"auto":"none"}})]})]}),r.jsx("div",{ref:he,className:`${e}-lightbox-strip`,style:{gap:d},"data-mouse-dragging":H?"true":"false",children:f.map((Z,Q)=>{const ce=Z.image.objectFit??"contain",se=Q%t.length,Le=Math.floor(Q/t.length),Oe=yi(d),ae=`calc(-0.5 * (${Oe} + ${d}))`;return r.jsxs("div",{ref:$e=>pe.current[Q]=$e,className:`${e}-strip-item`,style:{height:"100%"},children:[r.jsx("img",{src:Z.image.url,draggable:!1,style:{display:"block",width:"100%",height:"100%",objectFit:ce}}),b&&se<t.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ae,width:Oe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Le}-${Z.image.url}-${se}`)})}),t.length>1&&R==="on"&&(()=>{const Z=yi(s),Q=`calc(-0.5 * (${s} + ${Z}))`;return r.jsxs("div",{className:`${e}-thumbnails`,"data-thumbnail-active":y,"data-chrome-hidden":F&&!oe?"true":"false",style:{gap:l,bottom:s,"--thumbnail-active-color":w},children:[t.map((ce,se)=>{const Le=yi(l),Oe=`calc(-0.5 * (${Le} + ${l}))`;return r.jsxs("div",{style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":ge===se?"true":"false",onClick:()=>M&&h==="click"&&Ve(se),onMouseEnter:()=>O&&h==="hover"&&Ve(se),"aria-label":ce.image.name?`View ${ce.image.name}`:`View image ${se+1}`,"aria-current":ge===se?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${U?` ${e}-thumb-image-cover`:""}`,src:ce.image.url,alt:"",draggable:!1,style:te})}),b&&se<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Oe,width:Le,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ce.image.url}-${se}`)}),b&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":b?"":void 0,style:{position:"absolute",left:0,right:0,bottom:Q,height:Z,pointerEvents:"auto",zIndex:3}})]})})()]})]})},hp=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l})=>{const{prefix:s}=L.useScopedStyles(),{cover:d,coverFit:a,type:u,backgroundColor:p,contentBackgroundColor:I,thumbnailVisibility:S,thumbnailObjectFit:v,thumbnailTrigger:g,thumbnailActive:h,thumbnailActiveColor:R,thumbnailGap:T,thumbnailMarginBottom:y,imageGap:w,textMaxWidth:N,title1Gap:_,title2Gap:W,closeIcon:C,closeIconMaxWidth:P,closeIconColor:A,closeIconHoverColor:E,contentMarginTop:k,contentMarginLeft:B,contentMarginRight:V}=e,K=c.useRef(null),[ee,m]=c.useState(!1),b=t??[],{title1:F,title2:M,title3:$}=rp(b),O=q=>L.scalingValue(q,n??!1),U=mo("title1",po(e,"title1"),n),te=mo("title2",po(e,"title2"),n),Y=mo("title3",po(e,"title3"),n),fe=()=>{i||b.length===0||m(!0)},x=()=>{m(!1)};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:K,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ip(s)}}),d?r.jsx("button",{type:"button",className:`${s}-cover ${Vt(a)?`${s}-ratio-wrapper-cover`:`${s}-ratio-wrapper-fit`}`,onClick:fe,style:{display:"block",padding:0,border:"none",background:"transparent",...Vt(a)?{"--image-aspect-ratio":qi(a)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${s}-cover-image ${Vt(a)?`${s}-cover-image-cover`:`${s}-cover-image-fit`}`,src:d,alt:"cover"})}):null]}),ee&&typeof document<"u"&&(()=>{const q=(l?document.getElementById(l):null)??document.body;return Xn.createPortal(r.jsx(gp,{prefix:s,type:u,images:b,backgroundColor:p,contentBackgroundColor:I,thumbnailGap:O(T),thumbnailMarginBottom:O(y??.02),imageGap:O(w??0),thumbnailVisibility:S,thumbnailObjectFit:v,thumbnailTrigger:g,thumbnailActive:h,thumbnailActiveColor:R,textMaxWidth:O(N),title1Gap:O(_??0),title2Gap:O(W??0),title1:F,title2:M,title3:$,title1Style:U,title2Style:te,title3Style:Y,contentMarginTop:O(k??0),contentMarginLeft:O(B??0),contentMarginRight:O(V??0),closeIcon:C,closeIconMaxWidth:P,closeIconColor:A,closeIconHoverColor:E,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:x}),q)})()]})},fp=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
8775
8772
|
import { createPortal } from 'react-dom';
|
|
8776
8773
|
import { CommonComponentProps } from '../props';
|
|
8777
8774
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -8966,11 +8963,11 @@ function getCSS(P: string): string {
|
|
|
8966
8963
|
opacity: 1;
|
|
8967
8964
|
}
|
|
8968
8965
|
|
|
8969
|
-
.\${P}-thumbnails[data-thumbnail-active="
|
|
8970
|
-
|
|
8966
|
+
.\${P}-thumbnails[data-thumbnail-active="outline"] .\${P}-thumb[data-active="true"] {
|
|
8967
|
+
border-color: var(--thumbnail-active-color, #ffffff);
|
|
8971
8968
|
}
|
|
8972
8969
|
|
|
8973
|
-
.\${P}-thumbnails[data-thumbnail-active="
|
|
8970
|
+
.\${P}-thumbnails[data-thumbnail-active="color"] .\${P}-thumb:not([data-active="true"]) .\${P}-thumb-image {
|
|
8974
8971
|
filter: grayscale(1);
|
|
8975
8972
|
}
|
|
8976
8973
|
|
|
@@ -8978,9 +8975,6 @@ function getCSS(P: string): string {
|
|
|
8978
8975
|
transform: scale(1.15);
|
|
8979
8976
|
}
|
|
8980
8977
|
|
|
8981
|
-
.\${P}-thumbnails[data-thumbnail-active="opacity"] .\${P}-thumb:not([data-active="true"]) {
|
|
8982
|
-
opacity: 0.5;
|
|
8983
|
-
}
|
|
8984
8978
|
|
|
8985
8979
|
.\${P}-thumb-image {
|
|
8986
8980
|
display: block;
|
|
@@ -9188,7 +9182,8 @@ export type LightboxStripSettings = {
|
|
|
9188
9182
|
reversed: boolean;
|
|
9189
9183
|
},
|
|
9190
9184
|
thumbnailTrigger: 'click' | 'hover';
|
|
9191
|
-
thumbnailActive: '
|
|
9185
|
+
thumbnailActive: 'outline' | 'color' | 'scale-up';
|
|
9186
|
+
thumbnailActiveColor: string;
|
|
9192
9187
|
thumbnailGap: number;
|
|
9193
9188
|
thumbnailMarginBottom?: number;
|
|
9194
9189
|
imageGap?: number;
|
|
@@ -9396,7 +9391,8 @@ type LightboxOverlayProps = {
|
|
|
9396
9391
|
reversed: boolean;
|
|
9397
9392
|
};
|
|
9398
9393
|
thumbnailTrigger: 'click' | 'hover';
|
|
9399
|
-
thumbnailActive: '
|
|
9394
|
+
thumbnailActive: 'outline' | 'color' | 'scale-up';
|
|
9395
|
+
thumbnailActiveColor: string;
|
|
9400
9396
|
textMaxWidth: string;
|
|
9401
9397
|
title1Gap: string;
|
|
9402
9398
|
title2Gap: string;
|
|
@@ -9442,6 +9438,7 @@ const LightboxOverlay = ({
|
|
|
9442
9438
|
thumbnailVisibility,
|
|
9443
9439
|
thumbnailObjectFit,
|
|
9444
9440
|
thumbnailActive,
|
|
9441
|
+
thumbnailActiveColor,
|
|
9445
9442
|
textMaxWidth,
|
|
9446
9443
|
title1Gap,
|
|
9447
9444
|
title2Gap,
|
|
@@ -10031,7 +10028,11 @@ const LightboxOverlay = ({
|
|
|
10031
10028
|
className={\`\${P}-thumbnails\`}
|
|
10032
10029
|
data-thumbnail-active={thumbnailActive}
|
|
10033
10030
|
data-chrome-hidden={hideChromeOnIdle && !chromeVisible ? 'true' : 'false'}
|
|
10034
|
-
style={{
|
|
10031
|
+
style={{
|
|
10032
|
+
gap: thumbnailGap,
|
|
10033
|
+
bottom: thumbnailMarginBottom,
|
|
10034
|
+
'--thumbnail-active-color': thumbnailActiveColor,
|
|
10035
|
+
} as React.CSSProperties}
|
|
10035
10036
|
>
|
|
10036
10037
|
{images.map((item, index) => {
|
|
10037
10038
|
const thumbnailGapControlSize = getGapControlSize(thumbnailGap);
|
|
@@ -10119,6 +10120,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10119
10120
|
thumbnailObjectFit,
|
|
10120
10121
|
thumbnailTrigger,
|
|
10121
10122
|
thumbnailActive,
|
|
10123
|
+
thumbnailActiveColor,
|
|
10122
10124
|
thumbnailGap,
|
|
10123
10125
|
thumbnailMarginBottom,
|
|
10124
10126
|
imageGap,
|
|
@@ -10196,6 +10198,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10196
10198
|
thumbnailObjectFit={thumbnailObjectFit}
|
|
10197
10199
|
thumbnailTrigger={thumbnailTrigger}
|
|
10198
10200
|
thumbnailActive={thumbnailActive}
|
|
10201
|
+
thumbnailActiveColor={thumbnailActiveColor}
|
|
10199
10202
|
textMaxWidth={scaled(textMaxWidth)}
|
|
10200
10203
|
title1Gap={scaled(title1Gap ?? 0)}
|
|
10201
10204
|
title2Gap={scaled(title2Gap ?? 0)}
|
|
@@ -10223,7 +10226,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10223
10226
|
</>
|
|
10224
10227
|
);
|
|
10225
10228
|
};
|
|
10226
|
-
`,yp="https://cdn.cntrl.site/component-assets/Close.svg",an={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 vp(e){const t={};return t[Ke(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ke(e,"fontSettings")]={...an.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ke(e,"fontSize")]={...an.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ke(e,"lineHeight")]={...an.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ke(e,"letterSpacing")]={...an.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ke(e,"wordSpacing")]={...an.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ke(e,"textAlign")]={...an.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ke(e,"textAppearance")]={...an.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const bp=oi.reduce((e,t)=>({...e,...vp(t)}),{}),xp=oi.reduce((e,t)=>({...e,[Ke(t,"fontFamily")]:"Arial",[Ke(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ke(t,"letterSpacing")]:0,[Ke(t,"wordSpacing")]:0,[Ke(t,"textAlign")]:"left",[Ke(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Vr(e){return oi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ke(n,"fontSize")]=i),o!==void 0&&(t[Ke(n,"lineHeight")]=o),t},{})}const Sp=sp(),Cp={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:"common",title:"",display:{type:"radio-group"},enum:["A","B"]},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,max:200,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,max:200,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,max:200,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG",display:{type:"settings-color-picker"}},contentBackgroundColor:{type:"string",scope:"layout",title:"Content BG",display:{type:"settings-color-picker",visible:!0}},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:"Fill Icon",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Hover Icon",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"common",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:["invert","grayscale","scale-up"]}},textMaxWidth:{type:"string",scope:"common",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},title1Gap:{type:"number",scope:"layout",title:"Title 1 Gap",min:0,max:200,display:{type:"range-control"}},title2Gap:{type:"number",scope:"layout",title:"Title 2 Gap",min:0,max:200,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title 1",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Title 2",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Title 3",display:{type:"palette-color-picker"}},...bp,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,max:200,display:{type:"range-control"}},contentMarginLeft:{type:"number",scope:"layout",title:"Content margin left",min:0,max:200,display:{type:"range-control"}},contentMarginRight:{type:"number",scope:"layout",title:"Content margin right",min:0,max:200,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/LightboxJournal_1.jpg",coverFit:{display:"Cover",ratioValue:"16:9",reversed:!1},type:"A",closeIcon:yp,closeIconColor:"#ffffff",closeIconHoverColor:"#cccccc",thumbnailVisibility:"on",thumbnailSize:"S",thumbnailObjectFit:{display:"Fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"invert",title1Color:"#ffffff",title2Color:"#ffffff",title3Color:"#ffffff",...xp},layoutDefaults:{m:{thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,textMaxWidth:.4,closeIconMaxWidth:.02,backgroundColor:"rgba(28, 31, 34, 0.9)",contentBackgroundColor:"rgb(10, 10, 10)",contentMarginTop:0,contentMarginLeft:.02,contentMarginRight:.2,title1Gap:.1,title2Gap:.1,...Vr({title1FontSize:.01,title1LineHeight:.02,title2FontSize:.01,title2LineHeight:.02,title3FontSize:.01,title3LineHeight:.02})},d:{thumbnailGap:.02,thumbnailMarginBottom:.02,imageGap:.005,textMaxWidth:.4,closeIconMaxWidth:.02,backgroundColor:"rgba(28, 31, 34, 0.9)",contentBackgroundColor:"rgb(10, 10, 10)",contentMarginTop:.02,contentMarginLeft:.02,contentMarginRight:.02,title1Gap:.1,title2Gap:.1,...Vr({title1FontSize:.015,title1LineHeight:.02,title2FontSize:.015,title2LineHeight:.02,title3FontSize:.015,title3LineHeight:.02})}},displayRules:[{if:{name:"type",value:"A"},then:{name:"properties.contentBackgroundColor.display.visible",value:!1}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Gap","title2Gap","contentMarginTop","contentMarginLeft","contentMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Text",items:["textMaxWidth"]},{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:[Sp]}],paletteBookmark:{items:["backgroundColor","contentBackgroundColor","title1Color","title2Color","title3Color","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0,stripFieldsOnAdd:["title1","title2","title3","text"]},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",supportsMainImage:!0}},title1:{type:"string",label:"Title 1",placeholder:"Add Title 1...",display:{type:"text-input"}},title2:{type:"string",label:"Title 2",placeholder:"Add Title 2...",display:{type:"text-input"}},title3:{type:"string",label:"Title 3",placeholder:"Add Title 3...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_1.jpg",name:"",objectFit:"contain"},title1:"Ethan Parker",title2:"Midnight Atlas",title3:"Portland, OR"},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_2.jpg",name:"",objectFit:"contain"}},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_3.jpg",name:"",objectFit:"contain"}},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_4.jpg",name:"",objectFit:"contain"}},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_5.jpg",name:"",objectFit:"contain"}}]}},$p={element:hp,id:"lightbox-strip",name:"Lightbox 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:Cp,sourceCode:fp,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:oi.map(e=>({path:`styles.${Ke(e,"fontSettings")}`}))}},Dr=300,wo=400,Gr=300,Rn="cntrl-lightbox-journal-",wp=e=>`${Rn}${e}`,Kr=()=>{if(typeof window>"u")return null;const e=new URLSearchParams(window.location.search);for(const[t]of e){if(!t.startsWith(Rn))continue;const n=Number.parseInt(t.slice(Rn.length),10);if(Number.isFinite(n)&&n>=1)return n}return null},Ur=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},za=(e,t=!0)=>{if(typeof window>"u")return;const n=new URL(window.location.href);[...n.searchParams.keys()].forEach(l=>{l.startsWith(Rn)&&n.searchParams.delete(l)}),n.searchParams.set(wp(e),"");const i=t?"replaceState":"pushState",o=`${n.pathname}${n.search}${n.hash}`;window.history[i](window.history.state,"",o)},Tp=()=>{if(typeof window>"u")return;const e=new URL(window.location.href);let t=!1;if([...e.searchParams.keys()].forEach(n=>{n.startsWith(Rn)&&(e.searchParams.delete(n),t=!0)}),t){const n=`${e.pathname}${e.search}${e.hash}`;window.history.replaceState(window.history.state,"",n)}},Va=()=>typeof window>"u"?!1:[...new URLSearchParams(window.location.search).keys()].some(e=>e.startsWith(Rn)),Lp=e=>{if(Va()){if(e){window.history.back();return}Tp()}};function Ep(e){return`
|
|
10229
|
+
`,yp="https://cdn.cntrl.site/component-assets/Close.svg",an={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 vp(e){const t={};return t[Ge(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ge(e,"fontSettings")]={...an.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ge(e,"fontSize")]={...an.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ge(e,"lineHeight")]={...an.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ge(e,"letterSpacing")]={...an.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ge(e,"wordSpacing")]={...an.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ge(e,"textAlign")]={...an.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ge(e,"textAppearance")]={...an.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const bp=oi.reduce((e,t)=>({...e,...vp(t)}),{}),xp=oi.reduce((e,t)=>({...e,[Ge(t,"fontFamily")]:"Arial",[Ge(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ge(t,"letterSpacing")]:0,[Ge(t,"wordSpacing")]:0,[Ge(t,"textAlign")]:"left",[Ge(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Vr(e){return oi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ge(n,"fontSize")]=i),o!==void 0&&(t[Ge(n,"lineHeight")]=o),t},{})}const Sp=sp(),Cp={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:"common",title:"",display:{type:"radio-group"},enum:["A","B"]},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,max:200,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,max:200,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,max:200,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG",display:{type:"settings-color-picker"}},contentBackgroundColor:{type:"string",scope:"layout",title:"Content BG",display:{type:"settings-color-picker",visible:!0}},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:"Fill Icon",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Hover Icon",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"common",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:"Active Color",display:{type:"palette-color-picker"}},textMaxWidth:{type:"string",scope:"common",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},title1Gap:{type:"number",scope:"layout",title:"Title 1 Gap",min:0,max:200,display:{type:"range-control"}},title2Gap:{type:"number",scope:"layout",title:"Title 2 Gap",min:0,max:200,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title 1",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Title 2",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Title 3",display:{type:"palette-color-picker"}},...bp,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,max:200,display:{type:"range-control"}},contentMarginLeft:{type:"number",scope:"layout",title:"Content margin left",min:0,max:200,display:{type:"range-control"}},contentMarginRight:{type:"number",scope:"layout",title:"Content margin right",min:0,max:200,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/LightboxJournal_1.jpg",coverFit:{display:"Cover",ratioValue:"16:9",reversed:!1},type:"A",closeIcon:yp,closeIconColor:"#ffffff",closeIconHoverColor:"#cccccc",thumbnailVisibility:"on",thumbnailSize:"S",thumbnailObjectFit:{display:"Fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#ffffff",title2Color:"#ffffff",title3Color:"#ffffff",...xp},layoutDefaults:{m:{thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,textMaxWidth:.4,closeIconMaxWidth:.02,backgroundColor:"rgba(28, 31, 34, 0.9)",contentBackgroundColor:"rgb(10, 10, 10)",contentMarginTop:0,contentMarginLeft:.02,contentMarginRight:.2,title1Gap:.1,title2Gap:.1,...Vr({title1FontSize:.01,title1LineHeight:.02,title2FontSize:.01,title2LineHeight:.02,title3FontSize:.01,title3LineHeight:.02})},d:{thumbnailGap:.02,thumbnailMarginBottom:.02,imageGap:.005,textMaxWidth:.4,closeIconMaxWidth:.02,backgroundColor:"rgba(28, 31, 34, 0.9)",contentBackgroundColor:"rgb(10, 10, 10)",contentMarginTop:.02,contentMarginLeft:.02,contentMarginRight:.02,title1Gap:.1,title2Gap:.1,...Vr({title1FontSize:.015,title1LineHeight:.02,title2FontSize:.015,title2LineHeight:.02,title3FontSize:.015,title3LineHeight:.02})}},displayRules:[{if:{name:"type",value:"A"},then:{name:"properties.contentBackgroundColor.display.visible",value:!1}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Gap","title2Gap","contentMarginTop","contentMarginLeft","contentMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Text",items:["textMaxWidth"]},{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:[Sp]}],paletteBookmark:{items:["backgroundColor","contentBackgroundColor","title1Color","title2Color","title3Color","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0,stripFieldsOnAdd:["title1","title2","title3","text"]},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",supportsMainImage:!0}},title1:{type:"string",label:"Title 1",placeholder:"Add Title 1...",display:{type:"text-input"}},title2:{type:"string",label:"Title 2",placeholder:"Add Title 2...",display:{type:"text-input"}},title3:{type:"string",label:"Title 3",placeholder:"Add Title 3...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_1.jpg",name:"",objectFit:"contain"},title1:"Ethan Parker",title2:"Midnight Atlas",title3:"Portland, OR"},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_2.jpg",name:"",objectFit:"contain"}},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_3.jpg",name:"",objectFit:"contain"}},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_4.jpg",name:"",objectFit:"contain"}},{image:{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_5.jpg",name:"",objectFit:"contain"}}]}},$p={element:hp,id:"lightbox-strip",name:"Lightbox 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:Cp,sourceCode:fp,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:oi.map(e=>({path:`styles.${Ge(e,"fontSettings")}`}))}},Dr=300,wo=400,Gr=300,Rn="cntrl-lightbox-journal-",wp=e=>`${Rn}${e}`,Kr=()=>{if(typeof window>"u")return null;const e=new URLSearchParams(window.location.search);for(const[t]of e){if(!t.startsWith(Rn))continue;const n=Number.parseInt(t.slice(Rn.length),10);if(Number.isFinite(n)&&n>=1)return n}return null},Ur=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},za=(e,t=!0)=>{if(typeof window>"u")return;const n=new URL(window.location.href);[...n.searchParams.keys()].forEach(l=>{l.startsWith(Rn)&&n.searchParams.delete(l)}),n.searchParams.set(wp(e),"");const i=t?"replaceState":"pushState",o=`${n.pathname}${n.search}${n.hash}`;window.history[i](window.history.state,"",o)},Tp=()=>{if(typeof window>"u")return;const e=new URL(window.location.href);let t=!1;if([...e.searchParams.keys()].forEach(n=>{n.startsWith(Rn)&&(e.searchParams.delete(n),t=!0)}),t){const n=`${e.pathname}${e.search}${e.hash}`;window.history.replaceState(window.history.state,"",n)}},Va=()=>typeof window>"u"?!1:[...new URLSearchParams(window.location.search).keys()].some(e=>e.startsWith(Rn)),Lp=e=>{if(Va()){if(e){window.history.back();return}Tp()}};function Ep(e){return`
|
|
10227
10230
|
.${e}-wrapper {
|
|
10228
10231
|
position: relative;
|
|
10229
10232
|
width: 100%;
|
|
@@ -10615,7 +10618,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10615
10618
|
pointer-events: auto;
|
|
10616
10619
|
z-index: 10;
|
|
10617
10620
|
}
|
|
10618
|
-
`}const Ip=20,Rp=2,qr=e=>`max(${e}, ${Ip}px)`,Pn=e=>((e==null?void 0:e.image)??[]).slice(0,Rp),Da=e=>e.reduce((t,n)=>t+Pn(n).length,0),Pp=(e,t)=>{let n=1;for(let o=0;o<t;o++)n+=Pn(e[o]).length;const i=Pn(e[t]).length;return{start:n,end:n+i-1}},_p=(e,t)=>{const n=Da(e),{start:i,end:o}=Pp(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Ei=(e,t)=>t==="B"?e.flatMap((n,i)=>Pn(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Pn(n)})),Ap=(e,t,n,i)=>{var l;if(n==="B")return`${t+1} / ${e.length}`;const o=((l=e[t])==null?void 0:l.entryIndex)??0;return _p(i,o)},Xr=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Mp=(e,t,n)=>e==="B"?t.length>1:Da(n)>1,kp=({prefix:e,entries:t,journalType:n,coverFit:i,backgroundColor:o,imageGap:l,slideMaxWidth:s,slideMaxHeight:d,isEditor:a,isEditMode:u,isPreviewMode:p,closeIcon:I,closeIconMaxWidth:x,closeIconColor:b,closeIconHoverColor:g,textMaxWidth:h,titlesGap:R,countCloseGap:w,textTransition:y,title1Style:$,title2Style:N,title3Style:_,countStyle:M,contentMarginTop:S,contentMarginLeft:P,contentMarginRight:k,initialSlideIndex:L=0,enableUrlSync:F=!1,onBeforeClose:B,onClose:z})=>{const K=!!u,Z=!a||!!p,m=c.useMemo(()=>Ei(t,n),[t,n]),[E,W]=c.useState(L),A=m[E],C=A==null?void 0:A.entry,[V,q]=c.useState(!1),[ee,J]=c.useState(null),[ye,v]=c.useState(!1),[U,he]=c.useState(null),[ue,ge]=c.useState(!1),[ie,fe]=c.useState(0),[G,f]=c.useState(),[H,j]=c.useState(),[te,ce]=c.useState(null),ne=c.useRef(null),Q=c.useRef(0),pe=c.useRef(0),Se=c.useRef(0),be=c.useRef(!1),D=c.useRef(null),de=c.useRef(null),O=c.useRef(null),Y=c.useRef(null),we=c.useRef(null),Pe=c.useRef(null),Qe=c.useCallback(()=>{const ae=de.current;if(!ae)return;const $e=ae.closest(`.${e}-lightbox-content-area`);if(!$e)return ae.getBoundingClientRect().width;let _e=0;return Array.from($e.children).forEach(Re=>{Re instanceof HTMLElement&&(Re.contains(ae)||(_e+=Re.getBoundingClientRect().width))}),$e.getBoundingClientRect().width-_e},[e]),He=c.useCallback(()=>{ne.current&&(clearTimeout(ne.current),ne.current=null)},[]),Be=c.useCallback(ae=>{ae===Q.current&&(he(null),ge(!1))},[]),je=c.useCallback(()=>{u||be.current||(be.current=!0,B==null||B(),q(!1),D.current=setTimeout(()=>{z()},Dr))},[u,B,z]),ke=c.useCallback(ae=>{F&&za(ae+1,!0)},[F]),Ge=c.useCallback(ae=>{var dt,tn;if(m.length===0)return;const $e=(ae%m.length+m.length)%m.length;if($e===E)return;const _e=m[E],Re=m[$e];Q.current+=1;const ze=Q.current,ht=y==="fade"&&Xr(_e==null?void 0:_e.entry)!==Xr(Re==null?void 0:Re.entry),Te=(dt=de.current)==null?void 0:dt.getBoundingClientRect().height;let tt,Xe;ht&&(Xe=Qe(),Xn.flushSync(()=>{ce(Re.entry)}),O.current&&Xe&&(O.current.style.width=`${Xe}px`),tt=(tn=O.current)==null?void 0:tn.getBoundingClientRect().height,O.current&&(O.current.style.width=""));const Ze=Math.max(Te??0,tt??0)||void 0;fe(ze),he(E),ge(!0),W($e),ke($e),Se.current=$e,ht?(He(),Ze&&f(Ze),Xe&&j(Xe),J((_e==null?void 0:_e.entryIndex)??null),v(!0),pe.current=Re.entryIndex,ne.current=setTimeout(()=>{J(null),v(!1),f(void 0),j(void 0),ce(null),ne.current=null},wo)):(He(),J(null),v(!1),f(void 0),j(void 0),ce(null),pe.current=Re.entryIndex)},[E,He,Qe,m,ke,y]),Ye=ae=>{var ze;if(!Z||m.length<=1||ae.button!==0&&ae.pointerType==="mouse"||ae.target.closest("[data-controls]"))return;const _e=(ze=Y.current)==null?void 0:ze.getBoundingClientRect(),Re=_e?_e.left+_e.width/2:window.innerWidth/2;ae.clientX<Re?Ge(E-1):Ge(E+1)};c.useEffect(()=>{Pe.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const ae=requestAnimationFrame(()=>{q(!0),requestAnimationFrame(()=>{we.current?we.current.focus():Y.current&&Y.current.focus()})}),$e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{cancelAnimationFrame(ae),document.body.style.overflow=$e,D.current&&clearTimeout(D.current),ne.current&&clearTimeout(ne.current);const _e=Pe.current;_e&&document.contains(_e)&&_e.focus()}},[]),c.useEffect(()=>{var ae;y!=="fade"&&(pe.current=((ae=m[E])==null?void 0:ae.entryIndex)??0,He(),J(null),v(!1),f(void 0),j(void 0))},[E,He,m,y]),c.useEffect(()=>{const ae=$e=>{if($e.key==="Escape"){je();return}if($e.key==="ArrowLeft"&&m.length>1){Ge(E-1);return}if($e.key==="ArrowRight"&&m.length>1){Ge(E+1);return}if($e.key==="Tab"&&Y.current){const _e=Y.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),Re=Array.from(_e).filter(tt=>!tt.closest('[aria-hidden="true"]'));if(Re.length===0)return;const ze=Re[0],ht=Re[Re.length-1],Te=document.activeElement;$e.shiftKey?(Te===ze||!Y.current.contains(Te))&&($e.preventDefault(),ht.focus()):(Te===ht||!Y.current.contains(Te))&&($e.preventDefault(),ze.focus())}};return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[Ge,je,E,m.length]),c.useLayoutEffect(()=>{He(),Q.current=0,fe(0),he(null),ge(!1),J(null),v(!1),f(void 0),j(void 0),ce(null),W(ae=>{const $e=Math.max(0,m.length-1);return Math.min(ae,$e)})},[He,t.length,n,m.length]),c.useLayoutEffect(()=>{var ae;Se.current=L,pe.current=((ae=m[L])==null?void 0:ae.entryIndex)??0,W(L)},[L,m.length]);const Ee=ee!==null?t[ee]:null,Je=U!==null?m[U]:null,ct=!!(C!=null&&C.title1||C!=null&&C.title2||C!=null&&C.title3||Ee!=null&&Ee.title1||Ee!=null&&Ee.title2||Ee!=null&&Ee.title3),pt=Mp(n,m,t),rt=!!I,X={gap:R},re=pt&&rt?{gap:w}:void 0,se=(ae,$e,_e=!1)=>{const Re=qr($e),ze=`calc(-0.5 * (${Re} + ${$e}))`;return r.jsx("div",{"data-controls":ae,"data-controls-axis":"x",..._e?{"data-controls-reverse":"true"}:void 0,style:{position:"absolute",top:0,right:ze,width:Re,height:"100%",pointerEvents:"auto",zIndex:3}})},Ce=(ae,$e=!1)=>{if(!ae)return null;const _e=[ae.title1?{className:`${e}-title1`,style:$,text:ae.title1}:null,ae.title2?{className:`${e}-title2`,style:N,text:ae.title2}:null,ae.title3?{className:`${e}-title3`,style:_,text:ae.title3}:null].filter(Re=>Re!==null);return _e.map((Re,ze)=>r.jsxs("div",{className:`${e}-title-cell`,children:[r.jsx("p",{className:Re.className,style:{...Re.style,maxWidth:h},children:Re.text}),$e&&K&&ze<_e.length-1?se("titlesGap",R):null]},Re.className))},me=ae=>{const $e=!ae.objectFit&&Vt(i);return{className:`${e}-slide-image-cell${$e?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:s,maxHeight:d,...$e?{"--image-aspect-ratio":qi(i)}:{}}}},Oe=ae=>ae.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":ae.objectFit}}:Vt(i)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Ve=ae=>{if(ae.length===0)return null;const $e=ae.length>1,_e=qr(l),Re=`calc(-0.5 * (${_e} + ${l}))`;if(ae.length===1){const ze=ae[0];return r.jsx("div",{...me(ze),children:r.jsx("img",{...Oe(ze),src:ze.url,alt:ze.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:$e?{gap:l}:void 0,children:ae.map((ze,ht)=>r.jsxs("div",{...me(ze),children:[r.jsx("img",{...Oe(ze),src:ze.url,alt:ze.name??"",draggable:!1}),K&&$e&&ht<ae.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Re,width:_e,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ze.url}-${ht}`))})};return r.jsxs("div",{ref:Y,"data-selection":"none",className:`${e}-lightbox${a?` ${e}-lightbox-editor`:""}${u?` ${e}-lightbox-edit-mode`:""}`,onClick:je,role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:rt?void 0:-1,style:{opacity:V?1:0,transition:`opacity ${Dr}ms ease`,pointerEvents:V?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:o}}),r.jsx("div",{className:`${e}-lightbox-content`,onClick:ae=>ae.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":Z&&m.length>1?"true":"false",onPointerUp:Z?Ye:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Je&&ue?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:ae=>{ae.target===ae.currentTarget&&Be(ie)},children:r.jsx("div",{className:`${e}-slide-area`,children:Ve(Je.images)})},`slide-out-${ie}`):null,r.jsx("div",{className:`${e}-slide-layer-in${ue?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:A?Ve(A.images):null})},`slide-in-${ie}-${E}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-chrome`,style:{width:"100%",height:"100%"},children:[r.jsx("div",{"data-controls":K?"contentMarginTop":void 0,className:K?`${e}-control`:void 0,style:{height:S,width:"100%"}}),r.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%"},children:[r.jsx("div",{"data-controls":K?"contentMarginLeft":void 0,"data-controls-axis":K?"x":void 0,className:K?`${e}-control`:void 0,style:{width:P,flexShrink:0}}),r.jsxs("div",{className:`${e}-lightbox-content-area`,children:[ct&&r.jsx("div",{className:`${e}-text-bar-cell`,children:r.jsx("div",{className:`${e}-titles-row`,style:X,children:y==="fade"?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:O,className:`${e}-titles-stack`,style:{...X,position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Ce(te||C,!1)}),r.jsxs("div",{ref:de,className:`${e}-titles-stack`,style:{...X,...ye&&G?{minHeight:G}:void 0,...ye&&H?{width:H,maxWidth:"100%"}:void 0,...ye?{overflow:"hidden"}:void 0},children:[Ee&&ye?r.jsx("div",{className:`${e}-titles-layer-out ${e}-titles-fade-out`,style:X,children:Ce(Ee)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ye?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,style:X,children:Ce(C,!0)})]})]}):Ce(C,!0)})}),r.jsxs("div",{className:`${e}-lightbox-persistent-controls`,style:re,children:[pt&&r.jsxs("div",{className:`${e}-text-bar-cell`,children:[r.jsx("span",{className:`${e}-entry-counter`,style:M,"aria-live":"polite","aria-atomic":"true",children:Ap(m,E,n,t)}),K&&rt?se("countCloseGap",w,!0):null]}),rt&&r.jsx("div",{className:`${e}-close-icon`,style:{width:T.scalingValue(x??0,a),height:T.scalingValue(x??0,a),"--close-icon-hover-color":g},children:r.jsx("button",{ref:we,type:"button",className:`${e}-close-icon-inner`,onClick:je,"aria-label":"Close",children:r.jsx(At,{url:I??"",fill:b,hoverFill:g,className:`${e}-close-icon-img`})})})]})]}),r.jsx("div",{"data-controls":K?"contentMarginRight":void 0,"data-controls-axis":K?"x":void 0,"data-controls-reverse":K?"":void 0,className:K?`${e}-control`:void 0,style:{width:k,flexShrink:0}})]})]})]})},ri=["title1","title2","title3","count"];function Ue(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const Fp={title1:"1",title2:"2",title3:"3",count:"Count"};function Wp(e){return[Ue(e,"fontFamily"),Ue(e,"fontSettings"),{type:"row",items:[Ue(e,"fontSize"),Ue(e,"lineHeight"),Ue(e,"letterSpacing"),Ue(e,"wordSpacing")]},Ue(e,"textAlign"),Ue(e,"textAppearance")]}function Np(){return{type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(ri.map(e=>[Fp[e],Wp(e)]))}}const Hp={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Bp={title1:.02,title2:.02,title3:.02,count:.017};function vi(e,t){const n=i=>{const o=Ue(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[Hp[t]]}}function bi(e,t,n){var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??Bp[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return ut(i,n)}const Op=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l})=>{const{prefix:s}=T.useScopedStyles(),{cover:d,coverFit:a,type:u,backgroundColor:p,imageGap:I,maxWidth:x,maxHeight:b,textMaxWidth:g,textTransition:h,titlesGap:R,countCloseGap:w,closeIcon:y,closeIconMaxWidth:$,closeIconColor:N,closeIconHoverColor:_,contentMarginTop:M,contentMarginLeft:S,contentMarginRight:P}=e,k=U=>T.scalingValue(U,n??!1),L=bi("title1",vi(e,"title1"),n),F=bi("title2",vi(e,"title2"),n),B=bi("title3",vi(e,"title3"),n),z=bi("count",vi(e,"count"),n),K=c.useRef(null),[Z,m]=c.useState(!1),[E,W]=c.useState(0),A=c.useRef(!1),C=c.useRef(!1),V=c.useRef(!1),q=c.useMemo(()=>(t??[]).filter(U=>Pn(U).length>0),[t]),ee=!n||!!o,J=c.useCallback(()=>{ee&&(V.current=!0,Lp(C.current),C.current=!1)},[ee]),ye=(U=0)=>{if(i||q.length===0)return;const he=Ei(q,u),ue=Math.max(0,Math.min(U,he.length-1));if(W(ue),ee){const ge=Va();za(ue+1,ge),C.current=!ge}m(!0)},v=c.useCallback(()=>{m(!1),V.current=!1},[]);return c.useEffect(()=>{if(!ee||A.current)return;A.current=!0;const U=Kr();if(!U)return;const he=Ur(U,Ei(q,u).length);he<0||(W(he),m(!0))},[q,ee,u]),c.useEffect(()=>{if(!ee)return;const U=()=>{if(V.current){V.current=!1,m(!1);return}const he=Kr();if(!he){m(!1);return}const ue=Ur(he,Ei(q,u).length);if(ue<0){m(!1);return}C.current=!1,W(ue),m(!0)};return window.addEventListener("popstate",U),()=>window.removeEventListener("popstate",U)},[q,ee,u]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:K,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ep(s)}}),d?r.jsx("button",{type:"button",className:`${s}-cover ${Vt(a)?`${s}-ratio-wrapper-cover`:`${s}-ratio-wrapper-fit`}`,onClick:()=>ye(),style:{display:"block",padding:0,border:"none",background:"transparent",...Vt(a)?{"--image-aspect-ratio":qi(a)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${s}-cover-image ${Vt(a)?`${s}-cover-image-cover`:`${s}-cover-image-fit`}`,src:d,alt:"cover"})}):null]}),Z&&typeof document<"u"&&(()=>{const U=(l?document.getElementById(l):null)??document.body;return Xn.createPortal(r.jsx(kp,{prefix:s,entries:q,journalType:u,coverFit:a,backgroundColor:p,imageGap:k(I??0),slideMaxWidth:`${x}%`,slideMaxHeight:`${b}%`,textMaxWidth:k(g??.4),titlesGap:k(R??0),countCloseGap:k(w??0),textTransition:h,title1Style:L,title2Style:F,title3Style:B,countStyle:z,contentMarginTop:k(M??0),contentMarginLeft:k(S??0),contentMarginRight:k(P??0),closeIcon:y,closeIconMaxWidth:$,closeIconColor:N,closeIconHoverColor:_,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:E,enableUrlSync:ee,onBeforeClose:J,onClose:v}),U)})()]})},jp=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
10621
|
+
`}const Ip=20,Rp=2,qr=e=>`max(${e}, ${Ip}px)`,Pn=e=>((e==null?void 0:e.image)??[]).slice(0,Rp),Da=e=>e.reduce((t,n)=>t+Pn(n).length,0),Pp=(e,t)=>{let n=1;for(let o=0;o<t;o++)n+=Pn(e[o]).length;const i=Pn(e[t]).length;return{start:n,end:n+i-1}},_p=(e,t)=>{const n=Da(e),{start:i,end:o}=Pp(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Ei=(e,t)=>t==="B"?e.flatMap((n,i)=>Pn(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Pn(n)})),Ap=(e,t,n,i)=>{var l;if(n==="B")return`${t+1} / ${e.length}`;const o=((l=e[t])==null?void 0:l.entryIndex)??0;return _p(i,o)},Xr=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Mp=(e,t,n)=>e==="B"?t.length>1:Da(n)>1,kp=({prefix:e,entries:t,journalType:n,coverFit:i,backgroundColor:o,imageGap:l,slideMaxWidth:s,slideMaxHeight:d,isEditor:a,isEditMode:u,isPreviewMode:p,closeIcon:I,closeIconMaxWidth:S,closeIconColor:v,closeIconHoverColor:g,textMaxWidth:h,titlesGap:R,countCloseGap:T,textTransition:y,title1Style:w,title2Style:N,title3Style:_,countStyle:W,contentMarginTop:C,contentMarginLeft:P,contentMarginRight:A,initialSlideIndex:E=0,enableUrlSync:k=!1,onBeforeClose:B,onClose:V})=>{const K=!!u,ee=!a||!!p,m=c.useMemo(()=>Ei(t,n),[t,n]),[b,F]=c.useState(E),M=m[b],$=M==null?void 0:M.entry,[O,U]=c.useState(!1),[te,Y]=c.useState(null),[fe,x]=c.useState(!1),[q,he]=c.useState(null),[pe,be]=c.useState(!1),[J,me]=c.useState(0),[G,f]=c.useState(),[H,j]=c.useState(),[ne,de]=c.useState(null),oe=c.useRef(null),ie=c.useRef(0),ge=c.useRef(0),ve=c.useRef(0),Se=c.useRef(!1),D=c.useRef(null),ue=c.useRef(null),z=c.useRef(null),X=c.useRef(null),Ce=c.useRef(null),_e=c.useRef(null),Ze=c.useCallback(()=>{const ae=ue.current;if(!ae)return;const $e=ae.closest(`.${e}-lightbox-content-area`);if(!$e)return ae.getBoundingClientRect().width;let Ie=0;return Array.from($e.children).forEach(Re=>{Re instanceof HTMLElement&&(Re.contains(ae)||(Ie+=Re.getBoundingClientRect().width))}),$e.getBoundingClientRect().width-Ie},[e]),We=c.useCallback(()=>{oe.current&&(clearTimeout(oe.current),oe.current=null)},[]),ze=c.useCallback(ae=>{ae===ie.current&&(he(null),be(!1))},[]),Ne=c.useCallback(()=>{u||Se.current||(Se.current=!0,B==null||B(),U(!1),D.current=setTimeout(()=>{V()},Dr))},[u,B,V]),Me=c.useCallback(ae=>{k&&za(ae+1,!0)},[k]),qe=c.useCallback(ae=>{var dt,tn;if(m.length===0)return;const $e=(ae%m.length+m.length)%m.length;if($e===b)return;const Ie=m[b],Re=m[$e];ie.current+=1;const je=ie.current,ht=y==="fade"&&Xr(Ie==null?void 0:Ie.entry)!==Xr(Re==null?void 0:Re.entry),we=(dt=ue.current)==null?void 0:dt.getBoundingClientRect().height;let et,Ye;ht&&(Ye=Ze(),Xn.flushSync(()=>{de(Re.entry)}),z.current&&Ye&&(z.current.style.width=`${Ye}px`),et=(tn=z.current)==null?void 0:tn.getBoundingClientRect().height,z.current&&(z.current.style.width=""));const Je=Math.max(we??0,et??0)||void 0;me(je),he(b),be(!0),F($e),Me($e),ve.current=$e,ht?(We(),Je&&f(Je),Ye&&j(Ye),Y((Ie==null?void 0:Ie.entryIndex)??null),x(!0),ge.current=Re.entryIndex,oe.current=setTimeout(()=>{Y(null),x(!1),f(void 0),j(void 0),de(null),oe.current=null},wo)):(We(),Y(null),x(!1),f(void 0),j(void 0),de(null),ge.current=Re.entryIndex)},[b,We,Ze,m,Me,y]),Xe=ae=>{var je;if(!ee||m.length<=1||ae.button!==0&&ae.pointerType==="mouse"||ae.target.closest("[data-controls]"))return;const Ie=(je=X.current)==null?void 0:je.getBoundingClientRect(),Re=Ie?Ie.left+Ie.width/2:window.innerWidth/2;ae.clientX<Re?qe(b-1):qe(b+1)};c.useEffect(()=>{_e.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const ae=requestAnimationFrame(()=>{U(!0),requestAnimationFrame(()=>{Ce.current?Ce.current.focus():X.current&&X.current.focus()})}),$e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{cancelAnimationFrame(ae),document.body.style.overflow=$e,D.current&&clearTimeout(D.current),oe.current&&clearTimeout(oe.current);const Ie=_e.current;Ie&&document.contains(Ie)&&Ie.focus()}},[]),c.useEffect(()=>{var ae;y!=="fade"&&(ge.current=((ae=m[b])==null?void 0:ae.entryIndex)??0,We(),Y(null),x(!1),f(void 0),j(void 0))},[b,We,m,y]),c.useEffect(()=>{const ae=$e=>{if($e.key==="Escape"){Ne();return}if($e.key==="ArrowLeft"&&m.length>1){qe(b-1);return}if($e.key==="ArrowRight"&&m.length>1){qe(b+1);return}if($e.key==="Tab"&&X.current){const Ie=X.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),Re=Array.from(Ie).filter(et=>!et.closest('[aria-hidden="true"]'));if(Re.length===0)return;const je=Re[0],ht=Re[Re.length-1],we=document.activeElement;$e.shiftKey?(we===je||!X.current.contains(we))&&($e.preventDefault(),ht.focus()):(we===ht||!X.current.contains(we))&&($e.preventDefault(),je.focus())}};return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[qe,Ne,b,m.length]),c.useLayoutEffect(()=>{We(),ie.current=0,me(0),he(null),be(!1),Y(null),x(!1),f(void 0),j(void 0),de(null),F(ae=>{const $e=Math.max(0,m.length-1);return Math.min(ae,$e)})},[We,t.length,n,m.length]),c.useLayoutEffect(()=>{var ae;ve.current=E,ge.current=((ae=m[E])==null?void 0:ae.entryIndex)??0,F(E)},[E,m.length]);const Pe=te!==null?t[te]:null,Ve=q!==null?m[q]:null,ct=!!($!=null&&$.title1||$!=null&&$.title2||$!=null&&$.title3||Pe!=null&&Pe.title1||Pe!=null&&Pe.title2||Pe!=null&&Pe.title3),pt=Mp(n,m,t),rt=!!I,ot={gap:R},Z=pt&&rt?{gap:T}:void 0,Q=(ae,$e,Ie=!1)=>{const Re=qr($e),je=`calc(-0.5 * (${Re} + ${$e}))`;return r.jsx("div",{"data-controls":ae,"data-controls-axis":"x",...Ie?{"data-controls-reverse":"true"}:void 0,style:{position:"absolute",top:0,right:je,width:Re,height:"100%",pointerEvents:"auto",zIndex:3}})},ce=(ae,$e=!1)=>{if(!ae)return null;const Ie=[ae.title1?{className:`${e}-title1`,style:w,text:ae.title1}:null,ae.title2?{className:`${e}-title2`,style:N,text:ae.title2}:null,ae.title3?{className:`${e}-title3`,style:_,text:ae.title3}:null].filter(Re=>Re!==null);return Ie.map((Re,je)=>r.jsxs("div",{className:`${e}-title-cell`,children:[r.jsx("p",{className:Re.className,style:{...Re.style,maxWidth:h},children:Re.text}),$e&&K&&je<Ie.length-1?Q("titlesGap",R):null]},Re.className))},se=ae=>{const $e=!ae.objectFit&&Vt(i);return{className:`${e}-slide-image-cell${$e?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:s,maxHeight:d,...$e?{"--image-aspect-ratio":qi(i)}:{}}}},Le=ae=>ae.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":ae.objectFit}}:Vt(i)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Oe=ae=>{if(ae.length===0)return null;const $e=ae.length>1,Ie=qr(l),Re=`calc(-0.5 * (${Ie} + ${l}))`;if(ae.length===1){const je=ae[0];return r.jsx("div",{...se(je),children:r.jsx("img",{...Le(je),src:je.url,alt:je.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:$e?{gap:l}:void 0,children:ae.map((je,ht)=>r.jsxs("div",{...se(je),children:[r.jsx("img",{...Le(je),src:je.url,alt:je.name??"",draggable:!1}),K&&$e&&ht<ae.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Re,width:Ie,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${je.url}-${ht}`))})};return r.jsxs("div",{ref:X,"data-selection":"none",className:`${e}-lightbox${a?` ${e}-lightbox-editor`:""}${u?` ${e}-lightbox-edit-mode`:""}`,onClick:Ne,role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:rt?void 0:-1,style:{opacity:O?1:0,transition:`opacity ${Dr}ms ease`,pointerEvents:O?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:o}}),r.jsx("div",{className:`${e}-lightbox-content`,onClick:ae=>ae.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ee&&m.length>1?"true":"false",onPointerUp:ee?Xe:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Ve&&pe?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:ae=>{ae.target===ae.currentTarget&&ze(J)},children:r.jsx("div",{className:`${e}-slide-area`,children:Oe(Ve.images)})},`slide-out-${J}`):null,r.jsx("div",{className:`${e}-slide-layer-in${pe?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:M?Oe(M.images):null})},`slide-in-${J}-${b}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-chrome`,style:{width:"100%",height:"100%"},children:[r.jsx("div",{"data-controls":K?"contentMarginTop":void 0,className:K?`${e}-control`:void 0,style:{height:C,width:"100%"}}),r.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%"},children:[r.jsx("div",{"data-controls":K?"contentMarginLeft":void 0,"data-controls-axis":K?"x":void 0,className:K?`${e}-control`:void 0,style:{width:P,flexShrink:0}}),r.jsxs("div",{className:`${e}-lightbox-content-area`,children:[ct&&r.jsx("div",{className:`${e}-text-bar-cell`,children:r.jsx("div",{className:`${e}-titles-row`,style:ot,children:y==="fade"?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:z,className:`${e}-titles-stack`,style:{...ot,position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ce(ne||$,!1)}),r.jsxs("div",{ref:ue,className:`${e}-titles-stack`,style:{...ot,...fe&&G?{minHeight:G}:void 0,...fe&&H?{width:H,maxWidth:"100%"}:void 0,...fe?{overflow:"hidden"}:void 0},children:[Pe&&fe?r.jsx("div",{className:`${e}-titles-layer-out ${e}-titles-fade-out`,style:ot,children:ce(Pe)}):null,r.jsx("div",{className:`${e}-titles-layer-in${fe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,style:ot,children:ce($,!0)})]})]}):ce($,!0)})}),r.jsxs("div",{className:`${e}-lightbox-persistent-controls`,style:Z,children:[pt&&r.jsxs("div",{className:`${e}-text-bar-cell`,children:[r.jsx("span",{className:`${e}-entry-counter`,style:W,"aria-live":"polite","aria-atomic":"true",children:Ap(m,b,n,t)}),K&&rt?Q("countCloseGap",T,!0):null]}),rt&&r.jsx("div",{className:`${e}-close-icon`,style:{width:L.scalingValue(S??0,a),height:L.scalingValue(S??0,a),"--close-icon-hover-color":g},children:r.jsx("button",{ref:Ce,type:"button",className:`${e}-close-icon-inner`,onClick:Ne,"aria-label":"Close",children:r.jsx(At,{url:I??"",fill:v,hoverFill:g,className:`${e}-close-icon-img`})})})]})]}),r.jsx("div",{"data-controls":K?"contentMarginRight":void 0,"data-controls-axis":K?"x":void 0,"data-controls-reverse":K?"":void 0,className:K?`${e}-control`:void 0,style:{width:A,flexShrink:0}})]})]})]})},ri=["title1","title2","title3","count"];function Ke(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const Fp={title1:"1",title2:"2",title3:"3",count:"Count"};function Wp(e){return[Ke(e,"fontFamily"),Ke(e,"fontSettings"),{type:"row",items:[Ke(e,"fontSize"),Ke(e,"lineHeight"),Ke(e,"letterSpacing"),Ke(e,"wordSpacing")]},Ke(e,"textAlign"),Ke(e,"textAppearance")]}function Np(){return{type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(ri.map(e=>[Fp[e],Wp(e)]))}}const Hp={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Bp={title1:.02,title2:.02,title3:.02,count:.017};function vi(e,t){const n=i=>{const o=Ke(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[Hp[t]]}}function bi(e,t,n){var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??Bp[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return ut(i,n)}const Op=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l})=>{const{prefix:s}=L.useScopedStyles(),{cover:d,coverFit:a,type:u,backgroundColor:p,imageGap:I,maxWidth:S,maxHeight:v,textMaxWidth:g,textTransition:h,titlesGap:R,countCloseGap:T,closeIcon:y,closeIconMaxWidth:w,closeIconColor:N,closeIconHoverColor:_,contentMarginTop:W,contentMarginLeft:C,contentMarginRight:P}=e,A=q=>L.scalingValue(q,n??!1),E=bi("title1",vi(e,"title1"),n),k=bi("title2",vi(e,"title2"),n),B=bi("title3",vi(e,"title3"),n),V=bi("count",vi(e,"count"),n),K=c.useRef(null),[ee,m]=c.useState(!1),[b,F]=c.useState(0),M=c.useRef(!1),$=c.useRef(!1),O=c.useRef(!1),U=c.useMemo(()=>(t??[]).filter(q=>Pn(q).length>0),[t]),te=!n||!!o,Y=c.useCallback(()=>{te&&(O.current=!0,Lp($.current),$.current=!1)},[te]),fe=(q=0)=>{if(i||U.length===0)return;const he=Ei(U,u),pe=Math.max(0,Math.min(q,he.length-1));if(F(pe),te){const be=Va();za(pe+1,be),$.current=!be}m(!0)},x=c.useCallback(()=>{m(!1),O.current=!1},[]);return c.useEffect(()=>{if(!te||M.current)return;M.current=!0;const q=Kr();if(!q)return;const he=Ur(q,Ei(U,u).length);he<0||(F(he),m(!0))},[U,te,u]),c.useEffect(()=>{if(!te)return;const q=()=>{if(O.current){O.current=!1,m(!1);return}const he=Kr();if(!he){m(!1);return}const pe=Ur(he,Ei(U,u).length);if(pe<0){m(!1);return}$.current=!1,F(pe),m(!0)};return window.addEventListener("popstate",q),()=>window.removeEventListener("popstate",q)},[U,te,u]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:K,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ep(s)}}),d?r.jsx("button",{type:"button",className:`${s}-cover ${Vt(a)?`${s}-ratio-wrapper-cover`:`${s}-ratio-wrapper-fit`}`,onClick:()=>fe(),style:{display:"block",padding:0,border:"none",background:"transparent",...Vt(a)?{"--image-aspect-ratio":qi(a)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${s}-cover-image ${Vt(a)?`${s}-cover-image-cover`:`${s}-cover-image-fit`}`,src:d,alt:"cover"})}):null]}),ee&&typeof document<"u"&&(()=>{const q=(l?document.getElementById(l):null)??document.body;return Xn.createPortal(r.jsx(kp,{prefix:s,entries:U,journalType:u,coverFit:a,backgroundColor:p,imageGap:A(I??0),slideMaxWidth:`${S}%`,slideMaxHeight:`${v}%`,textMaxWidth:A(g??.4),titlesGap:A(R??0),countCloseGap:A(T??0),textTransition:h,title1Style:E,title2Style:k,title3Style:B,countStyle:V,contentMarginTop:A(W??0),contentMarginLeft:A(C??0),contentMarginRight:A(P??0),closeIcon:y,closeIconMaxWidth:w,closeIconColor:N,closeIconHoverColor:_,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:b,enableUrlSync:te,onBeforeClose:Y,onClose:x}),q)})()]})},jp=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
10619
10622
|
import { createPortal, flushSync } from 'react-dom';
|
|
10620
10623
|
import { CommonComponentProps } from '../props';
|
|
10621
10624
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -12204,4 +12207,4 @@ export type LightboxJournalSettings = {
|
|
|
12204
12207
|
closeIconColor: string;
|
|
12205
12208
|
closeIconHoverColor: string;
|
|
12206
12209
|
};
|
|
12207
|
-
`,zp="https://cdn.cntrl.site/component-assets/Close.svg",ln={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 Vp(e){const t={};return t[
|
|
12210
|
+
`,zp="https://cdn.cntrl.site/component-assets/Close.svg",ln={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 Vp(e){const t={};return t[Ke(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ke(e,"fontSettings")]={...ln.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ke(e,"fontSize")]={...ln.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ke(e,"lineHeight")]={...ln.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ke(e,"letterSpacing")]={...ln.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ke(e,"wordSpacing")]={...ln.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ke(e,"textAlign")]={...ln.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ke(e,"textAppearance")]={...ln.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Dp=ri.reduce((e,t)=>({...e,...Vp(t)}),{}),Gp=ri.reduce((e,t)=>({...e,[Ke(t,"fontFamily")]:"Arial",[Ke(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ke(t,"letterSpacing")]:0,[Ke(t,"wordSpacing")]:0,[Ke(t,"textAlign")]:"left",[Ke(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Yr(e){return ri.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ke(n,"fontSize")]=i),o!==void 0&&(t[Ke(n,"lineHeight")]=o),t},{})}const Kp=Np(),Up={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:"common",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,max:200,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"layout",title:"BG",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:"Fill Icon",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Hover Icon",display:{type:"settings-color-picker"}},textMaxWidth:{type:"string",scope:"common",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},titlesGap:{type:"number",scope:"layout",title:"Titles Gap",min:0,max:200,display:{type:"range-control"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,max:200,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title 1",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Title 2",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Title 3",display:{type:"palette-color-picker"}},countColor:{type:"string",scope:"common",title:"Count",display:{type:"palette-color-picker"}},...Dp,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,max:200,display:{type:"range-control"}},contentMarginLeft:{type:"number",scope:"layout",title:"Content margin left",min:0,max:200,display:{type:"range-control"}},contentMarginRight:{type:"number",scope:"layout",title:"Content margin right",min:0,max:200,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/LightboxJournal_1.jpg",coverFit:{display:"Cover",ratioValue:"16:9",reversed:!1},type:"A",closeIcon:zp,closeIconColor:"#ffffff",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#ffffff",title2Color:"#ffffff",title3Color:"#ffffff",countColor:"rgba(255, 255, 255, 0.7)",...Gp},layoutDefaults:{m:{imageGap:0,maxHeight:80,maxWidth:80,textMaxWidth:.4,closeIconMaxWidth:.02,backgroundColor:"rgba(28, 31, 34, 0.9)",contentMarginTop:.02,contentMarginLeft:.02,contentMarginRight:.02,titlesGap:.1,countCloseGap:.02,...Yr({title1FontSize:.03,title1LineHeight:.03,title2FontSize:.03,title2LineHeight:.03,title3FontSize:.03,title3LineHeight:.03,countFontSize:.03,countLineHeight:.03})},d:{maxHeight:80,maxWidth:80,imageGap:0,textMaxWidth:.4,closeIconMaxWidth:.015,backgroundColor:"rgba(28, 31, 34, 0.9)",contentMarginTop:.01,contentMarginLeft:.01,contentMarginRight:.01,titlesGap:.1,countCloseGap:.02,...Yr({title1FontSize:.01,title1LineHeight:.01,title2FontSize:.01,title2LineHeight:.01,title3FontSize:.01,title3LineHeight:.01,countFontSize:.01,countLineHeight:.01})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","titlesGap","countCloseGap","contentMarginTop","contentMarginLeft","contentMarginRight"]},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:["textMaxWidth","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:[Kp]}],paletteBookmark:{items:["backgroundColor","title1Color","title2Color","title3Color","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{title1:{type:"string",label:"Title 1",placeholder:"Add Title 1...",display:{type:"text-input"}},title2:{type:"string",label:"Title 2",placeholder:"Add Title 2...",display:{type:"text-input"}},title3:{type:"string",label:"Title 3",placeholder:"Add Title 3...",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:"Journal Entry 1",title2:"summer vacation",title3:"July 1978",image:[{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_1.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_2.jpg",name:"",objectFit:"contain"}]},{title1:"Journal Entry 2",title2:"spring break",title3:"March 1979",image:[{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_3.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_4.jpg",name:"",objectFit:"contain"}]},{title1:"Journal Entry 3",title2:"winter vacation",title3:"January 1980",image:[{url:"https://cdn.cntrl.site/component-assets/LightboxStrip_5.jpg",name:"",objectFit:"contain"}]}]}},qp={element:Op,id:"lightbox-journal",name:"Lightbox 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:Up,sourceCode:jp,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:ri.map(e=>({path:`styles.${Ke(e,"fontSettings")}`}))}},Xp=[ic,dc,Zc,$p,qp,ld,yd,Rd,kd,jd,Qd,tp];exports.components=Xp;exports.isSchemaV1=qa;
|