@cntrl-site/components 1.0.16-alpha.3 → 1.0.16-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/LightboxStrip/LightboxStrip.d.ts +7 -6
- package/dist/Components/utils/animateScrollLeft.d.ts +8 -0
- package/dist/Components/utils/cubicBezierEasing.d.ts +1 -0
- package/dist/Components/utils/useLightboxScrollLock.d.ts +1 -0
- package/dist/Components/utils/useLightboxSwipeDismiss.d.ts +1 -0
- package/dist/index.js +435 -146
- package/dist/index.mjs +4835 -4390
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("react"),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 cs(e){return e.type==="object"&&e.version===1}const ds="ControlSlider-module__wrapper___sHEkd",us="ControlSlider-module__hoverArrow___A-dOH",ps="ControlSlider-module__sliderItem___QQSkR",ms="ControlSlider-module__sliderImage___9hRl-",gs="ControlSlider-module__arrow___05ghY",hs="ControlSlider-module__arrowVertical___tBfVN",fs="ControlSlider-module__nextArrow___-30Yc",ys="ControlSlider-module__arrowInner___aEra3",vs="ControlSlider-module__arrowIcon___S4ztF",bs="ControlSlider-module__arrowImg___2dwJW",xs="ControlSlider-module__mirror___brd6U",Ss="ControlSlider-module__pagination___bicLF",Cs="ControlSlider-module__paginationInner___bT-P-",ws="ControlSlider-module__paginationVertical___zYqKw",$s="ControlSlider-module__paginationItem___nTRbk",Ts="ControlSlider-module__dot___p1Qun",Ls="ControlSlider-module__activeDot___LHFaj",Es="ControlSlider-module__paginationInsideBottom___R3FWn",Is="ControlSlider-module__paginationInsideTop___V-qb-",_s="ControlSlider-module__paginationOutsideBottom___14w8D",Rs="ControlSlider-module__paginationOutsideTop___SCLqB",Ps="ControlSlider-module__paginationInsideLeft___yOBRZ",As="ControlSlider-module__paginationInsideRight___Rtt3o",Ms="ControlSlider-module__paginationOutsideLeft___lahaw",ks="ControlSlider-module__paginationOutsideRight___EtuQa",Ws="ControlSlider-module__imgWrapper___UjEgB",Fs="ControlSlider-module__captionBlock___dJ6-j",Ns="ControlSlider-module__captionTextWrapper___HFlpf",Hs="ControlSlider-module__captionText___uGBVc",Os="ControlSlider-module__active___WZK4G",Bs="ControlSlider-module__withPointerEvents___t-18M",Ds="ControlSlider-module__topLeftAlignment___zjnGM",js="ControlSlider-module__topCenterAlignment___gD1xW",zs="ControlSlider-module__topRightAlignment___NMapS",Vs="ControlSlider-module__middleLeftAlignment___OnUrY",Ks="ControlSlider-module__middleCenterAlignment___Tdkl0",Gs="ControlSlider-module__middleRightAlignment___wEbfX",Us="ControlSlider-module__bottomLeftAlignment___cTP2-",qs="ControlSlider-module__bottomCenterAlignment___c54fB",Xs="ControlSlider-module__bottomRightAlignment___kEwrz",Ys="ControlSlider-module__clickOverlay___DZA28",Js="ControlSlider-module__contain___pLyq7",Zs="ControlSlider-module__cover___KdDat",ve={wrapper:ds,hoverArrow:us,sliderItem:ps,sliderImage:ms,arrow:gs,arrowVertical:hs,nextArrow:fs,arrowInner:ys,arrowIcon:vs,arrowImg:bs,mirror:xs,pagination:Ss,paginationInner:Cs,paginationVertical:ws,paginationItem:$s,dot:Ts,activeDot:Ls,paginationInsideBottom:Es,paginationInsideTop:Is,paginationOutsideBottom:_s,paginationOutsideTop:Rs,paginationInsideLeft:Ps,paginationInsideRight:As,paginationOutsideLeft:Ms,paginationOutsideRight:ks,imgWrapper:Ws,captionBlock:Fs,captionTextWrapper:Ns,captionText:Hs,active:Os,withPointerEvents:Bs,topLeftAlignment:Ds,topCenterAlignment:js,topRightAlignment:zs,middleLeftAlignment:Vs,middleCenterAlignment:Ks,middleRightAlignment:Gs,bottomLeftAlignment:Us,bottomCenterAlignment:qs,bottomRightAlignment:Xs,clickOverlay:Ys,contain:Js,cover:Zs};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 el(e,t,n){return t&&Qs(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var lr="(prefers-reduced-motion: reduce)",Tn=1,tl=2,In=3,Wn=4,ti=5,Si=6,Ri=7,nl={CREATED:Tn,MOUNTED:tl,IDLE:In,MOVING:Wn,SCROLLING:ti,DRAGGING:Si,DESTROYED:Ri};function Jt(e){e.length=0}function an(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ye(e){return e.bind.apply(e,[null].concat(an(arguments,1)))}var la=setTimeout,yo=function(){};function cr(e){return requestAnimationFrame(e)}function Fi(e,t){return typeof t===e}function zn(e){return!Po(e)&&Fi("object",e)}var Ro=Array.isArray,ca=Ye(Fi,"function"),nn=Ye(Fi,"string"),ni=Ye(Fi,"undefined");function Po(e){return e===null}function da(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function ii(e){return Ro(e)?e:[e]}function Mt(e,t){ii(e).forEach(t)}function Ao(e,t){return e.indexOf(t)>-1}function Ci(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,nn(t)?t.split(" "):t,!0)}function oi(e,t){Mt(t,e.appendChild.bind(e))}function Mo(e,t){Mt(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Vn(e,t){return da(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function ua(e,t){var n=e?an(e.children):[];return t?n.filter(function(i){return Vn(i,t)}):n}function ri(e,t){return t?ua(e,t)[0]:e.firstElementChild}var Kn=Object.keys;function gn(e,t,n){return e&&(n?Kn(e).reverse():Kn(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Gn(e){return an(arguments,1).forEach(function(t){gn(t,function(n,i){e[i]=t[i]})}),e}function tn(e){return an(arguments,1).forEach(function(t){gn(t,function(n,i){Ro(n)?e[i]=n.slice():zn(n)?e[i]=tn({},zn(e[i])?e[i]:{},n):e[i]=n})}),e}function dr(e,t){Mt(t||Kn(e),function(n){delete e[n]})}function Dt(e,t){Mt(e,function(n){Mt(t,function(i){n&&n.removeAttribute(i)})})}function Me(e,t,n){zn(t)?gn(t,function(i,o){Me(e,o,i)}):Mt(e,function(i){Po(n)||n===""?Dt(i,t):i.setAttribute(t,String(n))})}function Ln(e,t,n){var i=document.createElement(e);return t&&(nn(t)?Bt(i,t):Me(i,t)),n&&oi(n,i),i}function kt(e,t,n){if(ni(n))return getComputedStyle(e)[t];Po(n)||(e.style[t]=""+n)}function Un(e,t){kt(e,"display",t)}function pa(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Wt(e,t){return e.getAttribute(t)}function ur(e,t){return e&&e.classList.contains(t)}function Rt(e){return e.getBoundingClientRect()}function hn(e){Mt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function ma(e){return ri(new DOMParser().parseFromString(e,"text/html").body)}function Kt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ga(e,t){return e&&e.querySelector(t)}function ko(e,t){return t?an(e.querySelectorAll(t)):[]}function Ut(e,t){Gt(e,t,!1)}function vo(e){return e.timeStamp}function cn(e){return nn(e)?e:e?e+"px":""}var ai="splide",Wo="data-"+ai;function On(e,t){if(!e)throw new Error("["+ai+"] "+(t||""))}var on=Math.min,Pi=Math.max,Ai=Math.floor,qn=Math.ceil,Ct=Math.abs;function ha(e,t,n){return Ct(e-t)<n}function wi(e,t,n,i){var o=on(t,n),a=Pi(t,n);return i?o<e&&e<a:o<=e&&e<=a}function Cn(e,t,n){var i=on(t,n),o=Pi(t,n);return on(Pi(i,e),o)}function bo(e){return+(e>0)-+(e<0)}function xo(e,t){return Mt(t,function(n){e=e.replace("%s",""+n)}),e}function Fo(e){return e<10?"0"+e:""+e}var pr={};function il(e){return""+e+Fo(pr[e]=(pr[e]||0)+1)}function fa(){var e=[];function t(l,d,s,p){o(l,d,function(u,L,b){var y="addEventListener"in u,m=y?u.removeEventListener.bind(u,L,s,p):u.removeListener.bind(u,s);y?u.addEventListener(L,s,p):u.addListener(s),e.push([u,L,b,s,m])})}function n(l,d,s){o(l,d,function(p,u,L){e=e.filter(function(b){return b[0]===p&&b[1]===u&&b[2]===L&&(!s||b[3]===s)?(b[4](),!1):!0})})}function i(l,d,s){var p,u=!0;return typeof CustomEvent=="function"?p=new CustomEvent(d,{bubbles:u,detail:s}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(d,u,!1,s)),l.dispatchEvent(p),p}function o(l,d,s){Mt(l,function(p){p&&Mt(d,function(u){u.split(" ").forEach(function(L){var b=L.split(".");s(p,b[0],b[1])})})})}function a(){e.forEach(function(l){l[4]()}),Jt(e)}return{bind:t,unbind:n,dispatch:i,destroy:a}}var sn="mounted",So="ready",Zt="move",Fn="moved",No="click",ya="active",va="inactive",ba="visible",xa="hidden",rt="refresh",ht="updated",_n="resize",Ni="resized",Sa="drag",Ca="dragging",wa="dragged",Hi="scroll",yn="scrolled",ol="overflow",Ho="destroy",$a="arrows:mounted",Ta="arrows:updated",La="pagination:mounted",Ea="pagination:updated",Oo="navigation:mounted",Bo="autoplay:play",Ia="autoplay:playing",Do="autoplay:pause",jo="lazyload:loaded",_a="sk",Ra="sh",Mi="ei";function Qe(e){var t=e?e.event.bus:document.createDocumentFragment(),n=fa();function i(a,l){n.bind(t,ii(a).join(" "),function(d){l.apply(l,Ro(d.detail)?d.detail:[])})}function o(a){n.dispatch(t,a,an(arguments,1))}return e&&e.event.on(Ho,n.destroy),Gn(n,{bus:t,on:i,off:Ye(n.unbind,t),emit:o})}function Oi(e,t,n,i){var o=Date.now,a,l=0,d,s=!0,p=0;function u(){if(!s){if(l=e?on((o()-a)/e,1):1,n&&n(l),l>=1&&(t(),a=o(),i&&++p>=i))return b();d=cr(u)}}function L(w){w||m(),a=o()-(w?l*e:0),s=!1,d=cr(u)}function b(){s=!0}function y(){a=o(),l=0,n&&n(l)}function m(){d&&cancelAnimationFrame(d),l=0,d=0,s=!0}function h(w){e=w}function C(){return s}return{start:L,rewind:y,pause:b,cancel:m,set:h,isPaused:C}}function rl(e){var t=e;function n(o){t=o}function i(o){return Ao(ii(o),t)}return{set:n,is:i}}function al(e,t){var n=Oi(0,e,null,1);return function(){n.isPaused()&&n.start()}}function sl(e,t,n){var i=e.state,o=n.breakpoints||{},a=n.reducedMotion||{},l=fa(),d=[];function s(){var m=n.mediaQuery==="min";Kn(o).sort(function(h,C){return m?+h-+C:+C-+h}).forEach(function(h){u(o[h],"("+(m?"min":"max")+"-width:"+h+"px)")}),u(a,lr),L()}function p(m){m&&l.destroy()}function u(m,h){var C=matchMedia(h);l.bind(C,"change",L),d.push([m,C])}function L(){var m=i.is(Ri),h=n.direction,C=d.reduce(function(w,v){return tn(w,v[1].matches?v[0]:{})},{});dr(n),y(C),n.destroy?e.destroy(n.destroy==="completely"):m?(p(!0),e.mount()):h!==n.direction&&e.refresh()}function b(m){matchMedia(lr).matches&&(m?tn(n,a):dr(n,Kn(a)))}function y(m,h,C){tn(n,m),h&&tn(Object.getPrototypeOf(n),m),(C||!i.is(Tn))&&e.emit(ht,n)}return{setup:s,destroy:p,reduce:b,set:y}}var Bi="Arrow",Di=Bi+"Left",ji=Bi+"Right",Pa=Bi+"Up",Aa=Bi+"Down",mr="rtl",zi="ttb",Zi={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Pa,ji],ArrowRight:[Aa,Di]};function ll(e,t,n){function i(a,l,d){d=d||n.direction;var s=d===mr&&!l?1:d===zi?0:-1;return Zi[a]&&Zi[a][s]||a.replace(/width|left|right/i,function(p,u){var L=Zi[p.toLowerCase()][s]||p;return u>0?L.charAt(0).toUpperCase()+L.slice(1):L})}function o(a){return a*(n.direction===mr?1:-1)}return{resolve:i,orient:o}}var qt="role",En="tabindex",cl="disabled",Ft="aria-",si=Ft+"controls",Ma=Ft+"current",gr=Ft+"selected",Pt=Ft+"label",zo=Ft+"labelledby",ka=Ft+"hidden",Vo=Ft+"orientation",Xn=Ft+"roledescription",hr=Ft+"live",fr=Ft+"busy",yr=Ft+"atomic",Ko=[qt,En,cl,si,Ma,Pt,zo,ka,Vo,Xn],jt=ai+"__",ln="is-",Qi=ai,vr=jt+"track",dl=jt+"list",Vi=jt+"slide",Wa=Vi+"--clone",ul=Vi+"__container",Go=jt+"arrows",Ki=jt+"arrow",Fa=Ki+"--prev",Na=Ki+"--next",Gi=jt+"pagination",Ha=Gi+"__page",pl=jt+"progress",ml=pl+"__bar",gl=jt+"toggle",hl=jt+"spinner",fl=jt+"sr",yl=ln+"initialized",fn=ln+"active",Oa=ln+"prev",Ba=ln+"next",Co=ln+"visible",wo=ln+"loading",Da=ln+"focus-in",ja=ln+"overflow",vl=[fn,Co,Oa,Ba,wo,Da,ja],bl={slide:Vi,clone:Wa,arrows:Go,arrow:Ki,prev:Fa,next:Na,pagination:Gi,page:Ha,spinner:hl};function xl(e,t){if(ca(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Vn(n,t);)n=n.parentElement;return n}var Sl=5,br=200,za="touchstart mousedown",eo="touchmove mousemove",to="touchend touchcancel mouseup click";function Cl(e,t,n){var i=Qe(e),o=i.on,a=i.bind,l=e.root,d=n.i18n,s={},p=[],u=[],L=[],b,y,m;function h(){x(),O(),v()}function C(){o(rt,w),o(rt,h),o(ht,v),a(document,za+" keydown",function(T){m=T.type==="keydown"},{capture:!0}),a(l,"focusin",function(){Gt(l,Da,!!m)})}function w(T){var P=Ko.concat("style");Jt(p),Ut(l,u),Ut(b,L),Dt([b,y],P),Dt(l,T?P:["style",Xn])}function v(){Ut(l,u),Ut(b,L),u=B(Qi),L=B(vr),Bt(l,u),Bt(b,L),Me(l,Pt,n.label),Me(l,zo,n.labelledby)}function x(){b=R("."+vr),y=ri(b,"."+dl),On(b&&y,"A track/list element is missing."),Ci(p,ua(y,"."+Vi+":not(."+Wa+")")),gn({arrows:Go,pagination:Gi,prev:Fa,next:Na,bar:ml,toggle:gl},function(T,P){s[P]=R("."+T)}),Gn(s,{root:l,track:b,list:y,slides:p})}function O(){var T=l.id||il(ai),P=n.role;l.id=T,b.id=b.id||T+"-track",y.id=y.id||T+"-list",!Wt(l,qt)&&l.tagName!=="SECTION"&&P&&Me(l,qt,P),Me(l,Xn,d.carousel),Me(y,qt,"presentation")}function R(T){var P=ga(l,T);return P&&xl(P,"."+Qi)===l?P:void 0}function B(T){return[T+"--"+n.type,T+"--"+n.direction,n.drag&&T+"--draggable",n.isNavigation&&T+"--nav",T===Qi&&fn]}return Gn(s,{setup:h,mount:C,destroy:w})}var Rn="slide",Nn="loop",li="fade";function wl(e,t,n,i){var o=Qe(e),a=o.on,l=o.emit,d=o.bind,s=e.Components,p=e.root,u=e.options,L=u.isNavigation,b=u.updateOnMove,y=u.i18n,m=u.pagination,h=u.slideFocus,C=s.Direction.resolve,w=Wt(i,"style"),v=Wt(i,Pt),x=n>-1,O=ri(i,"."+ul),R;function B(){x||(i.id=p.id+"-slide"+Fo(t+1),Me(i,qt,m?"tabpanel":"group"),Me(i,Xn,y.slide),Me(i,Pt,v||xo(y.slideLabel,[t+1,e.length]))),T()}function T(){d(i,"click",Ye(l,No,I)),d(i,"keydown",Ye(l,_a,I)),a([Fn,Ra,yn],$),a(Oo,D),b&&a(Zt,g)}function P(){R=!0,o.destroy(),Ut(i,vl),Dt(i,Ko),Me(i,"style",w),Me(i,Pt,v||"")}function D(){var M=e.splides.map(function(W){var j=W.splide.Components.Slides.getAt(t);return j?j.slide.id:""}).join(" ");Me(i,Pt,xo(y.slideX,(x?n:t)+1)),Me(i,si,M),Me(i,qt,h?"button":""),h&&Dt(i,Xn)}function g(){R||$()}function $(){if(!R){var M=e.index;A(),H(),Gt(i,Oa,t===M-1),Gt(i,Ba,t===M+1)}}function A(){var M=Q();M!==ur(i,fn)&&(Gt(i,fn,M),Me(i,Ma,L&&M||""),l(M?ya:va,I))}function H(){var M=k(),W=!M&&(!Q()||x);if(e.state.is([Wn,ti])||Me(i,ka,W||""),Me(ko(i,u.focusableNodes||""),En,W?-1:""),h&&Me(i,En,W?-1:0),M!==ur(i,Co)&&(Gt(i,Co,M),l(M?ba:xa,I)),!M&&document.activeElement===i){var j=s.Slides.getAt(e.index);j&&pa(j.slide)}}function K(M,W,j){kt(j&&O||i,M,W)}function Q(){var M=e.index;return M===t||u.cloneStatus&&M===n}function k(){if(e.is(li))return Q();var M=Rt(s.Elements.track),W=Rt(i),j=C("left",!0),U=C("right",!0);return Ai(M[j])<=qn(W[j])&&Ai(W[U])<=qn(M[U])}function _(M,W){var j=Ct(M-t);return!x&&(u.rewind||e.is(Nn))&&(j=on(j,e.length-j)),j<=W}var I={index:t,slideIndex:n,slide:i,container:O,isClone:x,mount:B,destroy:P,update:$,style:K,isWithin:_};return I}function $l(e,t,n){var i=Qe(e),o=i.on,a=i.emit,l=i.bind,d=t.Elements,s=d.slides,p=d.list,u=[];function L(){b(),o(rt,y),o(rt,b)}function b(){s.forEach(function($,A){h($,A,-1)})}function y(){R(function($){$.destroy()}),Jt(u)}function m(){R(function($){$.update()})}function h($,A,H){var K=wl(e,A,H,$);K.mount(),u.push(K),u.sort(function(Q,k){return Q.index-k.index})}function C($){return $?B(function(A){return!A.isClone}):u}function w($){var A=t.Controller,H=A.toIndex($),K=A.hasFocus()?1:n.perPage;return B(function(Q){return wi(Q.index,H,H+K-1)})}function v($){return B($)[0]}function x($,A){Mt($,function(H){if(nn(H)&&(H=ma(H)),da(H)){var K=s[A];K?Mo(H,K):oi(p,H),Bt(H,n.classes.slide),P(H,Ye(a,_n))}}),a(rt)}function O($){hn(B($).map(function(A){return A.slide})),a(rt)}function R($,A){C(A).forEach($)}function B($){return u.filter(ca($)?$:function(A){return nn($)?Vn(A.slide,$):Ao(ii($),A.index)})}function T($,A,H){R(function(K){K.style($,A,H)})}function P($,A){var H=ko($,"img"),K=H.length;K?H.forEach(function(Q){l(Q,"load error",function(){--K||A()})}):A()}function D($){return $?s.length:u.length}function g(){return u.length>n.perPage}return{mount:L,destroy:y,update:m,register:h,get:C,getIn:w,getAt:v,add:x,remove:O,forEach:R,filter:B,style:T,getLength:D,isEnough:g}}function Tl(e,t,n){var i=Qe(e),o=i.on,a=i.bind,l=i.emit,d=t.Slides,s=t.Direction.resolve,p=t.Elements,u=p.root,L=p.track,b=p.list,y=d.getAt,m=d.style,h,C,w;function v(){x(),a(window,"resize load",al(Ye(l,_n))),o([ht,rt],x),o(_n,O)}function x(){h=n.direction===zi,kt(u,"maxWidth",cn(n.width)),kt(L,s("paddingLeft"),R(!1)),kt(L,s("paddingRight"),R(!0)),O(!0)}function O(I){var M=Rt(u);(I||C.width!==M.width||C.height!==M.height)&&(kt(L,"height",B()),m(s("marginRight"),cn(n.gap)),m("width",P()),m("height",D(),!0),C=M,l(Ni),w!==(w=_())&&(Gt(u,ja,w),l(ol,w)))}function R(I){var M=n.padding,W=s(I?"right":"left");return M&&cn(M[W]||(zn(M)?0:M))||"0px"}function B(){var I="";return h&&(I=T(),On(I,"height or heightRatio is missing."),I="calc("+I+" - "+R(!1)+" - "+R(!0)+")"),I}function T(){return cn(n.height||Rt(b).width*n.heightRatio)}function P(){return n.autoWidth?null:cn(n.fixedWidth)||(h?"":g())}function D(){return cn(n.fixedHeight)||(h?n.autoHeight?null:g():T())}function g(){var I=cn(n.gap);return"calc((100%"+(I&&" + "+I)+")/"+(n.perPage||1)+(I&&" - "+I)+")"}function $(){return Rt(b)[s("width")]}function A(I,M){var W=y(I||0);return W?Rt(W.slide)[s("width")]+(M?0:Q()):0}function H(I,M){var W=y(I);if(W){var j=Rt(W.slide)[s("right")],U=Rt(b)[s("left")];return Ct(j-U)+(M?0:Q())}return 0}function K(I){return H(e.length-1)-H(0)+A(0,I)}function Q(){var I=y(0);return I&&parseFloat(kt(I.slide,s("marginRight")))||0}function k(I){return parseFloat(kt(L,s("padding"+(I?"Right":"Left"))))||0}function _(){return e.is(li)||K(!0)>$()}return{mount:v,resize:O,listSize:$,slideSize:A,sliderSize:K,totalSize:H,getPadding:k,isOverflow:_}}var Ll=2;function El(e,t,n){var i=Qe(e),o=i.on,a=t.Elements,l=t.Slides,d=t.Direction.resolve,s=[],p;function u(){o(rt,L),o([ht,_n],y),(p=C())&&(m(p),t.Layout.resize(!0))}function L(){b(),u()}function b(){hn(s),Jt(s),i.destroy()}function y(){var w=C();p!==w&&(p<w||!w)&&i.emit(rt)}function m(w){var v=l.get().slice(),x=v.length;if(x){for(;v.length<w;)Ci(v,v);Ci(v.slice(-w),v.slice(0,w)).forEach(function(O,R){var B=R<w,T=h(O.slide,R);B?Mo(T,v[0].slide):oi(a.list,T),Ci(s,T),l.register(T,R-w+(B?0:x),O.index)})}}function h(w,v){var x=w.cloneNode(!0);return Bt(x,n.classes.clone),x.id=e.root.id+"-clone"+Fo(v+1),x}function C(){var w=n.clones;if(!e.is(Nn))w=0;else if(ni(w)){var v=n[d("fixedWidth")]&&t.Layout.slideSize(0),x=v&&qn(Rt(a.track)[d("width")]/v);w=x||n[d("autoWidth")]&&e.length||n.perPage*Ll}return w}return{mount:u,destroy:b}}function Il(e,t,n){var i=Qe(e),o=i.on,a=i.emit,l=e.state.set,d=t.Layout,s=d.slideSize,p=d.getPadding,u=d.totalSize,L=d.listSize,b=d.sliderSize,y=t.Direction,m=y.resolve,h=y.orient,C=t.Elements,w=C.list,v=C.track,x;function O(){x=t.Transition,o([sn,Ni,ht,rt],R)}function R(){t.Controller.isBusy()||(t.Scroll.cancel(),T(e.index),t.Slides.update())}function B(W,j,U,ie){W!==j&&I(W>U)&&($(),P(g(K(),W>U),!0)),l(Wn),a(Zt,j,U,W),x.start(j,function(){l(In),a(Fn,j,U,W),ie&&ie()})}function T(W){P(H(W,!0))}function P(W,j){if(!e.is(li)){var U=j?W:D(W);kt(w,"transform","translate"+m("X")+"("+U+"px)"),W!==U&&a(Ra)}}function D(W){if(e.is(Nn)){var j=A(W),U=j>t.Controller.getEnd(),ie=j<0;(ie||U)&&(W=g(W,U))}return W}function g(W,j){var U=W-_(j),ie=b();return W-=h(ie*(qn(Ct(U)/ie)||1))*(j?1:-1),W}function $(){P(K(),!0),x.cancel()}function A(W){for(var j=t.Slides.get(),U=0,ie=1/0,F=0;F<j.length;F++){var J=j[F].index,f=Ct(H(J,!0)-W);if(f<=ie)ie=f,U=J;else break}return U}function H(W,j){var U=h(u(W-1)-k(W));return j?Q(U):U}function K(){var W=m("left");return Rt(w)[W]-Rt(v)[W]+h(p(!1))}function Q(W){return n.trimSpace&&e.is(Rn)&&(W=Cn(W,0,h(b(!0)-L()))),W}function k(W){var j=n.focus;return j==="center"?(L()-s(W,!0))/2:+j*s(W)||0}function _(W){return H(W?t.Controller.getEnd():0,!!n.trimSpace)}function I(W){var j=h(g(K(),W));return W?j>=0:j<=w[m("scrollWidth")]-Rt(v)[m("width")]}function M(W,j){j=ni(j)?K():j;var U=W!==!0&&h(j)<h(_(!1)),ie=W!==!1&&h(j)>h(_(!0));return U||ie}return{mount:O,move:B,jump:T,translate:P,shift:g,cancel:$,toIndex:A,toPosition:H,getPosition:K,getLimit:_,exceededLimit:M,reposition:R}}function _l(e,t,n){var i=Qe(e),o=i.on,a=i.emit,l=t.Move,d=l.getPosition,s=l.getLimit,p=l.toPosition,u=t.Slides,L=u.isEnough,b=u.getLength,y=n.omitEnd,m=e.is(Nn),h=e.is(Rn),C=Ye(K,!1),w=Ye(K,!0),v=n.start||0,x,O=v,R,B,T;function P(){D(),o([ht,rt,Mi],D),o(Ni,g)}function D(){R=b(!0),B=n.perMove,T=n.perPage,x=I();var f=Cn(v,0,y?x:R-1);f!==v&&(v=f,l.reposition())}function g(){x!==I()&&a(Mi)}function $(f,ne,Ce){if(!J()){var ue=H(f),ye=_(ue);ye>-1&&(ne||ye!==v)&&(U(ye),l.move(ue,ye,O,Ce))}}function A(f,ne,Ce,ue){t.Scroll.scroll(f,ne,Ce,function(){var ye=_(l.toIndex(d()));U(y?on(ye,x):ye),ue&&ue()})}function H(f){var ne=v;if(nn(f)){var Ce=f.match(/([+\-<>])(\d+)?/)||[],ue=Ce[1],ye=Ce[2];ue==="+"||ue==="-"?ne=Q(v+ +(""+ue+(+ye||1)),v):ue===">"?ne=ye?M(+ye):C(!0):ue==="<"&&(ne=w(!0))}else ne=m?f:Cn(f,0,x);return ne}function K(f,ne){var Ce=B||(F()?1:T),ue=Q(v+Ce*(f?-1:1),v,!(B||F()));return ue===-1&&h&&!ha(d(),s(!f),1)?f?0:x:ne?ue:_(ue)}function Q(f,ne,Ce){if(L()||F()){var ue=k(f);ue!==f&&(ne=f,f=ue,Ce=!1),f<0||f>x?!B&&(wi(0,f,ne,!0)||wi(x,ne,f,!0))?f=M(W(f)):m?f=Ce?f<0?-(R%T||T):R:f:n.rewind?f=f<0?x:0:f=-1:Ce&&f!==ne&&(f=M(W(ne)+(f<ne?-1:1)))}else f=-1;return f}function k(f){if(h&&n.trimSpace==="move"&&f!==v)for(var ne=d();ne===p(f,!0)&&wi(f,0,e.length-1,!n.rewind);)f<v?--f:++f;return f}function _(f){return m?(f+R)%R||0:f}function I(){for(var f=R-(F()||m&&B?1:T);y&&f-- >0;)if(p(R-1,!0)!==p(f,!0)){f++;break}return Cn(f,0,R-1)}function M(f){return Cn(F()?f:T*f,0,x)}function W(f){return F()?on(f,x):Ai((f>=x?R-1:f)/T)}function j(f){var ne=l.toIndex(f);return h?Cn(ne,0,x):ne}function U(f){f!==v&&(O=v,v=f)}function ie(f){return f?O:v}function F(){return!ni(n.focus)||n.isNavigation}function J(){return e.state.is([Wn,ti])&&!!n.waitForTransition}return{mount:P,go:$,scroll:A,getNext:C,getPrev:w,getAdjacent:K,getEnd:I,setIndex:U,getIndex:ie,toIndex:M,toPage:W,toDest:j,hasFocus:F,isBusy:J}}var Rl="http://www.w3.org/2000/svg",Pl="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 Al(e,t,n){var i=Qe(e),o=i.on,a=i.bind,l=i.emit,d=n.classes,s=n.i18n,p=t.Elements,u=t.Controller,L=p.arrows,b=p.track,y=L,m=p.prev,h=p.next,C,w,v={};function x(){R(),o(ht,O)}function O(){B(),x()}function R(){var A=n.arrows;A&&!(m&&h)&&D(),m&&h&&(Gn(v,{prev:m,next:h}),Un(y,A?"":"none"),Bt(y,w=Go+"--"+n.direction),A&&(T(),$(),Me([m,h],si,b.id),l($a,m,h)))}function B(){i.destroy(),Ut(y,w),C?(hn(L?[m,h]:y),m=h=null):Dt([m,h],Ko)}function T(){o([sn,Fn,rt,yn,Mi],$),a(h,"click",Ye(P,">")),a(m,"click",Ye(P,"<"))}function P(A){u.go(A,!0)}function D(){y=L||Ln("div",d.arrows),m=g(!0),h=g(!1),C=!0,oi(y,[m,h]),!L&&Mo(y,b)}function g(A){var H='<button class="'+d.arrow+" "+(A?d.prev:d.next)+'" type="button"><svg xmlns="'+Rl+'" viewBox="0 0 '+pi+" "+pi+'" width="'+pi+'" height="'+pi+'" focusable="false"><path d="'+(n.arrowPath||Pl)+'" />';return ma(H)}function $(){if(m&&h){var A=e.index,H=u.getPrev(),K=u.getNext(),Q=H>-1&&A<H?s.last:s.prev,k=K>-1&&A>K?s.first:s.next;m.disabled=H<0,h.disabled=K<0,Me(m,Pt,Q),Me(h,Pt,k),l(Ta,m,h,H,K)}}return{arrows:v,mount:x,destroy:B,update:$}}var Ml=Wo+"-interval";function kl(e,t,n){var i=Qe(e),o=i.on,a=i.bind,l=i.emit,d=Oi(n.interval,e.go.bind(e,">"),T),s=d.isPaused,p=t.Elements,u=t.Elements,L=u.root,b=u.toggle,y=n.autoplay,m,h,C=y==="pause";function w(){y&&(v(),b&&Me(b,si,p.track.id),C||x(),B())}function v(){n.pauseOnHover&&a(L,"mouseenter mouseleave",function(D){m=D.type==="mouseenter",R()}),n.pauseOnFocus&&a(L,"focusin focusout",function(D){h=D.type==="focusin",R()}),b&&a(b,"click",function(){C?x():O(!0)}),o([Zt,Hi,rt],d.rewind),o(Zt,P)}function x(){s()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),h=m=C=!1,B(),l(Bo))}function O(D){D===void 0&&(D=!0),C=!!D,B(),s()||(d.pause(),l(Do))}function R(){C||(m||h?O(!1):x())}function B(){b&&(Gt(b,fn,!C),Me(b,Pt,n.i18n[C?"play":"pause"]))}function T(D){var g=p.bar;g&&kt(g,"width",D*100+"%"),l(Ia,D)}function P(D){var g=t.Slides.getAt(D);d.set(g&&+Wt(g.slide,Ml)||n.interval)}return{mount:w,destroy:d.cancel,play:x,pause:O,isPaused:s}}function Wl(e,t,n){var i=Qe(e),o=i.on;function a(){n.cover&&(o(jo,Ye(d,!0)),o([sn,ht,rt],Ye(l,!0)))}function l(s){t.Slides.forEach(function(p){var u=ri(p.container||p.slide,"img");u&&u.src&&d(s,u,p)})}function d(s,p,u){u.style("background",s?'center/cover no-repeat url("'+p.src+'")':"",!0),Un(p,s?"none":"")}return{mount:a,destroy:Ye(l,!1)}}var Fl=10,Nl=600,Hl=.6,Ol=1.5,Bl=800;function Dl(e,t,n){var i=Qe(e),o=i.on,a=i.emit,l=e.state.set,d=t.Move,s=d.getPosition,p=d.getLimit,u=d.exceededLimit,L=d.translate,b=e.is(Rn),y,m,h=1;function C(){o(Zt,O),o([ht,rt],R)}function w(T,P,D,g,$){var A=s();if(O(),D&&(!b||!u())){var H=t.Layout.sliderSize(),K=bo(T)*H*Ai(Ct(T)/H)||0;T=d.toPosition(t.Controller.toDest(T%H))+K}var Q=ha(A,T,1);h=1,P=Q?0:P||Pi(Ct(T-A)/Ol,Bl),m=g,y=Oi(P,v,Ye(x,A,T,$),1),l(ti),a(Hi),y.start()}function v(){l(In),m&&m(),a(yn)}function x(T,P,D,g){var $=s(),A=T+(P-T)*B(g),H=(A-$)*h;L($+H),b&&!D&&u()&&(h*=Hl,Ct(H)<Fl&&w(p(u(!0)),Nl,!1,m,!0))}function O(){y&&y.cancel()}function R(){y&&!y.isPaused()&&(O(),v())}function B(T){var P=n.easingFunc;return P?P(T):1-Math.pow(1-T,4)}return{mount:C,destroy:O,scroll:w,cancel:R}}var wn={passive:!1,capture:!0};function jl(e,t,n){var i=Qe(e),o=i.on,a=i.emit,l=i.bind,d=i.unbind,s=e.state,p=t.Move,u=t.Scroll,L=t.Controller,b=t.Elements.track,y=t.Media.reduce,m=t.Direction,h=m.resolve,C=m.orient,w=p.getPosition,v=p.exceededLimit,x,O,R,B,T,P=!1,D,g,$;function A(){l(b,eo,yo,wn),l(b,to,yo,wn),l(b,za,K,wn),l(b,"click",_,{capture:!0}),l(b,"dragstart",Kt),o([sn,ht],H)}function H(){var q=n.drag;me(!q),B=q==="free"}function K(q){if(D=!1,!g){var ee=ye(q);ue(q.target)&&(ee||!q.button)&&(L.isBusy()?Kt(q,!0):($=ee?b:window,T=s.is([Wn,ti]),R=null,l($,eo,Q,wn),l($,to,k,wn),p.cancel(),u.cancel(),I(q)))}}function Q(q){if(s.is(Si)||(s.set(Si),a(Sa)),q.cancelable)if(T){p.translate(x+Ce(F(q)));var ee=J(q)>br,ae=P!==(P=v());(ee||ae)&&I(q),D=!0,a(Ca),Kt(q)}else j(q)&&(T=W(q),Kt(q))}function k(q){s.is(Si)&&(s.set(In),a(wa)),T&&(M(q),Kt(q)),d($,eo,Q),d($,to,k),T=!1}function _(q){!g&&D&&Kt(q,!0)}function I(q){R=O,O=q,x=w()}function M(q){var ee=U(q),ae=ie(ee),oe=n.rewind&&n.rewindByDrag;y(!1),B?L.scroll(ae,0,n.snap):e.is(li)?L.go(C(bo(ee))<0?oe?"<":"-":oe?">":"+"):e.is(Rn)&&P&&oe?L.go(v(!0)?">":"<"):L.go(L.toDest(ae),!0),y(!0)}function W(q){var ee=n.dragMinThreshold,ae=zn(ee),oe=ae&&ee.mouse||0,be=(ae?ee.touch:+ee)||10;return Ct(F(q))>(ye(q)?be:oe)}function j(q){return Ct(F(q))>Ct(F(q,!0))}function U(q){if(e.is(Nn)||!P){var ee=J(q);if(ee&&ee<br)return F(q)/ee}return 0}function ie(q){return w()+bo(q)*on(Ct(q)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function F(q,ee){return ne(q,ee)-ne(f(q),ee)}function J(q){return vo(q)-vo(f(q))}function f(q){return O===q&&R||O}function ne(q,ee){return(ye(q)?q.changedTouches[0]:q)["page"+h(ee?"Y":"X")]}function Ce(q){return q/(P&&e.is(Rn)?Sl:1)}function ue(q){var ee=n.noDrag;return!Vn(q,"."+Ha+", ."+Ki)&&(!ee||!Vn(q,ee))}function ye(q){return typeof TouchEvent<"u"&&q instanceof TouchEvent}function re(){return T}function me(q){g=q}return{mount:A,disable:me,isDragging:re}}var zl={Spacebar:" ",Right:ji,Left:Di,Up:Pa,Down:Aa};function Uo(e){return e=nn(e)?e:e.key,zl[e]||e}var xr="keydown";function Vl(e,t,n){var i=Qe(e),o=i.on,a=i.bind,l=i.unbind,d=e.root,s=t.Direction.resolve,p,u;function L(){b(),o(ht,y),o(ht,b),o(Zt,h)}function b(){var w=n.keyboard;w&&(p=w==="global"?window:d,a(p,xr,C))}function y(){l(p,xr)}function m(w){u=w}function h(){var w=u;u=!0,la(function(){u=w})}function C(w){if(!u){var v=Uo(w);v===s(Di)?e.go("<"):v===s(ji)&&e.go(">")}}return{mount:L,destroy:y,disable:m}}var Bn=Wo+"-lazy",$i=Bn+"-srcset",Kl="["+Bn+"], ["+$i+"]";function Gl(e,t,n){var i=Qe(e),o=i.on,a=i.off,l=i.bind,d=i.emit,s=n.lazyLoad==="sequential",p=[Fn,yn],u=[];function L(){n.lazyLoad&&(b(),o(rt,b))}function b(){Jt(u),y(),s?w():(a(p),o(p,m),m())}function y(){t.Slides.forEach(function(v){ko(v.slide,Kl).forEach(function(x){var O=Wt(x,Bn),R=Wt(x,$i);if(O!==x.src||R!==x.srcset){var B=n.classes.spinner,T=x.parentElement,P=ri(T,"."+B)||Ln("span",B,T);u.push([x,v,P]),x.src||Un(x,"none")}})})}function m(){u=u.filter(function(v){var x=n.perPage*((n.preloadPages||1)+1)-1;return v[1].isWithin(e.index,x)?h(v):!0}),u.length||a(p)}function h(v){var x=v[0];Bt(v[1].slide,wo),l(x,"load error",Ye(C,v)),Me(x,"src",Wt(x,Bn)),Me(x,"srcset",Wt(x,$i)),Dt(x,Bn),Dt(x,$i)}function C(v,x){var O=v[0],R=v[1];Ut(R.slide,wo),x.type!=="error"&&(hn(v[2]),Un(O,""),d(jo,O,R),d(_n)),s&&w()}function w(){u.length&&h(u.shift())}return{mount:L,destroy:Ye(Jt,u),check:m}}function Ul(e,t,n){var i=Qe(e),o=i.on,a=i.emit,l=i.bind,d=t.Slides,s=t.Elements,p=t.Controller,u=p.hasFocus,L=p.getIndex,b=p.go,y=t.Direction.resolve,m=s.pagination,h=[],C,w;function v(){x(),o([ht,rt,Mi],v);var g=n.pagination;m&&Un(m,g?"":"none"),g&&(o([Zt,Hi,yn],D),O(),D(),a(La,{list:C,items:h},P(e.index)))}function x(){C&&(hn(m?an(C.children):C),Ut(C,w),Jt(h),C=null),i.destroy()}function O(){var g=e.length,$=n.classes,A=n.i18n,H=n.perPage,K=u()?p.getEnd()+1:qn(g/H);C=m||Ln("ul",$.pagination,s.track.parentElement),Bt(C,w=Gi+"--"+T()),Me(C,qt,"tablist"),Me(C,Pt,A.select),Me(C,Vo,T()===zi?"vertical":"");for(var Q=0;Q<K;Q++){var k=Ln("li",null,C),_=Ln("button",{class:$.page,type:"button"},k),I=d.getIn(Q).map(function(W){return W.slide.id}),M=!u()&&H>1?A.pageX:A.slideX;l(_,"click",Ye(R,Q)),n.paginationKeyboard&&l(_,"keydown",Ye(B,Q)),Me(k,qt,"presentation"),Me(_,qt,"tab"),Me(_,si,I.join(" ")),Me(_,Pt,xo(M,Q+1)),Me(_,En,-1),h.push({li:k,button:_,page:Q})}}function R(g){b(">"+g,!0)}function B(g,$){var A=h.length,H=Uo($),K=T(),Q=-1;H===y(ji,!1,K)?Q=++g%A:H===y(Di,!1,K)?Q=(--g+A)%A:H==="Home"?Q=0:H==="End"&&(Q=A-1);var k=h[Q];k&&(pa(k.button),b(">"+Q),Kt($,!0))}function T(){return n.paginationDirection||n.direction}function P(g){return h[p.toPage(g)]}function D(){var g=P(L(!0)),$=P(L());if(g){var A=g.button;Ut(A,fn),Dt(A,gr),Me(A,En,-1)}if($){var H=$.button;Bt(H,fn),Me(H,gr,!0),Me(H,En,"")}a(Ea,{list:C,items:h},g,$)}return{items:h,mount:v,destroy:x,getAt:P,update:D}}var ql=[" ","Enter"];function Xl(e,t,n){var i=n.isNavigation,o=n.slideFocus,a=[];function l(){e.splides.forEach(function(m){m.isParent||(p(e,m.splide),p(m.splide,e))}),i&&u()}function d(){a.forEach(function(m){m.destroy()}),Jt(a)}function s(){d(),l()}function p(m,h){var C=Qe(m);C.on(Zt,function(w,v,x){h.go(h.is(Nn)?x:w)}),a.push(C)}function u(){var m=Qe(e),h=m.on;h(No,b),h(_a,y),h([sn,ht],L),a.push(m),m.emit(Oo,e.splides)}function L(){Me(t.Elements.list,Vo,n.direction===zi?"vertical":"")}function b(m){e.go(m.index)}function y(m,h){Ao(ql,Uo(h))&&(b(m),Kt(h))}return{setup:Ye(t.Media.set,{slideFocus:ni(o)?i:o},!0),mount:l,destroy:d,remount:s}}function Yl(e,t,n){var i=Qe(e),o=i.bind,a=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,wn)}function d(p){if(p.cancelable){var u=p.deltaY,L=u<0,b=vo(p),y=n.wheelMinThreshold||0,m=n.wheelSleep||0;Ct(u)>y&&b-a>m&&(e.go(L?"<":">"),a=b),s(L)&&Kt(p)}}function s(p){return!n.releaseWheel||e.state.is(Wn)||t.Controller.getAdjacent(p)!==-1}return{mount:l}}var Jl=90;function Zl(e,t,n){var i=Qe(e),o=i.on,a=t.Elements.track,l=n.live&&!n.isNavigation,d=Ln("span",fl),s=Oi(Jl,Ye(u,!1));function p(){l&&(b(!t.Autoplay.isPaused()),Me(a,yr,!0),d.textContent="…",o(Bo,Ye(b,!0)),o(Do,Ye(b,!1)),o([Fn,yn],Ye(u,!0)))}function u(y){Me(a,fr,y),y?(oi(a,d),s.start()):(hn(d),s.cancel())}function L(){Dt(a,[hr,yr,fr]),hn(d)}function b(y){l&&Me(a,hr,y?"off":"polite")}return{mount:p,disable:b,destroy:L}}var Ql=Object.freeze({__proto__:null,Media:sl,Direction:ll,Elements:Cl,Slides:$l,Layout:Tl,Clones:El,Move:Il,Controller:_l,Arrows:Al,Autoplay:kl,Cover:Wl,Scroll:Dl,Drag:jl,Keyboard:Vl,LazyLoad:Gl,Pagination:Ul,Sync:Xl,Wheel:Yl,Live:Zl}),ec={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"},tc={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:bl,i18n:ec,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function nc(e,t,n){var i=t.Slides;function o(){Qe(e).on([sn,rt],a)}function a(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,s){i.style("transition","opacity "+n.speed+"ms "+n.easing),la(s)}return{mount:o,start:l,cancel:yo}}function ic(e,t,n){var i=t.Move,o=t.Controller,a=t.Scroll,l=t.Elements.list,d=Ye(kt,l,"transition"),s;function p(){Qe(e).bind(l,"transitionend",function(y){y.target===l&&s&&(L(),s())})}function u(y,m){var h=i.toPosition(y,!0),C=i.getPosition(),w=b(y);Ct(h-C)>=1&&w>=1?n.useScroll?a.scroll(h,w,!1,m):(d("transform "+w+"ms "+n.easing),i.translate(h,!0),s=m):(i.jump(y),m())}function L(){d(""),a.cancel()}function b(y){var m=n.rewindSpeed;if(e.is(Rn)&&m){var h=o.getIndex(!0),C=o.getEnd();if(h===0&&y>=C||h>=C&&y===0)return m}return n.speed}return{mount:p,start:u,cancel:L}}var oc=(function(){function e(n,i){this.event=Qe(),this.Components={},this.state=rl(Tn),this.splides=[],this._o={},this._E={};var o=nn(n)?ga(document,n):n;On(o,o+" is invalid."),this.root=o,i=tn({label:Wt(o,Pt)||"",labelledby:Wt(o,zo)||""},tc,e.defaults,i||{});try{tn(i,JSON.parse(Wt(o,Wo)))}catch{On(!1,"Invalid JSON")}this._o=Object.create(tn({},i))}var t=e.prototype;return t.mount=function(i,o){var a=this,l=this.state,d=this.Components;On(l.is([Tn,Ri]),"Already mounted!"),l.set(Tn),this._C=d,this._T=o||this._T||(this.is(li)?nc:ic),this._E=i||this._E;var s=Gn({},Ql,this._E,{Transition:this._T});return gn(s,function(p,u){var L=p(a,d,a._o);d[u]=L,L.setup&&L.setup()}),gn(d,function(p){p.mount&&p.mount()}),this.emit(sn),Bt(this.root,yl),l.set(In),this.emit(So),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(an(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(rt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,a=this.state;return a.is(Tn)?Qe(this).on(So,this.destroy.bind(this,i)):(gn(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Ho),o.destroy(),i&&Jt(this.splides),a.set(Ri)),this},el(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})(),qo=oc;qo.defaults={};qo.STATES=nl;var Sr=[[sn,"onMounted"],[So,"onReady"],[Zt,"onMove"],[Fn,"onMoved"],[No,"onClick"],[ya,"onActive"],[va,"onInactive"],[ba,"onVisible"],[xa,"onHidden"],[rt,"onRefresh"],[ht,"onUpdated"],[_n,"onResize"],[Ni,"onResized"],[Sa,"onDrag"],[Ca,"onDragging"],[wa,"onDragged"],[Hi,"onScroll"],[yn,"onScrolled"],[Ho,"onDestroy"],[$a,"onArrowsMounted"],[Ta,"onArrowsUpdated"],[La,"onPaginationMounted"],[Ea,"onPaginationUpdated"],[Oo,"onNavigationMounted"],[Bo,"onAutoplayPlay"],[Ia,"onAutoplayPlaying"],[Do,"onAutoplayPause"],[jo,"onLazyLoadLoaded"]];function Xo(...e){return e.filter(Boolean).join(" ")}function ki(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(ki(e)&&ki(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 rc(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function ac(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 To(e,t){const n=e;return ac(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():ki(i)?n[o]=To(ki(n[o])?n[o]:{},i):n[o]=i}),n}var sc=({children:e,className:t,...n})=>c.createElement("div",{className:Xo("splide__track",t),...n},c.createElement("ul",{className:"splide__list"},e)),Yo=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 qo(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=To({},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=To({},e));const t=this.getSlides();rc(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){Sr.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:Xo("splide",e),ref:this.splideRef,...this.omit(o,["options",...Sr.map(a=>a[1])])},n?c.createElement(sc,null,i):i)}},Jo=({children:e,className:t,...n})=>c.createElement("li",{className:Xo("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 lc="RichTextRenderer-module__link___BWeZ2",cc={link:lc},dc=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))},Ui=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>dc(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function Ht(e){const{color:t,...n}=e;return n}function pt(e,t){var o,a,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Ui(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:(a=e.textAppearance)==null?void 0:a.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:cc.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:uc(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 uc(e){return{...e.fontFamily&&{fontFamily:Ui(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 pc="SvgImage-module__svg___q3xE-",mc="SvgImage-module__img___VsTm-",Cr={svg:pc,img:mc},gc=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},hc=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Ot=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[a,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)}},[]),!gc(e)||!a?r.jsx("img",{src:e,alt:"",className:De(Cr.img,i),style:o}):r.jsx("span",{"data-supports-mask":a,className:De(Cr.svg,i),style:{"--svg":hc(e),"--fill":t,"--hover-fill":n,...o??{}}})},fc={"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 yc({settings:e,content:t,styles:n,isEditor:i}){const[o,a]=c.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:s,textAlign:p,wordSpacing:u,fontSizeLineHeight:L,textAppearance:b,color:y}=n.imageCaption??{},[m,h]=c.useState(void 0),[C,w]=c.useState(null),[v,x]=c.useState(0),[O,R]=c.useState(0),{direction:B,transition:T,controls:P,pagination:D,imageCaption:g,triggers:$}=e,A=c.useRef(T.type),{x:H,y:K}=e.controls.offset,Q=k=>{o&&o.go(k)};return c.useEffect(()=>{if(!C)return;const k=new ResizeObserver(_=>{if(!o)return;const[I]=_;h({width:Math.round(I.contentRect.width),height:Math.round(I.contentRect.height)})});return k.observe(C),()=>k.unobserve(C)},[C]),c.useEffect(()=>{!o||A.current===T.type||(R(k=>k+1),A.current=T.type)},[T.type]),r.jsx("div",{className:De(ve.wrapper,{[ve.editor]:i}),ref:w,children:r.jsxs("div",{className:ve.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:T.backgroundColor&&T.type==="fade in"?T.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:De(ve.captionBlock),children:r.jsx("div",{className:ve.captionTextWrapper,children:t.map((k,_)=>r.jsx("div",{className:De(ve.captionText,fc[g.alignment],{[ve.withPointerEvents]:_===v&&i,[ve.active]:_===v}),style:{fontFamily:Ui(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":E.scalingValue(l.width,i),letterSpacing:E.scalingValue(s,i),wordSpacing:E.scalingValue(u,i),textAlign:p,fontSize:E.scalingValue(L.fontSize,i),lineHeight:E.scalingValue(L.lineHeight,i),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:y,transitionDuration:T.duration?`${Math.round(parseInt(T.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:ve.captionTextInner,style:{"--link-hover-color":g.linkHoverColor,"--link-color":g.linkColor,position:"relative",top:E.scalingValue(g.offset.y,i),left:E.scalingValue(g.offset.x,i)},children:r.jsx(Yn,{content:k.imageCaption})})},_))})}),r.jsx(Yo,{onMove:k=>{x(k.index)},ref:a,options:{arrows:!1,speed:T.duration?parseInt(T.duration):500,autoplay:$.autoPlay!==null,...$.autoPlay!==null&&{interval:parseInt($.autoPlay)*1e3},direction:B==="horiz"||T.type==="fade in"?"ltr":"ttb",pagination:!1,drag:$.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:T.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((k,_)=>r.jsx(Jo,{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??""})})})},_))},O),P.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De(ve.arrow,{[ve.arrowVertical]:B==="vert",[ve.hoverArrow]:P.show==="on hover"}),style:{color:P.color,"--arrow-hover-color":P.hover},children:r.jsxs("button",{onClick:()=>{Q("-1")},className:ve.arrowInner,style:{transform:`translate(${E.scalingValue(H,i)}, ${E.scalingValue(K*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[P.arrowsImgUrl&&r.jsx(Ot,{url:P.arrowsImgUrl,fill:P.color,hoverFill:P.hover,className:De(ve.arrowImg,ve.mirror)}),!P.arrowsImgUrl&&r.jsx(wr,{color:P.color,className:De(ve.arrowIcon,ve.arrowImg,ve.mirror)})]})}),r.jsx("div",{className:De(ve.arrow,ve.nextArrow,{[ve.arrowVertical]:B==="vert",[ve.hoverArrow]:P.show==="on hover"}),style:{color:P.color,"--arrow-hover-color":P.hover},children:r.jsxs("button",{className:ve.arrowInner,onClick:()=>Q("+1"),style:{transform:`translate(${E.scalingValue(H*(B==="horiz"?-1:1),i)}, ${E.scalingValue(K,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[P.arrowsImgUrl&&r.jsx(Ot,{url:P.arrowsImgUrl,fill:P.color,hoverFill:P.hover,className:ve.arrowImg}),!P.arrowsImgUrl&&r.jsx(wr,{color:P.color,className:De(ve.arrowIcon,ve.arrowImg)})]})})]}),$.triggersList.click&&r.jsx("div",{className:ve.clickOverlay,onClick:()=>{o&&o.go("+1")}}),D.isActive&&r.jsx("div",{className:De(ve.pagination,{[ve.paginationInsideBottom]:D.position==="inside-1"&&B==="horiz",[ve.paginationInsideTop]:D.position==="inside-2"&&B==="horiz",[ve.paginationOutsideBottom]:D.position==="outside-1"&&B==="horiz",[ve.paginationOutsideTop]:D.position==="outside-2"&&B==="horiz",[ve.paginationInsideLeft]:D.position==="inside-1"&&B==="vert",[ve.paginationInsideRight]:D.position==="inside-2"&&B==="vert",[ve.paginationOutsideLeft]:D.position==="outside-1"&&B==="vert",[ve.paginationOutsideRight]:D.position==="outside-2"&&B==="vert",[ve.paginationVertical]:B==="vert"}),children:r.jsx("div",{className:ve.paginationInner,style:{backgroundColor:D.colors[2],transform:`scale(${D.scale/100}) translate(${E.scalingValue(D.offset.x,i)}, ${E.scalingValue(D.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((k,_)=>r.jsx("button",{onClick:()=>{o&&o.go(_)},className:De(ve.paginationItem),children:r.jsx("div",{className:De(ve.dot,{[ve.activeDot]:_===v}),style:{backgroundColor:_===v?D.colors[0]:D.colors[1],"--pagination-hover-color":D.hover}})},_))})})]})})}function wr({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 vc={element:yc,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"]}},bc="ImageRevealSlider-module__imageRevealSlider___UE5Ob",xc="ImageRevealSlider-module__image___Qjt-e",Sc="ImageRevealSlider-module__link___N-iLG",Cc="ImageRevealSlider-module__cursor___2U03d",Sn={imageRevealSlider:bc,image:xc,link:Sc,cursor:Cc};function $r(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const a=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*a,d=a/2,s=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-s&&t<=i.y+s)return!0}return!1}function no(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function wc(e,t,n,i){let o,a;if(t==="custom"){o=n;const l=await no(e);a=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await no(e);a=l.height/l.width*o}else{const l=await no(e);o=l.width,a=l.height}return{width:o,height:a,finalWidth:`${o}px`}}function $c({settings:e,content:t,isEditor:n}){const[i,o]=c.useState(null),[a,l]=c.useState([]),[d,s]=c.useState(0),p=c.useRef(0),[u,L]=c.useState({x:0,y:0}),[b,y]=c.useState(1),[m,h]=c.useState("none"),C=c.useRef({x:0,y:0}),[w,v]=c.useState(!1),{sizeType:x,imageWidth:O,randomRangeImageWidth:R}=e.imageSize,{revealPosition:B,visible:T}=e.position,{cursorType:P,target:D,defaultCursorScale:g,defaultCursor:$,hoverCursorScale:A,hoverCursor:H}=e.cursor;c.useEffect(()=>{if(!i)return;const k=(M,W)=>{const j=i.getBoundingClientRect(),U=M-j.left,ie=W-j.top;if(L({x:U,y:ie}),P==="system"){h("none"),y(1);return}const F=U,J=ie,f=document.elementFromPoint(j.left+F,j.top+J);if(f&&f.closest("a")){h("none"),y(1);return}const ne=$r(F,J,a)||D==="area"?{img:H??"none",scale:A}:{img:$??"none",scale:g};h(ne.img),y(ne.scale)},_=M=>{M.stopPropagation(),C.current={x:M.clientX,y:M.clientY},k(M.clientX,M.clientY)},I=()=>{w&&k(C.current.x,C.current.y)};return i.addEventListener("mousemove",_),window.addEventListener("scroll",I,!0),()=>{i.removeEventListener("mousemove",_),window.removeEventListener("scroll",I,!0)}},[i,w,u,P,D,H,$,A,g,a]),c.useEffect(()=>{w||(h("none"),y(0))},[w]);const K=async(k,_,I,M={})=>{const{width:W,height:j,finalWidth:U}=await wc(k.image.url,x,O,R);let ie=0,F=0;B==="same"?(ie=_/2,F=I/2):(ie=M.x??Math.random()*_,F=M.y??Math.random()*I);const J=Math.min(Math.max(ie,W/2),_-W/2),f=Math.min(Math.max(F,j/2),I-j/2);return{id:p.current++,url:k.image.url,link:k.link,name:k.image.name,x:J,y:f,width:U}};c.useEffect(()=>{if(!i||t.length===0)return;const k=i.getBoundingClientRect(),_=k.width,I=k.height,M=[];(async()=>{const j=t[0],U=await K(j,_,I);M.push(U),l(M),s(1)})()},[x,O,R,B,i]),c.useEffect(()=>{T==="last One"&&l(k=>k.length>0?[k[k.length-1]]:[])},[T]);const Q=async k=>{if(!i)return;const _=i.getBoundingClientRect(),I=k.clientX-_.left,M=k.clientY-_.top;if(D==="image"&&!$r(I,M,a))return;let W=0,j=0;B==="on Click"?(W=I,j=M):B==="same"?(W=_.width/2,j=_.height/2):(W=Math.random()*_.width,j=Math.random()*_.height);const U=t[d],ie=await K(U,_.width,_.height,{x:W,y:j});l(F=>T==="all"?[...F,ie]:[ie]),s(F=>F>=t.length-1?0:F+1)};return r.jsxs("div",{ref:o,onClick:Q,onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),className:Sn.imageRevealSlider,style:{cursor:m==="none"?"default":"none"},children:[a.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:m==="none"?"default":"none"},children:D==="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)),w&&r.jsx("div",{className:Sn.cursor,style:{left:`${u.x}px`,top:`${u.y}px`,transform:`translate(-50%, -50%) scale(${b})`,backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Tc={element:$c,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:""}]}}}},Lc="LightBox-module__hidden___9s-9x",Ec="LightBox-module__heroImage___sTxNF",Ic="LightBox-module__background___rm9ml",_c="LightBox-module__editor___4ACaY",Rc="LightBox-module__contentStyle___Bgnsq",Pc="LightBox-module__imageStyle___tLIlB",Ac="LightBox-module__imgWrapper___LuFUp",Mc="LightBox-module__contain___8-yaS",kc="LightBox-module__cover___hNvOG",Wc="LightBox-module__caption___b6L2I",Fc="LightBox-module__captionTextInner___rCGNH",Nc="LightBox-module__lightboxSplide___XFuWC",Hc="LightBox-module__arrow___iz38X",Oc="LightBox-module__arrowVertical___Zfz81",Bc="LightBox-module__nextArrow___zkAQN",Dc="LightBox-module__arrowInner___p48sW",jc="LightBox-module__arrowIcon___3VaFf",zc="LightBox-module__arrowImg___pNV88",Vc="LightBox-module__mirror___pjeXc",Kc="LightBox-module__thumbsWrapper___GB-nU",Gc="LightBox-module__thumbsContainerVertical___wttk5",Uc="LightBox-module__thumbsContainer___osSma",qc="LightBox-module__thumbsAlignStart___MO6tY",Xc="LightBox-module__thumbsAlignCenter___Q4sUx",Yc="LightBox-module__thumbsAlignEnd___p4y9R",Jc="LightBox-module__thumbItem___HvnF3",Zc="LightBox-module__closeButton___g2khP",Qc="LightBox-module__fadeIn___0m5GW",ed="LightBox-module__slideInLeft___gPYwC",td="LightBox-module__slideInRight___S-pPp",nd="LightBox-module__slideInTop___DFdAj",id="LightBox-module__slideInBottom___m27kZ",od="LightBox-module__fadeOut___55qBR",rd="LightBox-module__slideOutLeft___NvU7P",ad="LightBox-module__slideOutRight___SK7eC",sd="LightBox-module__slideOutTop___Vgg0z",ld="LightBox-module__slideOutBottom___nJ0Ef",cd="LightBox-module__scaleSlide___vZriG",le={hidden:Lc,heroImage:Ec,background:Ic,editor:_c,contentStyle:Rc,imageStyle:Pc,imgWrapper:Ac,contain:Mc,cover:kc,caption:Wc,captionTextInner:Fc,lightboxSplide:Nc,arrow:Hc,arrowVertical:Oc,nextArrow:Bc,arrowInner:Dc,arrowIcon:jc,arrowImg:zc,mirror:Vc,thumbsWrapper:Kc,thumbsContainerVertical:Gc,thumbsContainer:Uc,thumbsAlignStart:qc,thumbsAlignCenter:Xc,thumbsAlignEnd:Yc,thumbItem:Jc,closeButton:Zc,fadeIn:Qc,slideInLeft:ed,slideInRight:td,slideInTop:nd,slideInBottom:id,fadeOut:od,slideOutLeft:rd,slideOutRight:ad,slideOutTop:sd,slideOutBottom:ld,scaleSlide:cd},mi=(e,t,n)=>{const i={},[o,a]=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"),a==="left"?(i.left="0",i.right="auto"):a==="center"?(i.left="50%",i.right="auto"):a==="right"&&(i.left="auto",i.right="0"),o==="middle"&&a==="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)}))`:a==="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 Va(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 Tr(e){const t=e.getBoundingClientRect(),n=Va(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),a=e.naturalWidth,l=e.naturalHeight,d=i/o,s=a/l;let p,u;s>d?(p=i,u=i/s):(u=o,p=o*s);const L=t.left+n.left,b=t.top+n.top,y=(i-p)/2+L,m=(o-u)/2+b;return{x:y,y:m,width:p,height:u}}function Lr(e){const t=e.getBoundingClientRect(),n=Va(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Er(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 dd(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})(),a=(()=>{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:a}}const ud=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:a,isPreviewMode:l})=>{const[d,s]=c.useState(!1),{url:p}=e.thumbnailBlock.cover;return c.useEffect(()=>{o==="close"&&s(!1),o==="open"&&s(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:p,alt:"Cover",className:le.heroImage,onClick:()=>s(!0)}),r.jsx(pd,{isOpen:d,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:a})]})},pd=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:a,isEditor:l,metadata:d})=>{var Le;const{widthSettings:s,fontSettings:p,letterSpacing:u,textAlign:L,wordSpacing:b,fontSizeLineHeight:y,textAppearance:m,color:h}=i.imageCaption??{},[C,w]=c.useState(0),[v,x]=c.useState(0),[O,R]=c.useState(!1),[B,T]=c.useState(!1),[P,D]=c.useState({}),g=c.useRef(null),$=c.useRef(null),A=c.useRef(null),H=c.useRef(!1),K=c.useRef(null),Q=c.useRef(null),k=c.useRef(null),_=c.useRef(null),I=c.useRef(!1),M=c.useRef(null),[W,j]=c.useState(!1),{appear:U,triggers:ie,slider:F,thumbnail:J,controls:f,area:ne,caption:Ce,layout:ue}=o.lightboxBlock,{appearClass:ye,backdropAppearClass:re,backdropDisappearClass:me,disappearClass:q}=dd(U.type,U.direction),ee=(d==null?void 0:d.itemId)??null;c.useEffect(()=>{const z=()=>{setTimeout(()=>{var N,X;(X=(N=g.current)==null?void 0:N.splide)==null||X.refresh()},16)},de=()=>{x(N=>N+1)};return window.addEventListener("ArticleEditor.Layout:change",z),window.addEventListener("ArticleEditor.ComponentContent:change",de),()=>{window.removeEventListener("ArticleEditor.Layout:change",z),window.removeEventListener("ArticleEditor.ComponentContent:change",de)}},[]),c.useEffect(()=>{if(!e||!J.isActive){j(!1);return}const z=M.current;if(!z)return;const de=()=>{F.direction==="horiz"?j(z.scrollWidth>z.clientWidth):j(z.scrollHeight>z.clientHeight)};de();const N=new ResizeObserver(de);return N.observe(z),()=>N.disconnect()},[e,J.isActive,n.length,P,F.direction]);const ae=c.useCallback(()=>{const z=window.matchMedia("(max-width: 768px)").matches,de=Er(ne.color);z&&!l&&de>.9&&(document.body.style.backgroundColor=""),R(!0),H.current=!0;const N=X=>{X.target===K.current&&X.animationName&&(K.current&&Q.current&&K.current.removeEventListener("animationend",Q.current),Q.current=null,H.current&&(H.current=!1,t()),R(!1))};K.current&&(Q.current=N,K.current.addEventListener("animationend",N))},[t,ne.color,l]),oe=(z,de,N)=>{var X,Y;if(z){if(ie.type==="click"&&ie.switch==="image")ie.repeat==="close"&&C===n.length-1?ae():(X=g.current)==null||X.go("+1");else if(ie.type==="click"&&ie.switch==="50/50"){const te=z.getBoundingClientRect(),ce=de-te.left,he=N-te.top,Fe=te.width,$e=te.height;let we;F.direction==="horiz"?we=ce<Fe/2?"-1":"+1":we=he<$e/2?"-1":"+1",(Y=g.current)==null||Y.go(we)}}},be=z=>{if(I.current){I.current=!1;return}const de=n[C],N=(de==null?void 0:de.image.objectFit)==="cover";let X,Y;if("changedTouches"in z&&z.changedTouches.length>0)X=z.changedTouches[0].clientX,Y=z.changedTouches[0].clientY;else if("clientX"in z)X=z.clientX,Y=z.clientY;else return;let te;if(N&&A.current){const ce=Lr(A.current);te=X>=ce.left&&X<=ce.right&&Y>=ce.top&&Y<=ce.bottom}else{const ce=A.current?Tr(A.current):null;if(!ce){z.target===z.currentTarget&&ae();return}te=X>=ce.x&&X<=ce.x+ce.width&&Y>=ce.y&&Y<=ce.y+ce.height}te?oe(A.current,X,Y):ae()},Re=z=>{const de=z.target;(de.classList.contains(le.thumbsWrapper)||de.classList.contains(le.thumbsContainer))&&be(z)};c.useEffect(()=>{if(!e)return;const z=de=>{var N,X;if(de.key==="Escape"){ae();return}if(de.key==="ArrowRight"){w(Y=>(Y+1)%Math.max(n.length,1)),(N=g.current)==null||N.go("+1");return}de.key==="ArrowLeft"&&(w(Y=>(Y-1+Math.max(n.length,1))%Math.max(n.length,1)),(X=g.current)==null||X.go("-1"))};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[e,ae,n.length]),c.useEffect(()=>{if(e){if(w(0),x(de=>de+1),H.current=!1,R(!1),T(!1),D({}),!ee)return;const z=new CustomEvent("page-overlay",{detail:{itemId:ee}});window.dispatchEvent(z)}return()=>{K.current&&Q.current&&(K.current.removeEventListener("animationend",Q.current),Q.current=null),T(!1)}},[e,ee]),c.useEffect(()=>{$.current!==null&&$.current!==F.type&&x(z=>z+1),$.current=F.type},[F.type]),c.useEffect(()=>{if(!e)return;const z=document.body.style.overflow,de=window.matchMedia("(max-width: 768px)").matches,N=Er(ne.color);document.body.style.overflow="hidden",T(!1);const X=te=>{te.target===K.current&&!H.current&&te.animationName&&(de&&!l&&N>.9&&(document.body.style.backgroundColor=ne.color),T(!0),K.current&&k.current&&K.current.removeEventListener("animationend",k.current),k.current=null)};K.current&&(k.current=X,K.current.addEventListener("animationend",X));const Y=te=>{const ce=te.target;ce&&(ce.closest(`.${le.thumbsWrapper}`)||ce.closest(`.${le.thumbsContainer}`))||F.type!=="slide"&&te.preventDefault()};return document.addEventListener("touchmove",Y,{passive:!1}),()=>{document.body.style.overflow=z,document.removeEventListener("touchmove",Y),K.current&&k.current&&(K.current.removeEventListener("animationend",k.current),k.current=null),T(!1)}},[e,l,ne.color,F.type]),c.useEffect(()=>{if(!e)return;const z=de=>{var X,Y;if(H.current){de.stopPropagation();return}if(I.current){I.current=!1;return}const N=de.target;if(!(N&&(N.closest(`.${le.thumbsContainer}`)||N.closest(`.${le.thumbItem}`)||N.closest(`.${le.arrow}`)||N.closest(`.${le.closeButton}`)||N.closest(`.${le.caption}`)))){if(F.type==="slide"&&ie.type==="drag"&&((Y=(X=g.current)==null?void 0:X.splide)!=null&&Y.root)){const te=g.current.splide.root;if(N&&(te.contains(N)||te===N))return}if(de.touches.length===0&&de.changedTouches.length>0){const te=n[C],ce=(te==null?void 0:te.image.objectFit)==="cover",he=de.changedTouches[0];let Fe;if(ce&&A.current){const $e=Lr(A.current);Fe=he.clientX>=$e.left&&he.clientX<=$e.right&&he.clientY>=$e.top&&he.clientY<=$e.bottom}else{const $e=A.current?Tr(A.current):null;if(!$e)return;Fe=he.clientX>=$e.x&&he.clientX<=$e.x+$e.width&&he.clientY>=$e.y&&he.clientY<=$e.y+$e.height}if(!Fe){de.stopPropagation(),H.current=!0;const $e=we=>{we.stopPropagation(),we.preventDefault(),document.removeEventListener("click",$e,!0)};document.addEventListener("click",$e,!0),ae()}}}};return document.addEventListener("touchend",z,{passive:!0}),()=>{document.removeEventListener("touchend",z)}},[e,ae,C,n]);const xe=(F.type==="scale"||F.type==="fade")&&F.direction==="vert"&&ie.type==="drag";c.useEffect(()=>{var we,Ne;if(!e||!xe||!((Ne=(we=g.current)==null?void 0:we.splide)!=null&&Ne.root))return;const z=g.current.splide.root,de=30,N=(se,Ie)=>{if(_.current){const Ae=Math.abs(se-_.current.x),We=Math.abs(Ie-_.current.y);(Ae>0||We>0)&&(I.current=!0)}},X=se=>{_.current&&(se.preventDefault(),N(se.clientX,se.clientY))},Y=se=>{_.current&&se.touches.length>0&&(se.preventDefault(),N(se.touches[0].clientX,se.touches[0].clientY))},te=(se,Ie)=>{if(!_.current||!g.current){_.current=null;return}const Ae=Math.abs(se-_.current.x),We=Math.abs(Ie-_.current.y);We>de&&We>Ae&&g.current.go(Ie<_.current.y?"+1":"-1"),_.current=null},ce=se=>{_.current&&te(se.clientX,se.clientY),document.removeEventListener("pointerup",ce),document.removeEventListener("pointercancel",ce),document.removeEventListener("pointermove",X)},he=se=>{if(_.current){if(se.changedTouches.length>0){const Ie=se.changedTouches[0];te(Ie.clientX,Ie.clientY)}document.removeEventListener("touchend",he),document.removeEventListener("touchcancel",he),document.removeEventListener("touchmove",Y)}},Fe=se=>{_.current={x:se.clientX,y:se.clientY},I.current=!1,document.addEventListener("pointermove",X,{passive:!1}),document.addEventListener("pointerup",ce),document.addEventListener("pointercancel",ce)},$e=se=>{se.touches.length>0&&(_.current={x:se.touches[0].clientX,y:se.touches[0].clientY},I.current=!1,document.addEventListener("touchmove",Y,{passive:!1}),document.addEventListener("touchend",he),document.addEventListener("touchcancel",he))};return z.addEventListener("pointerdown",Fe),z.addEventListener("touchstart",$e),()=>{z.removeEventListener("pointerdown",Fe),z.removeEventListener("touchstart",$e),document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",ce),document.removeEventListener("pointercancel",ce),document.removeEventListener("touchmove",Y),document.removeEventListener("touchend",he),document.removeEventListener("touchcancel",he),_.current=null,I.current=!1}},[e,xe,v]);const Pe={backgroundColor:ne.color,backdropFilter:`blur(${ne.blur}px)`,animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(a)?null:ei.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:l?null:K,className:De(le.background,O?me:re,{[le.editor]:l},{[le.hidden]:!e}),style:{...Pe,...B&&!l&&!O?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?K:null,className:De(le.contentStyle,O?q:ye,{[le.editor]:l},{[le.hidden]:!e}),style:{animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Yo,{onMove:z=>w(z.index),ref:g,className:le.lightboxSplide,options:{arrows:!1,speed:F.duration?parseInt(F.duration):500,direction:F.direction==="horiz"||F.type==="fade"||F.type==="scale"?"ltr":"ttb",pagination:!1,drag:ie.type==="drag"&&!xe,perPage:1,width:"100%",height:"100%",type:F.type==="fade"||F.type==="scale"?"fade":"loop",padding:0,rewind:ie.repeat!=="close",start:0},style:{"--splide-speed":F.duration},children:n.map((z,de)=>{const N=mi(ue.position,ue.offset,l),X=`${E.scalingValue(ue.padding.top,l)} ${E.scalingValue(ue.padding.right,l)} ${E.scalingValue(ue.padding.bottom,l)} ${E.scalingValue(ue.padding.left,l)}`,Y=F.type==="scale"?(()=>{const{transform:te,...ce}=N;return{...ce,position:"absolute",padding:X,boxSizing:"border-box","--position-transform":te||"none"}})():{...N,position:"absolute",padding:X,boxSizing:"border-box"};return r.jsx(Jo,{children:r.jsx("div",{className:le.imgWrapper,onClick:be,children:r.jsx("img",{ref:de===C?A:null,className:De(le.imageStyle,{[le.contain]:z.image.objectFit==="contain",[le.cover]:z.image.objectFit==="cover",[le.scaleSlide]:F.type==="scale"}),src:z.image.url,alt:z.image.name??"",style:{...Y,pointerEvents:z.image.objectFit==="contain"?"none":"auto"}})})},de)})},v),f.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:De(le.arrow,{[le.arrowVertical]:F.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*(F.direction==="horiz"?1:-1),l)}) scale(${f.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=g.current)==null?void 0:z.go("-1")},"aria-label":"Previous",children:[f.arrowsImgUrl&&r.jsx(Ot,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:De(le.arrowImg,le.mirror)}),!f.arrowsImgUrl&&r.jsx(Ir,{color:f.color,className:De(le.arrowIcon,le.arrowImg,le.mirror)})]})}),r.jsx("div",{className:De(le.arrow,le.nextArrow,{[le.arrowVertical]:F.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*(F.direction==="horiz"?-1:1),l)}, ${E.scalingValue(f.offset.y,l)}) scale(${f.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=g.current)==null?void 0:z.go("+1")},"aria-label":"Next",children:[f.arrowsImgUrl&&r.jsx(Ot,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:le.arrowImg}),!f.arrowsImgUrl&&r.jsx(Ir,{color:f.color,className:De(le.arrowIcon,le.arrowImg)})]})})]}),ne.closeIconUrl&&(()=>{const z=mi(ne.closeIconAlign,ne.closeIconOffset,l),de=`scale(${ne.closeIconScale})`,N=z.transform?`${z.transform} ${de}`:de;return r.jsx("button",{className:le.closeButton,style:{...z,transform:N},onClick:ae,"aria-label":"Close lightbox",children:r.jsx(Ot,{url:ne.closeIconUrl,fill:ne.closeIconColor??"#000000",hoverFill:ne.closeIconHover??"#cccccc"})})})(),Ce&&Ce.isActive&&i.imageCaption&&((Le=n[C])==null?void 0:Le.imageCaption)&&r.jsx("div",{className:le.caption,style:{...mi(Ce.alignment,Ce.offset,l),fontFamily:Ui(p.fontFamily),fontWeight:p.fontWeight,fontStyle:p.fontStyle,width:s.sizing==="auto"?"max-content":E.scalingValue(s.width,l),letterSpacing:E.scalingValue(u,l),wordSpacing:E.scalingValue(b,l),textAlign:L,fontSize:E.scalingValue(y.fontSize,l),lineHeight:E.scalingValue(y.lineHeight,l),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:h},onClick:z=>z.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:le.captionTextInner,style:{"--link-color":Ce.linkColor,"--link-hover-color":Ce.linkHoverColor},children:r.jsx(Yn,{content:n[C].imageCaption})})}),J.isActive&&(()=>{const[z,de]=J.position.split("-"),N=F.direction==="horiz"?`${z}-left`:J.position,X=mi(N,J.offset,l),Y=()=>{if(F.direction==="horiz"){if(de==="left")return"flex-start";if(de==="center")return"center";if(de==="right")return"flex-end"}else{if(z==="top")return"flex-start";if(z==="middle")return"center";if(z==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:M,className:le.thumbsWrapper,onClick:te=>Re(te),style:{position:l?"absolute":"fixed",...X,...F.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]:F.direction==="vert",[le.thumbsAlignStart]:J.align==="start",[le.thumbsAlignCenter]:J.align==="center",[le.thumbsAlignEnd]:J.align==="end"}),style:{gap:E.scalingValue(J.grid.gap,l),justifyContent:W?"flex-start":Y()},children:n.map((te,ce)=>{const he=ce===C,Fe=P[ce],we=J.grid.size*(he?J.activeState.scale:1),Ne=()=>{if(J.fit!=="fit")return{};if(!Fe)return F.direction==="horiz"?{height:E.scalingValue(we,l)}:{width:E.scalingValue(we,l)};const se=Fe.width/Fe.height;if(F.direction==="horiz"){const Ie=we,Ae=Ie*se;return{width:E.scalingValue(Ae,l),height:E.scalingValue(Ie,l)}}else{const Ie=we,Ae=Ie/se;return{width:E.scalingValue(Ie,l),height:E.scalingValue(Ae,l)}}};return r.jsx("button",{className:le.thumbItem,style:{...F.direction==="horiz"&&J.fit!=="fit"?{height:E.scalingValue(we,l)}:{},...F.direction==="vert"&&J.fit!=="fit"?{width:E.scalingValue(we,l)}:{},...J.fit==="cover"?{width:E.scalingValue(we,l),height:E.scalingValue(we,l)}:{},...Ne(),transition:he?"all 0.25s ease-out":"none",opacity:he?J.activeState.opacity/100:J.opacity/100,"--thumb-hover":J.activeState.opacity/100},onClick:se=>{var Ie;se.stopPropagation(),w(ce),(Ie=g.current)==null||Ie.go(ce)},onMouseEnter:()=>{var se;J.triggers==="hov"&&((se=g.current)==null||se.go(ce))},children:r.jsx("img",{src:te.image.url,alt:te.image.name??"",onLoad:se=>{const Ie=se.currentTarget;Ie.naturalWidth&&Ie.naturalHeight&&D(Ae=>({...Ae,[ce]:{width:Ie.naturalWidth,height:Ie.naturalHeight}}))},style:{objectFit:J.fit==="cover"?"cover":"contain",...J.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...J.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${te.image.name}-${ce}`)})})})})()]})]}),document.getElementById(a))};function Ir({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 md={element:ud,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 gd(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 hd({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:a}){const l=!!n,d=i&&t||!t,{prefix:s}=E.useScopedStyles(),{type:p="A",fieldsToShow:u=2,fields:L=[],buttonLabel:b,gap:y,fieldsGap:m,buttonCorners:h,buttonStroke:C,buttonPadding:w,isButtonFullWidth:v,inputCorners:x,inputStroke:O,inputPadding:R,inputColor:B,inputTextColor:T,inputBorderColor:P,placeholderColor:D,buttonColor:g,buttonTextColor:$,buttonBorderColor:A,labelTextColor:H,successColor:K,errorColor:Q,fontFamily:k,inputFontSettings:_,inputFontSize:I,inputLineHeight:M,inputLetterSpacing:W,inputWordSpacing:j,inputTextAppearance:U,buttonFontSettings:ie,buttonFontSize:F,buttonLineHeight:J,buttonLetterSpacing:f,buttonWordSpacing:ne,buttonTextAppearance:Ce,labelFontSettings:ue,labelFontSize:ye,labelLineHeight:re,labelLetterSpacing:me,labelWordSpacing:q,labelTextAppearance:ee,statusFontSettings:ae,statusFontSize:oe,statusLineHeight:be,statusLetterSpacing:Re,statusWordSpacing:xe,statusTextAppearance:Pe,successMessage:Le,errorMessage:z,stateOverrides:de}=e,N=p==="B",X=L.slice(0,Math.min(u,L.length)),Y={fontSettings:{fontFamily:k,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:I??.01,lineHeight:M,letterSpacing:W??0,wordSpacing:j??0,textAppearance:U,color:T},te=Ht(pt(Y,t)),ce=E.scalingValue(O??0,t),he=E.scalingValue((M??I??.01)+((R==null?void 0:R.top)??0)+((R==null?void 0:R.bottom)??0)+(p==="C"?O??0:(O??0)*2),t),Fe={...te,borderStyle:"solid",borderRadius:p==="C"?0:E.scalingValue(x??0,t),...p==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:ce,borderLeftWidth:0}:{borderWidth:ce},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:he,minHeight:he},$e={fontSettings:{fontFamily:k,fontWeight:(ie==null?void 0:ie.fontWeight)??400,fontStyle:(ie==null?void 0:ie.fontStyle)??"normal"},fontSize:F??.01,lineHeight:J,letterSpacing:f??0,wordSpacing:ne??0,textAppearance:Ce,color:$},we=Ht(pt($e,t)),Ne=E.scalingValue(C??0,t),se={fontSettings:{fontFamily:k,fontWeight:(ue==null?void 0:ue.fontWeight)??400,fontStyle:(ue==null?void 0:ue.fontStyle)??"normal"},fontSize:ye??.01,lineHeight:re,letterSpacing:me??0,wordSpacing:q??0,textAppearance:ee,color:H},Ie=pt(se,t),Ae={fontSettings:{fontFamily:k,fontWeight:(ae==null?void 0:ae.fontWeight)??400,fontStyle:(ae==null?void 0:ae.fontStyle)??"normal"},fontSize:oe??.01,lineHeight:be,letterSpacing:Re??0,wordSpacing:xe??0,textAppearance:Pe,color:K},We=Ht(pt(Ae,t)),je=E.buildColorVars(s,{inputColor:B,inputTextColor:T,inputBorderColor:P,placeholderColor:D!=null&&D.trim()?D:"#cccccc",buttonColor:g,buttonTextColor:$,buttonBorderColor:A,labelTextColor:H,successColor:K,errorColor:Q},fd,yd,de),[st,ft]=c.useState(()=>Object.fromEntries(X.map(_e=>[_e.name,""]))),[yt,wt]=c.useState("idle"),[It,mt]=c.useState(null),ut=a==="success"?"success":a==="error"?"error":yt,Te=a==="error"?z:It,Je=a==="filled",Ze=c.useMemo(()=>{if(!Je)return st;let _e=null;for(const it of X)(st[it.name]??"").trim().length>0||(_e=_e??{...st},_e[it.name]="Filled");return _e??st},[st,Je,X]),et=ut==="error"?E.getFormFieldValidationError(X,Ze):null,$t=`${a&&a!=="default"?`${s}-state-${a}`:""}`.trim(),vt=o==null?void 0:o.submitUrl,_t=(_e,it)=>{ft(Ge=>({...Ge,[_e]:it}))},bt=async _e=>{if(_e.preventDefault(),!d)return;const it=Object.fromEntries(X.map(ze=>{var at;return[ze.name,((at=st[ze.name])==null?void 0:at.trim())??""]}).filter(([,ze])=>ze));if(!vt){wt("error"),mt("No integrations were found for this form.");return}if(Object.keys(it).length===0)return;const Ge=E.getFormFieldValidationError(X,st);if(Ge){wt("error"),mt(Ge);return}wt("submitting"),mt(null);try{const ze=await fetch(vt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(it)});if(!ze.ok){const at=await ze.text();throw new Error(at||`Request failed: ${ze.status}`)}wt("success"),ft(Object.fromEntries(X.map(at=>[at.name,""])))}catch(ze){wt("error"),mt(ze instanceof Error?ze.message:"Something went wrong")}};return r.jsxs("div",{className:`${s}-wrapper ${s}-type-${p} ${$t}`.trim(),style:je,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:gd(s)}}),r.jsxs("form",{onSubmit:bt,className:`${s}-form`,children:[r.jsx("div",{className:`${s}-fields`,children:X.map((_e,it)=>r.jsxs(c.Fragment,{children:[it>0&&r.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${s}-control`:void 0,style:{height:E.scalingValue(m??0,t)}}),r.jsxs("div",{className:`${s}-field-group${N?` ${s}-labeled`:""}`,children:[N&&r.jsx("span",{className:`${s}-field-label`,style:Ie?{...Ie,lineHeight:Ie.fontSize}:void 0,children:_e.label||_e.name}),_e.type==="textarea"?r.jsx("textarea",{name:_e.name,autoComplete:"off",value:Ze[_e.name]??"",onChange:Ge=>_t(_e.name,Ge.target.value),placeholder:_e.placeholder,className:`${s}-input`,style:Fe,rows:1,"data-filled":Je||(Ze[_e.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:_e.type==="phone"?"tel":_e.type==="email"?"email":"text",name:_e.name,autoComplete:"off",value:Ze[_e.name]??"",onChange:Ge=>_t(_e.name,Ge.target.value),placeholder:_e.placeholder,required:_e.isRequired??_e.type==="email",className:`${s}-input`,style:Fe,"data-filled":Je||(Ze[_e.name]??"").trim().length>0})]})]},it))}),r.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${s}-control`:void 0,style:{height:E.scalingValue(y??0,t)}}),r.jsx("div",{className:`${s}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${s}-button`,style:{borderStyle:"solid",borderRadius:E.scalingValue(h??0,t),borderWidth:Ne,paddingTop:E.scalingValue((w==null?void 0:w.top)??0,t),paddingRight:E.scalingValue((w==null?void 0:w.right)??0,t),paddingBottom:E.scalingValue((w==null?void 0:w.bottom)??0,t),paddingLeft:E.scalingValue((w==null?void 0:w.left)??0,t),pointerEvents:d?"auto":void 0,...we,...v?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${s}-overlay-anchor`,style:v?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:yt==="submitting"?"...":b})})})]}),ut==="success"&&r.jsx("p",{className:`${s}-success`,style:{...We},children:Le}),ut==="error"&&r.jsx("p",{className:`${s}-error`,style:{...We},role:"alert",children:et??Te??z})]})}const fd={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"},yd=["hover","focus","filled","success","error"],vd=`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
|
+
`,bd=[{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"}}}},xd=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Sd={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:bd,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:[...xd],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"]},Cd={element:hd,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:Sd,sourceCode:vd};function fi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function wd(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 $d=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:a}=E.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:s,buttonLabel:p,fieldsToShow:u=1,fontFamily:L,inputFontSettings:b,inputFontSize:y,inputLineHeight:m,inputLetterSpacing:h,inputWordSpacing:C,inputTextAppearance:w,buttonFontSettings:v,buttonFontSize:x,buttonLineHeight:O,buttonLetterSpacing:R,buttonWordSpacing:B,buttonTextAppearance:T,statusFontSettings:P,statusFontSize:D,statusLineHeight:g,statusLetterSpacing:$,statusWordSpacing:A,statusTextAppearance:H,iconMaxWidth:K,minHeight:Q,corners:k,stroke:_,stateOverrides:I,inputPadding:M,buttonPadding:W,successMessage:j="Thanks for subscribing!",errorMessage:U="Please, fill all required fields."}=e,ie=d.slice(0,Math.min(u,d.length)),[F,J]=c.useState(()=>Object.fromEntries(ie.map(se=>[se.name,""]))),[f,ne]=c.useState("idle"),[Ce,ue]=c.useState(null),ye=o==="success"?"success":o==="error"?"error":f,re=o==="error"?U:Ce,me=o==="filled",q=c.useMemo(()=>{if(!me)return F;let se=null;for(const Ie of ie)(F[Ie.name]??"").trim().length>0||(se=se??{...F},se[Ie.name]="Filled");return se??F},[me,F,ie]),ee=ye==="error"?E.getFormFieldValidationError(ie,q):null,ae=o&&o!=="default"?`${a}-state-${o}`:"",oe=ie.some(se=>(q[se.name]??"").trim().length>0),be=ae!==`${a}-state-filled`&&oe?`${a}-state-filled`:"",Re=`${ae} ${be}`.trim(),xe=i==null?void 0:i.submitUrl,Pe=p??"",Le=(s==null?void 0:s.icon)??"",z=(s==null?void 0:s.mode)==="On",de=Pe||"Submit",N={fontSettings:{fontFamily:L,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:y??.01,lineHeight:m,letterSpacing:h??0,wordSpacing:C??0,textAppearance:w,color:e.inputTextColor??"#111111"},X={fontSettings:{fontFamily:L,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:x??.01,lineHeight:O,letterSpacing:R??0,wordSpacing:B??0,textAppearance:T,color:e.buttonTextColor??"#ffffff"},Y={fontSettings:{fontFamily:L,fontWeight:(P==null?void 0:P.fontWeight)??400,fontStyle:(P==null?void 0:P.fontStyle)??"normal"},fontSize:D??.01,lineHeight:g,letterSpacing:$??0,wordSpacing:A??0,textAppearance:H,color:e.successColor??"#22c55e"},te=Ht(pt(N,t)),ce=Ht(pt(X,t)),he=Ht(pt(Y,t)),Fe=E.buildColorVars(a,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(N==null?void 0:N.color)??"#111111",buttonTextColor:e.buttonTextColor??(X==null?void 0:X.color)??"#ffffff"},Td,Ld,I),$e={borderRadius:E.scalingValue(k,t),borderWidth:E.scalingValue(_,t),borderStyle:"solid"},we={borderLeftWidth:E.scalingValue(_,t)},Ne=async se=>{if(se.preventDefault(),!l)return;const Ie=Object.fromEntries(ie.map(We=>{var je;return[We.name,((je=F[We.name])==null?void 0:je.trim())??""]}).filter(([,We])=>We));if(!xe){ne("error"),ue("No integrations were found for this form.");return}if(Object.keys(Ie).length===0)return;const Ae=E.getFormFieldValidationError(ie,F);if(Ae){ne("error"),ue(Ae);return}ne("submitting"),ue(null);try{const We=await fetch(xe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ie)});if(!We.ok){const je=await We.text();throw new Error(je||`Request failed: ${We.status}`)}ne("success"),J(Object.fromEntries(ie.map(je=>[je.name,""])))}catch(We){ne("error"),ue(We instanceof Error?We.message:"Something went wrong")}};return r.jsxs("div",{className:`${a}-wrapper ${Re}`.trim(),style:Fe,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:wd(a)}}),r.jsxs("form",{onSubmit:Ne,className:`${a}-form`,style:{...$e,height:E.scalingValue(Q,t),minHeight:E.scalingValue(Q,t)},children:[r.jsx("div",{className:`${a}-inputWrap ${a}-overlayAnchor`,style:{flex:1,minWidth:0},children:ie.map(se=>r.jsx("input",{type:se.type==="email"?"email":se.type==="phone"?"tel":"text",name:se.name,autoComplete:"off",value:q[se.name]??"",onChange:Ie=>J(Ae=>({...Ae,[se.name]:Ie.target.value})),placeholder:se.placeholder,required:se.isRequired??se.type==="email",className:`${a}-input`,style:{...te,paddingRight:E.scalingValue(M.right,t),paddingLeft:E.scalingValue(M.left,t),paddingTop:E.scalingValue(M.top,t),paddingBottom:E.scalingValue(M.bottom,t)}},se.name))}),r.jsx("div",{className:`${a}-overlayAnchor`,children:r.jsx("button",{type:l?"submit":"button",className:`${a}-submitBtn`,"aria-label":de,style:{...ce,...we,paddingRight:E.scalingValue(W.right,t),paddingLeft:E.scalingValue(W.left,t),paddingTop:E.scalingValue(W.top,t),paddingBottom:E.scalingValue(W.bottom,t),pointerEvents:l?"auto":void 0},children:f==="submitting"?"...":z?Le&&r.jsx(Ot,{url:Le,className:`${a}-submitBtnIcon`,style:{maxWidth:E.scalingValue(K??0,t)},fill:`var(--${a}-button-text-color)`,hoverFill:`var(--${a}-button-text-color)`}):Pe})})]}),ye==="success"&&r.jsx("p",{className:`${a}-success`,style:{...he},children:j}),ye==="error"&&r.jsx("p",{className:`${a}-error`,style:{...he},role:"alert",children:ee??re??U})]})},Td={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"},Ld=["hover","focus","filled","success","error"],Ed=`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
|
+
`,Id="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."}],io={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Rd=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Pd={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:{...io.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:{...io.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:{...io.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:Id},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:[...Rd],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"]},Ad={element:$d,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:Pd,sourceCode:Ed};function Md(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 kd=30,Wd=20,oo=2,Fd=2,Nd=(e,t)=>Array.from({length:t},()=>e).flat(),Hd=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Od=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Hd(i,e))},Bd=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,imageHoverClass:a,isFirstSet:l,scaled:d,onFirstSetImageDone:s})=>{var T,P,D;const p=c.useRef(null);c.useLayoutEffect(()=>{if(!l)return;const g=p.current;g!=null&&g.complete&&(s==null||s())},[l,(T=e.image)==null?void 0:T.url,s]);const u=n.display==="Cover",L=n.ratioValue??"1:1",b=n.reversed??!1,[y,m]=L.split(":").map(Number),w=(b?m:y)/(b?y:m);let v=i,x=v/w;x>o&&(x=o,v=x*w);const O=d(v),R=d(x),B=((P=e.image)==null?void 0:P.url)&&r.jsx("img",{ref:p,src:e.image.url,alt:((D=e.image)==null?void 0:D.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?s:void 0,onError:l?s:void 0});return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...u?{width:O}:{width:"fit-content",maxWidth:d(i),minWidth:0}},children:r.jsx("div",{className:a,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...u?{width:O,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})})},Dd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:a}=E.useScopedStyles(),l=c.useMemo(()=>Md(a),[a]),{speed:d,direction:s,pauseOnHover:p,gap:u,imageMaxWidth:L,imageMaxHeight:b,imageFit:y,hoverEffect:m}=e,h=!!o,C=!n||!!i,w=C&&m!=="off"&&m!=="randomize"?`${a}-image-hover-${m}`:void 0,v=n?!!i:!0,O=((t==null?void 0:t.length)??0)>0&&(v||!!n),R=Math.max(0,d)*kd,B=ee=>E.scalingValue(ee,n??!1),T=c.useRef(null),P=c.useRef(null),D=c.useRef(null),[g,$]=c.useState(0),[A,H]=c.useState(0),K=v&&p==="on",[Q,k]=c.useState(!1),[_,I]=c.useState({}),M=c.useRef(_);M.current=_;const W=c.useRef(null),j=c.useRef(0),U=c.useRef(null),ie=c.useMemo(()=>(t??[]).map(ee=>{var ae;return((ae=ee.image)==null?void 0:ae.url)??""}).join("\0"),[t]),[F,J]=c.useState(oo),f=c.useMemo(()=>{const ee=t??[];return!v||ee.length===0?ee:Nd(ee,F)},[t,v,F]),ne=c.useMemo(()=>f.filter(ee=>{var ae;return!!((ae=ee.image)!=null&&ae.url)}).length,[f]),Ce=O?Fd:1;c.useLayoutEffect(()=>{j.current=0,I({}),W.current=null,J(oo),$(0)},[ie]),c.useEffect(()=>{if(!C||m!=="randomize")return;const ee=T.current;if(!ee)return;const ae=xe=>{I(Pe=>{let Le=null;for(const z of xe)z in Pe&&(Od(ee,z)||(Le||(Le={...Pe}),delete Le[z]));return Le??Pe})},oe=new IntersectionObserver(xe=>{const Pe=new Set;for(const Le of xe){const z=Le.target.dataset.marqueeItemIndex,de=z!==void 0?Number(z):NaN;Number.isNaN(de)||Pe.add(de)}Pe.size>0&&ae(Pe)},{root:ee,threshold:0});Object.keys(_).forEach(xe=>{const Pe=Number(xe);ee.querySelectorAll(`[data-marquee-item-index="${Pe}"]`).forEach(Le=>oe.observe(Le))});let be=0;const Re=()=>{const xe=Object.keys(M.current);xe.length!==0&&(ae(xe.map(Number)),be=requestAnimationFrame(Re))};return Object.keys(M.current).length>0&&(be=requestAnimationFrame(Re)),()=>{cancelAnimationFrame(be),oe.disconnect()}},[m,_,C]),c.useLayoutEffect(()=>{if(!O)return;const ee=T.current,ae=D.current;if(!ee||!ae)return;let oe=0;const be=()=>{const Pe=ee.getBoundingClientRect().width,Le=ae.getBoundingClientRect().width,z=W.current,de=typeof z=="number"&&Math.abs(z-Le)<=.25;if(W.current=Le,v&&Le>0&&F>0){const N=Le/F;if(N>0&&Pe>0){const X=Math.max(oo,Math.ceil(Pe/N)+1);if(X!==F){J(X);return}}}if(Le>0&&g<=0){$(Le);return}de&&Le!==g?$(Le):!de&&g<=0&&(cancelAnimationFrame(oe),oe=requestAnimationFrame(be))},Re=()=>{cancelAnimationFrame(oe),oe=requestAnimationFrame(be)};U.current=Re,Re();const xe=new ResizeObserver(Re);return xe.observe(ee),xe.observe(ae),()=>{U.current=null,cancelAnimationFrame(oe),xe.disconnect()}},[v,O,g,ie,F]),c.useLayoutEffect(()=>{const ee=P.current;if(!O||!ee)return;const ae=g>0?g:0,oe=ae>0&&R>0?ae/R*1e3:0,be=`${Math.max(0,oe)/1e3}s`;ee.style.setProperty("--marquee-distance",`${ae}px`),ee.style.setProperty("--marquee-duration",be)},[v,O,R,g]),c.useLayoutEffect(()=>{if(!O){H(0);return}if(g<=0){H(0);return}const ee=P.current;if(!ee)return;const ae=()=>{const be=ee.getBoundingClientRect().height;H(be>0?be:0)};ae();const oe=new ResizeObserver(ae);return oe.observe(ee),()=>oe.disconnect()},[O,Ce,f,n,u,L,b,g,y,_]);const ue=()=>{K&&k(!0)},ye=()=>{K&&k(!1)},re=c.useCallback(()=>{var ee;j.current=Math.min(ne,j.current+1),(ee=U.current)==null||ee.call(U)},[ne]),me=c.useCallback((ee,ae)=>{I(oe=>{const be=oe[ee]??ae,Re=(t??[]).filter(Pe=>Pe!==be);if(Re.length===0)return oe;const xe=Re[Math.floor(Math.random()*Re.length)];return{...oe,[ee]:xe}})},[t]),q=(ee,ae,oe,be)=>{const Re=C&&m==="randomize"&&y.display==="Cover"?_[oe]??ee:ee,xe=`max(${B(u)}, ${Wd}px)`,Pe=`calc(-0.5 * (${xe} + ${B(u)}))`;return r.jsxs("div",{className:`${a}-marquee-card`,"data-marquee-item-index":oe,onMouseEnter:C&&m==="randomize"&&y.display==="Cover"?()=>me(oe,ee):void 0,children:[r.jsx(Bd,{item:Re,prefix:a,imageFit:y,imageMaxWidth:L,imageMaxHeight:b,imageHoverClass:w,isEditor:n,isFirstSet:be,scaled:B,onFirstSetImageDone:re}),h&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${a}-gap-control`,style:{position:"absolute",top:0,right:Pe,width:xe,height:"100%"}})]},`${ae}-${oe}`)};if(O){const ee=v?K&&Q?"paused":"running":"paused";return r.jsxs("div",{ref:T,className:De(`${a}-wrapper`,`${a}-marquee-wrapper`),"aria-label":"Marquee",style:g>0&&A>0?{height:A}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsx("div",{ref:P,className:`${a}-marquee-track`,"data-direction":s,onMouseEnter:ue,onMouseLeave:ye,style:{"--marquee-play-state":ee},children:Array.from({length:Ce},(ae,oe)=>r.jsx("div",{ref:oe===0?D:void 0,className:De(`${a}-marquee-row`,`${a}-marquee-set`),style:{gap:B(u),paddingRight:B(u)},"aria-hidden":oe>0,children:f.map((be,Re)=>q(be,oe,Re,oe===0))},`set-${oe}`))},"marquee-track")]})}return r.jsxs("div",{ref:T,className:`${a}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsx("div",{className:De(`${a}-marquee-row`,`${a}-marquee-static`),style:{gap:B(u),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((ee,ae)=>q(ee,0,ae))},"marquee-static")]})},jd=`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
|
+
`,zd={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:""}]}},Vd={element:Dd,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:zd,sourceCode:jd,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function _r(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 Kd=30,Rr=2,Gd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:a}=E.useScopedStyles(),{align:l,speed:d,direction:s,pauseOnHover:p,gap:u,cardWidth:L,corners:b,stroke:y,strokeColor:m,bgColor:h,padding:C,logoMarginTop:w,logoWidth:v,logoHeight:x,captionMarginTop:O}=e,R=!!o,B=((t==null?void 0:t.length)??0)>0,T=d>0&&(!n||!!i),P=B&&(T||!!n),D=Math.max(0,d)*Kd,g=N=>E.scalingValue(N,n??!1),$=c.useRef(null),A=c.useRef(null),H=c.useRef(null),[K,Q]=c.useState(0),[k,_]=c.useState(0),[I,M]=c.useState(0),W=T&&p==="on",[j,U]=c.useState(!1),ie=c.useRef(null),[F,J]=c.useState(0),[f,ne]=c.useState(0),Ce=c.useRef(null),ue=N=>{var Y,te,ce,he,Fe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${N}FontFamily`])??"Arial",fontWeight:((Y=e==null?void 0:e[`${N}FontSettings`])==null?void 0:Y.fontWeight)??400,fontStyle:((te=e==null?void 0:e[`${N}FontSettings`])==null?void 0:te.fontStyle)??"normal"},textAppearance:{textTransform:((ce=e==null?void 0:e[`${N}TextAppearance`])==null?void 0:ce.textTransform)??"none",textDecoration:((he=e==null?void 0:e[`${N}TextAppearance`])==null?void 0:he.textDecoration)??"none",fontVariant:((Fe=e==null?void 0:e[`${N}TextAppearance`])==null?void 0:Fe.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${N}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${N}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${N}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${N}LineHeight`])??.01,color:(e==null?void 0:e[`${N}Color`])??"#000000"}},ye=ue("text"),re=ue("caption"),me=c.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(N=>{var X,Y;return(((X=N.text)==null?void 0:X.length)??0)>0||(((Y=N.caption)==null?void 0:Y.length)??0)>0}),[t]),q=c.useMemo(()=>!P||(t==null?void 0:t.length)===0?1:k<=0||K<=0?Rr:Math.max(Rr,Math.ceil(K/k)+1),[P,t==null?void 0:t.length,k,K]);c.useLayoutEffect(()=>{if(!P)return;const N=$.current,X=H.current;if(!N||!X)return;let Y=0;const te=()=>{const Fe=N.getBoundingClientRect().width,$e=X.getBoundingClientRect().width,we=Ce.current,Ne=typeof we=="number"&&Math.abs(we-$e)<=.25;if(Ce.current=$e,Q(Fe),typeof $e=="number"&&$e>0&&k<=0){_($e);return}Ne&&$e!==k?_($e):!Ne&&k<=0&&(cancelAnimationFrame(Y),Y=requestAnimationFrame(te))},ce=()=>{cancelAnimationFrame(Y),Y=requestAnimationFrame(te)};ce();const he=new ResizeObserver(ce);return he.observe(N),he.observe(X),()=>{cancelAnimationFrame(Y),he.disconnect()}},[T,P,k]),c.useLayoutEffect(()=>{const N=A.current;if(!P||!N)return;const X=k>0?k:0,Y=X>0&&D>0?X/D*1e3:0,te=`${Math.max(0,Y)/1e3}s`;N.style.setProperty("--marquee-distance",`${X}px`),N.style.setProperty("--marquee-duration",te)},[T,P,D,k]),c.useLayoutEffect(()=>{if(!P){M(0);return}const N=H.current,X=A.current;if(!N||!X)return;const Y=()=>{let ce=0;for(let he=0;he<N.children.length;he++){const $e=N.children[he].firstElementChild;$e&&(ce=Math.max(ce,$e.offsetHeight))}ce<=0&&(ce=X.offsetHeight),M(ce>0?ce:0)};Y();const te=new ResizeObserver(Y);return te.observe(N),te.observe(X),()=>{te.disconnect()}},[P,q,t,n,u,L,C,y,b,v,x,F,f]);const ee=()=>{W&&U(!0)},ae=()=>{W&&U(!1)},oe=c.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),be=c.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),Re=c.useCallback((N,X,Y,te)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:oe,width:"100%"},children:[r.jsx("div",{"data-controls":R?te==null?void 0:te.controlsName:void 0,"data-controls-axis":R?"y":void 0,className:R?`${a}-control`:void 0,style:{height:g((te==null?void 0:te.marginTop)??0)}}),r.jsx("div",{...te!=null&&te.dataMeasureKind?{"data-testimonial-measure":te.dataMeasureKind}:{},style:{...pt(N,n),textAlign:be,pointerEvents:"auto",...typeof(te==null?void 0:te.minHeightPx)=="number"&&te.minHeightPx>0?{minHeight:te.minHeightPx}:{}},children:r.jsx(Yn,{content:X})})]},Y),[oe,be,n,R,a,g]),xe=c.useCallback((N,X,Y)=>{var te,ce,he;return r.jsxs("div",{style:{padding:`${g(C.top)} ${g(C.right)} ${g(C.bottom)} ${g(C.left)}`,width:g(L+y*2),height:"100%",borderRadius:g(b),border:`${g(y)} solid ${m}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${a}-cover`,style:{background:h}}),r.jsxs("div",{className:`${a}-elements-overlay`,style:{alignItems:oe,textAlign:be},children:[N.text&&Re(ye,N.text,"text",Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(Y==null?void 0:Y.textMinHeightPx)=="number"&&Y.textMinHeightPx>0?{minHeightPx:Y.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:oe,width:"100%"},children:[r.jsx("div",{"data-controls":R&&!(Y!=null&&Y.dataMeasureAttrs)?"logoMarginTop":void 0,className:R&&!(Y!=null&&Y.dataMeasureAttrs)?`${a}-control`:void 0,style:{height:g(w)}}),r.jsx("div",{style:{width:g(v),height:g(x)},children:((te=N.logo)==null?void 0:te.url)&&r.jsx("img",{src:N.logo.url,alt:((ce=N.logo)==null?void 0:ce.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((he=N.logo)==null?void 0:he.objectFit)||"contain"}})})]}),N.caption&&Re(re,N.caption,"caption",{...Y!=null&&Y.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:O,...Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(Y==null?void 0:Y.captionMinHeightPx)=="number"&&Y.captionMinHeightPx>0?{minHeightPx:Y.captionMinHeightPx}:{}})]})]},X)},[h,O,re,L,b,x,w,v,oe,be,C.bottom,C.left,C.right,C.top,Re,y,m,ye,n,R,a]),Pe=c.useCallback(N=>{J(N.maxTextPx),ne(N.maxCaptionPx)},[]);c.useLayoutEffect(()=>{if(!me){Pe({maxTextPx:0,maxCaptionPx:0});return}const N=ie.current;if(!N)return;const X=()=>{E.readTestimonialTextMeasure(N,Pe)};X();const Y=new ResizeObserver(X);return Y.observe(N),()=>{Y.disconnect()}},[me,Pe,t,xe]);const Le=me?{textMinHeightPx:F,captionMinHeightPx:f}:void 0,z=me?r.jsx("div",{ref:ie,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((N,X)=>xe(N,`measure-${X}`,{dataMeasureAttrs:!0}))}):null,de=(N,X)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[xe(N,`card-${X}`,Le),R&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${g(u)})`,width:g(u),height:"100%",pointerEvents:"auto",zIndex:2}})]},X);if(P){const N=T?W&&j?"paused":"running":"paused";return r.jsxs("div",{ref:$,className:De(`${a}-wrapper`,`${a}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...I>0?{height:I}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:_r(a)}}),z,r.jsx("div",{ref:A,className:`${a}-marquee-track`,"data-direction":s,onMouseEnter:ee,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":N},children:Array.from({length:q},(X,Y)=>r.jsx("div",{ref:Y===0?H:void 0,className:`${a}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:g(u),paddingRight:g(u)},"aria-hidden":Y>0,children:t==null?void 0:t.map((te,ce)=>de(te,`${Y}-${ce}`))},`set-${Y}`))})]})}return r.jsxs("div",{className:`${a}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:_r(a)}}),z,r.jsx("div",{style:{gap:g(u),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((N,X)=>de(N,X))})]})},Ud=`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
|
-
`,
|
|
3025
|
+
`,Pr={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},qd={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:{...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"}},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"}}},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"}]}]}]}},Xd={element:Gd,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:qd,sourceCode:Ud,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Yd(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 Jd=3e3,Zd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:a}=E.useScopedStyles(),l=t||[],{speed:d,align:s,width:p,imageMarginTop:u,textMarginTop:L,captionMarginTop:b,imageWidth:y,imageHeight:m,controlsWidth:h,controlsColor:C,controlsHoverColor:w}=e,v=d>0&&(!n||!!i),[x,O]=c.useState(0),[R,B]=c.useState(null),[T,P]=c.useState(!1),D=c.useRef(null),g=c.useMemo(()=>{switch(s){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[s]),$=c.useMemo(()=>{switch(s){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[s]);c.useEffect(()=>{O(0),B(null),P(!1)},[l.length]);const A=l[x],H=R===null?null:l[R],K=re=>{var q,ee,ae,oe,be;return{fontSettings:{fontFamily:(e==null?void 0:e[`${re}FontFamily`])??"Arial",fontWeight:((q=e==null?void 0:e[`${re}FontSettings`])==null?void 0:q.fontWeight)??400,fontStyle:((ee=e==null?void 0:e[`${re}FontSettings`])==null?void 0:ee.fontStyle)??"normal"},textAppearance:{textTransform:((ae=e==null?void 0:e[`${re}TextAppearance`])==null?void 0:ae.textTransform)??"none",textDecoration:((oe=e==null?void 0:e[`${re}TextAppearance`])==null?void 0:oe.textDecoration)??"none",fontVariant:((be=e==null?void 0:e[`${re}TextAppearance`])==null?void 0:be.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${re}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${re}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${re}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${re}WordSpacing`])??0,color:(e==null?void 0:e[`${re}Color`])??"#000000"}},Q=K("text"),k=K("caption"),_=l.length>1&&l.some(re=>{var me,q;return(((me=re.text)==null?void 0:me.length)??0)>0||(((q=re.caption)==null?void 0:q.length)??0)>0}),I=c.useRef(null),[M,W]=c.useState(0),[j,U]=c.useState(0),ie=e.controls??{mode:"Off",icon:null},F=l.length>1,J=c.useCallback((re,me)=>!F||me===re?re:(D.current&&window.clearTimeout(D.current),B(re),P(!0),D.current=window.setTimeout(()=>{B(null),P(!1),D.current=null},300),me),[F]),f=c.useCallback(()=>{F&&O(re=>J(re,(re-1+l.length)%l.length))},[F,J,l.length]),ne=c.useCallback(()=>{F&&O(re=>J(re,(re+1)%l.length))},[F,J,l.length]);c.useEffect(()=>{if(!v||!F)return;const re=Math.max(300,Jd/d),me=window.setInterval(()=>{O(q=>J(q,(q+1)%l.length))},re);return()=>{window.clearInterval(me)}},[v,F,J,l.length,d]),c.useEffect(()=>()=>{D.current&&window.clearTimeout(D.current)},[]);const Ce=(re,me)=>{var be,Re,xe,Pe;const q=me==null?void 0:me.textMinHeightPx,ee=me==null?void 0:me.captionMinHeightPx,ae=me==null?void 0:me.dataMeasureAttrs,oe=o&&!(me!=null&&me.dataMeasureAttrs)&&!(me!=null&&me.hideControls);return r.jsxs(r.Fragment,{children:[re.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:g,width:"100%"},children:[r.jsx("div",{"data-controls":oe?"textMarginTop":void 0,className:oe?`${a}-control`:void 0,style:{height:E.scalingValue(L??0,n??!1)}}),r.jsx("div",{...ae&&{"data-testimonial-measure":"text"},style:{...pt(Q,n),...q&&q>0?{minHeight:q}:{},textAlign:$,pointerEvents:"auto"},children:r.jsx(Yn,{content:re.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:g,width:"100%"},children:[r.jsx("div",{"data-controls":oe?"imageMarginTop":void 0,className:oe?`${a}-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(m??0,n??!1)},children:((be=re.image)==null?void 0:be.url)&&r.jsx("img",{src:(Re=re.image)==null?void 0:Re.url,alt:((xe=re.image)==null?void 0:xe.name)??"",className:`${a}-icon`,style:{objectFit:((Pe=re.image)==null?void 0:Pe.objectFit)||"contain"}})})]}),re.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:g,width:"100%"},children:[r.jsx("div",{"data-controls":oe?"captionMarginTop":void 0,className:oe?`${a}-control`:void 0,style:{height:E.scalingValue(b??0,n??!1)}}),r.jsx("div",{...ae?{"data-testimonial-measure":"caption"}:{},style:{...pt(k,n),...ee&&ee>0?{minHeight:ee}:{},textAlign:$,pointerEvents:"auto"},children:r.jsx(Yn,{content:re.caption})})]})]})},ue=c.useCallback(re=>{W(re.maxTextPx),U(re.maxCaptionPx)},[]);if(c.useLayoutEffect(()=>{if(!_){ue({maxTextPx:0,maxCaptionPx:0});return}const re=I.current;if(!re)return;const me=()=>{E.readTestimonialTextMeasure(re,ue)};me();const q=new ResizeObserver(me);return q.observe(re),()=>{q.disconnect()}},[_,ue,t]),!A)return r.jsx(r.Fragment,{});const ye=_?{textMinHeightPx:M,captionMinHeightPx:j}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${a}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Yd(a)}}),r.jsxs("div",{className:`${a}-wrapper`,style:{width:E.scalingValue(p??0,n??!1),alignItems:g},children:[_&&r.jsx("div",{ref:I,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((re,me)=>r.jsx("div",{style:{width:"100%"},children:Ce(re,{dataMeasureAttrs:!0})},me))}),r.jsxs("div",{className:`${a}-fade-stack`,children:[H&&T&&r.jsx("div",{className:De(`${a}-fade-item-prev`,`${a}-fade-out`),children:Ce(H,{...ye,hideControls:!0})}),r.jsx("div",{className:De(`${a}-fade-item-current`,T?`${a}-fade-in`:void 0),children:Ce(A,ye)})]})]}),ie.mode==="On"&&r.jsxs("div",{className:`${a}-controls`,children:[r.jsx("div",{className:`${a}-arrow`,style:{width:E.scalingValue(h??.02,n??!1),height:E.scalingValue(h??.02,n??!1),"--arrow-hover-color":w},children:r.jsx("button",{type:"button",className:`${a}-arrow-inner`,onClick:f,disabled:!F,"aria-label":"Previous testimonial",children:ie.icon&&r.jsx(Ot,{url:ie.icon,fill:C,hoverFill:w,className:De(`${a}-arrow-img`,`${a}-mirror`)})})}),r.jsx("div",{className:De(`${a}-arrow`,`${a}-next-arrow`),style:{width:E.scalingValue(h??.02,n??!1),height:E.scalingValue(h??.02,n??!1),"--arrow-hover-color":w},children:r.jsx("button",{type:"button",className:`${a}-arrow-inner`,onClick:ne,disabled:!F,"aria-label":"Next testimonial",children:ie.icon&&r.jsx(Ot,{url:ie.icon,fill:C,hoverFill:w,className:`${a}-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
|
+
`,eu="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>'),Ar={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},tu={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:{...Ar.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:{...Ar.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:eu},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"}]}]}]}},nu={element:Zd,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:tu,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 iu(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Mr(e){return((e==null?void 0:e.trim().length)??0)>0}function ro(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ao(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:E.scalingValue((o-t)/2,i)}}function ou(e){return`
|
|
3646
3646
|
.${e}-wrapper {
|
|
3647
3647
|
display: grid;
|
|
3648
3648
|
align-items: start;
|
|
3649
|
-
min-height: ${
|
|
3649
|
+
min-height: ${iu(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 zt=500,ru=750,Qt="cubic-bezier(0.22, 1, 0.36, 1)";function en(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function kr({media:e,className:t,style:n,onImageClick:i}){return en(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 au({images:e,index:t,imageDisplay:n,originRect:i,reverseClose:o,onClose:a,onPrev:l,onNext:d,counterClassName:s,counterStyle:p}){const u=n==="cover",L=c.useRef(null),b=c.useRef(null),[y,m]=c.useState(null),[h,C]=c.useState(i?"opening":"open"),[w,v]=c.useState(!0),x=c.useRef(t),O=c.useCallback(()=>{const g=L.current,$=b.current;if(!g||!$)return;const A=g.getBoundingClientRect(),H=A.width,K=A.height,Q=$.naturalWidth,k=$.naturalHeight;if(!H||!K||!Q||!k)return;if(n==="cover"){m({width:H,height:K,left:A.left,top:A.top});return}const _=Q/k,I=H/K;if(_>I){const M=H/_;m({width:H,height:M,left:A.left,top:A.top+(K-M)/2})}else{const M=K*_;m({width:M,height:K,left:A.left+(H-M)/2,top:A.top})}},[n]);c.useEffect(()=>{O();const g=L.current;if(!g)return;const $=new ResizeObserver(()=>O());return $.observe(g),()=>$.disconnect()},[O,t]),c.useEffect(()=>{h==="opening"&&y&&C("open")},[h,y]),c.useEffect(()=>{if(h!=="closing")return;const g=setTimeout(()=>a(),zt);return()=>clearTimeout(g)},[h,a]),c.useEffect(()=>{x.current!==t&&v(!1),x.current=t},[t]),c.useEffect(()=>{const g=$=>{$.key==="Escape"&&($.preventDefault(),$.stopPropagation(),h!=="closing"&&C("closing"))};return window.addEventListener("keydown",g,!0),()=>window.removeEventListener("keydown",g,!0)},[h]);const R=()=>{h!=="closing"&&C("closing")},B=h==="open",T=h==="closing",P=T&&o&&!!i,D=h==="opening"?i??y:P?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 ${zt}ms ${Qt}`,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 ${zt}ms ${Qt}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:s,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 ${zt}ms ${Qt}`},children:e.length>1&&r.jsxs("p",{className:s,style:p,children:[t+1," / ",e.length]})})]})}),D&&r.jsx("img",{ref:b,src:e[t],onLoad:O,style:{position:"fixed",top:D.top,left:D.left,width:D.width,height:D.height,objectFit:n==="cover"?"cover":"contain",opacity:T&&!P?0:1,transition:T&&!P?`opacity ${zt}ms ${Qt}`:P||w?`top ${zt}ms ${Qt}, left ${zt}ms ${Qt}, width ${zt}ms ${Qt}, height ${zt}ms ${Qt}`:"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:g=>{g.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:g=>{g.stopPropagation(),d()}})]})]})}function su(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function lu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:a,activeEvent:l,layoutId:d}){const{prefix:s}=E.useScopedStyles(),{type:p="a",gridLayout:u,textBoxWidth:L=100,verticalGap:b,entriesCount:y,lightbox:m,imageDisplay:h,lightboxImageDisplay:C,slider:w,sliderTiming:v,direction:x,transition:O,titleMarginTop:R,subtitleMarginTop:B,titleColor:T,subtitleColor:P,lightboxCounterColor:D,titleFontFamily:g,titleFontSettings:$,titleFontSize:A,titleLineHeight:H,titleLetterSpacing:K,titleWordSpacing:Q,titleTextAppearance:k,subtitleFontFamily:_,subtitleFontSettings:I,subtitleFontSize:M,subtitleLineHeight:W,subtitleLetterSpacing:j,subtitleWordSpacing:U,subtitleTextAppearance:ie,lightboxCounterFontFamily:F,lightboxCounterFontSettings:J,lightboxCounterFontSize:f,lightboxCounterLineHeight:ne,lightboxCounterLetterSpacing:Ce,lightboxCounterWordSpacing:ue,lightboxCounterTextAppearance:ye,showText:re="always",alignEntries:me="off"}=e,q={fontSettings:{fontFamily:g,fontWeight:($==null?void 0:$.fontWeight)??400,fontStyle:($==null?void 0:$.fontStyle)??"normal"},fontSize:A??.01,lineHeight:H,letterSpacing:K??0,wordSpacing:Q??0,textAppearance:k,color:T},ae={...Ht(pt(q,n))},oe={fontSettings:{fontFamily:_,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:M??.01,lineHeight:W,letterSpacing:j??0,wordSpacing:U??0,textAppearance:ie,color:P},Re={...Ht(pt(oe,n))},xe={fontSettings:{fontFamily:F,fontWeight:(J==null?void 0:J.fontWeight)??400,fontStyle:(J==null?void 0:J.fontStyle)??"normal"},fontSize:f??.01,lineHeight:ne,letterSpacing:Ce??0,wordSpacing:ue??0,textAppearance:ye,color:D},Le={...Ht(pt(xe,n)),...ao(f,ne,s,n)},z=ro(A,H,`${s}-item-title`,`${s}-text-tight-leading`),de=ro(M,W,`${s}-item-subtitle`,`${s}-text-tight-leading`),N=ao(A,H,s,n),X=ao(M,W,s,n),Y=ro(f,ne,`${s}-lightbox-counter`,`${s}-text-tight-leading`),te=E.buildColorVars(s,{titleColor:T,subtitleColor:P,lightboxCounterColor:D},cu,du),Fe=`${l&&l!=="default"?`${s}-state-${l}`:""}${re==="on hover"&&(!n||i)?` ${s}-show-text-hover`:""}`.trim(),$e=y===0?1/0:y,we=(t??[]).slice(0,$e),Ne=u.entryWidth??.2,se=(h==null?void 0:h.display)==="cover",Ie=(h==null?void 0:h.ratioValue)??"1:1",Ae=(h==null?void 0:h.reversed)??!1,[We,je]=Ie.split(":").map(Number),yt=`${Ae?je:We} / ${Ae?We:je}`,wt=E.scalingValue(Ne??0,n),It=!se&&w!=="off",mt={width:wt,...se?{aspectRatio:yt,height:"auto",overflow:"hidden"}:{height:"auto"}},ut=`${s}-item-image-wrapper${It?` ${s}-item-image-wrapper-fit-slider`:""}`.trim(),Te=p==="c",Je=Te&&me==="on",Ze=`calc(${E.scalingValue(Ne??0,n)} * (${L} / 100))`,et=E.scalingValue(Ne*L/100,n),tt=se?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[$t,vt]=c.useState("ltr"),[_t,bt]=c.useState(0),_e=c.useRef(null);c.useEffect(()=>{const Se=_e.current;if(!Se)return;const Ve=new ResizeObserver(Ke=>{bt(Math.round(Ke[0].contentRect.width))});return Ve.observe(Se),()=>Ve.disconnect()},[]);const it=(()=>{const Se={...te},Ve=_e.current?getComputedStyle(_e.current).getPropertyValue("--cntrl-article-width").trim():"";return Ve&&(Se["--cntrl-article-width"]=Ve),Se})(),[Ge,ze]=c.useState(!1),[at,Nt]=c.useState([]),[V,S]=c.useState(0),[G,pe]=c.useState(null),ge=(Se,Ve,Ke)=>{if(n&&!i||m==="off")return;const Z=Se.currentTarget.getBoundingClientRect();pe({top:Z.top,left:Z.left,width:Z.width,height:Z.height}),Nt(Ve),S(Ke),ze(!0)};c.useEffect(()=>{if(!Ge||m!=="on"||typeof document>"u")return;const Se=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Se}},[Ge,m]),c.useEffect(()=>{!n||i||(ze(!1),pe(null))},[n,i]);const He=c.useMemo(()=>ou(s),[s]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:He}}),r.jsx("div",{style:te,children:r.jsx("div",{ref:_e,className:`${s}-wrapper ${s}-type-${p}${Je?` ${s}-align-entries`:""} ${Fe}`.trim(),style:{gridTemplateColumns:`repeat(${u.columnsCount}, minmax(0, 1fr))`,rowGap:Je?0:E.scalingValue(b??0,n),columnGap:E.scalingValue(u.horizontalGap??0,n),width:E.scalingValue(u.wrapperWidth??0,n),...Je?{[`--${s}-align-entries-row-gap`]:E.scalingValue(b??0,n)}:{}},children:we.map((Se,Ve)=>{var ct,Et;const Ke=Mr(Se.title),Z=Mr(Se.subtitle),fe=(((ct=Se.link)==null?void 0:ct.length)??0)>0&&m==="off"?Se.link:void 0,Ee=Math.floor(Ve/u.columnsCount)===Math.ceil(we.length/u.columnsCount)-1,ke=Te?r.jsxs("div",{className:`${s}-item-text-block`,children:[Ke&&r.jsx("p",{className:z,style:{width:Ze,...ae,...N},children:Se.title}),Ke&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:E.scalingValue(R??0,n),width:et}}),Z&&r.jsx("p",{className:de,style:{width:Ze,...Re,...X},children:Se.subtitle}),Z&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:E.scalingValue(B??0,n),width:et}})]}):null,ot=Te?r.jsxs("div",{className:`${s}-item-title-row`,children:[Ke&&r.jsx("p",{className:z,style:{width:Ze,...ae,...N},children:Se.title}),Ke&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:E.scalingValue(R??0,n),width:et}})]}):null,lt=Te?r.jsxs("div",{className:`${s}-item-subtitle-row`,children:[Z&&r.jsx("p",{className:de,style:{width:Ze,...Re,...X},children:Se.subtitle}),Z&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:E.scalingValue(B??0,n),width:et}})]}):null,Oe=fe?r.jsxs("a",{href:fe,target:"_blank",className:`${s}-item-text-link`,children:[ot,lt]}):r.jsxs(r.Fragment,{children:[ot,lt]}),Tt=r.jsx("div",{className:ut,style:mt,children:(((Et=Se.image)==null?void 0:Et.length)??0)===0?null:w==="off"?(()=>{const Ue=Se.image[0],St=Se.image.filter(gt=>!en(gt)).map(gt=>gt.url);return r.jsx(kr,{media:Ue,className:`${s}-item-${en(Ue)?"video":"image"}`.trim(),style:tt,onImageClick:en(Ue)?void 0:gt=>ge(gt,St,0)})})():r.jsxs(r.Fragment,{children:[It&&r.jsx("div",{className:`${s}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Se.image.map(Ue=>en(Ue)?r.jsx("video",{src:Ue.url,muted:!0,playsInline:!0},`sizer-${Ue.url}`):r.jsx("img",{src:Ue.url,alt:""},`sizer-${Ue.url}`))}),r.jsx(Yo,{className:`${s}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:v*1e3,width:"100%",height:"100%",speed:ru,type:O==="fade"?"fade":"loop",rewind:O==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:O==="fade"?"ltr":x!=="random"?x==="horizontal"?"ltr":"ttb":$t},onMoved:Ue=>{if(x!=="random"||O==="fade")return;const xt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";vt(xt),setTimeout(()=>{Ue.refresh()},0)},children:Se.image.map((Ue,xt)=>{const St=Se.image.filter(dt=>!en(dt)),gt=St.map(dt=>dt.url),vn=St.findIndex(dt=>dt.url===Ue.url);return r.jsx(Jo,{children:r.jsx(kr,{media:Ue,className:`${s}-item-${en(Ue)?"video":"image"}`.trim(),style:tt,onImageClick:en(Ue)?void 0:dt=>ge(dt,gt,vn)})},xt)})},`${O}-${Ne}-${x}-${v}-${_t}-${d}`)]})}),Lt=Te?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&Ke?"titleMarginTop":void 0,className:o&&Ke?`${s}-control`:void 0,style:{height:Ke?E.scalingValue(R??0,n):0,width:et}}),r.jsx("p",{className:z,style:{width:Ze,...ae,...N},children:Se.title}),r.jsx("div",{"data-controls":o&&Z?"subtitleMarginTop":void 0,className:o&&Z?`${s}-control`:void 0,style:{height:Z?E.scalingValue(B??0,n):0,width:et}}),r.jsx("p",{className:de,style:{width:Ze,...Re,...X},children:Se.subtitle})]});return r.jsx("div",{className:`${s}-item`.trim(),children:r.jsx("div",{className:`${o?`${s}-item-inner`:`${s}-item-inner-hidden`}${Je&&Ee?` ${s}-item-inner-last-row`:""}`.trim(),style:{width:(L??0)>100?`calc(${E.scalingValue(Ne??0,n)} * (${L} / 100))`:E.scalingValue(Ne??0,n)},children:Je?r.jsxs(r.Fragment,{children:[Oe,r.jsx("a",{href:fe,target:"_blank",className:`${s}-item-image-link`,children:Tt})]}):r.jsxs("a",{href:fe,target:"_blank",className:`${s}-item-image-link`,children:[ke,Tt,Lt]})})},Ve)})})}),(!n||i)&&Ge&&typeof document<"u"&&m==="on"&&ei.createPortal(r.jsx("div",{style:it,"data-selection":"none",children:r.jsx(au,{images:at,index:V,imageDisplay:su(C),originRect:G,reverseClose:w==="off",onClose:()=>ze(!1),onPrev:()=>S(Se=>(Se-1+at.length)%at.length),onNext:()=>S(Se=>(Se+1)%at.length),counterClassName:Y,counterStyle:Le})}),document.body)]})}const cu={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},du=["hover","focus","filled","success","error"],uu=`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,11 +5014,11 @@ 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
|
+
`,so={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},pu=["titleColor","subtitleColor","lightboxCounterColor"],mu={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:{...so.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:{...so.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:{...so.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:[...pu],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},gu={element:lu,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:mu,sourceCode:uu};function hu(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 fu({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 a=o.play();a&&a.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 Ti(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function yu(e){return String(e??"").trim().length>0}function Wr(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){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Nr(e,t,n,i,o,a,l){const d=E.scalingValue(a,l),s=E.scalingValue(0,l),p=e===0,u=e===t-1&&!o;return{borderTopWidth:p&&n?d:s,borderBottomWidth:!u||i?d:s}}function vu(e,t,n){const i=E.scalingValue(t,n),o=E.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Hr=10;function bu(e){return`
|
|
5018
5018
|
.${e}-wrapper {
|
|
5019
5019
|
display: grid;
|
|
5020
5020
|
align-items: start;
|
|
5021
|
-
min-height: ${
|
|
5021
|
+
min-height: ${Ti(48)};
|
|
5022
5022
|
position: relative;
|
|
5023
5023
|
overflow: visible;
|
|
5024
5024
|
box-sizing: border-box;
|
|
@@ -5140,7 +5140,7 @@ a.${e}-list-item {
|
|
|
5140
5140
|
flex-shrink: 0;
|
|
5141
5141
|
overflow: visible;
|
|
5142
5142
|
box-sizing: border-box;
|
|
5143
|
-
min-width: ${
|
|
5143
|
+
min-width: ${Ti(50)};
|
|
5144
5144
|
position: relative;
|
|
5145
5145
|
display: flex;
|
|
5146
5146
|
align-items: flex-start;
|
|
@@ -5148,7 +5148,7 @@ a.${e}-list-item {
|
|
|
5148
5148
|
|
|
5149
5149
|
.${e}-list-col-last {
|
|
5150
5150
|
flex: 1 1 auto;
|
|
5151
|
-
min-width: ${
|
|
5151
|
+
min-width: ${Ti(50)};
|
|
5152
5152
|
}
|
|
5153
5153
|
|
|
5154
5154
|
.${e}-list-col-title {
|
|
@@ -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 rn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Zo=["AColumn","BColumn","CColumn","DColumn","EColumn"],Xt="cutLabel",Qo=[...Zo,Xt],qi=["A","B","C","D","E"];function Ka(e){return`${e}ColumnVerticalAlign`}const Lo=["Top","Center","Bottom"];function er(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return qi.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function xu(e){const t=er(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Su(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return qi.includes(n)?n:null}function Ga(e,t,n){const i=Su(e);return i?i===t?!1:xu(n[Ka(i)]):!0}function Jn(e){const t=er(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return qi.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Cu(e,t,n){if(Ua(e,t,n))return Jn(e);const i=Jn(e);return i.kind==="baseline"?{kind:"top"}:i}function wu(e){const t=Jn(e);return t.kind==="baseline"?{kind:"top"}:t}function Ua(e,t,n){return Ga(e,n,t)?Jn(e).kind==="baseline":!1}function $u(e){const t={};let n=!1;for(const i of qi){const o=Ka(i),a=e[o];if(e.type==="b"){const l=String(a??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}Ga(a,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Tu(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Lu(e){const t=Jn(e).kind;return t==="baseline"?"center":t}function Eu(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Or(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Iu(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(),a=o-i;return n.remove(),a}function lo(e,t,n,i){const o=e.titleEl;if(!o)return 0;const a=o.closest(`.${n}`);if(!a)return 0;const l=Iu(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=a.getBoundingClientRect(),s=o.getBoundingClientRect().height;let p=0;return e.kind==="center"?p=(d.height-s)/2:e.kind==="bottom"&&(p=d.height-s),d.top-t+p+l}function _u(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const a=o.querySelector(`.${n}`);a&&(a.style.minHeight=`${i}px`,a.style.height=`${i}px`)}),i)}function Ru(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Pu={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Be(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Au={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Mu(e){return[Be(e,"textFontFamily"),Be(e,"textFontSettings"),{type:"row",items:[Be(e,"textFontSize"),Be(e,"textLineHeight"),Be(e,"textLetterSpacing"),Be(e,"textWordSpacing")]},Be(e,"textTextAlign"),Be(e,"textTextAppearance"),`${e}VerticalAlign`]}function ku(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Qo.map(e=>[Au[e],Mu(e)]))}}function Wi(e,t){const n=i=>{const o=Be(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===Xt?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Br(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 Ht(pt(n,t))}function Dr(e,t,n,i){const o=Wi(e,t),a=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<a?`${n} ${i}`:n}function jr(e,t,n,i){const o=Wi(e,t),a=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=a?{}:{[`--${n}-title-leading-gap`]:E.scalingValue((a-l)/2,i)}}const At=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Pn=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],An=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Mn=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Wu={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Fu=["hover","focus","filled","success","error"],zr=.004,$n=.004,co=$n,Vr=12,tr=50,Zn=1440,Qn=tr/Zn;function qa(e){const t=typeof e=="number"&&e>0?e:Zn;return tr/t}function Nu(e,t){const n={position:"absolute",width:Vr,height:Vr,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 Vt({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:Nu(e,i)})})}function Hu(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 Xa={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Dn(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Ou(e,t=1){const n=t/e;return Object.fromEntries(At.map(i=>[i,n]))}function Bu(){return Object.fromEntries([...Pn.map(e=>[e,0]),...An.map(e=>[e,0])])}function Du(){return Object.fromEntries(Mn.map(e=>[e,0]))}function yi(e){return Object.fromEntries(At.map(t=>[t,typeof e[t]=="number"?e[t]:Xa[t]]))}function Ya(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 a=i/o;return{paddingLeft:t*a,paddingRight:n*a}}function Li(e,t,n){const i=nr(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((a,l)=>a+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function ju(e,t,n){const i={};for(let o=0;o<e;o+=1){const a=Pn[o],l=An[o],d=typeof n[a]=="number"?n[a]:0,s=typeof n[l]=="number"?n[l]:0,p=Ya(t[o]??0,d,s);p.paddingLeft!==d&&(i[a]=p.paddingLeft),p.paddingRight!==s&&(i[l]=p.paddingRight)}return i}function nr(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 s=l-t;for(let p=d.length-1;p>=0&&s>0;p-=1){const u=d[p]-Qn;if(u<=0)continue;const L=Math.min(s,u);d[p]-=L,s-=L}return[...d,i[e-1]]}function zu(e,t,n){if(e<=1)return{};const i=nr(e,t,n),o={};for(let a=0;a<e-1;a+=1){const l=At[a];i[a]!==n[l]&&(o[l]=i[a])}return o}function Kr(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...rn]}function Vu(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Ku(e,t,n,i){const o=Math.min(i,e.length,At.length),a={};for(let l=0;l<o;l+=1){const d=e[l],s=t.indexOf(d);if(s===-1)continue;const p=At[s],u=Pn[s],L=An[s],b=Mn[s],y=At[l],m=Pn[l],h=An[l],C=Mn[l],w=n[p],v=n[u],x=n[L],O=n[b];typeof w=="number"&&(a[y]=w),typeof v=="number"&&(a[m]=v),typeof x=="number"&&(a[h]=x),typeof O=="number"&&(a[C]=O)}return a}function Ja(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 Gu(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Dn(e),a=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Ou(n,o),...Bu()};if(a)for(const d of Mn)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Du());return Ja(e,l)?l:e}function Uu(e,t,n){const i=$u(e);i&&(e={...e,...i});const o=qa(n==null?void 0:n.designWidth),a=e.columns,l=t.columns,d=Dn(e),s=Dn(t),p=e.type==="b"||e.type===void 0&&t.type==="b",u=typeof a=="number"?a:typeof l=="number"?l:rn.length,L=x=>{if(p)return x;const O=yi({...t,...x}),R=Dn(x),B=Li(u,R,O),T=ju(u,B,{...t,...x});return Object.keys(T).length===0?x:{...x,...T}};if(typeof a=="number"&&a!==l)return e;const b=Kr(e),y=Kr(t);if(!Vu(b,y))return L({...e,...Ku(b,y,t,u)});if(d<s&&typeof u=="number"&&!p){const x=yi({...t,...e});return L({...e,...zu(u,d,x)})}if(p){const x=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,O=Math.max(0,(d-o)/2);return x>O?{...e,textPaddingLR:O}:e}const m=yi({...t,...e}),h=Li(u,s,yi(t)),w=Li(u,d,m).some((x,O)=>x<(h[O]??x)),v=At.some(x=>{const O=e[x],R=t[x];return typeof O=="number"&&typeof R=="number"&&O!==R});return w||v?L(e):e}function qu(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),a=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(Qn,i-o-a-Qn)}function Xu(e,t){return Math.random()*(t-e)+e}function Yu(e){return Object.fromEntries(At.map(t=>[t,typeof e[t]=="number"?e[t]:Xa[t]]))}function uo(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Ju(e,t,n,i,o,a){return e.slice(0,t).map((l,d)=>{const s=Pn[d],p=An[d],u=Mn[d];return{key:l,textPrefix:Pu[l],widthKey:At[d],width:n[At[d]],paddingLeftKey:s,paddingRightKey:p,paddingBottomKey:u,paddingLeft:i[s],paddingRight:o[p],paddingBottom:a[u]}})}function Zu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:a,layoutId:l,onUpdateSettings:d}){const{prefix:s}=E.useScopedStyles(),p=!!o,{columns:u,type:L,wrapperWidth:b,entriesCount:y,cellMinHeight:m,dividerWidth:h,showVisibility:C,cut:w,showCut:v,cutCellMinHeight:x,cutLabel:O,imageSize:R,imageOnHover:B,entryHoverEffect:T,entryHoverShowOption:P,rowPaddingTop:D,rowPaddingBottom:g,rowPaddingTopB:$,columnsOrder:A,textPaddingLR:H,textColor:K,backgroundColor:Q,dividerColor:k,textHoverColor:_,backgroundHoverColor:I,dividerHoverColor:M}=e,[W,j]=c.useState(void 0),[U,ie]=c.useState(null),F=B==="on"&&(!n||i),J=(w??0)>0,f=L==="b",ne=c.useRef(null),Ce=c.useRef(null),[ue,ye]=c.useState(null),[re,me]=c.useState(Zn),q=qa(re),ee=Math.max(0,((b??0)-q)/2),ae=Math.min(H??0,ee),oe=Math.max(ae,$n),be=((b??0)+q)/2;c.useLayoutEffect(()=>{if(!n){me(Zn);return}const Z=()=>{me(Hu(ne.current))};Z();const fe=ne.current;if(!fe)return;const Ee=new ResizeObserver(Z);Ee.observe(fe);let ke=fe;for(;ke&&!ke.style.getPropertyValue("--cntrl-article-width");)ke=ke.parentElement;return ke&&Ee.observe(ke),()=>Ee.disconnect()},[n,l]),c.useEffect(()=>{j(void 0)},[w,v,t,y]),c.useEffect(()=>{n&&!i&&j(void 0)},[n,i]);const Re=E.buildColorVars(s,{textColor:K,backgroundColor:Q,dividerColor:k,textHoverColor:_,backgroundHoverColor:I,dividerHoverColor:M},Wu,Fu),xe=a&&a!=="default"?`${s}-state-${a}`:"",Le=`${!n||i?T==="default"?`${s}-entry-hover-default`:T==="blinds"?`${s}-entry-hover-blinds`:T==="reveal"?`${s}-entry-hover-reveal`:"":""} ${xe}`.trim(),z=T==="reveal"&&(!n||i),de=(C==null?void 0:C[0])??!1,N=(C==null?void 0:C[1])??!1,X=c.useRef(e),Y=c.useRef(l);c.useEffect(()=>{if(!d||!n){X.current=e,Y.current=l;return}if(Y.current!==l){X.current=e,Y.current=l;return}const Z=X.current;if(!(Z!==e))return;if(typeof Z.columns=="number"&&typeof e.columns=="number"&&Z.columns!==e.columns){X.current=e;return}const Ee=Uu(e,Z,{designWidth:re});X.current=e,Ja(e,Ee)&&d(Ee)},[e,d,n,l,re]);const te=c.useMemo(()=>Yu(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ce=c.useMemo(()=>uo(e,Pn),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),he=c.useMemo(()=>uo(e,An),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Fe=c.useMemo(()=>uo(e,Mn),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),$e=c.useMemo(()=>Array.isArray(A)&&A.length>0?A:[...rn],[A]),we=c.useMemo(()=>Ju($e,u,te,ce,he,Fe),[$e,u,te,ce,he,Fe]),Ne=Dn(e),se=c.useMemo(()=>At.slice(0,u).map(Z=>te[Z]),[u,te]),Ie=c.useMemo(()=>nr(u,Ne,te),[u,Ne,te]),Ae=c.useMemo(()=>Li(u,Ne,te),[u,Ne,te]),We=c.useMemo(()=>we.map((Z,fe)=>Ya(Ae[fe]??0,Z.paddingLeft,Z.paddingRight)),[we,Ae]),je=c.useMemo(()=>{const Z=y===0?1/0:y;return(t??[]).slice(0,Z).map((Ee,ke)=>({id:ke,cells:Object.fromEntries(rn.map(ot=>[ot,Ee[ot]??""])),image:Ee.image,link:Ee.link}))},[t,y]),st=J?W??w:je.length,ft=c.useMemo(()=>J?je.slice(0,st):je,[je,J,st]),yt=J&&st<je.length,wt=ft.length>1||yt,It=[de?`${s}-divider-top`:"",N||wt?`${s}-divider-bottom`:""].filter(Boolean).join(" "),mt=!n||i,ut=()=>{if(!mt)return;const Z=W??w;if(!v){j(je.length);return}j(Math.min(Z+v,je.length))},Te=Z=>E.scalingValue(Z,n??!1),Je=f?$??0:D??0,Ze=g??0,et=m??0,tt=Je+et/2,$t=Math.max(Ze,co),vt=Nr(0,ft.length,de,N,yt,h??0,n??!1).borderTopWidth,_t=ue!=null?`${ue}px`:`calc(${vt} + ${Te(tt)})`,bt=f?"rowPaddingTopB":"rowPaddingTop",_e=we[0],it=we[we.length-1],Ge=We[0],ze=We[We.length-1],at=_e&&Ge?Math.max(Ge.paddingLeft,$n):0,Nt=it&&ze?Math.max(ze.paddingRight,$n):0,V=Ne,S=Z=>{const fe=ne.current;if(!fe)return{x:0,y:0};const Ee=fe.getBoundingClientRect();return{x:Z.clientX-Ee.left+Hr,y:Z.clientY-Ee.top+Hr}},G=(Z,fe)=>{if(!F)return;const Ee=Z.image;if(!(Ee!=null&&Ee.url)){ie(null);return}const{x:ke,y:ot}=S(fe),lt=(R==null?void 0:R.min)??80,Oe=(R==null?void 0:R.max)??320,Tt=(U==null?void 0:U.rowId)===Z.id?U.widthPx:Xu(lt,Oe);ie({rowId:Z.id,url:Ee.url,objectFit:"contain",isVideo:hu(Ee),widthPx:Tt,x:ke,y:ot})},pe=Z=>{if(!F||!U)return;const{x:fe,y:Ee}=S(Z);ie(ke=>!ke||ke.x===fe&&ke.y===Ee?ke:{...ke,x:fe,y:Ee})},ge=()=>{ie(null)},He=Z=>{z&&Wr(Z,s),F&&ie(null)},Se=Z=>{z&&Fr(Z,s)};c.useLayoutEffect(()=>{if(!p||f){ye(null);return}const Z=Ce.current,fe=Z==null?void 0:Z.parentElement;if(!Z||!fe){ye(null);return}const Ee=()=>{const ot=Z.querySelector("[data-list-row]");if(!ot){ye(null);return}const lt=fe.getBoundingClientRect(),Oe=ot.getBoundingClientRect();ye(Oe.top-lt.top+Oe.height/2)};Ee();const ke=new ResizeObserver(Ee);return ke.observe(Z),ke.observe(fe),()=>ke.disconnect()},[p,f,ft,Je,Ze,et,t,e,we,Ae,re,h,de,N,yt]);const Ve=c.useMemo(()=>!f&&Zo.some(Z=>{const fe=Z.charAt(0),Ee=e[`${Z}VerticalAlign`];return Ua(Ee,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 ct=Lt.querySelector(`.${s}-list-col`);ct&&(ct.style.minHeight="",ct.style.height="");const Et=Lt.querySelector(`.${s}-list-col-title`);Et&&(Et.style.transform="")})};if(f||!Ve){fe();return}const Ee=()=>{const Lt=Array.from(Z.querySelectorAll("[data-list-row]")),ct=`${s}-list-col`,Et=`${s}-baseline-probe`;Lt.forEach(Ue=>{Ue.querySelectorAll("[data-list-col]").forEach(xt=>{xt.style.transform="";const St=xt.querySelector(`.${ct}`);St&&(St.style.minHeight="",St.style.height="");const gt=xt.querySelector(`.${s}-list-col-title`);gt&&(gt.style.transform="")})}),Lt.forEach(Ue=>{const xt=Array.from(Ue.querySelectorAll("[data-list-col]"));_u(Ue,xt,ct)}),Z.offsetHeight,Lt.forEach(Ue=>{const xt=Array.from(Ue.querySelectorAll("[data-list-col]")),St=Ue.getBoundingClientRect().top,gt=new Map,vn=xt.map(nt=>{const bn=nt.querySelector(`.${s}-list-col-title`),xn={el:nt,titleEl:bn,letter:nt.getAttribute("data-col-letter")??"",kind:nt.getAttribute("data-valign")??"top",anchor:nt.getAttribute("data-valign-anchor")};return gt.set(xn.letter,xn),xn}),dt=new Map,ui=(nt,bn)=>{const xn=dt.get(nt.letter);if(xn!==void 0)return xn;const rr=nt.anchor?gt.get(nt.anchor):void 0;if(nt.kind!=="baseline"||!rr||bn.has(nt.letter)){const sr=lo(nt,St,ct,Et);return dt.set(nt.letter,sr),sr}bn.add(nt.letter);const as=ui(rr,bn);bn.delete(nt.letter);const ss=lo(nt,St,ct,Et),ls=as-ss;Ru(nt.titleEl,ls);const ar=lo(nt,St,ct,Et);return dt.set(nt.letter,ar),ar};vn.forEach(nt=>ui(nt,new Set))})};let ke=null;const ot=()=>{ke===null&&(ke=requestAnimationFrame(()=>{ke=null,Ee()}))};Ee();const lt=new ResizeObserver(()=>ot());lt.observe(Z);let Oe=!1;return typeof document<"u"&&((Tt=document.fonts)!=null&&Tt.ready)&&document.fonts.ready.then(()=>{Oe||ot()}),()=>{Oe=!0,ke!==null&&(cancelAnimationFrame(ke),ke=null),lt.disconnect(),fe()}},[Ve,f,e,t,re,ft,Ae]);const Ke=c.useMemo(()=>bu(s),[s]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ke}}),r.jsx("div",{style:Re,children:r.jsxs("div",{ref:ne,className:`${s}-wrapper ${Le}${It?` ${It}`:""}${f?` ${s}-type-b`:""}`.trim(),style:{width:E.scalingValue(b??0,n),...!f&&p?{[`--${s}-first-entry-handle-top`]:_t}:{}},onMouseMove:F?pe:void 0,onMouseLeave:F?ge:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[ft.map((Z,fe)=>{var lt;const Ee=(((lt=Z.link)==null?void 0:lt.length)??0)>0,ke=Ee&&(!n||i)?"a":"div",ot=Nr(fe,ft.length,de,N,yt,h??0,n??!1);return r.jsxs(ke,{ref:fe===0?Oe=>{Ce.current=Oe}:void 0,className:`${s}-list-item${Ee||P==="always"?` ${s}-list-item-has-link`:""}`,...Ee?{href:Z.link,target:"_blank"}:{},style:ot,onMouseEnter:Oe=>{z&&(Ee||P==="always")&&Wr(Oe,s),F&&G(Z,Oe)},onMouseLeave:Oe=>{z&&(Ee||P==="always")&&Fr(Oe,s)},children:[Je>0&&r.jsx("div",{className:`${s}-row-padding-handle`,style:{height:Te(Je)}}),r.jsxs("div",{className:`${s}-list-cols-row${f?"":` ${s}-list-cols-row-h`}${p&&fe===0&&f?` ${s}-list-cols-row-controls`:""}`,...f?{}:{"data-list-row":""},style:f?void 0:{minHeight:Te(et)},children:[we.map((Oe,Tt)=>{const Lt=Tt===we.length-1,ct=We[Tt],Et=Oe.paddingBottom,Ue=yu(Z.cells[Oe.key]),xt=f&&Ue&&Et>0,St=f?{minHeight:Te(et)}:{width:Te(Ae[Tt])},gt=f?{paddingLeft:Te(ae),paddingRight:Te(ae)}:{paddingLeft:Te(ct.paddingLeft),paddingRight:Te(ct.paddingRight)},vn=Oe.textPrefix.charAt(0),dt=f?wu(e[`${Oe.textPrefix}VerticalAlign`]):Cu(e[`${Oe.textPrefix}VerticalAlign`],e,vn),ui=f&&Ue&&p&&fe===0;return r.jsxs("div",{className:f?`${s}-list-col-wrap`:void 0,...f?{}:{"data-list-col":"","data-col-letter":vn,"data-valign":dt.kind,...dt.kind==="baseline"?{"data-valign-anchor":dt.anchorLetter}:{}},children:[r.jsx("div",{className:`${s}-list-col${Lt?` ${s}-list-col-last`:""}`,style:{...gt,...St,...f?{justifyContent:Or(dt.kind)}:{}},"data-test":Oe.width,children:r.jsx("span",{className:Dr(e,Oe.textPrefix,`${s}-list-col-title`,`${s}-text-tight-leading`),style:{...Br(Wi(e,Oe.textPrefix),n),...jr(e,Oe.textPrefix,s,n),...f?{}:Tu(dt.kind)},children:Z.cells[Oe.key]??null})}),xt&&r.jsx("div",{className:`${s}-row-padding-handle`,style:{height:Te(Et)}}),ui&&r.jsx(Vt,{P:s,"data-controls":Oe.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Te(Math.max(Et,co))}})]},Oe.key)}),p&&fe===0&&f&&r.jsxs(r.Fragment,{children:[r.jsx(Vt,{P:s,"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(be),className:`${s}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Te(oe),height:"100%"}}),r.jsx(Vt,{P:s,"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(be),className:`${s}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Te(Math.max(oe,Ne-oe)),width:Te(oe),height:"100%"}})]})]}),!f&&Ze>0&&r.jsx("div",{className:`${s}-row-padding-handle`,style:{height:Te(Ze)}}),p&&fe===0&&!f&&r.jsx(Vt,{P:s,"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:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Te($t)}})]},Z.id)}),p&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(Vt,{P:s,"data-controls":bt,"data-controls-static-handle":"",...f?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:f?"center":"left-y",areaStyle:{position:"absolute",top:vt,left:0,width:"100%",height:Te(Math.max(Je,co))}})},"row-padding-handles"),p&&!f&&_e&&it&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Vt,{P:s,"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(Ae[0]-((Ge==null?void 0:Ge.paddingRight)??0)),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Te(at),height:"100%"}}),r.jsx(Vt,{P:s,"data-controls":it.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(Ae[we.length-1]-((ze==null?void 0:ze.paddingLeft)??0)),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Te(V-Nt),width:Te(Nt),height:"100%"}})]},"column-edge-padding-handles"),p&&!f&&we.slice(0,-1).map((Z,fe)=>{const Ee=we[fe+1],ke=Ie.slice(0,fe+1).reduce((Lt,ct)=>Lt+ct,0),ot=We[fe],lt=We[fe+1],Oe=Math.max(ot.paddingRight,$n),Tt=Math.max(lt.paddingLeft,$n);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(Vt,{P:s,"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(Ae[fe]-ot.paddingLeft),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Te(ke-Oe),width:Te(Oe),height:"100%"}}),r.jsx(Vt,{P:s,"data-controls":Ee.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ae[fe+1]-lt.paddingRight),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Te(ke),width:Te(Tt),height:"100%"}})]},`${Z.paddingRightKey}-padding`)}),p&&!f&&we.slice(0,-1).map((Z,fe)=>{const Ee=qu(fe,Ie,se,Ne),ot=Ie.slice(0,fe+1).reduce((lt,Oe)=>lt+Oe,0)-zr/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(tr),"data-controls-max-fraction":String(Ee),"data-controls-variant":"column-width",className:`${s}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Te(ot),width:Te(zr),height:"calc(100%)",pointerEvents:"auto"}})},`${Z.widthKey}-junction`)})]}),yt&&(()=>{const Z=Wi(e,Xt),fe=Lu(e.cutLabelVerticalAlign),Ee=Z.textTextAlign==="justify"||f;return r.jsx("button",{type:"button",className:`${s}-cut-item`,style:{minHeight:Te(x??0),cursor:mt?"pointer":"default",...vu(N,h??0,n??!1)},onClick:mt?ut:void 0,onMouseEnter:z||F?He:void 0,onMouseLeave:z?Se:void 0,children:r.jsx("div",{className:`${s}-list-cols-row`,style:{...f?{paddingLeft:Te(ae),paddingRight:Te(ae)}:{},justifyContent:Eu(Z.textTextAlign),alignItems:Or(fe)},children:r.jsx("span",{className:Dr(e,Xt,`${s}-cut-label`,`${s}-text-tight-leading`),style:{...Br(Z,n),...jr(e,Xt,s,n),...Ee?{width:"100%"}:{}},children:O})})})})(),F&&U&&(()=>{const Z=Ti(U.widthPx),fe={width:Z,height:"auto",maxHeight:Z,objectFit:"contain",left:U.x,top:U.y,position:"absolute"};return r.jsx(fu,{media:U,className:U.isVideo?`${s}-hover-video`:`${s}-hover-image`,style:fe},`${U.rowId}-${U.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"],Gr=[...Lo,"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 ep(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 tp(){return Object.fromEntries(Hn.map((e,t)=>{const n=rn[t],i=`${e} column`;return[n,ep(i)]}))}function np(){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 Ur(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...rn]};for(const a of Hn)i[`${a}ColumnWidth`]=a==="A"?.0798:.32,i[`${a}ColumnPaddingLeft`]=0,i[`${a}ColumnPaddingRight`]=0,i[`${a}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function ip(e){const t={};if(e===Xt)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Lo]},enum:[...Lo]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Gr],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Gr]}}return t[Be(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Be(e,"textFontSettings")]={...dn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Be(e,"textFontSize")]={...dn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Be(e,"textLineHeight")]={...dn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Be(e,"textLetterSpacing")]={...dn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Be(e,"textWordSpacing")]={...dn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Be(e,"textTextAlign")]={...dn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Be(e,"textTextAppearance")]={...dn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const op=Qo.reduce((e,t)=>({...e,...ip(t)}),{});function rp(e){return{verticalAlign:e===Xt?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Xt?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function ap(e,t={}){var n;return{...rp(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const qr=new Set(["textFontFamily","textFontSettings"]);function sp(e,t,n){const i=a=>n===void 0?!0:n==="common"?qr.has(a):!qr.has(a),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=er(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Be(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Be(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Be(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Be(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Be(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Be(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Be(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Be(e,"textTextAppearance")]=t.textTextAppearance),o}function Ei(e={},t){return Qo.reduce((n,i)=>({...n,...sp(i,ap(i,e),t)}),{})}const lp=Ei(),cp=ku();function Za(e){return[Be(e,"textFontFamily"),Be(e,"textFontSettings"),Be(e,"textFontSize"),Be(e,"textLineHeight"),Be(e,"textLetterSpacing"),Be(e,"textWordSpacing"),Be(e,"textTextAlign"),Be(e,"textTextAppearance"),`${e}VerticalAlign`]}function dp(){const e=[];return Zo.forEach((t,n)=>{const i=rn[n],o=Za(t);for(let a=1;a<rn.length;a+=1){const l=[{name:"columns",value:a},...Array.from({length:a},(d,s)=>({name:`columnsOrder.${s}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const up=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Za(Xt);const pp=[...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"}],mp=[{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:""}],gp=[...Hn.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],hp={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:{...tp(),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:mp},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"}},...np(),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"}},...op,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",...lp,...Ei({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Ur({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},...Ei({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Ur({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},...Ei({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...dp(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...pp.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",...gp]},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__",cp]}],paletteBookmark:{items:[...up],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},fp={element:Zu,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Gu(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:hp,sourceCode:Qu},Yt=e=>e.display==="Cover",Xi=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Xr=100,yp=.2,Yr=8,Qa=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,a]=c.useState(0),[l,d]=c.useState(!1),s=c.useRef(null),p=c.useRef(0);p.current=o;const u=c.useMemo(()=>typeof window>"u"?Xr:Math.max(Xr,window.innerHeight*yp),[]),L=c.useCallback(g=>Math.max(0,1-g/(u*1.5)),[u]),b=c.useCallback(g=>Math.max(0,1-g/(u*.45)),[u]),y=c.useCallback(g=>{const $=typeof window<"u"?window.innerHeight:800,A=Math.max(.88,1-g/$*.12);return`translateY(${g}px) scale(${A})`},[]),m=c.useCallback(()=>{s.current=null},[]),h=c.useCallback(()=>{d(!0),a(0),window.setTimeout(()=>d(!1),n),m()},[n,m]),C=c.useCallback(()=>{const g=typeof window<"u"?window.innerHeight:800;d(!0),a(g),window.setTimeout(()=>{t(),m(),d(!1)},Math.min(n,200))},[n,t,m]),w=c.useCallback(g=>{!e||l||g.pointerType==="touch"&&(i!=null&&i(g.target)||(s.current={startX:g.clientX,startY:g.clientY,isLocked:null,pointerId:g.pointerId}))},[e,l,i]),v=c.useCallback(g=>{const $=s.current;if(!e||!$||g.pointerType!=="touch"||$.pointerId!==g.pointerId)return;const A=g.clientX-$.startX,H=g.clientY-$.startY;if($.isLocked===null){if(Math.abs(A)<Yr&&Math.abs(H)<Yr)return;if(H>0&&H>Math.abs(A))$.isLocked=!0,g.currentTarget.setPointerCapture(g.pointerId);else{$.isLocked=!1,m();return}}if(!$.isLocked)return;g.preventDefault();const K=Math.max(0,H);p.current=K,a(K)},[e,m]),x=c.useCallback(g=>{const $=s.current;if(!e||!$||g.pointerType!=="touch"||$.pointerId!==g.pointerId)return;const A=$.isLocked===!0;if(g.currentTarget.hasPointerCapture(g.pointerId)&&g.currentTarget.releasePointerCapture(g.pointerId),!A){m();return}g.clientY-$.startY>=u?C():h()},[u,C,e,m,h]),O=c.useCallback(g=>{x(g)},[x]),R=c.useCallback(g=>{x(g)},[x]),B=o>0,T=l?`transform ${n}ms ease`:"none",P=l?`opacity ${n}ms ease`:"none",D=o>0||l;return{isSwipeDragging:B,backdropStyle:{opacity:L(o),transition:P},mediaAreaStyle:{transform:y(o),transition:T,touchAction:B?"none":void 0,willChange:B?"transform":void 0},chromeStyle:D?{opacity:b(o),transition:P}:void 0,swipeHandlers:e?{onPointerDown:w,onPointerMove:v,onPointerUp:O,onPointerCancel:R}:{},dismissAreaStyle:e?{touchAction:"none"}:void 0}},vp="[data-lightbox-scrollable]",es=()=>{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,a=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 s=d.target;s instanceof Element&&s.closest(vp)||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=a,window.scrollTo(0,e)}},[])},bp=(e,t,{duration:n,ease:i,onFrame:o,onComplete:a})=>{const l=e.scrollLeft,d=t-l;if(Math.abs(d)<.5)return e.scrollLeft=t,a==null||a(),()=>{};const s=performance.now();let p=0;const u=L=>{const b=Math.min((L-s)/n,1);e.scrollLeft=l+d*i(b),o==null||o(),b<1?p=requestAnimationFrame(u):(e.scrollLeft=t,a==null||a())};return p=requestAnimationFrame(u),()=>{cancelAnimationFrame(p)}},xp=(e,t,n,i)=>{const o=3*e,a=3*(n-e)-o,l=1-o-a,d=3*t,s=3*(i-t)-d,p=1-d-s,u=m=>((l*m+a)*m+o)*m,L=m=>((p*m+s)*m+d)*m,b=m=>(3*l*m+2*a)*m+o,y=m=>{let h=m;for(let v=0;v<8;v+=1){const x=u(h)-m;if(Math.abs(x)<1e-6)return h;const O=b(h);if(Math.abs(O)<1e-6)break;h-=x/O}let C=0,w=1;for(h=m;C<w;){const v=u(h);if(Math.abs(v-m)<1e-6)return h;m>v?C=h:w=h,h=(C+w)/2}return h};return m=>m<=0?0:m>=1?1:L(y(m))},jn=300,Sp=750,Cp=3e3,Ii=42,wp=xp(0,0,.2,1);function $p(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 {
|
|
@@ -8600,7 +8601,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8600
8601
|
scrollbar-width: none;
|
|
8601
8602
|
pointer-events: auto;
|
|
8602
8603
|
opacity: 1;
|
|
8603
|
-
transition: opacity ${
|
|
8604
|
+
transition: opacity ${jn}ms ease;
|
|
8604
8605
|
}
|
|
8605
8606
|
|
|
8606
8607
|
.${e}-thumbnails[data-chrome-hidden="true"] {
|
|
@@ -8648,15 +8649,15 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8648
8649
|
|
|
8649
8650
|
.${e}-thumb-image {
|
|
8650
8651
|
display: block;
|
|
8651
|
-
height: ${
|
|
8652
|
+
height: ${Ii}px;
|
|
8652
8653
|
object-fit: contain;
|
|
8653
8654
|
transition: filter 0.2s ease;
|
|
8654
8655
|
}
|
|
8655
8656
|
|
|
8656
8657
|
.${e}-thumb-image-cover {
|
|
8657
8658
|
aspect-ratio: var(--image-aspect-ratio);
|
|
8658
|
-
max-width: ${
|
|
8659
|
-
max-height: ${
|
|
8659
|
+
max-width: ${Ii}px;
|
|
8660
|
+
max-height: ${Ii}px;
|
|
8660
8661
|
width: auto;
|
|
8661
8662
|
height: auto;
|
|
8662
8663
|
object-fit: cover;
|
|
@@ -8674,7 +8675,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8674
8675
|
background-color: transparent;
|
|
8675
8676
|
padding: 0;
|
|
8676
8677
|
opacity: 1;
|
|
8677
|
-
transition: opacity ${
|
|
8678
|
+
transition: opacity ${jn}ms ease;
|
|
8678
8679
|
}
|
|
8679
8680
|
|
|
8680
8681
|
.${e}-close-icon[data-chrome-hidden="true"] {
|
|
@@ -8708,22 +8709,37 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8708
8709
|
min-width: 0;
|
|
8709
8710
|
display: flex;
|
|
8710
8711
|
flex-direction: row;
|
|
8711
|
-
align-items: center;
|
|
8712
8712
|
}
|
|
8713
8713
|
|
|
8714
8714
|
.${e}-title-cell {
|
|
8715
8715
|
position: relative;
|
|
8716
|
-
flex: 0
|
|
8716
|
+
flex: 0 0 auto;
|
|
8717
8717
|
min-width: 0;
|
|
8718
|
+
box-sizing: border-box;
|
|
8718
8719
|
}
|
|
8719
8720
|
|
|
8720
8721
|
.${e}-title1,
|
|
8721
8722
|
.${e}-title2,
|
|
8722
8723
|
.${e}-title3 {
|
|
8723
8724
|
margin: 0;
|
|
8724
|
-
flex-shrink: 1;
|
|
8725
8725
|
min-width: 0;
|
|
8726
8726
|
}
|
|
8727
|
+
|
|
8728
|
+
.${e}-title-resize-handle {
|
|
8729
|
+
background: transparent;
|
|
8730
|
+
}
|
|
8731
|
+
|
|
8732
|
+
.${e}-title-resize-handle::after {
|
|
8733
|
+
content: '';
|
|
8734
|
+
position: absolute;
|
|
8735
|
+
top: 0;
|
|
8736
|
+
left: 50%;
|
|
8737
|
+
transform: translateX(-50%);
|
|
8738
|
+
width: 2px;
|
|
8739
|
+
height: 100%;
|
|
8740
|
+
background: #FF5C02;
|
|
8741
|
+
pointer-events: none;
|
|
8742
|
+
}
|
|
8727
8743
|
.${e}-lightbox-content-inner {
|
|
8728
8744
|
position: absolute;
|
|
8729
8745
|
inset: 0;
|
|
@@ -8737,16 +8753,10 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8737
8753
|
position: relative;
|
|
8738
8754
|
display: flex;
|
|
8739
8755
|
flex-direction: row;
|
|
8740
|
-
align-items: center;
|
|
8741
8756
|
flex: 1;
|
|
8742
8757
|
min-width: 0;
|
|
8743
8758
|
}
|
|
8744
8759
|
|
|
8745
|
-
.${e}-lightbox-chrome-bar {
|
|
8746
|
-
box-sizing: border-box;
|
|
8747
|
-
width: 100%;
|
|
8748
|
-
}
|
|
8749
|
-
|
|
8750
8760
|
.${e}-control {
|
|
8751
8761
|
position: relative;
|
|
8752
8762
|
z-index: 2;
|
|
@@ -8767,8 +8777,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8767
8777
|
z-index: 10;
|
|
8768
8778
|
}
|
|
8769
8779
|
|
|
8770
|
-
.${e}-control[data-controls="contentMarginTop"]::after
|
|
8771
|
-
.${e}-control[data-controls="contentMarginBottom"]::after {
|
|
8780
|
+
.${e}-control[data-controls="contentMarginTop"]::after {
|
|
8772
8781
|
content: '';
|
|
8773
8782
|
position: absolute;
|
|
8774
8783
|
top: 50%;
|
|
@@ -8782,7 +8791,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8782
8791
|
box-sizing: border-box;
|
|
8783
8792
|
pointer-events: none;
|
|
8784
8793
|
}
|
|
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';
|
|
8794
|
+
`}function Tp(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 Lp(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=Tp(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 qe(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const Ep={title1:"1",title2:"2",title3:"3"};function Ip(e){return[qe(e,"fontFamily"),qe(e,"fontSettings"),{type:"row",items:[qe(e,"fontSize"),qe(e,"lineHeight"),qe(e,"letterSpacing"),qe(e,"wordSpacing")]},qe(e,"textAlign"),qe(e,"textAppearance")]}function _p(){return{type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ci.map(e=>[Ep[e],Ip(e)]))}}const Rp={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Pp={title1:.02,title2:.02,title3:.02},Jr=.004,ts=50,Ap=1440,Eo=ts/Ap,po=1;function ns(e,t,n){if(e<=0)return[];const i=n.slice(0,e),o=i.reduce((s,p)=>s+p,0),a=Eo*e;if(o<=t||o<=a)return i;const l=[...i];let d=o-t;for(let s=l.length-1;s>=0&&d>0;s-=1){const p=l[s]-Eo;if(p<=0)continue;const u=Math.min(d,p);l[s]-=u,d-=u}return l}function Mp(e,t,n){return ns(e,t,n)}function kp(e,t,n){const i=t.filter((o,a)=>a!==e).reduce((o,a)=>o+a,0);return Math.max(Eo,n-i)}function Wp(e,t,n,i,o,a,l){const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:a,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d}function mo(e,t){const n=i=>{const o=qe(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[Rp[t]]}}function go(e,t,n){var o,a;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((a=t.fontSettings)==null?void 0:a.fontStyle)??"normal"},fontSize:t.fontSize??Pp[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return pt(i,n)}const Fp=1,Zr=.15,Np=3,Hp=20,ho=e=>`max(${e}, ${Hp}px)`,Op=({prefix:e,images:t,backgroundColor:n,thumbnailGap:i,thumbnailMarginBottom:o,imageGap:a,isEditor:l,isEditMode:d,isPreviewMode:s,closeIcon:p,closeIconMaxWidth:u,closeIconColor:L,closeIconHoverColor:b,thumbnailTrigger:y,thumbnailVisibility:m,thumbnailObjectFit:h,thumbnailActive:C,thumbnailActiveColor:w,title1Width:v,title2Width:x,title3Width:O,title1:R,title2:B,title3:T,title1Style:P,title2Style:D,title3Style:g,contentMarginTop:$,contentMarginLeft:A,contentMarginRight:H,title2MarginLeft:K,title3MarginLeft:Q,onClose:k})=>{const _=!!d,I=!d,M=!d&&(!l||!!s),W=M,j=M,U=Yt(h),ie=U?{"--image-aspect-ratio":Xi(h)}:void 0,F=!!(R||B||T),J=c.useMemo(()=>Wp(e,R,B,T,P,D,g),[e,R,B,T,P,D,g]),f=c.useMemo(()=>({title1Width:v,title2Width:x,title3Width:O}),[v,x,O]),ne=c.useMemo(()=>J.map(V=>f[V.widthKey]),[J,f]),Ce=c.useMemo(()=>ns(J.length,po,ne),[J.length,ne]),ue=c.useMemo(()=>Mp(J.length,po,ne),[J.length,ne]),ye=c.useCallback(V=>E.scalingValue(V,l??!1),[l]),re=c.useMemo(()=>({title2MarginLeft:K,title3MarginLeft:Q}),[K,Q]),me=c.useCallback(V=>{let S=0;for(let G=0;G<=V;G+=1){const pe=J[G];pe!=null&&pe.marginLeftKey&&(S+=re[pe.marginLeftKey]??0),S+=Ce[G]??0}return S},[J,re,Ce]),q=()=>J.flatMap((V,S)=>{const G=V.marginLeftKey?re[V.marginLeftKey]??0:0,pe=[];return V.marginLeftKey&&pe.push(r.jsx("div",{"data-controls":_?V.marginLeftKey:void 0,"data-controls-axis":_?"x":void 0,className:_?`${e}-control`:void 0,style:{width:ye(G),flexShrink:0}},`${V.className}-margin`)),pe.push(r.jsx("div",{className:`${e}-title-cell`,style:{width:ye(ue[S]??0)},children:r.jsx("p",{className:V.className,style:V.style,children:V.text})},V.className)),pe}),ee=()=>J.map((V,S)=>{const G=kp(S,Ce,po),ge=me(S)-Jr/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":V.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(ts),"data-controls-max-fraction":String(G),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ye(ge),width:ye(Jr),height:"100%",pointerEvents:"auto"}})},`${V.widthKey}-junction`)}),ae=c.useRef(null),oe=c.useRef(null),be=c.useRef([]),Re=c.useRef(0),xe=c.useRef({isActive:!1,startX:0,scrollLeft:0,hasMoved:!1}),Pe=c.useRef(null),Le=t.length>1,z=Le?Np:1,de=c.useMemo(()=>Array.from({length:z},()=>t).flat(),[t,z]),[N,X]=c.useState(!1),[Y,te]=c.useState(!1),[ce,he]=c.useState(!0),[Fe,$e]=c.useState(0),we=c.useRef(Fe);we.current=Fe;const Ne=c.useRef(null),se=c.useRef(!1),Ie=c.useRef(null),Ae=c.useRef(null),We=c.useCallback(()=>{I&&(he(!0),Ae.current&&clearTimeout(Ae.current),Ae.current=setTimeout(()=>{xe.current.isActive||he(!1)},Cp))},[I]),je=c.useCallback(()=>{d||se.current||(se.current=!0,te(!1),Ie.current=setTimeout(()=>{k()},jn))},[d,k]),st=c.useCallback(V=>!!(V.closest("[data-controls]")||V.closest(`.${e}-thumbnails`)||V.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ft,backdropStyle:yt,mediaAreaStyle:wt,chromeStyle:It,swipeHandlers:mt,dismissAreaStyle:ut}=Qa({enabled:M,onClose:je,animMs:jn,isBlockedTarget:st}),Te=()=>{if(!Le||t.length===0)return Re.current=0,0;const V=be.current[0],S=be.current[t.length];if(!V||!S)return Re.current;const G=S.offsetLeft-V.offsetLeft;return G>0&&(Re.current=G),Re.current},Je=(V=!1)=>{if(!Le)return;const S=oe.current,G=Te();!S||G<=0||(S.scrollLeft<=0?(S.scrollLeft+=G,V&&(xe.current.scrollLeft+=G)):S.scrollLeft>=G*2&&(S.scrollLeft-=G,V&&(xe.current.scrollLeft-=G)))},Ze=(V=(S=>(S=oe.current)==null?void 0:S.scrollLeft)()??0)=>{let G=0,pe=1/0;return be.current.forEach((ge,He)=>{if(!ge)return;const Se=Math.abs(ge.offsetLeft-V);Se<pe&&(pe=Se,G=He)}),G},et=()=>{!oe.current||t.length===0||Ne.current===null&&$e(Ze()%t.length)},tt=()=>{Ne.current=null,et()},$t=V=>{const S=oe.current;S&&(S.style.scrollSnapType=V?"":"none")},vt=()=>{var V;(V=Pe.current)==null||V.call(Pe),Pe.current=null},_t=(V,S,G,pe)=>{V.scrollLeft=S,Je(),G!==void 0?$e(G):et(),$t(!0),pe==null||pe()},bt=(V,{behavior:S="smooth",activeIndex:G,onComplete:pe}={})=>{const ge=oe.current;if(ge){if(vt(),$t(!1),S==="auto"){_t(ge,V,G,pe);return}Pe.current=bp(ge,V,{duration:Sp,ease:wp,onComplete:()=>{Pe.current=null,_t(ge,V,G,pe)}})}},_e=(V="smooth")=>{if(!oe.current||t.length===0)return;const G=Ze(),pe=be.current[G];pe&&bt(pe.offsetLeft,{behavior:V,activeIndex:G%t.length})},it=(V,S="smooth")=>{const G=oe.current;if(!G||t.length===0)return;const pe=G.scrollLeft-V,ge=Ze(G.scrollLeft),He=be.current[ge],Se=be.current[ge+1],Ve=He?Se?Se.offsetLeft-He.offsetLeft:He.offsetWidth:0;let Ke=ge;Ve>0&&(pe>Ve*Zr?Ke+=1:pe<-Ve*Zr&&(Ke-=1)),Le||(Ke=Math.max(0,Math.min(de.length-1,Ke)));const Z=be.current[Ke];if(!Z){_e(S);return}bt(Z.offsetLeft,{behavior:S,activeIndex:Ke%t.length})},Ge=(V,S="smooth")=>{const G=oe.current,pe=Le?t.length+V:V,ge=be.current[pe];!G||!ge||(S==="smooth"?Ne.current=V:Ne.current=null,$e(V),bt(ge.offsetLeft,{behavior:S,activeIndex:V,onComplete:S==="smooth"?tt:void 0}))},ze=V=>{if(!W||V.pointerType!=="mouse"||V.button!==0||st(V.target))return;const S=oe.current;S&&(vt(),xe.current={isActive:!0,startX:V.clientX,scrollLeft:S.scrollLeft,hasMoved:!1},$t(!1),We(),S.setPointerCapture(V.pointerId))},at=V=>{if(!W||V.pointerType!=="mouse")return;const S=oe.current;if(!S||!xe.current.isActive)return;const G=V.clientX-xe.current.startX;Math.abs(G)>Fp&&(xe.current.hasMoved=!0,X(!0)),xe.current.hasMoved&&(V.preventDefault(),S.scrollLeft=xe.current.scrollLeft-G,Je(!0),et(),We())},Nt=V=>{if(!W||V.pointerType!=="mouse")return;const S=oe.current;if(!S)return;const G=xe.current.hasMoved,pe=xe.current.scrollLeft;xe.current.isActive=!1,X(!1),S.hasPointerCapture(V.pointerId)&&S.releasePointerCapture(V.pointerId),Je(),G?it(pe):($t(!0),et()),We()};return es(),c.useEffect(()=>{const V=requestAnimationFrame(()=>te(!0));return()=>{cancelAnimationFrame(V),vt(),Ie.current&&clearTimeout(Ie.current),Ae.current&&clearTimeout(Ae.current)}},[]),c.useEffect(()=>{if(!I){he(!0);return}We();const V=ae.current;if(!V)return;const S=()=>We();return V.addEventListener("pointermove",S),V.addEventListener("pointerdown",S),()=>{V.removeEventListener("pointermove",S),V.removeEventListener("pointerdown",S),Ae.current&&clearTimeout(Ae.current)}},[I,We]),c.useEffect(()=>{const V=S=>{S.key==="Escape"&&je()};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[je]),c.useLayoutEffect(()=>{Te(),Ge(we.current,"auto")},[a]),c.useLayoutEffect(()=>{Te(),Ge(0,"auto")},[t.length,Le]),c.useEffect(()=>{if(!d)return;const V=oe.current;if(!V)return;const S=G=>{G.preventDefault()};return V.addEventListener("wheel",S,{passive:!1}),V.addEventListener("touchmove",S,{passive:!1}),()=>{V.removeEventListener("wheel",S),V.removeEventListener("touchmove",S)}},[d]),c.useEffect(()=>{const V=oe.current;if(!V)return;let S=null;const G=()=>{Je(),et(),Ne.current!==null&&(S&&clearTimeout(S),S=setTimeout(()=>{Ne.current!==null&&tt()},150))},pe=()=>{Ne.current!==null&&(S&&(clearTimeout(S),S=null),tt())};V.addEventListener("scroll",G,{passive:!0}),V.addEventListener("scrollend",pe);const ge=new ResizeObserver(()=>{Te(),Je(),et()});return ge.observe(V),()=>{S&&clearTimeout(S),vt(),V.removeEventListener("scroll",G),V.removeEventListener("scrollend",pe),ge.disconnect()}},[t.length,Le]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${l?` ${e}-lightbox-editor`:""}${d?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ft||je()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Y?1:0,transition:`opacity ${jn}ms ease`,pointerEvents:Y?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:n,...yt}}),r.jsxs("div",{ref:ae,className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%",...ut},...mt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:wt,onClick:V=>V.stopPropagation(),children:r.jsx("div",{ref:oe,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"",style:{gap:a},"data-mouse-draggable":W&&t.length>0?"true":"false","data-mouse-dragging":N?"true":"false",onPointerDown:ze,onPointerMove:at,onPointerUp:Nt,onPointerCancel:Nt,children:de.map((V,S)=>{const G=V.image.objectFit??"contain",pe=S%t.length,ge=Math.floor(S/t.length),He=ho(a),Se=`calc(-0.5 * (${He} + ${a}))`;return r.jsxs("div",{ref:Ve=>be.current[S]=Ve,className:`${e}-strip-item`,style:{height:"100%"},children:[r.jsx("img",{src:V.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:G}}),_&&pe<t.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Se,width:He,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ge}-${V.image.url}-${pe}`)})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,style:{width:"100%",height:"100%",top:0,bottom:0,...It},children:[r.jsx("div",{"data-controls":_?"contentMarginTop":void 0,"data-controls-static-handle":_?"":void 0,className:_?`${e}-control`:void 0,style:{height:$,width:"100%",pointerEvents:_?"auto":"none"}}),r.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%"},children:[r.jsx("div",{"data-controls":_?"contentMarginLeft":void 0,"data-controls-axis":_?"x":void 0,className:_?`${e}-control`:void 0,style:{width:A,flexShrink:0}}),r.jsxs("div",{className:`${e}-lightbox-content-area`,children:[F&&r.jsxs("div",{className:`${e}-titles-row`,children:[q(),_&&J.length>0?ee():null]}),p&&r.jsx("div",{className:`${e}-close-icon`,"data-chrome-hidden":I&&!ce?"true":"false",style:{width:E.scalingValue(u??0,l),height:E.scalingValue(u??0,l),"--close-icon-hover-color":b},children:r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:je,"aria-label":"Close",children:r.jsx(Ot,{url:p,fill:L,hoverFill:b,className:`${e}-close-icon-img`})})})]}),r.jsx("div",{"data-controls":_?"contentMarginRight":void 0,"data-controls-axis":_?"x":void 0,"data-controls-reverse":_?"":void 0,className:_?`${e}-control`:void 0,style:{width:H,flexShrink:0,pointerEvents:_?"auto":"none"}})]})]}),t.length>1&&m==="on"&&(()=>{const V=ho(o),S=`calc(-0.5 * (${o} + ${V}))`;return r.jsxs("div",{className:`${e}-thumbnails`,"data-lightbox-scrollable":"","data-thumbnail-active":C,"data-chrome-hidden":I&&!ce?"true":"false",onClick:G=>G.stopPropagation(),style:{gap:i,bottom:o,"--thumbnail-active-color":w,...It},children:[t.map((G,pe)=>{const ge=ho(i),He=`calc(-0.5 * (${ge} + ${i}))`;return r.jsxs("div",{style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":Fe===pe?"true":"false",onClick:()=>M&&y==="click"&&Ge(pe),onMouseEnter:()=>j&&y==="hover"&&Ge(pe),"aria-label":G.image.name?`View ${G.image.name}`:`View image ${pe+1}`,"aria-current":Fe===pe?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${U?` ${e}-thumb-image-cover`:""}`,src:G.image.url,alt:"",draggable:!1,style:{...ie,...h.display==="Cover"?{width:Ii}:{width:"100%"}}})}),_&&pe<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:He,width:ge,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${G.image.url}-${pe}`)}),_&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":_?"":void 0,style:{position:"absolute",left:0,right:0,bottom:S,height:V,pointerEvents:"auto",zIndex:3}})]})})()]})]})},Bp=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:a})=>{const{prefix:l}=E.useScopedStyles(),{cover:d,coverFit:s,backgroundColor:p,thumbnailVisibility:u,thumbnailObjectFit:L,thumbnailTrigger:b,thumbnailActive:y,thumbnailActiveColor:m,thumbnailGap:h,thumbnailMarginBottom:C,imageGap:w,title1Width:v,title2Width:x,title3Width:O,title2MarginLeft:R,title3MarginLeft:B,closeIcon:T,closeIconMaxWidth:P,closeIconColor:D,closeIconHoverColor:g,contentMarginTop:$,contentMarginLeft:A,contentMarginRight:H}=e,K=c.useRef(null),[Q,k]=c.useState(!1),_=t??[],{title1:I,title2:M,title3:W}=Lp(_),j=ne=>E.scalingValue(ne,n??!1),U=go("title1",mo(e,"title1"),n),ie=go("title2",mo(e,"title2"),n),F=go("title3",mo(e,"title3"),n),J=()=>{i||_.length===0||n&&!o||k(!0)},f=()=>{k(!1)};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:K,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:$p(l)}}),d?r.jsx("button",{type:"button",className:`${l}-cover ${Yt(s)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:J,style:{display:"block",padding:0,border:"none",background:"transparent",...Yt(s)?{"--image-aspect-ratio":Xi(s)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${l}-cover-image ${Yt(s)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})}):null]}),Q&&typeof document<"u"&&(()=>{const ne=(a?document.getElementById(a):null)??document.body;return ei.createPortal(r.jsx(Op,{prefix:l,images:_,backgroundColor:p,thumbnailGap:j(h),thumbnailMarginBottom:j(C??.02),imageGap:j(w??0),thumbnailVisibility:u,thumbnailObjectFit:L,thumbnailTrigger:b,thumbnailActive:y,thumbnailActiveColor:m,title1Width:v,title2Width:x,title3Width:O,title2MarginLeft:R??0,title3MarginLeft:B??0,title1:I,title2:M,title3:W,title1Style:U,title2Style:ie,title3Style:F,contentMarginTop:j($??0),contentMarginLeft:j(A??0),contentMarginRight:j(H??0),closeIcon:T,closeIconMaxWidth:P,closeIconColor:D,closeIconHoverColor:g,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:f}),ne)})()]})},Dp=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
8786
8795
|
import { createPortal } from 'react-dom';
|
|
8787
8796
|
import { CommonComponentProps } from '../props';
|
|
8788
8797
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -8791,12 +8800,19 @@ import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
|
8791
8800
|
import { textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
8792
8801
|
import { getAspectRatio, isImageRatioCover } from '../utils/imageFitStyles';
|
|
8793
8802
|
import { useLightboxSwipeDismiss } from '../utils/useLightboxSwipeDismiss';
|
|
8803
|
+
import { useLightboxScrollLock } from '../utils/useLightboxScrollLock';
|
|
8804
|
+
import { animateScrollLeft } from '../utils/animateScrollLeft';
|
|
8805
|
+
import { cubicBezierEasing } from '../utils/cubicBezierEasing';
|
|
8794
8806
|
import { LayoutItem, LayoutTab } from '../../types/SchemaV1';
|
|
8795
8807
|
|
|
8796
8808
|
const LIGHTBOX_ANIM_MS = 300;
|
|
8809
|
+
const SNAP_SCROLL_MS = 750;
|
|
8797
8810
|
const CONTROLS_IDLE_MS = 3000;
|
|
8798
8811
|
const THUMB_MAX_SIZE_PX = 42;
|
|
8799
8812
|
|
|
8813
|
+
// Decelerates into the snap — fast start, velocity eases to zero at the end.
|
|
8814
|
+
const easeSnapScroll = cubicBezierEasing(0, 0, 0.2, 1);
|
|
8815
|
+
|
|
8800
8816
|
function getCSS(P: string): string {
|
|
8801
8817
|
return \`
|
|
8802
8818
|
.\${P}-wrapper {
|
|
@@ -8851,6 +8867,7 @@ function getCSS(P: string): string {
|
|
|
8851
8867
|
flex-direction: column;
|
|
8852
8868
|
align-items: center;
|
|
8853
8869
|
justify-content: center;
|
|
8870
|
+
overscroll-behavior: none;
|
|
8854
8871
|
}
|
|
8855
8872
|
|
|
8856
8873
|
.\${P}-lightbox-editor {
|
|
@@ -9050,22 +9067,37 @@ function getCSS(P: string): string {
|
|
|
9050
9067
|
min-width: 0;
|
|
9051
9068
|
display: flex;
|
|
9052
9069
|
flex-direction: row;
|
|
9053
|
-
align-items: center;
|
|
9054
9070
|
}
|
|
9055
9071
|
|
|
9056
9072
|
.\${P}-title-cell {
|
|
9057
9073
|
position: relative;
|
|
9058
|
-
flex: 0
|
|
9074
|
+
flex: 0 0 auto;
|
|
9059
9075
|
min-width: 0;
|
|
9076
|
+
box-sizing: border-box;
|
|
9060
9077
|
}
|
|
9061
9078
|
|
|
9062
9079
|
.\${P}-title1,
|
|
9063
9080
|
.\${P}-title2,
|
|
9064
9081
|
.\${P}-title3 {
|
|
9065
9082
|
margin: 0;
|
|
9066
|
-
flex-shrink: 1;
|
|
9067
9083
|
min-width: 0;
|
|
9068
9084
|
}
|
|
9085
|
+
|
|
9086
|
+
.\${P}-title-resize-handle {
|
|
9087
|
+
background: transparent;
|
|
9088
|
+
}
|
|
9089
|
+
|
|
9090
|
+
.\${P}-title-resize-handle::after {
|
|
9091
|
+
content: '';
|
|
9092
|
+
position: absolute;
|
|
9093
|
+
top: 0;
|
|
9094
|
+
left: 50%;
|
|
9095
|
+
transform: translateX(-50%);
|
|
9096
|
+
width: 2px;
|
|
9097
|
+
height: 100%;
|
|
9098
|
+
background: #FF5C02;
|
|
9099
|
+
pointer-events: none;
|
|
9100
|
+
}
|
|
9069
9101
|
.\${P}-lightbox-content-inner {
|
|
9070
9102
|
position: absolute;
|
|
9071
9103
|
inset: 0;
|
|
@@ -9079,16 +9111,10 @@ function getCSS(P: string): string {
|
|
|
9079
9111
|
position: relative;
|
|
9080
9112
|
display: flex;
|
|
9081
9113
|
flex-direction: row;
|
|
9082
|
-
align-items: center;
|
|
9083
9114
|
flex: 1;
|
|
9084
9115
|
min-width: 0;
|
|
9085
9116
|
}
|
|
9086
9117
|
|
|
9087
|
-
.\${P}-lightbox-chrome-bar {
|
|
9088
|
-
box-sizing: border-box;
|
|
9089
|
-
width: 100%;
|
|
9090
|
-
}
|
|
9091
|
-
|
|
9092
9118
|
.\${P}-control {
|
|
9093
9119
|
position: relative;
|
|
9094
9120
|
z-index: 2;
|
|
@@ -9109,8 +9135,7 @@ function getCSS(P: string): string {
|
|
|
9109
9135
|
z-index: 10;
|
|
9110
9136
|
}
|
|
9111
9137
|
|
|
9112
|
-
.\${P}-control[data-controls="contentMarginTop"]::after
|
|
9113
|
-
.\${P}-control[data-controls="contentMarginBottom"]::after {
|
|
9138
|
+
.\${P}-control[data-controls="contentMarginTop"]::after {
|
|
9114
9139
|
content: '';
|
|
9115
9140
|
position: absolute;
|
|
9116
9141
|
top: 50%;
|
|
@@ -9201,9 +9226,7 @@ export type LightboxStripSettings = {
|
|
|
9201
9226
|
ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
|
|
9202
9227
|
reversed: boolean;
|
|
9203
9228
|
};
|
|
9204
|
-
type: 'A' | 'B';
|
|
9205
9229
|
backgroundColor: string;
|
|
9206
|
-
contentBackgroundColor?: string;
|
|
9207
9230
|
thumbnailVisibility: 'on' | 'off';
|
|
9208
9231
|
thumbnailObjectFit: {
|
|
9209
9232
|
display: 'Fit' | 'Cover';
|
|
@@ -9216,9 +9239,11 @@ export type LightboxStripSettings = {
|
|
|
9216
9239
|
thumbnailGap: number;
|
|
9217
9240
|
thumbnailMarginBottom?: number;
|
|
9218
9241
|
imageGap?: number;
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
|
|
9242
|
+
title1Width: number;
|
|
9243
|
+
title2Width: number;
|
|
9244
|
+
title3Width: number;
|
|
9245
|
+
title2MarginLeft: number;
|
|
9246
|
+
title3MarginLeft: number;
|
|
9222
9247
|
title1Color: string;
|
|
9223
9248
|
title2Color: string;
|
|
9224
9249
|
title3Color: string;
|
|
@@ -9247,7 +9272,6 @@ export type LightboxStripSettings = {
|
|
|
9247
9272
|
title3TextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
9248
9273
|
title3TextAppearance?: TextStyles['textAppearance'];
|
|
9249
9274
|
contentMarginTop: number;
|
|
9250
|
-
contentMarginBottom: number;
|
|
9251
9275
|
contentMarginLeft: number;
|
|
9252
9276
|
contentMarginRight: number;
|
|
9253
9277
|
closeIcon: string | null;
|
|
@@ -9353,6 +9377,143 @@ const STRIP_TEXT_STYLE_DEFAULT_FONT_SIZES: Record<StripTextStylePrefix, number>
|
|
|
9353
9377
|
title3: 0.02,
|
|
9354
9378
|
};
|
|
9355
9379
|
|
|
9380
|
+
export const STRIP_TITLE_WIDTH_KEYS = ['title1Width', 'title2Width', 'title3Width'] as const;
|
|
9381
|
+
|
|
9382
|
+
export type StripTitleWidthKey = typeof STRIP_TITLE_WIDTH_KEYS[number];
|
|
9383
|
+
|
|
9384
|
+
const TITLE_RESIZE_HANDLE_WIDTH = 0.004;
|
|
9385
|
+
const MIN_TITLE_WIDTH_PX = 50;
|
|
9386
|
+
const ARTICLE_DESIGN_WIDTH = 1440;
|
|
9387
|
+
const MIN_TITLE_WIDTH = MIN_TITLE_WIDTH_PX / ARTICLE_DESIGN_WIDTH;
|
|
9388
|
+
const STRIP_TITLES_CONTENT_WIDTH = 1;
|
|
9389
|
+
|
|
9390
|
+
const DEFAULT_STRIP_TITLE_WIDTHS: Record<StripTitleWidthKey, number> = {
|
|
9391
|
+
title1Width: 0.13,
|
|
9392
|
+
title2Width: 0.13,
|
|
9393
|
+
title3Width: 0.14,
|
|
9394
|
+
};
|
|
9395
|
+
|
|
9396
|
+
function getStripTitleWidthsFromSettings(
|
|
9397
|
+
settings: LightboxStripSettings,
|
|
9398
|
+
): Record<StripTitleWidthKey, number> {
|
|
9399
|
+
return Object.fromEntries(
|
|
9400
|
+
STRIP_TITLE_WIDTH_KEYS.map((key) => [
|
|
9401
|
+
key,
|
|
9402
|
+
typeof settings[key] === 'number' ? settings[key] : DEFAULT_STRIP_TITLE_WIDTHS[key],
|
|
9403
|
+
]),
|
|
9404
|
+
) as Record<StripTitleWidthKey, number>;
|
|
9405
|
+
}
|
|
9406
|
+
|
|
9407
|
+
function resolveStripTitleWidths(
|
|
9408
|
+
count: number,
|
|
9409
|
+
contentWidth: number,
|
|
9410
|
+
storedWidths: number[],
|
|
9411
|
+
): number[] {
|
|
9412
|
+
if (count <= 0) {
|
|
9413
|
+
return [];
|
|
9414
|
+
}
|
|
9415
|
+
|
|
9416
|
+
const widths = storedWidths.slice(0, count);
|
|
9417
|
+
const totalWidth = widths.reduce((sum, width) => sum + width, 0);
|
|
9418
|
+
const minTotalWidth = MIN_TITLE_WIDTH * count;
|
|
9419
|
+
|
|
9420
|
+
if (totalWidth <= contentWidth || totalWidth <= minTotalWidth) {
|
|
9421
|
+
return widths;
|
|
9422
|
+
}
|
|
9423
|
+
|
|
9424
|
+
const resolvedWidths = [...widths];
|
|
9425
|
+
let overflow = totalWidth - contentWidth;
|
|
9426
|
+
|
|
9427
|
+
for (let index = resolvedWidths.length - 1; index >= 0 && overflow > 0; index -= 1) {
|
|
9428
|
+
const shrinkable = resolvedWidths[index] - MIN_TITLE_WIDTH;
|
|
9429
|
+
if (shrinkable <= 0) {
|
|
9430
|
+
continue;
|
|
9431
|
+
}
|
|
9432
|
+
|
|
9433
|
+
const shrinkAmount = Math.min(overflow, shrinkable);
|
|
9434
|
+
resolvedWidths[index] -= shrinkAmount;
|
|
9435
|
+
overflow -= shrinkAmount;
|
|
9436
|
+
}
|
|
9437
|
+
|
|
9438
|
+
return resolvedWidths;
|
|
9439
|
+
}
|
|
9440
|
+
|
|
9441
|
+
function getEffectiveStripTitleWidths(
|
|
9442
|
+
count: number,
|
|
9443
|
+
contentWidth: number,
|
|
9444
|
+
storedWidths: number[],
|
|
9445
|
+
): number[] {
|
|
9446
|
+
return resolveStripTitleWidths(count, contentWidth, storedWidths);
|
|
9447
|
+
}
|
|
9448
|
+
|
|
9449
|
+
function getStripTitleMaxWidth(
|
|
9450
|
+
columnIndex: number,
|
|
9451
|
+
resolvedWidths: number[],
|
|
9452
|
+
contentWidth: number,
|
|
9453
|
+
): number {
|
|
9454
|
+
const otherWidths = resolvedWidths
|
|
9455
|
+
.filter((_, index) => index !== columnIndex)
|
|
9456
|
+
.reduce((sum, width) => sum + width, 0);
|
|
9457
|
+
|
|
9458
|
+
return Math.max(
|
|
9459
|
+
MIN_TITLE_WIDTH,
|
|
9460
|
+
contentWidth - otherWidths,
|
|
9461
|
+
);
|
|
9462
|
+
}
|
|
9463
|
+
|
|
9464
|
+
type StripTitleSlot = {
|
|
9465
|
+
prefix: StripTextStylePrefix;
|
|
9466
|
+
widthKey: StripTitleWidthKey;
|
|
9467
|
+
marginLeftKey?: 'title2MarginLeft' | 'title3MarginLeft';
|
|
9468
|
+
className: string;
|
|
9469
|
+
style: React.CSSProperties;
|
|
9470
|
+
text: string;
|
|
9471
|
+
};
|
|
9472
|
+
|
|
9473
|
+
function buildStripTitleSlots(
|
|
9474
|
+
prefix: string,
|
|
9475
|
+
title1: string,
|
|
9476
|
+
title2: string,
|
|
9477
|
+
title3: string,
|
|
9478
|
+
title1Style: React.CSSProperties,
|
|
9479
|
+
title2Style: React.CSSProperties,
|
|
9480
|
+
title3Style: React.CSSProperties,
|
|
9481
|
+
): StripTitleSlot[] {
|
|
9482
|
+
const slots: StripTitleSlot[] = [];
|
|
9483
|
+
|
|
9484
|
+
if (title1) {
|
|
9485
|
+
slots.push({
|
|
9486
|
+
prefix: 'title1',
|
|
9487
|
+
widthKey: 'title1Width',
|
|
9488
|
+
className: \`\${prefix}-title1\`,
|
|
9489
|
+
style: title1Style,
|
|
9490
|
+
text: title1,
|
|
9491
|
+
});
|
|
9492
|
+
}
|
|
9493
|
+
if (title2) {
|
|
9494
|
+
slots.push({
|
|
9495
|
+
prefix: 'title2',
|
|
9496
|
+
widthKey: 'title2Width',
|
|
9497
|
+
marginLeftKey: 'title2MarginLeft',
|
|
9498
|
+
className: \`\${prefix}-title2\`,
|
|
9499
|
+
style: title2Style,
|
|
9500
|
+
text: title2,
|
|
9501
|
+
});
|
|
9502
|
+
}
|
|
9503
|
+
if (title3) {
|
|
9504
|
+
slots.push({
|
|
9505
|
+
prefix: 'title3',
|
|
9506
|
+
widthKey: 'title3Width',
|
|
9507
|
+
marginLeftKey: 'title3MarginLeft',
|
|
9508
|
+
className: \`\${prefix}-title3\`,
|
|
9509
|
+
style: title3Style,
|
|
9510
|
+
text: title3,
|
|
9511
|
+
});
|
|
9512
|
+
}
|
|
9513
|
+
|
|
9514
|
+
return slots;
|
|
9515
|
+
}
|
|
9516
|
+
|
|
9356
9517
|
function resolveStripTextFields(
|
|
9357
9518
|
settings: LightboxStripSettings,
|
|
9358
9519
|
prefix: StripTextStylePrefix,
|
|
@@ -9403,12 +9564,10 @@ function stripTextFieldsToCss(
|
|
|
9403
9564
|
|
|
9404
9565
|
type LightboxOverlayProps = {
|
|
9405
9566
|
prefix: string;
|
|
9406
|
-
type: 'A' | 'B';
|
|
9407
9567
|
images: LightboxStripItem[];
|
|
9408
9568
|
backgroundColor: string;
|
|
9409
9569
|
thumbnailGap: string;
|
|
9410
9570
|
thumbnailMarginBottom: string;
|
|
9411
|
-
contentBackgroundColor?: string;
|
|
9412
9571
|
imageGap: string;
|
|
9413
9572
|
closeIcon: string | null;
|
|
9414
9573
|
closeIconMaxWidth: number;
|
|
@@ -9423,9 +9582,9 @@ type LightboxOverlayProps = {
|
|
|
9423
9582
|
thumbnailTrigger: 'click' | 'hover';
|
|
9424
9583
|
thumbnailActive: 'outline' | 'color' | 'scale-up';
|
|
9425
9584
|
thumbnailActiveColor: string;
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
|
|
9585
|
+
title1Width: number;
|
|
9586
|
+
title2Width: number;
|
|
9587
|
+
title3Width: number;
|
|
9429
9588
|
title1: string;
|
|
9430
9589
|
title2: string;
|
|
9431
9590
|
title3: string;
|
|
@@ -9433,9 +9592,10 @@ type LightboxOverlayProps = {
|
|
|
9433
9592
|
title2Style: React.CSSProperties;
|
|
9434
9593
|
title3Style: React.CSSProperties;
|
|
9435
9594
|
contentMarginTop: string;
|
|
9436
|
-
contentMarginBottom: string;
|
|
9437
9595
|
contentMarginLeft: string;
|
|
9438
9596
|
contentMarginRight: string;
|
|
9597
|
+
title2MarginLeft: number;
|
|
9598
|
+
title3MarginLeft: number;
|
|
9439
9599
|
isEditor?: boolean;
|
|
9440
9600
|
isEditMode?: boolean;
|
|
9441
9601
|
isPreviewMode?: boolean;
|
|
@@ -9452,9 +9612,7 @@ const getGapControlSize = (gap: string) => \`max(\${gap}, \${GAP_LABEL_AREA_PX}p
|
|
|
9452
9612
|
const LightboxOverlay = ({
|
|
9453
9613
|
prefix: P,
|
|
9454
9614
|
images,
|
|
9455
|
-
type,
|
|
9456
9615
|
backgroundColor,
|
|
9457
|
-
contentBackgroundColor,
|
|
9458
9616
|
thumbnailGap,
|
|
9459
9617
|
thumbnailMarginBottom,
|
|
9460
9618
|
imageGap,
|
|
@@ -9470,9 +9628,9 @@ const LightboxOverlay = ({
|
|
|
9470
9628
|
thumbnailObjectFit,
|
|
9471
9629
|
thumbnailActive,
|
|
9472
9630
|
thumbnailActiveColor,
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9631
|
+
title1Width,
|
|
9632
|
+
title2Width,
|
|
9633
|
+
title3Width,
|
|
9476
9634
|
title1,
|
|
9477
9635
|
title2,
|
|
9478
9636
|
title3,
|
|
@@ -9480,9 +9638,10 @@ const LightboxOverlay = ({
|
|
|
9480
9638
|
title2Style,
|
|
9481
9639
|
title3Style,
|
|
9482
9640
|
contentMarginTop,
|
|
9483
|
-
contentMarginBottom,
|
|
9484
9641
|
contentMarginLeft,
|
|
9485
9642
|
contentMarginRight,
|
|
9643
|
+
title2MarginLeft,
|
|
9644
|
+
title3MarginLeft,
|
|
9486
9645
|
onClose,
|
|
9487
9646
|
}: LightboxOverlayProps) => {
|
|
9488
9647
|
const showControls = Boolean(isEditMode);
|
|
@@ -9517,40 +9676,118 @@ const LightboxOverlay = ({
|
|
|
9517
9676
|
};
|
|
9518
9677
|
|
|
9519
9678
|
const hasTitles = Boolean(title1 || title2 || title3);
|
|
9679
|
+
const titleSlots = useMemo(
|
|
9680
|
+
() => buildStripTitleSlots(P, title1, title2, title3, title1Style, title2Style, title3Style),
|
|
9681
|
+
[P, title1, title2, title3, title1Style, title2Style, title3Style],
|
|
9682
|
+
);
|
|
9683
|
+
const titleWidthByKey = useMemo(
|
|
9684
|
+
() => ({
|
|
9685
|
+
title1Width,
|
|
9686
|
+
title2Width,
|
|
9687
|
+
title3Width,
|
|
9688
|
+
}),
|
|
9689
|
+
[title1Width, title2Width, title3Width],
|
|
9690
|
+
);
|
|
9691
|
+
const storedTitleWidths = useMemo(
|
|
9692
|
+
() => titleSlots.map((slot) => titleWidthByKey[slot.widthKey]),
|
|
9693
|
+
[titleSlots, titleWidthByKey],
|
|
9694
|
+
);
|
|
9695
|
+
const resolvedTitleWidths = useMemo(
|
|
9696
|
+
() => resolveStripTitleWidths(titleSlots.length, STRIP_TITLES_CONTENT_WIDTH, storedTitleWidths),
|
|
9697
|
+
[titleSlots.length, storedTitleWidths],
|
|
9698
|
+
);
|
|
9699
|
+
const effectiveTitleWidths = useMemo(
|
|
9700
|
+
() => getEffectiveStripTitleWidths(titleSlots.length, STRIP_TITLES_CONTENT_WIDTH, storedTitleWidths),
|
|
9701
|
+
[titleSlots.length, storedTitleWidths],
|
|
9702
|
+
);
|
|
9703
|
+
const scaledTitleWidth = useCallback(
|
|
9704
|
+
(value: number) => scalingValue(value, isEditor ?? false),
|
|
9705
|
+
[isEditor],
|
|
9706
|
+
);
|
|
9707
|
+
const titleMarginLeftByKey = useMemo(
|
|
9708
|
+
() => ({
|
|
9709
|
+
title2MarginLeft,
|
|
9710
|
+
title3MarginLeft,
|
|
9711
|
+
}),
|
|
9712
|
+
[title2MarginLeft, title3MarginLeft],
|
|
9713
|
+
);
|
|
9714
|
+
const getTitleBoundaryOffset = useCallback(
|
|
9715
|
+
(upToIndex: number) => {
|
|
9716
|
+
let offset = 0;
|
|
9717
|
+
for (let index = 0; index <= upToIndex; index += 1) {
|
|
9718
|
+
const slot = titleSlots[index];
|
|
9719
|
+
if (slot?.marginLeftKey) {
|
|
9720
|
+
offset += titleMarginLeftByKey[slot.marginLeftKey] ?? 0;
|
|
9721
|
+
}
|
|
9722
|
+
offset += resolvedTitleWidths[index] ?? 0;
|
|
9723
|
+
}
|
|
9724
|
+
return offset;
|
|
9725
|
+
},
|
|
9726
|
+
[titleSlots, titleMarginLeftByKey, resolvedTitleWidths],
|
|
9727
|
+
);
|
|
9520
9728
|
|
|
9521
|
-
const renderTitles = (
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
gapKey?: 'title1Gap' | 'title2Gap';
|
|
9527
|
-
gap?: string;
|
|
9528
|
-
};
|
|
9729
|
+
const renderTitles = () => titleSlots.flatMap((slot, index) => {
|
|
9730
|
+
const marginLeft = slot.marginLeftKey
|
|
9731
|
+
? titleMarginLeftByKey[slot.marginLeftKey] ?? 0
|
|
9732
|
+
: 0;
|
|
9733
|
+
const elements = [];
|
|
9529
9734
|
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9735
|
+
if (slot.marginLeftKey) {
|
|
9736
|
+
elements.push(
|
|
9737
|
+
<div
|
|
9738
|
+
key={\`\${slot.className}-margin\`}
|
|
9739
|
+
data-controls={showControls ? slot.marginLeftKey : undefined}
|
|
9740
|
+
data-controls-axis={showControls ? 'x' : undefined}
|
|
9741
|
+
className={showControls ? \`\${P}-control\` : undefined}
|
|
9742
|
+
style={{ width: scaledTitleWidth(marginLeft), flexShrink: 0 }}
|
|
9743
|
+
/>,
|
|
9744
|
+
);
|
|
9539
9745
|
}
|
|
9540
9746
|
|
|
9541
|
-
|
|
9747
|
+
elements.push(
|
|
9542
9748
|
<div
|
|
9543
9749
|
key={slot.className}
|
|
9544
9750
|
className={\`\${P}-title-cell\`}
|
|
9545
|
-
style={
|
|
9751
|
+
style={{ width: scaledTitleWidth(effectiveTitleWidths[index] ?? 0) }}
|
|
9546
9752
|
>
|
|
9547
|
-
<p className={slot.className} style={
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9753
|
+
<p className={slot.className} style={slot.style}>{slot.text}</p>
|
|
9754
|
+
</div>,
|
|
9755
|
+
);
|
|
9756
|
+
|
|
9757
|
+
return elements;
|
|
9758
|
+
});
|
|
9759
|
+
|
|
9760
|
+
const renderTitleWidthControls = () => titleSlots.map((slot, colIndex) => {
|
|
9761
|
+
const maxTitleWidth = getStripTitleMaxWidth(
|
|
9762
|
+
colIndex,
|
|
9763
|
+
resolvedTitleWidths,
|
|
9764
|
+
STRIP_TITLES_CONTENT_WIDTH,
|
|
9765
|
+
);
|
|
9766
|
+
const boundaryOffset = getTitleBoundaryOffset(colIndex);
|
|
9767
|
+
const titleWidthHandleOffset = boundaryOffset - TITLE_RESIZE_HANDLE_WIDTH / 2;
|
|
9768
|
+
|
|
9769
|
+
return (
|
|
9770
|
+
<div key={\`\${slot.widthKey}-junction\`} style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
|
|
9771
|
+
<div
|
|
9772
|
+
data-controls={slot.widthKey}
|
|
9773
|
+
data-controls-static-handle=""
|
|
9774
|
+
data-controls-axis="x"
|
|
9775
|
+
data-controls-min={String(MIN_TITLE_WIDTH_PX)}
|
|
9776
|
+
data-controls-max-fraction={String(maxTitleWidth)}
|
|
9777
|
+
data-controls-variant="column-width"
|
|
9778
|
+
className={\`\${P}-title-resize-handle\`}
|
|
9779
|
+
style={{
|
|
9780
|
+
position: 'absolute',
|
|
9781
|
+
top: 0,
|
|
9782
|
+
left: scaledTitleWidth(titleWidthHandleOffset),
|
|
9783
|
+
width: scaledTitleWidth(TITLE_RESIZE_HANDLE_WIDTH),
|
|
9784
|
+
height: '100%',
|
|
9785
|
+
pointerEvents: 'auto',
|
|
9786
|
+
}}
|
|
9787
|
+
/>
|
|
9551
9788
|
</div>
|
|
9552
|
-
)
|
|
9553
|
-
};
|
|
9789
|
+
);
|
|
9790
|
+
});
|
|
9554
9791
|
const dismissAreaRef = useRef<HTMLDivElement>(null);
|
|
9555
9792
|
const stripRef = useRef<HTMLDivElement>(null);
|
|
9556
9793
|
const itemRefs = useRef<(HTMLDivElement | null)[]>([]);
|
|
@@ -9561,6 +9798,7 @@ const LightboxOverlay = ({
|
|
|
9561
9798
|
scrollLeft: 0,
|
|
9562
9799
|
hasMoved: false,
|
|
9563
9800
|
});
|
|
9801
|
+
const scrollAnimRef = useRef<(() => void) | null>(null);
|
|
9564
9802
|
const isLoopEnabled = images.length > 1;
|
|
9565
9803
|
const loopCopies = isLoopEnabled ? LOOP_COPIES : 1;
|
|
9566
9804
|
const flatItems = useMemo(
|
|
@@ -9611,6 +9849,7 @@ const LightboxOverlay = ({
|
|
|
9611
9849
|
mediaAreaStyle,
|
|
9612
9850
|
chromeStyle: swipeChromeStyle,
|
|
9613
9851
|
swipeHandlers,
|
|
9852
|
+
dismissAreaStyle,
|
|
9614
9853
|
} = useLightboxSwipeDismiss({
|
|
9615
9854
|
enabled: allowImageScroll,
|
|
9616
9855
|
onClose: handleClose,
|
|
@@ -9677,23 +9916,74 @@ const LightboxOverlay = ({
|
|
|
9677
9916
|
updateActiveIndex();
|
|
9678
9917
|
};
|
|
9679
9918
|
|
|
9919
|
+
const setStripSnapEnabled = (enabled: boolean) => {
|
|
9920
|
+
const strip = stripRef.current;
|
|
9921
|
+
if (!strip) return;
|
|
9922
|
+
strip.style.scrollSnapType = enabled ? '' : 'none';
|
|
9923
|
+
};
|
|
9924
|
+
|
|
9925
|
+
const cancelScrollAnimation = () => {
|
|
9926
|
+
scrollAnimRef.current?.();
|
|
9927
|
+
scrollAnimRef.current = null;
|
|
9928
|
+
};
|
|
9929
|
+
|
|
9930
|
+
const finishStripScroll = (
|
|
9931
|
+
strip: HTMLDivElement,
|
|
9932
|
+
targetLeft: number,
|
|
9933
|
+
activeIndex?: number,
|
|
9934
|
+
onComplete?: () => void,
|
|
9935
|
+
) => {
|
|
9936
|
+
strip.scrollLeft = targetLeft;
|
|
9937
|
+
normalizeInfiniteScroll();
|
|
9938
|
+
if (activeIndex !== undefined) {
|
|
9939
|
+
setActiveIndex(activeIndex);
|
|
9940
|
+
} else {
|
|
9941
|
+
updateActiveIndex();
|
|
9942
|
+
}
|
|
9943
|
+
setStripSnapEnabled(true);
|
|
9944
|
+
onComplete?.();
|
|
9945
|
+
};
|
|
9946
|
+
|
|
9947
|
+
const scrollStripTo = (
|
|
9948
|
+
targetLeft: number,
|
|
9949
|
+
{
|
|
9950
|
+
behavior = 'smooth',
|
|
9951
|
+
activeIndex,
|
|
9952
|
+
onComplete,
|
|
9953
|
+
}: {
|
|
9954
|
+
behavior?: ScrollBehavior;
|
|
9955
|
+
activeIndex?: number;
|
|
9956
|
+
onComplete?: () => void;
|
|
9957
|
+
} = {},
|
|
9958
|
+
) => {
|
|
9959
|
+
const strip = stripRef.current;
|
|
9960
|
+
if (!strip) return;
|
|
9961
|
+
|
|
9962
|
+
cancelScrollAnimation();
|
|
9963
|
+
setStripSnapEnabled(false);
|
|
9964
|
+
|
|
9965
|
+
if (behavior === 'auto') {
|
|
9966
|
+
finishStripScroll(strip, targetLeft, activeIndex, onComplete);
|
|
9967
|
+
return;
|
|
9968
|
+
}
|
|
9969
|
+
|
|
9970
|
+
scrollAnimRef.current = animateScrollLeft(strip, targetLeft, {
|
|
9971
|
+
duration: SNAP_SCROLL_MS,
|
|
9972
|
+
ease: easeSnapScroll,
|
|
9973
|
+
onComplete: () => {
|
|
9974
|
+
scrollAnimRef.current = null;
|
|
9975
|
+
finishStripScroll(strip, targetLeft, activeIndex, onComplete);
|
|
9976
|
+
},
|
|
9977
|
+
});
|
|
9978
|
+
};
|
|
9979
|
+
|
|
9680
9980
|
const snapToNearestItem = (behavior: ScrollBehavior = 'smooth') => {
|
|
9681
9981
|
const strip = stripRef.current;
|
|
9682
9982
|
if (!strip || images.length === 0) return;
|
|
9683
9983
|
const flatIndex = getNearestFlatIndex();
|
|
9684
9984
|
const item = itemRefs.current[flatIndex];
|
|
9685
9985
|
if (!item) return;
|
|
9686
|
-
|
|
9687
|
-
left: item.offsetLeft,
|
|
9688
|
-
behavior,
|
|
9689
|
-
});
|
|
9690
|
-
setActiveIndex(flatIndex % images.length);
|
|
9691
|
-
};
|
|
9692
|
-
|
|
9693
|
-
const setStripSnapEnabled = (enabled: boolean) => {
|
|
9694
|
-
const strip = stripRef.current;
|
|
9695
|
-
if (!strip) return;
|
|
9696
|
-
strip.style.scrollSnapType = enabled ? '' : 'none';
|
|
9986
|
+
scrollStripTo(item.offsetLeft, { behavior, activeIndex: flatIndex % images.length });
|
|
9697
9987
|
};
|
|
9698
9988
|
|
|
9699
9989
|
const snapAfterDrag = (startScrollLeft: number, behavior: ScrollBehavior = 'smooth') => {
|
|
@@ -9727,11 +10017,10 @@ const LightboxOverlay = ({
|
|
|
9727
10017
|
return;
|
|
9728
10018
|
}
|
|
9729
10019
|
|
|
9730
|
-
|
|
9731
|
-
left: targetItem.offsetLeft,
|
|
10020
|
+
scrollStripTo(targetItem.offsetLeft, {
|
|
9732
10021
|
behavior,
|
|
10022
|
+
activeIndex: targetFlatIndex % images.length,
|
|
9733
10023
|
});
|
|
9734
|
-
setActiveIndex(targetFlatIndex % images.length);
|
|
9735
10024
|
};
|
|
9736
10025
|
|
|
9737
10026
|
const scrollToIndex = (index: number, behavior: ScrollBehavior = 'smooth') => {
|
|
@@ -9745,9 +10034,10 @@ const LightboxOverlay = ({
|
|
|
9745
10034
|
lockedActiveIndexRef.current = null;
|
|
9746
10035
|
}
|
|
9747
10036
|
setActiveIndex(index);
|
|
9748
|
-
|
|
9749
|
-
left: item.offsetLeft,
|
|
10037
|
+
scrollStripTo(item.offsetLeft, {
|
|
9750
10038
|
behavior,
|
|
10039
|
+
activeIndex: index,
|
|
10040
|
+
onComplete: behavior === 'smooth' ? releaseActiveIndexLock : undefined,
|
|
9751
10041
|
});
|
|
9752
10042
|
};
|
|
9753
10043
|
|
|
@@ -9757,6 +10047,7 @@ const LightboxOverlay = ({
|
|
|
9757
10047
|
if (isDragBlockedTarget(event.target as HTMLElement)) return;
|
|
9758
10048
|
const strip = stripRef.current;
|
|
9759
10049
|
if (!strip) return;
|
|
10050
|
+
cancelScrollAnimation();
|
|
9760
10051
|
mouseDragRef.current = {
|
|
9761
10052
|
isActive: true,
|
|
9762
10053
|
startX: event.clientX,
|
|
@@ -9800,22 +10091,22 @@ const LightboxOverlay = ({
|
|
|
9800
10091
|
strip.releasePointerCapture(event.pointerId);
|
|
9801
10092
|
}
|
|
9802
10093
|
normalizeInfiniteScroll();
|
|
9803
|
-
setStripSnapEnabled(true);
|
|
9804
10094
|
if (hadMoved) {
|
|
9805
10095
|
snapAfterDrag(startScrollLeft);
|
|
9806
10096
|
} else {
|
|
10097
|
+
setStripSnapEnabled(true);
|
|
9807
10098
|
updateActiveIndex();
|
|
9808
10099
|
}
|
|
9809
10100
|
resetChromeIdleTimer();
|
|
9810
10101
|
};
|
|
9811
10102
|
|
|
10103
|
+
useLightboxScrollLock();
|
|
10104
|
+
|
|
9812
10105
|
useEffect(() => {
|
|
9813
10106
|
const frame = requestAnimationFrame(() => setIsVisible(true));
|
|
9814
|
-
const originalOverflow = document.body.style.overflow;
|
|
9815
|
-
document.body.style.overflow = 'hidden';
|
|
9816
10107
|
return () => {
|
|
9817
10108
|
cancelAnimationFrame(frame);
|
|
9818
|
-
|
|
10109
|
+
cancelScrollAnimation();
|
|
9819
10110
|
if (closeTimeoutRef.current) {
|
|
9820
10111
|
clearTimeout(closeTimeoutRef.current);
|
|
9821
10112
|
}
|
|
@@ -9915,6 +10206,7 @@ const LightboxOverlay = ({
|
|
|
9915
10206
|
observer.observe(strip);
|
|
9916
10207
|
return () => {
|
|
9917
10208
|
if (scrollEndTimer) clearTimeout(scrollEndTimer);
|
|
10209
|
+
cancelScrollAnimation();
|
|
9918
10210
|
strip.removeEventListener('scroll', onScroll);
|
|
9919
10211
|
strip.removeEventListener('scrollend', onScrollEnd);
|
|
9920
10212
|
observer.disconnect();
|
|
@@ -9946,6 +10238,7 @@ const LightboxOverlay = ({
|
|
|
9946
10238
|
position: 'relative',
|
|
9947
10239
|
width: '100%',
|
|
9948
10240
|
height: '100%',
|
|
10241
|
+
...dismissAreaStyle,
|
|
9949
10242
|
}}
|
|
9950
10243
|
{...swipeHandlers}
|
|
9951
10244
|
>
|
|
@@ -9957,6 +10250,7 @@ const LightboxOverlay = ({
|
|
|
9957
10250
|
<div
|
|
9958
10251
|
ref={stripRef}
|
|
9959
10252
|
className={\`\${P}-lightbox-strip\`}
|
|
10253
|
+
data-lightbox-scrollable=""
|
|
9960
10254
|
style={{ gap: imageGap }}
|
|
9961
10255
|
data-mouse-draggable={allowMouseDrag && images.length > 0 ? 'true' : 'false'}
|
|
9962
10256
|
data-mouse-dragging={isMouseDragging ? 'true' : 'false'}
|
|
@@ -10012,10 +10306,9 @@ const LightboxOverlay = ({
|
|
|
10012
10306
|
className={\`\${P}-lightbox-content-inner\`}
|
|
10013
10307
|
style={{
|
|
10014
10308
|
width: '100%',
|
|
10015
|
-
height:
|
|
10309
|
+
height: '100%',
|
|
10016
10310
|
top: 0,
|
|
10017
|
-
bottom:
|
|
10018
|
-
...(type === 'B' ? { backgroundColor: contentBackgroundColor, position: 'relative' } : {}),
|
|
10311
|
+
bottom: 0,
|
|
10019
10312
|
...swipeChromeStyle,
|
|
10020
10313
|
}}
|
|
10021
10314
|
>
|
|
@@ -10026,7 +10319,6 @@ const LightboxOverlay = ({
|
|
|
10026
10319
|
style={{ height: contentMarginTop, width: '100%', pointerEvents: showControls ? 'auto' : 'none' }}
|
|
10027
10320
|
/>
|
|
10028
10321
|
<div
|
|
10029
|
-
className={type === 'B' ? \`\${P}-lightbox-chrome-bar\` : undefined}
|
|
10030
10322
|
style={{
|
|
10031
10323
|
display: 'flex',
|
|
10032
10324
|
flexDirection: 'row',
|
|
@@ -10042,7 +10334,8 @@ const LightboxOverlay = ({
|
|
|
10042
10334
|
<div className={\`\${P}-lightbox-content-area\`}>
|
|
10043
10335
|
{hasTitles && (
|
|
10044
10336
|
<div className={\`\${P}-titles-row\`}>
|
|
10045
|
-
{renderTitles(
|
|
10337
|
+
{renderTitles()}
|
|
10338
|
+
{showControls && titleSlots.length > 0 ? renderTitleWidthControls() : null}
|
|
10046
10339
|
</div>
|
|
10047
10340
|
)}
|
|
10048
10341
|
{closeIcon && (
|
|
@@ -10074,14 +10367,6 @@ const LightboxOverlay = ({
|
|
|
10074
10367
|
style={{ width: contentMarginRight, flexShrink: 0, pointerEvents: showControls ? 'auto' : 'none' }}
|
|
10075
10368
|
/>
|
|
10076
10369
|
</div>
|
|
10077
|
-
{type === 'B' && (
|
|
10078
|
-
<div
|
|
10079
|
-
data-controls={showControls ? 'contentMarginBottom' : undefined}
|
|
10080
|
-
data-controls-static-handle={showControls ? '' : undefined}
|
|
10081
|
-
className={showControls ? \`\${P}-control\` : undefined}
|
|
10082
|
-
style={{ height: contentMarginBottom, width: '100%', pointerEvents: showControls ? 'auto' : 'none' }}
|
|
10083
|
-
/>
|
|
10084
|
-
)}
|
|
10085
10370
|
</div>
|
|
10086
10371
|
{images.length > 1 && thumbnailVisibility === 'on' && (() => {
|
|
10087
10372
|
const thumbnailMarginBottomControlSize = getGapControlSize(thumbnailMarginBottom);
|
|
@@ -10089,8 +10374,10 @@ const LightboxOverlay = ({
|
|
|
10089
10374
|
return (
|
|
10090
10375
|
<div
|
|
10091
10376
|
className={\`\${P}-thumbnails\`}
|
|
10377
|
+
data-lightbox-scrollable=""
|
|
10092
10378
|
data-thumbnail-active={thumbnailActive}
|
|
10093
10379
|
data-chrome-hidden={hideChromeOnIdle && !chromeVisible ? 'true' : 'false'}
|
|
10380
|
+
onClick={(event) => event.stopPropagation()}
|
|
10094
10381
|
style={{
|
|
10095
10382
|
gap: thumbnailGap,
|
|
10096
10383
|
bottom: thumbnailMarginBottom,
|
|
@@ -10180,9 +10467,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10180
10467
|
const {
|
|
10181
10468
|
cover,
|
|
10182
10469
|
coverFit,
|
|
10183
|
-
type,
|
|
10184
10470
|
backgroundColor,
|
|
10185
|
-
contentBackgroundColor,
|
|
10186
10471
|
thumbnailVisibility,
|
|
10187
10472
|
thumbnailObjectFit,
|
|
10188
10473
|
thumbnailTrigger,
|
|
@@ -10191,15 +10476,16 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10191
10476
|
thumbnailGap,
|
|
10192
10477
|
thumbnailMarginBottom,
|
|
10193
10478
|
imageGap,
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10479
|
+
title1Width,
|
|
10480
|
+
title2Width,
|
|
10481
|
+
title3Width,
|
|
10482
|
+
title2MarginLeft,
|
|
10483
|
+
title3MarginLeft,
|
|
10197
10484
|
closeIcon,
|
|
10198
10485
|
closeIconMaxWidth,
|
|
10199
10486
|
closeIconColor,
|
|
10200
10487
|
closeIconHoverColor,
|
|
10201
10488
|
contentMarginTop,
|
|
10202
|
-
contentMarginBottom,
|
|
10203
10489
|
contentMarginLeft,
|
|
10204
10490
|
contentMarginRight
|
|
10205
10491
|
} = settings;
|
|
@@ -10256,10 +10542,8 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10256
10542
|
return createPortal(
|
|
10257
10543
|
<LightboxOverlay
|
|
10258
10544
|
prefix={P}
|
|
10259
|
-
type={type}
|
|
10260
10545
|
images={items}
|
|
10261
10546
|
backgroundColor={backgroundColor}
|
|
10262
|
-
contentBackgroundColor={contentBackgroundColor}
|
|
10263
10547
|
thumbnailGap={scaled(thumbnailGap)}
|
|
10264
10548
|
thumbnailMarginBottom={scaled(thumbnailMarginBottom ?? 0.02)}
|
|
10265
10549
|
imageGap={scaled(imageGap ?? 0)}
|
|
@@ -10268,9 +10552,11 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10268
10552
|
thumbnailTrigger={thumbnailTrigger}
|
|
10269
10553
|
thumbnailActive={thumbnailActive}
|
|
10270
10554
|
thumbnailActiveColor={thumbnailActiveColor}
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10555
|
+
title1Width={title1Width}
|
|
10556
|
+
title2Width={title2Width}
|
|
10557
|
+
title3Width={title3Width}
|
|
10558
|
+
title2MarginLeft={title2MarginLeft ?? 0}
|
|
10559
|
+
title3MarginLeft={title3MarginLeft ?? 0}
|
|
10274
10560
|
title1={title1}
|
|
10275
10561
|
title2={title2}
|
|
10276
10562
|
title3={title3}
|
|
@@ -10278,7 +10564,6 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10278
10564
|
title2Style={title2Style}
|
|
10279
10565
|
title3Style={title3Style}
|
|
10280
10566
|
contentMarginTop={scaled(contentMarginTop ?? 0)}
|
|
10281
|
-
contentMarginBottom={scaled(contentMarginBottom ?? 0)}
|
|
10282
10567
|
contentMarginLeft={scaled(contentMarginLeft ?? 0)}
|
|
10283
10568
|
contentMarginRight={scaled(contentMarginRight ?? 0)}
|
|
10284
10569
|
closeIcon={closeIcon}
|
|
@@ -10296,7 +10581,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10296
10581
|
</>
|
|
10297
10582
|
);
|
|
10298
10583
|
};
|
|
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`
|
|
10584
|
+
`,jp="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 zp(e){const t={};return t[qe(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[qe(e,"fontSettings")]={...pn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[qe(e,"fontSize")]={...pn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[qe(e,"lineHeight")]={...pn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[qe(e,"letterSpacing")]={...pn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[qe(e,"wordSpacing")]={...pn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[qe(e,"textAlign")]={...pn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[qe(e,"textAppearance")]={...pn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Vp=ci.reduce((e,t)=>({...e,...zp(t)}),{}),Kp=ci.reduce((e,t)=>({...e,[qe(t,"fontFamily")]:"Arial",[qe(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[qe(t,"letterSpacing")]:0,[qe(t,"wordSpacing")]:0,[qe(t,"textAlign")]:"left",[qe(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Qr(e){return ci.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[qe(n,"fontSize")]=i),o!==void 0&&(t[qe(n,"lineHeight")]=o),t},{})}const Gp=_p(),Up={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},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"}},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}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,max:100,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,max:100,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,max:100,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,max:200,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",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"}},...Vp,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:jp,closeIconColor:"#ffffff",closeIconHoverColor:"#cccccc",thumbnailVisibility:"on",thumbnailObjectFit:{display:"Fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#ffffff",title2Color:"#ffffff",title3Color:"#ffffff",...Kp},layoutDefaults:{m:{thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,title1Width:.13,title2Width:.13,title3Width:.14,title2MarginLeft:.04,title3MarginLeft:.04,closeIconMaxWidth:.04,backgroundColor:"rgba(28, 31, 34, 0.9)",contentMarginTop:.04,contentMarginLeft:.02,contentMarginRight:.02,...Qr({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},d:{thumbnailGap:.02,thumbnailMarginBottom:.02,imageGap:.005,title1Width:.13,title2Width:.13,title3Width:.14,title2MarginLeft:.1,title3MarginLeft:.1,closeIconMaxWidth:.02,backgroundColor:"rgba(28, 31, 34, 0.9)",contentMarginTop:.02,contentMarginLeft:.02,contentMarginRight:.02,...Qr({title1FontSize:.015,title1LineHeight:.02,title2FontSize:.015,title2LineHeight:.02,title3FontSize:.015,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","contentMarginTop","contentMarginLeft","contentMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Gp]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","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"}}]}},qp={element:Bp,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:Up,sourceCode:Dp,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:ci.map(e=>({path:`styles.${qe(e,"fontSettings")}`}))}},fo=300,Io=400,ea=300,Xp=50,ta=10,ir="cntrl-lightbox-journal",Yi=ir,_o=`${ir}-`,Ji=e=>`${ir}-${e}`,or=e=>e===Yi||e.startsWith(_o),na=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},ia=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=na(t.get(Ji(e)));if(i)return i}const n=na(t.get(Yi));if(n)return n;for(const[i]of t){if(!i.startsWith(_o))continue;const o=i.slice(_o.length);if(!/^\d+$/.test(o))continue;const a=Number.parseInt(o,10);if(Number.isFinite(a)&&a>=1)return a}return null},oa=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},is=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{or(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Ji(t),String(e)):i.searchParams.set(Yi,String(e));const o=n?"replaceState":"pushState",a=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",a)},Yp=e=>{if(typeof window>"u")return;const t=new URL(window.location.href);let n=!1;if([...t.searchParams.keys()].forEach(i=>{(e?i===Ji(e)||i===Yi:or(i))&&(t.searchParams.delete(i),n=!0)}),n){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},os=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Ji(e)):[...t.keys()].some(n=>or(n))},Jp=(e,t)=>{if(os(t)){if(e){window.history.back();return}Yp(t)}};function Zp(e){return`
|
|
10300
10585
|
.${e}-wrapper {
|
|
10301
10586
|
position: relative;
|
|
10302
10587
|
width: 100%;
|
|
@@ -10349,6 +10634,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10349
10634
|
flex-direction: column;
|
|
10350
10635
|
align-items: center;
|
|
10351
10636
|
justify-content: center;
|
|
10637
|
+
overscroll-behavior: none;
|
|
10352
10638
|
}
|
|
10353
10639
|
|
|
10354
10640
|
.${e}-lightbox-editor {
|
|
@@ -10453,11 +10739,11 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10453
10739
|
|
|
10454
10740
|
.${e}-slide-fade-in {
|
|
10455
10741
|
opacity: 0;
|
|
10456
|
-
animation: ${e}-slide-fade-in ${
|
|
10742
|
+
animation: ${e}-slide-fade-in ${ea}ms ease-in-out forwards;
|
|
10457
10743
|
}
|
|
10458
10744
|
|
|
10459
10745
|
.${e}-slide-fade-out {
|
|
10460
|
-
animation: ${e}-slide-fade-out ${
|
|
10746
|
+
animation: ${e}-slide-fade-out ${ea}ms ease-in-out forwards;
|
|
10461
10747
|
}
|
|
10462
10748
|
|
|
10463
10749
|
.${e}-slide-area {
|
|
@@ -10626,11 +10912,11 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10626
10912
|
|
|
10627
10913
|
.${e}-titles-fade-in {
|
|
10628
10914
|
opacity: 0;
|
|
10629
|
-
animation: ${e}-titles-fade-in ${
|
|
10915
|
+
animation: ${e}-titles-fade-in ${Io}ms ease-in-out forwards;
|
|
10630
10916
|
}
|
|
10631
10917
|
|
|
10632
10918
|
.${e}-titles-fade-out {
|
|
10633
|
-
animation: ${e}-titles-fade-out ${
|
|
10919
|
+
animation: ${e}-titles-fade-out ${Io}ms ease-in-out forwards;
|
|
10634
10920
|
}
|
|
10635
10921
|
|
|
10636
10922
|
.${e}-lightbox-chrome {
|
|
@@ -10690,7 +10976,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10690
10976
|
pointer-events: auto;
|
|
10691
10977
|
z-index: 10;
|
|
10692
10978
|
}
|
|
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';
|
|
10979
|
+
`}const Qp=20,em=2,ra=e=>`max(${e}, ${Qp}px)`,kn=e=>((e==null?void 0:e.image)??[]).slice(0,em),rs=e=>e.reduce((t,n)=>t+kn(n).length,0),tm=(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}},nm=(e,t)=>{const n=rs(e),{start:i,end:o}=tm(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},_i=(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)})),im=(e,t,n,i)=>{var a;if(n==="B")return`${t+1} / ${e.length}`;const o=((a=e[t])==null?void 0:a.entryIndex)??0;return nm(i,o)},aa=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",om=(e,t,n)=>e==="B"?t.length>1:rs(n)>1,rm=({prefix:e,entries:t,journalType:n,coverFit:i,backgroundColor:o,imageGap:a,slideMaxWidth:l,slideMaxHeight:d,isEditor:s,isEditMode:p,isPreviewMode:u,closeIcon:L,closeIconMaxWidth:b,closeIconColor:y,closeIconHoverColor:m,textMaxWidth:h,titlesGap:C,countCloseGap:w,textTransition:v,title1Style:x,title2Style:O,title3Style:R,countStyle:B,contentMarginTop:T,contentMarginLeft:P,contentMarginRight:D,initialSlideIndex:g=0,enableUrlSync:$=!1,journalItemId:A=null,onBeforeClose:H,onClose:K})=>{const Q=!!p,k=!s||!!u,_=!p&&(!s||!!u),I=c.useMemo(()=>_i(t,n),[t,n]),[M,W]=c.useState(g),j=I[M],U=j==null?void 0:j.entry,[ie,F]=c.useState(!1),[J,f]=c.useState(null),[ne,Ce]=c.useState(!1),[ue,ye]=c.useState(null),[re,me]=c.useState(!1),[q,ee]=c.useState(0),[ae,oe]=c.useState(),[be,Re]=c.useState(),[xe,Pe]=c.useState(null),Le=c.useRef(null),z=c.useRef(0),de=c.useRef(0),N=c.useRef(0),X=c.useRef(!1),Y=c.useRef(null),te=c.useRef(null),ce=c.useRef(null),he=c.useRef(null),Fe=c.useRef(null),$e=c.useRef(null),we=c.useRef(null),Ne=c.useCallback(()=>{const S=te.current;if(!S)return;const G=S.closest(`.${e}-lightbox-content-area`);if(!G)return S.getBoundingClientRect().width;let pe=0;return Array.from(G.children).forEach(ge=>{ge instanceof HTMLElement&&(ge.contains(S)||(pe+=ge.getBoundingClientRect().width))}),G.getBoundingClientRect().width-pe},[e]),se=c.useCallback(()=>{Le.current&&(clearTimeout(Le.current),Le.current=null)},[]),Ie=c.useCallback(S=>{S===z.current&&(ye(null),me(!1))},[]),Ae=c.useCallback(()=>{p||X.current||(X.current=!0,H==null||H(),F(!1),Y.current=setTimeout(()=>{K()},fo))},[p,H,K]),We=c.useCallback(S=>!!(S.closest("[data-controls]")||S.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:je,backdropStyle:st,mediaAreaStyle:ft,chromeStyle:yt,swipeHandlers:wt,dismissAreaStyle:It}=Qa({enabled:_,onClose:Ae,animMs:fo,isBlockedTarget:We}),mt=c.useCallback(S=>{$&&is(S+1,A,!0)},[$,A]),ut=c.useCallback(S=>{var Ee,ke;if(I.length===0)return;const G=(S%I.length+I.length)%I.length;if(G===M)return;const pe=I[M],ge=I[G];z.current+=1;const He=z.current,Se=v==="fade"&&aa(pe==null?void 0:pe.entry)!==aa(ge==null?void 0:ge.entry),Ve=(Ee=te.current)==null?void 0:Ee.getBoundingClientRect().height;let Ke,Z;Se&&(Z=Ne(),ei.flushSync(()=>{Pe(ge.entry)}),ce.current&&Z&&(ce.current.style.width=`${Z}px`),Ke=(ke=ce.current)==null?void 0:ke.getBoundingClientRect().height,ce.current&&(ce.current.style.width=""));const fe=Math.max(Ve??0,Ke??0)||void 0;ee(He),ye(M),me(!0),W(G),mt(G),N.current=G,Se?(se(),fe&&oe(fe),Z&&Re(Z),f((pe==null?void 0:pe.entryIndex)??null),Ce(!0),de.current=ge.entryIndex,Le.current=setTimeout(()=>{f(null),Ce(!1),oe(void 0),Re(void 0),Pe(null),Le.current=null},Io)):(se(),f(null),Ce(!1),oe(void 0),Re(void 0),Pe(null),de.current=ge.entryIndex)},[M,se,Ne,I,mt,v]),Te=c.useCallback(()=>{we.current=null},[]),Je=c.useCallback(S=>{!k||I.length<=1||S.pointerType==="mouse"&&S.button!==0||S.target.closest("[data-controls]")||(we.current={startX:S.clientX,startY:S.clientY,pointerId:S.pointerId})},[k,I.length]),Ze=c.useCallback(S=>{var fe;if(!k||I.length<=1||S.pointerType==="mouse"&&S.button!==0)return;if(je){Te();return}const G=we.current;if(!G||G.pointerId!==S.pointerId||(Te(),S.target.closest("[data-controls]")))return;const ge=S.clientX-G.startX,He=S.clientY-G.startY,Se=Math.abs(ge),Ve=Math.abs(He);if(Se>=Xp&&Se>Ve){ut(ge>0?M-1:M+1);return}if(Se>ta||Ve>ta)return;const Ke=(fe=he.current)==null?void 0:fe.getBoundingClientRect(),Z=Ke?Ke.left+Ke.width/2:window.innerWidth/2;ut(S.clientX<Z?M-1:M+1)},[M,k,ut,je,Te,I.length]),et=c.useCallback(S=>{const G=we.current;(G==null?void 0:G.pointerId)===S.pointerId&&Te()},[Te]);es(),c.useEffect(()=>{$e.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const S=requestAnimationFrame(()=>{F(!0),requestAnimationFrame(()=>{Fe.current?Fe.current.focus():he.current&&he.current.focus()})});return()=>{cancelAnimationFrame(S),Y.current&&clearTimeout(Y.current),Le.current&&clearTimeout(Le.current);const G=$e.current;G&&document.contains(G)&&G.focus()}},[]),c.useEffect(()=>{var S;v!=="fade"&&(de.current=((S=I[M])==null?void 0:S.entryIndex)??0,se(),f(null),Ce(!1),oe(void 0),Re(void 0))},[M,se,I,v]),c.useEffect(()=>{const S=G=>{if(G.key==="Escape"){Ae();return}if(G.key==="ArrowLeft"&&I.length>1){ut(M-1);return}if(G.key==="ArrowRight"&&I.length>1){ut(M+1);return}if(G.key==="Tab"&&he.current){const pe=he.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),ge=Array.from(pe).filter(Ke=>!Ke.closest('[aria-hidden="true"]'));if(ge.length===0)return;const He=ge[0],Se=ge[ge.length-1],Ve=document.activeElement;G.shiftKey?(Ve===He||!he.current.contains(Ve))&&(G.preventDefault(),Se.focus()):(Ve===Se||!he.current.contains(Ve))&&(G.preventDefault(),He.focus())}};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[ut,Ae,M,I.length]),c.useLayoutEffect(()=>{se(),z.current=0,ee(0),ye(null),me(!1),f(null),Ce(!1),oe(void 0),Re(void 0),Pe(null),W(S=>{const G=Math.max(0,I.length-1);return Math.min(S,G)})},[se,t.length,n,I.length]),c.useLayoutEffect(()=>{var S;N.current=g,de.current=((S=I[g])==null?void 0:S.entryIndex)??0,W(g)},[g,I.length]);const tt=J!==null?t[J]:null,$t=ue!==null?I[ue]:null,vt=!!(U!=null&&U.title1||U!=null&&U.title2||U!=null&&U.title3||tt!=null&&tt.title1||tt!=null&&tt.title2||tt!=null&&tt.title3),_t=om(n,I,t),bt=!!L,_e={gap:C},it=_t&&bt?{gap:w}:void 0,Ge=(S,G,pe=!1)=>{const ge=ra(G),He=`calc(-0.5 * (${ge} + ${G}))`;return r.jsx("div",{"data-controls":S,"data-controls-axis":"x",...pe?{"data-controls-reverse":"true"}:void 0,style:{position:"absolute",top:0,right:He,width:ge,height:"100%",pointerEvents:"auto",zIndex:3}})},ze=(S,G=!1)=>{if(!S)return null;const pe=[S.title1?{className:`${e}-title1`,style:x,text:S.title1}:null,S.title2?{className:`${e}-title2`,style:O,text:S.title2}:null,S.title3?{className:`${e}-title3`,style:R,text:S.title3}:null].filter(ge=>ge!==null);return pe.map((ge,He)=>r.jsxs("div",{className:`${e}-title-cell`,children:[r.jsx("p",{className:ge.className,style:{...ge.style,maxWidth:h},children:ge.text}),G&&Q&&He<pe.length-1?Ge("titlesGap",C):null]},ge.className))},at=S=>{const G=!S.objectFit&&Yt(i);return{className:`${e}-slide-image-cell${G?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:l,maxHeight:d,...G?{"--image-aspect-ratio":Xi(i)}:{}}}},Nt=S=>S.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":S.objectFit}}:Yt(i)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},V=S=>{if(S.length===0)return null;const G=S.length>1,pe=ra(a),ge=`calc(-0.5 * (${pe} + ${a}))`;if(S.length===1){const He=S[0];return r.jsx("div",{...at(He),children:r.jsx("img",{...Nt(He),src:He.url,alt:He.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:G?{gap:a}:void 0,children:S.map((He,Se)=>r.jsxs("div",{...at(He),children:[r.jsx("img",{...Nt(He),src:He.url,alt:He.name??"",draggable:!1}),Q&&G&&Se<S.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ge,width:pe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${He.url}-${Se}`))})};return r.jsxs("div",{ref:he,"data-selection":"none",className:`${e}-lightbox${s?` ${e}-lightbox-editor`:""}${p?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{je||Ae()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:bt?void 0:-1,style:{opacity:ie?1:0,transition:`opacity ${fo}ms ease`,pointerEvents:ie?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:o,...st}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%",...It},...wt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:ft,onClick:S=>S.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":k&&I.length>1?"true":"false",onPointerDown:k?Je:void 0,onPointerUp:k?Ze:void 0,onPointerCancel:k?et:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[$t&&re?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:S=>{S.target===S.currentTarget&&Ie(q)},children:r.jsx("div",{className:`${e}-slide-area`,children:V($t.images)})},`slide-out-${q}`):null,r.jsx("div",{className:`${e}-slide-layer-in${re?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:j?V(j.images):null})},`slide-in-${q}-${M}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-chrome`,style:{width:"100%",height:"100%",...yt},children:[r.jsx("div",{"data-controls":Q?"contentMarginTop":void 0,className:Q?`${e}-control`:void 0,style:{height:T,width:"100%"}}),r.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%"},children:[r.jsx("div",{"data-controls":Q?"contentMarginLeft":void 0,"data-controls-axis":Q?"x":void 0,className:Q?`${e}-control`:void 0,style:{width:P,flexShrink:0}}),r.jsxs("div",{className:`${e}-lightbox-content-area`,children:[vt&&r.jsx("div",{className:`${e}-text-bar-cell`,children:r.jsx("div",{className:`${e}-titles-row`,style:_e,children:v==="fade"?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:ce,className:`${e}-titles-stack`,style:{..._e,position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ze(xe||U,!1)}),r.jsxs("div",{ref:te,className:`${e}-titles-stack`,style:{..._e,...ne&&ae?{minHeight:ae}:void 0,...ne&&be?{width:be,maxWidth:"100%"}:void 0,...ne?{overflow:"hidden"}:void 0},children:[tt&&ne?r.jsx("div",{className:`${e}-titles-layer-out ${e}-titles-fade-out`,style:_e,children:ze(tt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ne?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,style:_e,children:ze(U,!0)})]})]}):ze(U,!0)})}),r.jsxs("div",{className:`${e}-lightbox-persistent-controls`,style:it,children:[_t&&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:im(I,M,n,t)}),Q&&bt?Ge("countCloseGap",w,!0):null]}),bt&&r.jsx("div",{className:`${e}-close-icon`,style:{width:E.scalingValue(b??0,s),height:E.scalingValue(b??0,s),"--close-icon-hover-color":m},children:r.jsx("button",{ref:Fe,type:"button",className:`${e}-close-icon-inner`,onClick:Ae,"aria-label":"Close",children:r.jsx(Ot,{url:L??"",fill:y,hoverFill:m,className:`${e}-close-icon-img`})})})]})]}),r.jsx("div",{"data-controls":Q?"contentMarginRight":void 0,"data-controls-axis":Q?"x":void 0,"data-controls-reverse":Q?"":void 0,className:Q?`${e}-control`:void 0,style:{width:D,flexShrink:0}})]})]})]})]})},di=["title1","title2","title3","count"];function Xe(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const am={title1:"1",title2:"2",title3:"3",count:"Count"};function sm(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 lm(){return{type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(di.map(e=>[am[e],sm(e)]))}}const cm={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},dm={title1:.02,title2:.02,title3:.02,count:.017};function bi(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[cm[t]]}}function xi(e,t,n){var o,a;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((a=t.fontSettings)==null?void 0:a.fontStyle)??"normal"},fontSize:t.fontSize??dm[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return pt(i,n)}const um=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:a,metadata:l})=>{const{prefix:d}=E.useScopedStyles(),s=(l==null?void 0:l.itemId)??null,{cover:p,coverFit:u,type:L,backgroundColor:b,imageGap:y,maxWidth:m,maxHeight:h,textMaxWidth:C,textTransition:w,titlesGap:v,countCloseGap:x,closeIcon:O,closeIconMaxWidth:R,closeIconColor:B,closeIconHoverColor:T,contentMarginTop:P,contentMarginLeft:D,contentMarginRight:g}=e,$=ue=>E.scalingValue(ue,n??!1),A=xi("title1",bi(e,"title1"),n),H=xi("title2",bi(e,"title2"),n),K=xi("title3",bi(e,"title3"),n),Q=xi("count",bi(e,"count"),n),k=c.useRef(null),[_,I]=c.useState(!1),[M,W]=c.useState(0),j=c.useRef(!1),U=c.useRef(!1),ie=c.useRef(!1),F=c.useMemo(()=>(t??[]).filter(ue=>kn(ue).length>0),[t]),J=!n||!!o,f=c.useCallback(()=>{J&&(ie.current=!0,Jp(U.current,s),U.current=!1)},[J,s]),ne=(ue=0)=>{if(i||F.length===0||n&&!o)return;const ye=_i(F,L),re=Math.max(0,Math.min(ue,ye.length-1));if(W(re),J){const me=os();is(re+1,s,me),U.current=!me}I(!0)},Ce=c.useCallback(()=>{I(!1),ie.current=!1},[]);return c.useEffect(()=>{if(!J||j.current)return;j.current=!0;const ue=ia(s);if(!ue)return;const ye=oa(ue,_i(F,L).length);ye<0||(W(ye),I(!0))},[F,s,J,L]),c.useEffect(()=>{if(!J)return;const ue=()=>{if(ie.current){ie.current=!1,I(!1);return}const ye=ia(s);if(!ye){I(!1);return}const re=oa(ye,_i(F,L).length);if(re<0){I(!1);return}U.current=!1,W(re),I(!0)};return window.addEventListener("popstate",ue),()=>window.removeEventListener("popstate",ue)},[F,s,J,L]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:k,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Zp(d)}}),p?r.jsx("button",{type:"button",className:`${d}-cover ${Yt(u)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>ne(),style:{display:"block",padding:0,border:"none",background:"transparent",...Yt(u)?{"--image-aspect-ratio":Xi(u)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Yt(u)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:p,alt:"cover"})}):null]}),_&&typeof document<"u"&&(()=>{const ue=(a?document.getElementById(a):null)??document.body;return ei.createPortal(r.jsx(rm,{prefix:d,entries:F,journalType:L,coverFit:u,backgroundColor:b,imageGap:$(y??0),slideMaxWidth:`${m}%`,slideMaxHeight:`${h}%`,textMaxWidth:$(C??.4),titlesGap:$(v??0),countCloseGap:$(x??0),textTransition:w,title1Style:A,title2Style:H,title3Style:K,countStyle:Q,contentMarginTop:$(P??0),contentMarginLeft:$(D??0),contentMarginRight:$(g??0),closeIcon:O,closeIconMaxWidth:R,closeIconColor:B,closeIconHoverColor:T,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:M,enableUrlSync:J,journalItemId:s,onBeforeClose:f,onClose:Ce}),ue)})()]})},pm=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
10694
10980
|
import { createPortal, flushSync } from 'react-dom';
|
|
10695
10981
|
import { CommonComponentProps } from '../props';
|
|
10696
10982
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -10699,6 +10985,7 @@ import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
|
10699
10985
|
import { textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
10700
10986
|
import { getAspectRatio, isImageRatioCover } from '../utils/imageFitStyles';
|
|
10701
10987
|
import { useLightboxSwipeDismiss } from '../utils/useLightboxSwipeDismiss';
|
|
10988
|
+
import { useLightboxScrollLock } from '../utils/useLightboxScrollLock';
|
|
10702
10989
|
import { LayoutItem, LayoutTab } from '../../types/SchemaV1';
|
|
10703
10990
|
|
|
10704
10991
|
const LIGHTBOX_ANIM_MS = 300;
|
|
@@ -10861,6 +11148,7 @@ function getCSS(P: string): string {
|
|
|
10861
11148
|
flex-direction: column;
|
|
10862
11149
|
align-items: center;
|
|
10863
11150
|
justify-content: center;
|
|
11151
|
+
overscroll-behavior: none;
|
|
10864
11152
|
}
|
|
10865
11153
|
|
|
10866
11154
|
.\${P}-lightbox-editor {
|
|
@@ -11439,6 +11727,7 @@ const LightboxOverlay = ({
|
|
|
11439
11727
|
mediaAreaStyle,
|
|
11440
11728
|
chromeStyle: swipeChromeStyle,
|
|
11441
11729
|
swipeHandlers,
|
|
11730
|
+
dismissAreaStyle,
|
|
11442
11731
|
} = useLightboxSwipeDismiss({
|
|
11443
11732
|
enabled: allowSwipeDismiss,
|
|
11444
11733
|
onClose: handleClose,
|
|
@@ -11580,6 +11869,8 @@ const LightboxOverlay = ({
|
|
|
11580
11869
|
}
|
|
11581
11870
|
}, [resetStripNavGesture]);
|
|
11582
11871
|
|
|
11872
|
+
useLightboxScrollLock();
|
|
11873
|
+
|
|
11583
11874
|
useEffect(() => {
|
|
11584
11875
|
previouslyFocusedRef.current = document.activeElement instanceof HTMLElement
|
|
11585
11876
|
? document.activeElement
|
|
@@ -11594,11 +11885,8 @@ const LightboxOverlay = ({
|
|
|
11594
11885
|
}
|
|
11595
11886
|
});
|
|
11596
11887
|
});
|
|
11597
|
-
const originalOverflow = document.body.style.overflow;
|
|
11598
|
-
document.body.style.overflow = 'hidden';
|
|
11599
11888
|
return () => {
|
|
11600
11889
|
cancelAnimationFrame(frame);
|
|
11601
|
-
document.body.style.overflow = originalOverflow;
|
|
11602
11890
|
if (closeTimeoutRef.current) {
|
|
11603
11891
|
clearTimeout(closeTimeoutRef.current);
|
|
11604
11892
|
}
|
|
@@ -11846,6 +12134,7 @@ const LightboxOverlay = ({
|
|
|
11846
12134
|
position: 'relative',
|
|
11847
12135
|
width: '100%',
|
|
11848
12136
|
height: '100%',
|
|
12137
|
+
...dismissAreaStyle,
|
|
11849
12138
|
}}
|
|
11850
12139
|
{...swipeHandlers}
|
|
11851
12140
|
>
|
|
@@ -12406,4 +12695,4 @@ export type LightboxJournalSettings = {
|
|
|
12406
12695
|
closeIconColor: string;
|
|
12407
12696
|
closeIconHoverColor: string;
|
|
12408
12697
|
};
|
|
12409
|
-
`,
|
|
12698
|
+
`,mm="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>'),mn={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 gm(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")]={...mn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Xe(e,"fontSize")]={...mn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Xe(e,"lineHeight")]={...mn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Xe(e,"letterSpacing")]={...mn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Xe(e,"wordSpacing")]={...mn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Xe(e,"textAlign")]={...mn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Xe(e,"textAppearance")]={...mn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const hm=di.reduce((e,t)=>({...e,...gm(t)}),{}),fm=di.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 sa(e){return di.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 ym=lm(),vm={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"}},...hm,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:mm,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#ffffff",...fm},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,textMaxWidth:.4,closeIconMaxWidth:.05,contentMarginTop:.02,contentMarginLeft:.01,contentMarginRight:.01,titlesGap:.01,countCloseGap:.005,...sa({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,...sa({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:[ym]}],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"}]}]}},bm={element:um,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:vm,sourceCode:pm,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:di.map(e=>({path:`styles.${Xe(e,"fontSettings")}`}))}},xm=[vc,Tc,md,qp,bm,Cd,Ad,Vd,Xd,nu,gu,fp];exports.components=xm;exports.isSchemaV1=cs;
|