@cntrl-site/components 1.0.17-alpha.5 → 1.0.17-alpha.6
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 +212 -52
- package/dist/index.mjs +3537 -3312
- package/package.json +1 -1
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"),Xe=require("classnames"),E=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Li=require("react-dom");function Ks(e){return e.type==="object"&&e.version===1}const Us="ControlSlider-module__wrapper___sHEkd",Gs="ControlSlider-module__hoverArrow___A-dOH",qs="ControlSlider-module__sliderItem___QQSkR",Xs="ControlSlider-module__sliderImage___9hRl-",Ys="ControlSlider-module__arrow___05ghY",Js="ControlSlider-module__arrowVertical___tBfVN",Zs="ControlSlider-module__nextArrow___-30Yc",Qs="ControlSlider-module__arrowInner___aEra3",ea="ControlSlider-module__arrowIcon___S4ztF",ta="ControlSlider-module__arrowImg___2dwJW",na="ControlSlider-module__mirror___brd6U",ia="ControlSlider-module__pagination___bicLF",oa="ControlSlider-module__paginationInner___bT-P-",ra="ControlSlider-module__paginationVertical___zYqKw",la="ControlSlider-module__paginationItem___nTRbk",sa="ControlSlider-module__dot___p1Qun",aa="ControlSlider-module__activeDot___LHFaj",ca="ControlSlider-module__paginationInsideBottom___R3FWn",da="ControlSlider-module__paginationInsideTop___V-qb-",ua="ControlSlider-module__paginationOutsideBottom___14w8D",pa="ControlSlider-module__paginationOutsideTop___SCLqB",ma="ControlSlider-module__paginationInsideLeft___yOBRZ",ga="ControlSlider-module__paginationInsideRight___Rtt3o",ha="ControlSlider-module__paginationOutsideLeft___lahaw",fa="ControlSlider-module__paginationOutsideRight___EtuQa",ya="ControlSlider-module__imgWrapper___UjEgB",va="ControlSlider-module__captionBlock___dJ6-j",xa="ControlSlider-module__captionTextWrapper___HFlpf",ba="ControlSlider-module__captionText___uGBVc",Sa="ControlSlider-module__active___WZK4G",wa="ControlSlider-module__withPointerEvents___t-18M",Ca="ControlSlider-module__topLeftAlignment___zjnGM",Ta="ControlSlider-module__topCenterAlignment___gD1xW",$a="ControlSlider-module__topRightAlignment___NMapS",La="ControlSlider-module__middleLeftAlignment___OnUrY",Ia="ControlSlider-module__middleCenterAlignment___Tdkl0",Ea="ControlSlider-module__middleRightAlignment___wEbfX",Ra="ControlSlider-module__bottomLeftAlignment___cTP2-",Ma="ControlSlider-module__bottomCenterAlignment___c54fB",_a="ControlSlider-module__bottomRightAlignment___kEwrz",Wa="ControlSlider-module__clickOverlay___DZA28",Aa="ControlSlider-module__contain___pLyq7",Pa="ControlSlider-module__cover___KdDat",be={wrapper:Us,hoverArrow:Gs,sliderItem:qs,sliderImage:Xs,arrow:Ys,arrowVertical:Js,nextArrow:Zs,arrowInner:Qs,arrowIcon:ea,arrowImg:ta,mirror:na,pagination:ia,paginationInner:oa,paginationVertical:ra,paginationItem:la,dot:sa,activeDot:aa,paginationInsideBottom:ca,paginationInsideTop:da,paginationOutsideBottom:ua,paginationOutsideTop:pa,paginationInsideLeft:ma,paginationInsideRight:ga,paginationOutsideLeft:ha,paginationOutsideRight:fa,imgWrapper:ya,captionBlock:va,captionTextWrapper:xa,captionText:ba,active:Sa,withPointerEvents:wa,topLeftAlignment:Ca,topCenterAlignment:Ta,topRightAlignment:$a,middleLeftAlignment:La,middleCenterAlignment:Ia,middleRightAlignment:Ea,bottomLeftAlignment:Ra,bottomCenterAlignment:Ma,bottomRightAlignment:_a,clickOverlay:Wa,contain:Aa,cover:Pa};function ka(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 Fa(e,t,n){return t&&ka(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Kr="(prefers-reduced-motion: reduce)",Yn=1,Na=2,ei=3,si=4,Ii=5,Qi=6,ao=7,Ha={CREATED:Yn,MOUNTED:Na,IDLE:ei,MOVING:si,SCROLLING:Ii,DRAGGING:Qi,DESTROYED:ao};function vn(e){e.length=0}function Rn(e,t,n){return Array.prototype.slice.call(e,t,n)}function at(e){return e.bind.apply(e,[null].concat(Rn(arguments,1)))}var Vl=setTimeout,Jo=function(){};function Ur(e){return requestAnimationFrame(e)}function fo(e,t){return typeof t===e}function hi(e){return!ur(e)&&fo("object",e)}var dr=Array.isArray,Kl=at(fo,"function"),Ln=at(fo,"string"),Ei=at(fo,"undefined");function ur(e){return e===null}function Ul(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Ri(e){return dr(e)?e:[e]}function qt(e,t){Ri(e).forEach(t)}function pr(e,t){return e.indexOf(t)>-1}function eo(e,t){return e.push.apply(e,Ri(t)),e}function mn(e,t,n){e&&qt(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function on(e,t){mn(e,Ln(t)?t.split(" "):t,!0)}function Mi(e,t){qt(t,e.appendChild.bind(e))}function mr(e,t){qt(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function fi(e,t){return Ul(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Gl(e,t){var n=e?Rn(e.children):[];return t?n.filter(function(i){return fi(i,t)}):n}function _i(e,t){return t?Gl(e,t)[0]:e.firstElementChild}var yi=Object.keys;function Bn(e,t,n){return e&&(n?yi(e).reverse():yi(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function vi(e){return Rn(arguments,1).forEach(function(t){Bn(t,function(n,i){e[i]=t[i]})}),e}function $n(e){return Rn(arguments,1).forEach(function(t){Bn(t,function(n,i){dr(n)?e[i]=n.slice():hi(n)?e[i]=$n({},hi(e[i])?e[i]:{},n):e[i]=n})}),e}function Gr(e,t){qt(t||yi(e),function(n){delete e[n]})}function rn(e,t){qt(e,function(n){qt(t,function(i){n&&n.removeAttribute(i)})})}function Be(e,t,n){hi(t)?Bn(t,function(i,o){Be(e,o,i)}):qt(e,function(i){ur(n)||n===""?rn(i,t):i.setAttribute(t,String(n))})}function Jn(e,t,n){var i=document.createElement(e);return t&&(Ln(t)?on(i,t):Be(i,t)),n&&Mi(n,i),i}function Yt(e,t,n){if(Ei(n))return getComputedStyle(e)[t];ur(n)||(e.style[t]=""+n)}function xi(e,t){Yt(e,"display",t)}function ql(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Jt(e,t){return e.getAttribute(t)}function qr(e,t){return e&&e.classList.contains(t)}function Kt(e){return e.getBoundingClientRect()}function On(e){qt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Xl(e){return _i(new DOMParser().parseFromString(e,"text/html").body)}function pn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Yl(e,t){return e&&e.querySelector(t)}function gr(e,t){return t?Rn(e.querySelectorAll(t)):[]}function gn(e,t){mn(e,t,!1)}function Zo(e){return e.timeStamp}function An(e){return Ln(e)?e:e?e+"px":""}var Wi="splide",hr="data-"+Wi;function pi(e,t){if(!e)throw new Error("["+Wi+"] "+(t||""))}var In=Math.min,co=Math.max,uo=Math.floor,bi=Math.ceil,Bt=Math.abs;function Jl(e,t,n){return Bt(e-t)<n}function to(e,t,n,i){var o=In(t,n),l=co(t,n);return i?o<e&&e<l:o<=e&&e<=l}function Gn(e,t,n){var i=In(t,n),o=co(t,n);return In(co(i,e),o)}function Qo(e){return+(e>0)-+(e<0)}function er(e,t){return qt(t,function(n){e=e.replace("%s",""+n)}),e}function fr(e){return e<10?"0"+e:""+e}var Xr={};function Ba(e){return""+e+fr(Xr[e]=(Xr[e]||0)+1)}function Zl(){var e=[];function t(s,d,a,p){o(s,d,function(u,S,x){var y="addEventListener"in u,m=y?u.removeEventListener.bind(u,S,a,p):u.removeListener.bind(u,a);y?u.addEventListener(S,a,p):u.addListener(a),e.push([u,S,x,a,m])})}function n(s,d,a){o(s,d,function(p,u,S){e=e.filter(function(x){return x[0]===p&&x[1]===u&&x[2]===S&&(!a||x[3]===a)?(x[4](),!1):!0})})}function i(s,d,a){var p,u=!0;return typeof CustomEvent=="function"?p=new CustomEvent(d,{bubbles:u,detail:a}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(d,u,!1,a)),s.dispatchEvent(p),p}function o(s,d,a){qt(s,function(p){p&&qt(d,function(u){u.split(" ").forEach(function(S){var x=S.split(".");a(p,x[0],x[1])})})})}function l(){e.forEach(function(s){s[4]()}),vn(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var Mn="mounted",tr="ready",xn="move",ai="moved",yr="click",Ql="active",es="inactive",ts="visible",ns="hidden",Lt="refresh",Pt="updated",ti="resize",yo="resized",is="drag",os="dragging",rs="dragged",vo="scroll",jn="scrolled",Oa="overflow",vr="destroy",ls="arrows:mounted",ss="arrows:updated",as="pagination:mounted",cs="pagination:updated",xr="navigation:mounted",br="autoplay:play",ds="autoplay:playing",Sr="autoplay:pause",wr="lazyload:loaded",us="sk",ps="sh",po="ei";function xt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Zl();function i(l,s){n.bind(t,Ri(l).join(" "),function(d){s.apply(s,dr(d.detail)?d.detail:[])})}function o(l){n.dispatch(t,l,Rn(arguments,1))}return e&&e.event.on(vr,n.destroy),vi(n,{bus:t,on:i,off:at(n.unbind,t),emit:o})}function xo(e,t,n,i){var o=Date.now,l,s=0,d,a=!0,p=0;function u(){if(!a){if(s=e?In((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++p>=i))return x();d=Ur(u)}}function S(w){w||m(),l=o()-(w?s*e:0),a=!1,d=Ur(u)}function x(){a=!0}function y(){l=o(),s=0,n&&n(s)}function m(){d&&cancelAnimationFrame(d),s=0,d=0,a=!0}function f(w){e=w}function $(){return a}return{start:S,rewind:y,pause:x,cancel:m,set:f,isPaused:$}}function Da(e){var t=e;function n(o){t=o}function i(o){return pr(Ri(o),t)}return{set:n,is:i}}function ja(e,t){var n=xo(0,e,null,1);return function(){n.isPaused()&&n.start()}}function za(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=Zl(),d=[];function a(){var m=n.mediaQuery==="min";yi(o).sort(function(f,$){return m?+f-+$:+$-+f}).forEach(function(f){u(o[f],"("+(m?"min":"max")+"-width:"+f+"px)")}),u(l,Kr),S()}function p(m){m&&s.destroy()}function u(m,f){var $=matchMedia(f);s.bind($,"change",S),d.push([m,$])}function S(){var m=i.is(ao),f=n.direction,$=d.reduce(function(w,C){return $n(w,C[1].matches?C[0]:{})},{});Gr(n),y($),n.destroy?e.destroy(n.destroy==="completely"):m?(p(!0),e.mount()):f!==n.direction&&e.refresh()}function x(m){matchMedia(Kr).matches&&(m?$n(n,l):Gr(n,yi(l)))}function y(m,f,$){$n(n,m),f&&$n(Object.getPrototypeOf(n),m),($||!i.is(Yn))&&e.emit(Pt,n)}return{setup:a,destroy:p,reduce:x,set:y}}var bo="Arrow",So=bo+"Left",wo=bo+"Right",ms=bo+"Up",gs=bo+"Down",Yr="rtl",Co="ttb",Wo={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[ms,wo],ArrowRight:[gs,So]};function Va(e,t,n){function i(l,s,d){d=d||n.direction;var a=d===Yr&&!s?1:d===Co?0:-1;return Wo[l]&&Wo[l][a]||l.replace(/width|left|right/i,function(p,u){var S=Wo[p.toLowerCase()][a]||p;return u>0?S.charAt(0).toUpperCase()+S.slice(1):S})}function o(l){return l*(n.direction===Yr?1:-1)}return{resolve:i,orient:o}}var hn="role",Zn="tabindex",Ka="disabled",Zt="aria-",Ai=Zt+"controls",hs=Zt+"current",Jr=Zt+"selected",Ut=Zt+"label",Cr=Zt+"labelledby",fs=Zt+"hidden",Tr=Zt+"orientation",Si=Zt+"roledescription",Zr=Zt+"live",Qr=Zt+"busy",el=Zt+"atomic",$r=[hn,Zn,Ka,Ai,hs,Ut,Cr,fs,Tr,Si],ln=Wi+"__",_n="is-",Ao=Wi,tl=ln+"track",Ua=ln+"list",To=ln+"slide",ys=To+"--clone",Ga=To+"__container",Lr=ln+"arrows",$o=ln+"arrow",vs=$o+"--prev",xs=$o+"--next",Lo=ln+"pagination",bs=Lo+"__page",qa=ln+"progress",Xa=qa+"__bar",Ya=ln+"toggle",Ja=ln+"spinner",Za=ln+"sr",Qa=_n+"initialized",Dn=_n+"active",Ss=_n+"prev",ws=_n+"next",nr=_n+"visible",ir=_n+"loading",Cs=_n+"focus-in",Ts=_n+"overflow",ec=[Dn,nr,Ss,ws,ir,Cs,Ts],tc={slide:To,clone:ys,arrows:Lr,arrow:$o,prev:vs,next:xs,pagination:Lo,page:bs,spinner:Ja};function nc(e,t){if(Kl(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!fi(n,t);)n=n.parentElement;return n}var ic=5,nl=200,$s="touchstart mousedown",Po="touchmove mousemove",ko="touchend touchcancel mouseup click";function oc(e,t,n){var i=xt(e),o=i.on,l=i.bind,s=e.root,d=n.i18n,a={},p=[],u=[],S=[],x,y,m;function f(){T(),P(),C()}function $(){o(Lt,w),o(Lt,f),o(Pt,C),l(document,$s+" keydown",function(b){m=b.type==="keydown"},{capture:!0}),l(s,"focusin",function(){mn(s,Cs,!!m)})}function w(b){var _=$r.concat("style");vn(p),gn(s,u),gn(x,S),rn([x,y],_),rn(s,b?_:["style",Si])}function C(){gn(s,u),gn(x,S),u=F(Ao),S=F(tl),on(s,u),on(x,S),Be(s,Ut,n.label),Be(s,Cr,n.labelledby)}function T(){x=R("."+tl),y=_i(x,"."+Ua),pi(x&&y,"A track/list element is missing."),eo(p,Gl(y,"."+To+":not(."+ys+")")),Bn({arrows:Lr,pagination:Lo,prev:vs,next:xs,bar:Xa,toggle:Ya},function(b,_){a[_]=R("."+b)}),vi(a,{root:s,track:x,list:y,slides:p})}function P(){var b=s.id||Ba(Wi),_=n.role;s.id=b,x.id=x.id||b+"-track",y.id=y.id||b+"-list",!Jt(s,hn)&&s.tagName!=="SECTION"&&_&&Be(s,hn,_),Be(s,Si,d.carousel),Be(y,hn,"presentation")}function R(b){var _=Yl(s,b);return _&&nc(_,"."+Ao)===s?_:void 0}function F(b){return[b+"--"+n.type,b+"--"+n.direction,n.drag&&b+"--draggable",n.isNavigation&&b+"--nav",b===Ao&&Dn]}return vi(a,{setup:f,mount:$,destroy:w})}var ni="slide",ci="loop",Pi="fade";function rc(e,t,n,i){var o=xt(e),l=o.on,s=o.emit,d=o.bind,a=e.Components,p=e.root,u=e.options,S=u.isNavigation,x=u.updateOnMove,y=u.i18n,m=u.pagination,f=u.slideFocus,$=a.Direction.resolve,w=Jt(i,"style"),C=Jt(i,Ut),T=n>-1,P=_i(i,"."+Ga),R;function F(){T||(i.id=p.id+"-slide"+fr(t+1),Be(i,hn,m?"tabpanel":"group"),Be(i,Si,y.slide),Be(i,Ut,C||er(y.slideLabel,[t+1,e.length]))),b()}function b(){d(i,"click",at(s,yr,G)),d(i,"keydown",at(s,us,G)),l([ai,ps,jn],L),l(xr,V),x&&l(xn,h)}function _(){R=!0,o.destroy(),gn(i,ec),rn(i,$r),Be(i,"style",w),Be(i,Ut,C||"")}function V(){var K=e.splides.map(function(H){var q=H.splide.Components.Slides.getAt(t);return q?q.slide.id:""}).join(" ");Be(i,Ut,er(y.slideX,(T?n:t)+1)),Be(i,Ai,K),Be(i,hn,f?"button":""),f&&rn(i,Si)}function h(){R||L()}function L(){if(!R){var K=e.index;I(),k(),mn(i,Ss,t===K-1),mn(i,ws,t===K+1)}}function I(){var K=le();K!==qr(i,Dn)&&(mn(i,Dn,K),Be(i,hs,S&&K||""),s(K?Ql:es,G))}function k(){var K=O(),H=!K&&(!le()||T);if(e.state.is([si,Ii])||Be(i,fs,H||""),Be(gr(i,u.focusableNodes||""),Zn,H?-1:""),f&&Be(i,Zn,H?-1:0),K!==qr(i,nr)&&(mn(i,nr,K),s(K?ts:ns,G)),!K&&document.activeElement===i){var q=a.Slides.getAt(e.index);q&&ql(q.slide)}}function z(K,H,q){Yt(q&&P||i,K,H)}function le(){var K=e.index;return K===t||u.cloneStatus&&K===n}function O(){if(e.is(Pi))return le();var K=Kt(a.Elements.track),H=Kt(i),q=$("left",!0),te=$("right",!0);return uo(K[q])<=bi(H[q])&&uo(H[te])<=bi(K[te])}function W(K,H){var q=Bt(K-t);return!T&&(u.rewind||e.is(ci))&&(q=In(q,e.length-q)),q<=H}var G={index:t,slideIndex:n,slide:i,container:P,isClone:T,mount:F,destroy:_,update:L,style:z,isWithin:W};return G}function lc(e,t,n){var i=xt(e),o=i.on,l=i.emit,s=i.bind,d=t.Elements,a=d.slides,p=d.list,u=[];function S(){x(),o(Lt,y),o(Lt,x)}function x(){a.forEach(function(L,I){f(L,I,-1)})}function y(){R(function(L){L.destroy()}),vn(u)}function m(){R(function(L){L.update()})}function f(L,I,k){var z=rc(e,I,k,L);z.mount(),u.push(z),u.sort(function(le,O){return le.index-O.index})}function $(L){return L?F(function(I){return!I.isClone}):u}function w(L){var I=t.Controller,k=I.toIndex(L),z=I.hasFocus()?1:n.perPage;return F(function(le){return to(le.index,k,k+z-1)})}function C(L){return F(L)[0]}function T(L,I){qt(L,function(k){if(Ln(k)&&(k=Xl(k)),Ul(k)){var z=a[I];z?mr(k,z):Mi(p,k),on(k,n.classes.slide),_(k,at(l,ti))}}),l(Lt)}function P(L){On(F(L).map(function(I){return I.slide})),l(Lt)}function R(L,I){$(I).forEach(L)}function F(L){return u.filter(Kl(L)?L:function(I){return Ln(L)?fi(I.slide,L):pr(Ri(L),I.index)})}function b(L,I,k){R(function(z){z.style(L,I,k)})}function _(L,I){var k=gr(L,"img"),z=k.length;z?k.forEach(function(le){s(le,"load error",function(){--z||I()})}):I()}function V(L){return L?a.length:u.length}function h(){return u.length>n.perPage}return{mount:S,destroy:y,update:m,register:f,get:$,getIn:w,getAt:C,add:T,remove:P,forEach:R,filter:F,style:b,getLength:V,isEnough:h}}function sc(e,t,n){var i=xt(e),o=i.on,l=i.bind,s=i.emit,d=t.Slides,a=t.Direction.resolve,p=t.Elements,u=p.root,S=p.track,x=p.list,y=d.getAt,m=d.style,f,$,w;function C(){T(),l(window,"resize load",ja(at(s,ti))),o([Pt,Lt],T),o(ti,P)}function T(){f=n.direction===Co,Yt(u,"maxWidth",An(n.width)),Yt(S,a("paddingLeft"),R(!1)),Yt(S,a("paddingRight"),R(!0)),P(!0)}function P(G){var K=Kt(u);(G||$.width!==K.width||$.height!==K.height)&&(Yt(S,"height",F()),m(a("marginRight"),An(n.gap)),m("width",_()),m("height",V(),!0),$=K,s(yo),w!==(w=W())&&(mn(u,Ts,w),s(Oa,w)))}function R(G){var K=n.padding,H=a(G?"right":"left");return K&&An(K[H]||(hi(K)?0:K))||"0px"}function F(){var G="";return f&&(G=b(),pi(G,"height or heightRatio is missing."),G="calc("+G+" - "+R(!1)+" - "+R(!0)+")"),G}function b(){return An(n.height||Kt(x).width*n.heightRatio)}function _(){return n.autoWidth?null:An(n.fixedWidth)||(f?"":h())}function V(){return An(n.fixedHeight)||(f?n.autoHeight?null:h():b())}function h(){var G=An(n.gap);return"calc((100%"+(G&&" + "+G)+")/"+(n.perPage||1)+(G&&" - "+G)+")"}function L(){return Kt(x)[a("width")]}function I(G,K){var H=y(G||0);return H?Kt(H.slide)[a("width")]+(K?0:le()):0}function k(G,K){var H=y(G);if(H){var q=Kt(H.slide)[a("right")],te=Kt(x)[a("left")];return Bt(q-te)+(K?0:le())}return 0}function z(G){return k(e.length-1)-k(0)+I(0,G)}function le(){var G=y(0);return G&&parseFloat(Yt(G.slide,a("marginRight")))||0}function O(G){return parseFloat(Yt(S,a("padding"+(G?"Right":"Left"))))||0}function W(){return e.is(Pi)||z(!0)>L()}return{mount:C,resize:P,listSize:L,slideSize:I,sliderSize:z,totalSize:k,getPadding:O,isOverflow:W}}var ac=2;function cc(e,t,n){var i=xt(e),o=i.on,l=t.Elements,s=t.Slides,d=t.Direction.resolve,a=[],p;function u(){o(Lt,S),o([Pt,ti],y),(p=$())&&(m(p),t.Layout.resize(!0))}function S(){x(),u()}function x(){On(a),vn(a),i.destroy()}function y(){var w=$();p!==w&&(p<w||!w)&&i.emit(Lt)}function m(w){var C=s.get().slice(),T=C.length;if(T){for(;C.length<w;)eo(C,C);eo(C.slice(-w),C.slice(0,w)).forEach(function(P,R){var F=R<w,b=f(P.slide,R);F?mr(b,C[0].slide):Mi(l.list,b),eo(a,b),s.register(b,R-w+(F?0:T),P.index)})}}function f(w,C){var T=w.cloneNode(!0);return on(T,n.classes.clone),T.id=e.root.id+"-clone"+fr(C+1),T}function $(){var w=n.clones;if(!e.is(ci))w=0;else if(Ei(w)){var C=n[d("fixedWidth")]&&t.Layout.slideSize(0),T=C&&bi(Kt(l.track)[d("width")]/C);w=T||n[d("autoWidth")]&&e.length||n.perPage*ac}return w}return{mount:u,destroy:x}}function dc(e,t,n){var i=xt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Layout,a=d.slideSize,p=d.getPadding,u=d.totalSize,S=d.listSize,x=d.sliderSize,y=t.Direction,m=y.resolve,f=y.orient,$=t.Elements,w=$.list,C=$.track,T;function P(){T=t.Transition,o([Mn,yo,Pt,Lt],R)}function R(){t.Controller.isBusy()||(t.Scroll.cancel(),b(e.index),t.Slides.update())}function F(H,q,te,se){H!==q&&G(H>te)&&(L(),_(h(z(),H>te),!0)),s(si),l(xn,q,te,H),T.start(q,function(){s(ei),l(ai,q,te,H),se&&se()})}function b(H){_(k(H,!0))}function _(H,q){if(!e.is(Pi)){var te=q?H:V(H);Yt(w,"transform","translate"+m("X")+"("+te+"px)"),H!==te&&l(ps)}}function V(H){if(e.is(ci)){var q=I(H),te=q>t.Controller.getEnd(),se=q<0;(se||te)&&(H=h(H,te))}return H}function h(H,q){var te=H-W(q),se=x();return H-=f(se*(bi(Bt(te)/se)||1))*(q?1:-1),H}function L(){_(z(),!0),T.cancel()}function I(H){for(var q=t.Slides.get(),te=0,se=1/0,N=0;N<q.length;N++){var ce=q[N].index,g=Bt(k(ce,!0)-H);if(g<=se)se=g,te=ce;else break}return te}function k(H,q){var te=f(u(H-1)-O(H));return q?le(te):te}function z(){var H=m("left");return Kt(w)[H]-Kt(C)[H]+f(p(!1))}function le(H){return n.trimSpace&&e.is(ni)&&(H=Gn(H,0,f(x(!0)-S()))),H}function O(H){var q=n.focus;return q==="center"?(S()-a(H,!0))/2:+q*a(H)||0}function W(H){return k(H?t.Controller.getEnd():0,!!n.trimSpace)}function G(H){var q=f(h(z(),H));return H?q>=0:q<=w[m("scrollWidth")]-Kt(C)[m("width")]}function K(H,q){q=Ei(q)?z():q;var te=H!==!0&&f(q)<f(W(!1)),se=H!==!1&&f(q)>f(W(!0));return te||se}return{mount:P,move:F,jump:b,translate:_,shift:h,cancel:L,toIndex:I,toPosition:k,getPosition:z,getLimit:W,exceededLimit:K,reposition:R}}function uc(e,t,n){var i=xt(e),o=i.on,l=i.emit,s=t.Move,d=s.getPosition,a=s.getLimit,p=s.toPosition,u=t.Slides,S=u.isEnough,x=u.getLength,y=n.omitEnd,m=e.is(ci),f=e.is(ni),$=at(z,!1),w=at(z,!0),C=n.start||0,T,P=C,R,F,b;function _(){V(),o([Pt,Lt,po],V),o(yo,h)}function V(){R=x(!0),F=n.perMove,b=n.perPage,T=G();var g=Gn(C,0,y?T:R-1);g!==C&&(C=g,s.reposition())}function h(){T!==G()&&l(po)}function L(g,ne,fe){if(!ce()){var ie=k(g),we=W(ie);we>-1&&(ne||we!==C)&&(te(we),s.move(ie,we,P,fe))}}function I(g,ne,fe,ie){t.Scroll.scroll(g,ne,fe,function(){var we=W(s.toIndex(d()));te(y?In(we,T):we),ie&&ie()})}function k(g){var ne=C;if(Ln(g)){var fe=g.match(/([+\-<>])(\d+)?/)||[],ie=fe[1],we=fe[2];ie==="+"||ie==="-"?ne=le(C+ +(""+ie+(+we||1)),C):ie===">"?ne=we?K(+we):$(!0):ie==="<"&&(ne=w(!0))}else ne=m?g:Gn(g,0,T);return ne}function z(g,ne){var fe=F||(N()?1:b),ie=le(C+fe*(g?-1:1),C,!(F||N()));return ie===-1&&f&&!Jl(d(),a(!g),1)?g?0:T:ne?ie:W(ie)}function le(g,ne,fe){if(S()||N()){var ie=O(g);ie!==g&&(ne=g,g=ie,fe=!1),g<0||g>T?!F&&(to(0,g,ne,!0)||to(T,ne,g,!0))?g=K(H(g)):m?g=fe?g<0?-(R%b||b):R:g:n.rewind?g=g<0?T:0:g=-1:fe&&g!==ne&&(g=K(H(ne)+(g<ne?-1:1)))}else g=-1;return g}function O(g){if(f&&n.trimSpace==="move"&&g!==C)for(var ne=d();ne===p(g,!0)&&to(g,0,e.length-1,!n.rewind);)g<C?--g:++g;return g}function W(g){return m?(g+R)%R||0:g}function G(){for(var g=R-(N()||m&&F?1:b);y&&g-- >0;)if(p(R-1,!0)!==p(g,!0)){g++;break}return Gn(g,0,R-1)}function K(g){return Gn(N()?g:b*g,0,T)}function H(g){return N()?In(g,T):uo((g>=T?R-1:g)/b)}function q(g){var ne=s.toIndex(g);return f?Gn(ne,0,T):ne}function te(g){g!==C&&(P=C,C=g)}function se(g){return g?P:C}function N(){return!Ei(n.focus)||n.isNavigation}function ce(){return e.state.is([si,Ii])&&!!n.waitForTransition}return{mount:_,go:L,scroll:I,getNext:$,getPrev:w,getAdjacent:z,getEnd:G,setIndex:te,getIndex:se,toIndex:K,toPage:H,toDest:q,hasFocus:N,isBusy:ce}}var pc="http://www.w3.org/2000/svg",mc="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",Bi=40;function gc(e,t,n){var i=xt(e),o=i.on,l=i.bind,s=i.emit,d=n.classes,a=n.i18n,p=t.Elements,u=t.Controller,S=p.arrows,x=p.track,y=S,m=p.prev,f=p.next,$,w,C={};function T(){R(),o(Pt,P)}function P(){F(),T()}function R(){var I=n.arrows;I&&!(m&&f)&&V(),m&&f&&(vi(C,{prev:m,next:f}),xi(y,I?"":"none"),on(y,w=Lr+"--"+n.direction),I&&(b(),L(),Be([m,f],Ai,x.id),s(ls,m,f)))}function F(){i.destroy(),gn(y,w),$?(On(S?[m,f]:y),m=f=null):rn([m,f],$r)}function b(){o([Mn,ai,Lt,jn,po],L),l(f,"click",at(_,">")),l(m,"click",at(_,"<"))}function _(I){u.go(I,!0)}function V(){y=S||Jn("div",d.arrows),m=h(!0),f=h(!1),$=!0,Mi(y,[m,f]),!S&&mr(y,x)}function h(I){var k='<button class="'+d.arrow+" "+(I?d.prev:d.next)+'" type="button"><svg xmlns="'+pc+'" viewBox="0 0 '+Bi+" "+Bi+'" width="'+Bi+'" height="'+Bi+'" focusable="false"><path d="'+(n.arrowPath||mc)+'" />';return Xl(k)}function L(){if(m&&f){var I=e.index,k=u.getPrev(),z=u.getNext(),le=k>-1&&I<k?a.last:a.prev,O=z>-1&&I>z?a.first:a.next;m.disabled=k<0,f.disabled=z<0,Be(m,Ut,le),Be(f,Ut,O),s(ss,m,f,k,z)}}return{arrows:C,mount:T,destroy:F,update:L}}var hc=hr+"-interval";function fc(e,t,n){var i=xt(e),o=i.on,l=i.bind,s=i.emit,d=xo(n.interval,e.go.bind(e,">"),b),a=d.isPaused,p=t.Elements,u=t.Elements,S=u.root,x=u.toggle,y=n.autoplay,m,f,$=y==="pause";function w(){y&&(C(),x&&Be(x,Ai,p.track.id),$||T(),F())}function C(){n.pauseOnHover&&l(S,"mouseenter mouseleave",function(V){m=V.type==="mouseenter",R()}),n.pauseOnFocus&&l(S,"focusin focusout",function(V){f=V.type==="focusin",R()}),x&&l(x,"click",function(){$?T():P(!0)}),o([xn,vo,Lt],d.rewind),o(xn,_)}function T(){a()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=m=$=!1,F(),s(br))}function P(V){V===void 0&&(V=!0),$=!!V,F(),a()||(d.pause(),s(Sr))}function R(){$||(m||f?P(!1):T())}function F(){x&&(mn(x,Dn,!$),Be(x,Ut,n.i18n[$?"play":"pause"]))}function b(V){var h=p.bar;h&&Yt(h,"width",V*100+"%"),s(ds,V)}function _(V){var h=t.Slides.getAt(V);d.set(h&&+Jt(h.slide,hc)||n.interval)}return{mount:w,destroy:d.cancel,play:T,pause:P,isPaused:a}}function yc(e,t,n){var i=xt(e),o=i.on;function l(){n.cover&&(o(wr,at(d,!0)),o([Mn,Pt,Lt],at(s,!0)))}function s(a){t.Slides.forEach(function(p){var u=_i(p.container||p.slide,"img");u&&u.src&&d(a,u,p)})}function d(a,p,u){u.style("background",a?'center/cover no-repeat url("'+p.src+'")':"",!0),xi(p,a?"none":"")}return{mount:l,destroy:at(s,!1)}}var vc=10,xc=600,bc=.6,Sc=1.5,wc=800;function Cc(e,t,n){var i=xt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Move,a=d.getPosition,p=d.getLimit,u=d.exceededLimit,S=d.translate,x=e.is(ni),y,m,f=1;function $(){o(xn,P),o([Pt,Lt],R)}function w(b,_,V,h,L){var I=a();if(P(),V&&(!x||!u())){var k=t.Layout.sliderSize(),z=Qo(b)*k*uo(Bt(b)/k)||0;b=d.toPosition(t.Controller.toDest(b%k))+z}var le=Jl(I,b,1);f=1,_=le?0:_||co(Bt(b-I)/Sc,wc),m=h,y=xo(_,C,at(T,I,b,L),1),s(Ii),l(vo),y.start()}function C(){s(ei),m&&m(),l(jn)}function T(b,_,V,h){var L=a(),I=b+(_-b)*F(h),k=(I-L)*f;S(L+k),x&&!V&&u()&&(f*=bc,Bt(k)<vc&&w(p(u(!0)),xc,!1,m,!0))}function P(){y&&y.cancel()}function R(){y&&!y.isPaused()&&(P(),C())}function F(b){var _=n.easingFunc;return _?_(b):1-Math.pow(1-b,4)}return{mount:$,destroy:P,scroll:w,cancel:R}}var qn={passive:!1,capture:!0};function Tc(e,t,n){var i=xt(e),o=i.on,l=i.emit,s=i.bind,d=i.unbind,a=e.state,p=t.Move,u=t.Scroll,S=t.Controller,x=t.Elements.track,y=t.Media.reduce,m=t.Direction,f=m.resolve,$=m.orient,w=p.getPosition,C=p.exceededLimit,T,P,R,F,b,_=!1,V,h,L;function I(){s(x,Po,Jo,qn),s(x,ko,Jo,qn),s(x,$s,z,qn),s(x,"click",W,{capture:!0}),s(x,"dragstart",pn),o([Mn,Pt],k)}function k(){var B=n.drag;oe(!B),F=B==="free"}function z(B){if(V=!1,!h){var Q=we(B);ie(B.target)&&(Q||!B.button)&&(S.isBusy()?pn(B,!0):(L=Q?x:window,b=a.is([si,Ii]),R=null,s(L,Po,le,qn),s(L,ko,O,qn),p.cancel(),u.cancel(),G(B)))}}function le(B){if(a.is(Qi)||(a.set(Qi),l(is)),B.cancelable)if(b){p.translate(T+fe(N(B)));var Q=ce(B)>nl,U=_!==(_=C());(Q||U)&&G(B),V=!0,l(os),pn(B)}else q(B)&&(b=H(B),pn(B))}function O(B){a.is(Qi)&&(a.set(ei),l(rs)),b&&(K(B),pn(B)),d(L,Po,le),d(L,ko,O),b=!1}function W(B){!h&&V&&pn(B,!0)}function G(B){R=P,P=B,T=w()}function K(B){var Q=te(B),U=se(Q),Y=n.rewind&&n.rewindByDrag;y(!1),F?S.scroll(U,0,n.snap):e.is(Pi)?S.go($(Qo(Q))<0?Y?"<":"-":Y?">":"+"):e.is(ni)&&_&&Y?S.go(C(!0)?">":"<"):S.go(S.toDest(U),!0),y(!0)}function H(B){var Q=n.dragMinThreshold,U=hi(Q),Y=U&&Q.mouse||0,Ie=(U?Q.touch:+Q)||10;return Bt(N(B))>(we(B)?Ie:Y)}function q(B){return Bt(N(B))>Bt(N(B,!0))}function te(B){if(e.is(ci)||!_){var Q=ce(B);if(Q&&Q<nl)return N(B)/Q}return 0}function se(B){return w()+Qo(B)*In(Bt(B)*(n.flickPower||600),F?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function N(B,Q){return ne(B,Q)-ne(g(B),Q)}function ce(B){return Zo(B)-Zo(g(B))}function g(B){return P===B&&R||P}function ne(B,Q){return(we(B)?B.changedTouches[0]:B)["page"+f(Q?"Y":"X")]}function fe(B){return B/(_&&e.is(ni)?ic:1)}function ie(B){var Q=n.noDrag;return!fi(B,"."+bs+", ."+$o)&&(!Q||!fi(B,Q))}function we(B){return typeof TouchEvent<"u"&&B instanceof TouchEvent}function me(){return b}function oe(B){h=B}return{mount:I,disable:oe,isDragging:me}}var $c={Spacebar:" ",Right:wo,Left:So,Up:ms,Down:gs};function Ir(e){return e=Ln(e)?e:e.key,$c[e]||e}var il="keydown";function Lc(e,t,n){var i=xt(e),o=i.on,l=i.bind,s=i.unbind,d=e.root,a=t.Direction.resolve,p,u;function S(){x(),o(Pt,y),o(Pt,x),o(xn,f)}function x(){var w=n.keyboard;w&&(p=w==="global"?window:d,l(p,il,$))}function y(){s(p,il)}function m(w){u=w}function f(){var w=u;u=!0,Vl(function(){u=w})}function $(w){if(!u){var C=Ir(w);C===a(So)?e.go("<"):C===a(wo)&&e.go(">")}}return{mount:S,destroy:y,disable:m}}var mi=hr+"-lazy",no=mi+"-srcset",Ic="["+mi+"], ["+no+"]";function Ec(e,t,n){var i=xt(e),o=i.on,l=i.off,s=i.bind,d=i.emit,a=n.lazyLoad==="sequential",p=[ai,jn],u=[];function S(){n.lazyLoad&&(x(),o(Lt,x))}function x(){vn(u),y(),a?w():(l(p),o(p,m),m())}function y(){t.Slides.forEach(function(C){gr(C.slide,Ic).forEach(function(T){var P=Jt(T,mi),R=Jt(T,no);if(P!==T.src||R!==T.srcset){var F=n.classes.spinner,b=T.parentElement,_=_i(b,"."+F)||Jn("span",F,b);u.push([T,C,_]),T.src||xi(T,"none")}})})}function m(){u=u.filter(function(C){var T=n.perPage*((n.preloadPages||1)+1)-1;return C[1].isWithin(e.index,T)?f(C):!0}),u.length||l(p)}function f(C){var T=C[0];on(C[1].slide,ir),s(T,"load error",at($,C)),Be(T,"src",Jt(T,mi)),Be(T,"srcset",Jt(T,no)),rn(T,mi),rn(T,no)}function $(C,T){var P=C[0],R=C[1];gn(R.slide,ir),T.type!=="error"&&(On(C[2]),xi(P,""),d(wr,P,R),d(ti)),a&&w()}function w(){u.length&&f(u.shift())}return{mount:S,destroy:at(vn,u),check:m}}function Rc(e,t,n){var i=xt(e),o=i.on,l=i.emit,s=i.bind,d=t.Slides,a=t.Elements,p=t.Controller,u=p.hasFocus,S=p.getIndex,x=p.go,y=t.Direction.resolve,m=a.pagination,f=[],$,w;function C(){T(),o([Pt,Lt,po],C);var h=n.pagination;m&&xi(m,h?"":"none"),h&&(o([xn,vo,jn],V),P(),V(),l(as,{list:$,items:f},_(e.index)))}function T(){$&&(On(m?Rn($.children):$),gn($,w),vn(f),$=null),i.destroy()}function P(){var h=e.length,L=n.classes,I=n.i18n,k=n.perPage,z=u()?p.getEnd()+1:bi(h/k);$=m||Jn("ul",L.pagination,a.track.parentElement),on($,w=Lo+"--"+b()),Be($,hn,"tablist"),Be($,Ut,I.select),Be($,Tr,b()===Co?"vertical":"");for(var le=0;le<z;le++){var O=Jn("li",null,$),W=Jn("button",{class:L.page,type:"button"},O),G=d.getIn(le).map(function(H){return H.slide.id}),K=!u()&&k>1?I.pageX:I.slideX;s(W,"click",at(R,le)),n.paginationKeyboard&&s(W,"keydown",at(F,le)),Be(O,hn,"presentation"),Be(W,hn,"tab"),Be(W,Ai,G.join(" ")),Be(W,Ut,er(K,le+1)),Be(W,Zn,-1),f.push({li:O,button:W,page:le})}}function R(h){x(">"+h,!0)}function F(h,L){var I=f.length,k=Ir(L),z=b(),le=-1;k===y(wo,!1,z)?le=++h%I:k===y(So,!1,z)?le=(--h+I)%I:k==="Home"?le=0:k==="End"&&(le=I-1);var O=f[le];O&&(ql(O.button),x(">"+le),pn(L,!0))}function b(){return n.paginationDirection||n.direction}function _(h){return f[p.toPage(h)]}function V(){var h=_(S(!0)),L=_(S());if(h){var I=h.button;gn(I,Dn),rn(I,Jr),Be(I,Zn,-1)}if(L){var k=L.button;on(k,Dn),Be(k,Jr,!0),Be(k,Zn,"")}l(cs,{list:$,items:f},h,L)}return{items:f,mount:C,destroy:T,getAt:_,update:V}}var Mc=[" ","Enter"];function _c(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(m){m.isParent||(p(e,m.splide),p(m.splide,e))}),i&&u()}function d(){l.forEach(function(m){m.destroy()}),vn(l)}function a(){d(),s()}function p(m,f){var $=xt(m);$.on(xn,function(w,C,T){f.go(f.is(ci)?T:w)}),l.push($)}function u(){var m=xt(e),f=m.on;f(yr,x),f(us,y),f([Mn,Pt],S),l.push(m),m.emit(xr,e.splides)}function S(){Be(t.Elements.list,Tr,n.direction===Co?"vertical":"")}function x(m){e.go(m.index)}function y(m,f){pr(Mc,Ir(f))&&(x(m),pn(f))}return{setup:at(t.Media.set,{slideFocus:Ei(o)?i:o},!0),mount:s,destroy:d,remount:a}}function Wc(e,t,n){var i=xt(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,qn)}function d(p){if(p.cancelable){var u=p.deltaY,S=u<0,x=Zo(p),y=n.wheelMinThreshold||0,m=n.wheelSleep||0;Bt(u)>y&&x-l>m&&(e.go(S?"<":">"),l=x),a(S)&&pn(p)}}function a(p){return!n.releaseWheel||e.state.is(si)||t.Controller.getAdjacent(p)!==-1}return{mount:s}}var Ac=90;function Pc(e,t,n){var i=xt(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,d=Jn("span",Za),a=xo(Ac,at(u,!1));function p(){s&&(x(!t.Autoplay.isPaused()),Be(l,el,!0),d.textContent="…",o(br,at(x,!0)),o(Sr,at(x,!1)),o([ai,jn],at(u,!0)))}function u(y){Be(l,Qr,y),y?(Mi(l,d),a.start()):(On(d),a.cancel())}function S(){rn(l,[Zr,el,Qr]),On(d)}function x(y){s&&Be(l,Zr,y?"off":"polite")}return{mount:p,disable:x,destroy:S}}var kc=Object.freeze({__proto__:null,Media:za,Direction:Va,Elements:oc,Slides:lc,Layout:sc,Clones:cc,Move:dc,Controller:uc,Arrows:gc,Autoplay:fc,Cover:yc,Scroll:Cc,Drag:Tc,Keyboard:Lc,LazyLoad:Ec,Pagination:Rc,Sync:_c,Wheel:Wc,Live:Pc}),Fc={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:tc,i18n:Fc,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Hc(e,t,n){var i=t.Slides;function o(){xt(e).on([Mn,Lt],l)}function l(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function s(d,a){i.style("transition","opacity "+n.speed+"ms "+n.easing),Vl(a)}return{mount:o,start:s,cancel:Jo}}function Bc(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,d=at(Yt,s,"transition"),a;function p(){xt(e).bind(s,"transitionend",function(y){y.target===s&&a&&(S(),a())})}function u(y,m){var f=i.toPosition(y,!0),$=i.getPosition(),w=x(y);Bt(f-$)>=1&&w>=1?n.useScroll?l.scroll(f,w,!1,m):(d("transform "+w+"ms "+n.easing),i.translate(f,!0),a=m):(i.jump(y),m())}function S(){d(""),l.cancel()}function x(y){var m=n.rewindSpeed;if(e.is(ni)&&m){var f=o.getIndex(!0),$=o.getEnd();if(f===0&&y>=$||f>=$&&y===0)return m}return n.speed}return{mount:p,start:u,cancel:S}}var Oc=(function(){function e(n,i){this.event=xt(),this.Components={},this.state=Da(Yn),this.splides=[],this._o={},this._E={};var o=Ln(n)?Yl(document,n):n;pi(o,o+" is invalid."),this.root=o,i=$n({label:Jt(o,Ut)||"",labelledby:Jt(o,Cr)||""},Nc,e.defaults,i||{});try{$n(i,JSON.parse(Jt(o,hr)))}catch{pi(!1,"Invalid JSON")}this._o=Object.create($n({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,d=this.Components;pi(s.is([Yn,ao]),"Already mounted!"),s.set(Yn),this._C=d,this._T=o||this._T||(this.is(Pi)?Hc:Bc),this._E=i||this._E;var a=vi({},kc,this._E,{Transition:this._T});return Bn(a,function(p,u){var S=p(l,d,l._o);d[u]=S,S.setup&&S.setup()}),Bn(d,function(p){p.mount&&p.mount()}),this.emit(Mn),on(this.root,Qa),s.set(ei),this.emit(tr),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(ei)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(Rn(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(Lt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(Yn)?xt(this).on(tr,this.destroy.bind(this,i)):(Bn(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(vr),o.destroy(),i&&vn(this.splides),l.set(ao)),this},Fa(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})(),Er=Oc;Er.defaults={};Er.STATES=Ha;var ol=[[Mn,"onMounted"],[tr,"onReady"],[xn,"onMove"],[ai,"onMoved"],[yr,"onClick"],[Ql,"onActive"],[es,"onInactive"],[ts,"onVisible"],[ns,"onHidden"],[Lt,"onRefresh"],[Pt,"onUpdated"],[ti,"onResize"],[yo,"onResized"],[is,"onDrag"],[os,"onDragging"],[rs,"onDragged"],[vo,"onScroll"],[jn,"onScrolled"],[vr,"onDestroy"],[ls,"onArrowsMounted"],[ss,"onArrowsUpdated"],[as,"onPaginationMounted"],[cs,"onPaginationUpdated"],[xr,"onNavigationMounted"],[br,"onAutoplayPlay"],[ds,"onAutoplayPlaying"],[Sr,"onAutoplayPause"],[wr,"onLazyLoadLoaded"]];function Rr(...e){return e.filter(Boolean).join(" ")}function mo(e){return e!==null&&typeof e=="object"}function or(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!or(n,t[i]));if(mo(e)&&mo(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!or(e[o],t[o]))}return e===t}function Dc(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function jc(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 rr(e,t){const n=e;return jc(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():mo(i)?n[o]=rr(mo(n[o])?n[o]:{},i):n[o]=i}),n}var zc=({children:e,className:t,...n})=>c.createElement("div",{className:Rr("splide__track",t),...n},c.createElement("ul",{className:"splide__list"},e)),Mr=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 Er(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=rr({},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&&!or(this.options,e)&&(this.splide.options=e,this.options=rr({},e));const t=this.getSlides();Dc(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){ol.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:Rr("splide",e),ref:this.splideRef,...this.omit(o,["options",...ol.map(l=>l[1])])},n?c.createElement(zc,null,i):i)}},_r=({children:e,className:t,...n})=>c.createElement("li",{className:Rr("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("react"),Ye=require("classnames"),R=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Fi=require("react-dom");function Ks(e){return e.type==="object"&&e.version===1}const Gs="ControlSlider-module__wrapper___sHEkd",Us="ControlSlider-module__hoverArrow___A-dOH",qs="ControlSlider-module__sliderItem___QQSkR",Xs="ControlSlider-module__sliderImage___9hRl-",Ys="ControlSlider-module__arrow___05ghY",Js="ControlSlider-module__arrowVertical___tBfVN",Zs="ControlSlider-module__nextArrow___-30Yc",Qs="ControlSlider-module__arrowInner___aEra3",ea="ControlSlider-module__arrowIcon___S4ztF",ta="ControlSlider-module__arrowImg___2dwJW",na="ControlSlider-module__mirror___brd6U",ia="ControlSlider-module__pagination___bicLF",oa="ControlSlider-module__paginationInner___bT-P-",ra="ControlSlider-module__paginationVertical___zYqKw",la="ControlSlider-module__paginationItem___nTRbk",sa="ControlSlider-module__dot___p1Qun",aa="ControlSlider-module__activeDot___LHFaj",ca="ControlSlider-module__paginationInsideBottom___R3FWn",da="ControlSlider-module__paginationInsideTop___V-qb-",ua="ControlSlider-module__paginationOutsideBottom___14w8D",pa="ControlSlider-module__paginationOutsideTop___SCLqB",ma="ControlSlider-module__paginationInsideLeft___yOBRZ",ga="ControlSlider-module__paginationInsideRight___Rtt3o",ha="ControlSlider-module__paginationOutsideLeft___lahaw",fa="ControlSlider-module__paginationOutsideRight___EtuQa",ya="ControlSlider-module__imgWrapper___UjEgB",va="ControlSlider-module__captionBlock___dJ6-j",xa="ControlSlider-module__captionTextWrapper___HFlpf",ba="ControlSlider-module__captionText___uGBVc",Sa="ControlSlider-module__active___WZK4G",wa="ControlSlider-module__withPointerEvents___t-18M",Ca="ControlSlider-module__topLeftAlignment___zjnGM",Ta="ControlSlider-module__topCenterAlignment___gD1xW",$a="ControlSlider-module__topRightAlignment___NMapS",La="ControlSlider-module__middleLeftAlignment___OnUrY",Ea="ControlSlider-module__middleCenterAlignment___Tdkl0",Ia="ControlSlider-module__middleRightAlignment___wEbfX",Ra="ControlSlider-module__bottomLeftAlignment___cTP2-",Ma="ControlSlider-module__bottomCenterAlignment___c54fB",Wa="ControlSlider-module__bottomRightAlignment___kEwrz",_a="ControlSlider-module__clickOverlay___DZA28",Aa="ControlSlider-module__contain___pLyq7",Pa="ControlSlider-module__cover___KdDat",be={wrapper:Gs,hoverArrow:Us,sliderItem:qs,sliderImage:Xs,arrow:Ys,arrowVertical:Js,nextArrow:Zs,arrowInner:Qs,arrowIcon:ea,arrowImg:ta,mirror:na,pagination:ia,paginationInner:oa,paginationVertical:ra,paginationItem:la,dot:sa,activeDot:aa,paginationInsideBottom:ca,paginationInsideTop:da,paginationOutsideBottom:ua,paginationOutsideTop:pa,paginationInsideLeft:ma,paginationInsideRight:ga,paginationOutsideLeft:ha,paginationOutsideRight:fa,imgWrapper:ya,captionBlock:va,captionTextWrapper:xa,captionText:ba,active:Sa,withPointerEvents:wa,topLeftAlignment:Ca,topCenterAlignment:Ta,topRightAlignment:$a,middleLeftAlignment:La,middleCenterAlignment:Ea,middleRightAlignment:Ia,bottomLeftAlignment:Ra,bottomCenterAlignment:Ma,bottomRightAlignment:Wa,clickOverlay:_a,contain:Aa,cover:Pa};function ka(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 Fa(e,t,n){return t&&ka(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Xr="(prefers-reduced-motion: reduce)",li=1,Na=2,di=3,yi=4,Ni=5,so=6,yo=7,Ha={CREATED:li,MOUNTED:Na,IDLE:di,MOVING:yi,SCROLLING:Ni,DRAGGING:so,DESTROYED:yo};function Cn(e){e.length=0}function Fn(e,t,n){return Array.prototype.slice.call(e,t,n)}function ct(e){return e.bind.apply(e,[null].concat(Fn(arguments,1)))}var ql=setTimeout,rr=function(){};function Yr(e){return requestAnimationFrame(e)}function To(e,t){return typeof t===e}function $i(e){return!xr(e)&&To("object",e)}var vr=Array.isArray,Xl=ct(To,"function"),An=ct(To,"string"),Hi=ct(To,"undefined");function xr(e){return e===null}function Yl(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Bi(e){return vr(e)?e:[e]}function Xt(e,t){Bi(e).forEach(t)}function br(e,t){return e.indexOf(t)>-1}function ao(e,t){return e.push.apply(e,Bi(t)),e}function vn(e,t,n){e&&Xt(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function cn(e,t){vn(e,An(t)?t.split(" "):t,!0)}function Oi(e,t){Xt(t,e.appendChild.bind(e))}function Sr(e,t){Xt(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Li(e,t){return Yl(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Jl(e,t){var n=e?Fn(e.children):[];return t?n.filter(function(i){return Li(i,t)}):n}function Di(e,t){return t?Jl(e,t)[0]:e.firstElementChild}var Ei=Object.keys;function Gn(e,t,n){return e&&(n?Ei(e).reverse():Ei(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Ii(e){return Fn(arguments,1).forEach(function(t){Gn(t,function(n,i){e[i]=t[i]})}),e}function _n(e){return Fn(arguments,1).forEach(function(t){Gn(t,function(n,i){vr(n)?e[i]=n.slice():$i(n)?e[i]=_n({},$i(e[i])?e[i]:{},n):e[i]=n})}),e}function Jr(e,t){Xt(t||Ei(e),function(n){delete e[n]})}function dn(e,t){Xt(e,function(n){Xt(t,function(i){n&&n.removeAttribute(i)})})}function Oe(e,t,n){$i(t)?Gn(t,function(i,o){Oe(e,o,i)}):Xt(e,function(i){xr(n)||n===""?dn(i,t):i.setAttribute(t,String(n))})}function si(e,t,n){var i=document.createElement(e);return t&&(An(t)?cn(i,t):Oe(i,t)),n&&Oi(n,i),i}function tn(e,t,n){if(Hi(n))return getComputedStyle(e)[t];xr(n)||(e.style[t]=""+n)}function Ri(e,t){tn(e,"display",t)}function Zl(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function nn(e,t){return e.getAttribute(t)}function Zr(e,t){return e&&e.classList.contains(t)}function Gt(e){return e.getBoundingClientRect()}function Un(e){Xt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Ql(e){return Di(new DOMParser().parseFromString(e,"text/html").body)}function yn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function es(e,t){return e&&e.querySelector(t)}function wr(e,t){return t?Fn(e.querySelectorAll(t)):[]}function xn(e,t){vn(e,t,!1)}function lr(e){return e.timeStamp}function On(e){return An(e)?e:e?e+"px":""}var ji="splide",Cr="data-"+ji;function wi(e,t){if(!e)throw new Error("["+ji+"] "+(t||""))}var Pn=Math.min,vo=Math.max,xo=Math.floor,Mi=Math.ceil,Dt=Math.abs;function ts(e,t,n){return Dt(e-t)<n}function co(e,t,n,i){var o=Pn(t,n),l=vo(t,n);return i?o<e&&e<l:o<=e&&e<=l}function ii(e,t,n){var i=Pn(t,n),o=vo(t,n);return Pn(vo(i,e),o)}function sr(e){return+(e>0)-+(e<0)}function ar(e,t){return Xt(t,function(n){e=e.replace("%s",""+n)}),e}function Tr(e){return e<10?"0"+e:""+e}var Qr={};function Ba(e){return""+e+Tr(Qr[e]=(Qr[e]||0)+1)}function ns(){var e=[];function t(s,d,a,p){o(s,d,function(u,S,x){var v="addEventListener"in u,m=v?u.removeEventListener.bind(u,S,a,p):u.removeListener.bind(u,a);v?u.addEventListener(S,a,p):u.addListener(a),e.push([u,S,x,a,m])})}function n(s,d,a){o(s,d,function(p,u,S){e=e.filter(function(x){return x[0]===p&&x[1]===u&&x[2]===S&&(!a||x[3]===a)?(x[4](),!1):!0})})}function i(s,d,a){var p,u=!0;return typeof CustomEvent=="function"?p=new CustomEvent(d,{bubbles:u,detail:a}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(d,u,!1,a)),s.dispatchEvent(p),p}function o(s,d,a){Xt(s,function(p){p&&Xt(d,function(u){u.split(" ").forEach(function(S){var x=S.split(".");a(p,x[0],x[1])})})})}function l(){e.forEach(function(s){s[4]()}),Cn(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var Nn="mounted",cr="ready",Tn="move",vi="moved",$r="click",is="active",os="inactive",rs="visible",ls="hidden",Et="refresh",Nt="updated",ui="resize",$o="resized",ss="drag",as="dragging",cs="dragged",Lo="scroll",Xn="scrolled",Oa="overflow",Lr="destroy",ds="arrows:mounted",us="arrows:updated",ps="pagination:mounted",ms="pagination:updated",Er="navigation:mounted",Ir="autoplay:play",gs="autoplay:playing",Rr="autoplay:pause",Mr="lazyload:loaded",hs="sk",fs="sh",bo="ei";function xt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=ns();function i(l,s){n.bind(t,Bi(l).join(" "),function(d){s.apply(s,vr(d.detail)?d.detail:[])})}function o(l){n.dispatch(t,l,Fn(arguments,1))}return e&&e.event.on(Lr,n.destroy),Ii(n,{bus:t,on:i,off:ct(n.unbind,t),emit:o})}function Eo(e,t,n,i){var o=Date.now,l,s=0,d,a=!0,p=0;function u(){if(!a){if(s=e?Pn((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++p>=i))return x();d=Yr(u)}}function S(w){w||m(),l=o()-(w?s*e:0),a=!1,d=Yr(u)}function x(){a=!0}function v(){l=o(),s=0,n&&n(s)}function m(){d&&cancelAnimationFrame(d),s=0,d=0,a=!0}function y(w){e=w}function $(){return a}return{start:S,rewind:v,pause:x,cancel:m,set:y,isPaused:$}}function Da(e){var t=e;function n(o){t=o}function i(o){return br(Bi(o),t)}return{set:n,is:i}}function ja(e,t){var n=Eo(0,e,null,1);return function(){n.isPaused()&&n.start()}}function za(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=ns(),d=[];function a(){var m=n.mediaQuery==="min";Ei(o).sort(function(y,$){return m?+y-+$:+$-+y}).forEach(function(y){u(o[y],"("+(m?"min":"max")+"-width:"+y+"px)")}),u(l,Xr),S()}function p(m){m&&s.destroy()}function u(m,y){var $=matchMedia(y);s.bind($,"change",S),d.push([m,$])}function S(){var m=i.is(yo),y=n.direction,$=d.reduce(function(w,C){return _n(w,C[1].matches?C[0]:{})},{});Jr(n),v($),n.destroy?e.destroy(n.destroy==="completely"):m?(p(!0),e.mount()):y!==n.direction&&e.refresh()}function x(m){matchMedia(Xr).matches&&(m?_n(n,l):Jr(n,Ei(l)))}function v(m,y,$){_n(n,m),y&&_n(Object.getPrototypeOf(n),m),($||!i.is(li))&&e.emit(Nt,n)}return{setup:a,destroy:p,reduce:x,set:v}}var Io="Arrow",Ro=Io+"Left",Mo=Io+"Right",ys=Io+"Up",vs=Io+"Down",el="rtl",Wo="ttb",Oo={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[ys,Mo],ArrowRight:[vs,Ro]};function Va(e,t,n){function i(l,s,d){d=d||n.direction;var a=d===el&&!s?1:d===Wo?0:-1;return Oo[l]&&Oo[l][a]||l.replace(/width|left|right/i,function(p,u){var S=Oo[p.toLowerCase()][a]||p;return u>0?S.charAt(0).toUpperCase()+S.slice(1):S})}function o(l){return l*(n.direction===el?1:-1)}return{resolve:i,orient:o}}var bn="role",ai="tabindex",Ka="disabled",on="aria-",zi=on+"controls",xs=on+"current",tl=on+"selected",Ut=on+"label",Wr=on+"labelledby",bs=on+"hidden",_r=on+"orientation",Wi=on+"roledescription",nl=on+"live",il=on+"busy",ol=on+"atomic",Ar=[bn,ai,Ka,zi,xs,Ut,Wr,bs,_r,Wi],un=ji+"__",Hn="is-",Do=ji,rl=un+"track",Ga=un+"list",_o=un+"slide",Ss=_o+"--clone",Ua=_o+"__container",Pr=un+"arrows",Ao=un+"arrow",ws=Ao+"--prev",Cs=Ao+"--next",Po=un+"pagination",Ts=Po+"__page",qa=un+"progress",Xa=qa+"__bar",Ya=un+"toggle",Ja=un+"spinner",Za=un+"sr",Qa=Hn+"initialized",qn=Hn+"active",$s=Hn+"prev",Ls=Hn+"next",dr=Hn+"visible",ur=Hn+"loading",Es=Hn+"focus-in",Is=Hn+"overflow",ec=[qn,dr,$s,Ls,ur,Es,Is],tc={slide:_o,clone:Ss,arrows:Pr,arrow:Ao,prev:ws,next:Cs,pagination:Po,page:Ts,spinner:Ja};function nc(e,t){if(Xl(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Li(n,t);)n=n.parentElement;return n}var ic=5,ll=200,Rs="touchstart mousedown",jo="touchmove mousemove",zo="touchend touchcancel mouseup click";function oc(e,t,n){var i=xt(e),o=i.on,l=i.bind,s=e.root,d=n.i18n,a={},p=[],u=[],S=[],x,v,m;function y(){T(),P(),C()}function $(){o(Et,w),o(Et,y),o(Nt,C),l(document,Rs+" keydown",function(b){m=b.type==="keydown"},{capture:!0}),l(s,"focusin",function(){vn(s,Es,!!m)})}function w(b){var W=Ar.concat("style");Cn(p),xn(s,u),xn(x,S),dn([x,v],W),dn(s,b?W:["style",Wi])}function C(){xn(s,u),xn(x,S),u=F(Do),S=F(rl),cn(s,u),cn(x,S),Oe(s,Ut,n.label),Oe(s,Wr,n.labelledby)}function T(){x=M("."+rl),v=Di(x,"."+Ga),wi(x&&v,"A track/list element is missing."),ao(p,Jl(v,"."+_o+":not(."+Ss+")")),Gn({arrows:Pr,pagination:Po,prev:ws,next:Cs,bar:Xa,toggle:Ya},function(b,W){a[W]=M("."+b)}),Ii(a,{root:s,track:x,list:v,slides:p})}function P(){var b=s.id||Ba(ji),W=n.role;s.id=b,x.id=x.id||b+"-track",v.id=v.id||b+"-list",!nn(s,bn)&&s.tagName!=="SECTION"&&W&&Oe(s,bn,W),Oe(s,Wi,d.carousel),Oe(v,bn,"presentation")}function M(b){var W=es(s,b);return W&&nc(W,"."+Do)===s?W:void 0}function F(b){return[b+"--"+n.type,b+"--"+n.direction,n.drag&&b+"--draggable",n.isNavigation&&b+"--nav",b===Do&&qn]}return Ii(a,{setup:y,mount:$,destroy:w})}var pi="slide",xi="loop",Vi="fade";function rc(e,t,n,i){var o=xt(e),l=o.on,s=o.emit,d=o.bind,a=e.Components,p=e.root,u=e.options,S=u.isNavigation,x=u.updateOnMove,v=u.i18n,m=u.pagination,y=u.slideFocus,$=a.Direction.resolve,w=nn(i,"style"),C=nn(i,Ut),T=n>-1,P=Di(i,"."+Ua),M;function F(){T||(i.id=p.id+"-slide"+Tr(t+1),Oe(i,bn,m?"tabpanel":"group"),Oe(i,Wi,v.slide),Oe(i,Ut,C||ar(v.slideLabel,[t+1,e.length]))),b()}function b(){d(i,"click",ct(s,$r,q)),d(i,"keydown",ct(s,hs,q)),l([vi,fs,Xn],L),l(Er,K),x&&l(Tn,h)}function W(){M=!0,o.destroy(),xn(i,ec),dn(i,Ar),Oe(i,"style",w),Oe(i,Ut,C||"")}function K(){var G=e.splides.map(function(H){var X=H.splide.Components.Slides.getAt(t);return X?X.slide.id:""}).join(" ");Oe(i,Ut,ar(v.slideX,(T?n:t)+1)),Oe(i,zi,G),Oe(i,bn,y?"button":""),y&&dn(i,Wi)}function h(){M||L()}function L(){if(!M){var G=e.index;E(),k(),vn(i,$s,t===G-1),vn(i,Ls,t===G+1)}}function E(){var G=le();G!==Zr(i,qn)&&(vn(i,qn,G),Oe(i,xs,S&&G||""),s(G?is:os,q))}function k(){var G=O(),H=!G&&(!le()||T);if(e.state.is([yi,Ni])||Oe(i,bs,H||""),Oe(wr(i,u.focusableNodes||""),ai,H?-1:""),y&&Oe(i,ai,H?-1:0),G!==Zr(i,dr)&&(vn(i,dr,G),s(G?rs:ls,q)),!G&&document.activeElement===i){var X=a.Slides.getAt(e.index);X&&Zl(X.slide)}}function z(G,H,X){tn(X&&P||i,G,H)}function le(){var G=e.index;return G===t||u.cloneStatus&&G===n}function O(){if(e.is(Vi))return le();var G=Gt(a.Elements.track),H=Gt(i),X=$("left",!0),ne=$("right",!0);return xo(G[X])<=Mi(H[X])&&xo(H[ne])<=Mi(G[ne])}function _(G,H){var X=Dt(G-t);return!T&&(u.rewind||e.is(xi))&&(X=Pn(X,e.length-X)),X<=H}var q={index:t,slideIndex:n,slide:i,container:P,isClone:T,mount:F,destroy:W,update:L,style:z,isWithin:_};return q}function lc(e,t,n){var i=xt(e),o=i.on,l=i.emit,s=i.bind,d=t.Elements,a=d.slides,p=d.list,u=[];function S(){x(),o(Et,v),o(Et,x)}function x(){a.forEach(function(L,E){y(L,E,-1)})}function v(){M(function(L){L.destroy()}),Cn(u)}function m(){M(function(L){L.update()})}function y(L,E,k){var z=rc(e,E,k,L);z.mount(),u.push(z),u.sort(function(le,O){return le.index-O.index})}function $(L){return L?F(function(E){return!E.isClone}):u}function w(L){var E=t.Controller,k=E.toIndex(L),z=E.hasFocus()?1:n.perPage;return F(function(le){return co(le.index,k,k+z-1)})}function C(L){return F(L)[0]}function T(L,E){Xt(L,function(k){if(An(k)&&(k=Ql(k)),Yl(k)){var z=a[E];z?Sr(k,z):Oi(p,k),cn(k,n.classes.slide),W(k,ct(l,ui))}}),l(Et)}function P(L){Un(F(L).map(function(E){return E.slide})),l(Et)}function M(L,E){$(E).forEach(L)}function F(L){return u.filter(Xl(L)?L:function(E){return An(L)?Li(E.slide,L):br(Bi(L),E.index)})}function b(L,E,k){M(function(z){z.style(L,E,k)})}function W(L,E){var k=wr(L,"img"),z=k.length;z?k.forEach(function(le){s(le,"load error",function(){--z||E()})}):E()}function K(L){return L?a.length:u.length}function h(){return u.length>n.perPage}return{mount:S,destroy:v,update:m,register:y,get:$,getIn:w,getAt:C,add:T,remove:P,forEach:M,filter:F,style:b,getLength:K,isEnough:h}}function sc(e,t,n){var i=xt(e),o=i.on,l=i.bind,s=i.emit,d=t.Slides,a=t.Direction.resolve,p=t.Elements,u=p.root,S=p.track,x=p.list,v=d.getAt,m=d.style,y,$,w;function C(){T(),l(window,"resize load",ja(ct(s,ui))),o([Nt,Et],T),o(ui,P)}function T(){y=n.direction===Wo,tn(u,"maxWidth",On(n.width)),tn(S,a("paddingLeft"),M(!1)),tn(S,a("paddingRight"),M(!0)),P(!0)}function P(q){var G=Gt(u);(q||$.width!==G.width||$.height!==G.height)&&(tn(S,"height",F()),m(a("marginRight"),On(n.gap)),m("width",W()),m("height",K(),!0),$=G,s($o),w!==(w=_())&&(vn(u,Is,w),s(Oa,w)))}function M(q){var G=n.padding,H=a(q?"right":"left");return G&&On(G[H]||($i(G)?0:G))||"0px"}function F(){var q="";return y&&(q=b(),wi(q,"height or heightRatio is missing."),q="calc("+q+" - "+M(!1)+" - "+M(!0)+")"),q}function b(){return On(n.height||Gt(x).width*n.heightRatio)}function W(){return n.autoWidth?null:On(n.fixedWidth)||(y?"":h())}function K(){return On(n.fixedHeight)||(y?n.autoHeight?null:h():b())}function h(){var q=On(n.gap);return"calc((100%"+(q&&" + "+q)+")/"+(n.perPage||1)+(q&&" - "+q)+")"}function L(){return Gt(x)[a("width")]}function E(q,G){var H=v(q||0);return H?Gt(H.slide)[a("width")]+(G?0:le()):0}function k(q,G){var H=v(q);if(H){var X=Gt(H.slide)[a("right")],ne=Gt(x)[a("left")];return Dt(X-ne)+(G?0:le())}return 0}function z(q){return k(e.length-1)-k(0)+E(0,q)}function le(){var q=v(0);return q&&parseFloat(tn(q.slide,a("marginRight")))||0}function O(q){return parseFloat(tn(S,a("padding"+(q?"Right":"Left"))))||0}function _(){return e.is(Vi)||z(!0)>L()}return{mount:C,resize:P,listSize:L,slideSize:E,sliderSize:z,totalSize:k,getPadding:O,isOverflow:_}}var ac=2;function cc(e,t,n){var i=xt(e),o=i.on,l=t.Elements,s=t.Slides,d=t.Direction.resolve,a=[],p;function u(){o(Et,S),o([Nt,ui],v),(p=$())&&(m(p),t.Layout.resize(!0))}function S(){x(),u()}function x(){Un(a),Cn(a),i.destroy()}function v(){var w=$();p!==w&&(p<w||!w)&&i.emit(Et)}function m(w){var C=s.get().slice(),T=C.length;if(T){for(;C.length<w;)ao(C,C);ao(C.slice(-w),C.slice(0,w)).forEach(function(P,M){var F=M<w,b=y(P.slide,M);F?Sr(b,C[0].slide):Oi(l.list,b),ao(a,b),s.register(b,M-w+(F?0:T),P.index)})}}function y(w,C){var T=w.cloneNode(!0);return cn(T,n.classes.clone),T.id=e.root.id+"-clone"+Tr(C+1),T}function $(){var w=n.clones;if(!e.is(xi))w=0;else if(Hi(w)){var C=n[d("fixedWidth")]&&t.Layout.slideSize(0),T=C&&Mi(Gt(l.track)[d("width")]/C);w=T||n[d("autoWidth")]&&e.length||n.perPage*ac}return w}return{mount:u,destroy:x}}function dc(e,t,n){var i=xt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Layout,a=d.slideSize,p=d.getPadding,u=d.totalSize,S=d.listSize,x=d.sliderSize,v=t.Direction,m=v.resolve,y=v.orient,$=t.Elements,w=$.list,C=$.track,T;function P(){T=t.Transition,o([Nn,$o,Nt,Et],M)}function M(){t.Controller.isBusy()||(t.Scroll.cancel(),b(e.index),t.Slides.update())}function F(H,X,ne,se){H!==X&&q(H>ne)&&(L(),W(h(z(),H>ne),!0)),s(yi),l(Tn,X,ne,H),T.start(X,function(){s(di),l(vi,X,ne,H),se&&se()})}function b(H){W(k(H,!0))}function W(H,X){if(!e.is(Vi)){var ne=X?H:K(H);tn(w,"transform","translate"+m("X")+"("+ne+"px)"),H!==ne&&l(fs)}}function K(H){if(e.is(xi)){var X=E(H),ne=X>t.Controller.getEnd(),se=X<0;(se||ne)&&(H=h(H,ne))}return H}function h(H,X){var ne=H-_(X),se=x();return H-=y(se*(Mi(Dt(ne)/se)||1))*(X?1:-1),H}function L(){W(z(),!0),T.cancel()}function E(H){for(var X=t.Slides.get(),ne=0,se=1/0,N=0;N<X.length;N++){var de=X[N].index,g=Dt(k(de,!0)-H);if(g<=se)se=g,ne=de;else break}return ne}function k(H,X){var ne=y(u(H-1)-O(H));return X?le(ne):ne}function z(){var H=m("left");return Gt(w)[H]-Gt(C)[H]+y(p(!1))}function le(H){return n.trimSpace&&e.is(pi)&&(H=ii(H,0,y(x(!0)-S()))),H}function O(H){var X=n.focus;return X==="center"?(S()-a(H,!0))/2:+X*a(H)||0}function _(H){return k(H?t.Controller.getEnd():0,!!n.trimSpace)}function q(H){var X=y(h(z(),H));return H?X>=0:X<=w[m("scrollWidth")]-Gt(C)[m("width")]}function G(H,X){X=Hi(X)?z():X;var ne=H!==!0&&y(X)<y(_(!1)),se=H!==!1&&y(X)>y(_(!0));return ne||se}return{mount:P,move:F,jump:b,translate:W,shift:h,cancel:L,toIndex:E,toPosition:k,getPosition:z,getLimit:_,exceededLimit:G,reposition:M}}function uc(e,t,n){var i=xt(e),o=i.on,l=i.emit,s=t.Move,d=s.getPosition,a=s.getLimit,p=s.toPosition,u=t.Slides,S=u.isEnough,x=u.getLength,v=n.omitEnd,m=e.is(xi),y=e.is(pi),$=ct(z,!1),w=ct(z,!0),C=n.start||0,T,P=C,M,F,b;function W(){K(),o([Nt,Et,bo],K),o($o,h)}function K(){M=x(!0),F=n.perMove,b=n.perPage,T=q();var g=ii(C,0,v?T:M-1);g!==C&&(C=g,s.reposition())}function h(){T!==q()&&l(bo)}function L(g,ie,fe){if(!de()){var oe=k(g),Ce=_(oe);Ce>-1&&(ie||Ce!==C)&&(ne(Ce),s.move(oe,Ce,P,fe))}}function E(g,ie,fe,oe){t.Scroll.scroll(g,ie,fe,function(){var Ce=_(s.toIndex(d()));ne(v?Pn(Ce,T):Ce),oe&&oe()})}function k(g){var ie=C;if(An(g)){var fe=g.match(/([+\-<>])(\d+)?/)||[],oe=fe[1],Ce=fe[2];oe==="+"||oe==="-"?ie=le(C+ +(""+oe+(+Ce||1)),C):oe===">"?ie=Ce?G(+Ce):$(!0):oe==="<"&&(ie=w(!0))}else ie=m?g:ii(g,0,T);return ie}function z(g,ie){var fe=F||(N()?1:b),oe=le(C+fe*(g?-1:1),C,!(F||N()));return oe===-1&&y&&!ts(d(),a(!g),1)?g?0:T:ie?oe:_(oe)}function le(g,ie,fe){if(S()||N()){var oe=O(g);oe!==g&&(ie=g,g=oe,fe=!1),g<0||g>T?!F&&(co(0,g,ie,!0)||co(T,ie,g,!0))?g=G(H(g)):m?g=fe?g<0?-(M%b||b):M:g:n.rewind?g=g<0?T:0:g=-1:fe&&g!==ie&&(g=G(H(ie)+(g<ie?-1:1)))}else g=-1;return g}function O(g){if(y&&n.trimSpace==="move"&&g!==C)for(var ie=d();ie===p(g,!0)&&co(g,0,e.length-1,!n.rewind);)g<C?--g:++g;return g}function _(g){return m?(g+M)%M||0:g}function q(){for(var g=M-(N()||m&&F?1:b);v&&g-- >0;)if(p(M-1,!0)!==p(g,!0)){g++;break}return ii(g,0,M-1)}function G(g){return ii(N()?g:b*g,0,T)}function H(g){return N()?Pn(g,T):xo((g>=T?M-1:g)/b)}function X(g){var ie=s.toIndex(g);return y?ii(ie,0,T):ie}function ne(g){g!==C&&(P=C,C=g)}function se(g){return g?P:C}function N(){return!Hi(n.focus)||n.isNavigation}function de(){return e.state.is([yi,Ni])&&!!n.waitForTransition}return{mount:W,go:L,scroll:E,getNext:$,getPrev:w,getAdjacent:z,getEnd:q,setIndex:ne,getIndex:se,toIndex:G,toPage:H,toDest:X,hasFocus:N,isBusy:de}}var pc="http://www.w3.org/2000/svg",mc="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",Ui=40;function gc(e,t,n){var i=xt(e),o=i.on,l=i.bind,s=i.emit,d=n.classes,a=n.i18n,p=t.Elements,u=t.Controller,S=p.arrows,x=p.track,v=S,m=p.prev,y=p.next,$,w,C={};function T(){M(),o(Nt,P)}function P(){F(),T()}function M(){var E=n.arrows;E&&!(m&&y)&&K(),m&&y&&(Ii(C,{prev:m,next:y}),Ri(v,E?"":"none"),cn(v,w=Pr+"--"+n.direction),E&&(b(),L(),Oe([m,y],zi,x.id),s(ds,m,y)))}function F(){i.destroy(),xn(v,w),$?(Un(S?[m,y]:v),m=y=null):dn([m,y],Ar)}function b(){o([Nn,vi,Et,Xn,bo],L),l(y,"click",ct(W,">")),l(m,"click",ct(W,"<"))}function W(E){u.go(E,!0)}function K(){v=S||si("div",d.arrows),m=h(!0),y=h(!1),$=!0,Oi(v,[m,y]),!S&&Sr(v,x)}function h(E){var k='<button class="'+d.arrow+" "+(E?d.prev:d.next)+'" type="button"><svg xmlns="'+pc+'" viewBox="0 0 '+Ui+" "+Ui+'" width="'+Ui+'" height="'+Ui+'" focusable="false"><path d="'+(n.arrowPath||mc)+'" />';return Ql(k)}function L(){if(m&&y){var E=e.index,k=u.getPrev(),z=u.getNext(),le=k>-1&&E<k?a.last:a.prev,O=z>-1&&E>z?a.first:a.next;m.disabled=k<0,y.disabled=z<0,Oe(m,Ut,le),Oe(y,Ut,O),s(us,m,y,k,z)}}return{arrows:C,mount:T,destroy:F,update:L}}var hc=Cr+"-interval";function fc(e,t,n){var i=xt(e),o=i.on,l=i.bind,s=i.emit,d=Eo(n.interval,e.go.bind(e,">"),b),a=d.isPaused,p=t.Elements,u=t.Elements,S=u.root,x=u.toggle,v=n.autoplay,m,y,$=v==="pause";function w(){v&&(C(),x&&Oe(x,zi,p.track.id),$||T(),F())}function C(){n.pauseOnHover&&l(S,"mouseenter mouseleave",function(K){m=K.type==="mouseenter",M()}),n.pauseOnFocus&&l(S,"focusin focusout",function(K){y=K.type==="focusin",M()}),x&&l(x,"click",function(){$?T():P(!0)}),o([Tn,Lo,Et],d.rewind),o(Tn,W)}function T(){a()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),y=m=$=!1,F(),s(Ir))}function P(K){K===void 0&&(K=!0),$=!!K,F(),a()||(d.pause(),s(Rr))}function M(){$||(m||y?P(!1):T())}function F(){x&&(vn(x,qn,!$),Oe(x,Ut,n.i18n[$?"play":"pause"]))}function b(K){var h=p.bar;h&&tn(h,"width",K*100+"%"),s(gs,K)}function W(K){var h=t.Slides.getAt(K);d.set(h&&+nn(h.slide,hc)||n.interval)}return{mount:w,destroy:d.cancel,play:T,pause:P,isPaused:a}}function yc(e,t,n){var i=xt(e),o=i.on;function l(){n.cover&&(o(Mr,ct(d,!0)),o([Nn,Nt,Et],ct(s,!0)))}function s(a){t.Slides.forEach(function(p){var u=Di(p.container||p.slide,"img");u&&u.src&&d(a,u,p)})}function d(a,p,u){u.style("background",a?'center/cover no-repeat url("'+p.src+'")':"",!0),Ri(p,a?"none":"")}return{mount:l,destroy:ct(s,!1)}}var vc=10,xc=600,bc=.6,Sc=1.5,wc=800;function Cc(e,t,n){var i=xt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Move,a=d.getPosition,p=d.getLimit,u=d.exceededLimit,S=d.translate,x=e.is(pi),v,m,y=1;function $(){o(Tn,P),o([Nt,Et],M)}function w(b,W,K,h,L){var E=a();if(P(),K&&(!x||!u())){var k=t.Layout.sliderSize(),z=sr(b)*k*xo(Dt(b)/k)||0;b=d.toPosition(t.Controller.toDest(b%k))+z}var le=ts(E,b,1);y=1,W=le?0:W||vo(Dt(b-E)/Sc,wc),m=h,v=Eo(W,C,ct(T,E,b,L),1),s(Ni),l(Lo),v.start()}function C(){s(di),m&&m(),l(Xn)}function T(b,W,K,h){var L=a(),E=b+(W-b)*F(h),k=(E-L)*y;S(L+k),x&&!K&&u()&&(y*=bc,Dt(k)<vc&&w(p(u(!0)),xc,!1,m,!0))}function P(){v&&v.cancel()}function M(){v&&!v.isPaused()&&(P(),C())}function F(b){var W=n.easingFunc;return W?W(b):1-Math.pow(1-b,4)}return{mount:$,destroy:P,scroll:w,cancel:M}}var oi={passive:!1,capture:!0};function Tc(e,t,n){var i=xt(e),o=i.on,l=i.emit,s=i.bind,d=i.unbind,a=e.state,p=t.Move,u=t.Scroll,S=t.Controller,x=t.Elements.track,v=t.Media.reduce,m=t.Direction,y=m.resolve,$=m.orient,w=p.getPosition,C=p.exceededLimit,T,P,M,F,b,W=!1,K,h,L;function E(){s(x,jo,rr,oi),s(x,zo,rr,oi),s(x,Rs,z,oi),s(x,"click",_,{capture:!0}),s(x,"dragstart",yn),o([Nn,Nt],k)}function k(){var B=n.drag;re(!B),F=B==="free"}function z(B){if(K=!1,!h){var Q=Ce(B);oe(B.target)&&(Q||!B.button)&&(S.isBusy()?yn(B,!0):(L=Q?x:window,b=a.is([yi,Ni]),M=null,s(L,jo,le,oi),s(L,zo,O,oi),p.cancel(),u.cancel(),q(B)))}}function le(B){if(a.is(so)||(a.set(so),l(ss)),B.cancelable)if(b){p.translate(T+fe(N(B)));var Q=de(B)>ll,U=W!==(W=C());(Q||U)&&q(B),K=!0,l(as),yn(B)}else X(B)&&(b=H(B),yn(B))}function O(B){a.is(so)&&(a.set(di),l(cs)),b&&(G(B),yn(B)),d(L,jo,le),d(L,zo,O),b=!1}function _(B){!h&&K&&yn(B,!0)}function q(B){M=P,P=B,T=w()}function G(B){var Q=ne(B),U=se(Q),J=n.rewind&&n.rewindByDrag;v(!1),F?S.scroll(U,0,n.snap):e.is(Vi)?S.go($(sr(Q))<0?J?"<":"-":J?">":"+"):e.is(pi)&&W&&J?S.go(C(!0)?">":"<"):S.go(S.toDest(U),!0),v(!0)}function H(B){var Q=n.dragMinThreshold,U=$i(Q),J=U&&Q.mouse||0,Me=(U?Q.touch:+Q)||10;return Dt(N(B))>(Ce(B)?Me:J)}function X(B){return Dt(N(B))>Dt(N(B,!0))}function ne(B){if(e.is(xi)||!W){var Q=de(B);if(Q&&Q<ll)return N(B)/Q}return 0}function se(B){return w()+sr(B)*Pn(Dt(B)*(n.flickPower||600),F?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function N(B,Q){return ie(B,Q)-ie(g(B),Q)}function de(B){return lr(B)-lr(g(B))}function g(B){return P===B&&M||P}function ie(B,Q){return(Ce(B)?B.changedTouches[0]:B)["page"+y(Q?"Y":"X")]}function fe(B){return B/(W&&e.is(pi)?ic:1)}function oe(B){var Q=n.noDrag;return!Li(B,"."+Ts+", ."+Ao)&&(!Q||!Li(B,Q))}function Ce(B){return typeof TouchEvent<"u"&&B instanceof TouchEvent}function me(){return b}function re(B){h=B}return{mount:E,disable:re,isDragging:me}}var $c={Spacebar:" ",Right:Mo,Left:Ro,Up:ys,Down:vs};function kr(e){return e=An(e)?e:e.key,$c[e]||e}var sl="keydown";function Lc(e,t,n){var i=xt(e),o=i.on,l=i.bind,s=i.unbind,d=e.root,a=t.Direction.resolve,p,u;function S(){x(),o(Nt,v),o(Nt,x),o(Tn,y)}function x(){var w=n.keyboard;w&&(p=w==="global"?window:d,l(p,sl,$))}function v(){s(p,sl)}function m(w){u=w}function y(){var w=u;u=!0,ql(function(){u=w})}function $(w){if(!u){var C=kr(w);C===a(Ro)?e.go("<"):C===a(Mo)&&e.go(">")}}return{mount:S,destroy:v,disable:m}}var Ci=Cr+"-lazy",uo=Ci+"-srcset",Ec="["+Ci+"], ["+uo+"]";function Ic(e,t,n){var i=xt(e),o=i.on,l=i.off,s=i.bind,d=i.emit,a=n.lazyLoad==="sequential",p=[vi,Xn],u=[];function S(){n.lazyLoad&&(x(),o(Et,x))}function x(){Cn(u),v(),a?w():(l(p),o(p,m),m())}function v(){t.Slides.forEach(function(C){wr(C.slide,Ec).forEach(function(T){var P=nn(T,Ci),M=nn(T,uo);if(P!==T.src||M!==T.srcset){var F=n.classes.spinner,b=T.parentElement,W=Di(b,"."+F)||si("span",F,b);u.push([T,C,W]),T.src||Ri(T,"none")}})})}function m(){u=u.filter(function(C){var T=n.perPage*((n.preloadPages||1)+1)-1;return C[1].isWithin(e.index,T)?y(C):!0}),u.length||l(p)}function y(C){var T=C[0];cn(C[1].slide,ur),s(T,"load error",ct($,C)),Oe(T,"src",nn(T,Ci)),Oe(T,"srcset",nn(T,uo)),dn(T,Ci),dn(T,uo)}function $(C,T){var P=C[0],M=C[1];xn(M.slide,ur),T.type!=="error"&&(Un(C[2]),Ri(P,""),d(Mr,P,M),d(ui)),a&&w()}function w(){u.length&&y(u.shift())}return{mount:S,destroy:ct(Cn,u),check:m}}function Rc(e,t,n){var i=xt(e),o=i.on,l=i.emit,s=i.bind,d=t.Slides,a=t.Elements,p=t.Controller,u=p.hasFocus,S=p.getIndex,x=p.go,v=t.Direction.resolve,m=a.pagination,y=[],$,w;function C(){T(),o([Nt,Et,bo],C);var h=n.pagination;m&&Ri(m,h?"":"none"),h&&(o([Tn,Lo,Xn],K),P(),K(),l(ps,{list:$,items:y},W(e.index)))}function T(){$&&(Un(m?Fn($.children):$),xn($,w),Cn(y),$=null),i.destroy()}function P(){var h=e.length,L=n.classes,E=n.i18n,k=n.perPage,z=u()?p.getEnd()+1:Mi(h/k);$=m||si("ul",L.pagination,a.track.parentElement),cn($,w=Po+"--"+b()),Oe($,bn,"tablist"),Oe($,Ut,E.select),Oe($,_r,b()===Wo?"vertical":"");for(var le=0;le<z;le++){var O=si("li",null,$),_=si("button",{class:L.page,type:"button"},O),q=d.getIn(le).map(function(H){return H.slide.id}),G=!u()&&k>1?E.pageX:E.slideX;s(_,"click",ct(M,le)),n.paginationKeyboard&&s(_,"keydown",ct(F,le)),Oe(O,bn,"presentation"),Oe(_,bn,"tab"),Oe(_,zi,q.join(" ")),Oe(_,Ut,ar(G,le+1)),Oe(_,ai,-1),y.push({li:O,button:_,page:le})}}function M(h){x(">"+h,!0)}function F(h,L){var E=y.length,k=kr(L),z=b(),le=-1;k===v(Mo,!1,z)?le=++h%E:k===v(Ro,!1,z)?le=(--h+E)%E:k==="Home"?le=0:k==="End"&&(le=E-1);var O=y[le];O&&(Zl(O.button),x(">"+le),yn(L,!0))}function b(){return n.paginationDirection||n.direction}function W(h){return y[p.toPage(h)]}function K(){var h=W(S(!0)),L=W(S());if(h){var E=h.button;xn(E,qn),dn(E,tl),Oe(E,ai,-1)}if(L){var k=L.button;cn(k,qn),Oe(k,tl,!0),Oe(k,ai,"")}l(ms,{list:$,items:y},h,L)}return{items:y,mount:C,destroy:T,getAt:W,update:K}}var Mc=[" ","Enter"];function Wc(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(m){m.isParent||(p(e,m.splide),p(m.splide,e))}),i&&u()}function d(){l.forEach(function(m){m.destroy()}),Cn(l)}function a(){d(),s()}function p(m,y){var $=xt(m);$.on(Tn,function(w,C,T){y.go(y.is(xi)?T:w)}),l.push($)}function u(){var m=xt(e),y=m.on;y($r,x),y(hs,v),y([Nn,Nt],S),l.push(m),m.emit(Er,e.splides)}function S(){Oe(t.Elements.list,_r,n.direction===Wo?"vertical":"")}function x(m){e.go(m.index)}function v(m,y){br(Mc,kr(y))&&(x(m),yn(y))}return{setup:ct(t.Media.set,{slideFocus:Hi(o)?i:o},!0),mount:s,destroy:d,remount:a}}function _c(e,t,n){var i=xt(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,oi)}function d(p){if(p.cancelable){var u=p.deltaY,S=u<0,x=lr(p),v=n.wheelMinThreshold||0,m=n.wheelSleep||0;Dt(u)>v&&x-l>m&&(e.go(S?"<":">"),l=x),a(S)&&yn(p)}}function a(p){return!n.releaseWheel||e.state.is(yi)||t.Controller.getAdjacent(p)!==-1}return{mount:s}}var Ac=90;function Pc(e,t,n){var i=xt(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,d=si("span",Za),a=Eo(Ac,ct(u,!1));function p(){s&&(x(!t.Autoplay.isPaused()),Oe(l,ol,!0),d.textContent="…",o(Ir,ct(x,!0)),o(Rr,ct(x,!1)),o([vi,Xn],ct(u,!0)))}function u(v){Oe(l,il,v),v?(Oi(l,d),a.start()):(Un(d),a.cancel())}function S(){dn(l,[nl,ol,il]),Un(d)}function x(v){s&&Oe(l,nl,v?"off":"polite")}return{mount:p,disable:x,destroy:S}}var kc=Object.freeze({__proto__:null,Media:za,Direction:Va,Elements:oc,Slides:lc,Layout:sc,Clones:cc,Move:dc,Controller:uc,Arrows:gc,Autoplay:fc,Cover:yc,Scroll:Cc,Drag:Tc,Keyboard:Lc,LazyLoad:Ic,Pagination:Rc,Sync:Wc,Wheel:_c,Live:Pc}),Fc={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:tc,i18n:Fc,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Hc(e,t,n){var i=t.Slides;function o(){xt(e).on([Nn,Et],l)}function l(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function s(d,a){i.style("transition","opacity "+n.speed+"ms "+n.easing),ql(a)}return{mount:o,start:s,cancel:rr}}function Bc(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,d=ct(tn,s,"transition"),a;function p(){xt(e).bind(s,"transitionend",function(v){v.target===s&&a&&(S(),a())})}function u(v,m){var y=i.toPosition(v,!0),$=i.getPosition(),w=x(v);Dt(y-$)>=1&&w>=1?n.useScroll?l.scroll(y,w,!1,m):(d("transform "+w+"ms "+n.easing),i.translate(y,!0),a=m):(i.jump(v),m())}function S(){d(""),l.cancel()}function x(v){var m=n.rewindSpeed;if(e.is(pi)&&m){var y=o.getIndex(!0),$=o.getEnd();if(y===0&&v>=$||y>=$&&v===0)return m}return n.speed}return{mount:p,start:u,cancel:S}}var Oc=(function(){function e(n,i){this.event=xt(),this.Components={},this.state=Da(li),this.splides=[],this._o={},this._E={};var o=An(n)?es(document,n):n;wi(o,o+" is invalid."),this.root=o,i=_n({label:nn(o,Ut)||"",labelledby:nn(o,Wr)||""},Nc,e.defaults,i||{});try{_n(i,JSON.parse(nn(o,Cr)))}catch{wi(!1,"Invalid JSON")}this._o=Object.create(_n({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,d=this.Components;wi(s.is([li,yo]),"Already mounted!"),s.set(li),this._C=d,this._T=o||this._T||(this.is(Vi)?Hc:Bc),this._E=i||this._E;var a=Ii({},kc,this._E,{Transition:this._T});return Gn(a,function(p,u){var S=p(l,d,l._o);d[u]=S,S.setup&&S.setup()}),Gn(d,function(p){p.mount&&p.mount()}),this.emit(Nn),cn(this.root,Qa),s.set(di),this.emit(cr),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(di)&&(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(Fn(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(Et),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(li)?xt(this).on(cr,this.destroy.bind(this,i)):(Gn(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(Lr),o.destroy(),i&&Cn(this.splides),l.set(yo)),this},Fa(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})(),Fr=Oc;Fr.defaults={};Fr.STATES=Ha;var al=[[Nn,"onMounted"],[cr,"onReady"],[Tn,"onMove"],[vi,"onMoved"],[$r,"onClick"],[is,"onActive"],[os,"onInactive"],[rs,"onVisible"],[ls,"onHidden"],[Et,"onRefresh"],[Nt,"onUpdated"],[ui,"onResize"],[$o,"onResized"],[ss,"onDrag"],[as,"onDragging"],[cs,"onDragged"],[Lo,"onScroll"],[Xn,"onScrolled"],[Lr,"onDestroy"],[ds,"onArrowsMounted"],[us,"onArrowsUpdated"],[ps,"onPaginationMounted"],[ms,"onPaginationUpdated"],[Er,"onNavigationMounted"],[Ir,"onAutoplayPlay"],[gs,"onAutoplayPlaying"],[Rr,"onAutoplayPause"],[Mr,"onLazyLoadLoaded"]];function Nr(...e){return e.filter(Boolean).join(" ")}function So(e){return e!==null&&typeof e=="object"}function pr(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!pr(n,t[i]));if(So(e)&&So(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!pr(e[o],t[o]))}return e===t}function Dc(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function jc(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 mr(e,t){const n=e;return jc(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():So(i)?n[o]=mr(So(n[o])?n[o]:{},i):n[o]=i}),n}var zc=({children:e,className:t,...n})=>c.createElement("div",{className:Nr("splide__track",t),...n},c.createElement("ul",{className:"splide__list"},e)),Hr=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 Fr(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=mr({},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&&!pr(this.options,e)&&(this.splide.options=e,this.options=mr({},e));const t=this.getSlides();Dc(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){al.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:Nr("splide",e),ref:this.splideRef,...this.omit(o,["options",...al.map(l=>l[1])])},n?c.createElement(zc,null,i):i)}},Br=({children:e,className:t,...n})=>c.createElement("li",{className:Nr("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 Vc="RichTextRenderer-module__link___BWeZ2",Kc={link:Vc},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))},Io=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Uc(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function tn(e){const{color:t,...n}=e;return n}function Wt(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Io(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:E.scalingValue(e.letterSpacing,t),wordSpacing:E.scalingValue(e.wordSpacing,t),fontSize:E.scalingValue(n,t),lineHeight:i!==void 0?E.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(l=e.textAppearance)==null?void 0:l.textDecoration,fontVariant:(s=e.textAppearance)==null?void 0:s.fontVariant,textAlign:e.textAlign,color:e.color}}const wi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Kc.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Gc(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 Gc(e){return{...e.fontFamily&&{fontFamily:Io(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 qc="SvgImage-module__svg___q3xE-",Xc="SvgImage-module__img___VsTm-",rl={svg:qc,img:Xc},Yc=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Jc=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,nn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[l,s]=c.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return c.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');s(d)}},[]),!Yc(e)||!l?r.jsx("img",{src:e,alt:"",className:Xe(rl.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:Xe(rl.svg,i),style:{"--svg":Jc(e),"--fill":t,"--hover-fill":n,...o??{}}})},Zc={"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 Qc({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=c.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:a,textAlign:p,wordSpacing:u,fontSizeLineHeight:S,textAppearance:x,color:y}=n.imageCaption??{},[m,f]=c.useState(void 0),[$,w]=c.useState(null),[C,T]=c.useState(0),[P,R]=c.useState(0),{direction:F,transition:b,controls:_,pagination:V,imageCaption:h,triggers:L}=e,I=c.useRef(b.type),{x:k,y:z}=e.controls.offset,le=O=>{o&&o.go(O)};return c.useEffect(()=>{if(!$)return;const O=new ResizeObserver(W=>{if(!o)return;const[G]=W;f({width:Math.round(G.contentRect.width),height:Math.round(G.contentRect.height)})});return O.observe($),()=>O.unobserve($)},[$]),c.useEffect(()=>{!o||I.current===b.type||(R(O=>O+1),I.current=b.type)},[b.type]),r.jsx("div",{className:Xe(be.wrapper,{[be.editor]:i}),ref:w,children:r.jsxs("div",{className:be.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:b.backgroundColor&&b.type==="fade in"?b.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:Xe(be.captionBlock),children:r.jsx("div",{className:be.captionTextWrapper,children:t.map((O,W)=>r.jsx("div",{className:Xe(be.captionText,Zc[h.alignment],{[be.withPointerEvents]:W===C&&i,[be.active]:W===C}),style:{fontFamily:Io(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":E.scalingValue(s.width,i),letterSpacing:E.scalingValue(a,i),wordSpacing:E.scalingValue(u,i),textAlign:p,fontSize:E.scalingValue(S.fontSize,i),lineHeight:E.scalingValue(S.lineHeight,i),textTransform:x.textTransform??"none",textDecoration:x.textDecoration??"none",fontVariant:x.fontVariant??"normal",color:y,transitionDuration:b.duration?`${Math.round(parseInt(b.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:be.captionTextInner,style:{"--link-hover-color":h.linkHoverColor,"--link-color":h.linkColor,position:"relative",top:E.scalingValue(h.offset.y,i),left:E.scalingValue(h.offset.x,i)},children:r.jsx(wi,{content:O.imageCaption})})},W))})}),r.jsx(Mr,{onMove:O=>{T(O.index)},ref:l,options:{arrows:!1,speed:b.duration?parseInt(b.duration):500,autoplay:L.autoPlay!==null,...L.autoPlay!==null&&{interval:parseInt(L.autoPlay)*1e3},direction:F==="horiz"||b.type==="fade in"?"ltr":"ttb",pagination:!1,drag:L.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:b.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((O,W)=>r.jsx(_r,{children:r.jsx("div",{className:be.sliderItem,children:r.jsx("div",{className:be.imgWrapper,children:r.jsx("img",{className:Xe(be.sliderImage,{[be.contain]:O.image.objectFit==="contain",[be.cover]:O.image.objectFit==="cover"}),src:O.image.url,alt:O.image.name??""})})})},W))},P),_.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Xe(be.arrow,{[be.arrowVertical]:F==="vert",[be.hoverArrow]:_.show==="on hover"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:r.jsxs("button",{onClick:()=>{le("-1")},className:be.arrowInner,style:{transform:`translate(${E.scalingValue(k,i)}, ${E.scalingValue(z*(F==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:[_.arrowsImgUrl&&r.jsx(nn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:Xe(be.arrowImg,be.mirror)}),!_.arrowsImgUrl&&r.jsx(ll,{color:_.color,className:Xe(be.arrowIcon,be.arrowImg,be.mirror)})]})}),r.jsx("div",{className:Xe(be.arrow,be.nextArrow,{[be.arrowVertical]:F==="vert",[be.hoverArrow]:_.show==="on hover"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:r.jsxs("button",{className:be.arrowInner,onClick:()=>le("+1"),style:{transform:`translate(${E.scalingValue(k*(F==="horiz"?-1:1),i)}, ${E.scalingValue(z,i)}) scale(${e.controls.scale/100}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:[_.arrowsImgUrl&&r.jsx(nn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:be.arrowImg}),!_.arrowsImgUrl&&r.jsx(ll,{color:_.color,className:Xe(be.arrowIcon,be.arrowImg)})]})})]}),L.triggersList.click&&r.jsx("div",{className:be.clickOverlay,onClick:()=>{o&&o.go("+1")}}),V.isActive&&r.jsx("div",{className:Xe(be.pagination,{[be.paginationInsideBottom]:V.position==="inside-1"&&F==="horiz",[be.paginationInsideTop]:V.position==="inside-2"&&F==="horiz",[be.paginationOutsideBottom]:V.position==="outside-1"&&F==="horiz",[be.paginationOutsideTop]:V.position==="outside-2"&&F==="horiz",[be.paginationInsideLeft]:V.position==="inside-1"&&F==="vert",[be.paginationInsideRight]:V.position==="inside-2"&&F==="vert",[be.paginationOutsideLeft]:V.position==="outside-1"&&F==="vert",[be.paginationOutsideRight]:V.position==="outside-2"&&F==="vert",[be.paginationVertical]:F==="vert"}),children:r.jsx("div",{className:be.paginationInner,style:{backgroundColor:V.colors[2],transform:`scale(${V.scale/100}) translate(${E.scalingValue(V.offset.x,i)}, ${E.scalingValue(V.offset.y,i)}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:t.map((O,W)=>r.jsx("button",{onClick:()=>{o&&o.go(W)},className:Xe(be.paginationItem),children:r.jsx("div",{className:Xe(be.dot,{[be.activeDot]:W===C}),style:{backgroundColor:W===C?V.colors[0]:V.colors[1],"--pagination-hover-color":V.hover}})},W))})})]})})}function ll({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 ed={element:Qc,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"]}},td="ImageRevealSlider-module__imageRevealSlider___UE5Ob",nd="ImageRevealSlider-module__image___Qjt-e",id="ImageRevealSlider-module__link___N-iLG",od="ImageRevealSlider-module__cursor___2U03d",Vn={imageRevealSlider:td,image:nd,link:id,cursor:od};function sl(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const l=i.width?Number.parseFloat(i.width):o.naturalWidth,s=o.naturalHeight/o.naturalWidth*l,d=l/2,a=s/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-a&&t<=i.y+a)return!0}return!1}function Fo(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function rd(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await Fo(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await Fo(e);l=s.height/s.width*o}else{const s=await Fo(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function ld({settings:e,content:t,isEditor:n}){const[i,o]=c.useState(null),[l,s]=c.useState([]),[d,a]=c.useState(0),p=c.useRef(0),[u,S]=c.useState({x:0,y:0}),[x,y]=c.useState(1),[m,f]=c.useState("none"),$=c.useRef({x:0,y:0}),[w,C]=c.useState(!1),{sizeType:T,imageWidth:P,randomRangeImageWidth:R}=e.imageSize,{revealPosition:F,visible:b}=e.position,{cursorType:_,target:V,defaultCursorScale:h,defaultCursor:L,hoverCursorScale:I,hoverCursor:k}=e.cursor;c.useEffect(()=>{if(!i)return;const O=(K,H)=>{const q=i.getBoundingClientRect(),te=K-q.left,se=H-q.top;if(S({x:te,y:se}),_==="system"){f("none"),y(1);return}const N=te,ce=se,g=document.elementFromPoint(q.left+N,q.top+ce);if(g&&g.closest("a")){f("none"),y(1);return}const ne=sl(N,ce,l)||V==="area"?{img:k??"none",scale:I}:{img:L??"none",scale:h};f(ne.img),y(ne.scale)},W=K=>{K.stopPropagation(),$.current={x:K.clientX,y:K.clientY},O(K.clientX,K.clientY)},G=()=>{w&&O($.current.x,$.current.y)};return i.addEventListener("mousemove",W),window.addEventListener("scroll",G,!0),()=>{i.removeEventListener("mousemove",W),window.removeEventListener("scroll",G,!0)}},[i,w,u,_,V,k,L,I,h,l]),c.useEffect(()=>{w||(f("none"),y(0))},[w]);const z=async(O,W,G,K={})=>{const{width:H,height:q,finalWidth:te}=await rd(O.image.url,T,P,R);let se=0,N=0;F==="same"?(se=W/2,N=G/2):(se=K.x??Math.random()*W,N=K.y??Math.random()*G);const ce=Math.min(Math.max(se,H/2),W-H/2),g=Math.min(Math.max(N,q/2),G-q/2);return{id:p.current++,url:O.image.url,link:O.link,name:O.image.name,x:ce,y:g,width:te}};c.useEffect(()=>{if(!i||t.length===0)return;const O=i.getBoundingClientRect(),W=O.width,G=O.height,K=[];(async()=>{const q=t[0],te=await z(q,W,G);K.push(te),s(K),a(1)})()},[T,P,R,F,i]),c.useEffect(()=>{b==="last One"&&s(O=>O.length>0?[O[O.length-1]]:[])},[b]);const le=async O=>{if(!i)return;const W=i.getBoundingClientRect(),G=O.clientX-W.left,K=O.clientY-W.top;if(V==="image"&&!sl(G,K,l))return;let H=0,q=0;F==="on Click"?(H=G,q=K):F==="same"?(H=W.width/2,q=W.height/2):(H=Math.random()*W.width,q=Math.random()*W.height);const te=t[d],se=await z(te,W.width,W.height,{x:H,y:q});s(N=>b==="all"?[...N,se]:[se]),a(N=>N>=t.length-1?0:N+1)};return r.jsxs("div",{ref:o,onClick:le,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:Vn.imageRevealSlider,style:{cursor:m==="none"?"default":"none"},children:[l.map(O=>r.jsx("div",{className:Vn.wrapper,style:{top:`${O.y}px`,left:`${O.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:O.width??"auto",height:"auto",cursor:m==="none"?"default":"none"},children:V==="area"&&O.link?r.jsx("a",{href:O.link,target:"_blank",className:Vn.link,children:r.jsx("img",{src:O.url,alt:O.name,className:Vn.image},O.id)}):r.jsx("img",{src:O.url,alt:O.name,className:Vn.image},O.id)},O.id)),w&&r.jsx("div",{className:Vn.cursor,style:{left:`${u.x}px`,top:`${u.y}px`,transform:`translate(-50%, -50%) scale(${x})`,backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const sd={element:ld,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},ad="LightBox-module__hidden___9s-9x",cd="LightBox-module__heroImage___sTxNF",dd="LightBox-module__background___rm9ml",ud="LightBox-module__editor___4ACaY",pd="LightBox-module__contentStyle___Bgnsq",md="LightBox-module__imageStyle___tLIlB",gd="LightBox-module__imgWrapper___LuFUp",hd="LightBox-module__contain___8-yaS",fd="LightBox-module__cover___hNvOG",yd="LightBox-module__caption___b6L2I",vd="LightBox-module__captionTextInner___rCGNH",xd="LightBox-module__lightboxSplide___XFuWC",bd="LightBox-module__arrow___iz38X",Sd="LightBox-module__arrowVertical___Zfz81",wd="LightBox-module__nextArrow___zkAQN",Cd="LightBox-module__arrowInner___p48sW",Td="LightBox-module__arrowIcon___3VaFf",$d="LightBox-module__arrowImg___pNV88",Ld="LightBox-module__mirror___pjeXc",Id="LightBox-module__thumbsWrapper___GB-nU",Ed="LightBox-module__thumbsContainerVertical___wttk5",Rd="LightBox-module__thumbsContainer___osSma",Md="LightBox-module__thumbsAlignStart___MO6tY",_d="LightBox-module__thumbsAlignCenter___Q4sUx",Wd="LightBox-module__thumbsAlignEnd___p4y9R",Ad="LightBox-module__thumbItem___HvnF3",Pd="LightBox-module__closeButton___g2khP",kd="LightBox-module__fadeIn___0m5GW",Fd="LightBox-module__slideInLeft___gPYwC",Nd="LightBox-module__slideInRight___S-pPp",Hd="LightBox-module__slideInTop___DFdAj",Bd="LightBox-module__slideInBottom___m27kZ",Od="LightBox-module__fadeOut___55qBR",Dd="LightBox-module__slideOutLeft___NvU7P",jd="LightBox-module__slideOutRight___SK7eC",zd="LightBox-module__slideOutTop___Vgg0z",Vd="LightBox-module__slideOutBottom___nJ0Ef",Kd="LightBox-module__scaleSlide___vZriG",ue={hidden:ad,heroImage:cd,background:dd,editor:ud,contentStyle:pd,imageStyle:md,imgWrapper:gd,contain:hd,cover:fd,caption:yd,captionTextInner:vd,lightboxSplide:xd,arrow:bd,arrowVertical:Sd,nextArrow:wd,arrowInner:Cd,arrowIcon:Td,arrowImg:$d,mirror:Ld,thumbsWrapper:Id,thumbsContainerVertical:Ed,thumbsContainer:Rd,thumbsAlignStart:Md,thumbsAlignCenter:_d,thumbsAlignEnd:Wd,thumbItem:Ad,closeButton:Pd,fadeIn:kd,slideInLeft:Fd,slideInRight:Nd,slideInTop:Hd,slideInBottom:Bd,fadeOut:Od,slideOutLeft:Dd,slideOutRight:jd,slideOutTop:zd,slideOutBottom:Vd,scaleSlide:Kd},Oi=(e,t,n)=>{const i={},[o,l]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),l==="left"?(i.left="0",i.right="auto"):l==="center"?(i.left="50%",i.right="auto"):l==="right"&&(i.left="auto",i.right="0"),o==="middle"&&l==="center"?i.transform=`translate(calc(-50% + ${E.scalingValue(t.x,n)}), calc(-50% + ${E.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${E.scalingValue(t.x,n)}, calc(-50% + ${E.scalingValue(t.y,n)}))`:l==="center"?i.transform=`translate(calc(-50% + ${E.scalingValue(t.x,n)}), ${E.scalingValue(t.y,n)})`:i.transform=`translate(${E.scalingValue(t.x,n)}, ${E.scalingValue(t.y,n)})`,i};function Ls(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 al(e){const t=e.getBoundingClientRect(),n=Ls(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,s=e.naturalHeight,d=i/o,a=l/s;let p,u;a>d?(p=i,u=i/a):(u=o,p=o*a);const S=t.left+n.left,x=t.top+n.top,y=(i-p)/2+S,m=(o-u)/2+x;return{x:y,y:m,width:p,height:u}}function cl(e){const t=e.getBoundingClientRect(),n=Ls(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function dl(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 ue.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return ue.slideInLeft;case"right":return ue.slideInRight;case"top":return ue.slideInTop;case"bottom":return ue.slideInBottom;default:return ue.slideInRight}return ue.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return ue.fadeIn;if(e==="slide in")switch(t){case"left":return ue.slideInLeft;case"right":return ue.slideInRight;case"top":return ue.slideInTop;case"bottom":return ue.slideInBottom;default:return ue.slideInRight}return ue.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return ue.fadeOut;if(e==="slide in")switch(t){case"left":return ue.slideOutLeft;case"right":return ue.slideOutRight;case"top":return ue.slideOutTop;case"bottom":return ue.slideOutBottom;default:return ue.slideOutRight}return ue.fadeOut})(),l=(()=>{if(e==="fade in")return ue.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return ue.slideOutLeft;case"right":return ue.slideOutRight;case"top":return ue.slideOutTop;case"bottom":return ue.slideOutBottom;default:return ue.slideOutRight}return ue.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const Gd=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:l,isPreviewMode:s})=>{const[d,a]=c.useState(!1),{url:p}=e.thumbnailBlock.cover;return c.useEffect(()=>{o==="close"&&a(!1),o==="open"&&a(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:p,alt:"Cover",className:ue.heroImage,onClick:()=>a(!0)}),r.jsx(qd,{isOpen:d,onClose:()=>a(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},qd=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:d})=>{var xe;const{widthSettings:a,fontSettings:p,letterSpacing:u,textAlign:S,wordSpacing:x,fontSizeLineHeight:y,textAppearance:m,color:f}=i.imageCaption??{},[$,w]=c.useState(0),[C,T]=c.useState(0),[P,R]=c.useState(!1),[F,b]=c.useState(!1),[_,V]=c.useState({}),h=c.useRef(null),L=c.useRef(null),I=c.useRef(null),k=c.useRef(!1),z=c.useRef(null),le=c.useRef(null),O=c.useRef(null),W=c.useRef(null),G=c.useRef(!1),K=c.useRef(null),[H,q]=c.useState(!1),{appear:te,triggers:se,slider:N,thumbnail:ce,controls:g,area:ne,caption:fe,layout:ie}=o.lightboxBlock,{appearClass:we,backdropAppearClass:me,backdropDisappearClass:oe,disappearClass:B}=Ud(te.type,te.direction),Q=(d==null?void 0:d.itemId)??null;c.useEffect(()=>{const j=()=>{setTimeout(()=>{var A,D;(D=(A=h.current)==null?void 0:A.splide)==null||D.refresh()},16)},ae=()=>{T(A=>A+1)};return window.addEventListener("ArticleEditor.Layout:change",j),window.addEventListener("ArticleEditor.ComponentContent:change",ae),()=>{window.removeEventListener("ArticleEditor.Layout:change",j),window.removeEventListener("ArticleEditor.ComponentContent:change",ae)}},[]),c.useEffect(()=>{if(!e||!ce.isActive){q(!1);return}const j=K.current;if(!j)return;const ae=()=>{N.direction==="horiz"?q(j.scrollWidth>j.clientWidth):q(j.scrollHeight>j.clientHeight)};ae();const A=new ResizeObserver(ae);return A.observe(j),()=>A.disconnect()},[e,ce.isActive,n.length,_,N.direction]);const U=c.useCallback(()=>{const j=window.matchMedia("(max-width: 768px)").matches,ae=dl(ne.color);j&&!s&&ae>.9&&(document.body.style.backgroundColor=""),R(!0),k.current=!0;const A=D=>{D.target===z.current&&D.animationName&&(z.current&&le.current&&z.current.removeEventListener("animationend",le.current),le.current=null,k.current&&(k.current=!1,t()),R(!1))};z.current&&(le.current=A,z.current.addEventListener("animationend",A))},[t,ne.color,s]),Y=(j,ae,A)=>{var D,X;if(j){if(se.type==="click"&&se.switch==="image")se.repeat==="close"&&$===n.length-1?U():(D=h.current)==null||D.go("+1");else if(se.type==="click"&&se.switch==="50/50"){const J=j.getBoundingClientRect(),ge=ae-J.left,Ce=A-J.top,De=J.width,Re=J.height;let $e;N.direction==="horiz"?$e=ge<De/2?"-1":"+1":$e=Ce<Re/2?"-1":"+1",(X=h.current)==null||X.go($e)}}},Ie=j=>{if(G.current){G.current=!1;return}const ae=n[$],A=(ae==null?void 0:ae.image.objectFit)==="cover";let D,X;if("changedTouches"in j&&j.changedTouches.length>0)D=j.changedTouches[0].clientX,X=j.changedTouches[0].clientY;else if("clientX"in j)D=j.clientX,X=j.clientY;else return;let J;if(A&&I.current){const ge=cl(I.current);J=D>=ge.left&&D<=ge.right&&X>=ge.top&&X<=ge.bottom}else{const ge=I.current?al(I.current):null;if(!ge){j.target===j.currentTarget&&U();return}J=D>=ge.x&&D<=ge.x+ge.width&&X>=ge.y&&X<=ge.y+ge.height}J?Y(I.current,D,X):U()},Me=j=>{const ae=j.target;(ae.classList.contains(ue.thumbsWrapper)||ae.classList.contains(ue.thumbsContainer))&&Ie(j)};c.useEffect(()=>{if(!e)return;const j=ae=>{var A,D;if(ae.key==="Escape"){U();return}if(ae.key==="ArrowRight"){w(X=>(X+1)%Math.max(n.length,1)),(A=h.current)==null||A.go("+1");return}ae.key==="ArrowLeft"&&(w(X=>(X-1+Math.max(n.length,1))%Math.max(n.length,1)),(D=h.current)==null||D.go("-1"))};return window.addEventListener("keydown",j),()=>{window.removeEventListener("keydown",j)}},[e,U,n.length]),c.useEffect(()=>{if(e){if(w(0),T(ae=>ae+1),k.current=!1,R(!1),b(!1),V({}),!Q)return;const j=new CustomEvent("page-overlay",{detail:{itemId:Q}});window.dispatchEvent(j)}return()=>{z.current&&le.current&&(z.current.removeEventListener("animationend",le.current),le.current=null),b(!1)}},[e,Q]),c.useEffect(()=>{L.current!==null&&L.current!==N.type&&T(j=>j+1),L.current=N.type},[N.type]),c.useEffect(()=>{if(!e)return;const j=document.body.style.overflow,ae=window.matchMedia("(max-width: 768px)").matches,A=dl(ne.color);document.body.style.overflow="hidden",b(!1);const D=J=>{J.target===z.current&&!k.current&&J.animationName&&(ae&&!s&&A>.9&&(document.body.style.backgroundColor=ne.color),b(!0),z.current&&O.current&&z.current.removeEventListener("animationend",O.current),O.current=null)};z.current&&(O.current=D,z.current.addEventListener("animationend",D));const X=J=>{const ge=J.target;ge&&(ge.closest(`.${ue.thumbsWrapper}`)||ge.closest(`.${ue.thumbsContainer}`))||N.type!=="slide"&&J.preventDefault()};return document.addEventListener("touchmove",X,{passive:!1}),()=>{document.body.style.overflow=j,document.removeEventListener("touchmove",X),z.current&&O.current&&(z.current.removeEventListener("animationend",O.current),O.current=null),b(!1)}},[e,s,ne.color,N.type]),c.useEffect(()=>{if(!e)return;const j=ae=>{var D,X;if(k.current){ae.stopPropagation();return}if(G.current){G.current=!1;return}const A=ae.target;if(!(A&&(A.closest(`.${ue.thumbsContainer}`)||A.closest(`.${ue.thumbItem}`)||A.closest(`.${ue.arrow}`)||A.closest(`.${ue.closeButton}`)||A.closest(`.${ue.caption}`)))){if(N.type==="slide"&&se.type==="drag"&&((X=(D=h.current)==null?void 0:D.splide)!=null&&X.root)){const J=h.current.splide.root;if(A&&(J.contains(A)||J===A))return}if(ae.touches.length===0&&ae.changedTouches.length>0){const J=n[$],ge=(J==null?void 0:J.image.objectFit)==="cover",Ce=ae.changedTouches[0];let De;if(ge&&I.current){const Re=cl(I.current);De=Ce.clientX>=Re.left&&Ce.clientX<=Re.right&&Ce.clientY>=Re.top&&Ce.clientY<=Re.bottom}else{const Re=I.current?al(I.current):null;if(!Re)return;De=Ce.clientX>=Re.x&&Ce.clientX<=Re.x+Re.width&&Ce.clientY>=Re.y&&Ce.clientY<=Re.y+Re.height}if(!De){ae.stopPropagation(),k.current=!0;const Re=$e=>{$e.stopPropagation(),$e.preventDefault(),document.removeEventListener("click",Re,!0)};document.addEventListener("click",Re,!0),U()}}}};return document.addEventListener("touchend",j,{passive:!0}),()=>{document.removeEventListener("touchend",j)}},[e,U,$,n]);const Ae=(N.type==="scale"||N.type==="fade")&&N.direction==="vert"&&se.type==="drag";c.useEffect(()=>{var $e,Ge;if(!e||!Ae||!((Ge=($e=h.current)==null?void 0:$e.splide)!=null&&Ge.root))return;const j=h.current.splide.root,ae=30,A=(pe,Ee)=>{if(W.current){const je=Math.abs(pe-W.current.x),ze=Math.abs(Ee-W.current.y);(je>0||ze>0)&&(G.current=!0)}},D=pe=>{W.current&&(pe.preventDefault(),A(pe.clientX,pe.clientY))},X=pe=>{W.current&&pe.touches.length>0&&(pe.preventDefault(),A(pe.touches[0].clientX,pe.touches[0].clientY))},J=(pe,Ee)=>{if(!W.current||!h.current){W.current=null;return}const je=Math.abs(pe-W.current.x),ze=Math.abs(Ee-W.current.y);ze>ae&&ze>je&&h.current.go(Ee<W.current.y?"+1":"-1"),W.current=null},ge=pe=>{W.current&&J(pe.clientX,pe.clientY),document.removeEventListener("pointerup",ge),document.removeEventListener("pointercancel",ge),document.removeEventListener("pointermove",D)},Ce=pe=>{if(W.current){if(pe.changedTouches.length>0){const Ee=pe.changedTouches[0];J(Ee.clientX,Ee.clientY)}document.removeEventListener("touchend",Ce),document.removeEventListener("touchcancel",Ce),document.removeEventListener("touchmove",X)}},De=pe=>{W.current={x:pe.clientX,y:pe.clientY},G.current=!1,document.addEventListener("pointermove",D,{passive:!1}),document.addEventListener("pointerup",ge),document.addEventListener("pointercancel",ge)},Re=pe=>{pe.touches.length>0&&(W.current={x:pe.touches[0].clientX,y:pe.touches[0].clientY},G.current=!1,document.addEventListener("touchmove",X,{passive:!1}),document.addEventListener("touchend",Ce),document.addEventListener("touchcancel",Ce))};return j.addEventListener("pointerdown",De),j.addEventListener("touchstart",Re),()=>{j.removeEventListener("pointerdown",De),j.removeEventListener("touchstart",Re),document.removeEventListener("pointermove",D),document.removeEventListener("pointerup",ge),document.removeEventListener("pointercancel",ge),document.removeEventListener("touchmove",X),document.removeEventListener("touchend",Ce),document.removeEventListener("touchcancel",Ce),W.current=null,G.current=!1}},[e,Ae,C]);const Pe={backgroundColor:ne.color,backdropFilter:`blur(${ne.blur}px)`,animationDuration:`${parseInt(te.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:Li.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:z,className:Xe(ue.background,P?oe:me,{[ue.editor]:s},{[ue.hidden]:!e}),style:{...Pe,...F&&!s&&!P?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?z:null,className:Xe(ue.contentStyle,P?B:we,{[ue.editor]:s},{[ue.hidden]:!e}),style:{animationDuration:`${parseInt(te.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Mr,{onMove:j=>w(j.index),ref:h,className:ue.lightboxSplide,options:{arrows:!1,speed:N.duration?parseInt(N.duration):500,direction:N.direction==="horiz"||N.type==="fade"||N.type==="scale"?"ltr":"ttb",pagination:!1,drag:se.type==="drag"&&!Ae,perPage:1,width:"100%",height:"100%",type:N.type==="fade"||N.type==="scale"?"fade":"loop",padding:0,rewind:se.repeat!=="close",start:0},style:{"--splide-speed":N.duration},children:n.map((j,ae)=>{const A=Oi(ie.position,ie.offset,s),D=`${E.scalingValue(ie.padding.top,s)} ${E.scalingValue(ie.padding.right,s)} ${E.scalingValue(ie.padding.bottom,s)} ${E.scalingValue(ie.padding.left,s)}`,X=N.type==="scale"?(()=>{const{transform:J,...ge}=A;return{...ge,position:"absolute",padding:D,boxSizing:"border-box","--position-transform":J||"none"}})():{...A,position:"absolute",padding:D,boxSizing:"border-box"};return r.jsx(_r,{children:r.jsx("div",{className:ue.imgWrapper,onClick:Ie,children:r.jsx("img",{ref:ae===$?I:null,className:Xe(ue.imageStyle,{[ue.contain]:j.image.objectFit==="contain",[ue.cover]:j.image.objectFit==="cover",[ue.scaleSlide]:N.type==="scale"}),src:j.image.url,alt:j.image.name??"",style:{...X,pointerEvents:j.image.objectFit==="contain"?"none":"auto"}})})},ae)})},C),g.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Xe(ue.arrow,{[ue.arrowVertical]:N.direction==="vert"}),style:{color:g.color,"--arrow-hover-color":g.hover},children:r.jsxs("button",{className:ue.arrowInner,style:{transform:`translate(${E.scalingValue(g.offset.x,s)}, ${E.scalingValue(g.offset.y*(N.direction==="horiz"?1:-1),s)}) scale(${g.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=h.current)==null?void 0:j.go("-1")},"aria-label":"Previous",children:[g.arrowsImgUrl&&r.jsx(nn,{url:g.arrowsImgUrl,fill:g.color,hoverFill:g.hover,className:Xe(ue.arrowImg,ue.mirror)}),!g.arrowsImgUrl&&r.jsx(ul,{color:g.color,className:Xe(ue.arrowIcon,ue.arrowImg,ue.mirror)})]})}),r.jsx("div",{className:Xe(ue.arrow,ue.nextArrow,{[ue.arrowVertical]:N.direction==="vert"}),style:{color:g.color,"--arrow-hover-color":g.hover},children:r.jsxs("button",{className:ue.arrowInner,style:{transform:`translate(${E.scalingValue(g.offset.x*(N.direction==="horiz"?-1:1),s)}, ${E.scalingValue(g.offset.y,s)}) scale(${g.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=h.current)==null?void 0:j.go("+1")},"aria-label":"Next",children:[g.arrowsImgUrl&&r.jsx(nn,{url:g.arrowsImgUrl,fill:g.color,hoverFill:g.hover,className:ue.arrowImg}),!g.arrowsImgUrl&&r.jsx(ul,{color:g.color,className:Xe(ue.arrowIcon,ue.arrowImg)})]})})]}),ne.closeIconUrl&&(()=>{const j=Oi(ne.closeIconAlign,ne.closeIconOffset,s),ae=`scale(${ne.closeIconScale})`,A=j.transform?`${j.transform} ${ae}`:ae;return r.jsx("button",{className:ue.closeButton,style:{...j,transform:A},onClick:U,"aria-label":"Close lightbox",children:r.jsx(nn,{url:ne.closeIconUrl,fill:ne.closeIconColor??"#000000",hoverFill:ne.closeIconHover??"#cccccc"})})})(),fe&&fe.isActive&&i.imageCaption&&((xe=n[$])==null?void 0:xe.imageCaption)&&r.jsx("div",{className:ue.caption,style:{...Oi(fe.alignment,fe.offset,s),fontFamily:Io(p.fontFamily),fontWeight:p.fontWeight,fontStyle:p.fontStyle,width:a.sizing==="auto"?"max-content":E.scalingValue(a.width,s),letterSpacing:E.scalingValue(u,s),wordSpacing:E.scalingValue(x,s),textAlign:S,fontSize:E.scalingValue(y.fontSize,s),lineHeight:E.scalingValue(y.lineHeight,s),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:f},onClick:j=>j.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:ue.captionTextInner,style:{"--link-color":fe.linkColor,"--link-hover-color":fe.linkHoverColor},children:r.jsx(wi,{content:n[$].imageCaption})})}),ce.isActive&&(()=>{const[j,ae]=ce.position.split("-"),A=N.direction==="horiz"?`${j}-left`:ce.position,D=Oi(A,ce.offset,s),X=()=>{if(N.direction==="horiz"){if(ae==="left")return"flex-start";if(ae==="center")return"center";if(ae==="right")return"flex-end"}else{if(j==="top")return"flex-start";if(j==="middle")return"center";if(j==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:K,className:ue.thumbsWrapper,onClick:J=>Me(J),style:{position:s?"absolute":"fixed",...D,...N.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:Xe(ue.thumbsContainer,{[ue.thumbsContainerVertical]:N.direction==="vert",[ue.thumbsAlignStart]:ce.align==="start",[ue.thumbsAlignCenter]:ce.align==="center",[ue.thumbsAlignEnd]:ce.align==="end"}),style:{gap:E.scalingValue(ce.grid.gap,s),justifyContent:H?"flex-start":X()},children:n.map((J,ge)=>{const Ce=ge===$,De=_[ge],$e=ce.grid.size*(Ce?ce.activeState.scale:1),Ge=()=>{if(ce.fit!=="fit")return{};if(!De)return N.direction==="horiz"?{height:E.scalingValue($e,s)}:{width:E.scalingValue($e,s)};const pe=De.width/De.height;if(N.direction==="horiz"){const Ee=$e,je=Ee*pe;return{width:E.scalingValue(je,s),height:E.scalingValue(Ee,s)}}else{const Ee=$e,je=Ee/pe;return{width:E.scalingValue(Ee,s),height:E.scalingValue(je,s)}}};return r.jsx("button",{className:ue.thumbItem,style:{...N.direction==="horiz"&&ce.fit!=="fit"?{height:E.scalingValue($e,s)}:{},...N.direction==="vert"&&ce.fit!=="fit"?{width:E.scalingValue($e,s)}:{},...ce.fit==="cover"?{width:E.scalingValue($e,s),height:E.scalingValue($e,s)}:{},...Ge(),transition:Ce?"all 0.25s ease-out":"none",opacity:Ce?ce.activeState.opacity/100:ce.opacity/100,"--thumb-hover":ce.activeState.opacity/100},onClick:pe=>{var Ee;pe.stopPropagation(),w(ge),(Ee=h.current)==null||Ee.go(ge)},onMouseEnter:()=>{var pe;ce.triggers==="hov"&&((pe=h.current)==null||pe.go(ge))},children:r.jsx("img",{src:J.image.url,alt:J.image.name??"",onLoad:pe=>{const Ee=pe.currentTarget;Ee.naturalWidth&&Ee.naturalHeight&&V(je=>({...je,[ge]:{width:Ee.naturalWidth,height:Ee.naturalHeight}}))},style:{objectFit:ce.fit==="cover"?"cover":"contain",...ce.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ce.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${J.image.name}-${ge}`)})})})})()]})]}),document.getElementById(l))};function ul({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Xd={element:Gd,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 Di(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Yd(e){return`
|
|
6
|
+
*/const Vc="RichTextRenderer-module__link___BWeZ2",Kc={link:Vc},Gc=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))},ko=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Gc(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function sn(e){const{color:t,...n}=e;return n}function Pt(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:ko(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:R.scalingValue(e.letterSpacing,t),wordSpacing:R.scalingValue(e.wordSpacing,t),fontSize:R.scalingValue(n,t),lineHeight:i!==void 0?R.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(l=e.textAppearance)==null?void 0:l.textDecoration,fontVariant:(s=e.textAppearance)==null?void 0:s.fontVariant,textAlign:e.textAlign,color:e.color}}const _i=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Kc.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:ko(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 qc="SvgImage-module__svg___q3xE-",Xc="SvgImage-module__img___VsTm-",cl={svg:qc,img:Xc},Yc=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Jc=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,an=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[l,s]=c.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return c.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');s(d)}},[]),!Yc(e)||!l?r.jsx("img",{src:e,alt:"",className:Ye(cl.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:Ye(cl.svg,i),style:{"--svg":Jc(e),"--fill":t,"--hover-fill":n,...o??{}}})},Zc={"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 Qc({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=c.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:a,textAlign:p,wordSpacing:u,fontSizeLineHeight:S,textAppearance:x,color:v}=n.imageCaption??{},[m,y]=c.useState(void 0),[$,w]=c.useState(null),[C,T]=c.useState(0),[P,M]=c.useState(0),{direction:F,transition:b,controls:W,pagination:K,imageCaption:h,triggers:L}=e,E=c.useRef(b.type),{x:k,y:z}=e.controls.offset,le=O=>{o&&o.go(O)};return c.useEffect(()=>{if(!$)return;const O=new ResizeObserver(_=>{if(!o)return;const[q]=_;y({width:Math.round(q.contentRect.width),height:Math.round(q.contentRect.height)})});return O.observe($),()=>O.unobserve($)},[$]),c.useEffect(()=>{!o||E.current===b.type||(M(O=>O+1),E.current=b.type)},[b.type]),r.jsx("div",{className:Ye(be.wrapper,{[be.editor]:i}),ref:w,children:r.jsxs("div",{className:be.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:b.backgroundColor&&b.type==="fade in"?b.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:Ye(be.captionBlock),children:r.jsx("div",{className:be.captionTextWrapper,children:t.map((O,_)=>r.jsx("div",{className:Ye(be.captionText,Zc[h.alignment],{[be.withPointerEvents]:_===C&&i,[be.active]:_===C}),style:{fontFamily:ko(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":R.scalingValue(s.width,i),letterSpacing:R.scalingValue(a,i),wordSpacing:R.scalingValue(u,i),textAlign:p,fontSize:R.scalingValue(S.fontSize,i),lineHeight:R.scalingValue(S.lineHeight,i),textTransform:x.textTransform??"none",textDecoration:x.textDecoration??"none",fontVariant:x.fontVariant??"normal",color:v,transitionDuration:b.duration?`${Math.round(parseInt(b.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:be.captionTextInner,style:{"--link-hover-color":h.linkHoverColor,"--link-color":h.linkColor,position:"relative",top:R.scalingValue(h.offset.y,i),left:R.scalingValue(h.offset.x,i)},children:r.jsx(_i,{content:O.imageCaption})})},_))})}),r.jsx(Hr,{onMove:O=>{T(O.index)},ref:l,options:{arrows:!1,speed:b.duration?parseInt(b.duration):500,autoplay:L.autoPlay!==null,...L.autoPlay!==null&&{interval:parseInt(L.autoPlay)*1e3},direction:F==="horiz"||b.type==="fade in"?"ltr":"ttb",pagination:!1,drag:L.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:b.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((O,_)=>r.jsx(Br,{children:r.jsx("div",{className:be.sliderItem,children:r.jsx("div",{className:be.imgWrapper,children:r.jsx("img",{className:Ye(be.sliderImage,{[be.contain]:O.image.objectFit==="contain",[be.cover]:O.image.objectFit==="cover"}),src:O.image.url,alt:O.image.name??""})})})},_))},P),W.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Ye(be.arrow,{[be.arrowVertical]:F==="vert",[be.hoverArrow]:W.show==="on hover"}),style:{color:W.color,"--arrow-hover-color":W.hover},children:r.jsxs("button",{onClick:()=>{le("-1")},className:be.arrowInner,style:{transform:`translate(${R.scalingValue(k,i)}, ${R.scalingValue(z*(F==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:[W.arrowsImgUrl&&r.jsx(an,{url:W.arrowsImgUrl,fill:W.color,hoverFill:W.hover,className:Ye(be.arrowImg,be.mirror)}),!W.arrowsImgUrl&&r.jsx(dl,{color:W.color,className:Ye(be.arrowIcon,be.arrowImg,be.mirror)})]})}),r.jsx("div",{className:Ye(be.arrow,be.nextArrow,{[be.arrowVertical]:F==="vert",[be.hoverArrow]:W.show==="on hover"}),style:{color:W.color,"--arrow-hover-color":W.hover},children:r.jsxs("button",{className:be.arrowInner,onClick:()=>le("+1"),style:{transform:`translate(${R.scalingValue(k*(F==="horiz"?-1:1),i)}, ${R.scalingValue(z,i)}) scale(${e.controls.scale/100}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:[W.arrowsImgUrl&&r.jsx(an,{url:W.arrowsImgUrl,fill:W.color,hoverFill:W.hover,className:be.arrowImg}),!W.arrowsImgUrl&&r.jsx(dl,{color:W.color,className:Ye(be.arrowIcon,be.arrowImg)})]})})]}),L.triggersList.click&&r.jsx("div",{className:be.clickOverlay,onClick:()=>{o&&o.go("+1")}}),K.isActive&&r.jsx("div",{className:Ye(be.pagination,{[be.paginationInsideBottom]:K.position==="inside-1"&&F==="horiz",[be.paginationInsideTop]:K.position==="inside-2"&&F==="horiz",[be.paginationOutsideBottom]:K.position==="outside-1"&&F==="horiz",[be.paginationOutsideTop]:K.position==="outside-2"&&F==="horiz",[be.paginationInsideLeft]:K.position==="inside-1"&&F==="vert",[be.paginationInsideRight]:K.position==="inside-2"&&F==="vert",[be.paginationOutsideLeft]:K.position==="outside-1"&&F==="vert",[be.paginationOutsideRight]:K.position==="outside-2"&&F==="vert",[be.paginationVertical]:F==="vert"}),children:r.jsx("div",{className:be.paginationInner,style:{backgroundColor:K.colors[2],transform:`scale(${K.scale/100}) translate(${R.scalingValue(K.offset.x,i)}, ${R.scalingValue(K.offset.y,i)}) rotate(${F==="horiz"?"0deg":"90deg"})`},children:t.map((O,_)=>r.jsx("button",{onClick:()=>{o&&o.go(_)},className:Ye(be.paginationItem),children:r.jsx("div",{className:Ye(be.dot,{[be.activeDot]:_===C}),style:{backgroundColor:_===C?K.colors[0]:K.colors[1],"--pagination-hover-color":K.hover}})},_))})})]})})}function dl({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 ed={element:Qc,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"]}},td="ImageRevealSlider-module__imageRevealSlider___UE5Ob",nd="ImageRevealSlider-module__image___Qjt-e",id="ImageRevealSlider-module__link___N-iLG",od="ImageRevealSlider-module__cursor___2U03d",ei={imageRevealSlider:td,image:nd,link:id,cursor:od};function ul(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const l=i.width?Number.parseFloat(i.width):o.naturalWidth,s=o.naturalHeight/o.naturalWidth*l,d=l/2,a=s/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-a&&t<=i.y+a)return!0}return!1}function Vo(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function rd(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await Vo(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await Vo(e);l=s.height/s.width*o}else{const s=await Vo(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function ld({settings:e,content:t,isEditor:n}){const[i,o]=c.useState(null),[l,s]=c.useState([]),[d,a]=c.useState(0),p=c.useRef(0),[u,S]=c.useState({x:0,y:0}),[x,v]=c.useState(1),[m,y]=c.useState("none"),$=c.useRef({x:0,y:0}),[w,C]=c.useState(!1),{sizeType:T,imageWidth:P,randomRangeImageWidth:M}=e.imageSize,{revealPosition:F,visible:b}=e.position,{cursorType:W,target:K,defaultCursorScale:h,defaultCursor:L,hoverCursorScale:E,hoverCursor:k}=e.cursor;c.useEffect(()=>{if(!i)return;const O=(G,H)=>{const X=i.getBoundingClientRect(),ne=G-X.left,se=H-X.top;if(S({x:ne,y:se}),W==="system"){y("none"),v(1);return}const N=ne,de=se,g=document.elementFromPoint(X.left+N,X.top+de);if(g&&g.closest("a")){y("none"),v(1);return}const ie=ul(N,de,l)||K==="area"?{img:k??"none",scale:E}:{img:L??"none",scale:h};y(ie.img),v(ie.scale)},_=G=>{G.stopPropagation(),$.current={x:G.clientX,y:G.clientY},O(G.clientX,G.clientY)},q=()=>{w&&O($.current.x,$.current.y)};return i.addEventListener("mousemove",_),window.addEventListener("scroll",q,!0),()=>{i.removeEventListener("mousemove",_),window.removeEventListener("scroll",q,!0)}},[i,w,u,W,K,k,L,E,h,l]),c.useEffect(()=>{w||(y("none"),v(0))},[w]);const z=async(O,_,q,G={})=>{const{width:H,height:X,finalWidth:ne}=await rd(O.image.url,T,P,M);let se=0,N=0;F==="same"?(se=_/2,N=q/2):(se=G.x??Math.random()*_,N=G.y??Math.random()*q);const de=Math.min(Math.max(se,H/2),_-H/2),g=Math.min(Math.max(N,X/2),q-X/2);return{id:p.current++,url:O.image.url,link:O.link,name:O.image.name,x:de,y:g,width:ne}};c.useEffect(()=>{if(!i||t.length===0)return;const O=i.getBoundingClientRect(),_=O.width,q=O.height,G=[];(async()=>{const X=t[0],ne=await z(X,_,q);G.push(ne),s(G),a(1)})()},[T,P,M,F,i]),c.useEffect(()=>{b==="last One"&&s(O=>O.length>0?[O[O.length-1]]:[])},[b]);const le=async O=>{if(!i)return;const _=i.getBoundingClientRect(),q=O.clientX-_.left,G=O.clientY-_.top;if(K==="image"&&!ul(q,G,l))return;let H=0,X=0;F==="on Click"?(H=q,X=G):F==="same"?(H=_.width/2,X=_.height/2):(H=Math.random()*_.width,X=Math.random()*_.height);const ne=t[d],se=await z(ne,_.width,_.height,{x:H,y:X});s(N=>b==="all"?[...N,se]:[se]),a(N=>N>=t.length-1?0:N+1)};return r.jsxs("div",{ref:o,onClick:le,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:ei.imageRevealSlider,style:{cursor:m==="none"?"default":"none"},children:[l.map(O=>r.jsx("div",{className:ei.wrapper,style:{top:`${O.y}px`,left:`${O.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:O.width??"auto",height:"auto",cursor:m==="none"?"default":"none"},children:K==="area"&&O.link?r.jsx("a",{href:O.link,target:"_blank",className:ei.link,children:r.jsx("img",{src:O.url,alt:O.name,className:ei.image},O.id)}):r.jsx("img",{src:O.url,alt:O.name,className:ei.image},O.id)},O.id)),w&&r.jsx("div",{className:ei.cursor,style:{left:`${u.x}px`,top:`${u.y}px`,transform:`translate(-50%, -50%) scale(${x})`,backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const sd={element:ld,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.cursor.defaultCursor"},{path:"settings.cursor.hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]},schema:{type:"object",properties:{settings:{type:"object",display:{type:"settings-block"},properties:{imageSize:{title:"IMG SIZE",icon:"size",tooltip:"IMG SIZE",type:"object",properties:{sizeType:{type:"string",display:{type:"ratio-group"},enum:["as Is","custom","random"]},imageWidth:{type:"number",label:"W",display:{type:"numeric-input",visible:!1}},randomRangeImageWidth:{type:"object",display:{type:"random-range-controls",visible:!1},properties:{min:{type:"number"},max:{type:"number"}}}}},cursor:{title:"cursor",icon:"cursor",tooltip:"cursor",type:"object",properties:{cursorType:{type:"string",display:{type:"ratio-group"},enum:["system","custom"]},target:{type:"string",title:"Target",display:{type:"ratio-group"},enum:["area","image"]},defaultCursor:{type:["string","null"],title:"Default",display:{type:"settings-image-input",visible:!1}},defaultCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}},hoverCursor:{type:["string","null"],title:"Hover",display:{type:"settings-image-input",visible:!1}},hoverCursorScale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control",visible:!1}}}},position:{title:"position",icon:"transition",tooltip:"Position",type:"object",properties:{revealPosition:{type:"string",display:{type:"ratio-group"},enum:["random","same","on Click"]},visible:{type:"string",title:"Visible",display:{type:"ratio-group"},enum:["all","last One"]}}}},default:{imageSize:{sizeType:"custom",imageWidth:500,randomRangeImageWidth:{min:100,max:1e3}},cursor:{cursorType:"system",target:"area",defaultCursor:null,defaultCursorScale:2,hoverCursor:null,hoverCursorScale:2},position:{revealPosition:"random",visible:"all"}},displayRules:[{if:{name:"imageSize.sizeType",value:"custom"},then:{name:"properties.imageSize.properties.imageWidth.display.visible",value:!0}},{if:{name:"imageSize.sizeType",value:"random"},then:{name:"properties.imageSize.properties.randomRangeImageWidth.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"}],then:{name:"properties.cursor.properties.defaultCursor.display.visible",value:!0}},{if:[{name:"cursor.target",value:"image"},{name:"cursor.cursorType",value:"custom"},{name:"cursor.defaultCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.defaultCursorScale.display.visible",value:!0}},{if:{name:"cursor.cursorType",value:"custom"},then:{name:"properties.cursor.properties.hoverCursor.display.visible",value:!0}},{if:[{name:"cursor.cursorType",value:"custom"},{name:"cursor.hoverCursor",value:null,isNotEqual:!0}],then:{name:"properties.cursor.properties.hoverCursorScale.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"},link:""},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQP84JKRDT7WNWDQZR4Y9.png",name:"Slider-4.png"},link:""}]}}}},ad="LightBox-module__hidden___9s-9x",cd="LightBox-module__heroImage___sTxNF",dd="LightBox-module__background___rm9ml",ud="LightBox-module__editor___4ACaY",pd="LightBox-module__contentStyle___Bgnsq",md="LightBox-module__imageStyle___tLIlB",gd="LightBox-module__imgWrapper___LuFUp",hd="LightBox-module__contain___8-yaS",fd="LightBox-module__cover___hNvOG",yd="LightBox-module__caption___b6L2I",vd="LightBox-module__captionTextInner___rCGNH",xd="LightBox-module__lightboxSplide___XFuWC",bd="LightBox-module__arrow___iz38X",Sd="LightBox-module__arrowVertical___Zfz81",wd="LightBox-module__nextArrow___zkAQN",Cd="LightBox-module__arrowInner___p48sW",Td="LightBox-module__arrowIcon___3VaFf",$d="LightBox-module__arrowImg___pNV88",Ld="LightBox-module__mirror___pjeXc",Ed="LightBox-module__thumbsWrapper___GB-nU",Id="LightBox-module__thumbsContainerVertical___wttk5",Rd="LightBox-module__thumbsContainer___osSma",Md="LightBox-module__thumbsAlignStart___MO6tY",Wd="LightBox-module__thumbsAlignCenter___Q4sUx",_d="LightBox-module__thumbsAlignEnd___p4y9R",Ad="LightBox-module__thumbItem___HvnF3",Pd="LightBox-module__closeButton___g2khP",kd="LightBox-module__fadeIn___0m5GW",Fd="LightBox-module__slideInLeft___gPYwC",Nd="LightBox-module__slideInRight___S-pPp",Hd="LightBox-module__slideInTop___DFdAj",Bd="LightBox-module__slideInBottom___m27kZ",Od="LightBox-module__fadeOut___55qBR",Dd="LightBox-module__slideOutLeft___NvU7P",jd="LightBox-module__slideOutRight___SK7eC",zd="LightBox-module__slideOutTop___Vgg0z",Vd="LightBox-module__slideOutBottom___nJ0Ef",Kd="LightBox-module__scaleSlide___vZriG",ue={hidden:ad,heroImage:cd,background:dd,editor:ud,contentStyle:pd,imageStyle:md,imgWrapper:gd,contain:hd,cover:fd,caption:yd,captionTextInner:vd,lightboxSplide:xd,arrow:bd,arrowVertical:Sd,nextArrow:wd,arrowInner:Cd,arrowIcon:Td,arrowImg:$d,mirror:Ld,thumbsWrapper:Ed,thumbsContainerVertical:Id,thumbsContainer:Rd,thumbsAlignStart:Md,thumbsAlignCenter:Wd,thumbsAlignEnd:_d,thumbItem:Ad,closeButton:Pd,fadeIn:kd,slideInLeft:Fd,slideInRight:Nd,slideInTop:Hd,slideInBottom:Bd,fadeOut:Od,slideOutLeft:Dd,slideOutRight:jd,slideOutTop:zd,slideOutBottom:Vd,scaleSlide:Kd},qi=(e,t,n)=>{const i={},[o,l]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),l==="left"?(i.left="0",i.right="auto"):l==="center"?(i.left="50%",i.right="auto"):l==="right"&&(i.left="auto",i.right="0"),o==="middle"&&l==="center"?i.transform=`translate(calc(-50% + ${R.scalingValue(t.x,n)}), calc(-50% + ${R.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${R.scalingValue(t.x,n)}, calc(-50% + ${R.scalingValue(t.y,n)}))`:l==="center"?i.transform=`translate(calc(-50% + ${R.scalingValue(t.x,n)}), ${R.scalingValue(t.y,n)})`:i.transform=`translate(${R.scalingValue(t.x,n)}, ${R.scalingValue(t.y,n)})`,i};function Ms(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 pl(e){const t=e.getBoundingClientRect(),n=Ms(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,s=e.naturalHeight,d=i/o,a=l/s;let p,u;a>d?(p=i,u=i/a):(u=o,p=o*a);const S=t.left+n.left,x=t.top+n.top,v=(i-p)/2+S,m=(o-u)/2+x;return{x:v,y:m,width:p,height:u}}function ml(e){const t=e.getBoundingClientRect(),n=Ms(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function gl(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 Gd(e,t){const n=(()=>{if(e==="fade in")return ue.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return ue.slideInLeft;case"right":return ue.slideInRight;case"top":return ue.slideInTop;case"bottom":return ue.slideInBottom;default:return ue.slideInRight}return ue.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return ue.fadeIn;if(e==="slide in")switch(t){case"left":return ue.slideInLeft;case"right":return ue.slideInRight;case"top":return ue.slideInTop;case"bottom":return ue.slideInBottom;default:return ue.slideInRight}return ue.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return ue.fadeOut;if(e==="slide in")switch(t){case"left":return ue.slideOutLeft;case"right":return ue.slideOutRight;case"top":return ue.slideOutTop;case"bottom":return ue.slideOutBottom;default:return ue.slideOutRight}return ue.fadeOut})(),l=(()=>{if(e==="fade in")return ue.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return ue.slideOutLeft;case"right":return ue.slideOutRight;case"top":return ue.slideOutTop;case"bottom":return ue.slideOutBottom;default:return ue.slideOutRight}return ue.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const Ud=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:l,isPreviewMode:s})=>{const[d,a]=c.useState(!1),{url:p}=e.thumbnailBlock.cover;return c.useEffect(()=>{o==="close"&&a(!1),o==="open"&&a(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:p,alt:"Cover",className:ue.heroImage,onClick:()=>a(!0)}),r.jsx(qd,{isOpen:d,onClose:()=>a(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},qd=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:d})=>{var xe;const{widthSettings:a,fontSettings:p,letterSpacing:u,textAlign:S,wordSpacing:x,fontSizeLineHeight:v,textAppearance:m,color:y}=i.imageCaption??{},[$,w]=c.useState(0),[C,T]=c.useState(0),[P,M]=c.useState(!1),[F,b]=c.useState(!1),[W,K]=c.useState({}),h=c.useRef(null),L=c.useRef(null),E=c.useRef(null),k=c.useRef(!1),z=c.useRef(null),le=c.useRef(null),O=c.useRef(null),_=c.useRef(null),q=c.useRef(!1),G=c.useRef(null),[H,X]=c.useState(!1),{appear:ne,triggers:se,slider:N,thumbnail:de,controls:g,area:ie,caption:fe,layout:oe}=o.lightboxBlock,{appearClass:Ce,backdropAppearClass:me,backdropDisappearClass:re,disappearClass:B}=Gd(ne.type,ne.direction),Q=(d==null?void 0:d.itemId)??null;c.useEffect(()=>{const j=()=>{setTimeout(()=>{var A,D;(D=(A=h.current)==null?void 0:A.splide)==null||D.refresh()},16)},ae=()=>{T(A=>A+1)};return window.addEventListener("ArticleEditor.Layout:change",j),window.addEventListener("ArticleEditor.ComponentContent:change",ae),()=>{window.removeEventListener("ArticleEditor.Layout:change",j),window.removeEventListener("ArticleEditor.ComponentContent:change",ae)}},[]),c.useEffect(()=>{if(!e||!de.isActive){X(!1);return}const j=G.current;if(!j)return;const ae=()=>{N.direction==="horiz"?X(j.scrollWidth>j.clientWidth):X(j.scrollHeight>j.clientHeight)};ae();const A=new ResizeObserver(ae);return A.observe(j),()=>A.disconnect()},[e,de.isActive,n.length,W,N.direction]);const U=c.useCallback(()=>{const j=window.matchMedia("(max-width: 768px)").matches,ae=gl(ie.color);j&&!s&&ae>.9&&(document.body.style.backgroundColor=""),M(!0),k.current=!0;const A=D=>{D.target===z.current&&D.animationName&&(z.current&&le.current&&z.current.removeEventListener("animationend",le.current),le.current=null,k.current&&(k.current=!1,t()),M(!1))};z.current&&(le.current=A,z.current.addEventListener("animationend",A))},[t,ie.color,s]),J=(j,ae,A)=>{var D,Y;if(j){if(se.type==="click"&&se.switch==="image")se.repeat==="close"&&$===n.length-1?U():(D=h.current)==null||D.go("+1");else if(se.type==="click"&&se.switch==="50/50"){const Z=j.getBoundingClientRect(),ge=ae-Z.left,Te=A-Z.top,je=Z.width,_e=Z.height;let Le;N.direction==="horiz"?Le=ge<je/2?"-1":"+1":Le=Te<_e/2?"-1":"+1",(Y=h.current)==null||Y.go(Le)}}},Me=j=>{if(q.current){q.current=!1;return}const ae=n[$],A=(ae==null?void 0:ae.image.objectFit)==="cover";let D,Y;if("changedTouches"in j&&j.changedTouches.length>0)D=j.changedTouches[0].clientX,Y=j.changedTouches[0].clientY;else if("clientX"in j)D=j.clientX,Y=j.clientY;else return;let Z;if(A&&E.current){const ge=ml(E.current);Z=D>=ge.left&&D<=ge.right&&Y>=ge.top&&Y<=ge.bottom}else{const ge=E.current?pl(E.current):null;if(!ge){j.target===j.currentTarget&&U();return}Z=D>=ge.x&&D<=ge.x+ge.width&&Y>=ge.y&&Y<=ge.y+ge.height}Z?J(E.current,D,Y):U()},Ae=j=>{const ae=j.target;(ae.classList.contains(ue.thumbsWrapper)||ae.classList.contains(ue.thumbsContainer))&&Me(j)};c.useEffect(()=>{if(!e)return;const j=ae=>{var A,D;if(ae.key==="Escape"){U();return}if(ae.key==="ArrowRight"){w(Y=>(Y+1)%Math.max(n.length,1)),(A=h.current)==null||A.go("+1");return}ae.key==="ArrowLeft"&&(w(Y=>(Y-1+Math.max(n.length,1))%Math.max(n.length,1)),(D=h.current)==null||D.go("-1"))};return window.addEventListener("keydown",j),()=>{window.removeEventListener("keydown",j)}},[e,U,n.length]),c.useEffect(()=>{if(e){if(w(0),T(ae=>ae+1),k.current=!1,M(!1),b(!1),K({}),!Q)return;const j=new CustomEvent("page-overlay",{detail:{itemId:Q}});window.dispatchEvent(j)}return()=>{z.current&&le.current&&(z.current.removeEventListener("animationend",le.current),le.current=null),b(!1)}},[e,Q]),c.useEffect(()=>{L.current!==null&&L.current!==N.type&&T(j=>j+1),L.current=N.type},[N.type]),c.useEffect(()=>{if(!e)return;const j=document.body.style.overflow,ae=window.matchMedia("(max-width: 768px)").matches,A=gl(ie.color);document.body.style.overflow="hidden",b(!1);const D=Z=>{Z.target===z.current&&!k.current&&Z.animationName&&(ae&&!s&&A>.9&&(document.body.style.backgroundColor=ie.color),b(!0),z.current&&O.current&&z.current.removeEventListener("animationend",O.current),O.current=null)};z.current&&(O.current=D,z.current.addEventListener("animationend",D));const Y=Z=>{const ge=Z.target;ge&&(ge.closest(`.${ue.thumbsWrapper}`)||ge.closest(`.${ue.thumbsContainer}`))||N.type!=="slide"&&Z.preventDefault()};return document.addEventListener("touchmove",Y,{passive:!1}),()=>{document.body.style.overflow=j,document.removeEventListener("touchmove",Y),z.current&&O.current&&(z.current.removeEventListener("animationend",O.current),O.current=null),b(!1)}},[e,s,ie.color,N.type]),c.useEffect(()=>{if(!e)return;const j=ae=>{var D,Y;if(k.current){ae.stopPropagation();return}if(q.current){q.current=!1;return}const A=ae.target;if(!(A&&(A.closest(`.${ue.thumbsContainer}`)||A.closest(`.${ue.thumbItem}`)||A.closest(`.${ue.arrow}`)||A.closest(`.${ue.closeButton}`)||A.closest(`.${ue.caption}`)))){if(N.type==="slide"&&se.type==="drag"&&((Y=(D=h.current)==null?void 0:D.splide)!=null&&Y.root)){const Z=h.current.splide.root;if(A&&(Z.contains(A)||Z===A))return}if(ae.touches.length===0&&ae.changedTouches.length>0){const Z=n[$],ge=(Z==null?void 0:Z.image.objectFit)==="cover",Te=ae.changedTouches[0];let je;if(ge&&E.current){const _e=ml(E.current);je=Te.clientX>=_e.left&&Te.clientX<=_e.right&&Te.clientY>=_e.top&&Te.clientY<=_e.bottom}else{const _e=E.current?pl(E.current):null;if(!_e)return;je=Te.clientX>=_e.x&&Te.clientX<=_e.x+_e.width&&Te.clientY>=_e.y&&Te.clientY<=_e.y+_e.height}if(!je){ae.stopPropagation(),k.current=!0;const _e=Le=>{Le.stopPropagation(),Le.preventDefault(),document.removeEventListener("click",_e,!0)};document.addEventListener("click",_e,!0),U()}}}};return document.addEventListener("touchend",j,{passive:!0}),()=>{document.removeEventListener("touchend",j)}},[e,U,$,n]);const ke=(N.type==="scale"||N.type==="fade")&&N.direction==="vert"&&se.type==="drag";c.useEffect(()=>{var Le,Ge;if(!e||!ke||!((Ge=(Le=h.current)==null?void 0:Le.splide)!=null&&Ge.root))return;const j=h.current.splide.root,ae=30,A=(pe,We)=>{if(_.current){const ze=Math.abs(pe-_.current.x),Ve=Math.abs(We-_.current.y);(ze>0||Ve>0)&&(q.current=!0)}},D=pe=>{_.current&&(pe.preventDefault(),A(pe.clientX,pe.clientY))},Y=pe=>{_.current&&pe.touches.length>0&&(pe.preventDefault(),A(pe.touches[0].clientX,pe.touches[0].clientY))},Z=(pe,We)=>{if(!_.current||!h.current){_.current=null;return}const ze=Math.abs(pe-_.current.x),Ve=Math.abs(We-_.current.y);Ve>ae&&Ve>ze&&h.current.go(We<_.current.y?"+1":"-1"),_.current=null},ge=pe=>{_.current&&Z(pe.clientX,pe.clientY),document.removeEventListener("pointerup",ge),document.removeEventListener("pointercancel",ge),document.removeEventListener("pointermove",D)},Te=pe=>{if(_.current){if(pe.changedTouches.length>0){const We=pe.changedTouches[0];Z(We.clientX,We.clientY)}document.removeEventListener("touchend",Te),document.removeEventListener("touchcancel",Te),document.removeEventListener("touchmove",Y)}},je=pe=>{_.current={x:pe.clientX,y:pe.clientY},q.current=!1,document.addEventListener("pointermove",D,{passive:!1}),document.addEventListener("pointerup",ge),document.addEventListener("pointercancel",ge)},_e=pe=>{pe.touches.length>0&&(_.current={x:pe.touches[0].clientX,y:pe.touches[0].clientY},q.current=!1,document.addEventListener("touchmove",Y,{passive:!1}),document.addEventListener("touchend",Te),document.addEventListener("touchcancel",Te))};return j.addEventListener("pointerdown",je),j.addEventListener("touchstart",_e),()=>{j.removeEventListener("pointerdown",je),j.removeEventListener("touchstart",_e),document.removeEventListener("pointermove",D),document.removeEventListener("pointerup",ge),document.removeEventListener("pointercancel",ge),document.removeEventListener("touchmove",Y),document.removeEventListener("touchend",Te),document.removeEventListener("touchcancel",Te),_.current=null,q.current=!1}},[e,ke,C]);const Fe={backgroundColor:ie.color,backdropFilter:`blur(${ie.blur}px)`,animationDuration:`${parseInt(ne.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:Fi.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:z,className:Ye(ue.background,P?re:me,{[ue.editor]:s},{[ue.hidden]:!e}),style:{...Fe,...F&&!s&&!P?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?z:null,className:Ye(ue.contentStyle,P?B:Ce,{[ue.editor]:s},{[ue.hidden]:!e}),style:{animationDuration:`${parseInt(ne.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Hr,{onMove:j=>w(j.index),ref:h,className:ue.lightboxSplide,options:{arrows:!1,speed:N.duration?parseInt(N.duration):500,direction:N.direction==="horiz"||N.type==="fade"||N.type==="scale"?"ltr":"ttb",pagination:!1,drag:se.type==="drag"&&!ke,perPage:1,width:"100%",height:"100%",type:N.type==="fade"||N.type==="scale"?"fade":"loop",padding:0,rewind:se.repeat!=="close",start:0},style:{"--splide-speed":N.duration},children:n.map((j,ae)=>{const A=qi(oe.position,oe.offset,s),D=`${R.scalingValue(oe.padding.top,s)} ${R.scalingValue(oe.padding.right,s)} ${R.scalingValue(oe.padding.bottom,s)} ${R.scalingValue(oe.padding.left,s)}`,Y=N.type==="scale"?(()=>{const{transform:Z,...ge}=A;return{...ge,position:"absolute",padding:D,boxSizing:"border-box","--position-transform":Z||"none"}})():{...A,position:"absolute",padding:D,boxSizing:"border-box"};return r.jsx(Br,{children:r.jsx("div",{className:ue.imgWrapper,onClick:Me,children:r.jsx("img",{ref:ae===$?E:null,className:Ye(ue.imageStyle,{[ue.contain]:j.image.objectFit==="contain",[ue.cover]:j.image.objectFit==="cover",[ue.scaleSlide]:N.type==="scale"}),src:j.image.url,alt:j.image.name??"",style:{...Y,pointerEvents:j.image.objectFit==="contain"?"none":"auto"}})})},ae)})},C),g.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Ye(ue.arrow,{[ue.arrowVertical]:N.direction==="vert"}),style:{color:g.color,"--arrow-hover-color":g.hover},children:r.jsxs("button",{className:ue.arrowInner,style:{transform:`translate(${R.scalingValue(g.offset.x,s)}, ${R.scalingValue(g.offset.y*(N.direction==="horiz"?1:-1),s)}) scale(${g.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=h.current)==null?void 0:j.go("-1")},"aria-label":"Previous",children:[g.arrowsImgUrl&&r.jsx(an,{url:g.arrowsImgUrl,fill:g.color,hoverFill:g.hover,className:Ye(ue.arrowImg,ue.mirror)}),!g.arrowsImgUrl&&r.jsx(hl,{color:g.color,className:Ye(ue.arrowIcon,ue.arrowImg,ue.mirror)})]})}),r.jsx("div",{className:Ye(ue.arrow,ue.nextArrow,{[ue.arrowVertical]:N.direction==="vert"}),style:{color:g.color,"--arrow-hover-color":g.hover},children:r.jsxs("button",{className:ue.arrowInner,style:{transform:`translate(${R.scalingValue(g.offset.x*(N.direction==="horiz"?-1:1),s)}, ${R.scalingValue(g.offset.y,s)}) scale(${g.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=h.current)==null?void 0:j.go("+1")},"aria-label":"Next",children:[g.arrowsImgUrl&&r.jsx(an,{url:g.arrowsImgUrl,fill:g.color,hoverFill:g.hover,className:ue.arrowImg}),!g.arrowsImgUrl&&r.jsx(hl,{color:g.color,className:Ye(ue.arrowIcon,ue.arrowImg)})]})})]}),ie.closeIconUrl&&(()=>{const j=qi(ie.closeIconAlign,ie.closeIconOffset,s),ae=`scale(${ie.closeIconScale})`,A=j.transform?`${j.transform} ${ae}`:ae;return r.jsx("button",{className:ue.closeButton,style:{...j,transform:A},onClick:U,"aria-label":"Close lightbox",children:r.jsx(an,{url:ie.closeIconUrl,fill:ie.closeIconColor??"#000000",hoverFill:ie.closeIconHover??"#cccccc"})})})(),fe&&fe.isActive&&i.imageCaption&&((xe=n[$])==null?void 0:xe.imageCaption)&&r.jsx("div",{className:ue.caption,style:{...qi(fe.alignment,fe.offset,s),fontFamily:ko(p.fontFamily),fontWeight:p.fontWeight,fontStyle:p.fontStyle,width:a.sizing==="auto"?"max-content":R.scalingValue(a.width,s),letterSpacing:R.scalingValue(u,s),wordSpacing:R.scalingValue(x,s),textAlign:S,fontSize:R.scalingValue(v.fontSize,s),lineHeight:R.scalingValue(v.lineHeight,s),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:y},onClick:j=>j.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:ue.captionTextInner,style:{"--link-color":fe.linkColor,"--link-hover-color":fe.linkHoverColor},children:r.jsx(_i,{content:n[$].imageCaption})})}),de.isActive&&(()=>{const[j,ae]=de.position.split("-"),A=N.direction==="horiz"?`${j}-left`:de.position,D=qi(A,de.offset,s),Y=()=>{if(N.direction==="horiz"){if(ae==="left")return"flex-start";if(ae==="center")return"center";if(ae==="right")return"flex-end"}else{if(j==="top")return"flex-start";if(j==="middle")return"center";if(j==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:G,className:ue.thumbsWrapper,onClick:Z=>Ae(Z),style:{position:s?"absolute":"fixed",...D,...N.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:Ye(ue.thumbsContainer,{[ue.thumbsContainerVertical]:N.direction==="vert",[ue.thumbsAlignStart]:de.align==="start",[ue.thumbsAlignCenter]:de.align==="center",[ue.thumbsAlignEnd]:de.align==="end"}),style:{gap:R.scalingValue(de.grid.gap,s),justifyContent:H?"flex-start":Y()},children:n.map((Z,ge)=>{const Te=ge===$,je=W[ge],Le=de.grid.size*(Te?de.activeState.scale:1),Ge=()=>{if(de.fit!=="fit")return{};if(!je)return N.direction==="horiz"?{height:R.scalingValue(Le,s)}:{width:R.scalingValue(Le,s)};const pe=je.width/je.height;if(N.direction==="horiz"){const We=Le,ze=We*pe;return{width:R.scalingValue(ze,s),height:R.scalingValue(We,s)}}else{const We=Le,ze=We/pe;return{width:R.scalingValue(We,s),height:R.scalingValue(ze,s)}}};return r.jsx("button",{className:ue.thumbItem,style:{...N.direction==="horiz"&&de.fit!=="fit"?{height:R.scalingValue(Le,s)}:{},...N.direction==="vert"&&de.fit!=="fit"?{width:R.scalingValue(Le,s)}:{},...de.fit==="cover"?{width:R.scalingValue(Le,s),height:R.scalingValue(Le,s)}:{},...Ge(),transition:Te?"all 0.25s ease-out":"none",opacity:Te?de.activeState.opacity/100:de.opacity/100,"--thumb-hover":de.activeState.opacity/100},onClick:pe=>{var We;pe.stopPropagation(),w(ge),(We=h.current)==null||We.go(ge)},onMouseEnter:()=>{var pe;de.triggers==="hov"&&((pe=h.current)==null||pe.go(ge))},children:r.jsx("img",{src:Z.image.url,alt:Z.image.name??"",onLoad:pe=>{const We=pe.currentTarget;We.naturalWidth&&We.naturalHeight&&K(ze=>({...ze,[ge]:{width:We.naturalWidth,height:We.naturalHeight}}))},style:{objectFit:de.fit==="cover"?"cover":"contain",...de.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...de.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Z.image.name}-${ge}`)})})})})()]})]}),document.getElementById(l))};function hl({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Xd={element: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 Xi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Yd(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: ${Xi(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: ${Xi(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: ${Xi(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: ${Xi(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 Jd({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:l}){const s=!!n,d=i&&t||!t,{prefix:a}=
|
|
158
|
+
`}function Jd({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:l}){const s=!!n,d=i&&t||!t,{prefix:a}=R.useScopedStyles(),{type:p="A",fieldsToShow:u=2,fields:S=[],buttonLabel:x,gap:v,fieldsGap:m,buttonCorners:y,buttonStroke:$,buttonPadding:w,isButtonFullWidth:C,inputCorners:T,inputStroke:P,inputPadding:M,inputColor:F,inputTextColor:b,inputBorderColor:W,placeholderColor:K,buttonColor:h,buttonTextColor:L,buttonBorderColor:E,labelTextColor:k,successColor:z,errorColor:le,fontFamily:O,inputFontSettings:_,inputFontSize:q,inputLineHeight:G,inputLetterSpacing:H,inputWordSpacing:X,inputTextAppearance:ne,buttonFontSettings:se,buttonFontSize:N,buttonLineHeight:de,buttonLetterSpacing:g,buttonWordSpacing:ie,buttonTextAppearance:fe,labelFontSettings:oe,labelFontSize:Ce,labelLineHeight:me,labelLetterSpacing:re,labelWordSpacing:B,labelTextAppearance:Q,statusFontSettings:U,statusFontSize:J,statusLineHeight:Me,statusLetterSpacing:Ae,statusWordSpacing:ke,statusTextAppearance:Fe,successMessage:xe,errorMessage:j,stateOverrides:ae}=e,A=p==="B",D=S.slice(0,Math.min(u,S.length)),Y={fontSettings:{fontFamily:O,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:q??.01,lineHeight:G,letterSpacing:H??0,wordSpacing:X??0,textAppearance:ne,color:b},Z=sn(Pt(Y,t)),ge=R.scalingValue(P??0,t),Te=R.scalingValue((G??q??.01)+((M==null?void 0:M.top)??0)+((M==null?void 0:M.bottom)??0)+(p==="C"?P??0:(P??0)*2),t),je={...Z,borderStyle:"solid",borderRadius:p==="C"?0:R.scalingValue(T??0,t),...p==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:ge,borderLeftWidth:0}:{borderWidth:ge},paddingTop:R.scalingValue((M==null?void 0:M.top)??0,t),paddingRight:R.scalingValue((M==null?void 0:M.right)??0,t),paddingBottom:R.scalingValue((M==null?void 0:M.bottom)??0,t),paddingLeft:R.scalingValue((M==null?void 0:M.left)??0,t),height:Te,minHeight:Te},_e={fontSettings:{fontFamily:O,fontWeight:(se==null?void 0:se.fontWeight)??400,fontStyle:(se==null?void 0:se.fontStyle)??"normal"},fontSize:N??.01,lineHeight:de,letterSpacing:g??0,wordSpacing:ie??0,textAppearance:fe,color:L},Le=sn(Pt(_e,t)),Ge=R.scalingValue($??0,t),pe={fontSettings:{fontFamily:O,fontWeight:(oe==null?void 0:oe.fontWeight)??400,fontStyle:(oe==null?void 0:oe.fontStyle)??"normal"},fontSize:Ce??.01,lineHeight:me,letterSpacing:re??0,wordSpacing:B??0,textAppearance:Q,color:k},We=Pt(pe,t),ze={fontSettings:{fontFamily:O,fontWeight:(U==null?void 0:U.fontWeight)??400,fontStyle:(U==null?void 0:U.fontStyle)??"normal"},fontSize:J??.01,lineHeight:Me,letterSpacing:Ae??0,wordSpacing:ke??0,textAppearance:Fe,color:z},Ve=sn(Pt(ze,t)),Ne=R.buildColorVars(a,{inputColor:F,inputTextColor:b,inputBorderColor:W,placeholderColor:K!=null&&K.trim()?K:"#cccccc",buttonColor:h,buttonTextColor:L,buttonBorderColor:E,labelTextColor:k,successColor:z,errorColor:le},Zd,Qd,ae),[It,dt]=c.useState(()=>Object.fromEntries(D.map(He=>[He.name,""]))),[bt,Ze]=c.useState("idle"),[yt,Mt]=c.useState(null),Ht=l==="success"?"success":l==="error"?"error":bt,Ee=l==="error"?j:yt,it=l==="filled",Ue=c.useMemo(()=>{if(!it)return It;let He=null;for(const Tt of D)(It[Tt.name]??"").trim().length>0||(He=He??{...It},He[Tt.name]="Filled");return He??It},[It,it,D]),ut=Ht==="error"?R.getFormFieldValidationError(D,Ue):null,rn=`${l&&l!=="default"?`${a}-state-${l}`:""}`.trim(),jt=o==null?void 0:o.submitUrl,Yt=(He,Tt)=>{dt(pt=>({...pt,[He]:Tt}))},ln=async He=>{if(He.preventDefault(),!d)return;const Tt=Object.fromEntries(D.map(et=>{var mt;return[et.name,((mt=It[et.name])==null?void 0:mt.trim())??""]}).filter(([,et])=>et));if(!jt){Ze("error"),Mt("No integrations were found for this form.");return}if(Object.keys(Tt).length===0)return;const pt=R.getFormFieldValidationError(D,It);if(pt){Ze("error"),Mt(pt);return}Ze("submitting"),Mt(null);try{const et=await fetch(jt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Tt)});if(!et.ok){const mt=await et.text();throw new Error(mt||`Request failed: ${et.status}`)}Ze("success"),dt(Object.fromEntries(D.map(mt=>[mt.name,""])))}catch(et){Ze("error"),Mt(et instanceof Error?et.message:"Something went wrong")}};return r.jsxs("div",{className:`${a}-wrapper ${a}-type-${p} ${rn}`.trim(),style:Ne,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Yd(a)}}),r.jsxs("form",{onSubmit:ln,className:`${a}-form`,children:[r.jsx("div",{className:`${a}-fields`,children:D.map((He,Tt)=>r.jsxs(c.Fragment,{children:[Tt>0&&r.jsx("div",{"data-controls":s?"fieldsGap":void 0,className:s?`${a}-control`:void 0,style:{height:R.scalingValue(m??0,t)}}),r.jsxs("div",{className:`${a}-field-group${A?` ${a}-labeled`:""}`,children:[A&&r.jsx("span",{className:`${a}-field-label`,style:We?{...We,lineHeight:We.fontSize}:void 0,children:He.label||He.name}),He.type==="textarea"?r.jsx("textarea",{name:He.name,autoComplete:"off",value:Ue[He.name]??"",onChange:pt=>Yt(He.name,pt.target.value),placeholder:He.placeholder,className:`${a}-input`,style:je,rows:1,"data-filled":it||(Ue[He.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:He.type==="phone"?"tel":He.type==="email"?"email":"text",name:He.name,autoComplete:"off",value:Ue[He.name]??"",onChange:pt=>Yt(He.name,pt.target.value),placeholder:He.placeholder,required:He.isRequired??He.type==="email",className:`${a}-input`,style:je,"data-filled":it||(Ue[He.name]??"").trim().length>0})]})]},Tt))}),r.jsx("div",{"data-controls":s?"gap":void 0,className:s?`${a}-control`:void 0,style:{height:R.scalingValue(v??0,t)}}),r.jsx("div",{className:`${a}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${a}-button`,style:{borderStyle:"solid",borderRadius:R.scalingValue(y??0,t),borderWidth:Ge,paddingTop:R.scalingValue((w==null?void 0:w.top)??0,t),paddingRight:R.scalingValue((w==null?void 0:w.right)??0,t),paddingBottom:R.scalingValue((w==null?void 0:w.bottom)??0,t),paddingLeft:R.scalingValue((w==null?void 0:w.left)??0,t),pointerEvents:d?"auto":void 0,...Le,...C?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${a}-overlay-anchor`,style:C?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:bt==="submitting"?"...":x})})})]}),Ht==="success"&&r.jsx("p",{className:`${a}-success`,style:{...Ve},children:xe}),Ht==="error"&&r.jsx("p",{className:`${a}-error`,style:{...Ve},role:"alert",children:ut??Ee??j})]})}const Zd={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"},Qd=["hover","focus","filled","success","error"],eu=`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
|
-
`,tu=[{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"}],ji={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},nu=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],iu={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:{...ji.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:{...ji.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:{...ji.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:{...ji.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:tu,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:[...nu],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"]},ou={element:Jd,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:iu,sourceCode:eu};function zi(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ru(e){return`
|
|
792
|
+
`,tu=[{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"}],Yi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},nu=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],iu={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:{...Yi.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:{...Yi.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:{...Yi.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:{...Yi.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:tu,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:[...nu],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"]},ou={element:Jd,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:iu,sourceCode:eu};function Ji(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ru(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: ${Ji(8)};
|
|
975
|
+
font-size: ${Ji(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: ${Ji(8)};
|
|
980
|
+
font-size: ${Ji(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const lu=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:l}=
|
|
983
|
+
`}const lu=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:l}=R.useScopedStyles(),s=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:a,buttonLabel:p,fieldsToShow:u=1,fontFamily:S,inputFontSettings:x,inputFontSize:v,inputLineHeight:m,inputLetterSpacing:y,inputWordSpacing:$,inputTextAppearance:w,buttonFontSettings:C,buttonFontSize:T,buttonLineHeight:P,buttonLetterSpacing:M,buttonWordSpacing:F,buttonTextAppearance:b,statusFontSettings:W,statusFontSize:K,statusLineHeight:h,statusLetterSpacing:L,statusWordSpacing:E,statusTextAppearance:k,iconMaxWidth:z,minHeight:le,corners:O,stroke:_,stateOverrides:q,inputPadding:G,buttonPadding:H,successMessage:X="Thanks for subscribing!",errorMessage:ne="Please, fill all required fields."}=e,se=d.slice(0,Math.min(u,d.length)),[N,de]=c.useState(()=>Object.fromEntries(se.map(pe=>[pe.name,""]))),[g,ie]=c.useState("idle"),[fe,oe]=c.useState(null),Ce=o==="success"?"success":o==="error"?"error":g,me=o==="error"?ne:fe,re=o==="filled",B=c.useMemo(()=>{if(!re)return N;let pe=null;for(const We of se)(N[We.name]??"").trim().length>0||(pe=pe??{...N},pe[We.name]="Filled");return pe??N},[re,N,se]),Q=Ce==="error"?R.getFormFieldValidationError(se,B):null,U=o&&o!=="default"?`${l}-state-${o}`:"",J=se.some(pe=>(B[pe.name]??"").trim().length>0),Me=U!==`${l}-state-filled`&&J?`${l}-state-filled`:"",Ae=`${U} ${Me}`.trim(),ke=i==null?void 0:i.submitUrl,Fe=p??"",xe=(a==null?void 0:a.icon)??"",j=(a==null?void 0:a.mode)==="On",ae=Fe||"Submit",A={fontSettings:{fontFamily:S,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:v??.01,lineHeight:m,letterSpacing:y??0,wordSpacing:$??0,textAppearance:w,color:e.inputTextColor??"#111111"},D={fontSettings:{fontFamily:S,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:T??.01,lineHeight:P,letterSpacing:M??0,wordSpacing:F??0,textAppearance:b,color:e.buttonTextColor??"#ffffff"},Y={fontSettings:{fontFamily:S,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:K??.01,lineHeight:h,letterSpacing:L??0,wordSpacing:E??0,textAppearance:k,color:e.successColor??"#22c55e"},Z=sn(Pt(A,t)),ge=sn(Pt(D,t)),Te=sn(Pt(Y,t)),je=R.buildColorVars(l,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(A==null?void 0:A.color)??"#111111",buttonTextColor:e.buttonTextColor??(D==null?void 0:D.color)??"#ffffff"},su,au,q),_e={borderRadius:R.scalingValue(O,t),borderWidth:R.scalingValue(_,t),borderStyle:"solid"},Le={borderLeftWidth:R.scalingValue(_,t)},Ge=async pe=>{if(pe.preventDefault(),!s)return;const We=Object.fromEntries(se.map(Ve=>{var Ne;return[Ve.name,((Ne=N[Ve.name])==null?void 0:Ne.trim())??""]}).filter(([,Ve])=>Ve));if(!ke){ie("error"),oe("No integrations were found for this form.");return}if(Object.keys(We).length===0)return;const ze=R.getFormFieldValidationError(se,N);if(ze){ie("error"),oe(ze);return}ie("submitting"),oe(null);try{const Ve=await fetch(ke,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(We)});if(!Ve.ok){const Ne=await Ve.text();throw new Error(Ne||`Request failed: ${Ve.status}`)}ie("success"),de(Object.fromEntries(se.map(Ne=>[Ne.name,""])))}catch(Ve){ie("error"),oe(Ve instanceof Error?Ve.message:"Something went wrong")}};return r.jsxs("div",{className:`${l}-wrapper ${Ae}`.trim(),style:je,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ru(l)}}),r.jsxs("form",{onSubmit:Ge,className:`${l}-form`,style:{..._e,height:R.scalingValue(le,t),minHeight:R.scalingValue(le,t)},children:[r.jsx("div",{className:`${l}-inputWrap ${l}-overlayAnchor`,style:{flex:1,minWidth:0},children:se.map(pe=>r.jsx("input",{type:pe.type==="email"?"email":pe.type==="phone"?"tel":"text",name:pe.name,autoComplete:"off",value:B[pe.name]??"",onChange:We=>de(ze=>({...ze,[pe.name]:We.target.value})),placeholder:pe.placeholder,required:pe.isRequired??pe.type==="email",className:`${l}-input`,style:{...Z,paddingRight:R.scalingValue(G.right,t),paddingLeft:R.scalingValue(G.left,t),paddingTop:R.scalingValue(G.top,t),paddingBottom:R.scalingValue(G.bottom,t)}},pe.name))}),r.jsx("div",{className:`${l}-overlayAnchor`,children:r.jsx("button",{type:s?"submit":"button",className:`${l}-submitBtn`,"aria-label":ae,style:{...ge,...Le,paddingRight:R.scalingValue(H.right,t),paddingLeft:R.scalingValue(H.left,t),paddingTop:R.scalingValue(H.top,t),paddingBottom:R.scalingValue(H.bottom,t),pointerEvents:s?"auto":void 0},children:g==="submitting"?"...":j?xe&&r.jsx(an,{url:xe,className:`${l}-submitBtnIcon`,style:{maxWidth:R.scalingValue(z??0,t)},fill:`var(--${l}-button-text-color)`,hoverFill:`var(--${l}-button-text-color)`}):Fe})})]}),Ce==="success"&&r.jsx("p",{className:`${l}-success`,style:{...Te},children:X}),Ce==="error"&&r.jsx("p",{className:`${l}-error`,style:{...Te},role:"alert",children:Q??me??ne})]})},su={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"},au=["hover","focus","filled","success","error"],cu=`import React, { useMemo, useState } from 'react';
|
|
984
984
|
import { CommonComponentProps } from '../props';
|
|
985
985
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
986
986
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1557,7 +1557,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1557
1557
|
};
|
|
1558
1558
|
|
|
1559
1559
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1560
|
-
`,du="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>'),uu=[{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."}],No={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},pu=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],mu={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:{...No.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:{...No.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:{...No.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:uu,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:du},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:[...pu],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"]},gu={element:lu,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:mu,sourceCode:cu};function hu(e){return`
|
|
1560
|
+
`,du="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>'),uu=[{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."}],Ko={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},pu=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],mu={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:{...Ko.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:{...Ko.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:{...Ko.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:uu,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:du},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:[...pu],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"]},gu={element:lu,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400,height:60},t:{width:453,height:60},m:{width:340,height:60}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},schema:mu,sourceCode:cu};function hu(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 fu=30,yu=20,
|
|
1692
|
+
`}const fu=30,yu=20,Go=2,vu=2,xu=(e,t)=>Array.from({length:t},()=>e).flat(),bu=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Su=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>bu(i,e))},wu=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,imageHoverClass:l,isFirstSet:s,scaled:d,onFirstSetImageDone:a})=>{var b,W,K;const p=c.useRef(null);c.useLayoutEffect(()=>{if(!s)return;const h=p.current;h!=null&&h.complete&&(a==null||a())},[s,(b=e.image)==null?void 0:b.url,a]);const u=n.display==="Cover",S=n.ratioValue??"1:1",x=n.reversed??!1,[v,m]=S.split(":").map(Number),w=(x?m:v)/(x?v:m);let C=i,T=C/w;T>o&&(T=o,C=T*w);const P=d(C),M=d(T),F=((W=e.image)==null?void 0:W.url)&&r.jsx("img",{ref:p,src:e.image.url,alt:((K=e.image)==null?void 0:K.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?a:void 0,onError:s?a:void 0});return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...u?{width:P}:{width:"fit-content",maxWidth:d(i),minWidth:0}},children:r.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...u?{width:P,height:M,overflow:"hidden"}:{width:"fit-content",maxWidth:d(i),height:d(o)}},children:F&&e.link?r.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:Ye(`${t}-marquee-link`,!u&&`${t}-marquee-link-contain`),children:F}):F})})},Cu=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=R.useScopedStyles(),s=c.useMemo(()=>hu(l),[l]),{speed:d,direction:a,pauseOnHover:p,gap:u,imageMaxWidth:S,imageMaxHeight:x,imageFit:v,hoverEffect:m}=e,y=!!o,$=!n||!!i,w=$&&m!=="off"&&m!=="randomize"?`${l}-image-hover-${m}`:void 0,C=n?!!i:!0,P=((t==null?void 0:t.length)??0)>0&&(C||!!n),M=Math.max(0,d)*fu,F=Q=>R.scalingValue(Q,n??!1),b=c.useRef(null),W=c.useRef(null),K=c.useRef(null),[h,L]=c.useState(0),[E,k]=c.useState(0),z=C&&p==="on",[le,O]=c.useState(!1),[_,q]=c.useState({}),G=c.useRef(_);G.current=_;const H=c.useRef(null),X=c.useRef(0),ne=c.useRef(null),se=c.useMemo(()=>(t??[]).map(Q=>{var U;return((U=Q.image)==null?void 0:U.url)??""}).join("\0"),[t]),[N,de]=c.useState(Go),g=c.useMemo(()=>{const Q=t??[];return!C||Q.length===0?Q:xu(Q,N)},[t,C,N]),ie=c.useMemo(()=>g.filter(Q=>{var U;return!!((U=Q.image)!=null&&U.url)}).length,[g]),fe=P?vu:1;c.useLayoutEffect(()=>{X.current=0,q({}),H.current=null,de(Go),L(0)},[se]),c.useEffect(()=>{if(!$||m!=="randomize")return;const Q=b.current;if(!Q)return;const U=ke=>{q(Fe=>{let xe=null;for(const j of ke)j in Fe&&(Su(Q,j)||(xe||(xe={...Fe}),delete xe[j]));return xe??Fe})},J=new IntersectionObserver(ke=>{const Fe=new Set;for(const xe of ke){const j=xe.target.dataset.marqueeItemIndex,ae=j!==void 0?Number(j):NaN;Number.isNaN(ae)||Fe.add(ae)}Fe.size>0&&U(Fe)},{root:Q,threshold:0});Object.keys(_).forEach(ke=>{const Fe=Number(ke);Q.querySelectorAll(`[data-marquee-item-index="${Fe}"]`).forEach(xe=>J.observe(xe))});let Me=0;const Ae=()=>{const ke=Object.keys(G.current);ke.length!==0&&(U(ke.map(Number)),Me=requestAnimationFrame(Ae))};return Object.keys(G.current).length>0&&(Me=requestAnimationFrame(Ae)),()=>{cancelAnimationFrame(Me),J.disconnect()}},[m,_,$]),c.useLayoutEffect(()=>{if(!P)return;const Q=b.current,U=K.current;if(!Q||!U)return;let J=0;const Me=()=>{const Fe=Q.getBoundingClientRect().width,xe=U.getBoundingClientRect().width,j=H.current,ae=typeof j=="number"&&Math.abs(j-xe)<=.25;if(H.current=xe,C&&xe>0&&N>0){const A=xe/N;if(A>0&&Fe>0){const D=Math.max(Go,Math.ceil(Fe/A)+1);if(D!==N){de(D);return}}}if(xe>0&&h<=0){L(xe);return}ae&&xe!==h?L(xe):!ae&&h<=0&&(cancelAnimationFrame(J),J=requestAnimationFrame(Me))},Ae=()=>{cancelAnimationFrame(J),J=requestAnimationFrame(Me)};ne.current=Ae,Ae();const ke=new ResizeObserver(Ae);return ke.observe(Q),ke.observe(U),()=>{ne.current=null,cancelAnimationFrame(J),ke.disconnect()}},[C,P,h,se,N]),c.useLayoutEffect(()=>{const Q=W.current;if(!P||!Q)return;const U=h>0?h:0,J=U>0&&M>0?U/M*1e3:0,Me=`${Math.max(0,J)/1e3}s`;Q.style.setProperty("--marquee-distance",`${U}px`),Q.style.setProperty("--marquee-duration",Me)},[C,P,M,h]),c.useLayoutEffect(()=>{if(!P){k(0);return}if(h<=0){k(0);return}const Q=W.current;if(!Q)return;const U=()=>{const Me=Q.getBoundingClientRect().height;k(Me>0?Me:0)};U();const J=new ResizeObserver(U);return J.observe(Q),()=>J.disconnect()},[P,fe,g,n,u,S,x,h,v,_]);const oe=()=>{z&&O(!0)},Ce=()=>{z&&O(!1)},me=c.useCallback(()=>{var Q;X.current=Math.min(ie,X.current+1),(Q=ne.current)==null||Q.call(ne)},[ie]),re=c.useCallback((Q,U)=>{q(J=>{const Me=J[Q]??U,Ae=(t??[]).filter(Fe=>Fe!==Me);if(Ae.length===0)return J;const ke=Ae[Math.floor(Math.random()*Ae.length)];return{...J,[Q]:ke}})},[t]),B=(Q,U,J,Me)=>{const Ae=$&&m==="randomize"&&v.display==="Cover"?_[J]??Q:Q,ke=`max(${F(u)}, ${yu}px)`,Fe=`calc(-0.5 * (${ke} + ${F(u)}))`;return r.jsxs("div",{className:`${l}-marquee-card`,"data-marquee-item-index":J,onMouseEnter:$&&m==="randomize"&&v.display==="Cover"?()=>re(J,Q):void 0,children:[r.jsx(wu,{item:Ae,prefix:l,imageFit:v,imageMaxWidth:S,imageMaxHeight:x,imageHoverClass:w,isEditor:n,isFirstSet:Me,scaled:F,onFirstSetImageDone:me}),y&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${l}-gap-control`,style:{position:"absolute",top:0,right:Fe,width:ke,height:"100%"}})]},`${U}-${J}`)};if(P){const Q=C?z&&le?"paused":"running":"paused";return r.jsxs("div",{ref:b,className:Ye(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Marquee",style:h>0&&E>0?{height:E}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsx("div",{ref:W,className:`${l}-marquee-track`,"data-direction":a,onMouseEnter:oe,onMouseLeave:Ce,style:{"--marquee-play-state":Q},children:Array.from({length:fe},(U,J)=>r.jsx("div",{ref:J===0?K:void 0,className:Ye(`${l}-marquee-row`,`${l}-marquee-set`),style:{gap:F(u),paddingRight:F(u)},"aria-hidden":J>0,children:g.map((Me,Ae)=>B(Me,J,Ae,J===0))},`set-${J}`))},"marquee-track")]})}return r.jsxs("div",{ref:b,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsx("div",{className:Ye(`${l}-marquee-row`,`${l}-marquee-static`),style:{gap:F(u),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Q,U)=>B(Q,0,U))},"marquee-static")]})},Tu=`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
|
-
`,$u={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:""}]}},Lu={element:Cu,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:$u,sourceCode:Tu,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function
|
|
2323
|
+
`,$u={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:""}]}},Lu={element:Cu,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:$u,sourceCode:Tu,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function fl(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 Eu=30,yl=2,Iu=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=R.useScopedStyles(),{align:s,speed:d,direction:a,pauseOnHover:p,gap:u,cardWidth:S,corners:x,stroke:v,strokeColor:m,bgColor:y,padding:$,logoMarginTop:w,logoWidth:C,logoHeight:T,captionMarginTop:P}=e,M=!!o,F=((t==null?void 0:t.length)??0)>0,b=d>0&&(!n||i),W=F&&(b||n),K=Math.max(0,d)*Eu,h=A=>R.scalingValue(A,n??!1),L=c.useRef(null),E=c.useRef(null),k=c.useRef(null),[z,le]=c.useState(0),[O,_]=c.useState(0),[q,G]=c.useState(0),H=b&&p==="on",[X,ne]=c.useState(!1),se=c.useRef(null),[N,de]=c.useState(0),[g,ie]=c.useState(0),fe=c.useRef(null),oe=A=>{var Y,Z,ge,Te,je;return{fontSettings:{fontFamily:(e==null?void 0:e[`${A}FontFamily`])??"Arial",fontWeight:((Y=e==null?void 0:e[`${A}FontSettings`])==null?void 0:Y.fontWeight)??400,fontStyle:((Z=e==null?void 0:e[`${A}FontSettings`])==null?void 0:Z.fontStyle)??"normal"},textAppearance:{textTransform:((ge=e==null?void 0:e[`${A}TextAppearance`])==null?void 0:ge.textTransform)??"none",textDecoration:((Te=e==null?void 0:e[`${A}TextAppearance`])==null?void 0:Te.textDecoration)??"none",fontVariant:((je=e==null?void 0:e[`${A}TextAppearance`])==null?void 0:je.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${A}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${A}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${A}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${A}LineHeight`])??.01,color:(e==null?void 0:e[`${A}Color`])??"#000000"}},Ce=oe("text"),me=oe("caption"),re=c.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(A=>{var D,Y;return(((D=A.text)==null?void 0:D.length)??0)>0||(((Y=A.caption)==null?void 0:Y.length)??0)>0}),[t]),B=c.useMemo(()=>!W||(t==null?void 0:t.length)===0?1:O<=0||z<=0?yl:Math.max(yl,Math.ceil(z/O)+1),[W,t==null?void 0:t.length,O,z]);c.useLayoutEffect(()=>{if(!W)return;const A=L.current,D=k.current;if(!A||!D)return;let Y=0;const Z=()=>{const je=A.getBoundingClientRect().width,_e=D.getBoundingClientRect().width,Le=fe.current,Ge=typeof Le=="number"&&Math.abs(Le-_e)<=.25;if(fe.current=_e,le(je),typeof _e=="number"&&_e>0&&O<=0){_(_e);return}Ge&&_e!==O?_(_e):!Ge&&O<=0&&(cancelAnimationFrame(Y),Y=requestAnimationFrame(Z))},ge=()=>{cancelAnimationFrame(Y),Y=requestAnimationFrame(Z)};ge();const Te=new ResizeObserver(ge);return Te.observe(A),Te.observe(D),()=>{cancelAnimationFrame(Y),Te.disconnect()}},[b,W,O]),c.useLayoutEffect(()=>{const A=E.current;if(!W||!A)return;const D=O>0?O:0,Y=D>0&&K>0?D/K*1e3:0,Z=`${Math.max(0,Y)/1e3}s`;A.style.setProperty("--marquee-distance",`${D}px`),A.style.setProperty("--marquee-duration",Z)},[b,W,K,O]),c.useLayoutEffect(()=>{if(!W){G(0);return}const A=k.current,D=E.current;if(!A||!D)return;const Y=()=>{let ge=0;for(let Te=0;Te<A.children.length;Te++){const _e=A.children[Te].firstElementChild;_e&&(ge=Math.max(ge,_e.offsetHeight))}ge<=0&&(ge=D.offsetHeight),G(ge>0?ge:0)};Y();const Z=new ResizeObserver(Y);return Z.observe(A),Z.observe(D),()=>{Z.disconnect()}},[W,B,t,n,u,S,$,v,x,C,T,N,g]);const Q=()=>{H&&ne(!0)},U=()=>{H&&ne(!1)},J=c.useMemo(()=>{switch(s){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[s]),Me=c.useMemo(()=>{switch(s){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[s]),Ae=c.useCallback((A,D,Y,Z)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:J,width:"100%"},children:[r.jsx("div",{"data-controls":M?Z==null?void 0:Z.controlsName:void 0,"data-controls-axis":M?"y":void 0,className:M?`${l}-control`:void 0,style:{height:h((Z==null?void 0:Z.marginTop)??0)}}),r.jsx("div",{...Z!=null&&Z.dataMeasureKind?{"data-testimonial-measure":Z.dataMeasureKind}:{},style:{...Pt(A,n),textAlign:Me,pointerEvents:"auto",...typeof(Z==null?void 0:Z.minHeightPx)=="number"&&Z.minHeightPx>0?{minHeight:Z.minHeightPx}:{}},children:r.jsx(_i,{content:D})})]},Y),[J,Me,n,M,l,h]),ke=c.useCallback((A,D,Y)=>{var Z,ge,Te;return r.jsxs("div",{style:{padding:`${h($.top)} ${h($.right)} ${h($.bottom)} ${h($.left)}`,width:h(S+v*2),height:"100%",borderRadius:h(x),border:`${h(v)} solid ${m}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${l}-cover`,style:{background:y}}),r.jsxs("div",{className:`${l}-elements-overlay`,style:{alignItems:J,textAlign:Me},children:[A.text&&Ae(Ce,A.text,"text",Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(Y==null?void 0:Y.textMinHeightPx)=="number"&&Y.textMinHeightPx>0?{minHeightPx:Y.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:J,width:"100%"},children:[r.jsx("div",{"data-controls":M&&!(Y!=null&&Y.dataMeasureAttrs)?"logoMarginTop":void 0,className:M&&!(Y!=null&&Y.dataMeasureAttrs)?`${l}-control`:void 0,style:{height:h(w)}}),r.jsx("div",{style:{width:h(C),height:h(T)},children:((Z=A.logo)==null?void 0:Z.url)&&r.jsx("img",{src:A.logo.url,alt:((ge=A.logo)==null?void 0:ge.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Te=A.logo)==null?void 0:Te.objectFit)||"contain"}})})]}),A.caption&&Ae(me,A.caption,"caption",{...Y!=null&&Y.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:P,...Y!=null&&Y.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(Y==null?void 0:Y.captionMinHeightPx)=="number"&&Y.captionMinHeightPx>0?{minHeightPx:Y.captionMinHeightPx}:{}})]})]},D)},[y,P,me,S,x,T,w,C,J,Me,$.bottom,$.left,$.right,$.top,Ae,v,m,Ce,n,M,l]),Fe=c.useCallback(A=>{de(A.maxTextPx),ie(A.maxCaptionPx)},[]);c.useLayoutEffect(()=>{if(!re){Fe({maxTextPx:0,maxCaptionPx:0});return}const A=se.current;if(!A)return;const D=()=>{R.readTestimonialTextMeasure(A,Fe)};D();const Y=new ResizeObserver(D);return Y.observe(A),()=>{Y.disconnect()}},[re,Fe,t,ke]);const xe=re?{textMinHeightPx:N,captionMinHeightPx:g}:void 0,j=re?r.jsx("div",{ref:se,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((A,D)=>ke(A,`measure-${D}`,{dataMeasureAttrs:!0}))}):null,ae=(A,D)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[ke(A,`card-${D}`,xe),M&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${h(u)})`,width:h(u),height:"100%",pointerEvents:"auto",zIndex:2}})]},D);if(W){const A=b?H&&X?"paused":"running":"paused";return r.jsxs("div",{ref:L,className:Ye(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...q>0?{height:q}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:fl(l)}}),j,r.jsx("div",{ref:E,className:`${l}-marquee-track`,"data-direction":a,onMouseEnter:Q,onMouseLeave:U,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px","--marquee-play-state":A},children:Array.from({length:B},(D,Y)=>r.jsx("div",{ref:Y===0?k:void 0,className:`${l}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:h(u),paddingRight:h(u)},"aria-hidden":Y>0,children:t==null?void 0:t.map((Z,ge)=>ae(Z,`${Y}-${ge}`))},`set-${Y}`))})]})}return r.jsxs("div",{className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:fl(l)}}),j,r.jsx("div",{style:{gap:h(u),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((A,D)=>ae(A,D))})]})},Ru=`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
|
+
`,vl={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Mu={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:{...vl.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:{...vl.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"}]}]}]}},Wu={element:Iu,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:Mu,sourceCode:Ru,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function _u(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 Au=3e3,Pu=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=
|
|
3149
|
+
`}const Au=3e3,Pu=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=R.useScopedStyles(),s=t||[],{speed:d,align:a,width:p,imageMarginTop:u,textMarginTop:S,captionMarginTop:x,imageWidth:v,imageHeight:m,controlsWidth:y,controlsColor:$,controlsHoverColor:w}=e,C=d>0&&(!n||!!i),[T,P]=c.useState(0),[M,F]=c.useState(null),[b,W]=c.useState(!1),K=c.useRef(null),h=c.useMemo(()=>{switch(a){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[a]),L=c.useMemo(()=>{switch(a){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[a]);c.useEffect(()=>{P(0),F(null),W(!1)},[s.length]);const E=s[T],k=M===null?null:s[M],z=me=>{var B,Q,U,J,Me;return{fontSettings:{fontFamily:(e==null?void 0:e[`${me}FontFamily`])??"Arial",fontWeight:((B=e==null?void 0:e[`${me}FontSettings`])==null?void 0:B.fontWeight)??400,fontStyle:((Q=e==null?void 0:e[`${me}FontSettings`])==null?void 0:Q.fontStyle)??"normal"},textAppearance:{textTransform:((U=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:U.textTransform)??"none",textDecoration:((J=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:J.textDecoration)??"none",fontVariant:((Me=e==null?void 0:e[`${me}TextAppearance`])==null?void 0:Me.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${me}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${me}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${me}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${me}WordSpacing`])??0,color:(e==null?void 0:e[`${me}Color`])??"#000000"}},le=z("text"),O=z("caption"),_=s.length>1&&s.some(me=>{var re,B;return(((re=me.text)==null?void 0:re.length)??0)>0||(((B=me.caption)==null?void 0:B.length)??0)>0}),q=c.useRef(null),[G,H]=c.useState(0),[X,ne]=c.useState(0),se=e.controls??{mode:"Off",icon:null},N=s.length>1,de=c.useCallback((me,re)=>!N||re===me?me:(K.current&&window.clearTimeout(K.current),F(me),W(!0),K.current=window.setTimeout(()=>{F(null),W(!1),K.current=null},300),re),[N]),g=c.useCallback(()=>{N&&P(me=>de(me,(me-1+s.length)%s.length))},[N,de,s.length]),ie=c.useCallback(()=>{N&&P(me=>de(me,(me+1)%s.length))},[N,de,s.length]);c.useEffect(()=>{if(!C||!N)return;const me=Math.max(300,Au/d),re=window.setInterval(()=>{P(B=>de(B,(B+1)%s.length))},me);return()=>{window.clearInterval(re)}},[C,N,de,s.length,d]),c.useEffect(()=>()=>{K.current&&window.clearTimeout(K.current)},[]);const fe=(me,re)=>{var Me,Ae,ke,Fe;const B=re==null?void 0:re.textMinHeightPx,Q=re==null?void 0:re.captionMinHeightPx,U=re==null?void 0:re.dataMeasureAttrs,J=o&&!(re!=null&&re.dataMeasureAttrs)&&!(re!=null&&re.hideControls);return r.jsxs(r.Fragment,{children:[me.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:h,width:"100%"},children:[r.jsx("div",{"data-controls":J?"textMarginTop":void 0,className:J?`${l}-control`:void 0,style:{height:R.scalingValue(S??0,n??!1)}}),r.jsx("div",{...U&&{"data-testimonial-measure":"text"},style:{...Pt(le,n),...B&&B>0?{minHeight:B}:{},textAlign:L,pointerEvents:"auto"},children:r.jsx(_i,{content:me.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:h,width:"100%"},children:[r.jsx("div",{"data-controls":J?"imageMarginTop":void 0,className:J?`${l}-control`:void 0,style:{height:R.scalingValue(u??0,n??!1)}}),r.jsx("div",{style:{width:R.scalingValue(v??0,n??!1),height:R.scalingValue(m??0,n??!1)},children:((Me=me.image)==null?void 0:Me.url)&&r.jsx("img",{src:(Ae=me.image)==null?void 0:Ae.url,alt:((ke=me.image)==null?void 0:ke.name)??"",className:`${l}-icon`,style:{objectFit:((Fe=me.image)==null?void 0:Fe.objectFit)||"contain"}})})]}),me.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:h,width:"100%"},children:[r.jsx("div",{"data-controls":J?"captionMarginTop":void 0,className:J?`${l}-control`:void 0,style:{height:R.scalingValue(x??0,n??!1)}}),r.jsx("div",{...U?{"data-testimonial-measure":"caption"}:{},style:{...Pt(O,n),...Q&&Q>0?{minHeight:Q}:{},textAlign:L,pointerEvents:"auto"},children:r.jsx(_i,{content:me.caption})})]})]})},oe=c.useCallback(me=>{H(me.maxTextPx),ne(me.maxCaptionPx)},[]);if(c.useLayoutEffect(()=>{if(!_){oe({maxTextPx:0,maxCaptionPx:0});return}const me=q.current;if(!me)return;const re=()=>{R.readTestimonialTextMeasure(me,oe)};re();const B=new ResizeObserver(re);return B.observe(me),()=>{B.disconnect()}},[_,oe,t]),!E)return r.jsx(r.Fragment,{});const Ce=_?{textMinHeightPx:G,captionMinHeightPx:X}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${l}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:_u(l)}}),r.jsxs("div",{className:`${l}-wrapper`,style:{width:R.scalingValue(p??0,n??!1),alignItems:h},children:[_&&r.jsx("div",{ref:q,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((me,re)=>r.jsx("div",{style:{width:"100%"},children:fe(me,{dataMeasureAttrs:!0})},re))}),r.jsxs("div",{className:`${l}-fade-stack`,children:[k&&b&&r.jsx("div",{className:Ye(`${l}-fade-item-prev`,`${l}-fade-out`),children:fe(k,{...Ce,hideControls:!0})}),r.jsx("div",{className:Ye(`${l}-fade-item-current`,b?`${l}-fade-in`:void 0),children:fe(E,Ce)})]})]}),se.mode==="On"&&r.jsxs("div",{className:`${l}-controls`,children:[r.jsx("div",{className:`${l}-arrow`,style:{width:R.scalingValue(y??.02,n??!1),height:R.scalingValue(y??.02,n??!1),"--arrow-hover-color":w},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:g,disabled:!N,"aria-label":"Previous testimonial",children:se.icon&&r.jsx(an,{url:se.icon,fill:$,hoverFill:w,className:Ye(`${l}-arrow-img`,`${l}-mirror`)})})}),r.jsx("div",{className:Ye(`${l}-arrow`,`${l}-next-arrow`),style:{width:R.scalingValue(y??.02,n??!1),height:R.scalingValue(y??.02,n??!1),"--arrow-hover-color":w},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:ie,disabled:!N,"aria-label":"Next testimonial",children:se.icon&&r.jsx(an,{url:se.icon,fill:$,hoverFill:w,className:`${l}-arrow-img`})})})]})]})})},ku=`import cn from 'classnames';
|
|
3150
3150
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3151
3151
|
import { CommonComponentProps } from '../props';
|
|
3152
3152
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3642,7 +3642,7 @@ type TestimonialsSettings = {
|
|
|
3642
3642
|
icon?: string | null;
|
|
3643
3643
|
};
|
|
3644
3644
|
};
|
|
3645
|
-
`,Fu="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>'),
|
|
3645
|
+
`,Fu="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>'),xl={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:{...xl.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:{...xl.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:Fu},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"}]}]}]}},Hu={element:Pu,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:ku,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Bu(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function bl(e){return((e==null?void 0:e.trim().length)??0)>0}function Uo(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function qo(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:R.scalingValue((o-t)/2,i)}}function Ou(e){return`
|
|
3646
3646
|
.${e}-wrapper {
|
|
3647
3647
|
display: grid;
|
|
3648
3648
|
align-items: start;
|
|
@@ -3845,7 +3845,7 @@ type TestimonialsSettings = {
|
|
|
3845
3845
|
pointer-events: auto;
|
|
3846
3846
|
z-index: 10;
|
|
3847
3847
|
}
|
|
3848
|
-
`}const dn=500,Du=750,Cn="cubic-bezier(0.22, 1, 0.36, 1)";function Tn(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function yl({media:e,className:t,style:n,onImageClick:i}){return Tn(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 ju({images:e,index:t,imageDisplay:n,originRect:i,reverseClose:o,onClose:l,onPrev:s,onNext:d,counterClassName:a,counterStyle:p}){const u=n==="cover",S=c.useRef(null),x=c.useRef(null),[y,m]=c.useState(null),[f,$]=c.useState(i?"opening":"open"),[w,C]=c.useState(!0),T=c.useRef(t),P=c.useCallback(()=>{const h=S.current,L=x.current;if(!h||!L)return;const I=h.getBoundingClientRect(),k=I.width,z=I.height,le=L.naturalWidth,O=L.naturalHeight;if(!k||!z||!le||!O)return;if(n==="cover"){m({width:k,height:z,left:I.left,top:I.top});return}const W=le/O,G=k/z;if(W>G){const K=k/W;m({width:k,height:K,left:I.left,top:I.top+(z-K)/2})}else{const K=z*W;m({width:K,height:z,left:I.left+(k-K)/2,top:I.top})}},[n]);c.useEffect(()=>{P();const h=S.current;if(!h)return;const L=new ResizeObserver(()=>P());return L.observe(h),()=>L.disconnect()},[P,t]),c.useEffect(()=>{f==="opening"&&y&&$("open")},[f,y]),c.useEffect(()=>{if(f!=="closing")return;const h=setTimeout(()=>l(),dn);return()=>clearTimeout(h)},[f,l]),c.useEffect(()=>{T.current!==t&&C(!1),T.current=t},[t]),c.useEffect(()=>{const h=L=>{L.key==="Escape"&&(L.preventDefault(),L.stopPropagation(),f!=="closing"&&$("closing"))};return window.addEventListener("keydown",h,!0),()=>window.removeEventListener("keydown",h,!0)},[f]);const R=()=>{f!=="closing"&&$("closing")},F=f==="open",b=f==="closing",_=b&&o&&!!i,V=f==="opening"?i??y:_?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:F?1:0,transition:`opacity ${dn}ms ${Cn}`,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:S,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:F?1:0,transition:`opacity ${dn}ms ${Cn}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:a,style:p,children:[t+1," / ",e.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:S,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:F?1:0,transition:`opacity ${dn}ms ${Cn}`},children:e.length>1&&r.jsxs("p",{className:a,style:p,children:[t+1," / ",e.length]})})]})}),V&&r.jsx("img",{ref:x,src:e[t],onLoad:P,style:{position:"fixed",top:V.top,left:V.left,width:V.width,height:V.height,objectFit:n==="cover"?"cover":"contain",opacity:b&&!_?0:1,transition:b&&!_?`opacity ${dn}ms ${Cn}`:_||w?`top ${dn}ms ${Cn}, left ${dn}ms ${Cn}, width ${dn}ms ${Cn}, height ${dn}ms ${Cn}`:"none",pointerEvents:"none",zIndex:9998}}),F&&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:h=>{h.stopPropagation(),s()}}),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:h=>{h.stopPropagation(),d()}})]})]})}function zu(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Vu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:d}){const{prefix:a}=E.useScopedStyles(),{type:p="a",gridLayout:u,textBoxWidth:S=100,verticalGap:x,entriesCount:y,lightbox:m,imageDisplay:f,lightboxImageDisplay:$,slider:w,sliderTiming:C,direction:T,transition:P,titleMarginTop:R,subtitleMarginTop:F,titleColor:b,subtitleColor:_,lightboxCounterColor:V,titleFontFamily:h,titleFontSettings:L,titleFontSize:I,titleLineHeight:k,titleLetterSpacing:z,titleWordSpacing:le,titleTextAppearance:O,subtitleFontFamily:W,subtitleFontSettings:G,subtitleFontSize:K,subtitleLineHeight:H,subtitleLetterSpacing:q,subtitleWordSpacing:te,subtitleTextAppearance:se,lightboxCounterFontFamily:N,lightboxCounterFontSettings:ce,lightboxCounterFontSize:g,lightboxCounterLineHeight:ne,lightboxCounterLetterSpacing:fe,lightboxCounterWordSpacing:ie,lightboxCounterTextAppearance:we,showText:me="always",alignEntries:oe="off"}=e,B={fontSettings:{fontFamily:h,fontWeight:(L==null?void 0:L.fontWeight)??400,fontStyle:(L==null?void 0:L.fontStyle)??"normal"},fontSize:I??.01,lineHeight:k,letterSpacing:z??0,wordSpacing:le??0,textAppearance:O,color:b},U={...tn(Wt(B,n))},Y={fontSettings:{fontFamily:W,fontWeight:(G==null?void 0:G.fontWeight)??400,fontStyle:(G==null?void 0:G.fontStyle)??"normal"},fontSize:K??.01,lineHeight:H,letterSpacing:q??0,wordSpacing:te??0,textAppearance:se,color:_},Me={...tn(Wt(Y,n))},Ae={fontSettings:{fontFamily:N,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:g??.01,lineHeight:ne,letterSpacing:fe??0,wordSpacing:ie??0,textAppearance:we,color:V},xe={...tn(Wt(Ae,n)),...Oo(g,ne,a,n)},j=Bo(I,k,`${a}-item-title`,`${a}-text-tight-leading`),ae=Bo(K,H,`${a}-item-subtitle`,`${a}-text-tight-leading`),A=Oo(I,k,a,n),D=Oo(K,H,a,n),X=Bo(g,ne,`${a}-lightbox-counter`,`${a}-text-tight-leading`),J=E.buildColorVars(a,{titleColor:b,subtitleColor:_,lightboxCounterColor:V},Ku,Uu),De=`${s&&s!=="default"?`${a}-state-${s}`:""}${me==="on hover"&&(!n||i)?` ${a}-show-text-hover`:""}`.trim(),Re=y===0?1/0:y,$e=(t??[]).slice(0,Re),Ge=u.entryWidth??.2,pe=(f==null?void 0:f.display)==="cover",Ee=(f==null?void 0:f.ratioValue)??"1:1",je=(f==null?void 0:f.reversed)??!1,[ze,Ve]=Ee.split(":").map(Number),$t=`${je?Ve:ze} / ${je?ze:Ve}`,Ye=E.scalingValue(Ge??0,n),ft=!pe&&w!=="off",bt={width:Ye,...pe?{aspectRatio:$t,height:"auto",overflow:"hidden"}:{height:"auto"}},Ot=`${a}-item-image-wrapper${ft?` ${a}-item-image-wrapper-fit-slider`:""}`.trim(),We=p==="c",wt=We&&oe==="on",Qe=`calc(${E.scalingValue(Ge??0,n)} * (${S} / 100))`,Et=E.scalingValue(Ge*S/100,n),kt=pe?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[sn,At]=c.useState("ltr"),[Dt,zt]=c.useState(0),Fe=c.useRef(null);c.useEffect(()=>{const Ne=Fe.current;if(!Ne)return;const yt=new ResizeObserver(Rt=>{zt(Math.round(Rt[0].contentRect.width))});return yt.observe(Ne),()=>yt.disconnect()},[]);const ct=(()=>{const Ne={...J},yt=Fe.current?getComputedStyle(Fe.current).getPropertyValue("--cntrl-article-width").trim():"";return yt&&(Ne["--cntrl-article-width"]=yt),Ne})(),[mt,et]=c.useState(!1),[tt,Ft]=c.useState([]),[Vt,Nt]=c.useState(0),[bn,Je]=c.useState(null),an=(Ne,yt,Rt)=>{if(n&&!i||m==="off")return;const ee=Ne.currentTarget.getBoundingClientRect();Je({top:ee.top,left:ee.left,width:ee.width,height:ee.height}),Ft(yt),Nt(Rt),et(!0)};c.useEffect(()=>{if(!mt||m!=="on"||typeof document>"u")return;const Ne=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ne}},[mt,m]),c.useEffect(()=>{!n||i||(et(!1),Je(null))},[n,i]);const Sn=c.useMemo(()=>Ou(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Sn}}),r.jsx("div",{style:J,children:r.jsx("div",{ref:Fe,className:`${a}-wrapper ${a}-type-${p}${wt?` ${a}-align-entries`:""} ${De}`.trim(),style:{gridTemplateColumns:`repeat(${u.columnsCount}, minmax(0, 1fr))`,rowGap:wt?0:E.scalingValue(x??0,n),columnGap:E.scalingValue(u.horizontalGap??0,n),width:E.scalingValue(u.wrapperWidth??0,n),...wt?{[`--${a}-align-entries-row-gap`]:E.scalingValue(x??0,n)}:{}},children:$e.map((Ne,yt)=>{var dt,vt;const Rt=fl(Ne.title),ee=fl(Ne.subtitle),ye=(((dt=Ne.link)==null?void 0:dt.length)??0)>0&&m==="off"?Ne.link:void 0,Le=Math.floor(yt/u.columnsCount)===Math.ceil($e.length/u.columnsCount)-1,Oe=We?r.jsxs("div",{className:`${a}-item-text-block`,children:[Rt&&r.jsx("p",{className:j,style:{width:Qe,...U,...A},children:Ne.title}),Rt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(R??0,n),width:Et}}),ee&&r.jsx("p",{className:ae,style:{width:Qe,...Me,...D},children:Ne.subtitle}),ee&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(F??0,n),width:Et}})]}):null,Ke=We?r.jsxs("div",{className:`${a}-item-title-row`,children:[Rt&&r.jsx("p",{className:j,style:{width:Qe,...U,...A},children:Ne.title}),Rt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(R??0,n),width:Et}})]}):null,Ue=We?r.jsxs("div",{className:`${a}-item-subtitle-row`,children:[ee&&r.jsx("p",{className:ae,style:{width:Qe,...Me,...D},children:Ne.subtitle}),ee&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:E.scalingValue(F??0,n),width:Et}})]}):null,ve=ye?r.jsxs("a",{href:ye,target:"_blank",className:`${a}-item-text-link`,children:[Ke,Ue]}):r.jsxs(r.Fragment,{children:[Ke,Ue]}),gt=r.jsx("div",{className:Ot,style:bt,children:(((vt=Ne.image)==null?void 0:vt.length)??0)===0?null:w==="off"?(()=>{const He=Ne.image[0],nt=Ne.image.filter(Ct=>!Tn(Ct)).map(Ct=>Ct.url);return r.jsx(yl,{media:He,className:`${a}-item-${Tn(He)?"video":"image"}`.trim(),style:kt,onImageClick:Tn(He)?void 0:Ct=>an(Ct,nt,0)})})():r.jsxs(r.Fragment,{children:[ft&&r.jsx("div",{className:`${a}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Ne.image.map(He=>Tn(He)?r.jsx("video",{src:He.url,muted:!0,playsInline:!0},`sizer-${He.url}`):r.jsx("img",{src:He.url,alt:""},`sizer-${He.url}`))}),r.jsx(Mr,{className:`${a}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:C*1e3,width:"100%",height:"100%",speed:Du,type:P==="fade"?"fade":"loop",rewind:P==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:P==="fade"?"ltr":T!=="random"?T==="horizontal"?"ltr":"ttb":sn},onMoved:He=>{if(T!=="random"||P==="fade")return;const St=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";At(St),setTimeout(()=>{He.refresh()},0)},children:Ne.image.map((He,St)=>{const nt=Ne.image.filter(ht=>!Tn(ht)),Ct=nt.map(ht=>ht.url),Qt=nt.findIndex(ht=>ht.url===He.url);return r.jsx(_r,{children:r.jsx(yl,{media:He,className:`${a}-item-${Tn(He)?"video":"image"}`.trim(),style:kt,onImageClick:Tn(He)?void 0:ht=>an(ht,Ct,Qt)})},St)})},`${P}-${Ge}-${T}-${C}-${Dt}-${d}`)]})}),ot=We?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&Rt?"titleMarginTop":void 0,className:o&&Rt?`${a}-control`:void 0,style:{height:Rt?E.scalingValue(R??0,n):0,width:Et}}),r.jsx("p",{className:j,style:{width:Qe,...U,...A},children:Ne.title}),r.jsx("div",{"data-controls":o&&ee?"subtitleMarginTop":void 0,className:o&&ee?`${a}-control`:void 0,style:{height:ee?E.scalingValue(F??0,n):0,width:Et}}),r.jsx("p",{className:ae,style:{width:Qe,...Me,...D},children:Ne.subtitle})]});return r.jsx("div",{className:`${a}-item`.trim(),children:r.jsx("div",{className:`${o?`${a}-item-inner`:`${a}-item-inner-hidden`}${wt&&Le?` ${a}-item-inner-last-row`:""}`.trim(),style:{width:(S??0)>100?`calc(${E.scalingValue(Ge??0,n)} * (${S} / 100))`:E.scalingValue(Ge??0,n)},children:wt?r.jsxs(r.Fragment,{children:[ve,r.jsx("a",{href:ye,target:"_blank",className:`${a}-item-image-link`,children:gt})]}):r.jsxs("a",{href:ye,target:"_blank",className:`${a}-item-image-link`,children:[Oe,gt,ot]})})},yt)})})}),(!n||i)&&mt&&typeof document<"u"&&m==="on"&&Li.createPortal(r.jsx("div",{style:ct,"data-selection":"none",children:r.jsx(ju,{images:tt,index:Vt,imageDisplay:zu($),originRect:bn,reverseClose:w==="off",onClose:()=>et(!1),onPrev:()=>Nt(Ne=>(Ne-1+tt.length)%tt.length),onNext:()=>Nt(Ne=>(Ne+1)%tt.length),counterClassName:X,counterStyle:xe})}),document.body)]})}const Ku={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Uu=["hover","focus","filled","success","error"],Gu=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3848
|
+
`}const hn=500,Du=750,Mn="cubic-bezier(0.22, 1, 0.36, 1)";function Wn(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function Sl({media:e,className:t,style:n,onImageClick:i}){return Wn(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 ju({images:e,index:t,imageDisplay:n,originRect:i,reverseClose:o,onClose:l,onPrev:s,onNext:d,counterClassName:a,counterStyle:p}){const u=n==="cover",S=c.useRef(null),x=c.useRef(null),[v,m]=c.useState(null),[y,$]=c.useState(i?"opening":"open"),[w,C]=c.useState(!0),T=c.useRef(t),P=c.useCallback(()=>{const h=S.current,L=x.current;if(!h||!L)return;const E=h.getBoundingClientRect(),k=E.width,z=E.height,le=L.naturalWidth,O=L.naturalHeight;if(!k||!z||!le||!O)return;if(n==="cover"){m({width:k,height:z,left:E.left,top:E.top});return}const _=le/O,q=k/z;if(_>q){const G=k/_;m({width:k,height:G,left:E.left,top:E.top+(z-G)/2})}else{const G=z*_;m({width:G,height:z,left:E.left+(k-G)/2,top:E.top})}},[n]);c.useEffect(()=>{P();const h=S.current;if(!h)return;const L=new ResizeObserver(()=>P());return L.observe(h),()=>L.disconnect()},[P,t]),c.useEffect(()=>{y==="opening"&&v&&$("open")},[y,v]),c.useEffect(()=>{if(y!=="closing")return;const h=setTimeout(()=>l(),hn);return()=>clearTimeout(h)},[y,l]),c.useEffect(()=>{T.current!==t&&C(!1),T.current=t},[t]),c.useEffect(()=>{const h=L=>{L.key==="Escape"&&(L.preventDefault(),L.stopPropagation(),y!=="closing"&&$("closing"))};return window.addEventListener("keydown",h,!0),()=>window.removeEventListener("keydown",h,!0)},[y]);const M=()=>{y!=="closing"&&$("closing")},F=y==="open",b=y==="closing",W=b&&o&&!!i,K=y==="opening"?i??v:W?i:v;return r.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:M,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:F?1:0,transition:`opacity ${hn}ms ${Mn}`,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:S,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:F?1:0,transition:`opacity ${hn}ms ${Mn}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&r.jsxs("p",{className:a,style:p,children:[t+1," / ",e.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:S,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:F?1:0,transition:`opacity ${hn}ms ${Mn}`},children:e.length>1&&r.jsxs("p",{className:a,style:p,children:[t+1," / ",e.length]})})]})}),K&&r.jsx("img",{ref:x,src:e[t],onLoad:P,style:{position:"fixed",top:K.top,left:K.left,width:K.width,height:K.height,objectFit:n==="cover"?"cover":"contain",opacity:b&&!W?0:1,transition:b&&!W?`opacity ${hn}ms ${Mn}`:W||w?`top ${hn}ms ${Mn}, left ${hn}ms ${Mn}, width ${hn}ms ${Mn}, height ${hn}ms ${Mn}`:"none",pointerEvents:"none",zIndex:9998}}),F&&v&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{position:"fixed",top:v.top,left:v.left,width:v.width/2,height:v.height,cursor:"w-resize",zIndex:9999},onClick:h=>{h.stopPropagation(),s()}}),r.jsx("div",{style:{position:"fixed",top:v.top,left:v.left+v.width/2,width:v.width/2,height:v.height,cursor:"e-resize",zIndex:9999},onClick:h=>{h.stopPropagation(),d()}})]})]})}function zu(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Vu({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:d}){const{prefix:a}=R.useScopedStyles(),{type:p="a",gridLayout:u,textBoxWidth:S=100,verticalGap:x,entriesCount:v,lightbox:m,imageDisplay:y,lightboxImageDisplay:$,slider:w,sliderTiming:C,direction:T,transition:P,titleMarginTop:M,subtitleMarginTop:F,titleColor:b,subtitleColor:W,lightboxCounterColor:K,titleFontFamily:h,titleFontSettings:L,titleFontSize:E,titleLineHeight:k,titleLetterSpacing:z,titleWordSpacing:le,titleTextAppearance:O,subtitleFontFamily:_,subtitleFontSettings:q,subtitleFontSize:G,subtitleLineHeight:H,subtitleLetterSpacing:X,subtitleWordSpacing:ne,subtitleTextAppearance:se,lightboxCounterFontFamily:N,lightboxCounterFontSettings:de,lightboxCounterFontSize:g,lightboxCounterLineHeight:ie,lightboxCounterLetterSpacing:fe,lightboxCounterWordSpacing:oe,lightboxCounterTextAppearance:Ce,showText:me="always",alignEntries:re="off"}=e,B={fontSettings:{fontFamily:h,fontWeight:(L==null?void 0:L.fontWeight)??400,fontStyle:(L==null?void 0:L.fontStyle)??"normal"},fontSize:E??.01,lineHeight:k,letterSpacing:z??0,wordSpacing:le??0,textAppearance:O,color:b},U={...sn(Pt(B,n))},J={fontSettings:{fontFamily:_,fontWeight:(q==null?void 0:q.fontWeight)??400,fontStyle:(q==null?void 0:q.fontStyle)??"normal"},fontSize:G??.01,lineHeight:H,letterSpacing:X??0,wordSpacing:ne??0,textAppearance:se,color:W},Ae={...sn(Pt(J,n))},ke={fontSettings:{fontFamily:N,fontWeight:(de==null?void 0:de.fontWeight)??400,fontStyle:(de==null?void 0:de.fontStyle)??"normal"},fontSize:g??.01,lineHeight:ie,letterSpacing:fe??0,wordSpacing:oe??0,textAppearance:Ce,color:K},xe={...sn(Pt(ke,n)),...qo(g,ie,a,n)},j=Uo(E,k,`${a}-item-title`,`${a}-text-tight-leading`),ae=Uo(G,H,`${a}-item-subtitle`,`${a}-text-tight-leading`),A=qo(E,k,a,n),D=qo(G,H,a,n),Y=Uo(g,ie,`${a}-lightbox-counter`,`${a}-text-tight-leading`),Z=R.buildColorVars(a,{titleColor:b,subtitleColor:W,lightboxCounterColor:K},Ku,Gu),je=`${s&&s!=="default"?`${a}-state-${s}`:""}${me==="on hover"&&(!n||i)?` ${a}-show-text-hover`:""}`.trim(),_e=v===0?1/0:v,Le=(t??[]).slice(0,_e),Ge=u.entryWidth??.2,pe=(y==null?void 0:y.display)==="cover",We=(y==null?void 0:y.ratioValue)??"1:1",ze=(y==null?void 0:y.reversed)??!1,[Ve,Ne]=We.split(":").map(Number),bt=`${ze?Ne:Ve} / ${ze?Ve:Ne}`,Ze=R.scalingValue(Ge??0,n),yt=!pe&&w!=="off",Mt={width:Ze,...pe?{aspectRatio:bt,height:"auto",overflow:"hidden"}:{height:"auto"}},Ht=`${a}-item-image-wrapper${yt?` ${a}-item-image-wrapper-fit-slider`:""}`.trim(),Ee=p==="c",it=Ee&&re==="on",Ue=`calc(${R.scalingValue(Ge??0,n)} * (${S} / 100))`,ut=R.scalingValue(Ge*S/100,n),Bt=pe?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[rn,jt]=c.useState("ltr"),[Yt,ln]=c.useState(0),He=c.useRef(null);c.useEffect(()=>{const Pe=He.current;if(!Pe)return;const ft=new ResizeObserver(Wt=>{ln(Math.round(Wt[0].contentRect.width))});return ft.observe(Pe),()=>ft.disconnect()},[]);const Tt=(()=>{const Pe={...Z},ft=He.current?getComputedStyle(He.current).getPropertyValue("--cntrl-article-width").trim():"";return ft&&(Pe["--cntrl-article-width"]=ft),Pe})(),[pt,et]=c.useState(!1),[mt,zt]=c.useState([]),[Vt,Jt]=c.useState(0),[pn,Ke]=c.useState(null),Zt=(Pe,ft,Wt)=>{if(n&&!i||m==="off")return;const te=Pe.currentTarget.getBoundingClientRect();Ke({top:te.top,left:te.left,width:te.width,height:te.height}),zt(ft),Jt(Wt),et(!0)};c.useEffect(()=>{if(!pt||m!=="on"||typeof document>"u")return;const Pe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Pe}},[pt,m]),c.useEffect(()=>{!n||i||(et(!1),Ke(null))},[n,i]);const kt=c.useMemo(()=>Ou(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:kt}}),r.jsx("div",{style:Z,children:r.jsx("div",{ref:He,className:`${a}-wrapper ${a}-type-${p}${it?` ${a}-align-entries`:""} ${je}`.trim(),style:{gridTemplateColumns:`repeat(${u.columnsCount}, minmax(0, 1fr))`,rowGap:it?0:R.scalingValue(x??0,n),columnGap:R.scalingValue(u.horizontalGap??0,n),width:R.scalingValue(u.wrapperWidth??0,n),...it?{[`--${a}-align-entries-row-gap`]:R.scalingValue(x??0,n)}:{}},children:Le.map((Pe,ft)=>{var ht,ot;const Wt=bl(Pe.title),te=bl(Pe.subtitle),ye=(((ht=Pe.link)==null?void 0:ht.length)??0)>0&&m==="off"?Pe.link:void 0,Ie=Math.floor(ft/u.columnsCount)===Math.ceil(Le.length/u.columnsCount)-1,De=Ee?r.jsxs("div",{className:`${a}-item-text-block`,children:[Wt&&r.jsx("p",{className:j,style:{width:Ue,...U,...A},children:Pe.title}),Wt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:R.scalingValue(M??0,n),width:ut}}),te&&r.jsx("p",{className:ae,style:{width:Ue,...Ae,...D},children:Pe.subtitle}),te&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:R.scalingValue(F??0,n),width:ut}})]}):null,qe=Ee?r.jsxs("div",{className:`${a}-item-title-row`,children:[Wt&&r.jsx("p",{className:j,style:{width:Ue,...U,...A},children:Pe.title}),Wt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:R.scalingValue(M??0,n),width:ut}})]}):null,Qe=Ee?r.jsxs("div",{className:`${a}-item-subtitle-row`,children:[te&&r.jsx("p",{className:ae,style:{width:Ue,...Ae,...D},children:Pe.subtitle}),te&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${a}-control`:void 0,style:{height:R.scalingValue(F??0,n),width:ut}})]}):null,ve=ye?r.jsxs("a",{href:ye,target:"_blank",className:`${a}-item-text-link`,children:[qe,Qe]}):r.jsxs(r.Fragment,{children:[qe,Qe]}),$t=r.jsx("div",{className:Ht,style:Mt,children:(((ot=Pe.image)==null?void 0:ot.length)??0)===0?null:w==="off"?(()=>{const Be=Pe.image[0],rt=Pe.image.filter(wt=>!Wn(wt)).map(wt=>wt.url);return r.jsx(Sl,{media:Be,className:`${a}-item-${Wn(Be)?"video":"image"}`.trim(),style:Bt,onImageClick:Wn(Be)?void 0:wt=>Zt(wt,rt,0)})})():r.jsxs(r.Fragment,{children:[yt&&r.jsx("div",{className:`${a}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Pe.image.map(Be=>Wn(Be)?r.jsx("video",{src:Be.url,muted:!0,playsInline:!0},`sizer-${Be.url}`):r.jsx("img",{src:Be.url,alt:""},`sizer-${Be.url}`))}),r.jsx(Hr,{className:`${a}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:C*1e3,width:"100%",height:"100%",speed:Du,type:P==="fade"?"fade":"loop",rewind:P==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:P==="fade"?"ltr":T!=="random"?T==="horizontal"?"ltr":"ttb":rn},onMoved:Be=>{if(T!=="random"||P==="fade")return;const vt=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";jt(vt),setTimeout(()=>{Be.refresh()},0)},children:Pe.image.map((Be,vt)=>{const rt=Pe.image.filter(St=>!Wn(St)),wt=rt.map(St=>St.url),_t=rt.findIndex(St=>St.url===Be.url);return r.jsx(Br,{children:r.jsx(Sl,{media:Be,className:`${a}-item-${Wn(Be)?"video":"image"}`.trim(),style:Bt,onImageClick:Wn(Be)?void 0:St=>Zt(St,wt,_t)})},vt)})},`${P}-${Ge}-${T}-${C}-${Yt}-${d}`)]})}),gt=Ee?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&Wt?"titleMarginTop":void 0,className:o&&Wt?`${a}-control`:void 0,style:{height:Wt?R.scalingValue(M??0,n):0,width:ut}}),r.jsx("p",{className:j,style:{width:Ue,...U,...A},children:Pe.title}),r.jsx("div",{"data-controls":o&&te?"subtitleMarginTop":void 0,className:o&&te?`${a}-control`:void 0,style:{height:te?R.scalingValue(F??0,n):0,width:ut}}),r.jsx("p",{className:ae,style:{width:Ue,...Ae,...D},children:Pe.subtitle})]});return r.jsx("div",{className:`${a}-item`.trim(),children:r.jsx("div",{className:`${o?`${a}-item-inner`:`${a}-item-inner-hidden`}${it&&Ie?` ${a}-item-inner-last-row`:""}`.trim(),style:{width:(S??0)>100?`calc(${R.scalingValue(Ge??0,n)} * (${S} / 100))`:R.scalingValue(Ge??0,n)},children:it?r.jsxs(r.Fragment,{children:[ve,r.jsx("a",{href:ye,target:"_blank",className:`${a}-item-image-link`,children:$t})]}):r.jsxs("a",{href:ye,target:"_blank",className:`${a}-item-image-link`,children:[De,$t,gt]})})},ft)})})}),(!n||i)&&pt&&typeof document<"u"&&m==="on"&&Fi.createPortal(r.jsx("div",{style:Tt,"data-selection":"none",children:r.jsx(ju,{images:mt,index:Vt,imageDisplay:zu($),originRect:pn,reverseClose:w==="off",onClose:()=>et(!1),onPrev:()=>Jt(Pe=>(Pe-1+mt.length)%mt.length),onNext:()=>Jt(Pe=>(Pe+1)%mt.length),counterClassName:Y,counterStyle:xe})}),document.body)]})}const Ku={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Gu=["hover","focus","filled","success","error"],Uu=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3849
3849
|
import '@splidejs/react-splide/css/core';
|
|
3850
3850
|
import { CommonComponentProps } from '../props';
|
|
3851
3851
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -5014,11 +5014,11 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
5014
5014
|
};
|
|
5015
5015
|
|
|
5016
5016
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
5017
|
-
`,Do={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},qu=["titleColor","subtitleColor","lightboxCounterColor"],Xu={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:{...Do.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:{...Do.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:{...Do.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:[...qu],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Yu={element:Vu,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:Xu,sourceCode:Gu};function Ju(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 Zu({media:e,className:t,style:n}){const i=c.useRef(null);return c.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const l=o.play();l&&l.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function io(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Qu(e){return String(e??"").trim().length>0}function vl(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 xl(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 bl(e,t,n,i,o,l,s){const d=E.scalingValue(l,s),a=E.scalingValue(0,s),p=e===0,u=e===t-1&&!o;return{borderTopWidth:p&&n?d:a,borderBottomWidth:!u||i?d:a}}function ep(e,t,n){const i=E.scalingValue(t,n),o=E.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Sl=10;function tp(e){return`
|
|
5017
|
+
`,Xo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},qu=["titleColor","subtitleColor","lightboxCounterColor"],Xu={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:{...Xo.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:{...Xo.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:{...Xo.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:[...qu],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Yu={element:Vu,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:Xu,sourceCode:Uu};function Ju(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 Zu({media:e,className:t,style:n}){const i=c.useRef(null);return c.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const l=o.play();l&&l.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function po(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Qu(e){return String(e??"").trim().length>0}function wl(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 Cl(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 Tl(e,t,n,i,o,l,s){const d=R.scalingValue(l,s),a=R.scalingValue(0,s),p=e===0,u=e===t-1&&!o;return{borderTopWidth:p&&n?d:a,borderBottomWidth:!u||i?d:a}}function ep(e,t,n){const i=R.scalingValue(t,n),o=R.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const $l=10;function tp(e){return`
|
|
5018
5018
|
.${e}-wrapper {
|
|
5019
5019
|
display: grid;
|
|
5020
5020
|
align-items: start;
|
|
5021
|
-
min-height: ${
|
|
5021
|
+
min-height: ${po(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: ${po(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: ${po(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 En=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Wr=["AColumn","BColumn","CColumn","DColumn","EColumn"],fn="cutLabel",Ar=[...Wr,fn],Eo=["A","B","C","D","E"];function Is(e){return`${e}ColumnVerticalAlign`}const lr=["Top","Center","Bottom"];function Pr(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Eo.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function np(e){const t=Pr(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function ip(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Eo.includes(n)?n:null}function Es(e,t,n){const i=ip(e);return i?i===t?!1:np(n[Is(i)]):!0}function Ci(e){const t=Pr(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Eo.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function op(e,t,n){if(Rs(e,t,n))return Ci(e);const i=Ci(e);return i.kind==="baseline"?{kind:"top"}:i}function rp(e){const t=Ci(e);return t.kind==="baseline"?{kind:"top"}:t}function Rs(e,t,n){return Es(e,n,t)?Ci(e).kind==="baseline":!1}function lp(e){const t={};let n=!1;for(const i of Eo){const o=Is(i),l=e[o];if(e.type==="b"){const s=String(l??"Top").trim();s!=="Top"&&s!=="Center"&&s!=="Bottom"&&(t[o]="Top",n=!0);continue}Es(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function sp(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function ap(e){const t=Ci(e).kind;return t==="baseline"?"center":t}function cp(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function wl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function dp(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),l=o-i;return n.remove(),l}function jo(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=dp(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+s;const d=l.getBoundingClientRect(),a=o.getBoundingClientRect().height;let p=0;return e.kind==="center"?p=(d.height-a)/2:e.kind==="bottom"&&(p=d.height-a),d.top-t+p+s}function up(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const l=o.querySelector(`.${n}`);l&&(l.style.minHeight=`${i}px`,l.style.height=`${i}px`)}),i)}function pp(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const mp={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function qe(e,t){return`${e}${t.replace(/^text/,"Text")}`}const gp={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function hp(e){return[qe(e,"textFontFamily"),qe(e,"textFontSettings"),{type:"row",items:[qe(e,"textFontSize"),qe(e,"textLineHeight"),qe(e,"textLetterSpacing"),qe(e,"textWordSpacing")]},qe(e,"textTextAlign"),qe(e,"textTextAppearance"),`${e}VerticalAlign`]}function fp(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Ar.map(e=>[gp[e],hp(e)]))}}function go(e,t){const n=i=>{const o=qe(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===fn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Cl(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 tn(Wt(n,t))}function Tl(e,t,n,i){const o=go(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function $l(e,t,n,i){const o=go(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:E.scalingValue((l-s)/2,i)}}const Gt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ii=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],oi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],ri=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],yp={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},vp=["hover","focus","filled","success","error"],Ll=.004,Xn=.004,zo=Xn,Il=12,kr=50,Ti=1440,$i=kr/Ti;function Ms(e){const t=typeof e=="number"&&e>0?e:Ti;return kr/t}function xp(e,t){const n={position:"absolute",width:Il,height:Il,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 un({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:xp(e,i)})})}function bp(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 Ti}const _s={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function gi(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Sp(e,t=1){const n=t/e;return Object.fromEntries(Gt.map(i=>[i,n]))}function wp(){return Object.fromEntries([...ii.map(e=>[e,0]),...oi.map(e=>[e,0])])}function Cp(){return Object.fromEntries(ri.map(e=>[e,0]))}function Vi(e){return Object.fromEntries(Gt.map(t=>[t,typeof e[t]=="number"?e[t]:_s[t]]))}function Ws(e,t,n){const i=e-$i,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const l=i/o;return{paddingLeft:t*l,paddingRight:n*l}}function oo(e,t,n){const i=Fr(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((l,s)=>l+s,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Tp(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=ii[o],s=oi[o],d=typeof n[l]=="number"?n[l]:0,a=typeof n[s]=="number"?n[s]:0,p=Ws(t[o]??0,d,a);p.paddingLeft!==d&&(i[l]=p.paddingLeft),p.paddingRight!==a&&(i[s]=p.paddingRight)}return i}function Fr(e,t,n){if(e<=0)return[];const i=Gt.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)+$i;if(t>=s)return i;const d=[...o];let a=s-t;for(let p=d.length-1;p>=0&&a>0;p-=1){const u=d[p]-$i;if(u<=0)continue;const S=Math.min(a,u);d[p]-=S,a-=S}return[...d,i[e-1]]}function $p(e,t,n){if(e<=1)return{};const i=Fr(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=Gt[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function El(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...En]}function Lp(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Ip(e,t,n,i){const o=Math.min(i,e.length,Gt.length),l={};for(let s=0;s<o;s+=1){const d=e[s],a=t.indexOf(d);if(a===-1)continue;const p=Gt[a],u=ii[a],S=oi[a],x=ri[a],y=Gt[s],m=ii[s],f=oi[s],$=ri[s],w=n[p],C=n[u],T=n[S],P=n[x];typeof w=="number"&&(l[y]=w),typeof C=="number"&&(l[m]=C),typeof T=="number"&&(l[f]=T),typeof P=="number"&&(l[$]=P)}return l}function As(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 Ep(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=gi(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...Sp(n,o),...wp()};if(l)for(const d of ri)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,Cp());return As(e,s)?s:e}function Rp(e,t,n){const i=lp(e);i&&(e={...e,...i});const o=Ms(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,d=gi(e),a=gi(t),p=e.type==="b"||e.type===void 0&&t.type==="b",u=typeof l=="number"?l:typeof s=="number"?s:En.length,S=T=>{if(p)return T;const P=Vi({...t,...T}),R=gi(T),F=oo(u,R,P),b=Tp(u,F,{...t,...T});return Object.keys(b).length===0?T:{...T,...b}};if(typeof l=="number"&&l!==s)return e;const x=El(e),y=El(t);if(!Lp(x,y))return S({...e,...Ip(x,y,t,u)});if(d<a&&typeof u=="number"&&!p){const T=Vi({...t,...e});return S({...e,...$p(u,d,T)})}if(p){const T=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,P=Math.max(0,(d-o)/2);return T>P?{...e,textPaddingLR:P}:e}const m=Vi({...t,...e}),f=oo(u,a,Vi(t)),w=oo(u,d,m).some((T,P)=>T<(f[P]??T)),C=Gt.some(T=>{const P=e[T],R=t[T];return typeof P=="number"&&typeof R=="number"&&P!==R});return w||C?S(e):e}function Mp(e,t,n,i){const o=t.slice(0,e).reduce((s,d)=>s+d,0),l=n.slice(e+1,t.length-1).reduce((s,d)=>s+d,0);return Math.max($i,i-o-l-$i)}function _p(e,t){return Math.random()*(t-e)+e}function Wp(e){return Object.fromEntries(Gt.map(t=>[t,typeof e[t]=="number"?e[t]:_s[t]]))}function Vo(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Ap(e,t,n,i,o,l){return e.slice(0,t).map((s,d)=>{const a=ii[d],p=oi[d],u=ri[d];return{key:s,textPrefix:mp[s],widthKey:Gt[d],width:n[Gt[d]],paddingLeftKey:a,paddingRightKey:p,paddingBottomKey:u,paddingLeft:i[a],paddingRight:o[p],paddingBottom:l[u]}})}function Pp({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:d}){const{prefix:a}=E.useScopedStyles(),p=!!o,{columns:u,type:S,wrapperWidth:x,entriesCount:y,cellMinHeight:m,dividerWidth:f,showVisibility:$,cut:w,showCut:C,cutCellMinHeight:T,cutLabel:P,imageSize:R,imageOnHover:F,entryHoverEffect:b,entryHoverShowOption:_,rowPaddingTop:V,rowPaddingBottom:h,rowPaddingTopB:L,columnsOrder:I,textPaddingLR:k,textColor:z,backgroundColor:le,dividerColor:O,textHoverColor:W,backgroundHoverColor:G,dividerHoverColor:K}=e,[H,q]=c.useState(void 0),[te,se]=c.useState(null),N=F==="on"&&(!n||i),ce=(w??0)>0,g=S==="b",ne=c.useRef(null),fe=c.useRef(null),[ie,we]=c.useState(null),[me,oe]=c.useState(Ti),B=Ms(me),Q=Math.max(0,((x??0)-B)/2),U=Math.min(k??0,Q),Y=Math.max(U,Xn),Ie=((x??0)+B)/2;c.useLayoutEffect(()=>{if(!n){oe(Ti);return}const ee=()=>{oe(bp(ne.current))};ee();const ye=ne.current;if(!ye)return;const Le=new ResizeObserver(ee);Le.observe(ye);let Oe=ye;for(;Oe&&!Oe.style.getPropertyValue("--cntrl-article-width");)Oe=Oe.parentElement;return Oe&&Le.observe(Oe),()=>Le.disconnect()},[n,s]),c.useEffect(()=>{q(void 0)},[w,C,t,y]),c.useEffect(()=>{n&&!i&&q(void 0)},[n,i]);const Me=E.buildColorVars(a,{textColor:z,backgroundColor:le,dividerColor:O,textHoverColor:W,backgroundHoverColor:G,dividerHoverColor:K},yp,vp),Ae=l&&l!=="default"?`${a}-state-${l}`:"",xe=`${!n||i?b==="default"?`${a}-entry-hover-default`:b==="blinds"?`${a}-entry-hover-blinds`:b==="reveal"?`${a}-entry-hover-reveal`:"":""} ${Ae}`.trim(),j=b==="reveal"&&(!n||i),ae=($==null?void 0:$[0])??!1,A=($==null?void 0:$[1])??!1,D=c.useRef(e),X=c.useRef(s);c.useEffect(()=>{if(!d||!n){D.current=e,X.current=s;return}if(X.current!==s){D.current=e,X.current=s;return}const ee=D.current;if(!(ee!==e))return;if(typeof ee.columns=="number"&&typeof e.columns=="number"&&ee.columns!==e.columns){D.current=e;return}const Le=Rp(e,ee,{designWidth:me});D.current=e,As(e,Le)&&d(Le)},[e,d,n,s,me]);const J=c.useMemo(()=>Wp(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ge=c.useMemo(()=>Vo(e,ii),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),Ce=c.useMemo(()=>Vo(e,oi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),De=c.useMemo(()=>Vo(e,ri),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Re=c.useMemo(()=>Array.isArray(I)&&I.length>0?I:[...En],[I]),$e=c.useMemo(()=>Ap(Re,u,J,ge,Ce,De),[Re,u,J,ge,Ce,De]),Ge=gi(e),pe=c.useMemo(()=>Gt.slice(0,u).map(ee=>J[ee]),[u,J]),Ee=c.useMemo(()=>Fr(u,Ge,J),[u,Ge,J]),je=c.useMemo(()=>oo(u,Ge,J),[u,Ge,J]),ze=c.useMemo(()=>$e.map((ee,ye)=>Ws(je[ye]??0,ee.paddingLeft,ee.paddingRight)),[$e,je]),Ve=c.useMemo(()=>{const ee=y===0?1/0:y;return(t??[]).slice(0,ee).map((Le,Oe)=>({id:Oe,cells:Object.fromEntries(En.map(Ke=>[Ke,Le[Ke]??""])),image:Le.image,link:Le.link}))},[t,y]),It=ce?H??w:Ve.length,pt=c.useMemo(()=>ce?Ve.slice(0,It):Ve,[Ve,ce,It]),$t=ce&&It<Ve.length,Ye=pt.length>1||$t,ft=[ae?`${a}-divider-top`:"",A||Ye?`${a}-divider-bottom`:""].filter(Boolean).join(" "),bt=!n||i,Ot=()=>{if(!bt)return;const ee=H??w;if(!C){q(Ve.length);return}q(Math.min(ee+C,Ve.length))},We=ee=>E.scalingValue(ee,n??!1),wt=g?L??0:V??0,Qe=h??0,Et=m??0,kt=wt+Et/2,sn=Math.max(Qe,zo),At=bl(0,pt.length,ae,A,$t,f??0,n??!1).borderTopWidth,Dt=ie!=null?`${ie}px`:`calc(${At} + ${We(kt)})`,zt=g?"rowPaddingTopB":"rowPaddingTop",Fe=$e[0],ct=$e[$e.length-1],mt=ze[0],et=ze[ze.length-1],tt=Fe&&mt?Math.max(mt.paddingLeft,Xn):0,Ft=ct&&et?Math.max(et.paddingRight,Xn):0,Vt=Ge,Nt=ee=>{const ye=ne.current;if(!ye)return{x:0,y:0};const Le=ye.getBoundingClientRect();return{x:ee.clientX-Le.left+Sl,y:ee.clientY-Le.top+Sl}},bn=(ee,ye)=>{if(!N)return;const Le=ee.image;if(!(Le!=null&&Le.url)){se(null);return}const{x:Oe,y:Ke}=Nt(ye),Ue=(R==null?void 0:R.min)??80,ve=(R==null?void 0:R.max)??320,gt=(te==null?void 0:te.rowId)===ee.id?te.widthPx:_p(Ue,ve);se({rowId:ee.id,url:Le.url,objectFit:"contain",isVideo:Ju(Le),widthPx:gt,x:Oe,y:Ke})},Je=ee=>{if(!N||!te)return;const{x:ye,y:Le}=Nt(ee);se(Oe=>!Oe||Oe.x===ye&&Oe.y===Le?Oe:{...Oe,x:ye,y:Le})},an=()=>{se(null)},Sn=ee=>{j&&vl(ee,a),N&&se(null)},Ne=ee=>{j&&xl(ee,a)};c.useLayoutEffect(()=>{if(!p||g){we(null);return}const ee=fe.current,ye=ee==null?void 0:ee.parentElement;if(!ee||!ye){we(null);return}const Le=()=>{const Ke=ee.querySelector("[data-list-row]");if(!Ke){we(null);return}const Ue=ye.getBoundingClientRect(),ve=Ke.getBoundingClientRect();we(ve.top-Ue.top+ve.height/2)};Le();const Oe=new ResizeObserver(Le);return Oe.observe(ee),Oe.observe(ye),()=>Oe.disconnect()},[p,g,pt,wt,Qe,Et,t,e,$e,je,me,f,ae,A,$t]);const yt=c.useMemo(()=>!g&&Wr.some(ee=>{const ye=ee.charAt(0),Le=e[`${ee}VerticalAlign`];return Rs(Le,e,ye)}),[g,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);c.useLayoutEffect(()=>{var gt;const ee=ne.current;if(!ee)return;const ye=()=>{ee.querySelectorAll("[data-list-col]").forEach(ot=>{ot.style.transform="";const dt=ot.querySelector(`.${a}-list-col`);dt&&(dt.style.minHeight="",dt.style.height="");const vt=ot.querySelector(`.${a}-list-col-title`);vt&&(vt.style.transform="")})};if(g||!yt){ye();return}const Le=()=>{const ot=Array.from(ee.querySelectorAll("[data-list-row]")),dt=`${a}-list-col`,vt=`${a}-baseline-probe`;ot.forEach(He=>{He.querySelectorAll("[data-list-col]").forEach(St=>{St.style.transform="";const nt=St.querySelector(`.${dt}`);nt&&(nt.style.minHeight="",nt.style.height="");const Ct=St.querySelector(`.${a}-list-col-title`);Ct&&(Ct.style.transform="")})}),ot.forEach(He=>{const St=Array.from(He.querySelectorAll("[data-list-col]"));up(He,St,dt)}),ee.offsetHeight,ot.forEach(He=>{const St=Array.from(He.querySelectorAll("[data-list-col]")),nt=He.getBoundingClientRect().top,Ct=new Map,Qt=St.map(ut=>{const jt=ut.querySelector(`.${a}-list-col-title`),v={el:ut,titleEl:jt,letter:ut.getAttribute("data-col-letter")??"",kind:ut.getAttribute("data-valign")??"top",anchor:ut.getAttribute("data-valign-anchor")};return Ct.set(v.letter,v),v}),ht=new Map,en=(ut,jt)=>{const v=ht.get(ut.letter);if(v!==void 0)return v;const Z=ut.anchor?Ct.get(ut.anchor):void 0;if(ut.kind!=="baseline"||!Z||jt.has(ut.letter)){const Mt=jo(ut,nt,dt,vt);return ht.set(ut.letter,Mt),Mt}jt.add(ut.letter);const re=en(Z,jt);jt.delete(ut.letter);const he=jo(ut,nt,dt,vt),ke=re-he;pp(ut.titleEl,ke);const it=jo(ut,nt,dt,vt);return ht.set(ut.letter,it),it};Qt.forEach(ut=>en(ut,new Set))})};let Oe=null;const Ke=()=>{Oe===null&&(Oe=requestAnimationFrame(()=>{Oe=null,Le()}))};Le();const Ue=new ResizeObserver(()=>Ke());Ue.observe(ee);let ve=!1;return typeof document<"u"&&((gt=document.fonts)!=null&>.ready)&&document.fonts.ready.then(()=>{ve||Ke()}),()=>{ve=!0,Oe!==null&&(cancelAnimationFrame(Oe),Oe=null),Ue.disconnect(),ye()}},[yt,g,e,t,me,pt,je]);const Rt=c.useMemo(()=>tp(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Rt}}),r.jsx("div",{style:Me,children:r.jsxs("div",{ref:ne,className:`${a}-wrapper ${xe}${ft?` ${ft}`:""}${g?` ${a}-type-b`:""}`.trim(),style:{width:E.scalingValue(x??0,n),...!g&&p?{[`--${a}-first-entry-handle-top`]:Dt}:{}},onMouseMove:N?Je:void 0,onMouseLeave:N?an:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[pt.map((ee,ye)=>{var Ue;const Le=(((Ue=ee.link)==null?void 0:Ue.length)??0)>0,Oe=Le&&(!n||i)?"a":"div",Ke=bl(ye,pt.length,ae,A,$t,f??0,n??!1);return r.jsxs(Oe,{ref:ye===0?ve=>{fe.current=ve}:void 0,className:`${a}-list-item${Le||_==="always"?` ${a}-list-item-has-link`:""}`,...Le?{href:ee.link,target:"_blank"}:{},style:Ke,onMouseEnter:ve=>{j&&(Le||_==="always")&&vl(ve,a),N&&bn(ee,ve)},onMouseLeave:ve=>{j&&(Le||_==="always")&&xl(ve,a)},children:[wt>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:We(wt)}}),r.jsxs("div",{className:`${a}-list-cols-row${g?"":` ${a}-list-cols-row-h`}${p&&ye===0&&g?` ${a}-list-cols-row-controls`:""}`,...g?{}:{"data-list-row":""},style:g?void 0:{minHeight:We(Et)},children:[$e.map((ve,gt)=>{const ot=gt===$e.length-1,dt=ze[gt],vt=ve.paddingBottom,He=Qu(ee.cells[ve.key]),St=g&&He&&vt>0,nt=g?{minHeight:We(Et)}:{width:We(je[gt])},Ct=g?{paddingLeft:We(U),paddingRight:We(U)}:{paddingLeft:We(dt.paddingLeft),paddingRight:We(dt.paddingRight)},Qt=ve.textPrefix.charAt(0),ht=g?rp(e[`${ve.textPrefix}VerticalAlign`]):op(e[`${ve.textPrefix}VerticalAlign`],e,Qt),en=g&&He&&p&&ye===0;return r.jsxs("div",{className:g?`${a}-list-col-wrap`:void 0,...g?{}:{"data-list-col":"","data-col-letter":Qt,"data-valign":ht.kind,...ht.kind==="baseline"?{"data-valign-anchor":ht.anchorLetter}:{}},children:[r.jsx("div",{className:`${a}-list-col${ot?` ${a}-list-col-last`:""}`,style:{...Ct,...nt,...g?{justifyContent:wl(ht.kind)}:{}},"data-test":ve.width,children:r.jsx("span",{className:Tl(e,ve.textPrefix,`${a}-list-col-title`,`${a}-text-tight-leading`),style:{...Cl(go(e,ve.textPrefix),n),...$l(e,ve.textPrefix,a,n),...g?{}:sp(ht.kind)},children:ee.cells[ve.key]??null})}),St&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:We(vt)}}),en&&r.jsx(un,{P:a,"data-controls":ve.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:We(Math.max(vt,zo))}})]},ve.key)}),p&&ye===0&&g&&r.jsxs(r.Fragment,{children:[r.jsx(un,{P:a,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ie),className:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:We(Y),height:"100%"}}),r.jsx(un,{P:a,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ie),className:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:We(Math.max(Y,Ge-Y)),width:We(Y),height:"100%"}})]})]}),!g&&Qe>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:We(Qe)}}),p&&ye===0&&!g&&r.jsx(un,{P:a,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:We(sn)}})]},ee.id)}),p&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(un,{P:a,"data-controls":zt,"data-controls-static-handle":"",...g?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:g?"center":"left-y",areaStyle:{position:"absolute",top:At,left:0,width:"100%",height:We(Math.max(wt,zo))}})},"row-padding-handles"),p&&!g&&Fe&&ct&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(un,{P:a,"data-controls":Fe.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[0]-((mt==null?void 0:mt.paddingRight)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:We(tt),height:"100%"}}),r.jsx(un,{P:a,"data-controls":ct.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(je[$e.length-1]-((et==null?void 0:et.paddingLeft)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:We(Vt-Ft),width:We(Ft),height:"100%"}})]},"column-edge-padding-handles"),p&&!g&&$e.slice(0,-1).map((ee,ye)=>{const Le=$e[ye+1],Oe=Ee.slice(0,ye+1).reduce((ot,dt)=>ot+dt,0),Ke=ze[ye],Ue=ze[ye+1],ve=Math.max(Ke.paddingRight,Xn),gt=Math.max(Ue.paddingLeft,Xn);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(un,{P:a,"data-controls":ee.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(je[ye]-Ke.paddingLeft),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:We(Oe-ve),width:We(ve),height:"100%"}}),r.jsx(un,{P:a,"data-controls":Le.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(je[ye+1]-Ue.paddingRight),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:We(Oe),width:We(gt),height:"100%"}})]},`${ee.paddingRightKey}-padding`)}),p&&!g&&$e.slice(0,-1).map((ee,ye)=>{const Le=Mp(ye,Ee,pe,Ge),Ke=Ee.slice(0,ye+1).reduce((Ue,ve)=>Ue+ve,0)-Ll/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ee.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(kr),"data-controls-max-fraction":String(Le),"data-controls-variant":"column-width",className:`${a}-col-resize-handle`,style:{position:"absolute",top:"0px",left:We(Ke),width:We(Ll),height:"calc(100%)",pointerEvents:"auto"}})},`${ee.widthKey}-junction`)})]}),$t&&(()=>{const ee=go(e,fn),ye=ap(e.cutLabelVerticalAlign),Le=ee.textTextAlign==="justify"||g;return r.jsx("button",{type:"button",className:`${a}-cut-item`,style:{minHeight:We(T??0),cursor:bt?"pointer":"default",...ep(A,f??0,n??!1)},onClick:bt?Ot:void 0,onMouseEnter:j||N?Sn:void 0,onMouseLeave:j?Ne:void 0,children:r.jsx("div",{className:`${a}-list-cols-row`,style:{...g?{paddingLeft:We(U),paddingRight:We(U)}:{},justifyContent:cp(ee.textTextAlign),alignItems:wl(ye)},children:r.jsx("span",{className:Tl(e,fn,`${a}-cut-label`,`${a}-text-tight-leading`),style:{...Cl(ee,n),...$l(e,fn,a,n),...Le?{width:"100%"}:{}},children:P})})})})(),N&&te&&(()=>{const ee=io(te.widthPx),ye={width:ee,height:"auto",maxHeight:ee,objectFit:"contain",left:te.x,top:te.y,position:"absolute"};return r.jsx(Zu,{media:te,className:te.isVideo?`${a}-hover-video`:`${a}-hover-image`,style:ye},`${te.rowId}-${te.url}`)})()]})})]})}const kp=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ComponentPropsWithoutRef } from 'react';
|
|
5448
|
+
`}const kn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Or=["AColumn","BColumn","CColumn","DColumn","EColumn"],Sn="cutLabel",Dr=[...Or,Sn],Fo=["A","B","C","D","E"];function Ws(e){return`${e}ColumnVerticalAlign`}const gr=["Top","Center","Bottom"];function jr(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Fo.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function np(e){const t=jr(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function ip(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Fo.includes(n)?n:null}function _s(e,t,n){const i=ip(e);return i?i===t?!1:np(n[Ws(i)]):!0}function Ai(e){const t=jr(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Fo.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function op(e,t,n){if(As(e,t,n))return Ai(e);const i=Ai(e);return i.kind==="baseline"?{kind:"top"}:i}function rp(e){const t=Ai(e);return t.kind==="baseline"?{kind:"top"}:t}function As(e,t,n){return _s(e,n,t)?Ai(e).kind==="baseline":!1}function lp(e){const t={};let n=!1;for(const i of Fo){const o=Ws(i),l=e[o];if(e.type==="b"){const s=String(l??"Top").trim();s!=="Top"&&s!=="Center"&&s!=="Bottom"&&(t[o]="Top",n=!0);continue}_s(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function sp(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function ap(e){const t=Ai(e).kind;return t==="baseline"?"center":t}function cp(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Ll(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function dp(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),l=o-i;return n.remove(),l}function Yo(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=dp(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+s;const d=l.getBoundingClientRect(),a=o.getBoundingClientRect().height;let p=0;return e.kind==="center"?p=(d.height-a)/2:e.kind==="bottom"&&(p=d.height-a),d.top-t+p+s}function up(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const l=o.querySelector(`.${n}`);l&&(l.style.minHeight=`${i}px`,l.style.height=`${i}px`)}),i)}function pp(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const mp={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Xe(e,t){return`${e}${t.replace(/^text/,"Text")}`}const gp={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function hp(e){return[Xe(e,"textFontFamily"),Xe(e,"textFontSettings"),{type:"row",items:[Xe(e,"textFontSize"),Xe(e,"textLineHeight"),Xe(e,"textLetterSpacing"),Xe(e,"textWordSpacing")]},Xe(e,"textTextAlign"),Xe(e,"textTextAppearance"),`${e}VerticalAlign`]}function fp(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Dr.map(e=>[gp[e],hp(e)]))}}function wo(e,t){const n=i=>{const o=Xe(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===Sn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function El(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 sn(Pt(n,t))}function Il(e,t,n,i){const o=wo(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function Rl(e,t,n,i){const o=wo(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:R.scalingValue((l-s)/2,i)}}const qt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],mi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],gi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],hi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],yp={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},vp=["hover","focus","filled","success","error"],Ml=.004,ri=.004,Jo=ri,Wl=12,zr=50,Pi=1440,ki=zr/Pi;function Ps(e){const t=typeof e=="number"&&e>0?e:Pi;return zr/t}function xp(e,t){const n={position:"absolute",width:Wl,height:Wl,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 fn({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:xp(e,i)})})}function bp(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 Pi}const ks={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Ti(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Sp(e,t=1){const n=t/e;return Object.fromEntries(qt.map(i=>[i,n]))}function wp(){return Object.fromEntries([...mi.map(e=>[e,0]),...gi.map(e=>[e,0])])}function Cp(){return Object.fromEntries(hi.map(e=>[e,0]))}function Zi(e){return Object.fromEntries(qt.map(t=>[t,typeof e[t]=="number"?e[t]:ks[t]]))}function Fs(e,t,n){const i=e-ki,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const l=i/o;return{paddingLeft:t*l,paddingRight:n*l}}function mo(e,t,n){const i=Vr(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((l,s)=>l+s,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function Tp(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=mi[o],s=gi[o],d=typeof n[l]=="number"?n[l]:0,a=typeof n[s]=="number"?n[s]:0,p=Fs(t[o]??0,d,a);p.paddingLeft!==d&&(i[l]=p.paddingLeft),p.paddingRight!==a&&(i[s]=p.paddingRight)}return i}function Vr(e,t,n){if(e<=0)return[];const i=qt.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)+ki;if(t>=s)return i;const d=[...o];let a=s-t;for(let p=d.length-1;p>=0&&a>0;p-=1){const u=d[p]-ki;if(u<=0)continue;const S=Math.min(a,u);d[p]-=S,a-=S}return[...d,i[e-1]]}function $p(e,t,n){if(e<=1)return{};const i=Vr(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=qt[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function _l(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...kn]}function Lp(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Ep(e,t,n,i){const o=Math.min(i,e.length,qt.length),l={};for(let s=0;s<o;s+=1){const d=e[s],a=t.indexOf(d);if(a===-1)continue;const p=qt[a],u=mi[a],S=gi[a],x=hi[a],v=qt[s],m=mi[s],y=gi[s],$=hi[s],w=n[p],C=n[u],T=n[S],P=n[x];typeof w=="number"&&(l[v]=w),typeof C=="number"&&(l[m]=C),typeof T=="number"&&(l[y]=T),typeof P=="number"&&(l[$]=P)}return l}function Ns(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 Ip(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Ti(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...Sp(n,o),...wp()};if(l)for(const d of hi)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,Cp());return Ns(e,s)?s:e}function Rp(e,t,n){const i=lp(e);i&&(e={...e,...i});const o=Ps(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,d=Ti(e),a=Ti(t),p=e.type==="b"||e.type===void 0&&t.type==="b",u=typeof l=="number"?l:typeof s=="number"?s:kn.length,S=T=>{if(p)return T;const P=Zi({...t,...T}),M=Ti(T),F=mo(u,M,P),b=Tp(u,F,{...t,...T});return Object.keys(b).length===0?T:{...T,...b}};if(typeof l=="number"&&l!==s)return e;const x=_l(e),v=_l(t);if(!Lp(x,v))return S({...e,...Ep(x,v,t,u)});if(d<a&&typeof u=="number"&&!p){const T=Zi({...t,...e});return S({...e,...$p(u,d,T)})}if(p){const T=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,P=Math.max(0,(d-o)/2);return T>P?{...e,textPaddingLR:P}:e}const m=Zi({...t,...e}),y=mo(u,a,Zi(t)),w=mo(u,d,m).some((T,P)=>T<(y[P]??T)),C=qt.some(T=>{const P=e[T],M=t[T];return typeof P=="number"&&typeof M=="number"&&P!==M});return w||C?S(e):e}function Mp(e,t,n,i){const o=t.slice(0,e).reduce((s,d)=>s+d,0),l=n.slice(e+1,t.length-1).reduce((s,d)=>s+d,0);return Math.max(ki,i-o-l-ki)}function Wp(e,t){return Math.random()*(t-e)+e}function _p(e){return Object.fromEntries(qt.map(t=>[t,typeof e[t]=="number"?e[t]:ks[t]]))}function Zo(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Ap(e,t,n,i,o,l){return e.slice(0,t).map((s,d)=>{const a=mi[d],p=gi[d],u=hi[d];return{key:s,textPrefix:mp[s],widthKey:qt[d],width:n[qt[d]],paddingLeftKey:a,paddingRightKey:p,paddingBottomKey:u,paddingLeft:i[a],paddingRight:o[p],paddingBottom:l[u]}})}function Pp({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:d}){const{prefix:a}=R.useScopedStyles(),p=!!o,{columns:u,type:S,wrapperWidth:x,entriesCount:v,cellMinHeight:m,dividerWidth:y,showVisibility:$,cut:w,showCut:C,cutCellMinHeight:T,cutLabel:P,imageSize:M,imageOnHover:F,entryHoverEffect:b,entryHoverShowOption:W,rowPaddingTop:K,rowPaddingBottom:h,rowPaddingTopB:L,columnsOrder:E,textPaddingLR:k,textColor:z,backgroundColor:le,dividerColor:O,textHoverColor:_,backgroundHoverColor:q,dividerHoverColor:G}=e,[H,X]=c.useState(void 0),[ne,se]=c.useState(null),N=F==="on"&&(!n||i),de=(w??0)>0,g=S==="b",ie=c.useRef(null),fe=c.useRef(null),[oe,Ce]=c.useState(null),[me,re]=c.useState(Pi),B=Ps(me),Q=Math.max(0,((x??0)-B)/2),U=Math.min(k??0,Q),J=Math.max(U,ri),Me=((x??0)+B)/2;c.useLayoutEffect(()=>{if(!n){re(Pi);return}const te=()=>{re(bp(ie.current))};te();const ye=ie.current;if(!ye)return;const Ie=new ResizeObserver(te);Ie.observe(ye);let De=ye;for(;De&&!De.style.getPropertyValue("--cntrl-article-width");)De=De.parentElement;return De&&Ie.observe(De),()=>Ie.disconnect()},[n,s]),c.useEffect(()=>{X(void 0)},[w,C,t,v]),c.useEffect(()=>{n&&!i&&X(void 0)},[n,i]);const Ae=R.buildColorVars(a,{textColor:z,backgroundColor:le,dividerColor:O,textHoverColor:_,backgroundHoverColor:q,dividerHoverColor:G},yp,vp),ke=l&&l!=="default"?`${a}-state-${l}`:"",xe=`${!n||i?b==="default"?`${a}-entry-hover-default`:b==="blinds"?`${a}-entry-hover-blinds`:b==="reveal"?`${a}-entry-hover-reveal`:"":""} ${ke}`.trim(),j=b==="reveal"&&(!n||i),ae=($==null?void 0:$[0])??!1,A=($==null?void 0:$[1])??!1,D=c.useRef(e),Y=c.useRef(s);c.useEffect(()=>{if(!d||!n){D.current=e,Y.current=s;return}if(Y.current!==s){D.current=e,Y.current=s;return}const te=D.current;if(!(te!==e))return;if(typeof te.columns=="number"&&typeof e.columns=="number"&&te.columns!==e.columns){D.current=e;return}const Ie=Rp(e,te,{designWidth:me});D.current=e,Ns(e,Ie)&&d(Ie)},[e,d,n,s,me]);const Z=c.useMemo(()=>_p(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),ge=c.useMemo(()=>Zo(e,mi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),Te=c.useMemo(()=>Zo(e,gi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),je=c.useMemo(()=>Zo(e,hi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),_e=c.useMemo(()=>Array.isArray(E)&&E.length>0?E:[...kn],[E]),Le=c.useMemo(()=>Ap(_e,u,Z,ge,Te,je),[_e,u,Z,ge,Te,je]),Ge=Ti(e),pe=c.useMemo(()=>qt.slice(0,u).map(te=>Z[te]),[u,Z]),We=c.useMemo(()=>Vr(u,Ge,Z),[u,Ge,Z]),ze=c.useMemo(()=>mo(u,Ge,Z),[u,Ge,Z]),Ve=c.useMemo(()=>Le.map((te,ye)=>Fs(ze[ye]??0,te.paddingLeft,te.paddingRight)),[Le,ze]),Ne=c.useMemo(()=>{const te=v===0?1/0:v;return(t??[]).slice(0,te).map((Ie,De)=>({id:De,cells:Object.fromEntries(kn.map(qe=>[qe,Ie[qe]??""])),image:Ie.image,link:Ie.link}))},[t,v]),It=de?H??w:Ne.length,dt=c.useMemo(()=>de?Ne.slice(0,It):Ne,[Ne,de,It]),bt=de&&It<Ne.length,Ze=dt.length>1||bt,yt=[ae?`${a}-divider-top`:"",A||Ze?`${a}-divider-bottom`:""].filter(Boolean).join(" "),Mt=!n||i,Ht=()=>{if(!Mt)return;const te=H??w;if(!C){X(Ne.length);return}X(Math.min(te+C,Ne.length))},Ee=te=>R.scalingValue(te,n??!1),it=g?L??0:K??0,Ue=h??0,ut=m??0,Bt=it+ut/2,rn=Math.max(Ue,Jo),jt=Tl(0,dt.length,ae,A,bt,y??0,n??!1).borderTopWidth,Yt=oe!=null?`${oe}px`:`calc(${jt} + ${Ee(Bt)})`,ln=g?"rowPaddingTopB":"rowPaddingTop",He=Le[0],Tt=Le[Le.length-1],pt=Ve[0],et=Ve[Ve.length-1],mt=He&&pt?Math.max(pt.paddingLeft,ri):0,zt=Tt&&et?Math.max(et.paddingRight,ri):0,Vt=Ge,Jt=te=>{const ye=ie.current;if(!ye)return{x:0,y:0};const Ie=ye.getBoundingClientRect();return{x:te.clientX-Ie.left+$l,y:te.clientY-Ie.top+$l}},pn=(te,ye)=>{if(!N)return;const Ie=te.image;if(!(Ie!=null&&Ie.url)){se(null);return}const{x:De,y:qe}=Jt(ye),Qe=(M==null?void 0:M.min)??80,ve=(M==null?void 0:M.max)??320,$t=(ne==null?void 0:ne.rowId)===te.id?ne.widthPx:Wp(Qe,ve);se({rowId:te.id,url:Ie.url,objectFit:"contain",isVideo:Ju(Ie),widthPx:$t,x:De,y:qe})},Ke=te=>{if(!N||!ne)return;const{x:ye,y:Ie}=Jt(te);se(De=>!De||De.x===ye&&De.y===Ie?De:{...De,x:ye,y:Ie})},Zt=()=>{se(null)},kt=te=>{j&&wl(te,a),N&&se(null)},Pe=te=>{j&&Cl(te,a)};c.useLayoutEffect(()=>{if(!p||g){Ce(null);return}const te=fe.current,ye=te==null?void 0:te.parentElement;if(!te||!ye){Ce(null);return}const Ie=()=>{const qe=te.querySelector("[data-list-row]");if(!qe){Ce(null);return}const Qe=ye.getBoundingClientRect(),ve=qe.getBoundingClientRect();Ce(ve.top-Qe.top+ve.height/2)};Ie();const De=new ResizeObserver(Ie);return De.observe(te),De.observe(ye),()=>De.disconnect()},[p,g,dt,it,Ue,ut,t,e,Le,ze,me,y,ae,A,bt]);const ft=c.useMemo(()=>!g&&Or.some(te=>{const ye=te.charAt(0),Ie=e[`${te}VerticalAlign`];return As(Ie,e,ye)}),[g,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);c.useLayoutEffect(()=>{var $t;const te=ie.current;if(!te)return;const ye=()=>{te.querySelectorAll("[data-list-col]").forEach(gt=>{gt.style.transform="";const ht=gt.querySelector(`.${a}-list-col`);ht&&(ht.style.minHeight="",ht.style.height="");const ot=gt.querySelector(`.${a}-list-col-title`);ot&&(ot.style.transform="")})};if(g||!ft){ye();return}const Ie=()=>{const gt=Array.from(te.querySelectorAll("[data-list-row]")),ht=`${a}-list-col`,ot=`${a}-baseline-probe`;gt.forEach(Be=>{Be.querySelectorAll("[data-list-col]").forEach(vt=>{vt.style.transform="";const rt=vt.querySelector(`.${ht}`);rt&&(rt.style.minHeight="",rt.style.height="");const wt=vt.querySelector(`.${a}-list-col-title`);wt&&(wt.style.transform="")})}),gt.forEach(Be=>{const vt=Array.from(Be.querySelectorAll("[data-list-col]"));up(Be,vt,ht)}),te.offsetHeight,gt.forEach(Be=>{const vt=Array.from(Be.querySelectorAll("[data-list-col]")),rt=Be.getBoundingClientRect().top,wt=new Map,_t=vt.map(tt=>{const Ft=tt.querySelector(`.${a}-list-col-title`),Kt={el:tt,titleEl:Ft,letter:tt.getAttribute("data-col-letter")??"",kind:tt.getAttribute("data-valign")??"top",anchor:tt.getAttribute("data-valign-anchor")};return wt.set(Kt.letter,Kt),Kt}),St=new Map,At=(tt,Ft)=>{const Kt=St.get(tt.letter);if(Kt!==void 0)return Kt;const $n=tt.anchor?wt.get(tt.anchor):void 0;if(tt.kind!=="baseline"||!$n||Ft.has(tt.letter)){const Qt=Yo(tt,rt,ht,ot);return St.set(tt.letter,Qt),Qt}Ft.add(tt.letter);const Bn=At($n,Ft);Ft.delete(tt.letter);const Ln=Yo(tt,rt,ht,ot),Yn=Bn-Ln;pp(tt.titleEl,Yn);const Jn=Yo(tt,rt,ht,ot);return St.set(tt.letter,Jn),Jn};_t.forEach(tt=>At(tt,new Set))})};let De=null;const qe=()=>{De===null&&(De=requestAnimationFrame(()=>{De=null,Ie()}))};Ie();const Qe=new ResizeObserver(()=>qe());Qe.observe(te);let ve=!1;return typeof document<"u"&&(($t=document.fonts)!=null&&$t.ready)&&document.fonts.ready.then(()=>{ve||qe()}),()=>{ve=!0,De!==null&&(cancelAnimationFrame(De),De=null),Qe.disconnect(),ye()}},[ft,g,e,t,me,dt,ze]);const Wt=c.useMemo(()=>tp(a),[a]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Wt}}),r.jsx("div",{style:Ae,children:r.jsxs("div",{ref:ie,className:`${a}-wrapper ${xe}${yt?` ${yt}`:""}${g?` ${a}-type-b`:""}`.trim(),style:{width:R.scalingValue(x??0,n),...!g&&p?{[`--${a}-first-entry-handle-top`]:Yt}:{}},onMouseMove:N?Ke:void 0,onMouseLeave:N?Zt:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[dt.map((te,ye)=>{var Qe;const Ie=(((Qe=te.link)==null?void 0:Qe.length)??0)>0,De=Ie&&(!n||i)?"a":"div",qe=Tl(ye,dt.length,ae,A,bt,y??0,n??!1);return r.jsxs(De,{ref:ye===0?ve=>{fe.current=ve}:void 0,className:`${a}-list-item${Ie||W==="always"?` ${a}-list-item-has-link`:""}`,...Ie?{href:te.link,target:"_blank"}:{},style:qe,onMouseEnter:ve=>{j&&(Ie||W==="always")&&wl(ve,a),N&&pn(te,ve)},onMouseLeave:ve=>{j&&(Ie||W==="always")&&Cl(ve,a)},children:[it>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:Ee(it)}}),r.jsxs("div",{className:`${a}-list-cols-row${g?"":` ${a}-list-cols-row-h`}${p&&ye===0&&g?` ${a}-list-cols-row-controls`:""}`,...g?{}:{"data-list-row":""},style:g?void 0:{minHeight:Ee(ut)},children:[Le.map((ve,$t)=>{const gt=$t===Le.length-1,ht=Ve[$t],ot=ve.paddingBottom,Be=Qu(te.cells[ve.key]),vt=g&&Be&&ot>0,rt=g?{minHeight:Ee(ut)}:{width:Ee(ze[$t])},wt=g?{paddingLeft:Ee(U),paddingRight:Ee(U)}:{paddingLeft:Ee(ht.paddingLeft),paddingRight:Ee(ht.paddingRight)},_t=ve.textPrefix.charAt(0),St=g?rp(e[`${ve.textPrefix}VerticalAlign`]):op(e[`${ve.textPrefix}VerticalAlign`],e,_t),At=g&&Be&&p&&ye===0;return r.jsxs("div",{className:g?`${a}-list-col-wrap`:void 0,...g?{}:{"data-list-col":"","data-col-letter":_t,"data-valign":St.kind,...St.kind==="baseline"?{"data-valign-anchor":St.anchorLetter}:{}},children:[r.jsx("div",{className:`${a}-list-col${gt?` ${a}-list-col-last`:""}`,style:{...wt,...rt,...g?{justifyContent:Ll(St.kind)}:{}},"data-test":ve.width,children:r.jsx("span",{className:Il(e,ve.textPrefix,`${a}-list-col-title`,`${a}-text-tight-leading`),style:{...El(wo(e,ve.textPrefix),n),...Rl(e,ve.textPrefix,a,n),...g?{}:sp(St.kind)},children:te.cells[ve.key]??null})}),vt&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:Ee(ot)}}),At&&r.jsx(fn,{P:a,"data-controls":ve.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ee(Math.max(ot,Jo))}})]},ve.key)}),p&&ye===0&&g&&r.jsxs(r.Fragment,{children:[r.jsx(fn,{P:a,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Me),className:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:Ee(J),height:"100%"}}),r.jsx(fn,{P:a,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Me),className:`${a}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:Ee(Math.max(J,Ge-J)),width:Ee(J),height:"100%"}})]})]}),!g&&Ue>0&&r.jsx("div",{className:`${a}-row-padding-handle`,style:{height:Ee(Ue)}}),p&&ye===0&&!g&&r.jsx(fn,{P:a,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:Ee(rn)}})]},te.id)}),p&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx(fn,{P:a,"data-controls":ln,"data-controls-static-handle":"",...g?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${a}-padding-control-handle`,hitPlacement:g?"center":"left-y",areaStyle:{position:"absolute",top:jt,left:0,width:"100%",height:Ee(Math.max(it,Jo))}})},"row-padding-handles"),p&&!g&&He&&Tt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(fn,{P:a,"data-controls":He.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ze[0]-((pt==null?void 0:pt.paddingRight)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:Ee(mt),height:"100%"}}),r.jsx(fn,{P:a,"data-controls":Tt.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ze[Le.length-1]-((et==null?void 0:et.paddingLeft)??0)),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ee(Vt-zt),width:Ee(zt),height:"100%"}})]},"column-edge-padding-handles"),p&&!g&&Le.slice(0,-1).map((te,ye)=>{const Ie=Le[ye+1],De=We.slice(0,ye+1).reduce((gt,ht)=>gt+ht,0),qe=Ve[ye],Qe=Ve[ye+1],ve=Math.max(qe.paddingRight,ri),$t=Math.max(Qe.paddingLeft,ri);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx(fn,{P:a,"data-controls":te.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ze[ye]-qe.paddingLeft),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ee(De-ve),width:Ee(ve),height:"100%"}}),r.jsx(fn,{P:a,"data-controls":Ie.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ze[ye+1]-Qe.paddingRight),className:`${a}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:Ee(De),width:Ee($t),height:"100%"}})]},`${te.paddingRightKey}-padding`)}),p&&!g&&Le.slice(0,-1).map((te,ye)=>{const Ie=Mp(ye,We,pe,Ge),qe=We.slice(0,ye+1).reduce((Qe,ve)=>Qe+ve,0)-Ml/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":te.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(zr),"data-controls-max-fraction":String(Ie),"data-controls-variant":"column-width",className:`${a}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ee(qe),width:Ee(Ml),height:"calc(100%)",pointerEvents:"auto"}})},`${te.widthKey}-junction`)})]}),bt&&(()=>{const te=wo(e,Sn),ye=ap(e.cutLabelVerticalAlign),Ie=te.textTextAlign==="justify"||g;return r.jsx("button",{type:"button",className:`${a}-cut-item`,style:{minHeight:Ee(T??0),cursor:Mt?"pointer":"default",...ep(A,y??0,n??!1)},onClick:Mt?Ht:void 0,onMouseEnter:j||N?kt:void 0,onMouseLeave:j?Pe:void 0,children:r.jsx("div",{className:`${a}-list-cols-row`,style:{...g?{paddingLeft:Ee(U),paddingRight:Ee(U)}:{},justifyContent:cp(te.textTextAlign),alignItems:Ll(ye)},children:r.jsx("span",{className:Il(e,Sn,`${a}-cut-label`,`${a}-text-tight-leading`),style:{...El(te,n),...Rl(e,Sn,a,n),...Ie?{width:"100%"}:{}},children:P})})})})(),N&&ne&&(()=>{const te=po(ne.widthPx),ye={width:te,height:"auto",maxHeight:te,objectFit:"contain",left:ne.x,top:ne.y,position:"absolute"};return r.jsx(Zu,{media:ne,className:ne.isVideo?`${a}-hover-video`:`${a}-hover-image`,style:ye},`${ne.rowId}-${ne.url}`)})()]})})]})}const kp=`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
|
-
`,di=["A","B","C","D","E"],Rl=[...lr,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Fp(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Ki(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Np(){return Object.fromEntries(di.map((e,t)=>{const n=En[t],i=`${e} column`;return[n,Fp(i)]}))}function Hp(){const e={};for(const t of di)e[`${t}ColumnWidth`]=Ki(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Ki(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Ki(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Ki(`${t} column padding bottom`);return e}function Ml(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...En]};for(const l of di)i[`${l}ColumnWidth`]=l==="A"?.0798:.32,i[`${l}ColumnPaddingLeft`]=0,i[`${l}ColumnPaddingRight`]=0,i[`${l}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Bp(e){const t={};if(e===fn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...lr]},enum:[...lr]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Rl],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Rl]}}return t[qe(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[qe(e,"textFontSettings")]={...Pn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[qe(e,"textFontSize")]={...Pn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[qe(e,"textLineHeight")]={...Pn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[qe(e,"textLetterSpacing")]={...Pn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[qe(e,"textWordSpacing")]={...Pn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[qe(e,"textTextAlign")]={...Pn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[qe(e,"textTextAppearance")]={...Pn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Op=Ar.reduce((e,t)=>({...e,...Bp(t)}),{});function Dp(e){return{verticalAlign:e===fn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===fn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function jp(e,t={}){var n;return{...Dp(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const _l=new Set(["textFontFamily","textFontSettings"]);function zp(e,t,n){const i=l=>n===void 0?!0:n==="common"?_l.has(l):!_l.has(l),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Pr(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[qe(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[qe(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[qe(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[qe(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[qe(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[qe(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[qe(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[qe(e,"textTextAppearance")]=t.textTextAppearance),o}function ro(e={},t){return Ar.reduce((n,i)=>({...n,...zp(i,jp(i,e),t)}),{})}const Vp=ro(),Kp=fp();function Ps(e){return[qe(e,"textFontFamily"),qe(e,"textFontSettings"),qe(e,"textFontSize"),qe(e,"textLineHeight"),qe(e,"textLetterSpacing"),qe(e,"textWordSpacing"),qe(e,"textTextAlign"),qe(e,"textTextAppearance"),`${e}VerticalAlign`]}function Up(){const e=[];return Wr.forEach((t,n)=>{const i=En[n],o=Ps(t);for(let l=1;l<En.length;l+=1){const s=[{name:"columns",value:l},...Array.from({length:l},(d,a)=>({name:`columnsOrder.${a}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:s,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const Gp=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Ps(fn);const qp=[...di.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],kn=[{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"}],Xp=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:kn[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:kn[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:kn[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:kn[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:kn[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:kn[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:kn[6],link:""}],Yp=[...di.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Jp={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:Xp},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"}},...Hp(),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",...Vp,...ro({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Ml({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},...ro({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Ml({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},...ro({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}},...qp.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}},...di.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",...Yp]},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__",Kp]}],paletteBookmark:{items:[...Gp],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Zp={element:Pp,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Ep(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:Jp,sourceCode:kp},yn=e=>e.display==="Cover",Ro=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Wl=100,Qp=.2,Al=8,ks=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,l]=c.useState(0),[s,d]=c.useState(!1),a=c.useRef(null),p=c.useRef(0);p.current=o;const u=c.useMemo(()=>typeof window>"u"?Wl:Math.max(Wl,window.innerHeight*Qp),[]),S=c.useCallback(h=>Math.max(0,1-h/(u*1.5)),[u]),x=c.useCallback(h=>Math.max(0,1-h/(u*.45)),[u]),y=c.useCallback(h=>{const L=typeof window<"u"?window.innerHeight:800,I=Math.max(.88,1-h/L*.12);return`translateY(${h}px) scale(${I})`},[]),m=c.useCallback(()=>{a.current=null},[]),f=c.useCallback(()=>{d(!0),l(0),window.setTimeout(()=>d(!1),n),m()},[n,m]),$=c.useCallback(()=>{const h=typeof window<"u"?window.innerHeight:800;d(!0),l(h),window.setTimeout(()=>{t(),m(),d(!1)},Math.min(n,200))},[n,t,m]),w=c.useCallback(h=>{!e||s||h.pointerType==="touch"&&(i!=null&&i(h.target)||(a.current={startX:h.clientX,startY:h.clientY,isLocked:null,pointerId:h.pointerId}))},[e,s,i]),C=c.useCallback(h=>{const L=a.current;if(!e||!L||h.pointerType!=="touch"||L.pointerId!==h.pointerId)return;const I=h.clientX-L.startX,k=h.clientY-L.startY;if(L.isLocked===null){if(Math.abs(I)<Al&&Math.abs(k)<Al)return;if(k>0&&k>Math.abs(I))L.isLocked=!0,h.currentTarget.setPointerCapture(h.pointerId);else{L.isLocked=!1,m();return}}if(!L.isLocked)return;h.preventDefault();const z=Math.max(0,k);p.current=z,l(z)},[e,m]),T=c.useCallback(h=>{const L=a.current;if(!e||!L||h.pointerType!=="touch"||L.pointerId!==h.pointerId)return;const I=L.isLocked===!0;if(h.currentTarget.hasPointerCapture(h.pointerId)&&h.currentTarget.releasePointerCapture(h.pointerId),!I){m();return}h.clientY-L.startY>=u?$():f()},[u,$,e,m,f]),P=c.useCallback(h=>{T(h)},[T]),R=c.useCallback(h=>{T(h)},[T]),F=o>0,b=s?`transform ${n}ms ease`:"none",_=s?`opacity ${n}ms ease`:"none",V=o>0||s;return{isSwipeDragging:F,backdropStyle:{opacity:S(o),transition:_},mediaAreaStyle:{transform:y(o),transition:b,touchAction:F?"none":void 0,willChange:F?"transform":void 0},overlayContentStyle:V?{opacity:x(o),transition:_}:void 0,swipeHandlers:e?{onPointerDown:w,onPointerMove:C,onPointerUp:P,onPointerCancel:R}:{},dismissAreaStyle:e?{touchAction:"none"}:void 0}},em="[data-lightbox-scrollable]",Fs=()=>{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,l=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 a=d.target;a instanceof Element&&a.closest(em)||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=l,window.scrollTo(0,e)}},[])},tm=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},nm=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},im=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},om=(e,t,n,{duration:i,easing:o,onComplete:l})=>{const s=e.scrollLeft,d=n-s,a=s-n,p=(m,f)=>{nm(t),e.scrollLeft=m,f&&(l==null||l())};if(Math.abs(d)<.5)return p(n,!0),()=>{};let u=!1,S=0;const x=()=>{t.removeEventListener("transitionend",y),clearTimeout(S)},y=m=>{m.target!==t||m.propertyName!=="transform"||u||(u=!0,x(),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(${a}px, 0, 0)`,S=window.setTimeout(()=>{u||(u=!0,x(),p(n,!0))},i+64),()=>{u||(u=!0,x(),p(s-im(t),!1))}},Qn=300,rm=900,lm=1500,sm="cubic-bezier(0.16, 1, 0.3, 1)",am=3e3,lo=42;function cm(e){return`
|
|
8459
|
+
`,bi=["A","B","C","D","E"],Al=[...gr,"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 Fp(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Qi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Np(){return Object.fromEntries(bi.map((e,t)=>{const n=kn[t],i=`${e} column`;return[n,Fp(i)]}))}function Hp(){const e={};for(const t of bi)e[`${t}ColumnWidth`]=Qi(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Qi(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Qi(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Qi(`${t} column padding bottom`);return e}function Pl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...kn]};for(const l of bi)i[`${l}ColumnWidth`]=l==="A"?.0798:.32,i[`${l}ColumnPaddingLeft`]=0,i[`${l}ColumnPaddingRight`]=0,i[`${l}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Bp(e){const t={};if(e===Sn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...gr]},enum:[...gr]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Al],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Al]}}return t[Xe(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Xe(e,"textFontSettings")]={...Dn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Xe(e,"textFontSize")]={...Dn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Xe(e,"textLineHeight")]={...Dn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Xe(e,"textLetterSpacing")]={...Dn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Xe(e,"textWordSpacing")]={...Dn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Xe(e,"textTextAlign")]={...Dn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Xe(e,"textTextAppearance")]={...Dn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Op=Dr.reduce((e,t)=>({...e,...Bp(t)}),{});function Dp(e){return{verticalAlign:e===Sn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Sn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function jp(e,t={}){var n;return{...Dp(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const kl=new Set(["textFontFamily","textFontSettings"]);function zp(e,t,n){const i=l=>n===void 0?!0:n==="common"?kl.has(l):!kl.has(l),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=jr(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Xe(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Xe(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Xe(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Xe(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Xe(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Xe(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Xe(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Xe(e,"textTextAppearance")]=t.textTextAppearance),o}function go(e={},t){return Dr.reduce((n,i)=>({...n,...zp(i,jp(i,e),t)}),{})}const Vp=go(),Kp=fp();function Hs(e){return[Xe(e,"textFontFamily"),Xe(e,"textFontSettings"),Xe(e,"textFontSize"),Xe(e,"textLineHeight"),Xe(e,"textLetterSpacing"),Xe(e,"textWordSpacing"),Xe(e,"textTextAlign"),Xe(e,"textTextAppearance"),`${e}VerticalAlign`]}function Gp(){const e=[];return Or.forEach((t,n)=>{const i=kn[n],o=Hs(t);for(let l=1;l<kn.length;l+=1){const s=[{name:"columns",value:l},...Array.from({length:l},(d,a)=>({name:`columnsOrder.${a}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:s,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const Up=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Hs(Sn);const qp=[...bi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],jn=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(1).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(2).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(3).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(4).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(5).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(8).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/grid(9).webp"}],Xp=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:jn[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:jn[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:jn[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:jn[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:jn[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:jn[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:jn[6],link:""}],Yp=[...bi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Jp={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:Xp},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"}},...Hp(),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",...Vp,...go({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Pl({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},...go({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Pl({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},...go({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Gp(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...qp.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}},...bi.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",...Yp]},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__",Kp]}],paletteBookmark:{items:[...Up],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Zp={element:Pp,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Ip(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:Jp,sourceCode:kp},wn=e=>e.display==="Cover",No=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Fl=100,Qp=.2,Nl=8,Bs=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,l]=c.useState(0),[s,d]=c.useState(!1),a=c.useRef(null),p=c.useRef(0);p.current=o;const u=c.useMemo(()=>typeof window>"u"?Fl:Math.max(Fl,window.innerHeight*Qp),[]),S=c.useCallback(h=>Math.max(0,1-h/(u*1.5)),[u]),x=c.useCallback(h=>Math.max(0,1-h/(u*.45)),[u]),v=c.useCallback(h=>{const L=typeof window<"u"?window.innerHeight:800,E=Math.max(.88,1-h/L*.12);return`translateY(${h}px) scale(${E})`},[]),m=c.useCallback(()=>{a.current=null},[]),y=c.useCallback(()=>{d(!0),l(0),window.setTimeout(()=>d(!1),n),m()},[n,m]),$=c.useCallback(()=>{const h=typeof window<"u"?window.innerHeight:800;d(!0),l(h),window.setTimeout(()=>{t(),m(),d(!1)},Math.min(n,200))},[n,t,m]),w=c.useCallback(h=>{!e||s||h.pointerType==="touch"&&(i!=null&&i(h.target)||(a.current={startX:h.clientX,startY:h.clientY,isLocked:null,pointerId:h.pointerId}))},[e,s,i]),C=c.useCallback(h=>{const L=a.current;if(!e||!L||h.pointerType!=="touch"||L.pointerId!==h.pointerId)return;const E=h.clientX-L.startX,k=h.clientY-L.startY;if(L.isLocked===null){if(Math.abs(E)<Nl&&Math.abs(k)<Nl)return;if(k>0&&k>Math.abs(E))L.isLocked=!0,h.currentTarget.setPointerCapture(h.pointerId);else{L.isLocked=!1,m();return}}if(!L.isLocked)return;h.preventDefault();const z=Math.max(0,k);p.current=z,l(z)},[e,m]),T=c.useCallback(h=>{const L=a.current;if(!e||!L||h.pointerType!=="touch"||L.pointerId!==h.pointerId)return;const E=L.isLocked===!0;if(h.currentTarget.hasPointerCapture(h.pointerId)&&h.currentTarget.releasePointerCapture(h.pointerId),!E){m();return}h.clientY-L.startY>=u?$():y()},[u,$,e,m,y]),P=c.useCallback(h=>{T(h)},[T]),M=c.useCallback(h=>{T(h)},[T]),F=o>0,b=s?`transform ${n}ms ease`:"none",W=s?`opacity ${n}ms ease`:"none",K=o>0||s;return{isSwipeDragging:F,backdropStyle:{opacity:S(o),transition:W},mediaAreaStyle:{transform:v(o),transition:b,touchAction:F?"none":void 0,willChange:F?"transform":void 0},overlayContentStyle:K?{opacity:x(o),transition:W}:void 0,swipeHandlers:e?{onPointerDown:w,onPointerMove:C,onPointerUp:P,onPointerCancel:M}:{},dismissAreaStyle:e?{touchAction:"none"}:void 0}},em="[data-lightbox-scrollable]",Os=()=>{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,l=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 a=d.target;a instanceof Element&&a.closest(em)||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=l,window.scrollTo(0,e)}},[])},tm=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},nm=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},im=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},om=(e,t,n,{duration:i,easing:o,onComplete:l})=>{const s=e.scrollLeft,d=n-s,a=s-n,p=(m,y)=>{nm(t),e.scrollLeft=m,y&&(l==null||l())};if(Math.abs(d)<.5)return p(n,!0),()=>{};let u=!1,S=0;const x=()=>{t.removeEventListener("transitionend",v),clearTimeout(S)},v=m=>{m.target!==t||m.propertyName!=="transform"||u||(u=!0,x(),p(n,!0))};return t.addEventListener("transitionend",v),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(${a}px, 0, 0)`,S=window.setTimeout(()=>{u||(u=!0,x(),p(n,!0))},i+64),()=>{u||(u=!0,x(),p(s-im(t),!1))}},ci=300,rm=900,lm=1500,sm="cubic-bezier(0.16, 1, 0.3, 1)",am=3e3,ho=42,cm=2,dm=16,um=.05;function pm(e){return`
|
|
8460
8460
|
.${e}-wrapper {
|
|
8461
8461
|
position: relative;
|
|
8462
8462
|
width: 100%;
|
|
@@ -8607,7 +8607,7 @@ 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 ${ci}ms ease;
|
|
8611
8611
|
}
|
|
8612
8612
|
|
|
8613
8613
|
.${e}-thumbnails[data-overlay-content-hidden="true"] {
|
|
@@ -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: ${ho}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: ${ho}px;
|
|
8666
|
+
max-height: ${ho}px;
|
|
8667
8667
|
width: auto;
|
|
8668
8668
|
height: auto;
|
|
8669
8669
|
object-fit: cover;
|
|
@@ -8681,7 +8681,7 @@ 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 ${ci}ms ease;
|
|
8685
8685
|
}
|
|
8686
8686
|
|
|
8687
8687
|
.${e}-close-icon[data-overlay-content-hidden="true"] {
|
|
@@ -8806,7 +8806,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8806
8806
|
display: flex;
|
|
8807
8807
|
flex-direction: column;
|
|
8808
8808
|
opacity: 1;
|
|
8809
|
-
transition: opacity ${
|
|
8809
|
+
transition: opacity ${ci}ms ease;
|
|
8810
8810
|
}
|
|
8811
8811
|
|
|
8812
8812
|
.${e}-lightbox-content-inner[data-overlay-content-hidden="true"] {
|
|
@@ -8847,7 +8847,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8847
8847
|
pointer-events: auto;
|
|
8848
8848
|
z-index: 10;
|
|
8849
8849
|
}
|
|
8850
|
-
`}function dm(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 um(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=dm(t.text);if(n.title1||n.title2||n.title3)return{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}return{title1:"",title2:"",title3:""}}const ki=["title1","title2","title3"];function lt(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const pm={title1:"1",title2:"2",title3:"3"};function mm(e){return[lt(e,"fontFamily"),lt(e,"fontSettings"),{type:"row",items:[lt(e,"fontSize"),lt(e,"lineHeight"),lt(e,"letterSpacing"),lt(e,"wordSpacing")]},lt(e,"textAlign"),lt(e,"textAppearance")]}function gm(){return{type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ki.map(e=>[pm[e],mm(e)]))}}const hm={title1:"title1Color",title2:"title2Color",title3:"title3Color"},fm={title1:.02,title2:.02,title3:.02},Kn=.004,Ui=.004;function Nr(e,t){if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const a=Math.min(l,d);return{overflow:l-a,widths:[d-a,...s]}},{overflow:i-1,widths:[]});return o}function Ns(e,t){return Nr(e,t)}function Gi(e,t){const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)}function Pl(e,t){const n=e.map(i=>t[i.widthKey]??0);return{resolved:Nr(e.length,n),effective:Ns(e.length,n)}}function ym(e,t,n,i,o,l,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:l,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:s,text:i}),d}function Ko(e,t){const n=i=>{const o=lt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[hm[t]]}}function vm(e,t,n,i){return e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0)}function Uo(e,t,n){var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??fm[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Wt(i,n)}const xm=1,kl=.15,bm=3,Sm=20,Go=e=>`max(${e}, ${Sm}px)`,wm=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s})=>{const{backgroundColor:d,thumbnailGap:a,thumbnailMarginBottom:p,imageGap:u,closeIcon:S,closeIconMaxWidth:x,closeIconColor:y,closeIconHoverColor:m,thumbnailTrigger:f,thumbnailVisibility:$,thumbnailObjectFit:w,thumbnailActive:C,thumbnailActiveColor:T,title1Width:P,title2Width:R,title3Width:F,title1MarginLeft:b=0,title2MarginLeft:_=0,title3MarginLeft:V=0,titleRowMarginBottom:h=0,titleHeaderLayout:L="desktop",contentMarginTop:I,iconMarginLeft:k}=n,z=v=>E.scalingValue(v,i??!1),le=z(a),O=z(p??.02),W=z(u??0),G=z(I??0),K=z(k??0),{title1:H,title2:q,title3:te}=um(t),se=Uo("title1",Ko(n,"title1"),i),N=Uo("title2",Ko(n,"title2"),i),ce=Uo("title3",Ko(n,"title3"),i),g=o,ne=L==="mobile",fe=!o&&(!i||l),ie=fe,we=fe,me=fe,oe=yn(w),B=oe?{"--image-aspect-ratio":Ro(w)}:void 0,Q=!!(H||q||te),U=c.useMemo(()=>ym(e,H,q,te,se,N,ce),[e,H,q,te,se,N,ce]),Y=c.useMemo(()=>({title1Width:P,title2Width:R,title3Width:F}),[P,R,F]),Ie=c.useMemo(()=>U.map(v=>Y[v.widthKey]),[U,Y]),Me=c.useMemo(()=>Nr(U.length,Ie),[U.length,Ie]),Ae=c.useMemo(()=>Ns(U.length,Ie),[U.length,Ie]),Pe=c.useMemo(()=>U.filter(v=>v.prefix==="title1"),[U]),xe=c.useMemo(()=>U.filter(v=>v.prefix==="title2"||v.prefix==="title3"),[U]),j=c.useMemo(()=>Pl(Pe,Y),[Pe,Y]),ae=c.useMemo(()=>Pl(xe,Y),[xe,Y]),A=c.useCallback((v,Z)=>{const re=U.indexOf(v);if(!ne||Z==="single-row")return{effectiveWidth:Ae[re]??0,resolvedWidth:Me[re]??0,maxWidth:Gi(re,Me)};if(Z==="two-row-top"){const ke=Pe.indexOf(v);return{effectiveWidth:j.effective[ke]??0,resolvedWidth:j.resolved[ke]??0,maxWidth:Gi(ke,j.resolved)}}const he=xe.indexOf(v);return{effectiveWidth:ae.effective[he]??0,resolvedWidth:ae.resolved[he]??0,maxWidth:Gi(he,ae.resolved)}},[xe,ae,Ae,Me,U,Pe,j,ne]),D=c.useCallback(v=>E.scalingValue(v,i??!1),[i]),X=D(h??0),J=c.useMemo(()=>({title1MarginLeft:b,title2MarginLeft:_,title3MarginLeft:V}),[b,_,V]),ge=c.useCallback(v=>U.slice(0,v+1).reduce((Z,re,he)=>Z+(re!=null&&re.marginLeftKey?J[re.marginLeftKey]??0:0)+(Me[he]??0),0)+(ne?0:b??0),[U,J,Me,ne,b]),Ce=c.useCallback(()=>ne?0:b??0,[ne,b]),De=c.useCallback(v=>xe.slice(0,v).reduce((Z,re,he)=>Z+(re.marginLeftKey?J[re.marginLeftKey]??0:0)+(ae.resolved[he]??0),0),[xe,ae.resolved,J]),Re=c.useCallback(v=>{const Z=xe[v];return De(v)+(Z.marginLeftKey?J[Z.marginLeftKey]??0:0)+(ae.resolved[v]??0)},[xe,ae.resolved,De,J]),$e=(v,Z)=>{const re=v.marginLeftKey?J[v.marginLeftKey]??0:0,{effectiveWidth:he,resolvedWidth:ke,maxWidth:it}=A(v,Z),Mt=Math.max(re,Ui),_t=g&&Z==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":v.prefix,style:{...Z==="single-row"?{gridArea:v.prefix}:{},width:D(he),...re>0?{marginLeft:D(re)}:{}},children:[r.jsx("p",{className:v.className,style:v.style,children:v.text}),_t&&v.marginLeftKey?r.jsx("div",{"data-controls":v.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:D(-re),width:D(Mt),height:"100%",pointerEvents:"auto"}}):null,_t?r.jsx("div",{"data-controls":v.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(it),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D(-Kn/2),width:D(Kn),height:"100%",pointerEvents:"auto"}}):null]},v.className)},Ge=()=>{const v=ne?-1:U.findIndex(he=>he.prefix==="title1"),Z=!ne&&(g||(b??0)>0)?(()=>{const ke=Math.max(b??0,Ui),it=v>=0?Me[v]:P;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(it),style:{position:"absolute",top:0,left:0,width:D(ke),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,re=U.flatMap((he,ke)=>{if(!he.marginLeftKey)return[];const it=J[he.marginLeftKey]??0,Mt=vm(U,Me,J,ke)+Ce(),_t=Math.max(it,Ui);return r.jsx("div",{"data-controls":he.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me[ke]),style:{position:"absolute",top:0,left:D(Mt),width:D(_t),height:"100%",pointerEvents:"auto"}},he.marginLeftKey)});return Z?[Z,...re]:re},pe=()=>U.map((v,Z)=>{const re=Gi(Z,Me),ke=ge(Z)-Kn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":v.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(re),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(ke),width:D(Kn),height:"100%",pointerEvents:"auto"}})},`${v.widthKey}-junction`)}),Ee=()=>xe.flatMap((v,Z)=>{if(!v.marginLeftKey)return[];const re=J[v.marginLeftKey]??0,he=De(Z),ke=Math.max(re,Ui),{resolvedWidth:it}=A(v,"two-row-bottom");return r.jsx("div",{"data-controls":v.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(it),style:{position:"absolute",top:0,left:D(he),width:D(ke),height:"100%",pointerEvents:"auto"}},v.marginLeftKey)}),je=()=>xe.map((v,Z)=>{const{maxWidth:re}=A(v,"two-row-bottom"),ke=Re(Z)-Kn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":v.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(re),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(ke),width:D(Kn),height:"100%",pointerEvents:"auto"}})},`${v.widthKey}-junction`)}),ze=c.useRef(null),Ve=c.useRef(null),It=c.useRef(null),pt=c.useRef([]),$t=c.useRef(0),Ye=c.useRef({isActive:!1,startX:0,scrollLeft:0,hasMoved:!1}),ft=c.useRef(null),bt=t.length>1,Ot=bt?bm:1,We=c.useMemo(()=>Array.from({length:Ot},()=>t).flat(),[t,Ot]),[wt,Qe]=c.useState(!1),[Et,kt]=c.useState(!1),[sn,At]=c.useState(!0),[Dt,zt]=c.useState(0),Fe=c.useRef(Dt);Fe.current=Dt;const ct=c.useRef(null),mt=c.useRef(!1),et=c.useRef(null),tt=c.useRef(null),Ft=ie&&!sn,Vt=c.useCallback(()=>{ie&&(At(!0),tt.current&&clearTimeout(tt.current),tt.current=setTimeout(()=>{Ye.current.isActive||At(!1)},am))},[ie]),Nt=c.useCallback(()=>{o||mt.current||(mt.current=!0,kt(!1),et.current=setTimeout(()=>{s()},Qn))},[o,s]),bn=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Ft?"true":"false",style:{width:E.scalingValue(x??0,i),height:E.scalingValue(x??0,i),marginRight:K,"--close-icon-hover-color":m},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Nt,"aria-label":"Close",children:r.jsx(nn,{url:S,fill:y,hoverFill:m,className:`${e}-close-icon-img`})}),g?r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:K,height:"100%",pointerEvents:"auto"}}):null]}),Je=(v="two-row")=>r.jsx("div",{...v==="two-row"&&g?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:D(b??0),flexShrink:0,...v==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...v==="two-row"&&g?{pointerEvents:"auto"}:{}}}),an=()=>{const v=U.find(he=>he.prefix==="title1"),Z=U.filter(he=>he.prefix==="title2"||he.prefix==="title3"),re=Z.length>0||g||(h??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(b??0)>0||g?Je():null,v?$e(v,"two-row-top"):null,S?bn():null]}),re?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[Z.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[Z.map(he=>$e(he,"two-row-bottom")),g?r.jsxs(r.Fragment,{children:[Ee(),je()]}):null]}):null,r.jsx("div",{"data-controls":g?"titleRowMarginBottom":void 0,"data-controls-axis":g?"y":void 0,"data-controls-reverse":g?"":void 0,className:g?`${e}-control`:void 0,style:{height:X,width:"100%",flexShrink:0,pointerEvents:g?"auto":"none"}})]}):null]})},Sn=()=>r.jsxs(r.Fragment,{children:[(b??0)>0||g?Je("single-row"):null,U.map(v=>$e(v,"single-row")),g?r.jsxs(r.Fragment,{children:[Ge(),pe()]}):null,S?bn():null]}),Ne=c.useCallback(v=>!!(v.closest("[data-controls]")||v.closest(`.${e}-thumbnails`)||v.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:yt,backdropStyle:Rt,mediaAreaStyle:ee,overlayContentStyle:ye,swipeHandlers:Le,dismissAreaStyle:Oe}=ks({enabled:fe??!1,onClose:Nt,animMs:Qn,isBlockedTarget:Ne}),Ke=()=>{if(!bt||t.length===0)return $t.current=0,0;const v=pt.current[0],Z=pt.current[t.length];if(!v||!Z)return $t.current;const re=Z.offsetLeft-v.offsetLeft;return re>0&&($t.current=re),$t.current},Ue=(v=!1)=>{if(!bt)return;const Z=Ve.current,re=Ke();!Z||re<=0||(Z.scrollLeft<=0?(Z.scrollLeft+=re,v&&(Ye.current.scrollLeft+=re)):Z.scrollLeft>=re*2&&(Z.scrollLeft-=re,v&&(Ye.current.scrollLeft-=re)))},ve=(v=(Z=>(Z=Ve.current)==null?void 0:Z.scrollLeft)()??0)=>pt.current.reduce((re,he,ke)=>{if(!he)return re;const it=Math.abs(he.offsetLeft-v);return it<re.distance?{flatIndex:ke,distance:it}:re},{flatIndex:0,distance:1/0}).flatIndex,gt=()=>{!Ve.current||t.length===0||ct.current===null&&zt(ve()%t.length)},ot=()=>{ct.current=null},dt=v=>{const Z=Ve.current;Z&&(Z.style.scrollSnapType=v?"":"none")},vt=()=>{var v;(v=ft.current)==null||v.call(ft),ft.current=null},He=()=>{const v=It.current;v&&(v.style.transition="",v.style.transform="",v.style.willChange="")},St=(v,Z,re,he)=>{He(),v.scrollLeft=Z,Ue(),re!==void 0?zt(re):gt(),dt(!0),he==null||he()},nt=(v,{behavior:Z="smooth",activeIndex:re,onComplete:he}={})=>{const ke=Ve.current,it=It.current;if(!ke||!it)return;if(vt(),dt(!1),Z==="auto"){St(ke,v,re,he);return}const Mt=Math.abs(v-ke.scrollLeft),_t=tm(Mt,rm,lm,ke.clientWidth*.55);ft.current=om(ke,it,v,{duration:_t,easing:sm,onComplete:()=>{ft.current=null,St(ke,v,re,he)}})},Ct=(v="smooth")=>{if(!Ve.current||t.length===0)return;const re=ve(),he=pt.current[re];he&&nt(he.offsetLeft,{behavior:v,activeIndex:re%t.length})},Qt=(v,Z="smooth")=>{const re=Ve.current;if(!re||t.length===0)return;const he=re.scrollLeft-v,ke=ve(re.scrollLeft),it=pt.current[ke],Mt=pt.current[ke+1],_t=it?Mt?Mt.offsetLeft-it.offsetLeft:it.offsetWidth:0,Wn=_t>0?he>_t*kl?1:he<-_t*kl?-1:0:0,wn=bt?ke+Wn:Math.max(0,Math.min(We.length-1,ke+Wn)),Ni=pt.current[wn];if(!Ni){Ct(Z);return}const ui=wn%t.length;Z==="smooth"&&(ct.current=ui),zt(ui),nt(Ni.offsetLeft,{behavior:Z,activeIndex:ui,onComplete:Z==="smooth"?ot:void 0})},ht=(v,Z="smooth")=>{const re=Ve.current,he=bt?t.length+v:v,ke=pt.current[he];!re||!ke||(Z==="smooth"?ct.current=v:ct.current=null,zt(v),nt(ke.offsetLeft,{behavior:Z,activeIndex:v,onComplete:Z==="smooth"?ot:void 0}))},en=v=>{if(!we||v.pointerType!=="mouse"||v.button!==0||Ne(v.target))return;const Z=Ve.current;Z&&(vt(),He(),ct.current=null,Ye.current={isActive:!0,startX:v.clientX,scrollLeft:Z.scrollLeft,hasMoved:!1},dt(!1),Vt(),Z.setPointerCapture(v.pointerId))},ut=v=>{if(!we||v.pointerType!=="mouse")return;const Z=Ve.current;if(!Z||!Ye.current.isActive)return;const re=v.clientX-Ye.current.startX;Math.abs(re)>xm&&(Ye.current.hasMoved=!0,Qe(!0)),Ye.current.hasMoved&&(v.preventDefault(),Z.scrollLeft=Ye.current.scrollLeft-re,Ue(!0),gt(),Vt())},jt=v=>{if(!we||v.pointerType!=="mouse")return;const Z=Ve.current;if(!Z)return;const re=Ye.current.hasMoved,he=Ye.current.scrollLeft;Ye.current.isActive=!1,Qe(!1),Z.hasPointerCapture(v.pointerId)&&Z.releasePointerCapture(v.pointerId),Ue(),re?Qt(he):(dt(!0),gt()),Vt()};return Fs(),c.useEffect(()=>{const v=requestAnimationFrame(()=>kt(!0));return()=>{cancelAnimationFrame(v),vt(),et.current&&clearTimeout(et.current),tt.current&&clearTimeout(tt.current)}},[]),c.useEffect(()=>{if(!ie){At(!0);return}Vt();const v=ze.current;if(!v)return;const Z=()=>Vt();return v.addEventListener("pointermove",Z),v.addEventListener("pointerdown",Z),()=>{v.removeEventListener("pointermove",Z),v.removeEventListener("pointerdown",Z),tt.current&&clearTimeout(tt.current)}},[ie,Vt]),c.useEffect(()=>{const v=Z=>{Z.key==="Escape"&&Nt()};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[Nt]),c.useLayoutEffect(()=>{Ke(),ht(Fe.current,"auto")},[W]),c.useLayoutEffect(()=>{Ke(),ht(0,"auto")},[t.length,bt]),c.useEffect(()=>{if(!o)return;const v=Ve.current;if(!v)return;const Z=re=>{re.preventDefault()};return v.addEventListener("wheel",Z,{passive:!1}),v.addEventListener("touchmove",Z,{passive:!1}),()=>{v.removeEventListener("wheel",Z),v.removeEventListener("touchmove",Z)}},[o]),c.useEffect(()=>{const v=Ve.current;if(!v)return;const Z=()=>{Ue(),gt()};v.addEventListener("scroll",Z,{passive:!0});const re=new ResizeObserver(()=>{Ke(),Ue(),gt()});return re.observe(v),()=>{vt(),v.removeEventListener("scroll",Z),re.disconnect()}},[t.length,bt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{yt||Nt()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Et?1:0,transition:`opacity ${Qn}ms ease`,pointerEvents:Et?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Rt}}),r.jsxs("div",{ref:ze,className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%",...Oe},...Le,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:ee,onClick:v=>v.stopPropagation(),children:r.jsx("div",{ref:Ve,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":we&&t.length>0?"true":"false","data-mouse-dragging":wt?"true":"false",onPointerDown:en,onPointerMove:ut,onPointerUp:jt,onPointerCancel:jt,children:r.jsx("div",{ref:It,className:`${e}-lightbox-strip-track`,style:{gap:W},children:We.map((v,Z)=>{const re=v.image.objectFit??"contain",he=Z%t.length,ke=Math.floor(Z/t.length),it=Go(W),Mt=`calc(-0.5 * (${it} + ${W}))`;return r.jsxs("div",{ref:_t=>pt.current[Z]=_t,className:`${e}-strip-item`,style:{height:L==="mobile"?"75vh":"100%"},children:[r.jsx("img",{src:v.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:re}}),g&&he<t.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Mt,width:it,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ke}-${v.image.url}-${he}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":Ft?"true":"false",style:{width:"100%",height:"100%",top:0,bottom:0,...ye},children:[r.jsx("div",{"data-controls":g?"contentMarginTop":void 0,"data-controls-axis":g?"y":void 0,"data-controls-handle-left-fraction":g?"0.05":void 0,className:g?`${e}-control`:void 0,style:{height:G,width:"100%",pointerEvents:g?"auto":"none"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0},children:r.jsx("div",{className:`${e}-lightbox-content-area${ne?` ${e}-lightbox-content-area-stacked`:""}`,children:(Q||S)&&r.jsx("div",{className:`${e}-header ${ne?`${e}-header-two-row`:`${e}-header-single-row`}`,children:ne?an():Q||S?Sn():null})})})]}),t.length>1&&$==="on"&&(()=>{const v=Go(O),Z=`calc(-0.5 * (${O} + ${v}))`;return r.jsxs("div",{className:`${e}-thumbnails`,"data-lightbox-scrollable":"","data-thumbnail-active":C,"data-overlay-content-hidden":Ft?"true":"false",onClick:re=>re.stopPropagation(),style:{gap:le,bottom:O,"--thumbnail-active-color":T,...ye},children:[t.map((re,he)=>{const ke=Go(le),it=`calc(-0.5 * (${ke} + ${le}))`;return r.jsxs("div",{style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":Dt===he?"true":"false",onClick:()=>fe&&f==="click"&&ht(he),onMouseEnter:()=>me&&f==="hover"&&ht(he),"aria-label":re.image.name?`View ${re.image.name}`:`View image ${he+1}`,"aria-current":Dt===he?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${oe?` ${e}-thumb-image-cover`:""}`,src:re.image.url,alt:"",draggable:!1,style:{...B,...w.display==="Cover"?{width:lo}:{width:"100%"}}})}),g&&he<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:it,width:ke,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${re.image.url}-${he}`)}),g&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":g?"":void 0,style:{position:"absolute",left:0,right:0,bottom:Z,height:v,pointerEvents:"auto",zIndex:3}})]})})()]})]})},Cm=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l})=>{const{prefix:s}=E.useScopedStyles(),{cover:d,coverFit:a}=e,p=c.useRef(null),[u,S]=c.useState(!1),x=t??[],y=u&&x.length>0,m=()=>{x.length!==0&&(n&&!i&&!o||S(!0))},f=()=>{n||m()},$=C=>{n&&(C.stopPropagation(),m())},w=()=>{S(!1)};return c.useEffect(()=>{!n||i||o||S(!1)},[n,i,o]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:p,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:cm(s)}}),d?r.jsx("button",{type:"button",className:`${s}-cover ${yn(a)?`${s}-ratio-wrapper-cover`:`${s}-ratio-wrapper-fit`}`,onClick:f,onDoubleClick:$,style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...yn(a)?{"--image-aspect-ratio":Ro(a)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${s}-cover-image ${yn(a)?`${s}-cover-image-cover`:`${s}-cover-image-fit`}`,src:d,alt:"cover"})}):null]}),y&&typeof document<"u"&&(()=>{const C=(l?document.getElementById(l):null)??document.body;return Li.createPortal(r.jsx(wm,{prefix:s,images:x,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:w}),C)})()]})},Tm=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
8850
|
+
`}function mm(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 gm(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=mm(t.text);if(n.title1||n.title2||n.title3)return{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}return{title1:"",title2:"",title3:""}}const Ki=["title1","title2","title3"];function st(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const hm={title1:"1",title2:"2",title3:"3"};function fm(e){return[st(e,"fontFamily"),st(e,"fontSettings"),{type:"row",items:[st(e,"fontSize"),st(e,"lineHeight"),st(e,"letterSpacing"),st(e,"wordSpacing")]},st(e,"textAlign"),st(e,"textAppearance")]}function ym(){return{type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Ki.map(e=>[hm[e],fm(e)]))}}const vm={title1:"title1Color",title2:"title2Color",title3:"title3Color"},xm={title1:.02,title2:.02,title3:.02},ti=.004,eo=.004;function Kr(e,t){if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const a=Math.min(l,d);return{overflow:l-a,widths:[d-a,...s]}},{overflow:i-1,widths:[]});return o}function Ds(e,t){return Kr(e,t)}function to(e,t){const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)}function Hl(e,t){const n=e.map(i=>t[i.widthKey]??0);return{resolved:Kr(e.length,n),effective:Ds(e.length,n)}}function bm(e,t,n,i,o,l,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:l,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:s,text:i}),d}function Qo(e,t){const n=i=>{const o=st(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[vm[t]]}}function Sm(e,t,n,i){return e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0)}function er(e,t,n){var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??xm[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 wm=1,Bl=.15,Cm=3,Tm=20,tr=e=>`max(${e}, ${Tm}px)`,$m=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s})=>{const{backgroundColor:d,thumbnailGap:a,thumbnailMarginBottom:p,imageGap:u,closeIcon:S,closeIconMaxWidth:x,closeIconColor:v,closeIconHoverColor:m,thumbnailTrigger:y,thumbnailVisibility:$,thumbnailObjectFit:w,thumbnailActive:C,thumbnailActiveColor:T,title1Width:P,title2Width:M,title3Width:F,title1MarginLeft:b=0,title2MarginLeft:W=0,title3MarginLeft:K=0,titleRowMarginBottom:h=0,titleHeaderLayout:L="desktop",contentMarginTop:E,iconMarginLeft:k}=n,z=f=>R.scalingValue(f,i??!1),le=z(a),O=z(p??.02),_=z(u??0),q=z(E??0),G=z(k??0),{title1:H,title2:X,title3:ne}=gm(t),se=er("title1",Qo(n,"title1"),i),N=er("title2",Qo(n,"title2"),i),de=er("title3",Qo(n,"title3"),i),g=o,ie=L==="mobile",fe=!o&&(!i||l),oe=fe,Ce=fe,me=fe,re=wn(w),B=re?{"--image-aspect-ratio":No(w)}:void 0,Q=!!(H||X||ne),U=c.useMemo(()=>bm(e,H,X,ne,se,N,de),[e,H,X,ne,se,N,de]),J=c.useMemo(()=>({title1Width:P,title2Width:M,title3Width:F}),[P,M,F]),Me=c.useMemo(()=>U.map(f=>J[f.widthKey]),[U,J]),Ae=c.useMemo(()=>Kr(U.length,Me),[U.length,Me]),ke=c.useMemo(()=>Ds(U.length,Me),[U.length,Me]),Fe=c.useMemo(()=>U.filter(f=>f.prefix==="title1"),[U]),xe=c.useMemo(()=>U.filter(f=>f.prefix==="title2"||f.prefix==="title3"),[U]),j=c.useMemo(()=>Hl(Fe,J),[Fe,J]),ae=c.useMemo(()=>Hl(xe,J),[xe,J]),A=c.useCallback((f,V)=>{const ee=U.indexOf(f);if(!ie||V==="single-row")return{effectiveWidth:ke[ee]??0,resolvedWidth:Ae[ee]??0,maxWidth:to(ee,Ae)};if(V==="two-row-top"){const we=Fe.indexOf(f);return{effectiveWidth:j.effective[we]??0,resolvedWidth:j.resolved[we]??0,maxWidth:to(we,j.resolved)}}const he=xe.indexOf(f);return{effectiveWidth:ae.effective[he]??0,resolvedWidth:ae.resolved[he]??0,maxWidth:to(he,ae.resolved)}},[xe,ae,ke,Ae,U,Fe,j,ie]),D=c.useCallback(f=>R.scalingValue(f,i??!1),[i]),Y=D(h??0),Z=c.useMemo(()=>({title1MarginLeft:b,title2MarginLeft:W,title3MarginLeft:K}),[b,W,K]),ge=c.useCallback(f=>U.slice(0,f+1).reduce((V,ee,he)=>V+(ee!=null&&ee.marginLeftKey?Z[ee.marginLeftKey]??0:0)+(Ae[he]??0),0)+(ie?0:b??0),[U,Z,Ae,ie,b]),Te=c.useCallback(()=>ie?0:b??0,[ie,b]),je=c.useCallback(f=>xe.slice(0,f).reduce((V,ee,he)=>V+(ee.marginLeftKey?Z[ee.marginLeftKey]??0:0)+(ae.resolved[he]??0),0),[xe,ae.resolved,Z]),_e=c.useCallback(f=>{const V=xe[f];return je(f)+(V.marginLeftKey?Z[V.marginLeftKey]??0:0)+(ae.resolved[f]??0)},[xe,ae.resolved,je,Z]),Le=(f,V)=>{const ee=f.marginLeftKey?Z[f.marginLeftKey]??0:0,{effectiveWidth:he,resolvedWidth:we,maxWidth:Je}=A(f,V),Lt=Math.max(ee,eo),Rt=g&&V==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":f.prefix,style:{...V==="single-row"?{gridArea:f.prefix}:{},width:D(he),...ee>0?{marginLeft:D(ee)}:{}},children:[r.jsx("p",{className:f.className,style:f.style,children:f.text}),Rt&&f.marginLeftKey?r.jsx("div",{"data-controls":f.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we),style:{position:"absolute",top:0,left:D(-ee),width:D(Lt),height:"100%",pointerEvents:"auto"}}):null,Rt?r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Je),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D(-ti/2),width:D(ti),height:"100%",pointerEvents:"auto"}}):null]},f.className)},Ge=()=>{const f=ie?-1:U.findIndex(he=>he.prefix==="title1"),V=!ie&&(g||(b??0)>0)?(()=>{const we=Math.max(b??0,eo),Je=f>=0?Ae[f]:P;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Je),style:{position:"absolute",top:0,left:0,width:D(we),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ee=U.flatMap((he,we)=>{if(!he.marginLeftKey)return[];const Je=Z[he.marginLeftKey]??0,Lt=Sm(U,Ae,Z,we)+Te(),Rt=Math.max(Je,eo);return r.jsx("div",{"data-controls":he.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ae[we]),style:{position:"absolute",top:0,left:D(Lt),width:D(Rt),height:"100%",pointerEvents:"auto"}},he.marginLeftKey)});return V?[V,...ee]:ee},pe=()=>U.map((f,V)=>{const ee=to(V,Ae),we=ge(V)-ti/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(we),width:D(ti),height:"100%",pointerEvents:"auto"}})},`${f.widthKey}-junction`)}),We=()=>xe.flatMap((f,V)=>{if(!f.marginLeftKey)return[];const ee=Z[f.marginLeftKey]??0,he=je(V),we=Math.max(ee,eo),{resolvedWidth:Je}=A(f,"two-row-bottom");return r.jsx("div",{"data-controls":f.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Je),style:{position:"absolute",top:0,left:D(he),width:D(we),height:"100%",pointerEvents:"auto"}},f.marginLeftKey)}),ze=()=>xe.map((f,V)=>{const{maxWidth:ee}=A(f,"two-row-bottom"),we=_e(V)-ti/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(we),width:D(ti),height:"100%",pointerEvents:"auto"}})},`${f.widthKey}-junction`)}),Ve=c.useRef(null),Ne=c.useRef(null),It=c.useRef(null),dt=c.useRef([]),bt=c.useRef(0),Ze=c.useRef({isActive:!1,startX:0,scrollLeft:0,hasMoved:!1}),yt=c.useRef(null),Mt=c.useRef(0),Ht=c.useRef("forward"),Ee=c.useRef(0),it=c.useRef(null),Ue=c.useRef(!1),ut=t.length>1,Bt=ut?Cm:1,rn=c.useMemo(()=>Array.from({length:Bt},()=>t).flat(),[t,Bt]),[jt,Yt]=c.useState(!1),[ln,He]=c.useState(!1),[Tt,pt]=c.useState(!0),[et,mt]=c.useState(0),zt=c.useRef(et);zt.current=et;const Vt=c.useRef(null),Jt=c.useRef(!1),pn=c.useRef(null),Ke=c.useRef(null),Zt=oe&&!Tt,kt=c.useCallback(()=>{oe&&(pt(!0),Ke.current&&clearTimeout(Ke.current),Ke.current=setTimeout(()=>{Ze.current.isActive||pt(!1)},am))},[oe]),Pe=c.useCallback(()=>{o||Jt.current||(Jt.current=!0,He(!1),pn.current=setTimeout(()=>{s()},ci))},[o,s]),ft=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Zt?"true":"false",style:{width:R.scalingValue(x??0,i),height:R.scalingValue(x??0,i),marginRight:G,"--close-icon-hover-color":m},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Pe,"aria-label":"Close",children:r.jsx(an,{url:S,fill:v,hoverFill:m,className:`${e}-close-icon-img`})}),g?r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:G,height:"100%",pointerEvents:"auto"}}):null]}),Wt=(f="two-row")=>r.jsx("div",{...f==="two-row"&&g?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:D(b??0),flexShrink:0,...f==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...f==="two-row"&&g?{pointerEvents:"auto"}:{}}}),te=()=>{const f=U.find(he=>he.prefix==="title1"),V=U.filter(he=>he.prefix==="title2"||he.prefix==="title3"),ee=V.length>0||g||(h??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(b??0)>0||g?Wt():null,f?Le(f,"two-row-top"):null,S?ft():null]}),ee?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[V.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[V.map(he=>Le(he,"two-row-bottom")),g?r.jsxs(r.Fragment,{children:[We(),ze()]}):null]}):null,r.jsx("div",{"data-controls":g?"titleRowMarginBottom":void 0,"data-controls-axis":g?"y":void 0,"data-controls-reverse":g?"":void 0,className:g?`${e}-control`:void 0,style:{height:Y,width:"100%",flexShrink:0,pointerEvents:g?"auto":"none"}})]}):null]})},ye=()=>r.jsxs(r.Fragment,{children:[(b??0)>0||g?Wt("single-row"):null,U.map(f=>Le(f,"single-row")),g?r.jsxs(r.Fragment,{children:[Ge(),pe()]}):null,S?ft():null]}),Ie=c.useCallback(f=>!!(f.closest("[data-controls]")||f.closest(`.${e}-thumbnails`)||f.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:De,backdropStyle:qe,mediaAreaStyle:Qe,overlayContentStyle:ve,swipeHandlers:$t,dismissAreaStyle:gt}=Bs({enabled:fe??!1,onClose:Pe,animMs:ci,isBlockedTarget:Ie}),ht=()=>{if(!ut||t.length===0)return bt.current=0,0;const f=dt.current[0],V=dt.current[t.length];if(!f||!V)return bt.current;const ee=V.offsetLeft-f.offsetLeft;return ee>0&&(bt.current=ee),bt.current},ot=(f=!1)=>{if(!ut)return;const V=Ne.current,ee=ht();!V||ee<=0||(V.scrollLeft<=0?(V.scrollLeft+=ee,f&&(Ze.current.scrollLeft+=ee),Ue.current&&(Ee.current+=ee)):V.scrollLeft>=ee*2&&(V.scrollLeft-=ee,f&&(Ze.current.scrollLeft-=ee),Ue.current&&(Ee.current-=ee)))},Be=(f=(V=>(V=Ne.current)==null?void 0:V.scrollLeft)()??0)=>{var Lt;const ee=((Lt=Ne.current)==null?void 0:Lt.clientWidth)??0,he=f+ee/2;let we=-1,Je={flatIndex:0,distance:1/0};return dt.current.forEach((Rt,In)=>{if(!Rt)return;const Rn=Rt.offsetLeft,mn=Rn+Rt.offsetWidth;we===-1&&he>=Rn&&he<mn&&(we=In);const I=Math.abs(Rn-f);I<Je.distance&&(Je={flatIndex:In,distance:I})}),we!==-1?we:Je.flatIndex},vt=f=>{const V=Ne.current;return!f||!V?!1:f.offsetWidth>V.clientWidth+1},rt=f=>{Ne.current&&dt.current.forEach(V=>{V&&(V.style.scrollSnapAlign=vt(V)&&f==="backward"?"end":"start")})},wt=f=>{const V=Ne.current;if(!f||!V||!vt(f))return!1;const ee=f.offsetLeft,he=ee+f.offsetWidth;return V.scrollLeft>=ee-1&&V.scrollLeft+V.clientWidth<=he+1},_t=()=>{!Ne.current||t.length===0||Vt.current===null&&mt(Be()%t.length)},St=()=>{Vt.current=null},At=f=>{const V=Ne.current;V&&(V.style.scrollSnapType=f?"":"none")},tt=()=>{var f;(f=yt.current)==null||f.call(yt),yt.current=null},Ft=()=>{it.current!==null&&(cancelAnimationFrame(it.current),it.current=null),Ue.current=!1},Kt=()=>{const f=Ne.current;if(!f){it.current=null,Ue.current=!1;return}const V=Ee.current-f.scrollLeft;if(Math.abs(V)<.5){f.scrollLeft=Ee.current,ot(),_t(),it.current=null,Ue.current=!1;return}f.scrollLeft+=V*um,ot(),_t(),kt(),it.current=requestAnimationFrame(Kt)},$n=()=>{const f=It.current;f&&(f.style.transition="",f.style.transform="",f.style.willChange="")},Bn=(f,V,ee,he)=>{$n(),f.scrollLeft=V,Mt.current=f.scrollLeft,ot(),ee!==void 0?mt(ee):_t(),At(!0),he==null||he()},Ln=(f,{behavior:V="smooth",activeIndex:ee,onComplete:he}={})=>{const we=Ne.current,Je=It.current;if(!we||!Je)return;if(Ft(),tt(),At(!1),V==="auto"){Bn(we,f,ee,he);return}const Lt=Math.abs(f-we.scrollLeft),Rt=tm(Lt,rm,lm,we.clientWidth*.55);yt.current=om(we,Je,f,{duration:Rt,easing:sm,onComplete:()=>{yt.current=null,Bn(we,f,ee,he)}})},Yn=(f="smooth")=>{if(!Ne.current||t.length===0)return;const ee=Be(),he=dt.current[ee];he&&Ln(he.offsetLeft,{behavior:f,activeIndex:ee%t.length})},Jn=(f,V="smooth")=>{const ee=Ne.current;if(!ee||t.length===0)return;const he=ee.scrollLeft-f,we=Be(ee.scrollLeft),Je=dt.current[we];if(wt(Je)){At(!0),_t();return}const Lt=dt.current[we+1],Rt=Je?Lt?Lt.offsetLeft-Je.offsetLeft:Je.offsetWidth:0,In=Rt>0?he>Rt*Bl?1:he<-Rt*Bl?-1:0:0,Rn=ut?we+In:Math.max(0,Math.min(rn.length-1,we+In)),mn=dt.current[Rn];if(!mn){Yn(V);return}const ce=he<0&&vt(mn)?mn.offsetLeft+mn.offsetWidth-ee.clientWidth:mn.offsetLeft,Re=Rn%t.length;V==="smooth"&&(Vt.current=Re),mt(Re),Ln(ce,{behavior:V,activeIndex:Re,onComplete:V==="smooth"?St:void 0})},Qt=(f,V="smooth")=>{const ee=Ne.current,he=ut?t.length+f:f,we=dt.current[he];!ee||!we||(V==="smooth"?Vt.current=f:Vt.current=null,mt(f),Ln(we.offsetLeft,{behavior:V,activeIndex:f,onComplete:V==="smooth"?St:void 0}))},Si=f=>{if(!Ce)return;if(f.pointerType==="touch"){Ft(),At(!0);return}if(f.pointerType!=="mouse"||f.button!==0||Ie(f.target))return;const V=Ne.current;V&&(Ft(),tt(),$n(),Vt.current=null,Ze.current={isActive:!0,startX:f.clientX,scrollLeft:V.scrollLeft,hasMoved:!1},At(!1),kt(),V.setPointerCapture(f.pointerId))},Zn=f=>{if(!Ce||f.pointerType!=="mouse")return;const V=Ne.current;if(!V||!Ze.current.isActive)return;const ee=f.clientX-Ze.current.startX;Math.abs(ee)>wm&&(Ze.current.hasMoved=!0,Yt(!0)),Ze.current.hasMoved&&(f.preventDefault(),V.scrollLeft=Ze.current.scrollLeft-ee,ot(!0),_t(),kt())},En=f=>{if(!Ce||f.pointerType!=="mouse")return;const V=Ne.current;if(!V)return;const ee=Ze.current.hasMoved,he=Ze.current.scrollLeft;Ze.current.isActive=!1,Yt(!1),V.hasPointerCapture(f.pointerId)&&V.releasePointerCapture(f.pointerId),ot(),ee?Jn(he):(At(!0),_t()),kt()};return Os(),c.useEffect(()=>{const f=requestAnimationFrame(()=>He(!0));return()=>{cancelAnimationFrame(f),tt(),pn.current&&clearTimeout(pn.current),Ke.current&&clearTimeout(Ke.current)}},[]),c.useEffect(()=>{if(!oe){pt(!0);return}kt();const f=Ve.current;if(!f)return;const V=()=>kt();return f.addEventListener("pointermove",V),f.addEventListener("pointerdown",V),()=>{f.removeEventListener("pointermove",V),f.removeEventListener("pointerdown",V),Ke.current&&clearTimeout(Ke.current)}},[oe,kt]),c.useEffect(()=>{const f=V=>{V.key==="Escape"&&Pe()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[Pe]),c.useLayoutEffect(()=>{ht(),Qt(zt.current,"auto")},[_]),c.useLayoutEffect(()=>{ht(),Qt(0,"auto")},[t.length,ut]),c.useEffect(()=>{if(!o)return;const f=Ne.current;if(!f)return;const V=ee=>{ee.preventDefault()};return f.addEventListener("wheel",V,{passive:!1}),f.addEventListener("touchmove",V,{passive:!1}),()=>{f.removeEventListener("wheel",V),f.removeEventListener("touchmove",V)}},[o]),c.useEffect(()=>{const f=Ne.current;if(!f||!fe)return;const V=ee=>{if(ee.preventDefault(),Math.abs(ee.deltaY)<=Math.abs(ee.deltaX))return;const he=ee.deltaMode===1?dm:ee.deltaMode===2?f.clientHeight:1,we=ee.deltaY*he*cm;if(we!==0){if(tt(),Ue.current||(Ue.current=!0,Ee.current=f.scrollLeft,Vt.current=null,At(!1)),Ee.current+=we,!ut){const Je=f.scrollWidth-f.clientWidth;Ee.current=Math.max(0,Math.min(Je,Ee.current))}kt(),it.current===null&&(it.current=requestAnimationFrame(Kt))}};return f.addEventListener("wheel",V,{passive:!1}),()=>{f.removeEventListener("wheel",V),Ft()}},[fe,t.length,ut]),c.useEffect(()=>{const f=Ne.current;if(!f)return;const V=()=>{ot();const he=f.scrollLeft,we=he-Mt.current;Mt.current=he;const Je=bt.current>0?bt.current*.5:1/0;if(we!==0&&Math.abs(we)<Je){const Lt=we>0?"forward":"backward";Lt!==Ht.current&&(Ht.current=Lt,rt(Lt))}_t()};f.addEventListener("scroll",V,{passive:!0});const ee=new ResizeObserver(()=>{ht(),ot(),rt(Ht.current),_t()});return ee.observe(f),()=>{tt(),f.removeEventListener("scroll",V),ee.disconnect()}},[t.length,ut]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{De||Pe()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:ln?1:0,transition:`opacity ${ci}ms ease`,pointerEvents:ln?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...qe}}),r.jsxs("div",{ref:Ve,className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%",...gt},...$t,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Qe,onClick:f=>f.stopPropagation(),children:r.jsx("div",{ref:Ne,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Ce&&t.length>0?"true":"false","data-mouse-dragging":jt?"true":"false",onPointerDown:Si,onPointerMove:Zn,onPointerUp:En,onPointerCancel:En,children:r.jsx("div",{ref:It,className:`${e}-lightbox-strip-track`,style:{gap:_},children:rn.map((f,V)=>{const ee=f.image.objectFit??"contain",he=V%t.length,we=Math.floor(V/t.length),Je=tr(_),Lt=`calc(-0.5 * (${Je} + ${_}))`;return r.jsxs("div",{ref:Rt=>dt.current[V]=Rt,className:`${e}-strip-item`,style:{height:L==="mobile"?"75vh":"100%"},children:[r.jsx("img",{src:f.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ee}}),g&&he<t.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Lt,width:Je,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${we}-${f.image.url}-${he}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":Zt?"true":"false",style:{width:"100%",height:"100%",top:0,bottom:0,...ve},children:[r.jsx("div",{"data-controls":g?"contentMarginTop":void 0,"data-controls-axis":g?"y":void 0,"data-controls-handle-left-fraction":g?"0.05":void 0,className:g?`${e}-control`:void 0,style:{height:q,width:"100%",pointerEvents:g?"auto":"none"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0},children:r.jsx("div",{className:`${e}-lightbox-content-area${ie?` ${e}-lightbox-content-area-stacked`:""}`,children:(Q||S)&&r.jsx("div",{className:`${e}-header ${ie?`${e}-header-two-row`:`${e}-header-single-row`}`,children:ie?te():Q||S?ye():null})})})]}),t.length>1&&$==="on"&&(()=>{const f=tr(O),V=`calc(-0.5 * (${O} + ${f}))`;return r.jsxs("div",{className:`${e}-thumbnails`,"data-lightbox-scrollable":"","data-thumbnail-active":C,"data-overlay-content-hidden":Zt?"true":"false",onClick:ee=>ee.stopPropagation(),style:{gap:le,bottom:O,"--thumbnail-active-color":T,...ve},children:[t.map((ee,he)=>{const we=tr(le),Je=`calc(-0.5 * (${we} + ${le}))`;return r.jsxs("div",{style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":et===he?"true":"false",onClick:()=>fe&&y==="click"&&Qt(he),onMouseEnter:()=>me&&y==="hover"&&Qt(he),"aria-label":ee.image.name?`View ${ee.image.name}`:`View image ${he+1}`,"aria-current":et===he?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${re?` ${e}-thumb-image-cover`:""}`,src:ee.image.url,alt:"",draggable:!1,style:{...B,...w.display==="Cover"?{width:ho}:{width:"100%"}}})}),g&&he<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Je,width:we,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ee.image.url}-${he}`)}),g&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":g?"":void 0,style:{position:"absolute",left:0,right:0,bottom:V,height:f,pointerEvents:"auto",zIndex:3}})]})})()]})]})},Lm=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l})=>{const{prefix:s}=R.useScopedStyles(),{cover:d,coverFit:a}=e,p=c.useRef(null),[u,S]=c.useState(!1),x=t??[],v=u&&x.length>0,m=()=>{x.length!==0&&(n&&!i&&!o||S(!0))},y=()=>{n||m()},$=C=>{n&&(C.stopPropagation(),m())},w=()=>{S(!1)};return c.useEffect(()=>{!n||i||o||S(!1)},[n,i,o]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:p,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:pm(s)}}),d?r.jsx("button",{type:"button",className:`${s}-cover ${wn(a)?`${s}-ratio-wrapper-cover`:`${s}-ratio-wrapper-fit`}`,onClick:y,onDoubleClick:$,style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...wn(a)?{"--image-aspect-ratio":No(a)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${s}-cover-image ${wn(a)?`${s}-cover-image-cover`:`${s}-cover-image-fit`}`,src:d,alt:"cover"})}):null]}),v&&typeof document<"u"&&(()=>{const C=(l?document.getElementById(l):null)??document.body;return Fi.createPortal(r.jsx($m,{prefix:s,images:x,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:w}),C)})()]})},Em=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
8851
8851
|
import { createPortal } from 'react-dom';
|
|
8852
8852
|
import { CommonComponentProps } from '../props';
|
|
8853
8853
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -8866,6 +8866,9 @@ const SNAP_SCROLL_MAX_MS = 1500;
|
|
|
8866
8866
|
const SNAP_SCROLL_EASING = 'cubic-bezier(0.16, 1, 0.3, 1)';
|
|
8867
8867
|
const CONTROLS_IDLE_MS = 3000;
|
|
8868
8868
|
const THUMB_MAX_SIZE_PX = 42;
|
|
8869
|
+
const WHEEL_SPEED = 2;
|
|
8870
|
+
const WHEEL_LINE_HEIGHT_PX = 16;
|
|
8871
|
+
const WHEEL_LERP = 0.05;
|
|
8869
8872
|
|
|
8870
8873
|
function getCSS(P: string): string {
|
|
8871
8874
|
return \`
|
|
@@ -10097,6 +10100,11 @@ const LightboxOverlay = ({
|
|
|
10097
10100
|
hasMoved: false,
|
|
10098
10101
|
});
|
|
10099
10102
|
const scrollAnimRef = useRef<(() => void) | null>(null);
|
|
10103
|
+
const lastScrollLeftRef = useRef(0);
|
|
10104
|
+
const scrollDirRef = useRef<'forward' | 'backward'>('forward');
|
|
10105
|
+
const wheelTargetRef = useRef(0);
|
|
10106
|
+
const wheelRafRef = useRef<number | null>(null);
|
|
10107
|
+
const isWheelingRef = useRef(false);
|
|
10100
10108
|
const isLoopEnabled = images.length > 1;
|
|
10101
10109
|
const loopCopies = isLoopEnabled ? LOOP_COPIES : 1;
|
|
10102
10110
|
const flatItems = useMemo(
|
|
@@ -10294,24 +10302,63 @@ const LightboxOverlay = ({
|
|
|
10294
10302
|
if (adjustMouseDragAnchor) {
|
|
10295
10303
|
mouseDragRef.current.scrollLeft += setWidth;
|
|
10296
10304
|
}
|
|
10305
|
+
if (isWheelingRef.current) {
|
|
10306
|
+
wheelTargetRef.current += setWidth;
|
|
10307
|
+
}
|
|
10297
10308
|
} else if (strip.scrollLeft >= setWidth * 2) {
|
|
10298
10309
|
strip.scrollLeft -= setWidth;
|
|
10299
10310
|
if (adjustMouseDragAnchor) {
|
|
10300
10311
|
mouseDragRef.current.scrollLeft -= setWidth;
|
|
10301
10312
|
}
|
|
10313
|
+
if (isWheelingRef.current) {
|
|
10314
|
+
wheelTargetRef.current -= setWidth;
|
|
10315
|
+
}
|
|
10302
10316
|
}
|
|
10303
10317
|
};
|
|
10304
10318
|
|
|
10305
|
-
const getNearestFlatIndex = (scrollLeft = stripRef.current?.scrollLeft ?? 0) =>
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10319
|
+
const getNearestFlatIndex = (scrollLeft = stripRef.current?.scrollLeft ?? 0) => {
|
|
10320
|
+
const viewport = stripRef.current?.clientWidth ?? 0;
|
|
10321
|
+
const viewportCenter = scrollLeft + viewport / 2;
|
|
10322
|
+
let containingIndex = -1;
|
|
10323
|
+
let nearest = { flatIndex: 0, distance: Infinity };
|
|
10324
|
+
itemRefs.current.forEach((item, flatIndex) => {
|
|
10325
|
+
if (!item) return;
|
|
10326
|
+
const left = item.offsetLeft;
|
|
10327
|
+
const right = left + item.offsetWidth;
|
|
10328
|
+
if (containingIndex === -1 && viewportCenter >= left && viewportCenter < right) {
|
|
10329
|
+
containingIndex = flatIndex;
|
|
10330
|
+
}
|
|
10331
|
+
const distance = Math.abs(left - scrollLeft);
|
|
10332
|
+
if (distance < nearest.distance) {
|
|
10333
|
+
nearest = { flatIndex, distance };
|
|
10334
|
+
}
|
|
10335
|
+
});
|
|
10336
|
+
return containingIndex !== -1 ? containingIndex : nearest.flatIndex;
|
|
10337
|
+
};
|
|
10338
|
+
|
|
10339
|
+
const isOversizedItem = (item: HTMLDivElement | null) => {
|
|
10340
|
+
const strip = stripRef.current;
|
|
10341
|
+
if (!item || !strip) return false;
|
|
10342
|
+
return item.offsetWidth > strip.clientWidth + 1;
|
|
10343
|
+
};
|
|
10344
|
+
|
|
10345
|
+
const updateOversizedSnapAlign = (direction: 'forward' | 'backward') => {
|
|
10346
|
+
if (!stripRef.current) return;
|
|
10347
|
+
itemRefs.current.forEach((item) => {
|
|
10348
|
+
if (!item) return;
|
|
10349
|
+
item.style.scrollSnapAlign = isOversizedItem(item) && direction === 'backward'
|
|
10350
|
+
? 'end'
|
|
10351
|
+
: 'start';
|
|
10352
|
+
});
|
|
10353
|
+
};
|
|
10354
|
+
|
|
10355
|
+
const isViewportWithinOversizedItem = (item: HTMLDivElement | null) => {
|
|
10356
|
+
const strip = stripRef.current;
|
|
10357
|
+
if (!item || !strip || !isOversizedItem(item)) return false;
|
|
10358
|
+
const left = item.offsetLeft;
|
|
10359
|
+
const right = left + item.offsetWidth;
|
|
10360
|
+
return strip.scrollLeft >= left - 1 && strip.scrollLeft + strip.clientWidth <= right + 1;
|
|
10361
|
+
};
|
|
10315
10362
|
|
|
10316
10363
|
const updateActiveIndex = () => {
|
|
10317
10364
|
if (!stripRef.current || images.length === 0) return;
|
|
@@ -10334,6 +10381,37 @@ const LightboxOverlay = ({
|
|
|
10334
10381
|
scrollAnimRef.current = null;
|
|
10335
10382
|
};
|
|
10336
10383
|
|
|
10384
|
+
const stopWheelAnimation = () => {
|
|
10385
|
+
if (wheelRafRef.current !== null) {
|
|
10386
|
+
cancelAnimationFrame(wheelRafRef.current);
|
|
10387
|
+
wheelRafRef.current = null;
|
|
10388
|
+
}
|
|
10389
|
+
isWheelingRef.current = false;
|
|
10390
|
+
};
|
|
10391
|
+
|
|
10392
|
+
const stepWheelAnimation = () => {
|
|
10393
|
+
const strip = stripRef.current;
|
|
10394
|
+
if (!strip) {
|
|
10395
|
+
wheelRafRef.current = null;
|
|
10396
|
+
isWheelingRef.current = false;
|
|
10397
|
+
return;
|
|
10398
|
+
}
|
|
10399
|
+
const distance = wheelTargetRef.current - strip.scrollLeft;
|
|
10400
|
+
if (Math.abs(distance) < 0.5) {
|
|
10401
|
+
strip.scrollLeft = wheelTargetRef.current;
|
|
10402
|
+
normalizeInfiniteScroll();
|
|
10403
|
+
updateActiveIndex();
|
|
10404
|
+
wheelRafRef.current = null;
|
|
10405
|
+
isWheelingRef.current = false;
|
|
10406
|
+
return;
|
|
10407
|
+
}
|
|
10408
|
+
strip.scrollLeft += distance * WHEEL_LERP;
|
|
10409
|
+
normalizeInfiniteScroll();
|
|
10410
|
+
updateActiveIndex();
|
|
10411
|
+
resetOverlayContentIdleTimer();
|
|
10412
|
+
wheelRafRef.current = requestAnimationFrame(stepWheelAnimation);
|
|
10413
|
+
};
|
|
10414
|
+
|
|
10337
10415
|
const clearStripTrackTransform = () => {
|
|
10338
10416
|
const track = trackRef.current;
|
|
10339
10417
|
if (!track) return;
|
|
@@ -10350,6 +10428,7 @@ const LightboxOverlay = ({
|
|
|
10350
10428
|
) => {
|
|
10351
10429
|
clearStripTrackTransform();
|
|
10352
10430
|
strip.scrollLeft = targetLeft;
|
|
10431
|
+
lastScrollLeftRef.current = strip.scrollLeft;
|
|
10353
10432
|
normalizeInfiniteScroll();
|
|
10354
10433
|
if (activeIndex !== undefined) {
|
|
10355
10434
|
setActiveIndex(activeIndex);
|
|
@@ -10376,6 +10455,7 @@ const LightboxOverlay = ({
|
|
|
10376
10455
|
const track = trackRef.current;
|
|
10377
10456
|
if (!strip || !track) return;
|
|
10378
10457
|
|
|
10458
|
+
stopWheelAnimation();
|
|
10379
10459
|
cancelScrollAnimation();
|
|
10380
10460
|
setStripSnapEnabled(false);
|
|
10381
10461
|
|
|
@@ -10418,6 +10498,13 @@ const LightboxOverlay = ({
|
|
|
10418
10498
|
const scrollDelta = strip.scrollLeft - startScrollLeft;
|
|
10419
10499
|
const currentFlatIndex = getNearestFlatIndex(strip.scrollLeft);
|
|
10420
10500
|
const currentItem = itemRefs.current[currentFlatIndex];
|
|
10501
|
+
|
|
10502
|
+
if (isViewportWithinOversizedItem(currentItem)) {
|
|
10503
|
+
setStripSnapEnabled(true);
|
|
10504
|
+
updateActiveIndex();
|
|
10505
|
+
return;
|
|
10506
|
+
}
|
|
10507
|
+
|
|
10421
10508
|
const nextItem = itemRefs.current[currentFlatIndex + 1];
|
|
10422
10509
|
const span = currentItem
|
|
10423
10510
|
? (nextItem ? nextItem.offsetLeft - currentItem.offsetLeft : currentItem.offsetWidth)
|
|
@@ -10440,12 +10527,17 @@ const LightboxOverlay = ({
|
|
|
10440
10527
|
return;
|
|
10441
10528
|
}
|
|
10442
10529
|
|
|
10530
|
+
const movingBackward = scrollDelta < 0;
|
|
10531
|
+
const targetLeft = movingBackward && isOversizedItem(targetItem)
|
|
10532
|
+
? targetItem.offsetLeft + targetItem.offsetWidth - strip.clientWidth
|
|
10533
|
+
: targetItem.offsetLeft;
|
|
10534
|
+
|
|
10443
10535
|
const snapTargetIndex = targetFlatIndex % images.length;
|
|
10444
10536
|
if (behavior === 'smooth') {
|
|
10445
10537
|
lockedActiveIndexRef.current = snapTargetIndex;
|
|
10446
10538
|
}
|
|
10447
10539
|
setActiveIndex(snapTargetIndex);
|
|
10448
|
-
scrollStripTo(
|
|
10540
|
+
scrollStripTo(targetLeft, {
|
|
10449
10541
|
behavior,
|
|
10450
10542
|
activeIndex: snapTargetIndex,
|
|
10451
10543
|
onComplete: behavior === 'smooth' ? releaseActiveIndexLock : undefined,
|
|
@@ -10472,10 +10564,18 @@ const LightboxOverlay = ({
|
|
|
10472
10564
|
|
|
10473
10565
|
const onStripPointerDown = (event: React.PointerEvent<HTMLDivElement>) => {
|
|
10474
10566
|
if (!allowMouseDrag) return;
|
|
10567
|
+
if (event.pointerType === 'touch') {
|
|
10568
|
+
// Free wheel scrolling leaves native snap disabled; restore it so the
|
|
10569
|
+
// touch swipe keeps its snapping behaviour.
|
|
10570
|
+
stopWheelAnimation();
|
|
10571
|
+
setStripSnapEnabled(true);
|
|
10572
|
+
return;
|
|
10573
|
+
}
|
|
10475
10574
|
if (event.pointerType !== 'mouse' || event.button !== 0) return;
|
|
10476
10575
|
if (isDragBlockedTarget(event.target as HTMLElement)) return;
|
|
10477
10576
|
const strip = stripRef.current;
|
|
10478
10577
|
if (!strip) return;
|
|
10578
|
+
stopWheelAnimation();
|
|
10479
10579
|
cancelScrollAnimation();
|
|
10480
10580
|
clearStripTrackTransform();
|
|
10481
10581
|
lockedActiveIndexRef.current = null;
|
|
@@ -10602,17 +10702,77 @@ const LightboxOverlay = ({
|
|
|
10602
10702
|
};
|
|
10603
10703
|
}, [isEditMode]);
|
|
10604
10704
|
|
|
10705
|
+
useEffect(() => {
|
|
10706
|
+
const strip = stripRef.current;
|
|
10707
|
+
if (!strip || !allowImageScroll) return;
|
|
10708
|
+
|
|
10709
|
+
const onWheel = (event: WheelEvent) => {
|
|
10710
|
+
// Vertical wheel (top/bottom) drives the horizontal slide; horizontal
|
|
10711
|
+
// wheel/scroll is intentionally ignored so left/right scroll never navigates.
|
|
10712
|
+
event.preventDefault();
|
|
10713
|
+
if (Math.abs(event.deltaY) <= Math.abs(event.deltaX)) return;
|
|
10714
|
+
const unit = event.deltaMode === 1
|
|
10715
|
+
? WHEEL_LINE_HEIGHT_PX
|
|
10716
|
+
: event.deltaMode === 2
|
|
10717
|
+
? strip.clientHeight
|
|
10718
|
+
: 1;
|
|
10719
|
+
const delta = event.deltaY * unit * WHEEL_SPEED;
|
|
10720
|
+
if (delta === 0) return;
|
|
10721
|
+
|
|
10722
|
+
cancelScrollAnimation();
|
|
10723
|
+
if (!isWheelingRef.current) {
|
|
10724
|
+
// Start a new wheel session: anchor the target to the current position
|
|
10725
|
+
// so accumulated deltas interpolate smoothly from where we are.
|
|
10726
|
+
isWheelingRef.current = true;
|
|
10727
|
+
wheelTargetRef.current = strip.scrollLeft;
|
|
10728
|
+
lockedActiveIndexRef.current = null;
|
|
10729
|
+
setStripSnapEnabled(false);
|
|
10730
|
+
}
|
|
10731
|
+
|
|
10732
|
+
wheelTargetRef.current += delta;
|
|
10733
|
+
if (!isLoopEnabled) {
|
|
10734
|
+
const maxScrollLeft = strip.scrollWidth - strip.clientWidth;
|
|
10735
|
+
wheelTargetRef.current = Math.max(0, Math.min(maxScrollLeft, wheelTargetRef.current));
|
|
10736
|
+
}
|
|
10737
|
+
resetOverlayContentIdleTimer();
|
|
10738
|
+
|
|
10739
|
+
// No snap on wheel: the lerp eases toward the accumulated target and the
|
|
10740
|
+
// strip rests wherever it lands. Native snapping is restored on touch.
|
|
10741
|
+
if (wheelRafRef.current === null) {
|
|
10742
|
+
wheelRafRef.current = requestAnimationFrame(stepWheelAnimation);
|
|
10743
|
+
}
|
|
10744
|
+
};
|
|
10745
|
+
|
|
10746
|
+
strip.addEventListener('wheel', onWheel, { passive: false });
|
|
10747
|
+
return () => {
|
|
10748
|
+
strip.removeEventListener('wheel', onWheel);
|
|
10749
|
+
stopWheelAnimation();
|
|
10750
|
+
};
|
|
10751
|
+
}, [allowImageScroll, images.length, isLoopEnabled]);
|
|
10752
|
+
|
|
10605
10753
|
useEffect(() => {
|
|
10606
10754
|
const strip = stripRef.current;
|
|
10607
10755
|
if (!strip) return;
|
|
10608
10756
|
const onScroll = () => {
|
|
10609
10757
|
normalizeInfiniteScroll();
|
|
10758
|
+
const current = strip.scrollLeft;
|
|
10759
|
+
const delta = current - lastScrollLeftRef.current;
|
|
10760
|
+
lastScrollLeftRef.current = current;
|
|
10761
|
+
const loopJump = setWidthRef.current > 0 ? setWidthRef.current * 0.5 : Infinity;
|
|
10762
|
+
if (delta !== 0 && Math.abs(delta) < loopJump) {
|
|
10763
|
+
const direction = delta > 0 ? 'forward' : 'backward';
|
|
10764
|
+
if (direction !== scrollDirRef.current) {
|
|
10765
|
+
scrollDirRef.current = direction;
|
|
10766
|
+
updateOversizedSnapAlign(direction);
|
|
10767
|
+
}
|
|
10768
|
+
}
|
|
10610
10769
|
updateActiveIndex();
|
|
10611
10770
|
};
|
|
10612
10771
|
strip.addEventListener('scroll', onScroll, { passive: true });
|
|
10613
10772
|
const observer = new ResizeObserver(() => {
|
|
10614
10773
|
measureSetWidth();
|
|
10615
10774
|
normalizeInfiniteScroll();
|
|
10775
|
+
updateOversizedSnapAlign(scrollDirRef.current);
|
|
10616
10776
|
updateActiveIndex();
|
|
10617
10777
|
});
|
|
10618
10778
|
observer.observe(strip);
|
|
@@ -10934,7 +11094,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
10934
11094
|
</>
|
|
10935
11095
|
);
|
|
10936
11096
|
};
|
|
10937
|
-
`,$m="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>'),Fn={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 Lm(e){const t={};return t[lt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[lt(e,"fontSettings")]={...Fn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[lt(e,"fontSize")]={...Fn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[lt(e,"lineHeight")]={...Fn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[lt(e,"letterSpacing")]={...Fn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[lt(e,"wordSpacing")]={...Fn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[lt(e,"textAlign")]={...Fn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[lt(e,"textAppearance")]={...Fn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Im=ki.reduce((e,t)=>({...e,...Lm(t)}),{}),Em=ki.reduce((e,t)=>({...e,[lt(t,"fontFamily")]:"Arial",[lt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[lt(t,"letterSpacing")]:0,[lt(t,"wordSpacing")]:0,[lt(t,"textAlign")]:"left",[lt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Fl(e){return ki.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[lt(n,"fontSize")]=i),o!==void 0&&(t[lt(n,"lineHeight")]=o),t},{})}const Rm=gm(),Mm={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:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up"]}},thumbnailActiveColor:{type:"string",scope:"common",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},...Im,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/LightboxJournal_1.jpg",coverFit:{display:"Cover",ratioValue:"16:9",reversed:!1},closeIcon:$m,closeIconColor:"#ffffff",closeIconHoverColor:"#cccccc",thumbnailObjectFit:{display:"Fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#ffffff",title2Color:"#ffffff",title3Color:"#ffffff",...Em},layoutDefaults:{m:{thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,backgroundColor:"rgba(28, 31, 34, 0.9)",contentMarginTop:.08,iconMarginLeft:.02,...Fl({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},d:{thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.02,imageGap:.005,title1Width:.13,title2Width:.13,title3Width:.14,title1MarginLeft:.02,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,backgroundColor:"rgba(28, 31, 34, 0.9)",contentMarginTop:.02,iconMarginLeft:.02,...Fl({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","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Rm]}],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"}}]}},_m={element:Cm,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:Mm,sourceCode:Tm,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:ki.map(e=>({path:`styles.${lt(e,"fontSettings")}`}))}},qo=300,sr=400,Nl=300,Wm=50,Hl=10,Hr="cntrl-lightbox-journal",Mo=Hr,ar=`${Hr}-`,_o=e=>`${Hr}-${e}`,Br=e=>e===Mo||e.startsWith(ar),Bl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Ol=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Bl(t.get(_o(e)));if(i)return i}const n=Bl(t.get(Mo));if(n)return n;for(const[i]of t){if(!i.startsWith(ar))continue;const o=i.slice(ar.length);if(!/^\d+$/.test(o))continue;const l=Number.parseInt(o,10);if(Number.isFinite(l)&&l>=1)return l}return null},Dl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Hs=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(s=>{Br(s)&&i.searchParams.delete(s)}),t?i.searchParams.set(_o(t),String(e)):i.searchParams.set(Mo,String(e));const o=n?"replaceState":"pushState",l=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",l)},Am=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===_o(e)||i===Mo:Br(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)}},Bs=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(_o(e)):[...t.keys()].some(n=>Br(n))},Pm=(e,t)=>{if(Bs(t)){if(e){window.history.back();return}Am(t)}};function km(e){return`
|
|
11097
|
+
`,Im="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>'),zn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Rm(e){const t={};return t[st(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[st(e,"fontSettings")]={...zn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[st(e,"fontSize")]={...zn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[st(e,"lineHeight")]={...zn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[st(e,"letterSpacing")]={...zn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[st(e,"wordSpacing")]={...zn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[st(e,"textAlign")]={...zn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[st(e,"textAppearance")]={...zn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Mm=Ki.reduce((e,t)=>({...e,...Rm(t)}),{}),Wm=Ki.reduce((e,t)=>({...e,[st(t,"fontFamily")]:"Arial",[st(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[st(t,"letterSpacing")]:0,[st(t,"wordSpacing")]:0,[st(t,"textAlign")]:"left",[st(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ol(e){return Ki.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[st(n,"fontSize")]=i),o!==void 0&&(t[st(n,"lineHeight")]=o),t},{})}const _m=ym(),Am={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:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up"]}},thumbnailActiveColor:{type:"string",scope:"common",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},...Mm,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/LightboxJournal_1.jpg",coverFit:{display:"Cover",ratioValue:"16:9",reversed:!1},closeIcon:Im,closeIconColor:"#ffffff",closeIconHoverColor:"#cccccc",thumbnailObjectFit:{display:"Fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",thumbnailActiveColor:"#ffffff",title1Color:"#ffffff",title2Color:"#ffffff",title3Color:"#ffffff",...Wm},layoutDefaults:{m:{thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,backgroundColor:"rgba(28, 31, 34, 0.9)",contentMarginTop:.08,iconMarginLeft:.02,...Ol({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04})},d:{thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.02,imageGap:.005,title1Width:.13,title2Width:.13,title3Width:.14,title1MarginLeft:.02,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,backgroundColor:"rgba(28, 31, 34, 0.9)",contentMarginTop:.02,iconMarginLeft:.02,...Ol({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","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[_m]}],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"}}]}},Pm={element:Lm,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:Am,sourceCode:Em,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:Ki.map(e=>({path:`styles.${st(e,"fontSettings")}`}))}},nr=300,hr=400,Dl=300,km=50,jl=10,Gr="cntrl-lightbox-journal",Ho=Gr,fr=`${Gr}-`,Bo=e=>`${Gr}-${e}`,Ur=e=>e===Ho||e.startsWith(fr),zl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Vl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=zl(t.get(Bo(e)));if(i)return i}const n=zl(t.get(Ho));if(n)return n;for(const[i]of t){if(!i.startsWith(fr))continue;const o=i.slice(fr.length);if(!/^\d+$/.test(o))continue;const l=Number.parseInt(o,10);if(Number.isFinite(l)&&l>=1)return l}return null},Kl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},js=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(s=>{Ur(s)&&i.searchParams.delete(s)}),t?i.searchParams.set(Bo(t),String(e)):i.searchParams.set(Ho,String(e));const o=n?"replaceState":"pushState",l=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",l)},Fm=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Bo(e)||i===Ho:Ur(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)}},zs=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Bo(e)):[...t.keys()].some(n=>Ur(n))},Nm=(e,t)=>{if(zs(t)){if(e){window.history.back();return}Fm(t)}};function Hm(e){return`
|
|
10938
11098
|
.${e}-wrapper {
|
|
10939
11099
|
position: relative;
|
|
10940
11100
|
width: 100%;
|
|
@@ -11092,11 +11252,11 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
11092
11252
|
|
|
11093
11253
|
.${e}-slide-fade-in {
|
|
11094
11254
|
opacity: 0;
|
|
11095
|
-
animation: ${e}-slide-fade-in ${
|
|
11255
|
+
animation: ${e}-slide-fade-in ${Dl}ms ease-in-out forwards;
|
|
11096
11256
|
}
|
|
11097
11257
|
|
|
11098
11258
|
.${e}-slide-fade-out {
|
|
11099
|
-
animation: ${e}-slide-fade-out ${
|
|
11259
|
+
animation: ${e}-slide-fade-out ${Dl}ms ease-in-out forwards;
|
|
11100
11260
|
}
|
|
11101
11261
|
|
|
11102
11262
|
.${e}-slide-area {
|
|
@@ -11363,11 +11523,11 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
11363
11523
|
|
|
11364
11524
|
.${e}-titles-fade-in {
|
|
11365
11525
|
opacity: 0;
|
|
11366
|
-
animation: ${e}-titles-fade-in ${
|
|
11526
|
+
animation: ${e}-titles-fade-in ${hr}ms ease-in-out forwards;
|
|
11367
11527
|
}
|
|
11368
11528
|
|
|
11369
11529
|
.${e}-titles-fade-out {
|
|
11370
|
-
animation: ${e}-titles-fade-out ${
|
|
11530
|
+
animation: ${e}-titles-fade-out ${hr}ms ease-in-out forwards;
|
|
11371
11531
|
}
|
|
11372
11532
|
|
|
11373
11533
|
.${e}-lightbox-overlay-content {
|
|
@@ -11443,7 +11603,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
11443
11603
|
pointer-events: auto;
|
|
11444
11604
|
z-index: 10;
|
|
11445
11605
|
}
|
|
11446
|
-
`}const Fm=20,Nm=2,Xo=e=>`max(${e}, ${Fm}px)`,li=e=>((e==null?void 0:e.image)??[]).slice(0,Nm),Os=e=>e.reduce((t,n)=>t+li(n).length,0),Hm=(e,t)=>{const n=e.slice(0,t).reduce((o,l)=>o+li(l).length,1),i=li(e[t]).length;return{start:n,end:n+i-1}},Bm=(e,t)=>{const n=Os(e),{start:i,end:o}=Hm(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},so=(e,t)=>t==="B"?e.flatMap((n,i)=>li(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:li(n)})),Om=(e,t,n,i)=>{var l;if(n==="B")return`${t+1} / ${e.length}`;const o=((l=e[t])==null?void 0:l.entryIndex)??0;return Bm(i,o)},jl=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Dm=(e,t,n)=>e==="B"?t.length>1:Os(n)>1,Un=.004,qi=.004,Yo={title1Width:.13,title2Width:.13,title3Width:.14};function Xi(e,t,n,i,o){const l=[];return t.title1&&l.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&l.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&l.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),l}function ho(e,t){if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const a=Math.min(l,d);return{overflow:l-a,widths:[d-a,...s]}},{overflow:i-1,widths:[]});return o}function cr(e,t){return ho(e,t)}function Nn(e,t){const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)}function Yi(e,t){const n=e.map(i=>t[i.widthKey]??0);return{resolved:ho(e.length,n),effective:cr(e.length,n)}}function jm(e,t,n,i){return e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0)}function zm(e,t,n,i){return e.slice(0,i+1).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0)}const Vm=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,initialSlideIndex:s=0,enableUrlSync:d=!1,journalItemId:a=null,onBeforeClose:p,onClose:u})=>{const{type:S,coverFit:x,backgroundColor:y,imageGap:m,maxWidth:f,maxHeight:$,textTransition:w,title1Width:C,title2Width:T,title3Width:P,title1MarginLeft:R=0,title2MarginLeft:F=0,title3MarginLeft:b=0,titleRowMarginBottom:_=0,titleHeaderLayout:V="single-row",countCloseGap:h=0,closeIcon:L,closeIconMaxWidth:I,closeIconColor:k,closeIconHoverColor:z,contentMarginTop:le=0,iconMarginRight:O=0}=n,W=c.useCallback(M=>E.scalingValue(M,i??!1),[i]),G=W(m??0),K=`${f}%`,H=`${$}%`,q=W(h),te=W(le),se=W(O),N=Zi("title1",Ji(n,"title1"),i),ce=Zi("title2",Ji(n,"title2"),i),g=Zi("title3",Ji(n,"title3"),i),ne=Zi("count",Ji(n,"count"),i),fe=!!o,ie=V==="mobile",we=!i||!!l,me=!o&&(!i||!!l),oe=c.useMemo(()=>so(t,S),[t,S]),[B,Q]=c.useState(s),U=oe[B],Y=U==null?void 0:U.entry,[Ie,Me]=c.useState(!1),[Ae,Pe]=c.useState(null),[xe,j]=c.useState(!1),[ae,A]=c.useState(null),[D,X]=c.useState(!1),[J,ge]=c.useState(0),[Ce,De]=c.useState(),[Re,$e]=c.useState(),[Ge,pe]=c.useState(null),Ee=c.useRef(null),je=c.useRef(0),ze=c.useRef(0),Ve=c.useRef(0),It=c.useRef(!1),pt=c.useRef(null),$t=c.useRef(null),Ye=c.useRef(null),ft=c.useRef(null),bt=c.useRef(null),Ot=c.useRef(null),We=c.useRef(null),wt=c.useCallback(()=>{const M=$t.current;if(!M)return;const de=M.closest(`.${e}-lightbox-content-area`);if(!de)return M.getBoundingClientRect().width;const _e=Array.from(de.children).reduce((Te,Se)=>!(Se instanceof HTMLElement)||Se.contains(M)?Te:Te+Se.getBoundingClientRect().width,0);return de.getBoundingClientRect().width-_e},[e]),Qe=c.useCallback(()=>{Ee.current&&(clearTimeout(Ee.current),Ee.current=null)},[]),Et=c.useCallback(M=>{M===je.current&&(A(null),X(!1))},[]),kt=c.useCallback(()=>{o||It.current||(It.current=!0,p==null||p(),Me(!1),pt.current=setTimeout(()=>{u()},qo))},[o,p,u]),sn=c.useCallback(M=>!!(M.closest("[data-controls]")||M.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:At,backdropStyle:Dt,mediaAreaStyle:zt,overlayContentStyle:Fe,swipeHandlers:ct,dismissAreaStyle:mt}=ks({enabled:me,onClose:kt,animMs:qo,isBlockedTarget:sn}),et=c.useCallback(M=>{d&&Hs(M+1,a,!0)},[d,a]),tt=c.useCallback(M=>{var Xt;if(oe.length===0)return;const de=(M%oe.length+oe.length)%oe.length;if(de===B)return;const _e=oe[B],Te=oe[de];je.current+=1;const Se=je.current,rt=w==="fade"&&jl(_e==null?void 0:_e.entry)!==jl(Te==null?void 0:Te.entry),Tt=(Xt=$t.current)==null?void 0:Xt.getBoundingClientRect().height,Ze=rt?(()=>{var Vr;const zn=wt();Li.flushSync(()=>{pe(Te.entry)}),Ye.current&&zn&&(Ye.current.style.width=`${zn}px`);const cn=(Vr=Ye.current)==null?void 0:Vr.getBoundingClientRect().height;return Ye.current&&(Ye.current.style.width=""),{measuredIncomingTitlesHeight:cn,incomingTitlesMeasureWidth:zn}})():void 0,Ht=Math.max(Tt??0,(Ze==null?void 0:Ze.measuredIncomingTitlesHeight)??0)||void 0;ge(Se),A(B),X(!0),Q(de),et(de),Ve.current=de,rt?(Qe(),Ht&&De(Ht),Ze!=null&&Ze.incomingTitlesMeasureWidth&&$e(Ze.incomingTitlesMeasureWidth),Pe((_e==null?void 0:_e.entryIndex)??null),j(!0),ze.current=Te.entryIndex,Ee.current=setTimeout(()=>{Pe(null),j(!1),De(void 0),$e(void 0),pe(null),Ee.current=null},sr)):(Qe(),Pe(null),j(!1),De(void 0),$e(void 0),pe(null),ze.current=Te.entryIndex)},[B,Qe,wt,oe,et,w]),Ft=c.useCallback(()=>{We.current=null},[]),Vt=c.useCallback(M=>{!we||oe.length<=1||M.pointerType==="mouse"&&M.button!==0||M.target.closest("[data-controls]")||(We.current={startX:M.clientX,startY:M.clientY,pointerId:M.pointerId})},[we,oe.length]),Nt=c.useCallback(M=>{var Xt;if(!we||oe.length<=1||M.pointerType==="mouse"&&M.button!==0)return;if(At){Ft();return}const de=We.current;if(!de||de.pointerId!==M.pointerId||(Ft(),M.target.closest("[data-controls]")))return;const Te=M.clientX-de.startX,Se=M.clientY-de.startY,rt=Math.abs(Te),Tt=Math.abs(Se);if(rt>=Wm&&rt>Tt){tt(Te>0?B-1:B+1);return}if(rt>Hl||Tt>Hl)return;const Ze=(Xt=ft.current)==null?void 0:Xt.getBoundingClientRect(),Ht=Ze?Ze.left+Ze.width/2:window.innerWidth/2;tt(M.clientX<Ht?B-1:B+1)},[B,we,tt,At,Ft,oe.length]),bn=c.useCallback(M=>{const de=We.current;(de==null?void 0:de.pointerId)===M.pointerId&&Ft()},[Ft]);Fs(),c.useEffect(()=>{Ot.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const M=requestAnimationFrame(()=>{Me(!0),requestAnimationFrame(()=>{bt.current?bt.current.focus():ft.current&&ft.current.focus()})});return()=>{cancelAnimationFrame(M),pt.current&&clearTimeout(pt.current),Ee.current&&clearTimeout(Ee.current);const de=Ot.current;de&&document.contains(de)&&de.focus()}},[]),c.useEffect(()=>{var M;w!=="fade"&&(ze.current=((M=oe[B])==null?void 0:M.entryIndex)??0,Qe(),Pe(null),j(!1),De(void 0),$e(void 0))},[B,Qe,oe,w]),c.useEffect(()=>{const M=de=>{if(de.key==="Escape"){kt();return}if(de.key==="ArrowLeft"&&oe.length>1){tt(B-1);return}if(de.key==="ArrowRight"&&oe.length>1){tt(B+1);return}if(de.key==="Tab"&&ft.current){const _e=ft.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),Te=Array.from(_e).filter(Ze=>!Ze.closest('[aria-hidden="true"]'));if(Te.length===0)return;const Se=Te[0],rt=Te[Te.length-1],Tt=document.activeElement;de.shiftKey?(Tt===Se||!ft.current.contains(Tt))&&(de.preventDefault(),rt.focus()):(Tt===rt||!ft.current.contains(Tt))&&(de.preventDefault(),Se.focus())}};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[tt,kt,B,oe.length]),c.useLayoutEffect(()=>{Qe(),je.current=0,ge(0),A(null),X(!1),Pe(null),j(!1),De(void 0),$e(void 0),pe(null),Q(M=>{const de=Math.max(0,oe.length-1);return Math.min(M,de)})},[Qe,t.length,S,oe.length]),c.useLayoutEffect(()=>{var M;Ve.current=s,ze.current=((M=oe[s])==null?void 0:M.entryIndex)??0,Q(s)},[s,oe.length]);const Je=Ae!==null?t[Ae]:null,an=ae!==null?oe[ae]:null,Sn=(Y==null?void 0:Y.title1)||(Y==null?void 0:Y.title2)||(Y==null?void 0:Y.title3)||(Je==null?void 0:Je.title1)||(Je==null?void 0:Je.title2)||(Je==null?void 0:Je.title3),Ne=Dm(S,oe,t),yt=L!==null,Rt=Sn||Ne||yt,ee=Ne&&yt?{gap:q}:void 0,ye=`${e}-titles-stack${ie?` ${e}-titles-stack-stacked`:""}`,Le=`${e}-titles-layer-out${ie?` ${e}-titles-layer-out-stacked`:""}`,Oe=W(_),Ke=c.useMemo(()=>({title1Width:C??Yo.title1Width,title2Width:T??Yo.title2Width,title3Width:P??Yo.title3Width}),[C,T,P]),Ue=c.useMemo(()=>({title2MarginLeft:F,title3MarginLeft:b}),[F,b]),ve=c.useMemo(()=>Y?Xi(e,Y,N,ce,g):[],[e,Y,N,ce,g]),gt=c.useMemo(()=>ve.map(M=>Ke[M.widthKey]),[ve,Ke]),ot=c.useMemo(()=>ho(ve.length,gt),[ve.length,gt]),dt=c.useMemo(()=>cr(ve.length,gt),[ve.length,gt]),vt=c.useMemo(()=>ve.filter(M=>M.prefix==="title1"),[ve]),He=c.useMemo(()=>ve.filter(M=>M.prefix==="title2"||M.prefix==="title3"),[ve]),St=c.useMemo(()=>Yi(vt,Ke),[vt,Ke]),nt=c.useMemo(()=>Yi(He,Ke),[He,Ke]),Ct=c.useCallback((M,de)=>{const _e=ve.findIndex(Se=>Se.prefix===M.prefix);if(!ie||de==="single-row")return{effectiveWidth:dt[_e]??0,resolvedWidth:ot[_e]??0,maxWidth:Nn(_e,ot)};if(de==="two-row-top"){const Se=vt.findIndex(rt=>rt.prefix===M.prefix);return{effectiveWidth:St.effective[Se]??0,resolvedWidth:St.resolved[Se]??0,maxWidth:Nn(Se,St.resolved)}}const Te=He.findIndex(Se=>Se.prefix===M.prefix);return{effectiveWidth:nt.effective[Te]??0,resolvedWidth:nt.resolved[Te]??0,maxWidth:Nn(Te,nt.resolved)}},[ve,He,nt,dt,ot,vt,St,ie]),Qt=c.useCallback(M=>zm(ve,ot,Ue,M)+(ie?0:R??0),[ve,ot,Ue,ie,R]),ht=c.useCallback(()=>ie?0:R??0,[ie,R]),en=c.useCallback(M=>He.slice(0,M).reduce((de,_e,Te)=>de+(_e.marginLeftKey?Ue[_e.marginLeftKey]??0:0)+(nt.resolved[Te]??0),0),[He,nt.resolved,Ue]),ut=c.useCallback(M=>{const de=He[M];return en(M)+(de.marginLeftKey?Ue[de.marginLeftKey]??0:0)+(nt.resolved[M]??0)},[He,nt.resolved,en,Ue]),jt=c.useCallback((M,de,_e)=>{if(!ie||_e==="single-row"){const Ze=M.findIndex(cn=>cn.prefix===de.prefix),Ht=M.map(cn=>Ke[cn.widthKey]),Xt=ho(M.length,Ht);return{effectiveWidth:cr(M.length,Ht)[Ze]??0,resolvedWidth:Xt[Ze]??0,maxWidth:Nn(Ze,Xt)}}if(_e==="two-row-top"){const Ze=M.filter(cn=>cn.prefix==="title1"),Ht=Ze.findIndex(cn=>cn.prefix===de.prefix),{resolved:Xt,effective:zn}=Yi(Ze,Ke);return{effectiveWidth:zn[Ht]??0,resolvedWidth:Xt[Ht]??0,maxWidth:Nn(Ht,Xt)}}const Te=M.filter(Ze=>Ze.prefix==="title2"||Ze.prefix==="title3"),Se=Te.findIndex(Ze=>Ze.prefix===de.prefix),{resolved:rt,effective:Tt}=Yi(Te,Ke);return{effectiveWidth:Tt[Se]??0,resolvedWidth:rt[Se]??0,maxWidth:Nn(Se,rt)}},[Ke,ie]),v=(M,de,_e)=>{const Te=M.marginLeftKey?Ue[M.marginLeftKey]??0:0,{effectiveWidth:Se,resolvedWidth:rt,maxWidth:Tt}=_e??Ct(M,de),Ze=Math.max(Te,qi),Ht=fe&&de==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":M.prefix,style:{width:W(Se),...Te>0?{marginLeft:W(Te)}:{}},children:[r.jsx("p",{className:M.className,style:M.style,children:M.text}),Ht&&M.marginLeftKey?r.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(rt),style:{position:"absolute",top:0,left:W(-Te),width:W(Ze),height:"100%",pointerEvents:"auto"}}):null,Ht?r.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Tt),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:W(-Un/2),width:W(Un),height:"100%",pointerEvents:"auto"}}):null]},M.className)},Z=()=>r.jsx("div",{...fe?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:W(R??0),flexShrink:0,alignSelf:"stretch",...fe?{pointerEvents:"auto"}:{}}}),re=()=>r.jsxs("div",{className:`${e}-text-bar-cell`,children:[r.jsx("span",{className:`${e}-entry-counter`,style:ne,"aria-live":"polite","aria-atomic":"true",children:Om(oe,B,S,t)}),fe&&yt?r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Xo(q)} + ${q}))`,width:Xo(q),height:"100%",pointerEvents:"auto",zIndex:3}}):null]}),he=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:E.scalingValue(I??0,i),height:E.scalingValue(I??0,i),marginRight:se,"--close-icon-hover-color":z},children:[r.jsx("button",{ref:bt,type:"button",className:`${e}-close-icon-inner`,onClick:kt,"aria-label":"Close",children:r.jsx(nn,{url:L??"",fill:k,hoverFill:z,className:`${e}-close-icon-img`})}),fe?r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:se,height:"100%",pointerEvents:"auto"}}):null]}),ke=()=>!Ne&&!yt?null:r.jsxs("div",{className:`${e}-titles-row-top-controls`,style:ee,children:[Ne?re():null,yt?he():null]}),it=M=>{if(!M)return null;const de=Xi(e,M,N,ce,g);return r.jsxs(r.Fragment,{children:[R>0||fe?Z():null,de.map(_e=>v(_e,"single-row",jt(de,_e,"single-row")))]})},Mt=M=>{if(!M)return null;const de=Xi(e,M,N,ce,g),_e=de.find(Te=>Te.prefix==="title1");return!_e&&!(R>0||fe)?null:r.jsxs(r.Fragment,{children:[R>0||fe?Z():null,_e?v(_e,"two-row-top",jt(de,_e,"two-row-top")):null]})},_t=(M,de=!1)=>{const _e=M?Xi(e,M,N,ce,g):[],Te=_e.filter(Tt=>Tt.prefix==="title2"||Tt.prefix==="title3"),Se=fe&&de;return Te.length>0||Se||(_??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[Te.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[Te.map(Tt=>v(Tt,"two-row-bottom",jt(_e,Tt,"two-row-bottom"))),de&&fe?r.jsxs(r.Fragment,{children:[Ds(),js()]}):null]}):null,(_??0)>0||Se?r.jsx("div",{"data-controls":Se?"titleRowMarginBottom":void 0,"data-controls-axis":Se?"y":void 0,"data-controls-reverse":Se?"":void 0,className:Se?`${e}-control`:void 0,style:{height:Oe,width:"100%",flexShrink:0,pointerEvents:Se?"auto":"none"}}):null]}):null},Wn=(M,de=!1)=>r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-titles-row-top`,children:[Mt(M),ke()]}),_t(M,de)]}),wn=M=>ie?r.jsx("div",{className:`${e}-titles-row-two-row`,style:{width:"100%"},children:Wn(M)}):M?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:it(M)}):null,Ni=()=>{const M=ie?-1:ve.findIndex(Te=>Te.prefix==="title1"),de=!ie&&(fe||(R??0)>0)?(()=>{const Se=Math.max(R??0,qi),rt=M>=0?ot[M]:C;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(rt),style:{position:"absolute",top:0,left:0,width:W(Se),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,_e=ve.flatMap((Te,Se)=>{if(!Te.marginLeftKey)return[];const rt=Ue[Te.marginLeftKey]??0,Tt=jm(ve,ot,Ue,Se)+ht(),Ze=Math.max(rt,qi);return r.jsx("div",{"data-controls":Te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ot[Se]),style:{position:"absolute",top:0,left:W(Tt),width:W(Ze),height:"100%",pointerEvents:"auto"}},Te.marginLeftKey)});return de?[de,..._e]:_e},ui=()=>ve.map((M,de)=>{const _e=Nn(de,ot),Se=Qt(de)-Un/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(_e),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:W(Se),width:W(Un),height:"100%",pointerEvents:"auto"}})},`${M.widthKey}-junction`)}),Ds=()=>He.flatMap((M,de)=>{if(!M.marginLeftKey)return[];const _e=Ue[M.marginLeftKey]??0,Te=en(de),Se=Math.max(_e,qi),{resolvedWidth:rt}=Ct(M,"two-row-bottom");return r.jsx("div",{"data-controls":M.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(rt),style:{position:"absolute",top:0,left:W(Te),width:W(Se),height:"100%",pointerEvents:"auto"}},M.marginLeftKey)}),js=()=>He.map((M,de)=>{const{maxWidth:_e}=Ct(M,"two-row-bottom"),Se=ut(de)-Un/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":M.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(_e),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:W(Se),width:W(Un),height:"100%",pointerEvents:"auto"}})},`${M.widthKey}-junction`)}),Hi=()=>!fe||ie?null:r.jsxs(r.Fragment,{children:[Ni(),ui()]}),Or=M=>{const de=!M.objectFit&&yn(x);return{className:`${e}-slide-image-cell${de?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:K,maxHeight:H,...de?{"--image-aspect-ratio":Ro(x)}:{}}}},Dr=M=>M.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":M.objectFit}}:yn(x)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},jr=M=>{if(M.length===0)return null;const de=M.length>1,_e=Xo(G),Te=`calc(-0.5 * (${_e} + ${G}))`;if(M.length===1){const Se=M[0];return r.jsx("div",{...Or(Se),children:r.jsx("img",{...Dr(Se),src:Se.url,alt:Se.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:de?{gap:G}:void 0,children:M.map((Se,rt)=>r.jsxs("div",{...Or(Se),children:[r.jsx("img",{...Dr(Se),src:Se.url,alt:Se.name??"",draggable:!1}),fe&&de&&rt<M.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Te,width:_e,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Se.url}-${rt}`))})},zr=!!(Y!=null&&Y.title2||Y!=null&&Y.title3||Je!=null&&Je.title2||Je!=null&&Je.title3||(_??0)>0||fe),zs=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:Ye,className:ye,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Wn(Ge||Y)}),r.jsxs("div",{ref:$t,className:`${e}-titles-row-two-row`,style:{...xe&&Ce?{minHeight:Ce}:void 0,...xe&&Re?{width:Re,maxWidth:"100%"}:void 0,...xe?{overflow:"hidden"}:void 0},children:[r.jsxs("div",{className:`${e}-titles-row-top`,children:[r.jsxs("div",{className:ye,style:{position:"relative",flex:1,minWidth:0},children:[Je&&xe?r.jsx("div",{className:`${Le} ${e}-titles-fade-out`,children:Mt(Je)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Mt(Y)})]}),ke()]}),zr?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Je&&xe?r.jsx("div",{className:`${Le} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:_t(Je)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ie?` ${e}-titles-layer-in-stacked`:""}`,children:_t(Y,!0)}),Hi()]}):null]})]}),Vs=()=>{const M=zr;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...M?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:M?void 0:{flex:"0 0 auto",height:"auto"},children:Wn(Y,!0)}),Hi()]})};return r.jsxs("div",{ref:ft,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{At||kt()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:yt?void 0:-1,style:{opacity:Ie?1:0,transition:`opacity ${qo}ms ease`,pointerEvents:Ie?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:y,...Dt}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%",...mt},...ct,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:zt,onClick:M=>M.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":we&&oe.length>1?"true":"false",onPointerDown:we?Vt:void 0,onPointerUp:we?Nt:void 0,onPointerCancel:we?bn:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[an&&D?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:M=>{M.target===M.currentTarget&&Et(J)},children:r.jsx("div",{className:`${e}-slide-area`,children:jr(an.images)})},`slide-out-${J}`):null,r.jsx("div",{className:`${e}-slide-layer-in${D?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:U?jr(U.images):null})},`slide-in-${J}-${B}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:{width:"100%",height:"100%",...Fe},children:[r.jsx("div",{"data-controls":fe?"contentMarginTop":void 0,className:fe?`${e}-control`:void 0,style:{height:te,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ie?{flex:1,minHeight:0}:{}},children:r.jsxs("div",{className:`${e}-lightbox-content-area${ie?` ${e}-lightbox-content-area-stacked`:""}`,children:[(ie?Rt:Sn)&&r.jsx("div",{className:`${e}-text-bar-cell${ie?` ${e}-text-bar-cell-stacked`:""}`,children:ie?w==="fade"?zs():Vs():w==="fade"?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:Ye,className:ye,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:wn(Ge||Y)}),r.jsxs("div",{ref:$t,className:ye,style:{width:"100%",...xe&&Ce?{minHeight:Ce}:void 0,...xe&&Re?{width:Re,maxWidth:"100%"}:void 0,...xe?{overflow:"hidden"}:void 0},children:[Je&&xe?r.jsx("div",{className:`${Le} ${e}-titles-fade-out`,children:wn(Je)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:wn(Y)}),Hi()]})]}):r.jsxs("div",{style:{position:"relative",width:"100%"},children:[wn(Y),Hi()]})}),!ie&&r.jsxs("div",{className:`${e}-lightbox-persistent-controls`,style:ee,children:[Ne&&re(),yt&&he()]})]})})]})]})]})},Fi=["title1","title2","title3","count"];function st(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const Km={title1:"1",title2:"2",title3:"3",count:"Count"};function Um(e){return[st(e,"fontFamily"),st(e,"fontSettings"),{type:"row",items:[st(e,"fontSize"),st(e,"lineHeight"),st(e,"letterSpacing"),st(e,"wordSpacing")]},st(e,"textAlign"),st(e,"textAppearance")]}function Gm(){return{type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Fi.map(e=>[Km[e],Um(e)]))}}const qm={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Xm={title1:.02,title2:.02,title3:.02,count:.017};function Ji(e,t){const n=i=>{const o=st(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[qm[t]]}}function Zi(e,t,n){var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??Xm[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Wt(i,n)}const Ym=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l,metadata:s})=>{const{prefix:d}=E.useScopedStyles(),a=(s==null?void 0:s.itemId)??null,{cover:p,coverFit:u,type:S}=e,x=c.useRef(null),[y,m]=c.useState(!1),[f,$]=c.useState(0),w=c.useRef(!1),C=c.useRef(!1),T=c.useRef(!1),P=c.useMemo(()=>(t??[]).filter(I=>li(I).length>0),[t]),R=y&&P.length>0,F=!n,b=c.useCallback(()=>{F&&(T.current=!0,Pm(C.current,a),C.current=!1)},[F,a]),_=(I=0)=>{if(P.length===0||n&&!i&&!o)return;const k=so(P,S),z=Math.max(0,Math.min(I,k.length-1));if($(z),F){const le=Bs();Hs(z+1,a,le),C.current=!le}m(!0)},V=()=>{n||_()},h=I=>{n&&(I.stopPropagation(),_())},L=c.useCallback(()=>{m(!1),T.current=!1},[]);return c.useEffect(()=>{!n||i||o||m(!1)},[n,i,o]),c.useEffect(()=>{if(!F||w.current)return;w.current=!0;const I=Ol(a);if(!I)return;const k=Dl(I,so(P,S).length);k<0||($(k),m(!0))},[P,a,F,S]),c.useEffect(()=>{if(!F)return;const I=()=>{if(T.current){T.current=!1,m(!1);return}const k=Ol(a);if(!k){m(!1);return}const z=Dl(k,so(P,S).length);if(z<0){m(!1);return}C.current=!1,$(z),m(!0)};return window.addEventListener("popstate",I),()=>window.removeEventListener("popstate",I)},[P,a,F,S]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:x,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:km(d)}}),p?r.jsx("button",{type:"button",className:`${d}-cover ${yn(u)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:V,onDoubleClick:h,style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...yn(u)?{"--image-aspect-ratio":Ro(u)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${yn(u)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:p,alt:"cover"})}):null]}),R&&typeof document<"u"&&(()=>{const I=(l?document.getElementById(l):null)??document.body;return Li.createPortal(r.jsx(Vm,{prefix:d,entries:P,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:F,journalItemId:a,onBeforeClose:b,onClose:L}),I)})()]})},Jm=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
11606
|
+
`}const Bm=20,Om=2,ir=e=>`max(${e}, ${Bm}px)`,fi=e=>((e==null?void 0:e.image)??[]).slice(0,Om),Vs=e=>e.reduce((t,n)=>t+fi(n).length,0),Dm=(e,t)=>{const n=e.slice(0,t).reduce((o,l)=>o+fi(l).length,1),i=fi(e[t]).length;return{start:n,end:n+i-1}},jm=(e,t)=>{const n=Vs(e),{start:i,end:o}=Dm(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},fo=(e,t)=>t==="B"?e.flatMap((n,i)=>fi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:fi(n)})),zm=(e,t,n,i)=>{var l;if(n==="B")return`${t+1} / ${e.length}`;const o=((l=e[t])==null?void 0:l.entryIndex)??0;return jm(i,o)},Gl=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Vm=(e,t,n)=>e==="B"?t.length>1:Vs(n)>1,ni=.004,no=.004,or={title1Width:.13,title2Width:.13,title3Width:.14};function io(e,t,n,i,o){const l=[];return t.title1&&l.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&l.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&l.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),l}function Co(e,t){if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const a=Math.min(l,d);return{overflow:l-a,widths:[d-a,...s]}},{overflow:i-1,widths:[]});return o}function yr(e,t){return Co(e,t)}function Vn(e,t){const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)}function oo(e,t){const n=e.map(i=>t[i.widthKey]??0);return{resolved:Co(e.length,n),effective:yr(e.length,n)}}function Km(e,t,n,i){return e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0)}function Gm(e,t,n,i){return e.slice(0,i+1).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0)}const Um=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,initialSlideIndex:s=0,enableUrlSync:d=!1,journalItemId:a=null,onBeforeClose:p,onClose:u})=>{const{type:S,coverFit:x,backgroundColor:v,imageGap:m,maxWidth:y,maxHeight:$,textTransition:w,title1Width:C,title2Width:T,title3Width:P,title1MarginLeft:M=0,title2MarginLeft:F=0,title3MarginLeft:b=0,titleRowMarginBottom:W=0,titleHeaderLayout:K="single-row",countCloseGap:h=0,closeIcon:L,closeIconMaxWidth:E,closeIconColor:k,closeIconHoverColor:z,contentMarginTop:le=0,iconMarginRight:O=0}=n,_=c.useCallback(I=>R.scalingValue(I,i??!1),[i]),q=_(m??0),G=`${y}%`,H=`${$}%`,X=_(h),ne=_(le),se=_(O),N=lo("title1",ro(n,"title1"),i),de=lo("title2",ro(n,"title2"),i),g=lo("title3",ro(n,"title3"),i),ie=lo("count",ro(n,"count"),i),fe=!!o,oe=K==="mobile",Ce=!i||!!l,me=!o&&(!i||!!l),re=c.useMemo(()=>fo(t,S),[t,S]),[B,Q]=c.useState(s),U=re[B],J=U==null?void 0:U.entry,[Me,Ae]=c.useState(!1),[ke,Fe]=c.useState(null),[xe,j]=c.useState(!1),[ae,A]=c.useState(null),[D,Y]=c.useState(!1),[Z,ge]=c.useState(0),[Te,je]=c.useState(),[_e,Le]=c.useState(),[Ge,pe]=c.useState(null),We=c.useRef(null),ze=c.useRef(0),Ve=c.useRef(0),Ne=c.useRef(0),It=c.useRef(!1),dt=c.useRef(null),bt=c.useRef(null),Ze=c.useRef(null),yt=c.useRef(null),Mt=c.useRef(null),Ht=c.useRef(null),Ee=c.useRef(null),it=c.useCallback(()=>{const I=bt.current;if(!I)return;const ce=I.closest(`.${e}-lightbox-content-area`);if(!ce)return I.getBoundingClientRect().width;const Re=Array.from(ce.children).reduce(($e,Se)=>!(Se instanceof HTMLElement)||Se.contains(I)?$e:$e+Se.getBoundingClientRect().width,0);return ce.getBoundingClientRect().width-Re},[e]),Ue=c.useCallback(()=>{We.current&&(clearTimeout(We.current),We.current=null)},[]),ut=c.useCallback(I=>{I===ze.current&&(A(null),Y(!1))},[]),Bt=c.useCallback(()=>{o||It.current||(It.current=!0,p==null||p(),Ae(!1),dt.current=setTimeout(()=>{u()},nr))},[o,p,u]),rn=c.useCallback(I=>!!(I.closest("[data-controls]")||I.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:jt,backdropStyle:Yt,mediaAreaStyle:ln,overlayContentStyle:He,swipeHandlers:Tt,dismissAreaStyle:pt}=Bs({enabled:me,onClose:Bt,animMs:nr,isBlockedTarget:rn}),et=c.useCallback(I=>{d&&js(I+1,a,!0)},[d,a]),mt=c.useCallback(I=>{var en;if(re.length===0)return;const ce=(I%re.length+re.length)%re.length;if(ce===B)return;const Re=re[B],$e=re[ce];ze.current+=1;const Se=ze.current,lt=w==="fade"&&Gl(Re==null?void 0:Re.entry)!==Gl($e==null?void 0:$e.entry),Ct=(en=bt.current)==null?void 0:en.getBoundingClientRect().height,nt=lt?(()=>{var qr;const Qn=it();Fi.flushSync(()=>{pe($e.entry)}),Ze.current&&Qn&&(Ze.current.style.width=`${Qn}px`);const gn=(qr=Ze.current)==null?void 0:qr.getBoundingClientRect().height;return Ze.current&&(Ze.current.style.width=""),{measuredIncomingTitlesHeight:gn,incomingTitlesMeasureWidth:Qn}})():void 0,Ot=Math.max(Ct??0,(nt==null?void 0:nt.measuredIncomingTitlesHeight)??0)||void 0;ge(Se),A(B),Y(!0),Q(ce),et(ce),Ne.current=ce,lt?(Ue(),Ot&&je(Ot),nt!=null&&nt.incomingTitlesMeasureWidth&&Le(nt.incomingTitlesMeasureWidth),Fe((Re==null?void 0:Re.entryIndex)??null),j(!0),Ve.current=$e.entryIndex,We.current=setTimeout(()=>{Fe(null),j(!1),je(void 0),Le(void 0),pe(null),We.current=null},hr)):(Ue(),Fe(null),j(!1),je(void 0),Le(void 0),pe(null),Ve.current=$e.entryIndex)},[B,Ue,it,re,et,w]),zt=c.useCallback(()=>{Ee.current=null},[]),Vt=c.useCallback(I=>{!Ce||re.length<=1||I.pointerType==="mouse"&&I.button!==0||I.target.closest("[data-controls]")||(Ee.current={startX:I.clientX,startY:I.clientY,pointerId:I.pointerId})},[Ce,re.length]),Jt=c.useCallback(I=>{var en;if(!Ce||re.length<=1||I.pointerType==="mouse"&&I.button!==0)return;if(jt){zt();return}const ce=Ee.current;if(!ce||ce.pointerId!==I.pointerId||(zt(),I.target.closest("[data-controls]")))return;const $e=I.clientX-ce.startX,Se=I.clientY-ce.startY,lt=Math.abs($e),Ct=Math.abs(Se);if(lt>=km&<>Ct){mt($e>0?B-1:B+1);return}if(lt>jl||Ct>jl)return;const nt=(en=yt.current)==null?void 0:en.getBoundingClientRect(),Ot=nt?nt.left+nt.width/2:window.innerWidth/2;mt(I.clientX<Ot?B-1:B+1)},[B,Ce,mt,jt,zt,re.length]),pn=c.useCallback(I=>{const ce=Ee.current;(ce==null?void 0:ce.pointerId)===I.pointerId&&zt()},[zt]);Os(),c.useEffect(()=>{Ht.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const I=requestAnimationFrame(()=>{Ae(!0),requestAnimationFrame(()=>{Mt.current?Mt.current.focus():yt.current&&yt.current.focus()})});return()=>{cancelAnimationFrame(I),dt.current&&clearTimeout(dt.current),We.current&&clearTimeout(We.current);const ce=Ht.current;ce&&document.contains(ce)&&ce.focus()}},[]),c.useEffect(()=>{var I;w!=="fade"&&(Ve.current=((I=re[B])==null?void 0:I.entryIndex)??0,Ue(),Fe(null),j(!1),je(void 0),Le(void 0))},[B,Ue,re,w]),c.useEffect(()=>{const I=ce=>{if(ce.key==="Escape"){Bt();return}if(ce.key==="ArrowLeft"&&re.length>1){mt(B-1);return}if(ce.key==="ArrowRight"&&re.length>1){mt(B+1);return}if(ce.key==="Tab"&&yt.current){const Re=yt.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),$e=Array.from(Re).filter(nt=>!nt.closest('[aria-hidden="true"]'));if($e.length===0)return;const Se=$e[0],lt=$e[$e.length-1],Ct=document.activeElement;ce.shiftKey?(Ct===Se||!yt.current.contains(Ct))&&(ce.preventDefault(),lt.focus()):(Ct===lt||!yt.current.contains(Ct))&&(ce.preventDefault(),Se.focus())}};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[mt,Bt,B,re.length]),c.useLayoutEffect(()=>{Ue(),ze.current=0,ge(0),A(null),Y(!1),Fe(null),j(!1),je(void 0),Le(void 0),pe(null),Q(I=>{const ce=Math.max(0,re.length-1);return Math.min(I,ce)})},[Ue,t.length,S,re.length]),c.useLayoutEffect(()=>{var I;Ne.current=s,Ve.current=((I=re[s])==null?void 0:I.entryIndex)??0,Q(s)},[s,re.length]);const Ke=ke!==null?t[ke]:null,Zt=ae!==null?re[ae]:null,kt=(J==null?void 0:J.title1)||(J==null?void 0:J.title2)||(J==null?void 0:J.title3)||(Ke==null?void 0:Ke.title1)||(Ke==null?void 0:Ke.title2)||(Ke==null?void 0:Ke.title3),Pe=Vm(S,re,t),ft=L!==null,Wt=kt||Pe||ft,te=Pe&&ft?{gap:X}:void 0,ye=`${e}-titles-stack${oe?` ${e}-titles-stack-stacked`:""}`,Ie=`${e}-titles-layer-out${oe?` ${e}-titles-layer-out-stacked`:""}`,De=_(W),qe=c.useMemo(()=>({title1Width:C??or.title1Width,title2Width:T??or.title2Width,title3Width:P??or.title3Width}),[C,T,P]),Qe=c.useMemo(()=>({title2MarginLeft:F,title3MarginLeft:b}),[F,b]),ve=c.useMemo(()=>J?io(e,J,N,de,g):[],[e,J,N,de,g]),$t=c.useMemo(()=>ve.map(I=>qe[I.widthKey]),[ve,qe]),gt=c.useMemo(()=>Co(ve.length,$t),[ve.length,$t]),ht=c.useMemo(()=>yr(ve.length,$t),[ve.length,$t]),ot=c.useMemo(()=>ve.filter(I=>I.prefix==="title1"),[ve]),Be=c.useMemo(()=>ve.filter(I=>I.prefix==="title2"||I.prefix==="title3"),[ve]),vt=c.useMemo(()=>oo(ot,qe),[ot,qe]),rt=c.useMemo(()=>oo(Be,qe),[Be,qe]),wt=c.useCallback((I,ce)=>{const Re=ve.findIndex(Se=>Se.prefix===I.prefix);if(!oe||ce==="single-row")return{effectiveWidth:ht[Re]??0,resolvedWidth:gt[Re]??0,maxWidth:Vn(Re,gt)};if(ce==="two-row-top"){const Se=ot.findIndex(lt=>lt.prefix===I.prefix);return{effectiveWidth:vt.effective[Se]??0,resolvedWidth:vt.resolved[Se]??0,maxWidth:Vn(Se,vt.resolved)}}const $e=Be.findIndex(Se=>Se.prefix===I.prefix);return{effectiveWidth:rt.effective[$e]??0,resolvedWidth:rt.resolved[$e]??0,maxWidth:Vn($e,rt.resolved)}},[ve,Be,rt,ht,gt,ot,vt,oe]),_t=c.useCallback(I=>Gm(ve,gt,Qe,I)+(oe?0:M??0),[ve,gt,Qe,oe,M]),St=c.useCallback(()=>oe?0:M??0,[oe,M]),At=c.useCallback(I=>Be.slice(0,I).reduce((ce,Re,$e)=>ce+(Re.marginLeftKey?Qe[Re.marginLeftKey]??0:0)+(rt.resolved[$e]??0),0),[Be,rt.resolved,Qe]),tt=c.useCallback(I=>{const ce=Be[I];return At(I)+(ce.marginLeftKey?Qe[ce.marginLeftKey]??0:0)+(rt.resolved[I]??0)},[Be,rt.resolved,At,Qe]),Ft=c.useCallback((I,ce,Re)=>{if(!oe||Re==="single-row"){const nt=I.findIndex(gn=>gn.prefix===ce.prefix),Ot=I.map(gn=>qe[gn.widthKey]),en=Co(I.length,Ot);return{effectiveWidth:yr(I.length,Ot)[nt]??0,resolvedWidth:en[nt]??0,maxWidth:Vn(nt,en)}}if(Re==="two-row-top"){const nt=I.filter(gn=>gn.prefix==="title1"),Ot=nt.findIndex(gn=>gn.prefix===ce.prefix),{resolved:en,effective:Qn}=oo(nt,qe);return{effectiveWidth:Qn[Ot]??0,resolvedWidth:en[Ot]??0,maxWidth:Vn(Ot,en)}}const $e=I.filter(nt=>nt.prefix==="title2"||nt.prefix==="title3"),Se=$e.findIndex(nt=>nt.prefix===ce.prefix),{resolved:lt,effective:Ct}=oo($e,qe);return{effectiveWidth:Ct[Se]??0,resolvedWidth:lt[Se]??0,maxWidth:Vn(Se,lt)}},[qe,oe]),Kt=(I,ce,Re)=>{const $e=I.marginLeftKey?Qe[I.marginLeftKey]??0:0,{effectiveWidth:Se,resolvedWidth:lt,maxWidth:Ct}=Re??wt(I,ce),nt=Math.max($e,no),Ot=fe&&ce==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":I.prefix,style:{width:_(Se),...$e>0?{marginLeft:_($e)}:{}},children:[r.jsx("p",{className:I.className,style:I.style,children:I.text}),Ot&&I.marginLeftKey?r.jsx("div",{"data-controls":I.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(lt),style:{position:"absolute",top:0,left:_(-$e),width:_(nt),height:"100%",pointerEvents:"auto"}}):null,Ot?r.jsx("div",{"data-controls":I.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ct),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:_(-ni/2),width:_(ni),height:"100%",pointerEvents:"auto"}}):null]},I.className)},$n=()=>r.jsx("div",{...fe?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:_(M??0),flexShrink:0,alignSelf:"stretch",...fe?{pointerEvents:"auto"}:{}}}),Bn=()=>r.jsxs("div",{className:`${e}-text-bar-cell`,children:[r.jsx("span",{className:`${e}-entry-counter`,style:ie,"aria-live":"polite","aria-atomic":"true",children:zm(re,B,S,t)}),fe&&ft?r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${ir(X)} + ${X}))`,width:ir(X),height:"100%",pointerEvents:"auto",zIndex:3}}):null]}),Ln=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:R.scalingValue(E??0,i),height:R.scalingValue(E??0,i),marginRight:se,"--close-icon-hover-color":z},children:[r.jsx("button",{ref:Mt,type:"button",className:`${e}-close-icon-inner`,onClick:Bt,"aria-label":"Close",children:r.jsx(an,{url:L??"",fill:k,hoverFill:z,className:`${e}-close-icon-img`})}),fe?r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:se,height:"100%",pointerEvents:"auto"}}):null]}),Yn=()=>!Pe&&!ft?null:r.jsxs("div",{className:`${e}-titles-row-top-controls`,style:te,children:[Pe?Bn():null,ft?Ln():null]}),Jn=I=>{if(!I)return null;const ce=io(e,I,N,de,g);return r.jsxs(r.Fragment,{children:[M>0||fe?$n():null,ce.map(Re=>Kt(Re,"single-row",Ft(ce,Re,"single-row")))]})},Qt=I=>{if(!I)return null;const ce=io(e,I,N,de,g),Re=ce.find($e=>$e.prefix==="title1");return!Re&&!(M>0||fe)?null:r.jsxs(r.Fragment,{children:[M>0||fe?$n():null,Re?Kt(Re,"two-row-top",Ft(ce,Re,"two-row-top")):null]})},Si=(I,ce=!1)=>{const Re=I?io(e,I,N,de,g):[],$e=Re.filter(Ct=>Ct.prefix==="title2"||Ct.prefix==="title3"),Se=fe&&ce;return $e.length>0||Se||(W??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[$e.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[$e.map(Ct=>Kt(Ct,"two-row-bottom",Ft(Re,Ct,"two-row-bottom"))),ce&&fe?r.jsxs(r.Fragment,{children:[ee(),he()]}):null]}):null,(W??0)>0||Se?r.jsx("div",{"data-controls":Se?"titleRowMarginBottom":void 0,"data-controls-axis":Se?"y":void 0,"data-controls-reverse":Se?"":void 0,className:Se?`${e}-control`:void 0,style:{height:De,width:"100%",flexShrink:0,pointerEvents:Se?"auto":"none"}}):null]}):null},Zn=(I,ce=!1)=>r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-titles-row-top`,children:[Qt(I),Yn()]}),Si(I,ce)]}),En=I=>oe?r.jsx("div",{className:`${e}-titles-row-two-row`,style:{width:"100%"},children:Zn(I)}):I?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Jn(I)}):null,f=()=>{const I=oe?-1:ve.findIndex($e=>$e.prefix==="title1"),ce=!oe&&(fe||(M??0)>0)?(()=>{const Se=Math.max(M??0,no),lt=I>=0?gt[I]:C;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(lt),style:{position:"absolute",top:0,left:0,width:_(Se),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Re=ve.flatMap(($e,Se)=>{if(!$e.marginLeftKey)return[];const lt=Qe[$e.marginLeftKey]??0,Ct=Km(ve,gt,Qe,Se)+St(),nt=Math.max(lt,no);return r.jsx("div",{"data-controls":$e.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(gt[Se]),style:{position:"absolute",top:0,left:_(Ct),width:_(nt),height:"100%",pointerEvents:"auto"}},$e.marginLeftKey)});return ce?[ce,...Re]:Re},V=()=>ve.map((I,ce)=>{const Re=Vn(ce,gt),Se=_t(ce)-ni/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":I.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Re),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:_(Se),width:_(ni),height:"100%",pointerEvents:"auto"}})},`${I.widthKey}-junction`)}),ee=()=>Be.flatMap((I,ce)=>{if(!I.marginLeftKey)return[];const Re=Qe[I.marginLeftKey]??0,$e=At(ce),Se=Math.max(Re,no),{resolvedWidth:lt}=wt(I,"two-row-bottom");return r.jsx("div",{"data-controls":I.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(lt),style:{position:"absolute",top:0,left:_($e),width:_(Se),height:"100%",pointerEvents:"auto"}},I.marginLeftKey)}),he=()=>Be.map((I,ce)=>{const{maxWidth:Re}=wt(I,"two-row-bottom"),Se=tt(ce)-ni/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":I.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Re),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:_(Se),width:_(ni),height:"100%",pointerEvents:"auto"}})},`${I.widthKey}-junction`)}),we=()=>!fe||oe?null:r.jsxs(r.Fragment,{children:[f(),V()]}),Je=I=>{const ce=!I.objectFit&&wn(x);return{className:`${e}-slide-image-cell${ce?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:G,maxHeight:H,...ce?{"--image-aspect-ratio":No(x)}:{}}}},Lt=I=>I.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":I.objectFit}}:wn(x)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Rt=I=>{if(I.length===0)return null;const ce=I.length>1,Re=ir(q),$e=`calc(-0.5 * (${Re} + ${q}))`;if(I.length===1){const Se=I[0];return r.jsx("div",{...Je(Se),children:r.jsx("img",{...Lt(Se),src:Se.url,alt:Se.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:ce?{gap:q}:void 0,children:I.map((Se,lt)=>r.jsxs("div",{...Je(Se),children:[r.jsx("img",{...Lt(Se),src:Se.url,alt:Se.name??"",draggable:!1}),fe&&ce&<<I.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:$e,width:Re,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Se.url}-${lt}`))})},In=!!(J!=null&&J.title2||J!=null&&J.title3||Ke!=null&&Ke.title2||Ke!=null&&Ke.title3||(W??0)>0||fe),Rn=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:Ze,className:ye,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Zn(Ge||J)}),r.jsxs("div",{ref:bt,className:`${e}-titles-row-two-row`,style:{...xe&&Te?{minHeight:Te}:void 0,...xe&&_e?{width:_e,maxWidth:"100%"}:void 0,...xe?{overflow:"hidden"}:void 0},children:[r.jsxs("div",{className:`${e}-titles-row-top`,children:[r.jsxs("div",{className:ye,style:{position:"relative",flex:1,minWidth:0},children:[Ke&&xe?r.jsx("div",{className:`${Ie} ${e}-titles-fade-out`,children:Qt(Ke)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:Qt(J)})]}),Yn()]}),In?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Ke&&xe?r.jsx("div",{className:`${Ie} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:Si(Ke)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${oe?` ${e}-titles-layer-in-stacked`:""}`,children:Si(J,!0)}),we()]}):null]})]}),mn=()=>{const I=In;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...I?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:I?void 0:{flex:"0 0 auto",height:"auto"},children:Zn(J,!0)}),we()]})};return r.jsxs("div",{ref:yt,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{jt||Bt()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:ft?void 0:-1,style:{opacity:Me?1:0,transition:`opacity ${nr}ms ease`,pointerEvents:Me?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:v,...Yt}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:{position:"relative",width:"100%",height:"100%",...pt},...Tt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:ln,onClick:I=>I.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":Ce&&re.length>1?"true":"false",onPointerDown:Ce?Vt:void 0,onPointerUp:Ce?Jt:void 0,onPointerCancel:Ce?pn:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Zt&&D?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:I=>{I.target===I.currentTarget&&ut(Z)},children:r.jsx("div",{className:`${e}-slide-area`,children:Rt(Zt.images)})},`slide-out-${Z}`):null,r.jsx("div",{className:`${e}-slide-layer-in${D?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:U?Rt(U.images):null})},`slide-in-${Z}-${B}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:{width:"100%",height:"100%",...He},children:[r.jsx("div",{"data-controls":fe?"contentMarginTop":void 0,className:fe?`${e}-control`:void 0,style:{height:ne,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...oe?{flex:1,minHeight:0}:{}},children:r.jsxs("div",{className:`${e}-lightbox-content-area${oe?` ${e}-lightbox-content-area-stacked`:""}`,children:[(oe?Wt:kt)&&r.jsx("div",{className:`${e}-text-bar-cell${oe?` ${e}-text-bar-cell-stacked`:""}`,children:oe?w==="fade"?Rn():mn():w==="fade"?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:Ze,className:ye,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:En(Ge||J)}),r.jsxs("div",{ref:bt,className:ye,style:{width:"100%",...xe&&Te?{minHeight:Te}:void 0,...xe&&_e?{width:_e,maxWidth:"100%"}:void 0,...xe?{overflow:"hidden"}:void 0},children:[Ke&&xe?r.jsx("div",{className:`${Ie} ${e}-titles-fade-out`,children:En(Ke)}):null,r.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:En(J)}),we()]})]}):r.jsxs("div",{style:{position:"relative",width:"100%"},children:[En(J),we()]})}),!oe&&r.jsxs("div",{className:`${e}-lightbox-persistent-controls`,style:te,children:[Pe&&Bn(),ft&&Ln()]})]})})]})]})]})},Gi=["title1","title2","title3","count"];function at(e,t){return`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`}const qm={title1:"1",title2:"2",title3:"3",count:"Count"};function Xm(e){return[at(e,"fontFamily"),at(e,"fontSettings"),{type:"row",items:[at(e,"fontSize"),at(e,"lineHeight"),at(e,"letterSpacing"),at(e,"wordSpacing")]},at(e,"textAlign"),at(e,"textAppearance")]}function Ym(){return{type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Gi.map(e=>[qm[e],Xm(e)]))}}const Jm={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Zm={title1:.02,title2:.02,title3:.02,count:.017};function ro(e,t){const n=i=>{const o=at(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[Jm[t]]}}function lo(e,t,n){var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??Zm[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 Qm=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l,metadata:s})=>{const{prefix:d}=R.useScopedStyles(),a=(s==null?void 0:s.itemId)??null,{cover:p,coverFit:u,type:S}=e,x=c.useRef(null),[v,m]=c.useState(!1),[y,$]=c.useState(0),w=c.useRef(!1),C=c.useRef(!1),T=c.useRef(!1),P=c.useMemo(()=>(t??[]).filter(E=>fi(E).length>0),[t]),M=v&&P.length>0,F=!n,b=c.useCallback(()=>{F&&(T.current=!0,Nm(C.current,a),C.current=!1)},[F,a]),W=(E=0)=>{if(P.length===0||n&&!i&&!o)return;const k=fo(P,S),z=Math.max(0,Math.min(E,k.length-1));if($(z),F){const le=zs();js(z+1,a,le),C.current=!le}m(!0)},K=()=>{n||W()},h=E=>{n&&(E.stopPropagation(),W())},L=c.useCallback(()=>{m(!1),T.current=!1},[]);return c.useEffect(()=>{!n||i||o||m(!1)},[n,i,o]),c.useEffect(()=>{if(!F||w.current)return;w.current=!0;const E=Vl(a);if(!E)return;const k=Kl(E,fo(P,S).length);k<0||($(k),m(!0))},[P,a,F,S]),c.useEffect(()=>{if(!F)return;const E=()=>{if(T.current){T.current=!1,m(!1);return}const k=Vl(a);if(!k){m(!1);return}const z=Kl(k,fo(P,S).length);if(z<0){m(!1);return}C.current=!1,$(z),m(!0)};return window.addEventListener("popstate",E),()=>window.removeEventListener("popstate",E)},[P,a,F,S]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:x,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Hm(d)}}),p?r.jsx("button",{type:"button",className:`${d}-cover ${wn(u)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:K,onDoubleClick:h,style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...wn(u)?{"--image-aspect-ratio":No(u)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${wn(u)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:p,alt:"cover"})}):null]}),M&&typeof document<"u"&&(()=>{const E=(l?document.getElementById(l):null)??document.body;return Fi.createPortal(r.jsx(Um,{prefix:d,entries:P,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:y,enableUrlSync:F,journalItemId:a,onBeforeClose:b,onClose:L}),E)})()]})},eg=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
11447
11607
|
import { createPortal, flushSync } from 'react-dom';
|
|
11448
11608
|
import { CommonComponentProps } from '../props';
|
|
11449
11609
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -13970,4 +14130,4 @@ export type LightboxJournalSettings = {
|
|
|
13970
14130
|
closeIconColor: string;
|
|
13971
14131
|
closeIconHoverColor: string;
|
|
13972
14132
|
};
|
|
13973
|
-
`,
|
|
14133
|
+
`,tg="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>'),Kn={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 ng(e){const t={};return t[at(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSettings")]={...Kn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[at(e,"fontSize")]={...Kn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[at(e,"lineHeight")]={...Kn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[at(e,"letterSpacing")]={...Kn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[at(e,"wordSpacing")]={...Kn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[at(e,"textAlign")]={...Kn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[at(e,"textAppearance")]={...Kn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const ig=Gi.reduce((e,t)=>({...e,...ng(t)}),{}),og=Gi.reduce((e,t)=>({...e,[at(t,"fontFamily")]:"Arial",[at(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[at(t,"letterSpacing")]:0,[at(t,"wordSpacing")]:0,[at(t,"textAlign")]:"left",[at(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ul(e){return Gi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[at(n,"fontSize")]=i),o!==void 0&&(t[at(n,"lineHeight")]=o),t},{})}const rg=Ym(),lg={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["Fit","Cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...ig,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/LightboxJournal_1.jpg",coverFit:{display:"Cover",ratioValue:"16:9",reversed:!1},closeIcon:tg,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#ffffff",...og},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.05,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.005,...Ul({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.015,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.13,title2Width:.13,title3Width:.14,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...Ul({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","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[rg]}],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"}]}]}},sg={element:Qm,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:lg,sourceCode:eg,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:Gi.map(e=>({path:`styles.${at(e,"fontSettings")}`}))}},ag=[ed,sd,Xd,Pm,sg,ou,gu,Lu,Wu,Hu,Yu,Zp];exports.components=ag;exports.isSchemaV1=Ks;
|