@cntrl-site/components 1.0.12-alpha.24 → 1.0.12-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/List/List.d.ts +7 -5
- package/dist/Components/List/ListComponent.d.ts +2 -2
- package/dist/Components/TestimonialGrid/TestimonialGrid.d.ts +0 -1
- package/dist/Components/TestimonialGrid/TestimonialGridComponent.d.ts +0 -1
- package/dist/Components/TestimonialSingle/TestimonialSingle.d.ts +1 -2
- package/dist/Components/TestimonialSingle/TestimonialSingleComponent.d.ts +1 -2
- package/dist/index.js +119 -50
- package/dist/index.mjs +2651 -2548
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),u=require("react"),Le=require("classnames"),w=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),So=require("react-dom");function ya(e){return e.type==="object"&&e.version===1}const va="ControlSlider-module__wrapper___sHEkd",ba="ControlSlider-module__hoverArrow___A-dOH",xa="ControlSlider-module__sliderItem___QQSkR",Ca="ControlSlider-module__sliderImage___9hRl-",Sa="ControlSlider-module__arrow___05ghY",$a="ControlSlider-module__arrowVertical___tBfVN",wa="ControlSlider-module__nextArrow___-30Yc",Ta="ControlSlider-module__arrowInner___aEra3",La="ControlSlider-module__arrowIcon___S4ztF",Ea="ControlSlider-module__arrowImg___2dwJW",Pa="ControlSlider-module__mirror___brd6U",_a="ControlSlider-module__pagination___bicLF",Aa="ControlSlider-module__paginationInner___bT-P-",Ra="ControlSlider-module__paginationVertical___zYqKw",ka="ControlSlider-module__paginationItem___nTRbk",Ia="ControlSlider-module__dot___p1Qun",Wa="ControlSlider-module__activeDot___LHFaj",Ma="ControlSlider-module__paginationInsideBottom___R3FWn",Fa="ControlSlider-module__paginationInsideTop___V-qb-",Na="ControlSlider-module__paginationOutsideBottom___14w8D",Ha="ControlSlider-module__paginationOutsideTop___SCLqB",Ba="ControlSlider-module__paginationInsideLeft___yOBRZ",Oa="ControlSlider-module__paginationInsideRight___Rtt3o",Va="ControlSlider-module__paginationOutsideLeft___lahaw",Da="ControlSlider-module__paginationOutsideRight___EtuQa",ja="ControlSlider-module__imgWrapper___UjEgB",za="ControlSlider-module__captionBlock___dJ6-j",Ka="ControlSlider-module__captionTextWrapper___HFlpf",Ua="ControlSlider-module__captionText___uGBVc",qa="ControlSlider-module__active___WZK4G",Ga="ControlSlider-module__withPointerEvents___t-18M",Ya="ControlSlider-module__topLeftAlignment___zjnGM",Xa="ControlSlider-module__topCenterAlignment___gD1xW",Za="ControlSlider-module__topRightAlignment___NMapS",Ja="ControlSlider-module__middleLeftAlignment___OnUrY",Qa="ControlSlider-module__middleCenterAlignment___Tdkl0",es="ControlSlider-module__middleRightAlignment___wEbfX",ts="ControlSlider-module__bottomLeftAlignment___cTP2-",ns="ControlSlider-module__bottomCenterAlignment___c54fB",rs="ControlSlider-module__bottomRightAlignment___kEwrz",is="ControlSlider-module__clickOverlay___DZA28",os="ControlSlider-module__contain___pLyq7",as="ControlSlider-module__cover___KdDat",se={wrapper:va,hoverArrow:ba,sliderItem:xa,sliderImage:Ca,arrow:Sa,arrowVertical:$a,nextArrow:wa,arrowInner:Ta,arrowIcon:La,arrowImg:Ea,mirror:Pa,pagination:_a,paginationInner:Aa,paginationVertical:Ra,paginationItem:ka,dot:Ia,activeDot:Wa,paginationInsideBottom:Ma,paginationInsideTop:Fa,paginationOutsideBottom:Na,paginationOutsideTop:Ha,paginationInsideLeft:Ba,paginationInsideRight:Oa,paginationOutsideLeft:Va,paginationOutsideRight:Da,imgWrapper:ja,captionBlock:za,captionTextWrapper:Ka,captionText:Ua,active:qa,withPointerEvents:Ga,topLeftAlignment:Ya,topCenterAlignment:Xa,topRightAlignment:Za,middleLeftAlignment:Ja,middleCenterAlignment:Qa,middleRightAlignment:es,bottomLeftAlignment:ts,bottomCenterAlignment:ns,bottomRightAlignment:rs,clickOverlay:is,contain:os,cover:as};function ss(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ls(e,t,n){return t&&ss(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Wi="(prefers-reduced-motion: reduce)",un=1,cs=2,gn=3,xn=4,Vn=5,ar=6,mr=7,ds={CREATED:un,MOUNTED:cs,IDLE:gn,MOVING:xn,SCROLLING:Vn,DRAGGING:ar,DESTROYED:mr};function It(e){e.length=0}function Dt(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ae(e){return e.bind.apply(e,[null].concat(Dt(arguments,1)))}var $o=setTimeout,Gr=function(){};function Mi(e){return requestAnimationFrame(e)}function br(e,t){return typeof t===e}function An(e){return!oi(e)&&br("object",e)}var ii=Array.isArray,wo=Ae(br,"function"),Bt=Ae(br,"string"),Dn=Ae(br,"undefined");function oi(e){return e===null}function To(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function jn(e){return ii(e)?e:[e]}function gt(e,t){jn(e).forEach(t)}function ai(e,t){return e.indexOf(t)>-1}function sr(e,t){return e.push.apply(e,jn(t)),e}function _t(e,t,n){e&>(t,function(r){r&&e.classList[n?"add":"remove"](r)})}function St(e,t){_t(e,Bt(t)?t.split(" "):t,!0)}function zn(e,t){gt(t,e.appendChild.bind(e))}function si(e,t){gt(e,function(n){var r=(t||n).parentNode;r&&r.insertBefore(n,t)})}function Rn(e,t){return To(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Lo(e,t){var n=e?Dt(e.children):[];return t?n.filter(function(r){return Rn(r,t)}):n}function Kn(e,t){return t?Lo(e,t)[0]:e.firstElementChild}var kn=Object.keys;function Zt(e,t,n){return e&&(n?kn(e).reverse():kn(e)).forEach(function(r){r!=="__proto__"&&t(e[r],r)}),e}function In(e){return Dt(arguments,1).forEach(function(t){Zt(t,function(n,r){e[r]=t[r]})}),e}function Nt(e){return Dt(arguments,1).forEach(function(t){Zt(t,function(n,r){ii(n)?e[r]=n.slice():An(n)?e[r]=Nt({},An(e[r])?e[r]:{},n):e[r]=n})}),e}function Fi(e,t){gt(t||kn(e),function(n){delete e[n]})}function $t(e,t){gt(e,function(n){gt(t,function(r){n&&n.removeAttribute(r)})})}function fe(e,t,n){An(t)?Zt(t,function(r,i){fe(e,i,r)}):gt(e,function(r){oi(n)||n===""?$t(r,t):r.setAttribute(t,String(n))})}function pn(e,t,n){var r=document.createElement(e);return t&&(Bt(t)?St(r,t):fe(r,t)),n&&zn(n,r),r}function ht(e,t,n){if(Dn(n))return getComputedStyle(e)[t];oi(n)||(e.style[t]=""+n)}function Wn(e,t){ht(e,"display",t)}function Eo(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function ft(e,t){return e.getAttribute(t)}function Ni(e,t){return e&&e.classList.contains(t)}function ut(e){return e.getBoundingClientRect()}function Jt(e){gt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Po(e){return Kn(new DOMParser().parseFromString(e,"text/html").body)}function Pt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function _o(e,t){return e&&e.querySelector(t)}function li(e,t){return t?Dt(e.querySelectorAll(t)):[]}function At(e,t){_t(e,t,!1)}function Yr(e){return e.timeStamp}function Gt(e){return Bt(e)?e:e?e+"px":""}var Un="splide",ci="data-"+Un;function En(e,t){if(!e)throw new Error("["+Un+"] "+(t||""))}var Ot=Math.min,gr=Math.max,hr=Math.floor,Mn=Math.ceil,tt=Math.abs;function Ao(e,t,n){return tt(e-t)<n}function lr(e,t,n,r){var i=Ot(t,n),a=gr(t,n);return r?i<e&&e<a:i<=e&&e<=a}function ln(e,t,n){var r=Ot(t,n),i=gr(t,n);return Ot(gr(r,e),i)}function Xr(e){return+(e>0)-+(e<0)}function Zr(e,t){return gt(t,function(n){e=e.replace("%s",""+n)}),e}function di(e){return e<10?"0"+e:""+e}var Hi={};function us(e){return""+e+di(Hi[e]=(Hi[e]||0)+1)}function Ro(){var e=[];function t(s,c,o,d){i(s,c,function(p,T,b){var y="addEventListener"in p,g=y?p.removeEventListener.bind(p,T,o,d):p.removeListener.bind(p,o);y?p.addEventListener(T,o,d):p.addListener(o),e.push([p,T,b,o,g])})}function n(s,c,o){i(s,c,function(d,p,T){e=e.filter(function(b){return b[0]===d&&b[1]===p&&b[2]===T&&(!o||b[3]===o)?(b[4](),!1):!0})})}function r(s,c,o){var d,p=!0;return typeof CustomEvent=="function"?d=new CustomEvent(c,{bubbles:p,detail:o}):(d=document.createEvent("CustomEvent"),d.initCustomEvent(c,p,!1,o)),s.dispatchEvent(d),d}function i(s,c,o){gt(s,function(d){d&>(c,function(p){p.split(" ").forEach(function(T){var b=T.split(".");o(d,b[0],b[1])})})})}function a(){e.forEach(function(s){s[4]()}),It(e)}return{bind:t,unbind:n,dispatch:r,destroy:a}}var jt="mounted",Jr="ready",Wt="move",Cn="moved",ui="click",ko="active",Io="inactive",Wo="visible",Mo="hidden",Oe="refresh",Ze="updated",hn="resize",xr="resized",Fo="drag",No="dragging",Ho="dragged",Cr="scroll",en="scrolled",ps="overflow",pi="destroy",Bo="arrows:mounted",Oo="arrows:updated",Vo="pagination:mounted",Do="pagination:updated",mi="navigation:mounted",gi="autoplay:play",jo="autoplay:playing",hi="autoplay:pause",fi="lazyload:loaded",zo="sk",Ko="sh",fr="ei";function We(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Ro();function r(a,s){n.bind(t,jn(a).join(" "),function(c){s.apply(s,ii(c.detail)?c.detail:[])})}function i(a){n.dispatch(t,a,Dt(arguments,1))}return e&&e.event.on(pi,n.destroy),In(n,{bus:t,on:r,off:Ae(n.unbind,t),emit:i})}function Sr(e,t,n,r){var i=Date.now,a,s=0,c,o=!0,d=0;function p(){if(!o){if(s=e?Ot((i()-a)/e,1):1,n&&n(s),s>=1&&(t(),a=i(),r&&++d>=r))return b();c=Mi(p)}}function T(x){x||g(),a=i()-(x?s*e:0),o=!1,c=Mi(p)}function b(){o=!0}function y(){a=i(),s=0,n&&n(s)}function g(){c&&cancelAnimationFrame(c),s=0,c=0,o=!0}function h(x){e=x}function P(){return o}return{start:T,rewind:y,pause:b,cancel:g,set:h,isPaused:P}}function ms(e){var t=e;function n(i){t=i}function r(i){return ai(jn(i),t)}return{set:n,is:r}}function gs(e,t){var n=Sr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function hs(e,t,n){var r=e.state,i=n.breakpoints||{},a=n.reducedMotion||{},s=Ro(),c=[];function o(){var g=n.mediaQuery==="min";kn(i).sort(function(h,P){return g?+h-+P:+P-+h}).forEach(function(h){p(i[h],"("+(g?"min":"max")+"-width:"+h+"px)")}),p(a,Wi),T()}function d(g){g&&s.destroy()}function p(g,h){var P=matchMedia(h);s.bind(P,"change",T),c.push([g,P])}function T(){var g=r.is(mr),h=n.direction,P=c.reduce(function(x,f){return Nt(x,f[1].matches?f[0]:{})},{});Fi(n),y(P),n.destroy?e.destroy(n.destroy==="completely"):g?(d(!0),e.mount()):h!==n.direction&&e.refresh()}function b(g){matchMedia(Wi).matches&&(g?Nt(n,a):Fi(n,kn(a)))}function y(g,h,P){Nt(n,g),h&&Nt(Object.getPrototypeOf(n),g),(P||!r.is(un))&&e.emit(Ze,n)}return{setup:o,destroy:d,reduce:b,set:y}}var $r="Arrow",wr=$r+"Left",Tr=$r+"Right",Uo=$r+"Up",qo=$r+"Down",Bi="rtl",Lr="ttb",Mr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Uo,Tr],ArrowRight:[qo,wr]};function fs(e,t,n){function r(a,s,c){c=c||n.direction;var o=c===Bi&&!s?1:c===Lr?0:-1;return Mr[a]&&Mr[a][o]||a.replace(/width|left|right/i,function(d,p){var T=Mr[d.toLowerCase()][o]||d;return p>0?T.charAt(0).toUpperCase()+T.slice(1):T})}function i(a){return a*(n.direction===Bi?1:-1)}return{resolve:r,orient:i}}var Rt="role",mn="tabindex",ys="disabled",yt="aria-",qn=yt+"controls",Go=yt+"current",Oi=yt+"selected",pt=yt+"label",yi=yt+"labelledby",Yo=yt+"hidden",vi=yt+"orientation",Fn=yt+"roledescription",Vi=yt+"live",Di=yt+"busy",ji=yt+"atomic",bi=[Rt,mn,ys,qn,Go,pt,yi,Yo,vi,Fn],wt=Un+"__",zt="is-",Fr=Un,zi=wt+"track",vs=wt+"list",Er=wt+"slide",Xo=Er+"--clone",bs=Er+"__container",xi=wt+"arrows",Pr=wt+"arrow",Zo=Pr+"--prev",Jo=Pr+"--next",_r=wt+"pagination",Qo=_r+"__page",xs=wt+"progress",Cs=xs+"__bar",Ss=wt+"toggle",$s=wt+"spinner",ws=wt+"sr",Ts=zt+"initialized",Qt=zt+"active",ea=zt+"prev",ta=zt+"next",Qr=zt+"visible",ei=zt+"loading",na=zt+"focus-in",ra=zt+"overflow",Ls=[Qt,Qr,ea,ta,ei,na,ra],Es={slide:Er,clone:Xo,arrows:xi,arrow:Pr,prev:Zo,next:Jo,pagination:_r,page:Qo,spinner:$s};function Ps(e,t){if(wo(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Rn(n,t);)n=n.parentElement;return n}var _s=5,Ki=200,ia="touchstart mousedown",Nr="touchmove mousemove",Hr="touchend touchcancel mouseup click";function As(e,t,n){var r=We(e),i=r.on,a=r.bind,s=e.root,c=n.i18n,o={},d=[],p=[],T=[],b,y,g;function h(){C(),B(),f()}function P(){i(Oe,x),i(Oe,h),i(Ze,f),a(document,ia+" keydown",function(S){g=S.type==="keydown"},{capture:!0}),a(s,"focusin",function(){_t(s,na,!!g)})}function x(S){var A=bi.concat("style");It(d),At(s,p),At(b,T),$t([b,y],A),$t(s,S?A:["style",Fn])}function f(){At(s,p),At(b,T),p=E(Fr),T=E(zi),St(s,p),St(b,T),fe(s,pt,n.label),fe(s,yi,n.labelledby)}function C(){b=_("."+zi),y=Kn(b,"."+vs),En(b&&y,"A track/list element is missing."),sr(d,Lo(y,"."+Er+":not(."+Xo+")")),Zt({arrows:xi,pagination:_r,prev:Zo,next:Jo,bar:Cs,toggle:Ss},function(S,A){o[A]=_("."+S)}),In(o,{root:s,track:b,list:y,slides:d})}function B(){var S=s.id||us(Un),A=n.role;s.id=S,b.id=b.id||S+"-track",y.id=y.id||S+"-list",!ft(s,Rt)&&s.tagName!=="SECTION"&&A&&fe(s,Rt,A),fe(s,Fn,c.carousel),fe(y,Rt,"presentation")}function _(S){var A=_o(s,S);return A&&Ps(A,"."+Fr)===s?A:void 0}function E(S){return[S+"--"+n.type,S+"--"+n.direction,n.drag&&S+"--draggable",n.isNavigation&&S+"--nav",S===Fr&&Qt]}return In(o,{setup:h,mount:P,destroy:x})}var fn="slide",Sn="loop",Gn="fade";function Rs(e,t,n,r){var i=We(e),a=i.on,s=i.emit,c=i.bind,o=e.Components,d=e.root,p=e.options,T=p.isNavigation,b=p.updateOnMove,y=p.i18n,g=p.pagination,h=p.slideFocus,P=o.Direction.resolve,x=ft(r,"style"),f=ft(r,pt),C=n>-1,B=Kn(r,"."+bs),_;function E(){C||(r.id=d.id+"-slide"+di(t+1),fe(r,Rt,g?"tabpanel":"group"),fe(r,Fn,y.slide),fe(r,pt,f||Zr(y.slideLabel,[t+1,e.length]))),S()}function S(){c(r,"click",Ae(s,ui,H)),c(r,"keydown",Ae(s,zo,H)),a([Cn,Ko,en],$),a(mi,k),b&&a(Wt,I)}function A(){_=!0,i.destroy(),At(r,Ls),$t(r,bi),fe(r,"style",x),fe(r,pt,f||"")}function k(){var M=e.splides.map(function(W){var j=W.splide.Components.Slides.getAt(t);return j?j.slide.id:""}).join(" ");fe(r,pt,Zr(y.slideX,(C?n:t)+1)),fe(r,qn,M),fe(r,Rt,h?"button":""),h&&$t(r,Fn)}function I(){_||$()}function $(){if(!_){var M=e.index;O(),V(),_t(r,ea,t===M-1),_t(r,ta,t===M+1)}}function O(){var M=X();M!==Ni(r,Qt)&&(_t(r,Qt,M),fe(r,Go,T&&M||""),s(M?ko:Io,H))}function V(){var M=L(),W=!M&&(!X()||C);if(e.state.is([xn,Vn])||fe(r,Yo,W||""),fe(li(r,p.focusableNodes||""),mn,W?-1:""),h&&fe(r,mn,W?-1:0),M!==Ni(r,Qr)&&(_t(r,Qr,M),s(M?Wo:Mo,H)),!M&&document.activeElement===r){var j=o.Slides.getAt(e.index);j&&Eo(j.slide)}}function q(M,W,j){ht(j&&B||r,M,W)}function X(){var M=e.index;return M===t||p.cloneStatus&&M===n}function L(){if(e.is(Gn))return X();var M=ut(o.Elements.track),W=ut(r),j=P("left",!0),Q=P("right",!0);return hr(M[j])<=Mn(W[j])&&hr(W[Q])<=Mn(M[Q])}function R(M,W){var j=tt(M-t);return!C&&(p.rewind||e.is(Sn))&&(j=Ot(j,e.length-j)),j<=W}var H={index:t,slideIndex:n,slide:r,container:B,isClone:C,mount:E,destroy:A,update:$,style:q,isWithin:R};return H}function ks(e,t,n){var r=We(e),i=r.on,a=r.emit,s=r.bind,c=t.Elements,o=c.slides,d=c.list,p=[];function T(){b(),i(Oe,y),i(Oe,b)}function b(){o.forEach(function($,O){h($,O,-1)})}function y(){_(function($){$.destroy()}),It(p)}function g(){_(function($){$.update()})}function h($,O,V){var q=Rs(e,O,V,$);q.mount(),p.push(q),p.sort(function(X,L){return X.index-L.index})}function P($){return $?E(function(O){return!O.isClone}):p}function x($){var O=t.Controller,V=O.toIndex($),q=O.hasFocus()?1:n.perPage;return E(function(X){return lr(X.index,V,V+q-1)})}function f($){return E($)[0]}function C($,O){gt($,function(V){if(Bt(V)&&(V=Po(V)),To(V)){var q=o[O];q?si(V,q):zn(d,V),St(V,n.classes.slide),A(V,Ae(a,hn))}}),a(Oe)}function B($){Jt(E($).map(function(O){return O.slide})),a(Oe)}function _($,O){P(O).forEach($)}function E($){return p.filter(wo($)?$:function(O){return Bt($)?Rn(O.slide,$):ai(jn($),O.index)})}function S($,O,V){_(function(q){q.style($,O,V)})}function A($,O){var V=li($,"img"),q=V.length;q?V.forEach(function(X){s(X,"load error",function(){--q||O()})}):O()}function k($){return $?o.length:p.length}function I(){return p.length>n.perPage}return{mount:T,destroy:y,update:g,register:h,get:P,getIn:x,getAt:f,add:C,remove:B,forEach:_,filter:E,style:S,getLength:k,isEnough:I}}function Is(e,t,n){var r=We(e),i=r.on,a=r.bind,s=r.emit,c=t.Slides,o=t.Direction.resolve,d=t.Elements,p=d.root,T=d.track,b=d.list,y=c.getAt,g=c.style,h,P,x;function f(){C(),a(window,"resize load",gs(Ae(s,hn))),i([Ze,Oe],C),i(hn,B)}function C(){h=n.direction===Lr,ht(p,"maxWidth",Gt(n.width)),ht(T,o("paddingLeft"),_(!1)),ht(T,o("paddingRight"),_(!0)),B(!0)}function B(H){var M=ut(p);(H||P.width!==M.width||P.height!==M.height)&&(ht(T,"height",E()),g(o("marginRight"),Gt(n.gap)),g("width",A()),g("height",k(),!0),P=M,s(xr),x!==(x=R())&&(_t(p,ra,x),s(ps,x)))}function _(H){var M=n.padding,W=o(H?"right":"left");return M&&Gt(M[W]||(An(M)?0:M))||"0px"}function E(){var H="";return h&&(H=S(),En(H,"height or heightRatio is missing."),H="calc("+H+" - "+_(!1)+" - "+_(!0)+")"),H}function S(){return Gt(n.height||ut(b).width*n.heightRatio)}function A(){return n.autoWidth?null:Gt(n.fixedWidth)||(h?"":I())}function k(){return Gt(n.fixedHeight)||(h?n.autoHeight?null:I():S())}function I(){var H=Gt(n.gap);return"calc((100%"+(H&&" + "+H)+")/"+(n.perPage||1)+(H&&" - "+H)+")"}function $(){return ut(b)[o("width")]}function O(H,M){var W=y(H||0);return W?ut(W.slide)[o("width")]+(M?0:X()):0}function V(H,M){var W=y(H);if(W){var j=ut(W.slide)[o("right")],Q=ut(b)[o("left")];return tt(j-Q)+(M?0:X())}return 0}function q(H){return V(e.length-1)-V(0)+O(0,H)}function X(){var H=y(0);return H&&parseFloat(ht(H.slide,o("marginRight")))||0}function L(H){return parseFloat(ht(T,o("padding"+(H?"Right":"Left"))))||0}function R(){return e.is(Gn)||q(!0)>$()}return{mount:f,resize:B,listSize:$,slideSize:O,sliderSize:q,totalSize:V,getPadding:L,isOverflow:R}}var Ws=2;function Ms(e,t,n){var r=We(e),i=r.on,a=t.Elements,s=t.Slides,c=t.Direction.resolve,o=[],d;function p(){i(Oe,T),i([Ze,hn],y),(d=P())&&(g(d),t.Layout.resize(!0))}function T(){b(),p()}function b(){Jt(o),It(o),r.destroy()}function y(){var x=P();d!==x&&(d<x||!x)&&r.emit(Oe)}function g(x){var f=s.get().slice(),C=f.length;if(C){for(;f.length<x;)sr(f,f);sr(f.slice(-x),f.slice(0,x)).forEach(function(B,_){var E=_<x,S=h(B.slide,_);E?si(S,f[0].slide):zn(a.list,S),sr(o,S),s.register(S,_-x+(E?0:C),B.index)})}}function h(x,f){var C=x.cloneNode(!0);return St(C,n.classes.clone),C.id=e.root.id+"-clone"+di(f+1),C}function P(){var x=n.clones;if(!e.is(Sn))x=0;else if(Dn(x)){var f=n[c("fixedWidth")]&&t.Layout.slideSize(0),C=f&&Mn(ut(a.track)[c("width")]/f);x=C||n[c("autoWidth")]&&e.length||n.perPage*Ws}return x}return{mount:p,destroy:b}}function Fs(e,t,n){var r=We(e),i=r.on,a=r.emit,s=e.state.set,c=t.Layout,o=c.slideSize,d=c.getPadding,p=c.totalSize,T=c.listSize,b=c.sliderSize,y=t.Direction,g=y.resolve,h=y.orient,P=t.Elements,x=P.list,f=P.track,C;function B(){C=t.Transition,i([jt,xr,Ze,Oe],_)}function _(){t.Controller.isBusy()||(t.Scroll.cancel(),S(e.index),t.Slides.update())}function E(W,j,Q,oe){W!==j&&H(W>Q)&&($(),A(I(q(),W>Q),!0)),s(xn),a(Wt,j,Q,W),C.start(j,function(){s(gn),a(Cn,j,Q,W),oe&&oe()})}function S(W){A(V(W,!0))}function A(W,j){if(!e.is(Gn)){var Q=j?W:k(W);ht(x,"transform","translate"+g("X")+"("+Q+"px)"),W!==Q&&a(Ko)}}function k(W){if(e.is(Sn)){var j=O(W),Q=j>t.Controller.getEnd(),oe=j<0;(oe||Q)&&(W=I(W,Q))}return W}function I(W,j){var Q=W-R(j),oe=b();return W-=h(oe*(Mn(tt(Q)/oe)||1))*(j?1:-1),W}function $(){A(q(),!0),C.cancel()}function O(W){for(var j=t.Slides.get(),Q=0,oe=1/0,te=0;te<j.length;te++){var ce=j[te].index,v=tt(V(ce,!0)-W);if(v<=oe)oe=v,Q=ce;else break}return Q}function V(W,j){var Q=h(p(W-1)-L(W));return j?X(Q):Q}function q(){var W=g("left");return ut(x)[W]-ut(f)[W]+h(d(!1))}function X(W){return n.trimSpace&&e.is(fn)&&(W=ln(W,0,h(b(!0)-T()))),W}function L(W){var j=n.focus;return j==="center"?(T()-o(W,!0))/2:+j*o(W)||0}function R(W){return V(W?t.Controller.getEnd():0,!!n.trimSpace)}function H(W){var j=h(I(q(),W));return W?j>=0:j<=x[g("scrollWidth")]-ut(f)[g("width")]}function M(W,j){j=Dn(j)?q():j;var Q=W!==!0&&h(j)<h(R(!1)),oe=W!==!1&&h(j)>h(R(!0));return Q||oe}return{mount:B,move:E,jump:S,translate:A,shift:I,cancel:$,toIndex:O,toPosition:V,getPosition:q,getLimit:R,exceededLimit:M,reposition:_}}function Ns(e,t,n){var r=We(e),i=r.on,a=r.emit,s=t.Move,c=s.getPosition,o=s.getLimit,d=s.toPosition,p=t.Slides,T=p.isEnough,b=p.getLength,y=n.omitEnd,g=e.is(Sn),h=e.is(fn),P=Ae(q,!1),x=Ae(q,!0),f=n.start||0,C,B=f,_,E,S;function A(){k(),i([Ze,Oe,fr],k),i(xr,I)}function k(){_=b(!0),E=n.perMove,S=n.perPage,C=H();var v=ln(f,0,y?C:_-1);v!==f&&(f=v,s.reposition())}function I(){C!==H()&&a(fr)}function $(v,ie,$e){if(!ce()){var de=V(v),ye=R(de);ye>-1&&(ie||ye!==f)&&(Q(ye),s.move(de,ye,B,$e))}}function O(v,ie,$e,de){t.Scroll.scroll(v,ie,$e,function(){var ye=R(s.toIndex(c()));Q(y?Ot(ye,C):ye),de&&de()})}function V(v){var ie=f;if(Bt(v)){var $e=v.match(/([+\-<>])(\d+)?/)||[],de=$e[1],ye=$e[2];de==="+"||de==="-"?ie=X(f+ +(""+de+(+ye||1)),f):de===">"?ie=ye?M(+ye):P(!0):de==="<"&&(ie=x(!0))}else ie=g?v:ln(v,0,C);return ie}function q(v,ie){var $e=E||(te()?1:S),de=X(f+$e*(v?-1:1),f,!(E||te()));return de===-1&&h&&!Ao(c(),o(!v),1)?v?0:C:ie?de:R(de)}function X(v,ie,$e){if(T()||te()){var de=L(v);de!==v&&(ie=v,v=de,$e=!1),v<0||v>C?!E&&(lr(0,v,ie,!0)||lr(C,ie,v,!0))?v=M(W(v)):g?v=$e?v<0?-(_%S||S):_:v:n.rewind?v=v<0?C:0:v=-1:$e&&v!==ie&&(v=M(W(ie)+(v<ie?-1:1)))}else v=-1;return v}function L(v){if(h&&n.trimSpace==="move"&&v!==f)for(var ie=c();ie===d(v,!0)&&lr(v,0,e.length-1,!n.rewind);)v<f?--v:++v;return v}function R(v){return g?(v+_)%_||0:v}function H(){for(var v=_-(te()||g&&E?1:S);y&&v-- >0;)if(d(_-1,!0)!==d(v,!0)){v++;break}return ln(v,0,_-1)}function M(v){return ln(te()?v:S*v,0,C)}function W(v){return te()?Ot(v,C):hr((v>=C?_-1:v)/S)}function j(v){var ie=s.toIndex(v);return h?ln(ie,0,C):ie}function Q(v){v!==f&&(B=f,f=v)}function oe(v){return v?B:f}function te(){return!Dn(n.focus)||n.isNavigation}function ce(){return e.state.is([xn,Vn])&&!!n.waitForTransition}return{mount:A,go:$,scroll:O,getNext:P,getPrev:x,getAdjacent:q,getEnd:H,setIndex:Q,getIndex:oe,toIndex:M,toPage:W,toDest:j,hasFocus:te,isBusy:ce}}var Hs="http://www.w3.org/2000/svg",Bs="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",Qn=40;function Os(e,t,n){var r=We(e),i=r.on,a=r.bind,s=r.emit,c=n.classes,o=n.i18n,d=t.Elements,p=t.Controller,T=d.arrows,b=d.track,y=T,g=d.prev,h=d.next,P,x,f={};function C(){_(),i(Ze,B)}function B(){E(),C()}function _(){var O=n.arrows;O&&!(g&&h)&&k(),g&&h&&(In(f,{prev:g,next:h}),Wn(y,O?"":"none"),St(y,x=xi+"--"+n.direction),O&&(S(),$(),fe([g,h],qn,b.id),s(Bo,g,h)))}function E(){r.destroy(),At(y,x),P?(Jt(T?[g,h]:y),g=h=null):$t([g,h],bi)}function S(){i([jt,Cn,Oe,en,fr],$),a(h,"click",Ae(A,">")),a(g,"click",Ae(A,"<"))}function A(O){p.go(O,!0)}function k(){y=T||pn("div",c.arrows),g=I(!0),h=I(!1),P=!0,zn(y,[g,h]),!T&&si(y,b)}function I(O){var V='<button class="'+c.arrow+" "+(O?c.prev:c.next)+'" type="button"><svg xmlns="'+Hs+'" viewBox="0 0 '+Qn+" "+Qn+'" width="'+Qn+'" height="'+Qn+'" focusable="false"><path d="'+(n.arrowPath||Bs)+'" />';return Po(V)}function $(){if(g&&h){var O=e.index,V=p.getPrev(),q=p.getNext(),X=V>-1&&O<V?o.last:o.prev,L=q>-1&&O>q?o.first:o.next;g.disabled=V<0,h.disabled=q<0,fe(g,pt,X),fe(h,pt,L),s(Oo,g,h,V,q)}}return{arrows:f,mount:C,destroy:E,update:$}}var Vs=ci+"-interval";function Ds(e,t,n){var r=We(e),i=r.on,a=r.bind,s=r.emit,c=Sr(n.interval,e.go.bind(e,">"),S),o=c.isPaused,d=t.Elements,p=t.Elements,T=p.root,b=p.toggle,y=n.autoplay,g,h,P=y==="pause";function x(){y&&(f(),b&&fe(b,qn,d.track.id),P||C(),E())}function f(){n.pauseOnHover&&a(T,"mouseenter mouseleave",function(k){g=k.type==="mouseenter",_()}),n.pauseOnFocus&&a(T,"focusin focusout",function(k){h=k.type==="focusin",_()}),b&&a(b,"click",function(){P?C():B(!0)}),i([Wt,Cr,Oe],c.rewind),i(Wt,A)}function C(){o()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),h=g=P=!1,E(),s(gi))}function B(k){k===void 0&&(k=!0),P=!!k,E(),o()||(c.pause(),s(hi))}function _(){P||(g||h?B(!1):C())}function E(){b&&(_t(b,Qt,!P),fe(b,pt,n.i18n[P?"play":"pause"]))}function S(k){var I=d.bar;I&&ht(I,"width",k*100+"%"),s(jo,k)}function A(k){var I=t.Slides.getAt(k);c.set(I&&+ft(I.slide,Vs)||n.interval)}return{mount:x,destroy:c.cancel,play:C,pause:B,isPaused:o}}function js(e,t,n){var r=We(e),i=r.on;function a(){n.cover&&(i(fi,Ae(c,!0)),i([jt,Ze,Oe],Ae(s,!0)))}function s(o){t.Slides.forEach(function(d){var p=Kn(d.container||d.slide,"img");p&&p.src&&c(o,p,d)})}function c(o,d,p){p.style("background",o?'center/cover no-repeat url("'+d.src+'")':"",!0),Wn(d,o?"none":"")}return{mount:a,destroy:Ae(s,!1)}}var zs=10,Ks=600,Us=.6,qs=1.5,Gs=800;function Ys(e,t,n){var r=We(e),i=r.on,a=r.emit,s=e.state.set,c=t.Move,o=c.getPosition,d=c.getLimit,p=c.exceededLimit,T=c.translate,b=e.is(fn),y,g,h=1;function P(){i(Wt,B),i([Ze,Oe],_)}function x(S,A,k,I,$){var O=o();if(B(),k&&(!b||!p())){var V=t.Layout.sliderSize(),q=Xr(S)*V*hr(tt(S)/V)||0;S=c.toPosition(t.Controller.toDest(S%V))+q}var X=Ao(O,S,1);h=1,A=X?0:A||gr(tt(S-O)/qs,Gs),g=I,y=Sr(A,f,Ae(C,O,S,$),1),s(Vn),a(Cr),y.start()}function f(){s(gn),g&&g(),a(en)}function C(S,A,k,I){var $=o(),O=S+(A-S)*E(I),V=(O-$)*h;T($+V),b&&!k&&p()&&(h*=Us,tt(V)<zs&&x(d(p(!0)),Ks,!1,g,!0))}function B(){y&&y.cancel()}function _(){y&&!y.isPaused()&&(B(),f())}function E(S){var A=n.easingFunc;return A?A(S):1-Math.pow(1-S,4)}return{mount:P,destroy:B,scroll:x,cancel:_}}var cn={passive:!1,capture:!0};function Xs(e,t,n){var r=We(e),i=r.on,a=r.emit,s=r.bind,c=r.unbind,o=e.state,d=t.Move,p=t.Scroll,T=t.Controller,b=t.Elements.track,y=t.Media.reduce,g=t.Direction,h=g.resolve,P=g.orient,x=d.getPosition,f=d.exceededLimit,C,B,_,E,S,A=!1,k,I,$;function O(){s(b,Nr,Gr,cn),s(b,Hr,Gr,cn),s(b,ia,q,cn),s(b,"click",R,{capture:!0}),s(b,"dragstart",Pt),i([jt,Ze],V)}function V(){var F=n.drag;re(!F),E=F==="free"}function q(F){if(k=!1,!I){var m=ye(F);de(F.target)&&(m||!F.button)&&(T.isBusy()?Pt(F,!0):($=m?b:window,S=o.is([xn,Vn]),_=null,s($,Nr,X,cn),s($,Hr,L,cn),d.cancel(),p.cancel(),H(F)))}}function X(F){if(o.is(ar)||(o.set(ar),a(Fo)),F.cancelable)if(S){d.translate(C+$e(te(F)));var m=ce(F)>Ki,N=A!==(A=f());(m||N)&&H(F),k=!0,a(No),Pt(F)}else j(F)&&(S=W(F),Pt(F))}function L(F){o.is(ar)&&(o.set(gn),a(Ho)),S&&(M(F),Pt(F)),c($,Nr,X),c($,Hr,L),S=!1}function R(F){!I&&k&&Pt(F,!0)}function H(F){_=B,B=F,C=x()}function M(F){var m=Q(F),N=oe(m),D=n.rewind&&n.rewindByDrag;y(!1),E?T.scroll(N,0,n.snap):e.is(Gn)?T.go(P(Xr(m))<0?D?"<":"-":D?">":"+"):e.is(fn)&&A&&D?T.go(f(!0)?">":"<"):T.go(T.toDest(N),!0),y(!0)}function W(F){var m=n.dragMinThreshold,N=An(m),D=N&&m.mouse||0,U=(N?m.touch:+m)||10;return tt(te(F))>(ye(F)?U:D)}function j(F){return tt(te(F))>tt(te(F,!0))}function Q(F){if(e.is(Sn)||!A){var m=ce(F);if(m&&m<Ki)return te(F)/m}return 0}function oe(F){return x()+Xr(F)*Ot(tt(F)*(n.flickPower||600),E?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function te(F,m){return ie(F,m)-ie(v(F),m)}function ce(F){return Yr(F)-Yr(v(F))}function v(F){return B===F&&_||B}function ie(F,m){return(ye(F)?F.changedTouches[0]:F)["page"+h(m?"Y":"X")]}function $e(F){return F/(A&&e.is(fn)?_s:1)}function de(F){var m=n.noDrag;return!Rn(F,"."+Qo+", ."+Pr)&&(!m||!Rn(F,m))}function ye(F){return typeof TouchEvent<"u"&&F instanceof TouchEvent}function Re(){return S}function re(F){I=F}return{mount:O,disable:re,isDragging:Re}}var Zs={Spacebar:" ",Right:Tr,Left:wr,Up:Uo,Down:qo};function Ci(e){return e=Bt(e)?e:e.key,Zs[e]||e}var Ui="keydown";function Js(e,t,n){var r=We(e),i=r.on,a=r.bind,s=r.unbind,c=e.root,o=t.Direction.resolve,d,p;function T(){b(),i(Ze,y),i(Ze,b),i(Wt,h)}function b(){var x=n.keyboard;x&&(d=x==="global"?window:c,a(d,Ui,P))}function y(){s(d,Ui)}function g(x){p=x}function h(){var x=p;p=!0,$o(function(){p=x})}function P(x){if(!p){var f=Ci(x);f===o(wr)?e.go("<"):f===o(Tr)&&e.go(">")}}return{mount:T,destroy:y,disable:g}}var Pn=ci+"-lazy",cr=Pn+"-srcset",Qs="["+Pn+"], ["+cr+"]";function el(e,t,n){var r=We(e),i=r.on,a=r.off,s=r.bind,c=r.emit,o=n.lazyLoad==="sequential",d=[Cn,en],p=[];function T(){n.lazyLoad&&(b(),i(Oe,b))}function b(){It(p),y(),o?x():(a(d),i(d,g),g())}function y(){t.Slides.forEach(function(f){li(f.slide,Qs).forEach(function(C){var B=ft(C,Pn),_=ft(C,cr);if(B!==C.src||_!==C.srcset){var E=n.classes.spinner,S=C.parentElement,A=Kn(S,"."+E)||pn("span",E,S);p.push([C,f,A]),C.src||Wn(C,"none")}})})}function g(){p=p.filter(function(f){var C=n.perPage*((n.preloadPages||1)+1)-1;return f[1].isWithin(e.index,C)?h(f):!0}),p.length||a(d)}function h(f){var C=f[0];St(f[1].slide,ei),s(C,"load error",Ae(P,f)),fe(C,"src",ft(C,Pn)),fe(C,"srcset",ft(C,cr)),$t(C,Pn),$t(C,cr)}function P(f,C){var B=f[0],_=f[1];At(_.slide,ei),C.type!=="error"&&(Jt(f[2]),Wn(B,""),c(fi,B,_),c(hn)),o&&x()}function x(){p.length&&h(p.shift())}return{mount:T,destroy:Ae(It,p),check:g}}function tl(e,t,n){var r=We(e),i=r.on,a=r.emit,s=r.bind,c=t.Slides,o=t.Elements,d=t.Controller,p=d.hasFocus,T=d.getIndex,b=d.go,y=t.Direction.resolve,g=o.pagination,h=[],P,x;function f(){C(),i([Ze,Oe,fr],f);var I=n.pagination;g&&Wn(g,I?"":"none"),I&&(i([Wt,Cr,en],k),B(),k(),a(Vo,{list:P,items:h},A(e.index)))}function C(){P&&(Jt(g?Dt(P.children):P),At(P,x),It(h),P=null),r.destroy()}function B(){var I=e.length,$=n.classes,O=n.i18n,V=n.perPage,q=p()?d.getEnd()+1:Mn(I/V);P=g||pn("ul",$.pagination,o.track.parentElement),St(P,x=_r+"--"+S()),fe(P,Rt,"tablist"),fe(P,pt,O.select),fe(P,vi,S()===Lr?"vertical":"");for(var X=0;X<q;X++){var L=pn("li",null,P),R=pn("button",{class:$.page,type:"button"},L),H=c.getIn(X).map(function(W){return W.slide.id}),M=!p()&&V>1?O.pageX:O.slideX;s(R,"click",Ae(_,X)),n.paginationKeyboard&&s(R,"keydown",Ae(E,X)),fe(L,Rt,"presentation"),fe(R,Rt,"tab"),fe(R,qn,H.join(" ")),fe(R,pt,Zr(M,X+1)),fe(R,mn,-1),h.push({li:L,button:R,page:X})}}function _(I){b(">"+I,!0)}function E(I,$){var O=h.length,V=Ci($),q=S(),X=-1;V===y(Tr,!1,q)?X=++I%O:V===y(wr,!1,q)?X=(--I+O)%O:V==="Home"?X=0:V==="End"&&(X=O-1);var L=h[X];L&&(Eo(L.button),b(">"+X),Pt($,!0))}function S(){return n.paginationDirection||n.direction}function A(I){return h[d.toPage(I)]}function k(){var I=A(T(!0)),$=A(T());if(I){var O=I.button;At(O,Qt),$t(O,Oi),fe(O,mn,-1)}if($){var V=$.button;St(V,Qt),fe(V,Oi,!0),fe(V,mn,"")}a(Do,{list:P,items:h},I,$)}return{items:h,mount:f,destroy:C,getAt:A,update:k}}var nl=[" ","Enter"];function rl(e,t,n){var r=n.isNavigation,i=n.slideFocus,a=[];function s(){e.splides.forEach(function(g){g.isParent||(d(e,g.splide),d(g.splide,e))}),r&&p()}function c(){a.forEach(function(g){g.destroy()}),It(a)}function o(){c(),s()}function d(g,h){var P=We(g);P.on(Wt,function(x,f,C){h.go(h.is(Sn)?C:x)}),a.push(P)}function p(){var g=We(e),h=g.on;h(ui,b),h(zo,y),h([jt,Ze],T),a.push(g),g.emit(mi,e.splides)}function T(){fe(t.Elements.list,vi,n.direction===Lr?"vertical":"")}function b(g){e.go(g.index)}function y(g,h){ai(nl,Ci(h))&&(b(g),Pt(h))}return{setup:Ae(t.Media.set,{slideFocus:Dn(i)?r:i},!0),mount:s,destroy:c,remount:o}}function il(e,t,n){var r=We(e),i=r.bind,a=0;function s(){n.wheel&&i(t.Elements.track,"wheel",c,cn)}function c(d){if(d.cancelable){var p=d.deltaY,T=p<0,b=Yr(d),y=n.wheelMinThreshold||0,g=n.wheelSleep||0;tt(p)>y&&b-a>g&&(e.go(T?"<":">"),a=b),o(T)&&Pt(d)}}function o(d){return!n.releaseWheel||e.state.is(xn)||t.Controller.getAdjacent(d)!==-1}return{mount:s}}var ol=90;function al(e,t,n){var r=We(e),i=r.on,a=t.Elements.track,s=n.live&&!n.isNavigation,c=pn("span",ws),o=Sr(ol,Ae(p,!1));function d(){s&&(b(!t.Autoplay.isPaused()),fe(a,ji,!0),c.textContent="…",i(gi,Ae(b,!0)),i(hi,Ae(b,!1)),i([Cn,en],Ae(p,!0)))}function p(y){fe(a,Di,y),y?(zn(a,c),o.start()):(Jt(c),o.cancel())}function T(){$t(a,[Vi,ji,Di]),Jt(c)}function b(y){s&&fe(a,Vi,y?"off":"polite")}return{mount:d,disable:b,destroy:T}}var sl=Object.freeze({__proto__:null,Media:hs,Direction:fs,Elements:As,Slides:ks,Layout:Is,Clones:Ms,Move:Fs,Controller:Ns,Arrows:Os,Autoplay:Ds,Cover:js,Scroll:Ys,Drag:Xs,Keyboard:Js,LazyLoad:el,Pagination:tl,Sync:rl,Wheel:il,Live:al}),ll={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"},cl={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:Es,i18n:ll,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function dl(e,t,n){var r=t.Slides;function i(){We(e).on([jt,Oe],a)}function a(){r.forEach(function(c){c.style("transform","translateX(-"+100*c.index+"%)")})}function s(c,o){r.style("transition","opacity "+n.speed+"ms "+n.easing),$o(o)}return{mount:i,start:s,cancel:Gr}}function ul(e,t,n){var r=t.Move,i=t.Controller,a=t.Scroll,s=t.Elements.list,c=Ae(ht,s,"transition"),o;function d(){We(e).bind(s,"transitionend",function(y){y.target===s&&o&&(T(),o())})}function p(y,g){var h=r.toPosition(y,!0),P=r.getPosition(),x=b(y);tt(h-P)>=1&&x>=1?n.useScroll?a.scroll(h,x,!1,g):(c("transform "+x+"ms "+n.easing),r.translate(h,!0),o=g):(r.jump(y),g())}function T(){c(""),a.cancel()}function b(y){var g=n.rewindSpeed;if(e.is(fn)&&g){var h=i.getIndex(!0),P=i.getEnd();if(h===0&&y>=P||h>=P&&y===0)return g}return n.speed}return{mount:d,start:p,cancel:T}}var pl=(function(){function e(n,r){this.event=We(),this.Components={},this.state=ms(un),this.splides=[],this._o={},this._E={};var i=Bt(n)?_o(document,n):n;En(i,i+" is invalid."),this.root=i,r=Nt({label:ft(i,pt)||"",labelledby:ft(i,yi)||""},cl,e.defaults,r||{});try{Nt(r,JSON.parse(ft(i,ci)))}catch{En(!1,"Invalid JSON")}this._o=Object.create(Nt({},r))}var t=e.prototype;return t.mount=function(r,i){var a=this,s=this.state,c=this.Components;En(s.is([un,mr]),"Already mounted!"),s.set(un),this._C=c,this._T=i||this._T||(this.is(Gn)?dl:ul),this._E=r||this._E;var o=In({},sl,this._E,{Transition:this._T});return Zt(o,function(d,p){var T=d(a,c,a._o);c[p]=T,T.setup&&T.setup()}),Zt(c,function(d){d.mount&&d.mount()}),this.emit(jt),St(this.root,Ts),s.set(gn),this.emit(Jr),this},t.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(gn)&&(this._C.Sync.remount(),r.Components.Sync.remount()),this},t.go=function(r){return this._C.Controller.go(r),this},t.on=function(r,i){return this.event.on(r,i),this},t.off=function(r){return this.event.off(r),this},t.emit=function(r){var i;return(i=this.event).emit.apply(i,[r].concat(Dt(arguments,1))),this},t.add=function(r,i){return this._C.Slides.add(r,i),this},t.remove=function(r){return this._C.Slides.remove(r),this},t.is=function(r){return this._o.type===r},t.refresh=function(){return this.emit(Oe),this},t.destroy=function(r){r===void 0&&(r=!0);var i=this.event,a=this.state;return a.is(un)?We(this).on(Jr,this.destroy.bind(this,r)):(Zt(this._C,function(s){s.destroy&&s.destroy(r)},!0),i.emit(pi),i.destroy(),r&&It(this.splides),a.set(mr)),this},ls(e,[{key:"options",get:function(){return this._o},set:function(r){this._C.Media.set(r,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Si=pl;Si.defaults={};Si.STATES=ds;var qi=[[jt,"onMounted"],[Jr,"onReady"],[Wt,"onMove"],[Cn,"onMoved"],[ui,"onClick"],[ko,"onActive"],[Io,"onInactive"],[Wo,"onVisible"],[Mo,"onHidden"],[Oe,"onRefresh"],[Ze,"onUpdated"],[hn,"onResize"],[xr,"onResized"],[Fo,"onDrag"],[No,"onDragging"],[Ho,"onDragged"],[Cr,"onScroll"],[en,"onScrolled"],[pi,"onDestroy"],[Bo,"onArrowsMounted"],[Oo,"onArrowsUpdated"],[Vo,"onPaginationMounted"],[Do,"onPaginationUpdated"],[mi,"onNavigationMounted"],[gi,"onAutoplayPlay"],[jo,"onAutoplayPlaying"],[hi,"onAutoplayPause"],[fi,"onLazyLoadLoaded"]];function $i(...e){return e.filter(Boolean).join(" ")}function yr(e){return e!==null&&typeof e=="object"}function ti(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,r)=>!ti(n,t[r]));if(yr(e)&&yr(t)){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(i=>!Object.prototype.hasOwnProperty.call(t,i)||!ti(e[i],t[i]))}return e===t}function ml(e,t){return e.length===t.length&&!e.some((n,r)=>n!==t[r])}function gl(e,t){if(e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const i=n[r];if(i!=="__proto__"&&t(e[i],i)===!1)break}}return e}function ni(e,t){const n=e;return gl(t,(r,i)=>{Array.isArray(r)?n[i]=r.slice():yr(r)?n[i]=ni(yr(n[i])?n[i]:{},r):n[i]=r}),n}var hl=({children:e,className:t,...n})=>u.createElement("div",{className:$i("splide__track",t),...n},u.createElement("ul",{className:"splide__list"},e)),wi=class extends u.Component{constructor(){super(...arguments),this.splideRef=u.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:r}=this.splideRef;r&&(this.splide=new Si(r,e),this.bind(this.splide),this.splide.mount(t,n),this.options=ni({},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&&!ti(this.options,e)&&(this.splide.options=e,this.options=ni({},e));const t=this.getSlides();ml(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){qi.forEach(([t,n])=>{const r=this.props[n];typeof r=="function"&&e.on(t,(...i)=>{r(e,...i)})})}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:r,...i}=this.props;return u.createElement(t,{className:$i("splide",e),ref:this.splideRef,...this.omit(i,["options",...qi.map(a=>a[1])])},n?u.createElement(hl,null,r):r)}},Ti=({children:e,className:t,...n})=>u.createElement("li",{className:$i("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),u=require("react"),Le=require("classnames"),$=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),So=require("react-dom");function ya(e){return e.type==="object"&&e.version===1}const va="ControlSlider-module__wrapper___sHEkd",ba="ControlSlider-module__hoverArrow___A-dOH",xa="ControlSlider-module__sliderItem___QQSkR",Ca="ControlSlider-module__sliderImage___9hRl-",Sa="ControlSlider-module__arrow___05ghY",$a="ControlSlider-module__arrowVertical___tBfVN",wa="ControlSlider-module__nextArrow___-30Yc",Ta="ControlSlider-module__arrowInner___aEra3",La="ControlSlider-module__arrowIcon___S4ztF",Ea="ControlSlider-module__arrowImg___2dwJW",Pa="ControlSlider-module__mirror___brd6U",_a="ControlSlider-module__pagination___bicLF",Aa="ControlSlider-module__paginationInner___bT-P-",Ra="ControlSlider-module__paginationVertical___zYqKw",Ia="ControlSlider-module__paginationItem___nTRbk",ka="ControlSlider-module__dot___p1Qun",Wa="ControlSlider-module__activeDot___LHFaj",Ma="ControlSlider-module__paginationInsideBottom___R3FWn",Fa="ControlSlider-module__paginationInsideTop___V-qb-",Na="ControlSlider-module__paginationOutsideBottom___14w8D",Ha="ControlSlider-module__paginationOutsideTop___SCLqB",Ba="ControlSlider-module__paginationInsideLeft___yOBRZ",Oa="ControlSlider-module__paginationInsideRight___Rtt3o",Va="ControlSlider-module__paginationOutsideLeft___lahaw",Da="ControlSlider-module__paginationOutsideRight___EtuQa",ja="ControlSlider-module__imgWrapper___UjEgB",za="ControlSlider-module__captionBlock___dJ6-j",Ka="ControlSlider-module__captionTextWrapper___HFlpf",qa="ControlSlider-module__captionText___uGBVc",Ua="ControlSlider-module__active___WZK4G",Ga="ControlSlider-module__withPointerEvents___t-18M",Ya="ControlSlider-module__topLeftAlignment___zjnGM",Xa="ControlSlider-module__topCenterAlignment___gD1xW",Za="ControlSlider-module__topRightAlignment___NMapS",Ja="ControlSlider-module__middleLeftAlignment___OnUrY",Qa="ControlSlider-module__middleCenterAlignment___Tdkl0",es="ControlSlider-module__middleRightAlignment___wEbfX",ts="ControlSlider-module__bottomLeftAlignment___cTP2-",ns="ControlSlider-module__bottomCenterAlignment___c54fB",rs="ControlSlider-module__bottomRightAlignment___kEwrz",is="ControlSlider-module__clickOverlay___DZA28",os="ControlSlider-module__contain___pLyq7",as="ControlSlider-module__cover___KdDat",se={wrapper:va,hoverArrow:ba,sliderItem:xa,sliderImage:Ca,arrow:Sa,arrowVertical:$a,nextArrow:wa,arrowInner:Ta,arrowIcon:La,arrowImg:Ea,mirror:Pa,pagination:_a,paginationInner:Aa,paginationVertical:Ra,paginationItem:Ia,dot:ka,activeDot:Wa,paginationInsideBottom:Ma,paginationInsideTop:Fa,paginationOutsideBottom:Na,paginationOutsideTop:Ha,paginationInsideLeft:Ba,paginationInsideRight:Oa,paginationOutsideLeft:Va,paginationOutsideRight:Da,imgWrapper:ja,captionBlock:za,captionTextWrapper:Ka,captionText:qa,active:Ua,withPointerEvents:Ga,topLeftAlignment:Ya,topCenterAlignment:Xa,topRightAlignment:Za,middleLeftAlignment:Ja,middleCenterAlignment:Qa,middleRightAlignment:es,bottomLeftAlignment:ts,bottomCenterAlignment:ns,bottomRightAlignment:rs,clickOverlay:is,contain:os,cover:as};function ss(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ls(e,t,n){return t&&ss(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Wi="(prefers-reduced-motion: reduce)",un=1,cs=2,gn=3,xn=4,Vn=5,ar=6,mr=7,ds={CREATED:un,MOUNTED:cs,IDLE:gn,MOVING:xn,SCROLLING:Vn,DRAGGING:ar,DESTROYED:mr};function kt(e){e.length=0}function Dt(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ae(e){return e.bind.apply(e,[null].concat(Dt(arguments,1)))}var $o=setTimeout,Gr=function(){};function Mi(e){return requestAnimationFrame(e)}function br(e,t){return typeof t===e}function An(e){return!oi(e)&&br("object",e)}var ii=Array.isArray,wo=Ae(br,"function"),Bt=Ae(br,"string"),Dn=Ae(br,"undefined");function oi(e){return e===null}function To(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function jn(e){return ii(e)?e:[e]}function gt(e,t){jn(e).forEach(t)}function ai(e,t){return e.indexOf(t)>-1}function sr(e,t){return e.push.apply(e,jn(t)),e}function _t(e,t,n){e&>(t,function(r){r&&e.classList[n?"add":"remove"](r)})}function St(e,t){_t(e,Bt(t)?t.split(" "):t,!0)}function zn(e,t){gt(t,e.appendChild.bind(e))}function si(e,t){gt(e,function(n){var r=(t||n).parentNode;r&&r.insertBefore(n,t)})}function Rn(e,t){return To(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Lo(e,t){var n=e?Dt(e.children):[];return t?n.filter(function(r){return Rn(r,t)}):n}function Kn(e,t){return t?Lo(e,t)[0]:e.firstElementChild}var In=Object.keys;function Zt(e,t,n){return e&&(n?In(e).reverse():In(e)).forEach(function(r){r!=="__proto__"&&t(e[r],r)}),e}function kn(e){return Dt(arguments,1).forEach(function(t){Zt(t,function(n,r){e[r]=t[r]})}),e}function Nt(e){return Dt(arguments,1).forEach(function(t){Zt(t,function(n,r){ii(n)?e[r]=n.slice():An(n)?e[r]=Nt({},An(e[r])?e[r]:{},n):e[r]=n})}),e}function Fi(e,t){gt(t||In(e),function(n){delete e[n]})}function $t(e,t){gt(e,function(n){gt(t,function(r){n&&n.removeAttribute(r)})})}function fe(e,t,n){An(t)?Zt(t,function(r,i){fe(e,i,r)}):gt(e,function(r){oi(n)||n===""?$t(r,t):r.setAttribute(t,String(n))})}function pn(e,t,n){var r=document.createElement(e);return t&&(Bt(t)?St(r,t):fe(r,t)),n&&zn(n,r),r}function ht(e,t,n){if(Dn(n))return getComputedStyle(e)[t];oi(n)||(e.style[t]=""+n)}function Wn(e,t){ht(e,"display",t)}function Eo(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function ft(e,t){return e.getAttribute(t)}function Ni(e,t){return e&&e.classList.contains(t)}function ut(e){return e.getBoundingClientRect()}function Jt(e){gt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Po(e){return Kn(new DOMParser().parseFromString(e,"text/html").body)}function Pt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function _o(e,t){return e&&e.querySelector(t)}function li(e,t){return t?Dt(e.querySelectorAll(t)):[]}function At(e,t){_t(e,t,!1)}function Yr(e){return e.timeStamp}function Gt(e){return Bt(e)?e:e?e+"px":""}var qn="splide",ci="data-"+qn;function En(e,t){if(!e)throw new Error("["+qn+"] "+(t||""))}var Ot=Math.min,gr=Math.max,hr=Math.floor,Mn=Math.ceil,tt=Math.abs;function Ao(e,t,n){return tt(e-t)<n}function lr(e,t,n,r){var i=Ot(t,n),a=gr(t,n);return r?i<e&&e<a:i<=e&&e<=a}function ln(e,t,n){var r=Ot(t,n),i=gr(t,n);return Ot(gr(r,e),i)}function Xr(e){return+(e>0)-+(e<0)}function Zr(e,t){return gt(t,function(n){e=e.replace("%s",""+n)}),e}function di(e){return e<10?"0"+e:""+e}var Hi={};function us(e){return""+e+di(Hi[e]=(Hi[e]||0)+1)}function Ro(){var e=[];function t(s,c,o,p){i(s,c,function(d,T,b){var y="addEventListener"in d,g=y?d.removeEventListener.bind(d,T,o,p):d.removeListener.bind(d,o);y?d.addEventListener(T,o,p):d.addListener(o),e.push([d,T,b,o,g])})}function n(s,c,o){i(s,c,function(p,d,T){e=e.filter(function(b){return b[0]===p&&b[1]===d&&b[2]===T&&(!o||b[3]===o)?(b[4](),!1):!0})})}function r(s,c,o){var p,d=!0;return typeof CustomEvent=="function"?p=new CustomEvent(c,{bubbles:d,detail:o}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(c,d,!1,o)),s.dispatchEvent(p),p}function i(s,c,o){gt(s,function(p){p&>(c,function(d){d.split(" ").forEach(function(T){var b=T.split(".");o(p,b[0],b[1])})})})}function a(){e.forEach(function(s){s[4]()}),kt(e)}return{bind:t,unbind:n,dispatch:r,destroy:a}}var jt="mounted",Jr="ready",Wt="move",Cn="moved",ui="click",Io="active",ko="inactive",Wo="visible",Mo="hidden",Be="refresh",Je="updated",hn="resize",xr="resized",Fo="drag",No="dragging",Ho="dragged",Cr="scroll",en="scrolled",ps="overflow",pi="destroy",Bo="arrows:mounted",Oo="arrows:updated",Vo="pagination:mounted",Do="pagination:updated",mi="navigation:mounted",gi="autoplay:play",jo="autoplay:playing",hi="autoplay:pause",fi="lazyload:loaded",zo="sk",Ko="sh",fr="ei";function Ie(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Ro();function r(a,s){n.bind(t,jn(a).join(" "),function(c){s.apply(s,ii(c.detail)?c.detail:[])})}function i(a){n.dispatch(t,a,Dt(arguments,1))}return e&&e.event.on(pi,n.destroy),kn(n,{bus:t,on:r,off:Ae(n.unbind,t),emit:i})}function Sr(e,t,n,r){var i=Date.now,a,s=0,c,o=!0,p=0;function d(){if(!o){if(s=e?Ot((i()-a)/e,1):1,n&&n(s),s>=1&&(t(),a=i(),r&&++p>=r))return b();c=Mi(d)}}function T(w){w||g(),a=i()-(w?s*e:0),o=!1,c=Mi(d)}function b(){o=!0}function y(){a=i(),s=0,n&&n(s)}function g(){c&&cancelAnimationFrame(c),s=0,c=0,o=!0}function m(w){e=w}function L(){return o}return{start:T,rewind:y,pause:b,cancel:g,set:m,isPaused:L}}function ms(e){var t=e;function n(i){t=i}function r(i){return ai(jn(i),t)}return{set:n,is:r}}function gs(e,t){var n=Sr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function hs(e,t,n){var r=e.state,i=n.breakpoints||{},a=n.reducedMotion||{},s=Ro(),c=[];function o(){var g=n.mediaQuery==="min";In(i).sort(function(m,L){return g?+m-+L:+L-+m}).forEach(function(m){d(i[m],"("+(g?"min":"max")+"-width:"+m+"px)")}),d(a,Wi),T()}function p(g){g&&s.destroy()}function d(g,m){var L=matchMedia(m);s.bind(L,"change",T),c.push([g,L])}function T(){var g=r.is(mr),m=n.direction,L=c.reduce(function(w,f){return Nt(w,f[1].matches?f[0]:{})},{});Fi(n),y(L),n.destroy?e.destroy(n.destroy==="completely"):g?(p(!0),e.mount()):m!==n.direction&&e.refresh()}function b(g){matchMedia(Wi).matches&&(g?Nt(n,a):Fi(n,In(a)))}function y(g,m,L){Nt(n,g),m&&Nt(Object.getPrototypeOf(n),g),(L||!r.is(un))&&e.emit(Je,n)}return{setup:o,destroy:p,reduce:b,set:y}}var $r="Arrow",wr=$r+"Left",Tr=$r+"Right",qo=$r+"Up",Uo=$r+"Down",Bi="rtl",Lr="ttb",Mr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[qo,Tr],ArrowRight:[Uo,wr]};function fs(e,t,n){function r(a,s,c){c=c||n.direction;var o=c===Bi&&!s?1:c===Lr?0:-1;return Mr[a]&&Mr[a][o]||a.replace(/width|left|right/i,function(p,d){var T=Mr[p.toLowerCase()][o]||p;return d>0?T.charAt(0).toUpperCase()+T.slice(1):T})}function i(a){return a*(n.direction===Bi?1:-1)}return{resolve:r,orient:i}}var Rt="role",mn="tabindex",ys="disabled",yt="aria-",Un=yt+"controls",Go=yt+"current",Oi=yt+"selected",pt=yt+"label",yi=yt+"labelledby",Yo=yt+"hidden",vi=yt+"orientation",Fn=yt+"roledescription",Vi=yt+"live",Di=yt+"busy",ji=yt+"atomic",bi=[Rt,mn,ys,Un,Go,pt,yi,Yo,vi,Fn],wt=qn+"__",zt="is-",Fr=qn,zi=wt+"track",vs=wt+"list",Er=wt+"slide",Xo=Er+"--clone",bs=Er+"__container",xi=wt+"arrows",Pr=wt+"arrow",Zo=Pr+"--prev",Jo=Pr+"--next",_r=wt+"pagination",Qo=_r+"__page",xs=wt+"progress",Cs=xs+"__bar",Ss=wt+"toggle",$s=wt+"spinner",ws=wt+"sr",Ts=zt+"initialized",Qt=zt+"active",ea=zt+"prev",ta=zt+"next",Qr=zt+"visible",ei=zt+"loading",na=zt+"focus-in",ra=zt+"overflow",Ls=[Qt,Qr,ea,ta,ei,na,ra],Es={slide:Er,clone:Xo,arrows:xi,arrow:Pr,prev:Zo,next:Jo,pagination:_r,page:Qo,spinner:$s};function Ps(e,t){if(wo(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Rn(n,t);)n=n.parentElement;return n}var _s=5,Ki=200,ia="touchstart mousedown",Nr="touchmove mousemove",Hr="touchend touchcancel mouseup click";function As(e,t,n){var r=Ie(e),i=r.on,a=r.bind,s=e.root,c=n.i18n,o={},p=[],d=[],T=[],b,y,g;function m(){S(),M(),f()}function L(){i(Be,w),i(Be,m),i(Je,f),a(document,ia+" keydown",function(x){g=x.type==="keydown"},{capture:!0}),a(s,"focusin",function(){_t(s,na,!!g)})}function w(x){var P=bi.concat("style");kt(p),At(s,d),At(b,T),$t([b,y],P),$t(s,x?P:["style",Fn])}function f(){At(s,d),At(b,T),d=A(Fr),T=A(zi),St(s,d),St(b,T),fe(s,pt,n.label),fe(s,yi,n.labelledby)}function S(){b=_("."+zi),y=Kn(b,"."+vs),En(b&&y,"A track/list element is missing."),sr(p,Lo(y,"."+Er+":not(."+Xo+")")),Zt({arrows:xi,pagination:_r,prev:Zo,next:Jo,bar:Cs,toggle:Ss},function(x,P){o[P]=_("."+x)}),kn(o,{root:s,track:b,list:y,slides:p})}function M(){var x=s.id||us(qn),P=n.role;s.id=x,b.id=b.id||x+"-track",y.id=y.id||x+"-list",!ft(s,Rt)&&s.tagName!=="SECTION"&&P&&fe(s,Rt,P),fe(s,Fn,c.carousel),fe(y,Rt,"presentation")}function _(x){var P=_o(s,x);return P&&Ps(P,"."+Fr)===s?P:void 0}function A(x){return[x+"--"+n.type,x+"--"+n.direction,n.drag&&x+"--draggable",n.isNavigation&&x+"--nav",x===Fr&&Qt]}return kn(o,{setup:m,mount:L,destroy:w})}var fn="slide",Sn="loop",Gn="fade";function Rs(e,t,n,r){var i=Ie(e),a=i.on,s=i.emit,c=i.bind,o=e.Components,p=e.root,d=e.options,T=d.isNavigation,b=d.updateOnMove,y=d.i18n,g=d.pagination,m=d.slideFocus,L=o.Direction.resolve,w=ft(r,"style"),f=ft(r,pt),S=n>-1,M=Kn(r,"."+bs),_;function A(){S||(r.id=p.id+"-slide"+di(t+1),fe(r,Rt,g?"tabpanel":"group"),fe(r,Fn,y.slide),fe(r,pt,f||Zr(y.slideLabel,[t+1,e.length]))),x()}function x(){c(r,"click",Ae(s,ui,H)),c(r,"keydown",Ae(s,zo,H)),a([Cn,Ko,en],R),a(mi,k),b&&a(Wt,E)}function P(){_=!0,i.destroy(),At(r,Ls),$t(r,bi),fe(r,"style",w),fe(r,pt,f||"")}function k(){var F=e.splides.map(function(I){var K=I.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");fe(r,pt,Zr(y.slideX,(S?n:t)+1)),fe(r,Un,F),fe(r,Rt,m?"button":""),m&&$t(r,Fn)}function E(){_||R()}function R(){if(!_){var F=e.index;B(),V(),_t(r,ea,t===F-1),_t(r,ta,t===F+1)}}function B(){var F=J();F!==Ni(r,Qt)&&(_t(r,Qt,F),fe(r,Go,T&&F||""),s(F?Io:ko,H))}function V(){var F=v(),I=!F&&(!J()||S);if(e.state.is([xn,Vn])||fe(r,Yo,I||""),fe(li(r,d.focusableNodes||""),mn,I?-1:""),m&&fe(r,mn,I?-1:0),F!==Ni(r,Qr)&&(_t(r,Qr,F),s(F?Wo:Mo,H)),!F&&document.activeElement===r){var K=o.Slides.getAt(e.index);K&&Eo(K.slide)}}function U(F,I,K){ht(K&&M||r,F,I)}function J(){var F=e.index;return F===t||d.cloneStatus&&F===n}function v(){if(e.is(Gn))return J();var F=ut(o.Elements.track),I=ut(r),K=L("left",!0),X=L("right",!0);return hr(F[K])<=Mn(I[K])&&hr(I[X])<=Mn(F[X])}function W(F,I){var K=tt(F-t);return!S&&(d.rewind||e.is(Sn))&&(K=Ot(K,e.length-K)),K<=I}var H={index:t,slideIndex:n,slide:r,container:M,isClone:S,mount:A,destroy:P,update:R,style:U,isWithin:W};return H}function Is(e,t,n){var r=Ie(e),i=r.on,a=r.emit,s=r.bind,c=t.Elements,o=c.slides,p=c.list,d=[];function T(){b(),i(Be,y),i(Be,b)}function b(){o.forEach(function(R,B){m(R,B,-1)})}function y(){_(function(R){R.destroy()}),kt(d)}function g(){_(function(R){R.update()})}function m(R,B,V){var U=Rs(e,B,V,R);U.mount(),d.push(U),d.sort(function(J,v){return J.index-v.index})}function L(R){return R?A(function(B){return!B.isClone}):d}function w(R){var B=t.Controller,V=B.toIndex(R),U=B.hasFocus()?1:n.perPage;return A(function(J){return lr(J.index,V,V+U-1)})}function f(R){return A(R)[0]}function S(R,B){gt(R,function(V){if(Bt(V)&&(V=Po(V)),To(V)){var U=o[B];U?si(V,U):zn(p,V),St(V,n.classes.slide),P(V,Ae(a,hn))}}),a(Be)}function M(R){Jt(A(R).map(function(B){return B.slide})),a(Be)}function _(R,B){L(B).forEach(R)}function A(R){return d.filter(wo(R)?R:function(B){return Bt(R)?Rn(B.slide,R):ai(jn(R),B.index)})}function x(R,B,V){_(function(U){U.style(R,B,V)})}function P(R,B){var V=li(R,"img"),U=V.length;U?V.forEach(function(J){s(J,"load error",function(){--U||B()})}):B()}function k(R){return R?o.length:d.length}function E(){return d.length>n.perPage}return{mount:T,destroy:y,update:g,register:m,get:L,getIn:w,getAt:f,add:S,remove:M,forEach:_,filter:A,style:x,getLength:k,isEnough:E}}function ks(e,t,n){var r=Ie(e),i=r.on,a=r.bind,s=r.emit,c=t.Slides,o=t.Direction.resolve,p=t.Elements,d=p.root,T=p.track,b=p.list,y=c.getAt,g=c.style,m,L,w;function f(){S(),a(window,"resize load",gs(Ae(s,hn))),i([Je,Be],S),i(hn,M)}function S(){m=n.direction===Lr,ht(d,"maxWidth",Gt(n.width)),ht(T,o("paddingLeft"),_(!1)),ht(T,o("paddingRight"),_(!0)),M(!0)}function M(H){var F=ut(d);(H||L.width!==F.width||L.height!==F.height)&&(ht(T,"height",A()),g(o("marginRight"),Gt(n.gap)),g("width",P()),g("height",k(),!0),L=F,s(xr),w!==(w=W())&&(_t(d,ra,w),s(ps,w)))}function _(H){var F=n.padding,I=o(H?"right":"left");return F&&Gt(F[I]||(An(F)?0:F))||"0px"}function A(){var H="";return m&&(H=x(),En(H,"height or heightRatio is missing."),H="calc("+H+" - "+_(!1)+" - "+_(!0)+")"),H}function x(){return Gt(n.height||ut(b).width*n.heightRatio)}function P(){return n.autoWidth?null:Gt(n.fixedWidth)||(m?"":E())}function k(){return Gt(n.fixedHeight)||(m?n.autoHeight?null:E():x())}function E(){var H=Gt(n.gap);return"calc((100%"+(H&&" + "+H)+")/"+(n.perPage||1)+(H&&" - "+H)+")"}function R(){return ut(b)[o("width")]}function B(H,F){var I=y(H||0);return I?ut(I.slide)[o("width")]+(F?0:J()):0}function V(H,F){var I=y(H);if(I){var K=ut(I.slide)[o("right")],X=ut(b)[o("left")];return tt(K-X)+(F?0:J())}return 0}function U(H){return V(e.length-1)-V(0)+B(0,H)}function J(){var H=y(0);return H&&parseFloat(ht(H.slide,o("marginRight")))||0}function v(H){return parseFloat(ht(T,o("padding"+(H?"Right":"Left"))))||0}function W(){return e.is(Gn)||U(!0)>R()}return{mount:f,resize:M,listSize:R,slideSize:B,sliderSize:U,totalSize:V,getPadding:v,isOverflow:W}}var Ws=2;function Ms(e,t,n){var r=Ie(e),i=r.on,a=t.Elements,s=t.Slides,c=t.Direction.resolve,o=[],p;function d(){i(Be,T),i([Je,hn],y),(p=L())&&(g(p),t.Layout.resize(!0))}function T(){b(),d()}function b(){Jt(o),kt(o),r.destroy()}function y(){var w=L();p!==w&&(p<w||!w)&&r.emit(Be)}function g(w){var f=s.get().slice(),S=f.length;if(S){for(;f.length<w;)sr(f,f);sr(f.slice(-w),f.slice(0,w)).forEach(function(M,_){var A=_<w,x=m(M.slide,_);A?si(x,f[0].slide):zn(a.list,x),sr(o,x),s.register(x,_-w+(A?0:S),M.index)})}}function m(w,f){var S=w.cloneNode(!0);return St(S,n.classes.clone),S.id=e.root.id+"-clone"+di(f+1),S}function L(){var w=n.clones;if(!e.is(Sn))w=0;else if(Dn(w)){var f=n[c("fixedWidth")]&&t.Layout.slideSize(0),S=f&&Mn(ut(a.track)[c("width")]/f);w=S||n[c("autoWidth")]&&e.length||n.perPage*Ws}return w}return{mount:d,destroy:b}}function Fs(e,t,n){var r=Ie(e),i=r.on,a=r.emit,s=e.state.set,c=t.Layout,o=c.slideSize,p=c.getPadding,d=c.totalSize,T=c.listSize,b=c.sliderSize,y=t.Direction,g=y.resolve,m=y.orient,L=t.Elements,w=L.list,f=L.track,S;function M(){S=t.Transition,i([jt,xr,Je,Be],_)}function _(){t.Controller.isBusy()||(t.Scroll.cancel(),x(e.index),t.Slides.update())}function A(I,K,X,re){I!==K&&H(I>X)&&(R(),P(E(U(),I>X),!0)),s(xn),a(Wt,K,X,I),S.start(K,function(){s(gn),a(Cn,K,X,I),re&&re()})}function x(I){P(V(I,!0))}function P(I,K){if(!e.is(Gn)){var X=K?I:k(I);ht(w,"transform","translate"+g("X")+"("+X+"px)"),I!==X&&a(Ko)}}function k(I){if(e.is(Sn)){var K=B(I),X=K>t.Controller.getEnd(),re=K<0;(re||X)&&(I=E(I,X))}return I}function E(I,K){var X=I-W(K),re=b();return I-=m(re*(Mn(tt(X)/re)||1))*(K?1:-1),I}function R(){P(U(),!0),S.cancel()}function B(I){for(var K=t.Slides.get(),X=0,re=1/0,Z=0;Z<K.length;Z++){var pe=K[Z].index,C=tt(V(pe,!0)-I);if(C<=re)re=C,X=pe;else break}return X}function V(I,K){var X=m(d(I-1)-v(I));return K?J(X):X}function U(){var I=g("left");return ut(w)[I]-ut(f)[I]+m(p(!1))}function J(I){return n.trimSpace&&e.is(fn)&&(I=ln(I,0,m(b(!0)-T()))),I}function v(I){var K=n.focus;return K==="center"?(T()-o(I,!0))/2:+K*o(I)||0}function W(I){return V(I?t.Controller.getEnd():0,!!n.trimSpace)}function H(I){var K=m(E(U(),I));return I?K>=0:K<=w[g("scrollWidth")]-ut(f)[g("width")]}function F(I,K){K=Dn(K)?U():K;var X=I!==!0&&m(K)<m(W(!1)),re=I!==!1&&m(K)>m(W(!0));return X||re}return{mount:M,move:A,jump:x,translate:P,shift:E,cancel:R,toIndex:B,toPosition:V,getPosition:U,getLimit:W,exceededLimit:F,reposition:_}}function Ns(e,t,n){var r=Ie(e),i=r.on,a=r.emit,s=t.Move,c=s.getPosition,o=s.getLimit,p=s.toPosition,d=t.Slides,T=d.isEnough,b=d.getLength,y=n.omitEnd,g=e.is(Sn),m=e.is(fn),L=Ae(U,!1),w=Ae(U,!0),f=n.start||0,S,M=f,_,A,x;function P(){k(),i([Je,Be,fr],k),i(xr,E)}function k(){_=b(!0),A=n.perMove,x=n.perPage,S=H();var C=ln(f,0,y?S:_-1);C!==f&&(f=C,s.reposition())}function E(){S!==H()&&a(fr)}function R(C,ie,Se){if(!pe()){var ue=V(C),ye=W(ue);ye>-1&&(ie||ye!==f)&&(X(ye),s.move(ue,ye,M,Se))}}function B(C,ie,Se,ue){t.Scroll.scroll(C,ie,Se,function(){var ye=W(s.toIndex(c()));X(y?Ot(ye,S):ye),ue&&ue()})}function V(C){var ie=f;if(Bt(C)){var Se=C.match(/([+\-<>])(\d+)?/)||[],ue=Se[1],ye=Se[2];ue==="+"||ue==="-"?ie=J(f+ +(""+ue+(+ye||1)),f):ue===">"?ie=ye?F(+ye):L(!0):ue==="<"&&(ie=w(!0))}else ie=g?C:ln(C,0,S);return ie}function U(C,ie){var Se=A||(Z()?1:x),ue=J(f+Se*(C?-1:1),f,!(A||Z()));return ue===-1&&m&&!Ao(c(),o(!C),1)?C?0:S:ie?ue:W(ue)}function J(C,ie,Se){if(T()||Z()){var ue=v(C);ue!==C&&(ie=C,C=ue,Se=!1),C<0||C>S?!A&&(lr(0,C,ie,!0)||lr(S,ie,C,!0))?C=F(I(C)):g?C=Se?C<0?-(_%x||x):_:C:n.rewind?C=C<0?S:0:C=-1:Se&&C!==ie&&(C=F(I(ie)+(C<ie?-1:1)))}else C=-1;return C}function v(C){if(m&&n.trimSpace==="move"&&C!==f)for(var ie=c();ie===p(C,!0)&&lr(C,0,e.length-1,!n.rewind);)C<f?--C:++C;return C}function W(C){return g?(C+_)%_||0:C}function H(){for(var C=_-(Z()||g&&A?1:x);y&&C-- >0;)if(p(_-1,!0)!==p(C,!0)){C++;break}return ln(C,0,_-1)}function F(C){return ln(Z()?C:x*C,0,S)}function I(C){return Z()?Ot(C,S):hr((C>=S?_-1:C)/x)}function K(C){var ie=s.toIndex(C);return m?ln(ie,0,S):ie}function X(C){C!==f&&(M=f,f=C)}function re(C){return C?M:f}function Z(){return!Dn(n.focus)||n.isNavigation}function pe(){return e.state.is([xn,Vn])&&!!n.waitForTransition}return{mount:P,go:R,scroll:B,getNext:L,getPrev:w,getAdjacent:U,getEnd:H,setIndex:X,getIndex:re,toIndex:F,toPage:I,toDest:K,hasFocus:Z,isBusy:pe}}var Hs="http://www.w3.org/2000/svg",Bs="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",Qn=40;function Os(e,t,n){var r=Ie(e),i=r.on,a=r.bind,s=r.emit,c=n.classes,o=n.i18n,p=t.Elements,d=t.Controller,T=p.arrows,b=p.track,y=T,g=p.prev,m=p.next,L,w,f={};function S(){_(),i(Je,M)}function M(){A(),S()}function _(){var B=n.arrows;B&&!(g&&m)&&k(),g&&m&&(kn(f,{prev:g,next:m}),Wn(y,B?"":"none"),St(y,w=xi+"--"+n.direction),B&&(x(),R(),fe([g,m],Un,b.id),s(Bo,g,m)))}function A(){r.destroy(),At(y,w),L?(Jt(T?[g,m]:y),g=m=null):$t([g,m],bi)}function x(){i([jt,Cn,Be,en,fr],R),a(m,"click",Ae(P,">")),a(g,"click",Ae(P,"<"))}function P(B){d.go(B,!0)}function k(){y=T||pn("div",c.arrows),g=E(!0),m=E(!1),L=!0,zn(y,[g,m]),!T&&si(y,b)}function E(B){var V='<button class="'+c.arrow+" "+(B?c.prev:c.next)+'" type="button"><svg xmlns="'+Hs+'" viewBox="0 0 '+Qn+" "+Qn+'" width="'+Qn+'" height="'+Qn+'" focusable="false"><path d="'+(n.arrowPath||Bs)+'" />';return Po(V)}function R(){if(g&&m){var B=e.index,V=d.getPrev(),U=d.getNext(),J=V>-1&&B<V?o.last:o.prev,v=U>-1&&B>U?o.first:o.next;g.disabled=V<0,m.disabled=U<0,fe(g,pt,J),fe(m,pt,v),s(Oo,g,m,V,U)}}return{arrows:f,mount:S,destroy:A,update:R}}var Vs=ci+"-interval";function Ds(e,t,n){var r=Ie(e),i=r.on,a=r.bind,s=r.emit,c=Sr(n.interval,e.go.bind(e,">"),x),o=c.isPaused,p=t.Elements,d=t.Elements,T=d.root,b=d.toggle,y=n.autoplay,g,m,L=y==="pause";function w(){y&&(f(),b&&fe(b,Un,p.track.id),L||S(),A())}function f(){n.pauseOnHover&&a(T,"mouseenter mouseleave",function(k){g=k.type==="mouseenter",_()}),n.pauseOnFocus&&a(T,"focusin focusout",function(k){m=k.type==="focusin",_()}),b&&a(b,"click",function(){L?S():M(!0)}),i([Wt,Cr,Be],c.rewind),i(Wt,P)}function S(){o()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),m=g=L=!1,A(),s(gi))}function M(k){k===void 0&&(k=!0),L=!!k,A(),o()||(c.pause(),s(hi))}function _(){L||(g||m?M(!1):S())}function A(){b&&(_t(b,Qt,!L),fe(b,pt,n.i18n[L?"play":"pause"]))}function x(k){var E=p.bar;E&&ht(E,"width",k*100+"%"),s(jo,k)}function P(k){var E=t.Slides.getAt(k);c.set(E&&+ft(E.slide,Vs)||n.interval)}return{mount:w,destroy:c.cancel,play:S,pause:M,isPaused:o}}function js(e,t,n){var r=Ie(e),i=r.on;function a(){n.cover&&(i(fi,Ae(c,!0)),i([jt,Je,Be],Ae(s,!0)))}function s(o){t.Slides.forEach(function(p){var d=Kn(p.container||p.slide,"img");d&&d.src&&c(o,d,p)})}function c(o,p,d){d.style("background",o?'center/cover no-repeat url("'+p.src+'")':"",!0),Wn(p,o?"none":"")}return{mount:a,destroy:Ae(s,!1)}}var zs=10,Ks=600,qs=.6,Us=1.5,Gs=800;function Ys(e,t,n){var r=Ie(e),i=r.on,a=r.emit,s=e.state.set,c=t.Move,o=c.getPosition,p=c.getLimit,d=c.exceededLimit,T=c.translate,b=e.is(fn),y,g,m=1;function L(){i(Wt,M),i([Je,Be],_)}function w(x,P,k,E,R){var B=o();if(M(),k&&(!b||!d())){var V=t.Layout.sliderSize(),U=Xr(x)*V*hr(tt(x)/V)||0;x=c.toPosition(t.Controller.toDest(x%V))+U}var J=Ao(B,x,1);m=1,P=J?0:P||gr(tt(x-B)/Us,Gs),g=E,y=Sr(P,f,Ae(S,B,x,R),1),s(Vn),a(Cr),y.start()}function f(){s(gn),g&&g(),a(en)}function S(x,P,k,E){var R=o(),B=x+(P-x)*A(E),V=(B-R)*m;T(R+V),b&&!k&&d()&&(m*=qs,tt(V)<zs&&w(p(d(!0)),Ks,!1,g,!0))}function M(){y&&y.cancel()}function _(){y&&!y.isPaused()&&(M(),f())}function A(x){var P=n.easingFunc;return P?P(x):1-Math.pow(1-x,4)}return{mount:L,destroy:M,scroll:w,cancel:_}}var cn={passive:!1,capture:!0};function Xs(e,t,n){var r=Ie(e),i=r.on,a=r.emit,s=r.bind,c=r.unbind,o=e.state,p=t.Move,d=t.Scroll,T=t.Controller,b=t.Elements.track,y=t.Media.reduce,g=t.Direction,m=g.resolve,L=g.orient,w=p.getPosition,f=p.exceededLimit,S,M,_,A,x,P=!1,k,E,R;function B(){s(b,Nr,Gr,cn),s(b,Hr,Gr,cn),s(b,ia,U,cn),s(b,"click",W,{capture:!0}),s(b,"dragstart",Pt),i([jt,Je],V)}function V(){var j=n.drag;ce(!j),A=j==="free"}function U(j){if(k=!1,!E){var h=ye(j);ue(j.target)&&(h||!j.button)&&(T.isBusy()?Pt(j,!0):(R=h?b:window,x=o.is([xn,Vn]),_=null,s(R,Nr,J,cn),s(R,Hr,v,cn),p.cancel(),d.cancel(),H(j)))}}function J(j){if(o.is(ar)||(o.set(ar),a(Fo)),j.cancelable)if(x){p.translate(S+Se(Z(j)));var h=pe(j)>Ki,N=P!==(P=f());(h||N)&&H(j),k=!0,a(No),Pt(j)}else K(j)&&(x=I(j),Pt(j))}function v(j){o.is(ar)&&(o.set(gn),a(Ho)),x&&(F(j),Pt(j)),c(R,Nr,J),c(R,Hr,v),x=!1}function W(j){!E&&k&&Pt(j,!0)}function H(j){_=M,M=j,S=w()}function F(j){var h=X(j),N=re(h),O=n.rewind&&n.rewindByDrag;y(!1),A?T.scroll(N,0,n.snap):e.is(Gn)?T.go(L(Xr(h))<0?O?"<":"-":O?">":"+"):e.is(fn)&&P&&O?T.go(f(!0)?">":"<"):T.go(T.toDest(N),!0),y(!0)}function I(j){var h=n.dragMinThreshold,N=An(h),O=N&&h.mouse||0,G=(N?h.touch:+h)||10;return tt(Z(j))>(ye(j)?G:O)}function K(j){return tt(Z(j))>tt(Z(j,!0))}function X(j){if(e.is(Sn)||!P){var h=pe(j);if(h&&h<Ki)return Z(j)/h}return 0}function re(j){return w()+Xr(j)*Ot(tt(j)*(n.flickPower||600),A?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function Z(j,h){return ie(j,h)-ie(C(j),h)}function pe(j){return Yr(j)-Yr(C(j))}function C(j){return M===j&&_||M}function ie(j,h){return(ye(j)?j.changedTouches[0]:j)["page"+m(h?"Y":"X")]}function Se(j){return j/(P&&e.is(fn)?_s:1)}function ue(j){var h=n.noDrag;return!Rn(j,"."+Qo+", ."+Pr)&&(!h||!Rn(j,h))}function ye(j){return typeof TouchEvent<"u"&&j instanceof TouchEvent}function ne(){return x}function ce(j){E=j}return{mount:B,disable:ce,isDragging:ne}}var Zs={Spacebar:" ",Right:Tr,Left:wr,Up:qo,Down:Uo};function Ci(e){return e=Bt(e)?e:e.key,Zs[e]||e}var qi="keydown";function Js(e,t,n){var r=Ie(e),i=r.on,a=r.bind,s=r.unbind,c=e.root,o=t.Direction.resolve,p,d;function T(){b(),i(Je,y),i(Je,b),i(Wt,m)}function b(){var w=n.keyboard;w&&(p=w==="global"?window:c,a(p,qi,L))}function y(){s(p,qi)}function g(w){d=w}function m(){var w=d;d=!0,$o(function(){d=w})}function L(w){if(!d){var f=Ci(w);f===o(wr)?e.go("<"):f===o(Tr)&&e.go(">")}}return{mount:T,destroy:y,disable:g}}var Pn=ci+"-lazy",cr=Pn+"-srcset",Qs="["+Pn+"], ["+cr+"]";function el(e,t,n){var r=Ie(e),i=r.on,a=r.off,s=r.bind,c=r.emit,o=n.lazyLoad==="sequential",p=[Cn,en],d=[];function T(){n.lazyLoad&&(b(),i(Be,b))}function b(){kt(d),y(),o?w():(a(p),i(p,g),g())}function y(){t.Slides.forEach(function(f){li(f.slide,Qs).forEach(function(S){var M=ft(S,Pn),_=ft(S,cr);if(M!==S.src||_!==S.srcset){var A=n.classes.spinner,x=S.parentElement,P=Kn(x,"."+A)||pn("span",A,x);d.push([S,f,P]),S.src||Wn(S,"none")}})})}function g(){d=d.filter(function(f){var S=n.perPage*((n.preloadPages||1)+1)-1;return f[1].isWithin(e.index,S)?m(f):!0}),d.length||a(p)}function m(f){var S=f[0];St(f[1].slide,ei),s(S,"load error",Ae(L,f)),fe(S,"src",ft(S,Pn)),fe(S,"srcset",ft(S,cr)),$t(S,Pn),$t(S,cr)}function L(f,S){var M=f[0],_=f[1];At(_.slide,ei),S.type!=="error"&&(Jt(f[2]),Wn(M,""),c(fi,M,_),c(hn)),o&&w()}function w(){d.length&&m(d.shift())}return{mount:T,destroy:Ae(kt,d),check:g}}function tl(e,t,n){var r=Ie(e),i=r.on,a=r.emit,s=r.bind,c=t.Slides,o=t.Elements,p=t.Controller,d=p.hasFocus,T=p.getIndex,b=p.go,y=t.Direction.resolve,g=o.pagination,m=[],L,w;function f(){S(),i([Je,Be,fr],f);var E=n.pagination;g&&Wn(g,E?"":"none"),E&&(i([Wt,Cr,en],k),M(),k(),a(Vo,{list:L,items:m},P(e.index)))}function S(){L&&(Jt(g?Dt(L.children):L),At(L,w),kt(m),L=null),r.destroy()}function M(){var E=e.length,R=n.classes,B=n.i18n,V=n.perPage,U=d()?p.getEnd()+1:Mn(E/V);L=g||pn("ul",R.pagination,o.track.parentElement),St(L,w=_r+"--"+x()),fe(L,Rt,"tablist"),fe(L,pt,B.select),fe(L,vi,x()===Lr?"vertical":"");for(var J=0;J<U;J++){var v=pn("li",null,L),W=pn("button",{class:R.page,type:"button"},v),H=c.getIn(J).map(function(I){return I.slide.id}),F=!d()&&V>1?B.pageX:B.slideX;s(W,"click",Ae(_,J)),n.paginationKeyboard&&s(W,"keydown",Ae(A,J)),fe(v,Rt,"presentation"),fe(W,Rt,"tab"),fe(W,Un,H.join(" ")),fe(W,pt,Zr(F,J+1)),fe(W,mn,-1),m.push({li:v,button:W,page:J})}}function _(E){b(">"+E,!0)}function A(E,R){var B=m.length,V=Ci(R),U=x(),J=-1;V===y(Tr,!1,U)?J=++E%B:V===y(wr,!1,U)?J=(--E+B)%B:V==="Home"?J=0:V==="End"&&(J=B-1);var v=m[J];v&&(Eo(v.button),b(">"+J),Pt(R,!0))}function x(){return n.paginationDirection||n.direction}function P(E){return m[p.toPage(E)]}function k(){var E=P(T(!0)),R=P(T());if(E){var B=E.button;At(B,Qt),$t(B,Oi),fe(B,mn,-1)}if(R){var V=R.button;St(V,Qt),fe(V,Oi,!0),fe(V,mn,"")}a(Do,{list:L,items:m},E,R)}return{items:m,mount:f,destroy:S,getAt:P,update:k}}var nl=[" ","Enter"];function rl(e,t,n){var r=n.isNavigation,i=n.slideFocus,a=[];function s(){e.splides.forEach(function(g){g.isParent||(p(e,g.splide),p(g.splide,e))}),r&&d()}function c(){a.forEach(function(g){g.destroy()}),kt(a)}function o(){c(),s()}function p(g,m){var L=Ie(g);L.on(Wt,function(w,f,S){m.go(m.is(Sn)?S:w)}),a.push(L)}function d(){var g=Ie(e),m=g.on;m(ui,b),m(zo,y),m([jt,Je],T),a.push(g),g.emit(mi,e.splides)}function T(){fe(t.Elements.list,vi,n.direction===Lr?"vertical":"")}function b(g){e.go(g.index)}function y(g,m){ai(nl,Ci(m))&&(b(g),Pt(m))}return{setup:Ae(t.Media.set,{slideFocus:Dn(i)?r:i},!0),mount:s,destroy:c,remount:o}}function il(e,t,n){var r=Ie(e),i=r.bind,a=0;function s(){n.wheel&&i(t.Elements.track,"wheel",c,cn)}function c(p){if(p.cancelable){var d=p.deltaY,T=d<0,b=Yr(p),y=n.wheelMinThreshold||0,g=n.wheelSleep||0;tt(d)>y&&b-a>g&&(e.go(T?"<":">"),a=b),o(T)&&Pt(p)}}function o(p){return!n.releaseWheel||e.state.is(xn)||t.Controller.getAdjacent(p)!==-1}return{mount:s}}var ol=90;function al(e,t,n){var r=Ie(e),i=r.on,a=t.Elements.track,s=n.live&&!n.isNavigation,c=pn("span",ws),o=Sr(ol,Ae(d,!1));function p(){s&&(b(!t.Autoplay.isPaused()),fe(a,ji,!0),c.textContent="…",i(gi,Ae(b,!0)),i(hi,Ae(b,!1)),i([Cn,en],Ae(d,!0)))}function d(y){fe(a,Di,y),y?(zn(a,c),o.start()):(Jt(c),o.cancel())}function T(){$t(a,[Vi,ji,Di]),Jt(c)}function b(y){s&&fe(a,Vi,y?"off":"polite")}return{mount:p,disable:b,destroy:T}}var sl=Object.freeze({__proto__:null,Media:hs,Direction:fs,Elements:As,Slides:Is,Layout:ks,Clones:Ms,Move:Fs,Controller:Ns,Arrows:Os,Autoplay:Ds,Cover:js,Scroll:Ys,Drag:Xs,Keyboard:Js,LazyLoad:el,Pagination:tl,Sync:rl,Wheel:il,Live:al}),ll={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"},cl={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:Es,i18n:ll,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function dl(e,t,n){var r=t.Slides;function i(){Ie(e).on([jt,Be],a)}function a(){r.forEach(function(c){c.style("transform","translateX(-"+100*c.index+"%)")})}function s(c,o){r.style("transition","opacity "+n.speed+"ms "+n.easing),$o(o)}return{mount:i,start:s,cancel:Gr}}function ul(e,t,n){var r=t.Move,i=t.Controller,a=t.Scroll,s=t.Elements.list,c=Ae(ht,s,"transition"),o;function p(){Ie(e).bind(s,"transitionend",function(y){y.target===s&&o&&(T(),o())})}function d(y,g){var m=r.toPosition(y,!0),L=r.getPosition(),w=b(y);tt(m-L)>=1&&w>=1?n.useScroll?a.scroll(m,w,!1,g):(c("transform "+w+"ms "+n.easing),r.translate(m,!0),o=g):(r.jump(y),g())}function T(){c(""),a.cancel()}function b(y){var g=n.rewindSpeed;if(e.is(fn)&&g){var m=i.getIndex(!0),L=i.getEnd();if(m===0&&y>=L||m>=L&&y===0)return g}return n.speed}return{mount:p,start:d,cancel:T}}var pl=(function(){function e(n,r){this.event=Ie(),this.Components={},this.state=ms(un),this.splides=[],this._o={},this._E={};var i=Bt(n)?_o(document,n):n;En(i,i+" is invalid."),this.root=i,r=Nt({label:ft(i,pt)||"",labelledby:ft(i,yi)||""},cl,e.defaults,r||{});try{Nt(r,JSON.parse(ft(i,ci)))}catch{En(!1,"Invalid JSON")}this._o=Object.create(Nt({},r))}var t=e.prototype;return t.mount=function(r,i){var a=this,s=this.state,c=this.Components;En(s.is([un,mr]),"Already mounted!"),s.set(un),this._C=c,this._T=i||this._T||(this.is(Gn)?dl:ul),this._E=r||this._E;var o=kn({},sl,this._E,{Transition:this._T});return Zt(o,function(p,d){var T=p(a,c,a._o);c[d]=T,T.setup&&T.setup()}),Zt(c,function(p){p.mount&&p.mount()}),this.emit(jt),St(this.root,Ts),s.set(gn),this.emit(Jr),this},t.sync=function(r){return this.splides.push({splide:r}),r.splides.push({splide:this,isParent:!0}),this.state.is(gn)&&(this._C.Sync.remount(),r.Components.Sync.remount()),this},t.go=function(r){return this._C.Controller.go(r),this},t.on=function(r,i){return this.event.on(r,i),this},t.off=function(r){return this.event.off(r),this},t.emit=function(r){var i;return(i=this.event).emit.apply(i,[r].concat(Dt(arguments,1))),this},t.add=function(r,i){return this._C.Slides.add(r,i),this},t.remove=function(r){return this._C.Slides.remove(r),this},t.is=function(r){return this._o.type===r},t.refresh=function(){return this.emit(Be),this},t.destroy=function(r){r===void 0&&(r=!0);var i=this.event,a=this.state;return a.is(un)?Ie(this).on(Jr,this.destroy.bind(this,r)):(Zt(this._C,function(s){s.destroy&&s.destroy(r)},!0),i.emit(pi),i.destroy(),r&&kt(this.splides),a.set(mr)),this},ls(e,[{key:"options",get:function(){return this._o},set:function(r){this._C.Media.set(r,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Si=pl;Si.defaults={};Si.STATES=ds;var Ui=[[jt,"onMounted"],[Jr,"onReady"],[Wt,"onMove"],[Cn,"onMoved"],[ui,"onClick"],[Io,"onActive"],[ko,"onInactive"],[Wo,"onVisible"],[Mo,"onHidden"],[Be,"onRefresh"],[Je,"onUpdated"],[hn,"onResize"],[xr,"onResized"],[Fo,"onDrag"],[No,"onDragging"],[Ho,"onDragged"],[Cr,"onScroll"],[en,"onScrolled"],[pi,"onDestroy"],[Bo,"onArrowsMounted"],[Oo,"onArrowsUpdated"],[Vo,"onPaginationMounted"],[Do,"onPaginationUpdated"],[mi,"onNavigationMounted"],[gi,"onAutoplayPlay"],[jo,"onAutoplayPlaying"],[hi,"onAutoplayPause"],[fi,"onLazyLoadLoaded"]];function $i(...e){return e.filter(Boolean).join(" ")}function yr(e){return e!==null&&typeof e=="object"}function ti(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,r)=>!ti(n,t[r]));if(yr(e)&&yr(t)){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(i=>!Object.prototype.hasOwnProperty.call(t,i)||!ti(e[i],t[i]))}return e===t}function ml(e,t){return e.length===t.length&&!e.some((n,r)=>n!==t[r])}function gl(e,t){if(e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const i=n[r];if(i!=="__proto__"&&t(e[i],i)===!1)break}}return e}function ni(e,t){const n=e;return gl(t,(r,i)=>{Array.isArray(r)?n[i]=r.slice():yr(r)?n[i]=ni(yr(n[i])?n[i]:{},r):n[i]=r}),n}var hl=({children:e,className:t,...n})=>u.createElement("div",{className:$i("splide__track",t),...n},u.createElement("ul",{className:"splide__list"},e)),wi=class extends u.Component{constructor(){super(...arguments),this.splideRef=u.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:r}=this.splideRef;r&&(this.splide=new Si(r,e),this.bind(this.splide),this.splide.mount(t,n),this.options=ni({},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&&!ti(this.options,e)&&(this.splide.options=e,this.options=ni({},e));const t=this.getSlides();ml(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){Ui.forEach(([t,n])=>{const r=this.props[n];typeof r=="function"&&e.on(t,(...i)=>{r(e,...i)})})}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:r,...i}=this.props;return u.createElement(t,{className:$i("splide",e),ref:this.splideRef,...this.omit(i,["options",...Ui.map(a=>a[1])])},n?u.createElement(hl,null,r):r)}},Ti=({children:e,className:t,...n})=>u.createElement("li",{className:$i("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 fl="RichTextRenderer-module__link___BWeZ2",yl={link:fl},vl=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(r=>/^\d/.test(r))},Ar=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>vl(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function Ct(e){const{color:t,...n}=e;return n}function nt(e,t){var i,a,s;const{fontSize:n,lineHeight:r}=e;return{fontFamily:Ar(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:w.scalingValue(e.letterSpacing,t),wordSpacing:w.scalingValue(e.wordSpacing,t),fontSize:w.scalingValue(n,t),lineHeight:r!==void 0?w.scalingValue(r,t):void 0,textTransform:(i=e.textAppearance)==null?void 0:i.textTransform,textDecoration:(a=e.textAppearance)==null?void 0:a.textDecoration,fontVariant:(s=e.textAppearance)==null?void 0:s.fontVariant,textAlign:e.textAlign,color:e.color}}const Nn=({content:e})=>{const t=n=>n.map((r,i)=>r.type==="link"?l.jsx("a",{className:yl.link,href:r.value,target:r.target,children:t(r.children)},i):l.jsx("span",{style:bl(r),children:r.text},i));return l.jsx(l.Fragment,{children:e.map((n,r)=>{const i=n.children;return l.jsx("div",{children:t(i)},r)})})};function bl(e){return{...e.fontFamily&&{fontFamily:Ar(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 xl="SvgImage-module__svg___q3xE-",Cl="SvgImage-module__img___VsTm-",Gi={svg:xl,img:Cl},Sl=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},$l=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Ht=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r="",style:i})=>{const[a,s]=u.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return u.useEffect(()=>{if(typeof window<"u"&&window.CSS){const c=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');s(c)}},[]),!Sl(e)||!a?l.jsx("img",{src:e,alt:"",className:Le(Gi.img,r),style:i}):l.jsx("span",{"data-supports-mask":a,className:Le(Gi.svg,r),style:{"--svg":$l(e),"--fill":t,"--hover-fill":n,...i??{}}})},wl={"top-left":se.topLeftAlignment,"top-center":se.topCenterAlignment,"top-right":se.topRightAlignment,"middle-left":se.middleLeftAlignment,"middle-center":se.middleCenterAlignment,"middle-right":se.middleRightAlignment,"bottom-left":se.bottomLeftAlignment,"bottom-center":se.bottomCenterAlignment,"bottom-right":se.bottomRightAlignment};function Tl({settings:e,content:t,styles:n,isEditor:r}){const[i,a]=u.useState(null),{widthSettings:s,fontSettings:c,letterSpacing:o,textAlign:d,wordSpacing:p,fontSizeLineHeight:T,textAppearance:b,color:y}=n.imageCaption,[g,h]=u.useState(void 0),[P,x]=u.useState(null),[f,C]=u.useState(0),[B,_]=u.useState(0),{direction:E,transition:S,controls:A,pagination:k,imageCaption:I,triggers:$}=e,O=u.useRef(S.type),{x:V,y:q}=e.controls.offset,X=L=>{i&&i.go(L)};return u.useEffect(()=>{if(!P)return;const L=new ResizeObserver(R=>{if(!i)return;const[H]=R;h({width:Math.round(H.contentRect.width),height:Math.round(H.contentRect.height)})});return L.observe(P),()=>L.unobserve(P)},[P]),u.useEffect(()=>{!i||O.current===S.type||(_(L=>L+1),O.current=S.type)},[S.type]),l.jsx("div",{className:Le(se.wrapper,{[se.editor]:r}),ref:x,children:l.jsxs("div",{className:se.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:S.backgroundColor&&S.type==="fade in"?S.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&l.jsx("div",{className:Le(se.captionBlock),children:l.jsx("div",{className:se.captionTextWrapper,children:t.map((L,R)=>l.jsx("div",{className:Le(se.captionText,wl[I.alignment],{[se.withPointerEvents]:R===f&&r,[se.active]:R===f}),style:{fontFamily:Ar(c.fontFamily),fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:s.sizing==="auto"?"max-content":w.scalingValue(s.width,r),letterSpacing:w.scalingValue(o,r),wordSpacing:w.scalingValue(p,r),textAlign:d,fontSize:w.scalingValue(T.fontSize,r),lineHeight:w.scalingValue(T.lineHeight,r),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:y,transitionDuration:S.duration?`${Math.round(parseInt(S.duration)/2)}ms`:"500ms"},children:l.jsx("div",{"data-styles":"imageCaption",className:se.captionTextInner,style:{"--link-hover-color":I.linkHoverColor,"--link-color":I.linkColor,position:"relative",top:w.scalingValue(I.offset.y,r),left:w.scalingValue(I.offset.x,r)},children:l.jsx(Nn,{content:L.imageCaption})})},R))})}),l.jsx(wi,{onMove:L=>{C(L.index)},ref:a,options:{arrows:!1,speed:S.duration?parseInt(S.duration):500,autoplay:$.autoPlay!==null,...$.autoPlay!==null&&{interval:parseInt($.autoPlay)*1e3},direction:E==="horiz"||S.type==="fade in"?"ltr":"ttb",pagination:!1,drag:$.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:S.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((L,R)=>l.jsx(Ti,{children:l.jsx("div",{className:se.sliderItem,children:l.jsx("div",{className:se.imgWrapper,children:l.jsx("img",{className:Le(se.sliderImage,{[se.contain]:L.image.objectFit==="contain",[se.cover]:L.image.objectFit==="cover"}),src:L.image.url,alt:L.image.name??""})})})},R))},B),A.isActive&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:Le(se.arrow,{[se.arrowVertical]:E==="vert",[se.hoverArrow]:A.show==="on hover"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:l.jsxs("button",{onClick:()=>{X("-1")},className:se.arrowInner,style:{transform:`translate(${w.scalingValue(V,r)}, ${w.scalingValue(q*(E==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[A.arrowsImgUrl&&l.jsx(Ht,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:Le(se.arrowImg,se.mirror)}),!A.arrowsImgUrl&&l.jsx(Yi,{color:A.color,className:Le(se.arrowIcon,se.arrowImg,se.mirror)})]})}),l.jsx("div",{className:Le(se.arrow,se.nextArrow,{[se.arrowVertical]:E==="vert",[se.hoverArrow]:A.show==="on hover"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:l.jsxs("button",{className:se.arrowInner,onClick:()=>X("+1"),style:{transform:`translate(${w.scalingValue(V*(E==="horiz"?-1:1),r)}, ${w.scalingValue(q,r)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[A.arrowsImgUrl&&l.jsx(Ht,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:se.arrowImg}),!A.arrowsImgUrl&&l.jsx(Yi,{color:A.color,className:Le(se.arrowIcon,se.arrowImg)})]})})]}),$.triggersList.click&&l.jsx("div",{className:se.clickOverlay,onClick:()=>{i&&i.go("+1")}}),k.isActive&&l.jsx("div",{className:Le(se.pagination,{[se.paginationInsideBottom]:k.position==="inside-1"&&E==="horiz",[se.paginationInsideTop]:k.position==="inside-2"&&E==="horiz",[se.paginationOutsideBottom]:k.position==="outside-1"&&E==="horiz",[se.paginationOutsideTop]:k.position==="outside-2"&&E==="horiz",[se.paginationInsideLeft]:k.position==="inside-1"&&E==="vert",[se.paginationInsideRight]:k.position==="inside-2"&&E==="vert",[se.paginationOutsideLeft]:k.position==="outside-1"&&E==="vert",[se.paginationOutsideRight]:k.position==="outside-2"&&E==="vert",[se.paginationVertical]:E==="vert"}),children:l.jsx("div",{className:se.paginationInner,style:{backgroundColor:k.colors[2],transform:`scale(${k.scale/100}) translate(${w.scalingValue(k.offset.x,r)}, ${w.scalingValue(k.offset.y,r)}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:t.map((L,R)=>l.jsx("button",{onClick:()=>{i&&i.go(R)},className:Le(se.paginationItem),children:l.jsx("div",{className:Le(se.dot,{[se.activeDot]:R===f}),style:{backgroundColor:R===f?k.colors[0]:k.colors[1],"--pagination-hover-color":k.hover}})},R))})})]})})}function Yi({color:e,className:t}){return l.jsx("svg",{viewBox:"0 0 10 18",className:t,children:l.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:l.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 Ll={element:Tl,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"]}},El="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Pl="ImageRevealSlider-module__image___Qjt-e",_l="ImageRevealSlider-module__link___N-iLG",Al="ImageRevealSlider-module__cursor___2U03d",sn={imageRevealSlider:El,image:Pl,link:_l,cursor:Al};function Xi(e,t,n){for(const r of n){const i=new Image;i.src=r.url;const a=r.width?Number.parseFloat(r.width):i.naturalWidth,s=i.naturalHeight/i.naturalWidth*a,c=a/2,o=s/2;if(e>=r.x-c&&e<=r.x+c&&t>=r.y-o&&t<=r.y+o)return!0}return!1}function Br(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Rl(e,t,n,r){let i,a;if(t==="custom"){i=n;const s=await Br(e);a=s.height/s.width*i}else if(t==="random"){i=Math.random()*(r.max-r.min)+r.min;const s=await Br(e);a=s.height/s.width*i}else{const s=await Br(e);i=s.width,a=s.height}return{width:i,height:a,finalWidth:`${i}px`}}function kl({settings:e,content:t,isEditor:n}){const[r,i]=u.useState(null),[a,s]=u.useState([]),[c,o]=u.useState(0),d=u.useRef(0),[p,T]=u.useState({x:0,y:0}),[b,y]=u.useState(1),[g,h]=u.useState("none"),P=u.useRef({x:0,y:0}),[x,f]=u.useState(!1),{sizeType:C,imageWidth:B,randomRangeImageWidth:_}=e.imageSize,{revealPosition:E,visible:S}=e.position,{cursorType:A,target:k,defaultCursorScale:I,defaultCursor:$,hoverCursorScale:O,hoverCursor:V}=e.cursor;u.useEffect(()=>{if(!r)return;const L=(M,W)=>{const j=r.getBoundingClientRect(),Q=M-j.left,oe=W-j.top;if(T({x:Q,y:oe}),A==="system"){h("none"),y(1);return}const te=Q,ce=oe,v=document.elementFromPoint(j.left+te,j.top+ce);if(v&&v.closest("a")){h("none"),y(1);return}const ie=Xi(te,ce,a)||k==="area"?{img:V??"none",scale:O}:{img:$??"none",scale:I};h(ie.img),y(ie.scale)},R=M=>{M.stopPropagation(),P.current={x:M.clientX,y:M.clientY},L(M.clientX,M.clientY)},H=()=>{x&&L(P.current.x,P.current.y)};return r.addEventListener("mousemove",R),window.addEventListener("scroll",H,!0),()=>{r.removeEventListener("mousemove",R),window.removeEventListener("scroll",H,!0)}},[r,x,p,A,k,V,$,O,I,a]),u.useEffect(()=>{x||(h("none"),y(0))},[x]);const q=async(L,R,H,M={})=>{const{width:W,height:j,finalWidth:Q}=await Rl(L.image.url,C,B,_);let oe=0,te=0;E==="same"?(oe=R/2,te=H/2):(oe=M.x??Math.random()*R,te=M.y??Math.random()*H);const ce=Math.min(Math.max(oe,W/2),R-W/2),v=Math.min(Math.max(te,j/2),H-j/2);return{id:d.current++,url:L.image.url,link:L.link,name:L.image.name,x:ce,y:v,width:Q}};u.useEffect(()=>{if(!r||t.length===0)return;const L=r.getBoundingClientRect(),R=L.width,H=L.height,M=[];(async()=>{const j=t[0],Q=await q(j,R,H);M.push(Q),s(M),o(1)})()},[C,B,_,E,r]),u.useEffect(()=>{S==="last One"&&s(L=>L.length>0?[L[L.length-1]]:[])},[S]);const X=async L=>{if(!r)return;const R=r.getBoundingClientRect(),H=L.clientX-R.left,M=L.clientY-R.top;if(k==="image"&&!Xi(H,M,a))return;let W=0,j=0;E==="on Click"?(W=H,j=M):E==="same"?(W=R.width/2,j=R.height/2):(W=Math.random()*R.width,j=Math.random()*R.height);const Q=t[c],oe=await q(Q,R.width,R.height,{x:W,y:j});s(te=>S==="all"?[...te,oe]:[oe]),o(te=>te>=t.length-1?0:te+1)};return l.jsxs("div",{ref:i,onClick:X,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:sn.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[a.map(L=>l.jsx("div",{className:sn.wrapper,style:{top:`${L.y}px`,left:`${L.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:L.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:k==="area"&&L.link?l.jsx("a",{href:L.link,target:"_blank",className:sn.link,children:l.jsx("img",{src:L.url,alt:L.name,className:sn.image},L.id)}):l.jsx("img",{src:L.url,alt:L.name,className:sn.image},L.id)},L.id)),x&&l.jsx("div",{className:sn.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${b})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Il={element:kl,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:""}]}}}},Wl="LightBox-module__hidden___9s-9x",Ml="LightBox-module__heroImage___sTxNF",Fl="LightBox-module__background___rm9ml",Nl="LightBox-module__editor___4ACaY",Hl="LightBox-module__contentStyle___Bgnsq",Bl="LightBox-module__imageStyle___tLIlB",Ol="LightBox-module__imgWrapper___LuFUp",Vl="LightBox-module__contain___8-yaS",Dl="LightBox-module__cover___hNvOG",jl="LightBox-module__caption___b6L2I",zl="LightBox-module__captionTextInner___rCGNH",Kl="LightBox-module__lightboxSplide___XFuWC",Ul="LightBox-module__arrow___iz38X",ql="LightBox-module__arrowVertical___Zfz81",Gl="LightBox-module__nextArrow___zkAQN",Yl="LightBox-module__arrowInner___p48sW",Xl="LightBox-module__arrowIcon___3VaFf",Zl="LightBox-module__arrowImg___pNV88",Jl="LightBox-module__mirror___pjeXc",Ql="LightBox-module__thumbsWrapper___GB-nU",ec="LightBox-module__thumbsContainerVertical___wttk5",tc="LightBox-module__thumbsContainer___osSma",nc="LightBox-module__thumbsAlignStart___MO6tY",rc="LightBox-module__thumbsAlignCenter___Q4sUx",ic="LightBox-module__thumbsAlignEnd___p4y9R",oc="LightBox-module__thumbItem___HvnF3",ac="LightBox-module__closeButton___g2khP",sc="LightBox-module__fadeIn___0m5GW",lc="LightBox-module__slideInLeft___gPYwC",cc="LightBox-module__slideInRight___S-pPp",dc="LightBox-module__slideInTop___DFdAj",uc="LightBox-module__slideInBottom___m27kZ",pc="LightBox-module__fadeOut___55qBR",mc="LightBox-module__slideOutLeft___NvU7P",gc="LightBox-module__slideOutRight___SK7eC",hc="LightBox-module__slideOutTop___Vgg0z",fc="LightBox-module__slideOutBottom___nJ0Ef",yc="LightBox-module__scaleSlide___vZriG",Z={hidden:Wl,heroImage:Ml,background:Fl,editor:Nl,contentStyle:Hl,imageStyle:Bl,imgWrapper:Ol,contain:Vl,cover:Dl,caption:jl,captionTextInner:zl,lightboxSplide:Kl,arrow:Ul,arrowVertical:ql,nextArrow:Gl,arrowInner:Yl,arrowIcon:Xl,arrowImg:Zl,mirror:Jl,thumbsWrapper:Ql,thumbsContainerVertical:ec,thumbsContainer:tc,thumbsAlignStart:nc,thumbsAlignCenter:rc,thumbsAlignEnd:ic,thumbItem:oc,closeButton:ac,fadeIn:sc,slideInLeft:lc,slideInRight:cc,slideInTop:dc,slideInBottom:uc,fadeOut:pc,slideOutLeft:mc,slideOutRight:gc,slideOutTop:hc,slideOutBottom:fc,scaleSlide:yc},er=(e,t,n)=>{const r={},[i,a]=e.split("-");return i==="top"?(r.top="0",r.bottom="auto"):i==="middle"?(r.top="50%",r.bottom="auto"):i==="bottom"&&(r.top="auto",r.bottom="0"),a==="left"?(r.left="0",r.right="auto"):a==="center"?(r.left="50%",r.right="auto"):a==="right"&&(r.left="auto",r.right="0"),i==="middle"&&a==="center"?r.transform=`translate(calc(-50% + ${w.scalingValue(t.x,n)}), calc(-50% + ${w.scalingValue(t.y,n)}))`:i==="middle"?r.transform=`translate(${w.scalingValue(t.x,n)}, calc(-50% + ${w.scalingValue(t.y,n)}))`:a==="center"?r.transform=`translate(calc(-50% + ${w.scalingValue(t.x,n)}), ${w.scalingValue(t.y,n)})`:r.transform=`translate(${w.scalingValue(t.x,n)}, ${w.scalingValue(t.y,n)})`,r};function oa(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 Zi(e){const t=e.getBoundingClientRect(),n=oa(e),r=Math.max(0,t.width-n.left-n.right),i=Math.max(0,t.height-n.top-n.bottom),a=e.naturalWidth,s=e.naturalHeight,c=r/i,o=a/s;let d,p;o>c?(d=r,p=r/o):(p=i,d=i*o);const T=t.left+n.left,b=t.top+n.top,y=(r-d)/2+T,g=(i-p)/2+b;return{x:y,y:g,width:d,height:p}}function Ji(e){const t=e.getBoundingClientRect(),n=oa(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Qi(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const r=t[1].split(",").map(i=>parseFloat(i.trim()));return r.length===4?r[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const r=n[1].substring(6,8);return parseInt(r,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function vc(e,t){const n=(()=>{if(e==="fade in")return Z.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Z.slideInLeft;case"right":return Z.slideInRight;case"top":return Z.slideInTop;case"bottom":return Z.slideInBottom;default:return Z.slideInRight}return Z.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return Z.fadeIn;if(e==="slide in")switch(t){case"left":return Z.slideInLeft;case"right":return Z.slideInRight;case"top":return Z.slideInTop;case"bottom":return Z.slideInBottom;default:return Z.slideInRight}return Z.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Z.fadeOut;if(e==="slide in")switch(t){case"left":return Z.slideOutLeft;case"right":return Z.slideOutRight;case"top":return Z.slideOutTop;case"bottom":return Z.slideOutBottom;default:return Z.slideOutRight}return Z.fadeOut})(),a=(()=>{if(e==="fade in")return Z.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Z.slideOutLeft;case"right":return Z.slideOutRight;case"top":return Z.slideOutTop;case"bottom":return Z.slideOutBottom;default:return Z.slideOutRight}return Z.fadeOut})();return{appearClass:n,backdropAppearClass:r,backdropDisappearClass:i,disappearClass:a}}const bc=({settings:e,content:t,styles:n,portalId:r,activeEvent:i,isEditor:a,isPreviewMode:s})=>{const[c,o]=u.useState(!1),{url:d}=e.thumbnailBlock.cover;return u.useEffect(()=>{i==="close"&&o(!1),i==="open"&&o(!0)},[i]),l.jsxs(l.Fragment,{children:[l.jsx("img",{src:d,alt:"Cover",className:Z.heroImage,onClick:()=>o(!0)}),l.jsx(xc,{isOpen:c,onClose:()=>o(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:a})]})},xc=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:i,portalId:a,isEditor:s,metadata:c})=>{var F;const[o,d]=u.useState(0),[p,T]=u.useState(0),[b,y]=u.useState(!1),[g,h]=u.useState(!1),[P,x]=u.useState({}),f=u.useRef(null),C=u.useRef(null),B=u.useRef(null),_=u.useRef(!1),E=u.useRef(null),S=u.useRef(null),A=u.useRef(null),k=u.useRef(null),I=u.useRef(!1),$=u.useRef(null),[O,V]=u.useState(!1),{appear:q,triggers:X,slider:L,thumbnail:R,controls:H,area:M,caption:W,layout:j}=i.lightboxBlock,{appearClass:Q,backdropAppearClass:oe,backdropDisappearClass:te,disappearClass:ce}=vc(q.type,q.direction),v=(c==null?void 0:c.itemId)??null;u.useEffect(()=>{const m=()=>{setTimeout(()=>{var D,U;(U=(D=f.current)==null?void 0:D.splide)==null||U.refresh()},16)},N=()=>{T(D=>D+1)};return window.addEventListener("ArticleEditor.Layout:change",m),window.addEventListener("ArticleEditor.ComponentContent:change",N),()=>{window.removeEventListener("ArticleEditor.Layout:change",m),window.removeEventListener("ArticleEditor.ComponentContent:change",N)}},[]),u.useEffect(()=>{if(!e||!R.isActive){V(!1);return}const m=$.current;if(!m)return;const N=()=>{L.direction==="horiz"?V(m.scrollWidth>m.clientWidth):V(m.scrollHeight>m.clientHeight)};N();const D=new ResizeObserver(N);return D.observe(m),()=>D.disconnect()},[e,R.isActive,n.length,P,L.direction]);const ie=u.useCallback(()=>{const m=window.matchMedia("(max-width: 768px)").matches,N=Qi(M.color);m&&!s&&N>.9&&(document.body.style.backgroundColor=""),y(!0),_.current=!0;const D=U=>{U.target===E.current&&U.animationName&&(E.current&&S.current&&E.current.removeEventListener("animationend",S.current),S.current=null,_.current&&(_.current=!1,t()),y(!1))};E.current&&(S.current=D,E.current.addEventListener("animationend",D))},[t,M.color,s]),$e=(m,N,D)=>{var U,ne;if(m){if(X.type==="click"&&X.switch==="image")X.repeat==="close"&&o===n.length-1?ie():(U=f.current)==null||U.go("+1");else if(X.type==="click"&&X.switch==="50/50"){const ee=m.getBoundingClientRect(),J=N-ee.left,ae=D-ee.top,ge=ee.width,me=ee.height;let he;L.direction==="horiz"?he=J<ge/2?"-1":"+1":he=ae<me/2?"-1":"+1",(ne=f.current)==null||ne.go(he)}}},de=m=>{if(I.current){I.current=!1;return}const N=n[o],D=(N==null?void 0:N.image.objectFit)==="cover";let U,ne;if("changedTouches"in m&&m.changedTouches.length>0)U=m.changedTouches[0].clientX,ne=m.changedTouches[0].clientY;else if("clientX"in m)U=m.clientX,ne=m.clientY;else return;let ee;if(D&&B.current){const J=Ji(B.current);ee=U>=J.left&&U<=J.right&&ne>=J.top&&ne<=J.bottom}else{const J=B.current?Zi(B.current):null;if(!J){m.target===m.currentTarget&&ie();return}ee=U>=J.x&&U<=J.x+J.width&&ne>=J.y&&ne<=J.y+J.height}ee?$e(B.current,U,ne):ie()},ye=m=>{const N=m.target;(N.classList.contains(Z.thumbsWrapper)||N.classList.contains(Z.thumbsContainer))&&de(m)};u.useEffect(()=>{if(!e)return;const m=N=>{var D,U;if(N.key==="Escape"){ie();return}if(N.key==="ArrowRight"){d(ne=>(ne+1)%Math.max(n.length,1)),(D=f.current)==null||D.go("+1");return}N.key==="ArrowLeft"&&(d(ne=>(ne-1+Math.max(n.length,1))%Math.max(n.length,1)),(U=f.current)==null||U.go("-1"))};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m)}},[e,ie,n.length]),u.useEffect(()=>{if(e){if(d(0),T(N=>N+1),_.current=!1,y(!1),h(!1),x({}),!v)return;const m=new CustomEvent("page-overlay",{detail:{itemId:v}});window.dispatchEvent(m)}return()=>{E.current&&S.current&&(E.current.removeEventListener("animationend",S.current),S.current=null),h(!1)}},[e,v]),u.useEffect(()=>{C.current!==null&&C.current!==L.type&&T(m=>m+1),C.current=L.type},[L.type]),u.useEffect(()=>{if(!e)return;const m=document.body.style.overflow,N=window.matchMedia("(max-width: 768px)").matches,D=Qi(M.color);document.body.style.overflow="hidden",h(!1);const U=ee=>{ee.target===E.current&&!_.current&&ee.animationName&&(N&&!s&&D>.9&&(document.body.style.backgroundColor=M.color),h(!0),E.current&&A.current&&E.current.removeEventListener("animationend",A.current),A.current=null)};E.current&&(A.current=U,E.current.addEventListener("animationend",U));const ne=ee=>{const J=ee.target;J&&(J.closest(`.${Z.thumbsWrapper}`)||J.closest(`.${Z.thumbsContainer}`))||L.type!=="slide"&&ee.preventDefault()};return document.addEventListener("touchmove",ne,{passive:!1}),()=>{document.body.style.overflow=m,document.removeEventListener("touchmove",ne),E.current&&A.current&&(E.current.removeEventListener("animationend",A.current),A.current=null),h(!1)}},[e,s,M.color,L.type]),u.useEffect(()=>{if(!e)return;const m=N=>{var U,ne;if(_.current){N.stopPropagation();return}if(I.current){I.current=!1;return}const D=N.target;if(!(D&&(D.closest(`.${Z.thumbsContainer}`)||D.closest(`.${Z.thumbItem}`)||D.closest(`.${Z.arrow}`)||D.closest(`.${Z.closeButton}`)||D.closest(`.${Z.caption}`)))){if(L.type==="slide"&&X.type==="drag"&&((ne=(U=f.current)==null?void 0:U.splide)!=null&&ne.root)){const ee=f.current.splide.root;if(D&&(ee.contains(D)||ee===D))return}if(N.touches.length===0&&N.changedTouches.length>0){const ee=n[o],J=(ee==null?void 0:ee.image.objectFit)==="cover",ae=N.changedTouches[0];let ge;if(J&&B.current){const me=Ji(B.current);ge=ae.clientX>=me.left&&ae.clientX<=me.right&&ae.clientY>=me.top&&ae.clientY<=me.bottom}else{const me=B.current?Zi(B.current):null;if(!me)return;ge=ae.clientX>=me.x&&ae.clientX<=me.x+me.width&&ae.clientY>=me.y&&ae.clientY<=me.y+me.height}if(!ge){N.stopPropagation(),_.current=!0;const me=he=>{he.stopPropagation(),he.preventDefault(),document.removeEventListener("click",me,!0)};document.addEventListener("click",me,!0),ie()}}}};return document.addEventListener("touchend",m,{passive:!0}),()=>{document.removeEventListener("touchend",m)}},[e,ie,o,n]);const Re=(L.type==="scale"||L.type==="fade")&&L.direction==="vert"&&X.type==="drag";u.useEffect(()=>{var he,K;if(!e||!Re||!((K=(he=f.current)==null?void 0:he.splide)!=null&&K.root))return;const m=f.current.splide.root,N=30,D=(Y,z)=>{if(k.current){const le=Math.abs(Y-k.current.x),we=Math.abs(z-k.current.y);(le>0||we>0)&&(I.current=!0)}},U=Y=>{k.current&&(Y.preventDefault(),D(Y.clientX,Y.clientY))},ne=Y=>{k.current&&Y.touches.length>0&&(Y.preventDefault(),D(Y.touches[0].clientX,Y.touches[0].clientY))},ee=(Y,z)=>{if(!k.current||!f.current){k.current=null;return}const le=Math.abs(Y-k.current.x),we=Math.abs(z-k.current.y);we>N&&we>le&&f.current.go(z<k.current.y?"+1":"-1"),k.current=null},J=Y=>{k.current&&ee(Y.clientX,Y.clientY),document.removeEventListener("pointerup",J),document.removeEventListener("pointercancel",J),document.removeEventListener("pointermove",U)},ae=Y=>{if(k.current){if(Y.changedTouches.length>0){const z=Y.changedTouches[0];ee(z.clientX,z.clientY)}document.removeEventListener("touchend",ae),document.removeEventListener("touchcancel",ae),document.removeEventListener("touchmove",ne)}},ge=Y=>{k.current={x:Y.clientX,y:Y.clientY},I.current=!1,document.addEventListener("pointermove",U,{passive:!1}),document.addEventListener("pointerup",J),document.addEventListener("pointercancel",J)},me=Y=>{Y.touches.length>0&&(k.current={x:Y.touches[0].clientX,y:Y.touches[0].clientY},I.current=!1,document.addEventListener("touchmove",ne,{passive:!1}),document.addEventListener("touchend",ae),document.addEventListener("touchcancel",ae))};return m.addEventListener("pointerdown",ge),m.addEventListener("touchstart",me),()=>{m.removeEventListener("pointerdown",ge),m.removeEventListener("touchstart",me),document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",J),document.removeEventListener("pointercancel",J),document.removeEventListener("touchmove",ne),document.removeEventListener("touchend",ae),document.removeEventListener("touchcancel",ae),k.current=null,I.current=!1}},[e,Re,p]);const re={backgroundColor:M.color,backdropFilter:`blur(${M.blur}px)`,animationDuration:`${parseInt(q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(a)?null:So.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:s?null:E,className:Le(Z.background,b?te:oe,{[Z.editor]:s},{[Z.hidden]:!e}),style:{...re,...g&&!s&&!b?{position:"absolute"}:{}}}),l.jsxs("div",{ref:s?E:null,className:Le(Z.contentStyle,b?ce:Q,{[Z.editor]:s},{[Z.hidden]:!e}),style:{animationDuration:`${parseInt(q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[l.jsx(wi,{onMove:m=>d(m.index),ref:f,className:Z.lightboxSplide,options:{arrows:!1,speed:L.duration?parseInt(L.duration):500,direction:L.direction==="horiz"||L.type==="fade"||L.type==="scale"?"ltr":"ttb",pagination:!1,drag:X.type==="drag"&&!Re,perPage:1,width:"100%",height:"100%",type:L.type==="fade"||L.type==="scale"?"fade":"loop",padding:0,rewind:X.repeat!=="close",start:0},style:{"--splide-speed":L.duration},children:n.map((m,N)=>{const D=er(j.position,j.offset,s),U=`${w.scalingValue(j.padding.top,s)} ${w.scalingValue(j.padding.right,s)} ${w.scalingValue(j.padding.bottom,s)} ${w.scalingValue(j.padding.left,s)}`,ne=L.type==="scale"?(()=>{const{transform:ee,...J}=D;return{...J,position:"absolute",padding:U,boxSizing:"border-box","--position-transform":ee||"none"}})():{...D,position:"absolute",padding:U,boxSizing:"border-box"};return l.jsx(Ti,{children:l.jsx("div",{className:Z.imgWrapper,onClick:de,children:l.jsx("img",{ref:N===o?B:null,className:Le(Z.imageStyle,{[Z.contain]:m.image.objectFit==="contain",[Z.cover]:m.image.objectFit==="cover",[Z.scaleSlide]:L.type==="scale"}),src:m.image.url,alt:m.image.name??"",style:{...ne,pointerEvents:m.image.objectFit==="contain"?"none":"auto"}})})},N)})},p),H.isActive&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:Le(Z.arrow,{[Z.arrowVertical]:L.direction==="vert"}),style:{color:H.color,"--arrow-hover-color":H.hover},children:l.jsxs("button",{className:Z.arrowInner,style:{transform:`translate(${w.scalingValue(H.offset.x,s)}, ${w.scalingValue(H.offset.y*(L.direction==="horiz"?1:-1),s)}) scale(${H.scale}) rotate(${L.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var m;return(m=f.current)==null?void 0:m.go("-1")},"aria-label":"Previous",children:[H.arrowsImgUrl&&l.jsx(Ht,{url:H.arrowsImgUrl,fill:H.color,hoverFill:H.hover,className:Le(Z.arrowImg,Z.mirror)}),!H.arrowsImgUrl&&l.jsx(eo,{color:H.color,className:Le(Z.arrowIcon,Z.arrowImg,Z.mirror)})]})}),l.jsx("div",{className:Le(Z.arrow,Z.nextArrow,{[Z.arrowVertical]:L.direction==="vert"}),style:{color:H.color,"--arrow-hover-color":H.hover},children:l.jsxs("button",{className:Z.arrowInner,style:{transform:`translate(${w.scalingValue(H.offset.x*(L.direction==="horiz"?-1:1),s)}, ${w.scalingValue(H.offset.y,s)}) scale(${H.scale}) rotate(${L.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var m;return(m=f.current)==null?void 0:m.go("+1")},"aria-label":"Next",children:[H.arrowsImgUrl&&l.jsx(Ht,{url:H.arrowsImgUrl,fill:H.color,hoverFill:H.hover,className:Z.arrowImg}),!H.arrowsImgUrl&&l.jsx(eo,{color:H.color,className:Le(Z.arrowIcon,Z.arrowImg)})]})})]}),M.closeIconUrl&&(()=>{const m=er(M.closeIconAlign,M.closeIconOffset,s),N=`scale(${M.closeIconScale})`,D=m.transform?`${m.transform} ${N}`:N;return l.jsx("button",{className:Z.closeButton,style:{...m,transform:D},onClick:ie,"aria-label":"Close lightbox",children:l.jsx(Ht,{url:M.closeIconUrl,fill:M.closeIconColor??"#000000",hoverFill:M.closeIconHover??"#cccccc"})})})(),W&&W.isActive&&r.imageCaption&&((F=n[o])==null?void 0:F.imageCaption)&&(()=>{const{widthSettings:m,fontSettings:N,letterSpacing:D,textAlign:U,wordSpacing:ne,fontSizeLineHeight:ee,textAppearance:J,color:ae}=r.imageCaption;return l.jsx("div",{className:Z.caption,style:{...er(W.alignment,W.offset,s),fontFamily:Ar(N.fontFamily),fontWeight:N.fontWeight,fontStyle:N.fontStyle,width:m.sizing==="auto"?"max-content":w.scalingValue(m.width,s),letterSpacing:w.scalingValue(D,s),wordSpacing:w.scalingValue(ne,s),textAlign:U,fontSize:w.scalingValue(ee.fontSize,s),lineHeight:w.scalingValue(ee.lineHeight,s),textTransform:J.textTransform??"none",textDecoration:J.textDecoration??"none",fontVariant:J.fontVariant??"normal",color:ae},onClick:ge=>ge.stopPropagation(),children:l.jsx("div",{"data-styles":"imageCaption",className:Z.captionTextInner,style:{"--link-color":W.linkColor,"--link-hover-color":W.linkHoverColor},children:l.jsx(Nn,{content:n[o].imageCaption})})})})(),R.isActive&&(()=>{const[m,N]=R.position.split("-"),D=L.direction==="horiz"?`${m}-left`:R.position,U=er(D,R.offset,s),ne=()=>{if(L.direction==="horiz"){if(N==="left")return"flex-start";if(N==="center")return"center";if(N==="right")return"flex-end"}else{if(m==="top")return"flex-start";if(m==="middle")return"center";if(m==="bottom")return"flex-end"}return"flex-start"};return l.jsx("div",{ref:$,className:Z.thumbsWrapper,onClick:ee=>ye(ee),style:{position:s?"absolute":"fixed",...U,...L.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:l.jsx("div",{className:Le(Z.thumbsContainer,{[Z.thumbsContainerVertical]:L.direction==="vert",[Z.thumbsAlignStart]:R.align==="start",[Z.thumbsAlignCenter]:R.align==="center",[Z.thumbsAlignEnd]:R.align==="end"}),style:{gap:w.scalingValue(R.grid.gap,s),justifyContent:O?"flex-start":ne()},children:n.map((ee,J)=>{const ae=J===o,ge=P[J],he=R.grid.size*(ae?R.activeState.scale:1),K=()=>{if(R.fit!=="fit")return{};if(!ge)return L.direction==="horiz"?{height:w.scalingValue(he,s)}:{width:w.scalingValue(he,s)};const Y=ge.width/ge.height;if(L.direction==="horiz"){const z=he,le=z*Y;return{width:w.scalingValue(le,s),height:w.scalingValue(z,s)}}else{const z=he,le=z/Y;return{width:w.scalingValue(z,s),height:w.scalingValue(le,s)}}};return l.jsx("button",{className:Z.thumbItem,style:{...L.direction==="horiz"&&R.fit!=="fit"?{height:w.scalingValue(he,s)}:{},...L.direction==="vert"&&R.fit!=="fit"?{width:w.scalingValue(he,s)}:{},...R.fit==="cover"?{width:w.scalingValue(he,s),height:w.scalingValue(he,s)}:{},...K(),transition:ae?"all 0.25s ease-out":"none",opacity:ae?R.activeState.opacity/100:R.opacity/100,"--thumb-hover":R.activeState.opacity/100},onClick:Y=>{var z;Y.stopPropagation(),d(J),(z=f.current)==null||z.go(J)},onMouseEnter:()=>{var Y;R.triggers==="hov"&&((Y=f.current)==null||Y.go(J))},children:l.jsx("img",{src:ee.image.url,alt:ee.image.name??"",onLoad:Y=>{const z=Y.currentTarget;z.naturalWidth&&z.naturalHeight&&x(le=>({...le,[J]:{width:z.naturalWidth,height:z.naturalHeight}}))},style:{objectFit:R.fit==="cover"?"cover":"contain",...R.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...R.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ee.image.name}-${J}`)})})})})()]})]}),document.getElementById(a))};function eo({color:e,className:t}){return l.jsx("svg",{viewBox:"0 0 10 18",className:t,children:l.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:l.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 Cc={element:bc,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 tr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Sc(e){return`
|
|
6
|
+
*/const fl="RichTextRenderer-module__link___BWeZ2",yl={link:fl},vl=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(r=>/^\d/.test(r))},Ar=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>vl(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function Ct(e){const{color:t,...n}=e;return n}function nt(e,t){var i,a,s;const{fontSize:n,lineHeight:r}=e;return{fontFamily:Ar(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:$.scalingValue(e.letterSpacing,t),wordSpacing:$.scalingValue(e.wordSpacing,t),fontSize:$.scalingValue(n,t),lineHeight:r!==void 0?$.scalingValue(r,t):void 0,textTransform:(i=e.textAppearance)==null?void 0:i.textTransform,textDecoration:(a=e.textAppearance)==null?void 0:a.textDecoration,fontVariant:(s=e.textAppearance)==null?void 0:s.fontVariant,textAlign:e.textAlign,color:e.color}}const Nn=({content:e})=>{const t=n=>n.map((r,i)=>r.type==="link"?l.jsx("a",{className:yl.link,href:r.value,target:r.target,children:t(r.children)},i):l.jsx("span",{style:bl(r),children:r.text},i));return l.jsx(l.Fragment,{children:e.map((n,r)=>{const i=n.children;return l.jsx("div",{children:t(i)},r)})})};function bl(e){return{...e.fontFamily&&{fontFamily:Ar(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 xl="SvgImage-module__svg___q3xE-",Cl="SvgImage-module__img___VsTm-",Gi={svg:xl,img:Cl},Sl=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},$l=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,Ht=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r="",style:i})=>{const[a,s]=u.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return u.useEffect(()=>{if(typeof window<"u"&&window.CSS){const c=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');s(c)}},[]),!Sl(e)||!a?l.jsx("img",{src:e,alt:"",className:Le(Gi.img,r),style:i}):l.jsx("span",{"data-supports-mask":a,className:Le(Gi.svg,r),style:{"--svg":$l(e),"--fill":t,"--hover-fill":n,...i??{}}})},wl={"top-left":se.topLeftAlignment,"top-center":se.topCenterAlignment,"top-right":se.topRightAlignment,"middle-left":se.middleLeftAlignment,"middle-center":se.middleCenterAlignment,"middle-right":se.middleRightAlignment,"bottom-left":se.bottomLeftAlignment,"bottom-center":se.bottomCenterAlignment,"bottom-right":se.bottomRightAlignment};function Tl({settings:e,content:t,styles:n,isEditor:r}){const[i,a]=u.useState(null),{widthSettings:s,fontSettings:c,letterSpacing:o,textAlign:p,wordSpacing:d,fontSizeLineHeight:T,textAppearance:b,color:y}=n.imageCaption,[g,m]=u.useState(void 0),[L,w]=u.useState(null),[f,S]=u.useState(0),[M,_]=u.useState(0),{direction:A,transition:x,controls:P,pagination:k,imageCaption:E,triggers:R}=e,B=u.useRef(x.type),{x:V,y:U}=e.controls.offset,J=v=>{i&&i.go(v)};return u.useEffect(()=>{if(!L)return;const v=new ResizeObserver(W=>{if(!i)return;const[H]=W;m({width:Math.round(H.contentRect.width),height:Math.round(H.contentRect.height)})});return v.observe(L),()=>v.unobserve(L)},[L]),u.useEffect(()=>{!i||B.current===x.type||(_(v=>v+1),B.current=x.type)},[x.type]),l.jsx("div",{className:Le(se.wrapper,{[se.editor]:r}),ref:w,children:l.jsxs("div",{className:se.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:x.backgroundColor&&x.type==="fade in"?x.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&l.jsx("div",{className:Le(se.captionBlock),children:l.jsx("div",{className:se.captionTextWrapper,children:t.map((v,W)=>l.jsx("div",{className:Le(se.captionText,wl[E.alignment],{[se.withPointerEvents]:W===f&&r,[se.active]:W===f}),style:{fontFamily:Ar(c.fontFamily),fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:s.sizing==="auto"?"max-content":$.scalingValue(s.width,r),letterSpacing:$.scalingValue(o,r),wordSpacing:$.scalingValue(d,r),textAlign:p,fontSize:$.scalingValue(T.fontSize,r),lineHeight:$.scalingValue(T.lineHeight,r),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:y,transitionDuration:x.duration?`${Math.round(parseInt(x.duration)/2)}ms`:"500ms"},children:l.jsx("div",{"data-styles":"imageCaption",className:se.captionTextInner,style:{"--link-hover-color":E.linkHoverColor,"--link-color":E.linkColor,position:"relative",top:$.scalingValue(E.offset.y,r),left:$.scalingValue(E.offset.x,r)},children:l.jsx(Nn,{content:v.imageCaption})})},W))})}),l.jsx(wi,{onMove:v=>{S(v.index)},ref:a,options:{arrows:!1,speed:x.duration?parseInt(x.duration):500,autoplay:R.autoPlay!==null,...R.autoPlay!==null&&{interval:parseInt(R.autoPlay)*1e3},direction:A==="horiz"||x.type==="fade in"?"ltr":"ttb",pagination:!1,drag:R.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:x.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((v,W)=>l.jsx(Ti,{children:l.jsx("div",{className:se.sliderItem,children:l.jsx("div",{className:se.imgWrapper,children:l.jsx("img",{className:Le(se.sliderImage,{[se.contain]:v.image.objectFit==="contain",[se.cover]:v.image.objectFit==="cover"}),src:v.image.url,alt:v.image.name??""})})})},W))},M),P.isActive&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:Le(se.arrow,{[se.arrowVertical]:A==="vert",[se.hoverArrow]:P.show==="on hover"}),style:{color:P.color,"--arrow-hover-color":P.hover},children:l.jsxs("button",{onClick:()=>{J("-1")},className:se.arrowInner,style:{transform:`translate(${$.scalingValue(V,r)}, ${$.scalingValue(U*(A==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${A==="horiz"?"0deg":"90deg"})`},children:[P.arrowsImgUrl&&l.jsx(Ht,{url:P.arrowsImgUrl,fill:P.color,hoverFill:P.hover,className:Le(se.arrowImg,se.mirror)}),!P.arrowsImgUrl&&l.jsx(Yi,{color:P.color,className:Le(se.arrowIcon,se.arrowImg,se.mirror)})]})}),l.jsx("div",{className:Le(se.arrow,se.nextArrow,{[se.arrowVertical]:A==="vert",[se.hoverArrow]:P.show==="on hover"}),style:{color:P.color,"--arrow-hover-color":P.hover},children:l.jsxs("button",{className:se.arrowInner,onClick:()=>J("+1"),style:{transform:`translate(${$.scalingValue(V*(A==="horiz"?-1:1),r)}, ${$.scalingValue(U,r)}) scale(${e.controls.scale/100}) rotate(${A==="horiz"?"0deg":"90deg"})`},children:[P.arrowsImgUrl&&l.jsx(Ht,{url:P.arrowsImgUrl,fill:P.color,hoverFill:P.hover,className:se.arrowImg}),!P.arrowsImgUrl&&l.jsx(Yi,{color:P.color,className:Le(se.arrowIcon,se.arrowImg)})]})})]}),R.triggersList.click&&l.jsx("div",{className:se.clickOverlay,onClick:()=>{i&&i.go("+1")}}),k.isActive&&l.jsx("div",{className:Le(se.pagination,{[se.paginationInsideBottom]:k.position==="inside-1"&&A==="horiz",[se.paginationInsideTop]:k.position==="inside-2"&&A==="horiz",[se.paginationOutsideBottom]:k.position==="outside-1"&&A==="horiz",[se.paginationOutsideTop]:k.position==="outside-2"&&A==="horiz",[se.paginationInsideLeft]:k.position==="inside-1"&&A==="vert",[se.paginationInsideRight]:k.position==="inside-2"&&A==="vert",[se.paginationOutsideLeft]:k.position==="outside-1"&&A==="vert",[se.paginationOutsideRight]:k.position==="outside-2"&&A==="vert",[se.paginationVertical]:A==="vert"}),children:l.jsx("div",{className:se.paginationInner,style:{backgroundColor:k.colors[2],transform:`scale(${k.scale/100}) translate(${$.scalingValue(k.offset.x,r)}, ${$.scalingValue(k.offset.y,r)}) rotate(${A==="horiz"?"0deg":"90deg"})`},children:t.map((v,W)=>l.jsx("button",{onClick:()=>{i&&i.go(W)},className:Le(se.paginationItem),children:l.jsx("div",{className:Le(se.dot,{[se.activeDot]:W===f}),style:{backgroundColor:W===f?k.colors[0]:k.colors[1],"--pagination-hover-color":k.hover}})},W))})})]})})}function Yi({color:e,className:t}){return l.jsx("svg",{viewBox:"0 0 10 18",className:t,children:l.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:l.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 Ll={element:Tl,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"]}},El="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Pl="ImageRevealSlider-module__image___Qjt-e",_l="ImageRevealSlider-module__link___N-iLG",Al="ImageRevealSlider-module__cursor___2U03d",sn={imageRevealSlider:El,image:Pl,link:_l,cursor:Al};function Xi(e,t,n){for(const r of n){const i=new Image;i.src=r.url;const a=r.width?Number.parseFloat(r.width):i.naturalWidth,s=i.naturalHeight/i.naturalWidth*a,c=a/2,o=s/2;if(e>=r.x-c&&e<=r.x+c&&t>=r.y-o&&t<=r.y+o)return!0}return!1}function Br(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Rl(e,t,n,r){let i,a;if(t==="custom"){i=n;const s=await Br(e);a=s.height/s.width*i}else if(t==="random"){i=Math.random()*(r.max-r.min)+r.min;const s=await Br(e);a=s.height/s.width*i}else{const s=await Br(e);i=s.width,a=s.height}return{width:i,height:a,finalWidth:`${i}px`}}function Il({settings:e,content:t,isEditor:n}){const[r,i]=u.useState(null),[a,s]=u.useState([]),[c,o]=u.useState(0),p=u.useRef(0),[d,T]=u.useState({x:0,y:0}),[b,y]=u.useState(1),[g,m]=u.useState("none"),L=u.useRef({x:0,y:0}),[w,f]=u.useState(!1),{sizeType:S,imageWidth:M,randomRangeImageWidth:_}=e.imageSize,{revealPosition:A,visible:x}=e.position,{cursorType:P,target:k,defaultCursorScale:E,defaultCursor:R,hoverCursorScale:B,hoverCursor:V}=e.cursor;u.useEffect(()=>{if(!r)return;const v=(F,I)=>{const K=r.getBoundingClientRect(),X=F-K.left,re=I-K.top;if(T({x:X,y:re}),P==="system"){m("none"),y(1);return}const Z=X,pe=re,C=document.elementFromPoint(K.left+Z,K.top+pe);if(C&&C.closest("a")){m("none"),y(1);return}const ie=Xi(Z,pe,a)||k==="area"?{img:V??"none",scale:B}:{img:R??"none",scale:E};m(ie.img),y(ie.scale)},W=F=>{F.stopPropagation(),L.current={x:F.clientX,y:F.clientY},v(F.clientX,F.clientY)},H=()=>{w&&v(L.current.x,L.current.y)};return r.addEventListener("mousemove",W),window.addEventListener("scroll",H,!0),()=>{r.removeEventListener("mousemove",W),window.removeEventListener("scroll",H,!0)}},[r,w,d,P,k,V,R,B,E,a]),u.useEffect(()=>{w||(m("none"),y(0))},[w]);const U=async(v,W,H,F={})=>{const{width:I,height:K,finalWidth:X}=await Rl(v.image.url,S,M,_);let re=0,Z=0;A==="same"?(re=W/2,Z=H/2):(re=F.x??Math.random()*W,Z=F.y??Math.random()*H);const pe=Math.min(Math.max(re,I/2),W-I/2),C=Math.min(Math.max(Z,K/2),H-K/2);return{id:p.current++,url:v.image.url,link:v.link,name:v.image.name,x:pe,y:C,width:X}};u.useEffect(()=>{if(!r||t.length===0)return;const v=r.getBoundingClientRect(),W=v.width,H=v.height,F=[];(async()=>{const K=t[0],X=await U(K,W,H);F.push(X),s(F),o(1)})()},[S,M,_,A,r]),u.useEffect(()=>{x==="last One"&&s(v=>v.length>0?[v[v.length-1]]:[])},[x]);const J=async v=>{if(!r)return;const W=r.getBoundingClientRect(),H=v.clientX-W.left,F=v.clientY-W.top;if(k==="image"&&!Xi(H,F,a))return;let I=0,K=0;A==="on Click"?(I=H,K=F):A==="same"?(I=W.width/2,K=W.height/2):(I=Math.random()*W.width,K=Math.random()*W.height);const X=t[c],re=await U(X,W.width,W.height,{x:I,y:K});s(Z=>x==="all"?[...Z,re]:[re]),o(Z=>Z>=t.length-1?0:Z+1)};return l.jsxs("div",{ref:i,onClick:J,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:sn.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[a.map(v=>l.jsx("div",{className:sn.wrapper,style:{top:`${v.y}px`,left:`${v.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:v.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:k==="area"&&v.link?l.jsx("a",{href:v.link,target:"_blank",className:sn.link,children:l.jsx("img",{src:v.url,alt:v.name,className:sn.image},v.id)}):l.jsx("img",{src:v.url,alt:v.name,className:sn.image},v.id)},v.id)),w&&l.jsx("div",{className:sn.cursor,style:{left:`${d.x}px`,top:`${d.y}px`,transform:`translate(-50%, -50%) scale(${b})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const kl={element:Il,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:""}]}}}},Wl="LightBox-module__hidden___9s-9x",Ml="LightBox-module__heroImage___sTxNF",Fl="LightBox-module__background___rm9ml",Nl="LightBox-module__editor___4ACaY",Hl="LightBox-module__contentStyle___Bgnsq",Bl="LightBox-module__imageStyle___tLIlB",Ol="LightBox-module__imgWrapper___LuFUp",Vl="LightBox-module__contain___8-yaS",Dl="LightBox-module__cover___hNvOG",jl="LightBox-module__caption___b6L2I",zl="LightBox-module__captionTextInner___rCGNH",Kl="LightBox-module__lightboxSplide___XFuWC",ql="LightBox-module__arrow___iz38X",Ul="LightBox-module__arrowVertical___Zfz81",Gl="LightBox-module__nextArrow___zkAQN",Yl="LightBox-module__arrowInner___p48sW",Xl="LightBox-module__arrowIcon___3VaFf",Zl="LightBox-module__arrowImg___pNV88",Jl="LightBox-module__mirror___pjeXc",Ql="LightBox-module__thumbsWrapper___GB-nU",ec="LightBox-module__thumbsContainerVertical___wttk5",tc="LightBox-module__thumbsContainer___osSma",nc="LightBox-module__thumbsAlignStart___MO6tY",rc="LightBox-module__thumbsAlignCenter___Q4sUx",ic="LightBox-module__thumbsAlignEnd___p4y9R",oc="LightBox-module__thumbItem___HvnF3",ac="LightBox-module__closeButton___g2khP",sc="LightBox-module__fadeIn___0m5GW",lc="LightBox-module__slideInLeft___gPYwC",cc="LightBox-module__slideInRight___S-pPp",dc="LightBox-module__slideInTop___DFdAj",uc="LightBox-module__slideInBottom___m27kZ",pc="LightBox-module__fadeOut___55qBR",mc="LightBox-module__slideOutLeft___NvU7P",gc="LightBox-module__slideOutRight___SK7eC",hc="LightBox-module__slideOutTop___Vgg0z",fc="LightBox-module__slideOutBottom___nJ0Ef",yc="LightBox-module__scaleSlide___vZriG",Y={hidden:Wl,heroImage:Ml,background:Fl,editor:Nl,contentStyle:Hl,imageStyle:Bl,imgWrapper:Ol,contain:Vl,cover:Dl,caption:jl,captionTextInner:zl,lightboxSplide:Kl,arrow:ql,arrowVertical:Ul,nextArrow:Gl,arrowInner:Yl,arrowIcon:Xl,arrowImg:Zl,mirror:Jl,thumbsWrapper:Ql,thumbsContainerVertical:ec,thumbsContainer:tc,thumbsAlignStart:nc,thumbsAlignCenter:rc,thumbsAlignEnd:ic,thumbItem:oc,closeButton:ac,fadeIn:sc,slideInLeft:lc,slideInRight:cc,slideInTop:dc,slideInBottom:uc,fadeOut:pc,slideOutLeft:mc,slideOutRight:gc,slideOutTop:hc,slideOutBottom:fc,scaleSlide:yc},er=(e,t,n)=>{const r={},[i,a]=e.split("-");return i==="top"?(r.top="0",r.bottom="auto"):i==="middle"?(r.top="50%",r.bottom="auto"):i==="bottom"&&(r.top="auto",r.bottom="0"),a==="left"?(r.left="0",r.right="auto"):a==="center"?(r.left="50%",r.right="auto"):a==="right"&&(r.left="auto",r.right="0"),i==="middle"&&a==="center"?r.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), calc(-50% + ${$.scalingValue(t.y,n)}))`:i==="middle"?r.transform=`translate(${$.scalingValue(t.x,n)}, calc(-50% + ${$.scalingValue(t.y,n)}))`:a==="center"?r.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), ${$.scalingValue(t.y,n)})`:r.transform=`translate(${$.scalingValue(t.x,n)}, ${$.scalingValue(t.y,n)})`,r};function oa(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 Zi(e){const t=e.getBoundingClientRect(),n=oa(e),r=Math.max(0,t.width-n.left-n.right),i=Math.max(0,t.height-n.top-n.bottom),a=e.naturalWidth,s=e.naturalHeight,c=r/i,o=a/s;let p,d;o>c?(p=r,d=r/o):(d=i,p=i*o);const T=t.left+n.left,b=t.top+n.top,y=(r-p)/2+T,g=(i-d)/2+b;return{x:y,y:g,width:p,height:d}}function Ji(e){const t=e.getBoundingClientRect(),n=oa(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Qi(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const r=t[1].split(",").map(i=>parseFloat(i.trim()));return r.length===4?r[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const r=n[1].substring(6,8);return parseInt(r,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function vc(e,t){const n=(()=>{if(e==="fade in")return Y.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Y.slideInLeft;case"right":return Y.slideInRight;case"top":return Y.slideInTop;case"bottom":return Y.slideInBottom;default:return Y.slideInRight}return Y.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return Y.fadeIn;if(e==="slide in")switch(t){case"left":return Y.slideInLeft;case"right":return Y.slideInRight;case"top":return Y.slideInTop;case"bottom":return Y.slideInBottom;default:return Y.slideInRight}return Y.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Y.fadeOut;if(e==="slide in")switch(t){case"left":return Y.slideOutLeft;case"right":return Y.slideOutRight;case"top":return Y.slideOutTop;case"bottom":return Y.slideOutBottom;default:return Y.slideOutRight}return Y.fadeOut})(),a=(()=>{if(e==="fade in")return Y.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Y.slideOutLeft;case"right":return Y.slideOutRight;case"top":return Y.slideOutTop;case"bottom":return Y.slideOutBottom;default:return Y.slideOutRight}return Y.fadeOut})();return{appearClass:n,backdropAppearClass:r,backdropDisappearClass:i,disappearClass:a}}const bc=({settings:e,content:t,styles:n,portalId:r,activeEvent:i,isEditor:a,isPreviewMode:s})=>{const[c,o]=u.useState(!1),{url:p}=e.thumbnailBlock.cover;return u.useEffect(()=>{i==="close"&&o(!1),i==="open"&&o(!0)},[i]),l.jsxs(l.Fragment,{children:[l.jsx("img",{src:p,alt:"Cover",className:Y.heroImage,onClick:()=>o(!0)}),l.jsx(xc,{isOpen:c,onClose:()=>o(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:a})]})},xc=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:i,portalId:a,isEditor:s,metadata:c})=>{var j;const[o,p]=u.useState(0),[d,T]=u.useState(0),[b,y]=u.useState(!1),[g,m]=u.useState(!1),[L,w]=u.useState({}),f=u.useRef(null),S=u.useRef(null),M=u.useRef(null),_=u.useRef(!1),A=u.useRef(null),x=u.useRef(null),P=u.useRef(null),k=u.useRef(null),E=u.useRef(!1),R=u.useRef(null),[B,V]=u.useState(!1),{appear:U,triggers:J,slider:v,thumbnail:W,controls:H,area:F,caption:I,layout:K}=i.lightboxBlock,{appearClass:X,backdropAppearClass:re,backdropDisappearClass:Z,disappearClass:pe}=vc(U.type,U.direction),C=(c==null?void 0:c.itemId)??null;u.useEffect(()=>{const h=()=>{setTimeout(()=>{var O,G;(G=(O=f.current)==null?void 0:O.splide)==null||G.refresh()},16)},N=()=>{T(O=>O+1)};return window.addEventListener("ArticleEditor.Layout:change",h),window.addEventListener("ArticleEditor.ComponentContent:change",N),()=>{window.removeEventListener("ArticleEditor.Layout:change",h),window.removeEventListener("ArticleEditor.ComponentContent:change",N)}},[]),u.useEffect(()=>{if(!e||!W.isActive){V(!1);return}const h=R.current;if(!h)return;const N=()=>{v.direction==="horiz"?V(h.scrollWidth>h.clientWidth):V(h.scrollHeight>h.clientHeight)};N();const O=new ResizeObserver(N);return O.observe(h),()=>O.disconnect()},[e,W.isActive,n.length,L,v.direction]);const ie=u.useCallback(()=>{const h=window.matchMedia("(max-width: 768px)").matches,N=Qi(F.color);h&&!s&&N>.9&&(document.body.style.backgroundColor=""),y(!0),_.current=!0;const O=G=>{G.target===A.current&&G.animationName&&(A.current&&x.current&&A.current.removeEventListener("animationend",x.current),x.current=null,_.current&&(_.current=!1,t()),y(!1))};A.current&&(x.current=O,A.current.addEventListener("animationend",O))},[t,F.color,s]),Se=(h,N,O)=>{var G,oe;if(h){if(J.type==="click"&&J.switch==="image")J.repeat==="close"&&o===n.length-1?ie():(G=f.current)==null||G.go("+1");else if(J.type==="click"&&J.switch==="50/50"){const te=h.getBoundingClientRect(),Q=N-te.left,le=O-te.top,ge=te.width,he=te.height;let z;v.direction==="horiz"?z=Q<ge/2?"-1":"+1":z=le<he/2?"-1":"+1",(oe=f.current)==null||oe.go(z)}}},ue=h=>{if(E.current){E.current=!1;return}const N=n[o],O=(N==null?void 0:N.image.objectFit)==="cover";let G,oe;if("changedTouches"in h&&h.changedTouches.length>0)G=h.changedTouches[0].clientX,oe=h.changedTouches[0].clientY;else if("clientX"in h)G=h.clientX,oe=h.clientY;else return;let te;if(O&&M.current){const Q=Ji(M.current);te=G>=Q.left&&G<=Q.right&&oe>=Q.top&&oe<=Q.bottom}else{const Q=M.current?Zi(M.current):null;if(!Q){h.target===h.currentTarget&&ie();return}te=G>=Q.x&&G<=Q.x+Q.width&&oe>=Q.y&&oe<=Q.y+Q.height}te?Se(M.current,G,oe):ie()},ye=h=>{const N=h.target;(N.classList.contains(Y.thumbsWrapper)||N.classList.contains(Y.thumbsContainer))&&ue(h)};u.useEffect(()=>{if(!e)return;const h=N=>{var O,G;if(N.key==="Escape"){ie();return}if(N.key==="ArrowRight"){p(oe=>(oe+1)%Math.max(n.length,1)),(O=f.current)==null||O.go("+1");return}N.key==="ArrowLeft"&&(p(oe=>(oe-1+Math.max(n.length,1))%Math.max(n.length,1)),(G=f.current)==null||G.go("-1"))};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[e,ie,n.length]),u.useEffect(()=>{if(e){if(p(0),T(N=>N+1),_.current=!1,y(!1),m(!1),w({}),!C)return;const h=new CustomEvent("page-overlay",{detail:{itemId:C}});window.dispatchEvent(h)}return()=>{A.current&&x.current&&(A.current.removeEventListener("animationend",x.current),x.current=null),m(!1)}},[e,C]),u.useEffect(()=>{S.current!==null&&S.current!==v.type&&T(h=>h+1),S.current=v.type},[v.type]),u.useEffect(()=>{if(!e)return;const h=document.body.style.overflow,N=window.matchMedia("(max-width: 768px)").matches,O=Qi(F.color);document.body.style.overflow="hidden",m(!1);const G=te=>{te.target===A.current&&!_.current&&te.animationName&&(N&&!s&&O>.9&&(document.body.style.backgroundColor=F.color),m(!0),A.current&&P.current&&A.current.removeEventListener("animationend",P.current),P.current=null)};A.current&&(P.current=G,A.current.addEventListener("animationend",G));const oe=te=>{const Q=te.target;Q&&(Q.closest(`.${Y.thumbsWrapper}`)||Q.closest(`.${Y.thumbsContainer}`))||v.type!=="slide"&&te.preventDefault()};return document.addEventListener("touchmove",oe,{passive:!1}),()=>{document.body.style.overflow=h,document.removeEventListener("touchmove",oe),A.current&&P.current&&(A.current.removeEventListener("animationend",P.current),P.current=null),m(!1)}},[e,s,F.color,v.type]),u.useEffect(()=>{if(!e)return;const h=N=>{var G,oe;if(_.current){N.stopPropagation();return}if(E.current){E.current=!1;return}const O=N.target;if(!(O&&(O.closest(`.${Y.thumbsContainer}`)||O.closest(`.${Y.thumbItem}`)||O.closest(`.${Y.arrow}`)||O.closest(`.${Y.closeButton}`)||O.closest(`.${Y.caption}`)))){if(v.type==="slide"&&J.type==="drag"&&((oe=(G=f.current)==null?void 0:G.splide)!=null&&oe.root)){const te=f.current.splide.root;if(O&&(te.contains(O)||te===O))return}if(N.touches.length===0&&N.changedTouches.length>0){const te=n[o],Q=(te==null?void 0:te.image.objectFit)==="cover",le=N.changedTouches[0];let ge;if(Q&&M.current){const he=Ji(M.current);ge=le.clientX>=he.left&&le.clientX<=he.right&&le.clientY>=he.top&&le.clientY<=he.bottom}else{const he=M.current?Zi(M.current):null;if(!he)return;ge=le.clientX>=he.x&&le.clientX<=he.x+he.width&&le.clientY>=he.y&&le.clientY<=he.y+he.height}if(!ge){N.stopPropagation(),_.current=!0;const he=z=>{z.stopPropagation(),z.preventDefault(),document.removeEventListener("click",he,!0)};document.addEventListener("click",he,!0),ie()}}}};return document.addEventListener("touchend",h,{passive:!0}),()=>{document.removeEventListener("touchend",h)}},[e,ie,o,n]);const ne=(v.type==="scale"||v.type==="fade")&&v.direction==="vert"&&J.type==="drag";u.useEffect(()=>{var z,ae;if(!e||!ne||!((ae=(z=f.current)==null?void 0:z.splide)!=null&&ae.root))return;const h=f.current.splide.root,N=30,O=(D,ee)=>{if(k.current){const xe=Math.abs(D-k.current.x),Ee=Math.abs(ee-k.current.y);(xe>0||Ee>0)&&(E.current=!0)}},G=D=>{k.current&&(D.preventDefault(),O(D.clientX,D.clientY))},oe=D=>{k.current&&D.touches.length>0&&(D.preventDefault(),O(D.touches[0].clientX,D.touches[0].clientY))},te=(D,ee)=>{if(!k.current||!f.current){k.current=null;return}const xe=Math.abs(D-k.current.x),Ee=Math.abs(ee-k.current.y);Ee>N&&Ee>xe&&f.current.go(ee<k.current.y?"+1":"-1"),k.current=null},Q=D=>{k.current&&te(D.clientX,D.clientY),document.removeEventListener("pointerup",Q),document.removeEventListener("pointercancel",Q),document.removeEventListener("pointermove",G)},le=D=>{if(k.current){if(D.changedTouches.length>0){const ee=D.changedTouches[0];te(ee.clientX,ee.clientY)}document.removeEventListener("touchend",le),document.removeEventListener("touchcancel",le),document.removeEventListener("touchmove",oe)}},ge=D=>{k.current={x:D.clientX,y:D.clientY},E.current=!1,document.addEventListener("pointermove",G,{passive:!1}),document.addEventListener("pointerup",Q),document.addEventListener("pointercancel",Q)},he=D=>{D.touches.length>0&&(k.current={x:D.touches[0].clientX,y:D.touches[0].clientY},E.current=!1,document.addEventListener("touchmove",oe,{passive:!1}),document.addEventListener("touchend",le),document.addEventListener("touchcancel",le))};return h.addEventListener("pointerdown",ge),h.addEventListener("touchstart",he),()=>{h.removeEventListener("pointerdown",ge),h.removeEventListener("touchstart",he),document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",Q),document.removeEventListener("pointercancel",Q),document.removeEventListener("touchmove",oe),document.removeEventListener("touchend",le),document.removeEventListener("touchcancel",le),k.current=null,E.current=!1}},[e,ne,d]);const ce={backgroundColor:F.color,backdropFilter:`blur(${F.blur}px)`,animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(a)?null:So.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:s?null:A,className:Le(Y.background,b?Z:re,{[Y.editor]:s},{[Y.hidden]:!e}),style:{...ce,...g&&!s&&!b?{position:"absolute"}:{}}}),l.jsxs("div",{ref:s?A:null,className:Le(Y.contentStyle,b?pe:X,{[Y.editor]:s},{[Y.hidden]:!e}),style:{animationDuration:`${parseInt(U.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[l.jsx(wi,{onMove:h=>p(h.index),ref:f,className:Y.lightboxSplide,options:{arrows:!1,speed:v.duration?parseInt(v.duration):500,direction:v.direction==="horiz"||v.type==="fade"||v.type==="scale"?"ltr":"ttb",pagination:!1,drag:J.type==="drag"&&!ne,perPage:1,width:"100%",height:"100%",type:v.type==="fade"||v.type==="scale"?"fade":"loop",padding:0,rewind:J.repeat!=="close",start:0},style:{"--splide-speed":v.duration},children:n.map((h,N)=>{const O=er(K.position,K.offset,s),G=`${$.scalingValue(K.padding.top,s)} ${$.scalingValue(K.padding.right,s)} ${$.scalingValue(K.padding.bottom,s)} ${$.scalingValue(K.padding.left,s)}`,oe=v.type==="scale"?(()=>{const{transform:te,...Q}=O;return{...Q,position:"absolute",padding:G,boxSizing:"border-box","--position-transform":te||"none"}})():{...O,position:"absolute",padding:G,boxSizing:"border-box"};return l.jsx(Ti,{children:l.jsx("div",{className:Y.imgWrapper,onClick:ue,children:l.jsx("img",{ref:N===o?M:null,className:Le(Y.imageStyle,{[Y.contain]:h.image.objectFit==="contain",[Y.cover]:h.image.objectFit==="cover",[Y.scaleSlide]:v.type==="scale"}),src:h.image.url,alt:h.image.name??"",style:{...oe,pointerEvents:h.image.objectFit==="contain"?"none":"auto"}})})},N)})},d),H.isActive&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:Le(Y.arrow,{[Y.arrowVertical]:v.direction==="vert"}),style:{color:H.color,"--arrow-hover-color":H.hover},children:l.jsxs("button",{className:Y.arrowInner,style:{transform:`translate(${$.scalingValue(H.offset.x,s)}, ${$.scalingValue(H.offset.y*(v.direction==="horiz"?1:-1),s)}) scale(${H.scale}) rotate(${v.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=f.current)==null?void 0:h.go("-1")},"aria-label":"Previous",children:[H.arrowsImgUrl&&l.jsx(Ht,{url:H.arrowsImgUrl,fill:H.color,hoverFill:H.hover,className:Le(Y.arrowImg,Y.mirror)}),!H.arrowsImgUrl&&l.jsx(eo,{color:H.color,className:Le(Y.arrowIcon,Y.arrowImg,Y.mirror)})]})}),l.jsx("div",{className:Le(Y.arrow,Y.nextArrow,{[Y.arrowVertical]:v.direction==="vert"}),style:{color:H.color,"--arrow-hover-color":H.hover},children:l.jsxs("button",{className:Y.arrowInner,style:{transform:`translate(${$.scalingValue(H.offset.x*(v.direction==="horiz"?-1:1),s)}, ${$.scalingValue(H.offset.y,s)}) scale(${H.scale}) rotate(${v.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=f.current)==null?void 0:h.go("+1")},"aria-label":"Next",children:[H.arrowsImgUrl&&l.jsx(Ht,{url:H.arrowsImgUrl,fill:H.color,hoverFill:H.hover,className:Y.arrowImg}),!H.arrowsImgUrl&&l.jsx(eo,{color:H.color,className:Le(Y.arrowIcon,Y.arrowImg)})]})})]}),F.closeIconUrl&&(()=>{const h=er(F.closeIconAlign,F.closeIconOffset,s),N=`scale(${F.closeIconScale})`,O=h.transform?`${h.transform} ${N}`:N;return l.jsx("button",{className:Y.closeButton,style:{...h,transform:O},onClick:ie,"aria-label":"Close lightbox",children:l.jsx(Ht,{url:F.closeIconUrl,fill:F.closeIconColor??"#000000",hoverFill:F.closeIconHover??"#cccccc"})})})(),I&&I.isActive&&r.imageCaption&&((j=n[o])==null?void 0:j.imageCaption)&&(()=>{const{widthSettings:h,fontSettings:N,letterSpacing:O,textAlign:G,wordSpacing:oe,fontSizeLineHeight:te,textAppearance:Q,color:le}=r.imageCaption;return l.jsx("div",{className:Y.caption,style:{...er(I.alignment,I.offset,s),fontFamily:Ar(N.fontFamily),fontWeight:N.fontWeight,fontStyle:N.fontStyle,width:h.sizing==="auto"?"max-content":$.scalingValue(h.width,s),letterSpacing:$.scalingValue(O,s),wordSpacing:$.scalingValue(oe,s),textAlign:G,fontSize:$.scalingValue(te.fontSize,s),lineHeight:$.scalingValue(te.lineHeight,s),textTransform:Q.textTransform??"none",textDecoration:Q.textDecoration??"none",fontVariant:Q.fontVariant??"normal",color:le},onClick:ge=>ge.stopPropagation(),children:l.jsx("div",{"data-styles":"imageCaption",className:Y.captionTextInner,style:{"--link-color":I.linkColor,"--link-hover-color":I.linkHoverColor},children:l.jsx(Nn,{content:n[o].imageCaption})})})})(),W.isActive&&(()=>{const[h,N]=W.position.split("-"),O=v.direction==="horiz"?`${h}-left`:W.position,G=er(O,W.offset,s),oe=()=>{if(v.direction==="horiz"){if(N==="left")return"flex-start";if(N==="center")return"center";if(N==="right")return"flex-end"}else{if(h==="top")return"flex-start";if(h==="middle")return"center";if(h==="bottom")return"flex-end"}return"flex-start"};return l.jsx("div",{ref:R,className:Y.thumbsWrapper,onClick:te=>ye(te),style:{position:s?"absolute":"fixed",...G,...v.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:l.jsx("div",{className:Le(Y.thumbsContainer,{[Y.thumbsContainerVertical]:v.direction==="vert",[Y.thumbsAlignStart]:W.align==="start",[Y.thumbsAlignCenter]:W.align==="center",[Y.thumbsAlignEnd]:W.align==="end"}),style:{gap:$.scalingValue(W.grid.gap,s),justifyContent:B?"flex-start":oe()},children:n.map((te,Q)=>{const le=Q===o,ge=L[Q],z=W.grid.size*(le?W.activeState.scale:1),ae=()=>{if(W.fit!=="fit")return{};if(!ge)return v.direction==="horiz"?{height:$.scalingValue(z,s)}:{width:$.scalingValue(z,s)};const D=ge.width/ge.height;if(v.direction==="horiz"){const ee=z,xe=ee*D;return{width:$.scalingValue(xe,s),height:$.scalingValue(ee,s)}}else{const ee=z,xe=ee/D;return{width:$.scalingValue(ee,s),height:$.scalingValue(xe,s)}}};return l.jsx("button",{className:Y.thumbItem,style:{...v.direction==="horiz"&&W.fit!=="fit"?{height:$.scalingValue(z,s)}:{},...v.direction==="vert"&&W.fit!=="fit"?{width:$.scalingValue(z,s)}:{},...W.fit==="cover"?{width:$.scalingValue(z,s),height:$.scalingValue(z,s)}:{},...ae(),transition:le?"all 0.25s ease-out":"none",opacity:le?W.activeState.opacity/100:W.opacity/100,"--thumb-hover":W.activeState.opacity/100},onClick:D=>{var ee;D.stopPropagation(),p(Q),(ee=f.current)==null||ee.go(Q)},onMouseEnter:()=>{var D;W.triggers==="hov"&&((D=f.current)==null||D.go(Q))},children:l.jsx("img",{src:te.image.url,alt:te.image.name??"",onLoad:D=>{const ee=D.currentTarget;ee.naturalWidth&&ee.naturalHeight&&w(xe=>({...xe,[Q]:{width:ee.naturalWidth,height:ee.naturalHeight}}))},style:{objectFit:W.fit==="cover"?"cover":"contain",...W.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...W.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${te.image.name}-${Q}`)})})})})()]})]}),document.getElementById(a))};function eo({color:e,className:t}){return l.jsx("svg",{viewBox:"0 0 10 18",className:t,children:l.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:l.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 Cc={element:bc,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 tr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Sc(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
pointer-events: auto;
|
|
156
156
|
z-index: 10;
|
|
157
157
|
}
|
|
158
|
-
`}function $c({settings:e,isEditor:t,isEditMode:n,isPreviewMode:r,metadata:i,activeEvent:a}){const s=!!n,c=r&&t||!t,{prefix:o}
|
|
158
|
+
`}function $c({settings:e,isEditor:t,isEditMode:n,isPreviewMode:r,metadata:i,activeEvent:a}){const s=!!n,c=r&&t||!t,{prefix:o}=$.useScopedStyles(),{type:p="A",fieldsToShow:d=2,fields:T=[],buttonLabel:b,gap:y,fieldsGap:g,buttonCorners:m,buttonStroke:L,buttonPadding:w,isButtonFullWidth:f,inputCorners:S,inputStroke:M,inputPadding:_,inputColor:A,inputTextColor:x,inputBorderColor:P,placeholderColor:k,buttonColor:E,buttonTextColor:R,buttonBorderColor:B,labelTextColor:V,successColor:U,errorColor:J,fontFamily:v,inputFontSettings:W,inputFontSize:H,inputLineHeight:F,inputLetterSpacing:I,inputWordSpacing:K,inputTextAppearance:X,buttonFontSettings:re,buttonFontSize:Z,buttonLineHeight:pe,buttonLetterSpacing:C,buttonWordSpacing:ie,buttonTextAppearance:Se,labelFontSettings:ue,labelFontSize:ye,labelLineHeight:ne,labelLetterSpacing:ce,labelWordSpacing:j,labelTextAppearance:h,statusFontSettings:N,statusFontSize:O,statusLineHeight:G,statusLetterSpacing:oe,statusWordSpacing:te,statusTextAppearance:Q,successMessage:le,errorMessage:ge,stateOverrides:he}=e,z=p==="B",ae=T.slice(0,Math.min(d,T.length)),D={fontSettings:{fontFamily:v,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:H??.01,lineHeight:F,letterSpacing:I??0,wordSpacing:K??0,textAppearance:X,color:x},ee=Ct(nt(D,t)),xe=$.scalingValue(M??0,t),Ee=$.scalingValue((F??H??.01)+((_==null?void 0:_.top)??0)+((_==null?void 0:_.bottom)??0)+(p==="C"?M??0:(M??0)*2),t),Xe={...ee,borderStyle:"solid",borderRadius:p==="C"?0:$.scalingValue(S??0,t),...p==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:xe,borderLeftWidth:0}:{borderWidth:xe},paddingTop:$.scalingValue((_==null?void 0:_.top)??0,t),paddingRight:$.scalingValue((_==null?void 0:_.right)??0,t),paddingBottom:$.scalingValue((_==null?void 0:_.bottom)??0,t),paddingLeft:$.scalingValue((_==null?void 0:_.left)??0,t),height:Ee,minHeight:Ee},Oe={fontSettings:{fontFamily:v,fontWeight:(re==null?void 0:re.fontWeight)??400,fontStyle:(re==null?void 0:re.fontStyle)??"normal"},fontSize:Z??.01,lineHeight:pe,letterSpacing:C??0,wordSpacing:ie??0,textAppearance:Se,color:R},ke=Ct(nt(Oe,t)),We=$.scalingValue(L??0,t),Pe={fontSettings:{fontFamily:v,fontWeight:(ue==null?void 0:ue.fontWeight)??400,fontStyle:(ue==null?void 0:ue.fontStyle)??"normal"},fontSize:ye??.01,lineHeight:ne,letterSpacing:ce??0,wordSpacing:j??0,textAppearance:h,color:V},je=nt(Pe,t),Ne={fontSettings:{fontFamily:v,fontWeight:(N==null?void 0:N.fontWeight)??400,fontStyle:(N==null?void 0:N.fontStyle)??"normal"},fontSize:O??.01,lineHeight:G,letterSpacing:oe??0,wordSpacing:te??0,textAppearance:Q,color:U},Re=Ct(nt(Ne,t)),Ve=$.buildColorVars(o,{inputColor:A,inputTextColor:x,inputBorderColor:P,placeholderColor:k!=null&&k.trim()?k:"#cccccc",buttonColor:E,buttonTextColor:R,buttonBorderColor:B,labelTextColor:V,successColor:U,errorColor:J},wc,Tc,he),[dt,vt]=u.useState(()=>Object.fromEntries(ae.map(be=>[be.name,""]))),[bt,Tt]=u.useState("idle"),[Kt,xt]=u.useState(null),qt=a==="success"?"success":a==="error"?"error":bt,ve=a==="error"?ge:Kt,Ge=a==="filled",ze=u.useMemo(()=>{if(!Ge)return dt;let be=null;for(const Ye of ae)(dt[Ye.name]??"").trim().length>0||(be=be??{...dt},be[Ye.name]="Filled");return be??dt},[dt,Ge,ae]),rt=qt==="error"?$.getFormFieldValidationError(ae,ze):null,Tn=`${a&&a!=="default"?`${o}-state-${a}`:""}`.trim(),Ut=i==null?void 0:i.submitUrl,tn=(be,Ye)=>{vt(De=>({...De,[be]:Ye}))},Ln=async be=>{if(be.preventDefault(),!c)return;const Ye=Object.fromEntries(ae.map(Me=>{var it;return[Me.name,((it=dt[Me.name])==null?void 0:it.trim())??""]}).filter(([,Me])=>Me));if(!Ut){Tt("error"),xt("No integrations were found for this form.");return}if(Object.keys(Ye).length===0)return;const De=$.getFormFieldValidationError(ae,dt);if(De){Tt("error"),xt(De);return}Tt("submitting"),xt(null);try{const Me=await fetch(Ut,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ye)});if(!Me.ok){const it=await Me.text();throw new Error(it||`Request failed: ${Me.status}`)}Tt("success"),vt(Object.fromEntries(ae.map(it=>[it.name,""])))}catch(Me){Tt("error"),xt(Me instanceof Error?Me.message:"Something went wrong")}};return l.jsxs("div",{className:`${o}-wrapper ${o}-type-${p} ${Tn}`.trim(),style:Ve,children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:Sc(o)}}),l.jsxs("form",{onSubmit:Ln,className:`${o}-form`,children:[l.jsx("div",{className:`${o}-fields`,children:ae.map((be,Ye)=>l.jsxs(u.Fragment,{children:[Ye>0&&l.jsx("div",{"data-controls":s?"fieldsGap":void 0,className:s?`${o}-control`:void 0,style:{height:$.scalingValue(g??0,t)}}),l.jsxs("div",{className:`${o}-field-group${z?` ${o}-labeled`:""}`,children:[z&&l.jsx("span",{className:`${o}-field-label`,style:je?{...je,lineHeight:je.fontSize}:void 0,children:be.label||be.name}),be.type==="textarea"?l.jsx("textarea",{name:be.name,autoComplete:"off",value:ze[be.name]??"",onChange:De=>tn(be.name,De.target.value),placeholder:be.placeholder,className:`${o}-input`,style:Xe,rows:1,"data-filled":Ge||(ze[be.name]??"").trim().length>0,"data-field-type":"textarea"}):l.jsx("input",{type:be.type==="phone"?"tel":be.type==="email"?"email":"text",name:be.name,autoComplete:"off",value:ze[be.name]??"",onChange:De=>tn(be.name,De.target.value),placeholder:be.placeholder,required:be.isRequired??be.type==="email",className:`${o}-input`,style:Xe,"data-filled":Ge||(ze[be.name]??"").trim().length>0})]})]},Ye))}),l.jsx("div",{"data-controls":s?"gap":void 0,className:s?`${o}-control`:void 0,style:{height:$.scalingValue(y??0,t)}}),l.jsx("div",{className:`${o}-overlay-anchor`,children:l.jsx("button",{type:c?"submit":"button",className:`${o}-button`,style:{borderStyle:"solid",borderRadius:$.scalingValue(m??0,t),borderWidth:We,paddingTop:$.scalingValue((w==null?void 0:w.top)??0,t),paddingRight:$.scalingValue((w==null?void 0:w.right)??0,t),paddingBottom:$.scalingValue((w==null?void 0:w.bottom)??0,t),paddingLeft:$.scalingValue((w==null?void 0:w.left)??0,t),pointerEvents:c?"auto":void 0,...ke,...f?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:l.jsx("span",{className:`${o}-overlay-anchor`,style:f?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:bt==="submitting"?"...":b})})})]}),qt==="success"&&l.jsx("p",{className:`${o}-success`,style:{...Re},children:le}),qt==="error"&&l.jsx("p",{className:`${o}-error`,style:{...Re},role:"alert",children:rt??ve??ge})]})}const wc={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"},Tc=["hover","focus","filled","success","error"],Lc=`import React, { useMemo, useState } from 'react';\r
|
|
159
159
|
import { CommonComponentProps } from '../props';\r
|
|
160
160
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';\r
|
|
161
161
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';\r
|
|
@@ -789,7 +789,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {\r
|
|
|
789
789
|
};\r
|
|
790
790
|
\r
|
|
791
791
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
792
|
-
`,Ec=[{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"}],nr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Pc=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],_c={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},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:{...nr.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:{...nr.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:{...nr.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:{...nr.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:Ec,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","fieldsToShow"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["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:["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:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Pc],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"]},Ac={element:$c,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:_c,sourceCode:Lc};function rr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Rc(e){return`
|
|
792
|
+
`,Ec=[{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"}],nr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Pc=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],_c={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:{...nr.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:{...nr.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:{...nr.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:{...nr.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:Ec,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:[...Pc],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"]},Ac={element:$c,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:_c,sourceCode:Lc};function rr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Rc(e){return`
|
|
793
793
|
.${e}-wrapper {
|
|
794
794
|
display: flex;
|
|
795
795
|
flex-direction: column;
|
|
@@ -980,7 +980,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
|
980
980
|
font-size: ${rr(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const
|
|
983
|
+
`}const Ic=({settings:e,isEditor:t,isPreviewMode:n,metadata:r,activeEvent:i})=>{const{prefix:a}=$.useScopedStyles(),s=n&&t||!t,{fields:c=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:o,buttonLabel:p,fieldsToShow:d=1,fontFamily:T,inputFontSettings:b,inputFontSize:y,inputLineHeight:g,inputLetterSpacing:m,inputWordSpacing:L,inputTextAppearance:w,buttonFontSettings:f,buttonFontSize:S,buttonLineHeight:M,buttonLetterSpacing:_,buttonWordSpacing:A,buttonTextAppearance:x,statusFontSettings:P,statusFontSize:k,statusLineHeight:E,statusLetterSpacing:R,statusWordSpacing:B,statusTextAppearance:V,iconMaxWidth:U,minHeight:J,corners:v,stroke:W,stateOverrides:H,inputPadding:F,buttonPadding:I,successMessage:K="Thanks for subscribing!",errorMessage:X="Please, fill all required fields."}=e,re=c.slice(0,Math.min(d,c.length)),[Z,pe]=u.useState(()=>Object.fromEntries(re.map(Pe=>[Pe.name,""]))),[C,ie]=u.useState("idle"),[Se,ue]=u.useState(null),ye=i==="success"?"success":i==="error"?"error":C,ne=i==="error"?X:Se,ce=i==="filled",j=u.useMemo(()=>{if(!ce)return Z;let Pe=null;for(const je of re)(Z[je.name]??"").trim().length>0||(Pe=Pe??{...Z},Pe[je.name]="Filled");return Pe??Z},[ce,Z,re]),h=ye==="error"?$.getFormFieldValidationError(re,j):null,N=i&&i!=="default"?`${a}-state-${i}`:"",O=re.some(Pe=>(j[Pe.name]??"").trim().length>0),G=N!==`${a}-state-filled`&&O?`${a}-state-filled`:"",oe=`${N} ${G}`.trim(),te=r==null?void 0:r.submitUrl,Q=p??"",le=(o==null?void 0:o.icon)??"",ge=(o==null?void 0:o.mode)==="On",he=Q||"Submit",z={fontSettings:{fontFamily:T,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:y??.01,lineHeight:g,letterSpacing:m??0,wordSpacing:L??0,textAppearance:w,color:e.inputTextColor??"#111111"},ae={fontSettings:{fontFamily:T,fontWeight:(f==null?void 0:f.fontWeight)??400,fontStyle:(f==null?void 0:f.fontStyle)??"normal"},fontSize:S??.01,lineHeight:M,letterSpacing:_??0,wordSpacing:A??0,textAppearance:x,color:e.buttonTextColor??"#ffffff"},D={fontSettings:{fontFamily:T,fontWeight:(P==null?void 0:P.fontWeight)??400,fontStyle:(P==null?void 0:P.fontStyle)??"normal"},fontSize:k??.01,lineHeight:E,letterSpacing:R??0,wordSpacing:B??0,textAppearance:V,color:e.successColor??"#22c55e"},ee=Ct(nt(z,t)),xe=Ct(nt(ae,t)),Ee=Ct(nt(D,t)),Xe=$.buildColorVars(a,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(z==null?void 0:z.color)??"#111111",buttonTextColor:e.buttonTextColor??(ae==null?void 0:ae.color)??"#ffffff"},kc,Wc,H),Oe={borderRadius:$.scalingValue(v,t),borderWidth:$.scalingValue(W,t),borderStyle:"solid"},ke={borderLeftWidth:$.scalingValue(W,t)},We=async Pe=>{if(Pe.preventDefault(),!s)return;const je=Object.fromEntries(re.map(Re=>{var Ve;return[Re.name,((Ve=Z[Re.name])==null?void 0:Ve.trim())??""]}).filter(([,Re])=>Re));if(!te){ie("error"),ue("No integrations were found for this form.");return}if(Object.keys(je).length===0)return;const Ne=$.getFormFieldValidationError(re,Z);if(Ne){ie("error"),ue(Ne);return}ie("submitting"),ue(null);try{const Re=await fetch(te,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(je)});if(!Re.ok){const Ve=await Re.text();throw new Error(Ve||`Request failed: ${Re.status}`)}ie("success"),pe(Object.fromEntries(re.map(Ve=>[Ve.name,""])))}catch(Re){ie("error"),ue(Re instanceof Error?Re.message:"Something went wrong")}};return l.jsxs("div",{className:`${a}-wrapper ${oe}`.trim(),style:Xe,children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:Rc(a)}}),l.jsxs("form",{onSubmit:We,className:`${a}-form`,style:{...Oe,height:$.scalingValue(J,t),minHeight:$.scalingValue(J,t)},children:[l.jsx("div",{className:`${a}-inputWrap ${a}-overlayAnchor`,style:{flex:1,minWidth:0},children:re.map(Pe=>l.jsx("input",{type:Pe.type==="email"?"email":Pe.type==="phone"?"tel":"text",name:Pe.name,autoComplete:"off",value:j[Pe.name]??"",onChange:je=>pe(Ne=>({...Ne,[Pe.name]:je.target.value})),placeholder:Pe.placeholder,required:Pe.isRequired??Pe.type==="email",className:`${a}-input`,style:{...ee,paddingRight:$.scalingValue(F.right,t),paddingLeft:$.scalingValue(F.left,t),paddingTop:$.scalingValue(F.top,t),paddingBottom:$.scalingValue(F.bottom,t)}},Pe.name))}),l.jsx("div",{className:`${a}-overlayAnchor`,children:l.jsx("button",{type:s?"submit":"button",className:`${a}-submitBtn`,"aria-label":he,style:{...xe,...ke,paddingRight:$.scalingValue(I.right,t),paddingLeft:$.scalingValue(I.left,t),paddingTop:$.scalingValue(I.top,t),paddingBottom:$.scalingValue(I.bottom,t),pointerEvents:s?"auto":void 0},children:C==="submitting"?"...":ge?le&&l.jsx(Ht,{url:le,className:`${a}-submitBtnIcon`,style:{maxWidth:$.scalingValue(U??0,t)},fill:`var(--${a}-button-text-color)`,hoverFill:`var(--${a}-button-text-color)`}):Q})})]}),ye==="success"&&l.jsx("p",{className:`${a}-success`,style:{...Ee},children:K}),ye==="error"&&l.jsx("p",{className:`${a}-error`,style:{...Ee},role:"alert",children:h??ne??X})]})},kc={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"},Wc=["hover","focus","filled","success","error"],Mc=`import React, { useMemo, useState } from 'react';\r
|
|
984
984
|
import { CommonComponentProps } from '../props';\r
|
|
985
985
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';\r
|
|
986
986
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';\r
|
|
@@ -1557,7 +1557,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {\r
|
|
|
1557
1557
|
};\r
|
|
1558
1558
|
\r
|
|
1559
1559
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;\r
|
|
1560
|
-
`,Fc="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>'),Nc=[{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."}],Or={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Hc=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Bc={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"number"},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:{...Or.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:{...Or.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:{...Or.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:Nc,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Fc},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__","fieldsToShow"]},{type:"row",items:["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:["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:["fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Hc],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"]},Oc={element:kc,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:Bc,sourceCode:Mc};function Vc(e){return`
|
|
1560
|
+
`,Fc="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>'),Nc=[{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."}],Or={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Hc=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],Bc={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:{...Or.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:{...Or.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:{...Or.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:Nc,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:Fc},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:[...Hc],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"]},Oc={element:Ic,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:Bc,sourceCode:Mc};function Vc(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;\r
|
|
|
1689
1689
|
.${e}-image-hover-grayscale:hover img {
|
|
1690
1690
|
filter: grayscale(100%);
|
|
1691
1691
|
}
|
|
1692
|
-
`}const Dc=30,jc=20,Vr=2,zc=2,Kc=(e,t)=>Array.from({length:t},()=>e).flat(),
|
|
1692
|
+
`}const Dc=30,jc=20,Vr=2,zc=2,Kc=(e,t)=>Array.from({length:t},()=>e).flat(),qc=(e,t)=>{const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return r.right>n.left&&r.left<n.right},Uc=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(r=>qc(r,e))},Gc=({item:e,prefix:t,imageFit:n,imageMaxWidth:r,imageMaxHeight:i,imageHoverClass:a,isFirstSet:s,scaled:c,onFirstSetImageDone:o})=>{var x,P,k;const p=u.useRef(null);u.useLayoutEffect(()=>{if(!s)return;const E=p.current;E!=null&&E.complete&&(o==null||o())},[s,(x=e.image)==null?void 0:x.url,o]);const d=n.display==="Cover",T=n.ratioValue??"1:1",b=n.reversed??!1,[y,g]=T.split(":").map(Number),w=(b?g:y)/(b?y:g);let f=r,S=f/w;S>i&&(S=i,f=S*w);const M=c(f),_=c(S),A=((P=e.image)==null?void 0:P.url)&&l.jsx("img",{ref:p,src:e.image.url,alt:((k=e.image)==null?void 0:k.name)??"",style:d?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:c(r),objectFit:"contain"},onLoad:s?o:void 0,onError:s?o:void 0});return l.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...d?{width:M}:{width:"fit-content",maxWidth:c(r),minWidth:0}},children:l.jsx("div",{className:a,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...d?{width:M,height:_,overflow:"hidden"}:{width:"fit-content",maxWidth:c(r),height:c(i)}},children:A&&e.link?l.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:Le(`${t}-marquee-link`,!d&&`${t}-marquee-link-contain`),children:A}):A})})},Yc=({settings:e,content:t,isEditor:n,isPreviewMode:r,isEditMode:i})=>{const{prefix:a}=$.useScopedStyles(),s=u.useMemo(()=>Vc(a),[a]),{speed:c,direction:o,pauseOnHover:p,gap:d,imageMaxWidth:T,imageMaxHeight:b,imageFit:y,hoverEffect:g}=e,m=!!i,L=!n||!!r,w=L&&g!=="off"&&g!=="randomize"?`${a}-image-hover-${g}`:void 0,f=n?!!r:!0,M=((t==null?void 0:t.length)??0)>0&&(f||!!n),_=Math.max(0,c)*Dc,A=h=>$.scalingValue(h,n??!1),x=u.useRef(null),P=u.useRef(null),k=u.useRef(null),[E,R]=u.useState(0),[B,V]=u.useState(0),U=f&&p==="on",[J,v]=u.useState(!1),[W,H]=u.useState({}),F=u.useRef(W);F.current=W;const I=u.useRef(null),K=u.useRef(0),X=u.useRef(null),re=u.useMemo(()=>(t??[]).map(h=>{var N;return((N=h.image)==null?void 0:N.url)??""}).join("\0"),[t]),[Z,pe]=u.useState(Vr),C=u.useMemo(()=>{const h=t??[];return!f||h.length===0?h:Kc(h,Z)},[t,f,Z]),ie=u.useMemo(()=>C.filter(h=>{var N;return!!((N=h.image)!=null&&N.url)}).length,[C]),Se=M?zc:1;u.useLayoutEffect(()=>{K.current=0,H({}),I.current=null,pe(Vr),R(0)},[re]),u.useEffect(()=>{if(!L||g!=="randomize")return;const h=x.current;if(!h)return;const N=te=>{H(Q=>{let le=null;for(const ge of te)ge in Q&&(Uc(h,ge)||(le||(le={...Q}),delete le[ge]));return le??Q})},O=new IntersectionObserver(te=>{const Q=new Set;for(const le of te){const ge=le.target.dataset.marqueeItemIndex,he=ge!==void 0?Number(ge):NaN;Number.isNaN(he)||Q.add(he)}Q.size>0&&N(Q)},{root:h,threshold:0});Object.keys(W).forEach(te=>{const Q=Number(te);h.querySelectorAll(`[data-marquee-item-index="${Q}"]`).forEach(le=>O.observe(le))});let G=0;const oe=()=>{const te=Object.keys(F.current);te.length!==0&&(N(te.map(Number)),G=requestAnimationFrame(oe))};return Object.keys(F.current).length>0&&(G=requestAnimationFrame(oe)),()=>{cancelAnimationFrame(G),O.disconnect()}},[g,W,L]),u.useLayoutEffect(()=>{if(!M)return;const h=x.current,N=k.current;if(!h||!N)return;let O=0;const G=()=>{const Q=h.getBoundingClientRect().width,le=N.getBoundingClientRect().width,ge=I.current,he=typeof ge=="number"&&Math.abs(ge-le)<=.25;if(I.current=le,f&&le>0&&Z>0){const z=le/Z;if(z>0&&Q>0){const ae=Math.max(Vr,Math.ceil(Q/z)+1);if(ae!==Z){pe(ae);return}}}if(le>0&&E<=0){R(le);return}he&&le!==E?R(le):!he&&E<=0&&(cancelAnimationFrame(O),O=requestAnimationFrame(G))},oe=()=>{cancelAnimationFrame(O),O=requestAnimationFrame(G)};X.current=oe,oe();const te=new ResizeObserver(oe);return te.observe(h),te.observe(N),()=>{X.current=null,cancelAnimationFrame(O),te.disconnect()}},[f,M,E,re,Z]),u.useLayoutEffect(()=>{const h=P.current;if(!M||!h)return;const N=E>0?E:0,O=N>0&&_>0?N/_*1e3:0,G=`${Math.max(0,O)/1e3}s`;h.style.setProperty("--marquee-distance",`${N}px`),h.style.setProperty("--marquee-duration",G)},[f,M,_,E]),u.useLayoutEffect(()=>{if(!M){V(0);return}if(E<=0){V(0);return}const h=P.current;if(!h)return;const N=()=>{const G=h.getBoundingClientRect().height;V(G>0?G:0)};N();const O=new ResizeObserver(N);return O.observe(h),()=>O.disconnect()},[M,Se,C,n,d,T,b,E,y,W]);const ue=()=>{U&&v(!0)},ye=()=>{U&&v(!1)},ne=u.useCallback(()=>{var h;K.current=Math.min(ie,K.current+1),(h=X.current)==null||h.call(X)},[ie]),ce=u.useCallback((h,N)=>{H(O=>{const G=O[h]??N,oe=(t??[]).filter(Q=>Q!==G);if(oe.length===0)return O;const te=oe[Math.floor(Math.random()*oe.length)];return{...O,[h]:te}})},[t]),j=(h,N,O,G)=>{const oe=L&&g==="randomize"&&y.display==="Cover"?W[O]??h:h,te=`max(${A(d)}, ${jc}px)`,Q=`calc(-0.5 * (${te} + ${A(d)}))`;return l.jsxs("div",{className:`${a}-marquee-card`,"data-marquee-item-index":O,onMouseEnter:L&&g==="randomize"&&y.display==="Cover"?()=>ce(O,h):void 0,children:[l.jsx(Gc,{item:oe,prefix:a,imageFit:y,imageMaxWidth:T,imageMaxHeight:b,imageHoverClass:w,isEditor:n,isFirstSet:G,scaled:A,onFirstSetImageDone:ne}),m&&l.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${a}-gap-control`,style:{position:"absolute",top:0,right:Q,width:te,height:"100%"}})]},`${N}-${O}`)};if(M){const h=f?U&&J?"paused":"running":"paused";return l.jsxs("div",{ref:x,className:Le(`${a}-wrapper`,`${a}-marquee-wrapper`),"aria-label":"Marquee",style:E>0&&B>0?{height:B}:void 0,children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),l.jsx("div",{ref:P,className:`${a}-marquee-track`,"data-direction":o,onMouseEnter:ue,onMouseLeave:ye,style:{"--marquee-play-state":h},children:Array.from({length:Se},(N,O)=>l.jsx("div",{ref:O===0?k:void 0,className:Le(`${a}-marquee-row`,`${a}-marquee-set`),style:{gap:A(d),paddingRight:A(d)},"aria-hidden":O>0,children:C.map((G,oe)=>j(G,O,oe,O===0))},`set-${O}`))},"marquee-track")]})}return l.jsxs("div",{ref:x,className:`${a}-wrapper`,children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),l.jsx("div",{className:Le(`${a}-marquee-row`,`${a}-marquee-static`),style:{gap:A(d),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((h,N)=>j(h,0,N))},"marquee-static")]})},Xc=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\r
|
|
1693
1693
|
import cn from 'classnames';\r
|
|
1694
1694
|
import { CommonComponentProps } from '../props';\r
|
|
1695
1695
|
import { scalingValue } from '../utils/scalingValue';\r
|
|
@@ -2320,7 +2320,7 @@ type MarqueeProps = {\r
|
|
|
2320
2320
|
isPreviewMode?: boolean;\r
|
|
2321
2321
|
isEditMode?: boolean;\r
|
|
2322
2322
|
} & CommonComponentProps;\r
|
|
2323
|
-
`,Zc={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min
|
|
2323
|
+
`,Zc={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,max:200,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,max:400,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,max:400,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:.15,imageMaxHeight:.1}},displayRules:[{if:{name:"imageFit.display",value:"Cover"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","randomize"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["direction"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7RZNCQFC3T744H0KX6R3FR.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7RZRTSS60YBFT6Y37ZX00T.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ9M9YJPQ5JWKCHDEW5M1GJD.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7S04EHBXQS1T4KVAMZNZQM.jpeg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/projects/01KM5KBNFNRT3D0JP64K5EY92A/articles-assets/01KQ7S08Q40WHD39024VNDWF2Q.jpeg",name:""},link:""}]}},Jc={element:Yc,id:"marquee",name:"Simple Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:140},m:{width:390,height:80}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple_Marquee.mp4"},schema:Zc,sourceCode:Xc,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function to(e){return`
|
|
2324
2324
|
.${e}-marquee-wrapper {
|
|
2325
2325
|
overflow: hidden;
|
|
2326
2326
|
width: 100%;
|
|
@@ -2407,7 +2407,7 @@ type MarqueeProps = {\r
|
|
|
2407
2407
|
pointer-events: auto;
|
|
2408
2408
|
z-index: 10;
|
|
2409
2409
|
}
|
|
2410
|
-
`}const Qc=30,no=2,ed=({settings:e,content:t,isEditor:n,isPreviewMode:r,isEditMode:i})=>{const{prefix:a}
|
|
2410
|
+
`}const Qc=30,no=2,ed=({settings:e,content:t,isEditor:n,isPreviewMode:r,isEditMode:i})=>{const{prefix:a}=$.useScopedStyles(),{align:s,speed:c,direction:o,pauseOnHover:p,gap:d,cardWidth:T,corners:b,stroke:y,strokeColor:g,bgColor:m,padding:L,logoMarginTop:w,logoWidth:f,logoHeight:S,captionMarginTop:M}=e,_=!!i,A=((t==null?void 0:t.length)??0)>0,x=c>0&&(!n||!!r),P=A&&(x||!!n),k=Math.max(0,c)*Qc,E=z=>$.scalingValue(z,n??!1),R=u.useRef(null),B=u.useRef(null),V=u.useRef(null),[U,J]=u.useState(0),[v,W]=u.useState(0),[H,F]=u.useState(0),I=x&&p==="on",[K,X]=u.useState(!1),re=u.useRef(null),[Z,pe]=u.useState(0),[C,ie]=u.useState(0),Se=u.useRef(null),ue=z=>{var D,ee,xe,Ee,Xe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${z}FontFamily`])??"Arial",fontWeight:((D=e==null?void 0:e[`${z}FontSettings`])==null?void 0:D.fontWeight)??400,fontStyle:((ee=e==null?void 0:e[`${z}FontSettings`])==null?void 0:ee.fontStyle)??"normal"},textAppearance:{textTransform:((xe=e==null?void 0:e[`${z}TextAppearance`])==null?void 0:xe.textTransform)??"none",textDecoration:((Ee=e==null?void 0:e[`${z}TextAppearance`])==null?void 0:Ee.textDecoration)??"none",fontVariant:((Xe=e==null?void 0:e[`${z}TextAppearance`])==null?void 0:Xe.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${z}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${z}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${z}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${z}LineHeight`])??.01,color:(e==null?void 0:e[`${z}Color`])??"#000000"}},ye=ue("text"),ne=ue("caption"),ce=u.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(z=>{var ae,D;return(((ae=z.text)==null?void 0:ae.length)??0)>0||(((D=z.caption)==null?void 0:D.length)??0)>0}),[t]),j=u.useMemo(()=>!P||(t==null?void 0:t.length)===0?1:v<=0||U<=0?no:Math.max(no,Math.ceil(U/v)+1),[P,t==null?void 0:t.length,v,U]);u.useLayoutEffect(()=>{if(!P)return;const z=R.current,ae=V.current;if(!z||!ae)return;let D=0;const ee=()=>{const Xe=z.getBoundingClientRect().width,Oe=ae.getBoundingClientRect().width,ke=Se.current,We=typeof ke=="number"&&Math.abs(ke-Oe)<=.25;if(Se.current=Oe,J(Xe),typeof Oe=="number"&&Oe>0&&v<=0){W(Oe);return}We&&Oe!==v?W(Oe):!We&&v<=0&&(cancelAnimationFrame(D),D=requestAnimationFrame(ee))},xe=()=>{cancelAnimationFrame(D),D=requestAnimationFrame(ee)};xe();const Ee=new ResizeObserver(xe);return Ee.observe(z),Ee.observe(ae),()=>{cancelAnimationFrame(D),Ee.disconnect()}},[x,P,v]),u.useLayoutEffect(()=>{const z=B.current;if(!P||!z)return;const ae=v>0?v:0,D=ae>0&&k>0?ae/k*1e3:0,ee=`${Math.max(0,D)/1e3}s`;z.style.setProperty("--marquee-distance",`${ae}px`),z.style.setProperty("--marquee-duration",ee)},[x,P,k,v]),u.useLayoutEffect(()=>{if(!P){F(0);return}const z=V.current,ae=B.current;if(!z||!ae)return;const D=()=>{let xe=0;for(let Ee=0;Ee<z.children.length;Ee++){const Oe=z.children[Ee].firstElementChild;Oe&&(xe=Math.max(xe,Oe.offsetHeight))}xe<=0&&(xe=ae.offsetHeight),F(xe>0?xe:0)};D();const ee=new ResizeObserver(D);return ee.observe(z),ee.observe(ae),()=>{ee.disconnect()}},[P,j,t,n,d,T,L,y,b,f,S,Z,C]);const h=()=>{I&&X(!0)},N=()=>{I&&X(!1)},O=u.useMemo(()=>{switch(s){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[s]),G=u.useMemo(()=>{switch(s){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[s]),oe=u.useCallback((z,ae,D,ee)=>l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:O,width:"100%"},children:[l.jsx("div",{"data-controls":_?ee==null?void 0:ee.controlsName:void 0,"data-controls-axis":_?"y":void 0,className:_?`${a}-control`:void 0,style:{height:E((ee==null?void 0:ee.marginTop)??0)}}),l.jsx("div",{...ee!=null&&ee.dataMeasureKind?{"data-testimonial-measure":ee.dataMeasureKind}:{},style:{...nt(z,n),textAlign:G,pointerEvents:"auto",...typeof(ee==null?void 0:ee.minHeightPx)=="number"&&ee.minHeightPx>0?{minHeight:ee.minHeightPx}:{}},children:l.jsx(Nn,{content:ae})})]},D),[O,G,n,_,a,E]),te=u.useCallback((z,ae,D)=>{var ee,xe,Ee;return l.jsxs("div",{style:{padding:`${E(L.top)} ${E(L.right)} ${E(L.bottom)} ${E(L.left)}`,width:E(T+y*2),height:"100%",borderRadius:E(b),border:`${E(y)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[l.jsx("div",{className:`${a}-cover`,style:{background:m}}),l.jsxs("div",{className:`${a}-elements-overlay`,style:{alignItems:O,textAlign:G},children:[z.text&&oe(ye,z.text,"text",D!=null&&D.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(D==null?void 0:D.textMinHeightPx)=="number"&&D.textMinHeightPx>0?{minHeightPx:D.textMinHeightPx}:void 0),l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:O,width:"100%"},children:[l.jsx("div",{"data-controls":_&&!(D!=null&&D.dataMeasureAttrs)?"logoMarginTop":void 0,className:_&&!(D!=null&&D.dataMeasureAttrs)?`${a}-control`:void 0,style:{height:E(w)}}),l.jsx("div",{style:{width:E(f),height:E(S)},children:((ee=z.logo)==null?void 0:ee.url)&&l.jsx("img",{src:z.logo.url,alt:((xe=z.logo)==null?void 0:xe.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Ee=z.logo)==null?void 0:Ee.objectFit)||"contain"}})})]}),z.caption&&oe(ne,z.caption,"caption",{...D!=null&&D.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:M,...D!=null&&D.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(D==null?void 0:D.captionMinHeightPx)=="number"&&D.captionMinHeightPx>0?{minHeightPx:D.captionMinHeightPx}:{}})]})]},ae)},[m,M,ne,T,b,S,w,f,O,G,L.bottom,L.left,L.right,L.top,oe,y,g,ye,n,_,a]),Q=u.useCallback(z=>{pe(z.maxTextPx),ie(z.maxCaptionPx)},[]);u.useLayoutEffect(()=>{if(!ce){Q({maxTextPx:0,maxCaptionPx:0});return}const z=re.current;if(!z)return;const ae=()=>{$.readTestimonialTextMeasure(z,Q)};ae();const D=new ResizeObserver(ae);return D.observe(z),()=>{D.disconnect()}},[ce,Q,t,te]);const le=ce?{textMinHeightPx:Z,captionMinHeightPx:C}:void 0,ge=ce?l.jsx("div",{ref:re,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((z,ae)=>te(z,`measure-${ae}`,{dataMeasureAttrs:!0}))}):null,he=(z,ae)=>l.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[te(z,`card-${ae}`,le),_&&l.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${E(d)})`,width:E(d),height:"100%",pointerEvents:"auto",zIndex:2}})]},ae);if(P){const z=x?I&&K?"paused":"running":"paused";return l.jsxs("div",{ref:R,className:Le(`${a}-wrapper`,`${a}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...H>0?{height:H}:{}},children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:to(a)}}),ge,l.jsx("div",{ref:B,className:`${a}-marquee-track`,"data-direction":o,onMouseEnter:h,onMouseLeave:N,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":z},children:Array.from({length:j},(ae,D)=>l.jsx("div",{ref:D===0?V:void 0,className:`${a}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:E(d),paddingRight:E(d)},"aria-hidden":D>0,children:t==null?void 0:t.map((ee,xe)=>he(ee,`${D}-${xe}`))},`set-${D}`))})]})}return l.jsxs("div",{className:`${a}-wrapper`,children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:to(a)}}),ge,l.jsx("div",{style:{gap:E(d),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((z,ae)=>he(z,ae))})]})},td=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\r
|
|
2411
2411
|
import cn from 'classnames';\r
|
|
2412
2412
|
import { CommonComponentProps } from '../props';\r
|
|
2413
2413
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';\r
|
|
@@ -2533,10 +2533,10 @@ type RenderTextOpts = {\r
|
|
|
2533
2533
|
\r
|
|
2534
2534
|
export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode, isEditMode }: TestimonialsProps) => {\r
|
|
2535
2535
|
const { prefix: P } = useScopedStyles();\r
|
|
2536
|
-
const {
|
|
2536
|
+
const { align, speed, direction, pauseOnHover, gap, cardWidth, corners, stroke, strokeColor, bgColor, padding, logoMarginTop, logoWidth, logoHeight, captionMarginTop } = settings;\r
|
|
2537
2537
|
const showControls = Boolean(isEditMode);\r
|
|
2538
2538
|
const hasContent = (content?.length ?? 0) > 0;\r
|
|
2539
|
-
const autoplayEnabled =
|
|
2539
|
+
const autoplayEnabled = speed > 0 && (!isEditor || Boolean(isPreviewMode));\r
|
|
2540
2540
|
const useMarqueeTrack = hasContent && (autoplayEnabled || Boolean(isEditor));\r
|
|
2541
2541
|
const pxPerSec = Math.max(0, speed) * PX_PER_SEC_PER_SPEED_UNIT;\r
|
|
2542
2542
|
const scaled = (v: number) => scalingValue(v, isEditor ?? false);\r
|
|
@@ -3006,7 +3006,6 @@ type Padding = {\r
|
|
|
3006
3006
|
};\r
|
|
3007
3007
|
\r
|
|
3008
3008
|
type TestimonialsSettings = {\r
|
|
3009
|
-
autoplay: 'on' | 'off';\r
|
|
3010
3009
|
speed: number;\r
|
|
3011
3010
|
align: 'start' | 'center' | 'end';\r
|
|
3012
3011
|
direction: 'left' | 'right';\r
|
|
@@ -3023,7 +3022,7 @@ type TestimonialsSettings = {\r
|
|
|
3023
3022
|
logoHeight: number;\r
|
|
3024
3023
|
captionMarginTop: number;\r
|
|
3025
3024
|
};\r
|
|
3026
|
-
`,ro={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},nd={type:"object",version:1,settings:{sizing:"auto manual",properties:{
|
|
3025
|
+
`,ro={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},nd={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Fill Text",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Fill Caption",display:{type:"palette-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...ro.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:{...ro.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"}]}]}]}},rd={element:ed,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:nd,sourceCode:td,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function id(e){return`
|
|
3027
3026
|
.${e}-container {
|
|
3028
3027
|
position: relative;
|
|
3029
3028
|
overflow-x: clip;
|
|
@@ -3147,7 +3146,7 @@ type TestimonialsSettings = {\r
|
|
|
3147
3146
|
width: 100%;
|
|
3148
3147
|
height: 100%;
|
|
3149
3148
|
}
|
|
3150
|
-
`}const od=({settings:e,content:t,isEditor:n,isPreviewMode:r,isEditMode:i})=>{const{prefix:a}
|
|
3149
|
+
`}const od=3e3,ad=({settings:e,content:t,isEditor:n,isPreviewMode:r,isEditMode:i})=>{const{prefix:a}=$.useScopedStyles(),s=t||[],{speed:c,align:o,width:p,imageMarginTop:d,textMarginTop:T,captionMarginTop:b,imageWidth:y,imageHeight:g,controlsWidth:m,controlsColor:L,controlsHoverColor:w}=e,f=c>0&&(!n||!!r),[S,M]=u.useState(0),[_,A]=u.useState(null),[x,P]=u.useState(!1),k=u.useRef(null),E=u.useMemo(()=>{switch(o){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[o]),R=u.useMemo(()=>{switch(o){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[o]);u.useEffect(()=>{M(0),A(null),P(!1)},[s.length]);const B=s[S],V=_===null?null:s[_],U=ne=>{var j,h,N,O,G;return{fontSettings:{fontFamily:(e==null?void 0:e[`${ne}FontFamily`])??"Arial",fontWeight:((j=e==null?void 0:e[`${ne}FontSettings`])==null?void 0:j.fontWeight)??400,fontStyle:((h=e==null?void 0:e[`${ne}FontSettings`])==null?void 0:h.fontStyle)??"normal"},textAppearance:{textTransform:((N=e==null?void 0:e[`${ne}TextAppearance`])==null?void 0:N.textTransform)??"none",textDecoration:((O=e==null?void 0:e[`${ne}TextAppearance`])==null?void 0:O.textDecoration)??"none",fontVariant:((G=e==null?void 0:e[`${ne}TextAppearance`])==null?void 0:G.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${ne}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${ne}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${ne}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${ne}WordSpacing`])??0,color:(e==null?void 0:e[`${ne}Color`])??"#000000"}},J=U("text"),v=U("caption"),W=s.length>1&&s.some(ne=>{var ce,j;return(((ce=ne.text)==null?void 0:ce.length)??0)>0||(((j=ne.caption)==null?void 0:j.length)??0)>0}),H=u.useRef(null),[F,I]=u.useState(0),[K,X]=u.useState(0),re=e.controls??{mode:"Off",icon:null},Z=s.length>1,pe=u.useCallback((ne,ce)=>!Z||ce===ne?ne:(k.current&&window.clearTimeout(k.current),A(ne),P(!0),k.current=window.setTimeout(()=>{A(null),P(!1),k.current=null},300),ce),[Z]),C=u.useCallback(()=>{Z&&M(ne=>pe(ne,(ne-1+s.length)%s.length))},[Z,pe,s.length]),ie=u.useCallback(()=>{Z&&M(ne=>pe(ne,(ne+1)%s.length))},[Z,pe,s.length]);u.useEffect(()=>{if(!f||!Z)return;const ne=Math.max(300,od/c),ce=window.setInterval(()=>{M(j=>pe(j,(j+1)%s.length))},ne);return()=>{window.clearInterval(ce)}},[f,Z,pe,s.length,c]),u.useEffect(()=>()=>{k.current&&window.clearTimeout(k.current)},[]);const Se=(ne,ce)=>{var G,oe,te,Q;const j=ce==null?void 0:ce.textMinHeightPx,h=ce==null?void 0:ce.captionMinHeightPx,N=ce==null?void 0:ce.dataMeasureAttrs,O=i&&!(ce!=null&&ce.dataMeasureAttrs)&&!(ce!=null&&ce.hideControls);return l.jsxs(l.Fragment,{children:[ne.text&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:E,width:"100%"},children:[l.jsx("div",{"data-controls":O?"textMarginTop":void 0,className:O?`${a}-control`:void 0,style:{height:$.scalingValue(T??0,n??!1)}}),l.jsx("div",{...N&&{"data-testimonial-measure":"text"},style:{...nt(J,n),...j&&j>0?{minHeight:j}:{},textAlign:R,pointerEvents:"auto"},children:l.jsx(Nn,{content:ne.text})})]}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:E,width:"100%"},children:[l.jsx("div",{"data-controls":O?"imageMarginTop":void 0,className:O?`${a}-control`:void 0,style:{height:$.scalingValue(d??0,n??!1)}}),l.jsx("div",{style:{width:$.scalingValue(y??0,n??!1),height:$.scalingValue(g??0,n??!1)},children:((G=ne.image)==null?void 0:G.url)&&l.jsx("img",{src:(oe=ne.image)==null?void 0:oe.url,alt:((te=ne.image)==null?void 0:te.name)??"",className:`${a}-icon`,style:{objectFit:((Q=ne.image)==null?void 0:Q.objectFit)||"contain"}})})]}),ne.caption&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:E,width:"100%"},children:[l.jsx("div",{"data-controls":O?"captionMarginTop":void 0,className:O?`${a}-control`:void 0,style:{height:$.scalingValue(b??0,n??!1)}}),l.jsx("div",{...N?{"data-testimonial-measure":"caption"}:{},style:{...nt(v,n),...h&&h>0?{minHeight:h}:{},textAlign:R,pointerEvents:"auto"},children:l.jsx(Nn,{content:ne.caption})})]})]})},ue=u.useCallback(ne=>{I(ne.maxTextPx),X(ne.maxCaptionPx)},[]);if(u.useLayoutEffect(()=>{if(!W){ue({maxTextPx:0,maxCaptionPx:0});return}const ne=H.current;if(!ne)return;const ce=()=>{$.readTestimonialTextMeasure(ne,ue)};ce();const j=new ResizeObserver(ce);return j.observe(ne),()=>{j.disconnect()}},[W,ue,t]),!B)return l.jsx(l.Fragment,{});const ye=W?{textMinHeightPx:F,captionMinHeightPx:K}:void 0;return l.jsx(l.Fragment,{children:l.jsxs("div",{className:`${a}-container`,children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:id(a)}}),l.jsxs("div",{className:`${a}-wrapper`,style:{width:$.scalingValue(p??0,n??!1),alignItems:E},children:[W&&l.jsx("div",{ref:H,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((ne,ce)=>l.jsx("div",{style:{width:"100%"},children:Se(ne,{dataMeasureAttrs:!0})},ce))}),l.jsxs("div",{className:`${a}-fade-stack`,children:[V&&x&&l.jsx("div",{className:Le(`${a}-fade-item-prev`,`${a}-fade-out`),children:Se(V,{...ye,hideControls:!0})}),l.jsx("div",{className:Le(`${a}-fade-item-current`,x?`${a}-fade-in`:void 0),children:Se(B,ye)})]})]}),re.mode==="On"&&l.jsxs("div",{className:`${a}-controls`,children:[l.jsx("div",{className:`${a}-arrow`,style:{width:$.scalingValue(m??.02,n??!1),height:$.scalingValue(m??.02,n??!1),"--arrow-hover-color":w},children:l.jsx("button",{type:"button",className:`${a}-arrow-inner`,onClick:C,disabled:!Z,"aria-label":"Previous testimonial",children:re.icon&&l.jsx(Ht,{url:re.icon,fill:L,hoverFill:w,className:Le(`${a}-arrow-img`,`${a}-mirror`)})})}),l.jsx("div",{className:Le(`${a}-arrow`,`${a}-next-arrow`),style:{width:$.scalingValue(m??.02,n??!1),height:$.scalingValue(m??.02,n??!1),"--arrow-hover-color":w},children:l.jsx("button",{type:"button",className:`${a}-arrow-inner`,onClick:ie,disabled:!Z,"aria-label":"Next testimonial",children:re.icon&&l.jsx(Ht,{url:re.icon,fill:L,hoverFill:w,className:`${a}-arrow-img`})})})]})]})})},sd=`import cn from 'classnames';\r
|
|
3151
3150
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\r
|
|
3152
3151
|
import { CommonComponentProps } from '../props';\r
|
|
3153
3152
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';\r
|
|
@@ -3300,11 +3299,13 @@ type RenderItemContentOpts = {\r
|
|
|
3300
3299
|
hideControls?: boolean;\r
|
|
3301
3300
|
};\r
|
|
3302
3301
|
\r
|
|
3302
|
+
const SLIDE_INTERVAL_BASE_MS = 3000;\r
|
|
3303
|
+
\r
|
|
3303
3304
|
export const TestimonialSingle = ({ settings, content, isEditor, isPreviewMode, isEditMode }: TestimonialsProps) => {\r
|
|
3304
3305
|
const { prefix: P } = useScopedStyles();\r
|
|
3305
3306
|
const items = content || [];\r
|
|
3306
|
-
const {
|
|
3307
|
-
const isAnimating =
|
|
3307
|
+
const { speed, align, width, imageMarginTop, textMarginTop, captionMarginTop, imageWidth, imageHeight, controlsWidth, controlsColor, controlsHoverColor } = settings;\r
|
|
3308
|
+
const isAnimating = speed > 0 && (!isEditor || Boolean(isPreviewMode));\r
|
|
3308
3309
|
const [activeIndex, setActiveIndex] = useState(0);\r
|
|
3309
3310
|
const [prevIndex, setPrevIndex] = useState<number | null>(null);\r
|
|
3310
3311
|
const [isFading, setIsFading] = useState(false);\r
|
|
@@ -3400,14 +3401,14 @@ export const TestimonialSingle = ({ settings, content, isEditor, isPreviewMode,
|
|
|
3400
3401
|
\r
|
|
3401
3402
|
useEffect(() => {\r
|
|
3402
3403
|
if (!isAnimating || !canSwitch) return;\r
|
|
3403
|
-
const
|
|
3404
|
+
const slideIntervalMs = Math.max(300, SLIDE_INTERVAL_BASE_MS / speed);\r
|
|
3404
3405
|
const id = window.setInterval(() => {\r
|
|
3405
3406
|
setActiveIndex((currentIndex) => commitTransition(currentIndex, (currentIndex + 1) % items.length));\r
|
|
3406
|
-
},
|
|
3407
|
+
}, slideIntervalMs);\r
|
|
3407
3408
|
return () => {\r
|
|
3408
3409
|
window.clearInterval(id);\r
|
|
3409
3410
|
};\r
|
|
3410
|
-
}, [isAnimating, canSwitch, commitTransition, items.length,
|
|
3411
|
+
}, [isAnimating, canSwitch, commitTransition, items.length, speed]);\r
|
|
3411
3412
|
\r
|
|
3412
3413
|
useEffect(() => {\r
|
|
3413
3414
|
return () => {\r
|
|
@@ -3625,8 +3626,7 @@ export type TestimonialsItem = {\r
|
|
|
3625
3626
|
};\r
|
|
3626
3627
|
\r
|
|
3627
3628
|
type TestimonialsSettings = {\r
|
|
3628
|
-
|
|
3629
|
-
delay: number;\r
|
|
3629
|
+
speed: number;\r
|
|
3630
3630
|
align: 'start' | 'center' | 'end';\r
|
|
3631
3631
|
width: number;\r
|
|
3632
3632
|
imageMarginTop?: number;\r
|
|
@@ -3642,11 +3642,11 @@ type TestimonialsSettings = {\r
|
|
|
3642
3642
|
icon?: string | null;\r
|
|
3643
3643
|
};\r
|
|
3644
3644
|
};\r
|
|
3645
|
-
`,
|
|
3645
|
+
`,ld="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>'),io={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},cd={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:{...io.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:{...io.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:ld},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"}]}]}]}},dd={element:ad,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:cd,sourceCode:sd,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function ud(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function oo(e){return((e==null?void 0:e.trim().length)??0)>0}function Dr(e,t,n,r){return t!==void 0&&t<(e??.01)?`${n} ${r}`:n}function jr(e,t,n,r){const i=e??.01;return t===void 0||t>=i?{}:{[`--${n}-title-leading-gap`]:$.scalingValue((i-t)/2,r)}}function pd(e){return`
|
|
3646
3646
|
.${e}-wrapper {
|
|
3647
3647
|
display: grid;
|
|
3648
3648
|
align-items: start;
|
|
3649
|
-
min-height: ${
|
|
3649
|
+
min-height: ${ud(48)};
|
|
3650
3650
|
}
|
|
3651
3651
|
.${e}-item {
|
|
3652
3652
|
display: flex;
|
|
@@ -3845,7 +3845,7 @@ type TestimonialsSettings = {\r
|
|
|
3845
3845
|
pointer-events: auto;
|
|
3846
3846
|
z-index: 10;
|
|
3847
3847
|
}
|
|
3848
|
-
`}const Lt=500,pd=750,Mt="cubic-bezier(0.22, 1, 0.36, 1)";function Ft(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function ao({media:e,className:t,style:n,onImageClick:r}){return Ft(e)?l.jsx("video",{src:e.url,className:t,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0}):l.jsx("img",{src:e.url,alt:e.name,className:t,style:n,onClick:r})}function md({images:e,index:t,imageDisplay:n,originRect:r,reverseClose:i,onClose:a,onPrev:s,onNext:c,counterClassName:o,counterStyle:d}){const p=n==="cover",T=u.useRef(null),b=u.useRef(null),[y,g]=u.useState(null),[h,P]=u.useState(r?"opening":"open"),[x,f]=u.useState(!0),C=u.useRef(t),B=u.useCallback(()=>{const I=T.current,$=b.current;if(!I||!$)return;const O=I.getBoundingClientRect(),V=O.width,q=O.height,X=$.naturalWidth,L=$.naturalHeight;if(!V||!q||!X||!L)return;if(n==="cover"){g({width:V,height:q,left:O.left,top:O.top});return}const R=X/L,H=V/q;if(R>H){const M=V/R;g({width:V,height:M,left:O.left,top:O.top+(q-M)/2})}else{const M=q*R;g({width:M,height:q,left:O.left+(V-M)/2,top:O.top})}},[n]);u.useEffect(()=>{B();const I=T.current;if(!I)return;const $=new ResizeObserver(()=>B());return $.observe(I),()=>$.disconnect()},[B,t]),u.useEffect(()=>{h==="opening"&&y&&P("open")},[h,y]),u.useEffect(()=>{if(h!=="closing")return;const I=setTimeout(()=>a(),Lt);return()=>clearTimeout(I)},[h,a]),u.useEffect(()=>{C.current!==t&&f(!1),C.current=t},[t]),u.useEffect(()=>{const I=$=>{$.key==="Escape"&&($.preventDefault(),$.stopPropagation(),h!=="closing"&&P("closing"))};return window.addEventListener("keydown",I,!0),()=>window.removeEventListener("keydown",I,!0)},[h]);const _=()=>{h!=="closing"&&P("closing")},E=h==="open",S=h==="closing",A=S&&i&&!!r,k=h==="opening"?r??y:A?r:y;return l.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:_,children:[l.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:E?1:0,transition:`opacity ${Lt}ms ${Mt}`,pointerEvents:"none"}}),l.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:T,style:{position:"absolute",inset:0}}),l.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:E?1:0,transition:`opacity ${Lt}ms ${Mt}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&l.jsxs("p",{className:o,style:d,children:[t+1," / ",e.length]})})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{height:"10%"}}),l.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:l.jsx("div",{ref:T,style:{width:"100%",height:"100%"}})}),l.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:E?1:0,transition:`opacity ${Lt}ms ${Mt}`},children:e.length>1&&l.jsxs("p",{className:o,style:d,children:[t+1," / ",e.length]})})]})}),k&&l.jsx("img",{ref:b,src:e[t],onLoad:B,style:{position:"fixed",top:k.top,left:k.left,width:k.width,height:k.height,objectFit:n==="cover"?"cover":"contain",opacity:S&&!A?0:1,transition:S&&!A?`opacity ${Lt}ms ${Mt}`:A||x?`top ${Lt}ms ${Mt}, left ${Lt}ms ${Mt}, width ${Lt}ms ${Mt}, height ${Lt}ms ${Mt}`:"none",pointerEvents:"none",zIndex:9998}}),E&&y&&l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{position:"fixed",top:y.top,left:y.left,width:y.width/2,height:y.height,cursor:"w-resize",zIndex:9999},onClick:I=>{I.stopPropagation(),s()}}),l.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:I=>{I.stopPropagation(),c()}})]})]})}function gd(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function hd({settings:e,content:t,isEditor:n,isPreviewMode:r,isEditMode:i,metadata:a,activeEvent:s,layoutId:c}){const{prefix:o}=w.useScopedStyles(),{type:d="a",gridLayout:p,textBoxWidth:T=100,verticalGap:b,entriesCount:y,lightbox:g,imageDisplay:h,lightboxImageDisplay:P,slider:x,sliderTiming:f,direction:C,transition:B,titleMarginTop:_,subtitleMarginTop:E,titleColor:S,subtitleColor:A,lightboxCounterColor:k,titleFontFamily:I,titleFontSettings:$,titleFontSize:O,titleLineHeight:V,titleLetterSpacing:q,titleWordSpacing:X,titleTextAppearance:L,subtitleFontFamily:R,subtitleFontSettings:H,subtitleFontSize:M,subtitleLineHeight:W,subtitleLetterSpacing:j,subtitleWordSpacing:Q,subtitleTextAppearance:oe,lightboxCounterFontFamily:te,lightboxCounterFontSettings:ce,lightboxCounterFontSize:v,lightboxCounterLineHeight:ie,lightboxCounterLetterSpacing:$e,lightboxCounterWordSpacing:de,lightboxCounterTextAppearance:ye,showText:Re="always",alignEntries:re="off"}=e,F={fontSettings:{fontFamily:I,fontWeight:($==null?void 0:$.fontWeight)??400,fontStyle:($==null?void 0:$.fontStyle)??"normal"},fontSize:O??.01,lineHeight:V,letterSpacing:q??0,wordSpacing:X??0,textAppearance:L,color:S},N={...Ct(nt(F,n))},D={fontSettings:{fontFamily:R,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:M??.01,lineHeight:W,letterSpacing:j??0,wordSpacing:Q??0,textAppearance:oe,color:A},ne={...Ct(nt(D,n))},ee={fontSettings:{fontFamily:te,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:v??.01,lineHeight:ie,letterSpacing:$e??0,wordSpacing:de??0,textAppearance:ye,color:k},ae={...Ct(nt(ee,n)),...jr(v,ie,o,n)},ge=Dr(O,V,`${o}-item-title`,`${o}-text-tight-leading`),me=Dr(M,W,`${o}-item-subtitle`,`${o}-text-tight-leading`),he=jr(O,V,o,n),K=jr(M,W,o,n),Y=Dr(v,ie,`${o}-lightbox-counter`,`${o}-text-tight-leading`),z=w.buildColorVars(o,{titleColor:S,subtitleColor:A,lightboxCounterColor:k},fd,yd),Ie=`${s&&s!=="default"?`${o}-state-${s}`:""}${Re==="on hover"&&(!n||r)?` ${o}-show-text-hover`:""}`.trim(),Je=y===0?1/0:y,Pe=(t??[]).slice(0,Je),Me=p.entryWidth??.2,Ee=(h==null?void 0:h.display)==="cover",je=(h==null?void 0:h.ratioValue)??"1:1",He=(h==null?void 0:h.reversed)??!1,[ke,Ve]=je.split(":").map(Number),bt=`${He?Ve:ke} / ${He?ke:Ve}`,Tt=w.scalingValue(Me??0,n),Kt=!Ee&&x!=="off",xt={width:Tt,...Ee?{aspectRatio:bt,height:"auto",overflow:"hidden"}:{height:"auto"}},Ut=`${o}-item-image-wrapper${Kt?` ${o}-item-image-wrapper-fit-slider`:""}`.trim(),ve=d==="c",Ge=ve&&re==="on",ze=`calc(${w.scalingValue(Me??0,n)} * (${T} / 100))`,rt=w.scalingValue(Me*T/100,n),wn=Ee?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[Tn,qt]=u.useState("ltr"),[tn,Ln]=u.useState(0),be=u.useRef(null);u.useEffect(()=>{const Te=be.current;if(!Te)return;const ot=new ResizeObserver(at=>{Ln(Math.round(at[0].contentRect.width))});return ot.observe(Te),()=>ot.disconnect()},[]);const Ye=(()=>{const Te={...z},ot=be.current?getComputedStyle(be.current).getPropertyValue("--cntrl-article-width").trim():"";return ot&&(Te["--cntrl-article-width"]=ot),Te})(),[De,Fe]=u.useState(!1),[it,Yn]=u.useState([]),[kr,nn]=u.useState(0),[Ir,Xn]=u.useState(null),Zn=(Te,ot,at)=>{if(n&&!r||g==="off")return;const G=Te.currentTarget.getBoundingClientRect();Xn({top:G.top,left:G.left,width:G.width,height:G.height}),Yn(ot),nn(at),Fe(!0)};u.useEffect(()=>{if(!De||g!=="on"||typeof document>"u")return;const Te=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Te}},[De,g]),u.useEffect(()=>{!n||r||(Fe(!1),Xn(null))},[n,r]);const Wr=u.useMemo(()=>ud(o),[o]);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:Wr}}),l.jsx("div",{style:z,children:l.jsx("div",{ref:be,className:`${o}-wrapper ${o}-type-${d}${Ge?` ${o}-align-entries`:""} ${Ie}`.trim(),style:{gridTemplateColumns:`repeat(${p.columnsCount}, minmax(0, 1fr))`,rowGap:Ge?0:w.scalingValue(b??0,n),columnGap:w.scalingValue(p.horizontalGap??0,n),width:w.scalingValue(p.wrapperWidth??0,n),...Ge?{[`--${o}-align-entries-row-gap`]:w.scalingValue(b??0,n)}:{}},children:Pe.map((Te,ot)=>{var Ue,ct;const at=oo(Te.title),G=oo(Te.subtitle),ue=(((Ue=Te.link)==null?void 0:Ue.length)??0)>0&&g==="off"?Te.link:void 0,pe=Math.floor(ot/p.columnsCount)===Math.ceil(Pe.length/p.columnsCount)-1,xe=ve?l.jsxs("div",{className:`${o}-item-text-block`,children:[at&&l.jsx("p",{className:ge,style:{width:ze,...N,...he},children:Te.title}),at&&l.jsx("div",{"data-controls":i?"titleMarginTop":void 0,className:i?`${o}-control`:void 0,style:{height:w.scalingValue(_??0,n),width:rt}}),G&&l.jsx("p",{className:me,style:{width:ze,...ne,...K},children:Te.subtitle}),G&&l.jsx("div",{"data-controls":i?"subtitleMarginTop":void 0,className:i?`${o}-control`:void 0,style:{height:w.scalingValue(E??0,n),width:rt}})]}):null,Be=ve?l.jsxs("div",{className:`${o}-item-title-row`,children:[at&&l.jsx("p",{className:ge,style:{width:ze,...N,...he},children:Te.title}),at&&l.jsx("div",{"data-controls":i?"titleMarginTop":void 0,className:i?`${o}-control`:void 0,style:{height:w.scalingValue(_??0,n),width:rt}})]}):null,Ke=ve?l.jsxs("div",{className:`${o}-item-subtitle-row`,children:[G&&l.jsx("p",{className:me,style:{width:ze,...ne,...K},children:Te.subtitle}),G&&l.jsx("div",{"data-controls":i?"subtitleMarginTop":void 0,className:i?`${o}-control`:void 0,style:{height:w.scalingValue(E??0,n),width:rt}})]}):null,Ce=ue?l.jsxs("a",{href:ue,target:"_blank",className:`${o}-item-text-link`,children:[Be,Ke]}):l.jsxs(l.Fragment,{children:[Be,Ke]}),st=l.jsx("div",{className:Ut,style:xt,children:(((ct=Te.image)==null?void 0:ct.length)??0)===0?null:x==="off"?(()=>{const _e=Te.image[0],et=Te.image.filter(Xe=>!Ft(Xe)).map(Xe=>Xe.url);return l.jsx(ao,{media:_e,className:`${o}-item-${Ft(_e)?"video":"image"}`.trim(),style:wn,onImageClick:Ft(_e)?void 0:Xe=>Zn(Xe,et,0)})})():l.jsxs(l.Fragment,{children:[Kt&&l.jsx("div",{className:`${o}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Te.image.map(_e=>Ft(_e)?l.jsx("video",{src:_e.url,muted:!0,playsInline:!0},`sizer-${_e.url}`):l.jsx("img",{src:_e.url,alt:""},`sizer-${_e.url}`))}),l.jsx(wi,{className:`${o}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:f*1e3,width:"100%",height:"100%",speed:pd,type:B==="fade"?"fade":"loop",rewind:B==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:B==="fade"?"ltr":C!=="random"?C==="horizontal"?"ltr":"ttb":Tn},onMoved:_e=>{if(C!=="random"||B==="fade")return;const Qe=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";qt(Qe),setTimeout(()=>{_e.refresh()},0)},children:Te.image.map((_e,Qe)=>{const et=Te.image.filter(qe=>!Ft(qe)),Xe=et.map(qe=>qe.url),rn=et.findIndex(qe=>qe.url===_e.url);return l.jsx(Ti,{children:l.jsx(ao,{media:_e,className:`${o}-item-${Ft(_e)?"video":"image"}`.trim(),style:wn,onImageClick:Ft(_e)?void 0:qe=>Zn(qe,Xe,rn)})},Qe)})},`${B}-${Me}-${C}-${f}-${tn}-${c}`)]})}),lt=ve?null:l.jsxs(l.Fragment,{children:[l.jsx("div",{"data-controls":i&&at?"titleMarginTop":void 0,className:i&&at?`${o}-control`:void 0,style:{height:at?w.scalingValue(_??0,n):0,width:rt}}),l.jsx("p",{className:ge,style:{width:ze,...N,...he},children:Te.title}),l.jsx("div",{"data-controls":i&&G?"subtitleMarginTop":void 0,className:i&&G?`${o}-control`:void 0,style:{height:G?w.scalingValue(E??0,n):0,width:rt}}),l.jsx("p",{className:me,style:{width:ze,...ne,...K},children:Te.subtitle})]});return l.jsx("div",{className:`${o}-item`.trim(),children:l.jsx("div",{className:`${i?`${o}-item-inner`:`${o}-item-inner-hidden`}${Ge&&pe?` ${o}-item-inner-last-row`:""}`.trim(),style:{width:(T??0)>100?`calc(${w.scalingValue(Me??0,n)} * (${T} / 100))`:w.scalingValue(Me??0,n)},children:Ge?l.jsxs(l.Fragment,{children:[Ce,l.jsx("a",{href:ue,target:"_blank",className:`${o}-item-image-link`,children:st})]}):l.jsxs("a",{href:ue,target:"_blank",className:`${o}-item-image-link`,children:[xe,st,lt]})})},ot)})})}),(!n||r)&&De&&typeof document<"u"&&g==="on"&&So.createPortal(l.jsx("div",{style:Ye,"data-selection":"none",children:l.jsx(md,{images:it,index:kr,imageDisplay:gd(P),originRect:Ir,reverseClose:x==="off",onClose:()=>Fe(!1),onPrev:()=>nn(Te=>(Te-1+it.length)%it.length),onNext:()=>nn(Te=>(Te+1)%it.length),counterClassName:Y,counterStyle:ae})}),document.body)]})}const fd={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},yd=["hover","focus","filled","success","error"],vd=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3848
|
+
`}const Lt=500,md=750,Mt="cubic-bezier(0.22, 1, 0.36, 1)";function Ft(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function ao({media:e,className:t,style:n,onImageClick:r}){return Ft(e)?l.jsx("video",{src:e.url,className:t,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0}):l.jsx("img",{src:e.url,alt:e.name,className:t,style:n,onClick:r})}function gd({images:e,index:t,imageDisplay:n,originRect:r,reverseClose:i,onClose:a,onPrev:s,onNext:c,counterClassName:o,counterStyle:p}){const d=n==="cover",T=u.useRef(null),b=u.useRef(null),[y,g]=u.useState(null),[m,L]=u.useState(r?"opening":"open"),[w,f]=u.useState(!0),S=u.useRef(t),M=u.useCallback(()=>{const E=T.current,R=b.current;if(!E||!R)return;const B=E.getBoundingClientRect(),V=B.width,U=B.height,J=R.naturalWidth,v=R.naturalHeight;if(!V||!U||!J||!v)return;if(n==="cover"){g({width:V,height:U,left:B.left,top:B.top});return}const W=J/v,H=V/U;if(W>H){const F=V/W;g({width:V,height:F,left:B.left,top:B.top+(U-F)/2})}else{const F=U*W;g({width:F,height:U,left:B.left+(V-F)/2,top:B.top})}},[n]);u.useEffect(()=>{M();const E=T.current;if(!E)return;const R=new ResizeObserver(()=>M());return R.observe(E),()=>R.disconnect()},[M,t]),u.useEffect(()=>{m==="opening"&&y&&L("open")},[m,y]),u.useEffect(()=>{if(m!=="closing")return;const E=setTimeout(()=>a(),Lt);return()=>clearTimeout(E)},[m,a]),u.useEffect(()=>{S.current!==t&&f(!1),S.current=t},[t]),u.useEffect(()=>{const E=R=>{R.key==="Escape"&&(R.preventDefault(),R.stopPropagation(),m!=="closing"&&L("closing"))};return window.addEventListener("keydown",E,!0),()=>window.removeEventListener("keydown",E,!0)},[m]);const _=()=>{m!=="closing"&&L("closing")},A=m==="open",x=m==="closing",P=x&&i&&!!r,k=m==="opening"?r??y:P?r:y;return l.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:_,children:[l.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:A?1:0,transition:`opacity ${Lt}ms ${Mt}`,pointerEvents:"none"}}),l.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:d?l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:T,style:{position:"absolute",inset:0}}),l.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:A?1:0,transition:`opacity ${Lt}ms ${Mt}`,pointerEvents:"none",zIndex:9999},children:e.length>1&&l.jsxs("p",{className:o,style:p,children:[t+1," / ",e.length]})})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{height:"10%"}}),l.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:l.jsx("div",{ref:T,style:{width:"100%",height:"100%"}})}),l.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:A?1:0,transition:`opacity ${Lt}ms ${Mt}`},children:e.length>1&&l.jsxs("p",{className:o,style:p,children:[t+1," / ",e.length]})})]})}),k&&l.jsx("img",{ref:b,src:e[t],onLoad:M,style:{position:"fixed",top:k.top,left:k.left,width:k.width,height:k.height,objectFit:n==="cover"?"cover":"contain",opacity:x&&!P?0:1,transition:x&&!P?`opacity ${Lt}ms ${Mt}`:P||w?`top ${Lt}ms ${Mt}, left ${Lt}ms ${Mt}, width ${Lt}ms ${Mt}, height ${Lt}ms ${Mt}`:"none",pointerEvents:"none",zIndex:9998}}),A&&y&&l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{position:"fixed",top:y.top,left:y.left,width:y.width/2,height:y.height,cursor:"w-resize",zIndex:9999},onClick:E=>{E.stopPropagation(),s()}}),l.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:E=>{E.stopPropagation(),c()}})]})]})}function hd(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function fd({settings:e,content:t,isEditor:n,isPreviewMode:r,isEditMode:i,metadata:a,activeEvent:s,layoutId:c}){const{prefix:o}=$.useScopedStyles(),{type:p="a",gridLayout:d,textBoxWidth:T=100,verticalGap:b,entriesCount:y,lightbox:g,imageDisplay:m,lightboxImageDisplay:L,slider:w,sliderTiming:f,direction:S,transition:M,titleMarginTop:_,subtitleMarginTop:A,titleColor:x,subtitleColor:P,lightboxCounterColor:k,titleFontFamily:E,titleFontSettings:R,titleFontSize:B,titleLineHeight:V,titleLetterSpacing:U,titleWordSpacing:J,titleTextAppearance:v,subtitleFontFamily:W,subtitleFontSettings:H,subtitleFontSize:F,subtitleLineHeight:I,subtitleLetterSpacing:K,subtitleWordSpacing:X,subtitleTextAppearance:re,lightboxCounterFontFamily:Z,lightboxCounterFontSettings:pe,lightboxCounterFontSize:C,lightboxCounterLineHeight:ie,lightboxCounterLetterSpacing:Se,lightboxCounterWordSpacing:ue,lightboxCounterTextAppearance:ye,showText:ne="always",alignEntries:ce="off"}=e,j={fontSettings:{fontFamily:E,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:B??.01,lineHeight:V,letterSpacing:U??0,wordSpacing:J??0,textAppearance:v,color:x},N={...Ct(nt(j,n))},O={fontSettings:{fontFamily:W,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:F??.01,lineHeight:I,letterSpacing:K??0,wordSpacing:X??0,textAppearance:re,color:P},oe={...Ct(nt(O,n))},te={fontSettings:{fontFamily:Z,fontWeight:(pe==null?void 0:pe.fontWeight)??400,fontStyle:(pe==null?void 0:pe.fontStyle)??"normal"},fontSize:C??.01,lineHeight:ie,letterSpacing:Se??0,wordSpacing:ue??0,textAppearance:ye,color:k},le={...Ct(nt(te,n)),...jr(C,ie,o,n)},ge=Dr(B,V,`${o}-item-title`,`${o}-text-tight-leading`),he=Dr(F,I,`${o}-item-subtitle`,`${o}-text-tight-leading`),z=jr(B,V,o,n),ae=jr(F,I,o,n),D=Dr(C,ie,`${o}-lightbox-counter`,`${o}-text-tight-leading`),ee=$.buildColorVars(o,{titleColor:x,subtitleColor:P,lightboxCounterColor:k},yd,vd),Xe=`${s&&s!=="default"?`${o}-state-${s}`:""}${ne==="on hover"&&(!n||r)?` ${o}-show-text-hover`:""}`.trim(),Oe=y===0?1/0:y,ke=(t??[]).slice(0,Oe),We=d.entryWidth??.2,Pe=(m==null?void 0:m.display)==="cover",je=(m==null?void 0:m.ratioValue)??"1:1",Ne=(m==null?void 0:m.reversed)??!1,[Re,Ve]=je.split(":").map(Number),bt=`${Ne?Ve:Re} / ${Ne?Re:Ve}`,Tt=$.scalingValue(We??0,n),Kt=!Pe&&w!=="off",xt={width:Tt,...Pe?{aspectRatio:bt,height:"auto",overflow:"hidden"}:{height:"auto"}},qt=`${o}-item-image-wrapper${Kt?` ${o}-item-image-wrapper-fit-slider`:""}`.trim(),ve=p==="c",Ge=ve&&ce==="on",ze=`calc(${$.scalingValue(We??0,n)} * (${T} / 100))`,rt=$.scalingValue(We*T/100,n),wn=Pe?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},[Tn,Ut]=u.useState("ltr"),[tn,Ln]=u.useState(0),be=u.useRef(null);u.useEffect(()=>{const Te=be.current;if(!Te)return;const ot=new ResizeObserver(at=>{Ln(Math.round(at[0].contentRect.width))});return ot.observe(Te),()=>ot.disconnect()},[]);const Ye=(()=>{const Te={...ee},ot=be.current?getComputedStyle(be.current).getPropertyValue("--cntrl-article-width").trim():"";return ot&&(Te["--cntrl-article-width"]=ot),Te})(),[De,Me]=u.useState(!1),[it,Yn]=u.useState([]),[Ir,nn]=u.useState(0),[kr,Xn]=u.useState(null),Zn=(Te,ot,at)=>{if(n&&!r||g==="off")return;const q=Te.currentTarget.getBoundingClientRect();Xn({top:q.top,left:q.left,width:q.width,height:q.height}),Yn(ot),nn(at),Me(!0)};u.useEffect(()=>{if(!De||g!=="on"||typeof document>"u")return;const Te=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Te}},[De,g]),u.useEffect(()=>{!n||r||(Me(!1),Xn(null))},[n,r]);const Wr=u.useMemo(()=>pd(o),[o]);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:Wr}}),l.jsx("div",{style:ee,children:l.jsx("div",{ref:be,className:`${o}-wrapper ${o}-type-${p}${Ge?` ${o}-align-entries`:""} ${Xe}`.trim(),style:{gridTemplateColumns:`repeat(${d.columnsCount}, minmax(0, 1fr))`,rowGap:Ge?0:$.scalingValue(b??0,n),columnGap:$.scalingValue(d.horizontalGap??0,n),width:$.scalingValue(d.wrapperWidth??0,n),...Ge?{[`--${o}-align-entries-row-gap`]:$.scalingValue(b??0,n)}:{}},children:ke.map((Te,ot)=>{var qe,ct;const at=oo(Te.title),q=oo(Te.subtitle),de=(((qe=Te.link)==null?void 0:qe.length)??0)>0&&g==="off"?Te.link:void 0,me=Math.floor(ot/d.columnsCount)===Math.ceil(ke.length/d.columnsCount)-1,Ce=ve?l.jsxs("div",{className:`${o}-item-text-block`,children:[at&&l.jsx("p",{className:ge,style:{width:ze,...N,...z},children:Te.title}),at&&l.jsx("div",{"data-controls":i?"titleMarginTop":void 0,className:i?`${o}-control`:void 0,style:{height:$.scalingValue(_??0,n),width:rt}}),q&&l.jsx("p",{className:he,style:{width:ze,...oe,...ae},children:Te.subtitle}),q&&l.jsx("div",{"data-controls":i?"subtitleMarginTop":void 0,className:i?`${o}-control`:void 0,style:{height:$.scalingValue(A??0,n),width:rt}})]}):null,He=ve?l.jsxs("div",{className:`${o}-item-title-row`,children:[at&&l.jsx("p",{className:ge,style:{width:ze,...N,...z},children:Te.title}),at&&l.jsx("div",{"data-controls":i?"titleMarginTop":void 0,className:i?`${o}-control`:void 0,style:{height:$.scalingValue(_??0,n),width:rt}})]}):null,Ke=ve?l.jsxs("div",{className:`${o}-item-subtitle-row`,children:[q&&l.jsx("p",{className:he,style:{width:ze,...oe,...ae},children:Te.subtitle}),q&&l.jsx("div",{"data-controls":i?"subtitleMarginTop":void 0,className:i?`${o}-control`:void 0,style:{height:$.scalingValue(A??0,n),width:rt}})]}):null,$e=de?l.jsxs("a",{href:de,target:"_blank",className:`${o}-item-text-link`,children:[He,Ke]}):l.jsxs(l.Fragment,{children:[He,Ke]}),st=l.jsx("div",{className:qt,style:xt,children:(((ct=Te.image)==null?void 0:ct.length)??0)===0?null:w==="off"?(()=>{const _e=Te.image[0],et=Te.image.filter(Ze=>!Ft(Ze)).map(Ze=>Ze.url);return l.jsx(ao,{media:_e,className:`${o}-item-${Ft(_e)?"video":"image"}`.trim(),style:wn,onImageClick:Ft(_e)?void 0:Ze=>Zn(Ze,et,0)})})():l.jsxs(l.Fragment,{children:[Kt&&l.jsx("div",{className:`${o}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Te.image.map(_e=>Ft(_e)?l.jsx("video",{src:_e.url,muted:!0,playsInline:!0},`sizer-${_e.url}`):l.jsx("img",{src:_e.url,alt:""},`sizer-${_e.url}`))}),l.jsx(wi,{className:`${o}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:f*1e3,width:"100%",height:"100%",speed:md,type:M==="fade"?"fade":"loop",rewind:M==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:M==="fade"?"ltr":S!=="random"?S==="horizontal"?"ltr":"ttb":Tn},onMoved:_e=>{if(S!=="random"||M==="fade")return;const Qe=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";Ut(Qe),setTimeout(()=>{_e.refresh()},0)},children:Te.image.map((_e,Qe)=>{const et=Te.image.filter(Ue=>!Ft(Ue)),Ze=et.map(Ue=>Ue.url),rn=et.findIndex(Ue=>Ue.url===_e.url);return l.jsx(Ti,{children:l.jsx(ao,{media:_e,className:`${o}-item-${Ft(_e)?"video":"image"}`.trim(),style:wn,onImageClick:Ft(_e)?void 0:Ue=>Zn(Ue,Ze,rn)})},Qe)})},`${M}-${We}-${S}-${f}-${tn}-${c}`)]})}),lt=ve?null:l.jsxs(l.Fragment,{children:[l.jsx("div",{"data-controls":i&&at?"titleMarginTop":void 0,className:i&&at?`${o}-control`:void 0,style:{height:at?$.scalingValue(_??0,n):0,width:rt}}),l.jsx("p",{className:ge,style:{width:ze,...N,...z},children:Te.title}),l.jsx("div",{"data-controls":i&&q?"subtitleMarginTop":void 0,className:i&&q?`${o}-control`:void 0,style:{height:q?$.scalingValue(A??0,n):0,width:rt}}),l.jsx("p",{className:he,style:{width:ze,...oe,...ae},children:Te.subtitle})]});return l.jsx("div",{className:`${o}-item`.trim(),children:l.jsx("div",{className:`${i?`${o}-item-inner`:`${o}-item-inner-hidden`}${Ge&&me?` ${o}-item-inner-last-row`:""}`.trim(),style:{width:(T??0)>100?`calc(${$.scalingValue(We??0,n)} * (${T} / 100))`:$.scalingValue(We??0,n)},children:Ge?l.jsxs(l.Fragment,{children:[$e,l.jsx("a",{href:de,target:"_blank",className:`${o}-item-image-link`,children:st})]}):l.jsxs("a",{href:de,target:"_blank",className:`${o}-item-image-link`,children:[Ce,st,lt]})})},ot)})})}),(!n||r)&&De&&typeof document<"u"&&g==="on"&&So.createPortal(l.jsx("div",{style:Ye,"data-selection":"none",children:l.jsx(gd,{images:it,index:Ir,imageDisplay:hd(L),originRect:kr,reverseClose:w==="off",onClose:()=>Me(!1),onPrev:()=>nn(Te=>(Te-1+it.length)%it.length),onNext:()=>nn(Te=>(Te+1)%it.length),counterClassName:D,counterStyle:le})}),document.body)]})}const yd={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},vd=["hover","focus","filled","success","error"],bd=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3849
3849
|
import '@splidejs/react-splide/css/core';
|
|
3850
3850
|
import { CommonComponentProps } from '../props';
|
|
3851
3851
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -5014,7 +5014,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
5014
5014
|
};
|
|
5015
5015
|
|
|
5016
5016
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
5017
|
-
`,zr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},bd=["titleColor","subtitleColor","lightboxCounterColor"],xd={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:"bird's eye view 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:"old city through the cracks",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",objectFit:"cover"}],link:""},{title:"private stone gardens",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",objectFit:"cover"},{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",objectFit:"cover"},{url:"https://cdn.cntrl.site/component-assets/grid(7).webp",objectFit:"cover"}],link:""},{title:"exiting the old town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(8).webp",objectFit:"cover"}],link:""},{title:"laundry 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:"city gates 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:"fortifications 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 Color",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Color",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Lightbox Counter Color",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...zr.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:{...zr.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:{...zr.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:[{type:"row",items:["__componentName__","name"]},"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:[{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:[{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:[...bd],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Cd={element:hd,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:xd,sourceCode:vd};function dr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Sd(e){return String(e??"").trim().length>0}function so(e,t){const n=e.currentTarget,r=n.getBoundingClientRect(),i=e.clientY-r.top>r.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,i)}function lo(e,t){const n=e.currentTarget,r=n.getBoundingClientRect(),i=e.clientY<r.top+r.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,i)}function co(e,t,n,r,i,a,s){const c=w.scalingValue(a,s),o=w.scalingValue(0,s),d=e===0,p=e===t-1&&!i;return{borderTopWidth:d&&n?c:o,borderBottomWidth:!p||r?c:o}}function $d(e,t,n){const r=w.scalingValue(t,n),i=w.scalingValue(0,n);return{borderTopWidth:i,borderBottomWidth:e?r:i}}const uo=10;function wd(e){return`
|
|
5017
|
+
`,zr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},xd=["titleColor","subtitleColor","lightboxCounterColor"],Cd={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:[{title:"Flying Over the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(1).webp",objectFit:"cover"}],link:""},{title:"Doors of Matera",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(2).webp",objectFit:"cover"}],link:""},{title:"Cattedrale di Santa Maria",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(3).webp",objectFit:"cover"}],link:""},{title:"City Through the Cracks",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(4).webp",objectFit:"cover"}],link:""},{title:"Private Stone Gardens",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(5).webp",objectFit:"cover"},{url:"https://cdn.cntrl.site/component-assets/grid(6).webp",objectFit:"cover"},{url:"https://cdn.cntrl.site/component-assets/grid(7).webp",objectFit:"cover"}],link:""},{title:"Exiting the Old Town",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(8).webp",objectFit:"cover"}],link:""},{title:"Under the Sun",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(9).webp",objectFit:"cover"}],link:""},{title:"Citygates View",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(10).webp",objectFit:"cover"}],link:""},{title:"Around the City",subtitle:"Leica M6 / SUMMICRON-M 50mm F2/ PORTRA 400",image:[{url:"https://cdn.cntrl.site/component-assets/grid(11).webp",objectFit:"cover"}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:4},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gap",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},entriesCount:{type:"number",scope:"layout",title:"Entries #",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...zr.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:{...zr.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:{...zr.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:[...xd],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Sd={element:fd,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:Cd,sourceCode:bd};function $d(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 wd({media:e,className:t,style:n}){const r=u.useRef(null);return u.useEffect(()=>{if(!e.isVideo)return;const i=r.current;if(!i)return;const a=i.play();a&&a.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?l.jsx("video",{ref:r,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):l.jsx("img",{className:t,src:e.url,alt:"",style:n})}function dr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Td(e){return String(e??"").trim().length>0}function so(e,t){const n=e.currentTarget,r=n.getBoundingClientRect(),i=e.clientY-r.top>r.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,i)}function lo(e,t){const n=e.currentTarget,r=n.getBoundingClientRect(),i=e.clientY<r.top+r.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,i)}function co(e,t,n,r,i,a,s){const c=$.scalingValue(a,s),o=$.scalingValue(0,s),p=e===0,d=e===t-1&&!i;return{borderTopWidth:p&&n?c:o,borderBottomWidth:!d||r?c:o}}function Ld(e,t,n){const r=$.scalingValue(t,n),i=$.scalingValue(0,n);return{borderTopWidth:i,borderBottomWidth:e?r:i}}const uo=10;function Ed(e){return`
|
|
5018
5018
|
.${e}-wrapper {
|
|
5019
5019
|
display: grid;
|
|
5020
5020
|
align-items: start;
|
|
@@ -5024,14 +5024,14 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
5024
5024
|
box-sizing: border-box;
|
|
5025
5025
|
}
|
|
5026
5026
|
|
|
5027
|
-
.${e}-hover-image
|
|
5027
|
+
.${e}-hover-image,
|
|
5028
|
+
.${e}-hover-video {
|
|
5028
5029
|
position: absolute;
|
|
5029
5030
|
left: 0;
|
|
5030
5031
|
top: 0;
|
|
5031
5032
|
z-index: 10;
|
|
5032
5033
|
pointer-events: none;
|
|
5033
5034
|
display: block;
|
|
5034
|
-
height: auto;
|
|
5035
5035
|
}
|
|
5036
5036
|
|
|
5037
5037
|
.${e}-list-item {
|
|
@@ -5445,7 +5445,7 @@ a.${e}-list-item {
|
|
|
5445
5445
|
overflow-wrap: anywhere;
|
|
5446
5446
|
word-break: break-word;
|
|
5447
5447
|
}
|
|
5448
|
-
`}const Vt=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Li=["AColumn","BColumn","CColumn","DColumn","EColumn"],kt="cutLabel",Ei=[...Li,kt],Rr=["A","B","C","D","E"];function aa(e){return`${e}ColumnVerticalAlign`}const ri=["Top","Center","Bottom"];function Pi(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const r=t.slice(-1).toUpperCase();return Rr.includes(r)?`Baseline ${r}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Td(e){const t=Pi(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Ld(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Rr.includes(n)?n:null}function sa(e,t,n){const r=Ld(e);return r?r===t?!1:Td(n[aa(r)]):!0}function Hn(e){const t=Pi(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Rr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Ed(e,t,n){if(la(e,t,n))return Hn(e);const r=Hn(e);return r.kind==="baseline"?{kind:"top"}:r}function Pd(e){const t=Hn(e);return t.kind==="baseline"?{kind:"top"}:t}function la(e,t,n){return sa(e,n,t)?Hn(e).kind==="baseline":!1}function _d(e){const t={};let n=!1;for(const r of Rr){const i=aa(r),a=e[i];if(e.type==="b"){const s=String(a??"Top").trim();s!=="Top"&&s!=="Center"&&s!=="Bottom"&&(t[i]="Top",n=!0);continue}sa(a,r,e)||(t[i]="Top",n=!0)}return n?t:null}function Ad(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Rd(e){const t=Hn(e).kind;return t==="baseline"?"center":t}function kd(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function po(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Id(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:r}=e.getBoundingClientRect(),{bottom:i}=n.getBoundingClientRect(),a=i-r;return n.remove(),a}function Kr(e,t,n,r){const i=e.titleEl;if(!i)return 0;const a=i.closest(`.${n}`);if(!a)return 0;const s=Id(i,r);if(e.kind==="baseline")return i.getBoundingClientRect().top-t+s;const c=a.getBoundingClientRect(),o=i.getBoundingClientRect().height;let d=0;return e.kind==="center"?d=(c.height-o)/2:e.kind==="bottom"&&(d=c.height-o),c.top-t+d+s}function Wd(e,t,n){const r=e.getBoundingClientRect().height;return r<=0?0:(t.forEach(i=>{const a=i.querySelector(`.${n}`);a&&(a.style.minHeight=`${r}px`,a.style.height=`${r}px`)}),r)}function Md(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Fd={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Se(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Nd={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Hd(e){return[Se(e,"textFontFamily"),Se(e,"textFontSettings"),{type:"row",items:[Se(e,"textFontSize"),Se(e,"textLineHeight"),Se(e,"textLetterSpacing"),Se(e,"textWordSpacing")]},Se(e,"textTextAlign"),Se(e,"textTextAppearance"),`${e}VerticalAlign`]}function Bd(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Ei.map(e=>[Nd[e],Hd(e)]))}}function vr(e,t){const n=r=>{const i=Se(t,r);return e[i]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===kt?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function mo(e,t){var r,i;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((r=e.textFontSettings)==null?void 0:r.fontWeight)??400,fontStyle:((i=e.textFontSettings)==null?void 0:i.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 Ct(nt(n,t))}function go(e,t,n,r){const i=vr(e,t),a=i.textFontSize??.01,s=i.textLineHeight;return s!==void 0&&s<a?`${n} ${r}`:n}function ho(e,t,n,r){const i=vr(e,t),a=i.textFontSize??.01,s=i.textLineHeight;return s===void 0||s>=a?{}:{[`--${n}-title-leading-gap`]:w.scalingValue((a-s)/2,r)}}const mt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],yn=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],vn=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],bn=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Od={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Vd=["hover","focus","filled","success","error"],fo=.004,dn=.004,Ur=dn,yo=12,_i=50,Bn=1440,On=_i/Bn;function ca(e){const t=typeof e=="number"&&e>0?e:Bn;return _i/t}function Dd(e,t){const n={position:"absolute",width:yo,height:yo,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 Et({P:e,className:t,areaStyle:n,hitPlacement:r,...i}){return l.jsx("div",{className:t,style:{...n,pointerEvents:"none"},...i,children:l.jsx("div",{style:Dd(e,r)})})}function jd(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const i=parseFloat(n);if(Number.isFinite(i)&&i>0)return i}const r=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(r){const i=parseFloat(r);if(Number.isFinite(i)&&i>0)return i}t=t.parentElement}return Bn}const da={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function _n(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function zd(e,t=1){const n=t/e;return Object.fromEntries(mt.map(r=>[r,n]))}function Kd(){return Object.fromEntries([...yn.map(e=>[e,0]),...vn.map(e=>[e,0])])}function Ud(){return Object.fromEntries(bn.map(e=>[e,0]))}function ir(e){return Object.fromEntries(mt.map(t=>[t,typeof e[t]=="number"?e[t]:da[t]]))}function ua(e,t,n){const r=e-On,i=t+n;if(i<=0||i<=r)return{paddingLeft:t,paddingRight:n};if(r<=0)return{paddingLeft:0,paddingRight:0};const a=r/i;return{paddingLeft:t*a,paddingRight:n*a}}function ur(e,t,n){const r=Ai(e,t,n);if(e<=0)return[];const i=r.slice(0,e-1).reduce((a,s)=>a+s,0);return[...r.slice(0,e-1),Math.max(0,t-i)]}function qd(e,t,n){const r={};for(let i=0;i<e;i+=1){const a=yn[i],s=vn[i],c=typeof n[a]=="number"?n[a]:0,o=typeof n[s]=="number"?n[s]:0,d=ua(t[i]??0,c,o);d.paddingLeft!==c&&(r[a]=d.paddingLeft),d.paddingRight!==o&&(r[s]=d.paddingRight)}return r}function Ai(e,t,n){if(e<=0)return[];const r=mt.slice(0,e).map(d=>n[d]);if(e===1)return r;const i=r.slice(0,e-1),s=i.reduce((d,p)=>d+p,0)+On;if(t>=s)return r;const c=[...i];let o=s-t;for(let d=c.length-1;d>=0&&o>0;d-=1){const p=c[d]-On;if(p<=0)continue;const T=Math.min(o,p);c[d]-=T,o-=T}return[...c,r[e-1]]}function Gd(e,t,n){if(e<=1)return{};const r=Ai(e,t,n),i={};for(let a=0;a<e-1;a+=1){const s=mt[a];r[a]!==n[s]&&(i[s]=r[a])}return i}function vo(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Vt]}function Yd(e,t){return e.length!==t.length?!1:e.every((n,r)=>n===t[r])}function Xd(e,t,n,r){const i=Math.min(r,e.length,mt.length),a={};for(let s=0;s<i;s+=1){const c=e[s],o=t.indexOf(c);if(o===-1)continue;const d=mt[o],p=yn[o],T=vn[o],b=bn[o],y=mt[s],g=yn[s],h=vn[s],P=bn[s],x=n[d],f=n[p],C=n[T],B=n[b];typeof x=="number"&&(a[y]=x),typeof f=="number"&&(a[g]=f),typeof C=="number"&&(a[h]=C),typeof B=="number"&&(a[P]=B)}return a}function pa(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const r of n)if(e[r]!==t[r])return!0;return!1}function Zd(e,t){const n=e.columns,r=t.columns;if(typeof n!="number"||n===r)return e;const i=_n(e),a=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...zd(n,i),...Kd()};if(a)for(const c of bn)typeof t[c]=="number"&&(s[c]=t[c]);else Object.assign(s,Ud());return pa(e,s)?s:e}function Jd(e,t,n){const r=_d(e);r&&(e={...e,...r});const i=ca(n==null?void 0:n.designWidth),a=e.columns,s=t.columns,c=_n(e),o=_n(t),d=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof a=="number"?a:typeof s=="number"?s:Vt.length,T=C=>{if(d)return C;const B=ir({...t,...C}),_=_n(C),E=ur(p,_,B),S=qd(p,E,{...t,...C});return Object.keys(S).length===0?C:{...C,...S}};if(typeof a=="number"&&a!==s)return e;const b=vo(e),y=vo(t);if(!Yd(b,y))return T({...e,...Xd(b,y,t,p)});if(c<o&&typeof p=="number"&&!d){const C=ir({...t,...e});return T({...e,...Gd(p,c,C)})}if(d){const C=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,B=Math.max(0,(c-i)/2);return C>B?{...e,textPaddingLR:B}:e}const g=ir({...t,...e}),h=ur(p,o,ir(t)),x=ur(p,c,g).some((C,B)=>C<(h[B]??C)),f=mt.some(C=>{const B=e[C],_=t[C];return typeof B=="number"&&typeof _=="number"&&B!==_});return x||f?T(e):e}function Qd(e,t,n,r){const i=t.slice(0,e).reduce((s,c)=>s+c,0),a=n.slice(e+1,t.length-1).reduce((s,c)=>s+c,0);return Math.max(On,r-i-a-On)}function eu(e,t){return Math.random()*(t-e)+e}function tu(e){return Object.fromEntries(mt.map(t=>[t,typeof e[t]=="number"?e[t]:da[t]]))}function qr(e,t,n=0){return Object.fromEntries(t.map(r=>[r,typeof e[r]=="number"?e[r]:n]))}function nu(e,t,n,r,i,a){return e.slice(0,t).map((s,c)=>{const o=yn[c],d=vn[c],p=bn[c];return{key:s,textPrefix:Fd[s],widthKey:mt[c],width:n[mt[c]],paddingLeftKey:o,paddingRightKey:d,paddingBottomKey:p,paddingLeft:r[o],paddingRight:i[d],paddingBottom:a[p]}})}function ru({settings:e,content:t,isEditor:n,isPreviewMode:r,isEditMode:i,activeEvent:a,layoutId:s,onUpdateSettings:c}){const{prefix:o}=w.useScopedStyles(),d=!!i,{columns:p,type:T,wrapperWidth:b,entriesCount:y,cellMinHeight:g,dividerWidth:h,showVisibility:P,cut:x,showCut:f,cutCellMinHeight:C,cutLabel:B,imageSize:_,imageOnHover:E,entryHoverEffect:S,entryHoverShowOption:A,rowPaddingTop:k,rowPaddingBottom:I,rowPaddingTopB:$,columnsOrder:O,textPaddingLR:V,textColor:q,backgroundColor:X,dividerColor:L,textHoverColor:R,backgroundHoverColor:H,dividerHoverColor:M}=e,[W,j]=u.useState(void 0),[Q,oe]=u.useState(null),te=E==="on"&&(!n||r),ce=(x??0)>0,v=T==="b",ie=u.useRef(null),$e=u.useRef(null),[de,ye]=u.useState(null),[Re,re]=u.useState(Bn),F=ca(Re),m=Math.max(0,((b??0)-F)/2),N=Math.min(V??0,m),D=Math.max(N,dn),U=((b??0)+F)/2;u.useLayoutEffect(()=>{if(!n){re(Bn);return}const G=()=>{re(jd(ie.current))};G();const ue=ie.current;if(!ue)return;const pe=new ResizeObserver(G);pe.observe(ue);let xe=ue;for(;xe&&!xe.style.getPropertyValue("--cntrl-article-width");)xe=xe.parentElement;return xe&&pe.observe(xe),()=>pe.disconnect()},[n,s]),u.useEffect(()=>{j(void 0)},[x,f,t,y]),u.useEffect(()=>{n&&!r&&j(void 0)},[n,r]);const ne=w.buildColorVars(o,{textColor:q,backgroundColor:X,dividerColor:L,textHoverColor:R,backgroundHoverColor:H,dividerHoverColor:M},Od,Vd),ee=a&&a!=="default"?`${o}-state-${a}`:"",ae=`${!n||r?S==="default"?`${o}-entry-hover-default`:S==="blinds"?`${o}-entry-hover-blinds`:S==="reveal"?`${o}-entry-hover-reveal`:"":""} ${ee}`.trim(),ge=S==="reveal"&&(!n||r),me=(P==null?void 0:P[0])??!1,he=(P==null?void 0:P[1])??!1,K=u.useRef(e),Y=u.useRef(s);u.useEffect(()=>{if(!c||!n){K.current=e,Y.current=s;return}if(Y.current!==s){K.current=e,Y.current=s;return}const G=K.current;if(!(G!==e))return;if(typeof G.columns=="number"&&typeof e.columns=="number"&&G.columns!==e.columns){K.current=e;return}const pe=Jd(e,G,{designWidth:Re});K.current=e,pa(e,pe)&&c(pe)},[e,c,n,s,Re]);const z=u.useMemo(()=>tu(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),le=u.useMemo(()=>qr(e,yn),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),we=u.useMemo(()=>qr(e,vn),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ie=u.useMemo(()=>qr(e,bn),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Je=u.useMemo(()=>Array.isArray(O)&&O.length>0?O:[...Vt],[O]),Pe=u.useMemo(()=>nu(Je,p,z,le,we,Ie),[Je,p,z,le,we,Ie]),Me=_n(e),Ee=u.useMemo(()=>mt.slice(0,p).map(G=>z[G]),[p,z]),je=u.useMemo(()=>Ai(p,Me,z),[p,Me,z]),He=u.useMemo(()=>ur(p,Me,z),[p,Me,z]),ke=u.useMemo(()=>Pe.map((G,ue)=>ua(He[ue]??0,G.paddingLeft,G.paddingRight)),[Pe,He]),Ve=u.useMemo(()=>{const G=y===0?1/0:y;return(t??[]).slice(0,G).map((pe,xe)=>({id:xe,cells:Object.fromEntries(Vt.map(Be=>[Be,pe[Be]??""])),image:pe.image,link:pe.link}))},[t,y]),dt=ce?W??x:Ve.length,vt=u.useMemo(()=>ce?Ve.slice(0,dt):Ve,[Ve,ce,dt]),bt=ce&&dt<Ve.length,Tt=vt.length>1||bt,Kt=[me?`${o}-divider-top`:"",he||Tt?`${o}-divider-bottom`:""].filter(Boolean).join(" "),xt=!n||r,Ut=()=>{if(!xt)return;const G=W??x;if(!f){j(Ve.length);return}j(Math.min(G+f,Ve.length))},ve=G=>w.scalingValue(G,n??!1),Ge=v?$??0:k??0,ze=I??0,rt=g??0,wn=Ge+rt/2,Tn=Math.max(ze,Ur),qt=co(0,vt.length,me,he,bt,h??0,n??!1).borderTopWidth,tn=de!=null?`${de}px`:`calc(${qt} + ${ve(wn)})`,Ln=v?"rowPaddingTopB":"rowPaddingTop",be=Pe[0],Ye=Pe[Pe.length-1],De=ke[0],Fe=ke[ke.length-1],it=be&&De?Math.max(De.paddingLeft,dn):0,Yn=Ye&&Fe?Math.max(Fe.paddingRight,dn):0,kr=Me,nn=G=>{const ue=ie.current;if(!ue)return{x:0,y:0};const pe=ue.getBoundingClientRect();return{x:G.clientX-pe.left+uo,y:G.clientY-pe.top+uo}},Ir=(G,ue)=>{if(!te)return;const pe=G.image;if(!(pe!=null&&pe.url)){oe(null);return}const{x:xe,y:Be}=nn(ue),Ke=(_==null?void 0:_.min)??80,Ce=(_==null?void 0:_.max)??320,st=(Q==null?void 0:Q.rowId)===G.id?Q.widthPx:eu(Ke,Ce);oe({rowId:G.id,url:pe.url,objectFit:pe.objectFit??"cover",widthPx:st,x:xe,y:Be})},Xn=G=>{if(!te||!Q)return;const{x:ue,y:pe}=nn(G);oe(xe=>!xe||xe.x===ue&&xe.y===pe?xe:{...xe,x:ue,y:pe})},Zn=()=>{oe(null)},Wr=G=>{ge&&so(G,o),te&&oe(null)},Te=G=>{ge&&lo(G,o)};u.useLayoutEffect(()=>{if(!d||v){ye(null);return}const G=$e.current,ue=G==null?void 0:G.parentElement;if(!G||!ue){ye(null);return}const pe=()=>{const Be=G.querySelector("[data-list-row]");if(!Be){ye(null);return}const Ke=ue.getBoundingClientRect(),Ce=Be.getBoundingClientRect();ye(Ce.top-Ke.top+Ce.height/2)};pe();const xe=new ResizeObserver(pe);return xe.observe(G),xe.observe(ue),()=>xe.disconnect()},[d,v,vt,Ge,ze,rt,t,e,Pe,He,Re,h,me,he,bt]);const ot=u.useMemo(()=>!v&&Li.some(G=>{const ue=G.charAt(0),pe=e[`${G}VerticalAlign`];return la(pe,e,ue)}),[v,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);u.useLayoutEffect(()=>{var st;const G=ie.current;if(!G)return;const ue=()=>{G.querySelectorAll("[data-list-col]").forEach(lt=>{lt.style.transform="";const Ue=lt.querySelector(`.${o}-list-col`);Ue&&(Ue.style.minHeight="",Ue.style.height="");const ct=lt.querySelector(`.${o}-list-col-title`);ct&&(ct.style.transform="")})};if(v||!ot){ue();return}const pe=()=>{const lt=Array.from(G.querySelectorAll("[data-list-row]")),Ue=`${o}-list-col`,ct=`${o}-baseline-probe`;lt.forEach(_e=>{_e.querySelectorAll("[data-list-col]").forEach(Qe=>{Qe.style.transform="";const et=Qe.querySelector(`.${Ue}`);et&&(et.style.minHeight="",et.style.height="");const Xe=Qe.querySelector(`.${o}-list-col-title`);Xe&&(Xe.style.transform="")})}),lt.forEach(_e=>{const Qe=Array.from(_e.querySelectorAll("[data-list-col]"));Wd(_e,Qe,Ue)}),G.offsetHeight,lt.forEach(_e=>{const Qe=Array.from(_e.querySelectorAll("[data-list-col]")),et=_e.getBoundingClientRect().top,Xe=new Map,rn=Qe.map(Ne=>{const on=Ne.querySelector(`.${o}-list-col-title`),an={el:Ne,titleEl:on,letter:Ne.getAttribute("data-col-letter")??"",kind:Ne.getAttribute("data-valign")??"top",anchor:Ne.getAttribute("data-valign-anchor")};return Xe.set(an.letter,an),an}),qe=new Map,Jn=(Ne,on)=>{const an=qe.get(Ne.letter);if(an!==void 0)return an;const Ri=Ne.anchor?Xe.get(Ne.anchor):void 0;if(Ne.kind!=="baseline"||!Ri||on.has(Ne.letter)){const Ii=Kr(Ne,et,Ue,ct);return qe.set(Ne.letter,Ii),Ii}on.add(Ne.letter);const ga=Jn(Ri,on);on.delete(Ne.letter);const ha=Kr(Ne,et,Ue,ct),fa=ga-ha;Md(Ne.titleEl,fa);const ki=Kr(Ne,et,Ue,ct);return qe.set(Ne.letter,ki),ki};rn.forEach(Ne=>Jn(Ne,new Set))})};let xe=null;const Be=()=>{xe===null&&(xe=requestAnimationFrame(()=>{xe=null,pe()}))};pe();const Ke=new ResizeObserver(()=>Be());Ke.observe(G);let Ce=!1;return typeof document<"u"&&((st=document.fonts)!=null&&st.ready)&&document.fonts.ready.then(()=>{Ce||Be()}),()=>{Ce=!0,xe!==null&&(cancelAnimationFrame(xe),xe=null),Ke.disconnect(),ue()}},[ot,v,e,t,Re,vt,He]);const at=u.useMemo(()=>wd(o),[o]);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:at}}),l.jsx("div",{style:ne,children:l.jsxs("div",{ref:ie,className:`${o}-wrapper ${ae}${Kt?` ${Kt}`:""}${v?` ${o}-type-b`:""}`.trim(),style:{width:w.scalingValue(b??0,n),...!v&&d?{[`--${o}-first-entry-handle-top`]:tn}:{}},onMouseMove:te?Xn:void 0,onMouseLeave:te?Zn:void 0,children:[l.jsxs("div",{style:{width:"100%",position:"relative"},children:[vt.map((G,ue)=>{var Ke;const pe=(((Ke=G.link)==null?void 0:Ke.length)??0)>0,xe=pe&&(!n||r)?"a":"div",Be=co(ue,vt.length,me,he,bt,h??0,n??!1);return l.jsxs(xe,{ref:ue===0?Ce=>{$e.current=Ce}:void 0,className:`${o}-list-item${pe||A==="always"?` ${o}-list-item-has-link`:""}`,...pe?{href:G.link,target:"_blank"}:{},style:Be,onMouseEnter:Ce=>{ge&&(pe||A==="always")&&so(Ce,o),te&&Ir(G,Ce)},onMouseLeave:Ce=>{ge&&(pe||A==="always")&&lo(Ce,o)},children:[Ge>0&&l.jsx("div",{className:`${o}-row-padding-handle`,style:{height:ve(Ge)}}),l.jsxs("div",{className:`${o}-list-cols-row${v?"":` ${o}-list-cols-row-h`}${d&&ue===0&&v?` ${o}-list-cols-row-controls`:""}`,...v?{}:{"data-list-row":""},style:v?void 0:{minHeight:ve(rt)},children:[Pe.map((Ce,st)=>{const lt=st===Pe.length-1,Ue=ke[st],ct=Ce.paddingBottom,_e=Sd(G.cells[Ce.key]),Qe=v&&_e&&ct>0,et=v?{minHeight:ve(rt)}:{width:ve(He[st])},Xe=v?{paddingLeft:ve(N),paddingRight:ve(N)}:{paddingLeft:ve(Ue.paddingLeft),paddingRight:ve(Ue.paddingRight)},rn=Ce.textPrefix.charAt(0),qe=v?Pd(e[`${Ce.textPrefix}VerticalAlign`]):Ed(e[`${Ce.textPrefix}VerticalAlign`],e,rn),Jn=v&&_e&&d&&ue===0;return l.jsxs("div",{className:v?`${o}-list-col-wrap`:void 0,...v?{}:{"data-list-col":"","data-col-letter":rn,"data-valign":qe.kind,...qe.kind==="baseline"?{"data-valign-anchor":qe.anchorLetter}:{}},children:[l.jsx("div",{className:`${o}-list-col${lt?` ${o}-list-col-last`:""}`,style:{...Xe,...et,...v?{justifyContent:po(qe.kind)}:{}},"data-test":Ce.width,children:l.jsx("span",{className:go(e,Ce.textPrefix,`${o}-list-col-title`,`${o}-text-tight-leading`),style:{...mo(vr(e,Ce.textPrefix),n),...ho(e,Ce.textPrefix,o,n),...v?{}:Ad(qe.kind)},children:G.cells[Ce.key]??null})}),Qe&&l.jsx("div",{className:`${o}-row-padding-handle`,style:{height:ve(ct)}}),Jn&&l.jsx(Et,{P:o,"data-controls":Ce.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${o}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:ve(Math.max(ct,Ur))}})]},Ce.key)}),d&&ue===0&&v&&l.jsxs(l.Fragment,{children:[l.jsx(Et,{P:o,"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(U),className:`${o}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:ve(D),height:"100%"}}),l.jsx(Et,{P:o,"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(U),className:`${o}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:ve(Math.max(D,Me-D)),width:ve(D),height:"100%"}})]})]}),!v&&ze>0&&l.jsx("div",{className:`${o}-row-padding-handle`,style:{height:ve(ze)}}),d&&ue===0&&!v&&l.jsx(Et,{P:o,"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:`${o}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:ve(Tn)}})]},G.id)}),d&&l.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:l.jsx(Et,{P:o,"data-controls":Ln,"data-controls-static-handle":"",...v?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${o}-padding-control-handle`,hitPlacement:v?"center":"left-y",areaStyle:{position:"absolute",top:qt,left:0,width:"100%",height:ve(Math.max(Ge,Ur))}})},"row-padding-handles"),d&&!v&&be&&Ye&&l.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[l.jsx(Et,{P:o,"data-controls":be.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(He[0]-((De==null?void 0:De.paddingRight)??0)),className:`${o}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:ve(it),height:"100%"}}),l.jsx(Et,{P:o,"data-controls":Ye.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(He[Pe.length-1]-((Fe==null?void 0:Fe.paddingLeft)??0)),className:`${o}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:ve(kr-Yn),width:ve(Yn),height:"100%"}})]},"column-edge-padding-handles"),d&&!v&&Pe.slice(0,-1).map((G,ue)=>{const pe=Pe[ue+1],xe=je.slice(0,ue+1).reduce((lt,Ue)=>lt+Ue,0),Be=ke[ue],Ke=ke[ue+1],Ce=Math.max(Be.paddingRight,dn),st=Math.max(Ke.paddingLeft,dn);return l.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[l.jsx(Et,{P:o,"data-controls":G.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(He[ue]-Be.paddingLeft),className:`${o}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:ve(xe-Ce),width:ve(Ce),height:"100%"}}),l.jsx(Et,{P:o,"data-controls":pe.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(He[ue+1]-Ke.paddingRight),className:`${o}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:ve(xe),width:ve(st),height:"100%"}})]},`${G.paddingRightKey}-padding`)}),d&&!v&&Pe.slice(0,-1).map((G,ue)=>{const pe=Qd(ue,je,Ee,Me),Be=je.slice(0,ue+1).reduce((Ke,Ce)=>Ke+Ce,0)-fo/2;return l.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:l.jsx("div",{"data-controls":G.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(_i),"data-controls-max-fraction":String(pe),"data-controls-variant":"column-width",className:`${o}-col-resize-handle`,style:{position:"absolute",top:"0px",left:ve(Be),width:ve(fo),height:"calc(100%)",pointerEvents:"auto"}})},`${G.widthKey}-junction`)})]}),bt&&(()=>{const G=vr(e,kt),ue=Rd(e.cutLabelVerticalAlign),pe=G.textTextAlign==="justify"||v;return l.jsx("button",{type:"button",className:`${o}-cut-item`,style:{minHeight:ve(C??0),cursor:xt?"pointer":"default",...$d(he,h??0,n??!1)},onClick:xt?Ut:void 0,onMouseEnter:ge||te?Wr:void 0,onMouseLeave:ge?Te:void 0,children:l.jsx("div",{className:`${o}-list-cols-row`,style:{...v?{paddingLeft:ve(N),paddingRight:ve(N)}:{},justifyContent:kd(G.textTextAlign),alignItems:po(ue)},children:l.jsx("span",{className:go(e,kt,`${o}-cut-label`,`${o}-text-tight-leading`),style:{...mo(G,n),...ho(e,kt,o,n),...pe?{width:"100%"}:{}},children:B})})})})(),te&&Q&&l.jsx("img",{className:`${o}-hover-image`,src:Q.url,alt:"",style:{width:dr(Q.widthPx),objectFit:Q.objectFit,left:Q.x,top:Q.y}})]})})]})}const iu=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ComponentPropsWithoutRef } from 'react';
|
|
5448
|
+
`}const Vt=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Li=["AColumn","BColumn","CColumn","DColumn","EColumn"],It="cutLabel",Ei=[...Li,It],Rr=["A","B","C","D","E"];function aa(e){return`${e}ColumnVerticalAlign`}const ri=["Top","Center","Bottom"];function Pi(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const r=t.slice(-1).toUpperCase();return Rr.includes(r)?`Baseline ${r}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Pd(e){const t=Pi(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function _d(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Rr.includes(n)?n:null}function sa(e,t,n){const r=_d(e);return r?r===t?!1:Pd(n[aa(r)]):!0}function Hn(e){const t=Pi(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Rr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Ad(e,t,n){if(la(e,t,n))return Hn(e);const r=Hn(e);return r.kind==="baseline"?{kind:"top"}:r}function Rd(e){const t=Hn(e);return t.kind==="baseline"?{kind:"top"}:t}function la(e,t,n){return sa(e,n,t)?Hn(e).kind==="baseline":!1}function Id(e){const t={};let n=!1;for(const r of Rr){const i=aa(r),a=e[i];if(e.type==="b"){const s=String(a??"Top").trim();s!=="Top"&&s!=="Center"&&s!=="Bottom"&&(t[i]="Top",n=!0);continue}sa(a,r,e)||(t[i]="Top",n=!0)}return n?t:null}function kd(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Wd(e){const t=Hn(e).kind;return t==="baseline"?"center":t}function Md(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function po(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Fd(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:r}=e.getBoundingClientRect(),{bottom:i}=n.getBoundingClientRect(),a=i-r;return n.remove(),a}function Kr(e,t,n,r){const i=e.titleEl;if(!i)return 0;const a=i.closest(`.${n}`);if(!a)return 0;const s=Fd(i,r);if(e.kind==="baseline")return i.getBoundingClientRect().top-t+s;const c=a.getBoundingClientRect(),o=i.getBoundingClientRect().height;let p=0;return e.kind==="center"?p=(c.height-o)/2:e.kind==="bottom"&&(p=c.height-o),c.top-t+p+s}function Nd(e,t,n){const r=e.getBoundingClientRect().height;return r<=0?0:(t.forEach(i=>{const a=i.querySelector(`.${n}`);a&&(a.style.minHeight=`${r}px`,a.style.height=`${r}px`)}),r)}function Hd(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Bd={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function we(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Od={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Vd(e){return[we(e,"textFontFamily"),we(e,"textFontSettings"),{type:"row",items:[we(e,"textFontSize"),we(e,"textLineHeight"),we(e,"textLetterSpacing"),we(e,"textWordSpacing")]},we(e,"textTextAlign"),we(e,"textTextAppearance"),`${e}VerticalAlign`]}function Dd(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Ei.map(e=>[Od[e],Vd(e)]))}}function vr(e,t){const n=r=>{const i=we(t,r);return e[i]};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===It?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function mo(e,t){var r,i;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((r=e.textFontSettings)==null?void 0:r.fontWeight)??400,fontStyle:((i=e.textFontSettings)==null?void 0:i.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 Ct(nt(n,t))}function go(e,t,n,r){const i=vr(e,t),a=i.textFontSize??.01,s=i.textLineHeight;return s!==void 0&&s<a?`${n} ${r}`:n}function ho(e,t,n,r){const i=vr(e,t),a=i.textFontSize??.01,s=i.textLineHeight;return s===void 0||s>=a?{}:{[`--${n}-title-leading-gap`]:$.scalingValue((a-s)/2,r)}}const mt=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],yn=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],vn=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],bn=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],jd={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},zd=["hover","focus","filled","success","error"],fo=.004,dn=.004,qr=dn,yo=12,_i=50,Bn=1440,On=_i/Bn;function ca(e){const t=typeof e=="number"&&e>0?e:Bn;return _i/t}function Kd(e,t){const n={position:"absolute",width:yo,height:yo,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 Et({P:e,className:t,areaStyle:n,hitPlacement:r,...i}){return l.jsx("div",{className:t,style:{...n,pointerEvents:"none"},...i,children:l.jsx("div",{style:Kd(e,r)})})}function qd(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const i=parseFloat(n);if(Number.isFinite(i)&&i>0)return i}const r=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(r){const i=parseFloat(r);if(Number.isFinite(i)&&i>0)return i}t=t.parentElement}return Bn}const da={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function _n(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Ud(e,t=1){const n=t/e;return Object.fromEntries(mt.map(r=>[r,n]))}function Gd(){return Object.fromEntries([...yn.map(e=>[e,0]),...vn.map(e=>[e,0])])}function Yd(){return Object.fromEntries(bn.map(e=>[e,0]))}function ir(e){return Object.fromEntries(mt.map(t=>[t,typeof e[t]=="number"?e[t]:da[t]]))}function ua(e,t,n){const r=e-On,i=t+n;if(i<=0||i<=r)return{paddingLeft:t,paddingRight:n};if(r<=0)return{paddingLeft:0,paddingRight:0};const a=r/i;return{paddingLeft:t*a,paddingRight:n*a}}function ur(e,t,n){const r=Ai(e,t,n);if(e<=0)return[];const i=r.slice(0,e-1).reduce((a,s)=>a+s,0);return[...r.slice(0,e-1),Math.max(0,t-i)]}function Xd(e,t,n){const r={};for(let i=0;i<e;i+=1){const a=yn[i],s=vn[i],c=typeof n[a]=="number"?n[a]:0,o=typeof n[s]=="number"?n[s]:0,p=ua(t[i]??0,c,o);p.paddingLeft!==c&&(r[a]=p.paddingLeft),p.paddingRight!==o&&(r[s]=p.paddingRight)}return r}function Ai(e,t,n){if(e<=0)return[];const r=mt.slice(0,e).map(p=>n[p]);if(e===1)return r;const i=r.slice(0,e-1),s=i.reduce((p,d)=>p+d,0)+On;if(t>=s)return r;const c=[...i];let o=s-t;for(let p=c.length-1;p>=0&&o>0;p-=1){const d=c[p]-On;if(d<=0)continue;const T=Math.min(o,d);c[p]-=T,o-=T}return[...c,r[e-1]]}function Zd(e,t,n){if(e<=1)return{};const r=Ai(e,t,n),i={};for(let a=0;a<e-1;a+=1){const s=mt[a];r[a]!==n[s]&&(i[s]=r[a])}return i}function vo(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Vt]}function Jd(e,t){return e.length!==t.length?!1:e.every((n,r)=>n===t[r])}function Qd(e,t,n,r){const i=Math.min(r,e.length,mt.length),a={};for(let s=0;s<i;s+=1){const c=e[s],o=t.indexOf(c);if(o===-1)continue;const p=mt[o],d=yn[o],T=vn[o],b=bn[o],y=mt[s],g=yn[s],m=vn[s],L=bn[s],w=n[p],f=n[d],S=n[T],M=n[b];typeof w=="number"&&(a[y]=w),typeof f=="number"&&(a[g]=f),typeof S=="number"&&(a[m]=S),typeof M=="number"&&(a[L]=M)}return a}function pa(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const r of n)if(e[r]!==t[r])return!0;return!1}function eu(e,t){const n=e.columns,r=t.columns;if(typeof n!="number"||n===r)return e;const i=_n(e),a=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...Ud(n,i),...Gd()};if(a)for(const c of bn)typeof t[c]=="number"&&(s[c]=t[c]);else Object.assign(s,Yd());return pa(e,s)?s:e}function tu(e,t,n){const r=Id(e);r&&(e={...e,...r});const i=ca(n==null?void 0:n.designWidth),a=e.columns,s=t.columns,c=_n(e),o=_n(t),p=e.type==="b"||e.type===void 0&&t.type==="b",d=typeof a=="number"?a:typeof s=="number"?s:Vt.length,T=S=>{if(p)return S;const M=ir({...t,...S}),_=_n(S),A=ur(d,_,M),x=Xd(d,A,{...t,...S});return Object.keys(x).length===0?S:{...S,...x}};if(typeof a=="number"&&a!==s)return e;const b=vo(e),y=vo(t);if(!Jd(b,y))return T({...e,...Qd(b,y,t,d)});if(c<o&&typeof d=="number"&&!p){const S=ir({...t,...e});return T({...e,...Zd(d,c,S)})}if(p){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,M=Math.max(0,(c-i)/2);return S>M?{...e,textPaddingLR:M}:e}const g=ir({...t,...e}),m=ur(d,o,ir(t)),w=ur(d,c,g).some((S,M)=>S<(m[M]??S)),f=mt.some(S=>{const M=e[S],_=t[S];return typeof M=="number"&&typeof _=="number"&&M!==_});return w||f?T(e):e}function nu(e,t,n,r){const i=t.slice(0,e).reduce((s,c)=>s+c,0),a=n.slice(e+1,t.length-1).reduce((s,c)=>s+c,0);return Math.max(On,r-i-a-On)}function ru(e,t){return Math.random()*(t-e)+e}function iu(e){return Object.fromEntries(mt.map(t=>[t,typeof e[t]=="number"?e[t]:da[t]]))}function Ur(e,t,n=0){return Object.fromEntries(t.map(r=>[r,typeof e[r]=="number"?e[r]:n]))}function ou(e,t,n,r,i,a){return e.slice(0,t).map((s,c)=>{const o=yn[c],p=vn[c],d=bn[c];return{key:s,textPrefix:Bd[s],widthKey:mt[c],width:n[mt[c]],paddingLeftKey:o,paddingRightKey:p,paddingBottomKey:d,paddingLeft:r[o],paddingRight:i[p],paddingBottom:a[d]}})}function au({settings:e,content:t,isEditor:n,isPreviewMode:r,isEditMode:i,activeEvent:a,layoutId:s,onUpdateSettings:c}){const{prefix:o}=$.useScopedStyles(),p=!!i,{columns:d,type:T,wrapperWidth:b,entriesCount:y,cellMinHeight:g,dividerWidth:m,showVisibility:L,cut:w,showCut:f,cutCellMinHeight:S,cutLabel:M,imageSize:_,imageOnHover:A,entryHoverEffect:x,entryHoverShowOption:P,rowPaddingTop:k,rowPaddingBottom:E,rowPaddingTopB:R,columnsOrder:B,textPaddingLR:V,textColor:U,backgroundColor:J,dividerColor:v,textHoverColor:W,backgroundHoverColor:H,dividerHoverColor:F}=e,[I,K]=u.useState(void 0),[X,re]=u.useState(null),Z=A==="on"&&(!n||r),pe=(w??0)>0,C=T==="b",ie=u.useRef(null),Se=u.useRef(null),[ue,ye]=u.useState(null),[ne,ce]=u.useState(Bn),j=ca(ne),h=Math.max(0,((b??0)-j)/2),N=Math.min(V??0,h),O=Math.max(N,dn),G=((b??0)+j)/2;u.useLayoutEffect(()=>{if(!n){ce(Bn);return}const q=()=>{ce(qd(ie.current))};q();const de=ie.current;if(!de)return;const me=new ResizeObserver(q);me.observe(de);let Ce=de;for(;Ce&&!Ce.style.getPropertyValue("--cntrl-article-width");)Ce=Ce.parentElement;return Ce&&me.observe(Ce),()=>me.disconnect()},[n,s]),u.useEffect(()=>{K(void 0)},[w,f,t,y]),u.useEffect(()=>{n&&!r&&K(void 0)},[n,r]);const oe=$.buildColorVars(o,{textColor:U,backgroundColor:J,dividerColor:v,textHoverColor:W,backgroundHoverColor:H,dividerHoverColor:F},jd,zd),te=a&&a!=="default"?`${o}-state-${a}`:"",le=`${!n||r?x==="default"?`${o}-entry-hover-default`:x==="blinds"?`${o}-entry-hover-blinds`:x==="reveal"?`${o}-entry-hover-reveal`:"":""} ${te}`.trim(),ge=x==="reveal"&&(!n||r),he=(L==null?void 0:L[0])??!1,z=(L==null?void 0:L[1])??!1,ae=u.useRef(e),D=u.useRef(s);u.useEffect(()=>{if(!c||!n){ae.current=e,D.current=s;return}if(D.current!==s){ae.current=e,D.current=s;return}const q=ae.current;if(!(q!==e))return;if(typeof q.columns=="number"&&typeof e.columns=="number"&&q.columns!==e.columns){ae.current=e;return}const me=tu(e,q,{designWidth:ne});ae.current=e,pa(e,me)&&c(me)},[e,c,n,s,ne]);const ee=u.useMemo(()=>iu(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),xe=u.useMemo(()=>Ur(e,yn),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),Ee=u.useMemo(()=>Ur(e,vn),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Xe=u.useMemo(()=>Ur(e,bn),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Oe=u.useMemo(()=>Array.isArray(B)&&B.length>0?B:[...Vt],[B]),ke=u.useMemo(()=>ou(Oe,d,ee,xe,Ee,Xe),[Oe,d,ee,xe,Ee,Xe]),We=_n(e),Pe=u.useMemo(()=>mt.slice(0,d).map(q=>ee[q]),[d,ee]),je=u.useMemo(()=>Ai(d,We,ee),[d,We,ee]),Ne=u.useMemo(()=>ur(d,We,ee),[d,We,ee]),Re=u.useMemo(()=>ke.map((q,de)=>ua(Ne[de]??0,q.paddingLeft,q.paddingRight)),[ke,Ne]),Ve=u.useMemo(()=>{const q=y===0?1/0:y;return(t??[]).slice(0,q).map((me,Ce)=>({id:Ce,cells:Object.fromEntries(Vt.map(He=>[He,me[He]??""])),image:me.image,link:me.link}))},[t,y]),dt=pe?I??w:Ve.length,vt=u.useMemo(()=>pe?Ve.slice(0,dt):Ve,[Ve,pe,dt]),bt=pe&&dt<Ve.length,Tt=vt.length>1||bt,Kt=[he?`${o}-divider-top`:"",z||Tt?`${o}-divider-bottom`:""].filter(Boolean).join(" "),xt=!n||r,qt=()=>{if(!xt)return;const q=I??w;if(!f){K(Ve.length);return}K(Math.min(q+f,Ve.length))},ve=q=>$.scalingValue(q,n??!1),Ge=C?R??0:k??0,ze=E??0,rt=g??0,wn=Ge+rt/2,Tn=Math.max(ze,qr),Ut=co(0,vt.length,he,z,bt,m??0,n??!1).borderTopWidth,tn=ue!=null?`${ue}px`:`calc(${Ut} + ${ve(wn)})`,Ln=C?"rowPaddingTopB":"rowPaddingTop",be=ke[0],Ye=ke[ke.length-1],De=Re[0],Me=Re[Re.length-1],it=be&&De?Math.max(De.paddingLeft,dn):0,Yn=Ye&&Me?Math.max(Me.paddingRight,dn):0,Ir=We,nn=q=>{const de=ie.current;if(!de)return{x:0,y:0};const me=de.getBoundingClientRect();return{x:q.clientX-me.left+uo,y:q.clientY-me.top+uo}},kr=(q,de)=>{if(!Z)return;const me=q.image;if(!(me!=null&&me.url)){re(null);return}const{x:Ce,y:He}=nn(de),Ke=(_==null?void 0:_.min)??80,$e=(_==null?void 0:_.max)??320,st=(X==null?void 0:X.rowId)===q.id?X.widthPx:ru(Ke,$e);re({rowId:q.id,url:me.url,objectFit:"contain",isVideo:$d(me),widthPx:st,x:Ce,y:He})},Xn=q=>{if(!Z||!X)return;const{x:de,y:me}=nn(q);re(Ce=>!Ce||Ce.x===de&&Ce.y===me?Ce:{...Ce,x:de,y:me})},Zn=()=>{re(null)},Wr=q=>{ge&&so(q,o),Z&&re(null)},Te=q=>{ge&&lo(q,o)};u.useLayoutEffect(()=>{if(!p||C){ye(null);return}const q=Se.current,de=q==null?void 0:q.parentElement;if(!q||!de){ye(null);return}const me=()=>{const He=q.querySelector("[data-list-row]");if(!He){ye(null);return}const Ke=de.getBoundingClientRect(),$e=He.getBoundingClientRect();ye($e.top-Ke.top+$e.height/2)};me();const Ce=new ResizeObserver(me);return Ce.observe(q),Ce.observe(de),()=>Ce.disconnect()},[p,C,vt,Ge,ze,rt,t,e,ke,Ne,ne,m,he,z,bt]);const ot=u.useMemo(()=>!C&&Li.some(q=>{const de=q.charAt(0),me=e[`${q}VerticalAlign`];return la(me,e,de)}),[C,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);u.useLayoutEffect(()=>{var st;const q=ie.current;if(!q)return;const de=()=>{q.querySelectorAll("[data-list-col]").forEach(lt=>{lt.style.transform="";const qe=lt.querySelector(`.${o}-list-col`);qe&&(qe.style.minHeight="",qe.style.height="");const ct=lt.querySelector(`.${o}-list-col-title`);ct&&(ct.style.transform="")})};if(C||!ot){de();return}const me=()=>{const lt=Array.from(q.querySelectorAll("[data-list-row]")),qe=`${o}-list-col`,ct=`${o}-baseline-probe`;lt.forEach(_e=>{_e.querySelectorAll("[data-list-col]").forEach(Qe=>{Qe.style.transform="";const et=Qe.querySelector(`.${qe}`);et&&(et.style.minHeight="",et.style.height="");const Ze=Qe.querySelector(`.${o}-list-col-title`);Ze&&(Ze.style.transform="")})}),lt.forEach(_e=>{const Qe=Array.from(_e.querySelectorAll("[data-list-col]"));Nd(_e,Qe,qe)}),q.offsetHeight,lt.forEach(_e=>{const Qe=Array.from(_e.querySelectorAll("[data-list-col]")),et=_e.getBoundingClientRect().top,Ze=new Map,rn=Qe.map(Fe=>{const on=Fe.querySelector(`.${o}-list-col-title`),an={el:Fe,titleEl:on,letter:Fe.getAttribute("data-col-letter")??"",kind:Fe.getAttribute("data-valign")??"top",anchor:Fe.getAttribute("data-valign-anchor")};return Ze.set(an.letter,an),an}),Ue=new Map,Jn=(Fe,on)=>{const an=Ue.get(Fe.letter);if(an!==void 0)return an;const Ri=Fe.anchor?Ze.get(Fe.anchor):void 0;if(Fe.kind!=="baseline"||!Ri||on.has(Fe.letter)){const ki=Kr(Fe,et,qe,ct);return Ue.set(Fe.letter,ki),ki}on.add(Fe.letter);const ga=Jn(Ri,on);on.delete(Fe.letter);const ha=Kr(Fe,et,qe,ct),fa=ga-ha;Hd(Fe.titleEl,fa);const Ii=Kr(Fe,et,qe,ct);return Ue.set(Fe.letter,Ii),Ii};rn.forEach(Fe=>Jn(Fe,new Set))})};let Ce=null;const He=()=>{Ce===null&&(Ce=requestAnimationFrame(()=>{Ce=null,me()}))};me();const Ke=new ResizeObserver(()=>He());Ke.observe(q);let $e=!1;return typeof document<"u"&&((st=document.fonts)!=null&&st.ready)&&document.fonts.ready.then(()=>{$e||He()}),()=>{$e=!0,Ce!==null&&(cancelAnimationFrame(Ce),Ce=null),Ke.disconnect(),de()}},[ot,C,e,t,ne,vt,Ne]);const at=u.useMemo(()=>Ed(o),[o]);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:at}}),l.jsx("div",{style:oe,children:l.jsxs("div",{ref:ie,className:`${o}-wrapper ${le}${Kt?` ${Kt}`:""}${C?` ${o}-type-b`:""}`.trim(),style:{width:$.scalingValue(b??0,n),...!C&&p?{[`--${o}-first-entry-handle-top`]:tn}:{}},onMouseMove:Z?Xn:void 0,onMouseLeave:Z?Zn:void 0,children:[l.jsxs("div",{style:{width:"100%",position:"relative"},children:[vt.map((q,de)=>{var Ke;const me=(((Ke=q.link)==null?void 0:Ke.length)??0)>0,Ce=me&&(!n||r)?"a":"div",He=co(de,vt.length,he,z,bt,m??0,n??!1);return l.jsxs(Ce,{ref:de===0?$e=>{Se.current=$e}:void 0,className:`${o}-list-item${me||P==="always"?` ${o}-list-item-has-link`:""}`,...me?{href:q.link,target:"_blank"}:{},style:He,onMouseEnter:$e=>{ge&&(me||P==="always")&&so($e,o),Z&&kr(q,$e)},onMouseLeave:$e=>{ge&&(me||P==="always")&&lo($e,o)},children:[Ge>0&&l.jsx("div",{className:`${o}-row-padding-handle`,style:{height:ve(Ge)}}),l.jsxs("div",{className:`${o}-list-cols-row${C?"":` ${o}-list-cols-row-h`}${p&&de===0&&C?` ${o}-list-cols-row-controls`:""}`,...C?{}:{"data-list-row":""},style:C?void 0:{minHeight:ve(rt)},children:[ke.map(($e,st)=>{const lt=st===ke.length-1,qe=Re[st],ct=$e.paddingBottom,_e=Td(q.cells[$e.key]),Qe=C&&_e&&ct>0,et=C?{minHeight:ve(rt)}:{width:ve(Ne[st])},Ze=C?{paddingLeft:ve(N),paddingRight:ve(N)}:{paddingLeft:ve(qe.paddingLeft),paddingRight:ve(qe.paddingRight)},rn=$e.textPrefix.charAt(0),Ue=C?Rd(e[`${$e.textPrefix}VerticalAlign`]):Ad(e[`${$e.textPrefix}VerticalAlign`],e,rn),Jn=C&&_e&&p&&de===0;return l.jsxs("div",{className:C?`${o}-list-col-wrap`:void 0,...C?{}:{"data-list-col":"","data-col-letter":rn,"data-valign":Ue.kind,...Ue.kind==="baseline"?{"data-valign-anchor":Ue.anchorLetter}:{}},children:[l.jsx("div",{className:`${o}-list-col${lt?` ${o}-list-col-last`:""}`,style:{...Ze,...et,...C?{justifyContent:po(Ue.kind)}:{}},"data-test":$e.width,children:l.jsx("span",{className:go(e,$e.textPrefix,`${o}-list-col-title`,`${o}-text-tight-leading`),style:{...mo(vr(e,$e.textPrefix),n),...ho(e,$e.textPrefix,o,n),...C?{}:kd(Ue.kind)},children:q.cells[$e.key]??null})}),Qe&&l.jsx("div",{className:`${o}-row-padding-handle`,style:{height:ve(ct)}}),Jn&&l.jsx(Et,{P:o,"data-controls":$e.paddingBottomKey,"data-controls-static-handle":"","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${o}-padding-control-handle`,hitPlacement:"center",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:ve(Math.max(ct,qr))}})]},$e.key)}),p&&de===0&&C&&l.jsxs(l.Fragment,{children:[l.jsx(Et,{P:o,"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(G),className:`${o}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:ve(O),height:"100%"}}),l.jsx(Et,{P:o,"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(G),className:`${o}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:ve(Math.max(O,We-O)),width:ve(O),height:"100%"}})]})]}),!C&&ze>0&&l.jsx("div",{className:`${o}-row-padding-handle`,style:{height:ve(ze)}}),p&&de===0&&!C&&l.jsx(Et,{P:o,"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:`${o}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:ve(Tn)}})]},q.id)}),p&&l.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:l.jsx(Et,{P:o,"data-controls":Ln,"data-controls-static-handle":"",...C?{}:{"data-controls-handle-left":"20"},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${o}-padding-control-handle`,hitPlacement:C?"center":"left-y",areaStyle:{position:"absolute",top:Ut,left:0,width:"100%",height:ve(Math.max(Ge,qr))}})},"row-padding-handles"),p&&!C&&be&&Ye&&l.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[l.jsx(Et,{P:o,"data-controls":be.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[0]-((De==null?void 0:De.paddingRight)??0)),className:`${o}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:ve(it),height:"100%"}}),l.jsx(Et,{P:o,"data-controls":Ye.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[ke.length-1]-((Me==null?void 0:Me.paddingLeft)??0)),className:`${o}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:ve(Ir-Yn),width:ve(Yn),height:"100%"}})]},"column-edge-padding-handles"),p&&!C&&ke.slice(0,-1).map((q,de)=>{const me=ke[de+1],Ce=je.slice(0,de+1).reduce((lt,qe)=>lt+qe,0),He=Re[de],Ke=Re[de+1],$e=Math.max(He.paddingRight,dn),st=Math.max(Ke.paddingLeft,dn);return l.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[l.jsx(Et,{P:o,"data-controls":q.paddingRightKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[de]-He.paddingLeft),className:`${o}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:ve(Ce-$e),width:ve($e),height:"100%"}}),l.jsx(Et,{P:o,"data-controls":me.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[de+1]-Ke.paddingRight),className:`${o}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:ve(Ce),width:ve(st),height:"100%"}})]},`${q.paddingRightKey}-padding`)}),p&&!C&&ke.slice(0,-1).map((q,de)=>{const me=nu(de,je,Pe,We),He=je.slice(0,de+1).reduce((Ke,$e)=>Ke+$e,0)-fo/2;return l.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:l.jsx("div",{"data-controls":q.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(_i),"data-controls-max-fraction":String(me),"data-controls-variant":"column-width",className:`${o}-col-resize-handle`,style:{position:"absolute",top:"0px",left:ve(He),width:ve(fo),height:"calc(100%)",pointerEvents:"auto"}})},`${q.widthKey}-junction`)})]}),bt&&(()=>{const q=vr(e,It),de=Wd(e.cutLabelVerticalAlign),me=q.textTextAlign==="justify"||C;return l.jsx("button",{type:"button",className:`${o}-cut-item`,style:{minHeight:ve(S??0),cursor:xt?"pointer":"default",...Ld(z,m??0,n??!1)},onClick:xt?qt:void 0,onMouseEnter:ge||Z?Wr:void 0,onMouseLeave:ge?Te:void 0,children:l.jsx("div",{className:`${o}-list-cols-row`,style:{...C?{paddingLeft:ve(N),paddingRight:ve(N)}:{},justifyContent:Md(q.textTextAlign),alignItems:po(de)},children:l.jsx("span",{className:go(e,It,`${o}-cut-label`,`${o}-text-tight-leading`),style:{...mo(q,n),...ho(e,It,o,n),...me?{width:"100%"}:{}},children:M})})})})(),Z&&X&&(()=>{const q=dr(X.widthPx),de={width:q,height:"auto",maxHeight:q,objectFit:"contain",left:X.x,top:X.y,position:"absolute"};return l.jsx(wd,{media:X,className:X.isVideo?`${o}-hover-video`:`${o}-hover-image`,style:de},`${X.rowId}-${X.url}`)})()]})})]})}const su=`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';
|
|
@@ -5571,17 +5571,20 @@ export type ListSettings = {
|
|
|
5571
5571
|
dividerHoverColor: string;
|
|
5572
5572
|
} & ListColumnTextStyleOverrides;
|
|
5573
5573
|
|
|
5574
|
+
type ListMedia = {
|
|
5575
|
+
objectFit?: 'cover' | 'contain';
|
|
5576
|
+
url: string;
|
|
5577
|
+
name: string;
|
|
5578
|
+
type?: 'image' | 'video';
|
|
5579
|
+
};
|
|
5580
|
+
|
|
5574
5581
|
type ListContentItem = {
|
|
5575
5582
|
AColumn?: string;
|
|
5576
5583
|
BColumnWidth?: string;
|
|
5577
5584
|
CColumnWidth?: string;
|
|
5578
5585
|
DColumnWidth?: string;
|
|
5579
5586
|
EColumnWidth?: string;
|
|
5580
|
-
image?:
|
|
5581
|
-
objectFit?: 'cover' | 'contain';
|
|
5582
|
-
url: string;
|
|
5583
|
-
name: string;
|
|
5584
|
-
};
|
|
5587
|
+
image?: ListMedia;
|
|
5585
5588
|
link?: string;
|
|
5586
5589
|
};
|
|
5587
5590
|
|
|
@@ -5596,11 +5599,68 @@ type HoverImageState = {
|
|
|
5596
5599
|
rowId: string | number;
|
|
5597
5600
|
url: string;
|
|
5598
5601
|
objectFit: 'cover' | 'contain';
|
|
5602
|
+
isVideo: boolean;
|
|
5599
5603
|
widthPx: number;
|
|
5600
5604
|
x: number;
|
|
5601
5605
|
y: number;
|
|
5602
5606
|
};
|
|
5603
5607
|
|
|
5608
|
+
function isVideoMedia(media: Pick<ListMedia, 'url' | 'type' | 'name'>): boolean {
|
|
5609
|
+
if (media.type === 'video') return true;
|
|
5610
|
+
if (media.type === 'image') return false;
|
|
5611
|
+
const name = media.name ?? '';
|
|
5612
|
+
if (/\\.(mp4|webm|ogg|mov)(\\?|$)/i.test(name)) return true;
|
|
5613
|
+
return /\\.(mp4|webm|ogg|mov)(\\?|$)/i.test(media.url);
|
|
5614
|
+
}
|
|
5615
|
+
|
|
5616
|
+
function ListHoverMedia({
|
|
5617
|
+
media,
|
|
5618
|
+
className,
|
|
5619
|
+
style,
|
|
5620
|
+
}: {
|
|
5621
|
+
media: Pick<HoverImageState, 'url' | 'objectFit' | 'isVideo'>;
|
|
5622
|
+
className: string;
|
|
5623
|
+
style: React.CSSProperties;
|
|
5624
|
+
}) {
|
|
5625
|
+
const videoRef = useRef<HTMLVideoElement>(null);
|
|
5626
|
+
|
|
5627
|
+
useEffect(() => {
|
|
5628
|
+
if (!media.isVideo) return;
|
|
5629
|
+
const video = videoRef.current;
|
|
5630
|
+
if (!video) return;
|
|
5631
|
+
|
|
5632
|
+
const playPromise = video.play();
|
|
5633
|
+
if (playPromise) {
|
|
5634
|
+
playPromise.catch(() => {});
|
|
5635
|
+
}
|
|
5636
|
+
}, [media.isVideo, media.url]);
|
|
5637
|
+
|
|
5638
|
+
if (media.isVideo) {
|
|
5639
|
+
return (
|
|
5640
|
+
<video
|
|
5641
|
+
ref={videoRef}
|
|
5642
|
+
className={className}
|
|
5643
|
+
src={media.url}
|
|
5644
|
+
style={style}
|
|
5645
|
+
muted
|
|
5646
|
+
loop
|
|
5647
|
+
autoPlay
|
|
5648
|
+
playsInline
|
|
5649
|
+
preload="auto"
|
|
5650
|
+
/>
|
|
5651
|
+
);
|
|
5652
|
+
}
|
|
5653
|
+
|
|
5654
|
+
return (
|
|
5655
|
+
<img
|
|
5656
|
+
className={className}
|
|
5657
|
+
src={media.url}
|
|
5658
|
+
alt=""
|
|
5659
|
+
style={style}
|
|
5660
|
+
/>
|
|
5661
|
+
);
|
|
5662
|
+
}
|
|
5663
|
+
|
|
5604
5664
|
type ListProps = {
|
|
5605
5665
|
layoutId?: string;
|
|
5606
5666
|
settings: ListSettings;
|
|
@@ -5682,14 +5742,14 @@ function getCSS(P: string): string {
|
|
|
5682
5742
|
box-sizing: border-box;
|
|
5683
5743
|
}
|
|
5684
5744
|
|
|
5685
|
-
.\${P}-hover-image
|
|
5745
|
+
.\${P}-hover-image,
|
|
5746
|
+
.\${P}-hover-video {
|
|
5686
5747
|
position: absolute;
|
|
5687
5748
|
left: 0;
|
|
5688
5749
|
top: 0;
|
|
5689
5750
|
z-index: 10;
|
|
5690
5751
|
pointer-events: none;
|
|
5691
5752
|
display: block;
|
|
5692
|
-
height: auto;
|
|
5693
5753
|
}
|
|
5694
5754
|
|
|
5695
5755
|
.\${P}-list-item {
|
|
@@ -7646,7 +7706,8 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
7646
7706
|
setHoverImage({
|
|
7647
7707
|
rowId: row.id,
|
|
7648
7708
|
url: image.url,
|
|
7649
|
-
objectFit:
|
|
7709
|
+
objectFit: 'contain',
|
|
7710
|
+
isVideo: isVideoMedia(image),
|
|
7650
7711
|
widthPx,
|
|
7651
7712
|
x,
|
|
7652
7713
|
y,
|
|
@@ -8369,22 +8430,30 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
8369
8430
|
</button>
|
|
8370
8431
|
);
|
|
8371
8432
|
})()}
|
|
8372
|
-
{showHoverImage && hoverImage && (
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
|
|
8433
|
+
{showHoverImage && hoverImage && (() => {
|
|
8434
|
+
const hoverSize = sv(hoverImage.widthPx);
|
|
8435
|
+
const hoverMediaStyle: React.CSSProperties = {
|
|
8436
|
+
width: hoverSize,
|
|
8437
|
+
height: 'auto',
|
|
8438
|
+
maxHeight: hoverSize,
|
|
8439
|
+
objectFit: 'contain',
|
|
8440
|
+
left: hoverImage.x,
|
|
8441
|
+
top: hoverImage.y,
|
|
8442
|
+
position: 'absolute',
|
|
8443
|
+
};
|
|
8444
|
+
|
|
8445
|
+
return (
|
|
8446
|
+
<ListHoverMedia
|
|
8447
|
+
key={\`\${hoverImage.rowId}-\${hoverImage.url}\`}
|
|
8448
|
+
media={hoverImage}
|
|
8449
|
+
className={hoverImage.isVideo ? \`\${P}-hover-video\` : \`\${P}-hover-image\`}
|
|
8450
|
+
style={hoverMediaStyle}
|
|
8451
|
+
/>
|
|
8452
|
+
);
|
|
8453
|
+
})()}
|
|
8385
8454
|
</div>
|
|
8386
8455
|
</div>
|
|
8387
8456
|
</>
|
|
8388
8457
|
);
|
|
8389
8458
|
}
|
|
8390
|
-
`,$n=["A","B","C","D","E"],bo=[...ri,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Yt={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 ou(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function or(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function au(){return Object.fromEntries($n.map((e,t)=>{const n=Vt[t],r=`${e} column`;return[n,ou(r)]}))}function su(){const e={};for(const t of $n)e[`${t}ColumnWidth`]=or(`${t} column width`),e[`${t}ColumnPaddingLeft`]=or(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=or(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=or(`${t} column padding bottom`);return e}function xo(e={}){const{typeBDefaults:t,...n}=e,r={wrapperWidth:1,columnsOrder:[...Vt]};for(const a of $n)r[`${a}ColumnWidth`]=a==="A"?.0798:.32,r[`${a}ColumnPaddingLeft`]=0,r[`${a}ColumnPaddingRight`]=0,r[`${a}ColumnPaddingBottom`]=0;const i=n.type==="b"&&t?t:{};return{...r,...i,...n}}function lu(e){const t={};if(e===kt)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ri]},enum:[...ri]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...bo],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...bo]}}return t[Se(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Se(e,"textFontSettings")]={...Yt.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Se(e,"textFontSize")]={...Yt.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Se(e,"textLineHeight")]={...Yt.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Se(e,"textLetterSpacing")]={...Yt.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Se(e,"textWordSpacing")]={...Yt.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Se(e,"textTextAlign")]={...Yt.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Se(e,"textTextAppearance")]={...Yt.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const cu=Ei.reduce((e,t)=>({...e,...lu(t)}),{});function du(e){return{verticalAlign:e===kt?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===kt?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function uu(e,t={}){var n;return{...du(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Co=new Set(["textFontFamily","textFontSettings"]);function pu(e,t,n){const r=a=>n===void 0?!0:n==="common"?Co.has(a):!Co.has(a),i={};return r("verticalAlign")&&t.verticalAlign!==void 0&&(i[`${e}VerticalAlign`]=Pi(t.verticalAlign)),r("textFontFamily")&&t.textFontFamily!==void 0&&(i[Se(e,"textFontFamily")]=t.textFontFamily),r("textFontSettings")&&t.textFontSettings!==void 0&&(i[Se(e,"textFontSettings")]=t.textFontSettings),r("textFontSize")&&t.textFontSize!==void 0&&(i[Se(e,"textFontSize")]=t.textFontSize),r("textLineHeight")&&t.textLineHeight!==void 0&&(i[Se(e,"textLineHeight")]=t.textLineHeight),r("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(i[Se(e,"textLetterSpacing")]=t.textLetterSpacing),r("textWordSpacing")&&t.textWordSpacing!==void 0&&(i[Se(e,"textWordSpacing")]=t.textWordSpacing),r("textTextAlign")&&t.textTextAlign!==void 0&&(i[Se(e,"textTextAlign")]=t.textTextAlign),r("textTextAppearance")&&t.textTextAppearance!==void 0&&(i[Se(e,"textTextAppearance")]=t.textTextAppearance),i}function pr(e={},t){return Ei.reduce((n,r)=>({...n,...pu(r,uu(r,e),t)}),{})}const mu=pr(),gu=Bd();function ma(e){return[Se(e,"textFontFamily"),Se(e,"textFontSettings"),Se(e,"textFontSize"),Se(e,"textLineHeight"),Se(e,"textLetterSpacing"),Se(e,"textWordSpacing"),Se(e,"textTextAlign"),Se(e,"textTextAppearance"),`${e}VerticalAlign`]}function hu(){const e=[];return Li.forEach((t,n)=>{const r=Vt[n],i=ma(t);for(let a=1;a<Vt.length;a+=1){const s=[{name:"columns",value:a},...Array.from({length:a},(c,o)=>({name:`columnsOrder.${o}`,value:r,isNotEqual:!0}))];i.forEach(c=>{e.push({if:s,then:{name:`properties.${c}.display.visible`,value:!1}})})}}),e}const fu=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"],yu=["cutLabel","cutCellMinHeight","showCut"],vu=ma(kt),bu=[...yu,...vu],xu=[...$n.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],Xt=[{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/default-list(1).webp"},{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/default-list(2).webp"},{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/default-list(3).webp"},{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/default-list(4).webp"},{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/default-list(5).webp"},{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/default-list(6).webp"},{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/default-list(7).webp"}],Cu=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:Xt[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:Xt[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:Xt[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:Xt[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:Xt[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:Xt[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:Xt[6],link:""}],Su=[...$n.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],$u={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:{...au(),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:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:Cu},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:"Cut",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"}},...su(),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"}},...cu,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",...mu,...pr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:xo({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},...pr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:xo({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},...pr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...hu(),...bu.map(e=>({if:{name:"cut",value:0},then:{name:`properties.${e}.display.visible`,value:!1}})),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...xu.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}},...$n.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",...Su]},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:["columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:[{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:[gu]}],paletteBookmark:{items:[...fu],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},wu={element:ru,id:"list",name:"Default List",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:Zd,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:$u,sourceCode:iu},Tu=[Ll,Il,Cc,Ac,Oc,Jc,rd,cd,Cd,wu];exports.components=Tu;exports.isSchemaV1=ya;
|
|
8459
|
+
`,$n=["A","B","C","D","E"],bo=[...ri,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Yt={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 lu(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function or(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function cu(){return Object.fromEntries($n.map((e,t)=>{const n=Vt[t],r=`${e} column`;return[n,lu(r)]}))}function du(){const e={};for(const t of $n)e[`${t}ColumnWidth`]=or(`${t} column width`),e[`${t}ColumnPaddingLeft`]=or(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=or(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=or(`${t} column padding bottom`);return e}function xo(e={}){const{typeBDefaults:t,...n}=e,r={wrapperWidth:1,columnsOrder:[...Vt]};for(const a of $n)r[`${a}ColumnWidth`]=a==="A"?.0798:.32,r[`${a}ColumnPaddingLeft`]=0,r[`${a}ColumnPaddingRight`]=0,r[`${a}ColumnPaddingBottom`]=0;const i=n.type==="b"&&t?t:{};return{...r,...i,...n}}function uu(e){const t={};if(e===It)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ri]},enum:[...ri]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...bo],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...bo]}}return t[we(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[we(e,"textFontSettings")]={...Yt.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[we(e,"textFontSize")]={...Yt.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[we(e,"textLineHeight")]={...Yt.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[we(e,"textLetterSpacing")]={...Yt.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[we(e,"textWordSpacing")]={...Yt.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[we(e,"textTextAlign")]={...Yt.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[we(e,"textTextAppearance")]={...Yt.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const pu=Ei.reduce((e,t)=>({...e,...uu(t)}),{});function mu(e){return{verticalAlign:e===It?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===It?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function gu(e,t={}){var n;return{...mu(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Co=new Set(["textFontFamily","textFontSettings"]);function hu(e,t,n){const r=a=>n===void 0?!0:n==="common"?Co.has(a):!Co.has(a),i={};return r("verticalAlign")&&t.verticalAlign!==void 0&&(i[`${e}VerticalAlign`]=Pi(t.verticalAlign)),r("textFontFamily")&&t.textFontFamily!==void 0&&(i[we(e,"textFontFamily")]=t.textFontFamily),r("textFontSettings")&&t.textFontSettings!==void 0&&(i[we(e,"textFontSettings")]=t.textFontSettings),r("textFontSize")&&t.textFontSize!==void 0&&(i[we(e,"textFontSize")]=t.textFontSize),r("textLineHeight")&&t.textLineHeight!==void 0&&(i[we(e,"textLineHeight")]=t.textLineHeight),r("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(i[we(e,"textLetterSpacing")]=t.textLetterSpacing),r("textWordSpacing")&&t.textWordSpacing!==void 0&&(i[we(e,"textWordSpacing")]=t.textWordSpacing),r("textTextAlign")&&t.textTextAlign!==void 0&&(i[we(e,"textTextAlign")]=t.textTextAlign),r("textTextAppearance")&&t.textTextAppearance!==void 0&&(i[we(e,"textTextAppearance")]=t.textTextAppearance),i}function pr(e={},t){return Ei.reduce((n,r)=>({...n,...hu(r,gu(r,e),t)}),{})}const fu=pr(),yu=Dd();function ma(e){return[we(e,"textFontFamily"),we(e,"textFontSettings"),we(e,"textFontSize"),we(e,"textLineHeight"),we(e,"textLetterSpacing"),we(e,"textWordSpacing"),we(e,"textTextAlign"),we(e,"textTextAppearance"),`${e}VerticalAlign`]}function vu(){const e=[];return Li.forEach((t,n)=>{const r=Vt[n],i=ma(t);for(let a=1;a<Vt.length;a+=1){const s=[{name:"columns",value:a},...Array.from({length:a},(c,o)=>({name:`columnsOrder.${o}`,value:r,isNotEqual:!0}))];i.forEach(c=>{e.push({if:s,then:{name:`properties.${c}.display.visible`,value:!1}})})}}),e}const bu=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];ma(It);const xu=[...$n.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],Xt=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/default-list(1).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/default-list(2).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/default-list(3).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/default-list(4).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/default-list(5).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/default-list(6).webp"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/default-list(7).webp"}],Cu=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:Xt[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:Xt[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:Xt[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:Xt[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:Xt[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:Xt[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:Xt[6],link:""}],Su=[...$n.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],$u={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:{...cu(),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:Cu},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"}},...du(),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"}},...pu,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",...fu,...pr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:xo({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},...pr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:xo({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},...pr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...vu(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...xu.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}},...$n.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",...Su]},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__",yu]}],paletteBookmark:{items:[...bu],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},wu={element:au,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>eu(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:$u,sourceCode:su},Tu=[Ll,kl,Cc,Ac,Oc,Jc,rd,dd,Sd,wu];exports.components=Tu;exports.isSchemaV1=ya;
|