@cntrl-site/components 1.0.17-alpha.1 → 1.0.17-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("react"),je=require("classnames"),I=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",Is="ControlSlider-module__paginationInsideBottom___R3FWn",Es="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",be={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:Is,paginationInsideTop:Es,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,En=3,Wn=4,ti=5,Si=6,Ri=7,nl={CREATED:Tn,MOUNTED:tl,IDLE:En,MOVING:Wn,SCROLLING:ti,DRAGGING:Si,DESTROYED:Ri};function Yt(e){e.length=0}function an(e,t,n){return Array.prototype.slice.call(e,t,n)}function qe(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=qe(Fi,"function"),nn=qe(Fi,"string"),ni=qe(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 Pt(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 Kt(e,t,n){e&&Pt(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Ht(e,t){Kt(e,nn(t)?t.split(" "):t,!0)}function oi(e,t){Pt(t,e.appendChild.bind(e))}function Mo(e,t){Pt(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){Pt(t||Kn(e),function(n){delete e[n]})}function Ot(e,t){Pt(e,function(n){Pt(t,function(i){n&&n.removeAttribute(i)})})}function Ae(e,t,n){zn(t)?gn(t,function(i,o){Ae(e,o,i)}):Pt(e,function(i){Po(n)||n===""?Ot(i,t):i.setAttribute(t,String(n))})}function Ln(e,t,n){var i=document.createElement(e);return t&&(nn(t)?Ht(i,t):Ae(i,t)),n&&oi(n,i),i}function Mt(e,t,n){if(ni(n))return getComputedStyle(e)[t];Po(n)||(e.style[t]=""+n)}function Un(e,t){Mt(e,"display",t)}function pa(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function kt(e,t){return e.getAttribute(t)}function ur(e,t){return e&&e.classList.contains(t)}function Et(e){return e.getBoundingClientRect()}function hn(e){Pt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function ma(e){return ri(new DOMParser().parseFromString(e,"text/html").body)}function Vt(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 Gt(e,t){Kt(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,St=Math.abs;function ha(e,t,n){return St(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 Pt(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,$,b){var y="addEventListener"in u,m=y?u.removeEventListener.bind(u,$,s,p):u.removeListener.bind(u,s);y?u.addEventListener($,s,p):u.addListener(s),e.push([u,$,b,s,m])})}function n(l,d,s){o(l,d,function(p,u,$){e=e.filter(function(b){return b[0]===p&&b[1]===u&&b[2]===$&&(!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){Pt(l,function(p){p&&Pt(d,function(u){u.split(" ").forEach(function($){var b=$.split(".");s(p,b[0],b[1])})})})}function a(){e.forEach(function(l){l[4]()}),Yt(e)}return{bind:t,unbind:n,dispatch:i,destroy:a}}var sn="mounted",So="ready",Jt="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",Ia="pagination:updated",Oo="navigation:mounted",Bo="autoplay:play",Ea="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:qe(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){L||m(),a=o()-(L?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(L){e=L}function T(){return s}return{start:$,rewind:y,pause:b,cancel:m,set:h,isPaused:T}}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,T){return m?+h-+T:+T-+h}).forEach(function(h){u(o[h],"("+(m?"min":"max")+"-width:"+h+"px)")}),u(a,lr),$()}function p(m){m&&l.destroy()}function u(m,h){var T=matchMedia(h);l.bind(T,"change",$),d.push([m,T])}function $(){var m=i.is(Ri),h=n.direction,T=d.reduce(function(L,x){return tn(L,x[1].matches?x[0]:{})},{});dr(n),y(T),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,T){tn(n,m),h&&tn(Object.getPrototypeOf(n),m),(T||!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 $=Zi[p.toLowerCase()][s]||p;return u>0?$.charAt(0).toUpperCase()+$.slice(1):$})}function o(a){return a*(n.direction===mr?1:-1)}return{resolve:i,orient:o}}var Ut="role",In="tabindex",cl="disabled",Wt="aria-",si=Wt+"controls",Ma=Wt+"current",gr=Wt+"selected",_t=Wt+"label",zo=Wt+"labelledby",ka=Wt+"hidden",Vo=Wt+"orientation",Xn=Wt+"roledescription",hr=Wt+"live",fr=Wt+"busy",yr=Wt+"atomic",Ko=[Ut,In,cl,si,Ma,_t,zo,ka,Vo,Xn],Bt=ai+"__",ln="is-",Qi=ai,vr=Bt+"track",dl=Bt+"list",Vi=Bt+"slide",Wa=Vi+"--clone",ul=Vi+"__container",Go=Bt+"arrows",Ki=Bt+"arrow",Fa=Ki+"--prev",Na=Ki+"--next",Gi=Bt+"pagination",Ha=Gi+"__page",pl=Bt+"progress",ml=pl+"__bar",gl=Bt+"toggle",hl=Bt+"spinner",fl=Bt+"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=[],$=[],b,y,m;function h(){S(),O(),x()}function T(){o(rt,L),o(rt,h),o(ht,x),a(document,za+" keydown",function(w){m=w.type==="keydown"},{capture:!0}),a(l,"focusin",function(){Kt(l,Da,!!m)})}function L(w){var P=Ko.concat("style");Yt(p),Gt(l,u),Gt(b,$),Ot([b,y],P),Ot(l,w?P:["style",Xn])}function x(){Gt(l,u),Gt(b,$),u=B(Qi),$=B(vr),Ht(l,u),Ht(b,$),Ae(l,_t,n.label),Ae(l,zo,n.labelledby)}function S(){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(w,P){s[P]=R("."+w)}),Gn(s,{root:l,track:b,list:y,slides:p})}function O(){var w=l.id||il(ai),P=n.role;l.id=w,b.id=b.id||w+"-track",y.id=y.id||w+"-list",!kt(l,Ut)&&l.tagName!=="SECTION"&&P&&Ae(l,Ut,P),Ae(l,Xn,d.carousel),Ae(y,Ut,"presentation")}function R(w){var P=ga(l,w);return P&&xl(P,"."+Qi)===l?P:void 0}function B(w){return[w+"--"+n.type,w+"--"+n.direction,n.drag&&w+"--draggable",n.isNavigation&&w+"--nav",w===Qi&&fn]}return Gn(s,{setup:h,mount:T,destroy:L})}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,$=u.isNavigation,b=u.updateOnMove,y=u.i18n,m=u.pagination,h=u.slideFocus,T=s.Direction.resolve,L=kt(i,"style"),x=kt(i,_t),S=n>-1,O=ri(i,"."+ul),R;function B(){S||(i.id=p.id+"-slide"+Fo(t+1),Ae(i,Ut,m?"tabpanel":"group"),Ae(i,Xn,y.slide),Ae(i,_t,x||xo(y.slideLabel,[t+1,e.length]))),w()}function w(){d(i,"click",qe(l,No,E)),d(i,"keydown",qe(l,_a,E)),a([Fn,Ra,yn],C),a(Oo,j),b&&a(Jt,g)}function P(){R=!0,o.destroy(),Gt(i,vl),Ot(i,Ko),Ae(i,"style",L),Ae(i,_t,x||"")}function j(){var M=e.splides.map(function(W){var z=W.splide.Components.Slides.getAt(t);return z?z.slide.id:""}).join(" ");Ae(i,_t,xo(y.slideX,(S?n:t)+1)),Ae(i,si,M),Ae(i,Ut,h?"button":""),h&&Ot(i,Xn)}function g(){R||C()}function C(){if(!R){var M=e.index;A(),H(),Kt(i,Oa,t===M-1),Kt(i,Ba,t===M+1)}}function A(){var M=Q();M!==ur(i,fn)&&(Kt(i,fn,M),Ae(i,Ma,$&&M||""),l(M?ya:va,E))}function H(){var M=k(),W=!M&&(!Q()||S);if(e.state.is([Wn,ti])||Ae(i,ka,W||""),Ae(ko(i,u.focusableNodes||""),In,W?-1:""),h&&Ae(i,In,W?-1:0),M!==ur(i,Co)&&(Kt(i,Co,M),l(M?ba:xa,E)),!M&&document.activeElement===i){var z=s.Slides.getAt(e.index);z&&pa(z.slide)}}function V(M,W,z){Mt(z&&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=Et(s.Elements.track),W=Et(i),z=T("left",!0),K=T("right",!0);return Ai(M[z])<=qn(W[z])&&Ai(W[K])<=qn(M[K])}function _(M,W){var z=St(M-t);return!S&&(u.rewind||e.is(Nn))&&(z=on(z,e.length-z)),z<=W}var E={index:t,slideIndex:n,slide:i,container:O,isClone:S,mount:B,destroy:P,update:C,style:V,isWithin:_};return E}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 $(){b(),o(rt,y),o(rt,b)}function b(){s.forEach(function(C,A){h(C,A,-1)})}function y(){R(function(C){C.destroy()}),Yt(u)}function m(){R(function(C){C.update()})}function h(C,A,H){var V=wl(e,A,H,C);V.mount(),u.push(V),u.sort(function(Q,k){return Q.index-k.index})}function T(C){return C?B(function(A){return!A.isClone}):u}function L(C){var A=t.Controller,H=A.toIndex(C),V=A.hasFocus()?1:n.perPage;return B(function(Q){return wi(Q.index,H,H+V-1)})}function x(C){return B(C)[0]}function S(C,A){Pt(C,function(H){if(nn(H)&&(H=ma(H)),da(H)){var V=s[A];V?Mo(H,V):oi(p,H),Ht(H,n.classes.slide),P(H,qe(a,_n))}}),a(rt)}function O(C){hn(B(C).map(function(A){return A.slide})),a(rt)}function R(C,A){T(A).forEach(C)}function B(C){return u.filter(ca(C)?C:function(A){return nn(C)?Vn(A.slide,C):Ao(ii(C),A.index)})}function w(C,A,H){R(function(V){V.style(C,A,H)})}function P(C,A){var H=ko(C,"img"),V=H.length;V?H.forEach(function(Q){l(Q,"load error",function(){--V||A()})}):A()}function j(C){return C?s.length:u.length}function g(){return u.length>n.perPage}return{mount:$,destroy:y,update:m,register:h,get:T,getIn:L,getAt:x,add:S,remove:O,forEach:R,filter:B,style:w,getLength:j,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,$=p.track,b=p.list,y=d.getAt,m=d.style,h,T,L;function x(){S(),a(window,"resize load",al(qe(l,_n))),o([ht,rt],S),o(_n,O)}function S(){h=n.direction===zi,Mt(u,"maxWidth",cn(n.width)),Mt($,s("paddingLeft"),R(!1)),Mt($,s("paddingRight"),R(!0)),O(!0)}function O(E){var M=Et(u);(E||T.width!==M.width||T.height!==M.height)&&(Mt($,"height",B()),m(s("marginRight"),cn(n.gap)),m("width",P()),m("height",j(),!0),T=M,l(Ni),L!==(L=_())&&(Kt(u,ja,L),l(ol,L)))}function R(E){var M=n.padding,W=s(E?"right":"left");return M&&cn(M[W]||(zn(M)?0:M))||"0px"}function B(){var E="";return h&&(E=w(),On(E,"height or heightRatio is missing."),E="calc("+E+" - "+R(!1)+" - "+R(!0)+")"),E}function w(){return cn(n.height||Et(b).width*n.heightRatio)}function P(){return n.autoWidth?null:cn(n.fixedWidth)||(h?"":g())}function j(){return cn(n.fixedHeight)||(h?n.autoHeight?null:g():w())}function g(){var E=cn(n.gap);return"calc((100%"+(E&&" + "+E)+")/"+(n.perPage||1)+(E&&" - "+E)+")"}function C(){return Et(b)[s("width")]}function A(E,M){var W=y(E||0);return W?Et(W.slide)[s("width")]+(M?0:Q()):0}function H(E,M){var W=y(E);if(W){var z=Et(W.slide)[s("right")],K=Et(b)[s("left")];return St(z-K)+(M?0:Q())}return 0}function V(E){return H(e.length-1)-H(0)+A(0,E)}function Q(){var E=y(0);return E&&parseFloat(Mt(E.slide,s("marginRight")))||0}function k(E){return parseFloat(Mt($,s("padding"+(E?"Right":"Left"))))||0}function _(){return e.is(li)||V(!0)>C()}return{mount:x,resize:O,listSize:C,slideSize:A,sliderSize:V,totalSize:H,getPadding:k,isOverflow:_}}var Ll=2;function Il(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,$),o([ht,_n],y),(p=T())&&(m(p),t.Layout.resize(!0))}function $(){b(),u()}function b(){hn(s),Yt(s),i.destroy()}function y(){var L=T();p!==L&&(p<L||!L)&&i.emit(rt)}function m(L){var x=l.get().slice(),S=x.length;if(S){for(;x.length<L;)Ci(x,x);Ci(x.slice(-L),x.slice(0,L)).forEach(function(O,R){var B=R<L,w=h(O.slide,R);B?Mo(w,x[0].slide):oi(a.list,w),Ci(s,w),l.register(w,R-L+(B?0:S),O.index)})}}function h(L,x){var S=L.cloneNode(!0);return Ht(S,n.classes.clone),S.id=e.root.id+"-clone"+Fo(x+1),S}function T(){var L=n.clones;if(!e.is(Nn))L=0;else if(ni(L)){var x=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=x&&qn(Et(a.track)[d("width")]/x);L=S||n[d("autoWidth")]&&e.length||n.perPage*Ll}return L}return{mount:u,destroy:b}}function El(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,$=d.listSize,b=d.sliderSize,y=t.Direction,m=y.resolve,h=y.orient,T=t.Elements,L=T.list,x=T.track,S;function O(){S=t.Transition,o([sn,Ni,ht,rt],R)}function R(){t.Controller.isBusy()||(t.Scroll.cancel(),w(e.index),t.Slides.update())}function B(W,z,K,ie){W!==z&&E(W>K)&&(C(),P(g(V(),W>K),!0)),l(Wn),a(Jt,z,K,W),S.start(z,function(){l(En),a(Fn,z,K,W),ie&&ie()})}function w(W){P(H(W,!0))}function P(W,z){if(!e.is(li)){var K=z?W:j(W);Mt(L,"transform","translate"+m("X")+"("+K+"px)"),W!==K&&a(Ra)}}function j(W){if(e.is(Nn)){var z=A(W),K=z>t.Controller.getEnd(),ie=z<0;(ie||K)&&(W=g(W,K))}return W}function g(W,z){var K=W-_(z),ie=b();return W-=h(ie*(qn(St(K)/ie)||1))*(z?1:-1),W}function C(){P(V(),!0),S.cancel()}function A(W){for(var z=t.Slides.get(),K=0,ie=1/0,F=0;F<z.length;F++){var J=z[F].index,f=St(H(J,!0)-W);if(f<=ie)ie=f,K=J;else break}return K}function H(W,z){var K=h(u(W-1)-k(W));return z?Q(K):K}function V(){var W=m("left");return Et(L)[W]-Et(x)[W]+h(p(!1))}function Q(W){return n.trimSpace&&e.is(Rn)&&(W=Cn(W,0,h(b(!0)-$()))),W}function k(W){var z=n.focus;return z==="center"?($()-s(W,!0))/2:+z*s(W)||0}function _(W){return H(W?t.Controller.getEnd():0,!!n.trimSpace)}function E(W){var z=h(g(V(),W));return W?z>=0:z<=L[m("scrollWidth")]-Et(x)[m("width")]}function M(W,z){z=ni(z)?V():z;var K=W!==!0&&h(z)<h(_(!1)),ie=W!==!1&&h(z)>h(_(!0));return K||ie}return{mount:O,move:B,jump:w,translate:P,shift:g,cancel:C,toIndex:A,toPosition:H,getPosition:V,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,$=u.isEnough,b=u.getLength,y=n.omitEnd,m=e.is(Nn),h=e.is(Rn),T=qe(V,!1),L=qe(V,!0),x=n.start||0,S,O=x,R,B,w;function P(){j(),o([ht,rt,Mi],j),o(Ni,g)}function j(){R=b(!0),B=n.perMove,w=n.perPage,S=E();var f=Cn(x,0,y?S:R-1);f!==x&&(x=f,l.reposition())}function g(){S!==E()&&a(Mi)}function C(f,ne,xe){if(!J()){var pe=H(f),ve=_(pe);ve>-1&&(ne||ve!==x)&&(K(ve),l.move(pe,ve,O,xe))}}function A(f,ne,xe,pe){t.Scroll.scroll(f,ne,xe,function(){var ve=_(l.toIndex(d()));K(y?on(ve,S):ve),pe&&pe()})}function H(f){var ne=x;if(nn(f)){var xe=f.match(/([+\-<>])(\d+)?/)||[],pe=xe[1],ve=xe[2];pe==="+"||pe==="-"?ne=Q(x+ +(""+pe+(+ve||1)),x):pe===">"?ne=ve?M(+ve):T(!0):pe==="<"&&(ne=L(!0))}else ne=m?f:Cn(f,0,S);return ne}function V(f,ne){var xe=B||(F()?1:w),pe=Q(x+xe*(f?-1:1),x,!(B||F()));return pe===-1&&h&&!ha(d(),s(!f),1)?f?0:S:ne?pe:_(pe)}function Q(f,ne,xe){if($()||F()){var pe=k(f);pe!==f&&(ne=f,f=pe,xe=!1),f<0||f>S?!B&&(wi(0,f,ne,!0)||wi(S,ne,f,!0))?f=M(W(f)):m?f=xe?f<0?-(R%w||w):R:f:n.rewind?f=f<0?S:0:f=-1:xe&&f!==ne&&(f=M(W(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 _(f){return m?(f+R)%R||0:f}function E(){for(var f=R-(F()||m&&B?1:w);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:w*f,0,S)}function W(f){return F()?on(f,S):Ai((f>=S?R-1:f)/w)}function z(f){var ne=l.toIndex(f);return h?Cn(ne,0,S):ne}function K(f){f!==x&&(O=x,x=f)}function ie(f){return f?O:x}function F(){return!ni(n.focus)||n.isNavigation}function J(){return e.state.is([Wn,ti])&&!!n.waitForTransition}return{mount:P,go:C,scroll:A,getNext:T,getPrev:L,getAdjacent:V,getEnd:E,setIndex:K,getIndex:ie,toIndex:M,toPage:W,toDest:z,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,$=p.arrows,b=p.track,y=$,m=p.prev,h=p.next,T,L,x={};function S(){R(),o(ht,O)}function O(){B(),S()}function R(){var A=n.arrows;A&&!(m&&h)&&j(),m&&h&&(Gn(x,{prev:m,next:h}),Un(y,A?"":"none"),Ht(y,L=Go+"--"+n.direction),A&&(w(),C(),Ae([m,h],si,b.id),l($a,m,h)))}function B(){i.destroy(),Gt(y,L),T?(hn($?[m,h]:y),m=h=null):Ot([m,h],Ko)}function w(){o([sn,Fn,rt,yn,Mi],C),a(h,"click",qe(P,">")),a(m,"click",qe(P,"<"))}function P(A){u.go(A,!0)}function j(){y=$||Ln("div",d.arrows),m=g(!0),h=g(!1),T=!0,oi(y,[m,h]),!$&&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 C(){if(m&&h){var A=e.index,H=u.getPrev(),V=u.getNext(),Q=H>-1&&A<H?s.last:s.prev,k=V>-1&&A>V?s.first:s.next;m.disabled=H<0,h.disabled=V<0,Ae(m,_t,Q),Ae(h,_t,k),l(Ta,m,h,H,V)}}return{arrows:x,mount:S,destroy:B,update:C}}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,">"),w),s=d.isPaused,p=t.Elements,u=t.Elements,$=u.root,b=u.toggle,y=n.autoplay,m,h,T=y==="pause";function L(){y&&(x(),b&&Ae(b,si,p.track.id),T||S(),B())}function x(){n.pauseOnHover&&a($,"mouseenter mouseleave",function(j){m=j.type==="mouseenter",R()}),n.pauseOnFocus&&a($,"focusin focusout",function(j){h=j.type==="focusin",R()}),b&&a(b,"click",function(){T?S():O(!0)}),o([Jt,Hi,rt],d.rewind),o(Jt,P)}function S(){s()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),h=m=T=!1,B(),l(Bo))}function O(j){j===void 0&&(j=!0),T=!!j,B(),s()||(d.pause(),l(Do))}function R(){T||(m||h?O(!1):S())}function B(){b&&(Kt(b,fn,!T),Ae(b,_t,n.i18n[T?"play":"pause"]))}function w(j){var g=p.bar;g&&Mt(g,"width",j*100+"%"),l(Ea,j)}function P(j){var g=t.Slides.getAt(j);d.set(g&&+kt(g.slide,Ml)||n.interval)}return{mount:L,destroy:d.cancel,play:S,pause:O,isPaused:s}}function Wl(e,t,n){var i=Qe(e),o=i.on;function a(){n.cover&&(o(jo,qe(d,!0)),o([sn,ht,rt],qe(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:qe(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,$=d.translate,b=e.is(Rn),y,m,h=1;function T(){o(Jt,O),o([ht,rt],R)}function L(w,P,j,g,C){var A=s();if(O(),j&&(!b||!u())){var H=t.Layout.sliderSize(),V=bo(w)*H*Ai(St(w)/H)||0;w=d.toPosition(t.Controller.toDest(w%H))+V}var Q=ha(A,w,1);h=1,P=Q?0:P||Pi(St(w-A)/Ol,Bl),m=g,y=Oi(P,x,qe(S,A,w,C),1),l(ti),a(Hi),y.start()}function x(){l(En),m&&m(),a(yn)}function S(w,P,j,g){var C=s(),A=w+(P-w)*B(g),H=(A-C)*h;$(C+H),b&&!j&&u()&&(h*=Hl,St(H)<Fl&&L(p(u(!0)),Nl,!1,m,!0))}function O(){y&&y.cancel()}function R(){y&&!y.isPaused()&&(O(),x())}function B(w){var P=n.easingFunc;return P?P(w):1-Math.pow(1-w,4)}return{mount:T,destroy:O,scroll:L,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,$=t.Controller,b=t.Elements.track,y=t.Media.reduce,m=t.Direction,h=m.resolve,T=m.orient,L=p.getPosition,x=p.exceededLimit,S,O,R,B,w,P=!1,j,g,C;function A(){l(b,eo,yo,wn),l(b,to,yo,wn),l(b,za,V,wn),l(b,"click",_,{capture:!0}),l(b,"dragstart",Vt),o([sn,ht],H)}function H(){var G=n.drag;fe(!G),B=G==="free"}function V(G){if(j=!1,!g){var ee=ve(G);pe(G.target)&&(ee||!G.button)&&($.isBusy()?Vt(G,!0):(C=ee?b:window,w=s.is([Wn,ti]),R=null,l(C,eo,Q,wn),l(C,to,k,wn),p.cancel(),u.cancel(),E(G)))}}function Q(G){if(s.is(Si)||(s.set(Si),a(Sa)),G.cancelable)if(w){p.translate(S+xe(F(G)));var ee=J(G)>br,le=P!==(P=x());(ee||le)&&E(G),j=!0,a(Ca),Vt(G)}else z(G)&&(w=W(G),Vt(G))}function k(G){s.is(Si)&&(s.set(En),a(wa)),w&&(M(G),Vt(G)),d(C,eo,Q),d(C,to,k),w=!1}function _(G){!g&&j&&Vt(G,!0)}function E(G){R=O,O=G,S=L()}function M(G){var ee=K(G),le=ie(ee),oe=n.rewind&&n.rewindByDrag;y(!1),B?$.scroll(le,0,n.snap):e.is(li)?$.go(T(bo(ee))<0?oe?"<":"-":oe?">":"+"):e.is(Rn)&&P&&oe?$.go(x(!0)?">":"<"):$.go($.toDest(le),!0),y(!0)}function W(G){var ee=n.dragMinThreshold,le=zn(ee),oe=le&&ee.mouse||0,Le=(le?ee.touch:+ee)||10;return St(F(G))>(ve(G)?Le:oe)}function z(G){return St(F(G))>St(F(G,!0))}function K(G){if(e.is(Nn)||!P){var ee=J(G);if(ee&&ee<br)return F(G)/ee}return 0}function ie(G){return L()+bo(G)*on(St(G)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function F(G,ee){return ne(G,ee)-ne(f(G),ee)}function J(G){return vo(G)-vo(f(G))}function f(G){return O===G&&R||O}function ne(G,ee){return(ve(G)?G.changedTouches[0]:G)["page"+h(ee?"Y":"X")]}function xe(G){return G/(P&&e.is(Rn)?Sl:1)}function pe(G){var ee=n.noDrag;return!Vn(G,"."+Ha+", ."+Ki)&&(!ee||!Vn(G,ee))}function ve(G){return typeof TouchEvent<"u"&&G instanceof TouchEvent}function se(){return w}function fe(G){g=G}return{mount:A,disable:fe,isDragging:se}}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 $(){b(),o(ht,y),o(ht,b),o(Jt,h)}function b(){var L=n.keyboard;L&&(p=L==="global"?window:d,a(p,xr,T))}function y(){l(p,xr)}function m(L){u=L}function h(){var L=u;u=!0,la(function(){u=L})}function T(L){if(!u){var x=Uo(L);x===s(Di)?e.go("<"):x===s(ji)&&e.go(">")}}return{mount:$,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 $(){n.lazyLoad&&(b(),o(rt,b))}function b(){Yt(u),y(),s?L():(a(p),o(p,m),m())}function y(){t.Slides.forEach(function(x){ko(x.slide,Kl).forEach(function(S){var O=kt(S,Bn),R=kt(S,$i);if(O!==S.src||R!==S.srcset){var B=n.classes.spinner,w=S.parentElement,P=ri(w,"."+B)||Ln("span",B,w);u.push([S,x,P]),S.src||Un(S,"none")}})})}function m(){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||a(p)}function h(x){var S=x[0];Ht(x[1].slide,wo),l(S,"load error",qe(T,x)),Ae(S,"src",kt(S,Bn)),Ae(S,"srcset",kt(S,$i)),Ot(S,Bn),Ot(S,$i)}function T(x,S){var O=x[0],R=x[1];Gt(R.slide,wo),S.type!=="error"&&(hn(x[2]),Un(O,""),d(jo,O,R),d(_n)),s&&L()}function L(){u.length&&h(u.shift())}return{mount:$,destroy:qe(Yt,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,$=p.getIndex,b=p.go,y=t.Direction.resolve,m=s.pagination,h=[],T,L;function x(){S(),o([ht,rt,Mi],x);var g=n.pagination;m&&Un(m,g?"":"none"),g&&(o([Jt,Hi,yn],j),O(),j(),a(La,{list:T,items:h},P(e.index)))}function S(){T&&(hn(m?an(T.children):T),Gt(T,L),Yt(h),T=null),i.destroy()}function O(){var g=e.length,C=n.classes,A=n.i18n,H=n.perPage,V=u()?p.getEnd()+1:qn(g/H);T=m||Ln("ul",C.pagination,s.track.parentElement),Ht(T,L=Gi+"--"+w()),Ae(T,Ut,"tablist"),Ae(T,_t,A.select),Ae(T,Vo,w()===zi?"vertical":"");for(var Q=0;Q<V;Q++){var k=Ln("li",null,T),_=Ln("button",{class:C.page,type:"button"},k),E=d.getIn(Q).map(function(W){return W.slide.id}),M=!u()&&H>1?A.pageX:A.slideX;l(_,"click",qe(R,Q)),n.paginationKeyboard&&l(_,"keydown",qe(B,Q)),Ae(k,Ut,"presentation"),Ae(_,Ut,"tab"),Ae(_,si,E.join(" ")),Ae(_,_t,xo(M,Q+1)),Ae(_,In,-1),h.push({li:k,button:_,page:Q})}}function R(g){b(">"+g,!0)}function B(g,C){var A=h.length,H=Uo(C),V=w(),Q=-1;H===y(ji,!1,V)?Q=++g%A:H===y(Di,!1,V)?Q=(--g+A)%A:H==="Home"?Q=0:H==="End"&&(Q=A-1);var k=h[Q];k&&(pa(k.button),b(">"+Q),Vt(C,!0))}function w(){return n.paginationDirection||n.direction}function P(g){return h[p.toPage(g)]}function j(){var g=P($(!0)),C=P($());if(g){var A=g.button;Gt(A,fn),Ot(A,gr),Ae(A,In,-1)}if(C){var H=C.button;Ht(H,fn),Ae(H,gr,!0),Ae(H,In,"")}a(Ia,{list:T,items:h},g,C)}return{items:h,mount:x,destroy:S,getAt:P,update:j}}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()}),Yt(a)}function s(){d(),l()}function p(m,h){var T=Qe(m);T.on(Jt,function(L,x,S){h.go(h.is(Nn)?S:L)}),a.push(T)}function u(){var m=Qe(e),h=m.on;h(No,b),h(_a,y),h([sn,ht],$),a.push(m),m.emit(Oo,e.splides)}function $(){Ae(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),Vt(h))}return{setup:qe(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,$=u<0,b=vo(p),y=n.wheelMinThreshold||0,m=n.wheelSleep||0;St(u)>y&&b-a>m&&(e.go($?"<":">"),a=b),s($)&&Vt(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,qe(u,!1));function p(){l&&(b(!t.Autoplay.isPaused()),Ae(a,yr,!0),d.textContent="…",o(Bo,qe(b,!0)),o(Do,qe(b,!1)),o([Fn,yn],qe(u,!0)))}function u(y){Ae(a,fr,y),y?(oi(a,d),s.start()):(hn(d),s.cancel())}function $(){Ot(a,[hr,yr,fr]),hn(d)}function b(y){l&&Ae(a,hr,y?"off":"polite")}return{mount:p,disable:b,destroy:$}}var Ql=Object.freeze({__proto__:null,Media:sl,Direction:ll,Elements:Cl,Slides:$l,Layout:Tl,Clones:Il,Move:El,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=qe(Mt,l,"transition"),s;function p(){Qe(e).bind(l,"transitionend",function(y){y.target===l&&s&&($(),s())})}function u(y,m){var h=i.toPosition(y,!0),T=i.getPosition(),L=b(y);St(h-T)>=1&&L>=1?n.useScroll?a.scroll(h,L,!1,m):(d("transform "+L+"ms "+n.easing),i.translate(h,!0),s=m):(i.jump(y),m())}function $(){d(""),a.cancel()}function b(y){var m=n.rewindSpeed;if(e.is(Rn)&&m){var h=o.getIndex(!0),T=o.getEnd();if(h===0&&y>=T||h>=T&&y===0)return m}return n.speed}return{mount:p,start:u,cancel:$}}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:kt(o,_t)||"",labelledby:kt(o,zo)||""},tc,e.defaults,i||{});try{tn(i,JSON.parse(kt(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 $=p(a,d,a._o);d[u]=$,$.setup&&$.setup()}),gn(d,function(p){p.mount&&p.mount()}),this.emit(sn),Ht(this.root,yl),l.set(En),this.emit(So),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(En)&&(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&&Yt(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"],[Jt,"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"],[Ia,"onPaginationUpdated"],[Oo,"onNavigationMounted"],[Bo,"onAutoplayPlay"],[Ea,"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);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),c=require("react"),je=require("classnames"),L=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),ti=require("react-dom");function ds(e){return e.type==="object"&&e.version===1}const us="ControlSlider-module__wrapper___sHEkd",ps="ControlSlider-module__hoverArrow___A-dOH",ms="ControlSlider-module__sliderItem___QQSkR",gs="ControlSlider-module__sliderImage___9hRl-",hs="ControlSlider-module__arrow___05ghY",fs="ControlSlider-module__arrowVertical___tBfVN",ys="ControlSlider-module__nextArrow___-30Yc",vs="ControlSlider-module__arrowInner___aEra3",bs="ControlSlider-module__arrowIcon___S4ztF",xs="ControlSlider-module__arrowImg___2dwJW",Ss="ControlSlider-module__mirror___brd6U",Cs="ControlSlider-module__pagination___bicLF",ws="ControlSlider-module__paginationInner___bT-P-",$s="ControlSlider-module__paginationVertical___zYqKw",Ts="ControlSlider-module__paginationItem___nTRbk",Ls="ControlSlider-module__dot___p1Qun",Is="ControlSlider-module__activeDot___LHFaj",Es="ControlSlider-module__paginationInsideBottom___R3FWn",_s="ControlSlider-module__paginationInsideTop___V-qb-",Rs="ControlSlider-module__paginationOutsideBottom___14w8D",As="ControlSlider-module__paginationOutsideTop___SCLqB",Ps="ControlSlider-module__paginationInsideLeft___yOBRZ",Ms="ControlSlider-module__paginationInsideRight___Rtt3o",ks="ControlSlider-module__paginationOutsideLeft___lahaw",Ws="ControlSlider-module__paginationOutsideRight___EtuQa",Fs="ControlSlider-module__imgWrapper___UjEgB",Ns="ControlSlider-module__captionBlock___dJ6-j",Hs="ControlSlider-module__captionTextWrapper___HFlpf",Os="ControlSlider-module__captionText___uGBVc",Bs="ControlSlider-module__active___WZK4G",Ds="ControlSlider-module__withPointerEvents___t-18M",js="ControlSlider-module__topLeftAlignment___zjnGM",zs="ControlSlider-module__topCenterAlignment___gD1xW",Vs="ControlSlider-module__topRightAlignment___NMapS",Ks="ControlSlider-module__middleLeftAlignment___OnUrY",Us="ControlSlider-module__middleCenterAlignment___Tdkl0",Gs="ControlSlider-module__middleRightAlignment___wEbfX",qs="ControlSlider-module__bottomLeftAlignment___cTP2-",Xs="ControlSlider-module__bottomCenterAlignment___c54fB",Ys="ControlSlider-module__bottomRightAlignment___kEwrz",Js="ControlSlider-module__clickOverlay___DZA28",Zs="ControlSlider-module__contain___pLyq7",Qs="ControlSlider-module__cover___KdDat",xe={wrapper:us,hoverArrow:ps,sliderItem:ms,sliderImage:gs,arrow:hs,arrowVertical:fs,nextArrow:ys,arrowInner:vs,arrowIcon:bs,arrowImg:xs,mirror:Ss,pagination:Cs,paginationInner:ws,paginationVertical:$s,paginationItem:Ts,dot:Ls,activeDot:Is,paginationInsideBottom:Es,paginationInsideTop:_s,paginationOutsideBottom:Rs,paginationOutsideTop:As,paginationInsideLeft:Ps,paginationInsideRight:Ms,paginationOutsideLeft:ks,paginationOutsideRight:Ws,imgWrapper:Fs,captionBlock:Ns,captionTextWrapper:Hs,captionText:Os,active:Bs,withPointerEvents:Ds,topLeftAlignment:js,topCenterAlignment:zs,topRightAlignment:Vs,middleLeftAlignment:Ks,middleCenterAlignment:Us,middleRightAlignment:Gs,bottomLeftAlignment:qs,bottomCenterAlignment:Xs,bottomRightAlignment:Ys,clickOverlay:Js,contain:Zs,cover:Qs};function el(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 tl(e,t,n){return t&&el(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var lr="(prefers-reduced-motion: reduce)",Tn=1,nl=2,Rn=3,Nn=4,ni=5,Ci=6,Ai=7,il={CREATED:Tn,MOUNTED:nl,IDLE:Rn,MOVING:Nn,SCROLLING:ni,DRAGGING:Ci,DESTROYED:Ai};function Yt(e){e.length=0}function an(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ze(e){return e.bind.apply(e,[null].concat(an(arguments,1)))}var ca=setTimeout,vo=function(){};function cr(e){return requestAnimationFrame(e)}function Ni(e,t){return typeof t===e}function Vn(e){return!Ao(e)&&Ni("object",e)}var Ro=Array.isArray,da=Ze(Ni,"function"),nn=Ze(Ni,"string"),ii=Ze(Ni,"undefined");function Ao(e){return e===null}function ua(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function oi(e){return Ro(e)?e:[e]}function _t(e,t){oi(e).forEach(t)}function Po(e,t){return e.indexOf(t)>-1}function wi(e,t){return e.push.apply(e,oi(t)),e}function Kt(e,t,n){e&&_t(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Ot(e,t){Kt(e,nn(t)?t.split(" "):t,!0)}function ri(e,t){_t(t,e.appendChild.bind(e))}function Mo(e,t){_t(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Kn(e,t){return ua(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function pa(e,t){var n=e?an(e.children):[];return t?n.filter(function(i){return Kn(i,t)}):n}function ai(e,t){return t?pa(e,t)[0]:e.firstElementChild}var Un=Object.keys;function gn(e,t,n){return e&&(n?Un(e).reverse():Un(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():Vn(n)?e[i]=tn({},Vn(e[i])?e[i]:{},n):e[i]=n})}),e}function dr(e,t){_t(t||Un(e),function(n){delete e[n]})}function Bt(e,t){_t(e,function(n){_t(t,function(i){n&&n.removeAttribute(i)})})}function ke(e,t,n){Vn(t)?gn(t,function(i,o){ke(e,o,i)}):_t(e,function(i){Ao(n)||n===""?Bt(i,t):i.setAttribute(t,String(n))})}function Ln(e,t,n){var i=document.createElement(e);return t&&(nn(t)?Ot(i,t):ke(i,t)),n&&ri(n,i),i}function Mt(e,t,n){if(ii(n))return getComputedStyle(e)[t];Ao(n)||(e.style[t]=""+n)}function qn(e,t){Mt(e,"display",t)}function ma(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function kt(e,t){return e.getAttribute(t)}function ur(e,t){return e&&e.classList.contains(t)}function Lt(e){return e.getBoundingClientRect()}function hn(e){_t(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function ga(e){return ai(new DOMParser().parseFromString(e,"text/html").body)}function Vt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ha(e,t){return e&&e.querySelector(t)}function ko(e,t){return t?an(e.querySelectorAll(t)):[]}function Ut(e,t){Kt(e,t,!1)}function bo(e){return e.timeStamp}function cn(e){return nn(e)?e:e?e+"px":""}var si="splide",Wo="data-"+si;function Dn(e,t){if(!e)throw new Error("["+si+"] "+(t||""))}var on=Math.min,Pi=Math.max,Mi=Math.floor,Xn=Math.ceil,Ct=Math.abs;function fa(e,t,n){return Ct(e-t)<n}function $i(e,t,n,i){var o=on(t,n),r=Pi(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Cn(e,t,n){var i=on(t,n),o=Pi(t,n);return on(Pi(i,e),o)}function xo(e){return+(e>0)-+(e<0)}function So(e,t){return _t(t,function(n){e=e.replace("%s",""+n)}),e}function Fo(e){return e<10?"0"+e:""+e}var pr={};function ol(e){return""+e+Fo(pr[e]=(pr[e]||0)+1)}function ya(){var e=[];function t(s,d,l,p){o(s,d,function(u,C,v){var y="addEventListener"in u,m=y?u.removeEventListener.bind(u,C,l,p):u.removeListener.bind(u,l);y?u.addEventListener(C,l,p):u.addListener(l),e.push([u,C,v,l,m])})}function n(s,d,l){o(s,d,function(p,u,C){e=e.filter(function(v){return v[0]===p&&v[1]===u&&v[2]===C&&(!l||v[3]===l)?(v[4](),!1):!0})})}function i(s,d,l){var p,u=!0;return typeof CustomEvent=="function"?p=new CustomEvent(d,{bubbles:u,detail:l}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(d,u,!1,l)),s.dispatchEvent(p),p}function o(s,d,l){_t(s,function(p){p&&_t(d,function(u){u.split(" ").forEach(function(C){var v=C.split(".");l(p,v[0],v[1])})})})}function r(){e.forEach(function(s){s[4]()}),Yt(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var sn="mounted",Co="ready",Jt="move",Hn="moved",No="click",va="active",ba="inactive",xa="visible",Sa="hidden",ct="refresh",vt="updated",An="resize",Hi="resized",Ca="drag",wa="dragging",$a="dragged",Oi="scroll",yn="scrolled",rl="overflow",Ho="destroy",Ta="arrows:mounted",La="arrows:updated",Ia="pagination:mounted",Ea="pagination:updated",Oo="navigation:mounted",Bo="autoplay:play",_a="autoplay:playing",Do="autoplay:pause",jo="lazyload:loaded",Ra="sk",Aa="sh",ki="ei";function et(e){var t=e?e.event.bus:document.createDocumentFragment(),n=ya();function i(r,s){n.bind(t,oi(r).join(" "),function(d){s.apply(s,Ro(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,an(arguments,1))}return e&&e.event.on(Ho,n.destroy),Gn(n,{bus:t,on:i,off:Ze(n.unbind,t),emit:o})}function Bi(e,t,n,i){var o=Date.now,r,s=0,d,l=!0,p=0;function u(){if(!l){if(s=e?on((o()-r)/e,1):1,n&&n(s),s>=1&&(t(),r=o(),i&&++p>=i))return v();d=cr(u)}}function C($){$||m(),r=o()-($?s*e:0),l=!1,d=cr(u)}function v(){l=!0}function y(){r=o(),s=0,n&&n(s)}function m(){d&&cancelAnimationFrame(d),s=0,d=0,l=!0}function h($){e=$}function w(){return l}return{start:C,rewind:y,pause:v,cancel:m,set:h,isPaused:w}}function al(e){var t=e;function n(o){t=o}function i(o){return Po(oi(o),t)}return{set:n,is:i}}function sl(e,t){var n=Bi(0,e,null,1);return function(){n.isPaused()&&n.start()}}function ll(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},s=ya(),d=[];function l(){var m=n.mediaQuery==="min";Un(o).sort(function(h,w){return m?+h-+w:+w-+h}).forEach(function(h){u(o[h],"("+(m?"min":"max")+"-width:"+h+"px)")}),u(r,lr),C()}function p(m){m&&s.destroy()}function u(m,h){var w=matchMedia(h);s.bind(w,"change",C),d.push([m,w])}function C(){var m=i.is(Ai),h=n.direction,w=d.reduce(function($,S){return tn($,S[1].matches?S[0]:{})},{});dr(n),y(w),n.destroy?e.destroy(n.destroy==="completely"):m?(p(!0),e.mount()):h!==n.direction&&e.refresh()}function v(m){matchMedia(lr).matches&&(m?tn(n,r):dr(n,Un(r)))}function y(m,h,w){tn(n,m),h&&tn(Object.getPrototypeOf(n),m),(w||!i.is(Tn))&&e.emit(vt,n)}return{setup:l,destroy:p,reduce:v,set:y}}var Di="Arrow",ji=Di+"Left",zi=Di+"Right",Pa=Di+"Up",Ma=Di+"Down",mr="rtl",Vi="ttb",Qi={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Pa,zi],ArrowRight:[Ma,ji]};function cl(e,t,n){function i(r,s,d){d=d||n.direction;var l=d===mr&&!s?1:d===Vi?0:-1;return Qi[r]&&Qi[r][l]||r.replace(/width|left|right/i,function(p,u){var C=Qi[p.toLowerCase()][l]||p;return u>0?C.charAt(0).toUpperCase()+C.slice(1):C})}function o(r){return r*(n.direction===mr?1:-1)}return{resolve:i,orient:o}}var Gt="role",In="tabindex",dl="disabled",Wt="aria-",li=Wt+"controls",ka=Wt+"current",gr=Wt+"selected",It=Wt+"label",zo=Wt+"labelledby",Wa=Wt+"hidden",Vo=Wt+"orientation",Yn=Wt+"roledescription",hr=Wt+"live",fr=Wt+"busy",yr=Wt+"atomic",Ko=[Gt,In,dl,li,ka,It,zo,Wa,Vo,Yn],Dt=si+"__",ln="is-",eo=si,vr=Dt+"track",ul=Dt+"list",Ki=Dt+"slide",Fa=Ki+"--clone",pl=Ki+"__container",Uo=Dt+"arrows",Ui=Dt+"arrow",Na=Ui+"--prev",Ha=Ui+"--next",Gi=Dt+"pagination",Oa=Gi+"__page",ml=Dt+"progress",gl=ml+"__bar",hl=Dt+"toggle",fl=Dt+"spinner",yl=Dt+"sr",vl=ln+"initialized",fn=ln+"active",Ba=ln+"prev",Da=ln+"next",wo=ln+"visible",$o=ln+"loading",ja=ln+"focus-in",za=ln+"overflow",bl=[fn,wo,Ba,Da,$o,ja,za],xl={slide:Ki,clone:Fa,arrows:Uo,arrow:Ui,prev:Na,next:Ha,pagination:Gi,page:Oa,spinner:fl};function Sl(e,t){if(da(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Kn(n,t);)n=n.parentElement;return n}var Cl=5,br=200,Va="touchstart mousedown",to="touchmove mousemove",no="touchend touchcancel mouseup click";function wl(e,t,n){var i=et(e),o=i.on,r=i.bind,s=e.root,d=n.i18n,l={},p=[],u=[],C=[],v,y,m;function h(){b(),H(),S()}function w(){o(ct,$),o(ct,h),o(vt,S),r(document,Va+" keydown",function(x){m=x.type==="keydown"},{capture:!0}),r(s,"focusin",function(){Kt(s,ja,!!m)})}function $(x){var E=Ko.concat("style");Yt(p),Ut(s,u),Ut(v,C),Bt([v,y],E),Bt(s,x?E:["style",Yn])}function S(){Ut(s,u),Ut(v,C),u=B(eo),C=B(vr),Ot(s,u),Ot(v,C),ke(s,It,n.label),ke(s,zo,n.labelledby)}function b(){v=I("."+vr),y=ai(v,"."+ul),Dn(v&&y,"A track/list element is missing."),wi(p,pa(y,"."+Ki+":not(."+Fa+")")),gn({arrows:Uo,pagination:Gi,prev:Na,next:Ha,bar:gl,toggle:hl},function(x,E){l[E]=I("."+x)}),Gn(l,{root:s,track:v,list:y,slides:p})}function H(){var x=s.id||ol(si),E=n.role;s.id=x,v.id=v.id||x+"-track",y.id=y.id||x+"-list",!kt(s,Gt)&&s.tagName!=="SECTION"&&E&&ke(s,Gt,E),ke(s,Yn,d.carousel),ke(y,Gt,"presentation")}function I(x){var E=ha(s,x);return E&&Sl(E,"."+eo)===s?E:void 0}function B(x){return[x+"--"+n.type,x+"--"+n.direction,n.drag&&x+"--draggable",n.isNavigation&&x+"--nav",x===eo&&fn]}return Gn(l,{setup:h,mount:w,destroy:$})}var Pn="slide",On="loop",ci="fade";function $l(e,t,n,i){var o=et(e),r=o.on,s=o.emit,d=o.bind,l=e.Components,p=e.root,u=e.options,C=u.isNavigation,v=u.updateOnMove,y=u.i18n,m=u.pagination,h=u.slideFocus,w=l.Direction.resolve,$=kt(i,"style"),S=kt(i,It),b=n>-1,H=ai(i,"."+pl),I;function B(){b||(i.id=p.id+"-slide"+Fo(t+1),ke(i,Gt,m?"tabpanel":"group"),ke(i,Yn,y.slide),ke(i,It,S||So(y.slideLabel,[t+1,e.length]))),x()}function x(){d(i,"click",Ze(s,No,D)),d(i,"keydown",Ze(s,Ra,D)),r([Hn,Aa,yn],T),r(Oo,V),v&&r(Jt,g)}function E(){I=!0,o.destroy(),Ut(i,bl),Bt(i,Ko),ke(i,"style",$),ke(i,It,S||"")}function V(){var O=e.splides.map(function(N){var _=N.splide.Components.Slides.getAt(t);return _?_.slide.id:""}).join(" ");ke(i,It,So(y.slideX,(b?n:t)+1)),ke(i,li,O),ke(i,Gt,h?"button":""),h&&Bt(i,Yn)}function g(){I||T()}function T(){if(!I){var O=e.index;P(),W(),Kt(i,Ba,t===O-1),Kt(i,Da,t===O+1)}}function P(){var O=oe();O!==ur(i,fn)&&(Kt(i,fn,O),ke(i,ka,C&&O||""),s(O?va:ba,D))}function W(){var O=F(),N=!O&&(!oe()||b);if(e.state.is([Nn,ni])||ke(i,Wa,N||""),ke(ko(i,u.focusableNodes||""),In,N?-1:""),h&&ke(i,In,N?-1:0),O!==ur(i,wo)&&(Kt(i,wo,O),s(O?xa:Sa,D)),!O&&document.activeElement===i){var _=l.Slides.getAt(e.index);_&&ma(_.slide)}}function K(O,N,_){Mt(_&&H||i,O,N)}function oe(){var O=e.index;return O===t||u.cloneStatus&&O===n}function F(){if(e.is(ci))return oe();var O=Lt(l.Elements.track),N=Lt(i),_=w("left",!0),q=w("right",!0);return Mi(O[_])<=Xn(N[_])&&Mi(N[q])<=Xn(O[q])}function R(O,N){var _=Ct(O-t);return!b&&(u.rewind||e.is(On))&&(_=on(_,e.length-_)),_<=N}var D={index:t,slideIndex:n,slide:i,container:H,isClone:b,mount:B,destroy:E,update:T,style:K,isWithin:R};return D}function Tl(e,t,n){var i=et(e),o=i.on,r=i.emit,s=i.bind,d=t.Elements,l=d.slides,p=d.list,u=[];function C(){v(),o(ct,y),o(ct,v)}function v(){l.forEach(function(T,P){h(T,P,-1)})}function y(){I(function(T){T.destroy()}),Yt(u)}function m(){I(function(T){T.update()})}function h(T,P,W){var K=$l(e,P,W,T);K.mount(),u.push(K),u.sort(function(oe,F){return oe.index-F.index})}function w(T){return T?B(function(P){return!P.isClone}):u}function $(T){var P=t.Controller,W=P.toIndex(T),K=P.hasFocus()?1:n.perPage;return B(function(oe){return $i(oe.index,W,W+K-1)})}function S(T){return B(T)[0]}function b(T,P){_t(T,function(W){if(nn(W)&&(W=ga(W)),ua(W)){var K=l[P];K?Mo(W,K):ri(p,W),Ot(W,n.classes.slide),E(W,Ze(r,An))}}),r(ct)}function H(T){hn(B(T).map(function(P){return P.slide})),r(ct)}function I(T,P){w(P).forEach(T)}function B(T){return u.filter(da(T)?T:function(P){return nn(T)?Kn(P.slide,T):Po(oi(T),P.index)})}function x(T,P,W){I(function(K){K.style(T,P,W)})}function E(T,P){var W=ko(T,"img"),K=W.length;K?W.forEach(function(oe){s(oe,"load error",function(){--K||P()})}):P()}function V(T){return T?l.length:u.length}function g(){return u.length>n.perPage}return{mount:C,destroy:y,update:m,register:h,get:w,getIn:$,getAt:S,add:b,remove:H,forEach:I,filter:B,style:x,getLength:V,isEnough:g}}function Ll(e,t,n){var i=et(e),o=i.on,r=i.bind,s=i.emit,d=t.Slides,l=t.Direction.resolve,p=t.Elements,u=p.root,C=p.track,v=p.list,y=d.getAt,m=d.style,h,w,$;function S(){b(),r(window,"resize load",sl(Ze(s,An))),o([vt,ct],b),o(An,H)}function b(){h=n.direction===Vi,Mt(u,"maxWidth",cn(n.width)),Mt(C,l("paddingLeft"),I(!1)),Mt(C,l("paddingRight"),I(!0)),H(!0)}function H(D){var O=Lt(u);(D||w.width!==O.width||w.height!==O.height)&&(Mt(C,"height",B()),m(l("marginRight"),cn(n.gap)),m("width",E()),m("height",V(),!0),w=O,s(Hi),$!==($=R())&&(Kt(u,za,$),s(rl,$)))}function I(D){var O=n.padding,N=l(D?"right":"left");return O&&cn(O[N]||(Vn(O)?0:O))||"0px"}function B(){var D="";return h&&(D=x(),Dn(D,"height or heightRatio is missing."),D="calc("+D+" - "+I(!1)+" - "+I(!0)+")"),D}function x(){return cn(n.height||Lt(v).width*n.heightRatio)}function E(){return n.autoWidth?null:cn(n.fixedWidth)||(h?"":g())}function V(){return cn(n.fixedHeight)||(h?n.autoHeight?null:g():x())}function g(){var D=cn(n.gap);return"calc((100%"+(D&&" + "+D)+")/"+(n.perPage||1)+(D&&" - "+D)+")"}function T(){return Lt(v)[l("width")]}function P(D,O){var N=y(D||0);return N?Lt(N.slide)[l("width")]+(O?0:oe()):0}function W(D,O){var N=y(D);if(N){var _=Lt(N.slide)[l("right")],q=Lt(v)[l("left")];return Ct(_-q)+(O?0:oe())}return 0}function K(D){return W(e.length-1)-W(0)+P(0,D)}function oe(){var D=y(0);return D&&parseFloat(Mt(D.slide,l("marginRight")))||0}function F(D){return parseFloat(Mt(C,l("padding"+(D?"Right":"Left"))))||0}function R(){return e.is(ci)||K(!0)>T()}return{mount:S,resize:H,listSize:T,slideSize:P,sliderSize:K,totalSize:W,getPadding:F,isOverflow:R}}var Il=2;function El(e,t,n){var i=et(e),o=i.on,r=t.Elements,s=t.Slides,d=t.Direction.resolve,l=[],p;function u(){o(ct,C),o([vt,An],y),(p=w())&&(m(p),t.Layout.resize(!0))}function C(){v(),u()}function v(){hn(l),Yt(l),i.destroy()}function y(){var $=w();p!==$&&(p<$||!$)&&i.emit(ct)}function m($){var S=s.get().slice(),b=S.length;if(b){for(;S.length<$;)wi(S,S);wi(S.slice(-$),S.slice(0,$)).forEach(function(H,I){var B=I<$,x=h(H.slide,I);B?Mo(x,S[0].slide):ri(r.list,x),wi(l,x),s.register(x,I-$+(B?0:b),H.index)})}}function h($,S){var b=$.cloneNode(!0);return Ot(b,n.classes.clone),b.id=e.root.id+"-clone"+Fo(S+1),b}function w(){var $=n.clones;if(!e.is(On))$=0;else if(ii($)){var S=n[d("fixedWidth")]&&t.Layout.slideSize(0),b=S&&Xn(Lt(r.track)[d("width")]/S);$=b||n[d("autoWidth")]&&e.length||n.perPage*Il}return $}return{mount:u,destroy:v}}function _l(e,t,n){var i=et(e),o=i.on,r=i.emit,s=e.state.set,d=t.Layout,l=d.slideSize,p=d.getPadding,u=d.totalSize,C=d.listSize,v=d.sliderSize,y=t.Direction,m=y.resolve,h=y.orient,w=t.Elements,$=w.list,S=w.track,b;function H(){b=t.Transition,o([sn,Hi,vt,ct],I)}function I(){t.Controller.isBusy()||(t.Scroll.cancel(),x(e.index),t.Slides.update())}function B(N,_,q,ie){N!==_&&D(N>q)&&(T(),E(g(K(),N>q),!0)),s(Nn),r(Jt,_,q,N),b.start(_,function(){s(Rn),r(Hn,_,q,N),ie&&ie()})}function x(N){E(W(N,!0))}function E(N,_){if(!e.is(ci)){var q=_?N:V(N);Mt($,"transform","translate"+m("X")+"("+q+"px)"),N!==q&&r(Aa)}}function V(N){if(e.is(On)){var _=P(N),q=_>t.Controller.getEnd(),ie=_<0;(ie||q)&&(N=g(N,q))}return N}function g(N,_){var q=N-R(_),ie=v();return N-=h(ie*(Xn(Ct(q)/ie)||1))*(_?1:-1),N}function T(){E(K(),!0),b.cancel()}function P(N){for(var _=t.Slides.get(),q=0,ie=1/0,k=0;k<_.length;k++){var G=_[k].index,f=Ct(W(G,!0)-N);if(f<=ie)ie=f,q=G;else break}return q}function W(N,_){var q=h(u(N-1)-F(N));return _?oe(q):q}function K(){var N=m("left");return Lt($)[N]-Lt(S)[N]+h(p(!1))}function oe(N){return n.trimSpace&&e.is(Pn)&&(N=Cn(N,0,h(v(!0)-C()))),N}function F(N){var _=n.focus;return _==="center"?(C()-l(N,!0))/2:+_*l(N)||0}function R(N){return W(N?t.Controller.getEnd():0,!!n.trimSpace)}function D(N){var _=h(g(K(),N));return N?_>=0:_<=$[m("scrollWidth")]-Lt(S)[m("width")]}function O(N,_){_=ii(_)?K():_;var q=N!==!0&&h(_)<h(R(!1)),ie=N!==!1&&h(_)>h(R(!0));return q||ie}return{mount:H,move:B,jump:x,translate:E,shift:g,cancel:T,toIndex:P,toPosition:W,getPosition:K,getLimit:R,exceededLimit:O,reposition:I}}function Rl(e,t,n){var i=et(e),o=i.on,r=i.emit,s=t.Move,d=s.getPosition,l=s.getLimit,p=s.toPosition,u=t.Slides,C=u.isEnough,v=u.getLength,y=n.omitEnd,m=e.is(On),h=e.is(Pn),w=Ze(K,!1),$=Ze(K,!0),S=n.start||0,b,H=S,I,B,x;function E(){V(),o([vt,ct,ki],V),o(Hi,g)}function V(){I=v(!0),B=n.perMove,x=n.perPage,b=D();var f=Cn(S,0,y?b:I-1);f!==S&&(S=f,s.reposition())}function g(){b!==D()&&r(ki)}function T(f,ee,ve){if(!G()){var he=W(f),Se=R(he);Se>-1&&(ee||Se!==S)&&(q(Se),s.move(he,Se,H,ve))}}function P(f,ee,ve,he){t.Scroll.scroll(f,ee,ve,function(){var Se=R(s.toIndex(d()));q(y?on(Se,b):Se),he&&he()})}function W(f){var ee=S;if(nn(f)){var ve=f.match(/([+\-<>])(\d+)?/)||[],he=ve[1],Se=ve[2];he==="+"||he==="-"?ee=oe(S+ +(""+he+(+Se||1)),S):he===">"?ee=Se?O(+Se):w(!0):he==="<"&&(ee=$(!0))}else ee=m?f:Cn(f,0,b);return ee}function K(f,ee){var ve=B||(k()?1:x),he=oe(S+ve*(f?-1:1),S,!(B||k()));return he===-1&&h&&!fa(d(),l(!f),1)?f?0:b:ee?he:R(he)}function oe(f,ee,ve){if(C()||k()){var he=F(f);he!==f&&(ee=f,f=he,ve=!1),f<0||f>b?!B&&($i(0,f,ee,!0)||$i(b,ee,f,!0))?f=O(N(f)):m?f=ve?f<0?-(I%x||x):I:f:n.rewind?f=f<0?b:0:f=-1:ve&&f!==ee&&(f=O(N(ee)+(f<ee?-1:1)))}else f=-1;return f}function F(f){if(h&&n.trimSpace==="move"&&f!==S)for(var ee=d();ee===p(f,!0)&&$i(f,0,e.length-1,!n.rewind);)f<S?--f:++f;return f}function R(f){return m?(f+I)%I||0:f}function D(){for(var f=I-(k()||m&&B?1:x);y&&f-- >0;)if(p(I-1,!0)!==p(f,!0)){f++;break}return Cn(f,0,I-1)}function O(f){return Cn(k()?f:x*f,0,b)}function N(f){return k()?on(f,b):Mi((f>=b?I-1:f)/x)}function _(f){var ee=s.toIndex(f);return h?Cn(ee,0,b):ee}function q(f){f!==S&&(H=S,S=f)}function ie(f){return f?H:S}function k(){return!ii(n.focus)||n.isNavigation}function G(){return e.state.is([Nn,ni])&&!!n.waitForTransition}return{mount:E,go:T,scroll:P,getNext:w,getPrev:$,getAdjacent:K,getEnd:D,setIndex:q,getIndex:ie,toIndex:O,toPage:N,toDest:_,hasFocus:k,isBusy:G}}var Al="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",mi=40;function Ml(e,t,n){var i=et(e),o=i.on,r=i.bind,s=i.emit,d=n.classes,l=n.i18n,p=t.Elements,u=t.Controller,C=p.arrows,v=p.track,y=C,m=p.prev,h=p.next,w,$,S={};function b(){I(),o(vt,H)}function H(){B(),b()}function I(){var P=n.arrows;P&&!(m&&h)&&V(),m&&h&&(Gn(S,{prev:m,next:h}),qn(y,P?"":"none"),Ot(y,$=Uo+"--"+n.direction),P&&(x(),T(),ke([m,h],li,v.id),s(Ta,m,h)))}function B(){i.destroy(),Ut(y,$),w?(hn(C?[m,h]:y),m=h=null):Bt([m,h],Ko)}function x(){o([sn,Hn,ct,yn,ki],T),r(h,"click",Ze(E,">")),r(m,"click",Ze(E,"<"))}function E(P){u.go(P,!0)}function V(){y=C||Ln("div",d.arrows),m=g(!0),h=g(!1),w=!0,ri(y,[m,h]),!C&&Mo(y,v)}function g(P){var W='<button class="'+d.arrow+" "+(P?d.prev:d.next)+'" type="button"><svg xmlns="'+Al+'" viewBox="0 0 '+mi+" "+mi+'" width="'+mi+'" height="'+mi+'" focusable="false"><path d="'+(n.arrowPath||Pl)+'" />';return ga(W)}function T(){if(m&&h){var P=e.index,W=u.getPrev(),K=u.getNext(),oe=W>-1&&P<W?l.last:l.prev,F=K>-1&&P>K?l.first:l.next;m.disabled=W<0,h.disabled=K<0,ke(m,It,oe),ke(h,It,F),s(La,m,h,W,K)}}return{arrows:S,mount:b,destroy:B,update:T}}var kl=Wo+"-interval";function Wl(e,t,n){var i=et(e),o=i.on,r=i.bind,s=i.emit,d=Bi(n.interval,e.go.bind(e,">"),x),l=d.isPaused,p=t.Elements,u=t.Elements,C=u.root,v=u.toggle,y=n.autoplay,m,h,w=y==="pause";function $(){y&&(S(),v&&ke(v,li,p.track.id),w||b(),B())}function S(){n.pauseOnHover&&r(C,"mouseenter mouseleave",function(V){m=V.type==="mouseenter",I()}),n.pauseOnFocus&&r(C,"focusin focusout",function(V){h=V.type==="focusin",I()}),v&&r(v,"click",function(){w?b():H(!0)}),o([Jt,Oi,ct],d.rewind),o(Jt,E)}function b(){l()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),h=m=w=!1,B(),s(Bo))}function H(V){V===void 0&&(V=!0),w=!!V,B(),l()||(d.pause(),s(Do))}function I(){w||(m||h?H(!1):b())}function B(){v&&(Kt(v,fn,!w),ke(v,It,n.i18n[w?"play":"pause"]))}function x(V){var g=p.bar;g&&Mt(g,"width",V*100+"%"),s(_a,V)}function E(V){var g=t.Slides.getAt(V);d.set(g&&+kt(g.slide,kl)||n.interval)}return{mount:$,destroy:d.cancel,play:b,pause:H,isPaused:l}}function Fl(e,t,n){var i=et(e),o=i.on;function r(){n.cover&&(o(jo,Ze(d,!0)),o([sn,vt,ct],Ze(s,!0)))}function s(l){t.Slides.forEach(function(p){var u=ai(p.container||p.slide,"img");u&&u.src&&d(l,u,p)})}function d(l,p,u){u.style("background",l?'center/cover no-repeat url("'+p.src+'")':"",!0),qn(p,l?"none":"")}return{mount:r,destroy:Ze(s,!1)}}var Nl=10,Hl=600,Ol=.6,Bl=1.5,Dl=800;function jl(e,t,n){var i=et(e),o=i.on,r=i.emit,s=e.state.set,d=t.Move,l=d.getPosition,p=d.getLimit,u=d.exceededLimit,C=d.translate,v=e.is(Pn),y,m,h=1;function w(){o(Jt,H),o([vt,ct],I)}function $(x,E,V,g,T){var P=l();if(H(),V&&(!v||!u())){var W=t.Layout.sliderSize(),K=xo(x)*W*Mi(Ct(x)/W)||0;x=d.toPosition(t.Controller.toDest(x%W))+K}var oe=fa(P,x,1);h=1,E=oe?0:E||Pi(Ct(x-P)/Bl,Dl),m=g,y=Bi(E,S,Ze(b,P,x,T),1),s(ni),r(Oi),y.start()}function S(){s(Rn),m&&m(),r(yn)}function b(x,E,V,g){var T=l(),P=x+(E-x)*B(g),W=(P-T)*h;C(T+W),v&&!V&&u()&&(h*=Ol,Ct(W)<Nl&&$(p(u(!0)),Hl,!1,m,!0))}function H(){y&&y.cancel()}function I(){y&&!y.isPaused()&&(H(),S())}function B(x){var E=n.easingFunc;return E?E(x):1-Math.pow(1-x,4)}return{mount:w,destroy:H,scroll:$,cancel:I}}var wn={passive:!1,capture:!0};function zl(e,t,n){var i=et(e),o=i.on,r=i.emit,s=i.bind,d=i.unbind,l=e.state,p=t.Move,u=t.Scroll,C=t.Controller,v=t.Elements.track,y=t.Media.reduce,m=t.Direction,h=m.resolve,w=m.orient,$=p.getPosition,S=p.exceededLimit,b,H,I,B,x,E=!1,V,g,T;function P(){s(v,to,vo,wn),s(v,no,vo,wn),s(v,Va,K,wn),s(v,"click",R,{capture:!0}),s(v,"dragstart",Vt),o([sn,vt],W)}function W(){var U=n.drag;ue(!U),B=U==="free"}function K(U){if(V=!1,!g){var Z=Se(U);he(U.target)&&(Z||!U.button)&&(C.isBusy()?Vt(U,!0):(T=Z?v:window,x=l.is([Nn,ni]),I=null,s(T,to,oe,wn),s(T,no,F,wn),p.cancel(),u.cancel(),D(U)))}}function oe(U){if(l.is(Ci)||(l.set(Ci),r(Ca)),U.cancelable)if(x){p.translate(b+ve(k(U)));var Z=G(U)>br,ae=E!==(E=S());(Z||ae)&&D(U),V=!0,r(wa),Vt(U)}else _(U)&&(x=N(U),Vt(U))}function F(U){l.is(Ci)&&(l.set(Rn),r($a)),x&&(O(U),Vt(U)),d(T,to,oe),d(T,no,F),x=!1}function R(U){!g&&V&&Vt(U,!0)}function D(U){I=H,H=U,b=$()}function O(U){var Z=q(U),ae=ie(Z),pe=n.rewind&&n.rewindByDrag;y(!1),B?C.scroll(ae,0,n.snap):e.is(ci)?C.go(w(xo(Z))<0?pe?"<":"-":pe?">":"+"):e.is(Pn)&&E&&pe?C.go(S(!0)?">":"<"):C.go(C.toDest(ae),!0),y(!0)}function N(U){var Z=n.dragMinThreshold,ae=Vn(Z),pe=ae&&Z.mouse||0,ye=(ae?Z.touch:+Z)||10;return Ct(k(U))>(Se(U)?ye:pe)}function _(U){return Ct(k(U))>Ct(k(U,!0))}function q(U){if(e.is(On)||!E){var Z=G(U);if(Z&&Z<br)return k(U)/Z}return 0}function ie(U){return $()+xo(U)*on(Ct(U)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function k(U,Z){return ee(U,Z)-ee(f(U),Z)}function G(U){return bo(U)-bo(f(U))}function f(U){return H===U&&I||H}function ee(U,Z){return(Se(U)?U.changedTouches[0]:U)["page"+h(Z?"Y":"X")]}function ve(U){return U/(E&&e.is(Pn)?Cl:1)}function he(U){var Z=n.noDrag;return!Kn(U,"."+Oa+", ."+Ui)&&(!Z||!Kn(U,Z))}function Se(U){return typeof TouchEvent<"u"&&U instanceof TouchEvent}function re(){return x}function ue(U){g=U}return{mount:P,disable:ue,isDragging:re}}var Vl={Spacebar:" ",Right:zi,Left:ji,Up:Pa,Down:Ma};function Go(e){return e=nn(e)?e:e.key,Vl[e]||e}var xr="keydown";function Kl(e,t,n){var i=et(e),o=i.on,r=i.bind,s=i.unbind,d=e.root,l=t.Direction.resolve,p,u;function C(){v(),o(vt,y),o(vt,v),o(Jt,h)}function v(){var $=n.keyboard;$&&(p=$==="global"?window:d,r(p,xr,w))}function y(){s(p,xr)}function m($){u=$}function h(){var $=u;u=!0,ca(function(){u=$})}function w($){if(!u){var S=Go($);S===l(ji)?e.go("<"):S===l(zi)&&e.go(">")}}return{mount:C,destroy:y,disable:m}}var jn=Wo+"-lazy",Ti=jn+"-srcset",Ul="["+jn+"], ["+Ti+"]";function Gl(e,t,n){var i=et(e),o=i.on,r=i.off,s=i.bind,d=i.emit,l=n.lazyLoad==="sequential",p=[Hn,yn],u=[];function C(){n.lazyLoad&&(v(),o(ct,v))}function v(){Yt(u),y(),l?$():(r(p),o(p,m),m())}function y(){t.Slides.forEach(function(S){ko(S.slide,Ul).forEach(function(b){var H=kt(b,jn),I=kt(b,Ti);if(H!==b.src||I!==b.srcset){var B=n.classes.spinner,x=b.parentElement,E=ai(x,"."+B)||Ln("span",B,x);u.push([b,S,E]),b.src||qn(b,"none")}})})}function m(){u=u.filter(function(S){var b=n.perPage*((n.preloadPages||1)+1)-1;return S[1].isWithin(e.index,b)?h(S):!0}),u.length||r(p)}function h(S){var b=S[0];Ot(S[1].slide,$o),s(b,"load error",Ze(w,S)),ke(b,"src",kt(b,jn)),ke(b,"srcset",kt(b,Ti)),Bt(b,jn),Bt(b,Ti)}function w(S,b){var H=S[0],I=S[1];Ut(I.slide,$o),b.type!=="error"&&(hn(S[2]),qn(H,""),d(jo,H,I),d(An)),l&&$()}function $(){u.length&&h(u.shift())}return{mount:C,destroy:Ze(Yt,u),check:m}}function ql(e,t,n){var i=et(e),o=i.on,r=i.emit,s=i.bind,d=t.Slides,l=t.Elements,p=t.Controller,u=p.hasFocus,C=p.getIndex,v=p.go,y=t.Direction.resolve,m=l.pagination,h=[],w,$;function S(){b(),o([vt,ct,ki],S);var g=n.pagination;m&&qn(m,g?"":"none"),g&&(o([Jt,Oi,yn],V),H(),V(),r(Ia,{list:w,items:h},E(e.index)))}function b(){w&&(hn(m?an(w.children):w),Ut(w,$),Yt(h),w=null),i.destroy()}function H(){var g=e.length,T=n.classes,P=n.i18n,W=n.perPage,K=u()?p.getEnd()+1:Xn(g/W);w=m||Ln("ul",T.pagination,l.track.parentElement),Ot(w,$=Gi+"--"+x()),ke(w,Gt,"tablist"),ke(w,It,P.select),ke(w,Vo,x()===Vi?"vertical":"");for(var oe=0;oe<K;oe++){var F=Ln("li",null,w),R=Ln("button",{class:T.page,type:"button"},F),D=d.getIn(oe).map(function(N){return N.slide.id}),O=!u()&&W>1?P.pageX:P.slideX;s(R,"click",Ze(I,oe)),n.paginationKeyboard&&s(R,"keydown",Ze(B,oe)),ke(F,Gt,"presentation"),ke(R,Gt,"tab"),ke(R,li,D.join(" ")),ke(R,It,So(O,oe+1)),ke(R,In,-1),h.push({li:F,button:R,page:oe})}}function I(g){v(">"+g,!0)}function B(g,T){var P=h.length,W=Go(T),K=x(),oe=-1;W===y(zi,!1,K)?oe=++g%P:W===y(ji,!1,K)?oe=(--g+P)%P:W==="Home"?oe=0:W==="End"&&(oe=P-1);var F=h[oe];F&&(ma(F.button),v(">"+oe),Vt(T,!0))}function x(){return n.paginationDirection||n.direction}function E(g){return h[p.toPage(g)]}function V(){var g=E(C(!0)),T=E(C());if(g){var P=g.button;Ut(P,fn),Bt(P,gr),ke(P,In,-1)}if(T){var W=T.button;Ot(W,fn),ke(W,gr,!0),ke(W,In,"")}r(Ea,{list:w,items:h},g,T)}return{items:h,mount:S,destroy:b,getAt:E,update:V}}var Xl=[" ","Enter"];function Yl(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function s(){e.splides.forEach(function(m){m.isParent||(p(e,m.splide),p(m.splide,e))}),i&&u()}function d(){r.forEach(function(m){m.destroy()}),Yt(r)}function l(){d(),s()}function p(m,h){var w=et(m);w.on(Jt,function($,S,b){h.go(h.is(On)?b:$)}),r.push(w)}function u(){var m=et(e),h=m.on;h(No,v),h(Ra,y),h([sn,vt],C),r.push(m),m.emit(Oo,e.splides)}function C(){ke(t.Elements.list,Vo,n.direction===Vi?"vertical":"")}function v(m){e.go(m.index)}function y(m,h){Po(Xl,Go(h))&&(v(m),Vt(h))}return{setup:Ze(t.Media.set,{slideFocus:ii(o)?i:o},!0),mount:s,destroy:d,remount:l}}function Jl(e,t,n){var i=et(e),o=i.bind,r=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,wn)}function d(p){if(p.cancelable){var u=p.deltaY,C=u<0,v=bo(p),y=n.wheelMinThreshold||0,m=n.wheelSleep||0;Ct(u)>y&&v-r>m&&(e.go(C?"<":">"),r=v),l(C)&&Vt(p)}}function l(p){return!n.releaseWheel||e.state.is(Nn)||t.Controller.getAdjacent(p)!==-1}return{mount:s}}var Zl=90;function Ql(e,t,n){var i=et(e),o=i.on,r=t.Elements.track,s=n.live&&!n.isNavigation,d=Ln("span",yl),l=Bi(Zl,Ze(u,!1));function p(){s&&(v(!t.Autoplay.isPaused()),ke(r,yr,!0),d.textContent="…",o(Bo,Ze(v,!0)),o(Do,Ze(v,!1)),o([Hn,yn],Ze(u,!0)))}function u(y){ke(r,fr,y),y?(ri(r,d),l.start()):(hn(d),l.cancel())}function C(){Bt(r,[hr,yr,fr]),hn(d)}function v(y){s&&ke(r,hr,y?"off":"polite")}return{mount:p,disable:v,destroy:C}}var ec=Object.freeze({__proto__:null,Media:ll,Direction:cl,Elements:wl,Slides:Tl,Layout:Ll,Clones:El,Move:_l,Controller:Rl,Arrows:Ml,Autoplay:Wl,Cover:Fl,Scroll:jl,Drag:zl,Keyboard:Kl,LazyLoad:Gl,Pagination:ql,Sync:Yl,Wheel:Jl,Live:Ql}),tc={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"},nc={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:xl,i18n:tc,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ic(e,t,n){var i=t.Slides;function o(){et(e).on([sn,ct],r)}function r(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function s(d,l){i.style("transition","opacity "+n.speed+"ms "+n.easing),ca(l)}return{mount:o,start:s,cancel:vo}}function oc(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,s=t.Elements.list,d=Ze(Mt,s,"transition"),l;function p(){et(e).bind(s,"transitionend",function(y){y.target===s&&l&&(C(),l())})}function u(y,m){var h=i.toPosition(y,!0),w=i.getPosition(),$=v(y);Ct(h-w)>=1&&$>=1?n.useScroll?r.scroll(h,$,!1,m):(d("transform "+$+"ms "+n.easing),i.translate(h,!0),l=m):(i.jump(y),m())}function C(){d(""),r.cancel()}function v(y){var m=n.rewindSpeed;if(e.is(Pn)&&m){var h=o.getIndex(!0),w=o.getEnd();if(h===0&&y>=w||h>=w&&y===0)return m}return n.speed}return{mount:p,start:u,cancel:C}}var rc=(function(){function e(n,i){this.event=et(),this.Components={},this.state=al(Tn),this.splides=[],this._o={},this._E={};var o=nn(n)?ha(document,n):n;Dn(o,o+" is invalid."),this.root=o,i=tn({label:kt(o,It)||"",labelledby:kt(o,zo)||""},nc,e.defaults,i||{});try{tn(i,JSON.parse(kt(o,Wo)))}catch{Dn(!1,"Invalid JSON")}this._o=Object.create(tn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,s=this.state,d=this.Components;Dn(s.is([Tn,Ai]),"Already mounted!"),s.set(Tn),this._C=d,this._T=o||this._T||(this.is(ci)?ic:oc),this._E=i||this._E;var l=Gn({},ec,this._E,{Transition:this._T});return gn(l,function(p,u){var C=p(r,d,r._o);d[u]=C,C.setup&&C.setup()}),gn(d,function(p){p.mount&&p.mount()}),this.emit(sn),Ot(this.root,vl),s.set(Rn),this.emit(Co),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Rn)&&(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(ct),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(Tn)?et(this).on(Co,this.destroy.bind(this,i)):(gn(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(Ho),o.destroy(),i&&Yt(this.splides),r.set(Ai)),this},tl(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=rc;qo.defaults={};qo.STATES=il;var Sr=[[sn,"onMounted"],[Co,"onReady"],[Jt,"onMove"],[Hn,"onMoved"],[No,"onClick"],[va,"onActive"],[ba,"onInactive"],[xa,"onVisible"],[Sa,"onHidden"],[ct,"onRefresh"],[vt,"onUpdated"],[An,"onResize"],[Hi,"onResized"],[Ca,"onDrag"],[wa,"onDragging"],[$a,"onDragged"],[Oi,"onScroll"],[yn,"onScrolled"],[Ho,"onDestroy"],[Ta,"onArrowsMounted"],[La,"onArrowsUpdated"],[Ia,"onPaginationMounted"],[Ea,"onPaginationUpdated"],[Oo,"onNavigationMounted"],[Bo,"onAutoplayPlay"],[_a,"onAutoplayPlaying"],[Do,"onAutoplayPause"],[jo,"onLazyLoadLoaded"]];function Xo(...e){return e.filter(Boolean).join(" ")}function Wi(e){return e!==null&&typeof e=="object"}function To(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!To(n,t[i]));if(Wi(e)&&Wi(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!To(e[o],t[o]))}return e===t}function ac(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function sc(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 Lo(e,t){const n=e;return sc(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Wi(i)?n[o]=Lo(Wi(n[o])?n[o]:{},i):n[o]=i}),n}var lc=({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=Lo({},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&&!To(this.options,e)&&(this.splide.options=e,this.options=Lo({},e));const t=this.getSlides();ac(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(r=>r[1])])},n?c.createElement(lc,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 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 Ft(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:I.scalingValue(e.letterSpacing,t),wordSpacing:I.scalingValue(e.wordSpacing,t),fontSize:I.scalingValue(n,t),lineHeight:i!==void 0?I.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,'\\"')}")`,Nt=({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:je(Cr.img,i),style:o}):r.jsx("span",{"data-supports-mask":a,className:je(Cr.svg,i),style:{"--svg":hc(e),"--fill":t,"--hover-fill":n,...o??{}}})},fc={"top-left":be.topLeftAlignment,"top-center":be.topCenterAlignment,"top-right":be.topRightAlignment,"middle-left":be.middleLeftAlignment,"middle-center":be.middleCenterAlignment,"middle-right":be.middleRightAlignment,"bottom-left":be.bottomLeftAlignment,"bottom-center":be.bottomCenterAlignment,"bottom-right":be.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:$,textAppearance:b,color:y}=n.imageCaption??{},[m,h]=c.useState(void 0),[T,L]=c.useState(null),[x,S]=c.useState(0),[O,R]=c.useState(0),{direction:B,transition:w,controls:P,pagination:j,imageCaption:g,triggers:C}=e,A=c.useRef(w.type),{x:H,y:V}=e.controls.offset,Q=k=>{o&&o.go(k)};return c.useEffect(()=>{if(!T)return;const k=new ResizeObserver(_=>{if(!o)return;const[E]=_;h({width:Math.round(E.contentRect.width),height:Math.round(E.contentRect.height)})});return k.observe(T),()=>k.unobserve(T)},[T]),c.useEffect(()=>{!o||A.current===w.type||(R(k=>k+1),A.current=w.type)},[w.type]),r.jsx("div",{className:je(be.wrapper,{[be.editor]:i}),ref:L,children:r.jsxs("div",{className:be.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:w.backgroundColor&&w.type==="fade in"?w.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:je(be.captionBlock),children:r.jsx("div",{className:be.captionTextWrapper,children:t.map((k,_)=>r.jsx("div",{className:je(be.captionText,fc[g.alignment],{[be.withPointerEvents]:_===x&&i,[be.active]:_===x}),style:{fontFamily:Ui(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":I.scalingValue(l.width,i),letterSpacing:I.scalingValue(s,i),wordSpacing:I.scalingValue(u,i),textAlign:p,fontSize:I.scalingValue($.fontSize,i),lineHeight:I.scalingValue($.lineHeight,i),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:y,transitionDuration:w.duration?`${Math.round(parseInt(w.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:be.captionTextInner,style:{"--link-hover-color":g.linkHoverColor,"--link-color":g.linkColor,position:"relative",top:I.scalingValue(g.offset.y,i),left:I.scalingValue(g.offset.x,i)},children:r.jsx(Yn,{content:k.imageCaption})})},_))})}),r.jsx(Yo,{onMove:k=>{S(k.index)},ref:a,options:{arrows:!1,speed:w.duration?parseInt(w.duration):500,autoplay:C.autoPlay!==null,...C.autoPlay!==null&&{interval:parseInt(C.autoPlay)*1e3},direction:B==="horiz"||w.type==="fade in"?"ltr":"ttb",pagination:!1,drag:C.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:w.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((k,_)=>r.jsx(Jo,{children:r.jsx("div",{className:be.sliderItem,children:r.jsx("div",{className:be.imgWrapper,children:r.jsx("img",{className:je(be.sliderImage,{[be.contain]:k.image.objectFit==="contain",[be.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:je(be.arrow,{[be.arrowVertical]:B==="vert",[be.hoverArrow]:P.show==="on hover"}),style:{color:P.color,"--arrow-hover-color":P.hover},children:r.jsxs("button",{onClick:()=>{Q("-1")},className:be.arrowInner,style:{transform:`translate(${I.scalingValue(H,i)}, ${I.scalingValue(V*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[P.arrowsImgUrl&&r.jsx(Nt,{url:P.arrowsImgUrl,fill:P.color,hoverFill:P.hover,className:je(be.arrowImg,be.mirror)}),!P.arrowsImgUrl&&r.jsx(wr,{color:P.color,className:je(be.arrowIcon,be.arrowImg,be.mirror)})]})}),r.jsx("div",{className:je(be.arrow,be.nextArrow,{[be.arrowVertical]:B==="vert",[be.hoverArrow]:P.show==="on hover"}),style:{color:P.color,"--arrow-hover-color":P.hover},children:r.jsxs("button",{className:be.arrowInner,onClick:()=>Q("+1"),style:{transform:`translate(${I.scalingValue(H*(B==="horiz"?-1:1),i)}, ${I.scalingValue(V,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[P.arrowsImgUrl&&r.jsx(Nt,{url:P.arrowsImgUrl,fill:P.color,hoverFill:P.hover,className:be.arrowImg}),!P.arrowsImgUrl&&r.jsx(wr,{color:P.color,className:je(be.arrowIcon,be.arrowImg)})]})})]}),C.triggersList.click&&r.jsx("div",{className:be.clickOverlay,onClick:()=>{o&&o.go("+1")}}),j.isActive&&r.jsx("div",{className:je(be.pagination,{[be.paginationInsideBottom]:j.position==="inside-1"&&B==="horiz",[be.paginationInsideTop]:j.position==="inside-2"&&B==="horiz",[be.paginationOutsideBottom]:j.position==="outside-1"&&B==="horiz",[be.paginationOutsideTop]:j.position==="outside-2"&&B==="horiz",[be.paginationInsideLeft]:j.position==="inside-1"&&B==="vert",[be.paginationInsideRight]:j.position==="inside-2"&&B==="vert",[be.paginationOutsideLeft]:j.position==="outside-1"&&B==="vert",[be.paginationOutsideRight]:j.position==="outside-2"&&B==="vert",[be.paginationVertical]:B==="vert"}),children:r.jsx("div",{className:be.paginationInner,style:{backgroundColor:j.colors[2],transform:`scale(${j.scale/100}) translate(${I.scalingValue(j.offset.x,i)}, ${I.scalingValue(j.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((k,_)=>r.jsx("button",{onClick:()=>{o&&o.go(_)},className:je(be.paginationItem),children:r.jsx("div",{className:je(be.dot,{[be.activeDot]:_===x}),style:{backgroundColor:_===x?j.colors[0]:j.colors[1],"--pagination-hover-color":j.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,$]=c.useState({x:0,y:0}),[b,y]=c.useState(1),[m,h]=c.useState("none"),T=c.useRef({x:0,y:0}),[L,x]=c.useState(!1),{sizeType:S,imageWidth:O,randomRangeImageWidth:R}=e.imageSize,{revealPosition:B,visible:w}=e.position,{cursorType:P,target:j,defaultCursorScale:g,defaultCursor:C,hoverCursorScale:A,hoverCursor:H}=e.cursor;c.useEffect(()=>{if(!i)return;const k=(M,W)=>{const z=i.getBoundingClientRect(),K=M-z.left,ie=W-z.top;if($({x:K,y:ie}),P==="system"){h("none"),y(1);return}const F=K,J=ie,f=document.elementFromPoint(z.left+F,z.top+J);if(f&&f.closest("a")){h("none"),y(1);return}const ne=$r(F,J,a)||j==="area"?{img:H??"none",scale:A}:{img:C??"none",scale:g};h(ne.img),y(ne.scale)},_=M=>{M.stopPropagation(),T.current={x:M.clientX,y:M.clientY},k(M.clientX,M.clientY)},E=()=>{L&&k(T.current.x,T.current.y)};return i.addEventListener("mousemove",_),window.addEventListener("scroll",E,!0),()=>{i.removeEventListener("mousemove",_),window.removeEventListener("scroll",E,!0)}},[i,L,u,P,j,H,C,A,g,a]),c.useEffect(()=>{L||(h("none"),y(0))},[L]);const V=async(k,_,E,M={})=>{const{width:W,height:z,finalWidth:K}=await wc(k.image.url,S,O,R);let ie=0,F=0;B==="same"?(ie=_/2,F=E/2):(ie=M.x??Math.random()*_,F=M.y??Math.random()*E);const J=Math.min(Math.max(ie,W/2),_-W/2),f=Math.min(Math.max(F,z/2),E-z/2);return{id:p.current++,url:k.image.url,link:k.link,name:k.image.name,x:J,y:f,width:K}};c.useEffect(()=>{if(!i||t.length===0)return;const k=i.getBoundingClientRect(),_=k.width,E=k.height,M=[];(async()=>{const z=t[0],K=await V(z,_,E);M.push(K),l(M),s(1)})()},[S,O,R,B,i]),c.useEffect(()=>{w==="last One"&&l(k=>k.length>0?[k[k.length-1]]:[])},[w]);const Q=async k=>{if(!i)return;const _=i.getBoundingClientRect(),E=k.clientX-_.left,M=k.clientY-_.top;if(j==="image"&&!$r(E,M,a))return;let W=0,z=0;B==="on Click"?(W=E,z=M):B==="same"?(W=_.width/2,z=_.height/2):(W=Math.random()*_.width,z=Math.random()*_.height);const K=t[d],ie=await V(K,_.width,_.height,{x:W,y:z});l(F=>w==="all"?[...F,ie]:[ie]),s(F=>F>=t.length-1?0:F+1)};return r.jsxs("div",{ref:o,onClick:Q,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!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:j==="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)),L&&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",Ic="LightBox-module__heroImage___sTxNF",Ec="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",ce={hidden:Lc,heroImage:Ic,background:Ec,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% + ${I.scalingValue(t.x,n)}), calc(-50% + ${I.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${I.scalingValue(t.x,n)}, calc(-50% + ${I.scalingValue(t.y,n)}))`:a==="center"?i.transform=`translate(calc(-50% + ${I.scalingValue(t.x,n)}), ${I.scalingValue(t.y,n)})`:i.transform=`translate(${I.scalingValue(t.x,n)}, ${I.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 $=t.left+n.left,b=t.top+n.top,y=(i-p)/2+$,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 Ir(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 ce.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return ce.slideInLeft;case"right":return ce.slideInRight;case"top":return ce.slideInTop;case"bottom":return ce.slideInBottom;default:return ce.slideInRight}return ce.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return ce.fadeIn;if(e==="slide in")switch(t){case"left":return ce.slideInLeft;case"right":return ce.slideInRight;case"top":return ce.slideInTop;case"bottom":return ce.slideInBottom;default:return ce.slideInRight}return ce.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return ce.fadeOut;if(e==="slide in")switch(t){case"left":return ce.slideOutLeft;case"right":return ce.slideOutRight;case"top":return ce.slideOutTop;case"bottom":return ce.slideOutBottom;default:return ce.slideOutRight}return ce.fadeOut})(),a=(()=>{if(e==="fade in")return ce.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return ce.slideOutLeft;case"right":return ce.slideOutRight;case"top":return ce.slideOutTop;case"bottom":return ce.slideOutBottom;default:return ce.slideOutRight}return ce.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass: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:ce.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 Ie;const{widthSettings:s,fontSettings:p,letterSpacing:u,textAlign:$,wordSpacing:b,fontSizeLineHeight:y,textAppearance:m,color:h}=i.imageCaption??{},[T,L]=c.useState(0),[x,S]=c.useState(0),[O,R]=c.useState(!1),[B,w]=c.useState(!1),[P,j]=c.useState({}),g=c.useRef(null),C=c.useRef(null),A=c.useRef(null),H=c.useRef(!1),V=c.useRef(null),Q=c.useRef(null),k=c.useRef(null),_=c.useRef(null),E=c.useRef(!1),M=c.useRef(null),[W,z]=c.useState(!1),{appear:K,triggers:ie,slider:F,thumbnail:J,controls:f,area:ne,caption:xe,layout:pe}=o.lightboxBlock,{appearClass:ve,backdropAppearClass:se,backdropDisappearClass:fe,disappearClass:G}=dd(K.type,K.direction),ee=(d==null?void 0:d.itemId)??null;c.useEffect(()=>{const D=()=>{setTimeout(()=>{var N,X;(X=(N=g.current)==null?void 0:N.splide)==null||X.refresh()},16)},ue=()=>{S(N=>N+1)};return window.addEventListener("ArticleEditor.Layout:change",D),window.addEventListener("ArticleEditor.ComponentContent:change",ue),()=>{window.removeEventListener("ArticleEditor.Layout:change",D),window.removeEventListener("ArticleEditor.ComponentContent:change",ue)}},[]),c.useEffect(()=>{if(!e||!J.isActive){z(!1);return}const D=M.current;if(!D)return;const ue=()=>{F.direction==="horiz"?z(D.scrollWidth>D.clientWidth):z(D.scrollHeight>D.clientHeight)};ue();const N=new ResizeObserver(ue);return N.observe(D),()=>N.disconnect()},[e,J.isActive,n.length,P,F.direction]);const le=c.useCallback(()=>{const D=window.matchMedia("(max-width: 768px)").matches,ue=Ir(ne.color);D&&!l&&ue>.9&&(document.body.style.backgroundColor=""),R(!0),H.current=!0;const N=X=>{X.target===V.current&&X.animationName&&(V.current&&Q.current&&V.current.removeEventListener("animationend",Q.current),Q.current=null,H.current&&(H.current=!1,t()),R(!1))};V.current&&(Q.current=N,V.current.addEventListener("animationend",N))},[t,ne.color,l]),oe=(D,ue,N)=>{var X,U;if(D){if(ie.type==="click"&&ie.switch==="image")ie.repeat==="close"&&T===n.length-1?le():(X=g.current)==null||X.go("+1");else if(ie.type==="click"&&ie.switch==="50/50"){const te=D.getBoundingClientRect(),de=ue-te.left,ye=N-te.top,Ne=te.width,Te=te.height;let Ce;F.direction==="horiz"?Ce=de<Ne/2?"-1":"+1":Ce=ye<Te/2?"-1":"+1",(U=g.current)==null||U.go(Ce)}}},Le=D=>{if(E.current){E.current=!1;return}const ue=n[T],N=(ue==null?void 0:ue.image.objectFit)==="cover";let X,U;if("changedTouches"in D&&D.changedTouches.length>0)X=D.changedTouches[0].clientX,U=D.changedTouches[0].clientY;else if("clientX"in D)X=D.clientX,U=D.clientY;else return;let te;if(N&&A.current){const de=Lr(A.current);te=X>=de.left&&X<=de.right&&U>=de.top&&U<=de.bottom}else{const de=A.current?Tr(A.current):null;if(!de){D.target===D.currentTarget&&le();return}te=X>=de.x&&X<=de.x+de.width&&U>=de.y&&U<=de.y+de.height}te?oe(A.current,X,U):le()},$e=D=>{const ue=D.target;(ue.classList.contains(ce.thumbsWrapper)||ue.classList.contains(ce.thumbsContainer))&&Le(D)};c.useEffect(()=>{if(!e)return;const D=ue=>{var N,X;if(ue.key==="Escape"){le();return}if(ue.key==="ArrowRight"){L(U=>(U+1)%Math.max(n.length,1)),(N=g.current)==null||N.go("+1");return}ue.key==="ArrowLeft"&&(L(U=>(U-1+Math.max(n.length,1))%Math.max(n.length,1)),(X=g.current)==null||X.go("-1"))};return window.addEventListener("keydown",D),()=>{window.removeEventListener("keydown",D)}},[e,le,n.length]),c.useEffect(()=>{if(e){if(L(0),S(ue=>ue+1),H.current=!1,R(!1),w(!1),j({}),!ee)return;const D=new CustomEvent("page-overlay",{detail:{itemId:ee}});window.dispatchEvent(D)}return()=>{V.current&&Q.current&&(V.current.removeEventListener("animationend",Q.current),Q.current=null),w(!1)}},[e,ee]),c.useEffect(()=>{C.current!==null&&C.current!==F.type&&S(D=>D+1),C.current=F.type},[F.type]),c.useEffect(()=>{if(!e)return;const D=document.body.style.overflow,ue=window.matchMedia("(max-width: 768px)").matches,N=Ir(ne.color);document.body.style.overflow="hidden",w(!1);const X=te=>{te.target===V.current&&!H.current&&te.animationName&&(ue&&!l&&N>.9&&(document.body.style.backgroundColor=ne.color),w(!0),V.current&&k.current&&V.current.removeEventListener("animationend",k.current),k.current=null)};V.current&&(k.current=X,V.current.addEventListener("animationend",X));const U=te=>{const de=te.target;de&&(de.closest(`.${ce.thumbsWrapper}`)||de.closest(`.${ce.thumbsContainer}`))||F.type!=="slide"&&te.preventDefault()};return document.addEventListener("touchmove",U,{passive:!1}),()=>{document.body.style.overflow=D,document.removeEventListener("touchmove",U),V.current&&k.current&&(V.current.removeEventListener("animationend",k.current),k.current=null),w(!1)}},[e,l,ne.color,F.type]),c.useEffect(()=>{if(!e)return;const D=ue=>{var X,U;if(H.current){ue.stopPropagation();return}if(E.current){E.current=!1;return}const N=ue.target;if(!(N&&(N.closest(`.${ce.thumbsContainer}`)||N.closest(`.${ce.thumbItem}`)||N.closest(`.${ce.arrow}`)||N.closest(`.${ce.closeButton}`)||N.closest(`.${ce.caption}`)))){if(F.type==="slide"&&ie.type==="drag"&&((U=(X=g.current)==null?void 0:X.splide)!=null&&U.root)){const te=g.current.splide.root;if(N&&(te.contains(N)||te===N))return}if(ue.touches.length===0&&ue.changedTouches.length>0){const te=n[T],de=(te==null?void 0:te.image.objectFit)==="cover",ye=ue.changedTouches[0];let Ne;if(de&&A.current){const Te=Lr(A.current);Ne=ye.clientX>=Te.left&&ye.clientX<=Te.right&&ye.clientY>=Te.top&&ye.clientY<=Te.bottom}else{const Te=A.current?Tr(A.current):null;if(!Te)return;Ne=ye.clientX>=Te.x&&ye.clientX<=Te.x+Te.width&&ye.clientY>=Te.y&&ye.clientY<=Te.y+Te.height}if(!Ne){ue.stopPropagation(),H.current=!0;const Te=Ce=>{Ce.stopPropagation(),Ce.preventDefault(),document.removeEventListener("click",Te,!0)};document.addEventListener("click",Te,!0),le()}}}};return document.addEventListener("touchend",D,{passive:!0}),()=>{document.removeEventListener("touchend",D)}},[e,le,T,n]);const _e=(F.type==="scale"||F.type==="fade")&&F.direction==="vert"&&ie.type==="drag";c.useEffect(()=>{var Ce,Be;if(!e||!_e||!((Be=(Ce=g.current)==null?void 0:Ce.splide)!=null&&Be.root))return;const D=g.current.splide.root,ue=30,N=(re,Pe)=>{if(_.current){const Me=Math.abs(re-_.current.x),ke=Math.abs(Pe-_.current.y);(Me>0||ke>0)&&(E.current=!0)}},X=re=>{_.current&&(re.preventDefault(),N(re.clientX,re.clientY))},U=re=>{_.current&&re.touches.length>0&&(re.preventDefault(),N(re.touches[0].clientX,re.touches[0].clientY))},te=(re,Pe)=>{if(!_.current||!g.current){_.current=null;return}const Me=Math.abs(re-_.current.x),ke=Math.abs(Pe-_.current.y);ke>ue&&ke>Me&&g.current.go(Pe<_.current.y?"+1":"-1"),_.current=null},de=re=>{_.current&&te(re.clientX,re.clientY),document.removeEventListener("pointerup",de),document.removeEventListener("pointercancel",de),document.removeEventListener("pointermove",X)},ye=re=>{if(_.current){if(re.changedTouches.length>0){const Pe=re.changedTouches[0];te(Pe.clientX,Pe.clientY)}document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),document.removeEventListener("touchmove",U)}},Ne=re=>{_.current={x:re.clientX,y:re.clientY},E.current=!1,document.addEventListener("pointermove",X,{passive:!1}),document.addEventListener("pointerup",de),document.addEventListener("pointercancel",de)},Te=re=>{re.touches.length>0&&(_.current={x:re.touches[0].clientX,y:re.touches[0].clientY},E.current=!1,document.addEventListener("touchmove",U,{passive:!1}),document.addEventListener("touchend",ye),document.addEventListener("touchcancel",ye))};return D.addEventListener("pointerdown",Ne),D.addEventListener("touchstart",Te),()=>{D.removeEventListener("pointerdown",Ne),D.removeEventListener("touchstart",Te),document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",de),document.removeEventListener("pointercancel",de),document.removeEventListener("touchmove",U),document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),_.current=null,E.current=!1}},[e,_e,x]);const Se={backgroundColor:ne.color,backdropFilter:`blur(${ne.blur}px)`,animationDuration:`${parseInt(K.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:V,className:je(ce.background,O?fe:se,{[ce.editor]:l},{[ce.hidden]:!e}),style:{...Se,...B&&!l&&!O?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?V:null,className:je(ce.contentStyle,O?G:ve,{[ce.editor]:l},{[ce.hidden]:!e}),style:{animationDuration:`${parseInt(K.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Yo,{onMove:D=>L(D.index),ref:g,className:ce.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"&&!_e,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((D,ue)=>{const N=mi(pe.position,pe.offset,l),X=`${I.scalingValue(pe.padding.top,l)} ${I.scalingValue(pe.padding.right,l)} ${I.scalingValue(pe.padding.bottom,l)} ${I.scalingValue(pe.padding.left,l)}`,U=F.type==="scale"?(()=>{const{transform:te,...de}=N;return{...de,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:ce.imgWrapper,onClick:Le,children:r.jsx("img",{ref:ue===T?A:null,className:je(ce.imageStyle,{[ce.contain]:D.image.objectFit==="contain",[ce.cover]:D.image.objectFit==="cover",[ce.scaleSlide]:F.type==="scale"}),src:D.image.url,alt:D.image.name??"",style:{...U,pointerEvents:D.image.objectFit==="contain"?"none":"auto"}})})},ue)})},x),f.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:je(ce.arrow,{[ce.arrowVertical]:F.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:ce.arrowInner,style:{transform:`translate(${I.scalingValue(f.offset.x,l)}, ${I.scalingValue(f.offset.y*(F.direction==="horiz"?1:-1),l)}) scale(${f.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var D;return(D=g.current)==null?void 0:D.go("-1")},"aria-label":"Previous",children:[f.arrowsImgUrl&&r.jsx(Nt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:je(ce.arrowImg,ce.mirror)}),!f.arrowsImgUrl&&r.jsx(Er,{color:f.color,className:je(ce.arrowIcon,ce.arrowImg,ce.mirror)})]})}),r.jsx("div",{className:je(ce.arrow,ce.nextArrow,{[ce.arrowVertical]:F.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:r.jsxs("button",{className:ce.arrowInner,style:{transform:`translate(${I.scalingValue(f.offset.x*(F.direction==="horiz"?-1:1),l)}, ${I.scalingValue(f.offset.y,l)}) scale(${f.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var D;return(D=g.current)==null?void 0:D.go("+1")},"aria-label":"Next",children:[f.arrowsImgUrl&&r.jsx(Nt,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:ce.arrowImg}),!f.arrowsImgUrl&&r.jsx(Er,{color:f.color,className:je(ce.arrowIcon,ce.arrowImg)})]})})]}),ne.closeIconUrl&&(()=>{const D=mi(ne.closeIconAlign,ne.closeIconOffset,l),ue=`scale(${ne.closeIconScale})`,N=D.transform?`${D.transform} ${ue}`:ue;return r.jsx("button",{className:ce.closeButton,style:{...D,transform:N},onClick:le,"aria-label":"Close lightbox",children:r.jsx(Nt,{url:ne.closeIconUrl,fill:ne.closeIconColor??"#000000",hoverFill:ne.closeIconHover??"#cccccc"})})})(),xe&&xe.isActive&&i.imageCaption&&((Ie=n[T])==null?void 0:Ie.imageCaption)&&r.jsx("div",{className:ce.caption,style:{...mi(xe.alignment,xe.offset,l),fontFamily:Ui(p.fontFamily),fontWeight:p.fontWeight,fontStyle:p.fontStyle,width:s.sizing==="auto"?"max-content":I.scalingValue(s.width,l),letterSpacing:I.scalingValue(u,l),wordSpacing:I.scalingValue(b,l),textAlign:$,fontSize:I.scalingValue(y.fontSize,l),lineHeight:I.scalingValue(y.lineHeight,l),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:h},onClick:D=>D.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:ce.captionTextInner,style:{"--link-color":xe.linkColor,"--link-hover-color":xe.linkHoverColor},children:r.jsx(Yn,{content:n[T].imageCaption})})}),J.isActive&&(()=>{const[D,ue]=J.position.split("-"),N=F.direction==="horiz"?`${D}-left`:J.position,X=mi(N,J.offset,l),U=()=>{if(F.direction==="horiz"){if(ue==="left")return"flex-start";if(ue==="center")return"center";if(ue==="right")return"flex-end"}else{if(D==="top")return"flex-start";if(D==="middle")return"center";if(D==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:M,className:ce.thumbsWrapper,onClick:te=>$e(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:je(ce.thumbsContainer,{[ce.thumbsContainerVertical]:F.direction==="vert",[ce.thumbsAlignStart]:J.align==="start",[ce.thumbsAlignCenter]:J.align==="center",[ce.thumbsAlignEnd]:J.align==="end"}),style:{gap:I.scalingValue(J.grid.gap,l),justifyContent:W?"flex-start":U()},children:n.map((te,de)=>{const ye=de===T,Ne=P[de],Ce=J.grid.size*(ye?J.activeState.scale:1),Be=()=>{if(J.fit!=="fit")return{};if(!Ne)return F.direction==="horiz"?{height:I.scalingValue(Ce,l)}:{width:I.scalingValue(Ce,l)};const re=Ne.width/Ne.height;if(F.direction==="horiz"){const Pe=Ce,Me=Pe*re;return{width:I.scalingValue(Me,l),height:I.scalingValue(Pe,l)}}else{const Pe=Ce,Me=Pe/re;return{width:I.scalingValue(Pe,l),height:I.scalingValue(Me,l)}}};return r.jsx("button",{className:ce.thumbItem,style:{...F.direction==="horiz"&&J.fit!=="fit"?{height:I.scalingValue(Ce,l)}:{},...F.direction==="vert"&&J.fit!=="fit"?{width:I.scalingValue(Ce,l)}:{},...J.fit==="cover"?{width:I.scalingValue(Ce,l),height:I.scalingValue(Ce,l)}:{},...Be(),transition:ye?"all 0.25s ease-out":"none",opacity:ye?J.activeState.opacity/100:J.opacity/100,"--thumb-hover":J.activeState.opacity/100},onClick:re=>{var Pe;re.stopPropagation(),L(de),(Pe=g.current)==null||Pe.go(de)},onMouseEnter:()=>{var re;J.triggers==="hov"&&((re=g.current)==null||re.go(de))},children:r.jsx("img",{src:te.image.url,alt:te.image.name??"",onLoad:re=>{const Pe=re.currentTarget;Pe.naturalWidth&&Pe.naturalHeight&&j(Me=>({...Me,[de]:{width:Pe.naturalWidth,height:Pe.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}-${de}`)})})})})()]})]}),document.getElementById(a))};function Er({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`
|
|
6
|
+
*/const cc="RichTextRenderer-module__link___BWeZ2",dc={link:cc},uc=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=>uc(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function Nt(e){const{color:t,...n}=e;return n}function ft(e,t){var o,r,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:qi(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:L.scalingValue(e.letterSpacing,t),wordSpacing:L.scalingValue(e.wordSpacing,t),fontSize:L.scalingValue(n,t),lineHeight:i!==void 0?L.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(s=e.textAppearance)==null?void 0:s.fontVariant,textAlign:e.textAlign,color:e.color}}const Jn=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:dc.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:pc(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:t(o)},i)})})};function pc(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 mc="SvgImage-module__svg___q3xE-",gc="SvgImage-module__img___VsTm-",Cr={svg:mc,img:gc},hc=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},fc=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Ht=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[r,s]=c.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return c.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');s(d)}},[]),!hc(e)||!r?a.jsx("img",{src:e,alt:"",className:je(Cr.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:je(Cr.svg,i),style:{"--svg":fc(e),"--fill":t,"--hover-fill":n,...o??{}}})},yc={"top-left":xe.topLeftAlignment,"top-center":xe.topCenterAlignment,"top-right":xe.topRightAlignment,"middle-left":xe.middleLeftAlignment,"middle-center":xe.middleCenterAlignment,"middle-right":xe.middleRightAlignment,"bottom-left":xe.bottomLeftAlignment,"bottom-center":xe.bottomCenterAlignment,"bottom-right":xe.bottomRightAlignment};function vc({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=c.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:l,textAlign:p,wordSpacing:u,fontSizeLineHeight:C,textAppearance:v,color:y}=n.imageCaption??{},[m,h]=c.useState(void 0),[w,$]=c.useState(null),[S,b]=c.useState(0),[H,I]=c.useState(0),{direction:B,transition:x,controls:E,pagination:V,imageCaption:g,triggers:T}=e,P=c.useRef(x.type),{x:W,y:K}=e.controls.offset,oe=F=>{o&&o.go(F)};return c.useEffect(()=>{if(!w)return;const F=new ResizeObserver(R=>{if(!o)return;const[D]=R;h({width:Math.round(D.contentRect.width),height:Math.round(D.contentRect.height)})});return F.observe(w),()=>F.unobserve(w)},[w]),c.useEffect(()=>{!o||P.current===x.type||(I(F=>F+1),P.current=x.type)},[x.type]),a.jsx("div",{className:je(xe.wrapper,{[xe.editor]:i}),ref:$,children:a.jsxs("div",{className:xe.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:x.backgroundColor&&x.type==="fade in"?x.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:je(xe.captionBlock),children:a.jsx("div",{className:xe.captionTextWrapper,children:t.map((F,R)=>a.jsx("div",{className:je(xe.captionText,yc[g.alignment],{[xe.withPointerEvents]:R===S&&i,[xe.active]:R===S}),style:{fontFamily:qi(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":L.scalingValue(s.width,i),letterSpacing:L.scalingValue(l,i),wordSpacing:L.scalingValue(u,i),textAlign:p,fontSize:L.scalingValue(C.fontSize,i),lineHeight:L.scalingValue(C.lineHeight,i),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:y,transitionDuration:x.duration?`${Math.round(parseInt(x.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:xe.captionTextInner,style:{"--link-hover-color":g.linkHoverColor,"--link-color":g.linkColor,position:"relative",top:L.scalingValue(g.offset.y,i),left:L.scalingValue(g.offset.x,i)},children:a.jsx(Jn,{content:F.imageCaption})})},R))})}),a.jsx(Yo,{onMove:F=>{b(F.index)},ref:r,options:{arrows:!1,speed:x.duration?parseInt(x.duration):500,autoplay:T.autoPlay!==null,...T.autoPlay!==null&&{interval:parseInt(T.autoPlay)*1e3},direction:B==="horiz"||x.type==="fade in"?"ltr":"ttb",pagination:!1,drag:T.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:x.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((F,R)=>a.jsx(Jo,{children:a.jsx("div",{className:xe.sliderItem,children:a.jsx("div",{className:xe.imgWrapper,children:a.jsx("img",{className:je(xe.sliderImage,{[xe.contain]:F.image.objectFit==="contain",[xe.cover]:F.image.objectFit==="cover"}),src:F.image.url,alt:F.image.name??""})})})},R))},H),E.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:je(xe.arrow,{[xe.arrowVertical]:B==="vert",[xe.hoverArrow]:E.show==="on hover"}),style:{color:E.color,"--arrow-hover-color":E.hover},children:a.jsxs("button",{onClick:()=>{oe("-1")},className:xe.arrowInner,style:{transform:`translate(${L.scalingValue(W,i)}, ${L.scalingValue(K*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[E.arrowsImgUrl&&a.jsx(Ht,{url:E.arrowsImgUrl,fill:E.color,hoverFill:E.hover,className:je(xe.arrowImg,xe.mirror)}),!E.arrowsImgUrl&&a.jsx(wr,{color:E.color,className:je(xe.arrowIcon,xe.arrowImg,xe.mirror)})]})}),a.jsx("div",{className:je(xe.arrow,xe.nextArrow,{[xe.arrowVertical]:B==="vert",[xe.hoverArrow]:E.show==="on hover"}),style:{color:E.color,"--arrow-hover-color":E.hover},children:a.jsxs("button",{className:xe.arrowInner,onClick:()=>oe("+1"),style:{transform:`translate(${L.scalingValue(W*(B==="horiz"?-1:1),i)}, ${L.scalingValue(K,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[E.arrowsImgUrl&&a.jsx(Ht,{url:E.arrowsImgUrl,fill:E.color,hoverFill:E.hover,className:xe.arrowImg}),!E.arrowsImgUrl&&a.jsx(wr,{color:E.color,className:je(xe.arrowIcon,xe.arrowImg)})]})})]}),T.triggersList.click&&a.jsx("div",{className:xe.clickOverlay,onClick:()=>{o&&o.go("+1")}}),V.isActive&&a.jsx("div",{className:je(xe.pagination,{[xe.paginationInsideBottom]:V.position==="inside-1"&&B==="horiz",[xe.paginationInsideTop]:V.position==="inside-2"&&B==="horiz",[xe.paginationOutsideBottom]:V.position==="outside-1"&&B==="horiz",[xe.paginationOutsideTop]:V.position==="outside-2"&&B==="horiz",[xe.paginationInsideLeft]:V.position==="inside-1"&&B==="vert",[xe.paginationInsideRight]:V.position==="inside-2"&&B==="vert",[xe.paginationOutsideLeft]:V.position==="outside-1"&&B==="vert",[xe.paginationOutsideRight]:V.position==="outside-2"&&B==="vert",[xe.paginationVertical]:B==="vert"}),children:a.jsx("div",{className:xe.paginationInner,style:{backgroundColor:V.colors[2],transform:`scale(${V.scale/100}) translate(${L.scalingValue(V.offset.x,i)}, ${L.scalingValue(V.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((F,R)=>a.jsx("button",{onClick:()=>{o&&o.go(R)},className:je(xe.paginationItem),children:a.jsx("div",{className:je(xe.dot,{[xe.activeDot]:R===S}),style:{backgroundColor:R===S?V.colors[0]:V.colors[1],"--pagination-hover-color":V.hover}})},R))})})]})})}function wr({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.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 bc={element:vc,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"]}},xc="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Sc="ImageRevealSlider-module__image___Qjt-e",Cc="ImageRevealSlider-module__link___N-iLG",wc="ImageRevealSlider-module__cursor___2U03d",Sn={imageRevealSlider:xc,image:Sc,link:Cc,cursor:wc};function $r(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const r=i.width?Number.parseFloat(i.width):o.naturalWidth,s=o.naturalHeight/o.naturalWidth*r,d=r/2,l=s/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-l&&t<=i.y+l)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 $c(e,t,n,i){let o,r;if(t==="custom"){o=n;const s=await io(e);r=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await io(e);r=s.height/s.width*o}else{const s=await io(e);o=s.width,r=s.height}return{width:o,height:r,finalWidth:`${o}px`}}function Tc({settings:e,content:t,isEditor:n}){const[i,o]=c.useState(null),[r,s]=c.useState([]),[d,l]=c.useState(0),p=c.useRef(0),[u,C]=c.useState({x:0,y:0}),[v,y]=c.useState(1),[m,h]=c.useState("none"),w=c.useRef({x:0,y:0}),[$,S]=c.useState(!1),{sizeType:b,imageWidth:H,randomRangeImageWidth:I}=e.imageSize,{revealPosition:B,visible:x}=e.position,{cursorType:E,target:V,defaultCursorScale:g,defaultCursor:T,hoverCursorScale:P,hoverCursor:W}=e.cursor;c.useEffect(()=>{if(!i)return;const F=(O,N)=>{const _=i.getBoundingClientRect(),q=O-_.left,ie=N-_.top;if(C({x:q,y:ie}),E==="system"){h("none"),y(1);return}const k=q,G=ie,f=document.elementFromPoint(_.left+k,_.top+G);if(f&&f.closest("a")){h("none"),y(1);return}const ee=$r(k,G,r)||V==="area"?{img:W??"none",scale:P}:{img:T??"none",scale:g};h(ee.img),y(ee.scale)},R=O=>{O.stopPropagation(),w.current={x:O.clientX,y:O.clientY},F(O.clientX,O.clientY)},D=()=>{$&&F(w.current.x,w.current.y)};return i.addEventListener("mousemove",R),window.addEventListener("scroll",D,!0),()=>{i.removeEventListener("mousemove",R),window.removeEventListener("scroll",D,!0)}},[i,$,u,E,V,W,T,P,g,r]),c.useEffect(()=>{$||(h("none"),y(0))},[$]);const K=async(F,R,D,O={})=>{const{width:N,height:_,finalWidth:q}=await $c(F.image.url,b,H,I);let ie=0,k=0;B==="same"?(ie=R/2,k=D/2):(ie=O.x??Math.random()*R,k=O.y??Math.random()*D);const G=Math.min(Math.max(ie,N/2),R-N/2),f=Math.min(Math.max(k,_/2),D-_/2);return{id:p.current++,url:F.image.url,link:F.link,name:F.image.name,x:G,y:f,width:q}};c.useEffect(()=>{if(!i||t.length===0)return;const F=i.getBoundingClientRect(),R=F.width,D=F.height,O=[];(async()=>{const _=t[0],q=await K(_,R,D);O.push(q),s(O),l(1)})()},[b,H,I,B,i]),c.useEffect(()=>{x==="last One"&&s(F=>F.length>0?[F[F.length-1]]:[])},[x]);const oe=async F=>{if(!i)return;const R=i.getBoundingClientRect(),D=F.clientX-R.left,O=F.clientY-R.top;if(V==="image"&&!$r(D,O,r))return;let N=0,_=0;B==="on Click"?(N=D,_=O):B==="same"?(N=R.width/2,_=R.height/2):(N=Math.random()*R.width,_=Math.random()*R.height);const q=t[d],ie=await K(q,R.width,R.height,{x:N,y:_});s(k=>x==="all"?[...k,ie]:[ie]),l(k=>k>=t.length-1?0:k+1)};return a.jsxs("div",{ref:o,onClick:oe,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),className:Sn.imageRevealSlider,style:{cursor:m==="none"?"default":"none"},children:[r.map(F=>a.jsx("div",{className:Sn.wrapper,style:{top:`${F.y}px`,left:`${F.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:F.width??"auto",height:"auto",cursor:m==="none"?"default":"none"},children:V==="area"&&F.link?a.jsx("a",{href:F.link,target:"_blank",className:Sn.link,children:a.jsx("img",{src:F.url,alt:F.name,className:Sn.image},F.id)}):a.jsx("img",{src:F.url,alt:F.name,className:Sn.image},F.id)},F.id)),$&&a.jsx("div",{className:Sn.cursor,style:{left:`${u.x}px`,top:`${u.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Lc={element:Tc,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:""}]}}}},Ic="LightBox-module__hidden___9s-9x",Ec="LightBox-module__heroImage___sTxNF",_c="LightBox-module__background___rm9ml",Rc="LightBox-module__editor___4ACaY",Ac="LightBox-module__contentStyle___Bgnsq",Pc="LightBox-module__imageStyle___tLIlB",Mc="LightBox-module__imgWrapper___LuFUp",kc="LightBox-module__contain___8-yaS",Wc="LightBox-module__cover___hNvOG",Fc="LightBox-module__caption___b6L2I",Nc="LightBox-module__captionTextInner___rCGNH",Hc="LightBox-module__lightboxSplide___XFuWC",Oc="LightBox-module__arrow___iz38X",Bc="LightBox-module__arrowVertical___Zfz81",Dc="LightBox-module__nextArrow___zkAQN",jc="LightBox-module__arrowInner___p48sW",zc="LightBox-module__arrowIcon___3VaFf",Vc="LightBox-module__arrowImg___pNV88",Kc="LightBox-module__mirror___pjeXc",Uc="LightBox-module__thumbsWrapper___GB-nU",Gc="LightBox-module__thumbsContainerVertical___wttk5",qc="LightBox-module__thumbsContainer___osSma",Xc="LightBox-module__thumbsAlignStart___MO6tY",Yc="LightBox-module__thumbsAlignCenter___Q4sUx",Jc="LightBox-module__thumbsAlignEnd___p4y9R",Zc="LightBox-module__thumbItem___HvnF3",Qc="LightBox-module__closeButton___g2khP",ed="LightBox-module__fadeIn___0m5GW",td="LightBox-module__slideInLeft___gPYwC",nd="LightBox-module__slideInRight___S-pPp",id="LightBox-module__slideInTop___DFdAj",od="LightBox-module__slideInBottom___m27kZ",rd="LightBox-module__fadeOut___55qBR",ad="LightBox-module__slideOutLeft___NvU7P",sd="LightBox-module__slideOutRight___SK7eC",ld="LightBox-module__slideOutTop___Vgg0z",cd="LightBox-module__slideOutBottom___nJ0Ef",dd="LightBox-module__scaleSlide___vZriG",ce={hidden:Ic,heroImage:Ec,background:_c,editor:Rc,contentStyle:Ac,imageStyle:Pc,imgWrapper:Mc,contain:kc,cover:Wc,caption:Fc,captionTextInner:Nc,lightboxSplide:Hc,arrow:Oc,arrowVertical:Bc,nextArrow:Dc,arrowInner:jc,arrowIcon:zc,arrowImg:Vc,mirror:Kc,thumbsWrapper:Uc,thumbsContainerVertical:Gc,thumbsContainer:qc,thumbsAlignStart:Xc,thumbsAlignCenter:Yc,thumbsAlignEnd:Jc,thumbItem:Zc,closeButton:Qc,fadeIn:ed,slideInLeft:td,slideInRight:nd,slideInTop:id,slideInBottom:od,fadeOut:rd,slideOutLeft:ad,slideOutRight:sd,slideOutTop:ld,slideOutBottom:cd,scaleSlide:dd},gi=(e,t,n)=>{const i={},[o,r]=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"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${L.scalingValue(t.x,n)}), calc(-50% + ${L.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${L.scalingValue(t.x,n)}, calc(-50% + ${L.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${L.scalingValue(t.x,n)}), ${L.scalingValue(t.y,n)})`:i.transform=`translate(${L.scalingValue(t.x,n)}, ${L.scalingValue(t.y,n)})`,i};function Ka(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=Ka(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),r=e.naturalWidth,s=e.naturalHeight,d=i/o,l=r/s;let p,u;l>d?(p=i,u=i/l):(u=o,p=o*l);const C=t.left+n.left,v=t.top+n.top,y=(i-p)/2+C,m=(o-u)/2+v;return{x:y,y:m,width:p,height:u}}function Lr(e){const t=e.getBoundingClientRect(),n=Ka(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ir(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 ud(e,t){const n=(()=>{if(e==="fade in")return ce.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return ce.slideInLeft;case"right":return ce.slideInRight;case"top":return ce.slideInTop;case"bottom":return ce.slideInBottom;default:return ce.slideInRight}return ce.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return ce.fadeIn;if(e==="slide in")switch(t){case"left":return ce.slideInLeft;case"right":return ce.slideInRight;case"top":return ce.slideInTop;case"bottom":return ce.slideInBottom;default:return ce.slideInRight}return ce.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return ce.fadeOut;if(e==="slide in")switch(t){case"left":return ce.slideOutLeft;case"right":return ce.slideOutRight;case"top":return ce.slideOutTop;case"bottom":return ce.slideOutBottom;default:return ce.slideOutRight}return ce.fadeOut})(),r=(()=>{if(e==="fade in")return ce.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return ce.slideOutLeft;case"right":return ce.slideOutRight;case"top":return ce.slideOutTop;case"bottom":return ce.slideOutBottom;default:return ce.slideOutRight}return ce.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const pd=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:s})=>{const[d,l]=c.useState(!1),{url:p}=e.thumbnailBlock.cover;return c.useEffect(()=>{o==="close"&&l(!1),o==="open"&&l(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:p,alt:"Cover",className:ce.heroImage,onClick:()=>l(!0)}),a.jsx(md,{isOpen:d,onClose:()=>l(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},md=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:s,metadata:d})=>{var Ie;const{widthSettings:l,fontSettings:p,letterSpacing:u,textAlign:C,wordSpacing:v,fontSizeLineHeight:y,textAppearance:m,color:h}=i.imageCaption??{},[w,$]=c.useState(0),[S,b]=c.useState(0),[H,I]=c.useState(!1),[B,x]=c.useState(!1),[E,V]=c.useState({}),g=c.useRef(null),T=c.useRef(null),P=c.useRef(null),W=c.useRef(!1),K=c.useRef(null),oe=c.useRef(null),F=c.useRef(null),R=c.useRef(null),D=c.useRef(!1),O=c.useRef(null),[N,_]=c.useState(!1),{appear:q,triggers:ie,slider:k,thumbnail:G,controls:f,area:ee,caption:ve,layout:he}=o.lightboxBlock,{appearClass:Se,backdropAppearClass:re,backdropDisappearClass:ue,disappearClass:U}=ud(q.type,q.direction),Z=(d==null?void 0:d.itemId)??null;c.useEffect(()=>{const z=()=>{setTimeout(()=>{var M,X;(X=(M=g.current)==null?void 0:M.splide)==null||X.refresh()},16)},le=()=>{b(M=>M+1)};return window.addEventListener("ArticleEditor.Layout:change",z),window.addEventListener("ArticleEditor.ComponentContent:change",le),()=>{window.removeEventListener("ArticleEditor.Layout:change",z),window.removeEventListener("ArticleEditor.ComponentContent:change",le)}},[]),c.useEffect(()=>{if(!e||!G.isActive){_(!1);return}const z=O.current;if(!z)return;const le=()=>{k.direction==="horiz"?_(z.scrollWidth>z.clientWidth):_(z.scrollHeight>z.clientHeight)};le();const M=new ResizeObserver(le);return M.observe(z),()=>M.disconnect()},[e,G.isActive,n.length,E,k.direction]);const ae=c.useCallback(()=>{const z=window.matchMedia("(max-width: 768px)").matches,le=Ir(ee.color);z&&!s&&le>.9&&(document.body.style.backgroundColor=""),I(!0),W.current=!0;const M=X=>{X.target===K.current&&X.animationName&&(K.current&&oe.current&&K.current.removeEventListener("animationend",oe.current),oe.current=null,W.current&&(W.current=!1,t()),I(!1))};K.current&&(oe.current=M,K.current.addEventListener("animationend",M))},[t,ee.color,s]),pe=(z,le,M)=>{var X,Y;if(z){if(ie.type==="click"&&ie.switch==="image")ie.repeat==="close"&&w===n.length-1?ae():(X=g.current)==null||X.go("+1");else if(ie.type==="click"&&ie.switch==="50/50"){const ne=z.getBoundingClientRect(),me=le-ne.left,we=M-ne.top,Oe=ne.width,$e=ne.height;let be;k.direction==="horiz"?be=me<Oe/2?"-1":"+1":be=we<$e/2?"-1":"+1",(Y=g.current)==null||Y.go(be)}}},ye=z=>{if(D.current){D.current=!1;return}const le=n[w],M=(le==null?void 0:le.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 ne;if(M&&P.current){const me=Lr(P.current);ne=X>=me.left&&X<=me.right&&Y>=me.top&&Y<=me.bottom}else{const me=P.current?Tr(P.current):null;if(!me){z.target===z.currentTarget&&ae();return}ne=X>=me.x&&X<=me.x+me.width&&Y>=me.y&&Y<=me.y+me.height}ne?pe(P.current,X,Y):ae()},We=z=>{const le=z.target;(le.classList.contains(ce.thumbsWrapper)||le.classList.contains(ce.thumbsContainer))&&ye(z)};c.useEffect(()=>{if(!e)return;const z=le=>{var M,X;if(le.key==="Escape"){ae();return}if(le.key==="ArrowRight"){$(Y=>(Y+1)%Math.max(n.length,1)),(M=g.current)==null||M.go("+1");return}le.key==="ArrowLeft"&&($(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($(0),b(le=>le+1),W.current=!1,I(!1),x(!1),V({}),!Z)return;const z=new CustomEvent("page-overlay",{detail:{itemId:Z}});window.dispatchEvent(z)}return()=>{K.current&&oe.current&&(K.current.removeEventListener("animationend",oe.current),oe.current=null),x(!1)}},[e,Z]),c.useEffect(()=>{T.current!==null&&T.current!==k.type&&b(z=>z+1),T.current=k.type},[k.type]),c.useEffect(()=>{if(!e)return;const z=document.body.style.overflow,le=window.matchMedia("(max-width: 768px)").matches,M=Ir(ee.color);document.body.style.overflow="hidden",x(!1);const X=ne=>{ne.target===K.current&&!W.current&&ne.animationName&&(le&&!s&&M>.9&&(document.body.style.backgroundColor=ee.color),x(!0),K.current&&F.current&&K.current.removeEventListener("animationend",F.current),F.current=null)};K.current&&(F.current=X,K.current.addEventListener("animationend",X));const Y=ne=>{const me=ne.target;me&&(me.closest(`.${ce.thumbsWrapper}`)||me.closest(`.${ce.thumbsContainer}`))||k.type!=="slide"&&ne.preventDefault()};return document.addEventListener("touchmove",Y,{passive:!1}),()=>{document.body.style.overflow=z,document.removeEventListener("touchmove",Y),K.current&&F.current&&(K.current.removeEventListener("animationend",F.current),F.current=null),x(!1)}},[e,s,ee.color,k.type]),c.useEffect(()=>{if(!e)return;const z=le=>{var X,Y;if(W.current){le.stopPropagation();return}if(D.current){D.current=!1;return}const M=le.target;if(!(M&&(M.closest(`.${ce.thumbsContainer}`)||M.closest(`.${ce.thumbItem}`)||M.closest(`.${ce.arrow}`)||M.closest(`.${ce.closeButton}`)||M.closest(`.${ce.caption}`)))){if(k.type==="slide"&&ie.type==="drag"&&((Y=(X=g.current)==null?void 0:X.splide)!=null&&Y.root)){const ne=g.current.splide.root;if(M&&(ne.contains(M)||ne===M))return}if(le.touches.length===0&&le.changedTouches.length>0){const ne=n[w],me=(ne==null?void 0:ne.image.objectFit)==="cover",we=le.changedTouches[0];let Oe;if(me&&P.current){const $e=Lr(P.current);Oe=we.clientX>=$e.left&&we.clientX<=$e.right&&we.clientY>=$e.top&&we.clientY<=$e.bottom}else{const $e=P.current?Tr(P.current):null;if(!$e)return;Oe=we.clientX>=$e.x&&we.clientX<=$e.x+$e.width&&we.clientY>=$e.y&&we.clientY<=$e.y+$e.height}if(!Oe){le.stopPropagation(),W.current=!0;const $e=be=>{be.stopPropagation(),be.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,w,n]);const Ce=(k.type==="scale"||k.type==="fade")&&k.direction==="vert"&&ie.type==="drag";c.useEffect(()=>{var be,He;if(!e||!Ce||!((He=(be=g.current)==null?void 0:be.splide)!=null&&He.root))return;const z=g.current.splide.root,le=30,M=(ge,Le)=>{if(R.current){const Ne=Math.abs(ge-R.current.x),Me=Math.abs(Le-R.current.y);(Ne>0||Me>0)&&(D.current=!0)}},X=ge=>{R.current&&(ge.preventDefault(),M(ge.clientX,ge.clientY))},Y=ge=>{R.current&&ge.touches.length>0&&(ge.preventDefault(),M(ge.touches[0].clientX,ge.touches[0].clientY))},ne=(ge,Le)=>{if(!R.current||!g.current){R.current=null;return}const Ne=Math.abs(ge-R.current.x),Me=Math.abs(Le-R.current.y);Me>le&&Me>Ne&&g.current.go(Le<R.current.y?"+1":"-1"),R.current=null},me=ge=>{R.current&&ne(ge.clientX,ge.clientY),document.removeEventListener("pointerup",me),document.removeEventListener("pointercancel",me),document.removeEventListener("pointermove",X)},we=ge=>{if(R.current){if(ge.changedTouches.length>0){const Le=ge.changedTouches[0];ne(Le.clientX,Le.clientY)}document.removeEventListener("touchend",we),document.removeEventListener("touchcancel",we),document.removeEventListener("touchmove",Y)}},Oe=ge=>{R.current={x:ge.clientX,y:ge.clientY},D.current=!1,document.addEventListener("pointermove",X,{passive:!1}),document.addEventListener("pointerup",me),document.addEventListener("pointercancel",me)},$e=ge=>{ge.touches.length>0&&(R.current={x:ge.touches[0].clientX,y:ge.touches[0].clientY},D.current=!1,document.addEventListener("touchmove",Y,{passive:!1}),document.addEventListener("touchend",we),document.addEventListener("touchcancel",we))};return z.addEventListener("pointerdown",Oe),z.addEventListener("touchstart",$e),()=>{z.removeEventListener("pointerdown",Oe),z.removeEventListener("touchstart",$e),document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",me),document.removeEventListener("pointercancel",me),document.removeEventListener("touchmove",Y),document.removeEventListener("touchend",we),document.removeEventListener("touchcancel",we),R.current=null,D.current=!1}},[e,Ce,S]);const Fe={backgroundColor:ee.color,backdropFilter:`blur(${ee.blur}px)`,animationDuration:`${parseInt(q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:ti.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:s?null:K,className:je(ce.background,H?ue:re,{[ce.editor]:s},{[ce.hidden]:!e}),style:{...Fe,...B&&!s&&!H?{position:"absolute"}:{}}}),a.jsxs("div",{ref:s?K:null,className:je(ce.contentStyle,H?U:Se,{[ce.editor]:s},{[ce.hidden]:!e}),style:{animationDuration:`${parseInt(q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Yo,{onMove:z=>$(z.index),ref:g,className:ce.lightboxSplide,options:{arrows:!1,speed:k.duration?parseInt(k.duration):500,direction:k.direction==="horiz"||k.type==="fade"||k.type==="scale"?"ltr":"ttb",pagination:!1,drag:ie.type==="drag"&&!Ce,perPage:1,width:"100%",height:"100%",type:k.type==="fade"||k.type==="scale"?"fade":"loop",padding:0,rewind:ie.repeat!=="close",start:0},style:{"--splide-speed":k.duration},children:n.map((z,le)=>{const M=gi(he.position,he.offset,s),X=`${L.scalingValue(he.padding.top,s)} ${L.scalingValue(he.padding.right,s)} ${L.scalingValue(he.padding.bottom,s)} ${L.scalingValue(he.padding.left,s)}`,Y=k.type==="scale"?(()=>{const{transform:ne,...me}=M;return{...me,position:"absolute",padding:X,boxSizing:"border-box","--position-transform":ne||"none"}})():{...M,position:"absolute",padding:X,boxSizing:"border-box"};return a.jsx(Jo,{children:a.jsx("div",{className:ce.imgWrapper,onClick:ye,children:a.jsx("img",{ref:le===w?P:null,className:je(ce.imageStyle,{[ce.contain]:z.image.objectFit==="contain",[ce.cover]:z.image.objectFit==="cover",[ce.scaleSlide]:k.type==="scale"}),src:z.image.url,alt:z.image.name??"",style:{...Y,pointerEvents:z.image.objectFit==="contain"?"none":"auto"}})})},le)})},S),f.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:je(ce.arrow,{[ce.arrowVertical]:k.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:a.jsxs("button",{className:ce.arrowInner,style:{transform:`translate(${L.scalingValue(f.offset.x,s)}, ${L.scalingValue(f.offset.y*(k.direction==="horiz"?1:-1),s)}) scale(${f.scale}) rotate(${k.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=g.current)==null?void 0:z.go("-1")},"aria-label":"Previous",children:[f.arrowsImgUrl&&a.jsx(Ht,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:je(ce.arrowImg,ce.mirror)}),!f.arrowsImgUrl&&a.jsx(Er,{color:f.color,className:je(ce.arrowIcon,ce.arrowImg,ce.mirror)})]})}),a.jsx("div",{className:je(ce.arrow,ce.nextArrow,{[ce.arrowVertical]:k.direction==="vert"}),style:{color:f.color,"--arrow-hover-color":f.hover},children:a.jsxs("button",{className:ce.arrowInner,style:{transform:`translate(${L.scalingValue(f.offset.x*(k.direction==="horiz"?-1:1),s)}, ${L.scalingValue(f.offset.y,s)}) scale(${f.scale}) rotate(${k.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=g.current)==null?void 0:z.go("+1")},"aria-label":"Next",children:[f.arrowsImgUrl&&a.jsx(Ht,{url:f.arrowsImgUrl,fill:f.color,hoverFill:f.hover,className:ce.arrowImg}),!f.arrowsImgUrl&&a.jsx(Er,{color:f.color,className:je(ce.arrowIcon,ce.arrowImg)})]})})]}),ee.closeIconUrl&&(()=>{const z=gi(ee.closeIconAlign,ee.closeIconOffset,s),le=`scale(${ee.closeIconScale})`,M=z.transform?`${z.transform} ${le}`:le;return a.jsx("button",{className:ce.closeButton,style:{...z,transform:M},onClick:ae,"aria-label":"Close lightbox",children:a.jsx(Ht,{url:ee.closeIconUrl,fill:ee.closeIconColor??"#000000",hoverFill:ee.closeIconHover??"#cccccc"})})})(),ve&&ve.isActive&&i.imageCaption&&((Ie=n[w])==null?void 0:Ie.imageCaption)&&a.jsx("div",{className:ce.caption,style:{...gi(ve.alignment,ve.offset,s),fontFamily:qi(p.fontFamily),fontWeight:p.fontWeight,fontStyle:p.fontStyle,width:l.sizing==="auto"?"max-content":L.scalingValue(l.width,s),letterSpacing:L.scalingValue(u,s),wordSpacing:L.scalingValue(v,s),textAlign:C,fontSize:L.scalingValue(y.fontSize,s),lineHeight:L.scalingValue(y.lineHeight,s),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:h},onClick:z=>z.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:ce.captionTextInner,style:{"--link-color":ve.linkColor,"--link-hover-color":ve.linkHoverColor},children:a.jsx(Jn,{content:n[w].imageCaption})})}),G.isActive&&(()=>{const[z,le]=G.position.split("-"),M=k.direction==="horiz"?`${z}-left`:G.position,X=gi(M,G.offset,s),Y=()=>{if(k.direction==="horiz"){if(le==="left")return"flex-start";if(le==="center")return"center";if(le==="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 a.jsx("div",{ref:O,className:ce.thumbsWrapper,onClick:ne=>We(ne),style:{position:s?"absolute":"fixed",...X,...k.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:je(ce.thumbsContainer,{[ce.thumbsContainerVertical]:k.direction==="vert",[ce.thumbsAlignStart]:G.align==="start",[ce.thumbsAlignCenter]:G.align==="center",[ce.thumbsAlignEnd]:G.align==="end"}),style:{gap:L.scalingValue(G.grid.gap,s),justifyContent:N?"flex-start":Y()},children:n.map((ne,me)=>{const we=me===w,Oe=E[me],be=G.grid.size*(we?G.activeState.scale:1),He=()=>{if(G.fit!=="fit")return{};if(!Oe)return k.direction==="horiz"?{height:L.scalingValue(be,s)}:{width:L.scalingValue(be,s)};const ge=Oe.width/Oe.height;if(k.direction==="horiz"){const Le=be,Ne=Le*ge;return{width:L.scalingValue(Ne,s),height:L.scalingValue(Le,s)}}else{const Le=be,Ne=Le/ge;return{width:L.scalingValue(Le,s),height:L.scalingValue(Ne,s)}}};return a.jsx("button",{className:ce.thumbItem,style:{...k.direction==="horiz"&&G.fit!=="fit"?{height:L.scalingValue(be,s)}:{},...k.direction==="vert"&&G.fit!=="fit"?{width:L.scalingValue(be,s)}:{},...G.fit==="cover"?{width:L.scalingValue(be,s),height:L.scalingValue(be,s)}:{},...He(),transition:we?"all 0.25s ease-out":"none",opacity:we?G.activeState.opacity/100:G.opacity/100,"--thumb-hover":G.activeState.opacity/100},onClick:ge=>{var Le;ge.stopPropagation(),$(me),(Le=g.current)==null||Le.go(me)},onMouseEnter:()=>{var ge;G.triggers==="hov"&&((ge=g.current)==null||ge.go(me))},children:a.jsx("img",{src:ne.image.url,alt:ne.image.name??"",onLoad:ge=>{const Le=ge.currentTarget;Le.naturalWidth&&Le.naturalHeight&&V(Ne=>({...Ne,[me]:{width:Le.naturalWidth,height:Le.naturalHeight}}))},style:{objectFit:G.fit==="cover"?"cover":"contain",...G.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...G.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ne.image.name}-${me}`)})})})})()]})]}),document.getElementById(r))};function Er({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.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 gd={element:pd,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 hi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function hd(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
width: 100%;
|
|
11
|
-
min-height: ${
|
|
11
|
+
min-height: ${hi(48)};
|
|
12
12
|
}
|
|
13
13
|
.${e}-wrapper.${e}-type-C .${e}-input:focus-visible,
|
|
14
14
|
.${e}-wrapper.${e}-type-C .${e}-button:focus-visible {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
min-width: 0;
|
|
33
33
|
}
|
|
34
34
|
.${e}-field-group.${e}-labeled {
|
|
35
|
-
gap: ${
|
|
35
|
+
gap: ${hi(4)};
|
|
36
36
|
}
|
|
37
37
|
.${e}-field-label {
|
|
38
38
|
white-space: nowrap;
|
|
@@ -128,11 +128,11 @@
|
|
|
128
128
|
outline: none;
|
|
129
129
|
}
|
|
130
130
|
.${e}-success {
|
|
131
|
-
margin-top: ${
|
|
131
|
+
margin-top: ${hi(8)};
|
|
132
132
|
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
133
133
|
}
|
|
134
134
|
.${e}-error {
|
|
135
|
-
margin-top: ${
|
|
135
|
+
margin-top: ${hi(8)};
|
|
136
136
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
137
137
|
}
|
|
138
138
|
.${e}-overlay-anchor {
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
pointer-events: auto;
|
|
156
156
|
z-index: 10;
|
|
157
157
|
}
|
|
158
|
-
`}function
|
|
158
|
+
`}function fd({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const s=!!n,d=i&&t||!t,{prefix:l}=L.useScopedStyles(),{type:p="A",fieldsToShow:u=2,fields:C=[],buttonLabel:v,gap:y,fieldsGap:m,buttonCorners:h,buttonStroke:w,buttonPadding:$,isButtonFullWidth:S,inputCorners:b,inputStroke:H,inputPadding:I,inputColor:B,inputTextColor:x,inputBorderColor:E,placeholderColor:V,buttonColor:g,buttonTextColor:T,buttonBorderColor:P,labelTextColor:W,successColor:K,errorColor:oe,fontFamily:F,inputFontSettings:R,inputFontSize:D,inputLineHeight:O,inputLetterSpacing:N,inputWordSpacing:_,inputTextAppearance:q,buttonFontSettings:ie,buttonFontSize:k,buttonLineHeight:G,buttonLetterSpacing:f,buttonWordSpacing:ee,buttonTextAppearance:ve,labelFontSettings:he,labelFontSize:Se,labelLineHeight:re,labelLetterSpacing:ue,labelWordSpacing:U,labelTextAppearance:Z,statusFontSettings:ae,statusFontSize:pe,statusLineHeight:ye,statusLetterSpacing:We,statusWordSpacing:Ce,statusTextAppearance:Fe,successMessage:Ie,errorMessage:z,stateOverrides:le}=e,M=p==="B",X=C.slice(0,Math.min(u,C.length)),Y={fontSettings:{fontFamily:F,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:D??.01,lineHeight:O,letterSpacing:N??0,wordSpacing:_??0,textAppearance:q,color:x},ne=Nt(ft(Y,t)),me=L.scalingValue(H??0,t),we=L.scalingValue((O??D??.01)+((I==null?void 0:I.top)??0)+((I==null?void 0:I.bottom)??0)+(p==="C"?H??0:(H??0)*2),t),Oe={...ne,borderStyle:"solid",borderRadius:p==="C"?0:L.scalingValue(b??0,t),...p==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:me,borderLeftWidth:0}:{borderWidth:me},paddingTop:L.scalingValue((I==null?void 0:I.top)??0,t),paddingRight:L.scalingValue((I==null?void 0:I.right)??0,t),paddingBottom:L.scalingValue((I==null?void 0:I.bottom)??0,t),paddingLeft:L.scalingValue((I==null?void 0:I.left)??0,t),height:we,minHeight:we},$e={fontSettings:{fontFamily:F,fontWeight:(ie==null?void 0:ie.fontWeight)??400,fontStyle:(ie==null?void 0:ie.fontStyle)??"normal"},fontSize:k??.01,lineHeight:G,letterSpacing:f??0,wordSpacing:ee??0,textAppearance:ve,color:T},be=Nt(ft($e,t)),He=L.scalingValue(w??0,t),ge={fontSettings:{fontFamily:F,fontWeight:(he==null?void 0:he.fontWeight)??400,fontStyle:(he==null?void 0:he.fontStyle)??"normal"},fontSize:Se??.01,lineHeight:re,letterSpacing:ue??0,wordSpacing:U??0,textAppearance:Z,color:W},Le=ft(ge,t),Ne={fontSettings:{fontFamily:F,fontWeight:(ae==null?void 0:ae.fontWeight)??400,fontStyle:(ae==null?void 0:ae.fontStyle)??"normal"},fontSize:pe??.01,lineHeight:ye,letterSpacing:We??0,wordSpacing:Ce??0,textAppearance:Fe,color:K},Me=Nt(ft(Ne,t)),Ve=L.buildColorVars(l,{inputColor:B,inputTextColor:x,inputBorderColor:E,placeholderColor:V!=null&&V.trim()?V:"#cccccc",buttonColor:g,buttonTextColor:T,buttonBorderColor:P,labelTextColor:W,successColor:K,errorColor:oe},yd,vd,le),[tt,dt]=c.useState(()=>Object.fromEntries(X.map(_e=>[_e.name,""]))),[st,bt]=c.useState("idle"),[Rt,xt]=c.useState(null),At=r==="success"?"success":r==="error"?"error":st,Ae=r==="error"?z:Rt,ot=r==="filled",qe=c.useMemo(()=>{if(!ot)return tt;let _e=null;for(const nt of X)(tt[nt.name]??"").trim().length>0||(_e=_e??{...tt},_e[nt.name]="Filled");return _e??tt},[tt,ot,X]),Qe=At==="error"?L.getFormFieldValidationError(X,qe):null,Pt=`${r&&r!=="default"?`${l}-state-${r}`:""}`.trim(),yt=o==null?void 0:o.submitUrl,rt=(_e,nt)=>{dt(Ue=>({...Ue,[_e]:nt}))},$t=async _e=>{if(_e.preventDefault(),!d)return;const nt=Object.fromEntries(X.map(Ge=>{var it;return[Ge.name,((it=tt[Ge.name])==null?void 0:it.trim())??""]}).filter(([,Ge])=>Ge));if(!yt){bt("error"),xt("No integrations were found for this form.");return}if(Object.keys(nt).length===0)return;const Ue=L.getFormFieldValidationError(X,tt);if(Ue){bt("error"),xt(Ue);return}bt("submitting"),xt(null);try{const Ge=await fetch(yt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(nt)});if(!Ge.ok){const it=await Ge.text();throw new Error(it||`Request failed: ${Ge.status}`)}bt("success"),dt(Object.fromEntries(X.map(it=>[it.name,""])))}catch(Ge){bt("error"),xt(Ge instanceof Error?Ge.message:"Something went wrong")}};return a.jsxs("div",{className:`${l}-wrapper ${l}-type-${p} ${Pt}`.trim(),style:Ve,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:hd(l)}}),a.jsxs("form",{onSubmit:$t,className:`${l}-form`,children:[a.jsx("div",{className:`${l}-fields`,children:X.map((_e,nt)=>a.jsxs(c.Fragment,{children:[nt>0&&a.jsx("div",{"data-controls":s?"fieldsGap":void 0,className:s?`${l}-control`:void 0,style:{height:L.scalingValue(m??0,t)}}),a.jsxs("div",{className:`${l}-field-group${M?` ${l}-labeled`:""}`,children:[M&&a.jsx("span",{className:`${l}-field-label`,style:Le?{...Le,lineHeight:Le.fontSize}:void 0,children:_e.label||_e.name}),_e.type==="textarea"?a.jsx("textarea",{name:_e.name,autoComplete:"off",value:qe[_e.name]??"",onChange:Ue=>rt(_e.name,Ue.target.value),placeholder:_e.placeholder,className:`${l}-input`,style:Oe,rows:1,"data-filled":ot||(qe[_e.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:_e.type==="phone"?"tel":_e.type==="email"?"email":"text",name:_e.name,autoComplete:"off",value:qe[_e.name]??"",onChange:Ue=>rt(_e.name,Ue.target.value),placeholder:_e.placeholder,required:_e.isRequired??_e.type==="email",className:`${l}-input`,style:Oe,"data-filled":ot||(qe[_e.name]??"").trim().length>0})]})]},nt))}),a.jsx("div",{"data-controls":s?"gap":void 0,className:s?`${l}-control`:void 0,style:{height:L.scalingValue(y??0,t)}}),a.jsx("div",{className:`${l}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${l}-button`,style:{borderStyle:"solid",borderRadius:L.scalingValue(h??0,t),borderWidth:He,paddingTop:L.scalingValue(($==null?void 0:$.top)??0,t),paddingRight:L.scalingValue(($==null?void 0:$.right)??0,t),paddingBottom:L.scalingValue(($==null?void 0:$.bottom)??0,t),paddingLeft:L.scalingValue(($==null?void 0:$.left)??0,t),pointerEvents:d?"auto":void 0,...be,...S?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${l}-overlay-anchor`,style:S?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:st==="submitting"?"...":v})})})]}),At==="success"&&a.jsx("p",{className:`${l}-success`,style:{...Me},children:Ie}),At==="error"&&a.jsx("p",{className:`${l}-error`,style:{...Me},role:"alert",children:Qe??Ae??z})]})}const yd={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"},vd=["hover","focus","filled","success","error"],bd=`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
|
-
`,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`
|
|
792
|
+
`,xd=[{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"}],fi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Sd=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Cd={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:{...fi.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:{...fi.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:{...fi.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:{...fi.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:xd,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:[...Sd],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"]},wd={element:fd,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:Cd,sourceCode:bd};function yi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function $d(e){return`
|
|
793
793
|
.${e}-wrapper {
|
|
794
794
|
display: flex;
|
|
795
795
|
flex-direction: column;
|
|
@@ -971,16 +971,16 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
971
971
|
align-items: center;
|
|
972
972
|
}
|
|
973
973
|
.${e}-success {
|
|
974
|
-
margin-top: ${
|
|
975
|
-
font-size: ${
|
|
974
|
+
margin-top: ${yi(8)};
|
|
975
|
+
font-size: ${yi(14)};
|
|
976
976
|
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
977
977
|
}
|
|
978
978
|
.${e}-error {
|
|
979
|
-
margin-top: ${
|
|
980
|
-
font-size: ${
|
|
979
|
+
margin-top: ${yi(8)};
|
|
980
|
+
font-size: ${yi(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const
|
|
983
|
+
`}const Td=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=L.useScopedStyles(),s=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:l,buttonLabel:p,fieldsToShow:u=1,fontFamily:C,inputFontSettings:v,inputFontSize:y,inputLineHeight:m,inputLetterSpacing:h,inputWordSpacing:w,inputTextAppearance:$,buttonFontSettings:S,buttonFontSize:b,buttonLineHeight:H,buttonLetterSpacing:I,buttonWordSpacing:B,buttonTextAppearance:x,statusFontSettings:E,statusFontSize:V,statusLineHeight:g,statusLetterSpacing:T,statusWordSpacing:P,statusTextAppearance:W,iconMaxWidth:K,minHeight:oe,corners:F,stroke:R,stateOverrides:D,inputPadding:O,buttonPadding:N,successMessage:_="Thanks for subscribing!",errorMessage:q="Please, fill all required fields."}=e,ie=d.slice(0,Math.min(u,d.length)),[k,G]=c.useState(()=>Object.fromEntries(ie.map(ge=>[ge.name,""]))),[f,ee]=c.useState("idle"),[ve,he]=c.useState(null),Se=o==="success"?"success":o==="error"?"error":f,re=o==="error"?q:ve,ue=o==="filled",U=c.useMemo(()=>{if(!ue)return k;let ge=null;for(const Le of ie)(k[Le.name]??"").trim().length>0||(ge=ge??{...k},ge[Le.name]="Filled");return ge??k},[ue,k,ie]),Z=Se==="error"?L.getFormFieldValidationError(ie,U):null,ae=o&&o!=="default"?`${r}-state-${o}`:"",pe=ie.some(ge=>(U[ge.name]??"").trim().length>0),ye=ae!==`${r}-state-filled`&&pe?`${r}-state-filled`:"",We=`${ae} ${ye}`.trim(),Ce=i==null?void 0:i.submitUrl,Fe=p??"",Ie=(l==null?void 0:l.icon)??"",z=(l==null?void 0:l.mode)==="On",le=Fe||"Submit",M={fontSettings:{fontFamily:C,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:y??.01,lineHeight:m,letterSpacing:h??0,wordSpacing:w??0,textAppearance:$,color:e.inputTextColor??"#111111"},X={fontSettings:{fontFamily:C,fontWeight:(S==null?void 0:S.fontWeight)??400,fontStyle:(S==null?void 0:S.fontStyle)??"normal"},fontSize:b??.01,lineHeight:H,letterSpacing:I??0,wordSpacing:B??0,textAppearance:x,color:e.buttonTextColor??"#ffffff"},Y={fontSettings:{fontFamily:C,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:V??.01,lineHeight:g,letterSpacing:T??0,wordSpacing:P??0,textAppearance:W,color:e.successColor??"#22c55e"},ne=Nt(ft(M,t)),me=Nt(ft(X,t)),we=Nt(ft(Y,t)),Oe=L.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(M==null?void 0:M.color)??"#111111",buttonTextColor:e.buttonTextColor??(X==null?void 0:X.color)??"#ffffff"},Ld,Id,D),$e={borderRadius:L.scalingValue(F,t),borderWidth:L.scalingValue(R,t),borderStyle:"solid"},be={borderLeftWidth:L.scalingValue(R,t)},He=async ge=>{if(ge.preventDefault(),!s)return;const Le=Object.fromEntries(ie.map(Me=>{var Ve;return[Me.name,((Ve=k[Me.name])==null?void 0:Ve.trim())??""]}).filter(([,Me])=>Me));if(!Ce){ee("error"),he("No integrations were found for this form.");return}if(Object.keys(Le).length===0)return;const Ne=L.getFormFieldValidationError(ie,k);if(Ne){ee("error"),he(Ne);return}ee("submitting"),he(null);try{const Me=await fetch(Ce,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Le)});if(!Me.ok){const Ve=await Me.text();throw new Error(Ve||`Request failed: ${Me.status}`)}ee("success"),G(Object.fromEntries(ie.map(Ve=>[Ve.name,""])))}catch(Me){ee("error"),he(Me instanceof Error?Me.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${We}`.trim(),style:Oe,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:$d(r)}}),a.jsxs("form",{onSubmit:He,className:`${r}-form`,style:{...$e,height:L.scalingValue(oe,t),minHeight:L.scalingValue(oe,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:ie.map(ge=>a.jsx("input",{type:ge.type==="email"?"email":ge.type==="phone"?"tel":"text",name:ge.name,autoComplete:"off",value:U[ge.name]??"",onChange:Le=>G(Ne=>({...Ne,[ge.name]:Le.target.value})),placeholder:ge.placeholder,required:ge.isRequired??ge.type==="email",className:`${r}-input`,style:{...ne,paddingRight:L.scalingValue(O.right,t),paddingLeft:L.scalingValue(O.left,t),paddingTop:L.scalingValue(O.top,t),paddingBottom:L.scalingValue(O.bottom,t)}},ge.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:s?"submit":"button",className:`${r}-submitBtn`,"aria-label":le,style:{...me,...be,paddingRight:L.scalingValue(N.right,t),paddingLeft:L.scalingValue(N.left,t),paddingTop:L.scalingValue(N.top,t),paddingBottom:L.scalingValue(N.bottom,t),pointerEvents:s?"auto":void 0},children:f==="submitting"?"...":z?Ie&&a.jsx(Ht,{url:Ie,className:`${r}-submitBtnIcon`,style:{maxWidth:L.scalingValue(K??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):Fe})})]}),Se==="success"&&a.jsx("p",{className:`${r}-success`,style:{...we},children:_}),Se==="error"&&a.jsx("p",{className:`${r}-error`,style:{...we},role:"alert",children:Z??re??q})]})},Ld={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"},Id=["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
|
-
`,Ed="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:Ed},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:Id};function Md(e){return`
|
|
1560
|
+
`,_d="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),Rd=[{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"}}}},Ad=["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:{...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:Rd,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:_d},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:0,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:0,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Ad],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"]},Md={element:Td,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 kd(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 Wd=30,Fd=20,ro=2,Nd=2,Hd=(e,t)=>Array.from({length:t},()=>e).flat(),Od=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Bd=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Od(i,e))},Dd=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,imageHoverClass:r,isFirstSet:s,scaled:d,onFirstSetImageDone:l})=>{var x,E,V;const p=c.useRef(null);c.useLayoutEffect(()=>{if(!s)return;const g=p.current;g!=null&&g.complete&&(l==null||l())},[s,(x=e.image)==null?void 0:x.url,l]);const u=n.display==="Cover",C=n.ratioValue??"1:1",v=n.reversed??!1,[y,m]=C.split(":").map(Number),$=(v?m:y)/(v?y:m);let S=i,b=S/$;b>o&&(b=o,S=b*$);const H=d(S),I=d(b),B=((E=e.image)==null?void 0:E.url)&&a.jsx("img",{ref:p,src:e.image.url,alt:((V=e.image)==null?void 0:V.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:s?l:void 0,onError:s?l:void 0});return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...u?{width:H}:{width:"fit-content",maxWidth:d(i),minWidth:0}},children:a.jsx("div",{className:r,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...u?{width:H,height:I,overflow:"hidden"}:{width:"fit-content",maxWidth:d(i),height:d(o)}},children:B&&e.link?a.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:je(`${t}-marquee-link`,!u&&`${t}-marquee-link-contain`),children:B}):B})})},jd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=L.useScopedStyles(),s=c.useMemo(()=>kd(r),[r]),{speed:d,direction:l,pauseOnHover:p,gap:u,imageMaxWidth:C,imageMaxHeight:v,imageFit:y,hoverEffect:m}=e,h=!!o,w=!n||!!i,$=w&&m!=="off"&&m!=="randomize"?`${r}-image-hover-${m}`:void 0,S=n?!!i:!0,H=((t==null?void 0:t.length)??0)>0&&(S||!!n),I=Math.max(0,d)*Wd,B=Z=>L.scalingValue(Z,n??!1),x=c.useRef(null),E=c.useRef(null),V=c.useRef(null),[g,T]=c.useState(0),[P,W]=c.useState(0),K=S&&p==="on",[oe,F]=c.useState(!1),[R,D]=c.useState({}),O=c.useRef(R);O.current=R;const N=c.useRef(null),_=c.useRef(0),q=c.useRef(null),ie=c.useMemo(()=>(t??[]).map(Z=>{var ae;return((ae=Z.image)==null?void 0:ae.url)??""}).join("\0"),[t]),[k,G]=c.useState(ro),f=c.useMemo(()=>{const Z=t??[];return!S||Z.length===0?Z:Hd(Z,k)},[t,S,k]),ee=c.useMemo(()=>f.filter(Z=>{var ae;return!!((ae=Z.image)!=null&&ae.url)}).length,[f]),ve=H?Nd:1;c.useLayoutEffect(()=>{_.current=0,D({}),N.current=null,G(ro),T(0)},[ie]),c.useEffect(()=>{if(!w||m!=="randomize")return;const Z=x.current;if(!Z)return;const ae=Ce=>{D(Fe=>{let Ie=null;for(const z of Ce)z in Fe&&(Bd(Z,z)||(Ie||(Ie={...Fe}),delete Ie[z]));return Ie??Fe})},pe=new IntersectionObserver(Ce=>{const Fe=new Set;for(const Ie of Ce){const z=Ie.target.dataset.marqueeItemIndex,le=z!==void 0?Number(z):NaN;Number.isNaN(le)||Fe.add(le)}Fe.size>0&&ae(Fe)},{root:Z,threshold:0});Object.keys(R).forEach(Ce=>{const Fe=Number(Ce);Z.querySelectorAll(`[data-marquee-item-index="${Fe}"]`).forEach(Ie=>pe.observe(Ie))});let ye=0;const We=()=>{const Ce=Object.keys(O.current);Ce.length!==0&&(ae(Ce.map(Number)),ye=requestAnimationFrame(We))};return Object.keys(O.current).length>0&&(ye=requestAnimationFrame(We)),()=>{cancelAnimationFrame(ye),pe.disconnect()}},[m,R,w]),c.useLayoutEffect(()=>{if(!H)return;const Z=x.current,ae=V.current;if(!Z||!ae)return;let pe=0;const ye=()=>{const Fe=Z.getBoundingClientRect().width,Ie=ae.getBoundingClientRect().width,z=N.current,le=typeof z=="number"&&Math.abs(z-Ie)<=.25;if(N.current=Ie,S&&Ie>0&&k>0){const M=Ie/k;if(M>0&&Fe>0){const X=Math.max(ro,Math.ceil(Fe/M)+1);if(X!==k){G(X);return}}}if(Ie>0&&g<=0){T(Ie);return}le&&Ie!==g?T(Ie):!le&&g<=0&&(cancelAnimationFrame(pe),pe=requestAnimationFrame(ye))},We=()=>{cancelAnimationFrame(pe),pe=requestAnimationFrame(ye)};q.current=We,We();const Ce=new ResizeObserver(We);return Ce.observe(Z),Ce.observe(ae),()=>{q.current=null,cancelAnimationFrame(pe),Ce.disconnect()}},[S,H,g,ie,k]),c.useLayoutEffect(()=>{const Z=E.current;if(!H||!Z)return;const ae=g>0?g:0,pe=ae>0&&I>0?ae/I*1e3:0,ye=`${Math.max(0,pe)/1e3}s`;Z.style.setProperty("--marquee-distance",`${ae}px`),Z.style.setProperty("--marquee-duration",ye)},[S,H,I,g]),c.useLayoutEffect(()=>{if(!H){W(0);return}if(g<=0){W(0);return}const Z=E.current;if(!Z)return;const ae=()=>{const ye=Z.getBoundingClientRect().height;W(ye>0?ye:0)};ae();const pe=new ResizeObserver(ae);return pe.observe(Z),()=>pe.disconnect()},[H,ve,f,n,u,C,v,g,y,R]);const he=()=>{K&&F(!0)},Se=()=>{K&&F(!1)},re=c.useCallback(()=>{var Z;_.current=Math.min(ee,_.current+1),(Z=q.current)==null||Z.call(q)},[ee]),ue=c.useCallback((Z,ae)=>{D(pe=>{const ye=pe[Z]??ae,We=(t??[]).filter(Fe=>Fe!==ye);if(We.length===0)return pe;const Ce=We[Math.floor(Math.random()*We.length)];return{...pe,[Z]:Ce}})},[t]),U=(Z,ae,pe,ye)=>{const We=w&&m==="randomize"&&y.display==="Cover"?R[pe]??Z:Z,Ce=`max(${B(u)}, ${Fd}px)`,Fe=`calc(-0.5 * (${Ce} + ${B(u)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":pe,onMouseEnter:w&&m==="randomize"&&y.display==="Cover"?()=>ue(pe,Z):void 0,children:[a.jsx(Dd,{item:We,prefix:r,imageFit:y,imageMaxWidth:C,imageMaxHeight:v,imageHoverClass:$,isEditor:n,isFirstSet:ye,scaled:B,onFirstSetImageDone:re}),h&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:Fe,width:Ce,height:"100%"}})]},`${ae}-${pe}`)};if(H){const Z=S?K&&oe?"paused":"running":"paused";return a.jsxs("div",{ref:x,className:je(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:g>0&&P>0?{height:P}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),a.jsx("div",{ref:E,className:`${r}-marquee-track`,"data-direction":l,onMouseEnter:he,onMouseLeave:Se,style:{"--marquee-play-state":Z},children:Array.from({length:ve},(ae,pe)=>a.jsx("div",{ref:pe===0?V:void 0,className:je(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:B(u),paddingRight:B(u)},"aria-hidden":pe>0,children:f.map((ye,We)=>U(ye,pe,We,pe===0))},`set-${pe}`))},"marquee-track")]})}return a.jsxs("div",{ref:x,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),a.jsx("div",{className:je(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:B(u),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Z,ae)=>U(Z,0,ae))},"marquee-static")]})},zd=`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
|
+
`,Vd={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,display:{type:"numeric-input"}},imageFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"Fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.21},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278}},displayRules:[{if:{name:"imageFit.display",value:"Cover"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","randomize"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{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:""}]}},Kd={element:jd,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:Vd,sourceCode:zd,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 Ud=30,Rr=2,Gd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=L.useScopedStyles(),{align:s,speed:d,direction:l,pauseOnHover:p,gap:u,cardWidth:C,corners:v,stroke:y,strokeColor:m,bgColor:h,padding:w,logoMarginTop:$,logoWidth:S,logoHeight:b,captionMarginTop:H}=e,I=!!o,B=((t==null?void 0:t.length)??0)>0,x=d>0&&(!n||i),E=B&&(x||n),V=Math.max(0,d)*Ud,g=M=>L.scalingValue(M,n??!1),T=c.useRef(null),P=c.useRef(null),W=c.useRef(null),[K,oe]=c.useState(0),[F,R]=c.useState(0),[D,O]=c.useState(0),N=x&&p==="on",[_,q]=c.useState(!1),ie=c.useRef(null),[k,G]=c.useState(0),[f,ee]=c.useState(0),ve=c.useRef(null),he=M=>{var Y,ne,me,we,Oe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${M}FontFamily`])??"Arial",fontWeight:((Y=e==null?void 0:e[`${M}FontSettings`])==null?void 0:Y.fontWeight)??400,fontStyle:((ne=e==null?void 0:e[`${M}FontSettings`])==null?void 0:ne.fontStyle)??"normal"},textAppearance:{textTransform:((me=e==null?void 0:e[`${M}TextAppearance`])==null?void 0:me.textTransform)??"none",textDecoration:((we=e==null?void 0:e[`${M}TextAppearance`])==null?void 0:we.textDecoration)??"none",fontVariant:((Oe=e==null?void 0:e[`${M}TextAppearance`])==null?void 0:Oe.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${M}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${M}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${M}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${M}LineHeight`])??.01,color:(e==null?void 0:e[`${M}Color`])??"#000000"}},Se=he("text"),re=he("caption"),ue=c.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(M=>{var X,Y;return(((X=M.text)==null?void 0:X.length)??0)>0||(((Y=M.caption)==null?void 0:Y.length)??0)>0}),[t]),U=c.useMemo(()=>!E||(t==null?void 0:t.length)===0?1:F<=0||K<=0?Rr:Math.max(Rr,Math.ceil(K/F)+1),[E,t==null?void 0:t.length,F,K]);c.useLayoutEffect(()=>{if(!E)return;const M=T.current,X=W.current;if(!M||!X)return;let Y=0;const ne=()=>{const Oe=M.getBoundingClientRect().width,$e=X.getBoundingClientRect().width,be=ve.current,He=typeof be=="number"&&Math.abs(be-$e)<=.25;if(ve.current=$e,oe(Oe),typeof $e=="number"&&$e>0&&F<=0){R($e);return}He&&$e!==F?R($e):!He&&F<=0&&(cancelAnimationFrame(Y),Y=requestAnimationFrame(ne))},me=()=>{cancelAnimationFrame(Y),Y=requestAnimationFrame(ne)};me();const we=new ResizeObserver(me);return we.observe(M),we.observe(X),()=>{cancelAnimationFrame(Y),we.disconnect()}},[x,E,F]),c.useLayoutEffect(()=>{const M=P.current;if(!E||!M)return;const X=F>0?F:0,Y=X>0&&V>0?X/V*1e3:0,ne=`${Math.max(0,Y)/1e3}s`;M.style.setProperty("--marquee-distance",`${X}px`),M.style.setProperty("--marquee-duration",ne)},[x,E,V,F]),c.useLayoutEffect(()=>{if(!E){O(0);return}const M=W.current,X=P.current;if(!M||!X)return;const Y=()=>{let me=0;for(let we=0;we<M.children.length;we++){const $e=M.children[we].firstElementChild;$e&&(me=Math.max(me,$e.offsetHeight))}me<=0&&(me=X.offsetHeight),O(me>0?me:0)};Y();const ne=new ResizeObserver(Y);return ne.observe(M),ne.observe(X),()=>{ne.disconnect()}},[E,U,t,n,u,C,w,y,v,S,b,k,f]);const Z=()=>{N&&q(!0)},ae=()=>{N&&q(!1)},pe=c.useMemo(()=>{switch(s){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[s]),ye=c.useMemo(()=>{switch(s){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[s]),We=c.useCallback((M,X,Y,ne)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:pe,width:"100%"},children:[a.jsx("div",{"data-controls":I?ne==null?void 0:ne.controlsName:void 0,"data-controls-axis":I?"y":void 0,className:I?`${r}-control`:void 0,style:{height:g((ne==null?void 0:ne.marginTop)??0)}}),a.jsx("div",{...ne!=null&&ne.dataMeasureKind?{"data-testimonial-measure":ne.dataMeasureKind}:{},style:{...ft(M,n),textAlign:ye,pointerEvents:"auto",...typeof(ne==null?void 0:ne.minHeightPx)=="number"&&ne.minHeightPx>0?{minHeight:ne.minHeightPx}:{}},children:a.jsx(Jn,{content:X})})]},Y),[pe,ye,n,I,r,g]),Ce=c.useCallback((M,X,Y)=>{var ne,me,we;return a.jsxs("div",{style:{padding:`${g(w.top)} ${g(w.right)} ${g(w.bottom)} ${g(w.left)}`,width:g(C+y*2),height:"100%",borderRadius:g(v),border:`${g(y)} solid ${m}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:h}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:pe,textAlign:ye},children:[M.text&&We(Se,M.text,"text",Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(Y==null?void 0:Y.textMinHeightPx)=="number"&&Y.textMinHeightPx>0?{minHeightPx:Y.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:pe,width:"100%"},children:[a.jsx("div",{"data-controls":I&&!(Y!=null&&Y.dataMeasureAttrs)?"logoMarginTop":void 0,className:I&&!(Y!=null&&Y.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:g($)}}),a.jsx("div",{style:{width:g(S),height:g(b)},children:((ne=M.logo)==null?void 0:ne.url)&&a.jsx("img",{src:M.logo.url,alt:((me=M.logo)==null?void 0:me.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((we=M.logo)==null?void 0:we.objectFit)||"contain"}})})]}),M.caption&&We(re,M.caption,"caption",{...Y!=null&&Y.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:H,...Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(Y==null?void 0:Y.captionMinHeightPx)=="number"&&Y.captionMinHeightPx>0?{minHeightPx:Y.captionMinHeightPx}:{}})]})]},X)},[h,H,re,C,v,b,$,S,pe,ye,w.bottom,w.left,w.right,w.top,We,y,m,Se,n,I,r]),Fe=c.useCallback(M=>{G(M.maxTextPx),ee(M.maxCaptionPx)},[]);c.useLayoutEffect(()=>{if(!ue){Fe({maxTextPx:0,maxCaptionPx:0});return}const M=ie.current;if(!M)return;const X=()=>{L.readTestimonialTextMeasure(M,Fe)};X();const Y=new ResizeObserver(X);return Y.observe(M),()=>{Y.disconnect()}},[ue,Fe,t,Ce]);const Ie=ue?{textMinHeightPx:k,captionMinHeightPx:f}:void 0,z=ue?a.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((M,X)=>Ce(M,`measure-${X}`,{dataMeasureAttrs:!0}))}):null,le=(M,X)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[Ce(M,`card-${X}`,Ie),I&&a.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(E){const M=x?N&&_?"paused":"running":"paused";return a.jsxs("div",{ref:T,className:je(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...D>0?{height:D}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_r(r)}}),z,a.jsx("div",{ref:P,className:`${r}-marquee-track`,"data-direction":l,onMouseEnter:Z,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":M},children:Array.from({length:U},(X,Y)=>a.jsx("div",{ref:Y===0?W:void 0,className:`${r}-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((ne,me)=>le(ne,`${Y}-${me}`))},`set-${Y}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_r(r)}}),z,a.jsx("div",{style:{gap:g(u),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((M,X)=>le(M,X))})]})},qd=`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
|
+
`,Ar={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Xd={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Fill Text",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Fill Caption",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...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"}},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"}}},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"}]}]}]}},Yd={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:Xd,sourceCode:qd,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Jd(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 Zd=3e3,Qd=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=L.useScopedStyles(),s=t||[],{speed:d,align:l,width:p,imageMarginTop:u,textMarginTop:C,captionMarginTop:v,imageWidth:y,imageHeight:m,controlsWidth:h,controlsColor:w,controlsHoverColor:$}=e,S=d>0&&(!n||!!i),[b,H]=c.useState(0),[I,B]=c.useState(null),[x,E]=c.useState(!1),V=c.useRef(null),g=c.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),T=c.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]);c.useEffect(()=>{H(0),B(null),E(!1)},[s.length]);const P=s[b],W=I===null?null:s[I],K=re=>{var U,Z,ae,pe,ye;return{fontSettings:{fontFamily:(e==null?void 0:e[`${re}FontFamily`])??"Arial",fontWeight:((U=e==null?void 0:e[`${re}FontSettings`])==null?void 0:U.fontWeight)??400,fontStyle:((Z=e==null?void 0:e[`${re}FontSettings`])==null?void 0:Z.fontStyle)??"normal"},textAppearance:{textTransform:((ae=e==null?void 0:e[`${re}TextAppearance`])==null?void 0:ae.textTransform)??"none",textDecoration:((pe=e==null?void 0:e[`${re}TextAppearance`])==null?void 0:pe.textDecoration)??"none",fontVariant:((ye=e==null?void 0:e[`${re}TextAppearance`])==null?void 0:ye.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"}},oe=K("text"),F=K("caption"),R=s.length>1&&s.some(re=>{var ue,U;return(((ue=re.text)==null?void 0:ue.length)??0)>0||(((U=re.caption)==null?void 0:U.length)??0)>0}),D=c.useRef(null),[O,N]=c.useState(0),[_,q]=c.useState(0),ie=e.controls??{mode:"Off",icon:null},k=s.length>1,G=c.useCallback((re,ue)=>!k||ue===re?re:(V.current&&window.clearTimeout(V.current),B(re),E(!0),V.current=window.setTimeout(()=>{B(null),E(!1),V.current=null},300),ue),[k]),f=c.useCallback(()=>{k&&H(re=>G(re,(re-1+s.length)%s.length))},[k,G,s.length]),ee=c.useCallback(()=>{k&&H(re=>G(re,(re+1)%s.length))},[k,G,s.length]);c.useEffect(()=>{if(!S||!k)return;const re=Math.max(300,Zd/d),ue=window.setInterval(()=>{H(U=>G(U,(U+1)%s.length))},re);return()=>{window.clearInterval(ue)}},[S,k,G,s.length,d]),c.useEffect(()=>()=>{V.current&&window.clearTimeout(V.current)},[]);const ve=(re,ue)=>{var ye,We,Ce,Fe;const U=ue==null?void 0:ue.textMinHeightPx,Z=ue==null?void 0:ue.captionMinHeightPx,ae=ue==null?void 0:ue.dataMeasureAttrs,pe=o&&!(ue!=null&&ue.dataMeasureAttrs)&&!(ue!=null&&ue.hideControls);return a.jsxs(a.Fragment,{children:[re.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:g,width:"100%"},children:[a.jsx("div",{"data-controls":pe?"textMarginTop":void 0,className:pe?`${r}-control`:void 0,style:{height:L.scalingValue(C??0,n??!1)}}),a.jsx("div",{...ae&&{"data-testimonial-measure":"text"},style:{...ft(oe,n),...U&&U>0?{minHeight:U}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Jn,{content:re.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:g,width:"100%"},children:[a.jsx("div",{"data-controls":pe?"imageMarginTop":void 0,className:pe?`${r}-control`:void 0,style:{height:L.scalingValue(u??0,n??!1)}}),a.jsx("div",{style:{width:L.scalingValue(y??0,n??!1),height:L.scalingValue(m??0,n??!1)},children:((ye=re.image)==null?void 0:ye.url)&&a.jsx("img",{src:(We=re.image)==null?void 0:We.url,alt:((Ce=re.image)==null?void 0:Ce.name)??"",className:`${r}-icon`,style:{objectFit:((Fe=re.image)==null?void 0:Fe.objectFit)||"contain"}})})]}),re.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:g,width:"100%"},children:[a.jsx("div",{"data-controls":pe?"captionMarginTop":void 0,className:pe?`${r}-control`:void 0,style:{height:L.scalingValue(v??0,n??!1)}}),a.jsx("div",{...ae?{"data-testimonial-measure":"caption"}:{},style:{...ft(F,n),...Z&&Z>0?{minHeight:Z}:{},textAlign:T,pointerEvents:"auto"},children:a.jsx(Jn,{content:re.caption})})]})]})},he=c.useCallback(re=>{N(re.maxTextPx),q(re.maxCaptionPx)},[]);if(c.useLayoutEffect(()=>{if(!R){he({maxTextPx:0,maxCaptionPx:0});return}const re=D.current;if(!re)return;const ue=()=>{L.readTestimonialTextMeasure(re,he)};ue();const U=new ResizeObserver(ue);return U.observe(re),()=>{U.disconnect()}},[R,he,t]),!P)return a.jsx(a.Fragment,{});const Se=R?{textMinHeightPx:O,captionMinHeightPx:_}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Jd(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:L.scalingValue(p??0,n??!1),alignItems:g},children:[R&&a.jsx("div",{ref:D,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((re,ue)=>a.jsx("div",{style:{width:"100%"},children:ve(re,{dataMeasureAttrs:!0})},ue))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[W&&x&&a.jsx("div",{className:je(`${r}-fade-item-prev`,`${r}-fade-out`),children:ve(W,{...Se,hideControls:!0})}),a.jsx("div",{className:je(`${r}-fade-item-current`,x?`${r}-fade-in`:void 0),children:ve(P,Se)})]})]}),ie.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:L.scalingValue(h??.02,n??!1),height:L.scalingValue(h??.02,n??!1),"--arrow-hover-color":$},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:f,disabled:!k,"aria-label":"Previous testimonial",children:ie.icon&&a.jsx(Ht,{url:ie.icon,fill:w,hoverFill:$,className:je(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:je(`${r}-arrow`,`${r}-next-arrow`),style:{width:L.scalingValue(h??.02,n??!1),height:L.scalingValue(h??.02,n??!1),"--arrow-hover-color":$},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:ee,disabled:!k,"aria-label":"Next testimonial",children:ie.icon&&a.jsx(Ht,{url:ie.icon,fill:w,hoverFill:$,className:`${r}-arrow-img`})})})]})]})})},eu=`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
|
+
`,tu="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" d="M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),Pr={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},nu={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Fill Controls",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Hover Controls",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Pr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Fill Caption"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Pr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Fill Text"}},defaults:{controls:{mode:"On",icon:tu},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"}]}]}]}},iu={element:Qd,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:nu,sourceCode:eu,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function ou(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Mr(e){return((e==null?void 0:e.trim().length)??0)>0}function ao(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function so(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:L.scalingValue((o-t)/2,i)}}function ru(e){return`
|
|
3646
3646
|
.${e}-wrapper {
|
|
3647
3647
|
display: grid;
|
|
3648
3648
|
align-items: start;
|
|
3649
|
-
min-height: ${
|
|
3649
|
+
min-height: ${ou(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 jt=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",$=c.useRef(null),b=c.useRef(null),[y,m]=c.useState(null),[h,T]=c.useState(i?"opening":"open"),[L,x]=c.useState(!0),S=c.useRef(t),O=c.useCallback(()=>{const g=$.current,C=b.current;if(!g||!C)return;const A=g.getBoundingClientRect(),H=A.width,V=A.height,Q=C.naturalWidth,k=C.naturalHeight;if(!H||!V||!Q||!k)return;if(n==="cover"){m({width:H,height:V,left:A.left,top:A.top});return}const _=Q/k,E=H/V;if(_>E){const M=H/_;m({width:H,height:M,left:A.left,top:A.top+(V-M)/2})}else{const M=V*_;m({width:M,height:V,left:A.left+(H-M)/2,top:A.top})}},[n]);c.useEffect(()=>{O();const g=$.current;if(!g)return;const C=new ResizeObserver(()=>O());return C.observe(g),()=>C.disconnect()},[O,t]),c.useEffect(()=>{h==="opening"&&y&&T("open")},[h,y]),c.useEffect(()=>{if(h!=="closing")return;const g=setTimeout(()=>a(),jt);return()=>clearTimeout(g)},[h,a]),c.useEffect(()=>{S.current!==t&&x(!1),S.current=t},[t]),c.useEffect(()=>{const g=C=>{C.key==="Escape"&&(C.preventDefault(),C.stopPropagation(),h!=="closing"&&T("closing"))};return window.addEventListener("keydown",g,!0),()=>window.removeEventListener("keydown",g,!0)},[h]);const R=()=>{h!=="closing"&&T("closing")},B=h==="open",w=h==="closing",P=w&&o&&!!i,j=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 ${jt}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:$,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:B?1:0,transition:`opacity ${jt}ms ${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:$,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:B?1:0,transition:`opacity ${jt}ms ${Qt}`},children:e.length>1&&r.jsxs("p",{className:s,style:p,children:[t+1," / ",e.length]})})]})}),j&&r.jsx("img",{ref:b,src:e[t],onLoad:O,style:{position:"fixed",top:j.top,left:j.left,width:j.width,height:j.height,objectFit:n==="cover"?"cover":"contain",opacity:w&&!P?0:1,transition:w&&!P?`opacity ${jt}ms ${Qt}`:P||L?`top ${jt}ms ${Qt}, left ${jt}ms ${Qt}, width ${jt}ms ${Qt}, height ${jt}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}=I.useScopedStyles(),{type:p="a",gridLayout:u,textBoxWidth:$=100,verticalGap:b,entriesCount:y,lightbox:m,imageDisplay:h,lightboxImageDisplay:T,slider:L,sliderTiming:x,direction:S,transition:O,titleMarginTop:R,subtitleMarginTop:B,titleColor:w,subtitleColor:P,lightboxCounterColor:j,titleFontFamily:g,titleFontSettings:C,titleFontSize:A,titleLineHeight:H,titleLetterSpacing:V,titleWordSpacing:Q,titleTextAppearance:k,subtitleFontFamily:_,subtitleFontSettings:E,subtitleFontSize:M,subtitleLineHeight:W,subtitleLetterSpacing:z,subtitleWordSpacing:K,subtitleTextAppearance:ie,lightboxCounterFontFamily:F,lightboxCounterFontSettings:J,lightboxCounterFontSize:f,lightboxCounterLineHeight:ne,lightboxCounterLetterSpacing:xe,lightboxCounterWordSpacing:pe,lightboxCounterTextAppearance:ve,showText:se="always",alignEntries:fe="off"}=e,G={fontSettings:{fontFamily:g,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:A??.01,lineHeight:H,letterSpacing:V??0,wordSpacing:Q??0,textAppearance:k,color:w},le={...Ft(pt(G,n))},oe={fontSettings:{fontFamily:_,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:M??.01,lineHeight:W,letterSpacing:z??0,wordSpacing:K??0,textAppearance:ie,color:P},$e={...Ft(pt(oe,n))},_e={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:xe??0,wordSpacing:pe??0,textAppearance:ve,color:j},Ie={...Ft(pt(_e,n)),...ao(f,ne,s,n)},D=ro(A,H,`${s}-item-title`,`${s}-text-tight-leading`),ue=ro(M,W,`${s}-item-subtitle`,`${s}-text-tight-leading`),N=ao(A,H,s,n),X=ao(M,W,s,n),U=ro(f,ne,`${s}-lightbox-counter`,`${s}-text-tight-leading`),te=I.buildColorVars(s,{titleColor:w,subtitleColor:P,lightboxCounterColor:j},cu,du),Ne=`${l&&l!=="default"?`${s}-state-${l}`:""}${se==="on hover"&&(!n||i)?` ${s}-show-text-hover`:""}`.trim(),Te=y===0?1/0:y,Ce=(t??[]).slice(0,Te),Be=u.entryWidth??.2,re=(h==null?void 0:h.display)==="cover",Pe=(h==null?void 0:h.ratioValue)??"1:1",Me=(h==null?void 0:h.reversed)??!1,[ke,ze]=Pe.split(":").map(Number),ft=`${Me?ze:ke} / ${Me?ke:ze}`,Ct=I.scalingValue(Be??0,n),At=!re&&L!=="off",dt={width:Ct,...re?{aspectRatio:ft,height:"auto",overflow:"hidden"}:{height:"auto"}},ut=`${s}-item-image-wrapper${At?` ${s}-item-image-wrapper-fit-slider`:""}`.trim(),Re=p==="c",Ze=Re&&fe==="on",Xe=`calc(${I.scalingValue(Be??0,n)} * (${$} / 100))`,at=I.scalingValue(Be*$/100,n),Ye=re?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[It,yt]=c.useState("ltr"),[vt,wt]=c.useState(0),Ee=c.useRef(null);c.useEffect(()=>{const me=Ee.current;if(!me)return;const Fe=new ResizeObserver(De=>{wt(Math.round(De[0].contentRect.width))});return Fe.observe(me),()=>Fe.disconnect()},[]);const et=(()=>{const me={...te},Fe=Ee.current?getComputedStyle(Ee.current).getPropertyValue("--cntrl-article-width").trim():"";return Fe&&(me["--cntrl-article-width"]=Fe),me})(),[Je,Ve]=c.useState(!1),[tt,Dt]=c.useState([]),[Zt,ae]=c.useState(0),[v,q]=c.useState(null),Z=(me,Fe,De)=>{if(n&&!i||m==="off")return;const Y=me.currentTarget.getBoundingClientRect();q({top:Y.top,left:Y.left,width:Y.width,height:Y.height}),Dt(Fe),ae(De),Ve(!0)};c.useEffect(()=>{if(!Je||m!=="on"||typeof document>"u")return;const me=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=me}},[Je,m]),c.useEffect(()=>{!n||i||(Ve(!1),q(null))},[n,i]);const ge=c.useMemo(()=>ou(s),[s]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ge}}),r.jsx("div",{style:te,children:r.jsx("div",{ref:Ee,className:`${s}-wrapper ${s}-type-${p}${Ze?` ${s}-align-entries`:""} ${Ne}`.trim(),style:{gridTemplateColumns:`repeat(${u.columnsCount}, minmax(0, 1fr))`,rowGap:Ze?0:I.scalingValue(b??0,n),columnGap:I.scalingValue(u.horizontalGap??0,n),width:I.scalingValue(u.wrapperWidth??0,n),...Ze?{[`--${s}-align-entries-row-gap`]:I.scalingValue(b??0,n)}:{}},children:Ce.map((me,Fe)=>{var lt,Lt;const De=Mr(me.title),Y=Mr(me.subtitle),he=(((lt=me.link)==null?void 0:lt.length)??0)>0&&m==="off"?me.link:void 0,we=Math.floor(Fe/u.columnsCount)===Math.ceil(Ce.length/u.columnsCount)-1,We=Re?r.jsxs("div",{className:`${s}-item-text-block`,children:[De&&r.jsx("p",{className:D,style:{width:Xe,...le,...N},children:me.title}),De&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:I.scalingValue(R??0,n),width:at}}),Y&&r.jsx("p",{className:ue,style:{width:Xe,...$e,...X},children:me.subtitle}),Y&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:I.scalingValue(B??0,n),width:at}})]}):null,ot=Re?r.jsxs("div",{className:`${s}-item-title-row`,children:[De&&r.jsx("p",{className:D,style:{width:Xe,...le,...N},children:me.title}),De&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:I.scalingValue(R??0,n),width:at}})]}):null,st=Re?r.jsxs("div",{className:`${s}-item-subtitle-row`,children:[Y&&r.jsx("p",{className:ue,style:{width:Xe,...$e,...X},children:me.subtitle}),Y&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:I.scalingValue(B??0,n),width:at}})]}):null,He=he?r.jsxs("a",{href:he,target:"_blank",className:`${s}-item-text-link`,children:[ot,st]}):r.jsxs(r.Fragment,{children:[ot,st]}),$t=r.jsx("div",{className:ut,style:dt,children:(((Lt=me.image)==null?void 0:Lt.length)??0)===0?null:L==="off"?(()=>{const Ke=me.image[0],xt=me.image.filter(gt=>!en(gt)).map(gt=>gt.url);return r.jsx(kr,{media:Ke,className:`${s}-item-${en(Ke)?"video":"image"}`.trim(),style:Ye,onImageClick:en(Ke)?void 0:gt=>Z(gt,xt,0)})})():r.jsxs(r.Fragment,{children:[At&&r.jsx("div",{className:`${s}-item-image-wrapper-sizer`,"aria-hidden":"true",children:me.image.map(Ke=>en(Ke)?r.jsx("video",{src:Ke.url,muted:!0,playsInline:!0},`sizer-${Ke.url}`):r.jsx("img",{src:Ke.url,alt:""},`sizer-${Ke.url}`))}),r.jsx(Yo,{className:`${s}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:x*1e3,width:"100%",height:"100%",speed:ru,type:O==="fade"?"fade":"loop",rewind:O==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:O==="fade"?"ltr":S!=="random"?S==="horizontal"?"ltr":"ttb":It},onMoved:Ke=>{if(S!=="random"||O==="fade")return;const bt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";yt(bt),setTimeout(()=>{Ke.refresh()},0)},children:me.image.map((Ke,bt)=>{const xt=me.image.filter(ct=>!en(ct)),gt=xt.map(ct=>ct.url),vn=xt.findIndex(ct=>ct.url===Ke.url);return r.jsx(Jo,{children:r.jsx(kr,{media:Ke,className:`${s}-item-${en(Ke)?"video":"image"}`.trim(),style:Ye,onImageClick:en(Ke)?void 0:ct=>Z(ct,gt,vn)})},bt)})},`${O}-${Be}-${S}-${x}-${vt}-${d}`)]})}),Tt=Re?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&De?"titleMarginTop":void 0,className:o&&De?`${s}-control`:void 0,style:{height:De?I.scalingValue(R??0,n):0,width:at}}),r.jsx("p",{className:D,style:{width:Xe,...le,...N},children:me.title}),r.jsx("div",{"data-controls":o&&Y?"subtitleMarginTop":void 0,className:o&&Y?`${s}-control`:void 0,style:{height:Y?I.scalingValue(B??0,n):0,width:at}}),r.jsx("p",{className:ue,style:{width:Xe,...$e,...X},children:me.subtitle})]});return r.jsx("div",{className:`${s}-item`.trim(),children:r.jsx("div",{className:`${o?`${s}-item-inner`:`${s}-item-inner-hidden`}${Ze&&we?` ${s}-item-inner-last-row`:""}`.trim(),style:{width:($??0)>100?`calc(${I.scalingValue(Be??0,n)} * (${$} / 100))`:I.scalingValue(Be??0,n)},children:Ze?r.jsxs(r.Fragment,{children:[He,r.jsx("a",{href:he,target:"_blank",className:`${s}-item-image-link`,children:$t})]}):r.jsxs("a",{href:he,target:"_blank",className:`${s}-item-image-link`,children:[We,$t,Tt]})})},Fe)})})}),(!n||i)&&Je&&typeof document<"u"&&m==="on"&&ei.createPortal(r.jsx("div",{style:et,"data-selection":"none",children:r.jsx(au,{images:tt,index:Zt,imageDisplay:su(T),originRect:v,reverseClose:L==="off",onClose:()=>Ve(!1),onPrev:()=>ae(me=>(me-1+tt.length)%tt.length),onNext:()=>ae(me=>(me+1)%tt.length),counterClassName:U,counterStyle:Ie})}),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';
|
|
3848
|
+
`}const jt=500,au=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)?a.jsx("video",{src:e.url,className:t,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0}):a.jsx("img",{src:e.url,alt:e.name,className:t,style:n,onClick:i})}function su({images:e,index:t,imageDisplay:n,originRect:i,reverseClose:o,onClose:r,onPrev:s,onNext:d,counterClassName:l,counterStyle:p}){const u=n==="cover",C=c.useRef(null),v=c.useRef(null),[y,m]=c.useState(null),[h,w]=c.useState(i?"opening":"open"),[$,S]=c.useState(!0),b=c.useRef(t),H=c.useCallback(()=>{const g=C.current,T=v.current;if(!g||!T)return;const P=g.getBoundingClientRect(),W=P.width,K=P.height,oe=T.naturalWidth,F=T.naturalHeight;if(!W||!K||!oe||!F)return;if(n==="cover"){m({width:W,height:K,left:P.left,top:P.top});return}const R=oe/F,D=W/K;if(R>D){const O=W/R;m({width:W,height:O,left:P.left,top:P.top+(K-O)/2})}else{const O=K*R;m({width:O,height:K,left:P.left+(W-O)/2,top:P.top})}},[n]);c.useEffect(()=>{H();const g=C.current;if(!g)return;const T=new ResizeObserver(()=>H());return T.observe(g),()=>T.disconnect()},[H,t]),c.useEffect(()=>{h==="opening"&&y&&w("open")},[h,y]),c.useEffect(()=>{if(h!=="closing")return;const g=setTimeout(()=>r(),jt);return()=>clearTimeout(g)},[h,r]),c.useEffect(()=>{b.current!==t&&S(!1),b.current=t},[t]),c.useEffect(()=>{const g=T=>{T.key==="Escape"&&(T.preventDefault(),T.stopPropagation(),h!=="closing"&&w("closing"))};return window.addEventListener("keydown",g,!0),()=>window.removeEventListener("keydown",g,!0)},[h]);const I=()=>{h!=="closing"&&w("closing")},B=h==="open",x=h==="closing",E=x&&o&&!!i,V=h==="opening"?i??y:E?i:y;return a.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:I,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:B?1:0,transition:`opacity ${jt}ms ${Qt}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:u?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:C,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:B?1:0,transition:`opacity ${jt}ms ${Qt}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&a.jsxs("p",{className:l,style:p,children:[t+1," / ",e.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:C,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:B?1:0,transition:`opacity ${jt}ms ${Qt}`},children:e.length>1&&a.jsxs("p",{className:l,style:p,children:[t+1," / ",e.length]})})]})}),V&&a.jsx("img",{ref:v,src:e[t],onLoad:H,style:{position:"fixed",top:V.top,left:V.left,width:V.width,height:V.height,objectFit:n==="cover"?"cover":"contain",opacity:x&&!E?0:1,transition:x&&!E?`opacity ${jt}ms ${Qt}`:E||$?`top ${jt}ms ${Qt}, left ${jt}ms ${Qt}, width ${jt}ms ${Qt}, height ${jt}ms ${Qt}`:"none",pointerEvents:"none",zIndex:9998}}),B&&y&&a.jsxs(a.Fragment,{children:[a.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(),s()}}),a.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 lu(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function cu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:s,layoutId:d}){const{prefix:l}=L.useScopedStyles(),{type:p="a",gridLayout:u,textBoxWidth:C=100,verticalGap:v,entriesCount:y,lightbox:m,imageDisplay:h,lightboxImageDisplay:w,slider:$,sliderTiming:S,direction:b,transition:H,titleMarginTop:I,subtitleMarginTop:B,titleColor:x,subtitleColor:E,lightboxCounterColor:V,titleFontFamily:g,titleFontSettings:T,titleFontSize:P,titleLineHeight:W,titleLetterSpacing:K,titleWordSpacing:oe,titleTextAppearance:F,subtitleFontFamily:R,subtitleFontSettings:D,subtitleFontSize:O,subtitleLineHeight:N,subtitleLetterSpacing:_,subtitleWordSpacing:q,subtitleTextAppearance:ie,lightboxCounterFontFamily:k,lightboxCounterFontSettings:G,lightboxCounterFontSize:f,lightboxCounterLineHeight:ee,lightboxCounterLetterSpacing:ve,lightboxCounterWordSpacing:he,lightboxCounterTextAppearance:Se,showText:re="always",alignEntries:ue="off"}=e,U={fontSettings:{fontFamily:g,fontWeight:(T==null?void 0:T.fontWeight)??400,fontStyle:(T==null?void 0:T.fontStyle)??"normal"},fontSize:P??.01,lineHeight:W,letterSpacing:K??0,wordSpacing:oe??0,textAppearance:F,color:x},ae={...Nt(ft(U,n))},pe={fontSettings:{fontFamily:R,fontWeight:(D==null?void 0:D.fontWeight)??400,fontStyle:(D==null?void 0:D.fontStyle)??"normal"},fontSize:O??.01,lineHeight:N,letterSpacing:_??0,wordSpacing:q??0,textAppearance:ie,color:E},We={...Nt(ft(pe,n))},Ce={fontSettings:{fontFamily:k,fontWeight:(G==null?void 0:G.fontWeight)??400,fontStyle:(G==null?void 0:G.fontStyle)??"normal"},fontSize:f??.01,lineHeight:ee,letterSpacing:ve??0,wordSpacing:he??0,textAppearance:Se,color:V},Ie={...Nt(ft(Ce,n)),...so(f,ee,l,n)},z=ao(P,W,`${l}-item-title`,`${l}-text-tight-leading`),le=ao(O,N,`${l}-item-subtitle`,`${l}-text-tight-leading`),M=so(P,W,l,n),X=so(O,N,l,n),Y=ao(f,ee,`${l}-lightbox-counter`,`${l}-text-tight-leading`),ne=L.buildColorVars(l,{titleColor:x,subtitleColor:E,lightboxCounterColor:V},du,uu),Oe=`${s&&s!=="default"?`${l}-state-${s}`:""}${re==="on hover"&&(!n||i)?` ${l}-show-text-hover`:""}`.trim(),$e=y===0?1/0:y,be=(t??[]).slice(0,$e),He=u.entryWidth??.2,ge=(h==null?void 0:h.display)==="cover",Le=(h==null?void 0:h.ratioValue)??"1:1",Ne=(h==null?void 0:h.reversed)??!1,[Me,Ve]=Le.split(":").map(Number),st=`${Ne?Ve:Me} / ${Ne?Me:Ve}`,bt=L.scalingValue(He??0,n),Rt=!ge&&$!=="off",xt={width:bt,...ge?{aspectRatio:st,height:"auto",overflow:"hidden"}:{height:"auto"}},At=`${l}-item-image-wrapper${Rt?` ${l}-item-image-wrapper-fit-slider`:""}`.trim(),Ae=p==="c",ot=Ae&&ue==="on",qe=`calc(${L.scalingValue(He??0,n)} * (${C} / 100))`,Qe=L.scalingValue(He*C/100,n),wt=ge?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[Pt,yt]=c.useState("ltr"),[rt,$t]=c.useState(0),_e=c.useRef(null);c.useEffect(()=>{const Q=_e.current;if(!Q)return;const Te=new ResizeObserver(Pe=>{$t(Math.round(Pe[0].contentRect.width))});return Te.observe(Q),()=>Te.disconnect()},[]);const nt=(()=>{const Q={...ne},Te=_e.current?getComputedStyle(_e.current).getPropertyValue("--cntrl-article-width").trim():"";return Te&&(Q["--cntrl-article-width"]=Te),Q})(),[Ue,Ge]=c.useState(!1),[it,Ft]=c.useState([]),[St,lt]=c.useState(0),[Zt,Tt]=c.useState(null),j=(Q,Te,Pe)=>{if(n&&!i||m==="off")return;const J=Q.currentTarget.getBoundingClientRect();Tt({top:J.top,left:J.left,width:J.width,height:J.height}),Ft(Te),lt(Pe),Ge(!0)};c.useEffect(()=>{if(!Ue||m!=="on"||typeof document>"u")return;const Q=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Q}},[Ue,m]),c.useEffect(()=>{!n||i||(Ge(!1),Tt(null))},[n,i]);const se=c.useMemo(()=>ru(l),[l]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:se}}),a.jsx("div",{style:ne,children:a.jsx("div",{ref:_e,className:`${l}-wrapper ${l}-type-${p}${ot?` ${l}-align-entries`:""} ${Oe}`.trim(),style:{gridTemplateColumns:`repeat(${u.columnsCount}, minmax(0, 1fr))`,rowGap:ot?0:L.scalingValue(v??0,n),columnGap:L.scalingValue(u.horizontalGap??0,n),width:L.scalingValue(u.wrapperWidth??0,n),...ot?{[`--${l}-align-entries-row-gap`]:L.scalingValue(v??0,n)}:{}},children:be.map((Q,Te)=>{var ze,ut;const Pe=Mr(Q.title),J=Mr(Q.subtitle),fe=(((ze=Q.link)==null?void 0:ze.length)??0)>0&&m==="off"?Q.link:void 0,A=Math.floor(Te/u.columnsCount)===Math.ceil(be.length/u.columnsCount)-1,te=Ae?a.jsxs("div",{className:`${l}-item-text-block`,children:[Pe&&a.jsx("p",{className:z,style:{width:qe,...ae,...M},children:Q.title}),Pe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${l}-control`:void 0,style:{height:L.scalingValue(I??0,n),width:Qe}}),J&&a.jsx("p",{className:le,style:{width:qe,...We,...X},children:Q.subtitle}),J&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${l}-control`:void 0,style:{height:L.scalingValue(B??0,n),width:Qe}})]}):null,Re=Ae?a.jsxs("div",{className:`${l}-item-title-row`,children:[Pe&&a.jsx("p",{className:z,style:{width:qe,...ae,...M},children:Q.title}),Pe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${l}-control`:void 0,style:{height:L.scalingValue(I??0,n),width:Qe}})]}):null,Ee=Ae?a.jsxs("div",{className:`${l}-item-subtitle-row`,children:[J&&a.jsx("p",{className:le,style:{width:qe,...We,...X},children:Q.subtitle}),J&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${l}-control`:void 0,style:{height:L.scalingValue(B??0,n),width:Qe}})]}):null,de=fe?a.jsxs("a",{href:fe,target:"_blank",className:`${l}-item-text-link`,children:[Re,Ee]}):a.jsxs(a.Fragment,{children:[Re,Ee]}),Ke=a.jsx("div",{className:At,style:xt,children:(((ut=Q.image)==null?void 0:ut.length)??0)===0?null:$==="off"?(()=>{const Be=Q.image[0],ht=Q.image.filter(mt=>!en(mt)).map(mt=>mt.url);return a.jsx(kr,{media:Be,className:`${l}-item-${en(Be)?"video":"image"}`.trim(),style:wt,onImageClick:en(Be)?void 0:mt=>j(mt,ht,0)})})():a.jsxs(a.Fragment,{children:[Rt&&a.jsx("div",{className:`${l}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Q.image.map(Be=>en(Be)?a.jsx("video",{src:Be.url,muted:!0,playsInline:!0},`sizer-${Be.url}`):a.jsx("img",{src:Be.url,alt:""},`sizer-${Be.url}`))}),a.jsx(Yo,{className:`${l}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:S*1e3,width:"100%",height:"100%",speed:au,type:H==="fade"?"fade":"loop",rewind:H==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:H==="fade"?"ltr":b!=="random"?b==="horizontal"?"ltr":"ttb":Pt},onMoved:Be=>{if(b!=="random"||H==="fade")return;const pt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";yt(pt),setTimeout(()=>{Be.refresh()},0)},children:Q.image.map((Be,pt)=>{const ht=Q.image.filter(gt=>!en(gt)),mt=ht.map(gt=>gt.url),vn=ht.findIndex(gt=>gt.url===Be.url);return a.jsx(Jo,{children:a.jsx(kr,{media:Be,className:`${l}-item-${en(Be)?"video":"image"}`.trim(),style:wt,onImageClick:en(Be)?void 0:gt=>j(gt,mt,vn)})},pt)})},`${H}-${He}-${b}-${S}-${rt}-${d}`)]})}),Xe=Ae?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Pe?"titleMarginTop":void 0,className:o&&Pe?`${l}-control`:void 0,style:{height:Pe?L.scalingValue(I??0,n):0,width:Qe}}),a.jsx("p",{className:z,style:{width:qe,...ae,...M},children:Q.title}),a.jsx("div",{"data-controls":o&&J?"subtitleMarginTop":void 0,className:o&&J?`${l}-control`:void 0,style:{height:J?L.scalingValue(B??0,n):0,width:Qe}}),a.jsx("p",{className:le,style:{width:qe,...We,...X},children:Q.subtitle})]});return a.jsx("div",{className:`${l}-item`.trim(),children:a.jsx("div",{className:`${o?`${l}-item-inner`:`${l}-item-inner-hidden`}${ot&&A?` ${l}-item-inner-last-row`:""}`.trim(),style:{width:(C??0)>100?`calc(${L.scalingValue(He??0,n)} * (${C} / 100))`:L.scalingValue(He??0,n)},children:ot?a.jsxs(a.Fragment,{children:[de,a.jsx("a",{href:fe,target:"_blank",className:`${l}-item-image-link`,children:Ke})]}):a.jsxs("a",{href:fe,target:"_blank",className:`${l}-item-image-link`,children:[te,Ke,Xe]})})},Te)})})}),(!n||i)&&Ue&&typeof document<"u"&&m==="on"&&ti.createPortal(a.jsx("div",{style:nt,"data-selection":"none",children:a.jsx(su,{images:it,index:St,imageDisplay:lu(w),originRect:Zt,reverseClose:$==="off",onClose:()=>Ge(!1),onPrev:()=>lt(Q=>(Q-1+it.length)%it.length),onNext:()=>lt(Q=>(Q+1)%it.length),counterClassName:Y,counterStyle:Ie})}),document.body)]})}const du={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},uu=["hover","focus","filled","success","error"],pu=`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
|
-
`,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=I.scalingValue(a,l),s=I.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=I.scalingValue(t,n),o=I.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Hr=10;function bu(e){return`
|
|
5017
|
+
`,lo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},mu=["titleColor","subtitleColor","lightboxCounterColor"],gu={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:[...mu],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},hu={element:cu,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:gu,sourceCode:pu};function fu(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 yu({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 r=o.play();r&&r.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Li(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function vu(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,r,s){const d=L.scalingValue(r,s),l=L.scalingValue(0,s),p=e===0,u=e===t-1&&!o;return{borderTopWidth:p&&n?d:l,borderBottomWidth:!u||i?d:l}}function bu(e,t,n){const i=L.scalingValue(t,n),o=L.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Hr=10;function xu(e){return`
|
|
5018
5018
|
.${e}-wrapper {
|
|
5019
5019
|
display: grid;
|
|
5020
5020
|
align-items: start;
|
|
5021
|
-
min-height: ${
|
|
5021
|
+
min-height: ${Li(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: ${Li(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: ${Li(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 rn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Zo=["AColumn","BColumn","CColumn","DColumn","EColumn"],qt="cutLabel",Qo=[...Zo,qt],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 Iu(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 Eu(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=Eu(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 Oe(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[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 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=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 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 Ft(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`]:I.scalingValue((a-l)/2,i)}}const Rt=["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 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: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(Rt.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(Rt.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=Rt.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 $=Math.min(s,u);d[p]-=$,s-=$}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=Rt[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,Rt.length),a={};for(let l=0;l<o;l+=1){const d=e[l],s=t.indexOf(d);if(s===-1)continue;const p=Rt[s],u=Pn[s],$=An[s],b=Mn[s],y=Rt[l],m=Pn[l],h=An[l],T=Mn[l],L=n[p],x=n[u],S=n[$],O=n[b];typeof L=="number"&&(a[y]=L),typeof x=="number"&&(a[m]=x),typeof S=="number"&&(a[h]=S),typeof O=="number"&&(a[T]=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,$=S=>{if(p)return S;const O=yi({...t,...S}),R=Dn(S),B=Li(u,R,O),w=ju(u,B,{...t,...S});return Object.keys(w).length===0?S:{...S,...w}};if(typeof a=="number"&&a!==l)return e;const b=Kr(e),y=Kr(t);if(!Vu(b,y))return $({...e,...Ku(b,y,t,u)});if(d<s&&typeof u=="number"&&!p){const S=yi({...t,...e});return $({...e,...zu(u,d,S)})}if(p){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,O=Math.max(0,(d-o)/2);return S>O?{...e,textPaddingLR:O}:e}const m=yi({...t,...e}),h=Li(u,s,yi(t)),L=Li(u,d,m).some((S,O)=>S<(h[O]??S)),x=Rt.some(S=>{const O=e[S],R=t[S];return typeof O=="number"&&typeof R=="number"&&O!==R});return L||x?$(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(Rt.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:Rt[d],width:n[Rt[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}=I.useScopedStyles(),p=!!o,{columns:u,type:$,wrapperWidth:b,entriesCount:y,cellMinHeight:m,dividerWidth:h,showVisibility:T,cut:L,showCut:x,cutCellMinHeight:S,cutLabel:O,imageSize:R,imageOnHover:B,entryHoverEffect:w,entryHoverShowOption:P,rowPaddingTop:j,rowPaddingBottom:g,rowPaddingTopB:C,columnsOrder:A,textPaddingLR:H,textColor:V,backgroundColor:Q,dividerColor:k,textHoverColor:_,backgroundHoverColor:E,dividerHoverColor:M}=e,[W,z]=c.useState(void 0),[K,ie]=c.useState(null),F=B==="on"&&(!n||i),J=(L??0)>0,f=$==="b",ne=c.useRef(null),xe=c.useRef(null),[pe,ve]=c.useState(null),[se,fe]=c.useState(Zn),G=qa(se),ee=Math.max(0,((b??0)-G)/2),le=Math.min(H??0,ee),oe=Math.max(le,$n),Le=((b??0)+G)/2;c.useLayoutEffect(()=>{if(!n){fe(Zn);return}const Y=()=>{fe(Hu(ne.current))};Y();const he=ne.current;if(!he)return;const we=new ResizeObserver(Y);we.observe(he);let We=he;for(;We&&!We.style.getPropertyValue("--cntrl-article-width");)We=We.parentElement;return We&&we.observe(We),()=>we.disconnect()},[n,l]),c.useEffect(()=>{z(void 0)},[L,x,t,y]),c.useEffect(()=>{n&&!i&&z(void 0)},[n,i]);const $e=I.buildColorVars(s,{textColor:V,backgroundColor:Q,dividerColor:k,textHoverColor:_,backgroundHoverColor:E,dividerHoverColor:M},Wu,Fu),_e=a&&a!=="default"?`${s}-state-${a}`:"",Ie=`${!n||i?w==="default"?`${s}-entry-hover-default`:w==="blinds"?`${s}-entry-hover-blinds`:w==="reveal"?`${s}-entry-hover-reveal`:"":""} ${_e}`.trim(),D=w==="reveal"&&(!n||i),ue=(T==null?void 0:T[0])??!1,N=(T==null?void 0:T[1])??!1,X=c.useRef(e),U=c.useRef(l);c.useEffect(()=>{if(!d||!n){X.current=e,U.current=l;return}if(U.current!==l){X.current=e,U.current=l;return}const Y=X.current;if(!(Y!==e))return;if(typeof Y.columns=="number"&&typeof e.columns=="number"&&Y.columns!==e.columns){X.current=e;return}const we=Uu(e,Y,{designWidth:se});X.current=e,Ja(e,we)&&d(we)},[e,d,n,l,se]);const te=c.useMemo(()=>Yu(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),de=c.useMemo(()=>uo(e,Pn),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),ye=c.useMemo(()=>uo(e,An),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ne=c.useMemo(()=>uo(e,Mn),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Te=c.useMemo(()=>Array.isArray(A)&&A.length>0?A:[...rn],[A]),Ce=c.useMemo(()=>Ju(Te,u,te,de,ye,Ne),[Te,u,te,de,ye,Ne]),Be=Dn(e),re=c.useMemo(()=>Rt.slice(0,u).map(Y=>te[Y]),[u,te]),Pe=c.useMemo(()=>nr(u,Be,te),[u,Be,te]),Me=c.useMemo(()=>Li(u,Be,te),[u,Be,te]),ke=c.useMemo(()=>Ce.map((Y,he)=>Ya(Me[he]??0,Y.paddingLeft,Y.paddingRight)),[Ce,Me]),ze=c.useMemo(()=>{const Y=y===0?1/0:y;return(t??[]).slice(0,Y).map((we,We)=>({id:We,cells:Object.fromEntries(rn.map(ot=>[ot,we[ot]??""])),image:we.image,link:we.link}))},[t,y]),it=J?W??L:ze.length,mt=c.useMemo(()=>J?ze.slice(0,it):ze,[ze,J,it]),ft=J&&it<ze.length,Ct=mt.length>1||ft,At=[ue?`${s}-divider-top`:"",N||Ct?`${s}-divider-bottom`:""].filter(Boolean).join(" "),dt=!n||i,ut=()=>{if(!dt)return;const Y=W??L;if(!x){z(ze.length);return}z(Math.min(Y+x,ze.length))},Re=Y=>I.scalingValue(Y,n??!1),Ze=f?C??0:j??0,Xe=g??0,at=m??0,Ye=Ze+at/2,It=Math.max(Xe,co),yt=Nr(0,mt.length,ue,N,ft,h??0,n??!1).borderTopWidth,vt=pe!=null?`${pe}px`:`calc(${yt} + ${Re(Ye)})`,wt=f?"rowPaddingTopB":"rowPaddingTop",Ee=Ce[0],et=Ce[Ce.length-1],Je=ke[0],Ve=ke[ke.length-1],tt=Ee&&Je?Math.max(Je.paddingLeft,$n):0,Dt=et&&Ve?Math.max(Ve.paddingRight,$n):0,Zt=Be,ae=Y=>{const he=ne.current;if(!he)return{x:0,y:0};const we=he.getBoundingClientRect();return{x:Y.clientX-we.left+Hr,y:Y.clientY-we.top+Hr}},v=(Y,he)=>{if(!F)return;const we=Y.image;if(!(we!=null&&we.url)){ie(null);return}const{x:We,y:ot}=ae(he),st=(R==null?void 0:R.min)??80,He=(R==null?void 0:R.max)??320,$t=(K==null?void 0:K.rowId)===Y.id?K.widthPx:Xu(st,He);ie({rowId:Y.id,url:we.url,objectFit:"contain",isVideo:hu(we),widthPx:$t,x:We,y:ot})},q=Y=>{if(!F||!K)return;const{x:he,y:we}=ae(Y);ie(We=>!We||We.x===he&&We.y===we?We:{...We,x:he,y:we})},Z=()=>{ie(null)},ge=Y=>{D&&Wr(Y,s),F&&ie(null)},me=Y=>{D&&Fr(Y,s)};c.useLayoutEffect(()=>{if(!p||f){ve(null);return}const Y=xe.current,he=Y==null?void 0:Y.parentElement;if(!Y||!he){ve(null);return}const we=()=>{const ot=Y.querySelector("[data-list-row]");if(!ot){ve(null);return}const st=he.getBoundingClientRect(),He=ot.getBoundingClientRect();ve(He.top-st.top+He.height/2)};we();const We=new ResizeObserver(we);return We.observe(Y),We.observe(he),()=>We.disconnect()},[p,f,mt,Ze,Xe,at,t,e,Ce,Me,se,h,ue,N,ft]);const Fe=c.useMemo(()=>!f&&Zo.some(Y=>{const he=Y.charAt(0),we=e[`${Y}VerticalAlign`];return Ua(we,e,he)}),[f,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);c.useLayoutEffect(()=>{var $t;const Y=ne.current;if(!Y)return;const he=()=>{Y.querySelectorAll("[data-list-col]").forEach(Tt=>{Tt.style.transform="";const lt=Tt.querySelector(`.${s}-list-col`);lt&&(lt.style.minHeight="",lt.style.height="");const Lt=Tt.querySelector(`.${s}-list-col-title`);Lt&&(Lt.style.transform="")})};if(f||!Fe){he();return}const we=()=>{const Tt=Array.from(Y.querySelectorAll("[data-list-row]")),lt=`${s}-list-col`,Lt=`${s}-baseline-probe`;Tt.forEach(Ke=>{Ke.querySelectorAll("[data-list-col]").forEach(bt=>{bt.style.transform="";const xt=bt.querySelector(`.${lt}`);xt&&(xt.style.minHeight="",xt.style.height="");const gt=bt.querySelector(`.${s}-list-col-title`);gt&&(gt.style.transform="")})}),Tt.forEach(Ke=>{const bt=Array.from(Ke.querySelectorAll("[data-list-col]"));_u(Ke,bt,lt)}),Y.offsetHeight,Tt.forEach(Ke=>{const bt=Array.from(Ke.querySelectorAll("[data-list-col]")),xt=Ke.getBoundingClientRect().top,gt=new Map,vn=bt.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}),ct=new Map,ui=(nt,bn)=>{const xn=ct.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,xt,lt,Lt);return ct.set(nt.letter,sr),sr}bn.add(nt.letter);const as=ui(rr,bn);bn.delete(nt.letter);const ss=lo(nt,xt,lt,Lt),ls=as-ss;Ru(nt.titleEl,ls);const ar=lo(nt,xt,lt,Lt);return ct.set(nt.letter,ar),ar};vn.forEach(nt=>ui(nt,new Set))})};let We=null;const ot=()=>{We===null&&(We=requestAnimationFrame(()=>{We=null,we()}))};we();const st=new ResizeObserver(()=>ot());st.observe(Y);let He=!1;return typeof document<"u"&&(($t=document.fonts)!=null&&$t.ready)&&document.fonts.ready.then(()=>{He||ot()}),()=>{He=!0,We!==null&&(cancelAnimationFrame(We),We=null),st.disconnect(),he()}},[Fe,f,e,t,se,mt,Me]);const De=c.useMemo(()=>bu(s),[s]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:De}}),r.jsx("div",{style:$e,children:r.jsxs("div",{ref:ne,className:`${s}-wrapper ${Ie}${At?` ${At}`:""}${f?` ${s}-type-b`:""}`.trim(),style:{width:I.scalingValue(b??0,n),...!f&&p?{[`--${s}-first-entry-handle-top`]:vt}:{}},onMouseMove:F?q:void 0,onMouseLeave:F?Z:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[mt.map((Y,he)=>{var st;const we=(((st=Y.link)==null?void 0:st.length)??0)>0,We=we&&(!n||i)?"a":"div",ot=Nr(he,mt.length,ue,N,ft,h??0,n??!1);return r.jsxs(We,{ref:he===0?He=>{xe.current=He}:void 0,className:`${s}-list-item${we||P==="always"?` ${s}-list-item-has-link`:""}`,...we?{href:Y.link,target:"_blank"}:{},style:ot,onMouseEnter:He=>{D&&(we||P==="always")&&Wr(He,s),F&&v(Y,He)},onMouseLeave:He=>{D&&(we||P==="always")&&Fr(He,s)},children:[Ze>0&&r.jsx("div",{className:`${s}-row-padding-handle`,style:{height:Re(Ze)}}),r.jsxs("div",{className:`${s}-list-cols-row${f?"":` ${s}-list-cols-row-h`}${p&&he===0&&f?` ${s}-list-cols-row-controls`:""}`,...f?{}:{"data-list-row":""},style:f?void 0:{minHeight:Re(at)},children:[Ce.map((He,$t)=>{const Tt=$t===Ce.length-1,lt=ke[$t],Lt=He.paddingBottom,Ke=yu(Y.cells[He.key]),bt=f&&Ke&&Lt>0,xt=f?{minHeight:Re(at)}:{width:Re(Me[$t])},gt=f?{paddingLeft:Re(le),paddingRight:Re(le)}:{paddingLeft:Re(lt.paddingLeft),paddingRight:Re(lt.paddingRight)},vn=He.textPrefix.charAt(0),ct=f?wu(e[`${He.textPrefix}VerticalAlign`]):Cu(e[`${He.textPrefix}VerticalAlign`],e,vn),ui=f&&Ke&&p&&he===0;return r.jsxs("div",{className:f?`${s}-list-col-wrap`:void 0,...f?{}:{"data-list-col":"","data-col-letter":vn,"data-valign":ct.kind,...ct.kind==="baseline"?{"data-valign-anchor":ct.anchorLetter}:{}},children:[r.jsx("div",{className:`${s}-list-col${Tt?` ${s}-list-col-last`:""}`,style:{...gt,...xt,...f?{justifyContent:Or(ct.kind)}:{}},"data-test":He.width,children:r.jsx("span",{className:Dr(e,He.textPrefix,`${s}-list-col-title`,`${s}-text-tight-leading`),style:{...Br(Wi(e,He.textPrefix),n),...jr(e,He.textPrefix,s,n),...f?{}:Tu(ct.kind)},children:Y.cells[He.key]??null})}),bt&&r.jsx("div",{className:`${s}-row-padding-handle`,style:{height:Re(Lt)}}),ui&&r.jsx(zt,{P:s,"data-controls":He.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:Re(Math.max(Lt,co))}})]},He.key)}),p&&he===0&&f&&r.jsxs(r.Fragment,{children:[r.jsx(zt,{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(Le),className:`${s}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Re(oe),height:"100%"}}),r.jsx(zt,{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(Le),className:`${s}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Re(Math.max(oe,Be-oe)),width:Re(oe),height:"100%"}})]})]}),!f&&Xe>0&&r.jsx("div",{className:`${s}-row-padding-handle`,style:{height:Re(Xe)}}),p&&he===0&&!f&&r.jsx(zt,{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:Re(It)}})]},Y.id)}),p&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(zt,{P:s,"data-controls":wt,"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:yt,left:0,width:"100%",height:Re(Math.max(Ze,co))}})},"row-padding-handles"),p&&!f&&Ee&&et&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(zt,{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(Me[0]-((Je==null?void 0:Je.paddingRight)??0)),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Re(tt),height:"100%"}}),r.jsx(zt,{P:s,"data-controls":et.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Me[Ce.length-1]-((Ve==null?void 0:Ve.paddingLeft)??0)),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Re(Zt-Dt),width:Re(Dt),height:"100%"}})]},"column-edge-padding-handles"),p&&!f&&Ce.slice(0,-1).map((Y,he)=>{const we=Ce[he+1],We=Pe.slice(0,he+1).reduce((Tt,lt)=>Tt+lt,0),ot=ke[he],st=ke[he+1],He=Math.max(ot.paddingRight,$n),$t=Math.max(st.paddingLeft,$n);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(zt,{P:s,"data-controls":Y.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(Me[he]-ot.paddingLeft),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Re(We-He),width:Re(He),height:"100%"}}),r.jsx(zt,{P:s,"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(Me[he+1]-st.paddingRight),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Re(We),width:Re($t),height:"100%"}})]},`${Y.paddingRightKey}-padding`)}),p&&!f&&Ce.slice(0,-1).map((Y,he)=>{const we=qu(he,Pe,re,Be),ot=Pe.slice(0,he+1).reduce((st,He)=>st+He,0)-zr/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Y.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(tr),"data-controls-max-fraction":String(we),"data-controls-variant":"column-width",className:`${s}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Re(ot),width:Re(zr),height:"calc(100%)",pointerEvents:"auto"}})},`${Y.widthKey}-junction`)})]}),ft&&(()=>{const Y=Wi(e,qt),he=Lu(e.cutLabelVerticalAlign),we=Y.textTextAlign==="justify"||f;return r.jsx("button",{type:"button",className:`${s}-cut-item`,style:{minHeight:Re(S??0),cursor:dt?"pointer":"default",...vu(N,h??0,n??!1)},onClick:dt?ut:void 0,onMouseEnter:D||F?ge:void 0,onMouseLeave:D?me:void 0,children:r.jsx("div",{className:`${s}-list-cols-row`,style:{...f?{paddingLeft:Re(le),paddingRight:Re(le)}:{},justifyContent:Iu(Y.textTextAlign),alignItems:Or(he)},children:r.jsx("span",{className:Dr(e,qt,`${s}-cut-label`,`${s}-text-tight-leading`),style:{...Br(Y,n),...jr(e,qt,s,n),...we?{width:"100%"}:{}},children:O})})})})(),F&&K&&(()=>{const Y=Ti(K.widthPx),he={width:Y,height:"auto",maxHeight:Y,objectFit:"contain",left:K.x,top:K.y,position:"absolute"};return r.jsx(fu,{media:K,className:K.isVideo?`${s}-hover-video`:`${s}-hover-image`,style:he},`${K.rowId}-${K.url}`)})()]})})]})}const Qu=`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"],qt="cutLabel",Qo=[...Zo,qt],Xi=["A","B","C","D","E"];function Ua(e){return`${e}ColumnVerticalAlign`}const Io=["Top","Center","Bottom"];function er(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 Su(e){const t=er(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Cu(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 Ga(e,t,n){const i=Cu(e);return i?i===t?!1:Su(n[Ua(i)]):!0}function Zn(e){const t=er(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 wu(e,t,n){if(qa(e,t,n))return Zn(e);const i=Zn(e);return i.kind==="baseline"?{kind:"top"}:i}function $u(e){const t=Zn(e);return t.kind==="baseline"?{kind:"top"}:t}function qa(e,t,n){return Ga(e,n,t)?Zn(e).kind==="baseline":!1}function Tu(e){const t={};let n=!1;for(const i of Xi){const o=Ua(i),r=e[o];if(e.type==="b"){const s=String(r??"Top").trim();s!=="Top"&&s!=="Center"&&s!=="Bottom"&&(t[o]="Top",n=!0);continue}Ga(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Lu(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Iu(e){const t=Zn(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 _u(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),r=o-i;return n.remove(),r}function co(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const s=_u(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+s;const d=r.getBoundingClientRect(),l=o.getBoundingClientRect().height;let p=0;return e.kind==="center"?p=(d.height-l)/2:e.kind==="bottom"&&(p=d.height-l),d.top-t+p+s}function Ru(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const r=o.querySelector(`.${n}`);r&&(r.style.minHeight=`${i}px`,r.style.height=`${i}px`)}),i)}function Au(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 De(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Mu={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function ku(e){return[De(e,"textFontFamily"),De(e,"textFontSettings"),{type:"row",items:[De(e,"textFontSize"),De(e,"textLineHeight"),De(e,"textLetterSpacing"),De(e,"textWordSpacing")]},De(e,"textTextAlign"),De(e,"textTextAppearance"),`${e}VerticalAlign`]}function Wu(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Qo.map(e=>[Mu[e],ku(e)]))}}function Fi(e,t){const n=i=>{const o=De(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 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 Nt(ft(n,t))}function Dr(e,t,n,i){const o=Fi(e,t),r=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<r?`${n} ${i}`:n}function jr(e,t,n,i){const o=Fi(e,t),r=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=r?{}:{[`--${n}-title-leading-gap`]:L.scalingValue((r-s)/2,i)}}const Et=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Mn=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],kn=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Wn=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Fu={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Nu=["hover","focus","filled","success","error"],zr=.004,$n=.004,uo=$n,Vr=12,tr=50,Qn=1440,ei=tr/Qn;function Xa(e){const t=typeof e=="number"&&e>0?e:Qn;return tr/t}function Hu(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 zt({P:e,className:t,areaStyle:n,hitPlacement:i,...o}){return a.jsx("div",{className:t,style:{...n,pointerEvents:"none"},...o,children:a.jsx("div",{style:Hu(e,i)})})}function Ou(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 Qn}const Ya={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function zn(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Bu(e,t=1){const n=t/e;return Object.fromEntries(Et.map(i=>[i,n]))}function Du(){return Object.fromEntries([...Mn.map(e=>[e,0]),...kn.map(e=>[e,0])])}function ju(){return Object.fromEntries(Wn.map(e=>[e,0]))}function vi(e){return Object.fromEntries(Et.map(t=>[t,typeof e[t]=="number"?e[t]:Ya[t]]))}function Ja(e,t,n){const i=e-ei,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const r=i/o;return{paddingLeft:t*r,paddingRight:n*r}}function Ii(e,t,n){const i=nr(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((r,s)=>r+s,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function zu(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=Mn[o],s=kn[o],d=typeof n[r]=="number"?n[r]:0,l=typeof n[s]=="number"?n[s]:0,p=Ja(t[o]??0,d,l);p.paddingLeft!==d&&(i[r]=p.paddingLeft),p.paddingRight!==l&&(i[s]=p.paddingRight)}return i}function nr(e,t,n){if(e<=0)return[];const i=Et.slice(0,e).map(p=>n[p]);if(e===1)return i;const o=i.slice(0,e-1),s=o.reduce((p,u)=>p+u,0)+ei;if(t>=s)return i;const d=[...o];let l=s-t;for(let p=d.length-1;p>=0&&l>0;p-=1){const u=d[p]-ei;if(u<=0)continue;const C=Math.min(l,u);d[p]-=C,l-=C}return[...d,i[e-1]]}function Vu(e,t,n){if(e<=1)return{};const i=nr(e,t,n),o={};for(let r=0;r<e-1;r+=1){const s=Et[r];i[r]!==n[s]&&(o[s]=i[r])}return o}function Kr(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...rn]}function Ku(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Uu(e,t,n,i){const o=Math.min(i,e.length,Et.length),r={};for(let s=0;s<o;s+=1){const d=e[s],l=t.indexOf(d);if(l===-1)continue;const p=Et[l],u=Mn[l],C=kn[l],v=Wn[l],y=Et[s],m=Mn[s],h=kn[s],w=Wn[s],$=n[p],S=n[u],b=n[C],H=n[v];typeof $=="number"&&(r[y]=$),typeof S=="number"&&(r[m]=S),typeof b=="number"&&(r[h]=b),typeof H=="number"&&(r[w]=H)}return r}function Za(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=zn(e),r=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...Bu(n,o),...Du()};if(r)for(const d of Wn)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,ju());return Za(e,s)?s:e}function qu(e,t,n){const i=Tu(e);i&&(e={...e,...i});const o=Xa(n==null?void 0:n.designWidth),r=e.columns,s=t.columns,d=zn(e),l=zn(t),p=e.type==="b"||e.type===void 0&&t.type==="b",u=typeof r=="number"?r:typeof s=="number"?s:rn.length,C=b=>{if(p)return b;const H=vi({...t,...b}),I=zn(b),B=Ii(u,I,H),x=zu(u,B,{...t,...b});return Object.keys(x).length===0?b:{...b,...x}};if(typeof r=="number"&&r!==s)return e;const v=Kr(e),y=Kr(t);if(!Ku(v,y))return C({...e,...Uu(v,y,t,u)});if(d<l&&typeof u=="number"&&!p){const b=vi({...t,...e});return C({...e,...Vu(u,d,b)})}if(p){const b=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return b>H?{...e,textPaddingLR:H}:e}const m=vi({...t,...e}),h=Ii(u,l,vi(t)),$=Ii(u,d,m).some((b,H)=>b<(h[H]??b)),S=Et.some(b=>{const H=e[b],I=t[b];return typeof H=="number"&&typeof I=="number"&&H!==I});return $||S?C(e):e}function Xu(e,t,n,i){const o=t.slice(0,e).reduce((s,d)=>s+d,0),r=n.slice(e+1,t.length-1).reduce((s,d)=>s+d,0);return Math.max(ei,i-o-r-ei)}function Yu(e,t){return Math.random()*(t-e)+e}function Ju(e){return Object.fromEntries(Et.map(t=>[t,typeof e[t]=="number"?e[t]:Ya[t]]))}function po(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Zu(e,t,n,i,o,r){return e.slice(0,t).map((s,d)=>{const l=Mn[d],p=kn[d],u=Wn[d];return{key:s,textPrefix:Pu[s],widthKey:Et[d],width:n[Et[d]],paddingLeftKey:l,paddingRightKey:p,paddingBottomKey:u,paddingLeft:i[l],paddingRight:o[p],paddingBottom:r[u]}})}function Qu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:s,onUpdateSettings:d}){const{prefix:l}=L.useScopedStyles(),p=!!o,{columns:u,type:C,wrapperWidth:v,entriesCount:y,cellMinHeight:m,dividerWidth:h,showVisibility:w,cut:$,showCut:S,cutCellMinHeight:b,cutLabel:H,imageSize:I,imageOnHover:B,entryHoverEffect:x,entryHoverShowOption:E,rowPaddingTop:V,rowPaddingBottom:g,rowPaddingTopB:T,columnsOrder:P,textPaddingLR:W,textColor:K,backgroundColor:oe,dividerColor:F,textHoverColor:R,backgroundHoverColor:D,dividerHoverColor:O}=e,[N,_]=c.useState(void 0),[q,ie]=c.useState(null),k=B==="on"&&(!n||i),G=($??0)>0,f=C==="b",ee=c.useRef(null),ve=c.useRef(null),[he,Se]=c.useState(null),[re,ue]=c.useState(Qn),U=Xa(re),Z=Math.max(0,((v??0)-U)/2),ae=Math.min(W??0,Z),pe=Math.max(ae,$n),ye=((v??0)+U)/2;c.useLayoutEffect(()=>{if(!n){ue(Qn);return}const J=()=>{ue(Ou(ee.current))};J();const fe=ee.current;if(!fe)return;const A=new ResizeObserver(J);A.observe(fe);let te=fe;for(;te&&!te.style.getPropertyValue("--cntrl-article-width");)te=te.parentElement;return te&&A.observe(te),()=>A.disconnect()},[n,s]),c.useEffect(()=>{_(void 0)},[$,S,t,y]),c.useEffect(()=>{n&&!i&&_(void 0)},[n,i]);const We=L.buildColorVars(l,{textColor:K,backgroundColor:oe,dividerColor:F,textHoverColor:R,backgroundHoverColor:D,dividerHoverColor:O},Fu,Nu),Ce=r&&r!=="default"?`${l}-state-${r}`:"",Ie=`${!n||i?x==="default"?`${l}-entry-hover-default`:x==="blinds"?`${l}-entry-hover-blinds`:x==="reveal"?`${l}-entry-hover-reveal`:"":""} ${Ce}`.trim(),z=x==="reveal"&&(!n||i),le=(w==null?void 0:w[0])??!1,M=(w==null?void 0:w[1])??!1,X=c.useRef(e),Y=c.useRef(s);c.useEffect(()=>{if(!d||!n){X.current=e,Y.current=s;return}if(Y.current!==s){X.current=e,Y.current=s;return}const J=X.current;if(!(J!==e))return;if(typeof J.columns=="number"&&typeof e.columns=="number"&&J.columns!==e.columns){X.current=e;return}const A=qu(e,J,{designWidth:re});X.current=e,Za(e,A)&&d(A)},[e,d,n,s,re]);const ne=c.useMemo(()=>Ju(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),me=c.useMemo(()=>po(e,Mn),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),we=c.useMemo(()=>po(e,kn),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Oe=c.useMemo(()=>po(e,Wn),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),$e=c.useMemo(()=>Array.isArray(P)&&P.length>0?P:[...rn],[P]),be=c.useMemo(()=>Zu($e,u,ne,me,we,Oe),[$e,u,ne,me,we,Oe]),He=zn(e),ge=c.useMemo(()=>Et.slice(0,u).map(J=>ne[J]),[u,ne]),Le=c.useMemo(()=>nr(u,He,ne),[u,He,ne]),Ne=c.useMemo(()=>Ii(u,He,ne),[u,He,ne]),Me=c.useMemo(()=>be.map((J,fe)=>Ja(Ne[fe]??0,J.paddingLeft,J.paddingRight)),[be,Ne]),Ve=c.useMemo(()=>{const J=y===0?1/0:y;return(t??[]).slice(0,J).map((A,te)=>({id:te,cells:Object.fromEntries(rn.map(Re=>[Re,A[Re]??""])),image:A.image,link:A.link}))},[t,y]),tt=G?N??$:Ve.length,dt=c.useMemo(()=>G?Ve.slice(0,tt):Ve,[Ve,G,tt]),st=G&&tt<Ve.length,bt=dt.length>1||st,Rt=[le?`${l}-divider-top`:"",M||bt?`${l}-divider-bottom`:""].filter(Boolean).join(" "),xt=!n||i,At=()=>{if(!xt)return;const J=N??$;if(!S){_(Ve.length);return}_(Math.min(J+S,Ve.length))},Ae=J=>L.scalingValue(J,n??!1),ot=f?T??0:V??0,qe=g??0,Qe=m??0,wt=ot+Qe/2,Pt=Math.max(qe,uo),yt=Nr(0,dt.length,le,M,st,h??0,n??!1).borderTopWidth,rt=he!=null?`${he}px`:`calc(${yt} + ${Ae(wt)})`,$t=f?"rowPaddingTopB":"rowPaddingTop",_e=be[0],nt=be[be.length-1],Ue=Me[0],Ge=Me[Me.length-1],it=_e&&Ue?Math.max(Ue.paddingLeft,$n):0,Ft=nt&&Ge?Math.max(Ge.paddingRight,$n):0,St=He,lt=J=>{const fe=ee.current;if(!fe)return{x:0,y:0};const A=fe.getBoundingClientRect();return{x:J.clientX-A.left+Hr,y:J.clientY-A.top+Hr}},Zt=(J,fe)=>{if(!k)return;const A=J.image;if(!(A!=null&&A.url)){ie(null);return}const{x:te,y:Re}=lt(fe),Ee=(I==null?void 0:I.min)??80,de=(I==null?void 0:I.max)??320,Ke=(q==null?void 0:q.rowId)===J.id?q.widthPx:Yu(Ee,de);ie({rowId:J.id,url:A.url,objectFit:"contain",isVideo:fu(A),widthPx:Ke,x:te,y:Re})},Tt=J=>{if(!k||!q)return;const{x:fe,y:A}=lt(J);ie(te=>!te||te.x===fe&&te.y===A?te:{...te,x:fe,y:A})},j=()=>{ie(null)},se=J=>{z&&Wr(J,l),k&&ie(null)},Q=J=>{z&&Fr(J,l)};c.useLayoutEffect(()=>{if(!p||f){Se(null);return}const J=ve.current,fe=J==null?void 0:J.parentElement;if(!J||!fe){Se(null);return}const A=()=>{const Re=J.querySelector("[data-list-row]");if(!Re){Se(null);return}const Ee=fe.getBoundingClientRect(),de=Re.getBoundingClientRect();Se(de.top-Ee.top+de.height/2)};A();const te=new ResizeObserver(A);return te.observe(J),te.observe(fe),()=>te.disconnect()},[p,f,dt,ot,qe,Qe,t,e,be,Ne,re,h,le,M,st]);const Te=c.useMemo(()=>!f&&Zo.some(J=>{const fe=J.charAt(0),A=e[`${J}VerticalAlign`];return qa(A,e,fe)}),[f,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);c.useLayoutEffect(()=>{var Ke;const J=ee.current;if(!J)return;const fe=()=>{J.querySelectorAll("[data-list-col]").forEach(Xe=>{Xe.style.transform="";const ze=Xe.querySelector(`.${l}-list-col`);ze&&(ze.style.minHeight="",ze.style.height="");const ut=Xe.querySelector(`.${l}-list-col-title`);ut&&(ut.style.transform="")})};if(f||!Te){fe();return}const A=()=>{const Xe=Array.from(J.querySelectorAll("[data-list-row]")),ze=`${l}-list-col`,ut=`${l}-baseline-probe`;Xe.forEach(Be=>{Be.querySelectorAll("[data-list-col]").forEach(pt=>{pt.style.transform="";const ht=pt.querySelector(`.${ze}`);ht&&(ht.style.minHeight="",ht.style.height="");const mt=pt.querySelector(`.${l}-list-col-title`);mt&&(mt.style.transform="")})}),Xe.forEach(Be=>{const pt=Array.from(Be.querySelectorAll("[data-list-col]"));Ru(Be,pt,ze)}),J.offsetHeight,Xe.forEach(Be=>{const pt=Array.from(Be.querySelectorAll("[data-list-col]")),ht=Be.getBoundingClientRect().top,mt=new Map,vn=pt.map(at=>{const bn=at.querySelector(`.${l}-list-col-title`),xn={el:at,titleEl:bn,letter:at.getAttribute("data-col-letter")??"",kind:at.getAttribute("data-valign")??"top",anchor:at.getAttribute("data-valign-anchor")};return mt.set(xn.letter,xn),xn}),gt=new Map,pi=(at,bn)=>{const xn=gt.get(at.letter);if(xn!==void 0)return xn;const rr=at.anchor?mt.get(at.anchor):void 0;if(at.kind!=="baseline"||!rr||bn.has(at.letter)){const sr=co(at,ht,ze,ut);return gt.set(at.letter,sr),sr}bn.add(at.letter);const ss=pi(rr,bn);bn.delete(at.letter);const ls=co(at,ht,ze,ut),cs=ss-ls;Au(at.titleEl,cs);const ar=co(at,ht,ze,ut);return gt.set(at.letter,ar),ar};vn.forEach(at=>pi(at,new Set))})};let te=null;const Re=()=>{te===null&&(te=requestAnimationFrame(()=>{te=null,A()}))};A();const Ee=new ResizeObserver(()=>Re());Ee.observe(J);let de=!1;return typeof document<"u"&&((Ke=document.fonts)!=null&&Ke.ready)&&document.fonts.ready.then(()=>{de||Re()}),()=>{de=!0,te!==null&&(cancelAnimationFrame(te),te=null),Ee.disconnect(),fe()}},[Te,f,e,t,re,dt,Ne]);const Pe=c.useMemo(()=>xu(l),[l]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Pe}}),a.jsx("div",{style:We,children:a.jsxs("div",{ref:ee,className:`${l}-wrapper ${Ie}${Rt?` ${Rt}`:""}${f?` ${l}-type-b`:""}`.trim(),style:{width:L.scalingValue(v??0,n),...!f&&p?{[`--${l}-first-entry-handle-top`]:rt}:{}},onMouseMove:k?Tt:void 0,onMouseLeave:k?j:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[dt.map((J,fe)=>{var Ee;const A=(((Ee=J.link)==null?void 0:Ee.length)??0)>0,te=A&&(!n||i)?"a":"div",Re=Nr(fe,dt.length,le,M,st,h??0,n??!1);return a.jsxs(te,{ref:fe===0?de=>{ve.current=de}:void 0,className:`${l}-list-item${A||E==="always"?` ${l}-list-item-has-link`:""}`,...A?{href:J.link,target:"_blank"}:{},style:Re,onMouseEnter:de=>{z&&(A||E==="always")&&Wr(de,l),k&&Zt(J,de)},onMouseLeave:de=>{z&&(A||E==="always")&&Fr(de,l)},children:[ot>0&&a.jsx("div",{className:`${l}-row-padding-handle`,style:{height:Ae(ot)}}),a.jsxs("div",{className:`${l}-list-cols-row${f?"":` ${l}-list-cols-row-h`}${p&&fe===0&&f?` ${l}-list-cols-row-controls`:""}`,...f?{}:{"data-list-row":""},style:f?void 0:{minHeight:Ae(Qe)},children:[be.map((de,Ke)=>{const Xe=Ke===be.length-1,ze=Me[Ke],ut=de.paddingBottom,Be=vu(J.cells[de.key]),pt=f&&Be&&ut>0,ht=f?{minHeight:Ae(Qe)}:{width:Ae(Ne[Ke])},mt=f?{paddingLeft:Ae(ae),paddingRight:Ae(ae)}:{paddingLeft:Ae(ze.paddingLeft),paddingRight:Ae(ze.paddingRight)},vn=de.textPrefix.charAt(0),gt=f?$u(e[`${de.textPrefix}VerticalAlign`]):wu(e[`${de.textPrefix}VerticalAlign`],e,vn),pi=f&&Be&&p&&fe===0;return a.jsxs("div",{className:f?`${l}-list-col-wrap`:void 0,...f?{}:{"data-list-col":"","data-col-letter":vn,"data-valign":gt.kind,...gt.kind==="baseline"?{"data-valign-anchor":gt.anchorLetter}:{}},children:[a.jsx("div",{className:`${l}-list-col${Xe?` ${l}-list-col-last`:""}`,style:{...mt,...ht,...f?{justifyContent:Or(gt.kind)}:{}},"data-test":de.width,children:a.jsx("span",{className:Dr(e,de.textPrefix,`${l}-list-col-title`,`${l}-text-tight-leading`),style:{...Br(Fi(e,de.textPrefix),n),...jr(e,de.textPrefix,l,n),...f?{}:Lu(gt.kind)},children:J.cells[de.key]??null})}),pt&&a.jsx("div",{className:`${l}-row-padding-handle`,style:{height:Ae(ut)}}),pi&&a.jsx(zt,{P:l,"data-controls":de.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${l}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ae(Math.max(ut,uo))}})]},de.key)}),p&&fe===0&&f&&a.jsxs(a.Fragment,{children:[a.jsx(zt,{P:l,"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(ye),className:`${l}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Ae(pe),height:"100%"}}),a.jsx(zt,{P:l,"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(ye),className:`${l}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Ae(Math.max(pe,He-pe)),width:Ae(pe),height:"100%"}})]})]}),!f&&qe>0&&a.jsx("div",{className:`${l}-row-padding-handle`,style:{height:Ae(qe)}}),p&&fe===0&&!f&&a.jsx(zt,{P:l,"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:`${l}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ae(Pt)}})]},J.id)}),p&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx(zt,{P:l,"data-controls":$t,"data-controls-static-handle":"",...f?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-padding-control-handle`,hitPlacement:f?"center":"left-y",areaStyle:{position:"absolute",top:yt,left:0,width:"100%",height:Ae(Math.max(ot,uo))}})},"row-padding-handles"),p&&!f&&_e&&nt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx(zt,{P:l,"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(Ne[0]-((Ue==null?void 0:Ue.paddingRight)??0)),className:`${l}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Ae(it),height:"100%"}}),a.jsx(zt,{P:l,"data-controls":nt.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(Ne[be.length-1]-((Ge==null?void 0:Ge.paddingLeft)??0)),className:`${l}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ae(St-Ft),width:Ae(Ft),height:"100%"}})]},"column-edge-padding-handles"),p&&!f&&be.slice(0,-1).map((J,fe)=>{const A=be[fe+1],te=Le.slice(0,fe+1).reduce((Xe,ze)=>Xe+ze,0),Re=Me[fe],Ee=Me[fe+1],de=Math.max(Re.paddingRight,$n),Ke=Math.max(Ee.paddingLeft,$n);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx(zt,{P:l,"data-controls":J.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(Ne[fe]-Re.paddingLeft),className:`${l}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ae(te-de),width:Ae(de),height:"100%"}}),a.jsx(zt,{P:l,"data-controls":A.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[fe+1]-Ee.paddingRight),className:`${l}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ae(te),width:Ae(Ke),height:"100%"}})]},`${J.paddingRightKey}-padding`)}),p&&!f&&be.slice(0,-1).map((J,fe)=>{const A=Xu(fe,Le,ge,He),Re=Le.slice(0,fe+1).reduce((Ee,de)=>Ee+de,0)-zr/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":J.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(tr),"data-controls-max-fraction":String(A),"data-controls-variant":"column-width",className:`${l}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ae(Re),width:Ae(zr),height:"calc(100%)",pointerEvents:"auto"}})},`${J.widthKey}-junction`)})]}),st&&(()=>{const J=Fi(e,qt),fe=Iu(e.cutLabelVerticalAlign),A=J.textTextAlign==="justify"||f;return a.jsx("button",{type:"button",className:`${l}-cut-item`,style:{minHeight:Ae(b??0),cursor:xt?"pointer":"default",...bu(M,h??0,n??!1)},onClick:xt?At:void 0,onMouseEnter:z||k?se:void 0,onMouseLeave:z?Q:void 0,children:a.jsx("div",{className:`${l}-list-cols-row`,style:{...f?{paddingLeft:Ae(ae),paddingRight:Ae(ae)}:{},justifyContent:Eu(J.textTextAlign),alignItems:Or(fe)},children:a.jsx("span",{className:Dr(e,qt,`${l}-cut-label`,`${l}-text-tight-leading`),style:{...Br(J,n),...jr(e,qt,l,n),...A?{width:"100%"}:{}},children:H})})})})(),k&&q&&(()=>{const J=Li(q.widthPx),fe={width:J,height:"auto",maxHeight:J,objectFit:"contain",left:q.x,top:q.y,position:"absolute"};return a.jsx(yu,{media:q,className:q.isVideo?`${l}-hover-video`:`${l}-hover-image`,style:fe},`${q.rowId}-${q.url}`)})()]})})]})}const ep=`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"],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===qt)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[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 op=Qo.reduce((e,t)=>({...e,...ip(t)}),{});function rp(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 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[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 Qo.reduce((n,i)=>({...n,...sp(i,ap(i,e),t)}),{})}const lp=Ii(),cp=ku();function Za(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 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(qt);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,...Ii({},"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},...Ii({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},...Ii({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},Xt=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),[]),$=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 C=typeof window<"u"?window.innerHeight:800,A=Math.max(.88,1-g/C*.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]),T=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]),L=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]),x=c.useCallback(g=>{const C=s.current;if(!e||!C||g.pointerType!=="touch"||C.pointerId!==g.pointerId)return;const A=g.clientX-C.startX,H=g.clientY-C.startY;if(C.isLocked===null){if(Math.abs(A)<Yr&&Math.abs(H)<Yr)return;if(H>0&&H>Math.abs(A))C.isLocked=!0,g.currentTarget.setPointerCapture(g.pointerId);else{C.isLocked=!1,m();return}}if(!C.isLocked)return;g.preventDefault();const V=Math.max(0,H);p.current=V,a(V)},[e,m]),S=c.useCallback(g=>{const C=s.current;if(!e||!C||g.pointerType!=="touch"||C.pointerId!==g.pointerId)return;const A=C.isLocked===!0;if(g.currentTarget.hasPointerCapture(g.pointerId)&&g.currentTarget.releasePointerCapture(g.pointerId),!A){m();return}g.clientY-C.startY>=u?T():h()},[u,T,e,m,h]),O=c.useCallback(g=>{S(g)},[S]),R=c.useCallback(g=>{S(g)},[S]),B=o>0,w=l?`transform ${n}ms ease`:"none",P=l?`opacity ${n}ms ease`:"none",j=o>0||l;return{isSwipeDragging:B,backdropStyle:{opacity:$(o),transition:P},mediaAreaStyle:{transform:y(o),transition:w,touchAction:B?"none":void 0,willChange:B?"transform":void 0},chromeStyle:j?{opacity:b(o),transition:P}:void 0,swipeHandlers:e?{onPointerDown:L,onPointerMove:x,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,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},xp=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Sp=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Cp=(e,t,n,{duration:i,easing:o,onComplete:a})=>{const l=e.scrollLeft,d=n-l,s=l-n,p=(m,h)=>{xp(t),e.scrollLeft=m,h&&(a==null||a())};if(Math.abs(d)<.5)return p(n,!0),()=>{};let u=!1,$=0;const b=()=>{t.removeEventListener("transitionend",y),clearTimeout($)},y=m=>{m.target!==t||m.propertyName!=="transform"||u||(u=!0,b(),p(n,!0))};return t.addEventListener("transitionend",y),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${s}px, 0, 0)`,$=window.setTimeout(()=>{u||(u=!0,b(),p(n,!0))},i+64),()=>{u||(u=!0,b(),p(l-Sp(t),!1))}},jn=300,wp=900,$p=1500,Tp="cubic-bezier(0.16, 1, 0.3, 1)",Lp=3e3,Ei=42;function Ip(e){return`
|
|
8459
|
+
`,Bn=["A","B","C","D","E"],Ur=[...Io,"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 tp(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function bi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function np(){return Object.fromEntries(Bn.map((e,t)=>{const n=rn[t],i=`${e} column`;return[n,tp(i)]}))}function ip(){const e={};for(const t of Bn)e[`${t}ColumnWidth`]=bi(`${t} column width`),e[`${t}ColumnPaddingLeft`]=bi(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=bi(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=bi(`${t} column padding bottom`);return e}function Gr(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...rn]};for(const r of Bn)i[`${r}ColumnWidth`]=r==="A"?.0798:.32,i[`${r}ColumnPaddingLeft`]=0,i[`${r}ColumnPaddingRight`]=0,i[`${r}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function op(e){const t={};if(e===qt)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Io]},enum:[...Io]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Ur],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Ur]}}return t[De(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[De(e,"textFontSettings")]={...dn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[De(e,"textFontSize")]={...dn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[De(e,"textLineHeight")]={...dn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[De(e,"textLetterSpacing")]={...dn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[De(e,"textWordSpacing")]={...dn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[De(e,"textTextAlign")]={...dn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[De(e,"textTextAppearance")]={...dn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const rp=Qo.reduce((e,t)=>({...e,...op(t)}),{});function ap(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 sp(e,t={}){var n;return{...ap(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const qr=new Set(["textFontFamily","textFontSettings"]);function lp(e,t,n){const i=r=>n===void 0?!0:n==="common"?qr.has(r):!qr.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=er(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[De(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[De(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[De(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[De(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[De(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[De(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[De(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[De(e,"textTextAppearance")]=t.textTextAppearance),o}function Ei(e={},t){return Qo.reduce((n,i)=>({...n,...lp(i,sp(i,e),t)}),{})}const cp=Ei(),dp=Wu();function Qa(e){return[De(e,"textFontFamily"),De(e,"textFontSettings"),De(e,"textFontSize"),De(e,"textLineHeight"),De(e,"textLetterSpacing"),De(e,"textWordSpacing"),De(e,"textTextAlign"),De(e,"textTextAppearance"),`${e}VerticalAlign`]}function up(){const e=[];return Zo.forEach((t,n)=>{const i=rn[n],o=Qa(t);for(let r=1;r<rn.length;r+=1){const s=[{name:"columns",value:r},...Array.from({length:r},(d,l)=>({name:`columnsOrder.${l}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:s,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const pp=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Qa(qt);const mp=[...Bn.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"}],gp=[{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:""}],hp=[...Bn.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],fp={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:{...np(),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:gp},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"}},...ip(),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"}},...rp,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",...cp,...Ei({},"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},...Ei({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},...Ei({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...up(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...mp.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}},...Bn.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",...hp]},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__",dp]}],paletteBookmark:{items:[...pp],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},yp={element:Qu,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:fp,sourceCode:ep},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}`},Xr=100,vp=.2,Yr=8,es=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=c.useState(0),[s,d]=c.useState(!1),l=c.useRef(null),p=c.useRef(0);p.current=o;const u=c.useMemo(()=>typeof window>"u"?Xr:Math.max(Xr,window.innerHeight*vp),[]),C=c.useCallback(g=>Math.max(0,1-g/(u*1.5)),[u]),v=c.useCallback(g=>Math.max(0,1-g/(u*.45)),[u]),y=c.useCallback(g=>{const T=typeof window<"u"?window.innerHeight:800,P=Math.max(.88,1-g/T*.12);return`translateY(${g}px) scale(${P})`},[]),m=c.useCallback(()=>{l.current=null},[]),h=c.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),m()},[n,m]),w=c.useCallback(()=>{const g=typeof window<"u"?window.innerHeight:800;d(!0),r(g),window.setTimeout(()=>{t(),m(),d(!1)},Math.min(n,200))},[n,t,m]),$=c.useCallback(g=>{!e||s||g.pointerType==="touch"&&(i!=null&&i(g.target)||(l.current={startX:g.clientX,startY:g.clientY,isLocked:null,pointerId:g.pointerId}))},[e,s,i]),S=c.useCallback(g=>{const T=l.current;if(!e||!T||g.pointerType!=="touch"||T.pointerId!==g.pointerId)return;const P=g.clientX-T.startX,W=g.clientY-T.startY;if(T.isLocked===null){if(Math.abs(P)<Yr&&Math.abs(W)<Yr)return;if(W>0&&W>Math.abs(P))T.isLocked=!0,g.currentTarget.setPointerCapture(g.pointerId);else{T.isLocked=!1,m();return}}if(!T.isLocked)return;g.preventDefault();const K=Math.max(0,W);p.current=K,r(K)},[e,m]),b=c.useCallback(g=>{const T=l.current;if(!e||!T||g.pointerType!=="touch"||T.pointerId!==g.pointerId)return;const P=T.isLocked===!0;if(g.currentTarget.hasPointerCapture(g.pointerId)&&g.currentTarget.releasePointerCapture(g.pointerId),!P){m();return}g.clientY-T.startY>=u?w():h()},[u,w,e,m,h]),H=c.useCallback(g=>{b(g)},[b]),I=c.useCallback(g=>{b(g)},[b]),B=o>0,x=s?`transform ${n}ms ease`:"none",E=s?`opacity ${n}ms ease`:"none",V=o>0||s;return{isSwipeDragging:B,backdropStyle:{opacity:C(o),transition:E},mediaAreaStyle:{transform:y(o),transition:x,touchAction:B?"none":void 0,willChange:B?"transform":void 0},overlayContentStyle:V?{opacity:v(o),transition:E}:void 0,swipeHandlers:e?{onPointerDown:$,onPointerMove:S,onPointerUp:H,onPointerCancel:I}:{},dismissAreaStyle:e?{touchAction:"none"}:void 0}},bp="[data-lightbox-scrollable]",ts=()=>{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,r=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 s=d=>{const l=d.target;l instanceof Element&&l.closest(bp)||d.preventDefault()};return document.addEventListener("touchmove",s,{passive:!1}),()=>{document.removeEventListener("touchmove",s),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=r,window.scrollTo(0,e)}},[])},xp=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Sp=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Cp=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},wp=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const s=e.scrollLeft,d=n-s,l=s-n,p=(m,h)=>{Sp(t),e.scrollLeft=m,h&&(r==null||r())};if(Math.abs(d)<.5)return p(n,!0),()=>{};let u=!1,C=0;const v=()=>{t.removeEventListener("transitionend",y),clearTimeout(C)},y=m=>{m.target!==t||m.propertyName!=="transform"||u||(u=!0,v(),p(n,!0))};return t.addEventListener("transitionend",y),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${l}px, 0, 0)`,C=window.setTimeout(()=>{u||(u=!0,v(),p(n,!0))},i+64),()=>{u||(u=!0,v(),p(s-Cp(t),!1))}},En=300,$p=900,Tp=1500,Lp="cubic-bezier(0.16, 1, 0.3, 1)",Ip=3e3,_i=42;function Ep(e){return`
|
|
8460
8460
|
.${e}-wrapper {
|
|
8461
8461
|
position: relative;
|
|
8462
8462
|
width: 100%;
|
|
@@ -8607,10 +8607,10 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8607
8607
|
scrollbar-width: none;
|
|
8608
8608
|
pointer-events: auto;
|
|
8609
8609
|
opacity: 1;
|
|
8610
|
-
transition: opacity ${
|
|
8610
|
+
transition: opacity ${En}ms ease;
|
|
8611
8611
|
}
|
|
8612
8612
|
|
|
8613
|
-
.${e}-thumbnails[data-
|
|
8613
|
+
.${e}-thumbnails[data-overlay-content-hidden="true"] {
|
|
8614
8614
|
opacity: 0;
|
|
8615
8615
|
pointer-events: none;
|
|
8616
8616
|
}
|
|
@@ -8655,15 +8655,15 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8655
8655
|
|
|
8656
8656
|
.${e}-thumb-image {
|
|
8657
8657
|
display: block;
|
|
8658
|
-
height: ${
|
|
8658
|
+
height: ${_i}px;
|
|
8659
8659
|
object-fit: contain;
|
|
8660
8660
|
transition: filter 0.2s ease;
|
|
8661
8661
|
}
|
|
8662
8662
|
|
|
8663
8663
|
.${e}-thumb-image-cover {
|
|
8664
8664
|
aspect-ratio: var(--image-aspect-ratio);
|
|
8665
|
-
max-width: ${
|
|
8666
|
-
max-height: ${
|
|
8665
|
+
max-width: ${_i}px;
|
|
8666
|
+
max-height: ${_i}px;
|
|
8667
8667
|
width: auto;
|
|
8668
8668
|
height: auto;
|
|
8669
8669
|
object-fit: cover;
|
|
@@ -8681,10 +8681,10 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8681
8681
|
background-color: transparent;
|
|
8682
8682
|
padding: 0;
|
|
8683
8683
|
opacity: 1;
|
|
8684
|
-
transition: opacity ${
|
|
8684
|
+
transition: opacity ${En}ms ease;
|
|
8685
8685
|
}
|
|
8686
8686
|
|
|
8687
|
-
.${e}-close-icon[data-
|
|
8687
|
+
.${e}-close-icon[data-overlay-content-hidden="true"] {
|
|
8688
8688
|
opacity: 0;
|
|
8689
8689
|
pointer-events: none;
|
|
8690
8690
|
}
|
|
@@ -8731,10 +8731,26 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8731
8731
|
min-width: 0;
|
|
8732
8732
|
}
|
|
8733
8733
|
|
|
8734
|
-
.${e}-title-resize-handle
|
|
8734
|
+
.${e}-title-resize-handle,
|
|
8735
|
+
.${e}-padding-control-handle {
|
|
8735
8736
|
background: transparent;
|
|
8736
8737
|
}
|
|
8737
8738
|
|
|
8739
|
+
.${e}-padding-control-handle[data-controls-axis="x"][data-controls-variant="column-padding"]::after {
|
|
8740
|
+
content: '';
|
|
8741
|
+
position: absolute;
|
|
8742
|
+
top: 50%;
|
|
8743
|
+
left: 50%;
|
|
8744
|
+
transform: translate(-50%, -50%);
|
|
8745
|
+
width: 4px;
|
|
8746
|
+
height: 12px;
|
|
8747
|
+
background: #FF5C02;
|
|
8748
|
+
border: 1px solid #FFFFFF;
|
|
8749
|
+
border-radius: 5px;
|
|
8750
|
+
box-sizing: border-box;
|
|
8751
|
+
pointer-events: none;
|
|
8752
|
+
}
|
|
8753
|
+
|
|
8738
8754
|
.${e}-title-resize-handle::after {
|
|
8739
8755
|
content: '';
|
|
8740
8756
|
position: absolute;
|
|
@@ -8753,6 +8769,13 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8753
8769
|
pointer-events: none;
|
|
8754
8770
|
display: flex;
|
|
8755
8771
|
flex-direction: column;
|
|
8772
|
+
opacity: 1;
|
|
8773
|
+
transition: opacity ${En}ms ease;
|
|
8774
|
+
}
|
|
8775
|
+
|
|
8776
|
+
.${e}-lightbox-content-inner[data-overlay-content-hidden="true"] {
|
|
8777
|
+
opacity: 0;
|
|
8778
|
+
pointer-events: none;
|
|
8756
8779
|
}
|
|
8757
8780
|
|
|
8758
8781
|
.${e}-lightbox-content-area {
|
|
@@ -8797,7 +8820,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8797
8820
|
box-sizing: border-box;
|
|
8798
8821
|
pointer-events: none;
|
|
8799
8822
|
}
|
|
8800
|
-
`}function Ep(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 _p(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=Ep(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 Ge(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const Rp={title1:"1",title2:"2",title3:"3"};function Pp(e){return[Ge(e,"fontFamily"),Ge(e,"fontSettings"),{type:"row",items:[Ge(e,"fontSize"),Ge(e,"lineHeight"),Ge(e,"letterSpacing"),Ge(e,"wordSpacing")]},Ge(e,"textAlign"),Ge(e,"textAppearance")]}function Ap(){return{type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ci.map(e=>[Rp[e],Pp(e)]))}}const Mp={title1:"title1Color",title2:"title2Color",title3:"title3Color"},kp={title1:.02,title2:.02,title3:.02},Jr=.004,ts=50,Wp=1440,Io=ts/Wp,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=Io*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]-Io;if(p<=0)continue;const u=Math.min(d,p);l[s]-=u,d-=u}return l}function Fp(e,t,n){return ns(e,t,n)}function Np(e,t,n){const i=t.filter((o,a)=>a!==e).reduce((o,a)=>o+a,0);return Math.max(Io,n-i)}function Hp(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=Ge(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Mp[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??kp[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 Op=1,Zr=.15,Bp=3,Dp=20,ho=e=>`max(${e}, ${Dp}px)`,jp=({prefix:e,images:t,backgroundColor:n,thumbnailGap:i,thumbnailMarginBottom:o,imageGap:a,isEditor:l,isEditMode:d,isPreviewMode:s,closeIcon:p,closeIconMaxWidth:u,closeIconColor:$,closeIconHoverColor:b,thumbnailTrigger:y,thumbnailVisibility:m,thumbnailObjectFit:h,thumbnailActive:T,thumbnailActiveColor:L,title1Width:x,title2Width:S,title3Width:O,title1:R,title2:B,title3:w,title1Style:P,title2Style:j,title3Style:g,contentMarginTop:C,contentMarginLeft:A,contentMarginRight:H,title2MarginLeft:V,title3MarginLeft:Q,onClose:k})=>{const _=!!d,E=!d,M=!d&&(!l||!!s),W=M,z=M,K=Xt(h),ie=K?{"--image-aspect-ratio":Xi(h)}:void 0,F=!!(R||B||w),J=c.useMemo(()=>Hp(e,R,B,w,P,j,g),[e,R,B,w,P,j,g]),f=c.useMemo(()=>({title1Width:x,title2Width:S,title3Width:O}),[x,S,O]),ne=c.useMemo(()=>J.map(v=>f[v.widthKey]),[J,f]),xe=c.useMemo(()=>ns(J.length,po,ne),[J.length,ne]),pe=c.useMemo(()=>Fp(J.length,po,ne),[J.length,ne]),ve=c.useCallback(v=>I.scalingValue(v,l??!1),[l]),se=c.useMemo(()=>({title2MarginLeft:V,title3MarginLeft:Q}),[V,Q]),fe=c.useCallback(v=>{let q=0;for(let Z=0;Z<=v;Z+=1){const ge=J[Z];ge!=null&&ge.marginLeftKey&&(q+=se[ge.marginLeftKey]??0),q+=xe[Z]??0}return q},[J,se,xe]),G=()=>J.flatMap((v,q)=>{const Z=v.marginLeftKey?se[v.marginLeftKey]??0:0,ge=[];return v.marginLeftKey&&ge.push(r.jsx("div",{"data-controls":_?v.marginLeftKey:void 0,"data-controls-axis":_?"x":void 0,className:_?`${e}-control`:void 0,style:{width:ve(Z),flexShrink:0}},`${v.className}-margin`)),ge.push(r.jsx("div",{className:`${e}-title-cell`,style:{width:ve(pe[q]??0)},children:r.jsx("p",{className:v.className,style:v.style,children:v.text})},v.className)),ge}),ee=()=>J.map((v,q)=>{const Z=Np(q,xe,po),me=fe(q)-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(Z),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ve(me),width:ve(Jr),height:"100%",pointerEvents:"auto"}})},`${v.widthKey}-junction`)}),le=c.useRef(null),oe=c.useRef(null),Le=c.useRef(null),$e=c.useRef([]),_e=c.useRef(0),Se=c.useRef({isActive:!1,startX:0,scrollLeft:0,hasMoved:!1}),Ie=c.useRef(null),D=t.length>1,ue=D?Bp:1,N=c.useMemo(()=>Array.from({length:ue},()=>t).flat(),[t,ue]),[X,U]=c.useState(!1),[te,de]=c.useState(!1),[ye,Ne]=c.useState(!0),[Te,Ce]=c.useState(0),Be=c.useRef(Te);Be.current=Te;const re=c.useRef(null),Pe=c.useRef(!1),Me=c.useRef(null),ke=c.useRef(null),ze=c.useCallback(()=>{E&&(Ne(!0),ke.current&&clearTimeout(ke.current),ke.current=setTimeout(()=>{Se.current.isActive||Ne(!1)},Lp))},[E]),it=c.useCallback(()=>{d||Pe.current||(Pe.current=!0,de(!1),Me.current=setTimeout(()=>{k()},jn))},[d,k]),mt=c.useCallback(v=>!!(v.closest("[data-controls]")||v.closest(`.${e}-thumbnails`)||v.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ft,backdropStyle:Ct,mediaAreaStyle:At,chromeStyle:dt,swipeHandlers:ut,dismissAreaStyle:Re}=Qa({enabled:M,onClose:it,animMs:jn,isBlockedTarget:mt}),Ze=()=>{if(!D||t.length===0)return _e.current=0,0;const v=$e.current[0],q=$e.current[t.length];if(!v||!q)return _e.current;const Z=q.offsetLeft-v.offsetLeft;return Z>0&&(_e.current=Z),_e.current},Xe=(v=!1)=>{if(!D)return;const q=oe.current,Z=Ze();!q||Z<=0||(q.scrollLeft<=0?(q.scrollLeft+=Z,v&&(Se.current.scrollLeft+=Z)):q.scrollLeft>=Z*2&&(q.scrollLeft-=Z,v&&(Se.current.scrollLeft-=Z)))},at=(v=(q=>(q=oe.current)==null?void 0:q.scrollLeft)()??0)=>{let Z=0,ge=1/0;return $e.current.forEach((me,Fe)=>{if(!me)return;const De=Math.abs(me.offsetLeft-v);De<ge&&(ge=De,Z=Fe)}),Z},Ye=()=>{!oe.current||t.length===0||re.current===null&&Ce(at()%t.length)},It=()=>{re.current=null,Ye()},yt=v=>{const q=oe.current;q&&(q.style.scrollSnapType=v?"":"none")},vt=()=>{var v;(v=Ie.current)==null||v.call(Ie),Ie.current=null},wt=()=>{const v=Le.current;v&&(v.style.transition="",v.style.transform="",v.style.willChange="")},Ee=(v,q,Z,ge)=>{wt(),v.scrollLeft=q,Xe(),Z!==void 0?Ce(Z):Ye(),yt(!0),ge==null||ge()},et=(v,{behavior:q="smooth",activeIndex:Z,onComplete:ge}={})=>{const me=oe.current,Fe=Le.current;if(!me||!Fe)return;if(vt(),yt(!1),q==="auto"){Ee(me,v,Z,ge);return}const De=Math.abs(v-me.scrollLeft),Y=bp(De,wp,$p,me.clientWidth*.55);Ie.current=Cp(me,Fe,v,{duration:Y,easing:Tp,onComplete:()=>{Ie.current=null,Ee(me,v,Z,ge)}})},Je=(v="smooth")=>{if(!oe.current||t.length===0)return;const Z=at(),ge=$e.current[Z];ge&&et(ge.offsetLeft,{behavior:v,activeIndex:Z%t.length})},Ve=(v,q="smooth")=>{const Z=oe.current;if(!Z||t.length===0)return;const ge=Z.scrollLeft-v,me=at(Z.scrollLeft),Fe=$e.current[me],De=$e.current[me+1],Y=Fe?De?De.offsetLeft-Fe.offsetLeft:Fe.offsetWidth:0;let he=me;Y>0&&(ge>Y*Zr?he+=1:ge<-Y*Zr&&(he-=1)),D||(he=Math.max(0,Math.min(N.length-1,he)));const we=$e.current[he];if(!we){Je(q);return}et(we.offsetLeft,{behavior:q,activeIndex:he%t.length})},tt=(v,q="smooth")=>{const Z=oe.current,ge=D?t.length+v:v,me=$e.current[ge];!Z||!me||(q==="smooth"?re.current=v:re.current=null,Ce(v),et(me.offsetLeft,{behavior:q,activeIndex:v,onComplete:q==="smooth"?It:void 0}))},Dt=v=>{if(!W||v.pointerType!=="mouse"||v.button!==0||mt(v.target))return;const q=oe.current;q&&(vt(),wt(),Se.current={isActive:!0,startX:v.clientX,scrollLeft:q.scrollLeft,hasMoved:!1},yt(!1),ze(),q.setPointerCapture(v.pointerId))},Zt=v=>{if(!W||v.pointerType!=="mouse")return;const q=oe.current;if(!q||!Se.current.isActive)return;const Z=v.clientX-Se.current.startX;Math.abs(Z)>Op&&(Se.current.hasMoved=!0,U(!0)),Se.current.hasMoved&&(v.preventDefault(),q.scrollLeft=Se.current.scrollLeft-Z,Xe(!0),Ye(),ze())},ae=v=>{if(!W||v.pointerType!=="mouse")return;const q=oe.current;if(!q)return;const Z=Se.current.hasMoved,ge=Se.current.scrollLeft;Se.current.isActive=!1,U(!1),q.hasPointerCapture(v.pointerId)&&q.releasePointerCapture(v.pointerId),Xe(),Z?Ve(ge):(yt(!0),Ye()),ze()};return es(),c.useEffect(()=>{const v=requestAnimationFrame(()=>de(!0));return()=>{cancelAnimationFrame(v),vt(),Me.current&&clearTimeout(Me.current),ke.current&&clearTimeout(ke.current)}},[]),c.useEffect(()=>{if(!E){Ne(!0);return}ze();const v=le.current;if(!v)return;const q=()=>ze();return v.addEventListener("pointermove",q),v.addEventListener("pointerdown",q),()=>{v.removeEventListener("pointermove",q),v.removeEventListener("pointerdown",q),ke.current&&clearTimeout(ke.current)}},[E,ze]),c.useEffect(()=>{const v=q=>{q.key==="Escape"&&it()};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[it]),c.useLayoutEffect(()=>{Ze(),tt(Be.current,"auto")},[a]),c.useLayoutEffect(()=>{Ze(),tt(0,"auto")},[t.length,D]),c.useEffect(()=>{if(!d)return;const v=oe.current;if(!v)return;const q=Z=>{Z.preventDefault()};return v.addEventListener("wheel",q,{passive:!1}),v.addEventListener("touchmove",q,{passive:!1}),()=>{v.removeEventListener("wheel",q),v.removeEventListener("touchmove",q)}},[d]),c.useEffect(()=>{const v=oe.current;if(!v)return;let q=null;const Z=()=>{Xe(),Ye(),re.current!==null&&(q&&clearTimeout(q),q=setTimeout(()=>{re.current!==null&&It()},150))},ge=()=>{re.current!==null&&(q&&(clearTimeout(q),q=null),It())};v.addEventListener("scroll",Z,{passive:!0}),v.addEventListener("scrollend",ge);const me=new ResizeObserver(()=>{Ze(),Xe(),Ye()});return me.observe(v),()=>{q&&clearTimeout(q),vt(),v.removeEventListener("scroll",Z),v.removeEventListener("scrollend",ge),me.disconnect()}},[t.length,D]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${l?` ${e}-lightbox-editor`:""}${d?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ft||it()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:te?1:0,transition:`opacity ${jn}ms ease`,pointerEvents:te?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:n,...Ct}}),r.jsxs("div",{ref:le,className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%",...Re},...ut,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:At,onClick:v=>v.stopPropagation(),children:r.jsx("div",{ref:oe,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":W&&t.length>0?"true":"false","data-mouse-dragging":X?"true":"false",onPointerDown:Dt,onPointerMove:Zt,onPointerUp:ae,onPointerCancel:ae,children:r.jsx("div",{ref:Le,className:`${e}-lightbox-strip-track`,style:{gap:a},children:N.map((v,q)=>{const Z=v.image.objectFit??"contain",ge=q%t.length,me=Math.floor(q/t.length),Fe=ho(a),De=`calc(-0.5 * (${Fe} + ${a}))`;return r.jsxs("div",{ref:Y=>$e.current[q]=Y,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:Z}}),_&&ge<t.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:De,width:Fe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${me}-${v.image.url}-${ge}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,style:{width:"100%",height:"100%",top:0,bottom:0,...dt},children:[r.jsx("div",{"data-controls":_?"contentMarginTop":void 0,"data-controls-static-handle":_?"":void 0,className:_?`${e}-control`:void 0,style:{height:C,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:[G(),_&&J.length>0?ee():null]}),p&&r.jsx("div",{className:`${e}-close-icon`,"data-chrome-hidden":E&&!ye?"true":"false",style:{width:I.scalingValue(u??0,l),height:I.scalingValue(u??0,l),"--close-icon-hover-color":b},children:r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:it,"aria-label":"Close",children:r.jsx(Nt,{url:p,fill:$,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),q=`calc(-0.5 * (${o} + ${v}))`;return r.jsxs("div",{className:`${e}-thumbnails`,"data-lightbox-scrollable":"","data-thumbnail-active":T,"data-chrome-hidden":E&&!ye?"true":"false",onClick:Z=>Z.stopPropagation(),style:{gap:i,bottom:o,"--thumbnail-active-color":L,...dt},children:[t.map((Z,ge)=>{const me=ho(i),Fe=`calc(-0.5 * (${me} + ${i}))`;return r.jsxs("div",{style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":Te===ge?"true":"false",onClick:()=>M&&y==="click"&&tt(ge),onMouseEnter:()=>z&&y==="hover"&&tt(ge),"aria-label":Z.image.name?`View ${Z.image.name}`:`View image ${ge+1}`,"aria-current":Te===ge?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${K?` ${e}-thumb-image-cover`:""}`,src:Z.image.url,alt:"",draggable:!1,style:{...ie,...h.display==="Cover"?{width:Ei}:{width:"100%"}}})}),_&&ge<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Fe,width:me,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${Z.image.url}-${ge}`)}),_&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":_?"":void 0,style:{position:"absolute",left:0,right:0,bottom:q,height:v,pointerEvents:"auto",zIndex:3}})]})})()]})]})},zp=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:a})=>{const{prefix:l}=I.useScopedStyles(),{cover:d,coverFit:s,backgroundColor:p,thumbnailVisibility:u,thumbnailObjectFit:$,thumbnailTrigger:b,thumbnailActive:y,thumbnailActiveColor:m,thumbnailGap:h,thumbnailMarginBottom:T,imageGap:L,title1Width:x,title2Width:S,title3Width:O,title2MarginLeft:R,title3MarginLeft:B,closeIcon:w,closeIconMaxWidth:P,closeIconColor:j,closeIconHoverColor:g,contentMarginTop:C,contentMarginLeft:A,contentMarginRight:H}=e,V=c.useRef(null),[Q,k]=c.useState(!1),_=t??[],{title1:E,title2:M,title3:W}=_p(_),z=ne=>I.scalingValue(ne,n??!1),K=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:V,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ip(l)}}),d?r.jsx("button",{type:"button",className:`${l}-cover ${Xt(s)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:J,style:{display:"block",padding:0,border:"none",background:"transparent",...Xt(s)?{"--image-aspect-ratio":Xi(s)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${l}-cover-image ${Xt(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(jp,{prefix:l,images:_,backgroundColor:p,thumbnailGap:z(h),thumbnailMarginBottom:z(T??.02),imageGap:z(L??0),thumbnailVisibility:u,thumbnailObjectFit:$,thumbnailTrigger:b,thumbnailActive:y,thumbnailActiveColor:m,title1Width:x,title2Width:S,title3Width:O,title2MarginLeft:R??0,title3MarginLeft:B??0,title1:E,title2:M,title3:W,title1Style:K,title2Style:ie,title3Style:F,contentMarginTop:z(C??0),contentMarginLeft:z(A??0),contentMarginRight:z(H??0),closeIcon:w,closeIconMaxWidth:P,closeIconColor:j,closeIconHoverColor:g,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:f}),ne)})()]})},Vp=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
8823
|
+
`}function _p(e){if(!Array.isArray(e)||e.length===0)return{};const t=e.find(o=>(o==null?void 0:o.type)==="paragraph")??e[0],n=t==null?void 0:t.children;if(!Array.isArray(n))return{};const i=n.map(o=>typeof(o==null?void 0:o.text)=="string"?o.text.trim():"").filter(Boolean);return{title1:i[0],title2:i[1],title3:i[2]}}function Rp(e){for(const t of e)if(t.title1||t.title2||t.title3)return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""};for(const t of e){const n=_p(t.text);if(n.title1||n.title2||n.title3)return{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}return{title1:"",title2:"",title3:""}}const di=["title1","title2","title3"];function Ye(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const Ap={title1:"1",title2:"2",title3:"3"};function Pp(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 Mp(){return{type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(di.map(e=>[Ap[e],Pp(e)]))}}const kp={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Wp={title1:.02,title2:.02,title3:.02},Jr=.004,Fp=.004;function ns(e,t){if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,s)=>r+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:s},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...s]};const l=Math.min(r,d);return{overflow:r-l,widths:[d-l,...s]}},{overflow:i-1,widths:[]});return o}function Np(e,t){return ns(e,t)}function Hp(e,t){const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n)}function Op(e,t,n,i,o,r,s){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:r,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:s,text:i}),d}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[kp[t]]}}function Bp(e,t,n,i){return e.slice(0,i).reduce((o,r,s)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[s]??0),0)}function go(e,t,n){var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??Wp[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return ft(i,n)}const Dp=1,Zr=.15,jp=3,zp=20,ho=e=>`max(${e}, ${zp}px)`,Vp=({prefix:e,images:t,backgroundColor:n,thumbnailGap:i,thumbnailMarginBottom:o,imageGap:r,isEditor:s,isEditMode:d,isPreviewMode:l,closeIcon:p,closeIconMaxWidth:u,closeIconColor:C,closeIconHoverColor:v,thumbnailTrigger:y,thumbnailVisibility:m,thumbnailObjectFit:h,thumbnailActive:w,thumbnailActiveColor:$,title1Width:S,title2Width:b,title3Width:H,title1:I,title2:B,title3:x,title1Style:E,title2Style:V,title3Style:g,contentMarginTop:T,contentMarginLeft:P,contentMarginRight:W,title2MarginLeft:K,title3MarginLeft:oe,onClose:F})=>{const R=d,D=!d&&(!s||l),O=D,N=D,_=D,q=Xt(h),ie=q?{"--image-aspect-ratio":Yi(h)}:void 0,k=!!(I||B||x),G=c.useMemo(()=>Op(e,I,B,x,E,V,g),[e,I,B,x,E,V,g]),f=c.useMemo(()=>({title1Width:S,title2Width:b,title3Width:H}),[S,b,H]),ee=c.useMemo(()=>G.map(j=>f[j.widthKey]),[G,f]),ve=c.useMemo(()=>ns(G.length,ee),[G.length,ee]),he=c.useMemo(()=>Np(G.length,ee),[G.length,ee]),Se=c.useCallback(j=>L.scalingValue(j,s??!1),[s]),re=c.useMemo(()=>({title2MarginLeft:K,title3MarginLeft:oe}),[K,oe]),ue=c.useCallback(j=>G.slice(0,j+1).reduce((se,Q,Te)=>se+(Q!=null&&Q.marginLeftKey?re[Q.marginLeftKey]??0:0)+(ve[Te]??0),0),[G,re,ve]),U=()=>G.map((j,se)=>{const Q=j.marginLeftKey?re[j.marginLeftKey]??0:0;return a.jsx("div",{className:`${e}-title-cell`,style:{width:Se(he[se]??0),...Q>0?{marginLeft:Se(Q)}:{}},children:a.jsx("p",{className:j.className,style:j.style,children:j.text})},j.className)}),Z=()=>G.flatMap((j,se)=>{if(!j.marginLeftKey)return[];const Q=re[j.marginLeftKey]??0,Te=Bp(G,ve,re,se),Pe=Math.max(Q,Fp);return a.jsx("div",{"data-controls":j.marginLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ve[se]),className:`${e}-padding-control-handle`,style:{position:"absolute",top:0,left:Se(Te),width:Se(Pe),height:"100%",pointerEvents:"auto"}},j.marginLeftKey)}),ae=()=>G.map((j,se)=>{const Q=Hp(se,ve),Pe=ue(se)-Jr/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":j.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-max-fraction":String(Q),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:Se(Pe),width:Se(Jr),height:"100%",pointerEvents:"auto"}})},`${j.widthKey}-junction`)}),pe=c.useRef(null),ye=c.useRef(null),We=c.useRef(null),Ce=c.useRef([]),Fe=c.useRef(0),Ie=c.useRef({isActive:!1,startX:0,scrollLeft:0,hasMoved:!1}),z=c.useRef(null),le=t.length>1,M=le?jp:1,X=c.useMemo(()=>Array.from({length:M},()=>t).flat(),[t,M]),[Y,ne]=c.useState(!1),[me,we]=c.useState(!1),[Oe,$e]=c.useState(!0),[be,He]=c.useState(0),ge=c.useRef(be);ge.current=be;const Le=c.useRef(null),Ne=c.useRef(!1),Me=c.useRef(null),Ve=c.useRef(null),tt=O&&!Oe,dt=c.useCallback(()=>{O&&($e(!0),Ve.current&&clearTimeout(Ve.current),Ve.current=setTimeout(()=>{Ie.current.isActive||$e(!1)},Ip))},[O]),st=c.useCallback(()=>{d||Ne.current||(Ne.current=!0,we(!1),Me.current=setTimeout(()=>{F()},En))},[d,F]),bt=c.useCallback(j=>!!(j.closest("[data-controls]")||j.closest(`.${e}-thumbnails`)||j.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Rt,backdropStyle:xt,mediaAreaStyle:At,overlayContentStyle:Ae,swipeHandlers:ot,dismissAreaStyle:qe}=es({enabled:D??!1,onClose:st,animMs:En,isBlockedTarget:bt}),Qe=()=>{if(!le||t.length===0)return Fe.current=0,0;const j=Ce.current[0],se=Ce.current[t.length];if(!j||!se)return Fe.current;const Q=se.offsetLeft-j.offsetLeft;return Q>0&&(Fe.current=Q),Fe.current},wt=(j=!1)=>{if(!le)return;const se=ye.current,Q=Qe();!se||Q<=0||(se.scrollLeft<=0?(se.scrollLeft+=Q,j&&(Ie.current.scrollLeft+=Q)):se.scrollLeft>=Q*2&&(se.scrollLeft-=Q,j&&(Ie.current.scrollLeft-=Q)))},Pt=(j=(se=>(se=ye.current)==null?void 0:se.scrollLeft)()??0)=>Ce.current.reduce((Q,Te,Pe)=>{if(!Te)return Q;const J=Math.abs(Te.offsetLeft-j);return J<Q.distance?{flatIndex:Pe,distance:J}:Q},{flatIndex:0,distance:1/0}).flatIndex,yt=()=>{!ye.current||t.length===0||Le.current===null&&He(Pt()%t.length)},rt=()=>{Le.current=null},$t=j=>{const se=ye.current;se&&(se.style.scrollSnapType=j?"":"none")},_e=()=>{var j;(j=z.current)==null||j.call(z),z.current=null},nt=()=>{const j=We.current;j&&(j.style.transition="",j.style.transform="",j.style.willChange="")},Ue=(j,se,Q,Te)=>{nt(),j.scrollLeft=se,wt(),Q!==void 0?He(Q):yt(),$t(!0),Te==null||Te()},Ge=(j,{behavior:se="smooth",activeIndex:Q,onComplete:Te}={})=>{const Pe=ye.current,J=We.current;if(!Pe||!J)return;if(_e(),$t(!1),se==="auto"){Ue(Pe,j,Q,Te);return}const fe=Math.abs(j-Pe.scrollLeft),A=xp(fe,$p,Tp,Pe.clientWidth*.55);z.current=wp(Pe,J,j,{duration:A,easing:Lp,onComplete:()=>{z.current=null,Ue(Pe,j,Q,Te)}})},it=(j="smooth")=>{if(!ye.current||t.length===0)return;const Q=Pt(),Te=Ce.current[Q];Te&&Ge(Te.offsetLeft,{behavior:j,activeIndex:Q%t.length})},Ft=(j,se="smooth")=>{const Q=ye.current;if(!Q||t.length===0)return;const Te=Q.scrollLeft-j,Pe=Pt(Q.scrollLeft),J=Ce.current[Pe],fe=Ce.current[Pe+1],A=J?fe?fe.offsetLeft-J.offsetLeft:J.offsetWidth:0,te=A>0?Te>A*Zr?1:Te<-A*Zr?-1:0:0,Re=le?Pe+te:Math.max(0,Math.min(X.length-1,Pe+te)),Ee=Ce.current[Re];if(!Ee){it(se);return}const de=Re%t.length;se==="smooth"&&(Le.current=de),He(de),Ge(Ee.offsetLeft,{behavior:se,activeIndex:de,onComplete:se==="smooth"?rt:void 0})},St=(j,se="smooth")=>{const Q=ye.current,Te=le?t.length+j:j,Pe=Ce.current[Te];!Q||!Pe||(se==="smooth"?Le.current=j:Le.current=null,He(j),Ge(Pe.offsetLeft,{behavior:se,activeIndex:j,onComplete:se==="smooth"?rt:void 0}))},lt=j=>{if(!N||j.pointerType!=="mouse"||j.button!==0||bt(j.target))return;const se=ye.current;se&&(_e(),nt(),Le.current=null,Ie.current={isActive:!0,startX:j.clientX,scrollLeft:se.scrollLeft,hasMoved:!1},$t(!1),dt(),se.setPointerCapture(j.pointerId))},Zt=j=>{if(!N||j.pointerType!=="mouse")return;const se=ye.current;if(!se||!Ie.current.isActive)return;const Q=j.clientX-Ie.current.startX;Math.abs(Q)>Dp&&(Ie.current.hasMoved=!0,ne(!0)),Ie.current.hasMoved&&(j.preventDefault(),se.scrollLeft=Ie.current.scrollLeft-Q,wt(!0),yt(),dt())},Tt=j=>{if(!N||j.pointerType!=="mouse")return;const se=ye.current;if(!se)return;const Q=Ie.current.hasMoved,Te=Ie.current.scrollLeft;Ie.current.isActive=!1,ne(!1),se.hasPointerCapture(j.pointerId)&&se.releasePointerCapture(j.pointerId),wt(),Q?Ft(Te):($t(!0),yt()),dt()};return ts(),c.useEffect(()=>{const j=requestAnimationFrame(()=>we(!0));return()=>{cancelAnimationFrame(j),_e(),Me.current&&clearTimeout(Me.current),Ve.current&&clearTimeout(Ve.current)}},[]),c.useEffect(()=>{if(!O){$e(!0);return}dt();const j=pe.current;if(!j)return;const se=()=>dt();return j.addEventListener("pointermove",se),j.addEventListener("pointerdown",se),()=>{j.removeEventListener("pointermove",se),j.removeEventListener("pointerdown",se),Ve.current&&clearTimeout(Ve.current)}},[O,dt]),c.useEffect(()=>{const j=se=>{se.key==="Escape"&&st()};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[st]),c.useLayoutEffect(()=>{Qe(),St(ge.current,"auto")},[r]),c.useLayoutEffect(()=>{Qe(),St(0,"auto")},[t.length,le]),c.useEffect(()=>{if(!d)return;const j=ye.current;if(!j)return;const se=Q=>{Q.preventDefault()};return j.addEventListener("wheel",se,{passive:!1}),j.addEventListener("touchmove",se,{passive:!1}),()=>{j.removeEventListener("wheel",se),j.removeEventListener("touchmove",se)}},[d]),c.useEffect(()=>{const j=ye.current;if(!j)return;const se=()=>{wt(),yt()};j.addEventListener("scroll",se,{passive:!0});const Q=new ResizeObserver(()=>{Qe(),wt(),yt()});return Q.observe(j),()=>{_e(),j.removeEventListener("scroll",se),Q.disconnect()}},[t.length,le]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${s?` ${e}-lightbox-editor`:""}${d?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Rt||st()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:me?1:0,transition:`opacity ${En}ms ease`,pointerEvents:me?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:n,...xt}}),a.jsxs("div",{ref:pe,className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%",...qe},...ot,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:At,onClick:j=>j.stopPropagation(),children:a.jsx("div",{ref:ye,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":N&&t.length>0?"true":"false","data-mouse-dragging":Y?"true":"false",onPointerDown:lt,onPointerMove:Zt,onPointerUp:Tt,onPointerCancel:Tt,children:a.jsx("div",{ref:We,className:`${e}-lightbox-strip-track`,style:{gap:r},children:X.map((j,se)=>{const Q=j.image.objectFit??"contain",Te=se%t.length,Pe=Math.floor(se/t.length),J=ho(r),fe=`calc(-0.5 * (${J} + ${r}))`;return a.jsxs("div",{ref:A=>Ce.current[se]=A,className:`${e}-strip-item`,style:{height:"100%"},children:[a.jsx("img",{src:j.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:Q}}),R&&Te<t.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:fe,width:J,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Pe}-${j.image.url}-${Te}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":tt?"true":"false",style:{width:"100%",height:"100%",top:0,bottom:0,...Ae},children:[a.jsx("div",{"data-controls":R?"contentMarginTop":void 0,"data-controls-static-handle":R?"":void 0,className:R?`${e}-control`:void 0,style:{height:T,width:"100%",pointerEvents:R?"auto":"none"}}),a.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%"},children:[a.jsx("div",{"data-controls":R?"contentMarginLeft":void 0,"data-controls-axis":R?"x":void 0,className:R?`${e}-control`:void 0,style:{width:P,flexShrink:0}}),a.jsxs("div",{className:`${e}-lightbox-content-area`,children:[k&&a.jsxs("div",{className:`${e}-titles-row`,children:[U(),R&&G.length>0?a.jsxs(a.Fragment,{children:[Z(),ae()]}):null]}),p&&a.jsx("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":tt?"true":"false",style:{width:L.scalingValue(u??0,s),height:L.scalingValue(u??0,s),"--close-icon-hover-color":v},children:a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:st,"aria-label":"Close",children:a.jsx(Ht,{url:p,fill:C,hoverFill:v,className:`${e}-close-icon-img`})})})]}),a.jsx("div",{"data-controls":R?"contentMarginRight":void 0,"data-controls-axis":R?"x":void 0,"data-controls-reverse":R?"":void 0,className:R?`${e}-control`:void 0,style:{width:W,flexShrink:0,pointerEvents:R?"auto":"none"}})]})]}),t.length>1&&m==="on"&&(()=>{const j=ho(o),se=`calc(-0.5 * (${o} + ${j}))`;return a.jsxs("div",{className:`${e}-thumbnails`,"data-lightbox-scrollable":"","data-thumbnail-active":w,"data-overlay-content-hidden":tt?"true":"false",onClick:Q=>Q.stopPropagation(),style:{gap:i,bottom:o,"--thumbnail-active-color":$,...Ae},children:[t.map((Q,Te)=>{const Pe=ho(i),J=`calc(-0.5 * (${Pe} + ${i}))`;return a.jsxs("div",{style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":be===Te?"true":"false",onClick:()=>D&&y==="click"&&St(Te),onMouseEnter:()=>_&&y==="hover"&&St(Te),"aria-label":Q.image.name?`View ${Q.image.name}`:`View image ${Te+1}`,"aria-current":be===Te?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${q?` ${e}-thumb-image-cover`:""}`,src:Q.image.url,alt:"",draggable:!1,style:{...ie,...h.display==="Cover"?{width:_i}:{width:"100%"}}})}),R&&Te<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:J,width:Pe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${Q.image.url}-${Te}`)}),R&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":R?"":void 0,style:{position:"absolute",left:0,right:0,bottom:se,height:j,pointerEvents:"auto",zIndex:3}})]})})()]})]})},Kp=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:s}=L.useScopedStyles(),{cover:d,coverFit:l,backgroundColor:p,thumbnailVisibility:u,thumbnailObjectFit:C,thumbnailTrigger:v,thumbnailActive:y,thumbnailActiveColor:m,thumbnailGap:h,thumbnailMarginBottom:w,imageGap:$,title1Width:S,title2Width:b,title3Width:H,title2MarginLeft:I,title3MarginLeft:B,closeIcon:x,closeIconMaxWidth:E,closeIconColor:V,closeIconHoverColor:g,contentMarginTop:T,contentMarginLeft:P,contentMarginRight:W}=e,K=c.useRef(null),[oe,F]=c.useState(!1),R=t??[],{title1:D,title2:O,title3:N}=Rp(R),_=ee=>L.scalingValue(ee,n??!1),q=go("title1",mo(e,"title1"),n),ie=go("title2",mo(e,"title2"),n),k=go("title3",mo(e,"title3"),n),G=()=>{i||R.length===0||n&&!o||F(!0)},f=()=>{F(!1)};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:K,className:`${s}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Ep(s)}}),d?a.jsx("button",{type:"button",className:`${s}-cover ${Xt(l)?`${s}-ratio-wrapper-cover`:`${s}-ratio-wrapper-fit`}`,onClick:G,style:{display:"block",padding:0,border:"none",background:"transparent",...Xt(l)?{"--image-aspect-ratio":Yi(l)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${s}-cover-image ${Xt(l)?`${s}-cover-image-cover`:`${s}-cover-image-fit`}`,src:d,alt:"cover"})}):null]}),oe&&typeof document<"u"&&(()=>{const ee=(r?document.getElementById(r):null)??document.body;return ti.createPortal(a.jsx(Vp,{prefix:s,images:R,backgroundColor:p,thumbnailGap:_(h),thumbnailMarginBottom:_(w??.02),imageGap:_($??0),thumbnailVisibility:u,thumbnailObjectFit:C,thumbnailTrigger:v,thumbnailActive:y,thumbnailActiveColor:m,title1Width:S,title2Width:b,title3Width:H,title2MarginLeft:I??0,title3MarginLeft:B??0,title1:D,title2:O,title3:N,title1Style:q,title2Style:ie,title3Style:k,contentMarginTop:_(T??0),contentMarginLeft:_(P??0),contentMarginRight:_(W??0),closeIcon:x,closeIconMaxWidth:E,closeIconColor:V,closeIconHoverColor:g,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:f}),ee)})()]})},Up=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
8801
8824
|
import { createPortal } from 'react-dom';
|
|
8802
8825
|
import { CommonComponentProps } from '../props';
|
|
8803
8826
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -8972,7 +8995,7 @@ function getCSS(P: string): string {
|
|
|
8972
8995
|
transition: opacity \${LIGHTBOX_ANIM_MS}ms ease;
|
|
8973
8996
|
}
|
|
8974
8997
|
|
|
8975
|
-
.\${P}-thumbnails[data-
|
|
8998
|
+
.\${P}-thumbnails[data-overlay-content-hidden="true"] {
|
|
8976
8999
|
opacity: 0;
|
|
8977
9000
|
pointer-events: none;
|
|
8978
9001
|
}
|
|
@@ -9046,7 +9069,7 @@ function getCSS(P: string): string {
|
|
|
9046
9069
|
transition: opacity \${LIGHTBOX_ANIM_MS}ms ease;
|
|
9047
9070
|
}
|
|
9048
9071
|
|
|
9049
|
-
.\${P}-close-icon[data-
|
|
9072
|
+
.\${P}-close-icon[data-overlay-content-hidden="true"] {
|
|
9050
9073
|
opacity: 0;
|
|
9051
9074
|
pointer-events: none;
|
|
9052
9075
|
}
|
|
@@ -9093,10 +9116,26 @@ function getCSS(P: string): string {
|
|
|
9093
9116
|
min-width: 0;
|
|
9094
9117
|
}
|
|
9095
9118
|
|
|
9096
|
-
.\${P}-title-resize-handle
|
|
9119
|
+
.\${P}-title-resize-handle,
|
|
9120
|
+
.\${P}-padding-control-handle {
|
|
9097
9121
|
background: transparent;
|
|
9098
9122
|
}
|
|
9099
9123
|
|
|
9124
|
+
.\${P}-padding-control-handle[data-controls-axis="x"][data-controls-variant="column-padding"]::after {
|
|
9125
|
+
content: '';
|
|
9126
|
+
position: absolute;
|
|
9127
|
+
top: 50%;
|
|
9128
|
+
left: 50%;
|
|
9129
|
+
transform: translate(-50%, -50%);
|
|
9130
|
+
width: 4px;
|
|
9131
|
+
height: 12px;
|
|
9132
|
+
background: #FF5C02;
|
|
9133
|
+
border: 1px solid #FFFFFF;
|
|
9134
|
+
border-radius: 5px;
|
|
9135
|
+
box-sizing: border-box;
|
|
9136
|
+
pointer-events: none;
|
|
9137
|
+
}
|
|
9138
|
+
|
|
9100
9139
|
.\${P}-title-resize-handle::after {
|
|
9101
9140
|
content: '';
|
|
9102
9141
|
position: absolute;
|
|
@@ -9115,6 +9154,13 @@ function getCSS(P: string): string {
|
|
|
9115
9154
|
pointer-events: none;
|
|
9116
9155
|
display: flex;
|
|
9117
9156
|
flex-direction: column;
|
|
9157
|
+
opacity: 1;
|
|
9158
|
+
transition: opacity \${LIGHTBOX_ANIM_MS}ms ease;
|
|
9159
|
+
}
|
|
9160
|
+
|
|
9161
|
+
.\${P}-lightbox-content-inner[data-overlay-content-hidden="true"] {
|
|
9162
|
+
opacity: 0;
|
|
9163
|
+
pointer-events: none;
|
|
9118
9164
|
}
|
|
9119
9165
|
|
|
9120
9166
|
.\${P}-lightbox-content-area {
|
|
@@ -9392,10 +9438,7 @@ export const STRIP_TITLE_WIDTH_KEYS = ['title1Width', 'title2Width', 'title3Widt
|
|
|
9392
9438
|
export type StripTitleWidthKey = typeof STRIP_TITLE_WIDTH_KEYS[number];
|
|
9393
9439
|
|
|
9394
9440
|
const TITLE_RESIZE_HANDLE_WIDTH = 0.004;
|
|
9395
|
-
const
|
|
9396
|
-
const ARTICLE_DESIGN_WIDTH = 1440;
|
|
9397
|
-
const MIN_TITLE_WIDTH = MIN_TITLE_WIDTH_PX / ARTICLE_DESIGN_WIDTH;
|
|
9398
|
-
const STRIP_TITLES_CONTENT_WIDTH = 1;
|
|
9441
|
+
const TITLE_PADDING_HANDLE_WIDTH = 0.004;
|
|
9399
9442
|
|
|
9400
9443
|
const DEFAULT_STRIP_TITLE_WIDTHS: Record<StripTitleWidthKey, number> = {
|
|
9401
9444
|
title1Width: 0.13,
|
|
@@ -9416,7 +9459,6 @@ function getStripTitleWidthsFromSettings(
|
|
|
9416
9459
|
|
|
9417
9460
|
function resolveStripTitleWidths(
|
|
9418
9461
|
count: number,
|
|
9419
|
-
contentWidth: number,
|
|
9420
9462
|
storedWidths: number[],
|
|
9421
9463
|
): number[] {
|
|
9422
9464
|
if (count <= 0) {
|
|
@@ -9425,50 +9467,47 @@ function resolveStripTitleWidths(
|
|
|
9425
9467
|
|
|
9426
9468
|
const widths = storedWidths.slice(0, count);
|
|
9427
9469
|
const totalWidth = widths.reduce((sum, width) => sum + width, 0);
|
|
9428
|
-
|
|
9429
|
-
|
|
9430
|
-
if (totalWidth <= contentWidth || totalWidth <= minTotalWidth) {
|
|
9470
|
+
if (totalWidth <= 1) {
|
|
9431
9471
|
return widths;
|
|
9432
9472
|
}
|
|
9433
9473
|
|
|
9434
|
-
const
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9474
|
+
const { widths: shrunkWidths } = [...widths].reverse().reduce<{
|
|
9475
|
+
overflow: number;
|
|
9476
|
+
widths: number[];
|
|
9477
|
+
}>(
|
|
9478
|
+
({ overflow, widths: acc }, width) => {
|
|
9479
|
+
if (overflow <= 0 || width <= 0) {
|
|
9480
|
+
return { overflow, widths: [width, ...acc] };
|
|
9481
|
+
}
|
|
9442
9482
|
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9483
|
+
const shrinkAmount = Math.min(overflow, width);
|
|
9484
|
+
return {
|
|
9485
|
+
overflow: overflow - shrinkAmount,
|
|
9486
|
+
widths: [width - shrinkAmount, ...acc],
|
|
9487
|
+
};
|
|
9488
|
+
},
|
|
9489
|
+
{ overflow: totalWidth - 1, widths: [] },
|
|
9490
|
+
);
|
|
9447
9491
|
|
|
9448
|
-
return
|
|
9492
|
+
return shrunkWidths;
|
|
9449
9493
|
}
|
|
9450
9494
|
|
|
9451
9495
|
function getEffectiveStripTitleWidths(
|
|
9452
9496
|
count: number,
|
|
9453
|
-
contentWidth: number,
|
|
9454
9497
|
storedWidths: number[],
|
|
9455
9498
|
): number[] {
|
|
9456
|
-
return resolveStripTitleWidths(count,
|
|
9499
|
+
return resolveStripTitleWidths(count, storedWidths);
|
|
9457
9500
|
}
|
|
9458
9501
|
|
|
9459
9502
|
function getStripTitleMaxWidth(
|
|
9460
9503
|
columnIndex: number,
|
|
9461
9504
|
resolvedWidths: number[],
|
|
9462
|
-
contentWidth: number,
|
|
9463
9505
|
): number {
|
|
9464
9506
|
const otherWidths = resolvedWidths
|
|
9465
9507
|
.filter((_, index) => index !== columnIndex)
|
|
9466
9508
|
.reduce((sum, width) => sum + width, 0);
|
|
9467
9509
|
|
|
9468
|
-
return Math.max(
|
|
9469
|
-
MIN_TITLE_WIDTH,
|
|
9470
|
-
contentWidth - otherWidths,
|
|
9471
|
-
);
|
|
9510
|
+
return Math.max(1 - otherWidths);
|
|
9472
9511
|
}
|
|
9473
9512
|
|
|
9474
9513
|
type StripTitleSlot = {
|
|
@@ -9549,6 +9588,20 @@ function resolveStripTextFields(
|
|
|
9549
9588
|
};
|
|
9550
9589
|
}
|
|
9551
9590
|
|
|
9591
|
+
function getStripTitleOffsetBeforeSlot(
|
|
9592
|
+
slots: StripTitleSlot[],
|
|
9593
|
+
resolvedWidths: number[],
|
|
9594
|
+
marginByKey: Record<'title2MarginLeft' | 'title3MarginLeft', number>,
|
|
9595
|
+
slotIndex: number,
|
|
9596
|
+
): number {
|
|
9597
|
+
return slots.slice(0, slotIndex).reduce(
|
|
9598
|
+
(offset, slot, index) => offset
|
|
9599
|
+
+ (slot?.marginLeftKey ? marginByKey[slot.marginLeftKey] ?? 0 : 0)
|
|
9600
|
+
+ (resolvedWidths[index] ?? 0),
|
|
9601
|
+
0,
|
|
9602
|
+
);
|
|
9603
|
+
}
|
|
9604
|
+
|
|
9552
9605
|
function stripTextFieldsToCss(
|
|
9553
9606
|
prefix: StripTextStylePrefix,
|
|
9554
9607
|
fields: ResolvedStripTextFields,
|
|
@@ -9654,9 +9707,9 @@ const LightboxOverlay = ({
|
|
|
9654
9707
|
title3MarginLeft,
|
|
9655
9708
|
onClose,
|
|
9656
9709
|
}: LightboxOverlayProps) => {
|
|
9657
|
-
const showControls =
|
|
9658
|
-
const
|
|
9659
|
-
const
|
|
9710
|
+
const showControls = isEditMode;
|
|
9711
|
+
const allowImageScroll = !isEditMode && (!isEditor || isPreviewMode);
|
|
9712
|
+
const hideOverlayContentOnIdle = allowImageScroll;
|
|
9660
9713
|
const allowMouseDrag = allowImageScroll;
|
|
9661
9714
|
const allowThumbnailHover = allowImageScroll;
|
|
9662
9715
|
const isThumbCover = isImageRatioCover(thumbnailObjectFit);
|
|
@@ -9664,27 +9717,6 @@ const LightboxOverlay = ({
|
|
|
9664
9717
|
? ({ '--image-aspect-ratio': getAspectRatio(thumbnailObjectFit) } as React.CSSProperties)
|
|
9665
9718
|
: undefined;
|
|
9666
9719
|
|
|
9667
|
-
const renderGapControl = (controlKey: string, gap: string, isReverse = false) => {
|
|
9668
|
-
const gapControlSize = getGapControlSize(gap);
|
|
9669
|
-
const gapControlRight = \`calc(-0.5 * (\${gapControlSize} + \${gap}))\`;
|
|
9670
|
-
return (
|
|
9671
|
-
<div
|
|
9672
|
-
data-controls={controlKey}
|
|
9673
|
-
data-controls-axis="x"
|
|
9674
|
-
{...(isReverse ? { 'data-controls-reverse': 'true' } : undefined)}
|
|
9675
|
-
style={{
|
|
9676
|
-
position: 'absolute',
|
|
9677
|
-
top: 0,
|
|
9678
|
-
right: gapControlRight,
|
|
9679
|
-
width: gapControlSize,
|
|
9680
|
-
height: '100%',
|
|
9681
|
-
pointerEvents: 'auto',
|
|
9682
|
-
zIndex: 3,
|
|
9683
|
-
}}
|
|
9684
|
-
/>
|
|
9685
|
-
);
|
|
9686
|
-
};
|
|
9687
|
-
|
|
9688
9720
|
const hasTitles = Boolean(title1 || title2 || title3);
|
|
9689
9721
|
const titleSlots = useMemo(
|
|
9690
9722
|
() => buildStripTitleSlots(P, title1, title2, title3, title1Style, title2Style, title3Style),
|
|
@@ -9703,11 +9735,11 @@ const LightboxOverlay = ({
|
|
|
9703
9735
|
[titleSlots, titleWidthByKey],
|
|
9704
9736
|
);
|
|
9705
9737
|
const resolvedTitleWidths = useMemo(
|
|
9706
|
-
() => resolveStripTitleWidths(titleSlots.length,
|
|
9738
|
+
() => resolveStripTitleWidths(titleSlots.length, storedTitleWidths),
|
|
9707
9739
|
[titleSlots.length, storedTitleWidths],
|
|
9708
9740
|
);
|
|
9709
9741
|
const effectiveTitleWidths = useMemo(
|
|
9710
|
-
() => getEffectiveStripTitleWidths(titleSlots.length,
|
|
9742
|
+
() => getEffectiveStripTitleWidths(titleSlots.length, storedTitleWidths),
|
|
9711
9743
|
[titleSlots.length, storedTitleWidths],
|
|
9712
9744
|
);
|
|
9713
9745
|
const scaledTitleWidth = useCallback(
|
|
@@ -9722,56 +9754,72 @@ const LightboxOverlay = ({
|
|
|
9722
9754
|
[title2MarginLeft, title3MarginLeft],
|
|
9723
9755
|
);
|
|
9724
9756
|
const getTitleBoundaryOffset = useCallback(
|
|
9725
|
-
(upToIndex: number) =>
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
}
|
|
9732
|
-
offset += resolvedTitleWidths[index] ?? 0;
|
|
9733
|
-
}
|
|
9734
|
-
return offset;
|
|
9735
|
-
},
|
|
9757
|
+
(upToIndex: number) => titleSlots.slice(0, upToIndex + 1).reduce(
|
|
9758
|
+
(offset, slot, index) => offset
|
|
9759
|
+
+ (slot?.marginLeftKey ? titleMarginLeftByKey[slot.marginLeftKey] ?? 0 : 0)
|
|
9760
|
+
+ (resolvedTitleWidths[index] ?? 0),
|
|
9761
|
+
0,
|
|
9762
|
+
),
|
|
9736
9763
|
[titleSlots, titleMarginLeftByKey, resolvedTitleWidths],
|
|
9737
9764
|
);
|
|
9738
9765
|
|
|
9739
|
-
const renderTitles = () => titleSlots.
|
|
9766
|
+
const renderTitles = () => titleSlots.map((slot, index) => {
|
|
9740
9767
|
const marginLeft = slot.marginLeftKey
|
|
9741
9768
|
? titleMarginLeftByKey[slot.marginLeftKey] ?? 0
|
|
9742
9769
|
: 0;
|
|
9743
|
-
const elements = [];
|
|
9744
|
-
|
|
9745
|
-
if (slot.marginLeftKey) {
|
|
9746
|
-
elements.push(
|
|
9747
|
-
<div
|
|
9748
|
-
key={\`\${slot.className}-margin\`}
|
|
9749
|
-
data-controls={showControls ? slot.marginLeftKey : undefined}
|
|
9750
|
-
data-controls-axis={showControls ? 'x' : undefined}
|
|
9751
|
-
className={showControls ? \`\${P}-control\` : undefined}
|
|
9752
|
-
style={{ width: scaledTitleWidth(marginLeft), flexShrink: 0 }}
|
|
9753
|
-
/>,
|
|
9754
|
-
);
|
|
9755
|
-
}
|
|
9756
9770
|
|
|
9757
|
-
|
|
9771
|
+
return (
|
|
9758
9772
|
<div
|
|
9759
9773
|
key={slot.className}
|
|
9760
9774
|
className={\`\${P}-title-cell\`}
|
|
9761
|
-
style={{
|
|
9775
|
+
style={{
|
|
9776
|
+
width: scaledTitleWidth(effectiveTitleWidths[index] ?? 0),
|
|
9777
|
+
...(marginLeft > 0 ? { marginLeft: scaledTitleWidth(marginLeft) } : {}),
|
|
9778
|
+
}}
|
|
9762
9779
|
>
|
|
9763
9780
|
<p className={slot.className} style={slot.style}>{slot.text}</p>
|
|
9764
|
-
</div
|
|
9781
|
+
</div>
|
|
9782
|
+
);
|
|
9783
|
+
});
|
|
9784
|
+
|
|
9785
|
+
const renderTitleMarginControls = () => titleSlots.flatMap((slot, colIndex) => {
|
|
9786
|
+
if (!slot.marginLeftKey) return [];
|
|
9787
|
+
|
|
9788
|
+
const marginLeft = titleMarginLeftByKey[slot.marginLeftKey] ?? 0;
|
|
9789
|
+
const offsetBeforeMargin = getStripTitleOffsetBeforeSlot(
|
|
9790
|
+
titleSlots,
|
|
9791
|
+
resolvedTitleWidths,
|
|
9792
|
+
titleMarginLeftByKey,
|
|
9793
|
+
colIndex,
|
|
9765
9794
|
);
|
|
9795
|
+
const marginHandleWidth = Math.max(marginLeft, TITLE_PADDING_HANDLE_WIDTH);
|
|
9766
9796
|
|
|
9767
|
-
return
|
|
9797
|
+
return (
|
|
9798
|
+
<div
|
|
9799
|
+
key={slot.marginLeftKey}
|
|
9800
|
+
data-controls={slot.marginLeftKey}
|
|
9801
|
+
data-controls-static-handle=""
|
|
9802
|
+
data-controls-axis="x"
|
|
9803
|
+
data-controls-variant="column-padding"
|
|
9804
|
+
data-controls-min="0"
|
|
9805
|
+
data-controls-max-fraction={String(resolvedTitleWidths[colIndex])}
|
|
9806
|
+
className={\`\${P}-padding-control-handle\`}
|
|
9807
|
+
style={{
|
|
9808
|
+
position: 'absolute',
|
|
9809
|
+
top: 0,
|
|
9810
|
+
left: scaledTitleWidth(offsetBeforeMargin),
|
|
9811
|
+
width: scaledTitleWidth(marginHandleWidth),
|
|
9812
|
+
height: '100%',
|
|
9813
|
+
pointerEvents: 'auto',
|
|
9814
|
+
}}
|
|
9815
|
+
/>
|
|
9816
|
+
);
|
|
9768
9817
|
});
|
|
9769
9818
|
|
|
9770
9819
|
const renderTitleWidthControls = () => titleSlots.map((slot, colIndex) => {
|
|
9771
9820
|
const maxTitleWidth = getStripTitleMaxWidth(
|
|
9772
9821
|
colIndex,
|
|
9773
9822
|
resolvedTitleWidths,
|
|
9774
|
-
STRIP_TITLES_CONTENT_WIDTH,
|
|
9775
9823
|
);
|
|
9776
9824
|
const boundaryOffset = getTitleBoundaryOffset(colIndex);
|
|
9777
9825
|
const titleWidthHandleOffset = boundaryOffset - TITLE_RESIZE_HANDLE_WIDTH / 2;
|
|
@@ -9782,7 +9830,6 @@ const LightboxOverlay = ({
|
|
|
9782
9830
|
data-controls={slot.widthKey}
|
|
9783
9831
|
data-controls-static-handle=""
|
|
9784
9832
|
data-controls-axis="x"
|
|
9785
|
-
data-controls-min={String(MIN_TITLE_WIDTH_PX)}
|
|
9786
9833
|
data-controls-max-fraction={String(maxTitleWidth)}
|
|
9787
9834
|
data-controls-variant="column-width"
|
|
9788
9835
|
className={\`\${P}-title-resize-handle\`}
|
|
@@ -9818,26 +9865,27 @@ const LightboxOverlay = ({
|
|
|
9818
9865
|
);
|
|
9819
9866
|
const [isMouseDragging, setIsMouseDragging] = useState(false);
|
|
9820
9867
|
const [isVisible, setIsVisible] = useState(false);
|
|
9821
|
-
const [
|
|
9868
|
+
const [overlayContentVisible, setOverlayContentVisible] = useState(true);
|
|
9822
9869
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
9823
9870
|
const activeIndexRef = useRef(activeIndex);
|
|
9824
9871
|
activeIndexRef.current = activeIndex;
|
|
9825
9872
|
const lockedActiveIndexRef = useRef<number | null>(null);
|
|
9826
9873
|
const isClosingRef = useRef(false);
|
|
9827
9874
|
const closeTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
9828
|
-
const
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9875
|
+
const overlayContentIdleTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
9876
|
+
const isOverlayContentHidden = hideOverlayContentOnIdle && !overlayContentVisible;
|
|
9877
|
+
|
|
9878
|
+
const resetOverlayContentIdleTimer = useCallback(() => {
|
|
9879
|
+
if (!hideOverlayContentOnIdle) return;
|
|
9880
|
+
setOverlayContentVisible(true);
|
|
9881
|
+
if (overlayContentIdleTimerRef.current) {
|
|
9882
|
+
clearTimeout(overlayContentIdleTimerRef.current);
|
|
9835
9883
|
}
|
|
9836
|
-
|
|
9884
|
+
overlayContentIdleTimerRef.current = setTimeout(() => {
|
|
9837
9885
|
if (mouseDragRef.current.isActive) return;
|
|
9838
|
-
|
|
9886
|
+
setOverlayContentVisible(false);
|
|
9839
9887
|
}, CONTROLS_IDLE_MS);
|
|
9840
|
-
}, [
|
|
9888
|
+
}, [hideOverlayContentOnIdle]);
|
|
9841
9889
|
|
|
9842
9890
|
const handleClose = useCallback(() => {
|
|
9843
9891
|
if (isEditMode || isClosingRef.current) return;
|
|
@@ -9858,11 +9906,11 @@ const LightboxOverlay = ({
|
|
|
9858
9906
|
isSwipeDragging,
|
|
9859
9907
|
backdropStyle: swipeBackdropStyle,
|
|
9860
9908
|
mediaAreaStyle,
|
|
9861
|
-
|
|
9909
|
+
overlayContentStyle: swipeOverlayContentStyle,
|
|
9862
9910
|
swipeHandlers,
|
|
9863
9911
|
dismissAreaStyle,
|
|
9864
9912
|
} = useLightboxSwipeDismiss({
|
|
9865
|
-
enabled: allowImageScroll,
|
|
9913
|
+
enabled: allowImageScroll ?? false,
|
|
9866
9914
|
onClose: handleClose,
|
|
9867
9915
|
animMs: LIGHTBOX_ANIM_MS,
|
|
9868
9916
|
isBlockedTarget: isDragBlockedTarget,
|
|
@@ -9902,19 +9950,16 @@ const LightboxOverlay = ({
|
|
|
9902
9950
|
}
|
|
9903
9951
|
};
|
|
9904
9952
|
|
|
9905
|
-
const getNearestFlatIndex = (scrollLeft = stripRef.current?.scrollLeft ?? 0) =>
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
itemRefs.current.forEach((item, flatIndex) => {
|
|
9909
|
-
if (!item) return;
|
|
9953
|
+
const getNearestFlatIndex = (scrollLeft = stripRef.current?.scrollLeft ?? 0) => itemRefs.current.reduce(
|
|
9954
|
+
(closest, item, flatIndex) => {
|
|
9955
|
+
if (!item) return closest;
|
|
9910
9956
|
const distance = Math.abs(item.offsetLeft - scrollLeft);
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
|
|
9915
|
-
}
|
|
9916
|
-
|
|
9917
|
-
};
|
|
9957
|
+
return distance < closest.distance
|
|
9958
|
+
? { flatIndex, distance }
|
|
9959
|
+
: closest;
|
|
9960
|
+
},
|
|
9961
|
+
{ flatIndex: 0, distance: Infinity },
|
|
9962
|
+
).flatIndex;
|
|
9918
9963
|
|
|
9919
9964
|
const updateActiveIndex = () => {
|
|
9920
9965
|
if (!stripRef.current || images.length === 0) return;
|
|
@@ -9924,7 +9969,6 @@ const LightboxOverlay = ({
|
|
|
9924
9969
|
|
|
9925
9970
|
const releaseActiveIndexLock = () => {
|
|
9926
9971
|
lockedActiveIndexRef.current = null;
|
|
9927
|
-
updateActiveIndex();
|
|
9928
9972
|
};
|
|
9929
9973
|
|
|
9930
9974
|
const setStripSnapEnabled = (enabled: boolean) => {
|
|
@@ -10027,18 +10071,16 @@ const LightboxOverlay = ({
|
|
|
10027
10071
|
? (nextItem ? nextItem.offsetLeft - currentItem.offsetLeft : currentItem.offsetWidth)
|
|
10028
10072
|
: 0;
|
|
10029
10073
|
|
|
10030
|
-
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
targetFlatIndex = Math.max(0, Math.min(flatItems.length - 1, targetFlatIndex));
|
|
10041
|
-
}
|
|
10074
|
+
const scrollAdjustment = span > 0
|
|
10075
|
+
? (scrollDelta > span * DRAG_SNAP_RATIO
|
|
10076
|
+
? 1
|
|
10077
|
+
: scrollDelta < -span * DRAG_SNAP_RATIO
|
|
10078
|
+
? -1
|
|
10079
|
+
: 0)
|
|
10080
|
+
: 0;
|
|
10081
|
+
const targetFlatIndex = isLoopEnabled
|
|
10082
|
+
? currentFlatIndex + scrollAdjustment
|
|
10083
|
+
: Math.max(0, Math.min(flatItems.length - 1, currentFlatIndex + scrollAdjustment));
|
|
10042
10084
|
|
|
10043
10085
|
const targetItem = itemRefs.current[targetFlatIndex];
|
|
10044
10086
|
if (!targetItem) {
|
|
@@ -10046,9 +10088,15 @@ const LightboxOverlay = ({
|
|
|
10046
10088
|
return;
|
|
10047
10089
|
}
|
|
10048
10090
|
|
|
10091
|
+
const snapTargetIndex = targetFlatIndex % images.length;
|
|
10092
|
+
if (behavior === 'smooth') {
|
|
10093
|
+
lockedActiveIndexRef.current = snapTargetIndex;
|
|
10094
|
+
}
|
|
10095
|
+
setActiveIndex(snapTargetIndex);
|
|
10049
10096
|
scrollStripTo(targetItem.offsetLeft, {
|
|
10050
10097
|
behavior,
|
|
10051
|
-
activeIndex:
|
|
10098
|
+
activeIndex: snapTargetIndex,
|
|
10099
|
+
onComplete: behavior === 'smooth' ? releaseActiveIndexLock : undefined,
|
|
10052
10100
|
});
|
|
10053
10101
|
};
|
|
10054
10102
|
|
|
@@ -10078,6 +10126,7 @@ const LightboxOverlay = ({
|
|
|
10078
10126
|
if (!strip) return;
|
|
10079
10127
|
cancelScrollAnimation();
|
|
10080
10128
|
clearStripTrackTransform();
|
|
10129
|
+
lockedActiveIndexRef.current = null;
|
|
10081
10130
|
mouseDragRef.current = {
|
|
10082
10131
|
isActive: true,
|
|
10083
10132
|
startX: event.clientX,
|
|
@@ -10085,7 +10134,7 @@ const LightboxOverlay = ({
|
|
|
10085
10134
|
hasMoved: false,
|
|
10086
10135
|
};
|
|
10087
10136
|
setStripSnapEnabled(false);
|
|
10088
|
-
|
|
10137
|
+
resetOverlayContentIdleTimer();
|
|
10089
10138
|
strip.setPointerCapture(event.pointerId);
|
|
10090
10139
|
};
|
|
10091
10140
|
|
|
@@ -10104,7 +10153,7 @@ const LightboxOverlay = ({
|
|
|
10104
10153
|
strip.scrollLeft = mouseDragRef.current.scrollLeft - deltaX;
|
|
10105
10154
|
normalizeInfiniteScroll(true);
|
|
10106
10155
|
updateActiveIndex();
|
|
10107
|
-
|
|
10156
|
+
resetOverlayContentIdleTimer();
|
|
10108
10157
|
}
|
|
10109
10158
|
};
|
|
10110
10159
|
|
|
@@ -10127,7 +10176,7 @@ const LightboxOverlay = ({
|
|
|
10127
10176
|
setStripSnapEnabled(true);
|
|
10128
10177
|
updateActiveIndex();
|
|
10129
10178
|
}
|
|
10130
|
-
|
|
10179
|
+
resetOverlayContentIdleTimer();
|
|
10131
10180
|
};
|
|
10132
10181
|
|
|
10133
10182
|
useLightboxScrollLock();
|
|
@@ -10140,31 +10189,31 @@ const LightboxOverlay = ({
|
|
|
10140
10189
|
if (closeTimeoutRef.current) {
|
|
10141
10190
|
clearTimeout(closeTimeoutRef.current);
|
|
10142
10191
|
}
|
|
10143
|
-
if (
|
|
10144
|
-
clearTimeout(
|
|
10192
|
+
if (overlayContentIdleTimerRef.current) {
|
|
10193
|
+
clearTimeout(overlayContentIdleTimerRef.current);
|
|
10145
10194
|
}
|
|
10146
10195
|
};
|
|
10147
10196
|
}, []);
|
|
10148
10197
|
|
|
10149
10198
|
useEffect(() => {
|
|
10150
|
-
if (!
|
|
10151
|
-
|
|
10199
|
+
if (!hideOverlayContentOnIdle) {
|
|
10200
|
+
setOverlayContentVisible(true);
|
|
10152
10201
|
return;
|
|
10153
10202
|
}
|
|
10154
|
-
|
|
10203
|
+
resetOverlayContentIdleTimer();
|
|
10155
10204
|
const dismissArea = dismissAreaRef.current;
|
|
10156
10205
|
if (!dismissArea) return;
|
|
10157
|
-
const onPointerActivity = () =>
|
|
10206
|
+
const onPointerActivity = () => resetOverlayContentIdleTimer();
|
|
10158
10207
|
dismissArea.addEventListener('pointermove', onPointerActivity);
|
|
10159
10208
|
dismissArea.addEventListener('pointerdown', onPointerActivity);
|
|
10160
10209
|
return () => {
|
|
10161
10210
|
dismissArea.removeEventListener('pointermove', onPointerActivity);
|
|
10162
10211
|
dismissArea.removeEventListener('pointerdown', onPointerActivity);
|
|
10163
|
-
if (
|
|
10164
|
-
clearTimeout(
|
|
10212
|
+
if (overlayContentIdleTimerRef.current) {
|
|
10213
|
+
clearTimeout(overlayContentIdleTimerRef.current);
|
|
10165
10214
|
}
|
|
10166
10215
|
};
|
|
10167
|
-
}, [
|
|
10216
|
+
}, [hideOverlayContentOnIdle, resetOverlayContentIdleTimer]);
|
|
10168
10217
|
|
|
10169
10218
|
useEffect(() => {
|
|
10170
10219
|
const onKeyDown = (event: KeyboardEvent) => {
|
|
@@ -10204,30 +10253,11 @@ const LightboxOverlay = ({
|
|
|
10204
10253
|
useEffect(() => {
|
|
10205
10254
|
const strip = stripRef.current;
|
|
10206
10255
|
if (!strip) return;
|
|
10207
|
-
let scrollEndTimer: ReturnType<typeof setTimeout> | null = null;
|
|
10208
10256
|
const onScroll = () => {
|
|
10209
10257
|
normalizeInfiniteScroll();
|
|
10210
10258
|
updateActiveIndex();
|
|
10211
|
-
if (lockedActiveIndexRef.current !== null) {
|
|
10212
|
-
if (scrollEndTimer) clearTimeout(scrollEndTimer);
|
|
10213
|
-
scrollEndTimer = setTimeout(() => {
|
|
10214
|
-
if (lockedActiveIndexRef.current !== null) {
|
|
10215
|
-
releaseActiveIndexLock();
|
|
10216
|
-
}
|
|
10217
|
-
}, 150);
|
|
10218
|
-
}
|
|
10219
|
-
};
|
|
10220
|
-
const onScrollEnd = () => {
|
|
10221
|
-
if (lockedActiveIndexRef.current !== null) {
|
|
10222
|
-
if (scrollEndTimer) {
|
|
10223
|
-
clearTimeout(scrollEndTimer);
|
|
10224
|
-
scrollEndTimer = null;
|
|
10225
|
-
}
|
|
10226
|
-
releaseActiveIndexLock();
|
|
10227
|
-
}
|
|
10228
10259
|
};
|
|
10229
10260
|
strip.addEventListener('scroll', onScroll, { passive: true });
|
|
10230
|
-
strip.addEventListener('scrollend', onScrollEnd);
|
|
10231
10261
|
const observer = new ResizeObserver(() => {
|
|
10232
10262
|
measureSetWidth();
|
|
10233
10263
|
normalizeInfiniteScroll();
|
|
@@ -10235,10 +10265,8 @@ const LightboxOverlay = ({
|
|
|
10235
10265
|
});
|
|
10236
10266
|
observer.observe(strip);
|
|
10237
10267
|
return () => {
|
|
10238
|
-
if (scrollEndTimer) clearTimeout(scrollEndTimer);
|
|
10239
10268
|
cancelScrollAnimation();
|
|
10240
10269
|
strip.removeEventListener('scroll', onScroll);
|
|
10241
|
-
strip.removeEventListener('scrollend', onScrollEnd);
|
|
10242
10270
|
observer.disconnect();
|
|
10243
10271
|
};
|
|
10244
10272
|
}, [images.length, isLoopEnabled]);
|
|
@@ -10339,12 +10367,13 @@ const LightboxOverlay = ({
|
|
|
10339
10367
|
</div>
|
|
10340
10368
|
<div
|
|
10341
10369
|
className={\`\${P}-lightbox-content-inner\`}
|
|
10370
|
+
data-overlay-content-hidden={isOverlayContentHidden ? 'true' : 'false'}
|
|
10342
10371
|
style={{
|
|
10343
10372
|
width: '100%',
|
|
10344
10373
|
height: '100%',
|
|
10345
10374
|
top: 0,
|
|
10346
10375
|
bottom: 0,
|
|
10347
|
-
...
|
|
10376
|
+
...swipeOverlayContentStyle,
|
|
10348
10377
|
}}
|
|
10349
10378
|
>
|
|
10350
10379
|
<div
|
|
@@ -10370,13 +10399,18 @@ const LightboxOverlay = ({
|
|
|
10370
10399
|
{hasTitles && (
|
|
10371
10400
|
<div className={\`\${P}-titles-row\`}>
|
|
10372
10401
|
{renderTitles()}
|
|
10373
|
-
{showControls && titleSlots.length > 0 ?
|
|
10402
|
+
{showControls && titleSlots.length > 0 ? (
|
|
10403
|
+
<>
|
|
10404
|
+
{renderTitleMarginControls()}
|
|
10405
|
+
{renderTitleWidthControls()}
|
|
10406
|
+
</>
|
|
10407
|
+
) : null}
|
|
10374
10408
|
</div>
|
|
10375
10409
|
)}
|
|
10376
10410
|
{closeIcon && (
|
|
10377
10411
|
<div
|
|
10378
10412
|
className={\`\${P}-close-icon\`}
|
|
10379
|
-
data-
|
|
10413
|
+
data-overlay-content-hidden={isOverlayContentHidden ? 'true' : 'false'}
|
|
10380
10414
|
style={{
|
|
10381
10415
|
width: scalingValue(closeIconMaxWidth ?? 0, isEditor),
|
|
10382
10416
|
height: scalingValue(closeIconMaxWidth ?? 0, isEditor),
|
|
@@ -10411,13 +10445,13 @@ const LightboxOverlay = ({
|
|
|
10411
10445
|
className={\`\${P}-thumbnails\`}
|
|
10412
10446
|
data-lightbox-scrollable=""
|
|
10413
10447
|
data-thumbnail-active={thumbnailActive}
|
|
10414
|
-
data-
|
|
10448
|
+
data-overlay-content-hidden={isOverlayContentHidden ? 'true' : 'false'}
|
|
10415
10449
|
onClick={(event) => event.stopPropagation()}
|
|
10416
10450
|
style={{
|
|
10417
10451
|
gap: thumbnailGap,
|
|
10418
10452
|
bottom: thumbnailMarginBottom,
|
|
10419
10453
|
'--thumbnail-active-color': thumbnailActiveColor,
|
|
10420
|
-
...
|
|
10454
|
+
...swipeOverlayContentStyle,
|
|
10421
10455
|
} as React.CSSProperties}
|
|
10422
10456
|
>
|
|
10423
10457
|
{images.map((item, index) => {
|
|
@@ -10616,7 +10650,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10616
10650
|
</>
|
|
10617
10651
|
);
|
|
10618
10652
|
};
|
|
10619
|
-
`,Kp="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 Gp(e){const t={};return t[Ge(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ge(e,"fontSettings")]={...pn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ge(e,"fontSize")]={...pn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ge(e,"lineHeight")]={...pn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ge(e,"letterSpacing")]={...pn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ge(e,"wordSpacing")]={...pn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ge(e,"textAlign")]={...pn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ge(e,"textAppearance")]={...pn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Up=ci.reduce((e,t)=>({...e,...Gp(t)}),{}),qp=ci.reduce((e,t)=>({...e,[Ge(t,"fontFamily")]:"Arial",[Ge(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ge(t,"letterSpacing")]:0,[Ge(t,"wordSpacing")]:0,[Ge(t,"textAlign")]:"left",[Ge(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Qr(e){return ci.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ge(n,"fontSize")]=i),o!==void 0&&(t[Ge(n,"lineHeight")]=o),t},{})}const Xp=Ap(),Yp={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"}},...Up,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:Kp,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",...qp},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:[Xp]}],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"}}]}},Jp={element:zp,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:Yp,sourceCode:Vp,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:ci.map(e=>({path:`styles.${Ge(e,"fontSettings")}`}))}},fo=300,Eo=400,ea=300,Zp=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)},Qp=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))},em=(e,t)=>{if(os(t)){if(e){window.history.back();return}Qp(t)}};function tm(e){return`
|
|
10653
|
+
`,Gp="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 qp(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 Xp=di.reduce((e,t)=>({...e,...qp(t)}),{}),Yp=di.reduce((e,t)=>({...e,[Ye(t,"fontFamily")]:"Arial",[Ye(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ye(t,"letterSpacing")]:0,[Ye(t,"wordSpacing")]:0,[Ye(t,"textAlign")]:"left",[Ye(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Qr(e){return di.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ye(n,"fontSize")]=i),o!==void 0&&(t[Ye(n,"lineHeight")]=o),t},{})}const Jp=Mp(),Zp={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,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"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,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},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"}},...Xp,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},contentMarginLeft:{type:"number",scope:"layout",title:"Content margin left",min:0,display:{type:"range-control"}},contentMarginRight:{type:"number",scope:"layout",title:"Content margin right",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/LightboxJournal_1.jpg",coverFit:{display:"Cover",ratioValue:"16:9",reversed:!1},closeIcon:Gp,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",...Yp},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:[Jp]}],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:Kp,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:Zp,sourceCode:Up,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:di.map(e=>({path:`styles.${Ye(e,"fontSettings")}`}))}},fo=300,Eo=400,ea=300,em=50,ta=10,ir="cntrl-lightbox-journal",Ji=ir,_o=`${ir}-`,Zi=e=>`${ir}-${e}`,or=e=>e===Ji||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(Zi(e)));if(i)return i}const n=na(t.get(Ji));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 r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}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(s=>{or(s)&&i.searchParams.delete(s)}),t?i.searchParams.set(Zi(t),String(e)):i.searchParams.set(Ji,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},tm=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Zi(e)||i===Ji:or(i));if(n.forEach(i=>t.searchParams.delete(i)),n.length>0){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},os=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Zi(e)):[...t.keys()].some(n=>or(n))},nm=(e,t)=>{if(os(t)){if(e){window.history.back();return}tm(t)}};function im(e){return`
|
|
10620
10654
|
.${e}-wrapper {
|
|
10621
10655
|
position: relative;
|
|
10622
10656
|
width: 100%;
|
|
@@ -10879,13 +10913,13 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10879
10913
|
min-width: 0;
|
|
10880
10914
|
display: flex;
|
|
10881
10915
|
flex-direction: row;
|
|
10882
|
-
align-items: center;
|
|
10883
10916
|
}
|
|
10884
10917
|
|
|
10885
10918
|
.${e}-title-cell {
|
|
10886
10919
|
position: relative;
|
|
10887
|
-
flex: 0
|
|
10920
|
+
flex: 0 0 auto;
|
|
10888
10921
|
min-width: 0;
|
|
10922
|
+
box-sizing: border-box;
|
|
10889
10923
|
}
|
|
10890
10924
|
|
|
10891
10925
|
.${e}-text-bar-cell {
|
|
@@ -10900,10 +10934,41 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10900
10934
|
.${e}-title2,
|
|
10901
10935
|
.${e}-title3 {
|
|
10902
10936
|
margin: 0;
|
|
10903
|
-
flex-shrink: 1;
|
|
10904
10937
|
min-width: 0;
|
|
10905
10938
|
}
|
|
10906
10939
|
|
|
10940
|
+
.${e}-title-resize-handle,
|
|
10941
|
+
.${e}-padding-control-handle {
|
|
10942
|
+
background: transparent;
|
|
10943
|
+
}
|
|
10944
|
+
|
|
10945
|
+
.${e}-padding-control-handle[data-controls-axis="x"][data-controls-variant="column-padding"]::after {
|
|
10946
|
+
content: '';
|
|
10947
|
+
position: absolute;
|
|
10948
|
+
top: 50%;
|
|
10949
|
+
left: 50%;
|
|
10950
|
+
transform: translate(-50%, -50%);
|
|
10951
|
+
width: 4px;
|
|
10952
|
+
height: 12px;
|
|
10953
|
+
background: #FF5C02;
|
|
10954
|
+
border: 1px solid #FFFFFF;
|
|
10955
|
+
border-radius: 5px;
|
|
10956
|
+
box-sizing: border-box;
|
|
10957
|
+
pointer-events: none;
|
|
10958
|
+
}
|
|
10959
|
+
|
|
10960
|
+
.${e}-title-resize-handle::after {
|
|
10961
|
+
content: '';
|
|
10962
|
+
position: absolute;
|
|
10963
|
+
top: 0;
|
|
10964
|
+
left: 50%;
|
|
10965
|
+
transform: translateX(-50%);
|
|
10966
|
+
width: 2px;
|
|
10967
|
+
height: 100%;
|
|
10968
|
+
background: #FF5C02;
|
|
10969
|
+
pointer-events: none;
|
|
10970
|
+
}
|
|
10971
|
+
|
|
10907
10972
|
.${e}-titles-stack {
|
|
10908
10973
|
position: relative;
|
|
10909
10974
|
display: flex;
|
|
@@ -10954,7 +11019,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10954
11019
|
animation: ${e}-titles-fade-out ${Eo}ms ease-in-out forwards;
|
|
10955
11020
|
}
|
|
10956
11021
|
|
|
10957
|
-
.${e}-lightbox-
|
|
11022
|
+
.${e}-lightbox-overlay-content {
|
|
10958
11023
|
position: absolute;
|
|
10959
11024
|
inset: 0;
|
|
10960
11025
|
z-index: 3;
|
|
@@ -11011,7 +11076,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
11011
11076
|
pointer-events: auto;
|
|
11012
11077
|
z-index: 10;
|
|
11013
11078
|
}
|
|
11014
|
-
`}const nm=20,im=2,ra=e=>`max(${e}, ${nm}px)`,kn=e=>((e==null?void 0:e.image)??[]).slice(0,im),rs=e=>e.reduce((t,n)=>t+kn(n).length,0),om=(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}},rm=(e,t)=>{const n=rs(e),{start:i,end:o}=om(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)})),am=(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 rm(i,o)},aa=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",sm=(e,t,n)=>e==="B"?t.length>1:rs(n)>1,lm=({prefix:e,entries:t,journalType:n,coverFit:i,backgroundColor:o,imageGap:a,slideMaxWidth:l,slideMaxHeight:d,isEditor:s,isEditMode:p,isPreviewMode:u,closeIcon:$,closeIconMaxWidth:b,closeIconColor:y,closeIconHoverColor:m,textMaxWidth:h,titlesGap:T,countCloseGap:L,textTransition:x,title1Style:S,title2Style:O,title3Style:R,countStyle:B,contentMarginTop:w,contentMarginLeft:P,contentMarginRight:j,initialSlideIndex:g=0,enableUrlSync:C=!1,journalItemId:A=null,onBeforeClose:H,onClose:V})=>{const Q=!!p,k=!s||!!u,_=!p&&(!s||!!u),E=c.useMemo(()=>_i(t,n),[t,n]),[M,W]=c.useState(g),z=E[M],K=z==null?void 0:z.entry,[ie,F]=c.useState(!1),[J,f]=c.useState(null),[ne,xe]=c.useState(!1),[pe,ve]=c.useState(null),[se,fe]=c.useState(!1),[G,ee]=c.useState(0),[le,oe]=c.useState(),[Le,$e]=c.useState(),[_e,Se]=c.useState(null),Ie=c.useRef(null),D=c.useRef(0),ue=c.useRef(0),N=c.useRef(0),X=c.useRef(!1),U=c.useRef(null),te=c.useRef(null),de=c.useRef(null),ye=c.useRef(null),Ne=c.useRef(null),Te=c.useRef(null),Ce=c.useRef(null),Be=c.useCallback(()=>{const ae=te.current;if(!ae)return;const v=ae.closest(`.${e}-lightbox-content-area`);if(!v)return ae.getBoundingClientRect().width;let q=0;return Array.from(v.children).forEach(Z=>{Z instanceof HTMLElement&&(Z.contains(ae)||(q+=Z.getBoundingClientRect().width))}),v.getBoundingClientRect().width-q},[e]),re=c.useCallback(()=>{Ie.current&&(clearTimeout(Ie.current),Ie.current=null)},[]),Pe=c.useCallback(ae=>{ae===D.current&&(ve(null),fe(!1))},[]),Me=c.useCallback(()=>{p||X.current||(X.current=!0,H==null||H(),F(!1),U.current=setTimeout(()=>{V()},fo))},[p,H,V]),ke=c.useCallback(ae=>!!(ae.closest("[data-controls]")||ae.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ze,backdropStyle:it,mediaAreaStyle:mt,chromeStyle:ft,swipeHandlers:Ct,dismissAreaStyle:At}=Qa({enabled:_,onClose:Me,animMs:fo,isBlockedTarget:ke}),dt=c.useCallback(ae=>{C&&is(ae+1,A,!0)},[C,A]),ut=c.useCallback(ae=>{var we,We;if(E.length===0)return;const v=(ae%E.length+E.length)%E.length;if(v===M)return;const q=E[M],Z=E[v];D.current+=1;const ge=D.current,me=x==="fade"&&aa(q==null?void 0:q.entry)!==aa(Z==null?void 0:Z.entry),Fe=(we=te.current)==null?void 0:we.getBoundingClientRect().height;let De,Y;me&&(Y=Be(),ei.flushSync(()=>{Se(Z.entry)}),de.current&&Y&&(de.current.style.width=`${Y}px`),De=(We=de.current)==null?void 0:We.getBoundingClientRect().height,de.current&&(de.current.style.width=""));const he=Math.max(Fe??0,De??0)||void 0;ee(ge),ve(M),fe(!0),W(v),dt(v),N.current=v,me?(re(),he&&oe(he),Y&&$e(Y),f((q==null?void 0:q.entryIndex)??null),xe(!0),ue.current=Z.entryIndex,Ie.current=setTimeout(()=>{f(null),xe(!1),oe(void 0),$e(void 0),Se(null),Ie.current=null},Eo)):(re(),f(null),xe(!1),oe(void 0),$e(void 0),Se(null),ue.current=Z.entryIndex)},[M,re,Be,E,dt,x]),Re=c.useCallback(()=>{Ce.current=null},[]),Ze=c.useCallback(ae=>{!k||E.length<=1||ae.pointerType==="mouse"&&ae.button!==0||ae.target.closest("[data-controls]")||(Ce.current={startX:ae.clientX,startY:ae.clientY,pointerId:ae.pointerId})},[k,E.length]),Xe=c.useCallback(ae=>{var he;if(!k||E.length<=1||ae.pointerType==="mouse"&&ae.button!==0)return;if(ze){Re();return}const v=Ce.current;if(!v||v.pointerId!==ae.pointerId||(Re(),ae.target.closest("[data-controls]")))return;const Z=ae.clientX-v.startX,ge=ae.clientY-v.startY,me=Math.abs(Z),Fe=Math.abs(ge);if(me>=Zp&&me>Fe){ut(Z>0?M-1:M+1);return}if(me>ta||Fe>ta)return;const De=(he=ye.current)==null?void 0:he.getBoundingClientRect(),Y=De?De.left+De.width/2:window.innerWidth/2;ut(ae.clientX<Y?M-1:M+1)},[M,k,ut,ze,Re,E.length]),at=c.useCallback(ae=>{const v=Ce.current;(v==null?void 0:v.pointerId)===ae.pointerId&&Re()},[Re]);es(),c.useEffect(()=>{Te.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const ae=requestAnimationFrame(()=>{F(!0),requestAnimationFrame(()=>{Ne.current?Ne.current.focus():ye.current&&ye.current.focus()})});return()=>{cancelAnimationFrame(ae),U.current&&clearTimeout(U.current),Ie.current&&clearTimeout(Ie.current);const v=Te.current;v&&document.contains(v)&&v.focus()}},[]),c.useEffect(()=>{var ae;x!=="fade"&&(ue.current=((ae=E[M])==null?void 0:ae.entryIndex)??0,re(),f(null),xe(!1),oe(void 0),$e(void 0))},[M,re,E,x]),c.useEffect(()=>{const ae=v=>{if(v.key==="Escape"){Me();return}if(v.key==="ArrowLeft"&&E.length>1){ut(M-1);return}if(v.key==="ArrowRight"&&E.length>1){ut(M+1);return}if(v.key==="Tab"&&ye.current){const q=ye.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),Z=Array.from(q).filter(De=>!De.closest('[aria-hidden="true"]'));if(Z.length===0)return;const ge=Z[0],me=Z[Z.length-1],Fe=document.activeElement;v.shiftKey?(Fe===ge||!ye.current.contains(Fe))&&(v.preventDefault(),me.focus()):(Fe===me||!ye.current.contains(Fe))&&(v.preventDefault(),ge.focus())}};return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[ut,Me,M,E.length]),c.useLayoutEffect(()=>{re(),D.current=0,ee(0),ve(null),fe(!1),f(null),xe(!1),oe(void 0),$e(void 0),Se(null),W(ae=>{const v=Math.max(0,E.length-1);return Math.min(ae,v)})},[re,t.length,n,E.length]),c.useLayoutEffect(()=>{var ae;N.current=g,ue.current=((ae=E[g])==null?void 0:ae.entryIndex)??0,W(g)},[g,E.length]);const Ye=J!==null?t[J]:null,It=pe!==null?E[pe]:null,yt=!!(K!=null&&K.title1||K!=null&&K.title2||K!=null&&K.title3||Ye!=null&&Ye.title1||Ye!=null&&Ye.title2||Ye!=null&&Ye.title3),vt=sm(n,E,t),wt=!!$,Ee={gap:T},et=vt&&wt?{gap:L}:void 0,Je=(ae,v,q=!1)=>{const Z=ra(v),ge=`calc(-0.5 * (${Z} + ${v}))`;return r.jsx("div",{"data-controls":ae,"data-controls-axis":"x",...q?{"data-controls-reverse":"true"}:void 0,style:{position:"absolute",top:0,right:ge,width:Z,height:"100%",pointerEvents:"auto",zIndex:3}})},Ve=(ae,v=!1)=>{if(!ae)return null;const q=[ae.title1?{className:`${e}-title1`,style:S,text:ae.title1}:null,ae.title2?{className:`${e}-title2`,style:O,text:ae.title2}:null,ae.title3?{className:`${e}-title3`,style:R,text:ae.title3}:null].filter(Z=>Z!==null);return q.map((Z,ge)=>r.jsxs("div",{className:`${e}-title-cell`,children:[r.jsx("p",{className:Z.className,style:{...Z.style,maxWidth:h},children:Z.text}),v&&Q&&ge<q.length-1?Je("titlesGap",T):null]},Z.className))},tt=ae=>{const v=!ae.objectFit&&Xt(i);return{className:`${e}-slide-image-cell${v?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:l,maxHeight:d,...v?{"--image-aspect-ratio":Xi(i)}:{}}}},Dt=ae=>ae.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":ae.objectFit}}:Xt(i)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Zt=ae=>{if(ae.length===0)return null;const v=ae.length>1,q=ra(a),Z=`calc(-0.5 * (${q} + ${a}))`;if(ae.length===1){const ge=ae[0];return r.jsx("div",{...tt(ge),children:r.jsx("img",{...Dt(ge),src:ge.url,alt:ge.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:v?{gap:a}:void 0,children:ae.map((ge,me)=>r.jsxs("div",{...tt(ge),children:[r.jsx("img",{...Dt(ge),src:ge.url,alt:ge.name??"",draggable:!1}),Q&&v&&me<ae.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Z,width:q,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ge.url}-${me}`))})};return r.jsxs("div",{ref:ye,"data-selection":"none",className:`${e}-lightbox${s?` ${e}-lightbox-editor`:""}${p?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ze||Me()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:wt?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,...it}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%",...At},...Ct,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:mt,onClick:ae=>ae.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":k&&E.length>1?"true":"false",onPointerDown:k?Ze:void 0,onPointerUp:k?Xe:void 0,onPointerCancel:k?at:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[It&&se?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:ae=>{ae.target===ae.currentTarget&&Pe(G)},children:r.jsx("div",{className:`${e}-slide-area`,children:Zt(It.images)})},`slide-out-${G}`):null,r.jsx("div",{className:`${e}-slide-layer-in${se?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:z?Zt(z.images):null})},`slide-in-${G}-${M}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-chrome`,style:{width:"100%",height:"100%",...ft},children:[r.jsx("div",{"data-controls":Q?"contentMarginTop":void 0,className:Q?`${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":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:[yt&&r.jsx("div",{className:`${e}-text-bar-cell`,children:r.jsx("div",{className:`${e}-titles-row`,style:Ee,children:x==="fade"?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:de,className:`${e}-titles-stack`,style:{...Ee,position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Ve(_e||K,!1)}),r.jsxs("div",{ref:te,className:`${e}-titles-stack`,style:{...Ee,...ne&&le?{minHeight:le}:void 0,...ne&&Le?{width:Le,maxWidth:"100%"}:void 0,...ne?{overflow:"hidden"}:void 0},children:[Ye&&ne?r.jsx("div",{className:`${e}-titles-layer-out ${e}-titles-fade-out`,style:Ee,children:Ve(Ye)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ne?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,style:Ee,children:Ve(K,!0)})]})]}):Ve(K,!0)})}),r.jsxs("div",{className:`${e}-lightbox-persistent-controls`,style:et,children:[vt&&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:am(E,M,n,t)}),Q&&wt?Je("countCloseGap",L,!0):null]}),wt&&r.jsx("div",{className:`${e}-close-icon`,style:{width:I.scalingValue(b??0,s),height:I.scalingValue(b??0,s),"--close-icon-hover-color":m},children:r.jsx("button",{ref:Ne,type:"button",className:`${e}-close-icon-inner`,onClick:Me,"aria-label":"Close",children:r.jsx(Nt,{url:$??"",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:j,flexShrink:0}})]})]})]})]})},di=["title1","title2","title3","count"];function Ue(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const cm={title1:"1",title2:"2",title3:"3",count:"Count"};function dm(e){return[Ue(e,"fontFamily"),Ue(e,"fontSettings"),{type:"row",items:[Ue(e,"fontSize"),Ue(e,"lineHeight"),Ue(e,"letterSpacing"),Ue(e,"wordSpacing")]},Ue(e,"textAlign"),Ue(e,"textAppearance")]}function um(){return{type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(di.map(e=>[cm[e],dm(e)]))}}const pm={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},mm={title1:.02,title2:.02,title3:.02,count:.017};function bi(e,t){const n=i=>{const o=Ue(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[pm[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??mm[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 gm=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:a,metadata:l})=>{const{prefix:d}=I.useScopedStyles(),s=(l==null?void 0:l.itemId)??null,{cover:p,coverFit:u,type:$,backgroundColor:b,imageGap:y,maxWidth:m,maxHeight:h,textMaxWidth:T,textTransition:L,titlesGap:x,countCloseGap:S,closeIcon:O,closeIconMaxWidth:R,closeIconColor:B,closeIconHoverColor:w,contentMarginTop:P,contentMarginLeft:j,contentMarginRight:g}=e,C=pe=>I.scalingValue(pe,n??!1),A=xi("title1",bi(e,"title1"),n),H=xi("title2",bi(e,"title2"),n),V=xi("title3",bi(e,"title3"),n),Q=xi("count",bi(e,"count"),n),k=c.useRef(null),[_,E]=c.useState(!1),[M,W]=c.useState(0),z=c.useRef(!1),K=c.useRef(!1),ie=c.useRef(!1),F=c.useMemo(()=>(t??[]).filter(pe=>kn(pe).length>0),[t]),J=!n||!!o,f=c.useCallback(()=>{J&&(ie.current=!0,em(K.current,s),K.current=!1)},[J,s]),ne=(pe=0)=>{if(i||F.length===0||n&&!o)return;const ve=_i(F,$),se=Math.max(0,Math.min(pe,ve.length-1));if(W(se),J){const fe=os();is(se+1,s,fe),K.current=!fe}E(!0)},xe=c.useCallback(()=>{E(!1),ie.current=!1},[]);return c.useEffect(()=>{if(!J||z.current)return;z.current=!0;const pe=ia(s);if(!pe)return;const ve=oa(pe,_i(F,$).length);ve<0||(W(ve),E(!0))},[F,s,J,$]),c.useEffect(()=>{if(!J)return;const pe=()=>{if(ie.current){ie.current=!1,E(!1);return}const ve=ia(s);if(!ve){E(!1);return}const se=oa(ve,_i(F,$).length);if(se<0){E(!1);return}K.current=!1,W(se),E(!0)};return window.addEventListener("popstate",pe),()=>window.removeEventListener("popstate",pe)},[F,s,J,$]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:k,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:tm(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":Xi(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]}),_&&typeof document<"u"&&(()=>{const pe=(a?document.getElementById(a):null)??document.body;return ei.createPortal(r.jsx(lm,{prefix:d,entries:F,journalType:$,coverFit:u,backgroundColor:b,imageGap:C(y??0),slideMaxWidth:`${m}%`,slideMaxHeight:`${h}%`,textMaxWidth:C(T??.4),titlesGap:C(x??0),countCloseGap:C(S??0),textTransition:L,title1Style:A,title2Style:H,title3Style:V,countStyle:Q,contentMarginTop:C(P??0),contentMarginLeft:C(j??0),contentMarginRight:C(g??0),closeIcon:O,closeIconMaxWidth:R,closeIconColor:B,closeIconHoverColor:w,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:M,enableUrlSync:J,journalItemId:s,onBeforeClose:f,onClose:xe}),pe)})()]})},hm=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
11079
|
+
`}const om=20,rm=2,yo=e=>`max(${e}, ${om}px)`,Fn=e=>((e==null?void 0:e.image)??[]).slice(0,rm),rs=e=>e.reduce((t,n)=>t+Fn(n).length,0),am=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Fn(r).length,1),i=Fn(e[t]).length;return{start:n,end:n+i-1}},sm=(e,t)=>{const n=rs(e),{start:i,end:o}=am(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Ri=(e,t)=>t==="B"?e.flatMap((n,i)=>Fn(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Fn(n)})),lm=(e,t,n,i)=>{var r;if(n==="B")return`${t+1} / ${e.length}`;const o=((r=e[t])==null?void 0:r.entryIndex)??0;return sm(i,o)},ra=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",cm=(e,t,n)=>e==="B"?t.length>1:rs(n)>1,aa=.004,dm=.004,_n={title1Width:.13,title2Width:.13,title3Width:.14};function sa(e,t,n,i,o){const r=[];return t.title1&&r.push({widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&r.push({widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&r.push({widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),r}function as(e,t){if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((r,s)=>r+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:r,widths:s},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...s]};const l=Math.min(r,d);return{overflow:r-l,widths:[d-l,...s]}},{overflow:i-1,widths:[]});return o}function um(e,t){return as(e,t)}function pm(e,t){const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n)}function mm(e,t,n,i){return e.slice(0,i).reduce((o,r,s)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[s]??0),0)}function gm(e,t,n,i){return e.slice(0,i+1).reduce((o,r,s)=>o+(r!=null&&r.marginLeftKey?n[r.marginLeftKey]??0:0)+(t[s]??0),0)}const hm=({prefix:e,entries:t,journalType:n,coverFit:i,backgroundColor:o,imageGap:r,slideMaxWidth:s,slideMaxHeight:d,isEditor:l,isEditMode:p,isPreviewMode:u,closeIcon:C,closeIconMaxWidth:v,closeIconColor:y,closeIconHoverColor:m,title1Width:h,title2Width:w,title3Width:$,title2MarginLeft:S,title3MarginLeft:b,countCloseGap:H,textTransition:I,title1Style:B,title2Style:x,title3Style:E,countStyle:V,contentMarginTop:g,contentMarginLeft:T,contentMarginRight:P,initialSlideIndex:W=0,enableUrlSync:K=!1,journalItemId:oe=null,onBeforeClose:F,onClose:R})=>{const D=!!p,O=!l||!!u,N=!p&&(!l||!!u),_=c.useMemo(()=>Ri(t,n),[t,n]),[q,ie]=c.useState(W),k=_[q],G=k==null?void 0:k.entry,[f,ee]=c.useState(!1),[ve,he]=c.useState(null),[Se,re]=c.useState(!1),[ue,U]=c.useState(null),[Z,ae]=c.useState(!1),[pe,ye]=c.useState(0),[We,Ce]=c.useState(),[Fe,Ie]=c.useState(),[z,le]=c.useState(null),M=c.useRef(null),X=c.useRef(0),Y=c.useRef(0),ne=c.useRef(0),me=c.useRef(!1),we=c.useRef(null),Oe=c.useRef(null),$e=c.useRef(null),be=c.useRef(null),He=c.useRef(null),ge=c.useRef(null),Le=c.useRef(null),Ne=c.useCallback(()=>{const A=Oe.current;if(!A)return;const te=A.closest(`.${e}-lightbox-content-area`);if(!te)return A.getBoundingClientRect().width;const Re=Array.from(te.children).reduce((Ee,de)=>!(de instanceof HTMLElement)||de.contains(A)?Ee:Ee+de.getBoundingClientRect().width,0);return te.getBoundingClientRect().width-Re},[e]),Me=c.useCallback(()=>{M.current&&(clearTimeout(M.current),M.current=null)},[]),Ve=c.useCallback(A=>{A===X.current&&(U(null),ae(!1))},[]),tt=c.useCallback(()=>{p||me.current||(me.current=!0,F==null||F(),ee(!1),we.current=setTimeout(()=>{R()},fo))},[p,F,R]),dt=c.useCallback(A=>!!(A.closest("[data-controls]")||A.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:st,backdropStyle:bt,mediaAreaStyle:Rt,overlayContentStyle:xt,swipeHandlers:At,dismissAreaStyle:Ae}=es({enabled:N,onClose:tt,animMs:fo,isBlockedTarget:dt}),ot=c.useCallback(A=>{K&&is(A+1,oe,!0)},[K,oe]),qe=c.useCallback(A=>{var Be;if(_.length===0)return;const te=(A%_.length+_.length)%_.length;if(te===q)return;const Re=_[q],Ee=_[te];X.current+=1;const de=X.current,Ke=I==="fade"&&ra(Re==null?void 0:Re.entry)!==ra(Ee==null?void 0:Ee.entry),Xe=(Be=Oe.current)==null?void 0:Be.getBoundingClientRect().height,ze=Ke?(()=>{var mt;const pt=Ne();ti.flushSync(()=>{le(Ee.entry)}),$e.current&&pt&&($e.current.style.width=`${pt}px`);const ht=(mt=$e.current)==null?void 0:mt.getBoundingClientRect().height;return $e.current&&($e.current.style.width=""),{measuredIncomingTitlesHeight:ht,incomingTitlesMeasureWidth:pt}})():void 0,ut=Math.max(Xe??0,(ze==null?void 0:ze.measuredIncomingTitlesHeight)??0)||void 0;ye(de),U(q),ae(!0),ie(te),ot(te),ne.current=te,Ke?(Me(),ut&&Ce(ut),ze!=null&&ze.incomingTitlesMeasureWidth&&Ie(ze.incomingTitlesMeasureWidth),he((Re==null?void 0:Re.entryIndex)??null),re(!0),Y.current=Ee.entryIndex,M.current=setTimeout(()=>{he(null),re(!1),Ce(void 0),Ie(void 0),le(null),M.current=null},Eo)):(Me(),he(null),re(!1),Ce(void 0),Ie(void 0),le(null),Y.current=Ee.entryIndex)},[q,Me,Ne,_,ot,I]),Qe=c.useCallback(()=>{Le.current=null},[]),wt=c.useCallback(A=>{!O||_.length<=1||A.pointerType==="mouse"&&A.button!==0||A.target.closest("[data-controls]")||(Le.current={startX:A.clientX,startY:A.clientY,pointerId:A.pointerId})},[O,_.length]),Pt=c.useCallback(A=>{var Be;if(!O||_.length<=1||A.pointerType==="mouse"&&A.button!==0)return;if(st){Qe();return}const te=Le.current;if(!te||te.pointerId!==A.pointerId||(Qe(),A.target.closest("[data-controls]")))return;const Ee=A.clientX-te.startX,de=A.clientY-te.startY,Ke=Math.abs(Ee),Xe=Math.abs(de);if(Ke>=em&&Ke>Xe){qe(Ee>0?q-1:q+1);return}if(Ke>ta||Xe>ta)return;const ze=(Be=be.current)==null?void 0:Be.getBoundingClientRect(),ut=ze?ze.left+ze.width/2:window.innerWidth/2;qe(A.clientX<ut?q-1:q+1)},[q,O,qe,st,Qe,_.length]),yt=c.useCallback(A=>{const te=Le.current;(te==null?void 0:te.pointerId)===A.pointerId&&Qe()},[Qe]);ts(),c.useEffect(()=>{ge.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const A=requestAnimationFrame(()=>{ee(!0),requestAnimationFrame(()=>{He.current?He.current.focus():be.current&&be.current.focus()})});return()=>{cancelAnimationFrame(A),we.current&&clearTimeout(we.current),M.current&&clearTimeout(M.current);const te=ge.current;te&&document.contains(te)&&te.focus()}},[]),c.useEffect(()=>{var A;I!=="fade"&&(Y.current=((A=_[q])==null?void 0:A.entryIndex)??0,Me(),he(null),re(!1),Ce(void 0),Ie(void 0))},[q,Me,_,I]),c.useEffect(()=>{const A=te=>{if(te.key==="Escape"){tt();return}if(te.key==="ArrowLeft"&&_.length>1){qe(q-1);return}if(te.key==="ArrowRight"&&_.length>1){qe(q+1);return}if(te.key==="Tab"&&be.current){const Re=be.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),Ee=Array.from(Re).filter(ze=>!ze.closest('[aria-hidden="true"]'));if(Ee.length===0)return;const de=Ee[0],Ke=Ee[Ee.length-1],Xe=document.activeElement;te.shiftKey?(Xe===de||!be.current.contains(Xe))&&(te.preventDefault(),Ke.focus()):(Xe===Ke||!be.current.contains(Xe))&&(te.preventDefault(),de.focus())}};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[qe,tt,q,_.length]),c.useLayoutEffect(()=>{Me(),X.current=0,ye(0),U(null),ae(!1),he(null),re(!1),Ce(void 0),Ie(void 0),le(null),ie(A=>{const te=Math.max(0,_.length-1);return Math.min(A,te)})},[Me,t.length,n,_.length]),c.useLayoutEffect(()=>{var A;ne.current=W,Y.current=((A=_[W])==null?void 0:A.entryIndex)??0,ie(W)},[W,_.length]);const rt=ve!==null?t[ve]:null,$t=ue!==null?_[ue]:null,_e=(G==null?void 0:G.title1)||(G==null?void 0:G.title2)||(G==null?void 0:G.title3)||(rt==null?void 0:rt.title1)||(rt==null?void 0:rt.title2)||(rt==null?void 0:rt.title3),nt=cm(n,_,t),Ue=C!==null,Ge=nt&&Ue?{gap:H}:void 0,it=c.useCallback(A=>L.scalingValue(A,l??!1),[l]),Ft=c.useMemo(()=>({title1Width:h??_n.title1Width,title2Width:w??_n.title2Width,title3Width:$??_n.title3Width}),[h,w,$]),St=c.useMemo(()=>({title2MarginLeft:S,title3MarginLeft:b}),[S,b]),lt=c.useMemo(()=>G?sa(e,G,B,x,E):[],[e,G,B,x,E]),Zt=c.useMemo(()=>lt.map(A=>Ft[A.widthKey]),[lt,Ft]),Tt=c.useMemo(()=>as(lt.length,Zt),[lt.length,Zt]),j=c.useCallback(A=>gm(lt,Tt,St,A),[lt,Tt,St]),se=A=>{if(!A)return null;const te=sa(e,A,B,x,E),Re=te.map(de=>Ft[de.widthKey]),Ee=um(te.length,Re);return te.map((de,Ke)=>{const Xe=de.marginLeftKey?St[de.marginLeftKey]??0:0;return a.jsx("div",{className:`${e}-title-cell`,style:{width:it(Ee[Ke]??0),...Xe>0?{marginLeft:it(Xe)}:{}},children:a.jsx("p",{className:de.className,style:de.style,children:de.text})},de.className)})},Q=()=>lt.flatMap((A,te)=>{if(!A.marginLeftKey)return[];const Re=St[A.marginLeftKey]??0,Ee=mm(lt,Tt,St,te),de=Math.max(Re,dm);return a.jsx("div",{"data-controls":A.marginLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Tt[te]),className:`${e}-padding-control-handle`,style:{position:"absolute",top:0,left:it(Ee),width:it(de),height:"100%",pointerEvents:"auto"}},A.marginLeftKey)}),Te=()=>lt.map((A,te)=>{const Re=pm(te,Tt),de=j(te)-aa/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":A.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-max-fraction":String(Re),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:it(de),width:it(aa),height:"100%",pointerEvents:"auto"}})},`${A.widthKey}-junction`)}),Pe=A=>{const te=!A.objectFit&&Xt(i);return{className:`${e}-slide-image-cell${te?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:s,maxHeight:d,...te?{"--image-aspect-ratio":Yi(i)}:{}}}},J=A=>A.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":A.objectFit}}:Xt(i)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},fe=A=>{if(A.length===0)return null;const te=A.length>1,Re=yo(r),Ee=`calc(-0.5 * (${Re} + ${r}))`;if(A.length===1){const de=A[0];return a.jsx("div",{...Pe(de),children:a.jsx("img",{...J(de),src:de.url,alt:de.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:te?{gap:r}:void 0,children:A.map((de,Ke)=>a.jsxs("div",{...Pe(de),children:[a.jsx("img",{...J(de),src:de.url,alt:de.name??"",draggable:!1}),D&&te&&Ke<A.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ee,width:Re,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${de.url}-${Ke}`))})};return a.jsxs("div",{ref:be,"data-selection":"none",className:`${e}-lightbox${l?` ${e}-lightbox-editor`:""}${p?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{st||tt()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:Ue?void 0:-1,style:{opacity:f?1:0,transition:`opacity ${fo}ms ease`,pointerEvents:f?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:o,...bt}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%",...Ae},...At,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Rt,onClick:A=>A.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":O&&_.length>1?"true":"false",onPointerDown:O?wt:void 0,onPointerUp:O?Pt:void 0,onPointerCancel:O?yt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[$t&&Z?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:A=>{A.target===A.currentTarget&&Ve(pe)},children:a.jsx("div",{className:`${e}-slide-area`,children:fe($t.images)})},`slide-out-${pe}`):null,a.jsx("div",{className:`${e}-slide-layer-in${Z?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:k?fe(k.images):null})},`slide-in-${pe}-${q}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:{width:"100%",height:"100%",...xt},children:[a.jsx("div",{"data-controls":D?"contentMarginTop":void 0,className:D?`${e}-control`:void 0,style:{height:g,width:"100%"}}),a.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%"},children:[a.jsx("div",{"data-controls":D?"contentMarginLeft":void 0,"data-controls-axis":D?"x":void 0,className:D?`${e}-control`:void 0,style:{width:T,flexShrink:0}}),a.jsxs("div",{className:`${e}-lightbox-content-area`,children:[_e&&a.jsx("div",{className:`${e}-text-bar-cell`,children:a.jsx("div",{className:`${e}-titles-row`,children:I==="fade"?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:$e,className:`${e}-titles-stack`,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:se(z||G)}),a.jsxs("div",{ref:Oe,className:`${e}-titles-stack`,style:{...Se&&We?{minHeight:We}:void 0,...Se&&Fe?{width:Fe,maxWidth:"100%"}:void 0,...Se?{overflow:"hidden"}:void 0},children:[rt&&Se?a.jsx("div",{className:`${e}-titles-layer-out ${e}-titles-fade-out`,children:se(rt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:se(G)}),D&<.length>0?a.jsxs(a.Fragment,{children:[Q(),Te()]}):null]})]}):a.jsxs(a.Fragment,{children:[se(G),D&<.length>0?a.jsxs(a.Fragment,{children:[Q(),Te()]}):null]})})}),a.jsxs("div",{className:`${e}-lightbox-persistent-controls`,style:Ge,children:[nt&&a.jsxs("div",{className:`${e}-text-bar-cell`,children:[a.jsx("span",{className:`${e}-entry-counter`,style:V,"aria-live":"polite","aria-atomic":"true",children:lm(_,q,n,t)}),D&&Ue?a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${yo(H)} + ${H}))`,width:yo(H),height:"100%",pointerEvents:"auto",zIndex:3}}):null]}),Ue&&a.jsx("div",{className:`${e}-close-icon`,style:{width:L.scalingValue(v??0,l),height:L.scalingValue(v??0,l),"--close-icon-hover-color":m},children:a.jsx("button",{ref:He,type:"button",className:`${e}-close-icon-inner`,onClick:tt,"aria-label":"Close",children:a.jsx(Ht,{url:C??"",fill:y,hoverFill:m,className:`${e}-close-icon-img`})})})]})]}),a.jsx("div",{"data-controls":D?"contentMarginRight":void 0,"data-controls-axis":D?"x":void 0,"data-controls-reverse":D?"":void 0,className:D?`${e}-control`:void 0,style:{width:P,flexShrink:0}})]})]})]})]})},ui=["title1","title2","title3","count"];function Je(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const fm={title1:"1",title2:"2",title3:"3",count:"Count"};function ym(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 vm(){return{type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(ui.map(e=>[fm[e],ym(e)]))}}const bm={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},xm={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[bm[t]]}}function Si(e,t,n){var o,r;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=t.fontSettings)==null?void 0:r.fontStyle)??"normal"},fontSize:t.fontSize??xm[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return ft(i,n)}const Sm=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:s})=>{const{prefix:d}=L.useScopedStyles(),l=(s==null?void 0:s.itemId)??null,{cover:p,coverFit:u,type:C,backgroundColor:v,imageGap:y,maxWidth:m,maxHeight:h,textTransition:w,title1Width:$,title2Width:S,title3Width:b,title2MarginLeft:H,title3MarginLeft:I,countCloseGap:B,closeIcon:x,closeIconMaxWidth:E,closeIconColor:V,closeIconHoverColor:g,contentMarginTop:T,contentMarginLeft:P,contentMarginRight:W}=e,K=ue=>L.scalingValue(ue,n??!1),oe=Si("title1",xi(e,"title1"),n),F=Si("title2",xi(e,"title2"),n),R=Si("title3",xi(e,"title3"),n),D=Si("count",xi(e,"count"),n),O=c.useRef(null),[N,_]=c.useState(!1),[q,ie]=c.useState(0),k=c.useRef(!1),G=c.useRef(!1),f=c.useRef(!1),ee=c.useMemo(()=>(t??[]).filter(ue=>Fn(ue).length>0),[t]),ve=!n||!!o,he=c.useCallback(()=>{ve&&(f.current=!0,nm(G.current,l),G.current=!1)},[ve,l]),Se=(ue=0)=>{if(i||ee.length===0||n&&!o)return;const U=Ri(ee,C),Z=Math.max(0,Math.min(ue,U.length-1));if(ie(Z),ve){const ae=os();is(Z+1,l,ae),G.current=!ae}_(!0)},re=c.useCallback(()=>{_(!1),f.current=!1},[]);return c.useEffect(()=>{if(!ve||k.current)return;k.current=!0;const ue=ia(l);if(!ue)return;const U=oa(ue,Ri(ee,C).length);U<0||(ie(U),_(!0))},[ee,l,ve,C]),c.useEffect(()=>{if(!ve)return;const ue=()=>{if(f.current){f.current=!1,_(!1);return}const U=ia(l);if(!U){_(!1);return}const Z=oa(U,Ri(ee,C).length);if(Z<0){_(!1);return}G.current=!1,ie(Z),_(!0)};return window.addEventListener("popstate",ue),()=>window.removeEventListener("popstate",ue)},[ee,l,ve,C]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:O,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:im(d)}}),p?a.jsx("button",{type:"button",className:`${d}-cover ${Xt(u)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>Se(),style:{display:"block",padding:0,border:"none",background:"transparent",...Xt(u)?{"--image-aspect-ratio":Yi(u)}:{}},"aria-label":"Open journal gallery",children:a.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 ue=(r?document.getElementById(r):null)??document.body;return ti.createPortal(a.jsx(hm,{prefix:d,entries:ee,journalType:C,coverFit:u,backgroundColor:v,imageGap:K(y??0),slideMaxWidth:`${m}%`,slideMaxHeight:`${h}%`,title1Width:$??_n.title1Width,title2Width:S??_n.title2Width,title3Width:b??_n.title3Width,title2MarginLeft:H??0,title3MarginLeft:I??0,countCloseGap:K(B??0),textTransition:w,title1Style:oe,title2Style:F,title3Style:R,countStyle:D,contentMarginTop:K(T??0),contentMarginLeft:K(P??0),contentMarginRight:K(W??0),closeIcon:x,closeIconMaxWidth:E,closeIconColor:V,closeIconHoverColor:g,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:q,enableUrlSync:ve,journalItemId:l,onBeforeClose:he,onClose:re}),ue)})()]})},Cm=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
11015
11080
|
import { createPortal, flushSync } from 'react-dom';
|
|
11016
11081
|
import { CommonComponentProps } from '../props';
|
|
11017
11082
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -11095,17 +11160,13 @@ const setJournalUrlParam = (slideNumber: number, itemId?: string | null, replace
|
|
|
11095
11160
|
const clearJournalUrlParam = (itemId?: string | null) => {
|
|
11096
11161
|
if (typeof window === 'undefined') return;
|
|
11097
11162
|
const url = new URL(window.location.href);
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
const shouldDelete = itemId
|
|
11163
|
+
const keysToDelete = [...url.searchParams.keys()].filter((key) => (
|
|
11164
|
+
itemId
|
|
11101
11165
|
? key === getJournalUrlParamKey(itemId) || key === LEGACY_JOURNAL_URL_PARAM_KEY
|
|
11102
|
-
: isJournalUrlParamKey(key)
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
}
|
|
11107
|
-
});
|
|
11108
|
-
if (changed) {
|
|
11166
|
+
: isJournalUrlParamKey(key)
|
|
11167
|
+
));
|
|
11168
|
+
keysToDelete.forEach((key) => url.searchParams.delete(key));
|
|
11169
|
+
if (keysToDelete.length > 0) {
|
|
11109
11170
|
const nextUrl = \`\${url.pathname}\${url.search}\${url.hash}\`;
|
|
11110
11171
|
window.history.replaceState(window.history.state, '', nextUrl);
|
|
11111
11172
|
}
|
|
@@ -11393,13 +11454,13 @@ function getCSS(P: string): string {
|
|
|
11393
11454
|
min-width: 0;
|
|
11394
11455
|
display: flex;
|
|
11395
11456
|
flex-direction: row;
|
|
11396
|
-
align-items: center;
|
|
11397
11457
|
}
|
|
11398
11458
|
|
|
11399
11459
|
.\${P}-title-cell {
|
|
11400
11460
|
position: relative;
|
|
11401
|
-
flex: 0
|
|
11461
|
+
flex: 0 0 auto;
|
|
11402
11462
|
min-width: 0;
|
|
11463
|
+
box-sizing: border-box;
|
|
11403
11464
|
}
|
|
11404
11465
|
|
|
11405
11466
|
.\${P}-text-bar-cell {
|
|
@@ -11414,10 +11475,41 @@ function getCSS(P: string): string {
|
|
|
11414
11475
|
.\${P}-title2,
|
|
11415
11476
|
.\${P}-title3 {
|
|
11416
11477
|
margin: 0;
|
|
11417
|
-
flex-shrink: 1;
|
|
11418
11478
|
min-width: 0;
|
|
11419
11479
|
}
|
|
11420
11480
|
|
|
11481
|
+
.\${P}-title-resize-handle,
|
|
11482
|
+
.\${P}-padding-control-handle {
|
|
11483
|
+
background: transparent;
|
|
11484
|
+
}
|
|
11485
|
+
|
|
11486
|
+
.\${P}-padding-control-handle[data-controls-axis="x"][data-controls-variant="column-padding"]::after {
|
|
11487
|
+
content: '';
|
|
11488
|
+
position: absolute;
|
|
11489
|
+
top: 50%;
|
|
11490
|
+
left: 50%;
|
|
11491
|
+
transform: translate(-50%, -50%);
|
|
11492
|
+
width: 4px;
|
|
11493
|
+
height: 12px;
|
|
11494
|
+
background: #FF5C02;
|
|
11495
|
+
border: 1px solid #FFFFFF;
|
|
11496
|
+
border-radius: 5px;
|
|
11497
|
+
box-sizing: border-box;
|
|
11498
|
+
pointer-events: none;
|
|
11499
|
+
}
|
|
11500
|
+
|
|
11501
|
+
.\${P}-title-resize-handle::after {
|
|
11502
|
+
content: '';
|
|
11503
|
+
position: absolute;
|
|
11504
|
+
top: 0;
|
|
11505
|
+
left: 50%;
|
|
11506
|
+
transform: translateX(-50%);
|
|
11507
|
+
width: 2px;
|
|
11508
|
+
height: 100%;
|
|
11509
|
+
background: #FF5C02;
|
|
11510
|
+
pointer-events: none;
|
|
11511
|
+
}
|
|
11512
|
+
|
|
11421
11513
|
.\${P}-titles-stack {
|
|
11422
11514
|
position: relative;
|
|
11423
11515
|
display: flex;
|
|
@@ -11468,7 +11560,7 @@ function getCSS(P: string): string {
|
|
|
11468
11560
|
animation: \${P}-titles-fade-out \${TEXT_FADE_MS}ms ease-in-out forwards;
|
|
11469
11561
|
}
|
|
11470
11562
|
|
|
11471
|
-
.\${P}-lightbox-
|
|
11563
|
+
.\${P}-lightbox-overlay-content {
|
|
11472
11564
|
position: absolute;
|
|
11473
11565
|
inset: 0;
|
|
11474
11566
|
z-index: 3;
|
|
@@ -11564,8 +11656,11 @@ type LightboxOverlayProps = {
|
|
|
11564
11656
|
closeIconMaxWidth: number;
|
|
11565
11657
|
closeIconColor: string;
|
|
11566
11658
|
closeIconHoverColor: string;
|
|
11567
|
-
|
|
11568
|
-
|
|
11659
|
+
title1Width: number;
|
|
11660
|
+
title2Width: number;
|
|
11661
|
+
title3Width: number;
|
|
11662
|
+
title2MarginLeft: number;
|
|
11663
|
+
title3MarginLeft: number;
|
|
11569
11664
|
countCloseGap: string;
|
|
11570
11665
|
textTransition: 'none' | 'fade';
|
|
11571
11666
|
title1Style: React.CSSProperties;
|
|
@@ -11594,10 +11689,10 @@ const getEntryImages = (entry: LightboxJournalItem | undefined): LightboxJournal
|
|
|
11594
11689
|
const getTotalImageCount = (entries: LightboxJournalItem[]) =>
|
|
11595
11690
|
entries.reduce((sum, entry) => sum + getEntryImages(entry).length, 0);
|
|
11596
11691
|
const getEntryImageRange = (entries: LightboxJournalItem[], entryIndex: number) => {
|
|
11597
|
-
|
|
11598
|
-
|
|
11599
|
-
|
|
11600
|
-
|
|
11692
|
+
const start = entries.slice(0, entryIndex).reduce(
|
|
11693
|
+
(sum, entry) => sum + getEntryImages(entry).length,
|
|
11694
|
+
1,
|
|
11695
|
+
);
|
|
11601
11696
|
const imageCount = getEntryImages(entries[entryIndex]).length;
|
|
11602
11697
|
return { start, end: start + imageCount - 1 };
|
|
11603
11698
|
};
|
|
@@ -11645,6 +11740,142 @@ const shouldShowCounter = (
|
|
|
11645
11740
|
entries: LightboxJournalItem[],
|
|
11646
11741
|
) => (journalType === 'B' ? slides.length > 1 : getTotalImageCount(entries) > 1);
|
|
11647
11742
|
|
|
11743
|
+
type JournalTitleWidthKey = 'title1Width' | 'title2Width' | 'title3Width';
|
|
11744
|
+
|
|
11745
|
+
const TITLE_RESIZE_HANDLE_WIDTH = 0.004;
|
|
11746
|
+
const TITLE_PADDING_HANDLE_WIDTH = 0.004;
|
|
11747
|
+
|
|
11748
|
+
const DEFAULT_JOURNAL_TITLE_WIDTHS: Record<JournalTitleWidthKey, number> = {
|
|
11749
|
+
title1Width: 0.13,
|
|
11750
|
+
title2Width: 0.13,
|
|
11751
|
+
title3Width: 0.14,
|
|
11752
|
+
};
|
|
11753
|
+
|
|
11754
|
+
type JournalTitleSlot = {
|
|
11755
|
+
widthKey: JournalTitleWidthKey;
|
|
11756
|
+
marginLeftKey?: 'title2MarginLeft' | 'title3MarginLeft';
|
|
11757
|
+
className: string;
|
|
11758
|
+
style: React.CSSProperties;
|
|
11759
|
+
text: string;
|
|
11760
|
+
};
|
|
11761
|
+
|
|
11762
|
+
function buildJournalTitleSlots(
|
|
11763
|
+
prefix: string,
|
|
11764
|
+
entry: LightboxJournalItem,
|
|
11765
|
+
title1Style: React.CSSProperties,
|
|
11766
|
+
title2Style: React.CSSProperties,
|
|
11767
|
+
title3Style: React.CSSProperties,
|
|
11768
|
+
): JournalTitleSlot[] {
|
|
11769
|
+
const slots: JournalTitleSlot[] = [];
|
|
11770
|
+
|
|
11771
|
+
if (entry.title1) {
|
|
11772
|
+
slots.push({
|
|
11773
|
+
widthKey: 'title1Width',
|
|
11774
|
+
className: \`\${prefix}-title1\`,
|
|
11775
|
+
style: title1Style,
|
|
11776
|
+
text: entry.title1,
|
|
11777
|
+
});
|
|
11778
|
+
}
|
|
11779
|
+
if (entry.title2) {
|
|
11780
|
+
slots.push({
|
|
11781
|
+
widthKey: 'title2Width',
|
|
11782
|
+
marginLeftKey: 'title2MarginLeft',
|
|
11783
|
+
className: \`\${prefix}-title2\`,
|
|
11784
|
+
style: title2Style,
|
|
11785
|
+
text: entry.title2,
|
|
11786
|
+
});
|
|
11787
|
+
}
|
|
11788
|
+
if (entry.title3) {
|
|
11789
|
+
slots.push({
|
|
11790
|
+
widthKey: 'title3Width',
|
|
11791
|
+
marginLeftKey: 'title3MarginLeft',
|
|
11792
|
+
className: \`\${prefix}-title3\`,
|
|
11793
|
+
style: title3Style,
|
|
11794
|
+
text: entry.title3,
|
|
11795
|
+
});
|
|
11796
|
+
}
|
|
11797
|
+
|
|
11798
|
+
return slots;
|
|
11799
|
+
}
|
|
11800
|
+
|
|
11801
|
+
function resolveJournalTitleWidths(
|
|
11802
|
+
count: number,
|
|
11803
|
+
storedWidths: number[],
|
|
11804
|
+
): number[] {
|
|
11805
|
+
if (count <= 0) {
|
|
11806
|
+
return [];
|
|
11807
|
+
}
|
|
11808
|
+
const widths = storedWidths.slice(0, count);
|
|
11809
|
+
const totalWidth = widths.reduce((sum, width) => sum + width, 0);
|
|
11810
|
+
if (totalWidth <= 1) {
|
|
11811
|
+
return widths;
|
|
11812
|
+
}
|
|
11813
|
+
const { widths: shrunkWidths } = [...widths].reverse().reduce<{
|
|
11814
|
+
overflow: number;
|
|
11815
|
+
widths: number[];
|
|
11816
|
+
}>(
|
|
11817
|
+
({ overflow, widths: acc }, width) => {
|
|
11818
|
+
if (overflow <= 0 || width <= 0) {
|
|
11819
|
+
return { overflow, widths: [width, ...acc] };
|
|
11820
|
+
}
|
|
11821
|
+
|
|
11822
|
+
const shrinkAmount = Math.min(overflow, width);
|
|
11823
|
+
return {
|
|
11824
|
+
overflow: overflow - shrinkAmount,
|
|
11825
|
+
widths: [width - shrinkAmount, ...acc],
|
|
11826
|
+
};
|
|
11827
|
+
},
|
|
11828
|
+
{ overflow: totalWidth - 1, widths: [] },
|
|
11829
|
+
);
|
|
11830
|
+
|
|
11831
|
+
return shrunkWidths;
|
|
11832
|
+
}
|
|
11833
|
+
|
|
11834
|
+
function getEffectiveJournalTitleWidths(
|
|
11835
|
+
count: number,
|
|
11836
|
+
storedWidths: number[],
|
|
11837
|
+
): number[] {
|
|
11838
|
+
return resolveJournalTitleWidths(count, storedWidths);
|
|
11839
|
+
}
|
|
11840
|
+
|
|
11841
|
+
function getJournalTitleMaxWidth(
|
|
11842
|
+
columnIndex: number,
|
|
11843
|
+
resolvedWidths: number[],
|
|
11844
|
+
): number {
|
|
11845
|
+
const otherWidths = resolvedWidths
|
|
11846
|
+
.filter((_, index) => index !== columnIndex)
|
|
11847
|
+
.reduce((sum, width) => sum + width, 0);
|
|
11848
|
+
return Math.max(1 - otherWidths);
|
|
11849
|
+
}
|
|
11850
|
+
|
|
11851
|
+
function getJournalTitleOffsetBeforeSlot(
|
|
11852
|
+
slots: JournalTitleSlot[],
|
|
11853
|
+
resolvedWidths: number[],
|
|
11854
|
+
marginByKey: Record<'title2MarginLeft' | 'title3MarginLeft', number>,
|
|
11855
|
+
slotIndex: number,
|
|
11856
|
+
): number {
|
|
11857
|
+
return slots.slice(0, slotIndex).reduce(
|
|
11858
|
+
(offset, slot, index) => offset
|
|
11859
|
+
+ (slot?.marginLeftKey ? marginByKey[slot.marginLeftKey] ?? 0 : 0)
|
|
11860
|
+
+ (resolvedWidths[index] ?? 0),
|
|
11861
|
+
0,
|
|
11862
|
+
);
|
|
11863
|
+
}
|
|
11864
|
+
|
|
11865
|
+
function getJournalTitleBoundaryOffset(
|
|
11866
|
+
slots: JournalTitleSlot[],
|
|
11867
|
+
resolvedWidths: number[],
|
|
11868
|
+
marginByKey: Record<'title2MarginLeft' | 'title3MarginLeft', number>,
|
|
11869
|
+
upToIndex: number,
|
|
11870
|
+
): number {
|
|
11871
|
+
return slots.slice(0, upToIndex + 1).reduce(
|
|
11872
|
+
(offset, slot, index) => offset
|
|
11873
|
+
+ (slot?.marginLeftKey ? marginByKey[slot.marginLeftKey] ?? 0 : 0)
|
|
11874
|
+
+ (resolvedWidths[index] ?? 0),
|
|
11875
|
+
0,
|
|
11876
|
+
);
|
|
11877
|
+
}
|
|
11878
|
+
|
|
11648
11879
|
const LightboxOverlay = ({
|
|
11649
11880
|
prefix: P,
|
|
11650
11881
|
entries,
|
|
@@ -11661,8 +11892,11 @@ const LightboxOverlay = ({
|
|
|
11661
11892
|
closeIconMaxWidth,
|
|
11662
11893
|
closeIconColor,
|
|
11663
11894
|
closeIconHoverColor,
|
|
11664
|
-
|
|
11665
|
-
|
|
11895
|
+
title1Width,
|
|
11896
|
+
title2Width,
|
|
11897
|
+
title3Width,
|
|
11898
|
+
title2MarginLeft,
|
|
11899
|
+
title3MarginLeft,
|
|
11666
11900
|
countCloseGap,
|
|
11667
11901
|
textTransition,
|
|
11668
11902
|
title1Style,
|
|
@@ -11681,10 +11915,7 @@ const LightboxOverlay = ({
|
|
|
11681
11915
|
const showControls = Boolean(isEditMode);
|
|
11682
11916
|
const allowDesktopNav = !isEditor || Boolean(isPreviewMode);
|
|
11683
11917
|
const allowSwipeDismiss = !isEditMode && (!isEditor || Boolean(isPreviewMode));
|
|
11684
|
-
const slides = useMemo(
|
|
11685
|
-
() => buildJournalSlides(entries, journalType),
|
|
11686
|
-
[entries, journalType],
|
|
11687
|
-
);
|
|
11918
|
+
const slides = useMemo(() => buildJournalSlides(entries, journalType), [entries, journalType]);
|
|
11688
11919
|
const [activeSlideIndex, setActiveSlideIndex] = useState(initialSlideIndex);
|
|
11689
11920
|
const activeSlide = slides[activeSlideIndex];
|
|
11690
11921
|
const activeEntry = activeSlide?.entry;
|
|
@@ -11719,12 +11950,11 @@ const LightboxOverlay = ({
|
|
|
11719
11950
|
if (!stack) return undefined;
|
|
11720
11951
|
const contentArea = stack.closest(\`.\${P}-lightbox-content-area\`) as HTMLElement | null;
|
|
11721
11952
|
if (!contentArea) return stack.getBoundingClientRect().width;
|
|
11722
|
-
|
|
11723
|
-
|
|
11724
|
-
if (
|
|
11725
|
-
|
|
11726
|
-
|
|
11727
|
-
});
|
|
11953
|
+
const fixedSiblingsWidth = Array.from(contentArea.children).reduce((sum, child) => {
|
|
11954
|
+
if (!(child instanceof HTMLElement)) return sum;
|
|
11955
|
+
if (child.contains(stack)) return sum;
|
|
11956
|
+
return sum + child.getBoundingClientRect().width;
|
|
11957
|
+
}, 0);
|
|
11728
11958
|
return contentArea.getBoundingClientRect().width - fixedSiblingsWidth;
|
|
11729
11959
|
}, [P]);
|
|
11730
11960
|
|
|
@@ -11760,7 +11990,7 @@ const LightboxOverlay = ({
|
|
|
11760
11990
|
isSwipeDragging,
|
|
11761
11991
|
backdropStyle: swipeBackdropStyle,
|
|
11762
11992
|
mediaAreaStyle,
|
|
11763
|
-
|
|
11993
|
+
overlayContentStyle: swipeOverlayContentStyle,
|
|
11764
11994
|
swipeHandlers,
|
|
11765
11995
|
dismissAreaStyle,
|
|
11766
11996
|
} = useLightboxSwipeDismiss({
|
|
@@ -11783,25 +12013,26 @@ const LightboxOverlay = ({
|
|
|
11783
12013
|
const incomingSlide = slides[normalizedIndex];
|
|
11784
12014
|
slideTransitionKeyRef.current += 1;
|
|
11785
12015
|
const transitionKey = slideTransitionKeyRef.current;
|
|
11786
|
-
const shouldFadeTitles = textTransition === 'fade'
|
|
11787
|
-
&& getEntryTitleKey(outgoingSlide?.entry) !== getEntryTitleKey(incomingSlide?.entry);
|
|
12016
|
+
const shouldFadeTitles = textTransition === 'fade' && getEntryTitleKey(outgoingSlide?.entry) !== getEntryTitleKey(incomingSlide?.entry);
|
|
11788
12017
|
const measuredOutgoingTitlesHeight = titlesStackRef.current?.getBoundingClientRect().height;
|
|
11789
|
-
|
|
11790
|
-
|
|
11791
|
-
if (shouldFadeTitles) {
|
|
11792
|
-
incomingTitlesMeasureWidth = getIncomingTitlesMeasureWidth();
|
|
12018
|
+
const titleFadeMeasure = shouldFadeTitles ? (() => {
|
|
12019
|
+
const incomingTitlesMeasureWidth = getIncomingTitlesMeasureWidth();
|
|
11793
12020
|
flushSync(() => {
|
|
11794
12021
|
setIncomingMeasureEntry(incomingSlide.entry);
|
|
11795
12022
|
});
|
|
11796
12023
|
if (titlesMeasureRef.current && incomingTitlesMeasureWidth) {
|
|
11797
12024
|
titlesMeasureRef.current.style.width = \`\${incomingTitlesMeasureWidth}px\`;
|
|
11798
12025
|
}
|
|
11799
|
-
measuredIncomingTitlesHeight = titlesMeasureRef.current?.getBoundingClientRect().height;
|
|
12026
|
+
const measuredIncomingTitlesHeight = titlesMeasureRef.current?.getBoundingClientRect().height;
|
|
11800
12027
|
if (titlesMeasureRef.current) {
|
|
11801
12028
|
titlesMeasureRef.current.style.width = '';
|
|
11802
12029
|
}
|
|
11803
|
-
|
|
11804
|
-
|
|
12030
|
+
return { measuredIncomingTitlesHeight, incomingTitlesMeasureWidth };
|
|
12031
|
+
})() : undefined;
|
|
12032
|
+
const lockedTitlesHeight = Math.max(
|
|
12033
|
+
measuredOutgoingTitlesHeight ?? 0,
|
|
12034
|
+
titleFadeMeasure?.measuredIncomingTitlesHeight ?? 0,
|
|
12035
|
+
) || undefined;
|
|
11805
12036
|
|
|
11806
12037
|
setSlideTransitionKey(transitionKey);
|
|
11807
12038
|
setPrevSlideIndex(activeSlideIndex);
|
|
@@ -11814,8 +12045,8 @@ const LightboxOverlay = ({
|
|
|
11814
12045
|
if (lockedTitlesHeight) {
|
|
11815
12046
|
setTitlesStackMinHeight(lockedTitlesHeight);
|
|
11816
12047
|
}
|
|
11817
|
-
if (incomingTitlesMeasureWidth) {
|
|
11818
|
-
setTitlesStackWidth(incomingTitlesMeasureWidth);
|
|
12048
|
+
if (titleFadeMeasure?.incomingTitlesMeasureWidth) {
|
|
12049
|
+
setTitlesStackWidth(titleFadeMeasure.incomingTitlesMeasureWidth);
|
|
11819
12050
|
}
|
|
11820
12051
|
setPrevEntryIndex(outgoingSlide?.entryIndex ?? null);
|
|
11821
12052
|
setIsTitlesFading(true);
|
|
@@ -11863,14 +12094,11 @@ const LightboxOverlay = ({
|
|
|
11863
12094
|
resetStripNavGesture();
|
|
11864
12095
|
return;
|
|
11865
12096
|
}
|
|
11866
|
-
|
|
11867
12097
|
const gesture = stripNavGestureRef.current;
|
|
11868
12098
|
if (!gesture || gesture.pointerId !== event.pointerId) return;
|
|
11869
12099
|
resetStripNavGesture();
|
|
11870
|
-
|
|
11871
12100
|
const target = event.target as HTMLElement;
|
|
11872
12101
|
if (target.closest('[data-controls]')) return;
|
|
11873
|
-
|
|
11874
12102
|
const deltaX = event.clientX - gesture.startX;
|
|
11875
12103
|
const deltaY = event.clientY - gesture.startY;
|
|
11876
12104
|
const absX = Math.abs(deltaX);
|
|
@@ -11880,22 +12108,13 @@ const LightboxOverlay = ({
|
|
|
11880
12108
|
goToSlide(deltaX > 0 ? activeSlideIndex - 1 : activeSlideIndex + 1);
|
|
11881
12109
|
return;
|
|
11882
12110
|
}
|
|
11883
|
-
|
|
11884
12111
|
if (absX > STRIP_NAV_TAP_MAX_PX || absY > STRIP_NAV_TAP_MAX_PX) return;
|
|
11885
|
-
|
|
11886
12112
|
const navRect = lightboxRef.current?.getBoundingClientRect();
|
|
11887
12113
|
const midPoint = navRect
|
|
11888
12114
|
? navRect.left + navRect.width / 2
|
|
11889
12115
|
: window.innerWidth / 2;
|
|
11890
12116
|
goToSlide(event.clientX < midPoint ? activeSlideIndex - 1 : activeSlideIndex + 1);
|
|
11891
|
-
}, [
|
|
11892
|
-
activeSlideIndex,
|
|
11893
|
-
allowDesktopNav,
|
|
11894
|
-
goToSlide,
|
|
11895
|
-
isSwipeDragging,
|
|
11896
|
-
resetStripNavGesture,
|
|
11897
|
-
slides.length,
|
|
11898
|
-
]);
|
|
12117
|
+
}, [activeSlideIndex, allowDesktopNav, goToSlide, isSwipeDragging, resetStripNavGesture, slides.length]);
|
|
11899
12118
|
|
|
11900
12119
|
const onStripPointerCancel = useCallback((event: React.PointerEvent<HTMLDivElement>) => {
|
|
11901
12120
|
const gesture = stripNavGestureRef.current;
|
|
@@ -12011,52 +12230,136 @@ const LightboxOverlay = ({
|
|
|
12011
12230
|
|
|
12012
12231
|
const outgoingEntry = prevEntryIndex !== null ? entries[prevEntryIndex] : null;
|
|
12013
12232
|
const outgoingSlide = prevSlideIndex !== null ? slides[prevSlideIndex] : null;
|
|
12014
|
-
const hasTitles =
|
|
12015
|
-
activeEntry?.title1 || activeEntry?.title2 || activeEntry?.title3
|
|
12016
|
-
|| outgoingEntry?.title1 || outgoingEntry?.title2 || outgoingEntry?.title3,
|
|
12017
|
-
);
|
|
12233
|
+
const hasTitles = activeEntry?.title1 || activeEntry?.title2 || activeEntry?.title3 || outgoingEntry?.title1 || outgoingEntry?.title2 || outgoingEntry?.title3;
|
|
12018
12234
|
const hasCounter = shouldShowCounter(journalType, slides, entries);
|
|
12019
|
-
const hasCloseIcon =
|
|
12020
|
-
const titlesGapStyle = { gap: titlesGap };
|
|
12235
|
+
const hasCloseIcon = closeIcon !== null;
|
|
12021
12236
|
const persistentControlsGapStyle = hasCounter && hasCloseIcon ? { gap: countCloseGap } : undefined;
|
|
12237
|
+
const scaled = useCallback((value: number) => scalingValue(value, isEditor ?? false), [isEditor]);
|
|
12238
|
+
const titleWidthByKey = useMemo(
|
|
12239
|
+
() => ({
|
|
12240
|
+
title1Width: title1Width ?? DEFAULT_JOURNAL_TITLE_WIDTHS.title1Width,
|
|
12241
|
+
title2Width: title2Width ?? DEFAULT_JOURNAL_TITLE_WIDTHS.title2Width,
|
|
12242
|
+
title3Width: title3Width ?? DEFAULT_JOURNAL_TITLE_WIDTHS.title3Width,
|
|
12243
|
+
}),
|
|
12244
|
+
[title1Width, title2Width, title3Width],
|
|
12245
|
+
);
|
|
12246
|
+
const titleMarginLeftByKey = useMemo(
|
|
12247
|
+
() => ({
|
|
12248
|
+
title2MarginLeft,
|
|
12249
|
+
title3MarginLeft,
|
|
12250
|
+
}),
|
|
12251
|
+
[title2MarginLeft, title3MarginLeft],
|
|
12252
|
+
);
|
|
12253
|
+
const activeTitleSlots = useMemo(
|
|
12254
|
+
() => (activeEntry
|
|
12255
|
+
? buildJournalTitleSlots(P, activeEntry, title1Style, title2Style, title3Style)
|
|
12256
|
+
: []),
|
|
12257
|
+
[P, activeEntry, title1Style, title2Style, title3Style],
|
|
12258
|
+
);
|
|
12259
|
+
const storedTitleWidths = useMemo(
|
|
12260
|
+
() => activeTitleSlots.map((slot) => titleWidthByKey[slot.widthKey]),
|
|
12261
|
+
[activeTitleSlots, titleWidthByKey],
|
|
12262
|
+
);
|
|
12263
|
+
const resolvedTitleWidths = useMemo(
|
|
12264
|
+
() => resolveJournalTitleWidths(activeTitleSlots.length, storedTitleWidths),
|
|
12265
|
+
[activeTitleSlots.length, storedTitleWidths],
|
|
12266
|
+
);
|
|
12267
|
+
const getTitleBoundaryOffset = useCallback(
|
|
12268
|
+
(upToIndex: number) => getJournalTitleBoundaryOffset(
|
|
12269
|
+
activeTitleSlots,
|
|
12270
|
+
resolvedTitleWidths,
|
|
12271
|
+
titleMarginLeftByKey,
|
|
12272
|
+
upToIndex,
|
|
12273
|
+
),
|
|
12274
|
+
[activeTitleSlots, resolvedTitleWidths, titleMarginLeftByKey],
|
|
12275
|
+
);
|
|
12276
|
+
|
|
12277
|
+
const renderTitles = (entry: LightboxJournalItem | undefined) => {
|
|
12278
|
+
if (!entry) return null;
|
|
12279
|
+
const slots = buildJournalTitleSlots(P, entry, title1Style, title2Style, title3Style);
|
|
12280
|
+
const entryStoredWidths = slots.map((slot) => titleWidthByKey[slot.widthKey]);
|
|
12281
|
+
const effectiveWidths = getEffectiveJournalTitleWidths(
|
|
12282
|
+
slots.length,
|
|
12283
|
+
entryStoredWidths,
|
|
12284
|
+
);
|
|
12285
|
+
|
|
12286
|
+
return slots.map((slot, index) => {
|
|
12287
|
+
const marginLeft = slot.marginLeftKey ? titleMarginLeftByKey[slot.marginLeftKey] ?? 0 : 0;
|
|
12288
|
+
return (
|
|
12289
|
+
<div
|
|
12290
|
+
key={slot.className}
|
|
12291
|
+
className={\`\${P}-title-cell\`}
|
|
12292
|
+
style={{
|
|
12293
|
+
width: scaled(effectiveWidths[index] ?? 0),
|
|
12294
|
+
...(marginLeft > 0 ? { marginLeft: scaled(marginLeft) } : {}),
|
|
12295
|
+
}}
|
|
12296
|
+
>
|
|
12297
|
+
<p className={slot.className} style={slot.style}>{slot.text}</p>
|
|
12298
|
+
</div>
|
|
12299
|
+
);
|
|
12300
|
+
});
|
|
12301
|
+
};
|
|
12302
|
+
|
|
12303
|
+
const renderTitleMarginControls = () => activeTitleSlots.flatMap((slot, colIndex) => {
|
|
12304
|
+
if (!slot.marginLeftKey) return [];
|
|
12305
|
+
|
|
12306
|
+
const marginLeft = titleMarginLeftByKey[slot.marginLeftKey] ?? 0;
|
|
12307
|
+
const offsetBeforeMargin = getJournalTitleOffsetBeforeSlot(
|
|
12308
|
+
activeTitleSlots,
|
|
12309
|
+
resolvedTitleWidths,
|
|
12310
|
+
titleMarginLeftByKey,
|
|
12311
|
+
colIndex,
|
|
12312
|
+
);
|
|
12313
|
+
const marginHandleWidth = Math.max(marginLeft, TITLE_PADDING_HANDLE_WIDTH);
|
|
12022
12314
|
|
|
12023
|
-
const renderGapControl = (controlKey: string, gap: string, isReverse = false) => {
|
|
12024
|
-
const gapControlSize = getGapControlSize(gap);
|
|
12025
|
-
const gapControlRight = \`calc(-0.5 * (\${gapControlSize} + \${gap}))\`;
|
|
12026
12315
|
return (
|
|
12027
12316
|
<div
|
|
12028
|
-
|
|
12317
|
+
key={slot.marginLeftKey}
|
|
12318
|
+
data-controls={slot.marginLeftKey}
|
|
12319
|
+
data-controls-static-handle=""
|
|
12029
12320
|
data-controls-axis="x"
|
|
12030
|
-
|
|
12321
|
+
data-controls-variant="column-padding"
|
|
12322
|
+
data-controls-min="0"
|
|
12323
|
+
data-controls-max-fraction={String(resolvedTitleWidths[colIndex])}
|
|
12324
|
+
className={\`\${P}-padding-control-handle\`}
|
|
12031
12325
|
style={{
|
|
12032
12326
|
position: 'absolute',
|
|
12033
12327
|
top: 0,
|
|
12034
|
-
|
|
12035
|
-
width:
|
|
12328
|
+
left: scaled(offsetBeforeMargin),
|
|
12329
|
+
width: scaled(marginHandleWidth),
|
|
12036
12330
|
height: '100%',
|
|
12037
12331
|
pointerEvents: 'auto',
|
|
12038
|
-
zIndex: 3,
|
|
12039
12332
|
}}
|
|
12040
12333
|
/>
|
|
12041
12334
|
);
|
|
12042
|
-
};
|
|
12043
|
-
|
|
12044
|
-
const renderTitles = (entry: LightboxJournalItem | undefined, showGapControls = false) => {
|
|
12045
|
-
if (!entry) return null;
|
|
12335
|
+
});
|
|
12046
12336
|
|
|
12047
|
-
|
|
12048
|
-
|
|
12049
|
-
|
|
12050
|
-
|
|
12051
|
-
].filter((slot): slot is { className: string; style: React.CSSProperties; text: string } => slot !== null);
|
|
12337
|
+
const renderTitleWidthControls = () => activeTitleSlots.map((slot, colIndex) => {
|
|
12338
|
+
const maxTitleWidth = getJournalTitleMaxWidth(colIndex, resolvedTitleWidths);
|
|
12339
|
+
const boundaryOffset = getTitleBoundaryOffset(colIndex);
|
|
12340
|
+
const titleWidthHandleOffset = boundaryOffset - TITLE_RESIZE_HANDLE_WIDTH / 2;
|
|
12052
12341
|
|
|
12053
|
-
return
|
|
12054
|
-
<div key={slot.
|
|
12055
|
-
<
|
|
12056
|
-
|
|
12342
|
+
return (
|
|
12343
|
+
<div key={\`\${slot.widthKey}-junction\`} style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
|
|
12344
|
+
<div
|
|
12345
|
+
data-controls={slot.widthKey}
|
|
12346
|
+
data-controls-static-handle=""
|
|
12347
|
+
data-controls-axis="x"
|
|
12348
|
+
data-controls-max-fraction={String(maxTitleWidth)}
|
|
12349
|
+
data-controls-variant="column-width"
|
|
12350
|
+
className={\`\${P}-title-resize-handle\`}
|
|
12351
|
+
style={{
|
|
12352
|
+
position: 'absolute',
|
|
12353
|
+
top: 0,
|
|
12354
|
+
left: scaled(titleWidthHandleOffset),
|
|
12355
|
+
width: scaled(TITLE_RESIZE_HANDLE_WIDTH),
|
|
12356
|
+
height: '100%',
|
|
12357
|
+
pointerEvents: 'auto',
|
|
12358
|
+
}}
|
|
12359
|
+
/>
|
|
12057
12360
|
</div>
|
|
12058
|
-
)
|
|
12059
|
-
};
|
|
12361
|
+
);
|
|
12362
|
+
});
|
|
12060
12363
|
|
|
12061
12364
|
const getSlideImageCellProps = (image: LightboxJournalImage) => {
|
|
12062
12365
|
const useRatioWrapper = !image.objectFit && isImageRatioCover(coverFit);
|
|
@@ -12195,10 +12498,7 @@ const LightboxOverlay = ({
|
|
|
12195
12498
|
finishSlideTransition(slideTransitionKey);
|
|
12196
12499
|
}}
|
|
12197
12500
|
>
|
|
12198
|
-
<div
|
|
12199
|
-
className={\`\${P}-slide-area\`}
|
|
12200
|
-
// style={{ maxWidth: slideMaxWidth, maxHeight: slideMaxHeight }}
|
|
12201
|
-
>
|
|
12501
|
+
<div className={\`\${P}-slide-area\`}>
|
|
12202
12502
|
{renderSlideImages(outgoingSlide.images)}
|
|
12203
12503
|
</div>
|
|
12204
12504
|
</div>
|
|
@@ -12215,7 +12515,7 @@ const LightboxOverlay = ({
|
|
|
12215
12515
|
</div>
|
|
12216
12516
|
</div>
|
|
12217
12517
|
|
|
12218
|
-
<div className={\`\${P}-lightbox-
|
|
12518
|
+
<div className={\`\${P}-lightbox-overlay-content\`} style={{ width: '100%', height: '100%', ...swipeOverlayContentStyle }}>
|
|
12219
12519
|
<div
|
|
12220
12520
|
data-controls={showControls ? 'contentMarginTop' : undefined}
|
|
12221
12521
|
className={showControls ? \`\${P}-control\` : undefined}
|
|
@@ -12233,7 +12533,6 @@ const LightboxOverlay = ({
|
|
|
12233
12533
|
<div className={\`\${P}-text-bar-cell\`}>
|
|
12234
12534
|
<div
|
|
12235
12535
|
className={\`\${P}-titles-row\`}
|
|
12236
|
-
style={titlesGapStyle}
|
|
12237
12536
|
>
|
|
12238
12537
|
{textTransition === 'fade' ? (
|
|
12239
12538
|
<>
|
|
@@ -12241,7 +12540,6 @@ const LightboxOverlay = ({
|
|
|
12241
12540
|
ref={titlesMeasureRef}
|
|
12242
12541
|
className={\`\${P}-titles-stack\`}
|
|
12243
12542
|
style={{
|
|
12244
|
-
...titlesGapStyle,
|
|
12245
12543
|
position: 'absolute',
|
|
12246
12544
|
visibility: 'hidden',
|
|
12247
12545
|
pointerEvents: 'none',
|
|
@@ -12253,36 +12551,45 @@ const LightboxOverlay = ({
|
|
|
12253
12551
|
}}
|
|
12254
12552
|
aria-hidden="true"
|
|
12255
12553
|
>
|
|
12256
|
-
{incomingMeasureEntry ? renderTitles(incomingMeasureEntry
|
|
12554
|
+
{incomingMeasureEntry ? renderTitles(incomingMeasureEntry) : renderTitles(activeEntry)}
|
|
12257
12555
|
</div>
|
|
12258
12556
|
<div
|
|
12259
12557
|
ref={titlesStackRef}
|
|
12260
12558
|
className={\`\${P}-titles-stack\`}
|
|
12261
12559
|
style={{
|
|
12262
|
-
...titlesGapStyle,
|
|
12263
12560
|
...(isTitlesFading && titlesStackMinHeight ? { minHeight: titlesStackMinHeight } : undefined),
|
|
12264
12561
|
...(isTitlesFading && titlesStackWidth ? { width: titlesStackWidth, maxWidth: '100%' } : undefined),
|
|
12265
12562
|
...(isTitlesFading ? { overflow: 'hidden' } : undefined),
|
|
12266
12563
|
}}
|
|
12267
12564
|
>
|
|
12268
12565
|
{outgoingEntry && isTitlesFading ? (
|
|
12269
|
-
<div
|
|
12270
|
-
className={\`\${P}-titles-layer-out \${P}-titles-fade-out\`}
|
|
12271
|
-
style={titlesGapStyle}
|
|
12272
|
-
>
|
|
12566
|
+
<div className={\`\${P}-titles-layer-out \${P}-titles-fade-out\`}>
|
|
12273
12567
|
{renderTitles(outgoingEntry)}
|
|
12274
12568
|
</div>
|
|
12275
12569
|
) : null}
|
|
12276
12570
|
<div
|
|
12277
12571
|
className={\`\${P}-titles-layer-in\${isTitlesFading ? \` \${P}-titles-layer-in-fading \${P}-titles-fade-in\` : ''}\`}
|
|
12278
|
-
style={titlesGapStyle}
|
|
12279
12572
|
>
|
|
12280
|
-
{renderTitles(activeEntry
|
|
12573
|
+
{renderTitles(activeEntry)}
|
|
12281
12574
|
</div>
|
|
12575
|
+
{showControls && activeTitleSlots.length > 0 ? (
|
|
12576
|
+
<>
|
|
12577
|
+
{renderTitleMarginControls()}
|
|
12578
|
+
{renderTitleWidthControls()}
|
|
12579
|
+
</>
|
|
12580
|
+
) : null}
|
|
12282
12581
|
</div>
|
|
12283
12582
|
</>
|
|
12284
12583
|
) : (
|
|
12285
|
-
|
|
12584
|
+
<>
|
|
12585
|
+
{renderTitles(activeEntry)}
|
|
12586
|
+
{showControls && activeTitleSlots.length > 0 ? (
|
|
12587
|
+
<>
|
|
12588
|
+
{renderTitleMarginControls()}
|
|
12589
|
+
{renderTitleWidthControls()}
|
|
12590
|
+
</>
|
|
12591
|
+
) : null}
|
|
12592
|
+
</>
|
|
12286
12593
|
)}
|
|
12287
12594
|
</div>
|
|
12288
12595
|
</div>
|
|
@@ -12298,7 +12605,22 @@ const LightboxOverlay = ({
|
|
|
12298
12605
|
>
|
|
12299
12606
|
{formatSlideCounter(slides, activeSlideIndex, journalType, entries)}
|
|
12300
12607
|
</span>
|
|
12301
|
-
{showControls && hasCloseIcon
|
|
12608
|
+
{showControls && hasCloseIcon
|
|
12609
|
+
? <div
|
|
12610
|
+
data-controls="countCloseGap"
|
|
12611
|
+
data-controls-axis="x"
|
|
12612
|
+
data-controls-reverse="true"
|
|
12613
|
+
style={{
|
|
12614
|
+
position: 'absolute',
|
|
12615
|
+
top: 0,
|
|
12616
|
+
right: \`calc(-0.5 * (\${getGapControlSize(countCloseGap)} + \${countCloseGap}))\`,
|
|
12617
|
+
width: getGapControlSize(countCloseGap),
|
|
12618
|
+
height: '100%',
|
|
12619
|
+
pointerEvents: 'auto',
|
|
12620
|
+
zIndex: 3,
|
|
12621
|
+
}}
|
|
12622
|
+
/>
|
|
12623
|
+
: null}
|
|
12302
12624
|
</div>
|
|
12303
12625
|
)}
|
|
12304
12626
|
{hasCloseIcon && (
|
|
@@ -12505,9 +12827,12 @@ export const LightboxJournal = ({ settings, content, isEditor, isEditMode, isPre
|
|
|
12505
12827
|
imageGap,
|
|
12506
12828
|
maxWidth,
|
|
12507
12829
|
maxHeight,
|
|
12508
|
-
textMaxWidth,
|
|
12509
12830
|
textTransition,
|
|
12510
|
-
|
|
12831
|
+
title1Width,
|
|
12832
|
+
title2Width,
|
|
12833
|
+
title3Width,
|
|
12834
|
+
title2MarginLeft,
|
|
12835
|
+
title3MarginLeft,
|
|
12511
12836
|
countCloseGap,
|
|
12512
12837
|
closeIcon,
|
|
12513
12838
|
closeIconMaxWidth,
|
|
@@ -12639,8 +12964,11 @@ export const LightboxJournal = ({ settings, content, isEditor, isEditMode, isPre
|
|
|
12639
12964
|
imageGap={scaled(imageGap ?? 0)}
|
|
12640
12965
|
slideMaxWidth={\`\${maxWidth}%\`}
|
|
12641
12966
|
slideMaxHeight={\`\${maxHeight}%\`}
|
|
12642
|
-
|
|
12643
|
-
|
|
12967
|
+
title1Width={title1Width ?? DEFAULT_JOURNAL_TITLE_WIDTHS.title1Width}
|
|
12968
|
+
title2Width={title2Width ?? DEFAULT_JOURNAL_TITLE_WIDTHS.title2Width}
|
|
12969
|
+
title3Width={title3Width ?? DEFAULT_JOURNAL_TITLE_WIDTHS.title3Width}
|
|
12970
|
+
title2MarginLeft={title2MarginLeft ?? 0}
|
|
12971
|
+
title3MarginLeft={title3MarginLeft ?? 0}
|
|
12644
12972
|
countCloseGap={scaled(countCloseGap ?? 0)}
|
|
12645
12973
|
textTransition={textTransition}
|
|
12646
12974
|
title1Style={title1Style}
|
|
@@ -12682,9 +13010,12 @@ export type LightboxJournalSettings = {
|
|
|
12682
13010
|
maxHeight: number;
|
|
12683
13011
|
backgroundColor: string;
|
|
12684
13012
|
imageGap?: number;
|
|
12685
|
-
textMaxWidth: number;
|
|
12686
13013
|
textTransition: 'none' | 'fade';
|
|
12687
|
-
|
|
13014
|
+
title1Width?: number;
|
|
13015
|
+
title2Width?: number;
|
|
13016
|
+
title3Width?: number;
|
|
13017
|
+
title2MarginLeft?: number;
|
|
13018
|
+
title3MarginLeft?: number;
|
|
12688
13019
|
countCloseGap?: number;
|
|
12689
13020
|
title1Color: string;
|
|
12690
13021
|
title2Color: string;
|
|
@@ -12730,4 +13061,4 @@ export type LightboxJournalSettings = {
|
|
|
12730
13061
|
closeIconColor: string;
|
|
12731
13062
|
closeIconHoverColor: string;
|
|
12732
13063
|
};
|
|
12733
|
-
`,
|
|
13064
|
+
`,wm="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 $m(e){const t={};return t[Je(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Je(e,"fontSettings")]={...mn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Je(e,"fontSize")]={...mn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Je(e,"lineHeight")]={...mn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Je(e,"letterSpacing")]={...mn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Je(e,"wordSpacing")]={...mn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Je(e,"textAlign")]={...mn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Je(e,"textAppearance")]={...mn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Tm=ui.reduce((e,t)=>({...e,...$m(t)}),{}),Lm=ui.reduce((e,t)=>({...e,[Je(t,"fontFamily")]:"Arial",[Je(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Je(t,"letterSpacing")]:0,[Je(t,"wordSpacing")]:0,[Je(t,"textAlign")]:"left",[Je(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function la(e){return ui.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Je(n,"fontSize")]=i),o!==void 0&&(t[Je(n,"lineHeight")]=o),t},{})}const Im=vm(),Em={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...Tm,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},contentMarginLeft:{type:"number",scope:"layout",title:"Content margin left",min:0,display:{type:"range-control"}},contentMarginRight:{type:"number",scope:"layout",title:"Content margin right",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/LightboxJournal_1.jpg",coverFit:{display:"Cover",ratioValue:"16:9",reversed:!1},closeIcon:wm,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#ffffff",...Lm},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.05,contentMarginTop:.02,contentMarginLeft:.01,contentMarginRight:.01,title1Width:.13,title2Width:.13,title3Width:.14,title2MarginLeft:.01,title3MarginLeft:.01,countCloseGap:.005,...la({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,closeIconMaxWidth:.015,contentMarginTop:.01,contentMarginLeft:.01,contentMarginRight:.01,title1Width:.13,title2Width:.13,title3Width:.14,title2MarginLeft:.1,title3MarginLeft:.1,countCloseGap:.02,...la({title1FontSize:.01,title1LineHeight:.01,title2FontSize:.01,title2LineHeight:.01,title3FontSize:.01,title3LineHeight:.01,countFontSize:.01,countLineHeight:.01})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","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:["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:[Im]}],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"}]}]}},_m={element:Sm,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:Em,sourceCode:Cm,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:ui.map(e=>({path:`styles.${Je(e,"fontSettings")}`}))}},Rm=[bc,Lc,gd,Qp,_m,wd,Md,Kd,Yd,iu,hu,yp];exports.components=Rm;exports.isSchemaV1=ds;
|