@cntrl-site/components 1.0.16-alpha.3 → 1.0.16-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("react"),De=require("classnames"),E=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),ei=require("react-dom");function is(e){return e.type==="object"&&e.version===1}const os="ControlSlider-module__wrapper___sHEkd",rs="ControlSlider-module__hoverArrow___A-dOH",as="ControlSlider-module__sliderItem___QQSkR",ss="ControlSlider-module__sliderImage___9hRl-",ls="ControlSlider-module__arrow___05ghY",cs="ControlSlider-module__arrowVertical___tBfVN",ds="ControlSlider-module__nextArrow___-30Yc",us="ControlSlider-module__arrowInner___aEra3",ps="ControlSlider-module__arrowIcon___S4ztF",ms="ControlSlider-module__arrowImg___2dwJW",gs="ControlSlider-module__mirror___brd6U",hs="ControlSlider-module__pagination___bicLF",fs="ControlSlider-module__paginationInner___bT-P-",ys="ControlSlider-module__paginationVertical___zYqKw",vs="ControlSlider-module__paginationItem___nTRbk",bs="ControlSlider-module__dot___p1Qun",xs="ControlSlider-module__activeDot___LHFaj",Ss="ControlSlider-module__paginationInsideBottom___R3FWn",Cs="ControlSlider-module__paginationInsideTop___V-qb-",$s="ControlSlider-module__paginationOutsideBottom___14w8D",ws="ControlSlider-module__paginationOutsideTop___SCLqB",Ts="ControlSlider-module__paginationInsideLeft___yOBRZ",Ls="ControlSlider-module__paginationInsideRight___Rtt3o",Es="ControlSlider-module__paginationOutsideLeft___lahaw",Is="ControlSlider-module__paginationOutsideRight___EtuQa",Rs="ControlSlider-module__imgWrapper___UjEgB",Ps="ControlSlider-module__captionBlock___dJ6-j",_s="ControlSlider-module__captionTextWrapper___HFlpf",As="ControlSlider-module__captionText___uGBVc",Ms="ControlSlider-module__active___WZK4G",ks="ControlSlider-module__withPointerEvents___t-18M",Fs="ControlSlider-module__topLeftAlignment___zjnGM",Ws="ControlSlider-module__topCenterAlignment___gD1xW",Ns="ControlSlider-module__topRightAlignment___NMapS",Hs="ControlSlider-module__middleLeftAlignment___OnUrY",Bs="ControlSlider-module__middleCenterAlignment___Tdkl0",Os="ControlSlider-module__middleRightAlignment___wEbfX",js="ControlSlider-module__bottomLeftAlignment___cTP2-",Ds="ControlSlider-module__bottomCenterAlignment___c54fB",zs="ControlSlider-module__bottomRightAlignment___kEwrz",Vs="ControlSlider-module__clickOverlay___DZA28",Gs="ControlSlider-module__contain___pLyq7",Us="ControlSlider-module__cover___KdDat",ye={wrapper:os,hoverArrow:rs,sliderItem:as,sliderImage:ss,arrow:ls,arrowVertical:cs,nextArrow:ds,arrowInner:us,arrowIcon:ps,arrowImg:ms,mirror:gs,pagination:hs,paginationInner:fs,paginationVertical:ys,paginationItem:vs,dot:bs,activeDot:xs,paginationInsideBottom:Ss,paginationInsideTop:Cs,paginationOutsideBottom:$s,paginationOutsideTop:ws,paginationInsideLeft:Ts,paginationInsideRight:Ls,paginationOutsideLeft:Es,paginationOutsideRight:Is,imgWrapper:Rs,captionBlock:Ps,captionTextWrapper:_s,captionText:As,active:Ms,withPointerEvents:ks,topLeftAlignment:Fs,topCenterAlignment:Ws,topRightAlignment:Ns,middleLeftAlignment:Hs,middleCenterAlignment:Bs,middleRightAlignment:Os,bottomLeftAlignment:js,bottomCenterAlignment:Ds,bottomRightAlignment:zs,clickOverlay:Vs,contain:Gs,cover:Us};function Ks(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 qs(e,t,n){return t&&Ks(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ar="(prefers-reduced-motion: reduce)",Tn=1,Xs=2,In=3,Fn=4,ti=5,Ci=6,_i=7,Ys={CREATED:Tn,MOUNTED:Xs,IDLE:In,MOVING:Fn,SCROLLING:ti,DRAGGING:Ci,DESTROYED:_i};function Yt(e){e.length=0}function rn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ze(e){return e.bind.apply(e,[null].concat(rn(arguments,1)))}var ra=setTimeout,fo=function(){};function sr(e){return requestAnimationFrame(e)}function Ni(e,t){return typeof t===e}function zn(e){return!Ro(e)&&Ni("object",e)}var Io=Array.isArray,aa=Ze(Ni,"function"),tn=Ze(Ni,"string"),ni=Ze(Ni,"undefined");function Ro(e){return e===null}function sa(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function ii(e){return Io(e)?e:[e]}function Mt(e,t){ii(e).forEach(t)}function Po(e,t){return e.indexOf(t)>-1}function $i(e,t){return e.push.apply(e,ii(t)),e}function Gt(e,t,n){e&&Mt(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Bt(e,t){Gt(e,tn(t)?t.split(" "):t,!0)}function oi(e,t){Mt(t,e.appendChild.bind(e))}function _o(e,t){Mt(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Vn(e,t){return sa(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function la(e,t){var n=e?rn(e.children):[];return t?n.filter(function(i){return Vn(i,t)}):n}function ri(e,t){return t?la(e,t)[0]:e.firstElementChild}var Gn=Object.keys;function gn(e,t,n){return e&&(n?Gn(e).reverse():Gn(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Un(e){return rn(arguments,1).forEach(function(t){gn(t,function(n,i){e[i]=t[i]})}),e}function en(e){return rn(arguments,1).forEach(function(t){gn(t,function(n,i){Io(n)?e[i]=n.slice():zn(n)?e[i]=en({},zn(e[i])?e[i]:{},n):e[i]=n})}),e}function lr(e,t){Mt(t||Gn(e),function(n){delete e[n]})}function Ot(e,t){Mt(e,function(n){Mt(t,function(i){n&&n.removeAttribute(i)})})}function Ae(e,t,n){zn(t)?gn(t,function(i,o){Ae(e,o,i)}):Mt(e,function(i){Ro(n)||n===""?Ot(i,t):i.setAttribute(t,String(n))})}function Ln(e,t,n){var i=document.createElement(e);return t&&(tn(t)?Bt(i,t):Ae(i,t)),n&&oi(n,i),i}function kt(e,t,n){if(ni(n))return getComputedStyle(e)[t];Ro(n)||(e.style[t]=""+n)}function Kn(e,t){kt(e,"display",t)}function ca(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Ft(e,t){return e.getAttribute(t)}function cr(e,t){return e&&e.classList.contains(t)}function Pt(e){return e.getBoundingClientRect()}function hn(e){Mt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function da(e){return ri(new DOMParser().parseFromString(e,"text/html").body)}function Vt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ua(e,t){return e&&e.querySelector(t)}function Ao(e,t){return t?rn(e.querySelectorAll(t)):[]}function Ut(e,t){Gt(e,t,!1)}function yo(e){return e.timeStamp}function cn(e){return tn(e)?e:e?e+"px":""}var ai="splide",Mo="data-"+ai;function Bn(e,t){if(!e)throw new Error("["+ai+"] "+(t||""))}var nn=Math.min,Ai=Math.max,Mi=Math.floor,qn=Math.ceil,wt=Math.abs;function pa(e,t,n){return wt(e-t)<n}function wi(e,t,n,i){var o=nn(t,n),s=Ai(t,n);return i?o<e&&e<s:o<=e&&e<=s}function Cn(e,t,n){var i=nn(t,n),o=Ai(t,n);return nn(Ai(i,e),o)}function vo(e){return+(e>0)-+(e<0)}function bo(e,t){return Mt(t,function(n){e=e.replace("%s",""+n)}),e}function ko(e){return e<10?"0"+e:""+e}var dr={};function Js(e){return""+e+ko(dr[e]=(dr[e]||0)+1)}function ma(){var e=[];function t(l,d,a,p){o(l,d,function(u,L,C){var y="addEventListener"in u,g=y?u.removeEventListener.bind(u,L,a,p):u.removeListener.bind(u,a);y?u.addEventListener(L,a,p):u.addListener(a),e.push([u,L,C,a,g])})}function n(l,d,a){o(l,d,function(p,u,L){e=e.filter(function(C){return C[0]===p&&C[1]===u&&C[2]===L&&(!a||C[3]===a)?(C[4](),!1):!0})})}function i(l,d,a){var p,u=!0;return typeof CustomEvent=="function"?p=new CustomEvent(d,{bubbles:u,detail:a}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(d,u,!1,a)),l.dispatchEvent(p),p}function o(l,d,a){Mt(l,function(p){p&&Mt(d,function(u){u.split(" ").forEach(function(L){var C=L.split(".");a(p,C[0],C[1])})})})}function s(){e.forEach(function(l){l[4]()}),Yt(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var an="mounted",xo="ready",Jt="move",Wn="moved",Fo="click",ga="active",ha="inactive",fa="visible",ya="hidden",lt="refresh",St="updated",Rn="resize",Hi="resized",va="drag",ba="dragging",xa="dragged",Bi="scroll",yn="scrolled",Zs="overflow",Wo="destroy",Sa="arrows:mounted",Ca="arrows:updated",$a="pagination:mounted",wa="pagination:updated",No="navigation:mounted",Ho="autoplay:play",Ta="autoplay:playing",Bo="autoplay:pause",Oo="lazyload:loaded",La="sk",Ea="sh",ki="ei";function et(e){var t=e?e.event.bus:document.createDocumentFragment(),n=ma();function i(s,l){n.bind(t,ii(s).join(" "),function(d){l.apply(l,Io(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,rn(arguments,1))}return e&&e.event.on(Wo,n.destroy),Un(n,{bus:t,on:i,off:Ze(n.unbind,t),emit:o})}function Oi(e,t,n,i){var o=Date.now,s,l=0,d,a=!0,p=0;function u(){if(!a){if(l=e?nn((o()-s)/e,1):1,n&&n(l),l>=1&&(t(),s=o(),i&&++p>=i))return C();d=sr(u)}}function L($){$||g(),s=o()-($?l*e:0),a=!1,d=sr(u)}function C(){a=!0}function y(){s=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,a=!0}function h($){e=$}function T(){return a}return{start:L,rewind:y,pause:C,cancel:g,set:h,isPaused:T}}function Qs(e){var t=e;function n(o){t=o}function i(o){return Po(ii(o),t)}return{set:n,is:i}}function el(e,t){var n=Oi(0,e,null,1);return function(){n.isPaused()&&n.start()}}function tl(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=ma(),d=[];function a(){var g=n.mediaQuery==="min";Gn(o).sort(function(h,T){return g?+h-+T:+T-+h}).forEach(function(h){u(o[h],"("+(g?"min":"max")+"-width:"+h+"px)")}),u(s,ar),L()}function p(g){g&&l.destroy()}function u(g,h){var T=matchMedia(h);l.bind(T,"change",L),d.push([g,T])}function L(){var g=i.is(_i),h=n.direction,T=d.reduce(function($,x){return en($,x[1].matches?x[0]:{})},{});lr(n),y(T),n.destroy?e.destroy(n.destroy==="completely"):g?(p(!0),e.mount()):h!==n.direction&&e.refresh()}function C(g){matchMedia(ar).matches&&(g?en(n,s):lr(n,Gn(s)))}function y(g,h,T){en(n,g),h&&en(Object.getPrototypeOf(n),g),(T||!i.is(Tn))&&e.emit(St,n)}return{setup:a,destroy:p,reduce:C,set:y}}var ji="Arrow",Di=ji+"Left",zi=ji+"Right",Ia=ji+"Up",Ra=ji+"Down",ur="rtl",Vi="ttb",Qi={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ia,zi],ArrowRight:[Ra,Di]};function nl(e,t,n){function i(s,l,d){d=d||n.direction;var a=d===ur&&!l?1:d===Vi?0:-1;return Qi[s]&&Qi[s][a]||s.replace(/width|left|right/i,function(p,u){var L=Qi[p.toLowerCase()][a]||p;return u>0?L.charAt(0).toUpperCase()+L.slice(1):L})}function o(s){return s*(n.direction===ur?1:-1)}return{resolve:i,orient:o}}var Kt="role",En="tabindex",il="disabled",Wt="aria-",si=Wt+"controls",Pa=Wt+"current",pr=Wt+"selected",_t=Wt+"label",jo=Wt+"labelledby",_a=Wt+"hidden",Do=Wt+"orientation",Xn=Wt+"roledescription",mr=Wt+"live",gr=Wt+"busy",hr=Wt+"atomic",zo=[Kt,En,il,si,Pa,_t,jo,_a,Do,Xn],jt=ai+"__",sn="is-",eo=ai,fr=jt+"track",ol=jt+"list",Gi=jt+"slide",Aa=Gi+"--clone",rl=Gi+"__container",Vo=jt+"arrows",Ui=jt+"arrow",Ma=Ui+"--prev",ka=Ui+"--next",Ki=jt+"pagination",Fa=Ki+"__page",al=jt+"progress",sl=al+"__bar",ll=jt+"toggle",cl=jt+"spinner",dl=jt+"sr",ul=sn+"initialized",fn=sn+"active",Wa=sn+"prev",Na=sn+"next",So=sn+"visible",Co=sn+"loading",Ha=sn+"focus-in",Ba=sn+"overflow",pl=[fn,So,Wa,Na,Co,Ha,Ba],ml={slide:Gi,clone:Aa,arrows:Vo,arrow:Ui,prev:Ma,next:ka,pagination:Ki,page:Fa,spinner:cl};function gl(e,t){if(aa(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Vn(n,t);)n=n.parentElement;return n}var hl=5,yr=200,Oa="touchstart mousedown",to="touchmove mousemove",no="touchend touchcancel mouseup click";function fl(e,t,n){var i=et(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,a={},p=[],u=[],L=[],C,y,g;function h(){S(),H(),x()}function T(){o(lt,$),o(lt,h),o(St,x),s(document,Oa+" keydown",function(w){g=w.type==="keydown"},{capture:!0}),s(l,"focusin",function(){Gt(l,Ha,!!g)})}function $(w){var I=zo.concat("style");Yt(p),Ut(l,u),Ut(C,L),Ot([C,y],I),Ot(l,w?I:["style",Xn])}function x(){Ut(l,u),Ut(C,L),u=B(eo),L=B(fr),Bt(l,u),Bt(C,L),Ae(l,_t,n.label),Ae(l,jo,n.labelledby)}function S(){C=R("."+fr),y=ri(C,"."+ol),Bn(C&&y,"A track/list element is missing."),$i(p,la(y,"."+Gi+":not(."+Aa+")")),gn({arrows:Vo,pagination:Ki,prev:Ma,next:ka,bar:sl,toggle:ll},function(w,I){a[I]=R("."+w)}),Un(a,{root:l,track:C,list:y,slides:p})}function H(){var w=l.id||Js(ai),I=n.role;l.id=w,C.id=C.id||w+"-track",y.id=y.id||w+"-list",!Ft(l,Kt)&&l.tagName!=="SECTION"&&I&&Ae(l,Kt,I),Ae(l,Xn,d.carousel),Ae(y,Kt,"presentation")}function R(w){var I=ua(l,w);return I&&gl(I,"."+eo)===l?I:void 0}function B(w){return[w+"--"+n.type,w+"--"+n.direction,n.drag&&w+"--draggable",n.isNavigation&&w+"--nav",w===eo&&fn]}return Un(a,{setup:h,mount:T,destroy:$})}var Pn="slide",Nn="loop",li="fade";function yl(e,t,n,i){var o=et(e),s=o.on,l=o.emit,d=o.bind,a=e.Components,p=e.root,u=e.options,L=u.isNavigation,C=u.updateOnMove,y=u.i18n,g=u.pagination,h=u.slideFocus,T=a.Direction.resolve,$=Ft(i,"style"),x=Ft(i,_t),S=n>-1,H=ri(i,"."+rl),R;function B(){S||(i.id=p.id+"-slide"+ko(t+1),Ae(i,Kt,g?"tabpanel":"group"),Ae(i,Xn,y.slide),Ae(i,_t,x||bo(y.slideLabel,[t+1,e.length]))),w()}function w(){d(i,"click",Ze(l,Fo,v)),d(i,"keydown",Ze(l,La,v)),s([Wn,Ea,yn],b),s(No,O),C&&s(Jt,m)}function I(){R=!0,o.destroy(),Ut(i,pl),Ot(i,zo),Ae(i,"style",$),Ae(i,_t,x||"")}function O(){var _=e.splides.map(function(A){var V=A.splide.Components.Slides.getAt(t);return V?V.slide.id:""}).join(" ");Ae(i,_t,bo(y.slideX,(S?n:t)+1)),Ae(i,si,_),Ae(i,Kt,h?"button":""),h&&Ot(i,Xn)}function m(){R||b()}function b(){if(!R){var _=e.index;P(),W(),Gt(i,Wa,t===_-1),Gt(i,Na,t===_+1)}}function P(){var _=Y();_!==cr(i,fn)&&(Gt(i,fn,_),Ae(i,Pa,L&&_||""),l(_?ga:ha,v))}function W(){var _=k(),A=!_&&(!Y()||S);if(e.state.is([Fn,ti])||Ae(i,_a,A||""),Ae(Ao(i,u.focusableNodes||""),En,A?-1:""),h&&Ae(i,En,A?-1:0),_!==cr(i,So)&&(Gt(i,So,_),l(_?fa:ya,v)),!_&&document.activeElement===i){var V=a.Slides.getAt(e.index);V&&ca(V.slide)}}function G(_,A,V){kt(V&&H||i,_,A)}function Y(){var _=e.index;return _===t||u.cloneStatus&&_===n}function k(){if(e.is(li))return Y();var _=Pt(a.Elements.track),A=Pt(i),V=T("left",!0),D=T("right",!0);return Mi(_[V])<=qn(A[V])&&Mi(A[D])<=qn(_[D])}function N(_,A){var V=wt(_-t);return!S&&(u.rewind||e.is(Nn))&&(V=nn(V,e.length-V)),V<=A}var v={index:t,slideIndex:n,slide:i,container:H,isClone:S,mount:B,destroy:I,update:b,style:G,isWithin:N};return v}function vl(e,t,n){var i=et(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,a=d.slides,p=d.list,u=[];function L(){C(),o(lt,y),o(lt,C)}function C(){a.forEach(function(b,P){h(b,P,-1)})}function y(){R(function(b){b.destroy()}),Yt(u)}function g(){R(function(b){b.update()})}function h(b,P,W){var G=yl(e,P,W,b);G.mount(),u.push(G),u.sort(function(Y,k){return Y.index-k.index})}function T(b){return b?B(function(P){return!P.isClone}):u}function $(b){var P=t.Controller,W=P.toIndex(b),G=P.hasFocus()?1:n.perPage;return B(function(Y){return wi(Y.index,W,W+G-1)})}function x(b){return B(b)[0]}function S(b,P){Mt(b,function(W){if(tn(W)&&(W=da(W)),sa(W)){var G=a[P];G?_o(W,G):oi(p,W),Bt(W,n.classes.slide),I(W,Ze(s,Rn))}}),s(lt)}function H(b){hn(B(b).map(function(P){return P.slide})),s(lt)}function R(b,P){T(P).forEach(b)}function B(b){return u.filter(aa(b)?b:function(P){return tn(b)?Vn(P.slide,b):Po(ii(b),P.index)})}function w(b,P,W){R(function(G){G.style(b,P,W)})}function I(b,P){var W=Ao(b,"img"),G=W.length;G?W.forEach(function(Y){l(Y,"load error",function(){--G||P()})}):P()}function O(b){return b?a.length:u.length}function m(){return u.length>n.perPage}return{mount:L,destroy:y,update:g,register:h,get:T,getIn:$,getAt:x,add:S,remove:H,forEach:R,filter:B,style:w,getLength:O,isEnough:m}}function bl(e,t,n){var i=et(e),o=i.on,s=i.bind,l=i.emit,d=t.Slides,a=t.Direction.resolve,p=t.Elements,u=p.root,L=p.track,C=p.list,y=d.getAt,g=d.style,h,T,$;function x(){S(),s(window,"resize load",el(Ze(l,Rn))),o([St,lt],S),o(Rn,H)}function S(){h=n.direction===Vi,kt(u,"maxWidth",cn(n.width)),kt(L,a("paddingLeft"),R(!1)),kt(L,a("paddingRight"),R(!0)),H(!0)}function H(v){var _=Pt(u);(v||T.width!==_.width||T.height!==_.height)&&(kt(L,"height",B()),g(a("marginRight"),cn(n.gap)),g("width",I()),g("height",O(),!0),T=_,l(Hi),$!==($=N())&&(Gt(u,Ba,$),l(Zs,$)))}function R(v){var _=n.padding,A=a(v?"right":"left");return _&&cn(_[A]||(zn(_)?0:_))||"0px"}function B(){var v="";return h&&(v=w(),Bn(v,"height or heightRatio is missing."),v="calc("+v+" - "+R(!1)+" - "+R(!0)+")"),v}function w(){return cn(n.height||Pt(C).width*n.heightRatio)}function I(){return n.autoWidth?null:cn(n.fixedWidth)||(h?"":m())}function O(){return cn(n.fixedHeight)||(h?n.autoHeight?null:m():w())}function m(){var v=cn(n.gap);return"calc((100%"+(v&&" + "+v)+")/"+(n.perPage||1)+(v&&" - "+v)+")"}function b(){return Pt(C)[a("width")]}function P(v,_){var A=y(v||0);return A?Pt(A.slide)[a("width")]+(_?0:Y()):0}function W(v,_){var A=y(v);if(A){var V=Pt(A.slide)[a("right")],D=Pt(C)[a("left")];return wt(V-D)+(_?0:Y())}return 0}function G(v){return W(e.length-1)-W(0)+P(0,v)}function Y(){var v=y(0);return v&&parseFloat(kt(v.slide,a("marginRight")))||0}function k(v){return parseFloat(kt(L,a("padding"+(v?"Right":"Left"))))||0}function N(){return e.is(li)||G(!0)>b()}return{mount:x,resize:H,listSize:b,slideSize:P,sliderSize:G,totalSize:W,getPadding:k,isOverflow:N}}var xl=2;function Sl(e,t,n){var i=et(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,a=[],p;function u(){o(lt,L),o([St,Rn],y),(p=T())&&(g(p),t.Layout.resize(!0))}function L(){C(),u()}function C(){hn(a),Yt(a),i.destroy()}function y(){var $=T();p!==$&&(p<$||!$)&&i.emit(lt)}function g($){var x=l.get().slice(),S=x.length;if(S){for(;x.length<$;)$i(x,x);$i(x.slice(-$),x.slice(0,$)).forEach(function(H,R){var B=R<$,w=h(H.slide,R);B?_o(w,x[0].slide):oi(s.list,w),$i(a,w),l.register(w,R-$+(B?0:S),H.index)})}}function h($,x){var S=$.cloneNode(!0);return Bt(S,n.classes.clone),S.id=e.root.id+"-clone"+ko(x+1),S}function T(){var $=n.clones;if(!e.is(Nn))$=0;else if(ni($)){var x=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=x&&qn(Pt(s.track)[d("width")]/x);$=S||n[d("autoWidth")]&&e.length||n.perPage*xl}return $}return{mount:u,destroy:C}}function Cl(e,t,n){var i=et(e),o=i.on,s=i.emit,l=e.state.set,d=t.Layout,a=d.slideSize,p=d.getPadding,u=d.totalSize,L=d.listSize,C=d.sliderSize,y=t.Direction,g=y.resolve,h=y.orient,T=t.Elements,$=T.list,x=T.track,S;function H(){S=t.Transition,o([an,Hi,St,lt],R)}function R(){t.Controller.isBusy()||(t.Scroll.cancel(),w(e.index),t.Slides.update())}function B(A,V,D,Z){A!==V&&v(A>D)&&(b(),I(m(G(),A>D),!0)),l(Fn),s(Jt,V,D,A),S.start(V,function(){l(In),s(Wn,V,D,A),Z&&Z()})}function w(A){I(W(A,!0))}function I(A,V){if(!e.is(li)){var D=V?A:O(A);kt($,"transform","translate"+g("X")+"("+D+"px)"),A!==D&&s(Ea)}}function O(A){if(e.is(Nn)){var V=P(A),D=V>t.Controller.getEnd(),Z=V<0;(Z||D)&&(A=m(A,D))}return A}function m(A,V){var D=A-N(V),Z=C();return A-=h(Z*(qn(wt(D)/Z)||1))*(V?1:-1),A}function b(){I(G(),!0),S.cancel()}function P(A){for(var V=t.Slides.get(),D=0,Z=1/0,M=0;M<V.length;M++){var te=V[M].index,f=wt(W(te,!0)-A);if(f<=Z)Z=f,D=te;else break}return D}function W(A,V){var D=h(u(A-1)-k(A));return V?Y(D):D}function G(){var A=g("left");return Pt($)[A]-Pt(x)[A]+h(p(!1))}function Y(A){return n.trimSpace&&e.is(Pn)&&(A=Cn(A,0,h(C(!0)-L()))),A}function k(A){var V=n.focus;return V==="center"?(L()-a(A,!0))/2:+V*a(A)||0}function N(A){return W(A?t.Controller.getEnd():0,!!n.trimSpace)}function v(A){var V=h(m(G(),A));return A?V>=0:V<=$[g("scrollWidth")]-Pt(x)[g("width")]}function _(A,V){V=ni(V)?G():V;var D=A!==!0&&h(V)<h(N(!1)),Z=A!==!1&&h(V)>h(N(!0));return D||Z}return{mount:H,move:B,jump:w,translate:I,shift:m,cancel:b,toIndex:P,toPosition:W,getPosition:G,getLimit:N,exceededLimit:_,reposition:R}}function $l(e,t,n){var i=et(e),o=i.on,s=i.emit,l=t.Move,d=l.getPosition,a=l.getLimit,p=l.toPosition,u=t.Slides,L=u.isEnough,C=u.getLength,y=n.omitEnd,g=e.is(Nn),h=e.is(Pn),T=Ze(G,!1),$=Ze(G,!0),x=n.start||0,S,H=x,R,B,w;function I(){O(),o([St,lt,ki],O),o(Hi,m)}function O(){R=C(!0),B=n.perMove,w=n.perPage,S=v();var f=Cn(x,0,y?S:R-1);f!==x&&(x=f,l.reposition())}function m(){S!==v()&&s(ki)}function b(f,ne,fe){if(!te()){var ee=W(f),he=N(ee);he>-1&&(ne||he!==x)&&(D(he),l.move(ee,he,H,fe))}}function P(f,ne,fe,ee){t.Scroll.scroll(f,ne,fe,function(){var he=N(l.toIndex(d()));D(y?nn(he,S):he),ee&&ee()})}function W(f){var ne=x;if(tn(f)){var fe=f.match(/([+\-<>])(\d+)?/)||[],ee=fe[1],he=fe[2];ee==="+"||ee==="-"?ne=Y(x+ +(""+ee+(+he||1)),x):ee===">"?ne=he?_(+he):T(!0):ee==="<"&&(ne=$(!0))}else ne=g?f:Cn(f,0,S);return ne}function G(f,ne){var fe=B||(M()?1:w),ee=Y(x+fe*(f?-1:1),x,!(B||M()));return ee===-1&&h&&!pa(d(),a(!f),1)?f?0:S:ne?ee:N(ee)}function Y(f,ne,fe){if(L()||M()){var ee=k(f);ee!==f&&(ne=f,f=ee,fe=!1),f<0||f>S?!B&&(wi(0,f,ne,!0)||wi(S,ne,f,!0))?f=_(A(f)):g?f=fe?f<0?-(R%w||w):R:f:n.rewind?f=f<0?S:0:f=-1:fe&&f!==ne&&(f=_(A(ne)+(f<ne?-1:1)))}else f=-1;return f}function k(f){if(h&&n.trimSpace==="move"&&f!==x)for(var ne=d();ne===p(f,!0)&&wi(f,0,e.length-1,!n.rewind);)f<x?--f:++f;return f}function N(f){return g?(f+R)%R||0:f}function v(){for(var f=R-(M()||g&&B?1:w);y&&f-- >0;)if(p(R-1,!0)!==p(f,!0)){f++;break}return Cn(f,0,R-1)}function _(f){return Cn(M()?f:w*f,0,S)}function A(f){return M()?nn(f,S):Mi((f>=S?R-1:f)/w)}function V(f){var ne=l.toIndex(f);return h?Cn(ne,0,S):ne}function D(f){f!==x&&(H=x,x=f)}function Z(f){return f?H:x}function M(){return!ni(n.focus)||n.isNavigation}function te(){return e.state.is([Fn,ti])&&!!n.waitForTransition}return{mount:I,go:b,scroll:P,getNext:T,getPrev:$,getAdjacent:G,getEnd:v,setIndex:D,getIndex:Z,toIndex:_,toPage:A,toDest:V,hasFocus:M,isBusy:te}}var wl="http://www.w3.org/2000/svg",Tl="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",pi=40;function Ll(e,t,n){var i=et(e),o=i.on,s=i.bind,l=i.emit,d=n.classes,a=n.i18n,p=t.Elements,u=t.Controller,L=p.arrows,C=p.track,y=L,g=p.prev,h=p.next,T,$,x={};function S(){R(),o(St,H)}function H(){B(),S()}function R(){var P=n.arrows;P&&!(g&&h)&&O(),g&&h&&(Un(x,{prev:g,next:h}),Kn(y,P?"":"none"),Bt(y,$=Vo+"--"+n.direction),P&&(w(),b(),Ae([g,h],si,C.id),l(Sa,g,h)))}function B(){i.destroy(),Ut(y,$),T?(hn(L?[g,h]:y),g=h=null):Ot([g,h],zo)}function w(){o([an,Wn,lt,yn,ki],b),s(h,"click",Ze(I,">")),s(g,"click",Ze(I,"<"))}function I(P){u.go(P,!0)}function O(){y=L||Ln("div",d.arrows),g=m(!0),h=m(!1),T=!0,oi(y,[g,h]),!L&&_o(y,C)}function m(P){var W='<button class="'+d.arrow+" "+(P?d.prev:d.next)+'" type="button"><svg xmlns="'+wl+'" viewBox="0 0 '+pi+" "+pi+'" width="'+pi+'" height="'+pi+'" focusable="false"><path d="'+(n.arrowPath||Tl)+'" />';return da(W)}function b(){if(g&&h){var P=e.index,W=u.getPrev(),G=u.getNext(),Y=W>-1&&P<W?a.last:a.prev,k=G>-1&&P>G?a.first:a.next;g.disabled=W<0,h.disabled=G<0,Ae(g,_t,Y),Ae(h,_t,k),l(Ca,g,h,W,G)}}return{arrows:x,mount:S,destroy:B,update:b}}var El=Mo+"-interval";function Il(e,t,n){var i=et(e),o=i.on,s=i.bind,l=i.emit,d=Oi(n.interval,e.go.bind(e,">"),w),a=d.isPaused,p=t.Elements,u=t.Elements,L=u.root,C=u.toggle,y=n.autoplay,g,h,T=y==="pause";function $(){y&&(x(),C&&Ae(C,si,p.track.id),T||S(),B())}function x(){n.pauseOnHover&&s(L,"mouseenter mouseleave",function(O){g=O.type==="mouseenter",R()}),n.pauseOnFocus&&s(L,"focusin focusout",function(O){h=O.type==="focusin",R()}),C&&s(C,"click",function(){T?S():H(!0)}),o([Jt,Bi,lt],d.rewind),o(Jt,I)}function S(){a()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),h=g=T=!1,B(),l(Ho))}function H(O){O===void 0&&(O=!0),T=!!O,B(),a()||(d.pause(),l(Bo))}function R(){T||(g||h?H(!1):S())}function B(){C&&(Gt(C,fn,!T),Ae(C,_t,n.i18n[T?"play":"pause"]))}function w(O){var m=p.bar;m&&kt(m,"width",O*100+"%"),l(Ta,O)}function I(O){var m=t.Slides.getAt(O);d.set(m&&+Ft(m.slide,El)||n.interval)}return{mount:$,destroy:d.cancel,play:S,pause:H,isPaused:a}}function Rl(e,t,n){var i=et(e),o=i.on;function s(){n.cover&&(o(Oo,Ze(d,!0)),o([an,St,lt],Ze(l,!0)))}function l(a){t.Slides.forEach(function(p){var u=ri(p.container||p.slide,"img");u&&u.src&&d(a,u,p)})}function d(a,p,u){u.style("background",a?'center/cover no-repeat url("'+p.src+'")':"",!0),Kn(p,a?"none":"")}return{mount:s,destroy:Ze(l,!1)}}var Pl=10,_l=600,Al=.6,Ml=1.5,kl=800;function Fl(e,t,n){var i=et(e),o=i.on,s=i.emit,l=e.state.set,d=t.Move,a=d.getPosition,p=d.getLimit,u=d.exceededLimit,L=d.translate,C=e.is(Pn),y,g,h=1;function T(){o(Jt,H),o([St,lt],R)}function $(w,I,O,m,b){var P=a();if(H(),O&&(!C||!u())){var W=t.Layout.sliderSize(),G=vo(w)*W*Mi(wt(w)/W)||0;w=d.toPosition(t.Controller.toDest(w%W))+G}var Y=pa(P,w,1);h=1,I=Y?0:I||Ai(wt(w-P)/Ml,kl),g=m,y=Oi(I,x,Ze(S,P,w,b),1),l(ti),s(Bi),y.start()}function x(){l(In),g&&g(),s(yn)}function S(w,I,O,m){var b=a(),P=w+(I-w)*B(m),W=(P-b)*h;L(b+W),C&&!O&&u()&&(h*=Al,wt(W)<Pl&&$(p(u(!0)),_l,!1,g,!0))}function H(){y&&y.cancel()}function R(){y&&!y.isPaused()&&(H(),x())}function B(w){var I=n.easingFunc;return I?I(w):1-Math.pow(1-w,4)}return{mount:T,destroy:H,scroll:$,cancel:R}}var $n={passive:!1,capture:!0};function Wl(e,t,n){var i=et(e),o=i.on,s=i.emit,l=i.bind,d=i.unbind,a=e.state,p=t.Move,u=t.Scroll,L=t.Controller,C=t.Elements.track,y=t.Media.reduce,g=t.Direction,h=g.resolve,T=g.orient,$=p.getPosition,x=p.exceededLimit,S,H,R,B,w,I=!1,O,m,b;function P(){l(C,to,fo,$n),l(C,no,fo,$n),l(C,Oa,G,$n),l(C,"click",N,{capture:!0}),l(C,"dragstart",Vt),o([an,St],W)}function W(){var z=n.drag;ue(!z),B=z==="free"}function G(z){if(O=!1,!m){var X=he(z);ee(z.target)&&(X||!z.button)&&(L.isBusy()?Vt(z,!0):(b=X?C:window,w=a.is([Fn,ti]),R=null,l(b,to,Y,$n),l(b,no,k,$n),p.cancel(),u.cancel(),v(z)))}}function Y(z){if(a.is(Ci)||(a.set(Ci),s(va)),z.cancelable)if(w){p.translate(S+fe(M(z)));var X=te(z)>yr,ae=I!==(I=x());(X||ae)&&v(z),O=!0,s(ba),Vt(z)}else V(z)&&(w=A(z),Vt(z))}function k(z){a.is(Ci)&&(a.set(In),s(xa)),w&&(_(z),Vt(z)),d(b,to,Y),d(b,no,k),w=!1}function N(z){!m&&O&&Vt(z,!0)}function v(z){R=H,H=z,S=$()}function _(z){var X=D(z),ae=Z(X),pe=n.rewind&&n.rewindByDrag;y(!1),B?L.scroll(ae,0,n.snap):e.is(li)?L.go(T(vo(X))<0?pe?"<":"-":pe?">":"+"):e.is(Pn)&&I&&pe?L.go(x(!0)?">":"<"):L.go(L.toDest(ae),!0),y(!0)}function A(z){var X=n.dragMinThreshold,ae=zn(X),pe=ae&&X.mouse||0,Se=(ae?X.touch:+X)||10;return wt(M(z))>(he(z)?Se:pe)}function V(z){return wt(M(z))>wt(M(z,!0))}function D(z){if(e.is(Nn)||!I){var X=te(z);if(X&&X<yr)return M(z)/X}return 0}function Z(z){return $()+vo(z)*nn(wt(z)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function M(z,X){return ne(z,X)-ne(f(z),X)}function te(z){return yo(z)-yo(f(z))}function f(z){return H===z&&R||H}function ne(z,X){return(he(z)?z.changedTouches[0]:z)["page"+h(X?"Y":"X")]}function fe(z){return z/(I&&e.is(Pn)?hl:1)}function ee(z){var X=n.noDrag;return!Vn(z,"."+Fa+", ."+Ui)&&(!X||!Vn(z,X))}function he(z){return typeof TouchEvent<"u"&&z instanceof TouchEvent}function oe(){return w}function ue(z){m=z}return{mount:P,disable:ue,isDragging:oe}}var Nl={Spacebar:" ",Right:zi,Left:Di,Up:Ia,Down:Ra};function Go(e){return e=tn(e)?e:e.key,Nl[e]||e}var vr="keydown";function Hl(e,t,n){var i=et(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,a=t.Direction.resolve,p,u;function L(){C(),o(St,y),o(St,C),o(Jt,h)}function C(){var $=n.keyboard;$&&(p=$==="global"?window:d,s(p,vr,T))}function y(){l(p,vr)}function g($){u=$}function h(){var $=u;u=!0,ra(function(){u=$})}function T($){if(!u){var x=Go($);x===a(Di)?e.go("<"):x===a(zi)&&e.go(">")}}return{mount:L,destroy:y,disable:g}}var On=Mo+"-lazy",Ti=On+"-srcset",Bl="["+On+"], ["+Ti+"]";function Ol(e,t,n){var i=et(e),o=i.on,s=i.off,l=i.bind,d=i.emit,a=n.lazyLoad==="sequential",p=[Wn,yn],u=[];function L(){n.lazyLoad&&(C(),o(lt,C))}function C(){Yt(u),y(),a?$():(s(p),o(p,g),g())}function y(){t.Slides.forEach(function(x){Ao(x.slide,Bl).forEach(function(S){var H=Ft(S,On),R=Ft(S,Ti);if(H!==S.src||R!==S.srcset){var B=n.classes.spinner,w=S.parentElement,I=ri(w,"."+B)||Ln("span",B,w);u.push([S,x,I]),S.src||Kn(S,"none")}})})}function g(){u=u.filter(function(x){var S=n.perPage*((n.preloadPages||1)+1)-1;return x[1].isWithin(e.index,S)?h(x):!0}),u.length||s(p)}function h(x){var S=x[0];Bt(x[1].slide,Co),l(S,"load error",Ze(T,x)),Ae(S,"src",Ft(S,On)),Ae(S,"srcset",Ft(S,Ti)),Ot(S,On),Ot(S,Ti)}function T(x,S){var H=x[0],R=x[1];Ut(R.slide,Co),S.type!=="error"&&(hn(x[2]),Kn(H,""),d(Oo,H,R),d(Rn)),a&&$()}function $(){u.length&&h(u.shift())}return{mount:L,destroy:Ze(Yt,u),check:g}}function jl(e,t,n){var i=et(e),o=i.on,s=i.emit,l=i.bind,d=t.Slides,a=t.Elements,p=t.Controller,u=p.hasFocus,L=p.getIndex,C=p.go,y=t.Direction.resolve,g=a.pagination,h=[],T,$;function x(){S(),o([St,lt,ki],x);var m=n.pagination;g&&Kn(g,m?"":"none"),m&&(o([Jt,Bi,yn],O),H(),O(),s($a,{list:T,items:h},I(e.index)))}function S(){T&&(hn(g?rn(T.children):T),Ut(T,$),Yt(h),T=null),i.destroy()}function H(){var m=e.length,b=n.classes,P=n.i18n,W=n.perPage,G=u()?p.getEnd()+1:qn(m/W);T=g||Ln("ul",b.pagination,a.track.parentElement),Bt(T,$=Ki+"--"+w()),Ae(T,Kt,"tablist"),Ae(T,_t,P.select),Ae(T,Do,w()===Vi?"vertical":"");for(var Y=0;Y<G;Y++){var k=Ln("li",null,T),N=Ln("button",{class:b.page,type:"button"},k),v=d.getIn(Y).map(function(A){return A.slide.id}),_=!u()&&W>1?P.pageX:P.slideX;l(N,"click",Ze(R,Y)),n.paginationKeyboard&&l(N,"keydown",Ze(B,Y)),Ae(k,Kt,"presentation"),Ae(N,Kt,"tab"),Ae(N,si,v.join(" ")),Ae(N,_t,bo(_,Y+1)),Ae(N,En,-1),h.push({li:k,button:N,page:Y})}}function R(m){C(">"+m,!0)}function B(m,b){var P=h.length,W=Go(b),G=w(),Y=-1;W===y(zi,!1,G)?Y=++m%P:W===y(Di,!1,G)?Y=(--m+P)%P:W==="Home"?Y=0:W==="End"&&(Y=P-1);var k=h[Y];k&&(ca(k.button),C(">"+Y),Vt(b,!0))}function w(){return n.paginationDirection||n.direction}function I(m){return h[p.toPage(m)]}function O(){var m=I(L(!0)),b=I(L());if(m){var P=m.button;Ut(P,fn),Ot(P,pr),Ae(P,En,-1)}if(b){var W=b.button;Bt(W,fn),Ae(W,pr,!0),Ae(W,En,"")}s(wa,{list:T,items:h},m,b)}return{items:h,mount:x,destroy:S,getAt:I,update:O}}var Dl=[" ","Enter"];function zl(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(g){g.isParent||(p(e,g.splide),p(g.splide,e))}),i&&u()}function d(){s.forEach(function(g){g.destroy()}),Yt(s)}function a(){d(),l()}function p(g,h){var T=et(g);T.on(Jt,function($,x,S){h.go(h.is(Nn)?S:$)}),s.push(T)}function u(){var g=et(e),h=g.on;h(Fo,C),h(La,y),h([an,St],L),s.push(g),g.emit(No,e.splides)}function L(){Ae(t.Elements.list,Do,n.direction===Vi?"vertical":"")}function C(g){e.go(g.index)}function y(g,h){Po(Dl,Go(h))&&(C(g),Vt(h))}return{setup:Ze(t.Media.set,{slideFocus:ni(o)?i:o},!0),mount:l,destroy:d,remount:a}}function Vl(e,t,n){var i=et(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,$n)}function d(p){if(p.cancelable){var u=p.deltaY,L=u<0,C=yo(p),y=n.wheelMinThreshold||0,g=n.wheelSleep||0;wt(u)>y&&C-s>g&&(e.go(L?"<":">"),s=C),a(L)&&Vt(p)}}function a(p){return!n.releaseWheel||e.state.is(Fn)||t.Controller.getAdjacent(p)!==-1}return{mount:l}}var Gl=90;function Ul(e,t,n){var i=et(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=Ln("span",dl),a=Oi(Gl,Ze(u,!1));function p(){l&&(C(!t.Autoplay.isPaused()),Ae(s,hr,!0),d.textContent="…",o(Ho,Ze(C,!0)),o(Bo,Ze(C,!1)),o([Wn,yn],Ze(u,!0)))}function u(y){Ae(s,gr,y),y?(oi(s,d),a.start()):(hn(d),a.cancel())}function L(){Ot(s,[mr,hr,gr]),hn(d)}function C(y){l&&Ae(s,mr,y?"off":"polite")}return{mount:p,disable:C,destroy:L}}var Kl=Object.freeze({__proto__:null,Media:tl,Direction:nl,Elements:fl,Slides:vl,Layout:bl,Clones:Sl,Move:Cl,Controller:$l,Arrows:Ll,Autoplay:Il,Cover:Rl,Scroll:Fl,Drag:Wl,Keyboard:Hl,LazyLoad:Ol,Pagination:jl,Sync:zl,Wheel:Vl,Live:Ul}),ql={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"},Xl={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:ml,i18n:ql,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Yl(e,t,n){var i=t.Slides;function o(){et(e).on([an,lt],s)}function s(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,a){i.style("transition","opacity "+n.speed+"ms "+n.easing),ra(a)}return{mount:o,start:l,cancel:fo}}function Jl(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=Ze(kt,l,"transition"),a;function p(){et(e).bind(l,"transitionend",function(y){y.target===l&&a&&(L(),a())})}function u(y,g){var h=i.toPosition(y,!0),T=i.getPosition(),$=C(y);wt(h-T)>=1&&$>=1?n.useScroll?s.scroll(h,$,!1,g):(d("transform "+$+"ms "+n.easing),i.translate(h,!0),a=g):(i.jump(y),g())}function L(){d(""),s.cancel()}function C(y){var g=n.rewindSpeed;if(e.is(Pn)&&g){var h=o.getIndex(!0),T=o.getEnd();if(h===0&&y>=T||h>=T&&y===0)return g}return n.speed}return{mount:p,start:u,cancel:L}}var Zl=(function(){function e(n,i){this.event=et(),this.Components={},this.state=Qs(Tn),this.splides=[],this._o={},this._E={};var o=tn(n)?ua(document,n):n;Bn(o,o+" is invalid."),this.root=o,i=en({label:Ft(o,_t)||"",labelledby:Ft(o,jo)||""},Xl,e.defaults,i||{});try{en(i,JSON.parse(Ft(o,Mo)))}catch{Bn(!1,"Invalid JSON")}this._o=Object.create(en({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,l=this.state,d=this.Components;Bn(l.is([Tn,_i]),"Already mounted!"),l.set(Tn),this._C=d,this._T=o||this._T||(this.is(li)?Yl:Jl),this._E=i||this._E;var a=Un({},Kl,this._E,{Transition:this._T});return gn(a,function(p,u){var L=p(s,d,s._o);d[u]=L,L.setup&&L.setup()}),gn(d,function(p){p.mount&&p.mount()}),this.emit(an),Bt(this.root,ul),l.set(In),this.emit(xo),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(In)&&(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(rn(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(lt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,s=this.state;return s.is(Tn)?et(this).on(xo,this.destroy.bind(this,i)):(gn(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Wo),o.destroy(),i&&Yt(this.splides),s.set(_i)),this},qs(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})(),Uo=Zl;Uo.defaults={};Uo.STATES=Ys;var br=[[an,"onMounted"],[xo,"onReady"],[Jt,"onMove"],[Wn,"onMoved"],[Fo,"onClick"],[ga,"onActive"],[ha,"onInactive"],[fa,"onVisible"],[ya,"onHidden"],[lt,"onRefresh"],[St,"onUpdated"],[Rn,"onResize"],[Hi,"onResized"],[va,"onDrag"],[ba,"onDragging"],[xa,"onDragged"],[Bi,"onScroll"],[yn,"onScrolled"],[Wo,"onDestroy"],[Sa,"onArrowsMounted"],[Ca,"onArrowsUpdated"],[$a,"onPaginationMounted"],[wa,"onPaginationUpdated"],[No,"onNavigationMounted"],[Ho,"onAutoplayPlay"],[Ta,"onAutoplayPlaying"],[Bo,"onAutoplayPause"],[Oo,"onLazyLoadLoaded"]];function Ko(...e){return e.filter(Boolean).join(" ")}function Fi(e){return e!==null&&typeof e=="object"}function $o(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!$o(n,t[i]));if(Fi(e)&&Fi(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!$o(e[o],t[o]))}return e===t}function Ql(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function ec(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 wo(e,t){const n=e;return ec(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Fi(i)?n[o]=wo(Fi(n[o])?n[o]:{},i):n[o]=i}),n}var tc=({children:e,className:t,...n})=>c.createElement("div",{className:Ko("splide__track",t),...n},c.createElement("ul",{className:"splide__list"},e)),qo=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 Uo(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=wo({},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&&!$o(this.options,e)&&(this.splide.options=e,this.options=wo({},e));const t=this.getSlides();Ql(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){br.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:Ko("splide",e),ref:this.splideRef,...this.omit(o,["options",...br.map(s=>s[1])])},n?c.createElement(tc,null,i):i)}},Xo=({children:e,className:t,...n})=>c.createElement("li",{className:Ko("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("react"),De=require("classnames"),E=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),ei=require("react-dom");function os(e){return e.type==="object"&&e.version===1}const rs="ControlSlider-module__wrapper___sHEkd",as="ControlSlider-module__hoverArrow___A-dOH",ss="ControlSlider-module__sliderItem___QQSkR",ls="ControlSlider-module__sliderImage___9hRl-",cs="ControlSlider-module__arrow___05ghY",ds="ControlSlider-module__arrowVertical___tBfVN",us="ControlSlider-module__nextArrow___-30Yc",ps="ControlSlider-module__arrowInner___aEra3",ms="ControlSlider-module__arrowIcon___S4ztF",gs="ControlSlider-module__arrowImg___2dwJW",hs="ControlSlider-module__mirror___brd6U",fs="ControlSlider-module__pagination___bicLF",ys="ControlSlider-module__paginationInner___bT-P-",vs="ControlSlider-module__paginationVertical___zYqKw",bs="ControlSlider-module__paginationItem___nTRbk",xs="ControlSlider-module__dot___p1Qun",Ss="ControlSlider-module__activeDot___LHFaj",Cs="ControlSlider-module__paginationInsideBottom___R3FWn",$s="ControlSlider-module__paginationInsideTop___V-qb-",ws="ControlSlider-module__paginationOutsideBottom___14w8D",Ts="ControlSlider-module__paginationOutsideTop___SCLqB",Ls="ControlSlider-module__paginationInsideLeft___yOBRZ",Es="ControlSlider-module__paginationInsideRight___Rtt3o",Is="ControlSlider-module__paginationOutsideLeft___lahaw",Rs="ControlSlider-module__paginationOutsideRight___EtuQa",Ps="ControlSlider-module__imgWrapper___UjEgB",As="ControlSlider-module__captionBlock___dJ6-j",_s="ControlSlider-module__captionTextWrapper___HFlpf",Ms="ControlSlider-module__captionText___uGBVc",ks="ControlSlider-module__active___WZK4G",Fs="ControlSlider-module__withPointerEvents___t-18M",Ws="ControlSlider-module__topLeftAlignment___zjnGM",Ns="ControlSlider-module__topCenterAlignment___gD1xW",Hs="ControlSlider-module__topRightAlignment___NMapS",Bs="ControlSlider-module__middleLeftAlignment___OnUrY",Os="ControlSlider-module__middleCenterAlignment___Tdkl0",js="ControlSlider-module__middleRightAlignment___wEbfX",Ds="ControlSlider-module__bottomLeftAlignment___cTP2-",zs="ControlSlider-module__bottomCenterAlignment___c54fB",Vs="ControlSlider-module__bottomRightAlignment___kEwrz",Gs="ControlSlider-module__clickOverlay___DZA28",Us="ControlSlider-module__contain___pLyq7",Ks="ControlSlider-module__cover___KdDat",ve={wrapper:rs,hoverArrow:as,sliderItem:ss,sliderImage:ls,arrow:cs,arrowVertical:ds,nextArrow:us,arrowInner:ps,arrowIcon:ms,arrowImg:gs,mirror:hs,pagination:fs,paginationInner:ys,paginationVertical:vs,paginationItem:bs,dot:xs,activeDot:Ss,paginationInsideBottom:Cs,paginationInsideTop:$s,paginationOutsideBottom:ws,paginationOutsideTop:Ts,paginationInsideLeft:Ls,paginationInsideRight:Es,paginationOutsideLeft:Is,paginationOutsideRight:Rs,imgWrapper:Ps,captionBlock:As,captionTextWrapper:_s,captionText:Ms,active:ks,withPointerEvents:Fs,topLeftAlignment:Ws,topCenterAlignment:Ns,topRightAlignment:Hs,middleLeftAlignment:Bs,middleCenterAlignment:Os,middleRightAlignment:js,bottomLeftAlignment:Ds,bottomCenterAlignment:zs,bottomRightAlignment:Vs,clickOverlay:Gs,contain:Us,cover:Ks};function qs(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 Xs(e,t,n){return t&&qs(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var ar="(prefers-reduced-motion: reduce)",Tn=1,Ys=2,In=3,Fn=4,ti=5,Ci=6,Ai=7,Js={CREATED:Tn,MOUNTED:Ys,IDLE:In,MOVING:Fn,SCROLLING:ti,DRAGGING:Ci,DESTROYED:Ai};function Xt(e){e.length=0}function on(e,t,n){return Array.prototype.slice.call(e,t,n)}function Je(e){return e.bind.apply(e,[null].concat(on(arguments,1)))}var ra=setTimeout,fo=function(){};function sr(e){return requestAnimationFrame(e)}function Ni(e,t){return typeof t===e}function zn(e){return!Ro(e)&&Ni("object",e)}var Io=Array.isArray,aa=Je(Ni,"function"),en=Je(Ni,"string"),ni=Je(Ni,"undefined");function Ro(e){return e===null}function sa(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function ii(e){return Io(e)?e:[e]}function At(e,t){ii(e).forEach(t)}function Po(e,t){return e.indexOf(t)>-1}function $i(e,t){return e.push.apply(e,ii(t)),e}function Vt(e,t,n){e&&At(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Ht(e,t){Vt(e,en(t)?t.split(" "):t,!0)}function oi(e,t){At(t,e.appendChild.bind(e))}function Ao(e,t){At(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Vn(e,t){return sa(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function la(e,t){var n=e?on(e.children):[];return t?n.filter(function(i){return Vn(i,t)}):n}function ri(e,t){return t?la(e,t)[0]:e.firstElementChild}var Gn=Object.keys;function mn(e,t,n){return e&&(n?Gn(e).reverse():Gn(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Un(e){return on(arguments,1).forEach(function(t){mn(t,function(n,i){e[i]=t[i]})}),e}function Qt(e){return on(arguments,1).forEach(function(t){mn(t,function(n,i){Io(n)?e[i]=n.slice():zn(n)?e[i]=Qt({},zn(e[i])?e[i]:{},n):e[i]=n})}),e}function lr(e,t){At(t||Gn(e),function(n){delete e[n]})}function Bt(e,t){At(e,function(n){At(t,function(i){n&&n.removeAttribute(i)})})}function _e(e,t,n){zn(t)?mn(t,function(i,o){_e(e,o,i)}):At(e,function(i){Ro(n)||n===""?Bt(i,t):i.setAttribute(t,String(n))})}function Ln(e,t,n){var i=document.createElement(e);return t&&(en(t)?Ht(i,t):_e(i,t)),n&&oi(n,i),i}function Mt(e,t,n){if(ni(n))return getComputedStyle(e)[t];Ro(n)||(e.style[t]=""+n)}function Kn(e,t){Mt(e,"display",t)}function ca(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function kt(e,t){return e.getAttribute(t)}function cr(e,t){return e&&e.classList.contains(t)}function It(e){return e.getBoundingClientRect()}function gn(e){At(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function da(e){return ri(new DOMParser().parseFromString(e,"text/html").body)}function zt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ua(e,t){return e&&e.querySelector(t)}function _o(e,t){return t?on(e.querySelectorAll(t)):[]}function Gt(e,t){Vt(e,t,!1)}function yo(e){return e.timeStamp}function ln(e){return en(e)?e:e?e+"px":""}var ai="splide",Mo="data-"+ai;function Bn(e,t){if(!e)throw new Error("["+ai+"] "+(t||""))}var tn=Math.min,_i=Math.max,Mi=Math.floor,qn=Math.ceil,wt=Math.abs;function pa(e,t,n){return wt(e-t)<n}function wi(e,t,n,i){var o=tn(t,n),s=_i(t,n);return i?o<e&&e<s:o<=e&&e<=s}function Cn(e,t,n){var i=tn(t,n),o=_i(t,n);return tn(_i(i,e),o)}function vo(e){return+(e>0)-+(e<0)}function bo(e,t){return At(t,function(n){e=e.replace("%s",""+n)}),e}function ko(e){return e<10?"0"+e:""+e}var dr={};function Zs(e){return""+e+ko(dr[e]=(dr[e]||0)+1)}function ma(){var e=[];function t(l,d,a,p){o(l,d,function(u,L,C){var y="addEventListener"in u,g=y?u.removeEventListener.bind(u,L,a,p):u.removeListener.bind(u,a);y?u.addEventListener(L,a,p):u.addListener(a),e.push([u,L,C,a,g])})}function n(l,d,a){o(l,d,function(p,u,L){e=e.filter(function(C){return C[0]===p&&C[1]===u&&C[2]===L&&(!a||C[3]===a)?(C[4](),!1):!0})})}function i(l,d,a){var p,u=!0;return typeof CustomEvent=="function"?p=new CustomEvent(d,{bubbles:u,detail:a}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(d,u,!1,a)),l.dispatchEvent(p),p}function o(l,d,a){At(l,function(p){p&&At(d,function(u){u.split(" ").forEach(function(L){var C=L.split(".");a(p,C[0],C[1])})})})}function s(){e.forEach(function(l){l[4]()}),Xt(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var rn="mounted",xo="ready",Yt="move",Wn="moved",Fo="click",ga="active",ha="inactive",fa="visible",ya="hidden",st="refresh",xt="updated",Rn="resize",Hi="resized",va="drag",ba="dragging",xa="dragged",Bi="scroll",fn="scrolled",Qs="overflow",Wo="destroy",Sa="arrows:mounted",Ca="arrows:updated",$a="pagination:mounted",wa="pagination:updated",No="navigation:mounted",Ho="autoplay:play",Ta="autoplay:playing",Bo="autoplay:pause",Oo="lazyload:loaded",La="sk",Ea="sh",ki="ei";function tt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=ma();function i(s,l){n.bind(t,ii(s).join(" "),function(d){l.apply(l,Io(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,on(arguments,1))}return e&&e.event.on(Wo,n.destroy),Un(n,{bus:t,on:i,off:Je(n.unbind,t),emit:o})}function Oi(e,t,n,i){var o=Date.now,s,l=0,d,a=!0,p=0;function u(){if(!a){if(l=e?tn((o()-s)/e,1):1,n&&n(l),l>=1&&(t(),s=o(),i&&++p>=i))return C();d=sr(u)}}function L($){$||g(),s=o()-($?l*e:0),a=!1,d=sr(u)}function C(){a=!0}function y(){s=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,a=!0}function h($){e=$}function T(){return a}return{start:L,rewind:y,pause:C,cancel:g,set:h,isPaused:T}}function el(e){var t=e;function n(o){t=o}function i(o){return Po(ii(o),t)}return{set:n,is:i}}function tl(e,t){var n=Oi(0,e,null,1);return function(){n.isPaused()&&n.start()}}function nl(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=ma(),d=[];function a(){var g=n.mediaQuery==="min";Gn(o).sort(function(h,T){return g?+h-+T:+T-+h}).forEach(function(h){u(o[h],"("+(g?"min":"max")+"-width:"+h+"px)")}),u(s,ar),L()}function p(g){g&&l.destroy()}function u(g,h){var T=matchMedia(h);l.bind(T,"change",L),d.push([g,T])}function L(){var g=i.is(Ai),h=n.direction,T=d.reduce(function($,x){return Qt($,x[1].matches?x[0]:{})},{});lr(n),y(T),n.destroy?e.destroy(n.destroy==="completely"):g?(p(!0),e.mount()):h!==n.direction&&e.refresh()}function C(g){matchMedia(ar).matches&&(g?Qt(n,s):lr(n,Gn(s)))}function y(g,h,T){Qt(n,g),h&&Qt(Object.getPrototypeOf(n),g),(T||!i.is(Tn))&&e.emit(xt,n)}return{setup:a,destroy:p,reduce:C,set:y}}var ji="Arrow",Di=ji+"Left",zi=ji+"Right",Ia=ji+"Up",Ra=ji+"Down",ur="rtl",Vi="ttb",Qi={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ia,zi],ArrowRight:[Ra,Di]};function il(e,t,n){function i(s,l,d){d=d||n.direction;var a=d===ur&&!l?1:d===Vi?0:-1;return Qi[s]&&Qi[s][a]||s.replace(/width|left|right/i,function(p,u){var L=Qi[p.toLowerCase()][a]||p;return u>0?L.charAt(0).toUpperCase()+L.slice(1):L})}function o(s){return s*(n.direction===ur?1:-1)}return{resolve:i,orient:o}}var Ut="role",En="tabindex",ol="disabled",Ft="aria-",si=Ft+"controls",Pa=Ft+"current",pr=Ft+"selected",Rt=Ft+"label",jo=Ft+"labelledby",Aa=Ft+"hidden",Do=Ft+"orientation",Xn=Ft+"roledescription",mr=Ft+"live",gr=Ft+"busy",hr=Ft+"atomic",zo=[Ut,En,ol,si,Pa,Rt,jo,Aa,Do,Xn],Ot=ai+"__",an="is-",eo=ai,fr=Ot+"track",rl=Ot+"list",Gi=Ot+"slide",_a=Gi+"--clone",al=Gi+"__container",Vo=Ot+"arrows",Ui=Ot+"arrow",Ma=Ui+"--prev",ka=Ui+"--next",Ki=Ot+"pagination",Fa=Ki+"__page",sl=Ot+"progress",ll=sl+"__bar",cl=Ot+"toggle",dl=Ot+"spinner",ul=Ot+"sr",pl=an+"initialized",hn=an+"active",Wa=an+"prev",Na=an+"next",So=an+"visible",Co=an+"loading",Ha=an+"focus-in",Ba=an+"overflow",ml=[hn,So,Wa,Na,Co,Ha,Ba],gl={slide:Gi,clone:_a,arrows:Vo,arrow:Ui,prev:Ma,next:ka,pagination:Ki,page:Fa,spinner:dl};function hl(e,t){if(aa(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Vn(n,t);)n=n.parentElement;return n}var fl=5,yr=200,Oa="touchstart mousedown",to="touchmove mousemove",no="touchend touchcancel mouseup click";function yl(e,t,n){var i=tt(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,a={},p=[],u=[],L=[],C,y,g;function h(){S(),H(),x()}function T(){o(st,$),o(st,h),o(xt,x),s(document,Oa+" keydown",function(w){g=w.type==="keydown"},{capture:!0}),s(l,"focusin",function(){Vt(l,Ha,!!g)})}function $(w){var I=zo.concat("style");Xt(p),Gt(l,u),Gt(C,L),Bt([C,y],I),Bt(l,w?I:["style",Xn])}function x(){Gt(l,u),Gt(C,L),u=B(eo),L=B(fr),Ht(l,u),Ht(C,L),_e(l,Rt,n.label),_e(l,jo,n.labelledby)}function S(){C=R("."+fr),y=ri(C,"."+rl),Bn(C&&y,"A track/list element is missing."),$i(p,la(y,"."+Gi+":not(."+_a+")")),mn({arrows:Vo,pagination:Ki,prev:Ma,next:ka,bar:ll,toggle:cl},function(w,I){a[I]=R("."+w)}),Un(a,{root:l,track:C,list:y,slides:p})}function H(){var w=l.id||Zs(ai),I=n.role;l.id=w,C.id=C.id||w+"-track",y.id=y.id||w+"-list",!kt(l,Ut)&&l.tagName!=="SECTION"&&I&&_e(l,Ut,I),_e(l,Xn,d.carousel),_e(y,Ut,"presentation")}function R(w){var I=ua(l,w);return I&&hl(I,"."+eo)===l?I:void 0}function B(w){return[w+"--"+n.type,w+"--"+n.direction,n.drag&&w+"--draggable",n.isNavigation&&w+"--nav",w===eo&&hn]}return Un(a,{setup:h,mount:T,destroy:$})}var Pn="slide",Nn="loop",li="fade";function vl(e,t,n,i){var o=tt(e),s=o.on,l=o.emit,d=o.bind,a=e.Components,p=e.root,u=e.options,L=u.isNavigation,C=u.updateOnMove,y=u.i18n,g=u.pagination,h=u.slideFocus,T=a.Direction.resolve,$=kt(i,"style"),x=kt(i,Rt),S=n>-1,H=ri(i,"."+al),R;function B(){S||(i.id=p.id+"-slide"+ko(t+1),_e(i,Ut,g?"tabpanel":"group"),_e(i,Xn,y.slide),_e(i,Rt,x||bo(y.slideLabel,[t+1,e.length]))),w()}function w(){d(i,"click",Je(l,Fo,v)),d(i,"keydown",Je(l,La,v)),s([Wn,Ea,fn],b),s(No,O),C&&s(Yt,m)}function I(){R=!0,o.destroy(),Gt(i,ml),Bt(i,zo),_e(i,"style",$),_e(i,Rt,x||"")}function O(){var A=e.splides.map(function(_){var V=_.splide.Components.Slides.getAt(t);return V?V.slide.id:""}).join(" ");_e(i,Rt,bo(y.slideX,(S?n:t)+1)),_e(i,si,A),_e(i,Ut,h?"button":""),h&&Bt(i,Xn)}function m(){R||b()}function b(){if(!R){var A=e.index;P(),W(),Vt(i,Wa,t===A-1),Vt(i,Na,t===A+1)}}function P(){var A=Y();A!==cr(i,hn)&&(Vt(i,hn,A),_e(i,Pa,L&&A||""),l(A?ga:ha,v))}function W(){var A=k(),_=!A&&(!Y()||S);if(e.state.is([Fn,ti])||_e(i,Aa,_||""),_e(_o(i,u.focusableNodes||""),En,_?-1:""),h&&_e(i,En,_?-1:0),A!==cr(i,So)&&(Vt(i,So,A),l(A?fa:ya,v)),!A&&document.activeElement===i){var V=a.Slides.getAt(e.index);V&&ca(V.slide)}}function G(A,_,V){Mt(V&&H||i,A,_)}function Y(){var A=e.index;return A===t||u.cloneStatus&&A===n}function k(){if(e.is(li))return Y();var A=It(a.Elements.track),_=It(i),V=T("left",!0),D=T("right",!0);return Mi(A[V])<=qn(_[V])&&Mi(_[D])<=qn(A[D])}function N(A,_){var V=wt(A-t);return!S&&(u.rewind||e.is(Nn))&&(V=tn(V,e.length-V)),V<=_}var v={index:t,slideIndex:n,slide:i,container:H,isClone:S,mount:B,destroy:I,update:b,style:G,isWithin:N};return v}function bl(e,t,n){var i=tt(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,a=d.slides,p=d.list,u=[];function L(){C(),o(st,y),o(st,C)}function C(){a.forEach(function(b,P){h(b,P,-1)})}function y(){R(function(b){b.destroy()}),Xt(u)}function g(){R(function(b){b.update()})}function h(b,P,W){var G=vl(e,P,W,b);G.mount(),u.push(G),u.sort(function(Y,k){return Y.index-k.index})}function T(b){return b?B(function(P){return!P.isClone}):u}function $(b){var P=t.Controller,W=P.toIndex(b),G=P.hasFocus()?1:n.perPage;return B(function(Y){return wi(Y.index,W,W+G-1)})}function x(b){return B(b)[0]}function S(b,P){At(b,function(W){if(en(W)&&(W=da(W)),sa(W)){var G=a[P];G?Ao(W,G):oi(p,W),Ht(W,n.classes.slide),I(W,Je(s,Rn))}}),s(st)}function H(b){gn(B(b).map(function(P){return P.slide})),s(st)}function R(b,P){T(P).forEach(b)}function B(b){return u.filter(aa(b)?b:function(P){return en(b)?Vn(P.slide,b):Po(ii(b),P.index)})}function w(b,P,W){R(function(G){G.style(b,P,W)})}function I(b,P){var W=_o(b,"img"),G=W.length;G?W.forEach(function(Y){l(Y,"load error",function(){--G||P()})}):P()}function O(b){return b?a.length:u.length}function m(){return u.length>n.perPage}return{mount:L,destroy:y,update:g,register:h,get:T,getIn:$,getAt:x,add:S,remove:H,forEach:R,filter:B,style:w,getLength:O,isEnough:m}}function xl(e,t,n){var i=tt(e),o=i.on,s=i.bind,l=i.emit,d=t.Slides,a=t.Direction.resolve,p=t.Elements,u=p.root,L=p.track,C=p.list,y=d.getAt,g=d.style,h,T,$;function x(){S(),s(window,"resize load",tl(Je(l,Rn))),o([xt,st],S),o(Rn,H)}function S(){h=n.direction===Vi,Mt(u,"maxWidth",ln(n.width)),Mt(L,a("paddingLeft"),R(!1)),Mt(L,a("paddingRight"),R(!0)),H(!0)}function H(v){var A=It(u);(v||T.width!==A.width||T.height!==A.height)&&(Mt(L,"height",B()),g(a("marginRight"),ln(n.gap)),g("width",I()),g("height",O(),!0),T=A,l(Hi),$!==($=N())&&(Vt(u,Ba,$),l(Qs,$)))}function R(v){var A=n.padding,_=a(v?"right":"left");return A&&ln(A[_]||(zn(A)?0:A))||"0px"}function B(){var v="";return h&&(v=w(),Bn(v,"height or heightRatio is missing."),v="calc("+v+" - "+R(!1)+" - "+R(!0)+")"),v}function w(){return ln(n.height||It(C).width*n.heightRatio)}function I(){return n.autoWidth?null:ln(n.fixedWidth)||(h?"":m())}function O(){return ln(n.fixedHeight)||(h?n.autoHeight?null:m():w())}function m(){var v=ln(n.gap);return"calc((100%"+(v&&" + "+v)+")/"+(n.perPage||1)+(v&&" - "+v)+")"}function b(){return It(C)[a("width")]}function P(v,A){var _=y(v||0);return _?It(_.slide)[a("width")]+(A?0:Y()):0}function W(v,A){var _=y(v);if(_){var V=It(_.slide)[a("right")],D=It(C)[a("left")];return wt(V-D)+(A?0:Y())}return 0}function G(v){return W(e.length-1)-W(0)+P(0,v)}function Y(){var v=y(0);return v&&parseFloat(Mt(v.slide,a("marginRight")))||0}function k(v){return parseFloat(Mt(L,a("padding"+(v?"Right":"Left"))))||0}function N(){return e.is(li)||G(!0)>b()}return{mount:x,resize:H,listSize:b,slideSize:P,sliderSize:G,totalSize:W,getPadding:k,isOverflow:N}}var Sl=2;function Cl(e,t,n){var i=tt(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,a=[],p;function u(){o(st,L),o([xt,Rn],y),(p=T())&&(g(p),t.Layout.resize(!0))}function L(){C(),u()}function C(){gn(a),Xt(a),i.destroy()}function y(){var $=T();p!==$&&(p<$||!$)&&i.emit(st)}function g($){var x=l.get().slice(),S=x.length;if(S){for(;x.length<$;)$i(x,x);$i(x.slice(-$),x.slice(0,$)).forEach(function(H,R){var B=R<$,w=h(H.slide,R);B?Ao(w,x[0].slide):oi(s.list,w),$i(a,w),l.register(w,R-$+(B?0:S),H.index)})}}function h($,x){var S=$.cloneNode(!0);return Ht(S,n.classes.clone),S.id=e.root.id+"-clone"+ko(x+1),S}function T(){var $=n.clones;if(!e.is(Nn))$=0;else if(ni($)){var x=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=x&&qn(It(s.track)[d("width")]/x);$=S||n[d("autoWidth")]&&e.length||n.perPage*Sl}return $}return{mount:u,destroy:C}}function $l(e,t,n){var i=tt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Layout,a=d.slideSize,p=d.getPadding,u=d.totalSize,L=d.listSize,C=d.sliderSize,y=t.Direction,g=y.resolve,h=y.orient,T=t.Elements,$=T.list,x=T.track,S;function H(){S=t.Transition,o([rn,Hi,xt,st],R)}function R(){t.Controller.isBusy()||(t.Scroll.cancel(),w(e.index),t.Slides.update())}function B(_,V,D,Q){_!==V&&v(_>D)&&(b(),I(m(G(),_>D),!0)),l(Fn),s(Yt,V,D,_),S.start(V,function(){l(In),s(Wn,V,D,_),Q&&Q()})}function w(_){I(W(_,!0))}function I(_,V){if(!e.is(li)){var D=V?_:O(_);Mt($,"transform","translate"+g("X")+"("+D+"px)"),_!==D&&s(Ea)}}function O(_){if(e.is(Nn)){var V=P(_),D=V>t.Controller.getEnd(),Q=V<0;(Q||D)&&(_=m(_,D))}return _}function m(_,V){var D=_-N(V),Q=C();return _-=h(Q*(qn(wt(D)/Q)||1))*(V?1:-1),_}function b(){I(G(),!0),S.cancel()}function P(_){for(var V=t.Slides.get(),D=0,Q=1/0,M=0;M<V.length;M++){var te=V[M].index,f=wt(W(te,!0)-_);if(f<=Q)Q=f,D=te;else break}return D}function W(_,V){var D=h(u(_-1)-k(_));return V?Y(D):D}function G(){var _=g("left");return It($)[_]-It(x)[_]+h(p(!1))}function Y(_){return n.trimSpace&&e.is(Pn)&&(_=Cn(_,0,h(C(!0)-L()))),_}function k(_){var V=n.focus;return V==="center"?(L()-a(_,!0))/2:+V*a(_)||0}function N(_){return W(_?t.Controller.getEnd():0,!!n.trimSpace)}function v(_){var V=h(m(G(),_));return _?V>=0:V<=$[g("scrollWidth")]-It(x)[g("width")]}function A(_,V){V=ni(V)?G():V;var D=_!==!0&&h(V)<h(N(!1)),Q=_!==!1&&h(V)>h(N(!0));return D||Q}return{mount:H,move:B,jump:w,translate:I,shift:m,cancel:b,toIndex:P,toPosition:W,getPosition:G,getLimit:N,exceededLimit:A,reposition:R}}function wl(e,t,n){var i=tt(e),o=i.on,s=i.emit,l=t.Move,d=l.getPosition,a=l.getLimit,p=l.toPosition,u=t.Slides,L=u.isEnough,C=u.getLength,y=n.omitEnd,g=e.is(Nn),h=e.is(Pn),T=Je(G,!1),$=Je(G,!0),x=n.start||0,S,H=x,R,B,w;function I(){O(),o([xt,st,ki],O),o(Hi,m)}function O(){R=C(!0),B=n.perMove,w=n.perPage,S=v();var f=Cn(x,0,y?S:R-1);f!==x&&(x=f,l.reposition())}function m(){S!==v()&&s(ki)}function b(f,ne,ye){if(!te()){var ee=W(f),he=N(ee);he>-1&&(ne||he!==x)&&(D(he),l.move(ee,he,H,ye))}}function P(f,ne,ye,ee){t.Scroll.scroll(f,ne,ye,function(){var he=N(l.toIndex(d()));D(y?tn(he,S):he),ee&&ee()})}function W(f){var ne=x;if(en(f)){var ye=f.match(/([+\-<>])(\d+)?/)||[],ee=ye[1],he=ye[2];ee==="+"||ee==="-"?ne=Y(x+ +(""+ee+(+he||1)),x):ee===">"?ne=he?A(+he):T(!0):ee==="<"&&(ne=$(!0))}else ne=g?f:Cn(f,0,S);return ne}function G(f,ne){var ye=B||(M()?1:w),ee=Y(x+ye*(f?-1:1),x,!(B||M()));return ee===-1&&h&&!pa(d(),a(!f),1)?f?0:S:ne?ee:N(ee)}function Y(f,ne,ye){if(L()||M()){var ee=k(f);ee!==f&&(ne=f,f=ee,ye=!1),f<0||f>S?!B&&(wi(0,f,ne,!0)||wi(S,ne,f,!0))?f=A(_(f)):g?f=ye?f<0?-(R%w||w):R:f:n.rewind?f=f<0?S:0:f=-1:ye&&f!==ne&&(f=A(_(ne)+(f<ne?-1:1)))}else f=-1;return f}function k(f){if(h&&n.trimSpace==="move"&&f!==x)for(var ne=d();ne===p(f,!0)&&wi(f,0,e.length-1,!n.rewind);)f<x?--f:++f;return f}function N(f){return g?(f+R)%R||0:f}function v(){for(var f=R-(M()||g&&B?1:w);y&&f-- >0;)if(p(R-1,!0)!==p(f,!0)){f++;break}return Cn(f,0,R-1)}function A(f){return Cn(M()?f:w*f,0,S)}function _(f){return M()?tn(f,S):Mi((f>=S?R-1:f)/w)}function V(f){var ne=l.toIndex(f);return h?Cn(ne,0,S):ne}function D(f){f!==x&&(H=x,x=f)}function Q(f){return f?H:x}function M(){return!ni(n.focus)||n.isNavigation}function te(){return e.state.is([Fn,ti])&&!!n.waitForTransition}return{mount:I,go:b,scroll:P,getNext:T,getPrev:$,getAdjacent:G,getEnd:v,setIndex:D,getIndex:Q,toIndex:A,toPage:_,toDest:V,hasFocus:M,isBusy:te}}var Tl="http://www.w3.org/2000/svg",Ll="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",pi=40;function El(e,t,n){var i=tt(e),o=i.on,s=i.bind,l=i.emit,d=n.classes,a=n.i18n,p=t.Elements,u=t.Controller,L=p.arrows,C=p.track,y=L,g=p.prev,h=p.next,T,$,x={};function S(){R(),o(xt,H)}function H(){B(),S()}function R(){var P=n.arrows;P&&!(g&&h)&&O(),g&&h&&(Un(x,{prev:g,next:h}),Kn(y,P?"":"none"),Ht(y,$=Vo+"--"+n.direction),P&&(w(),b(),_e([g,h],si,C.id),l(Sa,g,h)))}function B(){i.destroy(),Gt(y,$),T?(gn(L?[g,h]:y),g=h=null):Bt([g,h],zo)}function w(){o([rn,Wn,st,fn,ki],b),s(h,"click",Je(I,">")),s(g,"click",Je(I,"<"))}function I(P){u.go(P,!0)}function O(){y=L||Ln("div",d.arrows),g=m(!0),h=m(!1),T=!0,oi(y,[g,h]),!L&&Ao(y,C)}function m(P){var W='<button class="'+d.arrow+" "+(P?d.prev:d.next)+'" type="button"><svg xmlns="'+Tl+'" viewBox="0 0 '+pi+" "+pi+'" width="'+pi+'" height="'+pi+'" focusable="false"><path d="'+(n.arrowPath||Ll)+'" />';return da(W)}function b(){if(g&&h){var P=e.index,W=u.getPrev(),G=u.getNext(),Y=W>-1&&P<W?a.last:a.prev,k=G>-1&&P>G?a.first:a.next;g.disabled=W<0,h.disabled=G<0,_e(g,Rt,Y),_e(h,Rt,k),l(Ca,g,h,W,G)}}return{arrows:x,mount:S,destroy:B,update:b}}var Il=Mo+"-interval";function Rl(e,t,n){var i=tt(e),o=i.on,s=i.bind,l=i.emit,d=Oi(n.interval,e.go.bind(e,">"),w),a=d.isPaused,p=t.Elements,u=t.Elements,L=u.root,C=u.toggle,y=n.autoplay,g,h,T=y==="pause";function $(){y&&(x(),C&&_e(C,si,p.track.id),T||S(),B())}function x(){n.pauseOnHover&&s(L,"mouseenter mouseleave",function(O){g=O.type==="mouseenter",R()}),n.pauseOnFocus&&s(L,"focusin focusout",function(O){h=O.type==="focusin",R()}),C&&s(C,"click",function(){T?S():H(!0)}),o([Yt,Bi,st],d.rewind),o(Yt,I)}function S(){a()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),h=g=T=!1,B(),l(Ho))}function H(O){O===void 0&&(O=!0),T=!!O,B(),a()||(d.pause(),l(Bo))}function R(){T||(g||h?H(!1):S())}function B(){C&&(Vt(C,hn,!T),_e(C,Rt,n.i18n[T?"play":"pause"]))}function w(O){var m=p.bar;m&&Mt(m,"width",O*100+"%"),l(Ta,O)}function I(O){var m=t.Slides.getAt(O);d.set(m&&+kt(m.slide,Il)||n.interval)}return{mount:$,destroy:d.cancel,play:S,pause:H,isPaused:a}}function Pl(e,t,n){var i=tt(e),o=i.on;function s(){n.cover&&(o(Oo,Je(d,!0)),o([rn,xt,st],Je(l,!0)))}function l(a){t.Slides.forEach(function(p){var u=ri(p.container||p.slide,"img");u&&u.src&&d(a,u,p)})}function d(a,p,u){u.style("background",a?'center/cover no-repeat url("'+p.src+'")':"",!0),Kn(p,a?"none":"")}return{mount:s,destroy:Je(l,!1)}}var Al=10,_l=600,Ml=.6,kl=1.5,Fl=800;function Wl(e,t,n){var i=tt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Move,a=d.getPosition,p=d.getLimit,u=d.exceededLimit,L=d.translate,C=e.is(Pn),y,g,h=1;function T(){o(Yt,H),o([xt,st],R)}function $(w,I,O,m,b){var P=a();if(H(),O&&(!C||!u())){var W=t.Layout.sliderSize(),G=vo(w)*W*Mi(wt(w)/W)||0;w=d.toPosition(t.Controller.toDest(w%W))+G}var Y=pa(P,w,1);h=1,I=Y?0:I||_i(wt(w-P)/kl,Fl),g=m,y=Oi(I,x,Je(S,P,w,b),1),l(ti),s(Bi),y.start()}function x(){l(In),g&&g(),s(fn)}function S(w,I,O,m){var b=a(),P=w+(I-w)*B(m),W=(P-b)*h;L(b+W),C&&!O&&u()&&(h*=Ml,wt(W)<Al&&$(p(u(!0)),_l,!1,g,!0))}function H(){y&&y.cancel()}function R(){y&&!y.isPaused()&&(H(),x())}function B(w){var I=n.easingFunc;return I?I(w):1-Math.pow(1-w,4)}return{mount:T,destroy:H,scroll:$,cancel:R}}var $n={passive:!1,capture:!0};function Nl(e,t,n){var i=tt(e),o=i.on,s=i.emit,l=i.bind,d=i.unbind,a=e.state,p=t.Move,u=t.Scroll,L=t.Controller,C=t.Elements.track,y=t.Media.reduce,g=t.Direction,h=g.resolve,T=g.orient,$=p.getPosition,x=p.exceededLimit,S,H,R,B,w,I=!1,O,m,b;function P(){l(C,to,fo,$n),l(C,no,fo,$n),l(C,Oa,G,$n),l(C,"click",N,{capture:!0}),l(C,"dragstart",zt),o([rn,xt],W)}function W(){var z=n.drag;ue(!z),B=z==="free"}function G(z){if(O=!1,!m){var q=he(z);ee(z.target)&&(q||!z.button)&&(L.isBusy()?zt(z,!0):(b=q?C:window,w=a.is([Fn,ti]),R=null,l(b,to,Y,$n),l(b,no,k,$n),p.cancel(),u.cancel(),v(z)))}}function Y(z){if(a.is(Ci)||(a.set(Ci),s(va)),z.cancelable)if(w){p.translate(S+ye(M(z)));var q=te(z)>yr,ae=I!==(I=x());(q||ae)&&v(z),O=!0,s(ba),zt(z)}else V(z)&&(w=_(z),zt(z))}function k(z){a.is(Ci)&&(a.set(In),s(xa)),w&&(A(z),zt(z)),d(b,to,Y),d(b,no,k),w=!1}function N(z){!m&&O&&zt(z,!0)}function v(z){R=H,H=z,S=$()}function A(z){var q=D(z),ae=Q(q),pe=n.rewind&&n.rewindByDrag;y(!1),B?L.scroll(ae,0,n.snap):e.is(li)?L.go(T(vo(q))<0?pe?"<":"-":pe?">":"+"):e.is(Pn)&&I&&pe?L.go(x(!0)?">":"<"):L.go(L.toDest(ae),!0),y(!0)}function _(z){var q=n.dragMinThreshold,ae=zn(q),pe=ae&&q.mouse||0,$e=(ae?q.touch:+q)||10;return wt(M(z))>(he(z)?$e:pe)}function V(z){return wt(M(z))>wt(M(z,!0))}function D(z){if(e.is(Nn)||!I){var q=te(z);if(q&&q<yr)return M(z)/q}return 0}function Q(z){return $()+vo(z)*tn(wt(z)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function M(z,q){return ne(z,q)-ne(f(z),q)}function te(z){return yo(z)-yo(f(z))}function f(z){return H===z&&R||H}function ne(z,q){return(he(z)?z.changedTouches[0]:z)["page"+h(q?"Y":"X")]}function ye(z){return z/(I&&e.is(Pn)?fl:1)}function ee(z){var q=n.noDrag;return!Vn(z,"."+Fa+", ."+Ui)&&(!q||!Vn(z,q))}function he(z){return typeof TouchEvent<"u"&&z instanceof TouchEvent}function ie(){return w}function ue(z){m=z}return{mount:P,disable:ue,isDragging:ie}}var Hl={Spacebar:" ",Right:zi,Left:Di,Up:Ia,Down:Ra};function Go(e){return e=en(e)?e:e.key,Hl[e]||e}var vr="keydown";function Bl(e,t,n){var i=tt(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,a=t.Direction.resolve,p,u;function L(){C(),o(xt,y),o(xt,C),o(Yt,h)}function C(){var $=n.keyboard;$&&(p=$==="global"?window:d,s(p,vr,T))}function y(){l(p,vr)}function g($){u=$}function h(){var $=u;u=!0,ra(function(){u=$})}function T($){if(!u){var x=Go($);x===a(Di)?e.go("<"):x===a(zi)&&e.go(">")}}return{mount:L,destroy:y,disable:g}}var On=Mo+"-lazy",Ti=On+"-srcset",Ol="["+On+"], ["+Ti+"]";function jl(e,t,n){var i=tt(e),o=i.on,s=i.off,l=i.bind,d=i.emit,a=n.lazyLoad==="sequential",p=[Wn,fn],u=[];function L(){n.lazyLoad&&(C(),o(st,C))}function C(){Xt(u),y(),a?$():(s(p),o(p,g),g())}function y(){t.Slides.forEach(function(x){_o(x.slide,Ol).forEach(function(S){var H=kt(S,On),R=kt(S,Ti);if(H!==S.src||R!==S.srcset){var B=n.classes.spinner,w=S.parentElement,I=ri(w,"."+B)||Ln("span",B,w);u.push([S,x,I]),S.src||Kn(S,"none")}})})}function g(){u=u.filter(function(x){var S=n.perPage*((n.preloadPages||1)+1)-1;return x[1].isWithin(e.index,S)?h(x):!0}),u.length||s(p)}function h(x){var S=x[0];Ht(x[1].slide,Co),l(S,"load error",Je(T,x)),_e(S,"src",kt(S,On)),_e(S,"srcset",kt(S,Ti)),Bt(S,On),Bt(S,Ti)}function T(x,S){var H=x[0],R=x[1];Gt(R.slide,Co),S.type!=="error"&&(gn(x[2]),Kn(H,""),d(Oo,H,R),d(Rn)),a&&$()}function $(){u.length&&h(u.shift())}return{mount:L,destroy:Je(Xt,u),check:g}}function Dl(e,t,n){var i=tt(e),o=i.on,s=i.emit,l=i.bind,d=t.Slides,a=t.Elements,p=t.Controller,u=p.hasFocus,L=p.getIndex,C=p.go,y=t.Direction.resolve,g=a.pagination,h=[],T,$;function x(){S(),o([xt,st,ki],x);var m=n.pagination;g&&Kn(g,m?"":"none"),m&&(o([Yt,Bi,fn],O),H(),O(),s($a,{list:T,items:h},I(e.index)))}function S(){T&&(gn(g?on(T.children):T),Gt(T,$),Xt(h),T=null),i.destroy()}function H(){var m=e.length,b=n.classes,P=n.i18n,W=n.perPage,G=u()?p.getEnd()+1:qn(m/W);T=g||Ln("ul",b.pagination,a.track.parentElement),Ht(T,$=Ki+"--"+w()),_e(T,Ut,"tablist"),_e(T,Rt,P.select),_e(T,Do,w()===Vi?"vertical":"");for(var Y=0;Y<G;Y++){var k=Ln("li",null,T),N=Ln("button",{class:b.page,type:"button"},k),v=d.getIn(Y).map(function(_){return _.slide.id}),A=!u()&&W>1?P.pageX:P.slideX;l(N,"click",Je(R,Y)),n.paginationKeyboard&&l(N,"keydown",Je(B,Y)),_e(k,Ut,"presentation"),_e(N,Ut,"tab"),_e(N,si,v.join(" ")),_e(N,Rt,bo(A,Y+1)),_e(N,En,-1),h.push({li:k,button:N,page:Y})}}function R(m){C(">"+m,!0)}function B(m,b){var P=h.length,W=Go(b),G=w(),Y=-1;W===y(zi,!1,G)?Y=++m%P:W===y(Di,!1,G)?Y=(--m+P)%P:W==="Home"?Y=0:W==="End"&&(Y=P-1);var k=h[Y];k&&(ca(k.button),C(">"+Y),zt(b,!0))}function w(){return n.paginationDirection||n.direction}function I(m){return h[p.toPage(m)]}function O(){var m=I(L(!0)),b=I(L());if(m){var P=m.button;Gt(P,hn),Bt(P,pr),_e(P,En,-1)}if(b){var W=b.button;Ht(W,hn),_e(W,pr,!0),_e(W,En,"")}s(wa,{list:T,items:h},m,b)}return{items:h,mount:x,destroy:S,getAt:I,update:O}}var zl=[" ","Enter"];function Vl(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(g){g.isParent||(p(e,g.splide),p(g.splide,e))}),i&&u()}function d(){s.forEach(function(g){g.destroy()}),Xt(s)}function a(){d(),l()}function p(g,h){var T=tt(g);T.on(Yt,function($,x,S){h.go(h.is(Nn)?S:$)}),s.push(T)}function u(){var g=tt(e),h=g.on;h(Fo,C),h(La,y),h([rn,xt],L),s.push(g),g.emit(No,e.splides)}function L(){_e(t.Elements.list,Do,n.direction===Vi?"vertical":"")}function C(g){e.go(g.index)}function y(g,h){Po(zl,Go(h))&&(C(g),zt(h))}return{setup:Je(t.Media.set,{slideFocus:ni(o)?i:o},!0),mount:l,destroy:d,remount:a}}function Gl(e,t,n){var i=tt(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,$n)}function d(p){if(p.cancelable){var u=p.deltaY,L=u<0,C=yo(p),y=n.wheelMinThreshold||0,g=n.wheelSleep||0;wt(u)>y&&C-s>g&&(e.go(L?"<":">"),s=C),a(L)&&zt(p)}}function a(p){return!n.releaseWheel||e.state.is(Fn)||t.Controller.getAdjacent(p)!==-1}return{mount:l}}var Ul=90;function Kl(e,t,n){var i=tt(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=Ln("span",ul),a=Oi(Ul,Je(u,!1));function p(){l&&(C(!t.Autoplay.isPaused()),_e(s,hr,!0),d.textContent="…",o(Ho,Je(C,!0)),o(Bo,Je(C,!1)),o([Wn,fn],Je(u,!0)))}function u(y){_e(s,gr,y),y?(oi(s,d),a.start()):(gn(d),a.cancel())}function L(){Bt(s,[mr,hr,gr]),gn(d)}function C(y){l&&_e(s,mr,y?"off":"polite")}return{mount:p,disable:C,destroy:L}}var ql=Object.freeze({__proto__:null,Media:nl,Direction:il,Elements:yl,Slides:bl,Layout:xl,Clones:Cl,Move:$l,Controller:wl,Arrows:El,Autoplay:Rl,Cover:Pl,Scroll:Wl,Drag:Nl,Keyboard:Bl,LazyLoad:jl,Pagination:Dl,Sync:Vl,Wheel:Gl,Live:Kl}),Xl={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"},Yl={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:gl,i18n:Xl,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Jl(e,t,n){var i=t.Slides;function o(){tt(e).on([rn,st],s)}function s(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,a){i.style("transition","opacity "+n.speed+"ms "+n.easing),ra(a)}return{mount:o,start:l,cancel:fo}}function Zl(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=Je(Mt,l,"transition"),a;function p(){tt(e).bind(l,"transitionend",function(y){y.target===l&&a&&(L(),a())})}function u(y,g){var h=i.toPosition(y,!0),T=i.getPosition(),$=C(y);wt(h-T)>=1&&$>=1?n.useScroll?s.scroll(h,$,!1,g):(d("transform "+$+"ms "+n.easing),i.translate(h,!0),a=g):(i.jump(y),g())}function L(){d(""),s.cancel()}function C(y){var g=n.rewindSpeed;if(e.is(Pn)&&g){var h=o.getIndex(!0),T=o.getEnd();if(h===0&&y>=T||h>=T&&y===0)return g}return n.speed}return{mount:p,start:u,cancel:L}}var Ql=(function(){function e(n,i){this.event=tt(),this.Components={},this.state=el(Tn),this.splides=[],this._o={},this._E={};var o=en(n)?ua(document,n):n;Bn(o,o+" is invalid."),this.root=o,i=Qt({label:kt(o,Rt)||"",labelledby:kt(o,jo)||""},Yl,e.defaults,i||{});try{Qt(i,JSON.parse(kt(o,Mo)))}catch{Bn(!1,"Invalid JSON")}this._o=Object.create(Qt({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,l=this.state,d=this.Components;Bn(l.is([Tn,Ai]),"Already mounted!"),l.set(Tn),this._C=d,this._T=o||this._T||(this.is(li)?Jl:Zl),this._E=i||this._E;var a=Un({},ql,this._E,{Transition:this._T});return mn(a,function(p,u){var L=p(s,d,s._o);d[u]=L,L.setup&&L.setup()}),mn(d,function(p){p.mount&&p.mount()}),this.emit(rn),Ht(this.root,pl),l.set(In),this.emit(xo),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(In)&&(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(on(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(st),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,s=this.state;return s.is(Tn)?tt(this).on(xo,this.destroy.bind(this,i)):(mn(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Wo),o.destroy(),i&&Xt(this.splides),s.set(Ai)),this},Xs(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})(),Uo=Ql;Uo.defaults={};Uo.STATES=Js;var br=[[rn,"onMounted"],[xo,"onReady"],[Yt,"onMove"],[Wn,"onMoved"],[Fo,"onClick"],[ga,"onActive"],[ha,"onInactive"],[fa,"onVisible"],[ya,"onHidden"],[st,"onRefresh"],[xt,"onUpdated"],[Rn,"onResize"],[Hi,"onResized"],[va,"onDrag"],[ba,"onDragging"],[xa,"onDragged"],[Bi,"onScroll"],[fn,"onScrolled"],[Wo,"onDestroy"],[Sa,"onArrowsMounted"],[Ca,"onArrowsUpdated"],[$a,"onPaginationMounted"],[wa,"onPaginationUpdated"],[No,"onNavigationMounted"],[Ho,"onAutoplayPlay"],[Ta,"onAutoplayPlaying"],[Bo,"onAutoplayPause"],[Oo,"onLazyLoadLoaded"]];function Ko(...e){return e.filter(Boolean).join(" ")}function Fi(e){return e!==null&&typeof e=="object"}function $o(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!$o(n,t[i]));if(Fi(e)&&Fi(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!$o(e[o],t[o]))}return e===t}function ec(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function tc(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 wo(e,t){const n=e;return tc(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Fi(i)?n[o]=wo(Fi(n[o])?n[o]:{},i):n[o]=i}),n}var nc=({children:e,className:t,...n})=>c.createElement("div",{className:Ko("splide__track",t),...n},c.createElement("ul",{className:"splide__list"},e)),qo=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 Uo(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=wo({},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&&!$o(this.options,e)&&(this.splide.options=e,this.options=wo({},e));const t=this.getSlides();ec(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){br.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:Ko("splide",e),ref:this.splideRef,...this.omit(o,["options",...br.map(s=>s[1])])},n?c.createElement(nc,null,i):i)}},Xo=({children:e,className:t,...n})=>c.createElement("li",{className:Ko("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 nc="RichTextRenderer-module__link___BWeZ2",ic={link:nc},oc=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))},qi=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>oc(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function Nt(e){const{color:t,...n}=e;return n}function vt(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:qi(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:E.scalingValue(e.letterSpacing,t),wordSpacing:E.scalingValue(e.wordSpacing,t),fontSize:E.scalingValue(n,t),lineHeight:i!==void 0?E.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Yn=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:ic.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:rc(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 rc(e){return{...e.fontFamily&&{fontFamily:qi(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 ac="SvgImage-module__svg___q3xE-",sc="SvgImage-module__img___VsTm-",xr={svg:ac,img:sc},lc=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},cc=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Ht=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,l]=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("")');l(d)}},[]),!lc(e)||!s?r.jsx("img",{src:e,alt:"",className:De(xr.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:De(xr.svg,i),style:{"--svg":cc(e),"--fill":t,"--hover-fill":n,...o??{}}})},dc={"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 uc({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=c.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:a,textAlign:p,wordSpacing:u,fontSizeLineHeight:L,textAppearance:C,color:y}=n.imageCaption??{},[g,h]=c.useState(void 0),[T,$]=c.useState(null),[x,S]=c.useState(0),[H,R]=c.useState(0),{direction:B,transition:w,controls:I,pagination:O,imageCaption:m,triggers:b}=e,P=c.useRef(w.type),{x:W,y:G}=e.controls.offset,Y=k=>{o&&o.go(k)};return c.useEffect(()=>{if(!T)return;const k=new ResizeObserver(N=>{if(!o)return;const[v]=N;h({width:Math.round(v.contentRect.width),height:Math.round(v.contentRect.height)})});return k.observe(T),()=>k.unobserve(T)},[T]),c.useEffect(()=>{!o||P.current===w.type||(R(k=>k+1),P.current=w.type)},[w.type]),r.jsx("div",{className:De(ye.wrapper,{[ye.editor]:i}),ref:$,children:r.jsxs("div",{className:ye.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:w.backgroundColor&&w.type==="fade in"?w.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:De(ye.captionBlock),children:r.jsx("div",{className:ye.captionTextWrapper,children:t.map((k,N)=>r.jsx("div",{className:De(ye.captionText,dc[m.alignment],{[ye.withPointerEvents]:N===x&&i,[ye.active]:N===x}),style:{fontFamily:qi(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":E.scalingValue(l.width,i),letterSpacing:E.scalingValue(a,i),wordSpacing:E.scalingValue(u,i),textAlign:p,fontSize:E.scalingValue(L.fontSize,i),lineHeight:E.scalingValue(L.lineHeight,i),textTransform:C.textTransform??"none",textDecoration:C.textDecoration??"none",fontVariant:C.fontVariant??"normal",color:y,transitionDuration:w.duration?`${Math.round(parseInt(w.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:ye.captionTextInner,style:{"--link-hover-color":m.linkHoverColor,"--link-color":m.linkColor,position:"relative",top:E.scalingValue(m.offset.y,i),left:E.scalingValue(m.offset.x,i)},children:r.jsx(Yn,{content:k.imageCaption})})},N))})}),r.jsx(qo,{onMove:k=>{S(k.index)},ref:s,options:{arrows:!1,speed:w.duration?parseInt(w.duration):500,autoplay:b.autoPlay!==null,...b.autoPlay!==null&&{interval:parseInt(b.autoPlay)*1e3},direction:B==="horiz"||w.type==="fade in"?"ltr":"ttb",pagination:!1,drag:b.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:w.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((k,N)=>r.jsx(Xo,{children:r.jsx("div",{className:ye.sliderItem,children:r.jsx("div",{className:ye.imgWrapper,children:r.jsx("img",{className:De(ye.sliderImage,{[ye.contain]:k.image.objectFit==="contain",[ye.cover]:k.image.objectFit==="cover"}),src:k.image.url,alt:k.image.name??""})})})},N))},H),I.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De(ye.arrow,{[ye.arrowVertical]:B==="vert",[ye.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:r.jsxs("button",{onClick:()=>{Y("-1")},className:ye.arrowInner,style:{transform:`translate(${E.scalingValue(W,i)}, ${E.scalingValue(G*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&r.jsx(Ht,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:De(ye.arrowImg,ye.mirror)}),!I.arrowsImgUrl&&r.jsx(Sr,{color:I.color,className:De(ye.arrowIcon,ye.arrowImg,ye.mirror)})]})}),r.jsx("div",{className:De(ye.arrow,ye.nextArrow,{[ye.arrowVertical]:B==="vert",[ye.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:r.jsxs("button",{className:ye.arrowInner,onClick:()=>Y("+1"),style:{transform:`translate(${E.scalingValue(W*(B==="horiz"?-1:1),i)}, ${E.scalingValue(G,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&r.jsx(Ht,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:ye.arrowImg}),!I.arrowsImgUrl&&r.jsx(Sr,{color:I.color,className:De(ye.arrowIcon,ye.arrowImg)})]})})]}),b.triggersList.click&&r.jsx("div",{className:ye.clickOverlay,onClick:()=>{o&&o.go("+1")}}),O.isActive&&r.jsx("div",{className:De(ye.pagination,{[ye.paginationInsideBottom]:O.position==="inside-1"&&B==="horiz",[ye.paginationInsideTop]:O.position==="inside-2"&&B==="horiz",[ye.paginationOutsideBottom]:O.position==="outside-1"&&B==="horiz",[ye.paginationOutsideTop]:O.position==="outside-2"&&B==="horiz",[ye.paginationInsideLeft]:O.position==="inside-1"&&B==="vert",[ye.paginationInsideRight]:O.position==="inside-2"&&B==="vert",[ye.paginationOutsideLeft]:O.position==="outside-1"&&B==="vert",[ye.paginationOutsideRight]:O.position==="outside-2"&&B==="vert",[ye.paginationVertical]:B==="vert"}),children:r.jsx("div",{className:ye.paginationInner,style:{backgroundColor:O.colors[2],transform:`scale(${O.scale/100}) translate(${E.scalingValue(O.offset.x,i)}, ${E.scalingValue(O.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((k,N)=>r.jsx("button",{onClick:()=>{o&&o.go(N)},className:De(ye.paginationItem),children:r.jsx("div",{className:De(ye.dot,{[ye.activeDot]:N===x}),style:{backgroundColor:N===x?O.colors[0]:O.colors[1],"--pagination-hover-color":O.hover}})},N))})})]})})}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 pc={element:uc,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"]}},mc="ImageRevealSlider-module__imageRevealSlider___UE5Ob",gc="ImageRevealSlider-module__image___Qjt-e",hc="ImageRevealSlider-module__link___N-iLG",fc="ImageRevealSlider-module__cursor___2U03d",Sn={imageRevealSlider:mc,image:gc,link:hc,cursor:fc};function Cr(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const s=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*s,d=s/2,a=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-a&&t<=i.y+a)return!0}return!1}function io(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function yc(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await io(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await io(e);s=l.height/l.width*o}else{const l=await io(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function vc({settings:e,content:t,isEditor:n}){const[i,o]=c.useState(null),[s,l]=c.useState([]),[d,a]=c.useState(0),p=c.useRef(0),[u,L]=c.useState({x:0,y:0}),[C,y]=c.useState(1),[g,h]=c.useState("none"),T=c.useRef({x:0,y:0}),[$,x]=c.useState(!1),{sizeType:S,imageWidth:H,randomRangeImageWidth:R}=e.imageSize,{revealPosition:B,visible:w}=e.position,{cursorType:I,target:O,defaultCursorScale:m,defaultCursor:b,hoverCursorScale:P,hoverCursor:W}=e.cursor;c.useEffect(()=>{if(!i)return;const k=(_,A)=>{const V=i.getBoundingClientRect(),D=_-V.left,Z=A-V.top;if(L({x:D,y:Z}),I==="system"){h("none"),y(1);return}const M=D,te=Z,f=document.elementFromPoint(V.left+M,V.top+te);if(f&&f.closest("a")){h("none"),y(1);return}const ne=Cr(M,te,s)||O==="area"?{img:W??"none",scale:P}:{img:b??"none",scale:m};h(ne.img),y(ne.scale)},N=_=>{_.stopPropagation(),T.current={x:_.clientX,y:_.clientY},k(_.clientX,_.clientY)},v=()=>{$&&k(T.current.x,T.current.y)};return i.addEventListener("mousemove",N),window.addEventListener("scroll",v,!0),()=>{i.removeEventListener("mousemove",N),window.removeEventListener("scroll",v,!0)}},[i,$,u,I,O,W,b,P,m,s]),c.useEffect(()=>{$||(h("none"),y(0))},[$]);const G=async(k,N,v,_={})=>{const{width:A,height:V,finalWidth:D}=await yc(k.image.url,S,H,R);let Z=0,M=0;B==="same"?(Z=N/2,M=v/2):(Z=_.x??Math.random()*N,M=_.y??Math.random()*v);const te=Math.min(Math.max(Z,A/2),N-A/2),f=Math.min(Math.max(M,V/2),v-V/2);return{id:p.current++,url:k.image.url,link:k.link,name:k.image.name,x:te,y:f,width:D}};c.useEffect(()=>{if(!i||t.length===0)return;const k=i.getBoundingClientRect(),N=k.width,v=k.height,_=[];(async()=>{const V=t[0],D=await G(V,N,v);_.push(D),l(_),a(1)})()},[S,H,R,B,i]),c.useEffect(()=>{w==="last One"&&l(k=>k.length>0?[k[k.length-1]]:[])},[w]);const Y=async k=>{if(!i)return;const N=i.getBoundingClientRect(),v=k.clientX-N.left,_=k.clientY-N.top;if(O==="image"&&!Cr(v,_,s))return;let A=0,V=0;B==="on Click"?(A=v,V=_):B==="same"?(A=N.width/2,V=N.height/2):(A=Math.random()*N.width,V=Math.random()*N.height);const D=t[d],Z=await G(D,N.width,N.height,{x:A,y:V});l(M=>w==="all"?[...M,Z]:[Z]),a(M=>M>=t.length-1?0:M+1)};return r.jsxs("div",{ref:o,onClick:Y,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),className:Sn.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[s.map(k=>r.jsx("div",{className:Sn.wrapper,style:{top:`${k.y}px`,left:`${k.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:k.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:O==="area"&&k.link?r.jsx("a",{href:k.link,target:"_blank",className:Sn.link,children:r.jsx("img",{src:k.url,alt:k.name,className:Sn.image},k.id)}):r.jsx("img",{src:k.url,alt:k.name,className:Sn.image},k.id)},k.id)),$&&r.jsx("div",{className:Sn.cursor,style:{left:`${u.x}px`,top:`${u.y}px`,transform:`translate(-50%, -50%) scale(${C})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const bc={element:vc,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:""}]}}}},xc="LightBox-module__hidden___9s-9x",Sc="LightBox-module__heroImage___sTxNF",Cc="LightBox-module__background___rm9ml",$c="LightBox-module__editor___4ACaY",wc="LightBox-module__contentStyle___Bgnsq",Tc="LightBox-module__imageStyle___tLIlB",Lc="LightBox-module__imgWrapper___LuFUp",Ec="LightBox-module__contain___8-yaS",Ic="LightBox-module__cover___hNvOG",Rc="LightBox-module__caption___b6L2I",Pc="LightBox-module__captionTextInner___rCGNH",_c="LightBox-module__lightboxSplide___XFuWC",Ac="LightBox-module__arrow___iz38X",Mc="LightBox-module__arrowVertical___Zfz81",kc="LightBox-module__nextArrow___zkAQN",Fc="LightBox-module__arrowInner___p48sW",Wc="LightBox-module__arrowIcon___3VaFf",Nc="LightBox-module__arrowImg___pNV88",Hc="LightBox-module__mirror___pjeXc",Bc="LightBox-module__thumbsWrapper___GB-nU",Oc="LightBox-module__thumbsContainerVertical___wttk5",jc="LightBox-module__thumbsContainer___osSma",Dc="LightBox-module__thumbsAlignStart___MO6tY",zc="LightBox-module__thumbsAlignCenter___Q4sUx",Vc="LightBox-module__thumbsAlignEnd___p4y9R",Gc="LightBox-module__thumbItem___HvnF3",Uc="LightBox-module__closeButton___g2khP",Kc="LightBox-module__fadeIn___0m5GW",qc="LightBox-module__slideInLeft___gPYwC",Xc="LightBox-module__slideInRight___S-pPp",Yc="LightBox-module__slideInTop___DFdAj",Jc="LightBox-module__slideInBottom___m27kZ",Zc="LightBox-module__fadeOut___55qBR",Qc="LightBox-module__slideOutLeft___NvU7P",ed="LightBox-module__slideOutRight___SK7eC",td="LightBox-module__slideOutTop___Vgg0z",nd="LightBox-module__slideOutBottom___nJ0Ef",id="LightBox-module__scaleSlide___vZriG",le={hidden:xc,heroImage:Sc,background:Cc,editor:$c,contentStyle:wc,imageStyle:Tc,imgWrapper:Lc,contain:Ec,cover:Ic,caption:Rc,captionTextInner:Pc,lightboxSplide:_c,arrow:Ac,arrowVertical:Mc,nextArrow:kc,arrowInner:Fc,arrowIcon:Wc,arrowImg:Nc,mirror:Hc,thumbsWrapper:Bc,thumbsContainerVertical:Oc,thumbsContainer:jc,thumbsAlignStart:Dc,thumbsAlignCenter:zc,thumbsAlignEnd:Vc,thumbItem:Gc,closeButton:Uc,fadeIn:Kc,slideInLeft:qc,slideInRight:Xc,slideInTop:Yc,slideInBottom:Jc,fadeOut:Zc,slideOutLeft:Qc,slideOutRight:ed,slideOutTop:td,slideOutBottom:nd,scaleSlide:id},mi=(e,t,n)=>{const i={},[o,s]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),s==="left"?(i.left="0",i.right="auto"):s==="center"?(i.left="50%",i.right="auto"):s==="right"&&(i.left="auto",i.right="0"),o==="middle"&&s==="center"?i.transform=`translate(calc(-50% + ${E.scalingValue(t.x,n)}), calc(-50% + ${E.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${E.scalingValue(t.x,n)}, calc(-50% + ${E.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${E.scalingValue(t.x,n)}), ${E.scalingValue(t.y,n)})`:i.transform=`translate(${E.scalingValue(t.x,n)}, ${E.scalingValue(t.y,n)})`,i};function ja(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 $r(e){const t=e.getBoundingClientRect(),n=ja(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,l=e.naturalHeight,d=i/o,a=s/l;let p,u;a>d?(p=i,u=i/a):(u=o,p=o*a);const L=t.left+n.left,C=t.top+n.top,y=(i-p)/2+L,g=(o-u)/2+C;return{x:y,y:g,width:p,height:u}}function wr(e){const t=e.getBoundingClientRect(),n=ja(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Tr(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 od(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})(),s=(()=>{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:s}}const rd=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:l})=>{const[d,a]=c.useState(!1),{url:p}=e.thumbnailBlock.cover;return c.useEffect(()=>{o==="close"&&a(!1),o==="open"&&a(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:p,alt:"Cover",className:le.heroImage,onClick:()=>a(!0)}),r.jsx(ad,{isOpen:d,onClose:()=>a(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},ad=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var Ee;const{widthSettings:a,fontSettings:p,letterSpacing:u,textAlign:L,wordSpacing:C,fontSizeLineHeight:y,textAppearance:g,color:h}=i.imageCaption??{},[T,$]=c.useState(0),[x,S]=c.useState(0),[H,R]=c.useState(!1),[B,w]=c.useState(!1),[I,O]=c.useState({}),m=c.useRef(null),b=c.useRef(null),P=c.useRef(null),W=c.useRef(!1),G=c.useRef(null),Y=c.useRef(null),k=c.useRef(null),N=c.useRef(null),v=c.useRef(!1),_=c.useRef(null),[A,V]=c.useState(!1),{appear:D,triggers:Z,slider:M,thumbnail:te,controls:f,area:ne,caption:fe,layout:ee}=o.lightboxBlock,{appearClass:he,backdropAppearClass:oe,backdropDisappearClass:ue,disappearClass:z}=od(D.type,D.direction),X=(d==null?void 0:d.itemId)??null;c.useEffect(()=>{const j=()=>{setTimeout(()=>{var F,U;(U=(F=m.current)==null?void 0:F.splide)==null||U.refresh()},16)},se=()=>{S(F=>F+1)};return window.addEventListener("ArticleEditor.Layout:change",j),window.addEventListener("ArticleEditor.ComponentContent:change",se),()=>{window.removeEventListener("ArticleEditor.Layout:change",j),window.removeEventListener("ArticleEditor.ComponentContent:change",se)}},[]),c.useEffect(()=>{if(!e||!te.isActive){V(!1);return}const j=_.current;if(!j)return;const se=()=>{M.direction==="horiz"?V(j.scrollWidth>j.clientWidth):V(j.scrollHeight>j.clientHeight)};se();const F=new ResizeObserver(se);return F.observe(j),()=>F.disconnect()},[e,te.isActive,n.length,I,M.direction]);const ae=c.useCallback(()=>{const j=window.matchMedia("(max-width: 768px)").matches,se=Tr(ne.color);j&&!l&&se>.9&&(document.body.style.backgroundColor=""),R(!0),W.current=!0;const F=U=>{U.target===G.current&&U.animationName&&(G.current&&Y.current&&G.current.removeEventListener("animationend",Y.current),Y.current=null,W.current&&(W.current=!1,t()),R(!1))};G.current&&(Y.current=F,G.current.addEventListener("animationend",F))},[t,ne.color,l]),pe=(j,se,F)=>{var U,q;if(j){if(Z.type==="click"&&Z.switch==="image")Z.repeat==="close"&&T===n.length-1?ae():(U=m.current)==null||U.go("+1");else if(Z.type==="click"&&Z.switch==="50/50"){const J=j.getBoundingClientRect(),re=se-J.left,me=F-J.top,ke=J.width,Ce=J.height;let xe;M.direction==="horiz"?xe=re<ke/2?"-1":"+1":xe=me<Ce/2?"-1":"+1",(q=m.current)==null||q.go(xe)}}},Se=j=>{if(v.current){v.current=!1;return}const se=n[T],F=(se==null?void 0:se.image.objectFit)==="cover";let U,q;if("changedTouches"in j&&j.changedTouches.length>0)U=j.changedTouches[0].clientX,q=j.changedTouches[0].clientY;else if("clientX"in j)U=j.clientX,q=j.clientY;else return;let J;if(F&&P.current){const re=wr(P.current);J=U>=re.left&&U<=re.right&&q>=re.top&&q<=re.bottom}else{const re=P.current?$r(P.current):null;if(!re){j.target===j.currentTarget&&ae();return}J=U>=re.x&&U<=re.x+re.width&&q>=re.y&&q<=re.y+re.height}J?pe(P.current,U,q):ae()},Re=j=>{const se=j.target;(se.classList.contains(le.thumbsWrapper)||se.classList.contains(le.thumbsContainer))&&Se(j)};c.useEffect(()=>{if(!e)return;const j=se=>{var F,U;if(se.key==="Escape"){ae();return}if(se.key==="ArrowRight"){$(q=>(q+1)%Math.max(n.length,1)),(F=m.current)==null||F.go("+1");return}se.key==="ArrowLeft"&&($(q=>(q-1+Math.max(n.length,1))%Math.max(n.length,1)),(U=m.current)==null||U.go("-1"))};return window.addEventListener("keydown",j),()=>{window.removeEventListener("keydown",j)}},[e,ae,n.length]),c.useEffect(()=>{if(e){if($(0),S(se=>se+1),W.current=!1,R(!1),w(!1),O({}),!X)return;const j=new CustomEvent("page-overlay",{detail:{itemId:X}});window.dispatchEvent(j)}return()=>{G.current&&Y.current&&(G.current.removeEventListener("animationend",Y.current),Y.current=null),w(!1)}},[e,X]),c.useEffect(()=>{b.current!==null&&b.current!==M.type&&S(j=>j+1),b.current=M.type},[M.type]),c.useEffect(()=>{if(!e)return;const j=document.body.style.overflow,se=window.matchMedia("(max-width: 768px)").matches,F=Tr(ne.color);document.body.style.overflow="hidden",w(!1);const U=J=>{J.target===G.current&&!W.current&&J.animationName&&(se&&!l&&F>.9&&(document.body.style.backgroundColor=ne.color),w(!0),G.current&&k.current&&G.current.removeEventListener("animationend",k.current),k.current=null)};G.current&&(k.current=U,G.current.addEventListener("animationend",U));const q=J=>{const re=J.target;re&&(re.closest(`.${le.thumbsWrapper}`)||re.closest(`.${le.thumbsContainer}`))||M.type!=="slide"&&J.preventDefault()};return document.addEventListener("touchmove",q,{passive:!1}),()=>{document.body.style.overflow=j,document.removeEventListener("touchmove",q),G.current&&k.current&&(G.current.removeEventListener("animationend",k.current),k.current=null),w(!1)}},[e,l,ne.color,M.type]),c.useEffect(()=>{if(!e)return;const j=se=>{var U,q;if(W.current){se.stopPropagation();return}if(v.current){v.current=!1;return}const F=se.target;if(!(F&&(F.closest(`.${le.thumbsContainer}`)||F.closest(`.${le.thumbItem}`)||F.closest(`.${le.arrow}`)||F.closest(`.${le.closeButton}`)||F.closest(`.${le.caption}`)))){if(M.type==="slide"&&Z.type==="drag"&&((q=(U=m.current)==null?void 0:U.splide)!=null&&q.root)){const J=m.current.splide.root;if(F&&(J.contains(F)||J===F))return}if(se.touches.length===0&&se.changedTouches.length>0){const J=n[T],re=(J==null?void 0:J.image.objectFit)==="cover",me=se.changedTouches[0];let ke;if(re&&P.current){const Ce=wr(P.current);ke=me.clientX>=Ce.left&&me.clientX<=Ce.right&&me.clientY>=Ce.top&&me.clientY<=Ce.bottom}else{const Ce=P.current?$r(P.current):null;if(!Ce)return;ke=me.clientX>=Ce.x&&me.clientX<=Ce.x+Ce.width&&me.clientY>=Ce.y&&me.clientY<=Ce.y+Ce.height}if(!ke){se.stopPropagation(),W.current=!0;const Ce=xe=>{xe.stopPropagation(),xe.preventDefault(),document.removeEventListener("click",Ce,!0)};document.addEventListener("click",Ce,!0),ae()}}}};return document.addEventListener("touchend",j,{passive:!0}),()=>{document.removeEventListener("touchend",j)}},[e,ae,T,n]);const Le=(M.type==="scale"||M.type==="fade")&&M.direction==="vert"&&Z.type==="drag";c.useEffect(()=>{var xe,ze;if(!e||!Le||!((ze=(xe=m.current)==null?void 0:xe.splide)!=null&&ze.root))return;const j=m.current.splide.root,se=30,F=(ce,Te)=>{if(N.current){const Fe=Math.abs(ce-N.current.x),We=Math.abs(Te-N.current.y);(Fe>0||We>0)&&(v.current=!0)}},U=ce=>{N.current&&(ce.preventDefault(),F(ce.clientX,ce.clientY))},q=ce=>{N.current&&ce.touches.length>0&&(ce.preventDefault(),F(ce.touches[0].clientX,ce.touches[0].clientY))},J=(ce,Te)=>{if(!N.current||!m.current){N.current=null;return}const Fe=Math.abs(ce-N.current.x),We=Math.abs(Te-N.current.y);We>se&&We>Fe&&m.current.go(Te<N.current.y?"+1":"-1"),N.current=null},re=ce=>{N.current&&J(ce.clientX,ce.clientY),document.removeEventListener("pointerup",re),document.removeEventListener("pointercancel",re),document.removeEventListener("pointermove",U)},me=ce=>{if(N.current){if(ce.changedTouches.length>0){const Te=ce.changedTouches[0];J(Te.clientX,Te.clientY)}document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),document.removeEventListener("touchmove",q)}},ke=ce=>{N.current={x:ce.clientX,y:ce.clientY},v.current=!1,document.addEventListener("pointermove",U,{passive:!1}),document.addEventListener("pointerup",re),document.addEventListener("pointercancel",re)},Ce=ce=>{ce.touches.length>0&&(N.current={x:ce.touches[0].clientX,y:ce.touches[0].clientY},v.current=!1,document.addEventListener("touchmove",q,{passive:!1}),document.addEventListener("touchend",me),document.addEventListener("touchcancel",me))};return j.addEventListener("pointerdown",ke),j.addEventListener("touchstart",Ce),()=>{j.removeEventListener("pointerdown",ke),j.removeEventListener("touchstart",Ce),document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",re),document.removeEventListener("pointercancel",re),document.removeEventListener("touchmove",q),document.removeEventListener("touchend",me),document.removeEventListener("touchcancel",me),N.current=null,v.current=!1}},[e,Le,x]);const Me={backgroundColor:ne.color,backdropFilter:`blur(${ne.blur}px)`,animationDuration:`${parseInt(D.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:ei.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:l?null:G,className:De(le.background,H?ue:oe,{[le.editor]:l},{[le.hidden]:!e}),style:{...Me,...B&&!l&&!H?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?G:null,className:De(le.contentStyle,H?z:he,{[le.editor]:l},{[le.hidden]:!e}),style:{animationDuration:`${parseInt(D.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(qo,{onMove:j=>$(j.index),ref:m,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"&&!Le,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((j,se)=>{const F=mi(ee.position,ee.offset,l),U=`${E.scalingValue(ee.padding.top,l)} ${E.scalingValue(ee.padding.right,l)} ${E.scalingValue(ee.padding.bottom,l)} ${E.scalingValue(ee.padding.left,l)}`,q=M.type==="scale"?(()=>{const{transform:J,...re}=F;return{...re,position:"absolute",padding:U,boxSizing:"border-box","--position-transform":J||"none"}})():{...F,position:"absolute",padding:U,boxSizing:"border-box"};return r.jsx(Xo,{children:r.jsx("div",{className:le.imgWrapper,onClick:Se,children:r.jsx("img",{ref:se===T?P:null,className:De(le.imageStyle,{[le.contain]:j.image.objectFit==="contain",[le.cover]:j.image.objectFit==="cover",[le.scaleSlide]:M.type==="scale"}),src:j.image.url,alt:j.image.name??"",style:{...q,pointerEvents:j.image.objectFit==="contain"?"none":"auto"}})})},se)})},x),f.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De(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(${E.scalingValue(f.offset.x,l)}, ${E.scalingValue(f.offset.y*(M.direction==="horiz"?1:-1),l)}) scale(${f.scale}) rotate(${M.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=m.current)==null?void 0:j.go("-1")},"aria-label":"Previous",children:[f.arrowsImgUrl&&r.jsx(Ht,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:De(le.arrowImg,le.mirror)}),!f.arrowsImgUrl&&r.jsx(Lr,{color:f.color,className:De(le.arrowIcon,le.arrowImg,le.mirror)})]})}),r.jsx("div",{className:De(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(${E.scalingValue(f.offset.x*(M.direction==="horiz"?-1:1),l)}, ${E.scalingValue(f.offset.y,l)}) scale(${f.scale}) rotate(${M.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=m.current)==null?void 0:j.go("+1")},"aria-label":"Next",children:[f.arrowsImgUrl&&r.jsx(Ht,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:le.arrowImg}),!f.arrowsImgUrl&&r.jsx(Lr,{color:f.color,className:De(le.arrowIcon,le.arrowImg)})]})})]}),ne.closeIconUrl&&(()=>{const j=mi(ne.closeIconAlign,ne.closeIconOffset,l),se=`scale(${ne.closeIconScale})`,F=j.transform?`${j.transform} ${se}`:se;return r.jsx("button",{className:le.closeButton,style:{...j,transform:F},onClick:ae,"aria-label":"Close lightbox",children:r.jsx(Ht,{url:ne.closeIconUrl,fill:ne.closeIconColor??"#000000",hoverFill:ne.closeIconHover??"#cccccc"})})})(),fe&&fe.isActive&&i.imageCaption&&((Ee=n[T])==null?void 0:Ee.imageCaption)&&r.jsx("div",{className:le.caption,style:{...mi(fe.alignment,fe.offset,l),fontFamily:qi(p.fontFamily),fontWeight:p.fontWeight,fontStyle:p.fontStyle,width:a.sizing==="auto"?"max-content":E.scalingValue(a.width,l),letterSpacing:E.scalingValue(u,l),wordSpacing:E.scalingValue(C,l),textAlign:L,fontSize:E.scalingValue(y.fontSize,l),lineHeight:E.scalingValue(y.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:h},onClick:j=>j.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:le.captionTextInner,style:{"--link-color":fe.linkColor,"--link-hover-color":fe.linkHoverColor},children:r.jsx(Yn,{content:n[T].imageCaption})})}),te.isActive&&(()=>{const[j,se]=te.position.split("-"),F=M.direction==="horiz"?`${j}-left`:te.position,U=mi(F,te.offset,l),q=()=>{if(M.direction==="horiz"){if(se==="left")return"flex-start";if(se==="center")return"center";if(se==="right")return"flex-end"}else{if(j==="top")return"flex-start";if(j==="middle")return"center";if(j==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:_,className:le.thumbsWrapper,onClick:J=>Re(J),style:{position:l?"absolute":"fixed",...U,...M.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:De(le.thumbsContainer,{[le.thumbsContainerVertical]:M.direction==="vert",[le.thumbsAlignStart]:te.align==="start",[le.thumbsAlignCenter]:te.align==="center",[le.thumbsAlignEnd]:te.align==="end"}),style:{gap:E.scalingValue(te.grid.gap,l),justifyContent:A?"flex-start":q()},children:n.map((J,re)=>{const me=re===T,ke=I[re],xe=te.grid.size*(me?te.activeState.scale:1),ze=()=>{if(te.fit!=="fit")return{};if(!ke)return M.direction==="horiz"?{height:E.scalingValue(xe,l)}:{width:E.scalingValue(xe,l)};const ce=ke.width/ke.height;if(M.direction==="horiz"){const Te=xe,Fe=Te*ce;return{width:E.scalingValue(Fe,l),height:E.scalingValue(Te,l)}}else{const Te=xe,Fe=Te/ce;return{width:E.scalingValue(Te,l),height:E.scalingValue(Fe,l)}}};return r.jsx("button",{className:le.thumbItem,style:{...M.direction==="horiz"&&te.fit!=="fit"?{height:E.scalingValue(xe,l)}:{},...M.direction==="vert"&&te.fit!=="fit"?{width:E.scalingValue(xe,l)}:{},...te.fit==="cover"?{width:E.scalingValue(xe,l),height:E.scalingValue(xe,l)}:{},...ze(),transition:me?"all 0.25s ease-out":"none",opacity:me?te.activeState.opacity/100:te.opacity/100,"--thumb-hover":te.activeState.opacity/100},onClick:ce=>{var Te;ce.stopPropagation(),$(re),(Te=m.current)==null||Te.go(re)},onMouseEnter:()=>{var ce;te.triggers==="hov"&&((ce=m.current)==null||ce.go(re))},children:r.jsx("img",{src:J.image.url,alt:J.image.name??"",onLoad:ce=>{const Te=ce.currentTarget;Te.naturalWidth&&Te.naturalHeight&&O(Fe=>({...Fe,[re]:{width:Te.naturalWidth,height:Te.naturalHeight}}))},style:{objectFit:te.fit==="cover"?"cover":"contain",...te.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...te.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${J.image.name}-${re}`)})})})})()]})]}),document.getElementById(s))};function Lr({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 sd={element:rd,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 gi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ld(e){return`
|
|
6
|
+
*/const ic="RichTextRenderer-module__link___BWeZ2",oc={link:ic},rc=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))},qi=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>rc(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function Wt(e){const{color:t,...n}=e;return n}function vt(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:qi(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:E.scalingValue(e.letterSpacing,t),wordSpacing:E.scalingValue(e.wordSpacing,t),fontSize:E.scalingValue(n,t),lineHeight:i!==void 0?E.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Yn=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:oc.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:ac(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 ac(e){return{...e.fontFamily&&{fontFamily:qi(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 sc="SvgImage-module__svg___q3xE-",lc="SvgImage-module__img___VsTm-",xr={svg:sc,img:lc},cc=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},dc=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Nt=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,l]=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("")');l(d)}},[]),!cc(e)||!s?r.jsx("img",{src:e,alt:"",className:De(xr.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:De(xr.svg,i),style:{"--svg":dc(e),"--fill":t,"--hover-fill":n,...o??{}}})},uc={"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 pc({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=c.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:a,textAlign:p,wordSpacing:u,fontSizeLineHeight:L,textAppearance:C,color:y}=n.imageCaption??{},[g,h]=c.useState(void 0),[T,$]=c.useState(null),[x,S]=c.useState(0),[H,R]=c.useState(0),{direction:B,transition:w,controls:I,pagination:O,imageCaption:m,triggers:b}=e,P=c.useRef(w.type),{x:W,y:G}=e.controls.offset,Y=k=>{o&&o.go(k)};return c.useEffect(()=>{if(!T)return;const k=new ResizeObserver(N=>{if(!o)return;const[v]=N;h({width:Math.round(v.contentRect.width),height:Math.round(v.contentRect.height)})});return k.observe(T),()=>k.unobserve(T)},[T]),c.useEffect(()=>{!o||P.current===w.type||(R(k=>k+1),P.current=w.type)},[w.type]),r.jsx("div",{className:De(ve.wrapper,{[ve.editor]:i}),ref:$,children:r.jsxs("div",{className:ve.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:w.backgroundColor&&w.type==="fade in"?w.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:De(ve.captionBlock),children:r.jsx("div",{className:ve.captionTextWrapper,children:t.map((k,N)=>r.jsx("div",{className:De(ve.captionText,uc[m.alignment],{[ve.withPointerEvents]:N===x&&i,[ve.active]:N===x}),style:{fontFamily:qi(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":E.scalingValue(l.width,i),letterSpacing:E.scalingValue(a,i),wordSpacing:E.scalingValue(u,i),textAlign:p,fontSize:E.scalingValue(L.fontSize,i),lineHeight:E.scalingValue(L.lineHeight,i),textTransform:C.textTransform??"none",textDecoration:C.textDecoration??"none",fontVariant:C.fontVariant??"normal",color:y,transitionDuration:w.duration?`${Math.round(parseInt(w.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:ve.captionTextInner,style:{"--link-hover-color":m.linkHoverColor,"--link-color":m.linkColor,position:"relative",top:E.scalingValue(m.offset.y,i),left:E.scalingValue(m.offset.x,i)},children:r.jsx(Yn,{content:k.imageCaption})})},N))})}),r.jsx(qo,{onMove:k=>{S(k.index)},ref:s,options:{arrows:!1,speed:w.duration?parseInt(w.duration):500,autoplay:b.autoPlay!==null,...b.autoPlay!==null&&{interval:parseInt(b.autoPlay)*1e3},direction:B==="horiz"||w.type==="fade in"?"ltr":"ttb",pagination:!1,drag:b.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:w.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((k,N)=>r.jsx(Xo,{children:r.jsx("div",{className:ve.sliderItem,children:r.jsx("div",{className:ve.imgWrapper,children:r.jsx("img",{className:De(ve.sliderImage,{[ve.contain]:k.image.objectFit==="contain",[ve.cover]:k.image.objectFit==="cover"}),src:k.image.url,alt:k.image.name??""})})})},N))},H),I.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De(ve.arrow,{[ve.arrowVertical]:B==="vert",[ve.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:r.jsxs("button",{onClick:()=>{Y("-1")},className:ve.arrowInner,style:{transform:`translate(${E.scalingValue(W,i)}, ${E.scalingValue(G*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&r.jsx(Nt,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:De(ve.arrowImg,ve.mirror)}),!I.arrowsImgUrl&&r.jsx(Sr,{color:I.color,className:De(ve.arrowIcon,ve.arrowImg,ve.mirror)})]})}),r.jsx("div",{className:De(ve.arrow,ve.nextArrow,{[ve.arrowVertical]:B==="vert",[ve.hoverArrow]:I.show==="on hover"}),style:{color:I.color,"--arrow-hover-color":I.hover},children:r.jsxs("button",{className:ve.arrowInner,onClick:()=>Y("+1"),style:{transform:`translate(${E.scalingValue(W*(B==="horiz"?-1:1),i)}, ${E.scalingValue(G,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[I.arrowsImgUrl&&r.jsx(Nt,{url:I.arrowsImgUrl,fill:I.color,hoverFill:I.hover,className:ve.arrowImg}),!I.arrowsImgUrl&&r.jsx(Sr,{color:I.color,className:De(ve.arrowIcon,ve.arrowImg)})]})})]}),b.triggersList.click&&r.jsx("div",{className:ve.clickOverlay,onClick:()=>{o&&o.go("+1")}}),O.isActive&&r.jsx("div",{className:De(ve.pagination,{[ve.paginationInsideBottom]:O.position==="inside-1"&&B==="horiz",[ve.paginationInsideTop]:O.position==="inside-2"&&B==="horiz",[ve.paginationOutsideBottom]:O.position==="outside-1"&&B==="horiz",[ve.paginationOutsideTop]:O.position==="outside-2"&&B==="horiz",[ve.paginationInsideLeft]:O.position==="inside-1"&&B==="vert",[ve.paginationInsideRight]:O.position==="inside-2"&&B==="vert",[ve.paginationOutsideLeft]:O.position==="outside-1"&&B==="vert",[ve.paginationOutsideRight]:O.position==="outside-2"&&B==="vert",[ve.paginationVertical]:B==="vert"}),children:r.jsx("div",{className:ve.paginationInner,style:{backgroundColor:O.colors[2],transform:`scale(${O.scale/100}) translate(${E.scalingValue(O.offset.x,i)}, ${E.scalingValue(O.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((k,N)=>r.jsx("button",{onClick:()=>{o&&o.go(N)},className:De(ve.paginationItem),children:r.jsx("div",{className:De(ve.dot,{[ve.activeDot]:N===x}),style:{backgroundColor:N===x?O.colors[0]:O.colors[1],"--pagination-hover-color":O.hover}})},N))})})]})})}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 mc={element:pc,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"]}},gc="ImageRevealSlider-module__imageRevealSlider___UE5Ob",hc="ImageRevealSlider-module__image___Qjt-e",fc="ImageRevealSlider-module__link___N-iLG",yc="ImageRevealSlider-module__cursor___2U03d",Sn={imageRevealSlider:gc,image:hc,link:fc,cursor:yc};function Cr(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const s=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*s,d=s/2,a=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-a&&t<=i.y+a)return!0}return!1}function io(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function vc(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await io(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await io(e);s=l.height/l.width*o}else{const l=await io(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function bc({settings:e,content:t,isEditor:n}){const[i,o]=c.useState(null),[s,l]=c.useState([]),[d,a]=c.useState(0),p=c.useRef(0),[u,L]=c.useState({x:0,y:0}),[C,y]=c.useState(1),[g,h]=c.useState("none"),T=c.useRef({x:0,y:0}),[$,x]=c.useState(!1),{sizeType:S,imageWidth:H,randomRangeImageWidth:R}=e.imageSize,{revealPosition:B,visible:w}=e.position,{cursorType:I,target:O,defaultCursorScale:m,defaultCursor:b,hoverCursorScale:P,hoverCursor:W}=e.cursor;c.useEffect(()=>{if(!i)return;const k=(A,_)=>{const V=i.getBoundingClientRect(),D=A-V.left,Q=_-V.top;if(L({x:D,y:Q}),I==="system"){h("none"),y(1);return}const M=D,te=Q,f=document.elementFromPoint(V.left+M,V.top+te);if(f&&f.closest("a")){h("none"),y(1);return}const ne=Cr(M,te,s)||O==="area"?{img:W??"none",scale:P}:{img:b??"none",scale:m};h(ne.img),y(ne.scale)},N=A=>{A.stopPropagation(),T.current={x:A.clientX,y:A.clientY},k(A.clientX,A.clientY)},v=()=>{$&&k(T.current.x,T.current.y)};return i.addEventListener("mousemove",N),window.addEventListener("scroll",v,!0),()=>{i.removeEventListener("mousemove",N),window.removeEventListener("scroll",v,!0)}},[i,$,u,I,O,W,b,P,m,s]),c.useEffect(()=>{$||(h("none"),y(0))},[$]);const G=async(k,N,v,A={})=>{const{width:_,height:V,finalWidth:D}=await vc(k.image.url,S,H,R);let Q=0,M=0;B==="same"?(Q=N/2,M=v/2):(Q=A.x??Math.random()*N,M=A.y??Math.random()*v);const te=Math.min(Math.max(Q,_/2),N-_/2),f=Math.min(Math.max(M,V/2),v-V/2);return{id:p.current++,url:k.image.url,link:k.link,name:k.image.name,x:te,y:f,width:D}};c.useEffect(()=>{if(!i||t.length===0)return;const k=i.getBoundingClientRect(),N=k.width,v=k.height,A=[];(async()=>{const V=t[0],D=await G(V,N,v);A.push(D),l(A),a(1)})()},[S,H,R,B,i]),c.useEffect(()=>{w==="last One"&&l(k=>k.length>0?[k[k.length-1]]:[])},[w]);const Y=async k=>{if(!i)return;const N=i.getBoundingClientRect(),v=k.clientX-N.left,A=k.clientY-N.top;if(O==="image"&&!Cr(v,A,s))return;let _=0,V=0;B==="on Click"?(_=v,V=A):B==="same"?(_=N.width/2,V=N.height/2):(_=Math.random()*N.width,V=Math.random()*N.height);const D=t[d],Q=await G(D,N.width,N.height,{x:_,y:V});l(M=>w==="all"?[...M,Q]:[Q]),a(M=>M>=t.length-1?0:M+1)};return r.jsxs("div",{ref:o,onClick:Y,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),className:Sn.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[s.map(k=>r.jsx("div",{className:Sn.wrapper,style:{top:`${k.y}px`,left:`${k.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:k.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:O==="area"&&k.link?r.jsx("a",{href:k.link,target:"_blank",className:Sn.link,children:r.jsx("img",{src:k.url,alt:k.name,className:Sn.image},k.id)}):r.jsx("img",{src:k.url,alt:k.name,className:Sn.image},k.id)},k.id)),$&&r.jsx("div",{className:Sn.cursor,style:{left:`${u.x}px`,top:`${u.y}px`,transform:`translate(-50%, -50%) scale(${C})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const xc={element:bc,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:""}]}}}},Sc="LightBox-module__hidden___9s-9x",Cc="LightBox-module__heroImage___sTxNF",$c="LightBox-module__background___rm9ml",wc="LightBox-module__editor___4ACaY",Tc="LightBox-module__contentStyle___Bgnsq",Lc="LightBox-module__imageStyle___tLIlB",Ec="LightBox-module__imgWrapper___LuFUp",Ic="LightBox-module__contain___8-yaS",Rc="LightBox-module__cover___hNvOG",Pc="LightBox-module__caption___b6L2I",Ac="LightBox-module__captionTextInner___rCGNH",_c="LightBox-module__lightboxSplide___XFuWC",Mc="LightBox-module__arrow___iz38X",kc="LightBox-module__arrowVertical___Zfz81",Fc="LightBox-module__nextArrow___zkAQN",Wc="LightBox-module__arrowInner___p48sW",Nc="LightBox-module__arrowIcon___3VaFf",Hc="LightBox-module__arrowImg___pNV88",Bc="LightBox-module__mirror___pjeXc",Oc="LightBox-module__thumbsWrapper___GB-nU",jc="LightBox-module__thumbsContainerVertical___wttk5",Dc="LightBox-module__thumbsContainer___osSma",zc="LightBox-module__thumbsAlignStart___MO6tY",Vc="LightBox-module__thumbsAlignCenter___Q4sUx",Gc="LightBox-module__thumbsAlignEnd___p4y9R",Uc="LightBox-module__thumbItem___HvnF3",Kc="LightBox-module__closeButton___g2khP",qc="LightBox-module__fadeIn___0m5GW",Xc="LightBox-module__slideInLeft___gPYwC",Yc="LightBox-module__slideInRight___S-pPp",Jc="LightBox-module__slideInTop___DFdAj",Zc="LightBox-module__slideInBottom___m27kZ",Qc="LightBox-module__fadeOut___55qBR",ed="LightBox-module__slideOutLeft___NvU7P",td="LightBox-module__slideOutRight___SK7eC",nd="LightBox-module__slideOutTop___Vgg0z",id="LightBox-module__slideOutBottom___nJ0Ef",od="LightBox-module__scaleSlide___vZriG",ce={hidden:Sc,heroImage:Cc,background:$c,editor:wc,contentStyle:Tc,imageStyle:Lc,imgWrapper:Ec,contain:Ic,cover:Rc,caption:Pc,captionTextInner:Ac,lightboxSplide:_c,arrow:Mc,arrowVertical:kc,nextArrow:Fc,arrowInner:Wc,arrowIcon:Nc,arrowImg:Hc,mirror:Bc,thumbsWrapper:Oc,thumbsContainerVertical:jc,thumbsContainer:Dc,thumbsAlignStart:zc,thumbsAlignCenter:Vc,thumbsAlignEnd:Gc,thumbItem:Uc,closeButton:Kc,fadeIn:qc,slideInLeft:Xc,slideInRight:Yc,slideInTop:Jc,slideInBottom:Zc,fadeOut:Qc,slideOutLeft:ed,slideOutRight:td,slideOutTop:nd,slideOutBottom:id,scaleSlide:od},mi=(e,t,n)=>{const i={},[o,s]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),s==="left"?(i.left="0",i.right="auto"):s==="center"?(i.left="50%",i.right="auto"):s==="right"&&(i.left="auto",i.right="0"),o==="middle"&&s==="center"?i.transform=`translate(calc(-50% + ${E.scalingValue(t.x,n)}), calc(-50% + ${E.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${E.scalingValue(t.x,n)}, calc(-50% + ${E.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${E.scalingValue(t.x,n)}), ${E.scalingValue(t.y,n)})`:i.transform=`translate(${E.scalingValue(t.x,n)}, ${E.scalingValue(t.y,n)})`,i};function ja(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 $r(e){const t=e.getBoundingClientRect(),n=ja(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,l=e.naturalHeight,d=i/o,a=s/l;let p,u;a>d?(p=i,u=i/a):(u=o,p=o*a);const L=t.left+n.left,C=t.top+n.top,y=(i-p)/2+L,g=(o-u)/2+C;return{x:y,y:g,width:p,height:u}}function wr(e){const t=e.getBoundingClientRect(),n=ja(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Tr(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 rd(e,t){const n=(()=>{if(e==="fade in")return ce.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return ce.slideInLeft;case"right":return ce.slideInRight;case"top":return ce.slideInTop;case"bottom":return ce.slideInBottom;default:return ce.slideInRight}return ce.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return ce.fadeIn;if(e==="slide in")switch(t){case"left":return ce.slideInLeft;case"right":return ce.slideInRight;case"top":return ce.slideInTop;case"bottom":return ce.slideInBottom;default:return ce.slideInRight}return ce.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return ce.fadeOut;if(e==="slide in")switch(t){case"left":return ce.slideOutLeft;case"right":return ce.slideOutRight;case"top":return ce.slideOutTop;case"bottom":return ce.slideOutBottom;default:return ce.slideOutRight}return ce.fadeOut})(),s=(()=>{if(e==="fade in")return ce.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return ce.slideOutLeft;case"right":return ce.slideOutRight;case"top":return ce.slideOutTop;case"bottom":return ce.slideOutBottom;default:return ce.slideOutRight}return ce.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const ad=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:l})=>{const[d,a]=c.useState(!1),{url:p}=e.thumbnailBlock.cover;return c.useEffect(()=>{o==="close"&&a(!1),o==="open"&&a(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:p,alt:"Cover",className:ce.heroImage,onClick:()=>a(!0)}),r.jsx(sd,{isOpen:d,onClose:()=>a(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},sd=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var Re;const{widthSettings:a,fontSettings:p,letterSpacing:u,textAlign:L,wordSpacing:C,fontSizeLineHeight:y,textAppearance:g,color:h}=i.imageCaption??{},[T,$]=c.useState(0),[x,S]=c.useState(0),[H,R]=c.useState(!1),[B,w]=c.useState(!1),[I,O]=c.useState({}),m=c.useRef(null),b=c.useRef(null),P=c.useRef(null),W=c.useRef(!1),G=c.useRef(null),Y=c.useRef(null),k=c.useRef(null),N=c.useRef(null),v=c.useRef(!1),A=c.useRef(null),[_,V]=c.useState(!1),{appear:D,triggers:Q,slider:M,thumbnail:te,controls:f,area:ne,caption:ye,layout:ee}=o.lightboxBlock,{appearClass:he,backdropAppearClass:ie,backdropDisappearClass:ue,disappearClass:z}=rd(D.type,D.direction),q=(d==null?void 0:d.itemId)??null;c.useEffect(()=>{const j=()=>{setTimeout(()=>{var F,U;(U=(F=m.current)==null?void 0:F.splide)==null||U.refresh()},16)},le=()=>{S(F=>F+1)};return window.addEventListener("ArticleEditor.Layout:change",j),window.addEventListener("ArticleEditor.ComponentContent:change",le),()=>{window.removeEventListener("ArticleEditor.Layout:change",j),window.removeEventListener("ArticleEditor.ComponentContent:change",le)}},[]),c.useEffect(()=>{if(!e||!te.isActive){V(!1);return}const j=A.current;if(!j)return;const le=()=>{M.direction==="horiz"?V(j.scrollWidth>j.clientWidth):V(j.scrollHeight>j.clientHeight)};le();const F=new ResizeObserver(le);return F.observe(j),()=>F.disconnect()},[e,te.isActive,n.length,I,M.direction]);const ae=c.useCallback(()=>{const j=window.matchMedia("(max-width: 768px)").matches,le=Tr(ne.color);j&&!l&&le>.9&&(document.body.style.backgroundColor=""),R(!0),W.current=!0;const F=U=>{U.target===G.current&&U.animationName&&(G.current&&Y.current&&G.current.removeEventListener("animationend",Y.current),Y.current=null,W.current&&(W.current=!1,t()),R(!1))};G.current&&(Y.current=F,G.current.addEventListener("animationend",F))},[t,ne.color,l]),pe=(j,le,F)=>{var U,K;if(j){if(Q.type==="click"&&Q.switch==="image")Q.repeat==="close"&&T===n.length-1?ae():(U=m.current)==null||U.go("+1");else if(Q.type==="click"&&Q.switch==="50/50"){const J=j.getBoundingClientRect(),oe=le-J.left,ge=F-J.top,Fe=J.width,we=J.height;let xe;M.direction==="horiz"?xe=oe<Fe/2?"-1":"+1":xe=ge<we/2?"-1":"+1",(K=m.current)==null||K.go(xe)}}},$e=j=>{if(v.current){v.current=!1;return}const le=n[T],F=(le==null?void 0:le.image.objectFit)==="cover";let U,K;if("changedTouches"in j&&j.changedTouches.length>0)U=j.changedTouches[0].clientX,K=j.changedTouches[0].clientY;else if("clientX"in j)U=j.clientX,K=j.clientY;else return;let J;if(F&&P.current){const oe=wr(P.current);J=U>=oe.left&&U<=oe.right&&K>=oe.top&&K<=oe.bottom}else{const oe=P.current?$r(P.current):null;if(!oe){j.target===j.currentTarget&&ae();return}J=U>=oe.x&&U<=oe.x+oe.width&&K>=oe.y&&K<=oe.y+oe.height}J?pe(P.current,U,K):ae()},Pe=j=>{const le=j.target;(le.classList.contains(ce.thumbsWrapper)||le.classList.contains(ce.thumbsContainer))&&$e(j)};c.useEffect(()=>{if(!e)return;const j=le=>{var F,U;if(le.key==="Escape"){ae();return}if(le.key==="ArrowRight"){$(K=>(K+1)%Math.max(n.length,1)),(F=m.current)==null||F.go("+1");return}le.key==="ArrowLeft"&&($(K=>(K-1+Math.max(n.length,1))%Math.max(n.length,1)),(U=m.current)==null||U.go("-1"))};return window.addEventListener("keydown",j),()=>{window.removeEventListener("keydown",j)}},[e,ae,n.length]),c.useEffect(()=>{if(e){if($(0),S(le=>le+1),W.current=!1,R(!1),w(!1),O({}),!q)return;const j=new CustomEvent("page-overlay",{detail:{itemId:q}});window.dispatchEvent(j)}return()=>{G.current&&Y.current&&(G.current.removeEventListener("animationend",Y.current),Y.current=null),w(!1)}},[e,q]),c.useEffect(()=>{b.current!==null&&b.current!==M.type&&S(j=>j+1),b.current=M.type},[M.type]),c.useEffect(()=>{if(!e)return;const j=document.body.style.overflow,le=window.matchMedia("(max-width: 768px)").matches,F=Tr(ne.color);document.body.style.overflow="hidden",w(!1);const U=J=>{J.target===G.current&&!W.current&&J.animationName&&(le&&!l&&F>.9&&(document.body.style.backgroundColor=ne.color),w(!0),G.current&&k.current&&G.current.removeEventListener("animationend",k.current),k.current=null)};G.current&&(k.current=U,G.current.addEventListener("animationend",U));const K=J=>{const oe=J.target;oe&&(oe.closest(`.${ce.thumbsWrapper}`)||oe.closest(`.${ce.thumbsContainer}`))||M.type!=="slide"&&J.preventDefault()};return document.addEventListener("touchmove",K,{passive:!1}),()=>{document.body.style.overflow=j,document.removeEventListener("touchmove",K),G.current&&k.current&&(G.current.removeEventListener("animationend",k.current),k.current=null),w(!1)}},[e,l,ne.color,M.type]),c.useEffect(()=>{if(!e)return;const j=le=>{var U,K;if(W.current){le.stopPropagation();return}if(v.current){v.current=!1;return}const F=le.target;if(!(F&&(F.closest(`.${ce.thumbsContainer}`)||F.closest(`.${ce.thumbItem}`)||F.closest(`.${ce.arrow}`)||F.closest(`.${ce.closeButton}`)||F.closest(`.${ce.caption}`)))){if(M.type==="slide"&&Q.type==="drag"&&((K=(U=m.current)==null?void 0:U.splide)!=null&&K.root)){const J=m.current.splide.root;if(F&&(J.contains(F)||J===F))return}if(le.touches.length===0&&le.changedTouches.length>0){const J=n[T],oe=(J==null?void 0:J.image.objectFit)==="cover",ge=le.changedTouches[0];let Fe;if(oe&&P.current){const we=wr(P.current);Fe=ge.clientX>=we.left&&ge.clientX<=we.right&&ge.clientY>=we.top&&ge.clientY<=we.bottom}else{const we=P.current?$r(P.current):null;if(!we)return;Fe=ge.clientX>=we.x&&ge.clientX<=we.x+we.width&&ge.clientY>=we.y&&ge.clientY<=we.y+we.height}if(!Fe){le.stopPropagation(),W.current=!0;const we=xe=>{xe.stopPropagation(),xe.preventDefault(),document.removeEventListener("click",we,!0)};document.addEventListener("click",we,!0),ae()}}}};return document.addEventListener("touchend",j,{passive:!0}),()=>{document.removeEventListener("touchend",j)}},[e,ae,T,n]);const Ie=(M.type==="scale"||M.type==="fade")&&M.direction==="vert"&&Q.type==="drag";c.useEffect(()=>{var xe,ze;if(!e||!Ie||!((ze=(xe=m.current)==null?void 0:xe.splide)!=null&&ze.root))return;const j=m.current.splide.root,le=30,F=(de,Ee)=>{if(N.current){const We=Math.abs(de-N.current.x),Oe=Math.abs(Ee-N.current.y);(We>0||Oe>0)&&(v.current=!0)}},U=de=>{N.current&&(de.preventDefault(),F(de.clientX,de.clientY))},K=de=>{N.current&&de.touches.length>0&&(de.preventDefault(),F(de.touches[0].clientX,de.touches[0].clientY))},J=(de,Ee)=>{if(!N.current||!m.current){N.current=null;return}const We=Math.abs(de-N.current.x),Oe=Math.abs(Ee-N.current.y);Oe>le&&Oe>We&&m.current.go(Ee<N.current.y?"+1":"-1"),N.current=null},oe=de=>{N.current&&J(de.clientX,de.clientY),document.removeEventListener("pointerup",oe),document.removeEventListener("pointercancel",oe),document.removeEventListener("pointermove",U)},ge=de=>{if(N.current){if(de.changedTouches.length>0){const Ee=de.changedTouches[0];J(Ee.clientX,Ee.clientY)}document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),document.removeEventListener("touchmove",K)}},Fe=de=>{N.current={x:de.clientX,y:de.clientY},v.current=!1,document.addEventListener("pointermove",U,{passive:!1}),document.addEventListener("pointerup",oe),document.addEventListener("pointercancel",oe)},we=de=>{de.touches.length>0&&(N.current={x:de.touches[0].clientX,y:de.touches[0].clientY},v.current=!1,document.addEventListener("touchmove",K,{passive:!1}),document.addEventListener("touchend",ge),document.addEventListener("touchcancel",ge))};return j.addEventListener("pointerdown",Fe),j.addEventListener("touchstart",we),()=>{j.removeEventListener("pointerdown",Fe),j.removeEventListener("touchstart",we),document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",oe),document.removeEventListener("pointercancel",oe),document.removeEventListener("touchmove",K),document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),N.current=null,v.current=!1}},[e,Ie,x]);const Me={backgroundColor:ne.color,backdropFilter:`blur(${ne.blur}px)`,animationDuration:`${parseInt(D.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:ei.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:l?null:G,className:De(ce.background,H?ue:ie,{[ce.editor]:l},{[ce.hidden]:!e}),style:{...Me,...B&&!l&&!H?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?G:null,className:De(ce.contentStyle,H?z:he,{[ce.editor]:l},{[ce.hidden]:!e}),style:{animationDuration:`${parseInt(D.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(qo,{onMove:j=>$(j.index),ref:m,className:ce.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:Q.type==="drag"&&!Ie,perPage:1,width:"100%",height:"100%",type:M.type==="fade"||M.type==="scale"?"fade":"loop",padding:0,rewind:Q.repeat!=="close",start:0},style:{"--splide-speed":M.duration},children:n.map((j,le)=>{const F=mi(ee.position,ee.offset,l),U=`${E.scalingValue(ee.padding.top,l)} ${E.scalingValue(ee.padding.right,l)} ${E.scalingValue(ee.padding.bottom,l)} ${E.scalingValue(ee.padding.left,l)}`,K=M.type==="scale"?(()=>{const{transform:J,...oe}=F;return{...oe,position:"absolute",padding:U,boxSizing:"border-box","--position-transform":J||"none"}})():{...F,position:"absolute",padding:U,boxSizing:"border-box"};return r.jsx(Xo,{children:r.jsx("div",{className:ce.imgWrapper,onClick:$e,children:r.jsx("img",{ref:le===T?P:null,className:De(ce.imageStyle,{[ce.contain]:j.image.objectFit==="contain",[ce.cover]:j.image.objectFit==="cover",[ce.scaleSlide]:M.type==="scale"}),src:j.image.url,alt:j.image.name??"",style:{...K,pointerEvents:j.image.objectFit==="contain"?"none":"auto"}})})},le)})},x),f.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De(ce.arrow,{[ce.arrowVertical]:M.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:ce.arrowInner,style:{transform:`translate(${E.scalingValue(f.offset.x,l)}, ${E.scalingValue(f.offset.y*(M.direction==="horiz"?1:-1),l)}) scale(${f.scale}) rotate(${M.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=m.current)==null?void 0:j.go("-1")},"aria-label":"Previous",children:[f.arrowsImgUrl&&r.jsx(Nt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:De(ce.arrowImg,ce.mirror)}),!f.arrowsImgUrl&&r.jsx(Lr,{color:f.color,className:De(ce.arrowIcon,ce.arrowImg,ce.mirror)})]})}),r.jsx("div",{className:De(ce.arrow,ce.nextArrow,{[ce.arrowVertical]:M.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:ce.arrowInner,style:{transform:`translate(${E.scalingValue(f.offset.x*(M.direction==="horiz"?-1:1),l)}, ${E.scalingValue(f.offset.y,l)}) scale(${f.scale}) rotate(${M.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=m.current)==null?void 0:j.go("+1")},"aria-label":"Next",children:[f.arrowsImgUrl&&r.jsx(Nt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:ce.arrowImg}),!f.arrowsImgUrl&&r.jsx(Lr,{color:f.color,className:De(ce.arrowIcon,ce.arrowImg)})]})})]}),ne.closeIconUrl&&(()=>{const j=mi(ne.closeIconAlign,ne.closeIconOffset,l),le=`scale(${ne.closeIconScale})`,F=j.transform?`${j.transform} ${le}`:le;return r.jsx("button",{className:ce.closeButton,style:{...j,transform:F},onClick:ae,"aria-label":"Close lightbox",children:r.jsx(Nt,{url:ne.closeIconUrl,fill:ne.closeIconColor??"#000000",hoverFill:ne.closeIconHover??"#cccccc"})})})(),ye&&ye.isActive&&i.imageCaption&&((Re=n[T])==null?void 0:Re.imageCaption)&&r.jsx("div",{className:ce.caption,style:{...mi(ye.alignment,ye.offset,l),fontFamily:qi(p.fontFamily),fontWeight:p.fontWeight,fontStyle:p.fontStyle,width:a.sizing==="auto"?"max-content":E.scalingValue(a.width,l),letterSpacing:E.scalingValue(u,l),wordSpacing:E.scalingValue(C,l),textAlign:L,fontSize:E.scalingValue(y.fontSize,l),lineHeight:E.scalingValue(y.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:h},onClick:j=>j.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:ce.captionTextInner,style:{"--link-color":ye.linkColor,"--link-hover-color":ye.linkHoverColor},children:r.jsx(Yn,{content:n[T].imageCaption})})}),te.isActive&&(()=>{const[j,le]=te.position.split("-"),F=M.direction==="horiz"?`${j}-left`:te.position,U=mi(F,te.offset,l),K=()=>{if(M.direction==="horiz"){if(le==="left")return"flex-start";if(le==="center")return"center";if(le==="right")return"flex-end"}else{if(j==="top")return"flex-start";if(j==="middle")return"center";if(j==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:A,className:ce.thumbsWrapper,onClick:J=>Pe(J),style:{position:l?"absolute":"fixed",...U,...M.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:De(ce.thumbsContainer,{[ce.thumbsContainerVertical]:M.direction==="vert",[ce.thumbsAlignStart]:te.align==="start",[ce.thumbsAlignCenter]:te.align==="center",[ce.thumbsAlignEnd]:te.align==="end"}),style:{gap:E.scalingValue(te.grid.gap,l),justifyContent:_?"flex-start":K()},children:n.map((J,oe)=>{const ge=oe===T,Fe=I[oe],xe=te.grid.size*(ge?te.activeState.scale:1),ze=()=>{if(te.fit!=="fit")return{};if(!Fe)return M.direction==="horiz"?{height:E.scalingValue(xe,l)}:{width:E.scalingValue(xe,l)};const de=Fe.width/Fe.height;if(M.direction==="horiz"){const Ee=xe,We=Ee*de;return{width:E.scalingValue(We,l),height:E.scalingValue(Ee,l)}}else{const Ee=xe,We=Ee/de;return{width:E.scalingValue(Ee,l),height:E.scalingValue(We,l)}}};return r.jsx("button",{className:ce.thumbItem,style:{...M.direction==="horiz"&&te.fit!=="fit"?{height:E.scalingValue(xe,l)}:{},...M.direction==="vert"&&te.fit!=="fit"?{width:E.scalingValue(xe,l)}:{},...te.fit==="cover"?{width:E.scalingValue(xe,l),height:E.scalingValue(xe,l)}:{},...ze(),transition:ge?"all 0.25s ease-out":"none",opacity:ge?te.activeState.opacity/100:te.opacity/100,"--thumb-hover":te.activeState.opacity/100},onClick:de=>{var Ee;de.stopPropagation(),$(oe),(Ee=m.current)==null||Ee.go(oe)},onMouseEnter:()=>{var de;te.triggers==="hov"&&((de=m.current)==null||de.go(oe))},children:r.jsx("img",{src:J.image.url,alt:J.image.name??"",onLoad:de=>{const Ee=de.currentTarget;Ee.naturalWidth&&Ee.naturalHeight&&O(We=>({...We,[oe]:{width:Ee.naturalWidth,height:Ee.naturalHeight}}))},style:{objectFit:te.fit==="cover"?"cover":"contain",...te.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...te.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${J.image.name}-${oe}`)})})})})()]})]}),document.getElementById(s))};function Lr({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 ld={element:ad,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 gi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function cd(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
pointer-events: auto;
|
|
156
156
|
z-index: 10;
|
|
157
157
|
}
|
|
158
|
-
`}function
|
|
158
|
+
`}function dd({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:s}){const l=!!n,d=i&&t||!t,{prefix:a}=E.useScopedStyles(),{type:p="A",fieldsToShow:u=2,fields:L=[],buttonLabel:C,gap:y,fieldsGap:g,buttonCorners:h,buttonStroke:T,buttonPadding:$,isButtonFullWidth:x,inputCorners:S,inputStroke:H,inputPadding:R,inputColor:B,inputTextColor:w,inputBorderColor:I,placeholderColor:O,buttonColor:m,buttonTextColor:b,buttonBorderColor:P,labelTextColor:W,successColor:G,errorColor:Y,fontFamily:k,inputFontSettings:N,inputFontSize:v,inputLineHeight:A,inputLetterSpacing:_,inputWordSpacing:V,inputTextAppearance:D,buttonFontSettings:Q,buttonFontSize:M,buttonLineHeight:te,buttonLetterSpacing:f,buttonWordSpacing:ne,buttonTextAppearance:ye,labelFontSettings:ee,labelFontSize:he,labelLineHeight:ie,labelLetterSpacing:ue,labelWordSpacing:z,labelTextAppearance:q,statusFontSettings:ae,statusFontSize:pe,statusLineHeight:$e,statusLetterSpacing:Pe,statusWordSpacing:Ie,statusTextAppearance:Me,successMessage:Re,errorMessage:j,stateOverrides:le}=e,F=p==="B",U=L.slice(0,Math.min(u,L.length)),K={fontSettings:{fontFamily:k,fontWeight:(N==null?void 0:N.fontWeight)??400,fontStyle:(N==null?void 0:N.fontStyle)??"normal"},fontSize:v??.01,lineHeight:A,letterSpacing:_??0,wordSpacing:V??0,textAppearance:D,color:w},J=Wt(vt(K,t)),oe=E.scalingValue(H??0,t),ge=E.scalingValue((A??v??.01)+((R==null?void 0:R.top)??0)+((R==null?void 0:R.bottom)??0)+(p==="C"?H??0:(H??0)*2),t),Fe={...J,borderStyle:"solid",borderRadius:p==="C"?0:E.scalingValue(S??0,t),...p==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:oe,borderLeftWidth:0}:{borderWidth:oe},paddingTop:E.scalingValue((R==null?void 0:R.top)??0,t),paddingRight:E.scalingValue((R==null?void 0:R.right)??0,t),paddingBottom:E.scalingValue((R==null?void 0:R.bottom)??0,t),paddingLeft:E.scalingValue((R==null?void 0:R.left)??0,t),height:ge,minHeight:ge},we={fontSettings:{fontFamily:k,fontWeight:(Q==null?void 0:Q.fontWeight)??400,fontStyle:(Q==null?void 0:Q.fontStyle)??"normal"},fontSize:M??.01,lineHeight:te,letterSpacing:f??0,wordSpacing:ne??0,textAppearance:ye,color:b},xe=Wt(vt(we,t)),ze=E.scalingValue(T??0,t),de={fontSettings:{fontFamily:k,fontWeight:(ee==null?void 0:ee.fontWeight)??400,fontStyle:(ee==null?void 0:ee.fontStyle)??"normal"},fontSize:he??.01,lineHeight:ie,letterSpacing:ue??0,wordSpacing:z??0,textAppearance:q,color:W},Ee=vt(de,t),We={fontSettings:{fontFamily:k,fontWeight:(ae==null?void 0:ae.fontWeight)??400,fontStyle:(ae==null?void 0:ae.fontStyle)??"normal"},fontSize:pe??.01,lineHeight:$e,letterSpacing:Pe??0,wordSpacing:Ie??0,textAppearance:Me,color:G},Oe=Wt(vt(We,t)),Ge=E.buildColorVars(a,{inputColor:B,inputTextColor:w,inputBorderColor:I,placeholderColor:O!=null&&O.trim()?O:"#cccccc",buttonColor:m,buttonTextColor:b,buttonBorderColor:P,labelTextColor:W,successColor:G,errorColor:Y},ud,pd,le),[lt,ht]=c.useState(()=>Object.fromEntries(U.map(be=>[be.name,""]))),[dt,St]=c.useState("idle"),[_t,ft]=c.useState(null),yt=s==="success"?"success":s==="error"?"error":dt,Se=s==="error"?j:_t,rt=s==="filled",it=c.useMemo(()=>{if(!rt)return lt;let be=null;for(const qe of U)(lt[qe.name]??"").trim().length>0||(be=be??{...lt},be[qe.name]="Filled");return be??lt},[lt,rt,U]),ut=yt==="error"?E.getFormFieldValidationError(U,it):null,re=`${s&&s!=="default"?`${a}-state-${s}`:""}`.trim(),me=o==null?void 0:o.submitUrl,Ae=(be,qe)=>{ht(Ue=>({...Ue,[be]:qe}))},Ve=async be=>{if(be.preventDefault(),!d)return;const qe=Object.fromEntries(U.map(He=>{var ct;return[He.name,((ct=lt[He.name])==null?void 0:ct.trim())??""]}).filter(([,He])=>He));if(!me){St("error"),ft("No integrations were found for this form.");return}if(Object.keys(qe).length===0)return;const Ue=E.getFormFieldValidationError(U,lt);if(Ue){St("error"),ft(Ue);return}St("submitting"),ft(null);try{const He=await fetch(me,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(!He.ok){const ct=await He.text();throw new Error(ct||`Request failed: ${He.status}`)}St("success"),ht(Object.fromEntries(U.map(ct=>[ct.name,""])))}catch(He){St("error"),ft(He instanceof Error?He.message:"Something went wrong")}};return r.jsxs("div",{className:`${a}-wrapper ${a}-type-${p} ${re}`.trim(),style:Ge,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:cd(a)}}),r.jsxs("form",{onSubmit:Ve,className:`${a}-form`,children:[r.jsx("div",{className:`${a}-fields`,children:U.map((be,qe)=>r.jsxs(c.Fragment,{children:[qe>0&&r.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${a}-control`:void 0,style:{height:E.scalingValue(g??0,t)}}),r.jsxs("div",{className:`${a}-field-group${F?` ${a}-labeled`:""}`,children:[F&&r.jsx("span",{className:`${a}-field-label`,style:Ee?{...Ee,lineHeight:Ee.fontSize}:void 0,children:be.label||be.name}),be.type==="textarea"?r.jsx("textarea",{name:be.name,autoComplete:"off",value:it[be.name]??"",onChange:Ue=>Ae(be.name,Ue.target.value),placeholder:be.placeholder,className:`${a}-input`,style:Fe,rows:1,"data-filled":rt||(it[be.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:be.type==="phone"?"tel":be.type==="email"?"email":"text",name:be.name,autoComplete:"off",value:it[be.name]??"",onChange:Ue=>Ae(be.name,Ue.target.value),placeholder:be.placeholder,required:be.isRequired??be.type==="email",className:`${a}-input`,style:Fe,"data-filled":rt||(it[be.name]??"").trim().length>0})]})]},qe))}),r.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${a}-control`:void 0,style:{height:E.scalingValue(y??0,t)}}),r.jsx("div",{className:`${a}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${a}-button`,style:{borderStyle:"solid",borderRadius:E.scalingValue(h??0,t),borderWidth:ze,paddingTop:E.scalingValue(($==null?void 0:$.top)??0,t),paddingRight:E.scalingValue(($==null?void 0:$.right)??0,t),paddingBottom:E.scalingValue(($==null?void 0:$.bottom)??0,t),paddingLeft:E.scalingValue(($==null?void 0:$.left)??0,t),pointerEvents:d?"auto":void 0,...xe,...x?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${a}-overlay-anchor`,style:x?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:dt==="submitting"?"...":C})})})]}),yt==="success"&&r.jsx("p",{className:`${a}-success`,style:{...Oe},children:Re}),yt==="error"&&r.jsx("p",{className:`${a}-error`,style:{...Oe},role:"alert",children:ut??Se??j})]})}const ud={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"},pd=["hover","focus","filled","success","error"],md=`import React, { useMemo, useState } from 'react';
|
|
159
159
|
import { CommonComponentProps } from '../props';
|
|
160
160
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
161
161
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -789,7 +789,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
789
789
|
};
|
|
790
790
|
|
|
791
791
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
792
|
-
`,md=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],hi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},gd=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],hd={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...hi.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...hi.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...hi.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...hi.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:md,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...gd],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},fd={element:cd,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:hd,sourceCode:pd};function fi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function yd(e){return`
|
|
792
|
+
`,gd=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],hi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},hd=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],fd={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...hi.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...hi.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},labelFontSettings:{...hi.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...hi.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fieldsToShow:2,fields:gd,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#E2E2E2",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!1,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...hd],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},yd={element:dd,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300,height:42},t:{width:346,height:42},m:{width:300,height:42}},schema:fd,sourceCode:md};function fi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function vd(e){return`
|
|
793
793
|
.${e}-wrapper {
|
|
794
794
|
display: flex;
|
|
795
795
|
flex-direction: column;
|
|
@@ -980,7 +980,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
980
980
|
font-size: ${fi(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const
|
|
983
|
+
`}const bd=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:s}=E.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:a,buttonLabel:p,fieldsToShow:u=1,fontFamily:L,inputFontSettings:C,inputFontSize:y,inputLineHeight:g,inputLetterSpacing:h,inputWordSpacing:T,inputTextAppearance:$,buttonFontSettings:x,buttonFontSize:S,buttonLineHeight:H,buttonLetterSpacing:R,buttonWordSpacing:B,buttonTextAppearance:w,statusFontSettings:I,statusFontSize:O,statusLineHeight:m,statusLetterSpacing:b,statusWordSpacing:P,statusTextAppearance:W,iconMaxWidth:G,minHeight:Y,corners:k,stroke:N,stateOverrides:v,inputPadding:A,buttonPadding:_,successMessage:V="Thanks for subscribing!",errorMessage:D="Please, fill all required fields."}=e,Q=d.slice(0,Math.min(u,d.length)),[M,te]=c.useState(()=>Object.fromEntries(Q.map(de=>[de.name,""]))),[f,ne]=c.useState("idle"),[ye,ee]=c.useState(null),he=o==="success"?"success":o==="error"?"error":f,ie=o==="error"?D:ye,ue=o==="filled",z=c.useMemo(()=>{if(!ue)return M;let de=null;for(const Ee of Q)(M[Ee.name]??"").trim().length>0||(de=de??{...M},de[Ee.name]="Filled");return de??M},[ue,M,Q]),q=he==="error"?E.getFormFieldValidationError(Q,z):null,ae=o&&o!=="default"?`${s}-state-${o}`:"",pe=Q.some(de=>(z[de.name]??"").trim().length>0),$e=ae!==`${s}-state-filled`&&pe?`${s}-state-filled`:"",Pe=`${ae} ${$e}`.trim(),Ie=i==null?void 0:i.submitUrl,Me=p??"",Re=(a==null?void 0:a.icon)??"",j=(a==null?void 0:a.mode)==="On",le=Me||"Submit",F={fontSettings:{fontFamily:L,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:y??.01,lineHeight:g,letterSpacing:h??0,wordSpacing:T??0,textAppearance:$,color:e.inputTextColor??"#111111"},U={fontSettings:{fontFamily:L,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:S??.01,lineHeight:H,letterSpacing:R??0,wordSpacing:B??0,textAppearance:w,color:e.buttonTextColor??"#ffffff"},K={fontSettings:{fontFamily:L,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:O??.01,lineHeight:m,letterSpacing:b??0,wordSpacing:P??0,textAppearance:W,color:e.successColor??"#22c55e"},J=Wt(vt(F,t)),oe=Wt(vt(U,t)),ge=Wt(vt(K,t)),Fe=E.buildColorVars(s,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(F==null?void 0:F.color)??"#111111",buttonTextColor:e.buttonTextColor??(U==null?void 0:U.color)??"#ffffff"},xd,Sd,v),we={borderRadius:E.scalingValue(k,t),borderWidth:E.scalingValue(N,t),borderStyle:"solid"},xe={borderLeftWidth:E.scalingValue(N,t)},ze=async de=>{if(de.preventDefault(),!l)return;const Ee=Object.fromEntries(Q.map(Oe=>{var Ge;return[Oe.name,((Ge=M[Oe.name])==null?void 0:Ge.trim())??""]}).filter(([,Oe])=>Oe));if(!Ie){ne("error"),ee("No integrations were found for this form.");return}if(Object.keys(Ee).length===0)return;const We=E.getFormFieldValidationError(Q,M);if(We){ne("error"),ee(We);return}ne("submitting"),ee(null);try{const Oe=await fetch(Ie,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ee)});if(!Oe.ok){const Ge=await Oe.text();throw new Error(Ge||`Request failed: ${Oe.status}`)}ne("success"),te(Object.fromEntries(Q.map(Ge=>[Ge.name,""])))}catch(Oe){ne("error"),ee(Oe instanceof Error?Oe.message:"Something went wrong")}};return r.jsxs("div",{className:`${s}-wrapper ${Pe}`.trim(),style:Fe,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:vd(s)}}),r.jsxs("form",{onSubmit:ze,className:`${s}-form`,style:{...we,height:E.scalingValue(Y,t),minHeight:E.scalingValue(Y,t)},children:[r.jsx("div",{className:`${s}-inputWrap ${s}-overlayAnchor`,style:{flex:1,minWidth:0},children:Q.map(de=>r.jsx("input",{type:de.type==="email"?"email":de.type==="phone"?"tel":"text",name:de.name,autoComplete:"off",value:z[de.name]??"",onChange:Ee=>te(We=>({...We,[de.name]:Ee.target.value})),placeholder:de.placeholder,required:de.isRequired??de.type==="email",className:`${s}-input`,style:{...J,paddingRight:E.scalingValue(A.right,t),paddingLeft:E.scalingValue(A.left,t),paddingTop:E.scalingValue(A.top,t),paddingBottom:E.scalingValue(A.bottom,t)}},de.name))}),r.jsx("div",{className:`${s}-overlayAnchor`,children:r.jsx("button",{type:l?"submit":"button",className:`${s}-submitBtn`,"aria-label":le,style:{...oe,...xe,paddingRight:E.scalingValue(_.right,t),paddingLeft:E.scalingValue(_.left,t),paddingTop:E.scalingValue(_.top,t),paddingBottom:E.scalingValue(_.bottom,t),pointerEvents:l?"auto":void 0},children:f==="submitting"?"...":j?Re&&r.jsx(Nt,{url:Re,className:`${s}-submitBtnIcon`,style:{maxWidth:E.scalingValue(G??0,t)},fill:`var(--${s}-button-text-color)`,hoverFill:`var(--${s}-button-text-color)`}):Me})})]}),he==="success"&&r.jsx("p",{className:`${s}-success`,style:{...ge},children:V}),he==="error"&&r.jsx("p",{className:`${s}-error`,style:{...ge},role:"alert",children:q??ie??D})]})},xd={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"},Sd=["hover","focus","filled","success","error"],Cd=`import React, { useMemo, useState } from 'react';
|
|
984
984
|
import { CommonComponentProps } from '../props';
|
|
985
985
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
986
986
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1557,7 +1557,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1557
1557
|
};
|
|
1558
1558
|
|
|
1559
1559
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1560
|
-
`,Cd="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),$d=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],oo={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},wd=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Td={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...oo.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...oo.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...oo.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:$d,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Cd},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:0,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...wd],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Ld={element:vd,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:Td,sourceCode:Sd};function Ed(e){return`
|
|
1560
|
+
`,$d="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),wd=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],oo={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Td=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Ld={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...oo.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...oo.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...oo.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:wd,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:$d},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:0,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Td],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Ed={element:bd,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:Ld,sourceCode:Cd};function Id(e){return`
|
|
1561
1561
|
.${e}-marquee-wrapper {
|
|
1562
1562
|
overflow: hidden;
|
|
1563
1563
|
width: 100%;
|
|
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1689
1689
|
.${e}-image-hover-grayscale:hover img {
|
|
1690
1690
|
filter: grayscale(100%);
|
|
1691
1691
|
}
|
|
1692
|
-
`}const
|
|
1692
|
+
`}const Rd=30,Pd=20,ro=2,Ad=2,_d=(e,t)=>Array.from({length:t},()=>e).flat(),Md=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},kd=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Md(i,e))},Fd=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,imageHoverClass:s,isFirstSet:l,scaled:d,onFirstSetImageDone:a})=>{var w,I,O;const p=c.useRef(null);c.useLayoutEffect(()=>{if(!l)return;const m=p.current;m!=null&&m.complete&&(a==null||a())},[l,(w=e.image)==null?void 0:w.url,a]);const u=n.display==="Cover",L=n.ratioValue??"1:1",C=n.reversed??!1,[y,g]=L.split(":").map(Number),$=(C?g:y)/(C?y:g);let x=i,S=x/$;S>o&&(S=o,x=S*$);const H=d(x),R=d(S),B=((I=e.image)==null?void 0:I.url)&&r.jsx("img",{ref:p,src:e.image.url,alt:((O=e.image)==null?void 0:O.name)??"",style:u?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:d(i),objectFit:"contain"},onLoad:l?a:void 0,onError:l?a:void 0});return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...u?{width:H}:{width:"fit-content",maxWidth:d(i),minWidth:0}},children:r.jsx("div",{className:s,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...u?{width:H,height:R,overflow:"hidden"}:{width:"fit-content",maxWidth:d(i),height:d(o)}},children:B&&e.link?r.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:De(`${t}-marquee-link`,!u&&`${t}-marquee-link-contain`),children:B}):B})})},Wd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=E.useScopedStyles(),l=c.useMemo(()=>Id(s),[s]),{speed:d,direction:a,pauseOnHover:p,gap:u,imageMaxWidth:L,imageMaxHeight:C,imageFit:y,hoverEffect:g}=e,h=!!o,T=!n||!!i,$=T&&g!=="off"&&g!=="randomize"?`${s}-image-hover-${g}`:void 0,x=n?!!i:!0,H=((t==null?void 0:t.length)??0)>0&&(x||!!n),R=Math.max(0,d)*Rd,B=q=>E.scalingValue(q,n??!1),w=c.useRef(null),I=c.useRef(null),O=c.useRef(null),[m,b]=c.useState(0),[P,W]=c.useState(0),G=x&&p==="on",[Y,k]=c.useState(!1),[N,v]=c.useState({}),A=c.useRef(N);A.current=N;const _=c.useRef(null),V=c.useRef(0),D=c.useRef(null),Q=c.useMemo(()=>(t??[]).map(q=>{var ae;return((ae=q.image)==null?void 0:ae.url)??""}).join("\0"),[t]),[M,te]=c.useState(ro),f=c.useMemo(()=>{const q=t??[];return!x||q.length===0?q:_d(q,M)},[t,x,M]),ne=c.useMemo(()=>f.filter(q=>{var ae;return!!((ae=q.image)!=null&&ae.url)}).length,[f]),ye=H?Ad:1;c.useLayoutEffect(()=>{V.current=0,v({}),_.current=null,te(ro),b(0)},[Q]),c.useEffect(()=>{if(!T||g!=="randomize")return;const q=w.current;if(!q)return;const ae=Ie=>{v(Me=>{let Re=null;for(const j of Ie)j in Me&&(kd(q,j)||(Re||(Re={...Me}),delete Re[j]));return Re??Me})},pe=new IntersectionObserver(Ie=>{const Me=new Set;for(const Re of Ie){const j=Re.target.dataset.marqueeItemIndex,le=j!==void 0?Number(j):NaN;Number.isNaN(le)||Me.add(le)}Me.size>0&&ae(Me)},{root:q,threshold:0});Object.keys(N).forEach(Ie=>{const Me=Number(Ie);q.querySelectorAll(`[data-marquee-item-index="${Me}"]`).forEach(Re=>pe.observe(Re))});let $e=0;const Pe=()=>{const Ie=Object.keys(A.current);Ie.length!==0&&(ae(Ie.map(Number)),$e=requestAnimationFrame(Pe))};return Object.keys(A.current).length>0&&($e=requestAnimationFrame(Pe)),()=>{cancelAnimationFrame($e),pe.disconnect()}},[g,N,T]),c.useLayoutEffect(()=>{if(!H)return;const q=w.current,ae=O.current;if(!q||!ae)return;let pe=0;const $e=()=>{const Me=q.getBoundingClientRect().width,Re=ae.getBoundingClientRect().width,j=_.current,le=typeof j=="number"&&Math.abs(j-Re)<=.25;if(_.current=Re,x&&Re>0&&M>0){const F=Re/M;if(F>0&&Me>0){const U=Math.max(ro,Math.ceil(Me/F)+1);if(U!==M){te(U);return}}}if(Re>0&&m<=0){b(Re);return}le&&Re!==m?b(Re):!le&&m<=0&&(cancelAnimationFrame(pe),pe=requestAnimationFrame($e))},Pe=()=>{cancelAnimationFrame(pe),pe=requestAnimationFrame($e)};D.current=Pe,Pe();const Ie=new ResizeObserver(Pe);return Ie.observe(q),Ie.observe(ae),()=>{D.current=null,cancelAnimationFrame(pe),Ie.disconnect()}},[x,H,m,Q,M]),c.useLayoutEffect(()=>{const q=I.current;if(!H||!q)return;const ae=m>0?m:0,pe=ae>0&&R>0?ae/R*1e3:0,$e=`${Math.max(0,pe)/1e3}s`;q.style.setProperty("--marquee-distance",`${ae}px`),q.style.setProperty("--marquee-duration",$e)},[x,H,R,m]),c.useLayoutEffect(()=>{if(!H){W(0);return}if(m<=0){W(0);return}const q=I.current;if(!q)return;const ae=()=>{const $e=q.getBoundingClientRect().height;W($e>0?$e:0)};ae();const pe=new ResizeObserver(ae);return pe.observe(q),()=>pe.disconnect()},[H,ye,f,n,u,L,C,m,y,N]);const ee=()=>{G&&k(!0)},he=()=>{G&&k(!1)},ie=c.useCallback(()=>{var q;V.current=Math.min(ne,V.current+1),(q=D.current)==null||q.call(D)},[ne]),ue=c.useCallback((q,ae)=>{v(pe=>{const $e=pe[q]??ae,Pe=(t??[]).filter(Me=>Me!==$e);if(Pe.length===0)return pe;const Ie=Pe[Math.floor(Math.random()*Pe.length)];return{...pe,[q]:Ie}})},[t]),z=(q,ae,pe,$e)=>{const Pe=T&&g==="randomize"&&y.display==="Cover"?N[pe]??q:q,Ie=`max(${B(u)}, ${Pd}px)`,Me=`calc(-0.5 * (${Ie} + ${B(u)}))`;return r.jsxs("div",{className:`${s}-marquee-card`,"data-marquee-item-index":pe,onMouseEnter:T&&g==="randomize"&&y.display==="Cover"?()=>ue(pe,q):void 0,children:[r.jsx(Fd,{item:Pe,prefix:s,imageFit:y,imageMaxWidth:L,imageMaxHeight:C,imageHoverClass:$,isEditor:n,isFirstSet:$e,scaled:B,onFirstSetImageDone:ie}),h&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${s}-gap-control`,style:{position:"absolute",top:0,right:Me,width:Ie,height:"100%"}})]},`${ae}-${pe}`)};if(H){const q=x?G&&Y?"paused":"running":"paused";return r.jsxs("div",{ref:w,className:De(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Marquee",style:m>0&&P>0?{height:P}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsx("div",{ref:I,className:`${s}-marquee-track`,"data-direction":a,onMouseEnter:ee,onMouseLeave:he,style:{"--marquee-play-state":q},children:Array.from({length:ye},(ae,pe)=>r.jsx("div",{ref:pe===0?O:void 0,className:De(`${s}-marquee-row`,`${s}-marquee-set`),style:{gap:B(u),paddingRight:B(u)},"aria-hidden":pe>0,children:f.map(($e,Pe)=>z($e,pe,Pe,pe===0))},`set-${pe}`))},"marquee-track")]})}return r.jsxs("div",{ref:w,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsx("div",{className:De(`${s}-marquee-row`,`${s}-marquee-static`),style:{gap:B(u),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((q,ae)=>z(q,0,ae))},"marquee-static")]})},Nd=`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';
|
|
@@ -2320,7 +2320,7 @@ type MarqueeProps = {
|
|
|
2320
2320
|
isPreviewMode?: boolean;
|
|
2321
2321
|
isEditMode?: boolean;
|
|
2322
2322
|
} & CommonComponentProps;
|
|
2323
|
-
`,
|
|
2323
|
+
`,Hd={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,display:{type:"numeric-input"}},imageFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"Fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.21},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278}},displayRules:[{if:{name:"imageFit.display",value:"Cover"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","randomize"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["direction"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",name:""},link:""}]}},Bd={element:Wd,id:"marquee",name:"Simple Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:400},m:{width:390,height:80}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple_Marquee.mp4"},schema:Hd,sourceCode:Nd,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function Er(e){return`
|
|
2324
2324
|
.${e}-marquee-wrapper {
|
|
2325
2325
|
overflow: hidden;
|
|
2326
2326
|
width: 100%;
|
|
@@ -2407,7 +2407,7 @@ type MarqueeProps = {
|
|
|
2407
2407
|
pointer-events: auto;
|
|
2408
2408
|
z-index: 10;
|
|
2409
2409
|
}
|
|
2410
|
-
`}const
|
|
2410
|
+
`}const Od=30,Ir=2,jd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=E.useScopedStyles(),{align:l,speed:d,direction:a,pauseOnHover:p,gap:u,cardWidth:L,corners:C,stroke:y,strokeColor:g,bgColor:h,padding:T,logoMarginTop:$,logoWidth:x,logoHeight:S,captionMarginTop:H}=e,R=!!o,B=((t==null?void 0:t.length)??0)>0,w=d>0&&(!n||!!i),I=B&&(w||!!n),O=Math.max(0,d)*Od,m=F=>E.scalingValue(F,n??!1),b=c.useRef(null),P=c.useRef(null),W=c.useRef(null),[G,Y]=c.useState(0),[k,N]=c.useState(0),[v,A]=c.useState(0),_=w&&p==="on",[V,D]=c.useState(!1),Q=c.useRef(null),[M,te]=c.useState(0),[f,ne]=c.useState(0),ye=c.useRef(null),ee=F=>{var K,J,oe,ge,Fe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${F}FontFamily`])??"Arial",fontWeight:((K=e==null?void 0:e[`${F}FontSettings`])==null?void 0:K.fontWeight)??400,fontStyle:((J=e==null?void 0:e[`${F}FontSettings`])==null?void 0:J.fontStyle)??"normal"},textAppearance:{textTransform:((oe=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:oe.textTransform)??"none",textDecoration:((ge=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:ge.textDecoration)??"none",fontVariant:((Fe=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:Fe.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${F}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${F}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${F}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${F}LineHeight`])??.01,color:(e==null?void 0:e[`${F}Color`])??"#000000"}},he=ee("text"),ie=ee("caption"),ue=c.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(F=>{var U,K;return(((U=F.text)==null?void 0:U.length)??0)>0||(((K=F.caption)==null?void 0:K.length)??0)>0}),[t]),z=c.useMemo(()=>!I||(t==null?void 0:t.length)===0?1:k<=0||G<=0?Ir:Math.max(Ir,Math.ceil(G/k)+1),[I,t==null?void 0:t.length,k,G]);c.useLayoutEffect(()=>{if(!I)return;const F=b.current,U=W.current;if(!F||!U)return;let K=0;const J=()=>{const Fe=F.getBoundingClientRect().width,we=U.getBoundingClientRect().width,xe=ye.current,ze=typeof xe=="number"&&Math.abs(xe-we)<=.25;if(ye.current=we,Y(Fe),typeof we=="number"&&we>0&&k<=0){N(we);return}ze&&we!==k?N(we):!ze&&k<=0&&(cancelAnimationFrame(K),K=requestAnimationFrame(J))},oe=()=>{cancelAnimationFrame(K),K=requestAnimationFrame(J)};oe();const ge=new ResizeObserver(oe);return ge.observe(F),ge.observe(U),()=>{cancelAnimationFrame(K),ge.disconnect()}},[w,I,k]),c.useLayoutEffect(()=>{const F=P.current;if(!I||!F)return;const U=k>0?k:0,K=U>0&&O>0?U/O*1e3:0,J=`${Math.max(0,K)/1e3}s`;F.style.setProperty("--marquee-distance",`${U}px`),F.style.setProperty("--marquee-duration",J)},[w,I,O,k]),c.useLayoutEffect(()=>{if(!I){A(0);return}const F=W.current,U=P.current;if(!F||!U)return;const K=()=>{let oe=0;for(let ge=0;ge<F.children.length;ge++){const we=F.children[ge].firstElementChild;we&&(oe=Math.max(oe,we.offsetHeight))}oe<=0&&(oe=U.offsetHeight),A(oe>0?oe:0)};K();const J=new ResizeObserver(K);return J.observe(F),J.observe(U),()=>{J.disconnect()}},[I,z,t,n,u,L,T,y,C,x,S,M,f]);const q=()=>{_&&D(!0)},ae=()=>{_&&D(!1)},pe=c.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),$e=c.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),Pe=c.useCallback((F,U,K,J)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:pe,width:"100%"},children:[r.jsx("div",{"data-controls":R?J==null?void 0:J.controlsName:void 0,"data-controls-axis":R?"y":void 0,className:R?`${s}-control`:void 0,style:{height:m((J==null?void 0:J.marginTop)??0)}}),r.jsx("div",{...J!=null&&J.dataMeasureKind?{"data-testimonial-measure":J.dataMeasureKind}:{},style:{...vt(F,n),textAlign:$e,pointerEvents:"auto",...typeof(J==null?void 0:J.minHeightPx)=="number"&&J.minHeightPx>0?{minHeight:J.minHeightPx}:{}},children:r.jsx(Yn,{content:U})})]},K),[pe,$e,n,R,s,m]),Ie=c.useCallback((F,U,K)=>{var J,oe,ge;return r.jsxs("div",{style:{padding:`${m(T.top)} ${m(T.right)} ${m(T.bottom)} ${m(T.left)}`,width:m(L+y*2),height:"100%",borderRadius:m(C),border:`${m(y)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${s}-cover`,style:{background:h}}),r.jsxs("div",{className:`${s}-elements-overlay`,style:{alignItems:pe,textAlign:$e},children:[F.text&&Pe(he,F.text,"text",K!=null&&K.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(K==null?void 0:K.textMinHeightPx)=="number"&&K.textMinHeightPx>0?{minHeightPx:K.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:pe,width:"100%"},children:[r.jsx("div",{"data-controls":R&&!(K!=null&&K.dataMeasureAttrs)?"logoMarginTop":void 0,className:R&&!(K!=null&&K.dataMeasureAttrs)?`${s}-control`:void 0,style:{height:m($)}}),r.jsx("div",{style:{width:m(x),height:m(S)},children:((J=F.logo)==null?void 0:J.url)&&r.jsx("img",{src:F.logo.url,alt:((oe=F.logo)==null?void 0:oe.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((ge=F.logo)==null?void 0:ge.objectFit)||"contain"}})})]}),F.caption&&Pe(ie,F.caption,"caption",{...K!=null&&K.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:H,...K!=null&&K.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(K==null?void 0:K.captionMinHeightPx)=="number"&&K.captionMinHeightPx>0?{minHeightPx:K.captionMinHeightPx}:{}})]})]},U)},[h,H,ie,L,C,S,$,x,pe,$e,T.bottom,T.left,T.right,T.top,Pe,y,g,he,n,R,s]),Me=c.useCallback(F=>{te(F.maxTextPx),ne(F.maxCaptionPx)},[]);c.useLayoutEffect(()=>{if(!ue){Me({maxTextPx:0,maxCaptionPx:0});return}const F=Q.current;if(!F)return;const U=()=>{E.readTestimonialTextMeasure(F,Me)};U();const K=new ResizeObserver(U);return K.observe(F),()=>{K.disconnect()}},[ue,Me,t,Ie]);const Re=ue?{textMinHeightPx:M,captionMinHeightPx:f}:void 0,j=ue?r.jsx("div",{ref:Q,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((F,U)=>Ie(F,`measure-${U}`,{dataMeasureAttrs:!0}))}):null,le=(F,U)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Ie(F,`card-${U}`,Re),R&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${m(u)})`,width:m(u),height:"100%",pointerEvents:"auto",zIndex:2}})]},U);if(I){const F=w?_&&V?"paused":"running":"paused";return r.jsxs("div",{ref:b,className:De(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...v>0?{height:v}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Er(s)}}),j,r.jsx("div",{ref:P,className:`${s}-marquee-track`,"data-direction":a,onMouseEnter:q,onMouseLeave:ae,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px","--marquee-play-state":F},children:Array.from({length:z},(U,K)=>r.jsx("div",{ref:K===0?W:void 0,className:`${s}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:m(u),paddingRight:m(u)},"aria-hidden":K>0,children:t==null?void 0:t.map((J,oe)=>le(J,`${K}-${oe}`))},`set-${K}`))})]})}return r.jsxs("div",{className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Er(s)}}),j,r.jsx("div",{style:{gap:m(u),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((F,U)=>le(F,U))})]})},Dd=`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';
|
|
@@ -3022,7 +3022,7 @@ type TestimonialsSettings = {
|
|
|
3022
3022
|
logoHeight: number;
|
|
3023
3023
|
captionMarginTop: number;
|
|
3024
3024
|
};
|
|
3025
|
-
`,Rr={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},
|
|
3025
|
+
`,Rr={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},zd={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Fill Text",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Fill Caption",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Rr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Rr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}}},defaults:{direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.058,textLineHeight:.088,captionFontSize:.053,captionLineHeight:.069},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["align","direction"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners"]},{type:"group",title:"",items:["stroke","padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Vd={element:jd,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Grid.mp4"},defaultSize:{d:{width:"100%",height:320}},schema:zd,sourceCode:Dd,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Gd(e){return`
|
|
3026
3026
|
.${e}-container {
|
|
3027
3027
|
position: relative;
|
|
3028
3028
|
overflow-x: clip;
|
|
@@ -3146,7 +3146,7 @@ type TestimonialsSettings = {
|
|
|
3146
3146
|
width: 100%;
|
|
3147
3147
|
height: 100%;
|
|
3148
3148
|
}
|
|
3149
|
-
`}const
|
|
3149
|
+
`}const Ud=3e3,Kd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=E.useScopedStyles(),l=t||[],{speed:d,align:a,width:p,imageMarginTop:u,textMarginTop:L,captionMarginTop:C,imageWidth:y,imageHeight:g,controlsWidth:h,controlsColor:T,controlsHoverColor:$}=e,x=d>0&&(!n||!!i),[S,H]=c.useState(0),[R,B]=c.useState(null),[w,I]=c.useState(!1),O=c.useRef(null),m=c.useMemo(()=>{switch(a){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[a]),b=c.useMemo(()=>{switch(a){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[a]);c.useEffect(()=>{H(0),B(null),I(!1)},[l.length]);const P=l[S],W=R===null?null:l[R],G=ie=>{var z,q,ae,pe,$e;return{fontSettings:{fontFamily:(e==null?void 0:e[`${ie}FontFamily`])??"Arial",fontWeight:((z=e==null?void 0:e[`${ie}FontSettings`])==null?void 0:z.fontWeight)??400,fontStyle:((q=e==null?void 0:e[`${ie}FontSettings`])==null?void 0:q.fontStyle)??"normal"},textAppearance:{textTransform:((ae=e==null?void 0:e[`${ie}TextAppearance`])==null?void 0:ae.textTransform)??"none",textDecoration:((pe=e==null?void 0:e[`${ie}TextAppearance`])==null?void 0:pe.textDecoration)??"none",fontVariant:(($e=e==null?void 0:e[`${ie}TextAppearance`])==null?void 0:$e.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${ie}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${ie}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${ie}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${ie}WordSpacing`])??0,color:(e==null?void 0:e[`${ie}Color`])??"#000000"}},Y=G("text"),k=G("caption"),N=l.length>1&&l.some(ie=>{var ue,z;return(((ue=ie.text)==null?void 0:ue.length)??0)>0||(((z=ie.caption)==null?void 0:z.length)??0)>0}),v=c.useRef(null),[A,_]=c.useState(0),[V,D]=c.useState(0),Q=e.controls??{mode:"Off",icon:null},M=l.length>1,te=c.useCallback((ie,ue)=>!M||ue===ie?ie:(O.current&&window.clearTimeout(O.current),B(ie),I(!0),O.current=window.setTimeout(()=>{B(null),I(!1),O.current=null},300),ue),[M]),f=c.useCallback(()=>{M&&H(ie=>te(ie,(ie-1+l.length)%l.length))},[M,te,l.length]),ne=c.useCallback(()=>{M&&H(ie=>te(ie,(ie+1)%l.length))},[M,te,l.length]);c.useEffect(()=>{if(!x||!M)return;const ie=Math.max(300,Ud/d),ue=window.setInterval(()=>{H(z=>te(z,(z+1)%l.length))},ie);return()=>{window.clearInterval(ue)}},[x,M,te,l.length,d]),c.useEffect(()=>()=>{O.current&&window.clearTimeout(O.current)},[]);const ye=(ie,ue)=>{var $e,Pe,Ie,Me;const z=ue==null?void 0:ue.textMinHeightPx,q=ue==null?void 0:ue.captionMinHeightPx,ae=ue==null?void 0:ue.dataMeasureAttrs,pe=o&&!(ue!=null&&ue.dataMeasureAttrs)&&!(ue!=null&&ue.hideControls);return r.jsxs(r.Fragment,{children:[ie.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:m,width:"100%"},children:[r.jsx("div",{"data-controls":pe?"textMarginTop":void 0,className:pe?`${s}-control`:void 0,style:{height:E.scalingValue(L??0,n??!1)}}),r.jsx("div",{...ae&&{"data-testimonial-measure":"text"},style:{...vt(Y,n),...z&&z>0?{minHeight:z}:{},textAlign:b,pointerEvents:"auto"},children:r.jsx(Yn,{content:ie.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:m,width:"100%"},children:[r.jsx("div",{"data-controls":pe?"imageMarginTop":void 0,className:pe?`${s}-control`:void 0,style:{height:E.scalingValue(u??0,n??!1)}}),r.jsx("div",{style:{width:E.scalingValue(y??0,n??!1),height:E.scalingValue(g??0,n??!1)},children:(($e=ie.image)==null?void 0:$e.url)&&r.jsx("img",{src:(Pe=ie.image)==null?void 0:Pe.url,alt:((Ie=ie.image)==null?void 0:Ie.name)??"",className:`${s}-icon`,style:{objectFit:((Me=ie.image)==null?void 0:Me.objectFit)||"contain"}})})]}),ie.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:m,width:"100%"},children:[r.jsx("div",{"data-controls":pe?"captionMarginTop":void 0,className:pe?`${s}-control`:void 0,style:{height:E.scalingValue(C??0,n??!1)}}),r.jsx("div",{...ae?{"data-testimonial-measure":"caption"}:{},style:{...vt(k,n),...q&&q>0?{minHeight:q}:{},textAlign:b,pointerEvents:"auto"},children:r.jsx(Yn,{content:ie.caption})})]})]})},ee=c.useCallback(ie=>{_(ie.maxTextPx),D(ie.maxCaptionPx)},[]);if(c.useLayoutEffect(()=>{if(!N){ee({maxTextPx:0,maxCaptionPx:0});return}const ie=v.current;if(!ie)return;const ue=()=>{E.readTestimonialTextMeasure(ie,ee)};ue();const z=new ResizeObserver(ue);return z.observe(ie),()=>{z.disconnect()}},[N,ee,t]),!P)return r.jsx(r.Fragment,{});const he=N?{textMinHeightPx:A,captionMinHeightPx:V}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${s}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Gd(s)}}),r.jsxs("div",{className:`${s}-wrapper`,style:{width:E.scalingValue(p??0,n??!1),alignItems:m},children:[N&&r.jsx("div",{ref:v,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((ie,ue)=>r.jsx("div",{style:{width:"100%"},children:ye(ie,{dataMeasureAttrs:!0})},ue))}),r.jsxs("div",{className:`${s}-fade-stack`,children:[W&&w&&r.jsx("div",{className:De(`${s}-fade-item-prev`,`${s}-fade-out`),children:ye(W,{...he,hideControls:!0})}),r.jsx("div",{className:De(`${s}-fade-item-current`,w?`${s}-fade-in`:void 0),children:ye(P,he)})]})]}),Q.mode==="On"&&r.jsxs("div",{className:`${s}-controls`,children:[r.jsx("div",{className:`${s}-arrow`,style:{width:E.scalingValue(h??.02,n??!1),height:E.scalingValue(h??.02,n??!1),"--arrow-hover-color":$},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:f,disabled:!M,"aria-label":"Previous testimonial",children:Q.icon&&r.jsx(Nt,{url:Q.icon,fill:T,hoverFill:$,className:De(`${s}-arrow-img`,`${s}-mirror`)})})}),r.jsx("div",{className:De(`${s}-arrow`,`${s}-next-arrow`),style:{width:E.scalingValue(h??.02,n??!1),height:E.scalingValue(h??.02,n??!1),"--arrow-hover-color":$},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:ne,disabled:!M,"aria-label":"Next testimonial",children:Q.icon&&r.jsx(Nt,{url:Q.icon,fill:T,hoverFill:$,className:`${s}-arrow-img`})})})]})]})})},qd=`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,11 +3642,11 @@ type TestimonialsSettings = {
|
|
|
3642
3642
|
icon?: string | null;
|
|
3643
3643
|
};
|
|
3644
3644
|
};
|
|
3645
|
-
`,
|
|
3645
|
+
`,Xd="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>'),Pr={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Yd={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:{...Pr.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:{...Pr.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:Xd},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:Kd,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:Yd,sourceCode:qd,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 Ar(e){return((e==null?void 0:e.trim().length)??0)>0}function ao(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function so(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:E.scalingValue((o-t)/2,i)}}function Qd(e){return`
|
|
3646
3646
|
.${e}-wrapper {
|
|
3647
3647
|
display: grid;
|
|
3648
3648
|
align-items: start;
|
|
3649
|
-
min-height: ${
|
|
3649
|
+
min-height: ${Zd(48)};
|
|
3650
3650
|
}
|
|
3651
3651
|
.${e}-item {
|
|
3652
3652
|
display: flex;
|
|
@@ -3845,7 +3845,7 @@ type TestimonialsSettings = {
|
|
|
3845
3845
|
pointer-events: auto;
|
|
3846
3846
|
z-index: 10;
|
|
3847
3847
|
}
|
|
3848
|
-
`}const Dt=500,Qd=750,Zt="cubic-bezier(0.22, 1, 0.36, 1)";function Qt(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function Ar({media:e,className:t,style:n,onImageClick:i}){return Qt(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 eu({images:e,index:t,imageDisplay:n,originRect:i,reverseClose:o,onClose:s,onPrev:l,onNext:d,counterClassName:a,counterStyle:p}){const u=n==="cover",L=c.useRef(null),C=c.useRef(null),[y,g]=c.useState(null),[h,T]=c.useState(i?"opening":"open"),[$,x]=c.useState(!0),S=c.useRef(t),H=c.useCallback(()=>{const m=L.current,b=C.current;if(!m||!b)return;const P=m.getBoundingClientRect(),W=P.width,G=P.height,Y=b.naturalWidth,k=b.naturalHeight;if(!W||!G||!Y||!k)return;if(n==="cover"){g({width:W,height:G,left:P.left,top:P.top});return}const N=Y/k,v=W/G;if(N>v){const _=W/N;g({width:W,height:_,left:P.left,top:P.top+(G-_)/2})}else{const _=G*N;g({width:_,height:G,left:P.left+(W-_)/2,top:P.top})}},[n]);c.useEffect(()=>{H();const m=L.current;if(!m)return;const b=new ResizeObserver(()=>H());return b.observe(m),()=>b.disconnect()},[H,t]),c.useEffect(()=>{h==="opening"&&y&&T("open")},[h,y]),c.useEffect(()=>{if(h!=="closing")return;const m=setTimeout(()=>s(),Dt);return()=>clearTimeout(m)},[h,s]),c.useEffect(()=>{S.current!==t&&x(!1),S.current=t},[t]),c.useEffect(()=>{const m=b=>{b.key==="Escape"&&(b.preventDefault(),b.stopPropagation(),h!=="closing"&&T("closing"))};return window.addEventListener("keydown",m,!0),()=>window.removeEventListener("keydown",m,!0)},[h]);const R=()=>{h!=="closing"&&T("closing")},B=h==="open",w=h==="closing",I=w&&o&&!!i,O=h==="opening"?i??y:I?i:y;return r.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:R,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:B?1:0,transition:`opacity ${Dt}ms ${Zt}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:u?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:L,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:B?1:0,transition:`opacity ${Dt}ms ${Zt}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:a,style:p,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:L,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:B?1:0,transition:`opacity ${Dt}ms ${Zt}`},children:e.length>1&&r.jsxs("p",{className:a,style:p,children:[t+1," / ",e.length]})})]})}),O&&r.jsx("img",{ref:C,src:e[t],onLoad:H,style:{position:"fixed",top:O.top,left:O.left,width:O.width,height:O.height,objectFit:n==="cover"?"cover":"contain",opacity:w&&!I?0:1,transition:w&&!I?`opacity ${Dt}ms ${Zt}`:I||$?`top ${Dt}ms ${Zt}, left ${Dt}ms ${Zt}, width ${Dt}ms ${Zt}, height ${Dt}ms ${Zt}`:"none",pointerEvents:"none",zIndex:9998}}),B&&y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{position:"fixed",top:y.top,left:y.left,width:y.width/2,height:y.height,cursor:"w-resize",zIndex:9999},onClick:m=>{m.stopPropagation(),l()}}),r.jsx("div",{style:{position:"fixed",top:y.top,left:y.left+y.width/2,width:y.width/2,height:y.height,cursor:"e-resize",zIndex:9999},onClick:m=>{m.stopPropagation(),d()}})]})]})}function tu(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function nu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d}){const{prefix:a}=E.useScopedStyles(),{type:p="a",gridLayout:u,textBoxWidth:L=100,verticalGap:C,entriesCount:y,lightbox:g,imageDisplay:h,lightboxImageDisplay:T,slider:$,sliderTiming:x,direction:S,transition:H,titleMarginTop:R,subtitleMarginTop:B,titleColor:w,subtitleColor:I,lightboxCounterColor:O,titleFontFamily:m,titleFontSettings:b,titleFontSize:P,titleLineHeight:W,titleLetterSpacing:G,titleWordSpacing:Y,titleTextAppearance:k,subtitleFontFamily:N,subtitleFontSettings:v,subtitleFontSize:_,subtitleLineHeight:A,subtitleLetterSpacing:V,subtitleWordSpacing:D,subtitleTextAppearance:Z,lightboxCounterFontFamily:M,lightboxCounterFontSettings:te,lightboxCounterFontSize:f,lightboxCounterLineHeight:ne,lightboxCounterLetterSpacing:fe,lightboxCounterWordSpacing:ee,lightboxCounterTextAppearance:he,showText:oe="always",alignEntries:ue="off"}=e,z={fontSettings:{fontFamily:m,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:P??.01,lineHeight:W,letterSpacing:G??0,wordSpacing:Y??0,textAppearance:k,color:w},ae={...Nt(vt(z,n))},pe={fontSettings:{fontFamily:N,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:_??.01,lineHeight:A,letterSpacing:V??0,wordSpacing:D??0,textAppearance:Z,color:I},Re={...Nt(vt(pe,n))},Le={fontSettings:{fontFamily:M,fontWeight:(te==null?void 0:te.fontWeight)??400,fontStyle:(te==null?void 0:te.fontStyle)??"normal"},fontSize:f??.01,lineHeight:ne,letterSpacing:fe??0,wordSpacing:ee??0,textAppearance:he,color:O},Ee={...Nt(vt(Le,n)),...so(f,ne,a,n)},j=ao(P,W,`${a}-item-title`,`${a}-text-tight-leading`),se=ao(_,A,`${a}-item-subtitle`,`${a}-text-tight-leading`),F=so(P,W,a,n),U=so(_,A,a,n),q=ao(f,ne,`${a}-lightbox-counter`,`${a}-text-tight-leading`),J=E.buildColorVars(a,{titleColor:w,subtitleColor:I,lightboxCounterColor:O},iu,ou),ke=`${l&&l!=="default"?`${a}-state-${l}`:""}${oe==="on hover"&&(!n||i)?` ${a}-show-text-hover`:""}`.trim(),Ce=y===0?1/0:y,xe=(t??[]).slice(0,Ce),ze=u.entryWidth??.2,ce=(h==null?void 0:h.display)==="cover",Te=(h==null?void 0:h.ratioValue)??"1:1",Fe=(h==null?void 0:h.reversed)??!1,[We,Ge]=Te.split(":").map(Number),bt=`${Fe?Ge:We} / ${Fe?We:Ge}`,Tt=E.scalingValue(ze??0,n),Lt=!ce&&$!=="off",ct={width:Tt,...ce?{aspectRatio:bt,height:"auto",overflow:"hidden"}:{height:"auto"}},pt=`${a}-item-image-wrapper${Lt?` ${a}-item-image-wrapper-fit-slider`:""}`.trim(),_e=p==="c",at=_e&&ue==="on",tt=`calc(${E.scalingValue(ze??0,n)} * (${L} / 100))`,K=E.scalingValue(ze*L/100,n),ie=ce?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[ge,Ie]=c.useState("ltr"),[Ve,nt]=c.useState(0),$e=c.useRef(null);c.useEffect(()=>{const Pe=$e.current;if(!Pe)return;const it=new ResizeObserver(ot=>{nt(Math.round(ot[0].contentRect.width))});return it.observe(Pe),()=>it.disconnect()},[]);const Qe=(()=>{const Pe={...J},it=$e.current?getComputedStyle($e.current).getPropertyValue("--cntrl-article-width").trim():"";return it&&(Pe["--cntrl-article-width"]=it),Pe})(),[je,Ke]=c.useState(!1),[ft,ln]=c.useState([]),[de,be]=c.useState(0),[Ue,He]=c.useState(null),Xe=(Pe,it,ot)=>{if(n&&!i||g==="off")return;const Q=Pe.currentTarget.getBoundingClientRect();He({top:Q.top,left:Q.left,width:Q.width,height:Q.height}),ln(it),be(ot),Ke(!0)};c.useEffect(()=>{if(!je||g!=="on"||typeof document>"u")return;const Pe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Pe}},[je,g]),c.useEffect(()=>{!n||i||(Ke(!1),He(null))},[n,i]);const yt=c.useMemo(()=>Zd(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:yt}}),r.jsx("div",{style:J,children:r.jsx("div",{ref:$e,className:`${a}-wrapper ${a}-type-${p}${at?` ${a}-align-entries`:""} ${ke}`.trim(),style:{gridTemplateColumns:`repeat(${u.columnsCount}, minmax(0, 1fr))`,rowGap:at?0:E.scalingValue(C??0,n),columnGap:E.scalingValue(u.horizontalGap??0,n),width:E.scalingValue(u.wrapperWidth??0,n),...at?{[`--${a}-align-entries-row-gap`]:E.scalingValue(C??0,n)}:{}},children:xe.map((Pe,it)=>{var gt,Rt;const ot=_r(Pe.title),Q=_r(Pe.subtitle),ve=(((gt=Pe.link)==null?void 0:gt.length)??0)>0&&g==="off"?Pe.link:void 0,we=Math.floor(it/u.columnsCount)===Math.ceil(xe.length/u.columnsCount)-1,Ne=_e?r.jsxs("div",{className:`${a}-item-text-block`,children:[ot&&r.jsx("p",{className:j,style:{width:tt,...ae,...F},children:Pe.title}),ot&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(R??0,n),width:K}}),Q&&r.jsx("p",{className:se,style:{width:tt,...Re,...U},children:Pe.subtitle}),Q&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(B??0,n),width:K}})]}):null,st=_e?r.jsxs("div",{className:`${a}-item-title-row`,children:[ot&&r.jsx("p",{className:j,style:{width:tt,...ae,...F},children:Pe.title}),ot&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(R??0,n),width:K}})]}):null,mt=_e?r.jsxs("div",{className:`${a}-item-subtitle-row`,children:[Q&&r.jsx("p",{className:se,style:{width:tt,...Re,...U},children:Pe.subtitle}),Q&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(B??0,n),width:K}})]}):null,Be=ve?r.jsxs("a",{href:ve,target:"_blank",className:`${a}-item-text-link`,children:[st,mt]}):r.jsxs(r.Fragment,{children:[st,mt]}),Et=r.jsx("div",{className:pt,style:ct,children:(((Rt=Pe.image)==null?void 0:Rt.length)??0)===0?null:$==="off"?(()=>{const qe=Pe.image[0],$t=Pe.image.filter(xt=>!Qt(xt)).map(xt=>xt.url);return r.jsx(Ar,{media:qe,className:`${a}-item-${Qt(qe)?"video":"image"}`.trim(),style:ie,onImageClick:Qt(qe)?void 0:xt=>Xe(xt,$t,0)})})():r.jsxs(r.Fragment,{children:[Lt&&r.jsx("div",{className:`${a}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Pe.image.map(qe=>Qt(qe)?r.jsx("video",{src:qe.url,muted:!0,playsInline:!0},`sizer-${qe.url}`):r.jsx("img",{src:qe.url,alt:""},`sizer-${qe.url}`))}),r.jsx(qo,{className:`${a}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:x*1e3,width:"100%",height:"100%",speed:Qd,type:H==="fade"?"fade":"loop",rewind:H==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:H==="fade"?"ltr":S!=="random"?S==="horizontal"?"ltr":"ttb":ge},onMoved:qe=>{if(S!=="random"||H==="fade")return;const Ct=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Ie(Ct),setTimeout(()=>{qe.refresh()},0)},children:Pe.image.map((qe,Ct)=>{const $t=Pe.image.filter(ht=>!Qt(ht)),xt=$t.map(ht=>ht.url),vn=$t.findIndex(ht=>ht.url===qe.url);return r.jsx(Xo,{children:r.jsx(Ar,{media:qe,className:`${a}-item-${Qt(qe)?"video":"image"}`.trim(),style:ie,onImageClick:Qt(qe)?void 0:ht=>Xe(ht,xt,vn)})},Ct)})},`${H}-${ze}-${S}-${x}-${Ve}-${d}`)]})}),It=_e?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&ot?"titleMarginTop":void 0,className:o&&ot?`${a}-control`:void 0,style:{height:ot?E.scalingValue(R??0,n):0,width:K}}),r.jsx("p",{className:j,style:{width:tt,...ae,...F},children:Pe.title}),r.jsx("div",{"data-controls":o&&Q?"subtitleMarginTop":void 0,className:o&&Q?`${a}-control`:void 0,style:{height:Q?E.scalingValue(B??0,n):0,width:K}}),r.jsx("p",{className:se,style:{width:tt,...Re,...U},children:Pe.subtitle})]});return r.jsx("div",{className:`${a}-item`.trim(),children:r.jsx("div",{className:`${o?`${a}-item-inner`:`${a}-item-inner-hidden`}${at&&we?` ${a}-item-inner-last-row`:""}`.trim(),style:{width:(L??0)>100?`calc(${E.scalingValue(ze??0,n)} * (${L} / 100))`:E.scalingValue(ze??0,n)},children:at?r.jsxs(r.Fragment,{children:[Be,r.jsx("a",{href:ve,target:"_blank",className:`${a}-item-image-link`,children:Et})]}):r.jsxs("a",{href:ve,target:"_blank",className:`${a}-item-image-link`,children:[Ne,Et,It]})})},it)})})}),(!n||i)&&je&&typeof document<"u"&&g==="on"&&ei.createPortal(r.jsx("div",{style:Qe,"data-selection":"none",children:r.jsx(eu,{images:ft,index:de,imageDisplay:tu(T),originRect:Ue,reverseClose:$==="off",onClose:()=>Ke(!1),onPrev:()=>be(Pe=>(Pe-1+ft.length)%ft.length),onNext:()=>be(Pe=>(Pe+1)%ft.length),counterClassName:q,counterStyle:Ee})}),document.body)]})}const iu={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},ou=["hover","focus","filled","success","error"],ru=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3848
|
+
`}const jt=500,eu=750,Jt="cubic-bezier(0.22, 1, 0.36, 1)";function Zt(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function _r({media:e,className:t,style:n,onImageClick:i}){return Zt(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 tu({images:e,index:t,imageDisplay:n,originRect:i,reverseClose:o,onClose:s,onPrev:l,onNext:d,counterClassName:a,counterStyle:p}){const u=n==="cover",L=c.useRef(null),C=c.useRef(null),[y,g]=c.useState(null),[h,T]=c.useState(i?"opening":"open"),[$,x]=c.useState(!0),S=c.useRef(t),H=c.useCallback(()=>{const m=L.current,b=C.current;if(!m||!b)return;const P=m.getBoundingClientRect(),W=P.width,G=P.height,Y=b.naturalWidth,k=b.naturalHeight;if(!W||!G||!Y||!k)return;if(n==="cover"){g({width:W,height:G,left:P.left,top:P.top});return}const N=Y/k,v=W/G;if(N>v){const A=W/N;g({width:W,height:A,left:P.left,top:P.top+(G-A)/2})}else{const A=G*N;g({width:A,height:G,left:P.left+(W-A)/2,top:P.top})}},[n]);c.useEffect(()=>{H();const m=L.current;if(!m)return;const b=new ResizeObserver(()=>H());return b.observe(m),()=>b.disconnect()},[H,t]),c.useEffect(()=>{h==="opening"&&y&&T("open")},[h,y]),c.useEffect(()=>{if(h!=="closing")return;const m=setTimeout(()=>s(),jt);return()=>clearTimeout(m)},[h,s]),c.useEffect(()=>{S.current!==t&&x(!1),S.current=t},[t]),c.useEffect(()=>{const m=b=>{b.key==="Escape"&&(b.preventDefault(),b.stopPropagation(),h!=="closing"&&T("closing"))};return window.addEventListener("keydown",m,!0),()=>window.removeEventListener("keydown",m,!0)},[h]);const R=()=>{h!=="closing"&&T("closing")},B=h==="open",w=h==="closing",I=w&&o&&!!i,O=h==="opening"?i??y:I?i:y;return r.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:R,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:B?1:0,transition:`opacity ${jt}ms ${Jt}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:u?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:L,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:B?1:0,transition:`opacity ${jt}ms ${Jt}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:a,style:p,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:L,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:B?1:0,transition:`opacity ${jt}ms ${Jt}`},children:e.length>1&&r.jsxs("p",{className:a,style:p,children:[t+1," / ",e.length]})})]})}),O&&r.jsx("img",{ref:C,src:e[t],onLoad:H,style:{position:"fixed",top:O.top,left:O.left,width:O.width,height:O.height,objectFit:n==="cover"?"cover":"contain",opacity:w&&!I?0:1,transition:w&&!I?`opacity ${jt}ms ${Jt}`:I||$?`top ${jt}ms ${Jt}, left ${jt}ms ${Jt}, width ${jt}ms ${Jt}, height ${jt}ms ${Jt}`:"none",pointerEvents:"none",zIndex:9998}}),B&&y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{position:"fixed",top:y.top,left:y.left,width:y.width/2,height:y.height,cursor:"w-resize",zIndex:9999},onClick:m=>{m.stopPropagation(),l()}}),r.jsx("div",{style:{position:"fixed",top:y.top,left:y.left+y.width/2,width:y.width/2,height:y.height,cursor:"e-resize",zIndex:9999},onClick:m=>{m.stopPropagation(),d()}})]})]})}function nu(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function iu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d}){const{prefix:a}=E.useScopedStyles(),{type:p="a",gridLayout:u,textBoxWidth:L=100,verticalGap:C,entriesCount:y,lightbox:g,imageDisplay:h,lightboxImageDisplay:T,slider:$,sliderTiming:x,direction:S,transition:H,titleMarginTop:R,subtitleMarginTop:B,titleColor:w,subtitleColor:I,lightboxCounterColor:O,titleFontFamily:m,titleFontSettings:b,titleFontSize:P,titleLineHeight:W,titleLetterSpacing:G,titleWordSpacing:Y,titleTextAppearance:k,subtitleFontFamily:N,subtitleFontSettings:v,subtitleFontSize:A,subtitleLineHeight:_,subtitleLetterSpacing:V,subtitleWordSpacing:D,subtitleTextAppearance:Q,lightboxCounterFontFamily:M,lightboxCounterFontSettings:te,lightboxCounterFontSize:f,lightboxCounterLineHeight:ne,lightboxCounterLetterSpacing:ye,lightboxCounterWordSpacing:ee,lightboxCounterTextAppearance:he,showText:ie="always",alignEntries:ue="off"}=e,z={fontSettings:{fontFamily:m,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:P??.01,lineHeight:W,letterSpacing:G??0,wordSpacing:Y??0,textAppearance:k,color:w},ae={...Wt(vt(z,n))},pe={fontSettings:{fontFamily:N,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:A??.01,lineHeight:_,letterSpacing:V??0,wordSpacing:D??0,textAppearance:Q,color:I},Pe={...Wt(vt(pe,n))},Ie={fontSettings:{fontFamily:M,fontWeight:(te==null?void 0:te.fontWeight)??400,fontStyle:(te==null?void 0:te.fontStyle)??"normal"},fontSize:f??.01,lineHeight:ne,letterSpacing:ye??0,wordSpacing:ee??0,textAppearance:he,color:O},Re={...Wt(vt(Ie,n)),...so(f,ne,a,n)},j=ao(P,W,`${a}-item-title`,`${a}-text-tight-leading`),le=ao(A,_,`${a}-item-subtitle`,`${a}-text-tight-leading`),F=so(P,W,a,n),U=so(A,_,a,n),K=ao(f,ne,`${a}-lightbox-counter`,`${a}-text-tight-leading`),J=E.buildColorVars(a,{titleColor:w,subtitleColor:I,lightboxCounterColor:O},ou,ru),Fe=`${l&&l!=="default"?`${a}-state-${l}`:""}${ie==="on hover"&&(!n||i)?` ${a}-show-text-hover`:""}`.trim(),we=y===0?1/0:y,xe=(t??[]).slice(0,we),ze=u.entryWidth??.2,de=(h==null?void 0:h.display)==="cover",Ee=(h==null?void 0:h.ratioValue)??"1:1",We=(h==null?void 0:h.reversed)??!1,[Oe,Ge]=Ee.split(":").map(Number),dt=`${We?Ge:Oe} / ${We?Oe:Ge}`,St=E.scalingValue(ze??0,n),_t=!de&&$!=="off",ft={width:St,...de?{aspectRatio:dt,height:"auto",overflow:"hidden"}:{height:"auto"}},yt=`${a}-item-image-wrapper${_t?` ${a}-item-image-wrapper-fit-slider`:""}`.trim(),Se=p==="c",rt=Se&&ue==="on",it=`calc(${E.scalingValue(ze??0,n)} * (${L} / 100))`,ut=E.scalingValue(ze*L/100,n),X=de?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[re,me]=c.useState("ltr"),[Ae,Ve]=c.useState(0),be=c.useRef(null);c.useEffect(()=>{const Le=be.current;if(!Le)return;const et=new ResizeObserver(nt=>{Ve(Math.round(nt[0].contentRect.width))});return et.observe(Le),()=>et.disconnect()},[]);const qe=(()=>{const Le={...J},et=be.current?getComputedStyle(be.current).getPropertyValue("--cntrl-article-width").trim():"";return et&&(Le["--cntrl-article-width"]=et),Le})(),[Ue,He]=c.useState(!1),[ct,sn]=c.useState([]),[yn,se]=c.useState(0),[Ce,Ze]=c.useState(null),Ne=(Le,et,nt)=>{if(n&&!i||g==="off")return;const Z=Le.currentTarget.getBoundingClientRect();Ze({top:Z.top,left:Z.left,width:Z.width,height:Z.height}),sn(et),se(nt),He(!0)};c.useEffect(()=>{if(!Ue||g!=="on"||typeof document>"u")return;const Le=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Le}},[Ue,g]),c.useEffect(()=>{!n||i||(He(!1),Ze(null))},[n,i]);const Qe=c.useMemo(()=>Qd(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Qe}}),r.jsx("div",{style:J,children:r.jsx("div",{ref:be,className:`${a}-wrapper ${a}-type-${p}${rt?` ${a}-align-entries`:""} ${Fe}`.trim(),style:{gridTemplateColumns:`repeat(${u.columnsCount}, minmax(0, 1fr))`,rowGap:rt?0:E.scalingValue(C??0,n),columnGap:E.scalingValue(u.horizontalGap??0,n),width:E.scalingValue(u.wrapperWidth??0,n),...rt?{[`--${a}-align-entries-row-gap`]:E.scalingValue(C??0,n)}:{}},children:xe.map((Le,et)=>{var mt,Et;const nt=Ar(Le.title),Z=Ar(Le.subtitle),fe=(((mt=Le.link)==null?void 0:mt.length)??0)>0&&g==="off"?Le.link:void 0,Te=Math.floor(et/u.columnsCount)===Math.ceil(xe.length/u.columnsCount)-1,ke=Se?r.jsxs("div",{className:`${a}-item-text-block`,children:[nt&&r.jsx("p",{className:j,style:{width:it,...ae,...F},children:Le.title}),nt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(R??0,n),width:ut}}),Z&&r.jsx("p",{className:le,style:{width:it,...Pe,...U},children:Le.subtitle}),Z&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(B??0,n),width:ut}})]}):null,at=Se?r.jsxs("div",{className:`${a}-item-title-row`,children:[nt&&r.jsx("p",{className:j,style:{width:it,...ae,...F},children:Le.title}),nt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(R??0,n),width:ut}})]}):null,pt=Se?r.jsxs("div",{className:`${a}-item-subtitle-row`,children:[Z&&r.jsx("p",{className:le,style:{width:it,...Pe,...U},children:Le.subtitle}),Z&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(B??0,n),width:ut}})]}):null,Be=fe?r.jsxs("a",{href:fe,target:"_blank",className:`${a}-item-text-link`,children:[at,pt]}):r.jsxs(r.Fragment,{children:[at,pt]}),Tt=r.jsx("div",{className:yt,style:ft,children:(((Et=Le.image)==null?void 0:Et.length)??0)===0?null:$==="off"?(()=>{const Ke=Le.image[0],$t=Le.image.filter(bt=>!Zt(bt)).map(bt=>bt.url);return r.jsx(_r,{media:Ke,className:`${a}-item-${Zt(Ke)?"video":"image"}`.trim(),style:X,onImageClick:Zt(Ke)?void 0:bt=>Ne(bt,$t,0)})})():r.jsxs(r.Fragment,{children:[_t&&r.jsx("div",{className:`${a}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Le.image.map(Ke=>Zt(Ke)?r.jsx("video",{src:Ke.url,muted:!0,playsInline:!0},`sizer-${Ke.url}`):r.jsx("img",{src:Ke.url,alt:""},`sizer-${Ke.url}`))}),r.jsx(qo,{className:`${a}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:x*1e3,width:"100%",height:"100%",speed:eu,type:H==="fade"?"fade":"loop",rewind:H==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:H==="fade"?"ltr":S!=="random"?S==="horizontal"?"ltr":"ttb":re},onMoved:Ke=>{if(S!=="random"||H==="fade")return;const Ct=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";me(Ct),setTimeout(()=>{Ke.refresh()},0)},children:Le.image.map((Ke,Ct)=>{const $t=Le.image.filter(gt=>!Zt(gt)),bt=$t.map(gt=>gt.url),vn=$t.findIndex(gt=>gt.url===Ke.url);return r.jsx(Xo,{children:r.jsx(_r,{media:Ke,className:`${a}-item-${Zt(Ke)?"video":"image"}`.trim(),style:X,onImageClick:Zt(Ke)?void 0:gt=>Ne(gt,bt,vn)})},Ct)})},`${H}-${ze}-${S}-${x}-${Ae}-${d}`)]})}),Lt=Se?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&nt?"titleMarginTop":void 0,className:o&&nt?`${a}-control`:void 0,style:{height:nt?E.scalingValue(R??0,n):0,width:ut}}),r.jsx("p",{className:j,style:{width:it,...ae,...F},children:Le.title}),r.jsx("div",{"data-controls":o&&Z?"subtitleMarginTop":void 0,className:o&&Z?`${a}-control`:void 0,style:{height:Z?E.scalingValue(B??0,n):0,width:ut}}),r.jsx("p",{className:le,style:{width:it,...Pe,...U},children:Le.subtitle})]});return r.jsx("div",{className:`${a}-item`.trim(),children:r.jsx("div",{className:`${o?`${a}-item-inner`:`${a}-item-inner-hidden`}${rt&&Te?` ${a}-item-inner-last-row`:""}`.trim(),style:{width:(L??0)>100?`calc(${E.scalingValue(ze??0,n)} * (${L} / 100))`:E.scalingValue(ze??0,n)},children:rt?r.jsxs(r.Fragment,{children:[Be,r.jsx("a",{href:fe,target:"_blank",className:`${a}-item-image-link`,children:Tt})]}):r.jsxs("a",{href:fe,target:"_blank",className:`${a}-item-image-link`,children:[ke,Tt,Lt]})})},et)})})}),(!n||i)&&Ue&&typeof document<"u"&&g==="on"&&ei.createPortal(r.jsx("div",{style:qe,"data-selection":"none",children:r.jsx(tu,{images:ct,index:yn,imageDisplay:nu(T),originRect:Ce,reverseClose:$==="off",onClose:()=>He(!1),onPrev:()=>se(Le=>(Le-1+ct.length)%ct.length),onNext:()=>se(Le=>(Le+1)%ct.length),counterClassName:K,counterStyle:Re})}),document.body)]})}const ou={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},ru=["hover","focus","filled","success","error"],au=`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"}}}},au=["titleColor","subtitleColor","lightboxCounterColor"],su={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:"Leaving 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:[...au],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},lu={element:nu,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:su,sourceCode:ru};function cu(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 du({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 s=o.play();s&&s.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Li(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function uu(e){return String(e??"").trim().length>0}function Mr(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 kr(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 Fr(e,t,n,i,o,s,l){const d=E.scalingValue(s,l),a=E.scalingValue(0,l),p=e===0,u=e===t-1&&!o;return{borderTopWidth:p&&n?d:a,borderBottomWidth:!u||i?d:a}}function pu(e,t,n){const i=E.scalingValue(t,n),o=E.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Wr=10;function mu(e){return`
|
|
5017
|
+
`,lo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},su=["titleColor","subtitleColor","lightboxCounterColor"],lu={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:"Leaving 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:[...su],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},cu={element:iu,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:lu,sourceCode:au};function du(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 uu({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 s=o.play();s&&s.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Li(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function pu(e){return String(e??"").trim().length>0}function Mr(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 kr(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 Fr(e,t,n,i,o,s,l){const d=E.scalingValue(s,l),a=E.scalingValue(0,l),p=e===0,u=e===t-1&&!o;return{borderTopWidth:p&&n?d:a,borderBottomWidth:!u||i?d:a}}function mu(e,t,n){const i=E.scalingValue(t,n),o=E.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Wr=10;function gu(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 on=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Yo=["AColumn","BColumn","CColumn","DColumn","EColumn"],qt="cutLabel",Jo=[...Yo,qt],Xi=["A","B","C","D","E"];function Da(e){return`${e}ColumnVerticalAlign`}const To=["Top","Center","Bottom"];function Zo(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Xi.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function gu(e){const t=Zo(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function hu(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Xi.includes(n)?n:null}function za(e,t,n){const i=hu(e);return i?i===t?!1:gu(n[Da(i)]):!0}function Jn(e){const t=Zo(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Xi.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function fu(e,t,n){if(Va(e,t,n))return Jn(e);const i=Jn(e);return i.kind==="baseline"?{kind:"top"}:i}function yu(e){const t=Jn(e);return t.kind==="baseline"?{kind:"top"}:t}function Va(e,t,n){return za(e,n,t)?Jn(e).kind==="baseline":!1}function vu(e){const t={};let n=!1;for(const i of Xi){const o=Da(i),s=e[o];if(e.type==="b"){const l=String(s??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}za(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function bu(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function xu(e){const t=Jn(e).kind;return t==="baseline"?"center":t}function Su(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Nr(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Cu(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),s=o-i;return n.remove(),s}function co(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=Cu(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=s.getBoundingClientRect(),a=o.getBoundingClientRect().height;let p=0;return e.kind==="center"?p=(d.height-a)/2:e.kind==="bottom"&&(p=d.height-a),d.top-t+p+l}function $u(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const s=o.querySelector(`.${n}`);s&&(s.style.minHeight=`${i}px`,s.style.height=`${i}px`)}),i)}function wu(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Tu={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Oe(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Lu={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Eu(e){return[Oe(e,"textFontFamily"),Oe(e,"textFontSettings"),{type:"row",items:[Oe(e,"textFontSize"),Oe(e,"textLineHeight"),Oe(e,"textLetterSpacing"),Oe(e,"textWordSpacing")]},Oe(e,"textTextAlign"),Oe(e,"textTextAppearance"),`${e}VerticalAlign`]}function Iu(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Jo.map(e=>[Lu[e],Eu(e)]))}}function Wi(e,t){const n=i=>{const o=Oe(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===qt?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Hr(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 Nt(vt(n,t))}function Br(e,t,n,i){const o=Wi(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function Or(e,t,n,i){const o=Wi(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:E.scalingValue((s-l)/2,i)}}const At=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],_n=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],An=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Mn=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Ru={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Pu=["hover","focus","filled","success","error"],jr=.004,wn=.004,uo=wn,Dr=12,Qo=50,Zn=1440,Qn=Qo/Zn;function Ga(e){const t=typeof e=="number"&&e>0?e:Zn;return Qo/t}function _u(e,t){const n={position:"absolute",width:Dr,height:Dr,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 zt({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:_u(e,i)})})}function Au(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 Zn}const Ua={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function jn(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Mu(e,t=1){const n=t/e;return Object.fromEntries(At.map(i=>[i,n]))}function ku(){return Object.fromEntries([..._n.map(e=>[e,0]),...An.map(e=>[e,0])])}function Fu(){return Object.fromEntries(Mn.map(e=>[e,0]))}function yi(e){return Object.fromEntries(At.map(t=>[t,typeof e[t]=="number"?e[t]:Ua[t]]))}function Ka(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 s=i/o;return{paddingLeft:t*s,paddingRight:n*s}}function Ei(e,t,n){const i=er(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,l)=>s+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Wu(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=_n[o],l=An[o],d=typeof n[s]=="number"?n[s]:0,a=typeof n[l]=="number"?n[l]:0,p=Ka(t[o]??0,d,a);p.paddingLeft!==d&&(i[s]=p.paddingLeft),p.paddingRight!==a&&(i[l]=p.paddingRight)}return i}function er(e,t,n){if(e<=0)return[];const i=At.slice(0,e).map(p=>n[p]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((p,u)=>p+u,0)+Qn;if(t>=l)return i;const d=[...o];let a=l-t;for(let p=d.length-1;p>=0&&a>0;p-=1){const u=d[p]-Qn;if(u<=0)continue;const L=Math.min(a,u);d[p]-=L,a-=L}return[...d,i[e-1]]}function Nu(e,t,n){if(e<=1)return{};const i=er(e,t,n),o={};for(let s=0;s<e-1;s+=1){const l=At[s];i[s]!==n[l]&&(o[l]=i[s])}return o}function zr(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...on]}function Hu(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Bu(e,t,n,i){const o=Math.min(i,e.length,At.length),s={};for(let l=0;l<o;l+=1){const d=e[l],a=t.indexOf(d);if(a===-1)continue;const p=At[a],u=_n[a],L=An[a],C=Mn[a],y=At[l],g=_n[l],h=An[l],T=Mn[l],$=n[p],x=n[u],S=n[L],H=n[C];typeof $=="number"&&(s[y]=$),typeof x=="number"&&(s[g]=x),typeof S=="number"&&(s[h]=S),typeof H=="number"&&(s[T]=H)}return s}function qa(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 Ou(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=jn(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Mu(n,o),...ku()};if(s)for(const d of Mn)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Fu());return qa(e,l)?l:e}function ju(e,t,n){const i=vu(e);i&&(e={...e,...i});const o=Ga(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=jn(e),a=jn(t),p=e.type==="b"||e.type===void 0&&t.type==="b",u=typeof s=="number"?s:typeof l=="number"?l:on.length,L=S=>{if(p)return S;const H=yi({...t,...S}),R=jn(S),B=Ei(u,R,H),w=Wu(u,B,{...t,...S});return Object.keys(w).length===0?S:{...S,...w}};if(typeof s=="number"&&s!==l)return e;const C=zr(e),y=zr(t);if(!Hu(C,y))return L({...e,...Bu(C,y,t,u)});if(d<a&&typeof u=="number"&&!p){const S=yi({...t,...e});return L({...e,...Nu(u,d,S)})}if(p){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return S>H?{...e,textPaddingLR:H}:e}const g=yi({...t,...e}),h=Ei(u,a,yi(t)),$=Ei(u,d,g).some((S,H)=>S<(h[H]??S)),x=At.some(S=>{const H=e[S],R=t[S];return typeof H=="number"&&typeof R=="number"&&H!==R});return $||x?L(e):e}function Du(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),s=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(Qn,i-o-s-Qn)}function zu(e,t){return Math.random()*(t-e)+e}function Vu(e){return Object.fromEntries(At.map(t=>[t,typeof e[t]=="number"?e[t]:Ua[t]]))}function po(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Gu(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const a=_n[d],p=An[d],u=Mn[d];return{key:l,textPrefix:Tu[l],widthKey:At[d],width:n[At[d]],paddingLeftKey:a,paddingRightKey:p,paddingBottomKey:u,paddingLeft:i[a],paddingRight:o[p],paddingBottom:s[u]}})}function Uu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:a}=E.useScopedStyles(),p=!!o,{columns:u,type:L,wrapperWidth:C,entriesCount:y,cellMinHeight:g,dividerWidth:h,showVisibility:T,cut:$,showCut:x,cutCellMinHeight:S,cutLabel:H,imageSize:R,imageOnHover:B,entryHoverEffect:w,entryHoverShowOption:I,rowPaddingTop:O,rowPaddingBottom:m,rowPaddingTopB:b,columnsOrder:P,textPaddingLR:W,textColor:G,backgroundColor:Y,dividerColor:k,textHoverColor:N,backgroundHoverColor:v,dividerHoverColor:_}=e,[A,V]=c.useState(void 0),[D,Z]=c.useState(null),M=B==="on"&&(!n||i),te=($??0)>0,f=L==="b",ne=c.useRef(null),fe=c.useRef(null),[ee,he]=c.useState(null),[oe,ue]=c.useState(Zn),z=Ga(oe),X=Math.max(0,((C??0)-z)/2),ae=Math.min(W??0,X),pe=Math.max(ae,wn),Se=((C??0)+z)/2;c.useLayoutEffect(()=>{if(!n){ue(Zn);return}const Q=()=>{ue(Au(ne.current))};Q();const ve=ne.current;if(!ve)return;const we=new ResizeObserver(Q);we.observe(ve);let Ne=ve;for(;Ne&&!Ne.style.getPropertyValue("--cntrl-article-width");)Ne=Ne.parentElement;return Ne&&we.observe(Ne),()=>we.disconnect()},[n,l]),c.useEffect(()=>{V(void 0)},[$,x,t,y]),c.useEffect(()=>{n&&!i&&V(void 0)},[n,i]);const Re=E.buildColorVars(a,{textColor:G,backgroundColor:Y,dividerColor:k,textHoverColor:N,backgroundHoverColor:v,dividerHoverColor:_},Ru,Pu),Le=s&&s!=="default"?`${a}-state-${s}`:"",Ee=`${!n||i?w==="default"?`${a}-entry-hover-default`:w==="blinds"?`${a}-entry-hover-blinds`:w==="reveal"?`${a}-entry-hover-reveal`:"":""} ${Le}`.trim(),j=w==="reveal"&&(!n||i),se=(T==null?void 0:T[0])??!1,F=(T==null?void 0:T[1])??!1,U=c.useRef(e),q=c.useRef(l);c.useEffect(()=>{if(!d||!n){U.current=e,q.current=l;return}if(q.current!==l){U.current=e,q.current=l;return}const Q=U.current;if(!(Q!==e))return;if(typeof Q.columns=="number"&&typeof e.columns=="number"&&Q.columns!==e.columns){U.current=e;return}const we=ju(e,Q,{designWidth:oe});U.current=e,qa(e,we)&&d(we)},[e,d,n,l,oe]);const J=c.useMemo(()=>Vu(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),re=c.useMemo(()=>po(e,_n),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),me=c.useMemo(()=>po(e,An),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),ke=c.useMemo(()=>po(e,Mn),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Ce=c.useMemo(()=>Array.isArray(P)&&P.length>0?P:[...on],[P]),xe=c.useMemo(()=>Gu(Ce,u,J,re,me,ke),[Ce,u,J,re,me,ke]),ze=jn(e),ce=c.useMemo(()=>At.slice(0,u).map(Q=>J[Q]),[u,J]),Te=c.useMemo(()=>er(u,ze,J),[u,ze,J]),Fe=c.useMemo(()=>Ei(u,ze,J),[u,ze,J]),We=c.useMemo(()=>xe.map((Q,ve)=>Ka(Fe[ve]??0,Q.paddingLeft,Q.paddingRight)),[xe,Fe]),Ge=c.useMemo(()=>{const Q=y===0?1/0:y;return(t??[]).slice(0,Q).map((we,Ne)=>({id:Ne,cells:Object.fromEntries(on.map(st=>[st,we[st]??""])),image:we.image,link:we.link}))},[t,y]),dt=te?A??$:Ge.length,ut=c.useMemo(()=>te?Ge.slice(0,dt):Ge,[Ge,te,dt]),bt=te&&dt<Ge.length,Tt=ut.length>1||bt,Lt=[se?`${a}-divider-top`:"",F||Tt?`${a}-divider-bottom`:""].filter(Boolean).join(" "),ct=!n||i,pt=()=>{if(!ct)return;const Q=A??$;if(!x){V(Ge.length);return}V(Math.min(Q+x,Ge.length))},_e=Q=>E.scalingValue(Q,n??!1),at=f?b??0:O??0,tt=m??0,K=g??0,ie=at+K/2,ge=Math.max(tt,uo),Ie=Fr(0,ut.length,se,F,bt,h??0,n??!1).borderTopWidth,Ve=ee!=null?`${ee}px`:`calc(${Ie} + ${_e(ie)})`,nt=f?"rowPaddingTopB":"rowPaddingTop",$e=xe[0],Qe=xe[xe.length-1],je=We[0],Ke=We[We.length-1],ft=$e&&je?Math.max(je.paddingLeft,wn):0,ln=Qe&&Ke?Math.max(Ke.paddingRight,wn):0,de=ze,be=Q=>{const ve=ne.current;if(!ve)return{x:0,y:0};const we=ve.getBoundingClientRect();return{x:Q.clientX-we.left+Wr,y:Q.clientY-we.top+Wr}},Ue=(Q,ve)=>{if(!M)return;const we=Q.image;if(!(we!=null&&we.url)){Z(null);return}const{x:Ne,y:st}=be(ve),mt=(R==null?void 0:R.min)??80,Be=(R==null?void 0:R.max)??320,Et=(D==null?void 0:D.rowId)===Q.id?D.widthPx:zu(mt,Be);Z({rowId:Q.id,url:we.url,objectFit:"contain",isVideo:cu(we),widthPx:Et,x:Ne,y:st})},He=Q=>{if(!M||!D)return;const{x:ve,y:we}=be(Q);Z(Ne=>!Ne||Ne.x===ve&&Ne.y===we?Ne:{...Ne,x:ve,y:we})},Xe=()=>{Z(null)},yt=Q=>{j&&Mr(Q,a),M&&Z(null)},Pe=Q=>{j&&kr(Q,a)};c.useLayoutEffect(()=>{if(!p||f){he(null);return}const Q=fe.current,ve=Q==null?void 0:Q.parentElement;if(!Q||!ve){he(null);return}const we=()=>{const st=Q.querySelector("[data-list-row]");if(!st){he(null);return}const mt=ve.getBoundingClientRect(),Be=st.getBoundingClientRect();he(Be.top-mt.top+Be.height/2)};we();const Ne=new ResizeObserver(we);return Ne.observe(Q),Ne.observe(ve),()=>Ne.disconnect()},[p,f,ut,at,tt,K,t,e,xe,Fe,oe,h,se,F,bt]);const it=c.useMemo(()=>!f&&Yo.some(Q=>{const ve=Q.charAt(0),we=e[`${Q}VerticalAlign`];return Va(we,e,ve)}),[f,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);c.useLayoutEffect(()=>{var Et;const Q=ne.current;if(!Q)return;const ve=()=>{Q.querySelectorAll("[data-list-col]").forEach(It=>{It.style.transform="";const gt=It.querySelector(`.${a}-list-col`);gt&&(gt.style.minHeight="",gt.style.height="");const Rt=It.querySelector(`.${a}-list-col-title`);Rt&&(Rt.style.transform="")})};if(f||!it){ve();return}const we=()=>{const It=Array.from(Q.querySelectorAll("[data-list-row]")),gt=`${a}-list-col`,Rt=`${a}-baseline-probe`;It.forEach(qe=>{qe.querySelectorAll("[data-list-col]").forEach(Ct=>{Ct.style.transform="";const $t=Ct.querySelector(`.${gt}`);$t&&($t.style.minHeight="",$t.style.height="");const xt=Ct.querySelector(`.${a}-list-col-title`);xt&&(xt.style.transform="")})}),It.forEach(qe=>{const Ct=Array.from(qe.querySelectorAll("[data-list-col]"));$u(qe,Ct,gt)}),Q.offsetHeight,It.forEach(qe=>{const Ct=Array.from(qe.querySelectorAll("[data-list-col]")),$t=qe.getBoundingClientRect().top,xt=new Map,vn=Ct.map(rt=>{const bn=rt.querySelector(`.${a}-list-col-title`),xn={el:rt,titleEl:bn,letter:rt.getAttribute("data-col-letter")??"",kind:rt.getAttribute("data-valign")??"top",anchor:rt.getAttribute("data-valign-anchor")};return xt.set(xn.letter,xn),xn}),ht=new Map,ui=(rt,bn)=>{const xn=ht.get(rt.letter);if(xn!==void 0)return xn;const ir=rt.anchor?xt.get(rt.anchor):void 0;if(rt.kind!=="baseline"||!ir||bn.has(rt.letter)){const rr=co(rt,$t,gt,Rt);return ht.set(rt.letter,rr),rr}bn.add(rt.letter);const es=ui(ir,bn);bn.delete(rt.letter);const ts=co(rt,$t,gt,Rt),ns=es-ts;wu(rt.titleEl,ns);const or=co(rt,$t,gt,Rt);return ht.set(rt.letter,or),or};vn.forEach(rt=>ui(rt,new Set))})};let Ne=null;const st=()=>{Ne===null&&(Ne=requestAnimationFrame(()=>{Ne=null,we()}))};we();const mt=new ResizeObserver(()=>st());mt.observe(Q);let Be=!1;return typeof document<"u"&&((Et=document.fonts)!=null&&Et.ready)&&document.fonts.ready.then(()=>{Be||st()}),()=>{Be=!0,Ne!==null&&(cancelAnimationFrame(Ne),Ne=null),mt.disconnect(),ve()}},[it,f,e,t,oe,ut,Fe]);const ot=c.useMemo(()=>mu(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ot}}),r.jsx("div",{style:Re,children:r.jsxs("div",{ref:ne,className:`${a}-wrapper ${Ee}${Lt?` ${Lt}`:""}${f?` ${a}-type-b`:""}`.trim(),style:{width:E.scalingValue(C??0,n),...!f&&p?{[`--${a}-first-entry-handle-top`]:Ve}:{}},onMouseMove:M?He:void 0,onMouseLeave:M?Xe:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[ut.map((Q,ve)=>{var mt;const we=(((mt=Q.link)==null?void 0:mt.length)??0)>0,Ne=we&&(!n||i)?"a":"div",st=Fr(ve,ut.length,se,F,bt,h??0,n??!1);return r.jsxs(Ne,{ref:ve===0?Be=>{fe.current=Be}:void 0,className:`${a}-list-item${we||I==="always"?` ${a}-list-item-has-link`:""}`,...we?{href:Q.link,target:"_blank"}:{},style:st,onMouseEnter:Be=>{j&&(we||I==="always")&&Mr(Be,a),M&&Ue(Q,Be)},onMouseLeave:Be=>{j&&(we||I==="always")&&kr(Be,a)},children:[at>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:_e(at)}}),r.jsxs("div",{className:`${a}-list-cols-row${f?"":` ${a}-list-cols-row-h`}${p&&ve===0&&f?` ${a}-list-cols-row-controls`:""}`,...f?{}:{"data-list-row":""},style:f?void 0:{minHeight:_e(K)},children:[xe.map((Be,Et)=>{const It=Et===xe.length-1,gt=We[Et],Rt=Be.paddingBottom,qe=uu(Q.cells[Be.key]),Ct=f&&qe&&Rt>0,$t=f?{minHeight:_e(K)}:{width:_e(Fe[Et])},xt=f?{paddingLeft:_e(ae),paddingRight:_e(ae)}:{paddingLeft:_e(gt.paddingLeft),paddingRight:_e(gt.paddingRight)},vn=Be.textPrefix.charAt(0),ht=f?yu(e[`${Be.textPrefix}VerticalAlign`]):fu(e[`${Be.textPrefix}VerticalAlign`],e,vn),ui=f&&qe&&p&&ve===0;return r.jsxs("div",{className:f?`${a}-list-col-wrap`:void 0,...f?{}:{"data-list-col":"","data-col-letter":vn,"data-valign":ht.kind,...ht.kind==="baseline"?{"data-valign-anchor":ht.anchorLetter}:{}},children:[r.jsx("div",{className:`${a}-list-col${It?` ${a}-list-col-last`:""}`,style:{...xt,...$t,...f?{justifyContent:Nr(ht.kind)}:{}},"data-test":Be.width,children:r.jsx("span",{className:Br(e,Be.textPrefix,`${a}-list-col-title`,`${a}-text-tight-leading`),style:{...Hr(Wi(e,Be.textPrefix),n),...Or(e,Be.textPrefix,a,n),...f?{}:bu(ht.kind)},children:Q.cells[Be.key]??null})}),Ct&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:_e(Rt)}}),ui&&r.jsx(zt,{P:a,"data-controls":Be.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:_e(Math.max(Rt,uo))}})]},Be.key)}),p&&ve===0&&f&&r.jsxs(r.Fragment,{children:[r.jsx(zt,{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(Se),className:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:_e(pe),height:"100%"}}),r.jsx(zt,{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(Se),className:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:_e(Math.max(pe,ze-pe)),width:_e(pe),height:"100%"}})]})]}),!f&&tt>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:_e(tt)}}),p&&ve===0&&!f&&r.jsx(zt,{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:_e(ge)}})]},Q.id)}),p&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(zt,{P:a,"data-controls":nt,"data-controls-static-handle":"",...f?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:f?"center":"left-y",areaStyle:{position:"absolute",top:Ie,left:0,width:"100%",height:_e(Math.max(at,uo))}})},"row-padding-handles"),p&&!f&&$e&&Qe&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(zt,{P:a,"data-controls":$e.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Fe[0]-((je==null?void 0:je.paddingRight)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:_e(ft),height:"100%"}}),r.jsx(zt,{P:a,"data-controls":Qe.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(Fe[xe.length-1]-((Ke==null?void 0:Ke.paddingLeft)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:_e(de-ln),width:_e(ln),height:"100%"}})]},"column-edge-padding-handles"),p&&!f&&xe.slice(0,-1).map((Q,ve)=>{const we=xe[ve+1],Ne=Te.slice(0,ve+1).reduce((It,gt)=>It+gt,0),st=We[ve],mt=We[ve+1],Be=Math.max(st.paddingRight,wn),Et=Math.max(mt.paddingLeft,wn);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(zt,{P:a,"data-controls":Q.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(Fe[ve]-st.paddingLeft),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:_e(Ne-Be),width:_e(Be),height:"100%"}}),r.jsx(zt,{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(Fe[ve+1]-mt.paddingRight),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:_e(Ne),width:_e(Et),height:"100%"}})]},`${Q.paddingRightKey}-padding`)}),p&&!f&&xe.slice(0,-1).map((Q,ve)=>{const we=Du(ve,Te,ce,ze),st=Te.slice(0,ve+1).reduce((mt,Be)=>mt+Be,0)-jr/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Q.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(Qo),"data-controls-max-fraction":String(we),"data-controls-variant":"column-width",className:`${a}-col-resize-handle`,style:{position:"absolute",top:"0px",left:_e(st),width:_e(jr),height:"calc(100%)",pointerEvents:"auto"}})},`${Q.widthKey}-junction`)})]}),bt&&(()=>{const Q=Wi(e,qt),ve=xu(e.cutLabelVerticalAlign),we=Q.textTextAlign==="justify"||f;return r.jsx("button",{type:"button",className:`${a}-cut-item`,style:{minHeight:_e(S??0),cursor:ct?"pointer":"default",...pu(F,h??0,n??!1)},onClick:ct?pt:void 0,onMouseEnter:j||M?yt:void 0,onMouseLeave:j?Pe:void 0,children:r.jsx("div",{className:`${a}-list-cols-row`,style:{...f?{paddingLeft:_e(ae),paddingRight:_e(ae)}:{},justifyContent:Su(Q.textTextAlign),alignItems:Nr(ve)},children:r.jsx("span",{className:Br(e,qt,`${a}-cut-label`,`${a}-text-tight-leading`),style:{...Hr(Q,n),...Or(e,qt,a,n),...we?{width:"100%"}:{}},children:H})})})})(),M&&D&&(()=>{const Q=Li(D.widthPx),ve={width:Q,height:"auto",maxHeight:Q,objectFit:"contain",left:D.x,top:D.y,position:"absolute"};return r.jsx(du,{media:D,className:D.isVideo?`${a}-hover-video`:`${a}-hover-image`,style:ve},`${D.rowId}-${D.url}`)})()]})})]})}const Ku=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ComponentPropsWithoutRef } from 'react';
|
|
5448
|
+
`}const nn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Yo=["AColumn","BColumn","CColumn","DColumn","EColumn"],Kt="cutLabel",Jo=[...Yo,Kt],Xi=["A","B","C","D","E"];function Da(e){return`${e}ColumnVerticalAlign`}const To=["Top","Center","Bottom"];function Zo(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Xi.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function hu(e){const t=Zo(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function fu(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Xi.includes(n)?n:null}function za(e,t,n){const i=fu(e);return i?i===t?!1:hu(n[Da(i)]):!0}function Jn(e){const t=Zo(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Xi.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function yu(e,t,n){if(Va(e,t,n))return Jn(e);const i=Jn(e);return i.kind==="baseline"?{kind:"top"}:i}function vu(e){const t=Jn(e);return t.kind==="baseline"?{kind:"top"}:t}function Va(e,t,n){return za(e,n,t)?Jn(e).kind==="baseline":!1}function bu(e){const t={};let n=!1;for(const i of Xi){const o=Da(i),s=e[o];if(e.type==="b"){const l=String(s??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}za(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function xu(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Su(e){const t=Jn(e).kind;return t==="baseline"?"center":t}function Cu(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Nr(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function $u(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),s=o-i;return n.remove(),s}function co(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=$u(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=s.getBoundingClientRect(),a=o.getBoundingClientRect().height;let p=0;return e.kind==="center"?p=(d.height-a)/2:e.kind==="bottom"&&(p=d.height-a),d.top-t+p+l}function wu(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const s=o.querySelector(`.${n}`);s&&(s.style.minHeight=`${i}px`,s.style.height=`${i}px`)}),i)}function Tu(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Lu={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function je(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Eu={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Iu(e){return[je(e,"textFontFamily"),je(e,"textFontSettings"),{type:"row",items:[je(e,"textFontSize"),je(e,"textLineHeight"),je(e,"textLetterSpacing"),je(e,"textWordSpacing")]},je(e,"textTextAlign"),je(e,"textTextAppearance"),`${e}VerticalAlign`]}function Ru(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Jo.map(e=>[Eu[e],Iu(e)]))}}function Wi(e,t){const n=i=>{const o=je(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===Kt?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Hr(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 Wt(vt(n,t))}function Br(e,t,n,i){const o=Wi(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function Or(e,t,n,i){const o=Wi(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:E.scalingValue((s-l)/2,i)}}const Pt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],An=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],_n=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Mn=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Pu={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Au=["hover","focus","filled","success","error"],jr=.004,wn=.004,uo=wn,Dr=12,Qo=50,Zn=1440,Qn=Qo/Zn;function Ga(e){const t=typeof e=="number"&&e>0?e:Zn;return Qo/t}function _u(e,t){const n={position:"absolute",width:Dr,height:Dr,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 Dt({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:_u(e,i)})})}function Mu(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 Zn}const Ua={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function jn(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function ku(e,t=1){const n=t/e;return Object.fromEntries(Pt.map(i=>[i,n]))}function Fu(){return Object.fromEntries([...An.map(e=>[e,0]),..._n.map(e=>[e,0])])}function Wu(){return Object.fromEntries(Mn.map(e=>[e,0]))}function yi(e){return Object.fromEntries(Pt.map(t=>[t,typeof e[t]=="number"?e[t]:Ua[t]]))}function Ka(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 s=i/o;return{paddingLeft:t*s,paddingRight:n*s}}function Ei(e,t,n){const i=er(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,l)=>s+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Nu(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=An[o],l=_n[o],d=typeof n[s]=="number"?n[s]:0,a=typeof n[l]=="number"?n[l]:0,p=Ka(t[o]??0,d,a);p.paddingLeft!==d&&(i[s]=p.paddingLeft),p.paddingRight!==a&&(i[l]=p.paddingRight)}return i}function er(e,t,n){if(e<=0)return[];const i=Pt.slice(0,e).map(p=>n[p]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((p,u)=>p+u,0)+Qn;if(t>=l)return i;const d=[...o];let a=l-t;for(let p=d.length-1;p>=0&&a>0;p-=1){const u=d[p]-Qn;if(u<=0)continue;const L=Math.min(a,u);d[p]-=L,a-=L}return[...d,i[e-1]]}function Hu(e,t,n){if(e<=1)return{};const i=er(e,t,n),o={};for(let s=0;s<e-1;s+=1){const l=Pt[s];i[s]!==n[l]&&(o[l]=i[s])}return o}function zr(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...nn]}function Bu(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Ou(e,t,n,i){const o=Math.min(i,e.length,Pt.length),s={};for(let l=0;l<o;l+=1){const d=e[l],a=t.indexOf(d);if(a===-1)continue;const p=Pt[a],u=An[a],L=_n[a],C=Mn[a],y=Pt[l],g=An[l],h=_n[l],T=Mn[l],$=n[p],x=n[u],S=n[L],H=n[C];typeof $=="number"&&(s[y]=$),typeof x=="number"&&(s[g]=x),typeof S=="number"&&(s[h]=S),typeof H=="number"&&(s[T]=H)}return s}function qa(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 ju(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=jn(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...ku(n,o),...Fu()};if(s)for(const d of Mn)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Wu());return qa(e,l)?l:e}function Du(e,t,n){const i=bu(e);i&&(e={...e,...i});const o=Ga(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=jn(e),a=jn(t),p=e.type==="b"||e.type===void 0&&t.type==="b",u=typeof s=="number"?s:typeof l=="number"?l:nn.length,L=S=>{if(p)return S;const H=yi({...t,...S}),R=jn(S),B=Ei(u,R,H),w=Nu(u,B,{...t,...S});return Object.keys(w).length===0?S:{...S,...w}};if(typeof s=="number"&&s!==l)return e;const C=zr(e),y=zr(t);if(!Bu(C,y))return L({...e,...Ou(C,y,t,u)});if(d<a&&typeof u=="number"&&!p){const S=yi({...t,...e});return L({...e,...Hu(u,d,S)})}if(p){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return S>H?{...e,textPaddingLR:H}:e}const g=yi({...t,...e}),h=Ei(u,a,yi(t)),$=Ei(u,d,g).some((S,H)=>S<(h[H]??S)),x=Pt.some(S=>{const H=e[S],R=t[S];return typeof H=="number"&&typeof R=="number"&&H!==R});return $||x?L(e):e}function zu(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),s=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(Qn,i-o-s-Qn)}function Vu(e,t){return Math.random()*(t-e)+e}function Gu(e){return Object.fromEntries(Pt.map(t=>[t,typeof e[t]=="number"?e[t]:Ua[t]]))}function po(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Uu(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const a=An[d],p=_n[d],u=Mn[d];return{key:l,textPrefix:Lu[l],widthKey:Pt[d],width:n[Pt[d]],paddingLeftKey:a,paddingRightKey:p,paddingBottomKey:u,paddingLeft:i[a],paddingRight:o[p],paddingBottom:s[u]}})}function Ku({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:a}=E.useScopedStyles(),p=!!o,{columns:u,type:L,wrapperWidth:C,entriesCount:y,cellMinHeight:g,dividerWidth:h,showVisibility:T,cut:$,showCut:x,cutCellMinHeight:S,cutLabel:H,imageSize:R,imageOnHover:B,entryHoverEffect:w,entryHoverShowOption:I,rowPaddingTop:O,rowPaddingBottom:m,rowPaddingTopB:b,columnsOrder:P,textPaddingLR:W,textColor:G,backgroundColor:Y,dividerColor:k,textHoverColor:N,backgroundHoverColor:v,dividerHoverColor:A}=e,[_,V]=c.useState(void 0),[D,Q]=c.useState(null),M=B==="on"&&(!n||i),te=($??0)>0,f=L==="b",ne=c.useRef(null),ye=c.useRef(null),[ee,he]=c.useState(null),[ie,ue]=c.useState(Zn),z=Ga(ie),q=Math.max(0,((C??0)-z)/2),ae=Math.min(W??0,q),pe=Math.max(ae,wn),$e=((C??0)+z)/2;c.useLayoutEffect(()=>{if(!n){ue(Zn);return}const Z=()=>{ue(Mu(ne.current))};Z();const fe=ne.current;if(!fe)return;const Te=new ResizeObserver(Z);Te.observe(fe);let ke=fe;for(;ke&&!ke.style.getPropertyValue("--cntrl-article-width");)ke=ke.parentElement;return ke&&Te.observe(ke),()=>Te.disconnect()},[n,l]),c.useEffect(()=>{V(void 0)},[$,x,t,y]),c.useEffect(()=>{n&&!i&&V(void 0)},[n,i]);const Pe=E.buildColorVars(a,{textColor:G,backgroundColor:Y,dividerColor:k,textHoverColor:N,backgroundHoverColor:v,dividerHoverColor:A},Pu,Au),Ie=s&&s!=="default"?`${a}-state-${s}`:"",Re=`${!n||i?w==="default"?`${a}-entry-hover-default`:w==="blinds"?`${a}-entry-hover-blinds`:w==="reveal"?`${a}-entry-hover-reveal`:"":""} ${Ie}`.trim(),j=w==="reveal"&&(!n||i),le=(T==null?void 0:T[0])??!1,F=(T==null?void 0:T[1])??!1,U=c.useRef(e),K=c.useRef(l);c.useEffect(()=>{if(!d||!n){U.current=e,K.current=l;return}if(K.current!==l){U.current=e,K.current=l;return}const Z=U.current;if(!(Z!==e))return;if(typeof Z.columns=="number"&&typeof e.columns=="number"&&Z.columns!==e.columns){U.current=e;return}const Te=Du(e,Z,{designWidth:ie});U.current=e,qa(e,Te)&&d(Te)},[e,d,n,l,ie]);const J=c.useMemo(()=>Gu(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),oe=c.useMemo(()=>po(e,An),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),ge=c.useMemo(()=>po(e,_n),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Fe=c.useMemo(()=>po(e,Mn),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),we=c.useMemo(()=>Array.isArray(P)&&P.length>0?P:[...nn],[P]),xe=c.useMemo(()=>Uu(we,u,J,oe,ge,Fe),[we,u,J,oe,ge,Fe]),ze=jn(e),de=c.useMemo(()=>Pt.slice(0,u).map(Z=>J[Z]),[u,J]),Ee=c.useMemo(()=>er(u,ze,J),[u,ze,J]),We=c.useMemo(()=>Ei(u,ze,J),[u,ze,J]),Oe=c.useMemo(()=>xe.map((Z,fe)=>Ka(We[fe]??0,Z.paddingLeft,Z.paddingRight)),[xe,We]),Ge=c.useMemo(()=>{const Z=y===0?1/0:y;return(t??[]).slice(0,Z).map((Te,ke)=>({id:ke,cells:Object.fromEntries(nn.map(at=>[at,Te[at]??""])),image:Te.image,link:Te.link}))},[t,y]),lt=te?_??$:Ge.length,ht=c.useMemo(()=>te?Ge.slice(0,lt):Ge,[Ge,te,lt]),dt=te&<<Ge.length,St=ht.length>1||dt,_t=[le?`${a}-divider-top`:"",F||St?`${a}-divider-bottom`:""].filter(Boolean).join(" "),ft=!n||i,yt=()=>{if(!ft)return;const Z=_??$;if(!x){V(Ge.length);return}V(Math.min(Z+x,Ge.length))},Se=Z=>E.scalingValue(Z,n??!1),rt=f?b??0:O??0,it=m??0,ut=g??0,X=rt+ut/2,re=Math.max(it,uo),me=Fr(0,ht.length,le,F,dt,h??0,n??!1).borderTopWidth,Ae=ee!=null?`${ee}px`:`calc(${me} + ${Se(X)})`,Ve=f?"rowPaddingTopB":"rowPaddingTop",be=xe[0],qe=xe[xe.length-1],Ue=Oe[0],He=Oe[Oe.length-1],ct=be&&Ue?Math.max(Ue.paddingLeft,wn):0,sn=qe&&He?Math.max(He.paddingRight,wn):0,yn=ze,se=Z=>{const fe=ne.current;if(!fe)return{x:0,y:0};const Te=fe.getBoundingClientRect();return{x:Z.clientX-Te.left+Wr,y:Z.clientY-Te.top+Wr}},Ce=(Z,fe)=>{if(!M)return;const Te=Z.image;if(!(Te!=null&&Te.url)){Q(null);return}const{x:ke,y:at}=se(fe),pt=(R==null?void 0:R.min)??80,Be=(R==null?void 0:R.max)??320,Tt=(D==null?void 0:D.rowId)===Z.id?D.widthPx:Vu(pt,Be);Q({rowId:Z.id,url:Te.url,objectFit:"contain",isVideo:du(Te),widthPx:Tt,x:ke,y:at})},Ze=Z=>{if(!M||!D)return;const{x:fe,y:Te}=se(Z);Q(ke=>!ke||ke.x===fe&&ke.y===Te?ke:{...ke,x:fe,y:Te})},Ne=()=>{Q(null)},Qe=Z=>{j&&Mr(Z,a),M&&Q(null)},Le=Z=>{j&&kr(Z,a)};c.useLayoutEffect(()=>{if(!p||f){he(null);return}const Z=ye.current,fe=Z==null?void 0:Z.parentElement;if(!Z||!fe){he(null);return}const Te=()=>{const at=Z.querySelector("[data-list-row]");if(!at){he(null);return}const pt=fe.getBoundingClientRect(),Be=at.getBoundingClientRect();he(Be.top-pt.top+Be.height/2)};Te();const ke=new ResizeObserver(Te);return ke.observe(Z),ke.observe(fe),()=>ke.disconnect()},[p,f,ht,rt,it,ut,t,e,xe,We,ie,h,le,F,dt]);const et=c.useMemo(()=>!f&&Yo.some(Z=>{const fe=Z.charAt(0),Te=e[`${Z}VerticalAlign`];return Va(Te,e,fe)}),[f,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);c.useLayoutEffect(()=>{var Tt;const Z=ne.current;if(!Z)return;const fe=()=>{Z.querySelectorAll("[data-list-col]").forEach(Lt=>{Lt.style.transform="";const mt=Lt.querySelector(`.${a}-list-col`);mt&&(mt.style.minHeight="",mt.style.height="");const Et=Lt.querySelector(`.${a}-list-col-title`);Et&&(Et.style.transform="")})};if(f||!et){fe();return}const Te=()=>{const Lt=Array.from(Z.querySelectorAll("[data-list-row]")),mt=`${a}-list-col`,Et=`${a}-baseline-probe`;Lt.forEach(Ke=>{Ke.querySelectorAll("[data-list-col]").forEach(Ct=>{Ct.style.transform="";const $t=Ct.querySelector(`.${mt}`);$t&&($t.style.minHeight="",$t.style.height="");const bt=Ct.querySelector(`.${a}-list-col-title`);bt&&(bt.style.transform="")})}),Lt.forEach(Ke=>{const Ct=Array.from(Ke.querySelectorAll("[data-list-col]"));wu(Ke,Ct,mt)}),Z.offsetHeight,Lt.forEach(Ke=>{const Ct=Array.from(Ke.querySelectorAll("[data-list-col]")),$t=Ke.getBoundingClientRect().top,bt=new Map,vn=Ct.map(ot=>{const bn=ot.querySelector(`.${a}-list-col-title`),xn={el:ot,titleEl:bn,letter:ot.getAttribute("data-col-letter")??"",kind:ot.getAttribute("data-valign")??"top",anchor:ot.getAttribute("data-valign-anchor")};return bt.set(xn.letter,xn),xn}),gt=new Map,ui=(ot,bn)=>{const xn=gt.get(ot.letter);if(xn!==void 0)return xn;const ir=ot.anchor?bt.get(ot.anchor):void 0;if(ot.kind!=="baseline"||!ir||bn.has(ot.letter)){const rr=co(ot,$t,mt,Et);return gt.set(ot.letter,rr),rr}bn.add(ot.letter);const ts=ui(ir,bn);bn.delete(ot.letter);const ns=co(ot,$t,mt,Et),is=ts-ns;Tu(ot.titleEl,is);const or=co(ot,$t,mt,Et);return gt.set(ot.letter,or),or};vn.forEach(ot=>ui(ot,new Set))})};let ke=null;const at=()=>{ke===null&&(ke=requestAnimationFrame(()=>{ke=null,Te()}))};Te();const pt=new ResizeObserver(()=>at());pt.observe(Z);let Be=!1;return typeof document<"u"&&((Tt=document.fonts)!=null&&Tt.ready)&&document.fonts.ready.then(()=>{Be||at()}),()=>{Be=!0,ke!==null&&(cancelAnimationFrame(ke),ke=null),pt.disconnect(),fe()}},[et,f,e,t,ie,ht,We]);const nt=c.useMemo(()=>gu(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:nt}}),r.jsx("div",{style:Pe,children:r.jsxs("div",{ref:ne,className:`${a}-wrapper ${Re}${_t?` ${_t}`:""}${f?` ${a}-type-b`:""}`.trim(),style:{width:E.scalingValue(C??0,n),...!f&&p?{[`--${a}-first-entry-handle-top`]:Ae}:{}},onMouseMove:M?Ze:void 0,onMouseLeave:M?Ne:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[ht.map((Z,fe)=>{var pt;const Te=(((pt=Z.link)==null?void 0:pt.length)??0)>0,ke=Te&&(!n||i)?"a":"div",at=Fr(fe,ht.length,le,F,dt,h??0,n??!1);return r.jsxs(ke,{ref:fe===0?Be=>{ye.current=Be}:void 0,className:`${a}-list-item${Te||I==="always"?` ${a}-list-item-has-link`:""}`,...Te?{href:Z.link,target:"_blank"}:{},style:at,onMouseEnter:Be=>{j&&(Te||I==="always")&&Mr(Be,a),M&&Ce(Z,Be)},onMouseLeave:Be=>{j&&(Te||I==="always")&&kr(Be,a)},children:[rt>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:Se(rt)}}),r.jsxs("div",{className:`${a}-list-cols-row${f?"":` ${a}-list-cols-row-h`}${p&&fe===0&&f?` ${a}-list-cols-row-controls`:""}`,...f?{}:{"data-list-row":""},style:f?void 0:{minHeight:Se(ut)},children:[xe.map((Be,Tt)=>{const Lt=Tt===xe.length-1,mt=Oe[Tt],Et=Be.paddingBottom,Ke=pu(Z.cells[Be.key]),Ct=f&&Ke&&Et>0,$t=f?{minHeight:Se(ut)}:{width:Se(We[Tt])},bt=f?{paddingLeft:Se(ae),paddingRight:Se(ae)}:{paddingLeft:Se(mt.paddingLeft),paddingRight:Se(mt.paddingRight)},vn=Be.textPrefix.charAt(0),gt=f?vu(e[`${Be.textPrefix}VerticalAlign`]):yu(e[`${Be.textPrefix}VerticalAlign`],e,vn),ui=f&&Ke&&p&&fe===0;return r.jsxs("div",{className:f?`${a}-list-col-wrap`:void 0,...f?{}:{"data-list-col":"","data-col-letter":vn,"data-valign":gt.kind,...gt.kind==="baseline"?{"data-valign-anchor":gt.anchorLetter}:{}},children:[r.jsx("div",{className:`${a}-list-col${Lt?` ${a}-list-col-last`:""}`,style:{...bt,...$t,...f?{justifyContent:Nr(gt.kind)}:{}},"data-test":Be.width,children:r.jsx("span",{className:Br(e,Be.textPrefix,`${a}-list-col-title`,`${a}-text-tight-leading`),style:{...Hr(Wi(e,Be.textPrefix),n),...Or(e,Be.textPrefix,a,n),...f?{}:xu(gt.kind)},children:Z.cells[Be.key]??null})}),Ct&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:Se(Et)}}),ui&&r.jsx(Dt,{P:a,"data-controls":Be.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(Et,uo))}})]},Be.key)}),p&&fe===0&&f&&r.jsxs(r.Fragment,{children:[r.jsx(Dt,{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($e),className:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Se(pe),height:"100%"}}),r.jsx(Dt,{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($e),className:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Se(Math.max(pe,ze-pe)),width:Se(pe),height:"100%"}})]})]}),!f&&it>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:Se(it)}}),p&&fe===0&&!f&&r.jsx(Dt,{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(re)}})]},Z.id)}),p&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(Dt,{P:a,"data-controls":Ve,"data-controls-static-handle":"",...f?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:f?"center":"left-y",areaStyle:{position:"absolute",top:me,left:0,width:"100%",height:Se(Math.max(rt,uo))}})},"row-padding-handles"),p&&!f&&be&&qe&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Dt,{P:a,"data-controls":be.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(We[0]-((Ue==null?void 0:Ue.paddingRight)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Se(ct),height:"100%"}}),r.jsx(Dt,{P:a,"data-controls":qe.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(We[xe.length-1]-((He==null?void 0:He.paddingLeft)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Se(yn-sn),width:Se(sn),height:"100%"}})]},"column-edge-padding-handles"),p&&!f&&xe.slice(0,-1).map((Z,fe)=>{const Te=xe[fe+1],ke=Ee.slice(0,fe+1).reduce((Lt,mt)=>Lt+mt,0),at=Oe[fe],pt=Oe[fe+1],Be=Math.max(at.paddingRight,wn),Tt=Math.max(pt.paddingLeft,wn);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Dt,{P:a,"data-controls":Z.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(We[fe]-at.paddingLeft),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Se(ke-Be),width:Se(Be),height:"100%"}}),r.jsx(Dt,{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(We[fe+1]-pt.paddingRight),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Se(ke),width:Se(Tt),height:"100%"}})]},`${Z.paddingRightKey}-padding`)}),p&&!f&&xe.slice(0,-1).map((Z,fe)=>{const Te=zu(fe,Ee,de,ze),at=Ee.slice(0,fe+1).reduce((pt,Be)=>pt+Be,0)-jr/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Z.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(Qo),"data-controls-max-fraction":String(Te),"data-controls-variant":"column-width",className:`${a}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Se(at),width:Se(jr),height:"calc(100%)",pointerEvents:"auto"}})},`${Z.widthKey}-junction`)})]}),dt&&(()=>{const Z=Wi(e,Kt),fe=Su(e.cutLabelVerticalAlign),Te=Z.textTextAlign==="justify"||f;return r.jsx("button",{type:"button",className:`${a}-cut-item`,style:{minHeight:Se(S??0),cursor:ft?"pointer":"default",...mu(F,h??0,n??!1)},onClick:ft?yt:void 0,onMouseEnter:j||M?Qe:void 0,onMouseLeave:j?Le:void 0,children:r.jsx("div",{className:`${a}-list-cols-row`,style:{...f?{paddingLeft:Se(ae),paddingRight:Se(ae)}:{},justifyContent:Cu(Z.textTextAlign),alignItems:Nr(fe)},children:r.jsx("span",{className:Br(e,Kt,`${a}-cut-label`,`${a}-text-tight-leading`),style:{...Hr(Z,n),...Or(e,Kt,a,n),...Te?{width:"100%"}:{}},children:H})})})})(),M&&D&&(()=>{const Z=Li(D.widthPx),fe={width:Z,height:"auto",maxHeight:Z,objectFit:"contain",left:D.x,top:D.y,position:"absolute"};return r.jsx(uu,{media:D,className:D.isVideo?`${a}-hover-video`:`${a}-hover-image`,style:fe},`${D.rowId}-${D.url}`)})()]})})]})}const qu=`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';
|
|
@@ -8456,7 +8456,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8456
8456
|
</>
|
|
8457
8457
|
);
|
|
8458
8458
|
}
|
|
8459
|
-
`,Hn=["A","B","C","D","E"],Vr=[...To,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],dn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function qu(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function vi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Xu(){return Object.fromEntries(Hn.map((e,t)=>{const n=on[t],i=`${e} column`;return[n,qu(i)]}))}function Yu(){const e={};for(const t of Hn)e[`${t}ColumnWidth`]=vi(`${t} column width`),e[`${t}ColumnPaddingLeft`]=vi(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=vi(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=vi(`${t} column padding bottom`);return e}function Gr(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...on]};for(const s of Hn)i[`${s}ColumnWidth`]=s==="A"?.0798:.32,i[`${s}ColumnPaddingLeft`]=0,i[`${s}ColumnPaddingRight`]=0,i[`${s}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Ju(e){const t={};if(e===qt)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...To]},enum:[...To]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Vr],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Vr]}}return t[Oe(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Oe(e,"textFontSettings")]={...dn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Oe(e,"textFontSize")]={...dn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Oe(e,"textLineHeight")]={...dn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Oe(e,"textLetterSpacing")]={...dn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Oe(e,"textWordSpacing")]={...dn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Oe(e,"textTextAlign")]={...dn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Oe(e,"textTextAppearance")]={...dn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Zu=Jo.reduce((e,t)=>({...e,...Ju(t)}),{});function Qu(e){return{verticalAlign:e===qt?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===qt?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function ep(e,t={}){var n;return{...Qu(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Ur=new Set(["textFontFamily","textFontSettings"]);function tp(e,t,n){const i=s=>n===void 0?!0:n==="common"?Ur.has(s):!Ur.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Zo(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Oe(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Oe(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Oe(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Oe(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Oe(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Oe(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Oe(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Oe(e,"textTextAppearance")]=t.textTextAppearance),o}function Ii(e={},t){return Jo.reduce((n,i)=>({...n,...tp(i,ep(i,e),t)}),{})}const np=Ii(),ip=Iu();function Xa(e){return[Oe(e,"textFontFamily"),Oe(e,"textFontSettings"),Oe(e,"textFontSize"),Oe(e,"textLineHeight"),Oe(e,"textLetterSpacing"),Oe(e,"textWordSpacing"),Oe(e,"textTextAlign"),Oe(e,"textTextAppearance"),`${e}VerticalAlign`]}function op(){const e=[];return Yo.forEach((t,n)=>{const i=on[n],o=Xa(t);for(let s=1;s<on.length;s+=1){const l=[{name:"columns",value:s},...Array.from({length:s},(d,a)=>({name:`columnsOrder.${a}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const rp=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Xa(qt);const ap=[...Hn.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],un=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(1).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(2).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(3).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(4).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(5).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(8).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(9).webp"}],sp=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:un[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:un[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:un[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:un[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:un[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:un[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:un[6],link:""}],lp=[...Hn.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],cp={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...Xu(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:sp},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...Yu(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},...Zu,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...np,...Ii({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Gr({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...Ii({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Gr({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...Ii({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...op(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...ap.map(e=>({if:{name:"type",value:"b"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...Hn.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...lp]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",ip]}],paletteBookmark:{items:[...rp],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},dp={element:Uu,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Ou(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:cp,sourceCode:Ku},Xt=e=>e.display==="Cover",Yi=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Kr=100,up=.2,qr=8,Ya=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=c.useState(0),[l,d]=c.useState(!1),a=c.useRef(null),p=c.useRef(0);p.current=o;const u=c.useMemo(()=>typeof window>"u"?Kr:Math.max(Kr,window.innerHeight*up),[]),L=c.useCallback(m=>Math.max(0,1-m/(u*1.5)),[u]),C=c.useCallback(m=>Math.max(0,1-m/(u*.45)),[u]),y=c.useCallback(m=>{const b=typeof window<"u"?window.innerHeight:800,P=Math.max(.88,1-m/b*.12);return`translateY(${m}px) scale(${P})`},[]),g=c.useCallback(()=>{a.current=null},[]),h=c.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),T=c.useCallback(()=>{const m=typeof window<"u"?window.innerHeight:800;d(!0),s(m),window.setTimeout(()=>{t(),g()},Math.min(n,200))},[n,t,g]),$=c.useCallback(m=>{!e||l||m.pointerType==="touch"&&(i!=null&&i(m.target)||(a.current={startX:m.clientX,startY:m.clientY,isLocked:null,pointerId:m.pointerId}))},[e,l,i]),x=c.useCallback(m=>{const b=a.current;if(!e||!b||m.pointerType!=="touch"||b.pointerId!==m.pointerId)return;const P=m.clientX-b.startX,W=m.clientY-b.startY;if(b.isLocked===null){if(Math.abs(P)<qr&&Math.abs(W)<qr)return;if(W>0&&W>Math.abs(P))b.isLocked=!0,m.currentTarget.setPointerCapture(m.pointerId);else{b.isLocked=!1,g();return}}if(!b.isLocked)return;m.preventDefault();const G=Math.max(0,W);p.current=G,s(G)},[e,g]),S=c.useCallback(m=>{const b=a.current;if(!e||!b||m.pointerType!=="touch"||b.pointerId!==m.pointerId)return;const P=b.isLocked===!0;if(m.currentTarget.hasPointerCapture(m.pointerId)&&m.currentTarget.releasePointerCapture(m.pointerId),!P){g();return}m.clientY-b.startY>=u?T():h()},[u,T,e,g,h]),H=c.useCallback(m=>{S(m)},[S]),R=c.useCallback(m=>{S(m)},[S]),B=o>0,w=l?`transform ${n}ms ease`:"none",I=l?`opacity ${n}ms ease`:"none",O=o>0||l;return{isSwipeDragging:B,backdropStyle:{opacity:L(o),transition:I},mediaAreaStyle:{transform:y(o),transition:w,touchAction:B?"none":void 0,willChange:B?"transform":void 0},chromeStyle:O?{opacity:C(o),transition:I}:void 0,swipeHandlers:e?{onPointerDown:$,onPointerMove:x,onPointerUp:H,onPointerCancel:R}:{}}},Dn=300,pp=3e3,Ri=42;function mp(e){return`
|
|
8459
|
+
`,Hn=["A","B","C","D","E"],Vr=[...To,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],cn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Xu(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function vi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Yu(){return Object.fromEntries(Hn.map((e,t)=>{const n=nn[t],i=`${e} column`;return[n,Xu(i)]}))}function Ju(){const e={};for(const t of Hn)e[`${t}ColumnWidth`]=vi(`${t} column width`),e[`${t}ColumnPaddingLeft`]=vi(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=vi(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=vi(`${t} column padding bottom`);return e}function Gr(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...nn]};for(const s of Hn)i[`${s}ColumnWidth`]=s==="A"?.0798:.32,i[`${s}ColumnPaddingLeft`]=0,i[`${s}ColumnPaddingRight`]=0,i[`${s}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Zu(e){const t={};if(e===Kt)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...To]},enum:[...To]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Vr],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Vr]}}return t[je(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[je(e,"textFontSettings")]={...cn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[je(e,"textFontSize")]={...cn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[je(e,"textLineHeight")]={...cn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[je(e,"textLetterSpacing")]={...cn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[je(e,"textWordSpacing")]={...cn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[je(e,"textTextAlign")]={...cn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[je(e,"textTextAppearance")]={...cn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Qu=Jo.reduce((e,t)=>({...e,...Zu(t)}),{});function ep(e){return{verticalAlign:e===Kt?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Kt?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function tp(e,t={}){var n;return{...ep(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Ur=new Set(["textFontFamily","textFontSettings"]);function np(e,t,n){const i=s=>n===void 0?!0:n==="common"?Ur.has(s):!Ur.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Zo(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[je(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[je(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[je(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[je(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[je(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[je(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[je(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[je(e,"textTextAppearance")]=t.textTextAppearance),o}function Ii(e={},t){return Jo.reduce((n,i)=>({...n,...np(i,tp(i,e),t)}),{})}const ip=Ii(),op=Ru();function Xa(e){return[je(e,"textFontFamily"),je(e,"textFontSettings"),je(e,"textFontSize"),je(e,"textLineHeight"),je(e,"textLetterSpacing"),je(e,"textWordSpacing"),je(e,"textTextAlign"),je(e,"textTextAppearance"),`${e}VerticalAlign`]}function rp(){const e=[];return Yo.forEach((t,n)=>{const i=nn[n],o=Xa(t);for(let s=1;s<nn.length;s+=1){const l=[{name:"columns",value:s},...Array.from({length:s},(d,a)=>({name:`columnsOrder.${a}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const ap=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Xa(Kt);const sp=[...Hn.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],dn=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(1).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(2).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(3).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(4).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(5).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(8).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(9).webp"}],lp=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:dn[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:dn[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:dn[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:dn[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:dn[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:dn[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:dn[6],link:""}],cp=[...Hn.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],dp={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...Yu(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:lp},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b"]},columns:{type:"number",scope:"layout",title:"Columns",display:{type:"count-number"},min:1,max:5},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},textPaddingLR:{type:"number",scope:"layout",title:"Text Padding LR",min:0,max:9999,display:{type:"range-control"}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...Ju(),columnsOrder:{type:"array",scope:"layout",title:"Columns Order",display:{type:"reorder-input"},items:{type:"string"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},textHoverColor:{type:"string",scope:"common",title:"Text Hover",display:{type:"palette-color-picker"}},...Qu,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...ip,...Ii({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Gr({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...Ii({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Gr({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...Ii({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...rp(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...sp.map(e=>({if:{name:"type",value:"b"},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.rowPaddingTopB.display.visible",value:!1}},...Hn.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...cp]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",op]}],paletteBookmark:{items:[...ap],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},up={element:Ku,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>ju(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},schema:dp,sourceCode:qu},qt=e=>e.display==="Cover",Yi=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Kr=100,pp=.2,qr=8,Ya=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=c.useState(0),[l,d]=c.useState(!1),a=c.useRef(null),p=c.useRef(0);p.current=o;const u=c.useMemo(()=>typeof window>"u"?Kr:Math.max(Kr,window.innerHeight*pp),[]),L=c.useCallback(m=>Math.max(0,1-m/(u*1.5)),[u]),C=c.useCallback(m=>Math.max(0,1-m/(u*.45)),[u]),y=c.useCallback(m=>{const b=typeof window<"u"?window.innerHeight:800,P=Math.max(.88,1-m/b*.12);return`translateY(${m}px) scale(${P})`},[]),g=c.useCallback(()=>{a.current=null},[]),h=c.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),T=c.useCallback(()=>{const m=typeof window<"u"?window.innerHeight:800;d(!0),s(m),window.setTimeout(()=>{t(),g(),d(!1)},Math.min(n,200))},[n,t,g]),$=c.useCallback(m=>{!e||l||m.pointerType==="touch"&&(i!=null&&i(m.target)||(a.current={startX:m.clientX,startY:m.clientY,isLocked:null,pointerId:m.pointerId}))},[e,l,i]),x=c.useCallback(m=>{const b=a.current;if(!e||!b||m.pointerType!=="touch"||b.pointerId!==m.pointerId)return;const P=m.clientX-b.startX,W=m.clientY-b.startY;if(b.isLocked===null){if(Math.abs(P)<qr&&Math.abs(W)<qr)return;if(W>0&&W>Math.abs(P))b.isLocked=!0,m.currentTarget.setPointerCapture(m.pointerId);else{b.isLocked=!1,g();return}}if(!b.isLocked)return;m.preventDefault();const G=Math.max(0,W);p.current=G,s(G)},[e,g]),S=c.useCallback(m=>{const b=a.current;if(!e||!b||m.pointerType!=="touch"||b.pointerId!==m.pointerId)return;const P=b.isLocked===!0;if(m.currentTarget.hasPointerCapture(m.pointerId)&&m.currentTarget.releasePointerCapture(m.pointerId),!P){g();return}m.clientY-b.startY>=u?T():h()},[u,T,e,g,h]),H=c.useCallback(m=>{S(m)},[S]),R=c.useCallback(m=>{S(m)},[S]),B=o>0,w=l?`transform ${n}ms ease`:"none",I=l?`opacity ${n}ms ease`:"none",O=o>0||l;return{isSwipeDragging:B,backdropStyle:{opacity:L(o),transition:I},mediaAreaStyle:{transform:y(o),transition:w,touchAction:B?"none":void 0,willChange:B?"transform":void 0},chromeStyle:O?{opacity:C(o),transition:I}:void 0,swipeHandlers:e?{onPointerDown:$,onPointerMove:x,onPointerUp:H,onPointerCancel:R}:{},dismissAreaStyle:e?{touchAction:"none"}:void 0}},mp="[data-lightbox-scrollable]",Ja=()=>{c.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,s=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const l=d=>{const a=d.target;a instanceof Element&&a.closest(mp)||d.preventDefault()};return document.addEventListener("touchmove",l,{passive:!1}),()=>{document.removeEventListener("touchmove",l),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=s,window.scrollTo(0,e)}},[])},Dn=300,gp=3e3,Ri=42;function hp(e){return`
|
|
8460
8460
|
.${e}-wrapper {
|
|
8461
8461
|
position: relative;
|
|
8462
8462
|
width: 100%;
|
|
@@ -8509,6 +8509,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8509
8509
|
flex-direction: column;
|
|
8510
8510
|
align-items: center;
|
|
8511
8511
|
justify-content: center;
|
|
8512
|
+
overscroll-behavior: none;
|
|
8512
8513
|
}
|
|
8513
8514
|
|
|
8514
8515
|
.${e}-lightbox-editor {
|
|
@@ -8782,7 +8783,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8782
8783
|
box-sizing: border-box;
|
|
8783
8784
|
pointer-events: none;
|
|
8784
8785
|
}
|
|
8785
|
-
`}function gp(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 hp(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=gp(t.text);if(n.title1||n.title2||n.title3)return{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}return{title1:"",title2:"",title3:""}}const ci=["title1","title2","title3"];function Ye(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const fp={title1:"1",title2:"2",title3:"3"};function yp(e){return[Ye(e,"fontFamily"),Ye(e,"fontSettings"),{type:"row",items:[Ye(e,"fontSize"),Ye(e,"lineHeight"),Ye(e,"letterSpacing"),Ye(e,"wordSpacing")]},Ye(e,"textAlign"),Ye(e,"textAppearance")]}function vp(){return{type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ci.map(e=>[fp[e],yp(e)]))}}const bp={title1:"title1Color",title2:"title2Color",title3:"title3Color"},xp={title1:.02,title2:.02,title3:.02};function mo(e,t){const n=i=>{const o=Ye(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[bp[t]]}}function go(e,t,n){var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??xp[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return vt(i,n)}const Sp=1,Xr=.15,Cp=3,$p=20,bi=e=>`max(${e}, ${$p}px)`,wp=({prefix:e,images:t,type:n,backgroundColor:i,contentBackgroundColor:o,thumbnailGap:s,thumbnailMarginBottom:l,imageGap:d,isEditor:a,isEditMode:p,isPreviewMode:u,closeIcon:L,closeIconMaxWidth:C,closeIconColor:y,closeIconHoverColor:g,thumbnailTrigger:h,thumbnailVisibility:T,thumbnailObjectFit:$,thumbnailActive:x,thumbnailActiveColor:S,textMaxWidth:H,title1Gap:R,title2Gap:B,title1:w,title2:I,title3:O,title1Style:m,title2Style:b,title3Style:P,contentMarginTop:W,contentMarginBottom:G,contentMarginLeft:Y,contentMarginRight:k,onClose:N})=>{const v=!!p,_=!p,A=!p&&(!a||!!u),V=A,D=A,Z=Xt($),M=Z?{"--image-aspect-ratio":Yi($)}:void 0,te=(K,ie,ge=!1)=>{const Ie=bi(ie),Ve=`calc(-0.5 * (${Ie} + ${ie}))`;return r.jsx("div",{"data-controls":K,"data-controls-axis":"x",...ge?{"data-controls-reverse":"true"}:void 0,style:{position:"absolute",top:0,right:Ve,width:Ie,height:"100%",pointerEvents:"auto",zIndex:3}})},f=!!(w||I||O),ne=(K=!1)=>{const ie=[];return w&&ie.push({className:`${e}-title1`,style:m,text:w,gapKey:"title1Gap",gap:R}),I&&ie.push({className:`${e}-title2`,style:b,text:I,gapKey:"title2Gap",gap:B}),O&&ie.push({className:`${e}-title3`,style:P,text:O}),ie.map((ge,Ie)=>r.jsxs("div",{className:`${e}-title-cell`,style:Ie<ie.length-1&&ge.gap?{marginRight:ge.gap}:void 0,children:[r.jsx("p",{className:ge.className,style:{...ge.style,maxWidth:H},children:ge.text}),K&&v&&ge.gapKey&&ge.gap&&Ie<ie.length-1?te(ge.gapKey,ge.gap):null]},ge.className))},fe=c.useRef(null),ee=c.useRef(null),he=c.useRef([]),oe=c.useRef(0),ue=c.useRef({isActive:!1,startX:0,scrollLeft:0,hasMoved:!1}),z=t.length>1,X=z?Cp:1,ae=c.useMemo(()=>Array.from({length:X},()=>t).flat(),[t,X]),[pe,Se]=c.useState(!1),[Re,Le]=c.useState(!1),[Me,Ee]=c.useState(!0),[j,se]=c.useState(0),F=c.useRef(j);F.current=j;const U=c.useRef(null),q=c.useRef(!1),J=c.useRef(null),re=c.useRef(null),me=c.useCallback(()=>{_&&(Ee(!0),re.current&&clearTimeout(re.current),re.current=setTimeout(()=>{ue.current.isActive||Ee(!1)},pp))},[_]),ke=c.useCallback(()=>{p||q.current||(q.current=!0,Le(!1),J.current=setTimeout(()=>{N()},Dn))},[p,N]),Ce=c.useCallback(K=>!!(K.closest("[data-controls]")||K.closest(`.${e}-thumbnails`)||K.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:xe,backdropStyle:ze,mediaAreaStyle:ce,chromeStyle:Te,swipeHandlers:Fe}=Ya({enabled:A,onClose:ke,animMs:Dn,isBlockedTarget:Ce}),We=()=>{if(!z||t.length===0)return oe.current=0,0;const K=he.current[0],ie=he.current[t.length];if(!K||!ie)return oe.current;const ge=ie.offsetLeft-K.offsetLeft;return ge>0&&(oe.current=ge),oe.current},Ge=(K=!1)=>{if(!z)return;const ie=ee.current,ge=We();!ie||ge<=0||(ie.scrollLeft<=0?(ie.scrollLeft+=ge,K&&(ue.current.scrollLeft+=ge)):ie.scrollLeft>=ge*2&&(ie.scrollLeft-=ge,K&&(ue.current.scrollLeft-=ge)))},dt=(K=(ie=>(ie=ee.current)==null?void 0:ie.scrollLeft)()??0)=>{let ge=0,Ie=1/0;return he.current.forEach((Ve,nt)=>{if(!Ve)return;const $e=Math.abs(Ve.offsetLeft-K);$e<Ie&&(Ie=$e,ge=nt)}),ge},ut=()=>{!ee.current||t.length===0||U.current===null&&se(dt()%t.length)},bt=()=>{U.current=null,ut()},Tt=(K="smooth")=>{const ie=ee.current;if(!ie||t.length===0)return;const ge=dt(),Ie=he.current[ge];Ie&&(ie.scrollTo({left:Ie.offsetLeft,behavior:K}),se(ge%t.length))},Lt=K=>{const ie=ee.current;ie&&(ie.style.scrollSnapType=K?"":"none")},ct=(K,ie="smooth")=>{const ge=ee.current;if(!ge||t.length===0)return;const Ie=ge.scrollLeft-K,Ve=dt(ge.scrollLeft),nt=he.current[Ve],$e=he.current[Ve+1],Qe=nt?$e?$e.offsetLeft-nt.offsetLeft:nt.offsetWidth:0;let je=Ve;Qe>0&&(Ie>Qe*Xr?je+=1:Ie<-Qe*Xr&&(je-=1)),z||(je=Math.max(0,Math.min(ae.length-1,je)));const Ke=he.current[je];if(!Ke){Tt(ie);return}ge.scrollTo({left:Ke.offsetLeft,behavior:ie}),se(je%t.length)},pt=(K,ie="smooth")=>{const ge=ee.current,Ie=z?t.length+K:K,Ve=he.current[Ie];!ge||!Ve||(ie==="smooth"?U.current=K:U.current=null,se(K),ge.scrollTo({left:Ve.offsetLeft,behavior:ie}))},_e=K=>{if(!V||K.pointerType!=="mouse"||K.button!==0||Ce(K.target))return;const ie=ee.current;ie&&(ue.current={isActive:!0,startX:K.clientX,scrollLeft:ie.scrollLeft,hasMoved:!1},Lt(!1),me(),ie.setPointerCapture(K.pointerId))},at=K=>{if(!V||K.pointerType!=="mouse")return;const ie=ee.current;if(!ie||!ue.current.isActive)return;const ge=K.clientX-ue.current.startX;Math.abs(ge)>Sp&&(ue.current.hasMoved=!0,Se(!0)),ue.current.hasMoved&&(K.preventDefault(),ie.scrollLeft=ue.current.scrollLeft-ge,Ge(!0),ut(),me())},tt=K=>{if(!V||K.pointerType!=="mouse")return;const ie=ee.current;if(!ie)return;const ge=ue.current.hasMoved,Ie=ue.current.scrollLeft;ue.current.isActive=!1,Se(!1),ie.hasPointerCapture(K.pointerId)&&ie.releasePointerCapture(K.pointerId),Ge(),Lt(!0),ge?ct(Ie):ut(),me()};return c.useEffect(()=>{const K=requestAnimationFrame(()=>Le(!0)),ie=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{cancelAnimationFrame(K),document.body.style.overflow=ie,J.current&&clearTimeout(J.current),re.current&&clearTimeout(re.current)}},[]),c.useEffect(()=>{if(!_){Ee(!0);return}me();const K=fe.current;if(!K)return;const ie=()=>me();return K.addEventListener("pointermove",ie),K.addEventListener("pointerdown",ie),()=>{K.removeEventListener("pointermove",ie),K.removeEventListener("pointerdown",ie),re.current&&clearTimeout(re.current)}},[_,me]),c.useEffect(()=>{const K=ie=>{ie.key==="Escape"&&ke()};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[ke]),c.useLayoutEffect(()=>{We(),pt(F.current,"auto")},[d]),c.useLayoutEffect(()=>{We(),pt(0,"auto")},[t.length,z]),c.useEffect(()=>{if(!p)return;const K=ee.current;if(!K)return;const ie=ge=>{ge.preventDefault()};return K.addEventListener("wheel",ie,{passive:!1}),K.addEventListener("touchmove",ie,{passive:!1}),()=>{K.removeEventListener("wheel",ie),K.removeEventListener("touchmove",ie)}},[p]),c.useEffect(()=>{const K=ee.current;if(!K)return;let ie=null;const ge=()=>{Ge(),ut(),U.current!==null&&(ie&&clearTimeout(ie),ie=setTimeout(()=>{U.current!==null&&bt()},150))},Ie=()=>{U.current!==null&&(ie&&(clearTimeout(ie),ie=null),bt())};K.addEventListener("scroll",ge,{passive:!0}),K.addEventListener("scrollend",Ie);const Ve=new ResizeObserver(()=>{We(),Ge(),ut()});return Ve.observe(K),()=>{ie&&clearTimeout(ie),K.removeEventListener("scroll",ge),K.removeEventListener("scrollend",Ie),Ve.disconnect()}},[t.length,z]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${a?` ${e}-lightbox-editor`:""}${p?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{xe||ke()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Re?1:0,transition:`opacity ${Dn}ms ease`,pointerEvents:Re?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:i,...ze}}),r.jsxs("div",{ref:fe,className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%"},...Fe,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:ce,onClick:K=>K.stopPropagation(),children:r.jsx("div",{ref:ee,className:`${e}-lightbox-strip`,style:{gap:d},"data-mouse-draggable":V&&t.length>0?"true":"false","data-mouse-dragging":pe?"true":"false",onPointerDown:_e,onPointerMove:at,onPointerUp:tt,onPointerCancel:tt,children:ae.map((K,ie)=>{const ge=K.image.objectFit??"contain",Ie=ie%t.length,Ve=Math.floor(ie/t.length),nt=bi(d),$e=`calc(-0.5 * (${nt} + ${d}))`;return r.jsxs("div",{ref:Qe=>he.current[ie]=Qe,className:`${e}-strip-item`,style:{height:"100%"},children:[r.jsx("img",{src:K.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ge}}),v&&Ie<t.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:$e,width:nt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ve}-${K.image.url}-${Ie}`)})})}),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"}:{},...Te},children:[r.jsx("div",{"data-controls":v?"contentMarginTop":void 0,"data-controls-static-handle":v?"":void 0,className:v?`${e}-control`:void 0,style:{height:W,width:"100%",pointerEvents:v?"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":v?"contentMarginLeft":void 0,"data-controls-axis":v?"x":void 0,className:v?`${e}-control`:void 0,style:{width:Y,flexShrink:0}}),r.jsxs("div",{className:`${e}-lightbox-content-area`,children:[f&&r.jsx("div",{className:`${e}-titles-row`,children:ne(!0)}),L&&r.jsx("div",{className:`${e}-close-icon`,"data-chrome-hidden":_&&!Me?"true":"false",style:{width:E.scalingValue(C??0,a),height:E.scalingValue(C??0,a),"--close-icon-hover-color":g},children:r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:ke,"aria-label":"Close",children:r.jsx(Ht,{url:L,fill:y,hoverFill:g,className:`${e}-close-icon-img`})})})]}),r.jsx("div",{"data-controls":v?"contentMarginRight":void 0,"data-controls-axis":v?"x":void 0,"data-controls-reverse":v?"":void 0,className:v?`${e}-control`:void 0,style:{width:k,flexShrink:0,pointerEvents:v?"auto":"none"}})]}),n==="B"&&r.jsx("div",{"data-controls":v?"contentMarginBottom":void 0,"data-controls-static-handle":v?"":void 0,className:v?`${e}-control`:void 0,style:{height:G,width:"100%",pointerEvents:v?"auto":"none"}})]}),t.length>1&&T==="on"&&(()=>{const K=bi(l),ie=`calc(-0.5 * (${l} + ${K}))`;return r.jsxs("div",{className:`${e}-thumbnails`,"data-thumbnail-active":x,"data-chrome-hidden":_&&!Me?"true":"false",style:{gap:s,bottom:l,"--thumbnail-active-color":S,...Te},children:[t.map((ge,Ie)=>{const Ve=bi(s),nt=`calc(-0.5 * (${Ve} + ${s}))`;return r.jsxs("div",{style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":j===Ie?"true":"false",onClick:()=>A&&h==="click"&&pt(Ie),onMouseEnter:()=>D&&h==="hover"&&pt(Ie),"aria-label":ge.image.name?`View ${ge.image.name}`:`View image ${Ie+1}`,"aria-current":j===Ie?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${Z?` ${e}-thumb-image-cover`:""}`,src:ge.image.url,alt:"",draggable:!1,style:{...M,...$.display==="Cover"?{width:Ri}:{width:"100%"}}})}),v&&Ie<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:nt,width:Ve,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ge.image.url}-${Ie}`)}),v&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":v?"":void 0,style:{position:"absolute",left:0,right:0,bottom:ie,height:K,pointerEvents:"auto",zIndex:3}})]})})()]})]})},Tp=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s})=>{const{prefix:l}=E.useScopedStyles(),{cover:d,coverFit:a,type:p,backgroundColor:u,contentBackgroundColor:L,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailTrigger:g,thumbnailActive:h,thumbnailActiveColor:T,thumbnailGap:$,thumbnailMarginBottom:x,imageGap:S,textMaxWidth:H,title1Gap:R,title2Gap:B,closeIcon:w,closeIconMaxWidth:I,closeIconColor:O,closeIconHoverColor:m,contentMarginTop:b,contentMarginBottom:P,contentMarginLeft:W,contentMarginRight:G}=e,Y=c.useRef(null),[k,N]=c.useState(!1),v=t??[],{title1:_,title2:A,title3:V}=hp(v),D=fe=>E.scalingValue(fe,n??!1),Z=go("title1",mo(e,"title1"),n),M=go("title2",mo(e,"title2"),n),te=go("title3",mo(e,"title3"),n),f=()=>{i||v.length===0||n&&!o||N(!0)},ne=()=>{N(!1)};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:Y,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:mp(l)}}),d?r.jsx("button",{type:"button",className:`${l}-cover ${Xt(a)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:f,style:{display:"block",padding:0,border:"none",background:"transparent",...Xt(a)?{"--image-aspect-ratio":Yi(a)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${l}-cover-image ${Xt(a)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})}):null]}),k&&typeof document<"u"&&(()=>{const fe=(s?document.getElementById(s):null)??document.body;return ei.createPortal(r.jsx(wp,{prefix:l,type:p,images:v,backgroundColor:u,contentBackgroundColor:L,thumbnailGap:D($),thumbnailMarginBottom:D(x??.02),imageGap:D(S??0),thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailTrigger:g,thumbnailActive:h,thumbnailActiveColor:T,textMaxWidth:D(H),title1Gap:D(R??0),title2Gap:D(B??0),title1:_,title2:A,title3:V,title1Style:Z,title2Style:M,title3Style:te,contentMarginTop:D(b??0),contentMarginBottom:D(P??0),contentMarginLeft:D(W??0),contentMarginRight:D(G??0),closeIcon:w,closeIconMaxWidth:I,closeIconColor:O,closeIconHoverColor:m,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:ne}),fe)})()]})},Lp=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
8786
|
+
`}function fp(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 yp(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=fp(t.text);if(n.title1||n.title2||n.title3)return{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}return{title1:"",title2:"",title3:""}}const ci=["title1","title2","title3"];function Xe(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const vp={title1:"1",title2:"2",title3:"3"};function bp(e){return[Xe(e,"fontFamily"),Xe(e,"fontSettings"),{type:"row",items:[Xe(e,"fontSize"),Xe(e,"lineHeight"),Xe(e,"letterSpacing"),Xe(e,"wordSpacing")]},Xe(e,"textAlign"),Xe(e,"textAppearance")]}function xp(){return{type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ci.map(e=>[vp[e],bp(e)]))}}const Sp={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Cp={title1:.02,title2:.02,title3:.02};function mo(e,t){const n=i=>{const o=Xe(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[Sp[t]]}}function go(e,t,n){var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??Cp[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return vt(i,n)}const $p=1,Xr=.15,wp=3,Tp=20,bi=e=>`max(${e}, ${Tp}px)`,Lp=({prefix:e,images:t,type:n,backgroundColor:i,contentBackgroundColor:o,thumbnailGap:s,thumbnailMarginBottom:l,imageGap:d,isEditor:a,isEditMode:p,isPreviewMode:u,closeIcon:L,closeIconMaxWidth:C,closeIconColor:y,closeIconHoverColor:g,thumbnailTrigger:h,thumbnailVisibility:T,thumbnailObjectFit:$,thumbnailActive:x,thumbnailActiveColor:S,textMaxWidth:H,title1Gap:R,title2Gap:B,title1:w,title2:I,title3:O,title1Style:m,title2Style:b,title3Style:P,contentMarginTop:W,contentMarginBottom:G,contentMarginLeft:Y,contentMarginRight:k,onClose:N})=>{const v=!!p,A=!p,_=!p&&(!a||!!u),V=_,D=_,Q=qt($),M=Q?{"--image-aspect-ratio":Yi($)}:void 0,te=(X,re,me=!1)=>{const Ae=bi(re),Ve=`calc(-0.5 * (${Ae} + ${re}))`;return r.jsx("div",{"data-controls":X,"data-controls-axis":"x",...me?{"data-controls-reverse":"true"}:void 0,style:{position:"absolute",top:0,right:Ve,width:Ae,height:"100%",pointerEvents:"auto",zIndex:3}})},f=!!(w||I||O),ne=(X=!1)=>{const re=[];return w&&re.push({className:`${e}-title1`,style:m,text:w,gapKey:"title1Gap",gap:R}),I&&re.push({className:`${e}-title2`,style:b,text:I,gapKey:"title2Gap",gap:B}),O&&re.push({className:`${e}-title3`,style:P,text:O}),re.map((me,Ae)=>r.jsxs("div",{className:`${e}-title-cell`,style:Ae<re.length-1&&me.gap?{marginRight:me.gap}:void 0,children:[r.jsx("p",{className:me.className,style:{...me.style,maxWidth:H},children:me.text}),X&&v&&me.gapKey&&me.gap&&Ae<re.length-1?te(me.gapKey,me.gap):null]},me.className))},ye=c.useRef(null),ee=c.useRef(null),he=c.useRef([]),ie=c.useRef(0),ue=c.useRef({isActive:!1,startX:0,scrollLeft:0,hasMoved:!1}),z=t.length>1,q=z?wp:1,ae=c.useMemo(()=>Array.from({length:q},()=>t).flat(),[t,q]),[pe,$e]=c.useState(!1),[Pe,Ie]=c.useState(!1),[Me,Re]=c.useState(!0),[j,le]=c.useState(0),F=c.useRef(j);F.current=j;const U=c.useRef(null),K=c.useRef(!1),J=c.useRef(null),oe=c.useRef(null),ge=c.useCallback(()=>{A&&(Re(!0),oe.current&&clearTimeout(oe.current),oe.current=setTimeout(()=>{ue.current.isActive||Re(!1)},gp))},[A]),Fe=c.useCallback(()=>{p||K.current||(K.current=!0,Ie(!1),J.current=setTimeout(()=>{N()},Dn))},[p,N]),we=c.useCallback(X=>!!(X.closest("[data-controls]")||X.closest(`.${e}-thumbnails`)||X.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:xe,backdropStyle:ze,mediaAreaStyle:de,chromeStyle:Ee,swipeHandlers:We,dismissAreaStyle:Oe}=Ya({enabled:_,onClose:Fe,animMs:Dn,isBlockedTarget:we}),Ge=()=>{if(!z||t.length===0)return ie.current=0,0;const X=he.current[0],re=he.current[t.length];if(!X||!re)return ie.current;const me=re.offsetLeft-X.offsetLeft;return me>0&&(ie.current=me),ie.current},lt=(X=!1)=>{if(!z)return;const re=ee.current,me=Ge();!re||me<=0||(re.scrollLeft<=0?(re.scrollLeft+=me,X&&(ue.current.scrollLeft+=me)):re.scrollLeft>=me*2&&(re.scrollLeft-=me,X&&(ue.current.scrollLeft-=me)))},ht=(X=(re=>(re=ee.current)==null?void 0:re.scrollLeft)()??0)=>{let me=0,Ae=1/0;return he.current.forEach((Ve,be)=>{if(!Ve)return;const qe=Math.abs(Ve.offsetLeft-X);qe<Ae&&(Ae=qe,me=be)}),me},dt=()=>{!ee.current||t.length===0||U.current===null&&le(ht()%t.length)},St=()=>{U.current=null,dt()},_t=(X="smooth")=>{const re=ee.current;if(!re||t.length===0)return;const me=ht(),Ae=he.current[me];Ae&&(re.scrollTo({left:Ae.offsetLeft,behavior:X}),le(me%t.length))},ft=X=>{const re=ee.current;re&&(re.style.scrollSnapType=X?"":"none")},yt=(X,re="smooth")=>{const me=ee.current;if(!me||t.length===0)return;const Ae=me.scrollLeft-X,Ve=ht(me.scrollLeft),be=he.current[Ve],qe=he.current[Ve+1],Ue=be?qe?qe.offsetLeft-be.offsetLeft:be.offsetWidth:0;let He=Ve;Ue>0&&(Ae>Ue*Xr?He+=1:Ae<-Ue*Xr&&(He-=1)),z||(He=Math.max(0,Math.min(ae.length-1,He)));const ct=he.current[He];if(!ct){_t(re);return}me.scrollTo({left:ct.offsetLeft,behavior:re}),le(He%t.length)},Se=(X,re="smooth")=>{const me=ee.current,Ae=z?t.length+X:X,Ve=he.current[Ae];!me||!Ve||(re==="smooth"?U.current=X:U.current=null,le(X),me.scrollTo({left:Ve.offsetLeft,behavior:re}))},rt=X=>{if(!V||X.pointerType!=="mouse"||X.button!==0||we(X.target))return;const re=ee.current;re&&(ue.current={isActive:!0,startX:X.clientX,scrollLeft:re.scrollLeft,hasMoved:!1},ft(!1),ge(),re.setPointerCapture(X.pointerId))},it=X=>{if(!V||X.pointerType!=="mouse")return;const re=ee.current;if(!re||!ue.current.isActive)return;const me=X.clientX-ue.current.startX;Math.abs(me)>$p&&(ue.current.hasMoved=!0,$e(!0)),ue.current.hasMoved&&(X.preventDefault(),re.scrollLeft=ue.current.scrollLeft-me,lt(!0),dt(),ge())},ut=X=>{if(!V||X.pointerType!=="mouse")return;const re=ee.current;if(!re)return;const me=ue.current.hasMoved,Ae=ue.current.scrollLeft;ue.current.isActive=!1,$e(!1),re.hasPointerCapture(X.pointerId)&&re.releasePointerCapture(X.pointerId),lt(),ft(!0),me?yt(Ae):dt(),ge()};return Ja(),c.useEffect(()=>{const X=requestAnimationFrame(()=>Ie(!0));return()=>{cancelAnimationFrame(X),J.current&&clearTimeout(J.current),oe.current&&clearTimeout(oe.current)}},[]),c.useEffect(()=>{if(!A){Re(!0);return}ge();const X=ye.current;if(!X)return;const re=()=>ge();return X.addEventListener("pointermove",re),X.addEventListener("pointerdown",re),()=>{X.removeEventListener("pointermove",re),X.removeEventListener("pointerdown",re),oe.current&&clearTimeout(oe.current)}},[A,ge]),c.useEffect(()=>{const X=re=>{re.key==="Escape"&&Fe()};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[Fe]),c.useLayoutEffect(()=>{Ge(),Se(F.current,"auto")},[d]),c.useLayoutEffect(()=>{Ge(),Se(0,"auto")},[t.length,z]),c.useEffect(()=>{if(!p)return;const X=ee.current;if(!X)return;const re=me=>{me.preventDefault()};return X.addEventListener("wheel",re,{passive:!1}),X.addEventListener("touchmove",re,{passive:!1}),()=>{X.removeEventListener("wheel",re),X.removeEventListener("touchmove",re)}},[p]),c.useEffect(()=>{const X=ee.current;if(!X)return;let re=null;const me=()=>{lt(),dt(),U.current!==null&&(re&&clearTimeout(re),re=setTimeout(()=>{U.current!==null&&St()},150))},Ae=()=>{U.current!==null&&(re&&(clearTimeout(re),re=null),St())};X.addEventListener("scroll",me,{passive:!0}),X.addEventListener("scrollend",Ae);const Ve=new ResizeObserver(()=>{Ge(),lt(),dt()});return Ve.observe(X),()=>{re&&clearTimeout(re),X.removeEventListener("scroll",me),X.removeEventListener("scrollend",Ae),Ve.disconnect()}},[t.length,z]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${a?` ${e}-lightbox-editor`:""}${p?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{xe||Fe()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Pe?1:0,transition:`opacity ${Dn}ms ease`,pointerEvents:Pe?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:i,...ze}}),r.jsxs("div",{ref:ye,className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%",...Oe},...We,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:de,onClick:X=>X.stopPropagation(),children:r.jsx("div",{ref:ee,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"",style:{gap:d},"data-mouse-draggable":V&&t.length>0?"true":"false","data-mouse-dragging":pe?"true":"false",onPointerDown:rt,onPointerMove:it,onPointerUp:ut,onPointerCancel:ut,children:ae.map((X,re)=>{const me=X.image.objectFit??"contain",Ae=re%t.length,Ve=Math.floor(re/t.length),be=bi(d),qe=`calc(-0.5 * (${be} + ${d}))`;return r.jsxs("div",{ref:Ue=>he.current[re]=Ue,className:`${e}-strip-item`,style:{height:"100%"},children:[r.jsx("img",{src:X.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:me}}),v&&Ae<t.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:qe,width:be,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ve}-${X.image.url}-${Ae}`)})})}),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"}:{},...Ee},children:[r.jsx("div",{"data-controls":v?"contentMarginTop":void 0,"data-controls-static-handle":v?"":void 0,className:v?`${e}-control`:void 0,style:{height:W,width:"100%",pointerEvents:v?"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":v?"contentMarginLeft":void 0,"data-controls-axis":v?"x":void 0,className:v?`${e}-control`:void 0,style:{width:Y,flexShrink:0}}),r.jsxs("div",{className:`${e}-lightbox-content-area`,children:[f&&r.jsx("div",{className:`${e}-titles-row`,children:ne(!0)}),L&&r.jsx("div",{className:`${e}-close-icon`,"data-chrome-hidden":A&&!Me?"true":"false",style:{width:E.scalingValue(C??0,a),height:E.scalingValue(C??0,a),"--close-icon-hover-color":g},children:r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Fe,"aria-label":"Close",children:r.jsx(Nt,{url:L,fill:y,hoverFill:g,className:`${e}-close-icon-img`})})})]}),r.jsx("div",{"data-controls":v?"contentMarginRight":void 0,"data-controls-axis":v?"x":void 0,"data-controls-reverse":v?"":void 0,className:v?`${e}-control`:void 0,style:{width:k,flexShrink:0,pointerEvents:v?"auto":"none"}})]}),n==="B"&&r.jsx("div",{"data-controls":v?"contentMarginBottom":void 0,"data-controls-static-handle":v?"":void 0,className:v?`${e}-control`:void 0,style:{height:G,width:"100%",pointerEvents:v?"auto":"none"}})]}),t.length>1&&T==="on"&&(()=>{const X=bi(l),re=`calc(-0.5 * (${l} + ${X}))`;return r.jsxs("div",{className:`${e}-thumbnails`,"data-lightbox-scrollable":"","data-thumbnail-active":x,"data-chrome-hidden":A&&!Me?"true":"false",onClick:me=>me.stopPropagation(),style:{gap:s,bottom:l,"--thumbnail-active-color":S,...Ee},children:[t.map((me,Ae)=>{const Ve=bi(s),be=`calc(-0.5 * (${Ve} + ${s}))`;return r.jsxs("div",{style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":j===Ae?"true":"false",onClick:()=>_&&h==="click"&&Se(Ae),onMouseEnter:()=>D&&h==="hover"&&Se(Ae),"aria-label":me.image.name?`View ${me.image.name}`:`View image ${Ae+1}`,"aria-current":j===Ae?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${Q?` ${e}-thumb-image-cover`:""}`,src:me.image.url,alt:"",draggable:!1,style:{...M,...$.display==="Cover"?{width:Ri}:{width:"100%"}}})}),v&&Ae<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:be,width:Ve,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${me.image.url}-${Ae}`)}),v&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":v?"":void 0,style:{position:"absolute",left:0,right:0,bottom:re,height:X,pointerEvents:"auto",zIndex:3}})]})})()]})]})},Ep=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s})=>{const{prefix:l}=E.useScopedStyles(),{cover:d,coverFit:a,type:p,backgroundColor:u,contentBackgroundColor:L,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailTrigger:g,thumbnailActive:h,thumbnailActiveColor:T,thumbnailGap:$,thumbnailMarginBottom:x,imageGap:S,textMaxWidth:H,title1Gap:R,title2Gap:B,closeIcon:w,closeIconMaxWidth:I,closeIconColor:O,closeIconHoverColor:m,contentMarginTop:b,contentMarginBottom:P,contentMarginLeft:W,contentMarginRight:G}=e,Y=c.useRef(null),[k,N]=c.useState(!1),v=t??[],{title1:A,title2:_,title3:V}=yp(v),D=ye=>E.scalingValue(ye,n??!1),Q=go("title1",mo(e,"title1"),n),M=go("title2",mo(e,"title2"),n),te=go("title3",mo(e,"title3"),n),f=()=>{i||v.length===0||n&&!o||N(!0)},ne=()=>{N(!1)};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:Y,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:hp(l)}}),d?r.jsx("button",{type:"button",className:`${l}-cover ${qt(a)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:f,style:{display:"block",padding:0,border:"none",background:"transparent",...qt(a)?{"--image-aspect-ratio":Yi(a)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${l}-cover-image ${qt(a)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})}):null]}),k&&typeof document<"u"&&(()=>{const ye=(s?document.getElementById(s):null)??document.body;return ei.createPortal(r.jsx(Lp,{prefix:l,type:p,images:v,backgroundColor:u,contentBackgroundColor:L,thumbnailGap:D($),thumbnailMarginBottom:D(x??.02),imageGap:D(S??0),thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailTrigger:g,thumbnailActive:h,thumbnailActiveColor:T,textMaxWidth:D(H),title1Gap:D(R??0),title2Gap:D(B??0),title1:A,title2:_,title3:V,title1Style:Q,title2Style:M,title3Style:te,contentMarginTop:D(b??0),contentMarginBottom:D(P??0),contentMarginLeft:D(W??0),contentMarginRight:D(G??0),closeIcon:w,closeIconMaxWidth:I,closeIconColor:O,closeIconHoverColor:m,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:ne}),ye)})()]})},Ip=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
8786
8787
|
import { createPortal } from 'react-dom';
|
|
8787
8788
|
import { CommonComponentProps } from '../props';
|
|
8788
8789
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -8791,6 +8792,7 @@ import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
|
8791
8792
|
import { textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
8792
8793
|
import { getAspectRatio, isImageRatioCover } from '../utils/imageFitStyles';
|
|
8793
8794
|
import { useLightboxSwipeDismiss } from '../utils/useLightboxSwipeDismiss';
|
|
8795
|
+
import { useLightboxScrollLock } from '../utils/useLightboxScrollLock';
|
|
8794
8796
|
import { LayoutItem, LayoutTab } from '../../types/SchemaV1';
|
|
8795
8797
|
|
|
8796
8798
|
const LIGHTBOX_ANIM_MS = 300;
|
|
@@ -8851,6 +8853,7 @@ function getCSS(P: string): string {
|
|
|
8851
8853
|
flex-direction: column;
|
|
8852
8854
|
align-items: center;
|
|
8853
8855
|
justify-content: center;
|
|
8856
|
+
overscroll-behavior: none;
|
|
8854
8857
|
}
|
|
8855
8858
|
|
|
8856
8859
|
.\${P}-lightbox-editor {
|
|
@@ -9611,6 +9614,7 @@ const LightboxOverlay = ({
|
|
|
9611
9614
|
mediaAreaStyle,
|
|
9612
9615
|
chromeStyle: swipeChromeStyle,
|
|
9613
9616
|
swipeHandlers,
|
|
9617
|
+
dismissAreaStyle,
|
|
9614
9618
|
} = useLightboxSwipeDismiss({
|
|
9615
9619
|
enabled: allowImageScroll,
|
|
9616
9620
|
onClose: handleClose,
|
|
@@ -9809,13 +9813,12 @@ const LightboxOverlay = ({
|
|
|
9809
9813
|
resetChromeIdleTimer();
|
|
9810
9814
|
};
|
|
9811
9815
|
|
|
9816
|
+
useLightboxScrollLock();
|
|
9817
|
+
|
|
9812
9818
|
useEffect(() => {
|
|
9813
9819
|
const frame = requestAnimationFrame(() => setIsVisible(true));
|
|
9814
|
-
const originalOverflow = document.body.style.overflow;
|
|
9815
|
-
document.body.style.overflow = 'hidden';
|
|
9816
9820
|
return () => {
|
|
9817
9821
|
cancelAnimationFrame(frame);
|
|
9818
|
-
document.body.style.overflow = originalOverflow;
|
|
9819
9822
|
if (closeTimeoutRef.current) {
|
|
9820
9823
|
clearTimeout(closeTimeoutRef.current);
|
|
9821
9824
|
}
|
|
@@ -9946,6 +9949,7 @@ const LightboxOverlay = ({
|
|
|
9946
9949
|
position: 'relative',
|
|
9947
9950
|
width: '100%',
|
|
9948
9951
|
height: '100%',
|
|
9952
|
+
...dismissAreaStyle,
|
|
9949
9953
|
}}
|
|
9950
9954
|
{...swipeHandlers}
|
|
9951
9955
|
>
|
|
@@ -9957,6 +9961,7 @@ const LightboxOverlay = ({
|
|
|
9957
9961
|
<div
|
|
9958
9962
|
ref={stripRef}
|
|
9959
9963
|
className={\`\${P}-lightbox-strip\`}
|
|
9964
|
+
data-lightbox-scrollable=""
|
|
9960
9965
|
style={{ gap: imageGap }}
|
|
9961
9966
|
data-mouse-draggable={allowMouseDrag && images.length > 0 ? 'true' : 'false'}
|
|
9962
9967
|
data-mouse-dragging={isMouseDragging ? 'true' : 'false'}
|
|
@@ -10089,8 +10094,10 @@ const LightboxOverlay = ({
|
|
|
10089
10094
|
return (
|
|
10090
10095
|
<div
|
|
10091
10096
|
className={\`\${P}-thumbnails\`}
|
|
10097
|
+
data-lightbox-scrollable=""
|
|
10092
10098
|
data-thumbnail-active={thumbnailActive}
|
|
10093
10099
|
data-chrome-hidden={hideChromeOnIdle && !chromeVisible ? 'true' : 'false'}
|
|
10100
|
+
onClick={(event) => event.stopPropagation()}
|
|
10094
10101
|
style={{
|
|
10095
10102
|
gap: thumbnailGap,
|
|
10096
10103
|
bottom: thumbnailMarginBottom,
|
|
@@ -10296,7 +10303,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10296
10303
|
</>
|
|
10297
10304
|
);
|
|
10298
10305
|
};
|
|
10299
|
-
`,Ep="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="#000000" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>'),pn={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 Ip(e){const t={};return t[Ye(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSettings")]={...pn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSize")]={...pn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ye(e,"lineHeight")]={...pn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ye(e,"letterSpacing")]={...pn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ye(e,"wordSpacing")]={...pn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ye(e,"textAlign")]={...pn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ye(e,"textAppearance")]={...pn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Rp=ci.reduce((e,t)=>({...e,...Ip(t)}),{}),Pp=ci.reduce((e,t)=>({...e,[Ye(t,"fontFamily")]:"Arial",[Ye(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ye(t,"letterSpacing")]:0,[Ye(t,"wordSpacing")]:0,[Ye(t,"textAlign")]:"left",[Ye(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Yr(e){return ci.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ye(n,"fontSize")]=i),o!==void 0&&(t[Ye(n,"lineHeight")]=o),t},{})}const _p=vp(),Ap={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 Default",display:{type:"settings-color-picker"}},contentBackgroundColor:{type:"string",scope:"layout",title:"Header BG Default",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:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",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:"Outline Active",display:{type:"palette-color-picker",visible:!1}},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 Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},...Rp,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,max:200,display:{type:"range-control"}},contentMarginBottom:{type:"number",scope:"layout",title:"Content margin bottom",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:Ep,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",...Pp},layoutDefaults:{m:{thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,textMaxWidth:.4,closeIconMaxWidth:.04,backgroundColor:"rgba(28, 31, 34, 0.9)",contentBackgroundColor:"rgb(10, 10, 10)",contentMarginTop:.04,contentMarginBottom:.04,contentMarginLeft:.02,contentMarginRight:.02,title1Gap:.04,title2Gap:.04,...Yr({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},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,contentMarginBottom:.02,contentMarginLeft:.02,contentMarginRight:.02,title1Gap:.1,title2Gap:.1,...Yr({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}},{if:{name:"type",value:"A"},then:{name:"properties.contentMarginBottom.display.visible",value:!1}},{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Gap","title2Gap","contentMarginTop","contentMarginBottom","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:[_p]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","contentBackgroundColor","backgroundColor","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",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/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"}}]}},Mp={element:Tp,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:Ap,sourceCode:Lp,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:ci.map(e=>({path:`styles.${Ye(e,"fontSettings")}`}))}},ho=300,Lo=400,Jr=300,kp=50,Zr=10,tr="cntrl-lightbox-journal",Ji=tr,Eo=`${tr}-`,Zi=e=>`${tr}-${e}`,nr=e=>e===Ji||e.startsWith(Eo),Qr=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},ea=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Qr(t.get(Zi(e)));if(i)return i}const n=Qr(t.get(Ji));if(n)return n;for(const[i]of t){if(!i.startsWith(Eo))continue;const o=i.slice(Eo.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},ta=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Ja=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{nr(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Zi(t),String(e)):i.searchParams.set(Ji,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},Fp=e=>{if(typeof window>"u")return;const t=new URL(window.location.href);let n=!1;if([...t.searchParams.keys()].forEach(i=>{(e?i===Zi(e)||i===Ji:nr(i))&&(t.searchParams.delete(i),n=!0)}),n){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},Za=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Zi(e)):[...t.keys()].some(n=>nr(n))},Wp=(e,t)=>{if(Za(t)){if(e){window.history.back();return}Fp(t)}};function Np(e){return`
|
|
10306
|
+
`,Rp="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="#000000" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>'),un={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 Pp(e){const t={};return t[Xe(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Xe(e,"fontSettings")]={...un.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Xe(e,"fontSize")]={...un.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Xe(e,"lineHeight")]={...un.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Xe(e,"letterSpacing")]={...un.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Xe(e,"wordSpacing")]={...un.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Xe(e,"textAlign")]={...un.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Xe(e,"textAppearance")]={...un.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ap=ci.reduce((e,t)=>({...e,...Pp(t)}),{}),_p=ci.reduce((e,t)=>({...e,[Xe(t,"fontFamily")]:"Arial",[Xe(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Xe(t,"letterSpacing")]:0,[Xe(t,"wordSpacing")]:0,[Xe(t,"textAlign")]:"left",[Xe(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Yr(e){return ci.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Xe(n,"fontSize")]=i),o!==void 0&&(t[Xe(n,"lineHeight")]=o),t},{})}const Mp=xp(),kp={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 Default",display:{type:"settings-color-picker"}},contentBackgroundColor:{type:"string",scope:"layout",title:"Header BG Default",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:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",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:"Outline Active",display:{type:"palette-color-picker",visible:!1}},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 Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},...Ap,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,max:200,display:{type:"range-control"}},contentMarginBottom:{type:"number",scope:"layout",title:"Content margin bottom",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:Rp,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",..._p},layoutDefaults:{m:{thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,textMaxWidth:.4,closeIconMaxWidth:.04,backgroundColor:"rgba(28, 31, 34, 0.9)",contentBackgroundColor:"rgb(10, 10, 10)",contentMarginTop:.04,contentMarginBottom:.04,contentMarginLeft:.02,contentMarginRight:.02,title1Gap:.04,title2Gap:.04,...Yr({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},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,contentMarginBottom:.02,contentMarginLeft:.02,contentMarginRight:.02,title1Gap:.1,title2Gap:.1,...Yr({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}},{if:{name:"type",value:"A"},then:{name:"properties.contentMarginBottom.display.visible",value:!1}},{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Gap","title2Gap","contentMarginTop","contentMarginBottom","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:[Mp]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","contentBackgroundColor","backgroundColor","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",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/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"}}]}},Fp={element:Ep,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:kp,sourceCode:Ip,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:ci.map(e=>({path:`styles.${Xe(e,"fontSettings")}`}))}},ho=300,Lo=400,Jr=300,Wp=50,Zr=10,tr="cntrl-lightbox-journal",Ji=tr,Eo=`${tr}-`,Zi=e=>`${tr}-${e}`,nr=e=>e===Ji||e.startsWith(Eo),Qr=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},ea=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Qr(t.get(Zi(e)));if(i)return i}const n=Qr(t.get(Ji));if(n)return n;for(const[i]of t){if(!i.startsWith(Eo))continue;const o=i.slice(Eo.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},ta=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Za=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{nr(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Zi(t),String(e)):i.searchParams.set(Ji,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},Np=e=>{if(typeof window>"u")return;const t=new URL(window.location.href);let n=!1;if([...t.searchParams.keys()].forEach(i=>{(e?i===Zi(e)||i===Ji:nr(i))&&(t.searchParams.delete(i),n=!0)}),n){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},Qa=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Zi(e)):[...t.keys()].some(n=>nr(n))},Hp=(e,t)=>{if(Qa(t)){if(e){window.history.back();return}Np(t)}};function Bp(e){return`
|
|
10300
10307
|
.${e}-wrapper {
|
|
10301
10308
|
position: relative;
|
|
10302
10309
|
width: 100%;
|
|
@@ -10349,6 +10356,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10349
10356
|
flex-direction: column;
|
|
10350
10357
|
align-items: center;
|
|
10351
10358
|
justify-content: center;
|
|
10359
|
+
overscroll-behavior: none;
|
|
10352
10360
|
}
|
|
10353
10361
|
|
|
10354
10362
|
.${e}-lightbox-editor {
|
|
@@ -10690,7 +10698,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10690
10698
|
pointer-events: auto;
|
|
10691
10699
|
z-index: 10;
|
|
10692
10700
|
}
|
|
10693
|
-
`}const Hp=20,Bp=2,na=e=>`max(${e}, ${Hp}px)`,kn=e=>((e==null?void 0:e.image)??[]).slice(0,Bp),Qa=e=>e.reduce((t,n)=>t+kn(n).length,0),Op=(e,t)=>{let n=1;for(let o=0;o<t;o++)n+=kn(e[o]).length;const i=kn(e[t]).length;return{start:n,end:n+i-1}},jp=(e,t)=>{const n=Qa(e),{start:i,end:o}=Op(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Pi=(e,t)=>t==="B"?e.flatMap((n,i)=>kn(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:kn(n)})),Dp=(e,t,n,i)=>{var s;if(n==="B")return`${t+1} / ${e.length}`;const o=((s=e[t])==null?void 0:s.entryIndex)??0;return jp(i,o)},ia=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",zp=(e,t,n)=>e==="B"?t.length>1:Qa(n)>1,Vp=({prefix:e,entries:t,journalType:n,coverFit:i,backgroundColor:o,imageGap:s,slideMaxWidth:l,slideMaxHeight:d,isEditor:a,isEditMode:p,isPreviewMode:u,closeIcon:L,closeIconMaxWidth:C,closeIconColor:y,closeIconHoverColor:g,textMaxWidth:h,titlesGap:T,countCloseGap:$,textTransition:x,title1Style:S,title2Style:H,title3Style:R,countStyle:B,contentMarginTop:w,contentMarginLeft:I,contentMarginRight:O,initialSlideIndex:m=0,enableUrlSync:b=!1,journalItemId:P=null,onBeforeClose:W,onClose:G})=>{const Y=!!p,k=!a||!!u,N=!p&&(!a||!!u),v=c.useMemo(()=>Pi(t,n),[t,n]),[_,A]=c.useState(m),V=v[_],D=V==null?void 0:V.entry,[Z,M]=c.useState(!1),[te,f]=c.useState(null),[ne,fe]=c.useState(!1),[ee,he]=c.useState(null),[oe,ue]=c.useState(!1),[z,X]=c.useState(0),[ae,pe]=c.useState(),[Se,Re]=c.useState(),[Le,Me]=c.useState(null),Ee=c.useRef(null),j=c.useRef(0),se=c.useRef(0),F=c.useRef(0),U=c.useRef(!1),q=c.useRef(null),J=c.useRef(null),re=c.useRef(null),me=c.useRef(null),ke=c.useRef(null),Ce=c.useRef(null),xe=c.useRef(null),ze=c.useCallback(()=>{const de=J.current;if(!de)return;const be=de.closest(`.${e}-lightbox-content-area`);if(!be)return de.getBoundingClientRect().width;let Ue=0;return Array.from(be.children).forEach(He=>{He instanceof HTMLElement&&(He.contains(de)||(Ue+=He.getBoundingClientRect().width))}),be.getBoundingClientRect().width-Ue},[e]),ce=c.useCallback(()=>{Ee.current&&(clearTimeout(Ee.current),Ee.current=null)},[]),Te=c.useCallback(de=>{de===j.current&&(he(null),ue(!1))},[]),Fe=c.useCallback(()=>{p||U.current||(U.current=!0,W==null||W(),M(!1),q.current=setTimeout(()=>{G()},ho))},[p,W,G]),We=c.useCallback(de=>!!(de.closest("[data-controls]")||de.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ge,backdropStyle:dt,mediaAreaStyle:ut,chromeStyle:bt,swipeHandlers:Tt}=Ya({enabled:N,onClose:Fe,animMs:ho,isBlockedTarget:We}),Lt=c.useCallback(de=>{b&&Ja(de+1,P,!0)},[b,P]),ct=c.useCallback(de=>{var ve,we;if(v.length===0)return;const be=(de%v.length+v.length)%v.length;if(be===_)return;const Ue=v[_],He=v[be];j.current+=1;const Xe=j.current,yt=x==="fade"&&ia(Ue==null?void 0:Ue.entry)!==ia(He==null?void 0:He.entry),Pe=(ve=J.current)==null?void 0:ve.getBoundingClientRect().height;let it,ot;yt&&(ot=ze(),ei.flushSync(()=>{Me(He.entry)}),re.current&&ot&&(re.current.style.width=`${ot}px`),it=(we=re.current)==null?void 0:we.getBoundingClientRect().height,re.current&&(re.current.style.width=""));const Q=Math.max(Pe??0,it??0)||void 0;X(Xe),he(_),ue(!0),A(be),Lt(be),F.current=be,yt?(ce(),Q&&pe(Q),ot&&Re(ot),f((Ue==null?void 0:Ue.entryIndex)??null),fe(!0),se.current=He.entryIndex,Ee.current=setTimeout(()=>{f(null),fe(!1),pe(void 0),Re(void 0),Me(null),Ee.current=null},Lo)):(ce(),f(null),fe(!1),pe(void 0),Re(void 0),Me(null),se.current=He.entryIndex)},[_,ce,ze,v,Lt,x]),pt=c.useCallback(()=>{xe.current=null},[]),_e=c.useCallback(de=>{!k||v.length<=1||de.pointerType==="mouse"&&de.button!==0||de.target.closest("[data-controls]")||(xe.current={startX:de.clientX,startY:de.clientY,pointerId:de.pointerId})},[k,v.length]),at=c.useCallback(de=>{var Q;if(!k||v.length<=1||de.pointerType==="mouse"&&de.button!==0)return;if(Ge){pt();return}const be=xe.current;if(!be||be.pointerId!==de.pointerId||(pt(),de.target.closest("[data-controls]")))return;const He=de.clientX-be.startX,Xe=de.clientY-be.startY,yt=Math.abs(He),Pe=Math.abs(Xe);if(yt>=kp&&yt>Pe){ct(He>0?_-1:_+1);return}if(yt>Zr||Pe>Zr)return;const it=(Q=me.current)==null?void 0:Q.getBoundingClientRect(),ot=it?it.left+it.width/2:window.innerWidth/2;ct(de.clientX<ot?_-1:_+1)},[_,k,ct,Ge,pt,v.length]),tt=c.useCallback(de=>{const be=xe.current;(be==null?void 0:be.pointerId)===de.pointerId&&pt()},[pt]);c.useEffect(()=>{Ce.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const de=requestAnimationFrame(()=>{M(!0),requestAnimationFrame(()=>{ke.current?ke.current.focus():me.current&&me.current.focus()})}),be=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{cancelAnimationFrame(de),document.body.style.overflow=be,q.current&&clearTimeout(q.current),Ee.current&&clearTimeout(Ee.current);const Ue=Ce.current;Ue&&document.contains(Ue)&&Ue.focus()}},[]),c.useEffect(()=>{var de;x!=="fade"&&(se.current=((de=v[_])==null?void 0:de.entryIndex)??0,ce(),f(null),fe(!1),pe(void 0),Re(void 0))},[_,ce,v,x]),c.useEffect(()=>{const de=be=>{if(be.key==="Escape"){Fe();return}if(be.key==="ArrowLeft"&&v.length>1){ct(_-1);return}if(be.key==="ArrowRight"&&v.length>1){ct(_+1);return}if(be.key==="Tab"&&me.current){const Ue=me.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),He=Array.from(Ue).filter(it=>!it.closest('[aria-hidden="true"]'));if(He.length===0)return;const Xe=He[0],yt=He[He.length-1],Pe=document.activeElement;be.shiftKey?(Pe===Xe||!me.current.contains(Pe))&&(be.preventDefault(),yt.focus()):(Pe===yt||!me.current.contains(Pe))&&(be.preventDefault(),Xe.focus())}};return window.addEventListener("keydown",de),()=>window.removeEventListener("keydown",de)},[ct,Fe,_,v.length]),c.useLayoutEffect(()=>{ce(),j.current=0,X(0),he(null),ue(!1),f(null),fe(!1),pe(void 0),Re(void 0),Me(null),A(de=>{const be=Math.max(0,v.length-1);return Math.min(de,be)})},[ce,t.length,n,v.length]),c.useLayoutEffect(()=>{var de;F.current=m,se.current=((de=v[m])==null?void 0:de.entryIndex)??0,A(m)},[m,v.length]);const K=te!==null?t[te]:null,ie=ee!==null?v[ee]:null,ge=!!(D!=null&&D.title1||D!=null&&D.title2||D!=null&&D.title3||K!=null&&K.title1||K!=null&&K.title2||K!=null&&K.title3),Ie=zp(n,v,t),Ve=!!L,nt={gap:T},$e=Ie&&Ve?{gap:$}:void 0,Qe=(de,be,Ue=!1)=>{const He=na(be),Xe=`calc(-0.5 * (${He} + ${be}))`;return r.jsx("div",{"data-controls":de,"data-controls-axis":"x",...Ue?{"data-controls-reverse":"true"}:void 0,style:{position:"absolute",top:0,right:Xe,width:He,height:"100%",pointerEvents:"auto",zIndex:3}})},je=(de,be=!1)=>{if(!de)return null;const Ue=[de.title1?{className:`${e}-title1`,style:S,text:de.title1}:null,de.title2?{className:`${e}-title2`,style:H,text:de.title2}:null,de.title3?{className:`${e}-title3`,style:R,text:de.title3}:null].filter(He=>He!==null);return Ue.map((He,Xe)=>r.jsxs("div",{className:`${e}-title-cell`,children:[r.jsx("p",{className:He.className,style:{...He.style,maxWidth:h},children:He.text}),be&&Y&&Xe<Ue.length-1?Qe("titlesGap",T):null]},He.className))},Ke=de=>{const be=!de.objectFit&&Xt(i);return{className:`${e}-slide-image-cell${be?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:l,maxHeight:d,...be?{"--image-aspect-ratio":Yi(i)}:{}}}},ft=de=>de.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":de.objectFit}}:Xt(i)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ln=de=>{if(de.length===0)return null;const be=de.length>1,Ue=na(s),He=`calc(-0.5 * (${Ue} + ${s}))`;if(de.length===1){const Xe=de[0];return r.jsx("div",{...Ke(Xe),children:r.jsx("img",{...ft(Xe),src:Xe.url,alt:Xe.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:be?{gap:s}:void 0,children:de.map((Xe,yt)=>r.jsxs("div",{...Ke(Xe),children:[r.jsx("img",{...ft(Xe),src:Xe.url,alt:Xe.name??"",draggable:!1}),Y&&be&&yt<de.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:He,width:Ue,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Xe.url}-${yt}`))})};return r.jsxs("div",{ref:me,"data-selection":"none",className:`${e}-lightbox${a?` ${e}-lightbox-editor`:""}${p?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ge||Fe()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:Ve?void 0:-1,style:{opacity:Z?1:0,transition:`opacity ${ho}ms ease`,pointerEvents:Z?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:o,...dt}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%"},...Tt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:ut,onClick:de=>de.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":k&&v.length>1?"true":"false",onPointerDown:k?_e:void 0,onPointerUp:k?at:void 0,onPointerCancel:k?tt:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[ie&&oe?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:de=>{de.target===de.currentTarget&&Te(z)},children:r.jsx("div",{className:`${e}-slide-area`,children:ln(ie.images)})},`slide-out-${z}`):null,r.jsx("div",{className:`${e}-slide-layer-in${oe?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:V?ln(V.images):null})},`slide-in-${z}-${_}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-chrome`,style:{width:"100%",height:"100%",...bt},children:[r.jsx("div",{"data-controls":Y?"contentMarginTop":void 0,className:Y?`${e}-control`:void 0,style:{height:w,width:"100%"}}),r.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%"},children:[r.jsx("div",{"data-controls":Y?"contentMarginLeft":void 0,"data-controls-axis":Y?"x":void 0,className:Y?`${e}-control`:void 0,style:{width:I,flexShrink:0}}),r.jsxs("div",{className:`${e}-lightbox-content-area`,children:[ge&&r.jsx("div",{className:`${e}-text-bar-cell`,children:r.jsx("div",{className:`${e}-titles-row`,style:nt,children:x==="fade"?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:re,className:`${e}-titles-stack`,style:{...nt,position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:je(Le||D,!1)}),r.jsxs("div",{ref:J,className:`${e}-titles-stack`,style:{...nt,...ne&&ae?{minHeight:ae}:void 0,...ne&&Se?{width:Se,maxWidth:"100%"}:void 0,...ne?{overflow:"hidden"}:void 0},children:[K&&ne?r.jsx("div",{className:`${e}-titles-layer-out ${e}-titles-fade-out`,style:nt,children:je(K)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ne?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,style:nt,children:je(D,!0)})]})]}):je(D,!0)})}),r.jsxs("div",{className:`${e}-lightbox-persistent-controls`,style:$e,children:[Ie&&r.jsxs("div",{className:`${e}-text-bar-cell`,children:[r.jsx("span",{className:`${e}-entry-counter`,style:B,"aria-live":"polite","aria-atomic":"true",children:Dp(v,_,n,t)}),Y&&Ve?Qe("countCloseGap",$,!0):null]}),Ve&&r.jsx("div",{className:`${e}-close-icon`,style:{width:E.scalingValue(C??0,a),height:E.scalingValue(C??0,a),"--close-icon-hover-color":g},children:r.jsx("button",{ref:ke,type:"button",className:`${e}-close-icon-inner`,onClick:Fe,"aria-label":"Close",children:r.jsx(Ht,{url:L??"",fill:y,hoverFill:g,className:`${e}-close-icon-img`})})})]})]}),r.jsx("div",{"data-controls":Y?"contentMarginRight":void 0,"data-controls-axis":Y?"x":void 0,"data-controls-reverse":Y?"":void 0,className:Y?`${e}-control`:void 0,style:{width:O,flexShrink:0}})]})]})]})]})},di=["title1","title2","title3","count"];function Je(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const Gp={title1:"1",title2:"2",title3:"3",count:"Count"};function Up(e){return[Je(e,"fontFamily"),Je(e,"fontSettings"),{type:"row",items:[Je(e,"fontSize"),Je(e,"lineHeight"),Je(e,"letterSpacing"),Je(e,"wordSpacing")]},Je(e,"textAlign"),Je(e,"textAppearance")]}function Kp(){return{type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(di.map(e=>[Gp[e],Up(e)]))}}const qp={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Xp={title1:.02,title2:.02,title3:.02,count:.017};function xi(e,t){const n=i=>{const o=Je(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[qp[t]]}}function Si(e,t,n){var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??Xp[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return vt(i,n)}const Yp=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s,metadata:l})=>{const{prefix:d}=E.useScopedStyles(),a=(l==null?void 0:l.itemId)??null,{cover:p,coverFit:u,type:L,backgroundColor:C,imageGap:y,maxWidth:g,maxHeight:h,textMaxWidth:T,textTransition:$,titlesGap:x,countCloseGap:S,closeIcon:H,closeIconMaxWidth:R,closeIconColor:B,closeIconHoverColor:w,contentMarginTop:I,contentMarginLeft:O,contentMarginRight:m}=e,b=ee=>E.scalingValue(ee,n??!1),P=Si("title1",xi(e,"title1"),n),W=Si("title2",xi(e,"title2"),n),G=Si("title3",xi(e,"title3"),n),Y=Si("count",xi(e,"count"),n),k=c.useRef(null),[N,v]=c.useState(!1),[_,A]=c.useState(0),V=c.useRef(!1),D=c.useRef(!1),Z=c.useRef(!1),M=c.useMemo(()=>(t??[]).filter(ee=>kn(ee).length>0),[t]),te=!n||!!o,f=c.useCallback(()=>{te&&(Z.current=!0,Wp(D.current,a),D.current=!1)},[te,a]),ne=(ee=0)=>{if(i||M.length===0||n&&!o)return;const he=Pi(M,L),oe=Math.max(0,Math.min(ee,he.length-1));if(A(oe),te){const ue=Za();Ja(oe+1,a,ue),D.current=!ue}v(!0)},fe=c.useCallback(()=>{v(!1),Z.current=!1},[]);return c.useEffect(()=>{if(!te||V.current)return;V.current=!0;const ee=ea(a);if(!ee)return;const he=ta(ee,Pi(M,L).length);he<0||(A(he),v(!0))},[M,a,te,L]),c.useEffect(()=>{if(!te)return;const ee=()=>{if(Z.current){Z.current=!1,v(!1);return}const he=ea(a);if(!he){v(!1);return}const oe=ta(he,Pi(M,L).length);if(oe<0){v(!1);return}D.current=!1,A(oe),v(!0)};return window.addEventListener("popstate",ee),()=>window.removeEventListener("popstate",ee)},[M,a,te,L]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:k,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Np(d)}}),p?r.jsx("button",{type:"button",className:`${d}-cover ${Xt(u)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>ne(),style:{display:"block",padding:0,border:"none",background:"transparent",...Xt(u)?{"--image-aspect-ratio":Yi(u)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Xt(u)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:p,alt:"cover"})}):null]}),N&&typeof document<"u"&&(()=>{const ee=(s?document.getElementById(s):null)??document.body;return ei.createPortal(r.jsx(Vp,{prefix:d,entries:M,journalType:L,coverFit:u,backgroundColor:C,imageGap:b(y??0),slideMaxWidth:`${g}%`,slideMaxHeight:`${h}%`,textMaxWidth:b(T??.4),titlesGap:b(x??0),countCloseGap:b(S??0),textTransition:$,title1Style:P,title2Style:W,title3Style:G,countStyle:Y,contentMarginTop:b(I??0),contentMarginLeft:b(O??0),contentMarginRight:b(m??0),closeIcon:H,closeIconMaxWidth:R,closeIconColor:B,closeIconHoverColor:w,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:_,enableUrlSync:te,journalItemId:a,onBeforeClose:f,onClose:fe}),ee)})()]})},Jp=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
10701
|
+
`}const Op=20,jp=2,na=e=>`max(${e}, ${Op}px)`,kn=e=>((e==null?void 0:e.image)??[]).slice(0,jp),es=e=>e.reduce((t,n)=>t+kn(n).length,0),Dp=(e,t)=>{let n=1;for(let o=0;o<t;o++)n+=kn(e[o]).length;const i=kn(e[t]).length;return{start:n,end:n+i-1}},zp=(e,t)=>{const n=es(e),{start:i,end:o}=Dp(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Pi=(e,t)=>t==="B"?e.flatMap((n,i)=>kn(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:kn(n)})),Vp=(e,t,n,i)=>{var s;if(n==="B")return`${t+1} / ${e.length}`;const o=((s=e[t])==null?void 0:s.entryIndex)??0;return zp(i,o)},ia=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Gp=(e,t,n)=>e==="B"?t.length>1:es(n)>1,Up=({prefix:e,entries:t,journalType:n,coverFit:i,backgroundColor:o,imageGap:s,slideMaxWidth:l,slideMaxHeight:d,isEditor:a,isEditMode:p,isPreviewMode:u,closeIcon:L,closeIconMaxWidth:C,closeIconColor:y,closeIconHoverColor:g,textMaxWidth:h,titlesGap:T,countCloseGap:$,textTransition:x,title1Style:S,title2Style:H,title3Style:R,countStyle:B,contentMarginTop:w,contentMarginLeft:I,contentMarginRight:O,initialSlideIndex:m=0,enableUrlSync:b=!1,journalItemId:P=null,onBeforeClose:W,onClose:G})=>{const Y=!!p,k=!a||!!u,N=!p&&(!a||!!u),v=c.useMemo(()=>Pi(t,n),[t,n]),[A,_]=c.useState(m),V=v[A],D=V==null?void 0:V.entry,[Q,M]=c.useState(!1),[te,f]=c.useState(null),[ne,ye]=c.useState(!1),[ee,he]=c.useState(null),[ie,ue]=c.useState(!1),[z,q]=c.useState(0),[ae,pe]=c.useState(),[$e,Pe]=c.useState(),[Ie,Me]=c.useState(null),Re=c.useRef(null),j=c.useRef(0),le=c.useRef(0),F=c.useRef(0),U=c.useRef(!1),K=c.useRef(null),J=c.useRef(null),oe=c.useRef(null),ge=c.useRef(null),Fe=c.useRef(null),we=c.useRef(null),xe=c.useRef(null),ze=c.useCallback(()=>{const se=J.current;if(!se)return;const Ce=se.closest(`.${e}-lightbox-content-area`);if(!Ce)return se.getBoundingClientRect().width;let Ze=0;return Array.from(Ce.children).forEach(Ne=>{Ne instanceof HTMLElement&&(Ne.contains(se)||(Ze+=Ne.getBoundingClientRect().width))}),Ce.getBoundingClientRect().width-Ze},[e]),de=c.useCallback(()=>{Re.current&&(clearTimeout(Re.current),Re.current=null)},[]),Ee=c.useCallback(se=>{se===j.current&&(he(null),ue(!1))},[]),We=c.useCallback(()=>{p||U.current||(U.current=!0,W==null||W(),M(!1),K.current=setTimeout(()=>{G()},ho))},[p,W,G]),Oe=c.useCallback(se=>!!(se.closest("[data-controls]")||se.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ge,backdropStyle:lt,mediaAreaStyle:ht,chromeStyle:dt,swipeHandlers:St,dismissAreaStyle:_t}=Ya({enabled:N,onClose:We,animMs:ho,isBlockedTarget:Oe}),ft=c.useCallback(se=>{b&&Za(se+1,P,!0)},[b,P]),yt=c.useCallback(se=>{var Te,ke;if(v.length===0)return;const Ce=(se%v.length+v.length)%v.length;if(Ce===A)return;const Ze=v[A],Ne=v[Ce];j.current+=1;const Qe=j.current,Le=x==="fade"&&ia(Ze==null?void 0:Ze.entry)!==ia(Ne==null?void 0:Ne.entry),et=(Te=J.current)==null?void 0:Te.getBoundingClientRect().height;let nt,Z;Le&&(Z=ze(),ei.flushSync(()=>{Me(Ne.entry)}),oe.current&&Z&&(oe.current.style.width=`${Z}px`),nt=(ke=oe.current)==null?void 0:ke.getBoundingClientRect().height,oe.current&&(oe.current.style.width=""));const fe=Math.max(et??0,nt??0)||void 0;q(Qe),he(A),ue(!0),_(Ce),ft(Ce),F.current=Ce,Le?(de(),fe&&pe(fe),Z&&Pe(Z),f((Ze==null?void 0:Ze.entryIndex)??null),ye(!0),le.current=Ne.entryIndex,Re.current=setTimeout(()=>{f(null),ye(!1),pe(void 0),Pe(void 0),Me(null),Re.current=null},Lo)):(de(),f(null),ye(!1),pe(void 0),Pe(void 0),Me(null),le.current=Ne.entryIndex)},[A,de,ze,v,ft,x]),Se=c.useCallback(()=>{xe.current=null},[]),rt=c.useCallback(se=>{!k||v.length<=1||se.pointerType==="mouse"&&se.button!==0||se.target.closest("[data-controls]")||(xe.current={startX:se.clientX,startY:se.clientY,pointerId:se.pointerId})},[k,v.length]),it=c.useCallback(se=>{var fe;if(!k||v.length<=1||se.pointerType==="mouse"&&se.button!==0)return;if(Ge){Se();return}const Ce=xe.current;if(!Ce||Ce.pointerId!==se.pointerId||(Se(),se.target.closest("[data-controls]")))return;const Ne=se.clientX-Ce.startX,Qe=se.clientY-Ce.startY,Le=Math.abs(Ne),et=Math.abs(Qe);if(Le>=Wp&&Le>et){yt(Ne>0?A-1:A+1);return}if(Le>Zr||et>Zr)return;const nt=(fe=ge.current)==null?void 0:fe.getBoundingClientRect(),Z=nt?nt.left+nt.width/2:window.innerWidth/2;yt(se.clientX<Z?A-1:A+1)},[A,k,yt,Ge,Se,v.length]),ut=c.useCallback(se=>{const Ce=xe.current;(Ce==null?void 0:Ce.pointerId)===se.pointerId&&Se()},[Se]);Ja(),c.useEffect(()=>{we.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const se=requestAnimationFrame(()=>{M(!0),requestAnimationFrame(()=>{Fe.current?Fe.current.focus():ge.current&&ge.current.focus()})});return()=>{cancelAnimationFrame(se),K.current&&clearTimeout(K.current),Re.current&&clearTimeout(Re.current);const Ce=we.current;Ce&&document.contains(Ce)&&Ce.focus()}},[]),c.useEffect(()=>{var se;x!=="fade"&&(le.current=((se=v[A])==null?void 0:se.entryIndex)??0,de(),f(null),ye(!1),pe(void 0),Pe(void 0))},[A,de,v,x]),c.useEffect(()=>{const se=Ce=>{if(Ce.key==="Escape"){We();return}if(Ce.key==="ArrowLeft"&&v.length>1){yt(A-1);return}if(Ce.key==="ArrowRight"&&v.length>1){yt(A+1);return}if(Ce.key==="Tab"&&ge.current){const Ze=ge.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),Ne=Array.from(Ze).filter(nt=>!nt.closest('[aria-hidden="true"]'));if(Ne.length===0)return;const Qe=Ne[0],Le=Ne[Ne.length-1],et=document.activeElement;Ce.shiftKey?(et===Qe||!ge.current.contains(et))&&(Ce.preventDefault(),Le.focus()):(et===Le||!ge.current.contains(et))&&(Ce.preventDefault(),Qe.focus())}};return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[yt,We,A,v.length]),c.useLayoutEffect(()=>{de(),j.current=0,q(0),he(null),ue(!1),f(null),ye(!1),pe(void 0),Pe(void 0),Me(null),_(se=>{const Ce=Math.max(0,v.length-1);return Math.min(se,Ce)})},[de,t.length,n,v.length]),c.useLayoutEffect(()=>{var se;F.current=m,le.current=((se=v[m])==null?void 0:se.entryIndex)??0,_(m)},[m,v.length]);const X=te!==null?t[te]:null,re=ee!==null?v[ee]:null,me=!!(D!=null&&D.title1||D!=null&&D.title2||D!=null&&D.title3||X!=null&&X.title1||X!=null&&X.title2||X!=null&&X.title3),Ae=Gp(n,v,t),Ve=!!L,be={gap:T},qe=Ae&&Ve?{gap:$}:void 0,Ue=(se,Ce,Ze=!1)=>{const Ne=na(Ce),Qe=`calc(-0.5 * (${Ne} + ${Ce}))`;return r.jsx("div",{"data-controls":se,"data-controls-axis":"x",...Ze?{"data-controls-reverse":"true"}:void 0,style:{position:"absolute",top:0,right:Qe,width:Ne,height:"100%",pointerEvents:"auto",zIndex:3}})},He=(se,Ce=!1)=>{if(!se)return null;const Ze=[se.title1?{className:`${e}-title1`,style:S,text:se.title1}:null,se.title2?{className:`${e}-title2`,style:H,text:se.title2}:null,se.title3?{className:`${e}-title3`,style:R,text:se.title3}:null].filter(Ne=>Ne!==null);return Ze.map((Ne,Qe)=>r.jsxs("div",{className:`${e}-title-cell`,children:[r.jsx("p",{className:Ne.className,style:{...Ne.style,maxWidth:h},children:Ne.text}),Ce&&Y&&Qe<Ze.length-1?Ue("titlesGap",T):null]},Ne.className))},ct=se=>{const Ce=!se.objectFit&&qt(i);return{className:`${e}-slide-image-cell${Ce?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:l,maxHeight:d,...Ce?{"--image-aspect-ratio":Yi(i)}:{}}}},sn=se=>se.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":se.objectFit}}:qt(i)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},yn=se=>{if(se.length===0)return null;const Ce=se.length>1,Ze=na(s),Ne=`calc(-0.5 * (${Ze} + ${s}))`;if(se.length===1){const Qe=se[0];return r.jsx("div",{...ct(Qe),children:r.jsx("img",{...sn(Qe),src:Qe.url,alt:Qe.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:Ce?{gap:s}:void 0,children:se.map((Qe,Le)=>r.jsxs("div",{...ct(Qe),children:[r.jsx("img",{...sn(Qe),src:Qe.url,alt:Qe.name??"",draggable:!1}),Y&&Ce&&Le<se.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ne,width:Ze,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Qe.url}-${Le}`))})};return r.jsxs("div",{ref:ge,"data-selection":"none",className:`${e}-lightbox${a?` ${e}-lightbox-editor`:""}${p?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ge||We()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:Ve?void 0:-1,style:{opacity:Q?1:0,transition:`opacity ${ho}ms ease`,pointerEvents:Q?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:o,...lt}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%",..._t},...St,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:ht,onClick:se=>se.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":k&&v.length>1?"true":"false",onPointerDown:k?rt:void 0,onPointerUp:k?it:void 0,onPointerCancel:k?ut:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[re&&ie?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:se=>{se.target===se.currentTarget&&Ee(z)},children:r.jsx("div",{className:`${e}-slide-area`,children:yn(re.images)})},`slide-out-${z}`):null,r.jsx("div",{className:`${e}-slide-layer-in${ie?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:V?yn(V.images):null})},`slide-in-${z}-${A}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-chrome`,style:{width:"100%",height:"100%",...dt},children:[r.jsx("div",{"data-controls":Y?"contentMarginTop":void 0,className:Y?`${e}-control`:void 0,style:{height:w,width:"100%"}}),r.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%"},children:[r.jsx("div",{"data-controls":Y?"contentMarginLeft":void 0,"data-controls-axis":Y?"x":void 0,className:Y?`${e}-control`:void 0,style:{width:I,flexShrink:0}}),r.jsxs("div",{className:`${e}-lightbox-content-area`,children:[me&&r.jsx("div",{className:`${e}-text-bar-cell`,children:r.jsx("div",{className:`${e}-titles-row`,style:be,children:x==="fade"?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:oe,className:`${e}-titles-stack`,style:{...be,position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:He(Ie||D,!1)}),r.jsxs("div",{ref:J,className:`${e}-titles-stack`,style:{...be,...ne&&ae?{minHeight:ae}:void 0,...ne&&$e?{width:$e,maxWidth:"100%"}:void 0,...ne?{overflow:"hidden"}:void 0},children:[X&&ne?r.jsx("div",{className:`${e}-titles-layer-out ${e}-titles-fade-out`,style:be,children:He(X)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ne?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,style:be,children:He(D,!0)})]})]}):He(D,!0)})}),r.jsxs("div",{className:`${e}-lightbox-persistent-controls`,style:qe,children:[Ae&&r.jsxs("div",{className:`${e}-text-bar-cell`,children:[r.jsx("span",{className:`${e}-entry-counter`,style:B,"aria-live":"polite","aria-atomic":"true",children:Vp(v,A,n,t)}),Y&&Ve?Ue("countCloseGap",$,!0):null]}),Ve&&r.jsx("div",{className:`${e}-close-icon`,style:{width:E.scalingValue(C??0,a),height:E.scalingValue(C??0,a),"--close-icon-hover-color":g},children:r.jsx("button",{ref:Fe,type:"button",className:`${e}-close-icon-inner`,onClick:We,"aria-label":"Close",children:r.jsx(Nt,{url:L??"",fill:y,hoverFill:g,className:`${e}-close-icon-img`})})})]})]}),r.jsx("div",{"data-controls":Y?"contentMarginRight":void 0,"data-controls-axis":Y?"x":void 0,"data-controls-reverse":Y?"":void 0,className:Y?`${e}-control`:void 0,style:{width:O,flexShrink:0}})]})]})]})]})},di=["title1","title2","title3","count"];function Ye(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const Kp={title1:"1",title2:"2",title3:"3",count:"Count"};function qp(e){return[Ye(e,"fontFamily"),Ye(e,"fontSettings"),{type:"row",items:[Ye(e,"fontSize"),Ye(e,"lineHeight"),Ye(e,"letterSpacing"),Ye(e,"wordSpacing")]},Ye(e,"textAlign"),Ye(e,"textAppearance")]}function Xp(){return{type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(di.map(e=>[Kp[e],qp(e)]))}}const Yp={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Jp={title1:.02,title2:.02,title3:.02,count:.017};function xi(e,t){const n=i=>{const o=Ye(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[Yp[t]]}}function Si(e,t,n){var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??Jp[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return vt(i,n)}const Zp=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s,metadata:l})=>{const{prefix:d}=E.useScopedStyles(),a=(l==null?void 0:l.itemId)??null,{cover:p,coverFit:u,type:L,backgroundColor:C,imageGap:y,maxWidth:g,maxHeight:h,textMaxWidth:T,textTransition:$,titlesGap:x,countCloseGap:S,closeIcon:H,closeIconMaxWidth:R,closeIconColor:B,closeIconHoverColor:w,contentMarginTop:I,contentMarginLeft:O,contentMarginRight:m}=e,b=ee=>E.scalingValue(ee,n??!1),P=Si("title1",xi(e,"title1"),n),W=Si("title2",xi(e,"title2"),n),G=Si("title3",xi(e,"title3"),n),Y=Si("count",xi(e,"count"),n),k=c.useRef(null),[N,v]=c.useState(!1),[A,_]=c.useState(0),V=c.useRef(!1),D=c.useRef(!1),Q=c.useRef(!1),M=c.useMemo(()=>(t??[]).filter(ee=>kn(ee).length>0),[t]),te=!n||!!o,f=c.useCallback(()=>{te&&(Q.current=!0,Hp(D.current,a),D.current=!1)},[te,a]),ne=(ee=0)=>{if(i||M.length===0||n&&!o)return;const he=Pi(M,L),ie=Math.max(0,Math.min(ee,he.length-1));if(_(ie),te){const ue=Qa();Za(ie+1,a,ue),D.current=!ue}v(!0)},ye=c.useCallback(()=>{v(!1),Q.current=!1},[]);return c.useEffect(()=>{if(!te||V.current)return;V.current=!0;const ee=ea(a);if(!ee)return;const he=ta(ee,Pi(M,L).length);he<0||(_(he),v(!0))},[M,a,te,L]),c.useEffect(()=>{if(!te)return;const ee=()=>{if(Q.current){Q.current=!1,v(!1);return}const he=ea(a);if(!he){v(!1);return}const ie=ta(he,Pi(M,L).length);if(ie<0){v(!1);return}D.current=!1,_(ie),v(!0)};return window.addEventListener("popstate",ee),()=>window.removeEventListener("popstate",ee)},[M,a,te,L]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:k,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Bp(d)}}),p?r.jsx("button",{type:"button",className:`${d}-cover ${qt(u)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>ne(),style:{display:"block",padding:0,border:"none",background:"transparent",...qt(u)?{"--image-aspect-ratio":Yi(u)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${qt(u)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:p,alt:"cover"})}):null]}),N&&typeof document<"u"&&(()=>{const ee=(s?document.getElementById(s):null)??document.body;return ei.createPortal(r.jsx(Up,{prefix:d,entries:M,journalType:L,coverFit:u,backgroundColor:C,imageGap:b(y??0),slideMaxWidth:`${g}%`,slideMaxHeight:`${h}%`,textMaxWidth:b(T??.4),titlesGap:b(x??0),countCloseGap:b(S??0),textTransition:$,title1Style:P,title2Style:W,title3Style:G,countStyle:Y,contentMarginTop:b(I??0),contentMarginLeft:b(O??0),contentMarginRight:b(m??0),closeIcon:H,closeIconMaxWidth:R,closeIconColor:B,closeIconHoverColor:w,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:A,enableUrlSync:te,journalItemId:a,onBeforeClose:f,onClose:ye}),ee)})()]})},Qp=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
10694
10702
|
import { createPortal, flushSync } from 'react-dom';
|
|
10695
10703
|
import { CommonComponentProps } from '../props';
|
|
10696
10704
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -10699,6 +10707,7 @@ import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
|
10699
10707
|
import { textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
10700
10708
|
import { getAspectRatio, isImageRatioCover } from '../utils/imageFitStyles';
|
|
10701
10709
|
import { useLightboxSwipeDismiss } from '../utils/useLightboxSwipeDismiss';
|
|
10710
|
+
import { useLightboxScrollLock } from '../utils/useLightboxScrollLock';
|
|
10702
10711
|
import { LayoutItem, LayoutTab } from '../../types/SchemaV1';
|
|
10703
10712
|
|
|
10704
10713
|
const LIGHTBOX_ANIM_MS = 300;
|
|
@@ -10861,6 +10870,7 @@ function getCSS(P: string): string {
|
|
|
10861
10870
|
flex-direction: column;
|
|
10862
10871
|
align-items: center;
|
|
10863
10872
|
justify-content: center;
|
|
10873
|
+
overscroll-behavior: none;
|
|
10864
10874
|
}
|
|
10865
10875
|
|
|
10866
10876
|
.\${P}-lightbox-editor {
|
|
@@ -11439,6 +11449,7 @@ const LightboxOverlay = ({
|
|
|
11439
11449
|
mediaAreaStyle,
|
|
11440
11450
|
chromeStyle: swipeChromeStyle,
|
|
11441
11451
|
swipeHandlers,
|
|
11452
|
+
dismissAreaStyle,
|
|
11442
11453
|
} = useLightboxSwipeDismiss({
|
|
11443
11454
|
enabled: allowSwipeDismiss,
|
|
11444
11455
|
onClose: handleClose,
|
|
@@ -11580,6 +11591,8 @@ const LightboxOverlay = ({
|
|
|
11580
11591
|
}
|
|
11581
11592
|
}, [resetStripNavGesture]);
|
|
11582
11593
|
|
|
11594
|
+
useLightboxScrollLock();
|
|
11595
|
+
|
|
11583
11596
|
useEffect(() => {
|
|
11584
11597
|
previouslyFocusedRef.current = document.activeElement instanceof HTMLElement
|
|
11585
11598
|
? document.activeElement
|
|
@@ -11594,11 +11607,8 @@ const LightboxOverlay = ({
|
|
|
11594
11607
|
}
|
|
11595
11608
|
});
|
|
11596
11609
|
});
|
|
11597
|
-
const originalOverflow = document.body.style.overflow;
|
|
11598
|
-
document.body.style.overflow = 'hidden';
|
|
11599
11610
|
return () => {
|
|
11600
11611
|
cancelAnimationFrame(frame);
|
|
11601
|
-
document.body.style.overflow = originalOverflow;
|
|
11602
11612
|
if (closeTimeoutRef.current) {
|
|
11603
11613
|
clearTimeout(closeTimeoutRef.current);
|
|
11604
11614
|
}
|
|
@@ -11846,6 +11856,7 @@ const LightboxOverlay = ({
|
|
|
11846
11856
|
position: 'relative',
|
|
11847
11857
|
width: '100%',
|
|
11848
11858
|
height: '100%',
|
|
11859
|
+
...dismissAreaStyle,
|
|
11849
11860
|
}}
|
|
11850
11861
|
{...swipeHandlers}
|
|
11851
11862
|
>
|
|
@@ -12406,4 +12417,4 @@ export type LightboxJournalSettings = {
|
|
|
12406
12417
|
closeIconColor: string;
|
|
12407
12418
|
closeIconHoverColor: string;
|
|
12408
12419
|
};
|
|
12409
|
-
`,
|
|
12420
|
+
`,em="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="#000000" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>'),pn={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 tm(e){const t={};return t[Ye(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSettings")]={...pn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSize")]={...pn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ye(e,"lineHeight")]={...pn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ye(e,"letterSpacing")]={...pn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ye(e,"wordSpacing")]={...pn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ye(e,"textAlign")]={...pn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ye(e,"textAppearance")]={...pn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const nm=di.reduce((e,t)=>({...e,...tm(t)}),{}),im=di.reduce((e,t)=>({...e,[Ye(t,"fontFamily")]:"Arial",[Ye(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ye(t,"letterSpacing")]:0,[Ye(t,"wordSpacing")]:0,[Ye(t,"textAlign")]:"left",[Ye(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function oa(e){return di.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ye(n,"fontSize")]=i),o!==void 0&&(t[Ye(n,"lineHeight")]=o),t},{})}const om=Xp(),rm={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,max:200,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textMaxWidth:{type:"string",scope:"layout",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 Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...nm,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},closeIcon:em,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#ffffff",...im},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,textMaxWidth:.4,closeIconMaxWidth:.05,contentMarginTop:.02,contentMarginLeft:.01,contentMarginRight:.01,titlesGap:.01,countCloseGap:.005,...oa({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},d:{type:"A",maxHeight:80,maxWidth:80,imageGap:.05,textMaxWidth:.4,closeIconMaxWidth:.015,contentMarginTop:.01,contentMarginLeft:.01,contentMarginRight:.01,titlesGap:.1,countCloseGap:.02,...oa({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:[om]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"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"}]}]}},am={element:Zp,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:rm,sourceCode:Qp,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:di.map(e=>({path:`styles.${Ye(e,"fontSettings")}`}))}},sm=[mc,xc,ld,Fp,am,yd,Ed,Bd,Vd,Jd,cu,up];exports.components=sm;exports.isSchemaV1=os;
|