@cntrl-site/components 1.0.12-alpha.1 → 1.0.12-alpha.11
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/Form/Form.d.ts +2 -1
- package/dist/Components/Form/FormComponent.d.ts +3 -15
- package/dist/Components/Grid/Grid.d.ts +13 -1
- package/dist/Components/Grid/GridComponent.d.ts +1 -15
- package/dist/Components/Lightbox/Lightbox.d.ts +2 -1
- package/dist/Components/List/List.d.ts +27 -11
- package/dist/Components/List/ListComponent.d.ts +1 -15
- package/dist/Components/Marquee/Marquee.d.ts +8 -3
- package/dist/Components/Marquee/MarqueeComponent.d.ts +2 -1
- package/dist/Components/TestimonialGrid/TestimonialGrid.d.ts +2 -1
- package/dist/Components/TestimonialGrid/TestimonialGridComponent.d.ts +2 -1
- package/dist/Components/TestimonialSingle/TestimonialSingle.d.ts +2 -1
- package/dist/Components/TestimonialSingle/TestimonialSingleComponent.d.ts +2 -1
- package/dist/Components/utils/textStylesToCss.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1174 -641
- package/dist/index.mjs +6196 -5282
- package/dist/types/SchemaV1.d.ts +6 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("react"),ve=require("classnames"),T=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Bi=require("react-dom");function Nr(e){return e.type==="object"&&e.version===1}const Or="ControlSlider-module__wrapper___sHEkd",Hr="ControlSlider-module__hoverArrow___A-dOH",Br="ControlSlider-module__sliderItem___QQSkR",Vr="ControlSlider-module__sliderImage___9hRl-",Dr="ControlSlider-module__arrow___05ghY",zr="ControlSlider-module__arrowVertical___tBfVN",jr="ControlSlider-module__nextArrow___-30Yc",Kr="ControlSlider-module__arrowInner___aEra3",Ur="ControlSlider-module__arrowIcon___S4ztF",qr="ControlSlider-module__arrowImg___2dwJW",Gr="ControlSlider-module__mirror___brd6U",Yr="ControlSlider-module__pagination___bicLF",Xr="ControlSlider-module__paginationInner___bT-P-",Zr="ControlSlider-module__paginationVertical___zYqKw",Jr="ControlSlider-module__paginationItem___nTRbk",Qr="ControlSlider-module__dot___p1Qun",ea="ControlSlider-module__activeDot___LHFaj",ta="ControlSlider-module__paginationInsideBottom___R3FWn",na="ControlSlider-module__paginationInsideTop___V-qb-",oa="ControlSlider-module__paginationOutsideBottom___14w8D",ia="ControlSlider-module__paginationOutsideTop___SCLqB",ra="ControlSlider-module__paginationInsideLeft___yOBRZ",aa="ControlSlider-module__paginationInsideRight___Rtt3o",sa="ControlSlider-module__paginationOutsideLeft___lahaw",la="ControlSlider-module__paginationOutsideRight___EtuQa",ca="ControlSlider-module__imgWrapper___UjEgB",da="ControlSlider-module__captionBlock___dJ6-j",ua="ControlSlider-module__captionTextWrapper___HFlpf",pa="ControlSlider-module__captionText___uGBVc",ma="ControlSlider-module__active___WZK4G",ga="ControlSlider-module__withPointerEvents___t-18M",ha="ControlSlider-module__topLeftAlignment___zjnGM",fa="ControlSlider-module__topCenterAlignment___gD1xW",ya="ControlSlider-module__topRightAlignment___NMapS",va="ControlSlider-module__middleLeftAlignment___OnUrY",ba="ControlSlider-module__middleCenterAlignment___Tdkl0",xa="ControlSlider-module__middleRightAlignment___wEbfX",Ca="ControlSlider-module__bottomLeftAlignment___cTP2-",Sa="ControlSlider-module__bottomCenterAlignment___c54fB",wa="ControlSlider-module__bottomRightAlignment___kEwrz",$a="ControlSlider-module__clickOverlay___DZA28",Ta="ControlSlider-module__contain___pLyq7",La="ControlSlider-module__cover___KdDat",ae={wrapper:Or,hoverArrow:Hr,sliderItem:Br,sliderImage:Vr,arrow:Dr,arrowVertical:zr,nextArrow:jr,arrowInner:Kr,arrowIcon:Ur,arrowImg:qr,mirror:Gr,pagination:Yr,paginationInner:Xr,paginationVertical:Zr,paginationItem:Jr,dot:Qr,activeDot:ea,paginationInsideBottom:ta,paginationInsideTop:na,paginationOutsideBottom:oa,paginationOutsideTop:ia,paginationInsideLeft:ra,paginationInsideRight:aa,paginationOutsideLeft:sa,paginationOutsideRight:la,imgWrapper:ca,captionBlock:da,captionTextWrapper:ua,captionText:pa,active:ma,withPointerEvents:ga,topLeftAlignment:ha,topCenterAlignment:fa,topRightAlignment:ya,middleLeftAlignment:va,middleCenterAlignment:ba,middleRightAlignment:xa,bottomLeftAlignment:Ca,bottomCenterAlignment:Sa,bottomRightAlignment:wa,clickOverlay:$a,contain:Ta,cover:La};function Ea(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _a(e,t,n){return t&&Ea(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var li="(prefers-reduced-motion: reduce)",Ut=1,Pa=2,Yt=3,nn=4,Cn=5,On=6,Kn=7,Aa={CREATED:Ut,MOUNTED:Pa,IDLE:Yt,MOVING:nn,SCROLLING:Cn,DRAGGING:On,DESTROYED:Kn};function vt(e){e.length=0}function _t(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ee(e){return e.bind.apply(e,[null].concat(_t(arguments,1)))}var Vi=setTimeout,So=function(){};function ci(e){return requestAnimationFrame(e)}function Xn(e,t){return typeof t===e}function un(e){return!Io(e)&&Xn("object",e)}var Fo=Array.isArray,Di=Ee(Xn,"function"),Tt=Ee(Xn,"string"),Sn=Ee(Xn,"undefined");function Io(e){return e===null}function zi(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function wn(e){return Fo(e)?e:[e]}function tt(e,t){wn(e).forEach(t)}function Ro(e,t){return e.indexOf(t)>-1}function Hn(e,t){return e.push.apply(e,wn(t)),e}function gt(e,t,n){e&&tt(t,function(o){o&&e.classList[n?"add":"remove"](o)})}function ct(e,t){gt(e,Tt(t)?t.split(" "):t,!0)}function $n(e,t){tt(t,e.appendChild.bind(e))}function ko(e,t){tt(e,function(n){var o=(t||n).parentNode;o&&o.insertBefore(n,t)})}function pn(e,t){return zi(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function ji(e,t){var n=e?_t(e.children):[];return t?n.filter(function(o){return pn(o,t)}):n}function Tn(e,t){return t?ji(e,t)[0]:e.firstElementChild}var mn=Object.keys;function Nt(e,t,n){return e&&(n?mn(e).reverse():mn(e)).forEach(function(o){o!=="__proto__"&&t(e[o],o)}),e}function gn(e){return _t(arguments,1).forEach(function(t){Nt(t,function(n,o){e[o]=t[o]})}),e}function wt(e){return _t(arguments,1).forEach(function(t){Nt(t,function(n,o){Fo(n)?e[o]=n.slice():un(n)?e[o]=wt({},un(e[o])?e[o]:{},n):e[o]=n})}),e}function di(e,t){tt(t||mn(e),function(n){delete e[n]})}function dt(e,t){tt(e,function(n){tt(t,function(o){n&&n.removeAttribute(o)})})}function fe(e,t,n){un(t)?Nt(t,function(o,i){fe(e,i,o)}):tt(e,function(o){Io(n)||n===""?dt(o,t):o.setAttribute(t,String(n))})}function qt(e,t,n){var o=document.createElement(e);return t&&(Tt(t)?ct(o,t):fe(o,t)),n&&$n(n,o),o}function at(e,t,n){if(Sn(n))return getComputedStyle(e)[t];Io(n)||(e.style[t]=""+n)}function hn(e,t){at(e,"display",t)}function Ki(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function st(e,t){return e.getAttribute(t)}function ui(e,t){return e&&e.classList.contains(t)}function Je(e){return e.getBoundingClientRect()}function Ot(e){tt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Ui(e){return Tn(new DOMParser().parseFromString(e,"text/html").body)}function mt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function qi(e,t){return e&&e.querySelector(t)}function Mo(e,t){return t?_t(e.querySelectorAll(t)):[]}function ht(e,t){gt(e,t,!1)}function wo(e){return e.timeStamp}function Rt(e){return Tt(e)?e:e?e+"px":""}var Ln="splide",No="data-"+Ln;function cn(e,t){if(!e)throw new Error("["+Ln+"] "+(t||""))}var Lt=Math.min,Un=Math.max,qn=Math.floor,fn=Math.ceil,ze=Math.abs;function Gi(e,t,n){return ze(e-t)<n}function Bn(e,t,n,o){var i=Lt(t,n),l=Un(t,n);return o?i<e&&e<l:i<=e&&e<=l}function jt(e,t,n){var o=Lt(t,n),i=Un(t,n);return Lt(Un(o,e),i)}function $o(e){return+(e>0)-+(e<0)}function To(e,t){return tt(t,function(n){e=e.replace("%s",""+n)}),e}function Oo(e){return e<10?"0"+e:""+e}var pi={};function Wa(e){return""+e+Oo(pi[e]=(pi[e]||0)+1)}function Yi(){var e=[];function t(r,s,c,p){i(r,s,function(d,$,h){var f="addEventListener"in d,m=f?d.removeEventListener.bind(d,$,c,p):d.removeListener.bind(d,c);f?d.addEventListener($,c,p):d.addListener(c),e.push([d,$,h,c,m])})}function n(r,s,c){i(r,s,function(p,d,$){e=e.filter(function(h){return h[0]===p&&h[1]===d&&h[2]===$&&(!c||h[3]===c)?(h[4](),!1):!0})})}function o(r,s,c){var p,d=!0;return typeof CustomEvent=="function"?p=new CustomEvent(s,{bubbles:d,detail:c}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(s,d,!1,c)),r.dispatchEvent(p),p}function i(r,s,c){tt(r,function(p){p&&tt(s,function(d){d.split(" ").forEach(function($){var h=$.split(".");c(p,h[0],h[1])})})})}function l(){e.forEach(function(r){r[4]()}),vt(e)}return{bind:t,unbind:n,dispatch:o,destroy:l}}var Pt="mounted",Lo="ready",bt="move",on="moved",Ho="click",Xi="active",Zi="inactive",Ji="visible",Qi="hidden",Fe="refresh",De="updated",Xt="resize",Zn="resized",er="drag",tr="dragging",nr="dragged",Jn="scroll",Vt="scrolled",Fa="overflow",Bo="destroy",or="arrows:mounted",ir="arrows:updated",rr="pagination:mounted",ar="pagination:updated",Vo="navigation:mounted",Do="autoplay:play",sr="autoplay:playing",zo="autoplay:pause",jo="lazyload:loaded",lr="sk",cr="sh",Gn="ei";function _e(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Yi();function o(l,r){n.bind(t,wn(l).join(" "),function(s){r.apply(r,Fo(s.detail)?s.detail:[])})}function i(l){n.dispatch(t,l,_t(arguments,1))}return e&&e.event.on(Bo,n.destroy),gn(n,{bus:t,on:o,off:Ee(n.unbind,t),emit:i})}function Qn(e,t,n,o){var i=Date.now,l,r=0,s,c=!0,p=0;function d(){if(!c){if(r=e?Lt((i()-l)/e,1):1,n&&n(r),r>=1&&(t(),l=i(),o&&++p>=o))return h();s=ci(d)}}function $(y){y||m(),l=i()-(y?r*e:0),c=!1,s=ci(d)}function h(){c=!0}function f(){l=i(),r=0,n&&n(r)}function m(){s&&cancelAnimationFrame(s),r=0,s=0,c=!0}function g(y){e=y}function C(){return c}return{start:$,rewind:f,pause:h,cancel:m,set:g,isPaused:C}}function Ia(e){var t=e;function n(i){t=i}function o(i){return Ro(wn(i),t)}return{set:n,is:o}}function Ra(e,t){var n=Qn(0,e,null,1);return function(){n.isPaused()&&n.start()}}function ka(e,t,n){var o=e.state,i=n.breakpoints||{},l=n.reducedMotion||{},r=Yi(),s=[];function c(){var m=n.mediaQuery==="min";mn(i).sort(function(g,C){return m?+g-+C:+C-+g}).forEach(function(g){d(i[g],"("+(m?"min":"max")+"-width:"+g+"px)")}),d(l,li),$()}function p(m){m&&r.destroy()}function d(m,g){var C=matchMedia(g);r.bind(C,"change",$),s.push([m,C])}function $(){var m=o.is(Kn),g=n.direction,C=s.reduce(function(y,x){return wt(y,x[1].matches?x[0]:{})},{});di(n),f(C),n.destroy?e.destroy(n.destroy==="completely"):m?(p(!0),e.mount()):g!==n.direction&&e.refresh()}function h(m){matchMedia(li).matches&&(m?wt(n,l):di(n,mn(l)))}function f(m,g,C){wt(n,m),g&&wt(Object.getPrototypeOf(n),m),(C||!o.is(Ut))&&e.emit(De,n)}return{setup:c,destroy:p,reduce:h,set:f}}var eo="Arrow",to=eo+"Left",no=eo+"Right",dr=eo+"Up",ur=eo+"Down",mi="rtl",oo="ttb",po={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[dr,no],ArrowRight:[ur,to]};function Ma(e,t,n){function o(l,r,s){s=s||n.direction;var c=s===mi&&!r?1:s===oo?0:-1;return po[l]&&po[l][c]||l.replace(/width|left|right/i,function(p,d){var $=po[p.toLowerCase()][c]||p;return d>0?$.charAt(0).toUpperCase()+$.slice(1):$})}function i(l){return l*(n.direction===mi?1:-1)}return{resolve:o,orient:i}}var ft="role",Gt="tabindex",Na="disabled",lt="aria-",En=lt+"controls",pr=lt+"current",gi=lt+"selected",Qe=lt+"label",Ko=lt+"labelledby",mr=lt+"hidden",Uo=lt+"orientation",yn=lt+"roledescription",hi=lt+"live",fi=lt+"busy",yi=lt+"atomic",qo=[ft,Gt,Na,En,pr,Qe,Ko,mr,Uo,yn],ut=Ln+"__",At="is-",mo=Ln,vi=ut+"track",Oa=ut+"list",io=ut+"slide",gr=io+"--clone",Ha=io+"__container",Go=ut+"arrows",ro=ut+"arrow",hr=ro+"--prev",fr=ro+"--next",ao=ut+"pagination",yr=ao+"__page",Ba=ut+"progress",Va=Ba+"__bar",Da=ut+"toggle",za=ut+"spinner",ja=ut+"sr",Ka=At+"initialized",Ht=At+"active",vr=At+"prev",br=At+"next",Eo=At+"visible",_o=At+"loading",xr=At+"focus-in",Cr=At+"overflow",Ua=[Ht,Eo,vr,br,_o,xr,Cr],qa={slide:io,clone:gr,arrows:Go,arrow:ro,prev:hr,next:fr,pagination:ao,page:yr,spinner:za};function Ga(e,t){if(Di(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!pn(n,t);)n=n.parentElement;return n}var Ya=5,bi=200,Sr="touchstart mousedown",go="touchmove mousemove",ho="touchend touchcancel mouseup click";function Xa(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=e.root,s=n.i18n,c={},p=[],d=[],$=[],h,f,m;function g(){P(),L(),x()}function C(){i(Fe,y),i(Fe,g),i(De,x),l(document,Sr+" keydown",function(v){m=v.type==="keydown"},{capture:!0}),l(r,"focusin",function(){gt(r,xr,!!m)})}function y(v){var w=qo.concat("style");vt(p),ht(r,d),ht(h,$),dt([h,f],w),dt(r,v?w:["style",yn])}function x(){ht(r,d),ht(h,$),d=E(mo),$=E(vi),ct(r,d),ct(h,$),fe(r,Qe,n.label),fe(r,Ko,n.labelledby)}function P(){h=_("."+vi),f=Tn(h,"."+Oa),cn(h&&f,"A track/list element is missing."),Hn(p,ji(f,"."+io+":not(."+gr+")")),Nt({arrows:Go,pagination:ao,prev:hr,next:fr,bar:Va,toggle:Da},function(v,w){c[w]=_("."+v)}),gn(c,{root:r,track:h,list:f,slides:p})}function L(){var v=r.id||Wa(Ln),w=n.role;r.id=v,h.id=h.id||v+"-track",f.id=f.id||v+"-list",!st(r,ft)&&r.tagName!=="SECTION"&&w&&fe(r,ft,w),fe(r,yn,s.carousel),fe(f,ft,"presentation")}function _(v){var w=qi(r,v);return w&&Ga(w,"."+mo)===r?w:void 0}function E(v){return[v+"--"+n.type,v+"--"+n.direction,n.drag&&v+"--draggable",n.isNavigation&&v+"--nav",v===mo&&Ht]}return gn(c,{setup:g,mount:C,destroy:y})}var Zt="slide",rn="loop",_n="fade";function Za(e,t,n,o){var i=_e(e),l=i.on,r=i.emit,s=i.bind,c=e.Components,p=e.root,d=e.options,$=d.isNavigation,h=d.updateOnMove,f=d.i18n,m=d.pagination,g=d.slideFocus,C=c.Direction.resolve,y=st(o,"style"),x=st(o,Qe),P=n>-1,L=Tn(o,"."+Ha),_;function E(){P||(o.id=p.id+"-slide"+Oo(t+1),fe(o,ft,m?"tabpanel":"group"),fe(o,yn,f.slide),fe(o,Qe,x||To(f.slideLabel,[t+1,e.length]))),v()}function v(){s(o,"click",Ee(r,Ho,k)),s(o,"keydown",Ee(r,lr,k)),l([on,cr,Vt],A),l(Vo,R),h&&l(bt,V)}function w(){_=!0,i.destroy(),ht(o,Ua),dt(o,qo),fe(o,"style",y),fe(o,Qe,x||"")}function R(){var M=e.splides.map(function(W){var B=W.splide.Components.Slides.getAt(t);return B?B.slide.id:""}).join(" ");fe(o,Qe,To(f.slideX,(P?n:t)+1)),fe(o,En,M),fe(o,ft,g?"button":""),g&&dt(o,yn)}function V(){_||A()}function A(){if(!_){var M=e.index;H(),D(),gt(o,vr,t===M-1),gt(o,br,t===M+1)}}function H(){var M=U();M!==ui(o,Ht)&&(gt(o,Ht,M),fe(o,pr,$&&M||""),r(M?Xi:Zi,k))}function D(){var M=S(),W=!M&&(!U()||P);if(e.state.is([nn,Cn])||fe(o,mr,W||""),fe(Mo(o,d.focusableNodes||""),Gt,W?-1:""),g&&fe(o,Gt,W?-1:0),M!==ui(o,Eo)&&(gt(o,Eo,M),r(M?Ji:Qi,k)),!M&&document.activeElement===o){var B=c.Slides.getAt(e.index);B&&Ki(B.slide)}}function j(M,W,B){at(B&&L||o,M,W)}function U(){var M=e.index;return M===t||d.cloneStatus&&M===n}function S(){if(e.is(_n))return U();var M=Je(c.Elements.track),W=Je(o),B=C("left",!0),ee=C("right",!0);return qn(M[B])<=fn(W[B])&&qn(W[ee])<=fn(M[ee])}function N(M,W){var B=ze(M-t);return!P&&(d.rewind||e.is(rn))&&(B=Lt(B,e.length-B)),B<=W}var k={index:t,slideIndex:n,slide:o,container:L,isClone:P,mount:E,destroy:w,update:A,style:j,isWithin:N};return k}function Ja(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=o.bind,s=t.Elements,c=s.slides,p=s.list,d=[];function $(){h(),i(Fe,f),i(Fe,h)}function h(){c.forEach(function(A,H){g(A,H,-1)})}function f(){_(function(A){A.destroy()}),vt(d)}function m(){_(function(A){A.update()})}function g(A,H,D){var j=Za(e,H,D,A);j.mount(),d.push(j),d.sort(function(U,S){return U.index-S.index})}function C(A){return A?E(function(H){return!H.isClone}):d}function y(A){var H=t.Controller,D=H.toIndex(A),j=H.hasFocus()?1:n.perPage;return E(function(U){return Bn(U.index,D,D+j-1)})}function x(A){return E(A)[0]}function P(A,H){tt(A,function(D){if(Tt(D)&&(D=Ui(D)),zi(D)){var j=c[H];j?ko(D,j):$n(p,D),ct(D,n.classes.slide),w(D,Ee(l,Xt))}}),l(Fe)}function L(A){Ot(E(A).map(function(H){return H.slide})),l(Fe)}function _(A,H){C(H).forEach(A)}function E(A){return d.filter(Di(A)?A:function(H){return Tt(A)?pn(H.slide,A):Ro(wn(A),H.index)})}function v(A,H,D){_(function(j){j.style(A,H,D)})}function w(A,H){var D=Mo(A,"img"),j=D.length;j?D.forEach(function(U){r(U,"load error",function(){--j||H()})}):H()}function R(A){return A?c.length:d.length}function V(){return d.length>n.perPage}return{mount:$,destroy:f,update:m,register:g,get:C,getIn:y,getAt:x,add:P,remove:L,forEach:_,filter:E,style:v,getLength:R,isEnough:V}}function Qa(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.emit,s=t.Slides,c=t.Direction.resolve,p=t.Elements,d=p.root,$=p.track,h=p.list,f=s.getAt,m=s.style,g,C,y;function x(){P(),l(window,"resize load",Ra(Ee(r,Xt))),i([De,Fe],P),i(Xt,L)}function P(){g=n.direction===oo,at(d,"maxWidth",Rt(n.width)),at($,c("paddingLeft"),_(!1)),at($,c("paddingRight"),_(!0)),L(!0)}function L(k){var M=Je(d);(k||C.width!==M.width||C.height!==M.height)&&(at($,"height",E()),m(c("marginRight"),Rt(n.gap)),m("width",w()),m("height",R(),!0),C=M,r(Zn),y!==(y=N())&&(gt(d,Cr,y),r(Fa,y)))}function _(k){var M=n.padding,W=c(k?"right":"left");return M&&Rt(M[W]||(un(M)?0:M))||"0px"}function E(){var k="";return g&&(k=v(),cn(k,"height or heightRatio is missing."),k="calc("+k+" - "+_(!1)+" - "+_(!0)+")"),k}function v(){return Rt(n.height||Je(h).width*n.heightRatio)}function w(){return n.autoWidth?null:Rt(n.fixedWidth)||(g?"":V())}function R(){return Rt(n.fixedHeight)||(g?n.autoHeight?null:V():v())}function V(){var k=Rt(n.gap);return"calc((100%"+(k&&" + "+k)+")/"+(n.perPage||1)+(k&&" - "+k)+")"}function A(){return Je(h)[c("width")]}function H(k,M){var W=f(k||0);return W?Je(W.slide)[c("width")]+(M?0:U()):0}function D(k,M){var W=f(k);if(W){var B=Je(W.slide)[c("right")],ee=Je(h)[c("left")];return ze(B-ee)+(M?0:U())}return 0}function j(k){return D(e.length-1)-D(0)+H(0,k)}function U(){var k=f(0);return k&&parseFloat(at(k.slide,c("marginRight")))||0}function S(k){return parseFloat(at($,c("padding"+(k?"Right":"Left"))))||0}function N(){return e.is(_n)||j(!0)>A()}return{mount:x,resize:L,listSize:A,slideSize:H,sliderSize:j,totalSize:D,getPadding:S,isOverflow:N}}var es=2;function ts(e,t,n){var o=_e(e),i=o.on,l=t.Elements,r=t.Slides,s=t.Direction.resolve,c=[],p;function d(){i(Fe,$),i([De,Xt],f),(p=C())&&(m(p),t.Layout.resize(!0))}function $(){h(),d()}function h(){Ot(c),vt(c),o.destroy()}function f(){var y=C();p!==y&&(p<y||!y)&&o.emit(Fe)}function m(y){var x=r.get().slice(),P=x.length;if(P){for(;x.length<y;)Hn(x,x);Hn(x.slice(-y),x.slice(0,y)).forEach(function(L,_){var E=_<y,v=g(L.slide,_);E?ko(v,x[0].slide):$n(l.list,v),Hn(c,v),r.register(v,_-y+(E?0:P),L.index)})}}function g(y,x){var P=y.cloneNode(!0);return ct(P,n.classes.clone),P.id=e.root.id+"-clone"+Oo(x+1),P}function C(){var y=n.clones;if(!e.is(rn))y=0;else if(Sn(y)){var x=n[s("fixedWidth")]&&t.Layout.slideSize(0),P=x&&fn(Je(l.track)[s("width")]/x);y=P||n[s("autoWidth")]&&e.length||n.perPage*es}return y}return{mount:d,destroy:h}}function ns(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=e.state.set,s=t.Layout,c=s.slideSize,p=s.getPadding,d=s.totalSize,$=s.listSize,h=s.sliderSize,f=t.Direction,m=f.resolve,g=f.orient,C=t.Elements,y=C.list,x=C.track,P;function L(){P=t.Transition,i([Pt,Zn,De,Fe],_)}function _(){t.Controller.isBusy()||(t.Scroll.cancel(),v(e.index),t.Slides.update())}function E(W,B,ee,de){W!==B&&k(W>ee)&&(A(),w(V(j(),W>ee),!0)),r(nn),l(bt,B,ee,W),P.start(B,function(){r(Yt),l(on,B,ee,W),de&&de()})}function v(W){w(D(W,!0))}function w(W,B){if(!e.is(_n)){var ee=B?W:R(W);at(y,"transform","translate"+m("X")+"("+ee+"px)"),W!==ee&&l(cr)}}function R(W){if(e.is(rn)){var B=H(W),ee=B>t.Controller.getEnd(),de=B<0;(de||ee)&&(W=V(W,ee))}return W}function V(W,B){var ee=W-N(B),de=h();return W-=g(de*(fn(ze(ee)/de)||1))*(B?1:-1),W}function A(){w(j(),!0),P.cancel()}function H(W){for(var B=t.Slides.get(),ee=0,de=1/0,re=0;re<B.length;re++){var me=B[re].index,O=ze(D(me,!0)-W);if(O<=de)de=O,ee=me;else break}return ee}function D(W,B){var ee=g(d(W-1)-S(W));return B?U(ee):ee}function j(){var W=m("left");return Je(y)[W]-Je(x)[W]+g(p(!1))}function U(W){return n.trimSpace&&e.is(Zt)&&(W=jt(W,0,g(h(!0)-$()))),W}function S(W){var B=n.focus;return B==="center"?($()-c(W,!0))/2:+B*c(W)||0}function N(W){return D(W?t.Controller.getEnd():0,!!n.trimSpace)}function k(W){var B=g(V(j(),W));return W?B>=0:B<=y[m("scrollWidth")]-Je(x)[m("width")]}function M(W,B){B=Sn(B)?j():B;var ee=W!==!0&&g(B)<g(N(!1)),de=W!==!1&&g(B)>g(N(!0));return ee||de}return{mount:L,move:E,jump:v,translate:w,shift:V,cancel:A,toIndex:H,toPosition:D,getPosition:j,getLimit:N,exceededLimit:M,reposition:_}}function os(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=t.Move,s=r.getPosition,c=r.getLimit,p=r.toPosition,d=t.Slides,$=d.isEnough,h=d.getLength,f=n.omitEnd,m=e.is(rn),g=e.is(Zt),C=Ee(j,!1),y=Ee(j,!0),x=n.start||0,P,L=x,_,E,v;function w(){R(),i([De,Fe,Gn],R),i(Zn,V)}function R(){_=h(!0),E=n.perMove,v=n.perPage,P=k();var O=jt(x,0,f?P:_-1);O!==x&&(x=O,r.reposition())}function V(){P!==k()&&l(Gn)}function A(O,te,Y){if(!me()){var X=D(O),ne=N(X);ne>-1&&(te||ne!==x)&&(ee(ne),r.move(X,ne,L,Y))}}function H(O,te,Y,X){t.Scroll.scroll(O,te,Y,function(){var ne=N(r.toIndex(s()));ee(f?Lt(ne,P):ne),X&&X()})}function D(O){var te=x;if(Tt(O)){var Y=O.match(/([+\-<>])(\d+)?/)||[],X=Y[1],ne=Y[2];X==="+"||X==="-"?te=U(x+ +(""+X+(+ne||1)),x):X===">"?te=ne?M(+ne):C(!0):X==="<"&&(te=y(!0))}else te=m?O:jt(O,0,P);return te}function j(O,te){var Y=E||(re()?1:v),X=U(x+Y*(O?-1:1),x,!(E||re()));return X===-1&&g&&!Gi(s(),c(!O),1)?O?0:P:te?X:N(X)}function U(O,te,Y){if($()||re()){var X=S(O);X!==O&&(te=O,O=X,Y=!1),O<0||O>P?!E&&(Bn(0,O,te,!0)||Bn(P,te,O,!0))?O=M(W(O)):m?O=Y?O<0?-(_%v||v):_:O:n.rewind?O=O<0?P:0:O=-1:Y&&O!==te&&(O=M(W(te)+(O<te?-1:1)))}else O=-1;return O}function S(O){if(g&&n.trimSpace==="move"&&O!==x)for(var te=s();te===p(O,!0)&&Bn(O,0,e.length-1,!n.rewind);)O<x?--O:++O;return O}function N(O){return m?(O+_)%_||0:O}function k(){for(var O=_-(re()||m&&E?1:v);f&&O-- >0;)if(p(_-1,!0)!==p(O,!0)){O++;break}return jt(O,0,_-1)}function M(O){return jt(re()?O:v*O,0,P)}function W(O){return re()?Lt(O,P):qn((O>=P?_-1:O)/v)}function B(O){var te=r.toIndex(O);return g?jt(te,0,P):te}function ee(O){O!==x&&(L=x,x=O)}function de(O){return O?L:x}function re(){return!Sn(n.focus)||n.isNavigation}function me(){return e.state.is([nn,Cn])&&!!n.waitForTransition}return{mount:w,go:A,scroll:H,getNext:C,getPrev:y,getAdjacent:j,getEnd:k,setIndex:ee,getIndex:de,toIndex:M,toPage:W,toDest:B,hasFocus:re,isBusy:me}}var is="http://www.w3.org/2000/svg",rs="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",Wn=40;function as(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.emit,s=n.classes,c=n.i18n,p=t.Elements,d=t.Controller,$=p.arrows,h=p.track,f=$,m=p.prev,g=p.next,C,y,x={};function P(){_(),i(De,L)}function L(){E(),P()}function _(){var H=n.arrows;H&&!(m&&g)&&R(),m&&g&&(gn(x,{prev:m,next:g}),hn(f,H?"":"none"),ct(f,y=Go+"--"+n.direction),H&&(v(),A(),fe([m,g],En,h.id),r(or,m,g)))}function E(){o.destroy(),ht(f,y),C?(Ot($?[m,g]:f),m=g=null):dt([m,g],qo)}function v(){i([Pt,on,Fe,Vt,Gn],A),l(g,"click",Ee(w,">")),l(m,"click",Ee(w,"<"))}function w(H){d.go(H,!0)}function R(){f=$||qt("div",s.arrows),m=V(!0),g=V(!1),C=!0,$n(f,[m,g]),!$&&ko(f,h)}function V(H){var D='<button class="'+s.arrow+" "+(H?s.prev:s.next)+'" type="button"><svg xmlns="'+is+'" viewBox="0 0 '+Wn+" "+Wn+'" width="'+Wn+'" height="'+Wn+'" focusable="false"><path d="'+(n.arrowPath||rs)+'" />';return Ui(D)}function A(){if(m&&g){var H=e.index,D=d.getPrev(),j=d.getNext(),U=D>-1&&H<D?c.last:c.prev,S=j>-1&&H>j?c.first:c.next;m.disabled=D<0,g.disabled=j<0,fe(m,Qe,U),fe(g,Qe,S),r(ir,m,g,D,j)}}return{arrows:x,mount:P,destroy:E,update:A}}var ss=No+"-interval";function ls(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.emit,s=Qn(n.interval,e.go.bind(e,">"),v),c=s.isPaused,p=t.Elements,d=t.Elements,$=d.root,h=d.toggle,f=n.autoplay,m,g,C=f==="pause";function y(){f&&(x(),h&&fe(h,En,p.track.id),C||P(),E())}function x(){n.pauseOnHover&&l($,"mouseenter mouseleave",function(R){m=R.type==="mouseenter",_()}),n.pauseOnFocus&&l($,"focusin focusout",function(R){g=R.type==="focusin",_()}),h&&l(h,"click",function(){C?P():L(!0)}),i([bt,Jn,Fe],s.rewind),i(bt,w)}function P(){c()&&t.Slides.isEnough()&&(s.start(!n.resetProgress),g=m=C=!1,E(),r(Do))}function L(R){R===void 0&&(R=!0),C=!!R,E(),c()||(s.pause(),r(zo))}function _(){C||(m||g?L(!1):P())}function E(){h&&(gt(h,Ht,!C),fe(h,Qe,n.i18n[C?"play":"pause"]))}function v(R){var V=p.bar;V&&at(V,"width",R*100+"%"),r(sr,R)}function w(R){var V=t.Slides.getAt(R);s.set(V&&+st(V.slide,ss)||n.interval)}return{mount:y,destroy:s.cancel,play:P,pause:L,isPaused:c}}function cs(e,t,n){var o=_e(e),i=o.on;function l(){n.cover&&(i(jo,Ee(s,!0)),i([Pt,De,Fe],Ee(r,!0)))}function r(c){t.Slides.forEach(function(p){var d=Tn(p.container||p.slide,"img");d&&d.src&&s(c,d,p)})}function s(c,p,d){d.style("background",c?'center/cover no-repeat url("'+p.src+'")':"",!0),hn(p,c?"none":"")}return{mount:l,destroy:Ee(r,!1)}}var ds=10,us=600,ps=.6,ms=1.5,gs=800;function hs(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=e.state.set,s=t.Move,c=s.getPosition,p=s.getLimit,d=s.exceededLimit,$=s.translate,h=e.is(Zt),f,m,g=1;function C(){i(bt,L),i([De,Fe],_)}function y(v,w,R,V,A){var H=c();if(L(),R&&(!h||!d())){var D=t.Layout.sliderSize(),j=$o(v)*D*qn(ze(v)/D)||0;v=s.toPosition(t.Controller.toDest(v%D))+j}var U=Gi(H,v,1);g=1,w=U?0:w||Un(ze(v-H)/ms,gs),m=V,f=Qn(w,x,Ee(P,H,v,A),1),r(Cn),l(Jn),f.start()}function x(){r(Yt),m&&m(),l(Vt)}function P(v,w,R,V){var A=c(),H=v+(w-v)*E(V),D=(H-A)*g;$(A+D),h&&!R&&d()&&(g*=ps,ze(D)<ds&&y(p(d(!0)),us,!1,m,!0))}function L(){f&&f.cancel()}function _(){f&&!f.isPaused()&&(L(),x())}function E(v){var w=n.easingFunc;return w?w(v):1-Math.pow(1-v,4)}return{mount:C,destroy:L,scroll:y,cancel:_}}var Kt={passive:!1,capture:!0};function fs(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=o.bind,s=o.unbind,c=e.state,p=t.Move,d=t.Scroll,$=t.Controller,h=t.Elements.track,f=t.Media.reduce,m=t.Direction,g=m.resolve,C=m.orient,y=p.getPosition,x=p.exceededLimit,P,L,_,E,v,w=!1,R,V,A;function H(){r(h,go,So,Kt),r(h,ho,So,Kt),r(h,Sr,j,Kt),r(h,"click",N,{capture:!0}),r(h,"dragstart",mt),i([Pt,De],D)}function D(){var F=n.drag;oe(!F),E=F==="free"}function j(F){if(R=!1,!V){var b=ne(F);X(F.target)&&(b||!F.button)&&($.isBusy()?mt(F,!0):(A=b?h:window,v=c.is([nn,Cn]),_=null,r(A,go,U,Kt),r(A,ho,S,Kt),p.cancel(),d.cancel(),k(F)))}}function U(F){if(c.is(On)||(c.set(On),l(er)),F.cancelable)if(v){p.translate(P+Y(re(F)));var b=me(F)>bi,z=w!==(w=x());(b||z)&&k(F),R=!0,l(tr),mt(F)}else B(F)&&(v=W(F),mt(F))}function S(F){c.is(On)&&(c.set(Yt),l(nr)),v&&(M(F),mt(F)),s(A,go,U),s(A,ho,S),v=!1}function N(F){!V&&R&&mt(F,!0)}function k(F){_=L,L=F,P=y()}function M(F){var b=ee(F),z=de(b),q=n.rewind&&n.rewindByDrag;f(!1),E?$.scroll(z,0,n.snap):e.is(_n)?$.go(C($o(b))<0?q?"<":"-":q?">":"+"):e.is(Zt)&&w&&q?$.go(x(!0)?">":"<"):$.go($.toDest(z),!0),f(!0)}function W(F){var b=n.dragMinThreshold,z=un(b),q=z&&b.mouse||0,Z=(z?b.touch:+b)||10;return ze(re(F))>(ne(F)?Z:q)}function B(F){return ze(re(F))>ze(re(F,!0))}function ee(F){if(e.is(rn)||!w){var b=me(F);if(b&&b<bi)return re(F)/b}return 0}function de(F){return y()+$o(F)*Lt(ze(F)*(n.flickPower||600),E?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function re(F,b){return te(F,b)-te(O(F),b)}function me(F){return wo(F)-wo(O(F))}function O(F){return L===F&&_||L}function te(F,b){return(ne(F)?F.changedTouches[0]:F)["page"+g(b?"Y":"X")]}function Y(F){return F/(w&&e.is(Zt)?Ya:1)}function X(F){var b=n.noDrag;return!pn(F,"."+yr+", ."+ro)&&(!b||!pn(F,b))}function ne(F){return typeof TouchEvent<"u"&&F instanceof TouchEvent}function I(){return v}function oe(F){V=F}return{mount:H,disable:oe,isDragging:I}}var ys={Spacebar:" ",Right:no,Left:to,Up:dr,Down:ur};function Yo(e){return e=Tt(e)?e:e.key,ys[e]||e}var xi="keydown";function vs(e,t,n){var o=_e(e),i=o.on,l=o.bind,r=o.unbind,s=e.root,c=t.Direction.resolve,p,d;function $(){h(),i(De,f),i(De,h),i(bt,g)}function h(){var y=n.keyboard;y&&(p=y==="global"?window:s,l(p,xi,C))}function f(){r(p,xi)}function m(y){d=y}function g(){var y=d;d=!0,Vi(function(){d=y})}function C(y){if(!d){var x=Yo(y);x===c(to)?e.go("<"):x===c(no)&&e.go(">")}}return{mount:$,destroy:f,disable:m}}var dn=No+"-lazy",Vn=dn+"-srcset",bs="["+dn+"], ["+Vn+"]";function xs(e,t,n){var o=_e(e),i=o.on,l=o.off,r=o.bind,s=o.emit,c=n.lazyLoad==="sequential",p=[on,Vt],d=[];function $(){n.lazyLoad&&(h(),i(Fe,h))}function h(){vt(d),f(),c?y():(l(p),i(p,m),m())}function f(){t.Slides.forEach(function(x){Mo(x.slide,bs).forEach(function(P){var L=st(P,dn),_=st(P,Vn);if(L!==P.src||_!==P.srcset){var E=n.classes.spinner,v=P.parentElement,w=Tn(v,"."+E)||qt("span",E,v);d.push([P,x,w]),P.src||hn(P,"none")}})})}function m(){d=d.filter(function(x){var P=n.perPage*((n.preloadPages||1)+1)-1;return x[1].isWithin(e.index,P)?g(x):!0}),d.length||l(p)}function g(x){var P=x[0];ct(x[1].slide,_o),r(P,"load error",Ee(C,x)),fe(P,"src",st(P,dn)),fe(P,"srcset",st(P,Vn)),dt(P,dn),dt(P,Vn)}function C(x,P){var L=x[0],_=x[1];ht(_.slide,_o),P.type!=="error"&&(Ot(x[2]),hn(L,""),s(jo,L,_),s(Xt)),c&&y()}function y(){d.length&&g(d.shift())}return{mount:$,destroy:Ee(vt,d),check:m}}function Cs(e,t,n){var o=_e(e),i=o.on,l=o.emit,r=o.bind,s=t.Slides,c=t.Elements,p=t.Controller,d=p.hasFocus,$=p.getIndex,h=p.go,f=t.Direction.resolve,m=c.pagination,g=[],C,y;function x(){P(),i([De,Fe,Gn],x);var V=n.pagination;m&&hn(m,V?"":"none"),V&&(i([bt,Jn,Vt],R),L(),R(),l(rr,{list:C,items:g},w(e.index)))}function P(){C&&(Ot(m?_t(C.children):C),ht(C,y),vt(g),C=null),o.destroy()}function L(){var V=e.length,A=n.classes,H=n.i18n,D=n.perPage,j=d()?p.getEnd()+1:fn(V/D);C=m||qt("ul",A.pagination,c.track.parentElement),ct(C,y=ao+"--"+v()),fe(C,ft,"tablist"),fe(C,Qe,H.select),fe(C,Uo,v()===oo?"vertical":"");for(var U=0;U<j;U++){var S=qt("li",null,C),N=qt("button",{class:A.page,type:"button"},S),k=s.getIn(U).map(function(W){return W.slide.id}),M=!d()&&D>1?H.pageX:H.slideX;r(N,"click",Ee(_,U)),n.paginationKeyboard&&r(N,"keydown",Ee(E,U)),fe(S,ft,"presentation"),fe(N,ft,"tab"),fe(N,En,k.join(" ")),fe(N,Qe,To(M,U+1)),fe(N,Gt,-1),g.push({li:S,button:N,page:U})}}function _(V){h(">"+V,!0)}function E(V,A){var H=g.length,D=Yo(A),j=v(),U=-1;D===f(no,!1,j)?U=++V%H:D===f(to,!1,j)?U=(--V+H)%H:D==="Home"?U=0:D==="End"&&(U=H-1);var S=g[U];S&&(Ki(S.button),h(">"+U),mt(A,!0))}function v(){return n.paginationDirection||n.direction}function w(V){return g[p.toPage(V)]}function R(){var V=w($(!0)),A=w($());if(V){var H=V.button;ht(H,Ht),dt(H,gi),fe(H,Gt,-1)}if(A){var D=A.button;ct(D,Ht),fe(D,gi,!0),fe(D,Gt,"")}l(ar,{list:C,items:g},V,A)}return{items:g,mount:x,destroy:P,getAt:w,update:R}}var Ss=[" ","Enter"];function ws(e,t,n){var o=n.isNavigation,i=n.slideFocus,l=[];function r(){e.splides.forEach(function(m){m.isParent||(p(e,m.splide),p(m.splide,e))}),o&&d()}function s(){l.forEach(function(m){m.destroy()}),vt(l)}function c(){s(),r()}function p(m,g){var C=_e(m);C.on(bt,function(y,x,P){g.go(g.is(rn)?P:y)}),l.push(C)}function d(){var m=_e(e),g=m.on;g(Ho,h),g(lr,f),g([Pt,De],$),l.push(m),m.emit(Vo,e.splides)}function $(){fe(t.Elements.list,Uo,n.direction===oo?"vertical":"")}function h(m){e.go(m.index)}function f(m,g){Ro(Ss,Yo(g))&&(h(m),mt(g))}return{setup:Ee(t.Media.set,{slideFocus:Sn(i)?o:i},!0),mount:r,destroy:s,remount:c}}function $s(e,t,n){var o=_e(e),i=o.bind,l=0;function r(){n.wheel&&i(t.Elements.track,"wheel",s,Kt)}function s(p){if(p.cancelable){var d=p.deltaY,$=d<0,h=wo(p),f=n.wheelMinThreshold||0,m=n.wheelSleep||0;ze(d)>f&&h-l>m&&(e.go($?"<":">"),l=h),c($)&&mt(p)}}function c(p){return!n.releaseWheel||e.state.is(nn)||t.Controller.getAdjacent(p)!==-1}return{mount:r}}var Ts=90;function Ls(e,t,n){var o=_e(e),i=o.on,l=t.Elements.track,r=n.live&&!n.isNavigation,s=qt("span",ja),c=Qn(Ts,Ee(d,!1));function p(){r&&(h(!t.Autoplay.isPaused()),fe(l,yi,!0),s.textContent="…",i(Do,Ee(h,!0)),i(zo,Ee(h,!1)),i([on,Vt],Ee(d,!0)))}function d(f){fe(l,fi,f),f?($n(l,s),c.start()):(Ot(s),c.cancel())}function $(){dt(l,[hi,yi,fi]),Ot(s)}function h(f){r&&fe(l,hi,f?"off":"polite")}return{mount:p,disable:h,destroy:$}}var Es=Object.freeze({__proto__:null,Media:ka,Direction:Ma,Elements:Xa,Slides:Ja,Layout:Qa,Clones:ts,Move:ns,Controller:os,Arrows:as,Autoplay:ls,Cover:cs,Scroll:hs,Drag:fs,Keyboard:vs,LazyLoad:xs,Pagination:Cs,Sync:ws,Wheel:$s,Live:Ls}),_s={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"},Ps={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:qa,i18n:_s,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function As(e,t,n){var o=t.Slides;function i(){_e(e).on([Pt,Fe],l)}function l(){o.forEach(function(s){s.style("transform","translateX(-"+100*s.index+"%)")})}function r(s,c){o.style("transition","opacity "+n.speed+"ms "+n.easing),Vi(c)}return{mount:i,start:r,cancel:So}}function Ws(e,t,n){var o=t.Move,i=t.Controller,l=t.Scroll,r=t.Elements.list,s=Ee(at,r,"transition"),c;function p(){_e(e).bind(r,"transitionend",function(f){f.target===r&&c&&($(),c())})}function d(f,m){var g=o.toPosition(f,!0),C=o.getPosition(),y=h(f);ze(g-C)>=1&&y>=1?n.useScroll?l.scroll(g,y,!1,m):(s("transform "+y+"ms "+n.easing),o.translate(g,!0),c=m):(o.jump(f),m())}function $(){s(""),l.cancel()}function h(f){var m=n.rewindSpeed;if(e.is(Zt)&&m){var g=i.getIndex(!0),C=i.getEnd();if(g===0&&f>=C||g>=C&&f===0)return m}return n.speed}return{mount:p,start:d,cancel:$}}var Fs=(function(){function e(n,o){this.event=_e(),this.Components={},this.state=Ia(Ut),this.splides=[],this._o={},this._E={};var i=Tt(n)?qi(document,n):n;cn(i,i+" is invalid."),this.root=i,o=wt({label:st(i,Qe)||"",labelledby:st(i,Ko)||""},Ps,e.defaults,o||{});try{wt(o,JSON.parse(st(i,No)))}catch{cn(!1,"Invalid JSON")}this._o=Object.create(wt({},o))}var t=e.prototype;return t.mount=function(o,i){var l=this,r=this.state,s=this.Components;cn(r.is([Ut,Kn]),"Already mounted!"),r.set(Ut),this._C=s,this._T=i||this._T||(this.is(_n)?As:Ws),this._E=o||this._E;var c=gn({},Es,this._E,{Transition:this._T});return Nt(c,function(p,d){var $=p(l,s,l._o);s[d]=$,$.setup&&$.setup()}),Nt(s,function(p){p.mount&&p.mount()}),this.emit(Pt),ct(this.root,Ka),r.set(Yt),this.emit(Lo),this},t.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(Yt)&&(this._C.Sync.remount(),o.Components.Sync.remount()),this},t.go=function(o){return this._C.Controller.go(o),this},t.on=function(o,i){return this.event.on(o,i),this},t.off=function(o){return this.event.off(o),this},t.emit=function(o){var i;return(i=this.event).emit.apply(i,[o].concat(_t(arguments,1))),this},t.add=function(o,i){return this._C.Slides.add(o,i),this},t.remove=function(o){return this._C.Slides.remove(o),this},t.is=function(o){return this._o.type===o},t.refresh=function(){return this.emit(Fe),this},t.destroy=function(o){o===void 0&&(o=!0);var i=this.event,l=this.state;return l.is(Ut)?_e(this).on(Lo,this.destroy.bind(this,o)):(Nt(this._C,function(r){r.destroy&&r.destroy(o)},!0),i.emit(Bo),i.destroy(),o&&vt(this.splides),l.set(Kn)),this},_a(e,[{key:"options",get:function(){return this._o},set:function(o){this._C.Media.set(o,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Xo=Fs;Xo.defaults={};Xo.STATES=Aa;var Ci=[[Pt,"onMounted"],[Lo,"onReady"],[bt,"onMove"],[on,"onMoved"],[Ho,"onClick"],[Xi,"onActive"],[Zi,"onInactive"],[Ji,"onVisible"],[Qi,"onHidden"],[Fe,"onRefresh"],[De,"onUpdated"],[Xt,"onResize"],[Zn,"onResized"],[er,"onDrag"],[tr,"onDragging"],[nr,"onDragged"],[Jn,"onScroll"],[Vt,"onScrolled"],[Bo,"onDestroy"],[or,"onArrowsMounted"],[ir,"onArrowsUpdated"],[rr,"onPaginationMounted"],[ar,"onPaginationUpdated"],[Vo,"onNavigationMounted"],[Do,"onAutoplayPlay"],[sr,"onAutoplayPlaying"],[zo,"onAutoplayPause"],[jo,"onLazyLoadLoaded"]];function Zo(...e){return e.filter(Boolean).join(" ")}function Yn(e){return e!==null&&typeof e=="object"}function Po(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,o)=>!Po(n,t[o]));if(Yn(e)&&Yn(t)){const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&!n.some(i=>!Object.prototype.hasOwnProperty.call(t,i)||!Po(e[i],t[i]))}return e===t}function Is(e,t){return e.length===t.length&&!e.some((n,o)=>n!==t[o])}function Rs(e,t){if(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const i=n[o];if(i!=="__proto__"&&t(e[i],i)===!1)break}}return e}function Ao(e,t){const n=e;return Rs(t,(o,i)=>{Array.isArray(o)?n[i]=o.slice():Yn(o)?n[i]=Ao(Yn(n[i])?n[i]:{},o):n[i]=o}),n}var ks=({children:e,className:t,...n})=>u.createElement("div",{className:Zo("splide__track",t),...n},u.createElement("ul",{className:"splide__list"},e)),Jo=class extends u.Component{constructor(){super(...arguments),this.splideRef=u.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new Xo(o,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Ao({},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&&!Po(this.options,e)&&(this.splide.options=e,this.options=Ao({},e));const t=this.getSlides();Is(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){Ci.forEach(([t,n])=>{const o=this.props[n];typeof o=="function"&&e.on(t,(...i)=>{o(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:o,...i}=this.props;return u.createElement(t,{className:Zo("splide",e),ref:this.splideRef,...this.omit(i,["options",...Ci.map(l=>l[1])])},n?u.createElement(ks,null,o):o)}},Qo=({children:e,className:t,...n})=>u.createElement("li",{className:Zo("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),p=require("react"),Te=require("classnames"),E=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Qi=require("react-dom");function Zr(e){return e.type==="object"&&e.version===1}const Jr="ControlSlider-module__wrapper___sHEkd",Qr="ControlSlider-module__hoverArrow___A-dOH",ea="ControlSlider-module__sliderItem___QQSkR",ta="ControlSlider-module__sliderImage___9hRl-",na="ControlSlider-module__arrow___05ghY",oa="ControlSlider-module__arrowVertical___tBfVN",ia="ControlSlider-module__nextArrow___-30Yc",ra="ControlSlider-module__arrowInner___aEra3",aa="ControlSlider-module__arrowIcon___S4ztF",sa="ControlSlider-module__arrowImg___2dwJW",la="ControlSlider-module__mirror___brd6U",ca="ControlSlider-module__pagination___bicLF",da="ControlSlider-module__paginationInner___bT-P-",ua="ControlSlider-module__paginationVertical___zYqKw",pa="ControlSlider-module__paginationItem___nTRbk",ma="ControlSlider-module__dot___p1Qun",ga="ControlSlider-module__activeDot___LHFaj",ha="ControlSlider-module__paginationInsideBottom___R3FWn",fa="ControlSlider-module__paginationInsideTop___V-qb-",ya="ControlSlider-module__paginationOutsideBottom___14w8D",va="ControlSlider-module__paginationOutsideTop___SCLqB",ba="ControlSlider-module__paginationInsideLeft___yOBRZ",xa="ControlSlider-module__paginationInsideRight___Rtt3o",Ca="ControlSlider-module__paginationOutsideLeft___lahaw",Sa="ControlSlider-module__paginationOutsideRight___EtuQa",wa="ControlSlider-module__imgWrapper___UjEgB",$a="ControlSlider-module__captionBlock___dJ6-j",Ta="ControlSlider-module__captionTextWrapper___HFlpf",La="ControlSlider-module__captionText___uGBVc",Ea="ControlSlider-module__active___WZK4G",Pa="ControlSlider-module__withPointerEvents___t-18M",_a="ControlSlider-module__topLeftAlignment___zjnGM",Aa="ControlSlider-module__topCenterAlignment___gD1xW",Ra="ControlSlider-module__topRightAlignment___NMapS",Wa="ControlSlider-module__middleLeftAlignment___OnUrY",Ia="ControlSlider-module__middleCenterAlignment___Tdkl0",ka="ControlSlider-module__middleRightAlignment___wEbfX",Fa="ControlSlider-module__bottomLeftAlignment___cTP2-",Ma="ControlSlider-module__bottomCenterAlignment___c54fB",Na="ControlSlider-module__bottomRightAlignment___kEwrz",Ha="ControlSlider-module__clickOverlay___DZA28",Ba="ControlSlider-module__contain___pLyq7",Oa="ControlSlider-module__cover___KdDat",ae={wrapper:Jr,hoverArrow:Qr,sliderItem:ea,sliderImage:ta,arrow:na,arrowVertical:oa,nextArrow:ia,arrowInner:ra,arrowIcon:aa,arrowImg:sa,mirror:la,pagination:ca,paginationInner:da,paginationVertical:ua,paginationItem:pa,dot:ma,activeDot:ga,paginationInsideBottom:ha,paginationInsideTop:fa,paginationOutsideBottom:ya,paginationOutsideTop:va,paginationInsideLeft:ba,paginationInsideRight:xa,paginationOutsideLeft:Ca,paginationOutsideRight:Sa,imgWrapper:wa,captionBlock:$a,captionTextWrapper:Ta,captionText:La,active:Ea,withPointerEvents:Pa,topLeftAlignment:_a,topCenterAlignment:Aa,topRightAlignment:Ra,middleLeftAlignment:Wa,middleCenterAlignment:Ia,middleRightAlignment:ka,bottomLeftAlignment:Fa,bottomCenterAlignment:Ma,bottomRightAlignment:Na,clickOverlay:Ha,contain:Ba,cover:Oa};function Va(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Da(e,t,n){return t&&Va(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var fi="(prefers-reduced-motion: reduce)",Jt=1,ja=2,tn=3,ln=4,En=5,Un=6,eo=7,za={CREATED:Jt,MOUNTED:ja,IDLE:tn,MOVING:ln,SCROLLING:En,DRAGGING:Un,DESTROYED:eo};function wt(e){e.length=0}function It(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ae(e){return e.bind.apply(e,[null].concat(It(arguments,1)))}var er=setTimeout,Ro=function(){};function yi(e){return requestAnimationFrame(e)}function ao(e,t){return typeof t===e}function fn(e){return!Do(e)&&ao("object",e)}var Vo=Array.isArray,tr=Ae(ao,"function"),At=Ae(ao,"string"),Pn=Ae(ao,"undefined");function Do(e){return e===null}function nr(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function _n(e){return Vo(e)?e:[e]}function rt(e,t){_n(e).forEach(t)}function jo(e,t){return e.indexOf(t)>-1}function Gn(e,t){return e.push.apply(e,_n(t)),e}function bt(e,t,n){e&&rt(t,function(o){o&&e.classList[n?"add":"remove"](o)})}function gt(e,t){bt(e,At(t)?t.split(" "):t,!0)}function An(e,t){rt(t,e.appendChild.bind(e))}function zo(e,t){rt(e,function(n){var o=(t||n).parentNode;o&&o.insertBefore(n,t)})}function yn(e,t){return nr(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function or(e,t){var n=e?It(e.children):[];return t?n.filter(function(o){return yn(o,t)}):n}function Rn(e,t){return t?or(e,t)[0]:e.firstElementChild}var vn=Object.keys;function Dt(e,t,n){return e&&(n?vn(e).reverse():vn(e)).forEach(function(o){o!=="__proto__"&&t(e[o],o)}),e}function bn(e){return It(arguments,1).forEach(function(t){Dt(t,function(n,o){e[o]=t[o]})}),e}function Pt(e){return It(arguments,1).forEach(function(t){Dt(t,function(n,o){Vo(n)?e[o]=n.slice():fn(n)?e[o]=Pt({},fn(e[o])?e[o]:{},n):e[o]=n})}),e}function vi(e,t){rt(t||vn(e),function(n){delete e[n]})}function ht(e,t){rt(e,function(n){rt(t,function(o){n&&n.removeAttribute(o)})})}function he(e,t,n){fn(t)?Dt(t,function(o,r){he(e,r,o)}):rt(e,function(o){Do(n)||n===""?ht(o,t):o.setAttribute(t,String(n))})}function Qt(e,t,n){var o=document.createElement(e);return t&&(At(t)?gt(o,t):he(o,t)),n&&An(n,o),o}function at(e,t,n){if(Pn(n))return getComputedStyle(e)[t];Do(n)||(e.style[t]=""+n)}function xn(e,t){at(e,"display",t)}function ir(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function st(e,t){return e.getAttribute(t)}function bi(e,t){return e&&e.classList.contains(t)}function nt(e){return e.getBoundingClientRect()}function jt(e){rt(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function rr(e){return Rn(new DOMParser().parseFromString(e,"text/html").body)}function vt(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ar(e,t){return e&&e.querySelector(t)}function Ko(e,t){return t?It(e.querySelectorAll(t)):[]}function xt(e,t){bt(e,t,!1)}function Wo(e){return e.timeStamp}function Ht(e){return At(e)?e:e?e+"px":""}var Wn="splide",qo="data-"+Wn;function gn(e,t){if(!e)throw new Error("["+Wn+"] "+(t||""))}var Rt=Math.min,to=Math.max,no=Math.floor,Cn=Math.ceil,Ue=Math.abs;function sr(e,t,n){return Ue(e-t)<n}function Yn(e,t,n,o){var r=Rt(t,n),a=to(t,n);return o?r<e&&e<a:r<=e&&e<=a}function Yt(e,t,n){var o=Rt(t,n),r=to(t,n);return Rt(to(o,e),r)}function Io(e){return+(e>0)-+(e<0)}function ko(e,t){return rt(t,function(n){e=e.replace("%s",""+n)}),e}function Uo(e){return e<10?"0"+e:""+e}var xi={};function Ka(e){return""+e+Uo(xi[e]=(xi[e]||0)+1)}function lr(){var e=[];function t(i,c,s,d){r(i,c,function(u,P,v){var x="addEventListener"in u,h=x?u.removeEventListener.bind(u,P,s,d):u.removeListener.bind(u,s);x?u.addEventListener(P,s,d):u.addListener(s),e.push([u,P,v,s,h])})}function n(i,c,s){r(i,c,function(d,u,P){e=e.filter(function(v){return v[0]===d&&v[1]===u&&v[2]===P&&(!s||v[3]===s)?(v[4](),!1):!0})})}function o(i,c,s){var d,u=!0;return typeof CustomEvent=="function"?d=new CustomEvent(c,{bubbles:u,detail:s}):(d=document.createEvent("CustomEvent"),d.initCustomEvent(c,u,!1,s)),i.dispatchEvent(d),d}function r(i,c,s){rt(i,function(d){d&&rt(c,function(u){u.split(" ").forEach(function(P){var v=P.split(".");s(d,v[0],v[1])})})})}function a(){e.forEach(function(i){i[4]()}),wt(e)}return{bind:t,unbind:n,dispatch:o,destroy:a}}var kt="mounted",Fo="ready",$t="move",cn="moved",Go="click",cr="active",dr="inactive",ur="visible",pr="hidden",Be="refresh",Ke="updated",nn="resize",so="resized",mr="drag",gr="dragging",hr="dragged",lo="scroll",Kt="scrolled",qa="overflow",Yo="destroy",fr="arrows:mounted",yr="arrows:updated",vr="pagination:mounted",br="pagination:updated",Xo="navigation:mounted",Zo="autoplay:play",xr="autoplay:playing",Jo="autoplay:pause",Qo="lazyload:loaded",Cr="sk",Sr="sh",oo="ei";function Fe(e){var t=e?e.event.bus:document.createDocumentFragment(),n=lr();function o(a,i){n.bind(t,_n(a).join(" "),function(c){i.apply(i,Vo(c.detail)?c.detail:[])})}function r(a){n.dispatch(t,a,It(arguments,1))}return e&&e.event.on(Yo,n.destroy),bn(n,{bus:t,on:o,off:Ae(n.unbind,t),emit:r})}function co(e,t,n,o){var r=Date.now,a,i=0,c,s=!0,d=0;function u(){if(!s){if(i=e?Rt((r()-a)/e,1):1,n&&n(i),i>=1&&(t(),a=r(),o&&++d>=o))return v();c=yi(u)}}function P(L){L||h(),a=r()-(L?i*e:0),s=!1,c=yi(u)}function v(){s=!0}function x(){a=r(),i=0,n&&n(i)}function h(){c&&cancelAnimationFrame(c),i=0,c=0,s=!0}function g(L){e=L}function T(){return s}return{start:P,rewind:x,pause:v,cancel:h,set:g,isPaused:T}}function Ua(e){var t=e;function n(r){t=r}function o(r){return jo(_n(r),t)}return{set:n,is:o}}function Ga(e,t){var n=co(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Ya(e,t,n){var o=e.state,r=n.breakpoints||{},a=n.reducedMotion||{},i=lr(),c=[];function s(){var h=n.mediaQuery==="min";vn(r).sort(function(g,T){return h?+g-+T:+T-+g}).forEach(function(g){u(r[g],"("+(h?"min":"max")+"-width:"+g+"px)")}),u(a,fi),P()}function d(h){h&&i.destroy()}function u(h,g){var T=matchMedia(g);i.bind(T,"change",P),c.push([h,T])}function P(){var h=o.is(eo),g=n.direction,T=c.reduce(function(L,b){return Pt(L,b[1].matches?b[0]:{})},{});vi(n),x(T),n.destroy?e.destroy(n.destroy==="completely"):h?(d(!0),e.mount()):g!==n.direction&&e.refresh()}function v(h){matchMedia(fi).matches&&(h?Pt(n,a):vi(n,vn(a)))}function x(h,g,T){Pt(n,h),g&&Pt(Object.getPrototypeOf(n),h),(T||!o.is(Jt))&&e.emit(Ke,n)}return{setup:s,destroy:d,reduce:v,set:x}}var uo="Arrow",po=uo+"Left",mo=uo+"Right",wr=uo+"Up",$r=uo+"Down",Ci="rtl",go="ttb",xo={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[wr,mo],ArrowRight:[$r,po]};function Xa(e,t,n){function o(a,i,c){c=c||n.direction;var s=c===Ci&&!i?1:c===go?0:-1;return xo[a]&&xo[a][s]||a.replace(/width|left|right/i,function(d,u){var P=xo[d.toLowerCase()][s]||d;return u>0?P.charAt(0).toUpperCase()+P.slice(1):P})}function r(a){return a*(n.direction===Ci?1:-1)}return{resolve:o,orient:r}}var Ct="role",en="tabindex",Za="disabled",lt="aria-",In=lt+"controls",Tr=lt+"current",Si=lt+"selected",ot=lt+"label",ei=lt+"labelledby",Lr=lt+"hidden",ti=lt+"orientation",Sn=lt+"roledescription",wi=lt+"live",$i=lt+"busy",Ti=lt+"atomic",ni=[Ct,en,Za,In,Tr,ot,ei,Lr,ti,Sn],ft=Wn+"__",Ft="is-",Co=Wn,Li=ft+"track",Ja=ft+"list",ho=ft+"slide",Er=ho+"--clone",Qa=ho+"__container",oi=ft+"arrows",fo=ft+"arrow",Pr=fo+"--prev",_r=fo+"--next",yo=ft+"pagination",Ar=yo+"__page",es=ft+"progress",ts=es+"__bar",ns=ft+"toggle",os=ft+"spinner",is=ft+"sr",rs=Ft+"initialized",zt=Ft+"active",Rr=Ft+"prev",Wr=Ft+"next",Mo=Ft+"visible",No=Ft+"loading",Ir=Ft+"focus-in",kr=Ft+"overflow",as=[zt,Mo,Rr,Wr,No,Ir,kr],ss={slide:ho,clone:Er,arrows:oi,arrow:fo,prev:Pr,next:_r,pagination:yo,page:Ar,spinner:os};function ls(e,t){if(tr(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!yn(n,t);)n=n.parentElement;return n}var cs=5,Ei=200,Fr="touchstart mousedown",So="touchmove mousemove",wo="touchend touchcancel mouseup click";function ds(e,t,n){var o=Fe(e),r=o.on,a=o.bind,i=e.root,c=n.i18n,s={},d=[],u=[],P=[],v,x,h;function g(){m(),H(),b()}function T(){r(Be,L),r(Be,g),r(Ke,b),a(document,Fr+" keydown",function(C){h=C.type==="keydown"},{capture:!0}),a(i,"focusin",function(){bt(i,Ir,!!h)})}function L(C){var W=ni.concat("style");wt(d),xt(i,u),xt(v,P),ht([v,x],W),ht(i,C?W:["style",Sn])}function b(){xt(i,u),xt(v,P),u=_(Co),P=_(Li),gt(i,u),gt(v,P),he(i,ot,n.label),he(i,ei,n.labelledby)}function m(){v=F("."+Li),x=Rn(v,"."+Ja),gn(v&&x,"A track/list element is missing."),Gn(d,or(x,"."+ho+":not(."+Er+")")),Dt({arrows:oi,pagination:yo,prev:Pr,next:_r,bar:ts,toggle:ns},function(C,W){s[W]=F("."+C)}),bn(s,{root:i,track:v,list:x,slides:d})}function H(){var C=i.id||Ka(Wn),W=n.role;i.id=C,v.id=v.id||C+"-track",x.id=x.id||C+"-list",!st(i,Ct)&&i.tagName!=="SECTION"&&W&&he(i,Ct,W),he(i,Sn,c.carousel),he(x,Ct,"presentation")}function F(C){var W=ar(i,C);return W&&ls(W,"."+Co)===i?W:void 0}function _(C){return[C+"--"+n.type,C+"--"+n.direction,n.drag&&C+"--draggable",n.isNavigation&&C+"--nav",C===Co&&zt]}return bn(s,{setup:g,mount:T,destroy:L})}var on="slide",dn="loop",kn="fade";function us(e,t,n,o){var r=Fe(e),a=r.on,i=r.emit,c=r.bind,s=e.Components,d=e.root,u=e.options,P=u.isNavigation,v=u.updateOnMove,x=u.i18n,h=u.pagination,g=u.slideFocus,T=s.Direction.resolve,L=st(o,"style"),b=st(o,ot),m=n>-1,H=Rn(o,"."+Qa),F;function _(){m||(o.id=d.id+"-slide"+Uo(t+1),he(o,Ct,h?"tabpanel":"group"),he(o,Sn,x.slide),he(o,ot,b||ko(x.slideLabel,[t+1,e.length]))),C()}function C(){c(o,"click",Ae(i,Go,R)),c(o,"keydown",Ae(i,Cr,R)),a([cn,Sr,Kt],S),a(Xo,w),v&&a($t,O)}function W(){F=!0,r.destroy(),xt(o,as),ht(o,ni),he(o,"style",L),he(o,ot,b||"")}function w(){var B=e.splides.map(function(I){var A=I.splide.Components.Slides.getAt(t);return A?A.slide.id:""}).join(" ");he(o,ot,ko(x.slideX,(m?n:t)+1)),he(o,In,B),he(o,Ct,g?"button":""),g&&ht(o,Sn)}function O(){F||S()}function S(){if(!F){var B=e.index;V(),D(),bt(o,Rr,t===B-1),bt(o,Wr,t===B+1)}}function V(){var B=q();B!==bi(o,zt)&&(bt(o,zt,B),he(o,Tr,P&&B||""),i(B?cr:dr,R))}function D(){var B=$(),I=!B&&(!q()||m);if(e.state.is([ln,En])||he(o,Lr,I||""),he(Ko(o,u.focusableNodes||""),en,I?-1:""),g&&he(o,en,I?-1:0),B!==bi(o,Mo)&&(bt(o,Mo,B),i(B?ur:pr,R)),!B&&document.activeElement===o){var A=s.Slides.getAt(e.index);A&&ir(A.slide)}}function Z(B,I,A){at(A&&H||o,B,I)}function q(){var B=e.index;return B===t||u.cloneStatus&&B===n}function $(){if(e.is(kn))return q();var B=nt(s.Elements.track),I=nt(o),A=T("left",!0),Q=T("right",!0);return no(B[A])<=Cn(I[A])&&no(I[Q])<=Cn(B[Q])}function k(B,I){var A=Ue(B-t);return!m&&(u.rewind||e.is(dn))&&(A=Rt(A,e.length-A)),A<=I}var R={index:t,slideIndex:n,slide:o,container:H,isClone:m,mount:_,destroy:W,update:S,style:Z,isWithin:k};return R}function ps(e,t,n){var o=Fe(e),r=o.on,a=o.emit,i=o.bind,c=t.Elements,s=c.slides,d=c.list,u=[];function P(){v(),r(Be,x),r(Be,v)}function v(){s.forEach(function(S,V){g(S,V,-1)})}function x(){F(function(S){S.destroy()}),wt(u)}function h(){F(function(S){S.update()})}function g(S,V,D){var Z=us(e,V,D,S);Z.mount(),u.push(Z),u.sort(function(q,$){return q.index-$.index})}function T(S){return S?_(function(V){return!V.isClone}):u}function L(S){var V=t.Controller,D=V.toIndex(S),Z=V.hasFocus()?1:n.perPage;return _(function(q){return Yn(q.index,D,D+Z-1)})}function b(S){return _(S)[0]}function m(S,V){rt(S,function(D){if(At(D)&&(D=rr(D)),nr(D)){var Z=s[V];Z?zo(D,Z):An(d,D),gt(D,n.classes.slide),W(D,Ae(a,nn))}}),a(Be)}function H(S){jt(_(S).map(function(V){return V.slide})),a(Be)}function F(S,V){T(V).forEach(S)}function _(S){return u.filter(tr(S)?S:function(V){return At(S)?yn(V.slide,S):jo(_n(S),V.index)})}function C(S,V,D){F(function(Z){Z.style(S,V,D)})}function W(S,V){var D=Ko(S,"img"),Z=D.length;Z?D.forEach(function(q){i(q,"load error",function(){--Z||V()})}):V()}function w(S){return S?s.length:u.length}function O(){return u.length>n.perPage}return{mount:P,destroy:x,update:h,register:g,get:T,getIn:L,getAt:b,add:m,remove:H,forEach:F,filter:_,style:C,getLength:w,isEnough:O}}function ms(e,t,n){var o=Fe(e),r=o.on,a=o.bind,i=o.emit,c=t.Slides,s=t.Direction.resolve,d=t.Elements,u=d.root,P=d.track,v=d.list,x=c.getAt,h=c.style,g,T,L;function b(){m(),a(window,"resize load",Ga(Ae(i,nn))),r([Ke,Be],m),r(nn,H)}function m(){g=n.direction===go,at(u,"maxWidth",Ht(n.width)),at(P,s("paddingLeft"),F(!1)),at(P,s("paddingRight"),F(!0)),H(!0)}function H(R){var B=nt(u);(R||T.width!==B.width||T.height!==B.height)&&(at(P,"height",_()),h(s("marginRight"),Ht(n.gap)),h("width",W()),h("height",w(),!0),T=B,i(so),L!==(L=k())&&(bt(u,kr,L),i(qa,L)))}function F(R){var B=n.padding,I=s(R?"right":"left");return B&&Ht(B[I]||(fn(B)?0:B))||"0px"}function _(){var R="";return g&&(R=C(),gn(R,"height or heightRatio is missing."),R="calc("+R+" - "+F(!1)+" - "+F(!0)+")"),R}function C(){return Ht(n.height||nt(v).width*n.heightRatio)}function W(){return n.autoWidth?null:Ht(n.fixedWidth)||(g?"":O())}function w(){return Ht(n.fixedHeight)||(g?n.autoHeight?null:O():C())}function O(){var R=Ht(n.gap);return"calc((100%"+(R&&" + "+R)+")/"+(n.perPage||1)+(R&&" - "+R)+")"}function S(){return nt(v)[s("width")]}function V(R,B){var I=x(R||0);return I?nt(I.slide)[s("width")]+(B?0:q()):0}function D(R,B){var I=x(R);if(I){var A=nt(I.slide)[s("right")],Q=nt(v)[s("left")];return Ue(A-Q)+(B?0:q())}return 0}function Z(R){return D(e.length-1)-D(0)+V(0,R)}function q(){var R=x(0);return R&&parseFloat(at(R.slide,s("marginRight")))||0}function $(R){return parseFloat(at(P,s("padding"+(R?"Right":"Left"))))||0}function k(){return e.is(kn)||Z(!0)>S()}return{mount:b,resize:H,listSize:S,slideSize:V,sliderSize:Z,totalSize:D,getPadding:$,isOverflow:k}}var gs=2;function hs(e,t,n){var o=Fe(e),r=o.on,a=t.Elements,i=t.Slides,c=t.Direction.resolve,s=[],d;function u(){r(Be,P),r([Ke,nn],x),(d=T())&&(h(d),t.Layout.resize(!0))}function P(){v(),u()}function v(){jt(s),wt(s),o.destroy()}function x(){var L=T();d!==L&&(d<L||!L)&&o.emit(Be)}function h(L){var b=i.get().slice(),m=b.length;if(m){for(;b.length<L;)Gn(b,b);Gn(b.slice(-L),b.slice(0,L)).forEach(function(H,F){var _=F<L,C=g(H.slide,F);_?zo(C,b[0].slide):An(a.list,C),Gn(s,C),i.register(C,F-L+(_?0:m),H.index)})}}function g(L,b){var m=L.cloneNode(!0);return gt(m,n.classes.clone),m.id=e.root.id+"-clone"+Uo(b+1),m}function T(){var L=n.clones;if(!e.is(dn))L=0;else if(Pn(L)){var b=n[c("fixedWidth")]&&t.Layout.slideSize(0),m=b&&Cn(nt(a.track)[c("width")]/b);L=m||n[c("autoWidth")]&&e.length||n.perPage*gs}return L}return{mount:u,destroy:v}}function fs(e,t,n){var o=Fe(e),r=o.on,a=o.emit,i=e.state.set,c=t.Layout,s=c.slideSize,d=c.getPadding,u=c.totalSize,P=c.listSize,v=c.sliderSize,x=t.Direction,h=x.resolve,g=x.orient,T=t.Elements,L=T.list,b=T.track,m;function H(){m=t.Transition,r([kt,so,Ke,Be],F)}function F(){t.Controller.isBusy()||(t.Scroll.cancel(),C(e.index),t.Slides.update())}function _(I,A,Q,ie){I!==A&&R(I>Q)&&(S(),W(O(Z(),I>Q),!0)),i(ln),a($t,A,Q,I),m.start(A,function(){i(tn),a(cn,A,Q,I),ie&&ie()})}function C(I){W(D(I,!0))}function W(I,A){if(!e.is(kn)){var Q=A?I:w(I);at(L,"transform","translate"+h("X")+"("+Q+"px)"),I!==Q&&a(Sr)}}function w(I){if(e.is(dn)){var A=V(I),Q=A>t.Controller.getEnd(),ie=A<0;(ie||Q)&&(I=O(I,Q))}return I}function O(I,A){var Q=I-k(A),ie=v();return I-=g(ie*(Cn(Ue(Q)/ie)||1))*(A?1:-1),I}function S(){W(Z(),!0),m.cancel()}function V(I){for(var A=t.Slides.get(),Q=0,ie=1/0,re=0;re<A.length;re++){var U=A[re].index,M=Ue(D(U,!0)-I);if(M<=ie)ie=M,Q=U;else break}return Q}function D(I,A){var Q=g(u(I-1)-$(I));return A?q(Q):Q}function Z(){var I=h("left");return nt(L)[I]-nt(b)[I]+g(d(!1))}function q(I){return n.trimSpace&&e.is(on)&&(I=Yt(I,0,g(v(!0)-P()))),I}function $(I){var A=n.focus;return A==="center"?(P()-s(I,!0))/2:+A*s(I)||0}function k(I){return D(I?t.Controller.getEnd():0,!!n.trimSpace)}function R(I){var A=g(O(Z(),I));return I?A>=0:A<=L[h("scrollWidth")]-nt(b)[h("width")]}function B(I,A){A=Pn(A)?Z():A;var Q=I!==!0&&g(A)<g(k(!1)),ie=I!==!1&&g(A)>g(k(!0));return Q||ie}return{mount:H,move:_,jump:C,translate:W,shift:O,cancel:S,toIndex:V,toPosition:D,getPosition:Z,getLimit:k,exceededLimit:B,reposition:F}}function ys(e,t,n){var o=Fe(e),r=o.on,a=o.emit,i=t.Move,c=i.getPosition,s=i.getLimit,d=i.toPosition,u=t.Slides,P=u.isEnough,v=u.getLength,x=n.omitEnd,h=e.is(dn),g=e.is(on),T=Ae(Z,!1),L=Ae(Z,!0),b=n.start||0,m,H=b,F,_,C;function W(){w(),r([Ke,Be,oo],w),r(so,O)}function w(){F=v(!0),_=n.perMove,C=n.perPage,m=R();var M=Yt(b,0,x?m:F-1);M!==b&&(b=M,i.reposition())}function O(){m!==R()&&a(oo)}function S(M,oe,Ce){if(!U()){var ue=D(M),fe=k(ue);fe>-1&&(oe||fe!==b)&&(Q(fe),i.move(ue,fe,H,Ce))}}function V(M,oe,Ce,ue){t.Scroll.scroll(M,oe,Ce,function(){var fe=k(i.toIndex(c()));Q(x?Rt(fe,m):fe),ue&&ue()})}function D(M){var oe=b;if(At(M)){var Ce=M.match(/([+\-<>])(\d+)?/)||[],ue=Ce[1],fe=Ce[2];ue==="+"||ue==="-"?oe=q(b+ +(""+ue+(+fe||1)),b):ue===">"?oe=fe?B(+fe):T(!0):ue==="<"&&(oe=L(!0))}else oe=h?M:Yt(M,0,m);return oe}function Z(M,oe){var Ce=_||(re()?1:C),ue=q(b+Ce*(M?-1:1),b,!(_||re()));return ue===-1&&g&&!sr(c(),s(!M),1)?M?0:m:oe?ue:k(ue)}function q(M,oe,Ce){if(P()||re()){var ue=$(M);ue!==M&&(oe=M,M=ue,Ce=!1),M<0||M>m?!_&&(Yn(0,M,oe,!0)||Yn(m,oe,M,!0))?M=B(I(M)):h?M=Ce?M<0?-(F%C||C):F:M:n.rewind?M=M<0?m:0:M=-1:Ce&&M!==oe&&(M=B(I(oe)+(M<oe?-1:1)))}else M=-1;return M}function $(M){if(g&&n.trimSpace==="move"&&M!==b)for(var oe=c();oe===d(M,!0)&&Yn(M,0,e.length-1,!n.rewind);)M<b?--M:++M;return M}function k(M){return h?(M+F)%F||0:M}function R(){for(var M=F-(re()||h&&_?1:C);x&&M-- >0;)if(d(F-1,!0)!==d(M,!0)){M++;break}return Yt(M,0,F-1)}function B(M){return Yt(re()?M:C*M,0,m)}function I(M){return re()?Rt(M,m):no((M>=m?F-1:M)/C)}function A(M){var oe=i.toIndex(M);return g?Yt(oe,0,m):oe}function Q(M){M!==b&&(H=b,b=M)}function ie(M){return M?H:b}function re(){return!Pn(n.focus)||n.isNavigation}function U(){return e.state.is([ln,En])&&!!n.waitForTransition}return{mount:W,go:S,scroll:V,getNext:T,getPrev:L,getAdjacent:Z,getEnd:R,setIndex:Q,getIndex:ie,toIndex:B,toPage:I,toDest:A,hasFocus:re,isBusy:U}}var vs="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",On=40;function xs(e,t,n){var o=Fe(e),r=o.on,a=o.bind,i=o.emit,c=n.classes,s=n.i18n,d=t.Elements,u=t.Controller,P=d.arrows,v=d.track,x=P,h=d.prev,g=d.next,T,L,b={};function m(){F(),r(Ke,H)}function H(){_(),m()}function F(){var V=n.arrows;V&&!(h&&g)&&w(),h&&g&&(bn(b,{prev:h,next:g}),xn(x,V?"":"none"),gt(x,L=oi+"--"+n.direction),V&&(C(),S(),he([h,g],In,v.id),i(fr,h,g)))}function _(){o.destroy(),xt(x,L),T?(jt(P?[h,g]:x),h=g=null):ht([h,g],ni)}function C(){r([kt,cn,Be,Kt,oo],S),a(g,"click",Ae(W,">")),a(h,"click",Ae(W,"<"))}function W(V){u.go(V,!0)}function w(){x=P||Qt("div",c.arrows),h=O(!0),g=O(!1),T=!0,An(x,[h,g]),!P&&zo(x,v)}function O(V){var D='<button class="'+c.arrow+" "+(V?c.prev:c.next)+'" type="button"><svg xmlns="'+vs+'" viewBox="0 0 '+On+" "+On+'" width="'+On+'" height="'+On+'" focusable="false"><path d="'+(n.arrowPath||bs)+'" />';return rr(D)}function S(){if(h&&g){var V=e.index,D=u.getPrev(),Z=u.getNext(),q=D>-1&&V<D?s.last:s.prev,$=Z>-1&&V>Z?s.first:s.next;h.disabled=D<0,g.disabled=Z<0,he(h,ot,q),he(g,ot,$),i(yr,h,g,D,Z)}}return{arrows:b,mount:m,destroy:_,update:S}}var Cs=qo+"-interval";function Ss(e,t,n){var o=Fe(e),r=o.on,a=o.bind,i=o.emit,c=co(n.interval,e.go.bind(e,">"),C),s=c.isPaused,d=t.Elements,u=t.Elements,P=u.root,v=u.toggle,x=n.autoplay,h,g,T=x==="pause";function L(){x&&(b(),v&&he(v,In,d.track.id),T||m(),_())}function b(){n.pauseOnHover&&a(P,"mouseenter mouseleave",function(w){h=w.type==="mouseenter",F()}),n.pauseOnFocus&&a(P,"focusin focusout",function(w){g=w.type==="focusin",F()}),v&&a(v,"click",function(){T?m():H(!0)}),r([$t,lo,Be],c.rewind),r($t,W)}function m(){s()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),g=h=T=!1,_(),i(Zo))}function H(w){w===void 0&&(w=!0),T=!!w,_(),s()||(c.pause(),i(Jo))}function F(){T||(h||g?H(!1):m())}function _(){v&&(bt(v,zt,!T),he(v,ot,n.i18n[T?"play":"pause"]))}function C(w){var O=d.bar;O&&at(O,"width",w*100+"%"),i(xr,w)}function W(w){var O=t.Slides.getAt(w);c.set(O&&+st(O.slide,Cs)||n.interval)}return{mount:L,destroy:c.cancel,play:m,pause:H,isPaused:s}}function ws(e,t,n){var o=Fe(e),r=o.on;function a(){n.cover&&(r(Qo,Ae(c,!0)),r([kt,Ke,Be],Ae(i,!0)))}function i(s){t.Slides.forEach(function(d){var u=Rn(d.container||d.slide,"img");u&&u.src&&c(s,u,d)})}function c(s,d,u){u.style("background",s?'center/cover no-repeat url("'+d.src+'")':"",!0),xn(d,s?"none":"")}return{mount:a,destroy:Ae(i,!1)}}var $s=10,Ts=600,Ls=.6,Es=1.5,Ps=800;function _s(e,t,n){var o=Fe(e),r=o.on,a=o.emit,i=e.state.set,c=t.Move,s=c.getPosition,d=c.getLimit,u=c.exceededLimit,P=c.translate,v=e.is(on),x,h,g=1;function T(){r($t,H),r([Ke,Be],F)}function L(C,W,w,O,S){var V=s();if(H(),w&&(!v||!u())){var D=t.Layout.sliderSize(),Z=Io(C)*D*no(Ue(C)/D)||0;C=c.toPosition(t.Controller.toDest(C%D))+Z}var q=sr(V,C,1);g=1,W=q?0:W||to(Ue(C-V)/Es,Ps),h=O,x=co(W,b,Ae(m,V,C,S),1),i(En),a(lo),x.start()}function b(){i(tn),h&&h(),a(Kt)}function m(C,W,w,O){var S=s(),V=C+(W-C)*_(O),D=(V-S)*g;P(S+D),v&&!w&&u()&&(g*=Ls,Ue(D)<$s&&L(d(u(!0)),Ts,!1,h,!0))}function H(){x&&x.cancel()}function F(){x&&!x.isPaused()&&(H(),b())}function _(C){var W=n.easingFunc;return W?W(C):1-Math.pow(1-C,4)}return{mount:T,destroy:H,scroll:L,cancel:F}}var Xt={passive:!1,capture:!0};function As(e,t,n){var o=Fe(e),r=o.on,a=o.emit,i=o.bind,c=o.unbind,s=e.state,d=t.Move,u=t.Scroll,P=t.Controller,v=t.Elements.track,x=t.Media.reduce,h=t.Direction,g=h.resolve,T=h.orient,L=d.getPosition,b=d.exceededLimit,m,H,F,_,C,W=!1,w,O,S;function V(){i(v,So,Ro,Xt),i(v,wo,Ro,Xt),i(v,Fr,Z,Xt),i(v,"click",k,{capture:!0}),i(v,"dragstart",vt),r([kt,Ke],D)}function D(){var y=n.drag;ne(!y),_=y==="free"}function Z(y){if(w=!1,!O){var f=fe(y);ue(y.target)&&(f||!y.button)&&(P.isBusy()?vt(y,!0):(S=f?v:window,C=s.is([ln,En]),F=null,i(S,So,q,Xt),i(S,wo,$,Xt),d.cancel(),u.cancel(),R(y)))}}function q(y){if(s.is(Un)||(s.set(Un),a(mr)),y.cancelable)if(C){d.translate(m+Ce(re(y)));var f=U(y)>Ei,N=W!==(W=b());(f||N)&&R(y),w=!0,a(gr),vt(y)}else A(y)&&(C=I(y),vt(y))}function $(y){s.is(Un)&&(s.set(tn),a(hr)),C&&(B(y),vt(y)),c(S,So,q),c(S,wo,$),C=!1}function k(y){!O&&w&&vt(y,!0)}function R(y){F=H,H=y,m=L()}function B(y){var f=Q(y),N=ie(f),K=n.rewind&&n.rewindByDrag;x(!1),_?P.scroll(N,0,n.snap):e.is(kn)?P.go(T(Io(f))<0?K?"<":"-":K?">":"+"):e.is(on)&&W&&K?P.go(b(!0)?">":"<"):P.go(P.toDest(N),!0),x(!0)}function I(y){var f=n.dragMinThreshold,N=fn(f),K=N&&f.mouse||0,G=(N?f.touch:+f)||10;return Ue(re(y))>(fe(y)?G:K)}function A(y){return Ue(re(y))>Ue(re(y,!0))}function Q(y){if(e.is(dn)||!W){var f=U(y);if(f&&f<Ei)return re(y)/f}return 0}function ie(y){return L()+Io(y)*Rt(Ue(y)*(n.flickPower||600),_?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function re(y,f){return oe(y,f)-oe(M(y),f)}function U(y){return Wo(y)-Wo(M(y))}function M(y){return H===y&&F||H}function oe(y,f){return(fe(y)?y.changedTouches[0]:y)["page"+g(f?"Y":"X")]}function Ce(y){return y/(W&&e.is(on)?cs:1)}function ue(y){var f=n.noDrag;return!yn(y,"."+Ar+", ."+fo)&&(!f||!yn(y,f))}function fe(y){return typeof TouchEvent<"u"&&y instanceof TouchEvent}function Re(){return C}function ne(y){O=y}return{mount:V,disable:ne,isDragging:Re}}var Rs={Spacebar:" ",Right:mo,Left:po,Up:wr,Down:$r};function ii(e){return e=At(e)?e:e.key,Rs[e]||e}var Pi="keydown";function Ws(e,t,n){var o=Fe(e),r=o.on,a=o.bind,i=o.unbind,c=e.root,s=t.Direction.resolve,d,u;function P(){v(),r(Ke,x),r(Ke,v),r($t,g)}function v(){var L=n.keyboard;L&&(d=L==="global"?window:c,a(d,Pi,T))}function x(){i(d,Pi)}function h(L){u=L}function g(){var L=u;u=!0,er(function(){u=L})}function T(L){if(!u){var b=ii(L);b===s(po)?e.go("<"):b===s(mo)&&e.go(">")}}return{mount:P,destroy:x,disable:h}}var hn=qo+"-lazy",Xn=hn+"-srcset",Is="["+hn+"], ["+Xn+"]";function ks(e,t,n){var o=Fe(e),r=o.on,a=o.off,i=o.bind,c=o.emit,s=n.lazyLoad==="sequential",d=[cn,Kt],u=[];function P(){n.lazyLoad&&(v(),r(Be,v))}function v(){wt(u),x(),s?L():(a(d),r(d,h),h())}function x(){t.Slides.forEach(function(b){Ko(b.slide,Is).forEach(function(m){var H=st(m,hn),F=st(m,Xn);if(H!==m.src||F!==m.srcset){var _=n.classes.spinner,C=m.parentElement,W=Rn(C,"."+_)||Qt("span",_,C);u.push([m,b,W]),m.src||xn(m,"none")}})})}function h(){u=u.filter(function(b){var m=n.perPage*((n.preloadPages||1)+1)-1;return b[1].isWithin(e.index,m)?g(b):!0}),u.length||a(d)}function g(b){var m=b[0];gt(b[1].slide,No),i(m,"load error",Ae(T,b)),he(m,"src",st(m,hn)),he(m,"srcset",st(m,Xn)),ht(m,hn),ht(m,Xn)}function T(b,m){var H=b[0],F=b[1];xt(F.slide,No),m.type!=="error"&&(jt(b[2]),xn(H,""),c(Qo,H,F),c(nn)),s&&L()}function L(){u.length&&g(u.shift())}return{mount:P,destroy:Ae(wt,u),check:h}}function Fs(e,t,n){var o=Fe(e),r=o.on,a=o.emit,i=o.bind,c=t.Slides,s=t.Elements,d=t.Controller,u=d.hasFocus,P=d.getIndex,v=d.go,x=t.Direction.resolve,h=s.pagination,g=[],T,L;function b(){m(),r([Ke,Be,oo],b);var O=n.pagination;h&&xn(h,O?"":"none"),O&&(r([$t,lo,Kt],w),H(),w(),a(vr,{list:T,items:g},W(e.index)))}function m(){T&&(jt(h?It(T.children):T),xt(T,L),wt(g),T=null),o.destroy()}function H(){var O=e.length,S=n.classes,V=n.i18n,D=n.perPage,Z=u()?d.getEnd()+1:Cn(O/D);T=h||Qt("ul",S.pagination,s.track.parentElement),gt(T,L=yo+"--"+C()),he(T,Ct,"tablist"),he(T,ot,V.select),he(T,ti,C()===go?"vertical":"");for(var q=0;q<Z;q++){var $=Qt("li",null,T),k=Qt("button",{class:S.page,type:"button"},$),R=c.getIn(q).map(function(I){return I.slide.id}),B=!u()&&D>1?V.pageX:V.slideX;i(k,"click",Ae(F,q)),n.paginationKeyboard&&i(k,"keydown",Ae(_,q)),he($,Ct,"presentation"),he(k,Ct,"tab"),he(k,In,R.join(" ")),he(k,ot,ko(B,q+1)),he(k,en,-1),g.push({li:$,button:k,page:q})}}function F(O){v(">"+O,!0)}function _(O,S){var V=g.length,D=ii(S),Z=C(),q=-1;D===x(mo,!1,Z)?q=++O%V:D===x(po,!1,Z)?q=(--O+V)%V:D==="Home"?q=0:D==="End"&&(q=V-1);var $=g[q];$&&(ir($.button),v(">"+q),vt(S,!0))}function C(){return n.paginationDirection||n.direction}function W(O){return g[d.toPage(O)]}function w(){var O=W(P(!0)),S=W(P());if(O){var V=O.button;xt(V,zt),ht(V,Si),he(V,en,-1)}if(S){var D=S.button;gt(D,zt),he(D,Si,!0),he(D,en,"")}a(br,{list:T,items:g},O,S)}return{items:g,mount:b,destroy:m,getAt:W,update:w}}var Ms=[" ","Enter"];function Ns(e,t,n){var o=n.isNavigation,r=n.slideFocus,a=[];function i(){e.splides.forEach(function(h){h.isParent||(d(e,h.splide),d(h.splide,e))}),o&&u()}function c(){a.forEach(function(h){h.destroy()}),wt(a)}function s(){c(),i()}function d(h,g){var T=Fe(h);T.on($t,function(L,b,m){g.go(g.is(dn)?m:L)}),a.push(T)}function u(){var h=Fe(e),g=h.on;g(Go,v),g(Cr,x),g([kt,Ke],P),a.push(h),h.emit(Xo,e.splides)}function P(){he(t.Elements.list,ti,n.direction===go?"vertical":"")}function v(h){e.go(h.index)}function x(h,g){jo(Ms,ii(g))&&(v(h),vt(g))}return{setup:Ae(t.Media.set,{slideFocus:Pn(r)?o:r},!0),mount:i,destroy:c,remount:s}}function Hs(e,t,n){var o=Fe(e),r=o.bind,a=0;function i(){n.wheel&&r(t.Elements.track,"wheel",c,Xt)}function c(d){if(d.cancelable){var u=d.deltaY,P=u<0,v=Wo(d),x=n.wheelMinThreshold||0,h=n.wheelSleep||0;Ue(u)>x&&v-a>h&&(e.go(P?"<":">"),a=v),s(P)&&vt(d)}}function s(d){return!n.releaseWheel||e.state.is(ln)||t.Controller.getAdjacent(d)!==-1}return{mount:i}}var Bs=90;function Os(e,t,n){var o=Fe(e),r=o.on,a=t.Elements.track,i=n.live&&!n.isNavigation,c=Qt("span",is),s=co(Bs,Ae(u,!1));function d(){i&&(v(!t.Autoplay.isPaused()),he(a,Ti,!0),c.textContent="…",r(Zo,Ae(v,!0)),r(Jo,Ae(v,!1)),r([cn,Kt],Ae(u,!0)))}function u(x){he(a,$i,x),x?(An(a,c),s.start()):(jt(c),s.cancel())}function P(){ht(a,[wi,Ti,$i]),jt(c)}function v(x){i&&he(a,wi,x?"off":"polite")}return{mount:d,disable:v,destroy:P}}var Vs=Object.freeze({__proto__:null,Media:Ya,Direction:Xa,Elements:ds,Slides:ps,Layout:ms,Clones:hs,Move:fs,Controller:ys,Arrows:xs,Autoplay:Ss,Cover:ws,Scroll:_s,Drag:As,Keyboard:Ws,LazyLoad:ks,Pagination:Fs,Sync:Ns,Wheel:Hs,Live:Os}),Ds={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"},js={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:ss,i18n:Ds,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function zs(e,t,n){var o=t.Slides;function r(){Fe(e).on([kt,Be],a)}function a(){o.forEach(function(c){c.style("transform","translateX(-"+100*c.index+"%)")})}function i(c,s){o.style("transition","opacity "+n.speed+"ms "+n.easing),er(s)}return{mount:r,start:i,cancel:Ro}}function Ks(e,t,n){var o=t.Move,r=t.Controller,a=t.Scroll,i=t.Elements.list,c=Ae(at,i,"transition"),s;function d(){Fe(e).bind(i,"transitionend",function(x){x.target===i&&s&&(P(),s())})}function u(x,h){var g=o.toPosition(x,!0),T=o.getPosition(),L=v(x);Ue(g-T)>=1&&L>=1?n.useScroll?a.scroll(g,L,!1,h):(c("transform "+L+"ms "+n.easing),o.translate(g,!0),s=h):(o.jump(x),h())}function P(){c(""),a.cancel()}function v(x){var h=n.rewindSpeed;if(e.is(on)&&h){var g=r.getIndex(!0),T=r.getEnd();if(g===0&&x>=T||g>=T&&x===0)return h}return n.speed}return{mount:d,start:u,cancel:P}}var qs=(function(){function e(n,o){this.event=Fe(),this.Components={},this.state=Ua(Jt),this.splides=[],this._o={},this._E={};var r=At(n)?ar(document,n):n;gn(r,r+" is invalid."),this.root=r,o=Pt({label:st(r,ot)||"",labelledby:st(r,ei)||""},js,e.defaults,o||{});try{Pt(o,JSON.parse(st(r,qo)))}catch{gn(!1,"Invalid JSON")}this._o=Object.create(Pt({},o))}var t=e.prototype;return t.mount=function(o,r){var a=this,i=this.state,c=this.Components;gn(i.is([Jt,eo]),"Already mounted!"),i.set(Jt),this._C=c,this._T=r||this._T||(this.is(kn)?zs:Ks),this._E=o||this._E;var s=bn({},Vs,this._E,{Transition:this._T});return Dt(s,function(d,u){var P=d(a,c,a._o);c[u]=P,P.setup&&P.setup()}),Dt(c,function(d){d.mount&&d.mount()}),this.emit(kt),gt(this.root,rs),i.set(tn),this.emit(Fo),this},t.sync=function(o){return this.splides.push({splide:o}),o.splides.push({splide:this,isParent:!0}),this.state.is(tn)&&(this._C.Sync.remount(),o.Components.Sync.remount()),this},t.go=function(o){return this._C.Controller.go(o),this},t.on=function(o,r){return this.event.on(o,r),this},t.off=function(o){return this.event.off(o),this},t.emit=function(o){var r;return(r=this.event).emit.apply(r,[o].concat(It(arguments,1))),this},t.add=function(o,r){return this._C.Slides.add(o,r),this},t.remove=function(o){return this._C.Slides.remove(o),this},t.is=function(o){return this._o.type===o},t.refresh=function(){return this.emit(Be),this},t.destroy=function(o){o===void 0&&(o=!0);var r=this.event,a=this.state;return a.is(Jt)?Fe(this).on(Fo,this.destroy.bind(this,o)):(Dt(this._C,function(i){i.destroy&&i.destroy(o)},!0),r.emit(Yo),r.destroy(),o&&wt(this.splides),a.set(eo)),this},Da(e,[{key:"options",get:function(){return this._o},set:function(o){this._C.Media.set(o,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),ri=qs;ri.defaults={};ri.STATES=za;var _i=[[kt,"onMounted"],[Fo,"onReady"],[$t,"onMove"],[cn,"onMoved"],[Go,"onClick"],[cr,"onActive"],[dr,"onInactive"],[ur,"onVisible"],[pr,"onHidden"],[Be,"onRefresh"],[Ke,"onUpdated"],[nn,"onResize"],[so,"onResized"],[mr,"onDrag"],[gr,"onDragging"],[hr,"onDragged"],[lo,"onScroll"],[Kt,"onScrolled"],[Yo,"onDestroy"],[fr,"onArrowsMounted"],[yr,"onArrowsUpdated"],[vr,"onPaginationMounted"],[br,"onPaginationUpdated"],[Xo,"onNavigationMounted"],[Zo,"onAutoplayPlay"],[xr,"onAutoplayPlaying"],[Jo,"onAutoplayPause"],[Qo,"onLazyLoadLoaded"]];function ai(...e){return e.filter(Boolean).join(" ")}function io(e){return e!==null&&typeof e=="object"}function Ho(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,o)=>!Ho(n,t[o]));if(io(e)&&io(t)){const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&!n.some(r=>!Object.prototype.hasOwnProperty.call(t,r)||!Ho(e[r],t[r]))}return e===t}function Us(e,t){return e.length===t.length&&!e.some((n,o)=>n!==t[o])}function Gs(e,t){if(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const r=n[o];if(r!=="__proto__"&&t(e[r],r)===!1)break}}return e}function Bo(e,t){const n=e;return Gs(t,(o,r)=>{Array.isArray(o)?n[r]=o.slice():io(o)?n[r]=Bo(io(n[r])?n[r]:{},o):n[r]=o}),n}var Ys=({children:e,className:t,...n})=>p.createElement("div",{className:ai("splide__track",t),...n},p.createElement("ul",{className:"splide__list"},e)),si=class extends p.Component{constructor(){super(...arguments),this.splideRef=p.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:o}=this.splideRef;o&&(this.splide=new ri(o,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Bo({},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&&!Ho(this.options,e)&&(this.splide.options=e,this.options=Bo({},e));const t=this.getSlides();Us(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){_i.forEach(([t,n])=>{const o=this.props[n];typeof o=="function"&&e.on(t,(...r)=>{o(e,...r)})})}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:o,...r}=this.props;return p.createElement(t,{className:ai("splide",e),ref:this.splideRef,...this.omit(r,["options",..._i.map(a=>a[1])])},n?p.createElement(Ys,null,o):o)}},li=({children:e,className:t,...n})=>p.createElement("li",{className:ai("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 Ms="RichTextRenderer-module__link___BWeZ2",Ns={link:Ms},Os=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(o=>/^\d/.test(o))},so=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Os(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function yt(e){const{color:t,...n}=e;return n}function qe(e,t){var n,o,i;return{fontFamily:so(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:T.scalingValue(e.letterSpacing,t),wordSpacing:T.scalingValue(e.wordSpacing,t),fontSize:T.scalingValue(e.fontSize,t),lineHeight:e.lineHeight!==void 0?T.scalingValue(e.lineHeight,t):void 0,textTransform:(n=e.textAppearance)==null?void 0:n.textTransform,textDecoration:(o=e.textAppearance)==null?void 0:o.textDecoration,fontVariant:(i=e.textAppearance)==null?void 0:i.fontVariant,color:e.color}}const vn=({content:e})=>{const t=n=>n.map((o,i)=>o.type==="link"?a.jsx("a",{className:Ns.link,href:o.value,target:o.target,children:t(o.children)},i):a.jsx("span",{style:Hs(o),children:o.text},i));return a.jsx(a.Fragment,{children:e.map((n,o)=>{const i=n.children;return a.jsx("div",{children:t(i)},o)})})};function Hs(e){return{...e.fontFamily&&{fontFamily:so(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 Bs="SvgImage-module__svg___q3xE-",Vs="SvgImage-module__img___VsTm-",Si={svg:Bs,img:Vs},Ds=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},zs=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,$t=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:o="",style:i})=>{const[l,r]=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 s=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');r(s)}},[]),!Ds(e)||!l?a.jsx("img",{src:e,alt:"",className:ve(Si.img,o),style:i}):a.jsx("span",{"data-supports-mask":l,className:ve(Si.svg,o),style:{"--svg":zs(e),"--fill":t,"--hover-fill":n,...i??{}}})},js={"top-left":ae.topLeftAlignment,"top-center":ae.topCenterAlignment,"top-right":ae.topRightAlignment,"middle-left":ae.middleLeftAlignment,"middle-center":ae.middleCenterAlignment,"middle-right":ae.middleRightAlignment,"bottom-left":ae.bottomLeftAlignment,"bottom-center":ae.bottomCenterAlignment,"bottom-right":ae.bottomRightAlignment};function Ks({settings:e,content:t,styles:n,isEditor:o}){const[i,l]=u.useState(null),{widthSettings:r,fontSettings:s,letterSpacing:c,textAlign:p,wordSpacing:d,fontSizeLineHeight:$,textAppearance:h,color:f}=n.imageCaption,[m,g]=u.useState(void 0),[C,y]=u.useState(null),[x,P]=u.useState(0),[L,_]=u.useState(0),{direction:E,transition:v,controls:w,pagination:R,imageCaption:V,triggers:A}=e,H=u.useRef(v.type),{x:D,y:j}=e.controls.offset,U=S=>{i&&i.go(S)};return u.useEffect(()=>{if(!C)return;const S=new ResizeObserver(N=>{if(!i)return;const[k]=N;g({width:Math.round(k.contentRect.width),height:Math.round(k.contentRect.height)})});return S.observe(C),()=>S.unobserve(C)},[C]),u.useEffect(()=>{!i||H.current===v.type||(_(S=>S+1),H.current=v.type)},[v.type]),a.jsx("div",{className:ve(ae.wrapper,{[ae.editor]:o}),ref:y,children:a.jsxs("div",{className:ae.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:v.backgroundColor&&v.type==="fade in"?v.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:ve(ae.captionBlock),children:a.jsx("div",{className:ae.captionTextWrapper,children:t.map((S,N)=>a.jsx("div",{className:ve(ae.captionText,js[V.alignment],{[ae.withPointerEvents]:N===x&&o,[ae.active]:N===x}),style:{fontFamily:so(s.fontFamily),fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:r.sizing==="auto"?"max-content":T.scalingValue(r.width,o),letterSpacing:T.scalingValue(c,o),wordSpacing:T.scalingValue(d,o),textAlign:p,fontSize:T.scalingValue($.fontSize,o),lineHeight:T.scalingValue($.lineHeight,o),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f,transitionDuration:v.duration?`${Math.round(parseInt(v.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ae.captionTextInner,style:{"--link-hover-color":V.linkHoverColor,"--link-color":V.linkColor,position:"relative",top:T.scalingValue(V.offset.y,o),left:T.scalingValue(V.offset.x,o)},children:a.jsx(vn,{content:S.imageCaption})})},N))})}),a.jsx(Jo,{onMove:S=>{P(S.index)},ref:l,options:{arrows:!1,speed:v.duration?parseInt(v.duration):500,autoplay:A.autoPlay!==null,...A.autoPlay!==null&&{interval:parseInt(A.autoPlay)*1e3},direction:E==="horiz"||v.type==="fade in"?"ltr":"ttb",pagination:!1,drag:A.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:v.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((S,N)=>a.jsx(Qo,{children:a.jsx("div",{className:ae.sliderItem,children:a.jsx("div",{className:ae.imgWrapper,children:a.jsx("img",{className:ve(ae.sliderImage,{[ae.contain]:S.image.objectFit==="contain",[ae.cover]:S.image.objectFit==="cover"}),src:S.image.url,alt:S.image.name??""})})})},N))},L),w.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ve(ae.arrow,{[ae.arrowVertical]:E==="vert",[ae.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{onClick:()=>{U("-1")},className:ae.arrowInner,style:{transform:`translate(${T.scalingValue(D,o)}, ${T.scalingValue(j*(E==="horiz"?1:-1),o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx($t,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:ve(ae.arrowImg,ae.mirror)}),!w.arrowsImgUrl&&a.jsx(wi,{color:w.color,className:ve(ae.arrowIcon,ae.arrowImg,ae.mirror)})]})}),a.jsx("div",{className:ve(ae.arrow,ae.nextArrow,{[ae.arrowVertical]:E==="vert",[ae.hoverArrow]:w.show==="on hover"}),style:{color:w.color,"--arrow-hover-color":w.hover},children:a.jsxs("button",{className:ae.arrowInner,onClick:()=>U("+1"),style:{transform:`translate(${T.scalingValue(D*(E==="horiz"?-1:1),o)}, ${T.scalingValue(j,o)}) scale(${e.controls.scale/100}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:[w.arrowsImgUrl&&a.jsx($t,{url:w.arrowsImgUrl,fill:w.color,hoverFill:w.hover,className:ae.arrowImg}),!w.arrowsImgUrl&&a.jsx(wi,{color:w.color,className:ve(ae.arrowIcon,ae.arrowImg)})]})})]}),A.triggersList.click&&a.jsx("div",{className:ae.clickOverlay,onClick:()=>{i&&i.go("+1")}}),R.isActive&&a.jsx("div",{className:ve(ae.pagination,{[ae.paginationInsideBottom]:R.position==="inside-1"&&E==="horiz",[ae.paginationInsideTop]:R.position==="inside-2"&&E==="horiz",[ae.paginationOutsideBottom]:R.position==="outside-1"&&E==="horiz",[ae.paginationOutsideTop]:R.position==="outside-2"&&E==="horiz",[ae.paginationInsideLeft]:R.position==="inside-1"&&E==="vert",[ae.paginationInsideRight]:R.position==="inside-2"&&E==="vert",[ae.paginationOutsideLeft]:R.position==="outside-1"&&E==="vert",[ae.paginationOutsideRight]:R.position==="outside-2"&&E==="vert",[ae.paginationVertical]:E==="vert"}),children:a.jsx("div",{className:ae.paginationInner,style:{backgroundColor:R.colors[2],transform:`scale(${R.scale/100}) translate(${T.scalingValue(R.offset.x,o)}, ${T.scalingValue(R.offset.y,o)}) rotate(${E==="horiz"?"0deg":"90deg"})`},children:t.map((S,N)=>a.jsx("button",{onClick:()=>{i&&i.go(N)},className:ve(ae.paginationItem),children:a.jsx("div",{className:ve(ae.dot,{[ae.activeDot]:N===x}),style:{backgroundColor:N===x?R.colors[0]:R.colors[1],"--pagination-hover-color":R.hover}})},N))})})]})})}function wi({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Us={element:Ks,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"]}},qs="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Gs="ImageRevealSlider-module__image___Qjt-e",Ys="ImageRevealSlider-module__link___N-iLG",Xs="ImageRevealSlider-module__cursor___2U03d",zt={imageRevealSlider:qs,image:Gs,link:Ys,cursor:Xs};function $i(e,t,n){for(const o of n){const i=new Image;i.src=o.url;const l=o.width?Number.parseFloat(o.width):i.naturalWidth,r=i.naturalHeight/i.naturalWidth*l,s=l/2,c=r/2;if(e>=o.x-s&&e<=o.x+s&&t>=o.y-c&&t<=o.y+c)return!0}return!1}function fo(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Zs(e,t,n,o){let i,l;if(t==="custom"){i=n;const r=await fo(e);l=r.height/r.width*i}else if(t==="random"){i=Math.random()*(o.max-o.min)+o.min;const r=await fo(e);l=r.height/r.width*i}else{const r=await fo(e);i=r.width,l=r.height}return{width:i,height:l,finalWidth:`${i}px`}}function Js({settings:e,content:t,isEditor:n}){const[o,i]=u.useState(null),[l,r]=u.useState([]),[s,c]=u.useState(0),p=u.useRef(0),[d,$]=u.useState({x:0,y:0}),[h,f]=u.useState(1),[m,g]=u.useState("none"),C=u.useRef({x:0,y:0}),[y,x]=u.useState(!1),{sizeType:P,imageWidth:L,randomRangeImageWidth:_}=e.imageSize,{revealPosition:E,visible:v}=e.position,{cursorType:w,target:R,defaultCursorScale:V,defaultCursor:A,hoverCursorScale:H,hoverCursor:D}=e.cursor;u.useEffect(()=>{if(!o)return;const S=(M,W)=>{const B=o.getBoundingClientRect(),ee=M-B.left,de=W-B.top;if($({x:ee,y:de}),w==="system"){g("none"),f(1);return}const re=ee,me=de,O=document.elementFromPoint(B.left+re,B.top+me);if(O&&O.closest("a")){g("none"),f(1);return}const te=$i(re,me,l)||R==="area"?{img:D??"none",scale:H}:{img:A??"none",scale:V};g(te.img),f(te.scale)},N=M=>{M.stopPropagation(),C.current={x:M.clientX,y:M.clientY},S(M.clientX,M.clientY)},k=()=>{y&&S(C.current.x,C.current.y)};return o.addEventListener("mousemove",N),window.addEventListener("scroll",k,!0),()=>{o.removeEventListener("mousemove",N),window.removeEventListener("scroll",k,!0)}},[o,y,d,w,R,D,A,H,V,l]),u.useEffect(()=>{y||(g("none"),f(0))},[y]);const j=async(S,N,k,M={})=>{const{width:W,height:B,finalWidth:ee}=await Zs(S.image.url,P,L,_);let de=0,re=0;E==="same"?(de=N/2,re=k/2):(de=M.x??Math.random()*N,re=M.y??Math.random()*k);const me=Math.min(Math.max(de,W/2),N-W/2),O=Math.min(Math.max(re,B/2),k-B/2);return{id:p.current++,url:S.image.url,link:S.link,name:S.image.name,x:me,y:O,width:ee}};u.useEffect(()=>{if(!o||t.length===0)return;const S=o.getBoundingClientRect(),N=S.width,k=S.height,M=[];(async()=>{const B=t[0],ee=await j(B,N,k);M.push(ee),r(M),c(1)})()},[P,L,_,E,o]),u.useEffect(()=>{v==="last One"&&r(S=>S.length>0?[S[S.length-1]]:[])},[v]);const U=async S=>{if(!o)return;const N=o.getBoundingClientRect(),k=S.clientX-N.left,M=S.clientY-N.top;if(R==="image"&&!$i(k,M,l))return;let W=0,B=0;E==="on Click"?(W=k,B=M):E==="same"?(W=N.width/2,B=N.height/2):(W=Math.random()*N.width,B=Math.random()*N.height);const ee=t[s],de=await j(ee,N.width,N.height,{x:W,y:B});r(re=>v==="all"?[...re,de]:[de]),c(re=>re>=t.length-1?0:re+1)};return a.jsxs("div",{ref:i,onClick:U,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),className:zt.imageRevealSlider,style:{cursor:m==="none"?"default":"none"},children:[l.map(S=>a.jsx("div",{className:zt.wrapper,style:{top:`${S.y}px`,left:`${S.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:S.width??"auto",height:"auto",cursor:m==="none"?"default":"none"},children:R==="area"&&S.link?a.jsx("a",{href:S.link,target:"_blank",className:zt.link,children:a.jsx("img",{src:S.url,alt:S.name,className:zt.image},S.id)}):a.jsx("img",{src:S.url,alt:S.name,className:zt.image},S.id)},S.id)),y&&a.jsx("div",{className:zt.cursor,style:{left:`${d.x}px`,top:`${d.y}px`,transform:`translate(-50%, -50%) scale(${h})`,backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Qs={element:Js,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:""}]}}}},el="LightBox-module__hidden___9s-9x",tl="LightBox-module__heroImage___sTxNF",nl="LightBox-module__background___rm9ml",ol="LightBox-module__editor___4ACaY",il="LightBox-module__contentStyle___Bgnsq",rl="LightBox-module__imageStyle___tLIlB",al="LightBox-module__imgWrapper___LuFUp",sl="LightBox-module__contain___8-yaS",ll="LightBox-module__cover___hNvOG",cl="LightBox-module__caption___b6L2I",dl="LightBox-module__captionTextInner___rCGNH",ul="LightBox-module__lightboxSplide___XFuWC",pl="LightBox-module__arrow___iz38X",ml="LightBox-module__arrowVertical___Zfz81",gl="LightBox-module__nextArrow___zkAQN",hl="LightBox-module__arrowInner___p48sW",fl="LightBox-module__arrowIcon___3VaFf",yl="LightBox-module__arrowImg___pNV88",vl="LightBox-module__mirror___pjeXc",bl="LightBox-module__thumbsWrapper___GB-nU",xl="LightBox-module__thumbsContainerVertical___wttk5",Cl="LightBox-module__thumbsContainer___osSma",Sl="LightBox-module__thumbsAlignStart___MO6tY",wl="LightBox-module__thumbsAlignCenter___Q4sUx",$l="LightBox-module__thumbsAlignEnd___p4y9R",Tl="LightBox-module__thumbItem___HvnF3",Ll="LightBox-module__closeButton___g2khP",El="LightBox-module__fadeIn___0m5GW",_l="LightBox-module__slideInLeft___gPYwC",Pl="LightBox-module__slideInRight___S-pPp",Al="LightBox-module__slideInTop___DFdAj",Wl="LightBox-module__slideInBottom___m27kZ",Fl="LightBox-module__fadeOut___55qBR",Il="LightBox-module__slideOutLeft___NvU7P",Rl="LightBox-module__slideOutRight___SK7eC",kl="LightBox-module__slideOutTop___Vgg0z",Ml="LightBox-module__slideOutBottom___nJ0Ef",Nl="LightBox-module__scaleSlide___vZriG",G={hidden:el,heroImage:tl,background:nl,editor:ol,contentStyle:il,imageStyle:rl,imgWrapper:al,contain:sl,cover:ll,caption:cl,captionTextInner:dl,lightboxSplide:ul,arrow:pl,arrowVertical:ml,nextArrow:gl,arrowInner:hl,arrowIcon:fl,arrowImg:yl,mirror:vl,thumbsWrapper:bl,thumbsContainerVertical:xl,thumbsContainer:Cl,thumbsAlignStart:Sl,thumbsAlignCenter:wl,thumbsAlignEnd:$l,thumbItem:Tl,closeButton:Ll,fadeIn:El,slideInLeft:_l,slideInRight:Pl,slideInTop:Al,slideInBottom:Wl,fadeOut:Fl,slideOutLeft:Il,slideOutRight:Rl,slideOutTop:kl,slideOutBottom:Ml,scaleSlide:Nl},Fn=(e,t,n)=>{const o={},[i,l]=e.split("-");return i==="top"?(o.top="0",o.bottom="auto"):i==="middle"?(o.top="50%",o.bottom="auto"):i==="bottom"&&(o.top="auto",o.bottom="0"),l==="left"?(o.left="0",o.right="auto"):l==="center"?(o.left="50%",o.right="auto"):l==="right"&&(o.left="auto",o.right="0"),i==="middle"&&l==="center"?o.transform=`translate(calc(-50% + ${T.scalingValue(t.x,n)}), calc(-50% + ${T.scalingValue(t.y,n)}))`:i==="middle"?o.transform=`translate(${T.scalingValue(t.x,n)}, calc(-50% + ${T.scalingValue(t.y,n)}))`:l==="center"?o.transform=`translate(calc(-50% + ${T.scalingValue(t.x,n)}), ${T.scalingValue(t.y,n)})`:o.transform=`translate(${T.scalingValue(t.x,n)}, ${T.scalingValue(t.y,n)})`,o};function wr(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 Ti(e){const t=e.getBoundingClientRect(),n=wr(e),o=Math.max(0,t.width-n.left-n.right),i=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,r=e.naturalHeight,s=o/i,c=l/r;let p,d;c>s?(p=o,d=o/c):(d=i,p=i*c);const $=t.left+n.left,h=t.top+n.top,f=(o-p)/2+$,m=(i-d)/2+h;return{x:f,y:m,width:p,height:d}}function Li(e){const t=e.getBoundingClientRect(),n=wr(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Ei(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const o=t[1].split(",").map(i=>parseFloat(i.trim()));return o.length===4?o[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const o=n[1].substring(6,8);return parseInt(o,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Ol(e,t){const n=(()=>{if(e==="fade in")return G.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return G.slideInLeft;case"right":return G.slideInRight;case"top":return G.slideInTop;case"bottom":return G.slideInBottom;default:return G.slideInRight}return G.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return G.fadeIn;if(e==="slide in")switch(t){case"left":return G.slideInLeft;case"right":return G.slideInRight;case"top":return G.slideInTop;case"bottom":return G.slideInBottom;default:return G.slideInRight}return G.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return G.fadeOut;if(e==="slide in")switch(t){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})(),l=(()=>{if(e==="fade in")return G.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return G.slideOutLeft;case"right":return G.slideOutRight;case"top":return G.slideOutTop;case"bottom":return G.slideOutBottom;default:return G.slideOutRight}return G.fadeOut})();return{appearClass:n,backdropAppearClass:o,backdropDisappearClass:i,disappearClass:l}}const Hl=({settings:e,content:t,styles:n,portalId:o,activeEvent:i,isEditor:l})=>{const[r,s]=u.useState(!1),{url:c}=e.thumbnailBlock.cover;return u.useEffect(()=>{i==="close"&&s(!1),i==="open"&&s(!0)},[i]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:c,alt:"Cover",className:G.heroImage,onClick:()=>s(!0)}),a.jsx(Bl,{isOpen:r,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:o,isEditor:l})]})},Bl=({isOpen:e,onClose:t,content:n,lightboxStyles:o,settings:i,portalId:l,isEditor:r,metadata:s})=>{var F;const[c,p]=u.useState(0),[d,$]=u.useState(0),[h,f]=u.useState(!1),[m,g]=u.useState(!1),[C,y]=u.useState({}),x=u.useRef(null),P=u.useRef(null),L=u.useRef(null),_=u.useRef(!1),E=u.useRef(null),v=u.useRef(null),w=u.useRef(null),R=u.useRef(null),V=u.useRef(!1),A=u.useRef(null),[H,D]=u.useState(!1),{appear:j,triggers:U,slider:S,thumbnail:N,controls:k,area:M,caption:W,layout:B}=i.lightboxBlock,{appearClass:ee,backdropAppearClass:de,backdropDisappearClass:re,disappearClass:me}=Ol(j.type,j.direction),O=(s==null?void 0:s.itemId)??null;u.useEffect(()=>{const b=()=>{setTimeout(()=>{var q,Z;(Z=(q=x.current)==null?void 0:q.splide)==null||Z.refresh()},16)},z=()=>{$(q=>q+1)};return window.addEventListener("ArticleEditor.Layout:change",b),window.addEventListener("ArticleEditor.ComponentContent:change",z),()=>{window.removeEventListener("ArticleEditor.Layout:change",b),window.removeEventListener("ArticleEditor.ComponentContent:change",z)}},[]),u.useEffect(()=>{if(!e||!N.isActive){D(!1);return}const b=A.current;if(!b)return;const z=()=>{S.direction==="horiz"?D(b.scrollWidth>b.clientWidth):D(b.scrollHeight>b.clientHeight)};z();const q=new ResizeObserver(z);return q.observe(b),()=>q.disconnect()},[e,N.isActive,n.length,C,S.direction]);const te=u.useCallback(()=>{const b=window.matchMedia("(max-width: 768px)").matches,z=Ei(M.color);b&&!r&&z>.9&&(document.body.style.backgroundColor=""),f(!0),_.current=!0;const q=Z=>{Z.target===E.current&&Z.animationName&&(E.current&&v.current&&E.current.removeEventListener("animationend",v.current),v.current=null,_.current&&(_.current=!1,t()),f(!1))};E.current&&(v.current=q,E.current.addEventListener("animationend",q))},[t,M.color,r]),Y=(b,z,q)=>{var Z,se;if(b){if(U.type==="click"&&U.switch==="image")U.repeat==="close"&&c===n.length-1?te():(Z=x.current)==null||Z.go("+1");else if(U.type==="click"&&U.switch==="50/50"){const le=b.getBoundingClientRect(),ce=z-le.left,ge=q-le.top,K=le.width,J=le.height;let Q;S.direction==="horiz"?Q=ce<K/2?"-1":"+1":Q=ge<J/2?"-1":"+1",(se=x.current)==null||se.go(Q)}}},X=b=>{if(V.current){V.current=!1;return}const z=n[c],q=(z==null?void 0:z.image.objectFit)==="cover";let Z,se;if("changedTouches"in b&&b.changedTouches.length>0)Z=b.changedTouches[0].clientX,se=b.changedTouches[0].clientY;else if("clientX"in b)Z=b.clientX,se=b.clientY;else return;let le;if(q&&L.current){const ce=Li(L.current);le=Z>=ce.left&&Z<=ce.right&&se>=ce.top&&se<=ce.bottom}else{const ce=L.current?Ti(L.current):null;if(!ce){b.target===b.currentTarget&&te();return}le=Z>=ce.x&&Z<=ce.x+ce.width&&se>=ce.y&&se<=ce.y+ce.height}le?Y(L.current,Z,se):te()},ne=b=>{const z=b.target;(z.classList.contains(G.thumbsWrapper)||z.classList.contains(G.thumbsContainer))&&X(b)};u.useEffect(()=>{if(!e)return;const b=z=>{var q,Z;if(z.key==="Escape"){te();return}if(z.key==="ArrowRight"){p(se=>(se+1)%Math.max(n.length,1)),(q=x.current)==null||q.go("+1");return}z.key==="ArrowLeft"&&(p(se=>(se-1+Math.max(n.length,1))%Math.max(n.length,1)),(Z=x.current)==null||Z.go("-1"))};return window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b)}},[e,te,n.length]),u.useEffect(()=>{if(e){if(p(0),$(z=>z+1),_.current=!1,f(!1),g(!1),y({}),!O)return;const b=new CustomEvent("page-overlay",{detail:{itemId:O}});window.dispatchEvent(b)}return()=>{E.current&&v.current&&(E.current.removeEventListener("animationend",v.current),v.current=null),g(!1)}},[e,O]),u.useEffect(()=>{P.current!==null&&P.current!==S.type&&$(b=>b+1),P.current=S.type},[S.type]),u.useEffect(()=>{if(!e)return;const b=document.body.style.overflow,z=window.matchMedia("(max-width: 768px)").matches,q=Ei(M.color);document.body.style.overflow="hidden",g(!1);const Z=le=>{le.target===E.current&&!_.current&&le.animationName&&(z&&!r&&q>.9&&(document.body.style.backgroundColor=M.color),g(!0),E.current&&w.current&&E.current.removeEventListener("animationend",w.current),w.current=null)};E.current&&(w.current=Z,E.current.addEventListener("animationend",Z));const se=le=>{const ce=le.target;ce&&(ce.closest(`.${G.thumbsWrapper}`)||ce.closest(`.${G.thumbsContainer}`))||S.type!=="slide"&&le.preventDefault()};return document.addEventListener("touchmove",se,{passive:!1}),()=>{document.body.style.overflow=b,document.removeEventListener("touchmove",se),E.current&&w.current&&(E.current.removeEventListener("animationend",w.current),w.current=null),g(!1)}},[e,r,M.color,S.type]),u.useEffect(()=>{if(!e)return;const b=z=>{var Z,se;if(_.current){z.stopPropagation();return}if(V.current){V.current=!1;return}const q=z.target;if(!(q&&(q.closest(`.${G.thumbsContainer}`)||q.closest(`.${G.thumbItem}`)||q.closest(`.${G.arrow}`)||q.closest(`.${G.closeButton}`)||q.closest(`.${G.caption}`)))){if(S.type==="slide"&&U.type==="drag"&&((se=(Z=x.current)==null?void 0:Z.splide)!=null&&se.root)){const le=x.current.splide.root;if(q&&(le.contains(q)||le===q))return}if(z.touches.length===0&&z.changedTouches.length>0){const le=n[c],ce=(le==null?void 0:le.image.objectFit)==="cover",ge=z.changedTouches[0];let K;if(ce&&L.current){const J=Li(L.current);K=ge.clientX>=J.left&&ge.clientX<=J.right&&ge.clientY>=J.top&&ge.clientY<=J.bottom}else{const J=L.current?Ti(L.current):null;if(!J)return;K=ge.clientX>=J.x&&ge.clientX<=J.x+J.width&&ge.clientY>=J.y&&ge.clientY<=J.y+J.height}if(!K){z.stopPropagation(),_.current=!0;const J=Q=>{Q.stopPropagation(),Q.preventDefault(),document.removeEventListener("click",J,!0)};document.addEventListener("click",J,!0),te()}}}};return document.addEventListener("touchend",b,{passive:!0}),()=>{document.removeEventListener("touchend",b)}},[e,te,c,n]);const I=(S.type==="scale"||S.type==="fade")&&S.direction==="vert"&&U.type==="drag";u.useEffect(()=>{var Q,pe;if(!e||!I||!((pe=(Q=x.current)==null?void 0:Q.splide)!=null&&pe.root))return;const b=x.current.splide.root,z=30,q=(ie,ue)=>{if(R.current){const Ce=Math.abs(ie-R.current.x),$e=Math.abs(ue-R.current.y);(Ce>0||$e>0)&&(V.current=!0)}},Z=ie=>{R.current&&(ie.preventDefault(),q(ie.clientX,ie.clientY))},se=ie=>{R.current&&ie.touches.length>0&&(ie.preventDefault(),q(ie.touches[0].clientX,ie.touches[0].clientY))},le=(ie,ue)=>{if(!R.current||!x.current){R.current=null;return}const Ce=Math.abs(ie-R.current.x),$e=Math.abs(ue-R.current.y);$e>z&&$e>Ce&&x.current.go(ue<R.current.y?"+1":"-1"),R.current=null},ce=ie=>{R.current&&le(ie.clientX,ie.clientY),document.removeEventListener("pointerup",ce),document.removeEventListener("pointercancel",ce),document.removeEventListener("pointermove",Z)},ge=ie=>{if(R.current){if(ie.changedTouches.length>0){const ue=ie.changedTouches[0];le(ue.clientX,ue.clientY)}document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),document.removeEventListener("touchmove",se)}},K=ie=>{R.current={x:ie.clientX,y:ie.clientY},V.current=!1,document.addEventListener("pointermove",Z,{passive:!1}),document.addEventListener("pointerup",ce),document.addEventListener("pointercancel",ce)},J=ie=>{ie.touches.length>0&&(R.current={x:ie.touches[0].clientX,y:ie.touches[0].clientY},V.current=!1,document.addEventListener("touchmove",se,{passive:!1}),document.addEventListener("touchend",ge),document.addEventListener("touchcancel",ge))};return b.addEventListener("pointerdown",K),b.addEventListener("touchstart",J),()=>{b.removeEventListener("pointerdown",K),b.removeEventListener("touchstart",J),document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",ce),document.removeEventListener("pointercancel",ce),document.removeEventListener("touchmove",se),document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),R.current=null,V.current=!1}},[e,I,d]);const oe={backgroundColor:M.color,backdropFilter:`blur(${M.blur}px)`,animationDuration:`${parseInt(j.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:Bi.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:r?null:E,className:ve(G.background,h?re:de,{[G.editor]:r},{[G.hidden]:!e}),style:{...oe,...m&&!r&&!h?{position:"absolute"}:{}}}),a.jsxs("div",{ref:r?E:null,className:ve(G.contentStyle,h?me:ee,{[G.editor]:r},{[G.hidden]:!e}),style:{animationDuration:`${parseInt(j.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Jo,{onMove:b=>p(b.index),ref:x,className:G.lightboxSplide,options:{arrows:!1,speed:S.duration?parseInt(S.duration):500,direction:S.direction==="horiz"||S.type==="fade"||S.type==="scale"?"ltr":"ttb",pagination:!1,drag:U.type==="drag"&&!I,perPage:1,width:"100%",height:"100%",type:S.type==="fade"||S.type==="scale"?"fade":"loop",padding:0,rewind:U.repeat!=="close",start:0},style:{"--splide-speed":S.duration},children:n.map((b,z)=>{const q=Fn(B.position,B.offset,r),Z=`${T.scalingValue(B.padding.top,r)} ${T.scalingValue(B.padding.right,r)} ${T.scalingValue(B.padding.bottom,r)} ${T.scalingValue(B.padding.left,r)}`,se=S.type==="scale"?(()=>{const{transform:le,...ce}=q;return{...ce,position:"absolute",padding:Z,boxSizing:"border-box","--position-transform":le||"none"}})():{...q,position:"absolute",padding:Z,boxSizing:"border-box"};return a.jsx(Qo,{children:a.jsx("div",{className:G.imgWrapper,onClick:X,children:a.jsx("img",{ref:z===c?L:null,className:ve(G.imageStyle,{[G.contain]:b.image.objectFit==="contain",[G.cover]:b.image.objectFit==="cover",[G.scaleSlide]:S.type==="scale"}),src:b.image.url,alt:b.image.name??"",style:{...se,pointerEvents:b.image.objectFit==="contain"?"none":"auto"}})})},z)})},d),k.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ve(G.arrow,{[G.arrowVertical]:S.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${T.scalingValue(k.offset.x,r)}, ${T.scalingValue(k.offset.y*(S.direction==="horiz"?1:-1),r)}) scale(${k.scale}) rotate(${S.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var b;return(b=x.current)==null?void 0:b.go("-1")},"aria-label":"Previous",children:[k.arrowsImgUrl&&a.jsx($t,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:ve(G.arrowImg,G.mirror)}),!k.arrowsImgUrl&&a.jsx(_i,{color:k.color,className:ve(G.arrowIcon,G.arrowImg,G.mirror)})]})}),a.jsx("div",{className:ve(G.arrow,G.nextArrow,{[G.arrowVertical]:S.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:a.jsxs("button",{className:G.arrowInner,style:{transform:`translate(${T.scalingValue(k.offset.x*(S.direction==="horiz"?-1:1),r)}, ${T.scalingValue(k.offset.y,r)}) scale(${k.scale}) rotate(${S.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var b;return(b=x.current)==null?void 0:b.go("+1")},"aria-label":"Next",children:[k.arrowsImgUrl&&a.jsx($t,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:G.arrowImg}),!k.arrowsImgUrl&&a.jsx(_i,{color:k.color,className:ve(G.arrowIcon,G.arrowImg)})]})})]}),M.closeIconUrl&&(()=>{const b=Fn(M.closeIconAlign,M.closeIconOffset,r),z=`scale(${M.closeIconScale})`,q=b.transform?`${b.transform} ${z}`:z;return a.jsx("button",{className:G.closeButton,style:{...b,transform:q},onClick:te,"aria-label":"Close lightbox",children:a.jsx($t,{url:M.closeIconUrl,fill:M.closeIconColor??"#000000",hoverFill:M.closeIconHover??"#cccccc"})})})(),W&&W.isActive&&o.imageCaption&&((F=n[c])==null?void 0:F.imageCaption)&&(()=>{const{widthSettings:b,fontSettings:z,letterSpacing:q,textAlign:Z,wordSpacing:se,fontSizeLineHeight:le,textAppearance:ce,color:ge}=o.imageCaption;return a.jsx("div",{className:G.caption,style:{...Fn(W.alignment,W.offset,r),fontFamily:so(z.fontFamily),fontWeight:z.fontWeight,fontStyle:z.fontStyle,width:b.sizing==="auto"?"max-content":T.scalingValue(b.width,r),letterSpacing:T.scalingValue(q,r),wordSpacing:T.scalingValue(se,r),textAlign:Z,fontSize:T.scalingValue(le.fontSize,r),lineHeight:T.scalingValue(le.lineHeight,r),textTransform:ce.textTransform??"none",textDecoration:ce.textDecoration??"none",fontVariant:ce.fontVariant??"normal",color:ge},onClick:K=>K.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:G.captionTextInner,style:{"--link-color":W.linkColor,"--link-hover-color":W.linkHoverColor},children:a.jsx(vn,{content:n[c].imageCaption})})})})(),N.isActive&&(()=>{const[b,z]=N.position.split("-"),q=S.direction==="horiz"?`${b}-left`:N.position,Z=Fn(q,N.offset,r),se=()=>{if(S.direction==="horiz"){if(z==="left")return"flex-start";if(z==="center")return"center";if(z==="right")return"flex-end"}else{if(b==="top")return"flex-start";if(b==="middle")return"center";if(b==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:A,className:G.thumbsWrapper,onClick:le=>ne(le),style:{position:r?"absolute":"fixed",...Z,...S.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:ve(G.thumbsContainer,{[G.thumbsContainerVertical]:S.direction==="vert",[G.thumbsAlignStart]:N.align==="start",[G.thumbsAlignCenter]:N.align==="center",[G.thumbsAlignEnd]:N.align==="end"}),style:{gap:T.scalingValue(N.grid.gap,r),justifyContent:H?"flex-start":se()},children:n.map((le,ce)=>{const ge=ce===c,K=C[ce],Q=N.grid.size*(ge?N.activeState.scale:1),pe=()=>{if(N.fit!=="fit")return{};if(!K)return S.direction==="horiz"?{height:T.scalingValue(Q,r)}:{width:T.scalingValue(Q,r)};const ie=K.width/K.height;if(S.direction==="horiz"){const ue=Q,Ce=ue*ie;return{width:T.scalingValue(Ce,r),height:T.scalingValue(ue,r)}}else{const ue=Q,Ce=ue/ie;return{width:T.scalingValue(ue,r),height:T.scalingValue(Ce,r)}}};return a.jsx("button",{className:G.thumbItem,style:{...S.direction==="horiz"&&N.fit!=="fit"?{height:T.scalingValue(Q,r)}:{},...S.direction==="vert"&&N.fit!=="fit"?{width:T.scalingValue(Q,r)}:{},...N.fit==="cover"?{width:T.scalingValue(Q,r),height:T.scalingValue(Q,r)}:{},...pe(),transition:ge?"all 0.25s ease-out":"none",opacity:ge?N.activeState.opacity/100:N.opacity/100,"--thumb-hover":N.activeState.opacity/100},onClick:ie=>{var ue;ie.stopPropagation(),p(ce),(ue=x.current)==null||ue.go(ce)},onMouseEnter:()=>{var ie;N.triggers==="hov"&&((ie=x.current)==null||ie.go(ce))},children:a.jsx("img",{src:le.image.url,alt:le.image.name??"",onLoad:ie=>{const ue=ie.currentTarget;ue.naturalWidth&&ue.naturalHeight&&y(Ce=>({...Ce,[ce]:{width:ue.naturalWidth,height:ue.naturalHeight}}))},style:{objectFit:N.fit==="cover"?"cover":"contain",...N.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...N.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${le.image.name}-${ce}`)})})})})()]})]}),document.getElementById(l))};function _i({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Vl={element:Hl,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 In(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Dl(e){return`
|
|
6
|
+
*/const Xs="RichTextRenderer-module__link___BWeZ2",Zs={link:Xs},Js=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(o=>/^\d/.test(o))},vo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Js(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function mt(e){const{color:t,...n}=e;return n}function Ge(e,t){var r,a,i;const{fontSize:n,lineHeight:o}=e;return{fontFamily:vo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:E.scalingValue(e.letterSpacing,t),wordSpacing:E.scalingValue(e.wordSpacing,t),fontSize:E.scalingValue(n,t),lineHeight:o!==void 0?E.scalingValue(o,t):void 0,textTransform:(r=e.textAppearance)==null?void 0:r.textTransform,textDecoration:(a=e.textAppearance)==null?void 0:a.textDecoration,fontVariant:(i=e.textAppearance)==null?void 0:i.fontVariant,textAlign:e.textAlign,color:e.color}}const wn=({content:e})=>{const t=n=>n.map((o,r)=>o.type==="link"?l.jsx("a",{className:Zs.link,href:o.value,target:o.target,children:t(o.children)},r):l.jsx("span",{style:Qs(o),children:o.text},r));return l.jsx(l.Fragment,{children:e.map((n,o)=>{const r=n.children;return l.jsx("div",{children:t(r)},o)})})};function Qs(e){return{...e.fontFamily&&{fontFamily:vo(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 el="SvgImage-module__svg___q3xE-",tl="SvgImage-module__img___VsTm-",Ai={svg:el,img:tl},nl=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},ol=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,_t=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:o="",style:r})=>{const[a,i]=p.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return p.useEffect(()=>{if(typeof window<"u"&&window.CSS){const c=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');i(c)}},[]),!nl(e)||!a?l.jsx("img",{src:e,alt:"",className:Te(Ai.img,o),style:r}):l.jsx("span",{"data-supports-mask":a,className:Te(Ai.svg,o),style:{"--svg":ol(e),"--fill":t,"--hover-fill":n,...r??{}}})},il={"top-left":ae.topLeftAlignment,"top-center":ae.topCenterAlignment,"top-right":ae.topRightAlignment,"middle-left":ae.middleLeftAlignment,"middle-center":ae.middleCenterAlignment,"middle-right":ae.middleRightAlignment,"bottom-left":ae.bottomLeftAlignment,"bottom-center":ae.bottomCenterAlignment,"bottom-right":ae.bottomRightAlignment};function rl({settings:e,content:t,styles:n,isEditor:o}){const[r,a]=p.useState(null),{widthSettings:i,fontSettings:c,letterSpacing:s,textAlign:d,wordSpacing:u,fontSizeLineHeight:P,textAppearance:v,color:x}=n.imageCaption,[h,g]=p.useState(void 0),[T,L]=p.useState(null),[b,m]=p.useState(0),[H,F]=p.useState(0),{direction:_,transition:C,controls:W,pagination:w,imageCaption:O,triggers:S}=e,V=p.useRef(C.type),{x:D,y:Z}=e.controls.offset,q=$=>{r&&r.go($)};return p.useEffect(()=>{if(!T)return;const $=new ResizeObserver(k=>{if(!r)return;const[R]=k;g({width:Math.round(R.contentRect.width),height:Math.round(R.contentRect.height)})});return $.observe(T),()=>$.unobserve(T)},[T]),p.useEffect(()=>{!r||V.current===C.type||(F($=>$+1),V.current=C.type)},[C.type]),l.jsx("div",{className:Te(ae.wrapper,{[ae.editor]:o}),ref:L,children:l.jsxs("div",{className:ae.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:C.backgroundColor&&C.type==="fade in"?C.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&l.jsx("div",{className:Te(ae.captionBlock),children:l.jsx("div",{className:ae.captionTextWrapper,children:t.map(($,k)=>l.jsx("div",{className:Te(ae.captionText,il[O.alignment],{[ae.withPointerEvents]:k===b&&o,[ae.active]:k===b}),style:{fontFamily:vo(c.fontFamily),fontWeight:c.fontWeight,fontStyle:c.fontStyle,width:i.sizing==="auto"?"max-content":E.scalingValue(i.width,o),letterSpacing:E.scalingValue(s,o),wordSpacing:E.scalingValue(u,o),textAlign:d,fontSize:E.scalingValue(P.fontSize,o),lineHeight:E.scalingValue(P.lineHeight,o),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:x,transitionDuration:C.duration?`${Math.round(parseInt(C.duration)/2)}ms`:"500ms"},children:l.jsx("div",{"data-styles":"imageCaption",className:ae.captionTextInner,style:{"--link-hover-color":O.linkHoverColor,"--link-color":O.linkColor,position:"relative",top:E.scalingValue(O.offset.y,o),left:E.scalingValue(O.offset.x,o)},children:l.jsx(wn,{content:$.imageCaption})})},k))})}),l.jsx(si,{onMove:$=>{m($.index)},ref:a,options:{arrows:!1,speed:C.duration?parseInt(C.duration):500,autoplay:S.autoPlay!==null,...S.autoPlay!==null&&{interval:parseInt(S.autoPlay)*1e3},direction:_==="horiz"||C.type==="fade in"?"ltr":"ttb",pagination:!1,drag:S.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:C.type==="fade in"?"fade":"loop",rewind:!0},children:t.map(($,k)=>l.jsx(li,{children:l.jsx("div",{className:ae.sliderItem,children:l.jsx("div",{className:ae.imgWrapper,children:l.jsx("img",{className:Te(ae.sliderImage,{[ae.contain]:$.image.objectFit==="contain",[ae.cover]:$.image.objectFit==="cover"}),src:$.image.url,alt:$.image.name??""})})})},k))},H),W.isActive&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:Te(ae.arrow,{[ae.arrowVertical]:_==="vert",[ae.hoverArrow]:W.show==="on hover"}),style:{color:W.color,"--arrow-hover-color":W.hover},children:l.jsxs("button",{onClick:()=>{q("-1")},className:ae.arrowInner,style:{transform:`translate(${E.scalingValue(D,o)}, ${E.scalingValue(Z*(_==="horiz"?1:-1),o)}) scale(${e.controls.scale/100}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:[W.arrowsImgUrl&&l.jsx(_t,{url:W.arrowsImgUrl,fill:W.color,hoverFill:W.hover,className:Te(ae.arrowImg,ae.mirror)}),!W.arrowsImgUrl&&l.jsx(Ri,{color:W.color,className:Te(ae.arrowIcon,ae.arrowImg,ae.mirror)})]})}),l.jsx("div",{className:Te(ae.arrow,ae.nextArrow,{[ae.arrowVertical]:_==="vert",[ae.hoverArrow]:W.show==="on hover"}),style:{color:W.color,"--arrow-hover-color":W.hover},children:l.jsxs("button",{className:ae.arrowInner,onClick:()=>q("+1"),style:{transform:`translate(${E.scalingValue(D*(_==="horiz"?-1:1),o)}, ${E.scalingValue(Z,o)}) scale(${e.controls.scale/100}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:[W.arrowsImgUrl&&l.jsx(_t,{url:W.arrowsImgUrl,fill:W.color,hoverFill:W.hover,className:ae.arrowImg}),!W.arrowsImgUrl&&l.jsx(Ri,{color:W.color,className:Te(ae.arrowIcon,ae.arrowImg)})]})})]}),S.triggersList.click&&l.jsx("div",{className:ae.clickOverlay,onClick:()=>{r&&r.go("+1")}}),w.isActive&&l.jsx("div",{className:Te(ae.pagination,{[ae.paginationInsideBottom]:w.position==="inside-1"&&_==="horiz",[ae.paginationInsideTop]:w.position==="inside-2"&&_==="horiz",[ae.paginationOutsideBottom]:w.position==="outside-1"&&_==="horiz",[ae.paginationOutsideTop]:w.position==="outside-2"&&_==="horiz",[ae.paginationInsideLeft]:w.position==="inside-1"&&_==="vert",[ae.paginationInsideRight]:w.position==="inside-2"&&_==="vert",[ae.paginationOutsideLeft]:w.position==="outside-1"&&_==="vert",[ae.paginationOutsideRight]:w.position==="outside-2"&&_==="vert",[ae.paginationVertical]:_==="vert"}),children:l.jsx("div",{className:ae.paginationInner,style:{backgroundColor:w.colors[2],transform:`scale(${w.scale/100}) translate(${E.scalingValue(w.offset.x,o)}, ${E.scalingValue(w.offset.y,o)}) rotate(${_==="horiz"?"0deg":"90deg"})`},children:t.map(($,k)=>l.jsx("button",{onClick:()=>{r&&r.go(k)},className:Te(ae.paginationItem),children:l.jsx("div",{className:Te(ae.dot,{[ae.activeDot]:k===b}),style:{backgroundColor:k===b?w.colors[0]:w.colors[1],"--pagination-hover-color":w.hover}})},k))})})]})})}function Ri({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 al={element:rl,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"]}},sl="ImageRevealSlider-module__imageRevealSlider___UE5Ob",ll="ImageRevealSlider-module__image___Qjt-e",cl="ImageRevealSlider-module__link___N-iLG",dl="ImageRevealSlider-module__cursor___2U03d",Gt={imageRevealSlider:sl,image:ll,link:cl,cursor:dl};function Wi(e,t,n){for(const o of n){const r=new Image;r.src=o.url;const a=o.width?Number.parseFloat(o.width):r.naturalWidth,i=r.naturalHeight/r.naturalWidth*a,c=a/2,s=i/2;if(e>=o.x-c&&e<=o.x+c&&t>=o.y-s&&t<=o.y+s)return!0}return!1}function $o(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function ul(e,t,n,o){let r,a;if(t==="custom"){r=n;const i=await $o(e);a=i.height/i.width*r}else if(t==="random"){r=Math.random()*(o.max-o.min)+o.min;const i=await $o(e);a=i.height/i.width*r}else{const i=await $o(e);r=i.width,a=i.height}return{width:r,height:a,finalWidth:`${r}px`}}function pl({settings:e,content:t,isEditor:n}){const[o,r]=p.useState(null),[a,i]=p.useState([]),[c,s]=p.useState(0),d=p.useRef(0),[u,P]=p.useState({x:0,y:0}),[v,x]=p.useState(1),[h,g]=p.useState("none"),T=p.useRef({x:0,y:0}),[L,b]=p.useState(!1),{sizeType:m,imageWidth:H,randomRangeImageWidth:F}=e.imageSize,{revealPosition:_,visible:C}=e.position,{cursorType:W,target:w,defaultCursorScale:O,defaultCursor:S,hoverCursorScale:V,hoverCursor:D}=e.cursor;p.useEffect(()=>{if(!o)return;const $=(B,I)=>{const A=o.getBoundingClientRect(),Q=B-A.left,ie=I-A.top;if(P({x:Q,y:ie}),W==="system"){g("none"),x(1);return}const re=Q,U=ie,M=document.elementFromPoint(A.left+re,A.top+U);if(M&&M.closest("a")){g("none"),x(1);return}const oe=Wi(re,U,a)||w==="area"?{img:D??"none",scale:V}:{img:S??"none",scale:O};g(oe.img),x(oe.scale)},k=B=>{B.stopPropagation(),T.current={x:B.clientX,y:B.clientY},$(B.clientX,B.clientY)},R=()=>{L&&$(T.current.x,T.current.y)};return o.addEventListener("mousemove",k),window.addEventListener("scroll",R,!0),()=>{o.removeEventListener("mousemove",k),window.removeEventListener("scroll",R,!0)}},[o,L,u,W,w,D,S,V,O,a]),p.useEffect(()=>{L||(g("none"),x(0))},[L]);const Z=async($,k,R,B={})=>{const{width:I,height:A,finalWidth:Q}=await ul($.image.url,m,H,F);let ie=0,re=0;_==="same"?(ie=k/2,re=R/2):(ie=B.x??Math.random()*k,re=B.y??Math.random()*R);const U=Math.min(Math.max(ie,I/2),k-I/2),M=Math.min(Math.max(re,A/2),R-A/2);return{id:d.current++,url:$.image.url,link:$.link,name:$.image.name,x:U,y:M,width:Q}};p.useEffect(()=>{if(!o||t.length===0)return;const $=o.getBoundingClientRect(),k=$.width,R=$.height,B=[];(async()=>{const A=t[0],Q=await Z(A,k,R);B.push(Q),i(B),s(1)})()},[m,H,F,_,o]),p.useEffect(()=>{C==="last One"&&i($=>$.length>0?[$[$.length-1]]:[])},[C]);const q=async $=>{if(!o)return;const k=o.getBoundingClientRect(),R=$.clientX-k.left,B=$.clientY-k.top;if(w==="image"&&!Wi(R,B,a))return;let I=0,A=0;_==="on Click"?(I=R,A=B):_==="same"?(I=k.width/2,A=k.height/2):(I=Math.random()*k.width,A=Math.random()*k.height);const Q=t[c],ie=await Z(Q,k.width,k.height,{x:I,y:A});i(re=>C==="all"?[...re,ie]:[ie]),s(re=>re>=t.length-1?0:re+1)};return l.jsxs("div",{ref:r,onClick:q,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),className:Gt.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[a.map($=>l.jsx("div",{className:Gt.wrapper,style:{top:`${$.y}px`,left:`${$.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:$.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:w==="area"&&$.link?l.jsx("a",{href:$.link,target:"_blank",className:Gt.link,children:l.jsx("img",{src:$.url,alt:$.name,className:Gt.image},$.id)}):l.jsx("img",{src:$.url,alt:$.name,className:Gt.image},$.id)},$.id)),L&&l.jsx("div",{className:Gt.cursor,style:{left:`${u.x}px`,top:`${u.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const ml={element:pl,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:""}]}}}},gl="LightBox-module__hidden___9s-9x",hl="LightBox-module__heroImage___sTxNF",fl="LightBox-module__background___rm9ml",yl="LightBox-module__editor___4ACaY",vl="LightBox-module__contentStyle___Bgnsq",bl="LightBox-module__imageStyle___tLIlB",xl="LightBox-module__imgWrapper___LuFUp",Cl="LightBox-module__contain___8-yaS",Sl="LightBox-module__cover___hNvOG",wl="LightBox-module__caption___b6L2I",$l="LightBox-module__captionTextInner___rCGNH",Tl="LightBox-module__lightboxSplide___XFuWC",Ll="LightBox-module__arrow___iz38X",El="LightBox-module__arrowVertical___Zfz81",Pl="LightBox-module__nextArrow___zkAQN",_l="LightBox-module__arrowInner___p48sW",Al="LightBox-module__arrowIcon___3VaFf",Rl="LightBox-module__arrowImg___pNV88",Wl="LightBox-module__mirror___pjeXc",Il="LightBox-module__thumbsWrapper___GB-nU",kl="LightBox-module__thumbsContainerVertical___wttk5",Fl="LightBox-module__thumbsContainer___osSma",Ml="LightBox-module__thumbsAlignStart___MO6tY",Nl="LightBox-module__thumbsAlignCenter___Q4sUx",Hl="LightBox-module__thumbsAlignEnd___p4y9R",Bl="LightBox-module__thumbItem___HvnF3",Ol="LightBox-module__closeButton___g2khP",Vl="LightBox-module__fadeIn___0m5GW",Dl="LightBox-module__slideInLeft___gPYwC",jl="LightBox-module__slideInRight___S-pPp",zl="LightBox-module__slideInTop___DFdAj",Kl="LightBox-module__slideInBottom___m27kZ",ql="LightBox-module__fadeOut___55qBR",Ul="LightBox-module__slideOutLeft___NvU7P",Gl="LightBox-module__slideOutRight___SK7eC",Yl="LightBox-module__slideOutTop___Vgg0z",Xl="LightBox-module__slideOutBottom___nJ0Ef",Zl="LightBox-module__scaleSlide___vZriG",J={hidden:gl,heroImage:hl,background:fl,editor:yl,contentStyle:vl,imageStyle:bl,imgWrapper:xl,contain:Cl,cover:Sl,caption:wl,captionTextInner:$l,lightboxSplide:Tl,arrow:Ll,arrowVertical:El,nextArrow:Pl,arrowInner:_l,arrowIcon:Al,arrowImg:Rl,mirror:Wl,thumbsWrapper:Il,thumbsContainerVertical:kl,thumbsContainer:Fl,thumbsAlignStart:Ml,thumbsAlignCenter:Nl,thumbsAlignEnd:Hl,thumbItem:Bl,closeButton:Ol,fadeIn:Vl,slideInLeft:Dl,slideInRight:jl,slideInTop:zl,slideInBottom:Kl,fadeOut:ql,slideOutLeft:Ul,slideOutRight:Gl,slideOutTop:Yl,slideOutBottom:Xl,scaleSlide:Zl},Vn=(e,t,n)=>{const o={},[r,a]=e.split("-");return r==="top"?(o.top="0",o.bottom="auto"):r==="middle"?(o.top="50%",o.bottom="auto"):r==="bottom"&&(o.top="auto",o.bottom="0"),a==="left"?(o.left="0",o.right="auto"):a==="center"?(o.left="50%",o.right="auto"):a==="right"&&(o.left="auto",o.right="0"),r==="middle"&&a==="center"?o.transform=`translate(calc(-50% + ${E.scalingValue(t.x,n)}), calc(-50% + ${E.scalingValue(t.y,n)}))`:r==="middle"?o.transform=`translate(${E.scalingValue(t.x,n)}, calc(-50% + ${E.scalingValue(t.y,n)}))`:a==="center"?o.transform=`translate(calc(-50% + ${E.scalingValue(t.x,n)}), ${E.scalingValue(t.y,n)})`:o.transform=`translate(${E.scalingValue(t.x,n)}, ${E.scalingValue(t.y,n)})`,o};function Mr(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 Ii(e){const t=e.getBoundingClientRect(),n=Mr(e),o=Math.max(0,t.width-n.left-n.right),r=Math.max(0,t.height-n.top-n.bottom),a=e.naturalWidth,i=e.naturalHeight,c=o/r,s=a/i;let d,u;s>c?(d=o,u=o/s):(u=r,d=r*s);const P=t.left+n.left,v=t.top+n.top,x=(o-d)/2+P,h=(r-u)/2+v;return{x,y:h,width:d,height:u}}function ki(e){const t=e.getBoundingClientRect(),n=Mr(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Fi(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const o=t[1].split(",").map(r=>parseFloat(r.trim()));return o.length===4?o[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const o=n[1].substring(6,8);return parseInt(o,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Jl(e,t){const n=(()=>{if(e==="fade in")return J.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return J.slideInLeft;case"right":return J.slideInRight;case"top":return J.slideInTop;case"bottom":return J.slideInBottom;default:return J.slideInRight}return J.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return J.fadeIn;if(e==="slide in")switch(t){case"left":return J.slideInLeft;case"right":return J.slideInRight;case"top":return J.slideInTop;case"bottom":return J.slideInBottom;default:return J.slideInRight}return J.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return J.fadeOut;if(e==="slide in")switch(t){case"left":return J.slideOutLeft;case"right":return J.slideOutRight;case"top":return J.slideOutTop;case"bottom":return J.slideOutBottom;default:return J.slideOutRight}return J.fadeOut})(),a=(()=>{if(e==="fade in")return J.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return J.slideOutLeft;case"right":return J.slideOutRight;case"top":return J.slideOutTop;case"bottom":return J.slideOutBottom;default:return J.slideOutRight}return J.fadeOut})();return{appearClass:n,backdropAppearClass:o,backdropDisappearClass:r,disappearClass:a}}const Ql=({settings:e,content:t,styles:n,portalId:o,activeEvent:r,isEditor:a,isPreviewMode:i})=>{const[c,s]=p.useState(!1),{url:d}=e.thumbnailBlock.cover;return p.useEffect(()=>{r==="close"&&s(!1),r==="open"&&s(!0)},[r]),l.jsxs(l.Fragment,{children:[l.jsx("img",{src:d,alt:"Cover",className:J.heroImage,onClick:()=>s(!0)}),l.jsx(ec,{isOpen:c,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:o,isEditor:a})]})},ec=({isOpen:e,onClose:t,content:n,lightboxStyles:o,settings:r,portalId:a,isEditor:i,metadata:c})=>{var y;const[s,d]=p.useState(0),[u,P]=p.useState(0),[v,x]=p.useState(!1),[h,g]=p.useState(!1),[T,L]=p.useState({}),b=p.useRef(null),m=p.useRef(null),H=p.useRef(null),F=p.useRef(!1),_=p.useRef(null),C=p.useRef(null),W=p.useRef(null),w=p.useRef(null),O=p.useRef(!1),S=p.useRef(null),[V,D]=p.useState(!1),{appear:Z,triggers:q,slider:$,thumbnail:k,controls:R,area:B,caption:I,layout:A}=r.lightboxBlock,{appearClass:Q,backdropAppearClass:ie,backdropDisappearClass:re,disappearClass:U}=Jl(Z.type,Z.direction),M=(c==null?void 0:c.itemId)??null;p.useEffect(()=>{const f=()=>{setTimeout(()=>{var K,G;(G=(K=b.current)==null?void 0:K.splide)==null||G.refresh()},16)},N=()=>{P(K=>K+1)};return window.addEventListener("ArticleEditor.Layout:change",f),window.addEventListener("ArticleEditor.ComponentContent:change",N),()=>{window.removeEventListener("ArticleEditor.Layout:change",f),window.removeEventListener("ArticleEditor.ComponentContent:change",N)}},[]),p.useEffect(()=>{if(!e||!k.isActive){D(!1);return}const f=S.current;if(!f)return;const N=()=>{$.direction==="horiz"?D(f.scrollWidth>f.clientWidth):D(f.scrollHeight>f.clientHeight)};N();const K=new ResizeObserver(N);return K.observe(f),()=>K.disconnect()},[e,k.isActive,n.length,T,$.direction]);const oe=p.useCallback(()=>{const f=window.matchMedia("(max-width: 768px)").matches,N=Fi(B.color);f&&!i&&N>.9&&(document.body.style.backgroundColor=""),x(!0),F.current=!0;const K=G=>{G.target===_.current&&G.animationName&&(_.current&&C.current&&_.current.removeEventListener("animationend",C.current),C.current=null,F.current&&(F.current=!1,t()),x(!1))};_.current&&(C.current=K,_.current.addEventListener("animationend",K))},[t,B.color,i]),Ce=(f,N,K)=>{var G,ee;if(f){if(q.type==="click"&&q.switch==="image")q.repeat==="close"&&s===n.length-1?oe():(G=b.current)==null||G.go("+1");else if(q.type==="click"&&q.switch==="50/50"){const te=f.getBoundingClientRect(),X=N-te.left,ce=K-te.top,ve=te.width,de=te.height;let xe;$.direction==="horiz"?xe=X<ve/2?"-1":"+1":xe=ce<de/2?"-1":"+1",(ee=b.current)==null||ee.go(xe)}}},ue=f=>{if(O.current){O.current=!1;return}const N=n[s],K=(N==null?void 0:N.image.objectFit)==="cover";let G,ee;if("changedTouches"in f&&f.changedTouches.length>0)G=f.changedTouches[0].clientX,ee=f.changedTouches[0].clientY;else if("clientX"in f)G=f.clientX,ee=f.clientY;else return;let te;if(K&&H.current){const X=ki(H.current);te=G>=X.left&&G<=X.right&&ee>=X.top&&ee<=X.bottom}else{const X=H.current?Ii(H.current):null;if(!X){f.target===f.currentTarget&&oe();return}te=G>=X.x&&G<=X.x+X.width&&ee>=X.y&&ee<=X.y+X.height}te?Ce(H.current,G,ee):oe()},fe=f=>{const N=f.target;(N.classList.contains(J.thumbsWrapper)||N.classList.contains(J.thumbsContainer))&&ue(f)};p.useEffect(()=>{if(!e)return;const f=N=>{var K,G;if(N.key==="Escape"){oe();return}if(N.key==="ArrowRight"){d(ee=>(ee+1)%Math.max(n.length,1)),(K=b.current)==null||K.go("+1");return}N.key==="ArrowLeft"&&(d(ee=>(ee-1+Math.max(n.length,1))%Math.max(n.length,1)),(G=b.current)==null||G.go("-1"))};return window.addEventListener("keydown",f),()=>{window.removeEventListener("keydown",f)}},[e,oe,n.length]),p.useEffect(()=>{if(e){if(d(0),P(N=>N+1),F.current=!1,x(!1),g(!1),L({}),!M)return;const f=new CustomEvent("page-overlay",{detail:{itemId:M}});window.dispatchEvent(f)}return()=>{_.current&&C.current&&(_.current.removeEventListener("animationend",C.current),C.current=null),g(!1)}},[e,M]),p.useEffect(()=>{m.current!==null&&m.current!==$.type&&P(f=>f+1),m.current=$.type},[$.type]),p.useEffect(()=>{if(!e)return;const f=document.body.style.overflow,N=window.matchMedia("(max-width: 768px)").matches,K=Fi(B.color);document.body.style.overflow="hidden",g(!1);const G=te=>{te.target===_.current&&!F.current&&te.animationName&&(N&&!i&&K>.9&&(document.body.style.backgroundColor=B.color),g(!0),_.current&&W.current&&_.current.removeEventListener("animationend",W.current),W.current=null)};_.current&&(W.current=G,_.current.addEventListener("animationend",G));const ee=te=>{const X=te.target;X&&(X.closest(`.${J.thumbsWrapper}`)||X.closest(`.${J.thumbsContainer}`))||$.type!=="slide"&&te.preventDefault()};return document.addEventListener("touchmove",ee,{passive:!1}),()=>{document.body.style.overflow=f,document.removeEventListener("touchmove",ee),_.current&&W.current&&(_.current.removeEventListener("animationend",W.current),W.current=null),g(!1)}},[e,i,B.color,$.type]),p.useEffect(()=>{if(!e)return;const f=N=>{var G,ee;if(F.current){N.stopPropagation();return}if(O.current){O.current=!1;return}const K=N.target;if(!(K&&(K.closest(`.${J.thumbsContainer}`)||K.closest(`.${J.thumbItem}`)||K.closest(`.${J.arrow}`)||K.closest(`.${J.closeButton}`)||K.closest(`.${J.caption}`)))){if($.type==="slide"&&q.type==="drag"&&((ee=(G=b.current)==null?void 0:G.splide)!=null&&ee.root)){const te=b.current.splide.root;if(K&&(te.contains(K)||te===K))return}if(N.touches.length===0&&N.changedTouches.length>0){const te=n[s],X=(te==null?void 0:te.image.objectFit)==="cover",ce=N.changedTouches[0];let ve;if(X&&H.current){const de=ki(H.current);ve=ce.clientX>=de.left&&ce.clientX<=de.right&&ce.clientY>=de.top&&ce.clientY<=de.bottom}else{const de=H.current?Ii(H.current):null;if(!de)return;ve=ce.clientX>=de.x&&ce.clientX<=de.x+de.width&&ce.clientY>=de.y&&ce.clientY<=de.y+de.height}if(!ve){N.stopPropagation(),F.current=!0;const de=xe=>{xe.stopPropagation(),xe.preventDefault(),document.removeEventListener("click",de,!0)};document.addEventListener("click",de,!0),oe()}}}};return document.addEventListener("touchend",f,{passive:!0}),()=>{document.removeEventListener("touchend",f)}},[e,oe,s,n]);const Re=($.type==="scale"||$.type==="fade")&&$.direction==="vert"&&q.type==="drag";p.useEffect(()=>{var xe,z;if(!e||!Re||!((z=(xe=b.current)==null?void 0:xe.splide)!=null&&z.root))return;const f=b.current.splide.root,N=30,K=(Y,j)=>{if(w.current){const le=Math.abs(Y-w.current.x),we=Math.abs(j-w.current.y);(le>0||we>0)&&(O.current=!0)}},G=Y=>{w.current&&(Y.preventDefault(),K(Y.clientX,Y.clientY))},ee=Y=>{w.current&&Y.touches.length>0&&(Y.preventDefault(),K(Y.touches[0].clientX,Y.touches[0].clientY))},te=(Y,j)=>{if(!w.current||!b.current){w.current=null;return}const le=Math.abs(Y-w.current.x),we=Math.abs(j-w.current.y);we>N&&we>le&&b.current.go(j<w.current.y?"+1":"-1"),w.current=null},X=Y=>{w.current&&te(Y.clientX,Y.clientY),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.removeEventListener("pointermove",G)},ce=Y=>{if(w.current){if(Y.changedTouches.length>0){const j=Y.changedTouches[0];te(j.clientX,j.clientY)}document.removeEventListener("touchend",ce),document.removeEventListener("touchcancel",ce),document.removeEventListener("touchmove",ee)}},ve=Y=>{w.current={x:Y.clientX,y:Y.clientY},O.current=!1,document.addEventListener("pointermove",G,{passive:!1}),document.addEventListener("pointerup",X),document.addEventListener("pointercancel",X)},de=Y=>{Y.touches.length>0&&(w.current={x:Y.touches[0].clientX,y:Y.touches[0].clientY},O.current=!1,document.addEventListener("touchmove",ee,{passive:!1}),document.addEventListener("touchend",ce),document.addEventListener("touchcancel",ce))};return f.addEventListener("pointerdown",ve),f.addEventListener("touchstart",de),()=>{f.removeEventListener("pointerdown",ve),f.removeEventListener("touchstart",de),document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",X),document.removeEventListener("pointercancel",X),document.removeEventListener("touchmove",ee),document.removeEventListener("touchend",ce),document.removeEventListener("touchcancel",ce),w.current=null,O.current=!1}},[e,Re,u]);const ne={backgroundColor:B.color,backdropFilter:`blur(${B.blur}px)`,animationDuration:`${parseInt(Z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(a)?null:Qi.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:i?null:_,className:Te(J.background,v?re:ie,{[J.editor]:i},{[J.hidden]:!e}),style:{...ne,...h&&!i&&!v?{position:"absolute"}:{}}}),l.jsxs("div",{ref:i?_:null,className:Te(J.contentStyle,v?U:Q,{[J.editor]:i},{[J.hidden]:!e}),style:{animationDuration:`${parseInt(Z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[l.jsx(si,{onMove:f=>d(f.index),ref:b,className:J.lightboxSplide,options:{arrows:!1,speed:$.duration?parseInt($.duration):500,direction:$.direction==="horiz"||$.type==="fade"||$.type==="scale"?"ltr":"ttb",pagination:!1,drag:q.type==="drag"&&!Re,perPage:1,width:"100%",height:"100%",type:$.type==="fade"||$.type==="scale"?"fade":"loop",padding:0,rewind:q.repeat!=="close",start:0},style:{"--splide-speed":$.duration},children:n.map((f,N)=>{const K=Vn(A.position,A.offset,i),G=`${E.scalingValue(A.padding.top,i)} ${E.scalingValue(A.padding.right,i)} ${E.scalingValue(A.padding.bottom,i)} ${E.scalingValue(A.padding.left,i)}`,ee=$.type==="scale"?(()=>{const{transform:te,...X}=K;return{...X,position:"absolute",padding:G,boxSizing:"border-box","--position-transform":te||"none"}})():{...K,position:"absolute",padding:G,boxSizing:"border-box"};return l.jsx(li,{children:l.jsx("div",{className:J.imgWrapper,onClick:ue,children:l.jsx("img",{ref:N===s?H:null,className:Te(J.imageStyle,{[J.contain]:f.image.objectFit==="contain",[J.cover]:f.image.objectFit==="cover",[J.scaleSlide]:$.type==="scale"}),src:f.image.url,alt:f.image.name??"",style:{...ee,pointerEvents:f.image.objectFit==="contain"?"none":"auto"}})})},N)})},u),R.isActive&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:Te(J.arrow,{[J.arrowVertical]:$.direction==="vert"}),style:{color:R.color,"--arrow-hover-color":R.hover},children:l.jsxs("button",{className:J.arrowInner,style:{transform:`translate(${E.scalingValue(R.offset.x,i)}, ${E.scalingValue(R.offset.y*($.direction==="horiz"?1:-1),i)}) scale(${R.scale}) rotate(${$.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var f;return(f=b.current)==null?void 0:f.go("-1")},"aria-label":"Previous",children:[R.arrowsImgUrl&&l.jsx(_t,{url:R.arrowsImgUrl,fill:R.color,hoverFill:R.hover,className:Te(J.arrowImg,J.mirror)}),!R.arrowsImgUrl&&l.jsx(Mi,{color:R.color,className:Te(J.arrowIcon,J.arrowImg,J.mirror)})]})}),l.jsx("div",{className:Te(J.arrow,J.nextArrow,{[J.arrowVertical]:$.direction==="vert"}),style:{color:R.color,"--arrow-hover-color":R.hover},children:l.jsxs("button",{className:J.arrowInner,style:{transform:`translate(${E.scalingValue(R.offset.x*($.direction==="horiz"?-1:1),i)}, ${E.scalingValue(R.offset.y,i)}) scale(${R.scale}) rotate(${$.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var f;return(f=b.current)==null?void 0:f.go("+1")},"aria-label":"Next",children:[R.arrowsImgUrl&&l.jsx(_t,{url:R.arrowsImgUrl,fill:R.color,hoverFill:R.hover,className:J.arrowImg}),!R.arrowsImgUrl&&l.jsx(Mi,{color:R.color,className:Te(J.arrowIcon,J.arrowImg)})]})})]}),B.closeIconUrl&&(()=>{const f=Vn(B.closeIconAlign,B.closeIconOffset,i),N=`scale(${B.closeIconScale})`,K=f.transform?`${f.transform} ${N}`:N;return l.jsx("button",{className:J.closeButton,style:{...f,transform:K},onClick:oe,"aria-label":"Close lightbox",children:l.jsx(_t,{url:B.closeIconUrl,fill:B.closeIconColor??"#000000",hoverFill:B.closeIconHover??"#cccccc"})})})(),I&&I.isActive&&o.imageCaption&&((y=n[s])==null?void 0:y.imageCaption)&&(()=>{const{widthSettings:f,fontSettings:N,letterSpacing:K,textAlign:G,wordSpacing:ee,fontSizeLineHeight:te,textAppearance:X,color:ce}=o.imageCaption;return l.jsx("div",{className:J.caption,style:{...Vn(I.alignment,I.offset,i),fontFamily:vo(N.fontFamily),fontWeight:N.fontWeight,fontStyle:N.fontStyle,width:f.sizing==="auto"?"max-content":E.scalingValue(f.width,i),letterSpacing:E.scalingValue(K,i),wordSpacing:E.scalingValue(ee,i),textAlign:G,fontSize:E.scalingValue(te.fontSize,i),lineHeight:E.scalingValue(te.lineHeight,i),textTransform:X.textTransform??"none",textDecoration:X.textDecoration??"none",fontVariant:X.fontVariant??"normal",color:ce},onClick:ve=>ve.stopPropagation(),children:l.jsx("div",{"data-styles":"imageCaption",className:J.captionTextInner,style:{"--link-color":I.linkColor,"--link-hover-color":I.linkHoverColor},children:l.jsx(wn,{content:n[s].imageCaption})})})})(),k.isActive&&(()=>{const[f,N]=k.position.split("-"),K=$.direction==="horiz"?`${f}-left`:k.position,G=Vn(K,k.offset,i),ee=()=>{if($.direction==="horiz"){if(N==="left")return"flex-start";if(N==="center")return"center";if(N==="right")return"flex-end"}else{if(f==="top")return"flex-start";if(f==="middle")return"center";if(f==="bottom")return"flex-end"}return"flex-start"};return l.jsx("div",{ref:S,className:J.thumbsWrapper,onClick:te=>fe(te),style:{position:i?"absolute":"fixed",...G,...$.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:l.jsx("div",{className:Te(J.thumbsContainer,{[J.thumbsContainerVertical]:$.direction==="vert",[J.thumbsAlignStart]:k.align==="start",[J.thumbsAlignCenter]:k.align==="center",[J.thumbsAlignEnd]:k.align==="end"}),style:{gap:E.scalingValue(k.grid.gap,i),justifyContent:V?"flex-start":ee()},children:n.map((te,X)=>{const ce=X===s,ve=T[X],xe=k.grid.size*(ce?k.activeState.scale:1),z=()=>{if(k.fit!=="fit")return{};if(!ve)return $.direction==="horiz"?{height:E.scalingValue(xe,i)}:{width:E.scalingValue(xe,i)};const Y=ve.width/ve.height;if($.direction==="horiz"){const j=xe,le=j*Y;return{width:E.scalingValue(le,i),height:E.scalingValue(j,i)}}else{const j=xe,le=j/Y;return{width:E.scalingValue(j,i),height:E.scalingValue(le,i)}}};return l.jsx("button",{className:J.thumbItem,style:{...$.direction==="horiz"&&k.fit!=="fit"?{height:E.scalingValue(xe,i)}:{},...$.direction==="vert"&&k.fit!=="fit"?{width:E.scalingValue(xe,i)}:{},...k.fit==="cover"?{width:E.scalingValue(xe,i),height:E.scalingValue(xe,i)}:{},...z(),transition:ce?"all 0.25s ease-out":"none",opacity:ce?k.activeState.opacity/100:k.opacity/100,"--thumb-hover":k.activeState.opacity/100},onClick:Y=>{var j;Y.stopPropagation(),d(X),(j=b.current)==null||j.go(X)},onMouseEnter:()=>{var Y;k.triggers==="hov"&&((Y=b.current)==null||Y.go(X))},children:l.jsx("img",{src:te.image.url,alt:te.image.name??"",onLoad:Y=>{const j=Y.currentTarget;j.naturalWidth&&j.naturalHeight&&L(le=>({...le,[X]:{width:j.naturalWidth,height:j.naturalHeight}}))},style:{objectFit:k.fit==="cover"?"cover":"contain",...k.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...k.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${te.image.name}-${X}`)})})})})()]})]}),document.getElementById(a))};function Mi({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 tc={element:Ql,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 Dn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function nc(e){return`
|
|
7
7
|
.${e}-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
width: 100%;
|
|
11
|
-
min-height: ${
|
|
11
|
+
min-height: ${Dn(48)};
|
|
12
12
|
}
|
|
13
13
|
.${e}-wrapper.${e}-type-C .${e}-input:focus-visible,
|
|
14
14
|
.${e}-wrapper.${e}-type-C .${e}-button:focus-visible {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
min-width: 0;
|
|
33
33
|
}
|
|
34
34
|
.${e}-field-group.${e}-labeled {
|
|
35
|
-
gap: ${
|
|
35
|
+
gap: ${Dn(4)};
|
|
36
36
|
}
|
|
37
37
|
.${e}-field-label {
|
|
38
38
|
white-space: nowrap;
|
|
@@ -128,18 +128,34 @@
|
|
|
128
128
|
outline: none;
|
|
129
129
|
}
|
|
130
130
|
.${e}-success {
|
|
131
|
-
margin-top: ${
|
|
131
|
+
margin-top: ${Dn(8)};
|
|
132
132
|
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
133
133
|
}
|
|
134
134
|
.${e}-error {
|
|
135
|
-
margin-top: ${
|
|
135
|
+
margin-top: ${Dn(8)};
|
|
136
136
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
137
137
|
}
|
|
138
138
|
.${e}-overlay-anchor {
|
|
139
139
|
position: relative;
|
|
140
140
|
height: auto;
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
.${e}-control {
|
|
143
|
+
position: relative;
|
|
144
|
+
z-index: 2;
|
|
145
|
+
width: 100%;
|
|
146
|
+
}
|
|
147
|
+
.${e}-control::before {
|
|
148
|
+
content: "";
|
|
149
|
+
position: absolute;
|
|
150
|
+
top: 0;
|
|
151
|
+
left: 0;
|
|
152
|
+
width: 100%;
|
|
153
|
+
height: 100%;
|
|
154
|
+
min-height: 20px;
|
|
155
|
+
pointer-events: auto;
|
|
156
|
+
z-index: 10;
|
|
157
|
+
}
|
|
158
|
+
`}function oc({settings:e,isEditor:t,isEditMode:n,metadata:o,activeEvent:r}){const a=!!n,{prefix:i}=E.useScopedStyles(),{type:c="A",fieldsToShow:s=2,fields:d=[],buttonLabel:u,gap:P,fieldsGap:v,buttonCorners:x,buttonStroke:h,buttonPadding:g,isButtonFullWidth:T,inputCorners:L,inputStroke:b,inputPadding:m,inputColor:H,inputTextColor:F,inputBorderColor:_,placeholderColor:C,buttonColor:W,buttonTextColor:w,buttonBorderColor:O,labelTextColor:S,successColor:V,errorColor:D,fontFamily:Z,inputFontSettings:q,inputFontSize:$,inputLineHeight:k,inputLetterSpacing:R,inputWordSpacing:B,inputTextAppearance:I,buttonFontSettings:A,buttonFontSize:Q,buttonLineHeight:ie,buttonLetterSpacing:re,buttonWordSpacing:U,buttonTextAppearance:M,labelFontSettings:oe,labelFontSize:Ce,labelLineHeight:ue,labelLetterSpacing:fe,labelWordSpacing:Re,labelTextAppearance:ne,statusFontSettings:y,statusFontSize:f,statusLineHeight:N,statusLetterSpacing:K,statusWordSpacing:G,statusTextAppearance:ee,successMessage:te,errorMessage:X,stateOverrides:ce}=e,ve=c==="B",de=d.slice(0,Math.min(s,d.length)),xe={fontSettings:{fontFamily:Z,fontWeight:(q==null?void 0:q.fontWeight)??400,fontStyle:(q==null?void 0:q.fontStyle)??"normal"},fontSize:$??.01,lineHeight:k,letterSpacing:R??0,wordSpacing:B??0,textAppearance:I,color:F},z=mt(Ge(xe,t)),Y=E.scalingValue(b??0,t),j=E.scalingValue((k??$??.01)+((m==null?void 0:m.top)??0)+((m==null?void 0:m.bottom)??0)+(c==="C"?b??0:(b??0)*2),t),le={...z,borderStyle:"solid",borderRadius:c==="C"?0:E.scalingValue(L??0,t),...c==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:Y,borderLeftWidth:0}:{borderWidth:Y},paddingTop:E.scalingValue((m==null?void 0:m.top)??0,t),paddingRight:E.scalingValue((m==null?void 0:m.right)??0,t),paddingBottom:E.scalingValue((m==null?void 0:m.bottom)??0,t),paddingLeft:E.scalingValue((m==null?void 0:m.left)??0,t),height:j,minHeight:j},we={fontSettings:{fontFamily:Z,fontWeight:(A==null?void 0:A.fontWeight)??400,fontStyle:(A==null?void 0:A.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:ie,letterSpacing:re??0,wordSpacing:U??0,textAppearance:M,color:w},Se=mt(Ge(we,t)),Ne=E.scalingValue(h??0,t),ye={fontSettings:{fontFamily:Z,fontWeight:(oe==null?void 0:oe.fontWeight)??400,fontStyle:(oe==null?void 0:oe.fontStyle)??"normal"},fontSize:Ce??.01,lineHeight:ue,letterSpacing:fe??0,wordSpacing:Re??0,textAppearance:ne,color:S},He=Ge(ye,t),ke={fontSettings:{fontFamily:Z,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:f??.01,lineHeight:N,letterSpacing:K??0,wordSpacing:G??0,textAppearance:ee,color:V},We=mt(Ge(ke,t)),Oe=E.buildColorVars(i,{inputColor:H,inputTextColor:F,inputBorderColor:_,placeholderColor:C!=null&&C.trim()?C:"#cccccc",buttonColor:W,buttonTextColor:w,buttonBorderColor:O,labelTextColor:S,successColor:V,errorColor:D},ic,rc,ce),[Ye,ct]=p.useState(()=>Object.fromEntries(de.map(me=>[me.name,""]))),[Tt,Ze]=p.useState("idle"),[qt,dt]=p.useState(null),be=r==="success"?"success":r==="error"?"error":Tt,Je=r==="error"?X:qt,Qe=r==="filled",et=p.useMemo(()=>{if(!Qe)return Ye;let me=null;for(const Ie of de)(Ye[Ie.name]??"").trim().length>0||(me=me??{...Ye},me[Ie.name]="Filled");return me??Ye},[Ye,Qe,de]),Mt=be==="error"?E.getFormFieldValidationError(de,et):null,pn=`${r&&r!=="default"?`${i}-state-${r}`:""}`.trim(),Nt=o==null?void 0:o.submitUrl,Ee=(me,Ie)=>{ct(Ve=>({...Ve,[me]:Ie}))},De=async me=>{me.preventDefault();const Ie=Object.fromEntries(de.map(Me=>{var ut;return[Me.name,((ut=Ye[Me.name])==null?void 0:ut.trim())??""]}).filter(([,Me])=>Me));if(!Nt){Ze("error"),dt("No integrations were found for this form.");return}if(Object.keys(Ie).length===0)return;const Ve=E.getFormFieldValidationError(de,Ye);if(Ve){Ze("error"),dt(Ve);return}Ze("submitting"),dt(null);try{const Me=await fetch(Nt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ie)});if(!Me.ok){const ut=await Me.text();throw new Error(ut||`Request failed: ${Me.status}`)}Ze("success"),ct(Object.fromEntries(de.map(ut=>[ut.name,""])))}catch(Me){Ze("error"),dt(Me instanceof Error?Me.message:"Something went wrong")}};return l.jsxs("div",{className:`${i}-wrapper ${i}-type-${c} ${pn}`.trim(),style:Oe,children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:nc(i)}}),l.jsxs("form",{onSubmit:De,className:`${i}-form`,children:[l.jsx("div",{className:`${i}-fields`,children:de.map((me,Ie)=>l.jsxs(p.Fragment,{children:[Ie>0&&l.jsx("div",{"data-controls":a?"fieldsGap":void 0,className:a?`${i}-control`:void 0,style:{height:E.scalingValue(v??0,t)}}),l.jsxs("div",{className:`${i}-field-group${ve?` ${i}-labeled`:""}`,children:[ve&&l.jsx("span",{className:`${i}-field-label`,style:He?{...He,lineHeight:He.fontSize}:void 0,children:me.label||me.name}),me.type==="textarea"?l.jsx("textarea",{name:me.name,autoComplete:"off",value:et[me.name]??"",onChange:Ve=>Ee(me.name,Ve.target.value),placeholder:me.placeholder,className:`${i}-input`,style:le,rows:1,"data-filled":Qe||(et[me.name]??"").trim().length>0,"data-field-type":"textarea"}):l.jsx("input",{type:me.type==="phone"?"tel":me.type==="email"?"email":"text",name:me.name,autoComplete:"off",value:et[me.name]??"",onChange:Ve=>Ee(me.name,Ve.target.value),placeholder:me.placeholder,required:me.isRequired??me.type==="email",className:`${i}-input`,style:le,"data-filled":Qe||(et[me.name]??"").trim().length>0})]})]},Ie))}),l.jsx("div",{"data-controls":a?"gap":void 0,className:a?`${i}-control`:void 0,style:{height:E.scalingValue(P??0,t)}}),l.jsx("div",{className:`${i}-overlay-anchor`,children:l.jsx("button",{type:"submit",className:`${i}-button`,style:{borderStyle:"solid",borderRadius:E.scalingValue(x??0,t),borderWidth:Ne,paddingTop:E.scalingValue((g==null?void 0:g.top)??0,t),paddingRight:E.scalingValue((g==null?void 0:g.right)??0,t),paddingBottom:E.scalingValue((g==null?void 0:g.bottom)??0,t),paddingLeft:E.scalingValue((g==null?void 0:g.left)??0,t),...Se,...T?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:l.jsx("span",{className:`${i}-overlay-anchor`,style:T?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:Tt==="submitting"?"...":u})})})]}),be==="success"&&l.jsx("p",{className:`${i}-success`,style:{...We},children:te}),be==="error"&&l.jsx("p",{className:`${i}-error`,style:{...We},role:"alert",children:Mt??Je??X})]})}const ic={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"},rc=["hover","focus","filled","success","error"],ac=`import React, { useMemo, useState } from 'react';
|
|
143
159
|
import { CommonComponentProps } from '../props';
|
|
144
160
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
145
161
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -285,6 +301,22 @@ function getCSS(P: string): string {
|
|
|
285
301
|
position: relative;
|
|
286
302
|
height: auto;
|
|
287
303
|
}
|
|
304
|
+
.\${P}-control {
|
|
305
|
+
position: relative;
|
|
306
|
+
z-index: 2;
|
|
307
|
+
width: 100%;
|
|
308
|
+
}
|
|
309
|
+
.\${P}-control::before {
|
|
310
|
+
content: "";
|
|
311
|
+
position: absolute;
|
|
312
|
+
top: 0;
|
|
313
|
+
left: 0;
|
|
314
|
+
width: 100%;
|
|
315
|
+
height: 100%;
|
|
316
|
+
min-height: 20px;
|
|
317
|
+
pointer-events: auto;
|
|
318
|
+
z-index: 10;
|
|
319
|
+
}
|
|
288
320
|
\`;
|
|
289
321
|
}
|
|
290
322
|
|
|
@@ -292,11 +324,13 @@ type FormProps = {
|
|
|
292
324
|
settings: FormSettings;
|
|
293
325
|
content?: unknown;
|
|
294
326
|
isEditor?: boolean;
|
|
327
|
+
isEditMode?: boolean;
|
|
295
328
|
activeEvent: string | undefined;
|
|
296
329
|
onUpdateSettings?: (settings: FormSettings) => void;
|
|
297
330
|
} & CommonComponentProps;
|
|
298
331
|
|
|
299
|
-
export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
332
|
+
export function Form({ settings, isEditor, isEditMode, metadata, activeEvent }: FormProps) {
|
|
333
|
+
const showControls = Boolean(isEditMode);
|
|
300
334
|
const { prefix: P } = useScopedStyles();
|
|
301
335
|
const {
|
|
302
336
|
type = 'A',
|
|
@@ -538,49 +572,59 @@ export function Form({ settings, isEditor, metadata, activeEvent }: FormProps) {
|
|
|
538
572
|
<form
|
|
539
573
|
onSubmit={handleSubmit}
|
|
540
574
|
className={\`\${P}-form\`}
|
|
541
|
-
style={{ gap: scalingValue(gap ?? 0, isEditor) }}
|
|
542
575
|
>
|
|
543
|
-
<div
|
|
544
|
-
className={\`\${P}-fields\`}
|
|
545
|
-
style={{ gap: scalingValue(fieldsGap ?? 0, isEditor) }}
|
|
546
|
-
>
|
|
576
|
+
<div className={\`\${P}-fields\`}>
|
|
547
577
|
{visibleFields.map((field, index) => (
|
|
548
|
-
<
|
|
549
|
-
{
|
|
550
|
-
<
|
|
551
|
-
{
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
{field.type === 'textarea' ? (
|
|
555
|
-
<textarea
|
|
556
|
-
name={field.name}
|
|
557
|
-
autoComplete="off"
|
|
558
|
-
value={displayValues[field.name] ?? ''}
|
|
559
|
-
onChange={(e) => handleFieldChange(field.name, e.target.value)}
|
|
560
|
-
placeholder={field.placeholder}
|
|
561
|
-
className={\`\${P}-input\`}
|
|
562
|
-
style={inputFieldCss}
|
|
563
|
-
rows={1}
|
|
564
|
-
data-filled={isFilledPreview || ((displayValues[field.name] ?? '') as string).trim().length > 0}
|
|
565
|
-
data-field-type="textarea"
|
|
566
|
-
/>
|
|
567
|
-
) : (
|
|
568
|
-
<input
|
|
569
|
-
type={field.type === 'phone' ? 'tel' : field.type === 'email' ? 'email' : 'text'}
|
|
570
|
-
name={field.name}
|
|
571
|
-
autoComplete="off"
|
|
572
|
-
value={displayValues[field.name] ?? ''}
|
|
573
|
-
onChange={(e) => handleFieldChange(field.name, e.target.value)}
|
|
574
|
-
placeholder={field.placeholder}
|
|
575
|
-
required={field.isRequired ?? field.type === 'email'}
|
|
576
|
-
className={\`\${P}-input\`}
|
|
577
|
-
style={inputFieldCss}
|
|
578
|
-
data-filled={isFilledPreview || ((displayValues[field.name] ?? '') as string).trim().length > 0}
|
|
578
|
+
<React.Fragment key={index}>
|
|
579
|
+
{index > 0 && (
|
|
580
|
+
<div
|
|
581
|
+
data-controls={showControls ? 'fieldsGap' : undefined}
|
|
582
|
+
className={showControls ? \`\${P}-control\` : undefined}
|
|
583
|
+
style={{ height: scalingValue(fieldsGap ?? 0, isEditor) }}
|
|
579
584
|
/>
|
|
580
585
|
)}
|
|
581
|
-
|
|
586
|
+
<div className={\`\${P}-field-group\${showLabels ? \` \${P}-labeled\` : ''}\`}>
|
|
587
|
+
{showLabels && (
|
|
588
|
+
<span className={\`\${P}-field-label\`} style={labelTextCss ? { ...labelTextCss, lineHeight: labelTextCss.fontSize } : undefined}>
|
|
589
|
+
{field.label || field.name}
|
|
590
|
+
</span>
|
|
591
|
+
)}
|
|
592
|
+
{field.type === 'textarea' ? (
|
|
593
|
+
<textarea
|
|
594
|
+
name={field.name}
|
|
595
|
+
autoComplete="off"
|
|
596
|
+
value={displayValues[field.name] ?? ''}
|
|
597
|
+
onChange={(e) => handleFieldChange(field.name, e.target.value)}
|
|
598
|
+
placeholder={field.placeholder}
|
|
599
|
+
className={\`\${P}-input\`}
|
|
600
|
+
style={inputFieldCss}
|
|
601
|
+
rows={1}
|
|
602
|
+
data-filled={isFilledPreview || ((displayValues[field.name] ?? '') as string).trim().length > 0}
|
|
603
|
+
data-field-type="textarea"
|
|
604
|
+
/>
|
|
605
|
+
) : (
|
|
606
|
+
<input
|
|
607
|
+
type={field.type === 'phone' ? 'tel' : field.type === 'email' ? 'email' : 'text'}
|
|
608
|
+
name={field.name}
|
|
609
|
+
autoComplete="off"
|
|
610
|
+
value={displayValues[field.name] ?? ''}
|
|
611
|
+
onChange={(e) => handleFieldChange(field.name, e.target.value)}
|
|
612
|
+
placeholder={field.placeholder}
|
|
613
|
+
required={field.isRequired ?? field.type === 'email'}
|
|
614
|
+
className={\`\${P}-input\`}
|
|
615
|
+
style={inputFieldCss}
|
|
616
|
+
data-filled={isFilledPreview || ((displayValues[field.name] ?? '') as string).trim().length > 0}
|
|
617
|
+
/>
|
|
618
|
+
)}
|
|
619
|
+
</div>
|
|
620
|
+
</React.Fragment>
|
|
582
621
|
))}
|
|
583
622
|
</div>
|
|
623
|
+
<div
|
|
624
|
+
data-controls={showControls ? 'gap' : undefined}
|
|
625
|
+
className={showControls ? \`\${P}-control\` : undefined}
|
|
626
|
+
style={{ height: scalingValue(gap ?? 0, isEditor) }}
|
|
627
|
+
/>
|
|
584
628
|
<div className={\`\${P}-overlay-anchor\`}>
|
|
585
629
|
<button
|
|
586
630
|
type="submit"
|
|
@@ -740,7 +784,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
740
784
|
};
|
|
741
785
|
|
|
742
786
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
743
|
-
`,ql=[{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."},{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"}],Rn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Gl=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Yl={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:{...Rn.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:{...Rn.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:{...Rn.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:{...Rn.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:ql,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:[{type:"group",title:"",items:["fieldsGap","inputCorners"]},{type:"group",title:"",items:["inputStroke","inputPadding"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["gap","buttonCorners"]},{type:"row",title:"",items:["buttonStroke","buttonPadding"]},{type:"row",title:"",items:["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:[...Gl],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"]},Xl={element:zl,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:Yl,sourceCode:Ul};function kn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Zl(e){return`
|
|
787
|
+
`,sc=[{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."},{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"}],jn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},lc=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],cc={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:{...jn.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:{...jn.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:{...jn.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:{...jn.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:sc,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:[...lc],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"]},dc={element:oc,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:cc,sourceCode:ac};function zn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function uc(e){return`
|
|
744
788
|
.${e}-wrapper {
|
|
745
789
|
display: flex;
|
|
746
790
|
flex-direction: column;
|
|
@@ -922,16 +966,16 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
922
966
|
align-items: center;
|
|
923
967
|
}
|
|
924
968
|
.${e}-success {
|
|
925
|
-
margin-top: ${
|
|
926
|
-
font-size: ${
|
|
969
|
+
margin-top: ${zn(8)};
|
|
970
|
+
font-size: ${zn(14)};
|
|
927
971
|
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
928
972
|
}
|
|
929
973
|
.${e}-error {
|
|
930
|
-
margin-top: ${
|
|
931
|
-
font-size: ${
|
|
974
|
+
margin-top: ${zn(8)};
|
|
975
|
+
font-size: ${zn(14)};
|
|
932
976
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
933
977
|
}
|
|
934
|
-
`}const
|
|
978
|
+
`}const pc=({settings:e,isEditor:t,metadata:n,activeEvent:o})=>{const{prefix:r}=E.useScopedStyles(),{fields:a=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:i,buttonLabel:c,fieldsToShow:s=1,fontFamily:d,inputFontSettings:u,inputFontSize:P,inputLineHeight:v,inputLetterSpacing:x,inputWordSpacing:h,inputTextAppearance:g,buttonFontSettings:T,buttonFontSize:L,buttonLineHeight:b,buttonLetterSpacing:m,buttonWordSpacing:H,buttonTextAppearance:F,statusFontSettings:_,statusFontSize:C,statusLineHeight:W,statusLetterSpacing:w,statusWordSpacing:O,statusTextAppearance:S,iconMaxWidth:V,minHeight:D,corners:Z,stroke:q,stateOverrides:$,inputPadding:k,buttonPadding:R,successMessage:B="Thanks for subscribing!",errorMessage:I="Please, fill all required fields."}=e,A=a.slice(0,Math.min(s,a.length)),[Q,ie]=p.useState(()=>Object.fromEntries(A.map(ye=>[ye.name,""]))),[re,U]=p.useState("idle"),[M,oe]=p.useState(null),Ce=o==="success"?"success":o==="error"?"error":re,ue=o==="error"?I:M,fe=o==="filled",Re=p.useMemo(()=>{if(!fe)return Q;let ye=null;for(const He of A)(Q[He.name]??"").trim().length>0||(ye=ye??{...Q},ye[He.name]="Filled");return ye??Q},[fe,Q,A]),ne=Ce==="error"?E.getFormFieldValidationError(A,Re):null,y=o&&o!=="default"?`${r}-state-${o}`:"",f=A.some(ye=>(Re[ye.name]??"").trim().length>0),N=y!==`${r}-state-filled`&&f?`${r}-state-filled`:"",K=`${y} ${N}`.trim(),G=n==null?void 0:n.submitUrl,ee=c??"",te=(i==null?void 0:i.icon)??"",X=(i==null?void 0:i.mode)==="On",ce=ee||"Submit",ve={fontSettings:{fontFamily:d,fontWeight:(u==null?void 0:u.fontWeight)??400,fontStyle:(u==null?void 0:u.fontStyle)??"normal"},fontSize:P??.01,lineHeight:v,letterSpacing:x??0,wordSpacing:h??0,textAppearance:g,color:e.inputTextColor??"#111111"},de={fontSettings:{fontFamily:d,fontWeight:(T==null?void 0:T.fontWeight)??400,fontStyle:(T==null?void 0:T.fontStyle)??"normal"},fontSize:L??.01,lineHeight:b,letterSpacing:m??0,wordSpacing:H??0,textAppearance:F,color:e.buttonTextColor??"#ffffff"},xe={fontSettings:{fontFamily:d,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:C??.01,lineHeight:W,letterSpacing:w??0,wordSpacing:O??0,textAppearance:S,color:e.successColor??"#22c55e"},z=mt(Ge(ve,t)),Y=mt(Ge(de,t)),j=mt(Ge(xe,t)),le=E.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(ve==null?void 0:ve.color)??"#111111",buttonTextColor:e.buttonTextColor??(de==null?void 0:de.color)??"#ffffff"},mc,gc,$),we={borderRadius:E.scalingValue(Z,t),borderWidth:E.scalingValue(q,t),borderStyle:"solid"},Se={borderLeftWidth:E.scalingValue(q,t)},Ne=async ye=>{ye.preventDefault();const He=Object.fromEntries(A.map(We=>{var Oe;return[We.name,((Oe=Q[We.name])==null?void 0:Oe.trim())??""]}).filter(([,We])=>We));if(!G){U("error"),oe("No integrations were found for this form.");return}if(Object.keys(He).length===0)return;const ke=E.getFormFieldValidationError(A,Q);if(ke){U("error"),oe(ke);return}U("submitting"),oe(null);try{const We=await fetch(G,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(He)});if(!We.ok){const Oe=await We.text();throw new Error(Oe||`Request failed: ${We.status}`)}U("success"),ie(Object.fromEntries(A.map(Oe=>[Oe.name,""])))}catch(We){U("error"),oe(We instanceof Error?We.message:"Something went wrong")}};return l.jsxs("div",{className:`${r}-wrapper ${K}`.trim(),style:le,children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:uc(r)}}),l.jsxs("form",{onSubmit:Ne,className:`${r}-form`,style:{...we,height:E.scalingValue(D,t),minHeight:E.scalingValue(D,t)},children:[l.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:A.map(ye=>l.jsx("input",{type:ye.type==="email"?"email":ye.type==="phone"?"tel":"text",name:ye.name,autoComplete:"off",value:Re[ye.name]??"",onChange:He=>ie(ke=>({...ke,[ye.name]:He.target.value})),placeholder:ye.placeholder,required:ye.isRequired??ye.type==="email",className:`${r}-input`,style:{...z,paddingRight:E.scalingValue(k.right,t),paddingLeft:E.scalingValue(k.left,t),paddingTop:E.scalingValue(k.top,t),paddingBottom:E.scalingValue(k.bottom,t)}},ye.name))}),l.jsx("div",{className:`${r}-overlayAnchor`,children:l.jsx("button",{type:"submit",className:`${r}-submitBtn`,"aria-label":ce,style:{...Y,...Se,paddingRight:E.scalingValue(R.right,t),paddingLeft:E.scalingValue(R.left,t),paddingTop:E.scalingValue(R.top,t),paddingBottom:E.scalingValue(R.bottom,t)},children:re==="submitting"?"...":X?te&&l.jsx(_t,{url:te,className:`${r}-submitBtnIcon`,style:{maxWidth:E.scalingValue(V??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):ee})})]}),Ce==="success"&&l.jsx("p",{className:`${r}-success`,style:{...j},children:B}),Ce==="error"&&l.jsx("p",{className:`${r}-error`,style:{...j},role:"alert",children:ne??ue??I})]})},mc={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"},gc=["hover","focus","filled","success","error"],hc=`import React, { useMemo, useState } from 'react';
|
|
935
979
|
import { CommonComponentProps } from '../props';
|
|
936
980
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
937
981
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1503,7 +1547,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1503
1547
|
};
|
|
1504
1548
|
|
|
1505
1549
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1506
|
-
`,nc="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>'),oc=[{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."}],yo={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ic=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],rc={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:{...yo.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:{...yo.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:{...yo.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:oc,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:nc},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:[...ic],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"]},ac={element:Jl,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:rc,sourceCode:tc};function Pi(e){return`
|
|
1550
|
+
`,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>'),yc=[{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."}],To={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},vc=["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:{...To.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:{...To.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:{...To.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:yc,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:[...vc],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"]},xc={element:pc,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:hc};function Ni(e){return`
|
|
1507
1551
|
.${e}-marquee-wrapper {
|
|
1508
1552
|
overflow: hidden;
|
|
1509
1553
|
width: 100%;
|
|
@@ -1616,6 +1660,13 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1616
1660
|
pointer-events: auto;
|
|
1617
1661
|
z-index: 10;
|
|
1618
1662
|
}
|
|
1663
|
+
|
|
1664
|
+
.${e}-gap-control {
|
|
1665
|
+
position: relative;
|
|
1666
|
+
z-index: 2;
|
|
1667
|
+
pointer-events: auto;
|
|
1668
|
+
height: 100%;
|
|
1669
|
+
}
|
|
1619
1670
|
.${e}-image-hover-brightness img {
|
|
1620
1671
|
transition: filter 0.3s ease;
|
|
1621
1672
|
}
|
|
@@ -1628,13 +1679,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1628
1679
|
.${e}-image-hover-grayscale:hover img {
|
|
1629
1680
|
filter: grayscale(100%);
|
|
1630
1681
|
}
|
|
1631
|
-
|
|
1632
|
-
transition: filter 0.3s ease;
|
|
1633
|
-
}
|
|
1634
|
-
.${e}-image-hover-saturate:hover img {
|
|
1635
|
-
filter: saturate(2);
|
|
1636
|
-
}
|
|
1637
|
-
`}const sc=30,vo=2,lc=2,cc=(e,t)=>Array.from({length:t},()=>e).flat(),dc=(e,t)=>{const n=t.getBoundingClientRect(),o=e.getBoundingClientRect();return o.right>n.left&&o.left<n.right},uc=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(o=>dc(o,e))},pc=({item:e,prefix:t,imageFit:n,imageMaxWidth:o,imageMaxHeight:i,imageHoverClass:l,isFirstSet:r,scaled:s,onFirstSetImageDone:c})=>{var h,f,m;const p=u.useRef(null);u.useLayoutEffect(()=>{if(!r)return;const g=p.current;g!=null&&g.complete&&(c==null||c())},[r,(h=e.image)==null?void 0:h.url,c]);const d=n==="cover",$=((f=e.image)==null?void 0:f.url)&&a.jsx("img",{ref:p,src:e.image.url,alt:((m=e.image)==null?void 0:m.name)??"",style:d?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:s(o),objectFit:"contain"},onLoad:r?c:void 0,onError:r?c:void 0});return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...d?{width:s(o)}:{width:"fit-content",maxWidth:s(o),minWidth:0}},children:a.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...d?{width:"100%",height:s(i),overflow:"hidden"}:{width:"fit-content",maxWidth:s(o),height:s(i)}},children:$&&e.link?a.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:ve(`${t}-marquee-link`,!d&&`${t}-marquee-link-contain`),children:$}):$})})},mc=({settings:e,content:t,isEditor:n,isPreviewMode:o})=>{const{prefix:i}=T.useScopedStyles(),{speed:l,direction:r,pauseOnHover:s,gap:c,imageMaxWidth:p,imageMaxHeight:d,imageFit:$,hoverEffect:h}=e,f=h==="off"||h==="randomize"?void 0:`${i}-image-hover-${h}`,m=!o,g=Math.max(0,l)*sc,C=Y=>T.scalingValue(Y,n??!1),y=u.useRef(null),x=u.useRef(null),P=u.useRef(null),[L,_]=u.useState(0),[E,v]=u.useState(0),w=m&&s==="on",[R,V]=u.useState(!1),[A,H]=u.useState({}),D=u.useRef(A);D.current=A;const j=u.useRef(null),U=u.useRef(0),S=u.useRef(null),N=u.useMemo(()=>(t??[]).map(Y=>{var X;return((X=Y.image)==null?void 0:X.url)??""}).join("\0"),[t]),[k,M]=u.useState(vo),W=u.useMemo(()=>{const Y=t??[];return!m||Y.length===0?Y:cc(Y,k)},[t,m,k]),B=u.useMemo(()=>W.filter(Y=>{var X;return!!((X=Y.image)!=null&&X.url)}).length,[W]),ee=u.useMemo(()=>!m||((t==null?void 0:t.length)??0)===0?1:lc,[m,t==null?void 0:t.length]);u.useLayoutEffect(()=>{U.current=0,H({}),j.current=null,M(vo),_(0)},[N]),u.useEffect(()=>{if(h!=="randomize")return;const Y=y.current;if(!Y)return;const X=F=>{H(b=>{let z=null;for(const q of F)q in b&&(uc(Y,q)||(z||(z={...b}),delete z[q]));return z??b})},ne=new IntersectionObserver(F=>{const b=new Set;for(const z of F){const q=z.target.dataset.marqueeItemIndex,Z=q!==void 0?Number(q):NaN;Number.isNaN(Z)||b.add(Z)}b.size>0&&X(b)},{root:Y,threshold:0});Object.keys(A).forEach(F=>{const b=Number(F);Y.querySelectorAll(`[data-marquee-item-index="${b}"]`).forEach(z=>ne.observe(z))});let I=0;const oe=()=>{const F=Object.keys(D.current);F.length!==0&&(X(F.map(Number)),I=requestAnimationFrame(oe))};return Object.keys(D.current).length>0&&(I=requestAnimationFrame(oe)),()=>{cancelAnimationFrame(I),ne.disconnect()}},[h,A]),u.useLayoutEffect(()=>{if(!m)return;const Y=y.current,X=P.current;if(!Y||!X)return;let ne=0;const I=()=>{const b=Y.getBoundingClientRect().width,z=X.getBoundingClientRect().width,q=j.current,Z=typeof q=="number"&&Math.abs(q-z)<=.25;if(j.current=z,z>0&&k>0){const se=z/k;if(se>0&&b>0){const le=Math.max(vo,Math.ceil(b/se)+1);if(le!==k){M(le);return}}}if(z>0&&L<=0){_(z);return}Z&&z!==L?_(z):!Z&&L<=0&&(cancelAnimationFrame(ne),ne=requestAnimationFrame(I))},oe=()=>{cancelAnimationFrame(ne),ne=requestAnimationFrame(I)};S.current=oe,oe();const F=new ResizeObserver(oe);return F.observe(Y),F.observe(X),()=>{S.current=null,cancelAnimationFrame(ne),F.disconnect()}},[m,L,N,k]),u.useLayoutEffect(()=>{const Y=x.current;if(!m||!Y)return;const X=L>0?L:0,ne=X>0&&g>0?X/g*1e3:0,I=`${Math.max(0,ne)/1e3}s`;Y.style.setProperty("--marquee-distance",`${X}px`),Y.style.setProperty("--marquee-duration",I)},[m,g,L]),u.useLayoutEffect(()=>{if(!m){v(0);return}if(L<=0){v(0);return}const Y=x.current;if(!Y)return;const X=()=>{const I=Y.getBoundingClientRect().height;v(I>0?I:0)};X();const ne=new ResizeObserver(X);return ne.observe(Y),()=>ne.disconnect()},[m,ee,W,n,c,p,d,L,$,A]);const de=()=>{w&&V(!0)},re=()=>{w&&V(!1)},me=u.useCallback(()=>{var Y;U.current=Math.min(B,U.current+1),(Y=S.current)==null||Y.call(S)},[B]),O=u.useCallback((Y,X)=>{H(ne=>{const I=ne[Y]??X,oe=(t??[]).filter(b=>b!==I);if(oe.length===0)return ne;const F=oe[Math.floor(Math.random()*oe.length)];return{...ne,[Y]:F}})},[t]),te=(Y,X,ne,I)=>{const oe=h==="randomize"&&$==="cover"?A[ne]??Y:Y;return a.jsxs("div",{className:`${i}-marquee-card`,"data-marquee-item-index":ne,onMouseEnter:h==="randomize"&&$==="cover"?()=>O(ne,Y):void 0,children:[a.jsx(pc,{item:oe,prefix:i,imageFit:$,imageMaxWidth:p,imageMaxHeight:d,imageHoverClass:f,isEditor:n,isFirstSet:I,scaled:C,onFirstSetImageDone:me}),n&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${C(c)})`,width:C(c),height:"100%",pointerEvents:"auto",zIndex:2}})]},`${X}-${ne}`)};return m&&((t==null?void 0:t.length)??0)>0?a.jsxs("div",{ref:y,className:ve(`${i}-wrapper`,`${i}-marquee-wrapper`),"aria-label":"Marquee",style:L>0&&E>0?{height:E}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Pi(i)}}),a.jsx("div",{ref:x,className:`${i}-marquee-track`,"data-direction":r,onMouseEnter:de,onMouseLeave:re,style:{...w?{"--marquee-play-state":R?"paused":"running"}:{"--marquee-play-state":"running"}},children:Array.from({length:ee},(Y,X)=>a.jsx("div",{ref:X===0?P:void 0,className:ve(`${i}-marquee-row`,`${i}-marquee-set`),style:{gap:C(c),paddingRight:C(c)},"aria-hidden":X>0,children:W.map((ne,I)=>te(ne,X,I,X===0))},`set-${X}`))},"marquee-track")]}):a.jsxs("div",{ref:y,className:`${i}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Pi(i)}}),a.jsx("div",{className:ve(`${i}-marquee-row`,`${i}-marquee-static`),style:{gap:C(c),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Y,X)=>te(Y,0,X))},"marquee-static")]})},gc=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
1682
|
+
`}const Cc=30,Sc=20,Lo=2,wc=2,$c=(e,t)=>Array.from({length:t},()=>e).flat(),Tc=(e,t)=>{const n=t.getBoundingClientRect(),o=e.getBoundingClientRect();return o.right>n.left&&o.left<n.right},Lc=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(o=>Tc(o,e))},Ec=({item:e,prefix:t,imageFit:n,imageMaxWidth:o,imageMaxHeight:r,imageHoverClass:a,isFirstSet:i,scaled:c,onFirstSetImageDone:s})=>{var C,W,w;const d=p.useRef(null);p.useLayoutEffect(()=>{if(!i)return;const O=d.current;O!=null&&O.complete&&(s==null||s())},[i,(C=e.image)==null?void 0:C.url,s]);const u=n.display==="Cover",P=n.ratioValue??"1:1",v=n.reversed??!1,[x,h]=P.split(":").map(Number),L=(v?h:x)/(v?x:h);let b=o,m=b/L;m>r&&(m=r,b=m*L);const H=c(b),F=c(m),_=((W=e.image)==null?void 0:W.url)&&l.jsx("img",{ref:d,src:e.image.url,alt:((w=e.image)==null?void 0:w.name)??"",style:u?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover"}:{pointerEvents:"auto",display:"block",height:"100%",width:"auto",maxWidth:c(o),objectFit:"contain"},onLoad:i?s:void 0,onError:i?s:void 0});return l.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...u?{width:H}:{width:"fit-content",maxWidth:c(o),minWidth:0}},children:l.jsx("div",{className:a,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...u?{width:H,height:F,overflow:"hidden"}:{width:"fit-content",maxWidth:c(o),height:c(r)}},children:_&&e.link?l.jsx("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:Te(`${t}-marquee-link`,!u&&`${t}-marquee-link-contain`),children:_}):_})})},Pc=({settings:e,content:t,isEditor:n,isPreviewMode:o,isEditMode:r})=>{const{prefix:a}=E.useScopedStyles(),{speed:i,direction:c,pauseOnHover:s,gap:d,imageMaxWidth:u,imageMaxHeight:P,imageFit:v,hoverEffect:x}=e,h=!!r,g=!n||!!o,T=g&&x!=="off"&&x!=="randomize"?`${a}-image-hover-${x}`:void 0,L=n?!!o:!0,m=((t==null?void 0:t.length)??0)>0&&(L||!!n),H=Math.max(0,i)*Cc,F=y=>E.scalingValue(y,n??!1),_=p.useRef(null),C=p.useRef(null),W=p.useRef(null),[w,O]=p.useState(0),[S,V]=p.useState(0),D=L&&s==="on",[Z,q]=p.useState(!1),[$,k]=p.useState({}),R=p.useRef($);R.current=$;const B=p.useRef(null),I=p.useRef(0),A=p.useRef(null),Q=p.useMemo(()=>(t??[]).map(y=>{var f;return((f=y.image)==null?void 0:f.url)??""}).join("\0"),[t]),[ie,re]=p.useState(Lo),U=p.useMemo(()=>{const y=t??[];return!L||y.length===0?y:$c(y,ie)},[t,L,ie]),M=p.useMemo(()=>U.filter(y=>{var f;return!!((f=y.image)!=null&&f.url)}).length,[U]),oe=m?wc:1;p.useLayoutEffect(()=>{I.current=0,k({}),B.current=null,re(Lo),O(0)},[Q]),p.useEffect(()=>{if(!g||x!=="randomize")return;const y=_.current;if(!y)return;const f=ee=>{k(te=>{let X=null;for(const ce of ee)ce in te&&(Lc(y,ce)||(X||(X={...te}),delete X[ce]));return X??te})},N=new IntersectionObserver(ee=>{const te=new Set;for(const X of ee){const ce=X.target.dataset.marqueeItemIndex,ve=ce!==void 0?Number(ce):NaN;Number.isNaN(ve)||te.add(ve)}te.size>0&&f(te)},{root:y,threshold:0});Object.keys($).forEach(ee=>{const te=Number(ee);y.querySelectorAll(`[data-marquee-item-index="${te}"]`).forEach(X=>N.observe(X))});let K=0;const G=()=>{const ee=Object.keys(R.current);ee.length!==0&&(f(ee.map(Number)),K=requestAnimationFrame(G))};return Object.keys(R.current).length>0&&(K=requestAnimationFrame(G)),()=>{cancelAnimationFrame(K),N.disconnect()}},[x,$,g]),p.useLayoutEffect(()=>{if(!m)return;const y=_.current,f=W.current;if(!y||!f)return;let N=0;const K=()=>{const te=y.getBoundingClientRect().width,X=f.getBoundingClientRect().width,ce=B.current,ve=typeof ce=="number"&&Math.abs(ce-X)<=.25;if(B.current=X,L&&X>0&&ie>0){const de=X/ie;if(de>0&&te>0){const xe=Math.max(Lo,Math.ceil(te/de)+1);if(xe!==ie){re(xe);return}}}if(X>0&&w<=0){O(X);return}ve&&X!==w?O(X):!ve&&w<=0&&(cancelAnimationFrame(N),N=requestAnimationFrame(K))},G=()=>{cancelAnimationFrame(N),N=requestAnimationFrame(K)};A.current=G,G();const ee=new ResizeObserver(G);return ee.observe(y),ee.observe(f),()=>{A.current=null,cancelAnimationFrame(N),ee.disconnect()}},[L,m,w,Q,ie]),p.useLayoutEffect(()=>{const y=C.current;if(!m||!y)return;const f=w>0?w:0,N=f>0&&H>0?f/H*1e3:0,K=`${Math.max(0,N)/1e3}s`;y.style.setProperty("--marquee-distance",`${f}px`),y.style.setProperty("--marquee-duration",K)},[L,m,H,w]),p.useLayoutEffect(()=>{if(!m){V(0);return}if(w<=0){V(0);return}const y=C.current;if(!y)return;const f=()=>{const K=y.getBoundingClientRect().height;V(K>0?K:0)};f();const N=new ResizeObserver(f);return N.observe(y),()=>N.disconnect()},[m,oe,U,n,d,u,P,w,v,$]);const Ce=()=>{D&&q(!0)},ue=()=>{D&&q(!1)},fe=p.useCallback(()=>{var y;I.current=Math.min(M,I.current+1),(y=A.current)==null||y.call(A)},[M]),Re=p.useCallback((y,f)=>{k(N=>{const K=N[y]??f,G=(t??[]).filter(te=>te!==K);if(G.length===0)return N;const ee=G[Math.floor(Math.random()*G.length)];return{...N,[y]:ee}})},[t]),ne=(y,f,N,K)=>{const G=g&&x==="randomize"&&v.display==="Cover"?$[N]??y:y,ee=`max(${F(d)}, ${Sc}px)`,te=`calc(-0.5 * (${ee} + ${F(d)}))`;return l.jsxs("div",{className:`${a}-marquee-card`,"data-marquee-item-index":N,onMouseEnter:g&&x==="randomize"&&v.display==="Cover"?()=>Re(N,y):void 0,children:[l.jsx(Ec,{item:G,prefix:a,imageFit:v,imageMaxWidth:u,imageMaxHeight:P,imageHoverClass:T,isEditor:n,isFirstSet:K,scaled:F,onFirstSetImageDone:fe}),h&&l.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${a}-gap-control`,style:{position:"absolute",top:0,right:te,width:ee,height:"100%"}})]},`${f}-${N}`)};if(m){const y=L?D&&Z?"paused":"running":"paused";return l.jsxs("div",{ref:_,className:Te(`${a}-wrapper`,`${a}-marquee-wrapper`),"aria-label":"Marquee",style:w>0&&S>0?{height:S}:void 0,children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:Ni(a)}}),l.jsx("div",{ref:C,className:`${a}-marquee-track`,"data-direction":c,onMouseEnter:Ce,onMouseLeave:ue,style:{"--marquee-play-state":y},children:Array.from({length:oe},(f,N)=>l.jsx("div",{ref:N===0?W:void 0,className:Te(`${a}-marquee-row`,`${a}-marquee-set`),style:{gap:F(d),paddingRight:F(d)},"aria-hidden":N>0,children:U.map((K,G)=>ne(K,N,G,N===0))},`set-${N}`))},"marquee-track")]})}return l.jsxs("div",{ref:_,className:`${a}-wrapper`,children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:Ni(a)}}),l.jsx("div",{className:Te(`${a}-marquee-row`,`${a}-marquee-static`),style:{gap:F(d),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((y,f)=>ne(y,0,f))},"marquee-static")]})},_c=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
1638
1683
|
import cn from 'classnames';
|
|
1639
1684
|
import { CommonComponentProps } from '../props';
|
|
1640
1685
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -1754,6 +1799,13 @@ function getCSS(P: string): string {
|
|
|
1754
1799
|
pointer-events: auto;
|
|
1755
1800
|
z-index: 10;
|
|
1756
1801
|
}
|
|
1802
|
+
|
|
1803
|
+
.\${P}-gap-control {
|
|
1804
|
+
position: relative;
|
|
1805
|
+
z-index: 2;
|
|
1806
|
+
pointer-events: auto;
|
|
1807
|
+
height: 100%;
|
|
1808
|
+
}
|
|
1757
1809
|
.\${P}-image-hover-brightness img {
|
|
1758
1810
|
transition: filter 0.3s ease;
|
|
1759
1811
|
}
|
|
@@ -1766,16 +1818,11 @@ function getCSS(P: string): string {
|
|
|
1766
1818
|
.\${P}-image-hover-grayscale:hover img {
|
|
1767
1819
|
filter: grayscale(100%);
|
|
1768
1820
|
}
|
|
1769
|
-
.\${P}-image-hover-saturate img {
|
|
1770
|
-
transition: filter 0.3s ease;
|
|
1771
|
-
}
|
|
1772
|
-
.\${P}-image-hover-saturate:hover img {
|
|
1773
|
-
filter: saturate(2);
|
|
1774
|
-
}
|
|
1775
1821
|
\`;
|
|
1776
1822
|
}
|
|
1777
1823
|
|
|
1778
1824
|
const PX_PER_SEC_PER_SPEED_UNIT = 30;
|
|
1825
|
+
const GAP_LABEL_AREA_PX = 20;
|
|
1779
1826
|
const MIN_CONTENT_SEQUENCE_REPEAT = 2;
|
|
1780
1827
|
const OUTER_SET_COPIES = 2;
|
|
1781
1828
|
|
|
@@ -1796,7 +1843,11 @@ const isAnyCopyOfSlotInView = (wrapper: Element, itemIndex: number): boolean =>
|
|
|
1796
1843
|
type MarqueeItemCardProps = {
|
|
1797
1844
|
item: MarqueeItem;
|
|
1798
1845
|
prefix: string;
|
|
1799
|
-
imageFit:
|
|
1846
|
+
imageFit: {
|
|
1847
|
+
display: 'Fit' | 'Cover';
|
|
1848
|
+
ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
|
|
1849
|
+
reversed: boolean;
|
|
1850
|
+
};
|
|
1800
1851
|
imageMaxWidth: number;
|
|
1801
1852
|
imageMaxHeight: number;
|
|
1802
1853
|
imageHoverClass?: string;
|
|
@@ -1825,7 +1876,22 @@ const MarqueeItemCard = ({
|
|
|
1825
1876
|
if (el?.complete) onFirstSetImageDone?.();
|
|
1826
1877
|
}, [isFirstSet, item.image?.url, onFirstSetImageDone]);
|
|
1827
1878
|
|
|
1828
|
-
const isCover = imageFit === '
|
|
1879
|
+
const isCover = imageFit.display === 'Cover';
|
|
1880
|
+
const ratioValue = imageFit.ratioValue ?? '1:1';
|
|
1881
|
+
const ratioReversed = imageFit.reversed ?? false;
|
|
1882
|
+
const [rW, rH] = ratioValue.split(':').map(Number);
|
|
1883
|
+
const effW = ratioReversed ? rH : rW;
|
|
1884
|
+
const effH = ratioReversed ? rW : rH;
|
|
1885
|
+
const ratio = effW / effH;
|
|
1886
|
+
let coverWidth = imageMaxWidth;
|
|
1887
|
+
let coverHeight = coverWidth / ratio;
|
|
1888
|
+
if (coverHeight > imageMaxHeight) {
|
|
1889
|
+
coverHeight = imageMaxHeight;
|
|
1890
|
+
coverWidth = coverHeight * ratio;
|
|
1891
|
+
}
|
|
1892
|
+
const coverWidthScaled = scaled(coverWidth);
|
|
1893
|
+
const coverHeightScaled = scaled(coverHeight);
|
|
1894
|
+
|
|
1829
1895
|
const imageNode =
|
|
1830
1896
|
item.image?.url &&
|
|
1831
1897
|
(
|
|
@@ -1862,7 +1928,7 @@ const MarqueeItemCard = ({
|
|
|
1862
1928
|
flexDirection: 'column',
|
|
1863
1929
|
alignItems: 'start',
|
|
1864
1930
|
...(isCover
|
|
1865
|
-
? { width:
|
|
1931
|
+
? { width: coverWidthScaled }
|
|
1866
1932
|
: { width: 'fit-content', maxWidth: scaled(imageMaxWidth), minWidth: 0 }),
|
|
1867
1933
|
}}
|
|
1868
1934
|
>
|
|
@@ -1875,7 +1941,7 @@ const MarqueeItemCard = ({
|
|
|
1875
1941
|
alignItems: 'center',
|
|
1876
1942
|
flexShrink: 0,
|
|
1877
1943
|
...(isCover
|
|
1878
|
-
? { width:
|
|
1944
|
+
? { width: coverWidthScaled, height: coverHeightScaled, overflow: 'hidden'}
|
|
1879
1945
|
: {
|
|
1880
1946
|
width: 'fit-content',
|
|
1881
1947
|
maxWidth: scaled(imageMaxWidth),
|
|
@@ -1901,11 +1967,15 @@ const MarqueeItemCard = ({
|
|
|
1901
1967
|
);
|
|
1902
1968
|
};
|
|
1903
1969
|
|
|
1904
|
-
export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeProps) => {
|
|
1970
|
+
export const Marquee = ({ settings, content, isEditor, isPreviewMode, isEditMode }: MarqueeProps) => {
|
|
1905
1971
|
const { prefix: P } = useScopedStyles();
|
|
1906
1972
|
const { speed, direction, pauseOnHover, gap, imageMaxWidth, imageMaxHeight, imageFit, hoverEffect } = settings;
|
|
1907
|
-
const
|
|
1908
|
-
const
|
|
1973
|
+
const showControls = Boolean(isEditMode);
|
|
1974
|
+
const showHoverEffects = !isEditor || Boolean(isPreviewMode);
|
|
1975
|
+
const imageHoverClass = showHoverEffects && hoverEffect !== 'off' && hoverEffect !== 'randomize' ? \`\${P}-image-hover-\${hoverEffect}\` : undefined;
|
|
1976
|
+
const autoplayEnabled = isEditor ? Boolean(isPreviewMode) : true;
|
|
1977
|
+
const hasContent = (content?.length ?? 0) > 0;
|
|
1978
|
+
const useMarqueeTrack = hasContent && (autoplayEnabled || Boolean(isEditor));
|
|
1909
1979
|
const pxPerSec = Math.max(0, speed) * PX_PER_SEC_PER_SPEED_UNIT;
|
|
1910
1980
|
const scaled = (v: number) => scalingValue(v, isEditor ?? false);
|
|
1911
1981
|
const wrapperRef = useRef<HTMLDivElement | null>(null);
|
|
@@ -1932,10 +2002,7 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1932
2002
|
() => setContent.filter((i) => Boolean(i.image?.url)).length,
|
|
1933
2003
|
[setContent],
|
|
1934
2004
|
);
|
|
1935
|
-
const copies =
|
|
1936
|
-
if (!autoplayEnabled || (content?.length ?? 0) === 0) return 1;
|
|
1937
|
-
return OUTER_SET_COPIES;
|
|
1938
|
-
}, [autoplayEnabled, content?.length]);
|
|
2005
|
+
const copies = useMarqueeTrack ? OUTER_SET_COPIES : 1;
|
|
1939
2006
|
|
|
1940
2007
|
useLayoutEffect(() => {
|
|
1941
2008
|
loadedFirstSetImagesRef.current = 0;
|
|
@@ -1946,7 +2013,7 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1946
2013
|
}, [contentImageUrlsKey]);
|
|
1947
2014
|
|
|
1948
2015
|
useEffect(() => {
|
|
1949
|
-
if (hoverEffect !== 'randomize') return;
|
|
2016
|
+
if (!showHoverEffects || hoverEffect !== 'randomize') return;
|
|
1950
2017
|
const wrapper = wrapperRef.current;
|
|
1951
2018
|
if (!wrapper) return;
|
|
1952
2019
|
|
|
@@ -1995,10 +2062,10 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
1995
2062
|
cancelAnimationFrame(raf);
|
|
1996
2063
|
observer.disconnect();
|
|
1997
2064
|
};
|
|
1998
|
-
}, [hoverEffect, swappedSlots]);
|
|
2065
|
+
}, [hoverEffect, swappedSlots, showHoverEffects]);
|
|
1999
2066
|
|
|
2000
2067
|
useLayoutEffect(() => {
|
|
2001
|
-
if (!
|
|
2068
|
+
if (!useMarqueeTrack) return;
|
|
2002
2069
|
const wrapper = wrapperRef.current;
|
|
2003
2070
|
const set = setRef.current;
|
|
2004
2071
|
if (!wrapper || !set) return;
|
|
@@ -2011,7 +2078,7 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
2011
2078
|
typeof prevCandidate === 'number' &&
|
|
2012
2079
|
Math.abs(prevCandidate - nextRawSetWidth) <= 0.25;
|
|
2013
2080
|
stableCandidateRef.current = nextRawSetWidth;
|
|
2014
|
-
if (nextRawSetWidth > 0 && contentSequenceRepeat > 0) {
|
|
2081
|
+
if (autoplayEnabled && nextRawSetWidth > 0 && contentSequenceRepeat > 0) {
|
|
2015
2082
|
const singleCycleWidth = nextRawSetWidth / contentSequenceRepeat;
|
|
2016
2083
|
if (singleCycleWidth > 0 && nextContainerWidth > 0) {
|
|
2017
2084
|
const targetRepeat = Math.max(
|
|
@@ -2049,20 +2116,20 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
2049
2116
|
cancelAnimationFrame(raf);
|
|
2050
2117
|
ro.disconnect();
|
|
2051
2118
|
};
|
|
2052
|
-
}, [autoplayEnabled, setWidth, contentImageUrlsKey, contentSequenceRepeat]);
|
|
2119
|
+
}, [autoplayEnabled, useMarqueeTrack, setWidth, contentImageUrlsKey, contentSequenceRepeat]);
|
|
2053
2120
|
|
|
2054
2121
|
useLayoutEffect(() => {
|
|
2055
2122
|
const track = trackRef.current;
|
|
2056
|
-
if (!
|
|
2123
|
+
if (!useMarqueeTrack || !track) return;
|
|
2057
2124
|
const safeSetWidth = setWidth > 0 ? setWidth : 0;
|
|
2058
2125
|
const durationMs = safeSetWidth > 0 && pxPerSec > 0 ? (safeSetWidth / pxPerSec) * 1000 : 0;
|
|
2059
2126
|
const durationS = \`\${Math.max(0, durationMs) / 1000}s\`;
|
|
2060
2127
|
track.style.setProperty('--marquee-distance', \`\${safeSetWidth}px\`);
|
|
2061
2128
|
track.style.setProperty('--marquee-duration', durationS);
|
|
2062
|
-
}, [autoplayEnabled, pxPerSec, setWidth]);
|
|
2129
|
+
}, [autoplayEnabled, useMarqueeTrack, pxPerSec, setWidth]);
|
|
2063
2130
|
|
|
2064
2131
|
useLayoutEffect(() => {
|
|
2065
|
-
if (!
|
|
2132
|
+
if (!useMarqueeTrack) {
|
|
2066
2133
|
setTrackHeight(0);
|
|
2067
2134
|
return;
|
|
2068
2135
|
}
|
|
@@ -2080,7 +2147,7 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
2080
2147
|
const ro = new ResizeObserver(measure);
|
|
2081
2148
|
ro.observe(track);
|
|
2082
2149
|
return () => ro.disconnect();
|
|
2083
|
-
}, [
|
|
2150
|
+
}, [useMarqueeTrack, copies, setContent, isEditor, gap, imageMaxWidth, imageMaxHeight, setWidth, imageFit, swappedSlots]);
|
|
2084
2151
|
|
|
2085
2152
|
const onTrackEnter = () => {
|
|
2086
2153
|
if (!hoverPauseEnabled) return;
|
|
@@ -2110,13 +2177,15 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
2110
2177
|
}, [content]);
|
|
2111
2178
|
|
|
2112
2179
|
const renderCardWrapper = (item: MarqueeItem, copyIndex: number, slotIndex: number, isFirstSet?: boolean) => {
|
|
2113
|
-
const displayItem = hoverEffect === 'randomize' && imageFit === '
|
|
2180
|
+
const displayItem = showHoverEffects && hoverEffect === 'randomize' && imageFit.display === 'Cover' ? (swappedSlots[slotIndex] ?? item) : item;
|
|
2181
|
+
const gapLabelSize = \`max(\${scaled(gap)}, \${GAP_LABEL_AREA_PX}px)\`;
|
|
2182
|
+
const gapControlRight = \`calc(-0.5 * (\${gapLabelSize} + \${scaled(gap)}))\`;
|
|
2114
2183
|
return (
|
|
2115
2184
|
<div
|
|
2116
2185
|
key={\`\${copyIndex}-\${slotIndex}\`}
|
|
2117
2186
|
className={\`\${P}-marquee-card\`}
|
|
2118
2187
|
data-marquee-item-index={slotIndex}
|
|
2119
|
-
onMouseEnter={hoverEffect === 'randomize' && imageFit === '
|
|
2188
|
+
onMouseEnter={showHoverEffects && hoverEffect === 'randomize' && imageFit.display === 'Cover' ? () => handleRandomizeEnter(slotIndex, item) : undefined}
|
|
2120
2189
|
>
|
|
2121
2190
|
<MarqueeItemCard
|
|
2122
2191
|
item={displayItem}
|
|
@@ -2130,18 +2199,17 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
2130
2199
|
scaled={scaled}
|
|
2131
2200
|
onFirstSetImageDone={onFirstSetImageDone}
|
|
2132
2201
|
/>
|
|
2133
|
-
{
|
|
2202
|
+
{showControls && (
|
|
2134
2203
|
<div
|
|
2135
2204
|
data-controls="gap"
|
|
2136
2205
|
data-controls-axis="x"
|
|
2206
|
+
className={\`\${P}-gap-control\`}
|
|
2137
2207
|
style={{
|
|
2138
2208
|
position: 'absolute',
|
|
2139
2209
|
top: 0,
|
|
2140
|
-
right:
|
|
2141
|
-
width:
|
|
2210
|
+
right: gapControlRight,
|
|
2211
|
+
width: gapLabelSize,
|
|
2142
2212
|
height: '100%',
|
|
2143
|
-
pointerEvents: 'auto',
|
|
2144
|
-
zIndex: 2,
|
|
2145
2213
|
}}
|
|
2146
2214
|
/>
|
|
2147
2215
|
)}
|
|
@@ -2149,7 +2217,13 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
2149
2217
|
);
|
|
2150
2218
|
};
|
|
2151
2219
|
|
|
2152
|
-
if (
|
|
2220
|
+
if (useMarqueeTrack) {
|
|
2221
|
+
const marqueePlayState = !autoplayEnabled
|
|
2222
|
+
? 'paused'
|
|
2223
|
+
: hoverPauseEnabled
|
|
2224
|
+
? (isHovering ? 'paused' : 'running')
|
|
2225
|
+
: 'running';
|
|
2226
|
+
|
|
2153
2227
|
return (
|
|
2154
2228
|
<div
|
|
2155
2229
|
ref={wrapperRef}
|
|
@@ -2165,11 +2239,7 @@ export const Marquee = ({ settings, content, isEditor, isPreviewMode }: MarqueeP
|
|
|
2165
2239
|
data-direction={direction}
|
|
2166
2240
|
onMouseEnter={onTrackEnter}
|
|
2167
2241
|
onMouseLeave={onTrackLeave}
|
|
2168
|
-
style={{
|
|
2169
|
-
...(hoverPauseEnabled
|
|
2170
|
-
? ({ '--marquee-play-state': isHovering ? 'paused' : 'running' } as React.CSSProperties)
|
|
2171
|
-
: ({ '--marquee-play-state': 'running' } as React.CSSProperties)),
|
|
2172
|
-
}}
|
|
2242
|
+
style={{ '--marquee-play-state': marqueePlayState } as React.CSSProperties}
|
|
2173
2243
|
>
|
|
2174
2244
|
{Array.from({ length: copies }, (_, copyIndex) => (
|
|
2175
2245
|
<div
|
|
@@ -2221,11 +2291,15 @@ export type MarqueeSettings = {
|
|
|
2221
2291
|
speed: number;
|
|
2222
2292
|
direction: 'left' | 'right';
|
|
2223
2293
|
pauseOnHover: 'on' | 'off';
|
|
2224
|
-
hoverEffect: 'off' | 'brightness' | 'grayscale' | '
|
|
2294
|
+
hoverEffect: 'off' | 'brightness' | 'grayscale' | 'randomize';
|
|
2225
2295
|
gap: number;
|
|
2226
2296
|
imageMaxWidth: number;
|
|
2227
2297
|
imageMaxHeight: number;
|
|
2228
|
-
imageFit:
|
|
2298
|
+
imageFit: {
|
|
2299
|
+
display: 'Fit' | 'Cover';
|
|
2300
|
+
ratioValue: '1:1' | '2:3' | '3:4' | '4:5' | '16:9';
|
|
2301
|
+
reversed: boolean;
|
|
2302
|
+
};
|
|
2229
2303
|
};
|
|
2230
2304
|
|
|
2231
2305
|
type MarqueeProps = {
|
|
@@ -2233,8 +2307,9 @@ type MarqueeProps = {
|
|
|
2233
2307
|
content?: MarqueeItem[];
|
|
2234
2308
|
isEditor?: boolean;
|
|
2235
2309
|
isPreviewMode?: boolean;
|
|
2310
|
+
isEditMode?: boolean;
|
|
2236
2311
|
} & CommonComponentProps;
|
|
2237
|
-
`,
|
|
2312
|
+
`,Ac={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:.5,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:""}]}},Rc={element:Pc,id:"marquee",name:"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:Ac,sourceCode:_c,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function Hi(e){return`
|
|
2238
2313
|
.${e}-marquee-wrapper {
|
|
2239
2314
|
overflow: hidden;
|
|
2240
2315
|
width: 100%;
|
|
@@ -2321,7 +2396,7 @@ type MarqueeProps = {
|
|
|
2321
2396
|
pointer-events: auto;
|
|
2322
2397
|
z-index: 10;
|
|
2323
2398
|
}
|
|
2324
|
-
`}const
|
|
2399
|
+
`}const Wc=30,Bi=2,Ic=({settings:e,content:t,isEditor:n,isPreviewMode:o,isEditMode:r})=>{const{prefix:a}=E.useScopedStyles(),{autoplay:i,align:c,speed:s,direction:d,pauseOnHover:u,gap:P,cardWidth:v,corners:x,stroke:h,strokeColor:g,bgColor:T,padding:L,logoMarginTop:b,logoWidth:m,logoHeight:H,captionMarginTop:F}=e,_=!!r,C=((t==null?void 0:t.length)??0)>0,W=i==="on"&&(!n||!!o),w=C&&(W||!!n),O=Math.max(0,s)*Wc,S=z=>E.scalingValue(z,n??!1),V=p.useRef(null),D=p.useRef(null),Z=p.useRef(null),[q,$]=p.useState(0),[k,R]=p.useState(0),[B,I]=p.useState(0),A=W&&u==="on",[Q,ie]=p.useState(!1),re=p.useRef(null),[U,M]=p.useState(0),[oe,Ce]=p.useState(0),ue=p.useRef(null),fe=z=>{var j,le,we,Se,Ne;return{fontSettings:{fontFamily:(e==null?void 0:e[`${z}FontFamily`])??"Arial",fontWeight:((j=e==null?void 0:e[`${z}FontSettings`])==null?void 0:j.fontWeight)??400,fontStyle:((le=e==null?void 0:e[`${z}FontSettings`])==null?void 0:le.fontStyle)??"normal"},textAppearance:{textTransform:((we=e==null?void 0:e[`${z}TextAppearance`])==null?void 0:we.textTransform)??"none",textDecoration:((Se=e==null?void 0:e[`${z}TextAppearance`])==null?void 0:Se.textDecoration)??"none",fontVariant:((Ne=e==null?void 0:e[`${z}TextAppearance`])==null?void 0:Ne.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"}},Re=fe("text"),ne=fe("caption"),y=p.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(z=>{var Y,j;return(((Y=z.text)==null?void 0:Y.length)??0)>0||(((j=z.caption)==null?void 0:j.length)??0)>0}),[t]),f=p.useMemo(()=>!w||(t==null?void 0:t.length)===0?1:k<=0||q<=0?Bi:Math.max(Bi,Math.ceil(q/k)+1),[w,t==null?void 0:t.length,k,q]);p.useLayoutEffect(()=>{if(!w)return;const z=V.current,Y=Z.current;if(!z||!Y)return;let j=0;const le=()=>{const Ne=z.getBoundingClientRect().width,ye=Y.getBoundingClientRect().width,He=ue.current,ke=typeof He=="number"&&Math.abs(He-ye)<=.25;if(ue.current=ye,$(Ne),typeof ye=="number"&&ye>0&&k<=0){R(ye);return}ke&&ye!==k?R(ye):!ke&&k<=0&&(cancelAnimationFrame(j),j=requestAnimationFrame(le))},we=()=>{cancelAnimationFrame(j),j=requestAnimationFrame(le)};we();const Se=new ResizeObserver(we);return Se.observe(z),Se.observe(Y),()=>{cancelAnimationFrame(j),Se.disconnect()}},[W,w,k]),p.useLayoutEffect(()=>{const z=D.current;if(!w||!z)return;const Y=k>0?k:0,j=Y>0&&O>0?Y/O*1e3:0,le=`${Math.max(0,j)/1e3}s`;z.style.setProperty("--marquee-distance",`${Y}px`),z.style.setProperty("--marquee-duration",le)},[W,w,O,k]),p.useLayoutEffect(()=>{if(!w){I(0);return}const z=Z.current,Y=D.current;if(!z||!Y)return;const j=()=>{let we=0;for(let Se=0;Se<z.children.length;Se++){const ye=z.children[Se].firstElementChild;ye&&(we=Math.max(we,ye.offsetHeight))}we<=0&&(we=Y.offsetHeight),I(we>0?we:0)};j();const le=new ResizeObserver(j);return le.observe(z),le.observe(Y),()=>{le.disconnect()}},[w,f,t,n,P,v,L,h,x,m,H,U,oe]);const N=()=>{A&&ie(!0)},K=()=>{A&&ie(!1)},G=p.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),ee=p.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]),te=p.useCallback((z,Y,j,le)=>l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:G,width:"100%"},children:[l.jsx("div",{"data-controls":_?le==null?void 0:le.controlsName:void 0,"data-controls-axis":_?"y":void 0,className:_?`${a}-control`:void 0,style:{height:S((le==null?void 0:le.marginTop)??0)}}),l.jsx("div",{...le!=null&&le.dataMeasureKind?{"data-testimonial-measure":le.dataMeasureKind}:{},style:{...Ge(z,n),textAlign:ee,pointerEvents:"auto",...typeof(le==null?void 0:le.minHeightPx)=="number"&&le.minHeightPx>0?{minHeight:le.minHeightPx}:{}},children:l.jsx(wn,{content:Y})})]},j),[G,ee,n,_,a,S]),X=p.useCallback((z,Y,j)=>{var le,we,Se;return l.jsxs("div",{style:{padding:`${S(L.top)} ${S(L.right)} ${S(L.bottom)} ${S(L.left)}`,width:S(v+h*2),height:"100%",borderRadius:S(x),border:`${S(h)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[l.jsx("div",{className:`${a}-cover`,style:{background:T}}),l.jsxs("div",{className:`${a}-elements-overlay`,style:{alignItems:G,textAlign:ee},children:[z.text&&te(Re,z.text,"text",j!=null&&j.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(j==null?void 0:j.textMinHeightPx)=="number"&&j.textMinHeightPx>0?{minHeightPx:j.textMinHeightPx}:void 0),l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:G,width:"100%"},children:[l.jsx("div",{"data-controls":_&&!(j!=null&&j.dataMeasureAttrs)?"logoMarginTop":void 0,className:_&&!(j!=null&&j.dataMeasureAttrs)?`${a}-control`:void 0,style:{height:S(b)}}),l.jsx("div",{style:{width:S(m),height:S(H)},children:((le=z.logo)==null?void 0:le.url)&&l.jsx("img",{src:z.logo.url,alt:((we=z.logo)==null?void 0:we.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Se=z.logo)==null?void 0:Se.objectFit)||"contain"}})})]}),z.caption&&te(ne,z.caption,"caption",{...j!=null&&j.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:F,...j!=null&&j.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(j==null?void 0:j.captionMinHeightPx)=="number"&&j.captionMinHeightPx>0?{minHeightPx:j.captionMinHeightPx}:{}})]})]},Y)},[T,F,ne,v,x,H,b,m,G,ee,L.bottom,L.left,L.right,L.top,te,h,g,Re,n,_,a]),ce=p.useCallback(z=>{M(z.maxTextPx),Ce(z.maxCaptionPx)},[]);p.useLayoutEffect(()=>{if(!y){ce({maxTextPx:0,maxCaptionPx:0});return}const z=re.current;if(!z)return;const Y=()=>{E.readTestimonialTextMeasure(z,ce)};Y();const j=new ResizeObserver(Y);return j.observe(z),()=>{j.disconnect()}},[y,ce,t,X]);const ve=y?{textMinHeightPx:U,captionMinHeightPx:oe}:void 0,de=y?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,Y)=>X(z,`measure-${Y}`,{dataMeasureAttrs:!0}))}):null,xe=(z,Y)=>l.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[X(z,`card-${Y}`,ve),_&&l.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${S(P)})`,width:S(P),height:"100%",pointerEvents:"auto",zIndex:2}})]},Y);if(w){const z=W?A&&Q?"paused":"running":"paused";return l.jsxs("div",{ref:V,className:Te(`${a}-wrapper`,`${a}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...B>0?{height:B}:{}},children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:Hi(a)}}),de,l.jsx("div",{ref:D,className:`${a}-marquee-track`,"data-direction":d,onMouseEnter:N,onMouseLeave:K,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:f},(Y,j)=>l.jsx("div",{ref:j===0?Z:void 0,className:`${a}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:S(P),paddingRight:S(P)},"aria-hidden":j>0,children:t==null?void 0:t.map((le,we)=>xe(le,`${j}-${we}`))},`set-${j}`))})]})}return l.jsxs("div",{className:`${a}-wrapper`,children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:Hi(a)}}),de,l.jsx("div",{style:{gap:S(P),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((z,Y)=>xe(z,Y))})]})},kc=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2325
2400
|
import cn from 'classnames';
|
|
2326
2401
|
import { CommonComponentProps } from '../props';
|
|
2327
2402
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -2426,9 +2501,11 @@ type TestimonialsProps = {
|
|
|
2426
2501
|
content?: TestimonialsItem[];
|
|
2427
2502
|
isEditor?: boolean;
|
|
2428
2503
|
isPreviewMode?: boolean;
|
|
2504
|
+
isEditMode?: boolean;
|
|
2429
2505
|
} & CommonComponentProps;
|
|
2430
2506
|
|
|
2431
2507
|
const PX_PER_SEC_PER_SPEED_UNIT = 30;
|
|
2508
|
+
const MIN_TRACK_COPIES = 2;
|
|
2432
2509
|
|
|
2433
2510
|
type RenderCardOpts = {
|
|
2434
2511
|
textMinHeightPx?: number;
|
|
@@ -2443,11 +2520,13 @@ type RenderTextOpts = {
|
|
|
2443
2520
|
dataMeasureKind?: 'text' | 'caption';
|
|
2444
2521
|
};
|
|
2445
2522
|
|
|
2446
|
-
export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }: TestimonialsProps) => {
|
|
2523
|
+
export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode, isEditMode }: TestimonialsProps) => {
|
|
2447
2524
|
const { prefix: P } = useScopedStyles();
|
|
2448
2525
|
const { autoplay, align, speed, direction, pauseOnHover, gap, cardWidth, corners, stroke, strokeColor, bgColor, padding, logoMarginTop, logoWidth, logoHeight, captionMarginTop } = settings;
|
|
2449
|
-
const
|
|
2450
|
-
const
|
|
2526
|
+
const showControls = Boolean(isEditMode);
|
|
2527
|
+
const hasContent = (content?.length ?? 0) > 0;
|
|
2528
|
+
const autoplayEnabled = autoplay === 'on' && (!isEditor || Boolean(isPreviewMode));
|
|
2529
|
+
const useMarqueeTrack = hasContent && (autoplayEnabled || Boolean(isEditor));
|
|
2451
2530
|
const pxPerSec = Math.max(0, speed) * PX_PER_SEC_PER_SPEED_UNIT;
|
|
2452
2531
|
const scaled = (v: number) => scalingValue(v, isEditor ?? false);
|
|
2453
2532
|
const wrapperRef = useRef<HTMLDivElement | null>(null);
|
|
@@ -2456,7 +2535,7 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
2456
2535
|
const [containerWidth, setContainerWidth] = useState(0);
|
|
2457
2536
|
const [setWidth, setSetWidth] = useState(0);
|
|
2458
2537
|
const [trackHeight, setTrackHeight] = useState(0);
|
|
2459
|
-
const hoverPauseEnabled =
|
|
2538
|
+
const hoverPauseEnabled = autoplayEnabled && pauseOnHover === 'on';
|
|
2460
2539
|
const [isHovering, setIsHovering] = useState(false);
|
|
2461
2540
|
const measureLayerRef = useRef<HTMLDivElement>(null);
|
|
2462
2541
|
const [measuredTextMinPx, setMeasuredTextMinPx] = useState(0);
|
|
@@ -2494,13 +2573,13 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
2494
2573
|
);
|
|
2495
2574
|
|
|
2496
2575
|
const copies = useMemo(() => {
|
|
2497
|
-
if (!
|
|
2498
|
-
if (setWidth <= 0 || containerWidth <= 0) return
|
|
2499
|
-
return Math.max(
|
|
2500
|
-
}, [
|
|
2576
|
+
if (!useMarqueeTrack || content?.length === 0) return 1;
|
|
2577
|
+
if (setWidth <= 0 || containerWidth <= 0) return MIN_TRACK_COPIES;
|
|
2578
|
+
return Math.max(MIN_TRACK_COPIES, Math.ceil(containerWidth / setWidth) + 1);
|
|
2579
|
+
}, [useMarqueeTrack, content?.length, setWidth, containerWidth]);
|
|
2501
2580
|
|
|
2502
2581
|
useLayoutEffect(() => {
|
|
2503
|
-
if (!
|
|
2582
|
+
if (!useMarqueeTrack) return;
|
|
2504
2583
|
const wrapper = wrapperRef.current;
|
|
2505
2584
|
const set = setRef.current;
|
|
2506
2585
|
if (!wrapper || !set) return;
|
|
@@ -2535,20 +2614,20 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
2535
2614
|
cancelAnimationFrame(raf);
|
|
2536
2615
|
ro.disconnect();
|
|
2537
2616
|
};
|
|
2538
|
-
}, [autoplayEnabled, setWidth]);
|
|
2617
|
+
}, [autoplayEnabled, useMarqueeTrack, setWidth]);
|
|
2539
2618
|
|
|
2540
2619
|
useLayoutEffect(() => {
|
|
2541
2620
|
const track = trackRef.current;
|
|
2542
|
-
if (!
|
|
2621
|
+
if (!useMarqueeTrack || !track) return;
|
|
2543
2622
|
const safeSetWidth = setWidth > 0 ? setWidth : 0;
|
|
2544
2623
|
const durationMs = safeSetWidth > 0 && pxPerSec > 0 ? (safeSetWidth / pxPerSec) * 1000 : 0;
|
|
2545
2624
|
const durationS = \`\${Math.max(0, durationMs) / 1000}s\`;
|
|
2546
2625
|
track.style.setProperty('--marquee-distance', \`\${safeSetWidth}px\`);
|
|
2547
2626
|
track.style.setProperty('--marquee-duration', durationS);
|
|
2548
|
-
}, [autoplayEnabled,
|
|
2627
|
+
}, [autoplayEnabled, useMarqueeTrack, pxPerSec, setWidth]);
|
|
2549
2628
|
|
|
2550
2629
|
useLayoutEffect(() => {
|
|
2551
|
-
if (!
|
|
2630
|
+
if (!useMarqueeTrack) {
|
|
2552
2631
|
setTrackHeight(0);
|
|
2553
2632
|
return;
|
|
2554
2633
|
}
|
|
@@ -2574,7 +2653,7 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
2574
2653
|
return () => {
|
|
2575
2654
|
ro.disconnect();
|
|
2576
2655
|
};
|
|
2577
|
-
}, [
|
|
2656
|
+
}, [useMarqueeTrack, copies, content, isEditor, gap, cardWidth, padding, stroke, corners, logoWidth, logoHeight, measuredTextMinPx, measuredCaptionMinPx]);
|
|
2578
2657
|
|
|
2579
2658
|
const onTrackEnter = () => {
|
|
2580
2659
|
if (!hoverPauseEnabled) return;
|
|
@@ -2621,9 +2700,9 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
2621
2700
|
}}
|
|
2622
2701
|
>
|
|
2623
2702
|
<div
|
|
2624
|
-
data-controls={options?.controlsName}
|
|
2625
|
-
data-controls-axis=
|
|
2626
|
-
className={\`\${P}-control\`}
|
|
2703
|
+
data-controls={showControls ? options?.controlsName : undefined}
|
|
2704
|
+
data-controls-axis={showControls ? 'y' : undefined}
|
|
2705
|
+
className={showControls ? \`\${P}-control\` : undefined}
|
|
2627
2706
|
style={{ height: scaled(options?.marginTop ?? 0) }}
|
|
2628
2707
|
/>
|
|
2629
2708
|
<div
|
|
@@ -2641,7 +2720,7 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
2641
2720
|
</div>
|
|
2642
2721
|
</div>
|
|
2643
2722
|
),
|
|
2644
|
-
[overlayAlignItems, overlayTextAlign, isEditor]
|
|
2723
|
+
[overlayAlignItems, overlayTextAlign, isEditor, showControls, P, scaled]
|
|
2645
2724
|
);
|
|
2646
2725
|
|
|
2647
2726
|
const renderCard = useCallback(
|
|
@@ -2683,9 +2762,9 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
2683
2762
|
}}
|
|
2684
2763
|
>
|
|
2685
2764
|
<div
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2765
|
+
data-controls={showControls && !opts?.dataMeasureAttrs ? 'logoMarginTop' : undefined}
|
|
2766
|
+
className={showControls && !opts?.dataMeasureAttrs ? \`\${P}-control\` : undefined}
|
|
2767
|
+
style={{ height: scaled(logoMarginTop) }}
|
|
2689
2768
|
/>
|
|
2690
2769
|
<div style={{ width: scaled(logoWidth), height: scaled(logoHeight) }}>
|
|
2691
2770
|
{item.logo?.url && (
|
|
@@ -2699,7 +2778,7 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
2699
2778
|
</div>
|
|
2700
2779
|
{item.caption &&
|
|
2701
2780
|
renderText(captionStyle, item.caption, 'caption', {
|
|
2702
|
-
controlsName: 'captionMarginTop',
|
|
2781
|
+
...(opts?.dataMeasureAttrs ? {} : { controlsName: 'captionMarginTop' }),
|
|
2703
2782
|
marginTop: captionMarginTop,
|
|
2704
2783
|
...(opts?.dataMeasureAttrs
|
|
2705
2784
|
? { dataMeasureKind: 'caption' as const }
|
|
@@ -2730,6 +2809,8 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
2730
2809
|
strokeColor,
|
|
2731
2810
|
textStyle,
|
|
2732
2811
|
isEditor,
|
|
2812
|
+
showControls,
|
|
2813
|
+
P,
|
|
2733
2814
|
]
|
|
2734
2815
|
);
|
|
2735
2816
|
|
|
@@ -2792,7 +2873,7 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
2792
2873
|
}}
|
|
2793
2874
|
>
|
|
2794
2875
|
{renderCard(item, \`card-\${key}\`, visibleCardOpts)}
|
|
2795
|
-
{
|
|
2876
|
+
{showControls && (
|
|
2796
2877
|
<div
|
|
2797
2878
|
data-controls="gap"
|
|
2798
2879
|
data-controls-axis="x"
|
|
@@ -2810,7 +2891,13 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
2810
2891
|
</div>
|
|
2811
2892
|
);
|
|
2812
2893
|
|
|
2813
|
-
if (
|
|
2894
|
+
if (useMarqueeTrack) {
|
|
2895
|
+
const marqueePlayState = !autoplayEnabled
|
|
2896
|
+
? 'paused'
|
|
2897
|
+
: hoverPauseEnabled
|
|
2898
|
+
? (isHovering ? 'paused' : 'running')
|
|
2899
|
+
: 'running';
|
|
2900
|
+
|
|
2814
2901
|
return (
|
|
2815
2902
|
<div
|
|
2816
2903
|
ref={wrapperRef}
|
|
@@ -2841,9 +2928,7 @@ export const TestimonialGrid = ({ settings, content, isEditor, isPreviewMode }:
|
|
|
2841
2928
|
transform: 'translateZ(0)',
|
|
2842
2929
|
WebkitTransform: 'translateZ(0)',
|
|
2843
2930
|
perspective: '1000px',
|
|
2844
|
-
...(
|
|
2845
|
-
? ({ '--marquee-play-state': isHovering ? 'paused' : 'running' } as React.CSSProperties)
|
|
2846
|
-
: ({ '--marquee-play-state': 'running' } as React.CSSProperties)),
|
|
2931
|
+
...( { '--marquee-play-state': marqueePlayState } as React.CSSProperties),
|
|
2847
2932
|
}}
|
|
2848
2933
|
>
|
|
2849
2934
|
{Array.from({ length: copies }, (_, copyIndex) => (
|
|
@@ -2927,7 +3012,7 @@ type TestimonialsSettings = {
|
|
|
2927
3012
|
logoHeight: number;
|
|
2928
3013
|
captionMarginTop: number;
|
|
2929
3014
|
};
|
|
2930
|
-
`,
|
|
3015
|
+
`,Oi={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Fc={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:.5,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:{...Oi.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:{...Oi.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:{autoplay:"on",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__","autoplay","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__","autoplay"]},{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:[{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"}]}]}]}},Mc={element:Ic,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:Fc,sourceCode:kc,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function Nc(e){return`
|
|
2931
3016
|
.${e}-container {
|
|
2932
3017
|
position: relative;
|
|
2933
3018
|
overflow-x: clip;
|
|
@@ -3051,7 +3136,7 @@ type TestimonialsSettings = {
|
|
|
3051
3136
|
width: 100%;
|
|
3052
3137
|
height: 100%;
|
|
3053
3138
|
}
|
|
3054
|
-
`}const
|
|
3139
|
+
`}const Hc=({settings:e,content:t,isEditor:n,isPreviewMode:o,isEditMode:r})=>{const{prefix:a}=E.useScopedStyles(),i=t||[],{autoplay:c,delay:s,align:d,width:u,imageMarginTop:P,textMarginTop:v,captionMarginTop:x,imageWidth:h,imageHeight:g,controlsWidth:T,controlsColor:L,controlsHoverColor:b}=e,m=c==="on"&&o,[H,F]=p.useState(0),[_,C]=p.useState(null),[W,w]=p.useState(!1),O=p.useRef(null),S=p.useMemo(()=>{switch(d){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[d]),V=p.useMemo(()=>{switch(d){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[d]);p.useEffect(()=>{F(0),C(null),w(!1)},[i.length]);const D=i[H],Z=_===null?null:i[_],q=ne=>{var f,N,K,G,ee;return{fontSettings:{fontFamily:(e==null?void 0:e[`${ne}FontFamily`])??"Arial",fontWeight:((f=e==null?void 0:e[`${ne}FontSettings`])==null?void 0:f.fontWeight)??400,fontStyle:((N=e==null?void 0:e[`${ne}FontSettings`])==null?void 0:N.fontStyle)??"normal"},textAppearance:{textTransform:((K=e==null?void 0:e[`${ne}TextAppearance`])==null?void 0:K.textTransform)??"none",textDecoration:((G=e==null?void 0:e[`${ne}TextAppearance`])==null?void 0:G.textDecoration)??"none",fontVariant:((ee=e==null?void 0:e[`${ne}TextAppearance`])==null?void 0:ee.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"}},$=q("text"),k=q("caption"),R=i.length>1&&i.some(ne=>{var y,f;return(((y=ne.text)==null?void 0:y.length)??0)>0||(((f=ne.caption)==null?void 0:f.length)??0)>0}),B=p.useRef(null),[I,A]=p.useState(0),[Q,ie]=p.useState(0),re=e.controls??{mode:"Off",icon:null},U=i.length>1,M=p.useCallback((ne,y)=>!U||y===ne?ne:(O.current&&window.clearTimeout(O.current),C(ne),w(!0),O.current=window.setTimeout(()=>{C(null),w(!1),O.current=null},300),y),[U]),oe=p.useCallback(()=>{U&&F(ne=>M(ne,(ne-1+i.length)%i.length))},[U,M,i.length]),Ce=p.useCallback(()=>{U&&F(ne=>M(ne,(ne+1)%i.length))},[U,M,i.length]);p.useEffect(()=>{if(!m||!U)return;const ne=Math.max(300,Number.isFinite(s*1e3)?s*1e3:0),y=window.setInterval(()=>{F(f=>M(f,(f+1)%i.length))},ne);return()=>{window.clearInterval(y)}},[m,U,M,i.length,s]),p.useEffect(()=>()=>{O.current&&window.clearTimeout(O.current)},[]);const ue=(ne,y)=>{var ee,te,X,ce;const f=y==null?void 0:y.textMinHeightPx,N=y==null?void 0:y.captionMinHeightPx,K=y==null?void 0:y.dataMeasureAttrs,G=r&&!(y!=null&&y.dataMeasureAttrs)&&!(y!=null&&y.hideControls);return l.jsxs(l.Fragment,{children:[ne.text&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:S,width:"100%"},children:[l.jsx("div",{"data-controls":G?"textMarginTop":void 0,className:G?`${a}-control`:void 0,style:{height:E.scalingValue(v??0,n??!1)}}),l.jsx("div",{...K&&{"data-testimonial-measure":"text"},style:{...Ge($,n),...f&&f>0?{minHeight:f}:{},textAlign:V,pointerEvents:"auto"},children:l.jsx(wn,{content:ne.text})})]}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:S,width:"100%"},children:[l.jsx("div",{"data-controls":G?"imageMarginTop":void 0,className:G?`${a}-control`:void 0,style:{height:E.scalingValue(P??0,n??!1)}}),l.jsx("div",{style:{width:E.scalingValue(h??0,n??!1),height:E.scalingValue(g??0,n??!1)},children:((ee=ne.image)==null?void 0:ee.url)&&l.jsx("img",{src:(te=ne.image)==null?void 0:te.url,alt:((X=ne.image)==null?void 0:X.name)??"",className:`${a}-icon`,style:{objectFit:((ce=ne.image)==null?void 0:ce.objectFit)||"contain"}})})]}),ne.caption&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:S,width:"100%"},children:[l.jsx("div",{"data-controls":G?"captionMarginTop":void 0,className:G?`${a}-control`:void 0,style:{height:E.scalingValue(x??0,n??!1)}}),l.jsx("div",{...K?{"data-testimonial-measure":"caption"}:{},style:{...Ge(k,n),...N&&N>0?{minHeight:N}:{},textAlign:V,pointerEvents:"auto"},children:l.jsx(wn,{content:ne.caption})})]})]})},fe=p.useCallback(ne=>{A(ne.maxTextPx),ie(ne.maxCaptionPx)},[]);if(p.useLayoutEffect(()=>{if(!R){fe({maxTextPx:0,maxCaptionPx:0});return}const ne=B.current;if(!ne)return;const y=()=>{E.readTestimonialTextMeasure(ne,fe)};y();const f=new ResizeObserver(y);return f.observe(ne),()=>{f.disconnect()}},[R,fe,t]),!D)return l.jsx(l.Fragment,{});const Re=R?{textMinHeightPx:I,captionMinHeightPx:Q}:void 0;return l.jsx(l.Fragment,{children:l.jsxs("div",{className:`${a}-container`,children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:Nc(a)}}),l.jsxs("div",{className:`${a}-wrapper`,style:{width:E.scalingValue(u??0,n??!1),alignItems:S},children:[R&&l.jsx("div",{ref:B,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:i.map((ne,y)=>l.jsx("div",{style:{width:"100%"},children:ue(ne,{dataMeasureAttrs:!0})},y))}),l.jsxs("div",{className:`${a}-fade-stack`,children:[Z&&W&&l.jsx("div",{className:Te(`${a}-fade-item-prev`,`${a}-fade-out`),children:ue(Z,{...Re,hideControls:!0})}),l.jsx("div",{className:Te(`${a}-fade-item-current`,W?`${a}-fade-in`:void 0),children:ue(D,Re)})]})]}),re.mode==="On"&&l.jsxs("div",{className:`${a}-controls`,children:[l.jsx("div",{className:`${a}-arrow`,style:{width:E.scalingValue(T??.02,n??!1),height:E.scalingValue(T??.02,n??!1),"--arrow-hover-color":b},children:l.jsx("button",{type:"button",className:`${a}-arrow-inner`,onClick:oe,disabled:!U,"aria-label":"Previous testimonial",children:re.icon&&l.jsx(_t,{url:re.icon,fill:L,hoverFill:b,className:Te(`${a}-arrow-img`,`${a}-mirror`)})})}),l.jsx("div",{className:Te(`${a}-arrow`,`${a}-next-arrow`),style:{width:E.scalingValue(T??.02,n??!1),height:E.scalingValue(T??.02,n??!1),"--arrow-hover-color":b},children:l.jsx("button",{type:"button",className:`${a}-arrow-inner`,onClick:Ce,disabled:!U,"aria-label":"Next testimonial",children:re.icon&&l.jsx(_t,{url:re.icon,fill:L,hoverFill:b,className:`${a}-arrow-img`})})})]})]})})},Bc=`import cn from 'classnames';
|
|
3055
3140
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3056
3141
|
import { CommonComponentProps } from '../props';
|
|
3057
3142
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3194,19 +3279,21 @@ type TestimonialsProps = {
|
|
|
3194
3279
|
content?: TestimonialsItem[];
|
|
3195
3280
|
isEditor?: boolean;
|
|
3196
3281
|
isPreviewMode?: boolean;
|
|
3282
|
+
isEditMode?: boolean;
|
|
3197
3283
|
} & CommonComponentProps;
|
|
3198
3284
|
|
|
3199
3285
|
type RenderItemContentOpts = {
|
|
3200
3286
|
textMinHeightPx?: number;
|
|
3201
3287
|
captionMinHeightPx?: number;
|
|
3202
3288
|
dataMeasureAttrs?: boolean;
|
|
3289
|
+
hideControls?: boolean;
|
|
3203
3290
|
};
|
|
3204
3291
|
|
|
3205
|
-
export const TestimonialSingle = ({ settings, content, isEditor, isPreviewMode }: TestimonialsProps) => {
|
|
3292
|
+
export const TestimonialSingle = ({ settings, content, isEditor, isPreviewMode, isEditMode }: TestimonialsProps) => {
|
|
3206
3293
|
const { prefix: P } = useScopedStyles();
|
|
3207
3294
|
const items = content || [];
|
|
3208
3295
|
const { autoplay, delay, align, width, imageMarginTop, textMarginTop, captionMarginTop, imageWidth, imageHeight, controlsWidth, controlsColor, controlsHoverColor } = settings;
|
|
3209
|
-
const isAnimating = autoplay === 'on' &&
|
|
3296
|
+
const isAnimating = autoplay === 'on' && isPreviewMode;
|
|
3210
3297
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
3211
3298
|
const [prevIndex, setPrevIndex] = useState<number | null>(null);
|
|
3212
3299
|
const [isFading, setIsFading] = useState(false);
|
|
@@ -3321,14 +3408,15 @@ export const TestimonialSingle = ({ settings, content, isEditor, isPreviewMode }
|
|
|
3321
3408
|
const textMinHeightPx = opts?.textMinHeightPx;
|
|
3322
3409
|
const captionMinHeightPx = opts?.captionMinHeightPx;
|
|
3323
3410
|
const dataMeasureAttrs = opts?.dataMeasureAttrs;
|
|
3411
|
+
const showMarginControls = isEditMode && !opts?.dataMeasureAttrs && !opts?.hideControls;
|
|
3324
3412
|
|
|
3325
3413
|
return (
|
|
3326
3414
|
<>
|
|
3327
3415
|
{item.text && (
|
|
3328
3416
|
<div style={{ display: 'flex', flexDirection: 'column', alignItems: overlayAlignItems, width: '100%' }}>
|
|
3329
3417
|
<div
|
|
3330
|
-
data-controls=
|
|
3331
|
-
className={\`\${P}-control\`}
|
|
3418
|
+
data-controls={showMarginControls ? 'textMarginTop' : undefined}
|
|
3419
|
+
className={showMarginControls ? \`\${P}-control\` : undefined}
|
|
3332
3420
|
style={{ height: scalingValue(textMarginTop ?? 0, isEditor ?? false) }}
|
|
3333
3421
|
/>
|
|
3334
3422
|
<div
|
|
@@ -3346,8 +3434,8 @@ export const TestimonialSingle = ({ settings, content, isEditor, isPreviewMode }
|
|
|
3346
3434
|
)}
|
|
3347
3435
|
<div style={{ display: 'flex', flexDirection: 'column', alignItems: overlayAlignItems, width: '100%' }}>
|
|
3348
3436
|
<div
|
|
3349
|
-
data-controls=
|
|
3350
|
-
className={\`\${P}-control\`}
|
|
3437
|
+
data-controls={showMarginControls ? 'imageMarginTop' : undefined}
|
|
3438
|
+
className={showMarginControls ? \`\${P}-control\` : undefined}
|
|
3351
3439
|
style={{ height: scalingValue(imageMarginTop ?? 0, isEditor ?? false) }}
|
|
3352
3440
|
/>
|
|
3353
3441
|
<div style={{ width: scalingValue(imageWidth ?? 0, isEditor ?? false), height: scalingValue(imageHeight ?? 0, isEditor ?? false)}}>
|
|
@@ -3364,8 +3452,8 @@ export const TestimonialSingle = ({ settings, content, isEditor, isPreviewMode }
|
|
|
3364
3452
|
{item.caption && (
|
|
3365
3453
|
<div style={{ display: 'flex', flexDirection: 'column', alignItems: overlayAlignItems, width: '100%' }}>
|
|
3366
3454
|
<div
|
|
3367
|
-
data-controls=
|
|
3368
|
-
className={\`\${P}-control\`}
|
|
3455
|
+
data-controls={showMarginControls ? 'captionMarginTop' : undefined}
|
|
3456
|
+
className={showMarginControls ? \`\${P}-control\` : undefined}
|
|
3369
3457
|
style={{ height: scalingValue(captionMarginTop ?? 0, isEditor ?? false) }}
|
|
3370
3458
|
/>
|
|
3371
3459
|
<div
|
|
@@ -3447,7 +3535,7 @@ export const TestimonialSingle = ({ settings, content, isEditor, isPreviewMode }
|
|
|
3447
3535
|
<div className={\`\${P}-fade-stack\`}>
|
|
3448
3536
|
{previousItem && isFading && (
|
|
3449
3537
|
<div className={cn(\`\${P}-fade-item-prev\`, \`\${P}-fade-out\`)}>
|
|
3450
|
-
{renderItemContent(previousItem, visibleContentOpts)}
|
|
3538
|
+
{renderItemContent(previousItem, { ...visibleContentOpts, hideControls: true })}
|
|
3451
3539
|
</div>
|
|
3452
3540
|
)}
|
|
3453
3541
|
<div className={cn(\`\${P}-fade-item-current\`, isFading ? \`\${P}-fade-in\` : undefined)}>
|
|
@@ -3543,11 +3631,11 @@ type TestimonialsSettings = {
|
|
|
3543
3631
|
icon?: string | null;
|
|
3544
3632
|
};
|
|
3545
3633
|
};
|
|
3546
|
-
`,
|
|
3634
|
+
`,Oc="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>'),Vi={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Vc={type:"object",version:1,settings:{sizing:"auto manual",properties:{autoplay:{type:"string",scope:"common",title:"Autoplay",display:{type:"switch-control"},enum:["on","off"]},delay:{type:"number",scope:"layout",title:"Delay(s)",display:{type:"percentage-input"},step:1,min:1,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:{...Vi.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:{...Vi.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:{autoplay:"on",controls:{mode:"On",icon:Oc},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:{delay:3,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},d:{delay:3,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},displayRules:[{if:{name:"autoplay",value:"off"},then:{name:"properties.delay.display.enabled",value:!1}}],layout:["__componentName__","autoplay","delay","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","autoplay"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","delay"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{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"}]}]}]}},Dc={element:Hc,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:Vc,sourceCode:Bc,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"styles.text.fontSettings"},{path:"styles.caption.fontSettings"}]}};function jc(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function zc(e){return`
|
|
3547
3635
|
.${e}-wrapper {
|
|
3548
3636
|
display: grid;
|
|
3549
3637
|
align-items: start;
|
|
3550
|
-
min-height: ${
|
|
3638
|
+
min-height: ${jc(48)};
|
|
3551
3639
|
}
|
|
3552
3640
|
.${e}-item {
|
|
3553
3641
|
display: flex;
|
|
@@ -3613,6 +3701,10 @@ type TestimonialsSettings = {
|
|
|
3613
3701
|
margin-top: 0px;
|
|
3614
3702
|
color: var(--${e}-subtitle-color);
|
|
3615
3703
|
}
|
|
3704
|
+
.${e}-lightbox-counter {
|
|
3705
|
+
margin: 0;
|
|
3706
|
+
color: var(--${e}-lightbox-counter-color);
|
|
3707
|
+
}
|
|
3616
3708
|
|
|
3617
3709
|
.${e}-control {
|
|
3618
3710
|
position: relative;
|
|
@@ -3631,14 +3723,13 @@ type TestimonialsSettings = {
|
|
|
3631
3723
|
pointer-events: auto;
|
|
3632
3724
|
z-index: 10;
|
|
3633
3725
|
}
|
|
3634
|
-
`}const
|
|
3726
|
+
`}const Et=500,Bt="cubic-bezier(0.22, 1, 0.36, 1)";function Kc({images:e,index:t,imageDisplay:n,originRect:o,reverseClose:r,onClose:a,onPrev:i,onNext:c,counterClassName:s,counterStyle:d}){const u=p.useRef(null),P=p.useRef(null),[v,x]=p.useState(null),[h,g]=p.useState(o?"opening":"open"),[T,L]=p.useState(!0),b=p.useRef(t),m=p.useCallback(()=>{const w=u.current,O=P.current;if(!w||!O)return;const S=w.getBoundingClientRect(),V=S.width,D=S.height,Z=O.naturalWidth,q=O.naturalHeight;if(!V||!D||!Z||!q)return;if(n==="Cover"){x({width:V,height:D,left:S.left,top:S.top});return}const $=Z/q,k=V/D;if($>k){const R=V/$;x({width:V,height:R,left:S.left,top:S.top+(D-R)/2})}else{const R=D*$;x({width:R,height:D,left:S.left+(V-R)/2,top:S.top})}},[n]);p.useEffect(()=>{m();const w=u.current;if(!w)return;const O=new ResizeObserver(()=>m());return O.observe(w),()=>O.disconnect()},[m,t]),p.useEffect(()=>{if(h!=="opening"||!v)return;const w={id:0};return w.id=requestAnimationFrame(()=>{w.id=requestAnimationFrame(()=>g("open"))}),()=>cancelAnimationFrame(w.id)},[h,v]),p.useEffect(()=>{if(h!=="closing")return;const w=setTimeout(()=>a(),Et);return()=>clearTimeout(w)},[h,a]),p.useEffect(()=>{b.current!==t&&L(!1),b.current=t},[t]);const H=()=>{h!=="closing"&&g("closing")},F=h==="open",_=h==="closing",C=_&&r&&!!o,W=h==="opening"?o??v:C?o:v;return l.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:9997},onClick:H,children:[l.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:F?1:0,transition:`opacity ${Et}ms ${Bt}`,pointerEvents:"none"}}),l.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},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:u,style:{width:"100%",height:"100%"}})}),l.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:F?1:0,transition:`opacity ${Et}ms ${Bt}`},children:e.length>1&&l.jsxs("p",{className:s,style:d,children:[t+1," / ",e.length]})})]}),W&&l.jsx("img",{ref:P,src:e[t],onLoad:m,style:{position:"fixed",top:W.top,left:W.left,width:W.width,height:W.height,objectFit:n==="Cover"?"cover":"contain",opacity:_&&!C?0:1,transition:_&&!C?`opacity ${Et}ms ${Bt}`:C||T?`top ${Et}ms ${Bt}, left ${Et}ms ${Bt}, width ${Et}ms ${Bt}, height ${Et}ms ${Bt}`:"none",pointerEvents:"none",zIndex:9998}}),F&&v&&l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{position:"fixed",top:v.top,left:v.left,width:v.width/2,height:v.height,cursor:"w-resize",zIndex:9999},onClick:w=>{w.stopPropagation(),i()}}),l.jsx("div",{style:{position:"fixed",top:v.top,left:v.left+v.width/2,width:v.width/2,height:v.height,cursor:"e-resize",zIndex:9999},onClick:w=>{w.stopPropagation(),c()}})]})]})}function qc({settings:e,content:t,isEditor:n,isPreviewMode:o,isEditMode:r,metadata:a,activeEvent:i,layoutId:c}){const{prefix:s}=E.useScopedStyles(),d=!!r,{type:u="A",gridLayout:P,textBoxWidth:v,verticalGap:x,entriesCount:h,lightbox:g,imageDisplay:T,slider:L,sliderTiming:b,direction:m,transition:H,titleMarginTop:F,subtitleMarginTop:_,titleColor:C,subtitleColor:W,lightboxCounterColor:w,titleFontFamily:O,titleFontSettings:S,titleFontSize:V,titleLineHeight:D,titleLetterSpacing:Z,titleWordSpacing:q,titleTextAppearance:$,subtitleFontFamily:k,subtitleFontSettings:R,subtitleFontSize:B,subtitleLineHeight:I,subtitleLetterSpacing:A,subtitleWordSpacing:Q,subtitleTextAppearance:ie,lightboxCounterFontFamily:re,lightboxCounterFontSettings:U,lightboxCounterFontSize:M,lightboxCounterLineHeight:oe,lightboxCounterLetterSpacing:Ce,lightboxCounterWordSpacing:ue,lightboxCounterTextAppearance:fe}=e,Re={fontSettings:{fontFamily:O,fontWeight:(S==null?void 0:S.fontWeight)??400,fontStyle:(S==null?void 0:S.fontStyle)??"normal"},fontSize:V??.01,lineHeight:D,letterSpacing:Z??0,wordSpacing:q??0,textAppearance:$,color:C},y={...mt(Ge(Re,n))},f={fontSettings:{fontFamily:k,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:B??.01,lineHeight:I,letterSpacing:A??0,wordSpacing:Q??0,textAppearance:ie,color:W},K={...mt(Ge(f,n))},G={fontSettings:{fontFamily:re,fontWeight:(U==null?void 0:U.fontWeight)??400,fontStyle:(U==null?void 0:U.fontStyle)??"normal"},fontSize:M??.01,lineHeight:oe,letterSpacing:Ce??0,wordSpacing:ue??0,textAppearance:fe,color:w},te={...mt(Ge(G,n))},X=E.buildColorVars(s,{titleColor:C,subtitleColor:W,lightboxCounterColor:w},Uc,Gc),ve=`${i&&i!=="default"?`${s}-state-${i}`:""}`.trim(),de=h===0?1/0:h,xe=(t??[]).slice(0,de),z=P.entryWidth??.2,Y=(T==null?void 0:T.display)==="Cover",j=(T==null?void 0:T.ratioValue)??"1:1",le=(T==null?void 0:T.reversed)??!1,[we,Se]=j.split(":").map(Number),Ne=le?Se:we,ye=le?we:Se,He=`${Ne} / ${ye}`,ke=Ne>=ye,We={objectFit:Y?"cover":"contain",...Y&&{aspectRatio:He,width:ke?"100%":"auto",height:ke?"auto":"100%"}},[Oe,Ye]=p.useState("ltr"),[ct,Tt]=p.useState(0),Ze=p.useRef(null);p.useEffect(()=>{const Ee=Ze.current;if(!Ee)return;const De=new ResizeObserver(me=>{Tt(Math.round(me[0].contentRect.width))});return De.observe(Ee),()=>De.disconnect()},[]);const qt=(()=>{const Ee={...X},De=Ze.current?getComputedStyle(Ze.current).getPropertyValue("--cntrl-article-width").trim():"";return De&&(Ee["--cntrl-article-width"]=De),Ee})(),[dt,be]=p.useState(!1),[Je,Qe]=p.useState([]),[et,Mt]=p.useState(0),[Fn,pn]=p.useState(null),Nt=(Ee,De,me)=>{if(n&&!o||g==="Off")return;const Ie=Ee.currentTarget.getBoundingClientRect();pn({top:Ie.top,left:Ie.left,width:Ie.width,height:Ie.height}),Qe(De),Mt(me),be(!0)};return p.useEffect(()=>{if(!dt||g!=="On"||typeof document>"u")return;const Ee=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ee}},[dt,g]),l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:zc(s)}}),l.jsx("div",{style:X,children:l.jsx("div",{ref:Ze,className:`${s}-wrapper ${s}-type-${u} ${ve}`.trim(),style:{gridTemplateColumns:`repeat(${P.columnsCount}, minmax(0, 1fr))`,rowGap:E.scalingValue(x??0,n),columnGap:E.scalingValue(P.horizontalGap??0,n),width:E.scalingValue(P.wrapperWidth??0,n)},children:xe.map((Ee,De)=>{var me,Ie;return l.jsx("div",{className:`${s}-item`.trim(),children:l.jsx("div",{className:r?`${s}-item-inner`:`${s}-item-inner-hidden`,style:{width:(v??0)>100?`calc(${E.scalingValue(z??0,n)} * (${v} / 100))`:E.scalingValue(z??0,n)},children:l.jsxs("a",{href:(((me=Ee.link)==null?void 0:me.length)??0)>0&&g==="Off"?Ee.link:void 0,target:"_blank",className:`${s}-item-image-link`,children:[l.jsx("div",{className:`${s}-item-image-wrapper`,style:{width:E.scalingValue(z??0,n),height:E.scalingValue(z??0,n)},children:(((Ie=Ee.image)==null?void 0:Ie.length)??0)===0?null:L==="Off"?l.jsx("img",{src:Ee.image[0].url,alt:Ee.image[0].name,className:`${s}-item-image`.trim(),style:We,onClick:Ve=>Nt(Ve,Ee.image.map(Me=>Me.url),0)}):l.jsx(si,{className:`${s}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:b*1e3,width:"100%",height:"100%",speed:500,type:H==="Fade"?"fade":"loop",rewind:H==="Fade",pauseOnHover:!1,pauseOnFocus:!1,direction:H==="Fade"?"ltr":m!=="Random"?m==="Horizontal"?"ltr":"ttb":Oe},onMoved:Ve=>{if(m!=="Random"||H==="Fade")return;const Me=Math.random()>.5?Math.random()>.5?"rtl":"ltr":Math.random()>.5?"btt":"ttb";Ye(Me),setTimeout(()=>{Ve.refresh()},0)},children:Ee.image.map((Ve,Me)=>l.jsx(li,{children:l.jsx("img",{src:Ve.url,alt:Ve.name,className:`${s}-item-image`.trim(),style:We,onClick:ut=>Nt(ut,Ee.image.map(Mn=>Mn.url),Me)})},Me))},`${H}-${z}-${m}-${b}-${ct}-${c}`)}),l.jsx("div",{"data-controls":"titleMarginTop",className:`${s}-control`,style:{height:E.scalingValue(F??0,n),width:E.scalingValue(z*v/100,n)}}),l.jsx("p",{className:`${s}-item-title`.trim(),style:{width:`calc(${E.scalingValue(z??0,n)} * (${v} / 100))`,...y},children:Ee.title}),u==="B"&&d&&l.jsx("div",{"data-controls":"subtitleMarginTop",className:`${s}-control`,style:{height:E.scalingValue(_??0,n),width:E.scalingValue(z*v/100,n)}}),u==="B"&&l.jsx("p",{className:`${s}-item-subtitle`.trim(),style:{width:`calc(${E.scalingValue(z??0,n)} * (${v} / 100))`,...K},children:Ee.subtitle})]})})},De)})})}),(!n||o)&&dt&&typeof document<"u"&&g==="On"&&Qi.createPortal(l.jsx("div",{style:qt,"data-selection":"none",children:l.jsx(Kc,{images:Je,index:et,imageDisplay:T.display,originRect:Fn,reverseClose:L==="Off",onClose:()=>be(!1),onPrev:()=>Mt(Ee=>(Ee-1+Je.length)%Je.length),onNext:()=>Mt(Ee=>(Ee+1)%Je.length),counterClassName:`${s}-lightbox-counter`.trim(),counterStyle:te})}),document.body)]})}const Uc={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Gc=["hover","focus","filled","success","error"],Yc=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
3635
3727
|
import '@splidejs/react-splide/css/core';
|
|
3636
3728
|
import { CommonComponentProps } from '../props';
|
|
3637
3729
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
3638
3730
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3639
3731
|
import { createPortal } from 'react-dom';
|
|
3640
3732
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
3641
|
-
import { getFontBasedOnSystem } from '../utils/getMainFontBaseOnSystem';
|
|
3642
3733
|
|
|
3643
3734
|
function sv(px: number): string {
|
|
3644
3735
|
return \`calc(var(--cntrl-article-width, 100vw) * \${px / 1440})\`;
|
|
@@ -3715,6 +3806,10 @@ function getCSS(P: string): string {
|
|
|
3715
3806
|
margin-top: 0px;
|
|
3716
3807
|
color: var(--\${P}-subtitle-color);
|
|
3717
3808
|
}
|
|
3809
|
+
.\${P}-lightbox-counter {
|
|
3810
|
+
margin: 0;
|
|
3811
|
+
color: var(--\${P}-lightbox-counter-color);
|
|
3812
|
+
}
|
|
3718
3813
|
|
|
3719
3814
|
.\${P}-control {
|
|
3720
3815
|
position: relative;
|
|
@@ -3742,6 +3837,7 @@ type GridProps = {
|
|
|
3742
3837
|
content?: any;
|
|
3743
3838
|
isEditor?: boolean;
|
|
3744
3839
|
isPreviewMode?: boolean;
|
|
3840
|
+
isEditMode?: boolean;
|
|
3745
3841
|
activeEvent: string | undefined;
|
|
3746
3842
|
onUpdateSettings?: (settings: GridSettings) => void;
|
|
3747
3843
|
} & CommonComponentProps;
|
|
@@ -3757,12 +3853,14 @@ type LightboxProps = {
|
|
|
3757
3853
|
onClose: () => void;
|
|
3758
3854
|
onPrev: () => void;
|
|
3759
3855
|
onNext: () => void;
|
|
3856
|
+
counterClassName: string;
|
|
3857
|
+
counterStyle: React.CSSProperties;
|
|
3760
3858
|
};
|
|
3761
3859
|
|
|
3762
3860
|
const LIGHTBOX_ANIM_MS = 500;
|
|
3763
3861
|
const LIGHTBOX_EASING = 'cubic-bezier(0.22, 1, 0.36, 1)';
|
|
3764
3862
|
|
|
3765
|
-
function Lightbox({ images, index, imageDisplay, originRect, reverseClose, onClose, onPrev, onNext }: LightboxProps) {
|
|
3863
|
+
function Lightbox({ images, index, imageDisplay, originRect, reverseClose, onClose, onPrev, onNext, counterClassName, counterStyle }: LightboxProps) {
|
|
3766
3864
|
const ghostRef = useRef<HTMLDivElement>(null);
|
|
3767
3865
|
const imgRef = useRef<HTMLImageElement>(null);
|
|
3768
3866
|
const [finalRect, setFinalRect] = useState<AnimRect | null>(null);
|
|
@@ -3891,20 +3989,14 @@ function Lightbox({ images, index, imageDisplay, originRect, reverseClose, onClo
|
|
|
3891
3989
|
justifyContent: 'center',
|
|
3892
3990
|
alignItems: 'center',
|
|
3893
3991
|
height: '10%',
|
|
3894
|
-
color: '#E6E6E6',
|
|
3895
|
-
letterSpacing: '-0.6px',
|
|
3896
|
-
lineHeight: '16px',
|
|
3897
3992
|
opacity: isOpen ? 1 : 0,
|
|
3898
3993
|
transition: \`opacity \${LIGHTBOX_ANIM_MS}ms \${LIGHTBOX_EASING}\`,
|
|
3899
|
-
fontFamily: getFontBasedOnSystem(),
|
|
3900
3994
|
}}
|
|
3901
3995
|
>
|
|
3902
3996
|
{images.length > 1 &&
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
<p>{images.length}</p>
|
|
3907
|
-
</>
|
|
3997
|
+
<p className={counterClassName} style={counterStyle}>
|
|
3998
|
+
{index + 1} / {images.length}
|
|
3999
|
+
</p>
|
|
3908
4000
|
}
|
|
3909
4001
|
</div>
|
|
3910
4002
|
</div>
|
|
@@ -3971,8 +4063,9 @@ function Lightbox({ images, index, imageDisplay, originRect, reverseClose, onClo
|
|
|
3971
4063
|
);
|
|
3972
4064
|
}
|
|
3973
4065
|
|
|
3974
|
-
export function Grid({ settings, content, isEditor, isPreviewMode, metadata, activeEvent, layoutId }: GridProps) {
|
|
4066
|
+
export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, metadata, activeEvent, layoutId }: GridProps) {
|
|
3975
4067
|
const { prefix: P } = useScopedStyles();
|
|
4068
|
+
const showControls = Boolean(isEditMode);
|
|
3976
4069
|
const {
|
|
3977
4070
|
type = 'A',
|
|
3978
4071
|
gridLayout,
|
|
@@ -3989,6 +4082,7 @@ export function Grid({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
3989
4082
|
subtitleMarginTop,
|
|
3990
4083
|
titleColor,
|
|
3991
4084
|
subtitleColor,
|
|
4085
|
+
lightboxCounterColor,
|
|
3992
4086
|
titleFontFamily,
|
|
3993
4087
|
titleFontSettings,
|
|
3994
4088
|
titleFontSize,
|
|
@@ -4003,6 +4097,13 @@ export function Grid({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4003
4097
|
subtitleLetterSpacing,
|
|
4004
4098
|
subtitleWordSpacing,
|
|
4005
4099
|
subtitleTextAppearance,
|
|
4100
|
+
lightboxCounterFontFamily,
|
|
4101
|
+
lightboxCounterFontSettings,
|
|
4102
|
+
lightboxCounterFontSize,
|
|
4103
|
+
lightboxCounterLineHeight,
|
|
4104
|
+
lightboxCounterLetterSpacing,
|
|
4105
|
+
lightboxCounterWordSpacing,
|
|
4106
|
+
lightboxCounterTextAppearance,
|
|
4006
4107
|
} = settings;
|
|
4007
4108
|
|
|
4008
4109
|
const resolvedTitleTextStyle: TextStyles = {
|
|
@@ -4041,9 +4142,28 @@ export function Grid({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4041
4142
|
...subtitleTypographyCss,
|
|
4042
4143
|
} as React.CSSProperties;
|
|
4043
4144
|
|
|
4145
|
+
const resolvedLightboxCounterTextStyle: TextStyles = {
|
|
4146
|
+
fontSettings: {
|
|
4147
|
+
fontFamily: lightboxCounterFontFamily,
|
|
4148
|
+
fontWeight: lightboxCounterFontSettings?.fontWeight ?? 400,
|
|
4149
|
+
fontStyle: lightboxCounterFontSettings?.fontStyle ?? 'normal',
|
|
4150
|
+
},
|
|
4151
|
+
fontSize: lightboxCounterFontSize ?? 0.01,
|
|
4152
|
+
lineHeight: lightboxCounterLineHeight,
|
|
4153
|
+
letterSpacing: lightboxCounterLetterSpacing ?? 0,
|
|
4154
|
+
wordSpacing: lightboxCounterWordSpacing ?? 0,
|
|
4155
|
+
textAppearance: lightboxCounterTextAppearance,
|
|
4156
|
+
color: lightboxCounterColor,
|
|
4157
|
+
};
|
|
4158
|
+
const lightboxCounterTypographyCss = omitTextColors(textStylesToCss(resolvedLightboxCounterTextStyle, isEditor));
|
|
4159
|
+
const lightboxCounterFieldCss = {
|
|
4160
|
+
...lightboxCounterTypographyCss,
|
|
4161
|
+
} as React.CSSProperties;
|
|
4162
|
+
|
|
4044
4163
|
const colorVars = buildColorVars(P, {
|
|
4045
4164
|
titleColor,
|
|
4046
4165
|
subtitleColor,
|
|
4166
|
+
lightboxCounterColor,
|
|
4047
4167
|
}, COLOR_VAR_MAP, STATE_KEYS);
|
|
4048
4168
|
|
|
4049
4169
|
const stateClass = activeEvent && activeEvent !== 'default' ? \`\${P}-state-\${activeEvent}\` : '';
|
|
@@ -4087,12 +4207,24 @@ export function Grid({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4087
4207
|
return () => ro.disconnect();
|
|
4088
4208
|
}, []);
|
|
4089
4209
|
|
|
4210
|
+
const lightboxPortalStyle = (() => {
|
|
4211
|
+
const style: Record<string, string> = { ...(colorVars as Record<string, string>) };
|
|
4212
|
+
const articleWidth = containerRef.current
|
|
4213
|
+
? getComputedStyle(containerRef.current).getPropertyValue('--cntrl-article-width').trim()
|
|
4214
|
+
: '';
|
|
4215
|
+
if (articleWidth) {
|
|
4216
|
+
style['--cntrl-article-width'] = articleWidth;
|
|
4217
|
+
}
|
|
4218
|
+
return style as React.CSSProperties;
|
|
4219
|
+
})();
|
|
4220
|
+
|
|
4090
4221
|
const [lightboxOpen, setLightboxOpen] = useState(false);
|
|
4091
4222
|
const [lightboxImages, setLightboxImages] = useState<string[]>([]);
|
|
4092
4223
|
const [lightboxIndex, setLightboxIndex] = useState(0);
|
|
4093
4224
|
const [lightboxOriginRect, setLightboxOriginRect] = useState<AnimRect | null>(null);
|
|
4094
4225
|
|
|
4095
4226
|
const openLightbox = (e: React.MouseEvent<HTMLImageElement>, urls: string[], idx: number) => {
|
|
4227
|
+
if (isEditor && !isPreviewMode) return;
|
|
4096
4228
|
if (lightbox === 'Off') return;
|
|
4097
4229
|
const r = e.currentTarget.getBoundingClientRect();
|
|
4098
4230
|
setLightboxOriginRect({ top: r.top, left: r.left, width: r.width, height: r.height });
|
|
@@ -4130,7 +4262,7 @@ export function Grid({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4130
4262
|
className={\`\${P}-item\`.trim()}
|
|
4131
4263
|
>
|
|
4132
4264
|
<div
|
|
4133
|
-
className={
|
|
4265
|
+
className={isEditMode ? \`\${P}-item-inner\` : \`\${P}-item-inner-hidden\`}
|
|
4134
4266
|
style={{ width: (textBoxWidth ?? 0) > 100 ? \`calc(\${scalingValue(size ?? 0, isEditor)} * (\${textBoxWidth} / 100))\` : scalingValue(size ?? 0, isEditor) }}
|
|
4135
4267
|
>
|
|
4136
4268
|
<a href={(item.link?.length ?? 0) > 0 && lightbox === 'Off' ? item.link : undefined} target='_blank' className={\`\${P}-item-image-link\`}>
|
|
@@ -4202,7 +4334,7 @@ export function Grid({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4202
4334
|
<p className={\`\${P}-item-title\`.trim()} style={{ width: \`calc(\${scalingValue(size ?? 0, isEditor)} * (\${textBoxWidth} / 100))\`, ...titleFieldCss }}>
|
|
4203
4335
|
{item.title}
|
|
4204
4336
|
</p>
|
|
4205
|
-
{type === 'B' && <div
|
|
4337
|
+
{type === 'B' && showControls && <div
|
|
4206
4338
|
data-controls="subtitleMarginTop"
|
|
4207
4339
|
className={\`\${P}-control\`}
|
|
4208
4340
|
style={{ height: scalingValue(subtitleMarginTop ?? 0, isEditor), width: scalingValue(size * textBoxWidth / 100, isEditor) }}
|
|
@@ -4216,9 +4348,9 @@ export function Grid({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4216
4348
|
))}
|
|
4217
4349
|
</div>
|
|
4218
4350
|
</div>
|
|
4219
|
-
{lightboxOpen && typeof document
|
|
4351
|
+
{(!isEditor || isPreviewMode) && lightboxOpen && typeof document !== 'undefined' && lightbox === 'On' &&
|
|
4220
4352
|
createPortal(
|
|
4221
|
-
<div data-selection="none">
|
|
4353
|
+
<div style={lightboxPortalStyle} data-selection="none">
|
|
4222
4354
|
<Lightbox
|
|
4223
4355
|
images={lightboxImages}
|
|
4224
4356
|
index={lightboxIndex}
|
|
@@ -4228,6 +4360,8 @@ export function Grid({ settings, content, isEditor, isPreviewMode, metadata, act
|
|
|
4228
4360
|
onClose={() => setLightboxOpen(false)}
|
|
4229
4361
|
onPrev={() => setLightboxIndex((prev) => (prev - 1 + lightboxImages.length) % lightboxImages.length)}
|
|
4230
4362
|
onNext={() => setLightboxIndex((prev) => (prev + 1) % lightboxImages.length)}
|
|
4363
|
+
counterClassName={\`\${P}-lightbox-counter\`.trim()}
|
|
4364
|
+
counterStyle={lightboxCounterFieldCss}
|
|
4231
4365
|
/>
|
|
4232
4366
|
</div>,
|
|
4233
4367
|
document.body
|
|
@@ -4264,6 +4398,7 @@ type GridSettings = {
|
|
|
4264
4398
|
subtitleMarginTop: number;
|
|
4265
4399
|
titleColor: string;
|
|
4266
4400
|
subtitleColor: string;
|
|
4401
|
+
lightboxCounterColor: string;
|
|
4267
4402
|
titleFontFamily: string;
|
|
4268
4403
|
titleFontSettings?: { fontWeight: number; fontStyle: string };
|
|
4269
4404
|
titleFontSize?: number;
|
|
@@ -4278,23 +4413,32 @@ type GridSettings = {
|
|
|
4278
4413
|
subtitleLetterSpacing?: number;
|
|
4279
4414
|
subtitleWordSpacing?: number;
|
|
4280
4415
|
subtitleTextAppearance?: TextStyles['textAppearance'];
|
|
4416
|
+
lightboxCounterFontFamily: string;
|
|
4417
|
+
lightboxCounterFontSettings?: { fontWeight: number; fontStyle: string };
|
|
4418
|
+
lightboxCounterFontSize?: number;
|
|
4419
|
+
lightboxCounterLineHeight?: number;
|
|
4420
|
+
lightboxCounterLetterSpacing?: number;
|
|
4421
|
+
lightboxCounterWordSpacing?: number;
|
|
4422
|
+
lightboxCounterTextAppearance?: TextStyles['textAppearance'];
|
|
4281
4423
|
};
|
|
4282
4424
|
|
|
4283
4425
|
type ColorKeys =
|
|
4284
4426
|
| 'titleColor'
|
|
4285
4427
|
| 'subtitleColor'
|
|
4428
|
+
| 'lightboxCounterColor'
|
|
4286
4429
|
|
|
4287
4430
|
const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
4288
4431
|
titleColor: 'title-color',
|
|
4289
4432
|
subtitleColor: 'subtitle-color',
|
|
4433
|
+
lightboxCounterColor: 'lightbox-counter-color',
|
|
4290
4434
|
};
|
|
4291
4435
|
|
|
4292
4436
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
4293
|
-
`,Ii={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Mc=["titleColor","subtitleColor"],Nc={type:"object",version:1,properties:{content:{type:"array",settings:{addItemWithoutImage:!0},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"},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:"Title 1",subtitle:"Subtitle 1",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Grid-1.png",objectFit:"cover"}],link:""},{title:"Title 2",subtitle:"Subtitle 2",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Grid-2.png",objectFit:"cover"}],link:""},{title:"Title 3",subtitle:"Subtitle 3",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Grid-3.png",objectFit:"cover"}],link:""}]}},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B"]},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},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"}}},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",visible:!1}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Ii.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:{...Ii.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"}}},defaults:{lightbox:"Off",imageDisplay:{display:"Fit",ratioValue:"16:9",reversed:!1},type:"A",slider:"Off",sliderTiming:5,direction:"Horizontal",transition:"Slide",titleColor:"#767676",subtitleColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Arial",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,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:.043,titleLineHeight:.043,subtitleFontSize:.0373,subtitleLineHeight:.0373},d:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,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:.01,titleLineHeight:.01,subtitleFontSize:.01,subtitleLineHeight:.01}},displayRules:[{if:{name:"transition",value:"Fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"type",value:"B"},then:{name:"properties.subtitleColor.display.visible",value:!0}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","entriesCount","lightbox","imageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"cursor",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"]},{type:"row",title:"Image",items:["imageDisplay","lightbox"]},{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"]}]}],paletteBookmark:{items:[...Mc],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor"]}}},Oc={element:Fc,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:Nc,sourceCode:kc};function Dn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Hc(e){return String(e??"").trim().length>0}function Bc(e,t,n,o,i,l,r){const s=T.scalingValue(l,r),c=T.scalingValue(0,r),p=e===0,d=e===t-1&&!i;return{borderTopWidth:p&&n?s:c,borderBottomWidth:!d||o?s:c}}function Vc(e,t,n){const o=T.scalingValue(t,n),i=T.scalingValue(0,n);return{borderTopWidth:i,borderBottomWidth:e?o:i}}function Dc(e){return`
|
|
4437
|
+
`,Eo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Xc=["titleColor","subtitleColor","lightboxCounterColor"],Zc={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0},display:{type:"array",rules:[{if:{name:"type",value:"A"},then:{name:"subtitle",value:!1}}]},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"},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:"Title 1",subtitle:"Subtitle 1",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-1.png",name:"Grid-1.png",objectFit:"cover"}],link:""},{title:"Title 2",subtitle:"Subtitle 2",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-2.png",name:"Grid-2.png",objectFit:"cover"}],link:""},{title:"Title 3",subtitle:"Subtitle 3",image:[{url:"https://cdn.cntrl.site/component-assets/Control-slider-default-picture-3.png",name:"Grid-3.png",objectFit:"cover"}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B"]},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},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"}}},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",visible:!1}},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:{...Eo.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:{...Eo.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:{...Eo.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:"Off",imageDisplay:{display:"Fit",ratioValue:"16:9",reversed:!1},type:"A",slider:"Off",sliderTiming:5,direction:"Horizontal",transition:"Slide",titleColor:"#767676",subtitleColor:"#DEDDDD",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Arial",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Arial",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,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:.043,titleLineHeight:.043,subtitleFontSize:.0373,subtitleLineHeight:.0373,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},d:{gridLayout:{entryWidth:.2,horizontalGap:.05,wrapperWidth:1,columnsCount:2,lockedParam:null},textBoxWidth:100,verticalGap:.0083,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:.01,titleLineHeight:.01,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"Fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"type",value:"B"},then:{name:"properties.subtitleColor.display.visible",value:!0}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","entriesCount","lightbox","imageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"cursor",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"]},{type:"row",title:"Image",items:["imageDisplay","lightbox"]},{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:[...Xc],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Jc={element:qc,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:Zc,sourceCode:Yc};function Zn(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Qc(e){return String(e??"").trim().length>0}function ed(e,t,n,o,r,a,i){const c=E.scalingValue(a,i),s=E.scalingValue(0,i),d=e===0,u=e===t-1&&!r;return{borderTopWidth:d&&n?c:s,borderBottomWidth:!u||o?c:s}}function td(e,t,n){const o=E.scalingValue(t,n),r=E.scalingValue(0,n);return{borderTopWidth:r,borderBottomWidth:e?o:r}}const Di=10;function nd(e){return`
|
|
4294
4438
|
.${e}-wrapper {
|
|
4295
4439
|
display: grid;
|
|
4296
4440
|
align-items: start;
|
|
4297
|
-
min-height: ${
|
|
4441
|
+
min-height: ${Zn(48)};
|
|
4298
4442
|
position: relative;
|
|
4299
4443
|
overflow: visible;
|
|
4300
4444
|
box-sizing: border-box;
|
|
@@ -4302,8 +4446,8 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
4302
4446
|
|
|
4303
4447
|
.${e}-hover-image {
|
|
4304
4448
|
position: absolute;
|
|
4305
|
-
|
|
4306
|
-
|
|
4449
|
+
left: 0;
|
|
4450
|
+
top: 0;
|
|
4307
4451
|
z-index: 10;
|
|
4308
4452
|
pointer-events: none;
|
|
4309
4453
|
display: block;
|
|
@@ -4344,24 +4488,34 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
4344
4488
|
}
|
|
4345
4489
|
|
|
4346
4490
|
.${e}-list-cols-row-h [data-list-col] {
|
|
4347
|
-
display:
|
|
4348
|
-
|
|
4491
|
+
display: grid;
|
|
4492
|
+
grid-template-rows: minmax(0, 1fr);
|
|
4349
4493
|
align-self: stretch;
|
|
4350
|
-
min-height:
|
|
4494
|
+
min-height: min-content;
|
|
4351
4495
|
}
|
|
4352
4496
|
|
|
4353
4497
|
.${e}-list-cols-row-h .${e}-list-col {
|
|
4354
|
-
flex: 1;
|
|
4355
4498
|
display: flex;
|
|
4356
4499
|
flex-direction: column;
|
|
4357
4500
|
align-items: flex-start;
|
|
4501
|
+
justify-content: flex-start;
|
|
4502
|
+
width: 100%;
|
|
4503
|
+
min-height: 0;
|
|
4358
4504
|
}
|
|
4359
4505
|
|
|
4360
4506
|
.${e}-list-cols-row-h .${e}-list-col-title {
|
|
4361
|
-
|
|
4507
|
+
display: block;
|
|
4508
|
+
flex: 0 0 auto;
|
|
4362
4509
|
align-self: stretch;
|
|
4363
4510
|
}
|
|
4364
4511
|
|
|
4512
|
+
.${e}-text-tight-leading {
|
|
4513
|
+
display: block;
|
|
4514
|
+
flex-shrink: 0;
|
|
4515
|
+
padding-top: var(--${e}-title-leading-gap, 0);
|
|
4516
|
+
padding-bottom: var(--${e}-title-leading-gap, 0);
|
|
4517
|
+
}
|
|
4518
|
+
|
|
4365
4519
|
.${e}-wrapper.${e}-type-b .${e}-list-cols-row {
|
|
4366
4520
|
flex-direction: column;
|
|
4367
4521
|
align-items: stretch;
|
|
@@ -4370,23 +4524,24 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
4370
4524
|
.${e}-wrapper.${e}-type-b .${e}-list-col {
|
|
4371
4525
|
width: 100%;
|
|
4372
4526
|
min-width: 0;
|
|
4373
|
-
|
|
4527
|
+
flex-direction: column;
|
|
4528
|
+
justify-content: flex-start;
|
|
4374
4529
|
align-items: flex-start;
|
|
4530
|
+
min-height: min-content;
|
|
4375
4531
|
}
|
|
4376
4532
|
|
|
4377
4533
|
.${e}-wrapper.${e}-type-b .${e}-list-col-title {
|
|
4534
|
+
display: block;
|
|
4535
|
+
flex: 0 0 auto;
|
|
4536
|
+
align-self: stretch;
|
|
4378
4537
|
text-align: center;
|
|
4379
4538
|
}
|
|
4380
4539
|
|
|
4381
4540
|
.${e}-wrapper.${e}-type-b .${e}-cut-item .${e}-list-cols-row {
|
|
4382
4541
|
flex-direction: row;
|
|
4383
|
-
align-items: center;
|
|
4384
|
-
justify-content: center;
|
|
4385
4542
|
}
|
|
4386
4543
|
|
|
4387
4544
|
.${e}-wrapper.${e}-type-b .${e}-cut-label {
|
|
4388
|
-
text-align: center;
|
|
4389
|
-
width: 100%;
|
|
4390
4545
|
box-sizing: border-box;
|
|
4391
4546
|
}
|
|
4392
4547
|
|
|
@@ -4405,7 +4560,7 @@ a.${e}-list-item {
|
|
|
4405
4560
|
flex-shrink: 0;
|
|
4406
4561
|
overflow: visible;
|
|
4407
4562
|
box-sizing: border-box;
|
|
4408
|
-
min-width: ${
|
|
4563
|
+
min-width: ${Zn(50)};
|
|
4409
4564
|
position: relative;
|
|
4410
4565
|
display: flex;
|
|
4411
4566
|
align-items: flex-start;
|
|
@@ -4413,7 +4568,7 @@ a.${e}-list-item {
|
|
|
4413
4568
|
|
|
4414
4569
|
.${e}-list-col-last {
|
|
4415
4570
|
flex: 1 1 auto;
|
|
4416
|
-
min-width: ${
|
|
4571
|
+
min-width: ${Zn(50)};
|
|
4417
4572
|
}
|
|
4418
4573
|
|
|
4419
4574
|
.${e}-list-col-title {
|
|
@@ -4436,151 +4591,148 @@ a.${e}-list-item {
|
|
|
4436
4591
|
}
|
|
4437
4592
|
|
|
4438
4593
|
.${e}-col-resize-handle,
|
|
4439
|
-
.${e}-padding-control-handle
|
|
4440
|
-
|
|
4441
|
-
}
|
|
4442
|
-
|
|
4443
|
-
.${e}-row-padding-handle {
|
|
4444
|
-
position: relative;
|
|
4445
|
-
z-index: 2;
|
|
4446
|
-
width: 100%;
|
|
4447
|
-
flex-shrink: 0;
|
|
4594
|
+
.${e}-padding-control-handle,
|
|
4595
|
+
.${e}-text-padding-lr-handle {
|
|
4448
4596
|
background: transparent;
|
|
4449
4597
|
}
|
|
4450
4598
|
|
|
4451
|
-
.${e}-
|
|
4452
|
-
|
|
4453
|
-
position: absolute;
|
|
4454
|
-
top: 0;
|
|
4455
|
-
left: 0;
|
|
4456
|
-
width: 100%;
|
|
4457
|
-
height: 100%;
|
|
4458
|
-
min-height: 20px;
|
|
4459
|
-
pointer-events: auto;
|
|
4460
|
-
z-index: 10;
|
|
4461
|
-
}
|
|
4462
|
-
|
|
4463
|
-
.${e}-col-resize-handle::after {
|
|
4599
|
+
.${e}-padding-control-handle[data-controls-axis="x"][data-controls-variant="column-padding"]::after,
|
|
4600
|
+
.${e}-text-padding-lr-handle::after {
|
|
4464
4601
|
content: '';
|
|
4465
4602
|
position: absolute;
|
|
4466
|
-
top:
|
|
4603
|
+
top: var(--${e}-first-entry-handle-top, 50%);
|
|
4467
4604
|
left: 50%;
|
|
4468
|
-
transform:
|
|
4469
|
-
width:
|
|
4470
|
-
height:
|
|
4605
|
+
transform: translate(-50%, -50%);
|
|
4606
|
+
width: 4px;
|
|
4607
|
+
height: 12px;
|
|
4471
4608
|
background: #FF5C02;
|
|
4609
|
+
border: 1px solid #FFFFFF;
|
|
4610
|
+
border-radius: 5px;
|
|
4611
|
+
box-sizing: border-box;
|
|
4472
4612
|
pointer-events: none;
|
|
4473
4613
|
}
|
|
4474
4614
|
|
|
4475
|
-
.${e}-
|
|
4615
|
+
.${e}-text-padding-lr-handle::after {
|
|
4476
4616
|
top: 50%;
|
|
4477
|
-
left: 0;
|
|
4478
|
-
transform: translateY(-50%);
|
|
4479
|
-
width: 100%;
|
|
4480
|
-
height: 2px;
|
|
4481
4617
|
}
|
|
4482
4618
|
|
|
4483
|
-
.${e}-padding-control-handle::after {
|
|
4619
|
+
.${e}-padding-control-handle[data-controls-axis="y"]::after {
|
|
4484
4620
|
content: '';
|
|
4485
4621
|
position: absolute;
|
|
4486
4622
|
top: 50%;
|
|
4487
4623
|
left: 50%;
|
|
4488
4624
|
transform: translate(-50%, -50%);
|
|
4489
|
-
width:
|
|
4490
|
-
height:
|
|
4625
|
+
width: 12px;
|
|
4626
|
+
height: 4px;
|
|
4491
4627
|
background: #FF5C02;
|
|
4492
4628
|
border: 1px solid #FFFFFF;
|
|
4493
4629
|
border-radius: 5px;
|
|
4494
|
-
pointer-events: none;
|
|
4495
4630
|
box-sizing: border-box;
|
|
4631
|
+
pointer-events: none;
|
|
4496
4632
|
}
|
|
4497
4633
|
|
|
4498
|
-
.${e}-
|
|
4499
|
-
|
|
4500
|
-
|
|
4634
|
+
.${e}-padding-control-handle[data-controls-variant="row-padding"][data-controls-axis="y"]::after,
|
|
4635
|
+
.${e}-padding-control-handle[data-controls-variant="column-padding"][data-controls-axis="y"]::after {
|
|
4636
|
+
left: 20px;
|
|
4637
|
+
transform: translateY(-50%);
|
|
4501
4638
|
}
|
|
4502
4639
|
|
|
4503
|
-
.${e}-
|
|
4640
|
+
.${e}-row-padding-handle {
|
|
4641
|
+
width: 100%;
|
|
4642
|
+
flex-shrink: 0;
|
|
4504
4643
|
background: transparent;
|
|
4505
4644
|
}
|
|
4506
4645
|
|
|
4507
|
-
.${e}-
|
|
4646
|
+
.${e}-list-col-wrap {
|
|
4647
|
+
position: relative;
|
|
4648
|
+
}
|
|
4649
|
+
|
|
4650
|
+
.${e}-list-cols-row-controls {
|
|
4651
|
+
position: relative;
|
|
4652
|
+
}
|
|
4653
|
+
|
|
4654
|
+
.${e}-col-resize-handle::after {
|
|
4508
4655
|
content: '';
|
|
4509
4656
|
position: absolute;
|
|
4510
|
-
top:
|
|
4657
|
+
top: 0;
|
|
4511
4658
|
left: 50%;
|
|
4512
|
-
transform:
|
|
4513
|
-
width:
|
|
4514
|
-
height:
|
|
4659
|
+
transform: translateX(-50%);
|
|
4660
|
+
width: 2px;
|
|
4661
|
+
height: 100%;
|
|
4515
4662
|
background: #FF5C02;
|
|
4516
|
-
border: 1px solid #FFFFFF;
|
|
4517
|
-
border-radius: 5px;
|
|
4518
4663
|
pointer-events: none;
|
|
4519
|
-
box-sizing: border-box;
|
|
4520
4664
|
}
|
|
4521
4665
|
|
|
4522
|
-
.${e}-wrapper.${e}-
|
|
4523
|
-
|
|
4666
|
+
.${e}-wrapper.${e}-type-b .${e}-col-resize-handle::after {
|
|
4667
|
+
top: 50%;
|
|
4668
|
+
left: 0;
|
|
4669
|
+
transform: translateY(-50%);
|
|
4670
|
+
width: 100%;
|
|
4671
|
+
height: 2px;
|
|
4672
|
+
}
|
|
4673
|
+
|
|
4674
|
+
.${e}-wrapper.${e}-entry-hover-default .${e}-list-item-has-link,
|
|
4675
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item-has-link,
|
|
4524
4676
|
.${e}-wrapper.${e}-entry-hover-default .${e}-cut-item,
|
|
4525
4677
|
.${e}-wrapper.${e}-entry-hover-blinds .${e}-cut-item {
|
|
4526
4678
|
transition: background-color 250ms, border-color 250ms;
|
|
4527
4679
|
}
|
|
4528
4680
|
|
|
4529
|
-
.${e}-wrapper.${e}-entry-hover-default .${e}-list-col-title,
|
|
4530
|
-
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-col-title,
|
|
4681
|
+
.${e}-wrapper.${e}-entry-hover-default .${e}-list-item-has-link .${e}-list-col-title,
|
|
4682
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item-has-link .${e}-list-col-title,
|
|
4531
4683
|
.${e}-wrapper.${e}-entry-hover-default .${e}-cut-label,
|
|
4532
4684
|
.${e}-wrapper.${e}-entry-hover-blinds .${e}-cut-label {
|
|
4533
4685
|
transition: color 250ms;
|
|
4534
4686
|
}
|
|
4535
4687
|
|
|
4536
|
-
.${e}-wrapper.${e}-entry-hover-default .${e}-list-item:hover,
|
|
4537
|
-
.${e}-wrapper.${e}-entry-hover-default.${e}-state-hover .${e}-list-item,
|
|
4688
|
+
.${e}-wrapper.${e}-entry-hover-default .${e}-list-item-has-link:hover,
|
|
4689
|
+
.${e}-wrapper.${e}-entry-hover-default.${e}-state-hover .${e}-list-item-has-link,
|
|
4538
4690
|
.${e}-wrapper.${e}-entry-hover-default .${e}-cut-item:hover,
|
|
4539
4691
|
.${e}-wrapper.${e}-entry-hover-default.${e}-state-hover .${e}-cut-item {
|
|
4540
4692
|
background: var(--${e}-background-hover-color);
|
|
4541
4693
|
}
|
|
4542
4694
|
|
|
4543
|
-
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default .${e}-list-item:hover,
|
|
4544
|
-
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default .${e}-list-item:has(+ .${e}-list-item:hover),
|
|
4695
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default .${e}-list-item-has-link:hover,
|
|
4696
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default .${e}-list-item:has(+ .${e}-list-item-has-link:hover),
|
|
4545
4697
|
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default .${e}-list-item:has(+ .${e}-cut-item:hover),
|
|
4546
|
-
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default.${e}-state-hover .${e}-list-item,
|
|
4698
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default.${e}-state-hover .${e}-list-item-has-link,
|
|
4547
4699
|
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default .${e}-cut-item:hover,
|
|
4548
4700
|
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-default.${e}-state-hover .${e}-cut-item,
|
|
4549
|
-
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds .${e}-list-item:hover,
|
|
4550
|
-
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds .${e}-list-item:has(+ .${e}-list-item:hover),
|
|
4701
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds .${e}-list-item-has-link:hover,
|
|
4702
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds .${e}-list-item:has(+ .${e}-list-item-has-link:hover),
|
|
4551
4703
|
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds .${e}-list-item:has(+ .${e}-cut-item:hover),
|
|
4552
|
-
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item,
|
|
4704
|
+
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item-has-link,
|
|
4553
4705
|
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds .${e}-cut-item:hover,
|
|
4554
4706
|
.${e}-wrapper.${e}-divider-bottom.${e}-entry-hover-blinds.${e}-state-hover .${e}-cut-item {
|
|
4555
4707
|
border-bottom-color: var(--${e}-divider-hover-color);
|
|
4556
4708
|
}
|
|
4557
4709
|
|
|
4558
|
-
.${e}-wrapper.${e}-divider-top:not(.${e}-divider-bottom).${e}-entry-hover-default .${e}-list-item:hover:first-child,
|
|
4559
|
-
.${e}-wrapper.${e}-divider-top:not(.${e}-divider-bottom).${e}-entry-hover-default.${e}-state-hover .${e}-list-item:first-child,
|
|
4560
|
-
.${e}-wrapper.${e}-divider-top:not(.${e}-divider-bottom).${e}-entry-hover-blinds .${e}-list-item:hover:first-child,
|
|
4561
|
-
.${e}-wrapper.${e}-divider-top:not(.${e}-divider-bottom).${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item:first-child {
|
|
4710
|
+
.${e}-wrapper.${e}-divider-top:not(.${e}-divider-bottom).${e}-entry-hover-default .${e}-list-item-has-link:hover:first-child,
|
|
4711
|
+
.${e}-wrapper.${e}-divider-top:not(.${e}-divider-bottom).${e}-entry-hover-default.${e}-state-hover .${e}-list-item-has-link:first-child,
|
|
4712
|
+
.${e}-wrapper.${e}-divider-top:not(.${e}-divider-bottom).${e}-entry-hover-blinds .${e}-list-item-has-link:hover:first-child,
|
|
4713
|
+
.${e}-wrapper.${e}-divider-top:not(.${e}-divider-bottom).${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item-has-link:first-child {
|
|
4562
4714
|
border-top-color: var(--${e}-divider-hover-color);
|
|
4563
4715
|
}
|
|
4564
4716
|
|
|
4565
|
-
.${e}-wrapper.${e}-divider-top.${e}-divider-bottom.${e}-entry-hover-default .${e}-list-item:hover:first-child,
|
|
4566
|
-
.${e}-wrapper.${e}-divider-top.${e}-divider-bottom.${e}-entry-hover-default.${e}-state-hover .${e}-list-item:first-child,
|
|
4567
|
-
.${e}-wrapper.${e}-divider-top.${e}-divider-bottom.${e}-entry-hover-blinds .${e}-list-item:hover:first-child,
|
|
4568
|
-
.${e}-wrapper.${e}-divider-top.${e}-divider-bottom.${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item:first-child {
|
|
4717
|
+
.${e}-wrapper.${e}-divider-top.${e}-divider-bottom.${e}-entry-hover-default .${e}-list-item-has-link:hover:first-child,
|
|
4718
|
+
.${e}-wrapper.${e}-divider-top.${e}-divider-bottom.${e}-entry-hover-default.${e}-state-hover .${e}-list-item-has-link:first-child,
|
|
4719
|
+
.${e}-wrapper.${e}-divider-top.${e}-divider-bottom.${e}-entry-hover-blinds .${e}-list-item-has-link:hover:first-child,
|
|
4720
|
+
.${e}-wrapper.${e}-divider-top.${e}-divider-bottom.${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item-has-link:first-child {
|
|
4569
4721
|
border-top-color: var(--${e}-divider-hover-color);
|
|
4570
4722
|
}
|
|
4571
4723
|
|
|
4572
|
-
.${e}-wrapper.${e}-entry-hover-default .${e}-list-item:hover .${e}-list-col-title,
|
|
4573
|
-
.${e}-wrapper.${e}-entry-hover-default.${e}-state-hover .${e}-list-item .${e}-list-col-title,
|
|
4724
|
+
.${e}-wrapper.${e}-entry-hover-default .${e}-list-item-has-link:hover .${e}-list-col-title,
|
|
4725
|
+
.${e}-wrapper.${e}-entry-hover-default.${e}-state-hover .${e}-list-item-has-link .${e}-list-col-title,
|
|
4574
4726
|
.${e}-wrapper.${e}-entry-hover-default .${e}-cut-item:hover .${e}-cut-label,
|
|
4575
4727
|
.${e}-wrapper.${e}-entry-hover-default.${e}-state-hover .${e}-cut-item .${e}-cut-label,
|
|
4576
|
-
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item:hover .${e}-list-col-title,
|
|
4577
|
-
.${e}-wrapper.${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item .${e}-list-col-title,
|
|
4728
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item-has-link:hover .${e}-list-col-title,
|
|
4729
|
+
.${e}-wrapper.${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item-has-link .${e}-list-col-title,
|
|
4578
4730
|
.${e}-wrapper.${e}-entry-hover-blinds .${e}-cut-item:hover .${e}-cut-label,
|
|
4579
4731
|
.${e}-wrapper.${e}-entry-hover-blinds.${e}-state-hover .${e}-cut-item .${e}-cut-label {
|
|
4580
4732
|
color: var(--${e}-text-hover-color);
|
|
4581
4733
|
}
|
|
4582
4734
|
|
|
4583
|
-
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item::before,
|
|
4735
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item-has-link::before,
|
|
4584
4736
|
.${e}-wrapper.${e}-entry-hover-blinds .${e}-cut-item::before {
|
|
4585
4737
|
content: '';
|
|
4586
4738
|
position: absolute;
|
|
@@ -4599,8 +4751,8 @@ a.${e}-list-item {
|
|
|
4599
4751
|
z-index: 1;
|
|
4600
4752
|
}
|
|
4601
4753
|
|
|
4602
|
-
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item:hover::before,
|
|
4603
|
-
.${e}-wrapper.${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item::before,
|
|
4754
|
+
.${e}-wrapper.${e}-entry-hover-blinds .${e}-list-item-has-link:hover::before,
|
|
4755
|
+
.${e}-wrapper.${e}-entry-hover-blinds.${e}-state-hover .${e}-list-item-has-link::before,
|
|
4604
4756
|
.${e}-wrapper.${e}-entry-hover-blinds .${e}-cut-item:hover::before,
|
|
4605
4757
|
.${e}-wrapper.${e}-entry-hover-blinds.${e}-state-hover .${e}-cut-item::before {
|
|
4606
4758
|
transform: scaleY(1);
|
|
@@ -4608,8 +4760,7 @@ a.${e}-list-item {
|
|
|
4608
4760
|
|
|
4609
4761
|
.${e}-cut-item {
|
|
4610
4762
|
display: flex;
|
|
4611
|
-
align-items:
|
|
4612
|
-
justify-content: center;
|
|
4763
|
+
align-items: stretch;
|
|
4613
4764
|
width: 100%;
|
|
4614
4765
|
overflow: visible;
|
|
4615
4766
|
position: relative;
|
|
@@ -4617,6 +4768,20 @@ a.${e}-list-item {
|
|
|
4617
4768
|
box-sizing: border-box;
|
|
4618
4769
|
user-select: none;
|
|
4619
4770
|
background: var(--${e}-background-color);
|
|
4771
|
+
cursor: pointer;
|
|
4772
|
+
padding: 0;
|
|
4773
|
+
border: none;
|
|
4774
|
+
font: inherit;
|
|
4775
|
+
text-align: inherit;
|
|
4776
|
+
appearance: none;
|
|
4777
|
+
-webkit-appearance: none;
|
|
4778
|
+
}
|
|
4779
|
+
|
|
4780
|
+
.${e}-cut-item .${e}-list-cols-row {
|
|
4781
|
+
flex: 1;
|
|
4782
|
+
min-height: 100%;
|
|
4783
|
+
width: 100%;
|
|
4784
|
+
display: flex;
|
|
4620
4785
|
}
|
|
4621
4786
|
|
|
4622
4787
|
.${e}-wrapper.${e}-divider-bottom .${e}-cut-item {
|
|
@@ -4625,19 +4790,20 @@ a.${e}-list-item {
|
|
|
4625
4790
|
}
|
|
4626
4791
|
|
|
4627
4792
|
.${e}-cut-label {
|
|
4628
|
-
|
|
4629
|
-
cursor: pointer;
|
|
4793
|
+
display: block;
|
|
4630
4794
|
position: relative;
|
|
4631
4795
|
z-index: 1;
|
|
4796
|
+
margin: 0;
|
|
4632
4797
|
color: var(--${e}-text-color);
|
|
4633
4798
|
white-space: pre-wrap;
|
|
4634
4799
|
overflow-wrap: anywhere;
|
|
4635
4800
|
word-break: break-word;
|
|
4636
4801
|
}
|
|
4637
|
-
`}const Jt=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Bt=["AColumn","BColumn","CColumn","DColumn","EColumn"],ei=["A","B","C","D","E"];function $r(e){return`${e}ColumnVerticalAlign`}const zc=["Top","Center","Bottom"];function jc(e){const t=String(e??"Top").trim();return t.toLowerCase().startsWith("baseline")?!1:t==="Top"}function Kc(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ei.includes(n)?n:null}function Tr(e,t,n){const o=Kc(e);return o?o===t?!1:jc(n[$r(o)]):!0}function Wo(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ei.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Uc(e,t,n){if(Lr(e,t,n))return Wo(e);const o=Wo(e);return o.kind==="baseline"?{kind:"top"}:o}function Lr(e,t,n){return Tr(e,n,t)?Wo(e).kind==="baseline":!1}function qc(e){if(e.type==="B")return null;const t={};let n=!1;for(const o of ei){const i=$r(o),l=e[i];Tr(l,o,e)||(t[i]="Top",n=!0)}return n?t:null}function Gc(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function bo(e,t){if(!e)return 0;const n=document.createElement("i");n.className=t,n.setAttribute("data-baseline-probe",""),n.setAttribute("aria-hidden","true"),e.insertBefore(n,e.firstChild);const o=n.getBoundingClientRect().bottom;return n.remove(),o}function Yc(e,t){return!e||!t?(e&&(e.style.paddingTop="",e.style.marginTop=""),0):(t>0?(e.style.paddingTop=`${t}px`,e.style.marginTop=""):(e.style.paddingTop="",e.style.marginTop=`${t}px`),t)}const Xc={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"},Zc=["textFontFamily","textFontSettings","textFontSize","textLineHeight","textLetterSpacing","textWordSpacing","textTextAppearance"];function ti(e,t){return`${e}${t.replace(/^text/,"Text")}`}function Jc(e){return{textFontFamily:e.textFontFamily??"Arial",textFontSettings:e.textFontSettings??{fontWeight:400,fontStyle:"normal"},textFontSize:e.textFontSize,textLineHeight:e.textLineHeight,textLetterSpacing:e.textLetterSpacing??0,textWordSpacing:e.textWordSpacing??0,textTextAppearance:e.textTextAppearance,textColor:e.textColor}}function Qc(e,t){const n=o=>{const i=ti(t,o),l=e[i];return l!==void 0?l:e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Ri(e,t){var o,i;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((o=e.textFontSettings)==null?void 0:o.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,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return yt(qe(n,t))}function ed(e,t){const n={};let o=!1;for(const i of Zc)if(e[i]!==t[i]&&e[i]!==void 0){o=!0;for(const l of Bt)Object.assign(n,{[ti(l,i)]:e[i]})}return o?n:null}const et=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Qt=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],en=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],tn=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],td={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},nd=["hover","focus","filled","success","error"],ki=.004,ln=.004,ni=50,bn=1440,xn=ni/bn;function Er(e){const t=typeof e=="number"&&e>0?e:bn;return ni/t}function od(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 o=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(o){const i=parseFloat(o);if(Number.isFinite(i)&&i>0)return i}t=t.parentElement}return bn}const _r={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function zn(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function id(e,t=1){const n=t/e;return Object.fromEntries(et.map(o=>[o,n]))}function rd(){return Object.fromEntries([...Qt.map(e=>[e,0]),...en.map(e=>[e,0])])}function ad(){return Object.fromEntries(tn.map(e=>[e,0]))}function Mn(e){return Object.fromEntries(et.map(t=>[t,typeof e[t]=="number"?e[t]:_r[t]]))}function Pr(e,t,n){const o=e-xn,i=t+n;if(i<=0||i<=o)return{paddingLeft:t,paddingRight:n};if(o<=0)return{paddingLeft:0,paddingRight:0};const l=o/i;return{paddingLeft:t*l,paddingRight:n*l}}function jn(e,t,n){const o=oi(e,t,n);if(e<=0)return[];const i=o.slice(0,e-1).reduce((l,r)=>l+r,0);return[...o.slice(0,e-1),Math.max(0,t-i)]}function sd(e,t,n){const o={};for(let i=0;i<e;i+=1){const l=Qt[i],r=en[i],s=typeof n[l]=="number"?n[l]:0,c=typeof n[r]=="number"?n[r]:0,p=Pr(t[i]??0,s,c);p.paddingLeft!==s&&(o[l]=p.paddingLeft),p.paddingRight!==c&&(o[r]=p.paddingRight)}return o}function oi(e,t,n){if(e<=0)return[];const o=et.slice(0,e).map(p=>n[p]);if(e===1)return o;const i=o.slice(0,e-1),r=i.reduce((p,d)=>p+d,0)+xn;if(t>=r)return o;const s=[...i];let c=r-t;for(let p=s.length-1;p>=0&&c>0;p-=1){const d=s[p]-xn;if(d<=0)continue;const $=Math.min(c,d);s[p]-=$,c-=$}return[...s,o[e-1]]}function ld(e,t,n){if(e<=1)return{};const o=oi(e,t,n),i={};for(let l=0;l<e-1;l+=1){const r=et[l];o[l]!==n[r]&&(i[r]=o[l])}return i}function Mi(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Jt]}function cd(e,t){return e.length!==t.length?!1:e.every((n,o)=>n===t[o])}function dd(e,t,n,o){const i=Math.min(o,e.length,et.length),l={};for(let r=0;r<i;r+=1){const s=e[r],c=t.indexOf(s);if(c===-1)continue;const p=et[c],d=Qt[c],$=en[c],h=tn[c],f=et[r],m=Qt[r],g=en[r],C=tn[r],y=n[p],x=n[d],P=n[$],L=n[h];typeof y=="number"&&(l[f]=y),typeof x=="number"&&(l[m]=x),typeof P=="number"&&(l[g]=P),typeof L=="number"&&(l[C]=L)}return l}function ud(e,t,n){const o=ed(e,t);o&&(e={...e,...o});const i=qc(e);i&&(e={...e,...i});const l=Er(n==null?void 0:n.designWidth),r=e.columns,s=t.columns,c=zn(e),p=zn(t),d=e.type==="B"||e.type===void 0&&t.type==="B",$=typeof r=="number"?r:typeof s=="number"?s:Jt.length,h=L=>{if(d)return L;const _=Mn({...t,...L}),E=zn(L),v=jn($,E,_),w=sd($,v,{...t,...L});return Object.keys(w).length===0?L:{...L,...w}};if(typeof r=="number"&&r!==s){const L={...e,...id(r,c),...rd()};if(d)for(const _ of tn)typeof t[_]=="number"&&(L[_]=t[_]);else Object.assign(L,ad());return L}const f=Mi(e),m=Mi(t);if(!cd(f,m))return h({...e,...dd(f,m,t,$)});if(c<p&&typeof $=="number"&&!d){const L=Mn({...t,...e});return h({...e,...ld($,c,L)})}if(d){const L=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,_=Math.max(0,(c-l)/2);return L>_?{...e,textPaddingLR:_}:e}const g=Mn({...t,...e}),C=jn($,p,Mn(t)),x=jn($,c,g).some((L,_)=>L<(C[_]??L)),P=et.some(L=>{const _=e[L],E=t[L];return typeof _=="number"&&typeof E=="number"&&_!==E});return x||P?h(e):e}function pd(e,t,n,o){const i=t.slice(0,e).reduce((r,s)=>r+s,0),l=n.slice(e+1,t.length-1).reduce((r,s)=>r+s,0);return Math.max(xn,o-i-l-xn)}function md(e,t){return Math.random()*(t-e)+e}function gd(e){return Object.fromEntries(et.map(t=>[t,typeof e[t]=="number"?e[t]:_r[t]]))}function xo(e,t,n=0){return Object.fromEntries(t.map(o=>[o,typeof e[o]=="number"?e[o]:n]))}function hd(e,t,n,o,i,l){return e.slice(0,t).map((r,s)=>{const c=Qt[s],p=en[s],d=tn[s];return{key:r,textPrefix:Xc[r],widthKey:et[s],width:n[et[s]],paddingLeftKey:c,paddingRightKey:p,paddingBottomKey:d,paddingLeft:o[c],paddingRight:i[p],paddingBottom:l[d]}})}function fd({settings:e,content:t,isEditor:n,isPreviewMode:o,activeEvent:i,layoutId:l,onUpdateSettings:r}){const{prefix:s}=T.useScopedStyles(),c=!!(n&&o),{columns:p,type:d,wrapperWidth:$,entriesCount:h,cellMinHeight:f,dividerWidth:m,showVisibility:g,cut:C,showCut:y,cutCellMinHeight:x,cutLabel:P,imageSize:L,imageOnHover:_,entryHoverEffect:E,rowPaddingTop:v,rowPaddingBottom:w,rowPaddingTopB:R,columnsOrder:V,textPaddingLR:A,textColor:H,textFontFamily:D,textFontSettings:j,textFontSize:U,textLineHeight:S,textLetterSpacing:N,textWordSpacing:k,textTextAppearance:M,backgroundColor:W,dividerColor:B,textHoverColor:ee,backgroundHoverColor:de,dividerHoverColor:re}=e,[me,O]=u.useState(void 0),[te,Y]=u.useState(null),X=_==="On",ne=(C??0)>0,I=d==="B",oe=u.useRef(null),[F,b]=u.useState(bn),z=Er(F),q=Math.max(0,(($??0)-z)/2),Z=Math.min(A??0,q),se=Math.max(Z,ln),le=(($??0)+z)/2;u.useLayoutEffect(()=>{if(!n){b(bn);return}const he=()=>{b(od(oe.current))};he();const xe=oe.current;if(!xe)return;const We=new ResizeObserver(he);We.observe(xe);let Oe=xe;for(;Oe&&!Oe.style.getPropertyValue("--cntrl-article-width");)Oe=Oe.parentElement;return Oe&&We.observe(Oe),()=>We.disconnect()},[n,l]),u.useEffect(()=>{O(void 0)},[C,y,t,h]);const ce=Ri(Jc(e),n),ge=u.useMemo(()=>Object.fromEntries(Bt.map(he=>[he,Ri(Qc(e,he),n)])),[e,D,j,U,S,N,k,M,H,n]),K=T.buildColorVars(s,{textColor:H,backgroundColor:W,dividerColor:B,textHoverColor:ee,backgroundHoverColor:de,dividerHoverColor:re},td,nd),J=i&&i!=="default"?`${s}-state-${i}`:"",pe=`${E==="Default"?`${s}-entry-hover-default`:E==="Blinds"?`${s}-entry-hover-blinds`:""} ${J}`.trim(),ie=(g==null?void 0:g[0])??!1,ue=(g==null?void 0:g[1])??!1,Ce=u.useRef(e),$e=u.useRef(l);u.useEffect(()=>{if(!r||!n){Ce.current=e,$e.current=l;return}if($e.current!==l){Ce.current=e,$e.current=l;return}const he=Ce.current,xe=ud(e,he,{designWidth:F});Ce.current=e,xe!==e&&r(xe)},[e,r,n,l,F]);const Pe=u.useMemo(()=>gd(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),je=u.useMemo(()=>xo(e,Qt),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),we=u.useMemo(()=>xo(e,en),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Me=u.useMemo(()=>xo(e,tn),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),Ge=u.useMemo(()=>Array.isArray(V)&&V.length>0?V:[...Jt],[V]),ye=u.useMemo(()=>hd(Ge,p,Pe,je,we,Me),[Ge,p,Pe,je,we,Me]),Ae=zn(e),Te=u.useMemo(()=>et.slice(0,p).map(he=>Pe[he]),[p,Pe]),Be=u.useMemo(()=>oi(p,Ae,Pe),[p,Ae,Pe]),Ne=u.useMemo(()=>jn(p,Ae,Pe),[p,Ae,Pe]),Ie=u.useMemo(()=>ye.map((he,xe)=>Pr(Ne[xe]??0,he.paddingLeft,he.paddingRight)),[ye,Ne]),ke=u.useMemo(()=>{const he=h===0?1/0:h;return(t??[]).slice(0,he).map((We,Oe)=>({id:Oe,cells:Object.fromEntries(Jt.map(rt=>[rt,We[rt]??""])),image:We.image,link:We.link}))},[t,h]),Ye=ne?me??C:ke.length,nt=u.useMemo(()=>ne?ke.slice(0,Ye):ke,[ke,ne,Ye]),ot=ne&&Ye<ke.length,lo=nt.length>1||ot,co=[ie?`${s}-divider-top`:"",ue||lo?`${s}-divider-bottom`:""].filter(Boolean).join(" "),uo=()=>{const he=me??C;if(!y){O(ke.length);return}O(Math.min(he+y,ke.length))},Se=he=>T.scalingValue(he,n??!1),an=I?R??0:v??0,Pn=w??0,be=f??0,it=I?"rowPaddingTopB":"rowPaddingTop",Ke=ye[0],Ve=ye[ye.length-1],Xe=Ie[0],sn=Ie[Ie.length-1],Ar=Ke&&Xe?Math.max(Xe.paddingLeft,ln):0,ii=Ve&&sn?Math.max(sn.paddingRight,ln):0,Wr=Ae,Fr=he=>{if(!X)return;const xe=he.image;if(!(xe!=null&&xe.url)){Y(null);return}if((te==null?void 0:te.rowId)===he.id)return;const We=(L==null?void 0:L.min)??80,Oe=(L==null?void 0:L.max)??320;Y({rowId:he.id,url:xe.url,objectFit:xe.objectFit??"cover",widthPx:md(We,Oe)})},Ir=()=>{Y(null)},ri=u.useMemo(()=>!I&&Bt.some(he=>{const xe=he.charAt(0),We=e[`${he}VerticalAlign`];return Lr(We,e,xe)}),[I,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);return u.useLayoutEffect(()=>{var xt;const he=oe.current;if(!he)return;const xe=()=>{he.querySelectorAll("[data-list-col]").forEach(He=>{He.style.transform="";const Ue=He.querySelector(`.${s}-list-col-title`);Ue&&(Ue.style.paddingTop="",Ue.style.marginTop="")})};if(I||!ri){xe();return}const We=()=>{he.querySelectorAll("[data-list-row]").forEach(He=>{const Ue=Array.from(He.querySelectorAll("[data-list-col]"));Ue.forEach(Le=>{Le.style.transform="";const Ze=Le.querySelector(`.${s}-list-col-title`);Ze&&(Ze.style.paddingTop="",Ze.style.marginTop="")});const Ct=`${s}-baseline-probe`,Wt=new Map,Dt=Ue.map(Le=>{const Ze=Le.querySelector(`.${s}-list-col-title`),pt={el:Le,titleEl:Ze,letter:Le.getAttribute("data-col-letter")??"",kind:Le.getAttribute("data-valign")??"top",anchor:Le.getAttribute("data-valign-anchor")};return Wt.set(pt.letter,pt),pt}),Ft=new Map,An=(Le,Ze)=>{const pt=Ft.get(Le.letter);if(pt!==void 0)return pt;const It=Le.anchor?Wt.get(Le.anchor):void 0;if(Le.kind!=="baseline"||!It||Ze.has(Le.letter)){const si=bo(Le.titleEl,Ct);return Ft.set(Le.letter,si),si}Ze.add(Le.letter);const Rr=An(It,Ze);Ze.delete(Le.letter);const kr=bo(Le.titleEl,Ct),Mr=Rr-kr;Yc(Le.titleEl,Mr);const ai=bo(Le.titleEl,Ct);return Ft.set(Le.letter,ai),ai};Dt.forEach(Le=>An(Le,new Set))})};We();const Oe=new ResizeObserver(()=>We());Oe.observe(he);let rt=!1;return typeof document<"u"&&((xt=document.fonts)!=null&&xt.ready)&&document.fonts.ready.then(()=>{rt||We()}),()=>{rt=!0,Oe.disconnect(),xe()}},[ri,I,e,t,F,nt,Ne,ge]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Dc(s)}}),a.jsx("div",{style:K,children:a.jsxs("div",{ref:oe,className:`${s}-wrapper ${pe}${co?` ${co}`:""}${I?` ${s}-type-b`:""}`.trim(),style:{width:T.scalingValue($??0,n)},onMouseLeave:X?Ir:void 0,children:[a.jsxs("div",{style:{width:"100%"},children:[nt.map((he,xe)=>{var xt;const We=(((xt=he.link)==null?void 0:xt.length)??0)>0,Oe=We?"a":"div",rt=Bc(xe,nt.length,ie,ue,ot,m??0,n??!1);return a.jsxs(Oe,{className:`${s}-list-item`,...We?{href:he.link,target:"_blank"}:{},style:rt,onMouseEnter:X?()=>Fr(he):void 0,children:[(an>0||c)&&a.jsx("div",{...c?{"data-controls":it,"data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Se(an)}}),a.jsx("div",{className:`${s}-list-cols-row${I?"":` ${s}-list-cols-row-h`}`,...I?{}:{"data-list-row":""},style:I?void 0:{minHeight:Se(be)},children:ye.map((He,Ue)=>{const Ct=Ue===ye.length-1,Wt=Ie[Ue],Dt=He.paddingBottom,Ft=Hc(he.cells[He.key]),An=I&&Ft&&(Dt>0||c),Le=I?{minHeight:Se(be)}:Ct?{}:{width:Se(Ne[Ue])},Ze=I?{paddingLeft:Se(Z),paddingRight:Se(Z)}:{paddingLeft:Se(Wt.paddingLeft),paddingRight:Se(Wt.paddingRight)},pt=He.textPrefix.charAt(0),It=I?{kind:"top"}:Uc(e[`${He.textPrefix}VerticalAlign`],e,pt);return a.jsxs("div",{...I?{}:{"data-list-col":"","data-col-letter":pt,"data-valign":It.kind,...It.kind==="baseline"?{"data-valign-anchor":It.anchorLetter}:{}},children:[a.jsx("div",{className:`${s}-list-col${Ct?` ${s}-list-col-last`:""}`,style:{...Ze,...Le,...I?{}:{justifyContent:Gc(It.kind)}},"data-test":He.width,children:a.jsx("span",{className:`${s}-list-col-title`,style:ge[He.textPrefix]??ce,children:he.cells[He.key]??null})}),An&&a.jsx("div",{...c?{"data-controls":He.paddingBottomKey,"data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Se(Dt)}})]},He.key)})}),!I&&(Pn>0||c)&&a.jsx("div",{...c?{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-min":"0"}:{},className:`${s}-row-padding-handle`,style:{height:Se(Pn)}})]},he.id)}),ot&&a.jsx("div",{className:`${s}-cut-item`,style:{minHeight:Se(x??0),...Vc(ue,m??0,n??!1)},children:a.jsx("div",{className:`${s}-list-cols-row`,style:I?{paddingLeft:Se(Z),paddingRight:Se(Z)}:{justifyContent:"center"},children:a.jsx("button",{type:"button",className:`${s}-cut-label`,style:ce,onClick:uo,children:P})})})]}),c&&!I&&Ke&&Ve&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ke.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[0]-((Xe==null?void 0:Xe.paddingRight)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:0,width:Se(Ar),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":Ve.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[ye.length-1]-((sn==null?void 0:sn.paddingLeft)??0)),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Se(Wr-ii),width:Se(ii),height:"100%",pointerEvents:"auto",zIndex:2}})]},"column-edge-padding-handles"),c&&!I&&ye.slice(0,-1).map((he,xe)=>{const We=ye[xe+1],Oe=pd(xe,Be,Te,Ae),rt=Be.slice(0,xe+1).reduce((Dt,Ft)=>Dt+Ft,0),xt=Ie[xe],He=Ie[xe+1],Ue=Math.max(xt.paddingRight,ln),Ct=Math.max(He.paddingLeft,ln),Wt=rt-ki/2;return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":he.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[xe]-xt.paddingLeft),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Se(rt-Ue),width:Se(Ue),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":he.widthKey,"data-controls-axis":"x","data-controls-min":String(ni),"data-controls-max-fraction":String(Oe),"data-controls-variant":"column-width",className:`${s}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Se(Wt),width:Se(ki),height:"calc(100%)",pointerEvents:"auto",zIndex:4}}),a.jsx("div",{"data-controls":We.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[xe+1]-He.paddingRight),"data-controls-static-handle":"",className:`${s}-padding-control-handle`,style:{position:"absolute",top:0,left:Se(rt),width:Se(Ct),height:"100%",pointerEvents:"auto",zIndex:2}})]},`${he.widthKey}-junction`)}),c&&I&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(le),"data-controls-static-handle":"",className:`${s}-text-padding-lr-handle`,style:{position:"absolute",top:0,left:0,width:Se(se),height:"100%",pointerEvents:"auto",zIndex:2}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(le),"data-controls-static-handle":"",className:`${s}-text-padding-lr-handle`,style:{position:"absolute",top:0,left:Se(Math.max(se,Ae-se)),width:Se(se),height:"100%",pointerEvents:"auto",zIndex:2}})]},"text-padding-lr-handles"),X&&te&&a.jsx("img",{className:`${s}-hover-image`,src:te.url,alt:"",style:{width:Dn(te.widthPx),objectFit:te.objectFit}})]})})]})}const yd=`import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4802
|
+
`}const Wt=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ci=["AColumn","BColumn","CColumn","DColumn","EColumn"],St="cutLabel",bo=[...ci,St],di=["A","B","C","D","E"];function Nr(e){return`${e}ColumnVerticalAlign`}const Oo=["Top","Center","Bottom"];function od(e){const t=String(e??"Top").trim();return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function id(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return di.includes(n)?n:null}function Hr(e,t,n){const o=id(e);return o?o===t?!1:od(n[Nr(o)]):!0}function $n(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return di.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function rd(e,t,n){if(Br(e,t,n))return $n(e);const o=$n(e);return o.kind==="baseline"?{kind:"top"}:o}function ad(e){const t=$n(e);return t.kind==="baseline"?{kind:"top"}:t}function Br(e,t,n){return Hr(e,n,t)?$n(e).kind==="baseline":!1}function sd(e){const t={};let n=!1;for(const o of di){const r=Nr(o),a=e[r];if(e.type==="B"){const i=String(a??"Top").trim();i!=="Top"&&i!=="Center"&&i!=="Bottom"&&(t[r]="Top",n=!0);continue}Hr(a,o,e)||(t[r]="Top",n=!0)}return n?t:null}function ld(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function cd(e){const t=$n(e).kind;return t==="baseline"?"center":t}function dd(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function ji(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function ud(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:o}=e.getBoundingClientRect(),{bottom:r}=n.getBoundingClientRect(),a=r-o;return n.remove(),a}function Po(e,t,n,o){const r=e.titleEl;if(!r)return 0;const a=r.closest(`.${n}`);if(!a)return 0;const i=ud(r,o);if(e.kind==="baseline")return r.getBoundingClientRect().top-t+i;const c=a.getBoundingClientRect(),s=r.getBoundingClientRect().height;let d=0;return e.kind==="center"?d=(c.height-s)/2:e.kind==="bottom"&&(d=c.height-s),c.top-t+d+i}function pd(e,t,n){const o=e.getBoundingClientRect().height;return o<=0?0:(t.forEach(r=>{const a=r.querySelector(`.${n}`);a&&(a.style.minHeight=`${o}px`,a.style.height=`${o}px`)}),e.offsetHeight,o)}function md(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const gd={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Le(e,t){return`${e}${t.replace(/^text/,"Text")}`}const hd={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function fd(e){return[Le(e,"textFontFamily"),Le(e,"textFontSettings"),{type:"row",items:[Le(e,"textFontSize"),Le(e,"textLineHeight"),Le(e,"textLetterSpacing"),Le(e,"textWordSpacing")]},Le(e,"textTextAlign"),Le(e,"textTextAppearance"),`${e}VerticalAlign`]}function yd(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(bo.map(e=>[hd[e],fd(e)]))}}function ro(e,t){const n=o=>{const r=Le(t,o);return e[r]};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===St?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function zi(e,t){var o,r;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((o=e.textFontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((r=e.textFontSettings)==null?void 0:r.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 mt(Ge(n,t))}function Ki(e,t,n,o){const r=ro(e,t),a=r.textFontSize??.01,i=r.textLineHeight;return i!==void 0&&i<a?`${n} ${o}`:n}function qi(e,t,n,o){const r=ro(e,t),a=r.textFontSize??.01,i=r.textLineHeight;return i===void 0||i>=a?{}:{[`--${n}-title-leading-gap`]:E.scalingValue((a-i)/2,o)}}const it=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],rn=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],an=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],sn=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],vd={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},bd=["hover","focus","filled","success","error"],Ui=.004,Zt=.004,_o=Zt,Gi=12,ui=50,Tn=1440,Ln=ui/Tn;function Or(e){const t=typeof e=="number"&&e>0?e:Tn;return ui/t}function xd(e,t){const n={position:"absolute",width:Gi,height:Gi,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 yt({P:e,className:t,areaStyle:n,hitPlacement:o,...r}){return l.jsx("div",{className:t,style:{...n,pointerEvents:"none"},...r,children:l.jsx("div",{style:xd(e,o)})})}function Cd(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const r=parseFloat(n);if(Number.isFinite(r)&&r>0)return r}const o=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(o){const r=parseFloat(o);if(Number.isFinite(r)&&r>0)return r}t=t.parentElement}return Tn}const Vr={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Jn(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Sd(e,t=1){const n=t/e;return Object.fromEntries(it.map(o=>[o,n]))}function wd(){return Object.fromEntries([...rn.map(e=>[e,0]),...an.map(e=>[e,0])])}function $d(){return Object.fromEntries(sn.map(e=>[e,0]))}function Kn(e){return Object.fromEntries(it.map(t=>[t,typeof e[t]=="number"?e[t]:Vr[t]]))}function Dr(e,t,n){const o=e-Ln,r=t+n;if(r<=0||r<=o)return{paddingLeft:t,paddingRight:n};if(o<=0)return{paddingLeft:0,paddingRight:0};const a=o/r;return{paddingLeft:t*a,paddingRight:n*a}}function Qn(e,t,n){const o=pi(e,t,n);if(e<=0)return[];const r=o.slice(0,e-1).reduce((a,i)=>a+i,0);return[...o.slice(0,e-1),Math.max(0,t-r)]}function Td(e,t,n){const o={};for(let r=0;r<e;r+=1){const a=rn[r],i=an[r],c=typeof n[a]=="number"?n[a]:0,s=typeof n[i]=="number"?n[i]:0,d=Dr(t[r]??0,c,s);d.paddingLeft!==c&&(o[a]=d.paddingLeft),d.paddingRight!==s&&(o[i]=d.paddingRight)}return o}function pi(e,t,n){if(e<=0)return[];const o=it.slice(0,e).map(d=>n[d]);if(e===1)return o;const r=o.slice(0,e-1),i=r.reduce((d,u)=>d+u,0)+Ln;if(t>=i)return o;const c=[...r];let s=i-t;for(let d=c.length-1;d>=0&&s>0;d-=1){const u=c[d]-Ln;if(u<=0)continue;const P=Math.min(s,u);c[d]-=P,s-=P}return[...c,o[e-1]]}function Ld(e,t,n){if(e<=1)return{};const o=pi(e,t,n),r={};for(let a=0;a<e-1;a+=1){const i=it[a];o[a]!==n[i]&&(r[i]=o[a])}return r}function Yi(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Wt]}function Ed(e,t){return e.length!==t.length?!1:e.every((n,o)=>n===t[o])}function Pd(e,t,n,o){const r=Math.min(o,e.length,it.length),a={};for(let i=0;i<r;i+=1){const c=e[i],s=t.indexOf(c);if(s===-1)continue;const d=it[s],u=rn[s],P=an[s],v=sn[s],x=it[i],h=rn[i],g=an[i],T=sn[i],L=n[d],b=n[u],m=n[P],H=n[v];typeof L=="number"&&(a[x]=L),typeof b=="number"&&(a[h]=b),typeof m=="number"&&(a[g]=m),typeof H=="number"&&(a[T]=H)}return a}function _d(e,t,n){const o=sd(e);o&&(e={...e,...o});const r=Or(n==null?void 0:n.designWidth),a=e.columns,i=t.columns,c=Jn(e),s=Jn(t),d=e.type==="B"||e.type===void 0&&t.type==="B",u=typeof a=="number"?a:typeof i=="number"?i:Wt.length,P=m=>{if(d)return m;const H=Kn({...t,...m}),F=Jn(m),_=Qn(u,F,H),C=Td(u,_,{...t,...m});return Object.keys(C).length===0?m:{...m,...C}};if(typeof a=="number"&&a!==i){const m={...e,...Sd(a,c),...wd()};if(d)for(const H of sn)typeof t[H]=="number"&&(m[H]=t[H]);else Object.assign(m,$d());return m}const v=Yi(e),x=Yi(t);if(!Ed(v,x))return P({...e,...Pd(v,x,t,u)});if(c<s&&typeof u=="number"&&!d){const m=Kn({...t,...e});return P({...e,...Ld(u,c,m)})}if(d){const m=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(c-r)/2);return m>H?{...e,textPaddingLR:H}:e}const h=Kn({...t,...e}),g=Qn(u,s,Kn(t)),L=Qn(u,c,h).some((m,H)=>m<(g[H]??m)),b=it.some(m=>{const H=e[m],F=t[m];return typeof H=="number"&&typeof F=="number"&&H!==F});return L||b?P(e):e}function Ad(e,t,n,o){const r=t.slice(0,e).reduce((i,c)=>i+c,0),a=n.slice(e+1,t.length-1).reduce((i,c)=>i+c,0);return Math.max(Ln,o-r-a-Ln)}function Rd(e,t){return Math.random()*(t-e)+e}function Wd(e){return Object.fromEntries(it.map(t=>[t,typeof e[t]=="number"?e[t]:Vr[t]]))}function Ao(e,t,n=0){return Object.fromEntries(t.map(o=>[o,typeof e[o]=="number"?e[o]:n]))}function Id(e,t,n,o,r,a){return e.slice(0,t).map((i,c)=>{const s=rn[c],d=an[c],u=sn[c];return{key:i,textPrefix:gd[i],widthKey:it[c],width:n[it[c]],paddingLeftKey:s,paddingRightKey:d,paddingBottomKey:u,paddingLeft:o[s],paddingRight:r[d],paddingBottom:a[u]}})}function kd({settings:e,content:t,isEditor:n,isPreviewMode:o,isEditMode:r,activeEvent:a,layoutId:i,onUpdateSettings:c}){const{prefix:s}=E.useScopedStyles(),d=!!r,{columns:u,type:P,wrapperWidth:v,entriesCount:x,cellMinHeight:h,dividerWidth:g,showVisibility:T,cut:L,showCut:b,cutCellMinHeight:m,cutLabel:H,imageSize:F,imageOnHover:_,entryHoverEffect:C,rowPaddingTop:W,rowPaddingBottom:w,rowPaddingTopB:O,columnsOrder:S,textPaddingLR:V,textColor:D,backgroundColor:Z,dividerColor:q,textHoverColor:$,backgroundHoverColor:k,dividerHoverColor:R}=e,[B,I]=p.useState(void 0),[A,Q]=p.useState(null),ie=_==="On"&&(!n||o),re=(L??0)>0,U=P==="B",M=p.useRef(null),oe=p.useRef(null),[Ce,ue]=p.useState(null),[fe,Re]=p.useState(Tn),ne=Or(fe),y=Math.max(0,((v??0)-ne)/2),f=Math.min(V??0,y),N=Math.max(f,Zt),K=((v??0)+ne)/2;p.useLayoutEffect(()=>{if(!n){Re(Tn);return}const se=()=>{Re(Cd(M.current))};se();const pe=M.current;if(!pe)return;const ge=new ResizeObserver(se);ge.observe(pe);let _e=pe;for(;_e&&!_e.style.getPropertyValue("--cntrl-article-width");)_e=_e.parentElement;return _e&&ge.observe(_e),()=>ge.disconnect()},[n,i]),p.useEffect(()=>{I(void 0)},[L,b,t,x]);const G=E.buildColorVars(s,{textColor:D,backgroundColor:Z,dividerColor:q,textHoverColor:$,backgroundHoverColor:k,dividerHoverColor:R},vd,bd),ee=a&&a!=="default"?`${s}-state-${a}`:"",X=`${C==="Default"?`${s}-entry-hover-default`:C==="Blinds"?`${s}-entry-hover-blinds`:""} ${ee}`.trim(),ce=(T==null?void 0:T[0])??!1,ve=(T==null?void 0:T[1])??!1,de=p.useRef(e),xe=p.useRef(i);p.useEffect(()=>{if(!c||!n){de.current=e,xe.current=i;return}if(xe.current!==i){de.current=e,xe.current=i;return}const se=de.current;if(!(se!==e))return;const ge=_d(e,se,{designWidth:fe});de.current=e,ge!==e&&c(ge)},[e,c,n,i,fe]);const z=p.useMemo(()=>Wd(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Y=p.useMemo(()=>Ao(e,rn),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),j=p.useMemo(()=>Ao(e,an),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),le=p.useMemo(()=>Ao(e,sn),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),we=p.useMemo(()=>Array.isArray(S)&&S.length>0?S:[...Wt],[S]),Se=p.useMemo(()=>Id(we,u,z,Y,j,le),[we,u,z,Y,j,le]),Ne=Jn(e),ye=p.useMemo(()=>it.slice(0,u).map(se=>z[se]),[u,z]),He=p.useMemo(()=>pi(u,Ne,z),[u,Ne,z]),ke=p.useMemo(()=>Qn(u,Ne,z),[u,Ne,z]),We=p.useMemo(()=>Se.map((se,pe)=>Dr(ke[pe]??0,se.paddingLeft,se.paddingRight)),[Se,ke]),Oe=p.useMemo(()=>{const se=x===0?1/0:x;return(t??[]).slice(0,se).map((ge,_e)=>({id:_e,cells:Object.fromEntries(Wt.map(qe=>[qe,ge[qe]??""])),image:ge.image,link:ge.link}))},[t,x]),Ye=re?B??L:Oe.length,ct=p.useMemo(()=>re?Oe.slice(0,Ye):Oe,[Oe,re,Ye]),Tt=re&&Ye<Oe.length,Ze=ct.length>1||Tt,qt=[ce?`${s}-divider-top`:"",ve||Ze?`${s}-divider-bottom`:""].filter(Boolean).join(" "),dt=()=>{const se=B??L;if(!b){I(Oe.length);return}I(Math.min(se+b,Oe.length))},be=se=>E.scalingValue(se,n??!1),Je=U?O??0:W??0,Qe=w??0,et=h??0,Mt=(Je+et+Qe)/2,Fn=Math.max(Qe,_o),pn=Ce!=null?`${Ce/2}px`:be(Mt),Nt=U?"rowPaddingTopB":"rowPaddingTop",Ee=Se[0],De=Se[Se.length-1],me=We[0],Ie=We[We.length-1],Ve=Ee&&me?Math.max(me.paddingLeft,Zt):0,Me=De&&Ie?Math.max(Ie.paddingRight,Zt):0,ut=Ne,Mn=se=>{const pe=M.current;if(!pe)return{x:0,y:0};const ge=pe.getBoundingClientRect();return{x:se.clientX-ge.left+Di,y:se.clientY-ge.top+Di}},zr=(se,pe)=>{if(!ie)return;const ge=se.image;if(!(ge!=null&&ge.url)){Q(null);return}const{x:_e,y:qe}=Mn(pe),tt=(F==null?void 0:F.min)??80,$e=(F==null?void 0:F.max)??320,je=(A==null?void 0:A.rowId)===se.id?A.widthPx:Rd(tt,$e);Q({rowId:se.id,url:ge.url,objectFit:ge.objectFit??"cover",widthPx:je,x:_e,y:qe})},Kr=se=>{if(!ie||!A)return;const{x:pe,y:ge}=Mn(se);Q(_e=>!_e||_e.x===pe&&_e.y===ge?_e:{..._e,x:pe,y:ge})},qr=()=>{Q(null)},Ur=()=>{ie&&Q(null)};p.useLayoutEffect(()=>{if(!d||U){ue(null);return}const se=oe.current;if(!se){ue(null);return}const pe=()=>{ue(se.getBoundingClientRect().height)};pe();const ge=new ResizeObserver(pe);return ge.observe(se),()=>ge.disconnect()},[d,U,ct,Je,Qe,et,t,e,Se,ke,fe]);const mi=p.useMemo(()=>!U&&ci.some(se=>{const pe=se.charAt(0),ge=e[`${se}VerticalAlign`];return Br(ge,e,pe)}),[U,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);return p.useLayoutEffect(()=>{var tt;const se=M.current;if(!se)return;const pe=()=>{se.querySelectorAll("[data-list-col]").forEach($e=>{$e.style.transform="";const je=$e.querySelector(`.${s}-list-col`);je&&(je.style.minHeight="",je.style.height="");const pt=$e.querySelector(`.${s}-list-col-title`);pt&&(pt.style.transform="")})};if(U||!mi){pe();return}const ge=()=>{se.querySelectorAll("[data-list-row]").forEach($e=>{const je=Array.from($e.querySelectorAll("[data-list-col]"));je.forEach(Pe=>{Pe.style.transform="";const Xe=Pe.querySelector(`.${s}-list-col`);Xe&&(Xe.style.minHeight="",Xe.style.height="");const ze=Pe.querySelector(`.${s}-list-col-title`);ze&&(ze.style.transform="")}),pd($e,je,`${s}-list-col`),$e.offsetHeight;const pt=$e.getBoundingClientRect().top,Lt=`${s}-baseline-probe`,Ut=new Map,Nn=je.map(Pe=>{const Xe=Pe.querySelector(`.${s}-list-col-title`),ze={el:Pe,titleEl:Xe,letter:Pe.getAttribute("data-col-letter")??"",kind:Pe.getAttribute("data-valign")??"top",anchor:Pe.getAttribute("data-valign-anchor")};return Ut.set(ze.letter,ze),ze}),mn=new Map,Hn=(Pe,Xe)=>{const ze=mn.get(Pe.letter);if(ze!==void 0)return ze;const Bn=Pe.anchor?Ut.get(Pe.anchor):void 0;if(Pe.kind!=="baseline"||!Bn||Xe.has(Pe.letter)){const hi=Po(Pe,pt,`${s}-list-col`,Lt);return mn.set(Pe.letter,hi),hi}Xe.add(Pe.letter);const Gr=Hn(Bn,Xe);Xe.delete(Pe.letter);const Yr=Po(Pe,pt,`${s}-list-col`,Lt),Xr=Gr-Yr;md(Pe.titleEl,Xr);const gi=Po(Pe,pt,`${s}-list-col`,Lt);return mn.set(Pe.letter,gi),gi};Nn.forEach(Pe=>Hn(Pe,new Set))})};ge();const _e=new ResizeObserver(()=>ge());_e.observe(se);let qe=!1;return typeof document<"u"&&((tt=document.fonts)!=null&&tt.ready)&&document.fonts.ready.then(()=>{qe||ge()}),()=>{qe=!0,_e.disconnect(),pe()}},[mi,U,e,t,fe,ct,ke]),l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:nd(s)}}),l.jsx("div",{style:G,children:l.jsxs("div",{ref:M,className:`${s}-wrapper ${X}${qt?` ${qt}`:""}${U?` ${s}-type-b`:""}`.trim(),style:{width:E.scalingValue(v??0,n),...!U&&d?{[`--${s}-first-entry-handle-top`]:pn}:{}},onMouseMove:ie?Kr:void 0,onMouseLeave:ie?qr:void 0,children:[l.jsxs("div",{style:{width:"100%"},children:[ct.map((se,pe)=>{var tt;const ge=(((tt=se.link)==null?void 0:tt.length)??0)>0,_e=ge?"a":"div",qe=ed(pe,ct.length,ce,ve,Tt,g??0,n??!1);return l.jsxs(_e,{ref:pe===0?$e=>{oe.current=$e}:void 0,className:`${s}-list-item${ge?` ${s}-list-item-has-link`:""}`,...ge?{href:se.link,target:"_blank"}:{},style:qe,onMouseEnter:ie?$e=>zr(se,$e):void 0,children:[Je>0&&l.jsx("div",{className:`${s}-row-padding-handle`,style:{height:be(Je)}}),l.jsxs("div",{className:`${s}-list-cols-row${U?"":` ${s}-list-cols-row-h`}${d&&pe===0&&U?` ${s}-list-cols-row-controls`:""}`,...U?{}:{"data-list-row":""},style:U?void 0:{minHeight:be(et)},children:[Se.map(($e,je)=>{const pt=je===Se.length-1,Lt=We[je],Ut=$e.paddingBottom,Nn=Qc(se.cells[$e.key]),mn=U&&Nn&&Ut>0,Hn=U?{minHeight:be(et)}:{width:be(ke[je])},Pe=U?{paddingLeft:be(f),paddingRight:be(f)}:{paddingLeft:be(Lt.paddingLeft),paddingRight:be(Lt.paddingRight)},Xe=$e.textPrefix.charAt(0),ze=U?ad(e[`${$e.textPrefix}VerticalAlign`]):rd(e[`${$e.textPrefix}VerticalAlign`],e,Xe),Bn=U&&Nn&&d&&pe===0;return l.jsxs("div",{className:U?`${s}-list-col-wrap`:void 0,...U?{}:{"data-list-col":"","data-col-letter":Xe,"data-valign":ze.kind,...ze.kind==="baseline"?{"data-valign-anchor":ze.anchorLetter}:{}},children:[l.jsx("div",{className:`${s}-list-col${pt?` ${s}-list-col-last`:""}`,style:{...Pe,...Hn,...U?{justifyContent:ji(ze.kind)}:{}},"data-test":$e.width,children:l.jsx("span",{className:Ki(e,$e.textPrefix,`${s}-list-col-title`,`${s}-text-tight-leading`),style:{...zi(ro(e,$e.textPrefix),n),...qi(e,$e.textPrefix,s,n),...U?{}:ld(ze.kind)},children:se.cells[$e.key]??null})}),mn&&l.jsx("div",{className:`${s}-row-padding-handle`,style:{height:be(Ut)}}),Bn&&l.jsx(yt,{P:s,"data-controls":$e.paddingBottomKey,"data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:be(Math.max(Ut,_o))}})]},$e.key)}),d&&pe===0&&U&&l.jsxs(l.Fragment,{children:[l.jsx(yt,{P:s,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(K),className:`${s}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:0,width:be(N),height:"100%"}}),l.jsx(yt,{P:s,"data-controls":"textPaddingLR","data-controls-static-handle":"","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(K),className:`${s}-text-padding-lr-handle`,hitPlacement:"center",areaStyle:{position:"absolute",top:0,left:be(Math.max(N,Ne-N)),width:be(N),height:"100%"}})]})]}),!U&&Qe>0&&l.jsx("div",{className:`${s}-row-padding-handle`,style:{height:be(Qe)}}),d&&pe===0&&!U&&l.jsx(yt,{P:s,"data-controls":"rowPaddingBottom","data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",bottom:0,left:0,width:"100%",height:be(Fn)}})]},se.id)}),Tt&&(()=>{const se=ro(e,St),pe=cd(e.cutLabelVerticalAlign),ge=se.textTextAlign==="justify"||U;return l.jsx("button",{type:"button",className:`${s}-cut-item`,style:{minHeight:be(m??0),...td(ve,g??0,n??!1)},onClick:dt,onMouseEnter:ie?Ur:void 0,children:l.jsx("div",{className:`${s}-list-cols-row`,style:{...U?{paddingLeft:be(f),paddingRight:be(f)}:{},justifyContent:dd(se.textTextAlign),alignItems:ji(pe)},children:l.jsx("span",{className:Ki(e,St,`${s}-cut-label`,`${s}-text-tight-leading`),style:{...zi(se,n),...qi(e,St,s,n),...ge?{width:"100%"}:{}},children:H})})})})()]}),d&&l.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:l.jsx(yt,{P:s,"data-controls":Nt,"data-controls-static-handle":"","data-controls-handle-left":"20","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-padding-control-handle`,hitPlacement:"left-y",areaStyle:{position:"absolute",top:0,left:0,width:"100%",height:be(Math.max(Je,_o))}})},"row-padding-handles"),d&&!U&&Ee&&De&&l.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[l.jsx(yt,{P:s,"data-controls":Ee.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ke[0]-((me==null?void 0:me.paddingRight)??0)),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:0,width:be(Ve),height:"100%"}}),l.jsx(yt,{P:s,"data-controls":De.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(ke[Se.length-1]-((Ie==null?void 0:Ie.paddingLeft)??0)),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:be(ut-Me),width:be(Me),height:"100%"}})]},"column-edge-padding-handles"),d&&!U&&Se.slice(0,-1).map((se,pe)=>{const ge=Se[pe+1],_e=He.slice(0,pe+1).reduce((pt,Lt)=>pt+Lt,0),qe=We[pe],tt=We[pe+1],$e=Math.max(qe.paddingRight,Zt),je=Math.max(tt.paddingLeft,Zt);return l.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[l.jsx(yt,{P:s,"data-controls":se.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(ke[pe]-qe.paddingLeft),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:be(_e-$e),width:be($e),height:"100%"}}),l.jsx(yt,{P:s,"data-controls":ge.paddingLeftKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ke[pe+1]-tt.paddingRight),className:`${s}-padding-control-handle`,hitPlacement:"center-x",areaStyle:{position:"absolute",top:0,left:be(_e),width:be(je),height:"100%"}})]},`${se.paddingRightKey}-padding`)}),d&&!U&&Se.slice(0,-1).map((se,pe)=>{const ge=Ad(pe,He,ye,Ne),qe=He.slice(0,pe+1).reduce((tt,$e)=>tt+$e,0)-Ui/2;return l.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:l.jsx("div",{"data-controls":se.widthKey,"data-controls-static-handle":"","data-controls-axis":"x","data-controls-min":String(ui),"data-controls-max-fraction":String(ge),"data-controls-variant":"column-width",className:`${s}-col-resize-handle`,style:{position:"absolute",top:"0px",left:be(qe),width:be(Ui),height:"calc(100%)",pointerEvents:"auto"}})},`${se.widthKey}-junction`)}),ie&&A&&l.jsx("img",{className:`${s}-hover-image`,src:A.url,alt:"",style:{width:Zn(A.widthPx),objectFit:A.objectFit,left:A.x,top:A.y}})]})})]})}const Fd=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ComponentPropsWithoutRef } from 'react';
|
|
4638
4803
|
import { CommonComponentProps } from '../props';
|
|
4639
4804
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
4640
4805
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
4806
|
+
import type { LayoutItem, LayoutTab } from '../../types/SchemaV1';
|
|
4641
4807
|
|
|
4642
4808
|
type ListFontSettings = { fontWeight: number; fontStyle: string };
|
|
4643
4809
|
|
|
@@ -4651,6 +4817,7 @@ type ListColumnTextStyleOverrides = {
|
|
|
4651
4817
|
AColumnTextLineHeight?: number;
|
|
4652
4818
|
AColumnTextLetterSpacing?: number;
|
|
4653
4819
|
AColumnTextWordSpacing?: number;
|
|
4820
|
+
AColumnTextTextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
4654
4821
|
AColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4655
4822
|
BColumnVerticalAlign?: string;
|
|
4656
4823
|
BColumnTextFontFamily?: string;
|
|
@@ -4659,6 +4826,7 @@ type ListColumnTextStyleOverrides = {
|
|
|
4659
4826
|
BColumnTextLineHeight?: number;
|
|
4660
4827
|
BColumnTextLetterSpacing?: number;
|
|
4661
4828
|
BColumnTextWordSpacing?: number;
|
|
4829
|
+
BColumnTextTextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
4662
4830
|
BColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4663
4831
|
CColumnVerticalAlign?: string;
|
|
4664
4832
|
CColumnTextFontFamily?: string;
|
|
@@ -4667,6 +4835,7 @@ type ListColumnTextStyleOverrides = {
|
|
|
4667
4835
|
CColumnTextLineHeight?: number;
|
|
4668
4836
|
CColumnTextLetterSpacing?: number;
|
|
4669
4837
|
CColumnTextWordSpacing?: number;
|
|
4838
|
+
CColumnTextTextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
4670
4839
|
CColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4671
4840
|
DColumnVerticalAlign?: string;
|
|
4672
4841
|
DColumnTextFontFamily?: string;
|
|
@@ -4675,6 +4844,7 @@ type ListColumnTextStyleOverrides = {
|
|
|
4675
4844
|
DColumnTextLineHeight?: number;
|
|
4676
4845
|
DColumnTextLetterSpacing?: number;
|
|
4677
4846
|
DColumnTextWordSpacing?: number;
|
|
4847
|
+
DColumnTextTextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
4678
4848
|
DColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4679
4849
|
EColumnVerticalAlign?: string;
|
|
4680
4850
|
EColumnTextFontFamily?: string;
|
|
@@ -4683,7 +4853,17 @@ type ListColumnTextStyleOverrides = {
|
|
|
4683
4853
|
EColumnTextLineHeight?: number;
|
|
4684
4854
|
EColumnTextLetterSpacing?: number;
|
|
4685
4855
|
EColumnTextWordSpacing?: number;
|
|
4856
|
+
EColumnTextTextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
4686
4857
|
EColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4858
|
+
cutLabelTextFontFamily?: string;
|
|
4859
|
+
cutLabelTextFontSettings?: ListFontSettings;
|
|
4860
|
+
cutLabelTextFontSize?: number;
|
|
4861
|
+
cutLabelTextLineHeight?: number;
|
|
4862
|
+
cutLabelTextLetterSpacing?: number;
|
|
4863
|
+
cutLabelTextWordSpacing?: number;
|
|
4864
|
+
cutLabelTextTextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
4865
|
+
cutLabelTextTextAppearance?: TextStyles['textAppearance'];
|
|
4866
|
+
cutLabelVerticalAlign?: string;
|
|
4687
4867
|
};
|
|
4688
4868
|
|
|
4689
4869
|
export type ListColumnVerticalAlignKey = \`\${ListColumnPrefix}VerticalAlign\`;
|
|
@@ -4696,44 +4876,6 @@ type ListColumnVerticalAlignUpdates = {
|
|
|
4696
4876
|
EColumnVerticalAlign?: string;
|
|
4697
4877
|
};
|
|
4698
4878
|
|
|
4699
|
-
type ListColumnTextStyleSyncUpdates = {
|
|
4700
|
-
AColumnTextFontFamily?: string;
|
|
4701
|
-
AColumnTextFontSettings?: ListFontSettings;
|
|
4702
|
-
AColumnTextFontSize?: number;
|
|
4703
|
-
AColumnTextLineHeight?: number;
|
|
4704
|
-
AColumnTextLetterSpacing?: number;
|
|
4705
|
-
AColumnTextWordSpacing?: number;
|
|
4706
|
-
AColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4707
|
-
BColumnTextFontFamily?: string;
|
|
4708
|
-
BColumnTextFontSettings?: ListFontSettings;
|
|
4709
|
-
BColumnTextFontSize?: number;
|
|
4710
|
-
BColumnTextLineHeight?: number;
|
|
4711
|
-
BColumnTextLetterSpacing?: number;
|
|
4712
|
-
BColumnTextWordSpacing?: number;
|
|
4713
|
-
BColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4714
|
-
CColumnTextFontFamily?: string;
|
|
4715
|
-
CColumnTextFontSettings?: ListFontSettings;
|
|
4716
|
-
CColumnTextFontSize?: number;
|
|
4717
|
-
CColumnTextLineHeight?: number;
|
|
4718
|
-
CColumnTextLetterSpacing?: number;
|
|
4719
|
-
CColumnTextWordSpacing?: number;
|
|
4720
|
-
CColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4721
|
-
DColumnTextFontFamily?: string;
|
|
4722
|
-
DColumnTextFontSettings?: ListFontSettings;
|
|
4723
|
-
DColumnTextFontSize?: number;
|
|
4724
|
-
DColumnTextLineHeight?: number;
|
|
4725
|
-
DColumnTextLetterSpacing?: number;
|
|
4726
|
-
DColumnTextWordSpacing?: number;
|
|
4727
|
-
DColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4728
|
-
EColumnTextFontFamily?: string;
|
|
4729
|
-
EColumnTextFontSettings?: ListFontSettings;
|
|
4730
|
-
EColumnTextFontSize?: number;
|
|
4731
|
-
EColumnTextLineHeight?: number;
|
|
4732
|
-
EColumnTextLetterSpacing?: number;
|
|
4733
|
-
EColumnTextWordSpacing?: number;
|
|
4734
|
-
EColumnTextTextAppearance?: TextStyles['textAppearance'];
|
|
4735
|
-
};
|
|
4736
|
-
|
|
4737
4879
|
export type ListSettings = {
|
|
4738
4880
|
columns: number;
|
|
4739
4881
|
type: 'A' | 'B';
|
|
@@ -4775,13 +4917,6 @@ export type ListSettings = {
|
|
|
4775
4917
|
columnsOrder?: string[];
|
|
4776
4918
|
textPaddingLR?: number;
|
|
4777
4919
|
textColor: string;
|
|
4778
|
-
textFontFamily: string;
|
|
4779
|
-
textFontSettings?: ListFontSettings;
|
|
4780
|
-
textFontSize?: number;
|
|
4781
|
-
textLineHeight?: number;
|
|
4782
|
-
textLetterSpacing?: number;
|
|
4783
|
-
textWordSpacing?: number;
|
|
4784
|
-
textTextAppearance?: TextStyles['textAppearance'];
|
|
4785
4920
|
backgroundColor: string;
|
|
4786
4921
|
dividerColor: string;
|
|
4787
4922
|
textHoverColor: string;
|
|
@@ -4815,6 +4950,8 @@ type HoverImageState = {
|
|
|
4815
4950
|
url: string;
|
|
4816
4951
|
objectFit: 'cover' | 'contain';
|
|
4817
4952
|
widthPx: number;
|
|
4953
|
+
x: number;
|
|
4954
|
+
y: number;
|
|
4818
4955
|
};
|
|
4819
4956
|
|
|
4820
4957
|
type ListProps = {
|
|
@@ -4823,6 +4960,8 @@ type ListProps = {
|
|
|
4823
4960
|
content?: ListContentItem[];
|
|
4824
4961
|
isEditor?: boolean;
|
|
4825
4962
|
isPreviewMode?: boolean;
|
|
4963
|
+
isEditMode?: boolean;
|
|
4964
|
+
isEditMode?: boolean;
|
|
4826
4965
|
activeEvent: string | undefined;
|
|
4827
4966
|
onUpdateSettings?: (settings: ListSettings) => void;
|
|
4828
4967
|
} & CommonComponentProps;
|
|
@@ -4870,6 +5009,8 @@ function getCutItemDividerWidths(
|
|
|
4870
5009
|
};
|
|
4871
5010
|
}
|
|
4872
5011
|
|
|
5012
|
+
const HOVER_IMAGE_CURSOR_OFFSET = 10;
|
|
5013
|
+
|
|
4873
5014
|
function getCSS(P: string): string {
|
|
4874
5015
|
return \`
|
|
4875
5016
|
.\${P}-wrapper {
|
|
@@ -4883,8 +5024,8 @@ function getCSS(P: string): string {
|
|
|
4883
5024
|
|
|
4884
5025
|
.\${P}-hover-image {
|
|
4885
5026
|
position: absolute;
|
|
4886
|
-
|
|
4887
|
-
|
|
5027
|
+
left: 0;
|
|
5028
|
+
top: 0;
|
|
4888
5029
|
z-index: 10;
|
|
4889
5030
|
pointer-events: none;
|
|
4890
5031
|
display: block;
|
|
@@ -4925,24 +5066,34 @@ function getCSS(P: string): string {
|
|
|
4925
5066
|
}
|
|
4926
5067
|
|
|
4927
5068
|
.\${P}-list-cols-row-h [data-list-col] {
|
|
4928
|
-
display:
|
|
4929
|
-
|
|
5069
|
+
display: grid;
|
|
5070
|
+
grid-template-rows: minmax(0, 1fr);
|
|
4930
5071
|
align-self: stretch;
|
|
4931
|
-
min-height:
|
|
5072
|
+
min-height: min-content;
|
|
4932
5073
|
}
|
|
4933
5074
|
|
|
4934
5075
|
.\${P}-list-cols-row-h .\${P}-list-col {
|
|
4935
|
-
flex: 1;
|
|
4936
5076
|
display: flex;
|
|
4937
5077
|
flex-direction: column;
|
|
4938
5078
|
align-items: flex-start;
|
|
5079
|
+
justify-content: flex-start;
|
|
5080
|
+
width: 100%;
|
|
5081
|
+
min-height: 0;
|
|
4939
5082
|
}
|
|
4940
5083
|
|
|
4941
5084
|
.\${P}-list-cols-row-h .\${P}-list-col-title {
|
|
4942
|
-
|
|
5085
|
+
display: block;
|
|
5086
|
+
flex: 0 0 auto;
|
|
4943
5087
|
align-self: stretch;
|
|
4944
5088
|
}
|
|
4945
5089
|
|
|
5090
|
+
.\${P}-text-tight-leading {
|
|
5091
|
+
display: block;
|
|
5092
|
+
flex-shrink: 0;
|
|
5093
|
+
padding-top: var(--\${P}-title-leading-gap, 0);
|
|
5094
|
+
padding-bottom: var(--\${P}-title-leading-gap, 0);
|
|
5095
|
+
}
|
|
5096
|
+
|
|
4946
5097
|
.\${P}-wrapper.\${P}-type-b .\${P}-list-cols-row {
|
|
4947
5098
|
flex-direction: column;
|
|
4948
5099
|
align-items: stretch;
|
|
@@ -4951,23 +5102,24 @@ function getCSS(P: string): string {
|
|
|
4951
5102
|
.\${P}-wrapper.\${P}-type-b .\${P}-list-col {
|
|
4952
5103
|
width: 100%;
|
|
4953
5104
|
min-width: 0;
|
|
4954
|
-
|
|
5105
|
+
flex-direction: column;
|
|
5106
|
+
justify-content: flex-start;
|
|
4955
5107
|
align-items: flex-start;
|
|
5108
|
+
min-height: min-content;
|
|
4956
5109
|
}
|
|
4957
5110
|
|
|
4958
5111
|
.\${P}-wrapper.\${P}-type-b .\${P}-list-col-title {
|
|
5112
|
+
display: block;
|
|
5113
|
+
flex: 0 0 auto;
|
|
5114
|
+
align-self: stretch;
|
|
4959
5115
|
text-align: center;
|
|
4960
5116
|
}
|
|
4961
5117
|
|
|
4962
5118
|
.\${P}-wrapper.\${P}-type-b .\${P}-cut-item .\${P}-list-cols-row {
|
|
4963
5119
|
flex-direction: row;
|
|
4964
|
-
align-items: center;
|
|
4965
|
-
justify-content: center;
|
|
4966
5120
|
}
|
|
4967
5121
|
|
|
4968
5122
|
.\${P}-wrapper.\${P}-type-b .\${P}-cut-label {
|
|
4969
|
-
text-align: center;
|
|
4970
|
-
width: 100%;
|
|
4971
5123
|
box-sizing: border-box;
|
|
4972
5124
|
}
|
|
4973
5125
|
|
|
@@ -5017,151 +5169,148 @@ a.\${P}-list-item {
|
|
|
5017
5169
|
}
|
|
5018
5170
|
|
|
5019
5171
|
.\${P}-col-resize-handle,
|
|
5020
|
-
.\${P}-padding-control-handle
|
|
5021
|
-
|
|
5022
|
-
}
|
|
5023
|
-
|
|
5024
|
-
.\${P}-row-padding-handle {
|
|
5025
|
-
position: relative;
|
|
5026
|
-
z-index: 2;
|
|
5027
|
-
width: 100%;
|
|
5028
|
-
flex-shrink: 0;
|
|
5172
|
+
.\${P}-padding-control-handle,
|
|
5173
|
+
.\${P}-text-padding-lr-handle {
|
|
5029
5174
|
background: transparent;
|
|
5030
5175
|
}
|
|
5031
5176
|
|
|
5032
|
-
.\${P}-
|
|
5033
|
-
|
|
5034
|
-
position: absolute;
|
|
5035
|
-
top: 0;
|
|
5036
|
-
left: 0;
|
|
5037
|
-
width: 100%;
|
|
5038
|
-
height: 100%;
|
|
5039
|
-
min-height: 20px;
|
|
5040
|
-
pointer-events: auto;
|
|
5041
|
-
z-index: 10;
|
|
5042
|
-
}
|
|
5043
|
-
|
|
5044
|
-
.\${P}-col-resize-handle::after {
|
|
5177
|
+
.\${P}-padding-control-handle[data-controls-axis="x"][data-controls-variant="column-padding"]::after,
|
|
5178
|
+
.\${P}-text-padding-lr-handle::after {
|
|
5045
5179
|
content: '';
|
|
5046
5180
|
position: absolute;
|
|
5047
|
-
top:
|
|
5181
|
+
top: var(--\${P}-first-entry-handle-top, 50%);
|
|
5048
5182
|
left: 50%;
|
|
5049
|
-
transform:
|
|
5050
|
-
width:
|
|
5051
|
-
height:
|
|
5183
|
+
transform: translate(-50%, -50%);
|
|
5184
|
+
width: 4px;
|
|
5185
|
+
height: 12px;
|
|
5052
5186
|
background: #FF5C02;
|
|
5187
|
+
border: 1px solid #FFFFFF;
|
|
5188
|
+
border-radius: 5px;
|
|
5189
|
+
box-sizing: border-box;
|
|
5053
5190
|
pointer-events: none;
|
|
5054
5191
|
}
|
|
5055
5192
|
|
|
5056
|
-
.\${P}-
|
|
5193
|
+
.\${P}-text-padding-lr-handle::after {
|
|
5057
5194
|
top: 50%;
|
|
5058
|
-
left: 0;
|
|
5059
|
-
transform: translateY(-50%);
|
|
5060
|
-
width: 100%;
|
|
5061
|
-
height: 2px;
|
|
5062
5195
|
}
|
|
5063
5196
|
|
|
5064
|
-
.\${P}-padding-control-handle::after {
|
|
5197
|
+
.\${P}-padding-control-handle[data-controls-axis="y"]::after {
|
|
5065
5198
|
content: '';
|
|
5066
5199
|
position: absolute;
|
|
5067
5200
|
top: 50%;
|
|
5068
5201
|
left: 50%;
|
|
5069
5202
|
transform: translate(-50%, -50%);
|
|
5070
|
-
width:
|
|
5071
|
-
height:
|
|
5203
|
+
width: 12px;
|
|
5204
|
+
height: 4px;
|
|
5072
5205
|
background: #FF5C02;
|
|
5073
5206
|
border: 1px solid #FFFFFF;
|
|
5074
5207
|
border-radius: 5px;
|
|
5075
|
-
pointer-events: none;
|
|
5076
5208
|
box-sizing: border-box;
|
|
5209
|
+
pointer-events: none;
|
|
5077
5210
|
}
|
|
5078
5211
|
|
|
5079
|
-
.\${P}-
|
|
5080
|
-
|
|
5081
|
-
|
|
5212
|
+
.\${P}-padding-control-handle[data-controls-variant="row-padding"][data-controls-axis="y"]::after,
|
|
5213
|
+
.\${P}-padding-control-handle[data-controls-variant="column-padding"][data-controls-axis="y"]::after {
|
|
5214
|
+
left: 20px;
|
|
5215
|
+
transform: translateY(-50%);
|
|
5082
5216
|
}
|
|
5083
5217
|
|
|
5084
|
-
.\${P}-
|
|
5218
|
+
.\${P}-row-padding-handle {
|
|
5219
|
+
width: 100%;
|
|
5220
|
+
flex-shrink: 0;
|
|
5085
5221
|
background: transparent;
|
|
5086
5222
|
}
|
|
5087
5223
|
|
|
5088
|
-
.\${P}-
|
|
5224
|
+
.\${P}-list-col-wrap {
|
|
5225
|
+
position: relative;
|
|
5226
|
+
}
|
|
5227
|
+
|
|
5228
|
+
.\${P}-list-cols-row-controls {
|
|
5229
|
+
position: relative;
|
|
5230
|
+
}
|
|
5231
|
+
|
|
5232
|
+
.\${P}-col-resize-handle::after {
|
|
5089
5233
|
content: '';
|
|
5090
5234
|
position: absolute;
|
|
5091
|
-
top:
|
|
5235
|
+
top: 0;
|
|
5092
5236
|
left: 50%;
|
|
5093
|
-
transform:
|
|
5094
|
-
width:
|
|
5095
|
-
height:
|
|
5237
|
+
transform: translateX(-50%);
|
|
5238
|
+
width: 2px;
|
|
5239
|
+
height: 100%;
|
|
5096
5240
|
background: #FF5C02;
|
|
5097
|
-
border: 1px solid #FFFFFF;
|
|
5098
|
-
border-radius: 5px;
|
|
5099
5241
|
pointer-events: none;
|
|
5100
|
-
box-sizing: border-box;
|
|
5101
5242
|
}
|
|
5102
5243
|
|
|
5103
|
-
.\${P}-wrapper.\${P}-
|
|
5104
|
-
|
|
5244
|
+
.\${P}-wrapper.\${P}-type-b .\${P}-col-resize-handle::after {
|
|
5245
|
+
top: 50%;
|
|
5246
|
+
left: 0;
|
|
5247
|
+
transform: translateY(-50%);
|
|
5248
|
+
width: 100%;
|
|
5249
|
+
height: 2px;
|
|
5250
|
+
}
|
|
5251
|
+
|
|
5252
|
+
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item-has-link,
|
|
5253
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item-has-link,
|
|
5105
5254
|
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item,
|
|
5106
5255
|
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item {
|
|
5107
5256
|
transition: background-color 250ms, border-color 250ms;
|
|
5108
5257
|
}
|
|
5109
5258
|
|
|
5110
|
-
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-col-title,
|
|
5111
|
-
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-col-title,
|
|
5259
|
+
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item-has-link .\${P}-list-col-title,
|
|
5260
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item-has-link .\${P}-list-col-title,
|
|
5112
5261
|
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-label,
|
|
5113
5262
|
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-label {
|
|
5114
5263
|
transition: color 250ms;
|
|
5115
5264
|
}
|
|
5116
5265
|
|
|
5117
|
-
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover,
|
|
5118
|
-
.\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item,
|
|
5266
|
+
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item-has-link:hover,
|
|
5267
|
+
.\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item-has-link,
|
|
5119
5268
|
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item:hover,
|
|
5120
5269
|
.\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-cut-item {
|
|
5121
5270
|
background: var(--\${P}-background-hover-color);
|
|
5122
5271
|
}
|
|
5123
5272
|
|
|
5124
|
-
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item:hover,
|
|
5125
|
-
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item:has(+ .\${P}-list-item:hover),
|
|
5273
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item-has-link:hover,
|
|
5274
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item:has(+ .\${P}-list-item-has-link:hover),
|
|
5126
5275
|
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item:has(+ .\${P}-cut-item:hover),
|
|
5127
|
-
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item,
|
|
5276
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item-has-link,
|
|
5128
5277
|
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-cut-item:hover,
|
|
5129
5278
|
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-default.\${P}-state-hover .\${P}-cut-item,
|
|
5130
|
-
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item:hover,
|
|
5131
|
-
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-list-item:hover),
|
|
5279
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item-has-link:hover,
|
|
5280
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-list-item-has-link:hover),
|
|
5132
5281
|
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item:has(+ .\${P}-cut-item:hover),
|
|
5133
|
-
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item,
|
|
5282
|
+
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item-has-link,
|
|
5134
5283
|
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-cut-item:hover,
|
|
5135
5284
|
.\${P}-wrapper.\${P}-divider-bottom.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-cut-item {
|
|
5136
5285
|
border-bottom-color: var(--\${P}-divider-hover-color);
|
|
5137
5286
|
}
|
|
5138
5287
|
|
|
5139
|
-
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-default .\${P}-list-item:hover:first-child,
|
|
5140
|
-
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item:first-child,
|
|
5141
|
-
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-blinds .\${P}-list-item:hover:first-child,
|
|
5142
|
-
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item:first-child {
|
|
5288
|
+
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-default .\${P}-list-item-has-link:hover:first-child,
|
|
5289
|
+
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item-has-link:first-child,
|
|
5290
|
+
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-blinds .\${P}-list-item-has-link:hover:first-child,
|
|
5291
|
+
.\${P}-wrapper.\${P}-divider-top:not(.\${P}-divider-bottom).\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item-has-link:first-child {
|
|
5143
5292
|
border-top-color: var(--\${P}-divider-hover-color);
|
|
5144
5293
|
}
|
|
5145
5294
|
|
|
5146
|
-
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item:hover:first-child,
|
|
5147
|
-
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item:first-child,
|
|
5148
|
-
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item:hover:first-child,
|
|
5149
|
-
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item:first-child {
|
|
5295
|
+
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-default .\${P}-list-item-has-link:hover:first-child,
|
|
5296
|
+
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item-has-link:first-child,
|
|
5297
|
+
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-blinds .\${P}-list-item-has-link:hover:first-child,
|
|
5298
|
+
.\${P}-wrapper.\${P}-divider-top.\${P}-divider-bottom.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item-has-link:first-child {
|
|
5150
5299
|
border-top-color: var(--\${P}-divider-hover-color);
|
|
5151
5300
|
}
|
|
5152
5301
|
|
|
5153
|
-
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item:hover .\${P}-list-col-title,
|
|
5154
|
-
.\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item .\${P}-list-col-title,
|
|
5302
|
+
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-list-item-has-link:hover .\${P}-list-col-title,
|
|
5303
|
+
.\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-list-item-has-link .\${P}-list-col-title,
|
|
5155
5304
|
.\${P}-wrapper.\${P}-entry-hover-default .\${P}-cut-item:hover .\${P}-cut-label,
|
|
5156
5305
|
.\${P}-wrapper.\${P}-entry-hover-default.\${P}-state-hover .\${P}-cut-item .\${P}-cut-label,
|
|
5157
|
-
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover .\${P}-list-col-title,
|
|
5158
|
-
.\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item .\${P}-list-col-title,
|
|
5306
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item-has-link:hover .\${P}-list-col-title,
|
|
5307
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item-has-link .\${P}-list-col-title,
|
|
5159
5308
|
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item:hover .\${P}-cut-label,
|
|
5160
5309
|
.\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-cut-item .\${P}-cut-label {
|
|
5161
5310
|
color: var(--\${P}-text-hover-color);
|
|
5162
5311
|
}
|
|
5163
5312
|
|
|
5164
|
-
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item::before,
|
|
5313
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item-has-link::before,
|
|
5165
5314
|
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item::before {
|
|
5166
5315
|
content: '';
|
|
5167
5316
|
position: absolute;
|
|
@@ -5180,8 +5329,8 @@ a.\${P}-list-item {
|
|
|
5180
5329
|
z-index: 1;
|
|
5181
5330
|
}
|
|
5182
5331
|
|
|
5183
|
-
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item:hover::before,
|
|
5184
|
-
.\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item::before,
|
|
5332
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-list-item-has-link:hover::before,
|
|
5333
|
+
.\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-list-item-has-link::before,
|
|
5185
5334
|
.\${P}-wrapper.\${P}-entry-hover-blinds .\${P}-cut-item:hover::before,
|
|
5186
5335
|
.\${P}-wrapper.\${P}-entry-hover-blinds.\${P}-state-hover .\${P}-cut-item::before {
|
|
5187
5336
|
transform: scaleY(1);
|
|
@@ -5189,8 +5338,7 @@ a.\${P}-list-item {
|
|
|
5189
5338
|
|
|
5190
5339
|
.\${P}-cut-item {
|
|
5191
5340
|
display: flex;
|
|
5192
|
-
align-items:
|
|
5193
|
-
justify-content: center;
|
|
5341
|
+
align-items: stretch;
|
|
5194
5342
|
width: 100%;
|
|
5195
5343
|
overflow: visible;
|
|
5196
5344
|
position: relative;
|
|
@@ -5198,6 +5346,20 @@ a.\${P}-list-item {
|
|
|
5198
5346
|
box-sizing: border-box;
|
|
5199
5347
|
user-select: none;
|
|
5200
5348
|
background: var(--\${P}-background-color);
|
|
5349
|
+
cursor: pointer;
|
|
5350
|
+
padding: 0;
|
|
5351
|
+
border: none;
|
|
5352
|
+
font: inherit;
|
|
5353
|
+
text-align: inherit;
|
|
5354
|
+
appearance: none;
|
|
5355
|
+
-webkit-appearance: none;
|
|
5356
|
+
}
|
|
5357
|
+
|
|
5358
|
+
.\${P}-cut-item .\${P}-list-cols-row {
|
|
5359
|
+
flex: 1;
|
|
5360
|
+
min-height: 100%;
|
|
5361
|
+
width: 100%;
|
|
5362
|
+
display: flex;
|
|
5201
5363
|
}
|
|
5202
5364
|
|
|
5203
5365
|
.\${P}-wrapper.\${P}-divider-bottom .\${P}-cut-item {
|
|
@@ -5206,10 +5368,10 @@ a.\${P}-list-item {
|
|
|
5206
5368
|
}
|
|
5207
5369
|
|
|
5208
5370
|
.\${P}-cut-label {
|
|
5209
|
-
|
|
5210
|
-
cursor: pointer;
|
|
5371
|
+
display: block;
|
|
5211
5372
|
position: relative;
|
|
5212
5373
|
z-index: 1;
|
|
5374
|
+
margin: 0;
|
|
5213
5375
|
color: var(--\${P}-text-color);
|
|
5214
5376
|
white-space: pre-wrap;
|
|
5215
5377
|
overflow-wrap: anywhere;
|
|
@@ -5234,6 +5396,15 @@ export const COLUMN_TEXT_PREFIXES = [
|
|
|
5234
5396
|
'EColumn',
|
|
5235
5397
|
] as const;
|
|
5236
5398
|
|
|
5399
|
+
export const CUT_LABEL_TEXT_PREFIX = 'cutLabel' as const;
|
|
5400
|
+
|
|
5401
|
+
export const LIST_TEXT_STYLE_PREFIXES = [
|
|
5402
|
+
...COLUMN_TEXT_PREFIXES,
|
|
5403
|
+
CUT_LABEL_TEXT_PREFIX,
|
|
5404
|
+
] as const;
|
|
5405
|
+
|
|
5406
|
+
export type ListTextStylePrefix = typeof LIST_TEXT_STYLE_PREFIXES[number];
|
|
5407
|
+
|
|
5237
5408
|
export const LIST_COLUMN_LETTERS = ['A', 'B', 'C', 'D', 'E'] as const;
|
|
5238
5409
|
|
|
5239
5410
|
export function getListColumnVerticalAlignSettingKey(columnLetter: string): string {
|
|
@@ -5242,12 +5413,12 @@ export function getListColumnVerticalAlignSettingKey(columnLetter: string): stri
|
|
|
5242
5413
|
|
|
5243
5414
|
export const COLUMN_VALIGN_BASIC_OPTIONS = ['Top', 'Center', 'Bottom'] as const;
|
|
5244
5415
|
|
|
5245
|
-
export function
|
|
5416
|
+
export function isBaselineAnchorColumnVerticalAlign(value: string | undefined): boolean {
|
|
5246
5417
|
const raw = String(value ?? 'Top').trim();
|
|
5247
5418
|
if (raw.toLowerCase().startsWith('baseline')) {
|
|
5248
5419
|
return false;
|
|
5249
5420
|
}
|
|
5250
|
-
return raw === 'Top';
|
|
5421
|
+
return raw === 'Top' || raw === 'Center' || raw === 'Bottom';
|
|
5251
5422
|
}
|
|
5252
5423
|
|
|
5253
5424
|
export function parseBaselineAnchorLetter(value: string | undefined): string | null {
|
|
@@ -5273,7 +5444,7 @@ export function isValidColumnBaselineVAlign(
|
|
|
5273
5444
|
if (anchorLetter === forColumnLetter) {
|
|
5274
5445
|
return false;
|
|
5275
5446
|
}
|
|
5276
|
-
return
|
|
5447
|
+
return isBaselineAnchorColumnVerticalAlign(settings[getListColumnVerticalAlignSettingKey(anchorLetter) as ListColumnVerticalAlignKey]);
|
|
5277
5448
|
}
|
|
5278
5449
|
|
|
5279
5450
|
export function getColumnVerticalAlignOptionsForLetter(
|
|
@@ -5282,7 +5453,7 @@ export function getColumnVerticalAlignOptionsForLetter(
|
|
|
5282
5453
|
): string[] {
|
|
5283
5454
|
const baselineOptions = LIST_COLUMN_LETTERS
|
|
5284
5455
|
.filter((letter) => letter !== columnLetter)
|
|
5285
|
-
.filter((letter) =>
|
|
5456
|
+
.filter((letter) => isBaselineAnchorColumnVerticalAlign(settings[getListColumnVerticalAlignSettingKey(letter) as ListColumnVerticalAlignKey]))
|
|
5286
5457
|
.map((letter) => \`Baseline \${letter}\`);
|
|
5287
5458
|
|
|
5288
5459
|
return [...COLUMN_VALIGN_BASIC_OPTIONS, ...baselineOptions];
|
|
@@ -5323,6 +5494,14 @@ function resolveColumnVerticalAlign(
|
|
|
5323
5494
|
return parsed;
|
|
5324
5495
|
}
|
|
5325
5496
|
|
|
5497
|
+
function resolveBasicColumnVerticalAlign(value: string | undefined): ColumnVerticalAlign {
|
|
5498
|
+
const parsed = parseColumnVerticalAlign(value);
|
|
5499
|
+
if (parsed.kind === 'baseline') {
|
|
5500
|
+
return { kind: 'top' };
|
|
5501
|
+
}
|
|
5502
|
+
return parsed;
|
|
5503
|
+
}
|
|
5504
|
+
|
|
5326
5505
|
function isActiveBaselineVAlign(
|
|
5327
5506
|
value: string | undefined,
|
|
5328
5507
|
settings: ListSettings,
|
|
@@ -5337,16 +5516,22 @@ function isActiveBaselineVAlign(
|
|
|
5337
5516
|
function getListColumnVerticalAlignSanitizeUpdates(
|
|
5338
5517
|
settings: ListSettings,
|
|
5339
5518
|
): ListColumnVerticalAlignUpdates | null {
|
|
5340
|
-
if (settings.type === 'B') {
|
|
5341
|
-
return null;
|
|
5342
|
-
}
|
|
5343
|
-
|
|
5344
5519
|
const updates: ListColumnVerticalAlignUpdates = {};
|
|
5345
5520
|
let hasUpdates = false;
|
|
5346
5521
|
|
|
5347
5522
|
for (const letter of LIST_COLUMN_LETTERS) {
|
|
5348
5523
|
const key = getListColumnVerticalAlignSettingKey(letter) as ListColumnVerticalAlignKey;
|
|
5349
5524
|
const value = settings[key];
|
|
5525
|
+
|
|
5526
|
+
if (settings.type === 'B') {
|
|
5527
|
+
const raw = String(value ?? 'Top').trim();
|
|
5528
|
+
if (raw !== 'Top' && raw !== 'Center' && raw !== 'Bottom') {
|
|
5529
|
+
updates[key] = 'Top';
|
|
5530
|
+
hasUpdates = true;
|
|
5531
|
+
}
|
|
5532
|
+
continue;
|
|
5533
|
+
}
|
|
5534
|
+
|
|
5350
5535
|
if (!isValidColumnBaselineVAlign(value, letter, settings)) {
|
|
5351
5536
|
updates[key] = 'Top';
|
|
5352
5537
|
hasUpdates = true;
|
|
@@ -5356,46 +5541,134 @@ function getListColumnVerticalAlignSanitizeUpdates(
|
|
|
5356
5541
|
return hasUpdates ? updates : null;
|
|
5357
5542
|
}
|
|
5358
5543
|
|
|
5359
|
-
function
|
|
5544
|
+
function vAlignToTitleStyle(
|
|
5360
5545
|
kind: ColumnVerticalAlign['kind'],
|
|
5361
|
-
):
|
|
5362
|
-
if (kind === 'center')
|
|
5363
|
-
|
|
5546
|
+
): React.CSSProperties {
|
|
5547
|
+
if (kind === 'center') {
|
|
5548
|
+
return { flex: '0 0 auto', marginTop: 'auto', marginBottom: 'auto' };
|
|
5549
|
+
}
|
|
5550
|
+
if (kind === 'bottom') {
|
|
5551
|
+
return { flex: '0 0 auto', marginTop: 'auto' };
|
|
5552
|
+
}
|
|
5553
|
+
return {};
|
|
5554
|
+
}
|
|
5555
|
+
|
|
5556
|
+
function resolveCutLabelVerticalAlignKind(
|
|
5557
|
+
value: string | undefined,
|
|
5558
|
+
): ColumnVerticalAlign['kind'] {
|
|
5559
|
+
const kind = parseColumnVerticalAlign(value).kind;
|
|
5560
|
+
return kind === 'baseline' ? 'center' : kind;
|
|
5561
|
+
}
|
|
5562
|
+
|
|
5563
|
+
function textAlignToJustifyContent(
|
|
5564
|
+
textAlign: 'left' | 'center' | 'right' | 'justify',
|
|
5565
|
+
): React.CSSProperties['justifyContent'] {
|
|
5566
|
+
if (textAlign === 'right') {
|
|
5567
|
+
return 'flex-end';
|
|
5568
|
+
}
|
|
5569
|
+
if (textAlign === 'center') {
|
|
5570
|
+
return 'center';
|
|
5571
|
+
}
|
|
5572
|
+
if (textAlign === 'left') {
|
|
5573
|
+
return 'flex-start';
|
|
5574
|
+
}
|
|
5364
5575
|
return 'flex-start';
|
|
5365
5576
|
}
|
|
5366
5577
|
|
|
5367
|
-
function
|
|
5368
|
-
|
|
5578
|
+
function cutVerticalAlignKindToFlexAlign(
|
|
5579
|
+
kind: ColumnVerticalAlign['kind'],
|
|
5580
|
+
): React.CSSProperties['alignItems'] {
|
|
5581
|
+
if (kind === 'center') {
|
|
5582
|
+
return 'center';
|
|
5583
|
+
}
|
|
5584
|
+
if (kind === 'bottom') {
|
|
5585
|
+
return 'flex-end';
|
|
5586
|
+
}
|
|
5587
|
+
return 'flex-start';
|
|
5588
|
+
}
|
|
5369
5589
|
|
|
5590
|
+
function getFirstLineBaselineOffsetInTitle(
|
|
5591
|
+
titleEl: HTMLElement,
|
|
5592
|
+
probeClassName: string,
|
|
5593
|
+
): number {
|
|
5370
5594
|
const probe = document.createElement('i');
|
|
5371
5595
|
probe.className = probeClassName;
|
|
5372
|
-
probe.setAttribute('data-baseline-probe', '');
|
|
5373
5596
|
probe.setAttribute('aria-hidden', 'true');
|
|
5597
|
+
titleEl.prepend(probe);
|
|
5374
5598
|
|
|
5375
|
-
titleEl.
|
|
5376
|
-
const
|
|
5599
|
+
const { top: titleTop } = titleEl.getBoundingClientRect();
|
|
5600
|
+
const { bottom: probeBottom } = probe.getBoundingClientRect();
|
|
5601
|
+
const baselineOffset = probeBottom - titleTop;
|
|
5377
5602
|
probe.remove();
|
|
5378
5603
|
|
|
5379
|
-
return
|
|
5604
|
+
return baselineOffset;
|
|
5605
|
+
}
|
|
5606
|
+
|
|
5607
|
+
function measureColumnFirstLineBaselineOffset(
|
|
5608
|
+
info: {
|
|
5609
|
+
titleEl: HTMLElement | null;
|
|
5610
|
+
kind: string;
|
|
5611
|
+
},
|
|
5612
|
+
rowTop: number,
|
|
5613
|
+
listColClassName: string,
|
|
5614
|
+
probeClassName: string,
|
|
5615
|
+
): number {
|
|
5616
|
+
const titleEl = info.titleEl;
|
|
5617
|
+
if (!titleEl) return 0;
|
|
5618
|
+
|
|
5619
|
+
const listCol = titleEl.closest<HTMLElement>(\`.\${listColClassName}\`);
|
|
5620
|
+
if (!listCol) return 0;
|
|
5621
|
+
|
|
5622
|
+
const baselineInTitle = getFirstLineBaselineOffsetInTitle(titleEl, probeClassName);
|
|
5623
|
+
|
|
5624
|
+
if (info.kind === 'baseline') {
|
|
5625
|
+
return titleEl.getBoundingClientRect().top - rowTop + baselineInTitle;
|
|
5626
|
+
}
|
|
5627
|
+
|
|
5628
|
+
const listColRect = listCol.getBoundingClientRect();
|
|
5629
|
+
const titleHeight = titleEl.getBoundingClientRect().height;
|
|
5630
|
+
let valignOffset = 0;
|
|
5631
|
+
|
|
5632
|
+
if (info.kind === 'center') {
|
|
5633
|
+
valignOffset = (listColRect.height - titleHeight) / 2;
|
|
5634
|
+
} else if (info.kind === 'bottom') {
|
|
5635
|
+
valignOffset = listColRect.height - titleHeight;
|
|
5636
|
+
}
|
|
5637
|
+
|
|
5638
|
+
return (listColRect.top - rowTop) + valignOffset + baselineInTitle;
|
|
5639
|
+
}
|
|
5640
|
+
|
|
5641
|
+
function syncRowListColHeights(
|
|
5642
|
+
rowEl: HTMLElement,
|
|
5643
|
+
cols: HTMLElement[],
|
|
5644
|
+
listColClassName: string,
|
|
5645
|
+
): number {
|
|
5646
|
+
const rowHeight = rowEl.getBoundingClientRect().height;
|
|
5647
|
+
if (rowHeight <= 0) {
|
|
5648
|
+
return 0;
|
|
5649
|
+
}
|
|
5650
|
+
|
|
5651
|
+
cols.forEach((colEl) => {
|
|
5652
|
+
const listCol = colEl.querySelector<HTMLElement>(\`.\${listColClassName}\`);
|
|
5653
|
+
if (listCol) {
|
|
5654
|
+
listCol.style.minHeight = \`\${rowHeight}px\`;
|
|
5655
|
+
listCol.style.height = \`\${rowHeight}px\`;
|
|
5656
|
+
}
|
|
5657
|
+
});
|
|
5658
|
+
|
|
5659
|
+
void rowEl.offsetHeight;
|
|
5660
|
+
return rowHeight;
|
|
5380
5661
|
}
|
|
5381
5662
|
|
|
5382
5663
|
function applyBaselineTitleShift(titleEl: HTMLElement | null, shift: number): number {
|
|
5383
5664
|
if (!titleEl || !shift) {
|
|
5384
5665
|
if (titleEl) {
|
|
5385
|
-
titleEl.style.
|
|
5386
|
-
titleEl.style.marginTop = '';
|
|
5666
|
+
titleEl.style.transform = '';
|
|
5387
5667
|
}
|
|
5388
5668
|
return 0;
|
|
5389
5669
|
}
|
|
5390
5670
|
|
|
5391
|
-
|
|
5392
|
-
titleEl.style.paddingTop = \`\${shift}px\`;
|
|
5393
|
-
titleEl.style.marginTop = '';
|
|
5394
|
-
} else {
|
|
5395
|
-
titleEl.style.paddingTop = '';
|
|
5396
|
-
titleEl.style.marginTop = \`\${shift}px\`;
|
|
5397
|
-
}
|
|
5398
|
-
|
|
5671
|
+
titleEl.style.transform = \`translateY(\${shift}px)\`;
|
|
5399
5672
|
return shift;
|
|
5400
5673
|
}
|
|
5401
5674
|
|
|
@@ -5417,18 +5690,60 @@ export const LIST_GLOBAL_TEXT_STYLE_KEYS = [
|
|
|
5417
5690
|
'textLineHeight',
|
|
5418
5691
|
'textLetterSpacing',
|
|
5419
5692
|
'textWordSpacing',
|
|
5693
|
+
'textTextAlign',
|
|
5420
5694
|
'textTextAppearance',
|
|
5421
5695
|
] as const;
|
|
5422
5696
|
|
|
5423
5697
|
export type ListGlobalTextStyleKey = typeof LIST_GLOBAL_TEXT_STYLE_KEYS[number];
|
|
5424
5698
|
|
|
5425
5699
|
export function getListColumnTextSettingKey(
|
|
5426
|
-
prefix:
|
|
5700
|
+
prefix: ListTextStylePrefix,
|
|
5427
5701
|
globalKey: ListGlobalTextStyleKey,
|
|
5428
5702
|
): string {
|
|
5429
5703
|
return \`\${prefix}\${globalKey.replace(/^text/, 'Text')}\`;
|
|
5430
5704
|
}
|
|
5431
5705
|
|
|
5706
|
+
export const LIST_TEXT_STYLE_TAB_LABELS: Record<ListTextStylePrefix, string> = {
|
|
5707
|
+
AColumn: 'A',
|
|
5708
|
+
BColumn: 'B',
|
|
5709
|
+
CColumn: 'C',
|
|
5710
|
+
DColumn: 'D',
|
|
5711
|
+
EColumn: 'E',
|
|
5712
|
+
cutLabel: 'CUT',
|
|
5713
|
+
};
|
|
5714
|
+
|
|
5715
|
+
export function createListTextStyleTabContentItems(prefix: ListTextStylePrefix): LayoutItem[] {
|
|
5716
|
+
return [
|
|
5717
|
+
getListColumnTextSettingKey(prefix, 'textFontFamily'),
|
|
5718
|
+
getListColumnTextSettingKey(prefix, 'textFontSettings'),
|
|
5719
|
+
{
|
|
5720
|
+
type: 'row',
|
|
5721
|
+
items: [
|
|
5722
|
+
getListColumnTextSettingKey(prefix, 'textFontSize'),
|
|
5723
|
+
getListColumnTextSettingKey(prefix, 'textLineHeight'),
|
|
5724
|
+
getListColumnTextSettingKey(prefix, 'textLetterSpacing'),
|
|
5725
|
+
getListColumnTextSettingKey(prefix, 'textWordSpacing'),
|
|
5726
|
+
],
|
|
5727
|
+
},
|
|
5728
|
+
getListColumnTextSettingKey(prefix, 'textTextAlign'),
|
|
5729
|
+
getListColumnTextSettingKey(prefix, 'textTextAppearance'),
|
|
5730
|
+
\`\${prefix}VerticalAlign\`,
|
|
5731
|
+
];
|
|
5732
|
+
}
|
|
5733
|
+
|
|
5734
|
+
export function createListTextStylePanelTab(): LayoutTab {
|
|
5735
|
+
return {
|
|
5736
|
+
type: 'tab',
|
|
5737
|
+
id: 'listColumnTextStyle',
|
|
5738
|
+
tabs: Object.fromEntries(
|
|
5739
|
+
LIST_TEXT_STYLE_PREFIXES.map((prefix) => [
|
|
5740
|
+
LIST_TEXT_STYLE_TAB_LABELS[prefix],
|
|
5741
|
+
createListTextStyleTabContentItems(prefix),
|
|
5742
|
+
]),
|
|
5743
|
+
),
|
|
5744
|
+
};
|
|
5745
|
+
}
|
|
5746
|
+
|
|
5432
5747
|
type ListTextStyleFields = {
|
|
5433
5748
|
textFontFamily?: string;
|
|
5434
5749
|
textFontSettings?: { fontWeight: number; fontStyle: string };
|
|
@@ -5436,6 +5751,7 @@ type ListTextStyleFields = {
|
|
|
5436
5751
|
textLineHeight?: number;
|
|
5437
5752
|
textLetterSpacing?: number;
|
|
5438
5753
|
textWordSpacing?: number;
|
|
5754
|
+
textTextAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
5439
5755
|
textTextAppearance?: TextStyles['textAppearance'];
|
|
5440
5756
|
textColor?: string;
|
|
5441
5757
|
};
|
|
@@ -5447,39 +5763,18 @@ type ResolvedListTextFields = {
|
|
|
5447
5763
|
textLineHeight?: number;
|
|
5448
5764
|
textLetterSpacing: number;
|
|
5449
5765
|
textWordSpacing: number;
|
|
5766
|
+
textTextAlign: 'left' | 'center' | 'right' | 'justify';
|
|
5450
5767
|
textTextAppearance?: TextStyles['textAppearance'];
|
|
5451
5768
|
textColor?: string;
|
|
5452
5769
|
};
|
|
5453
5770
|
|
|
5454
|
-
function resolveListGlobalTextFields(
|
|
5455
|
-
settings: ListTextStyleFields,
|
|
5456
|
-
): ResolvedListTextFields {
|
|
5457
|
-
return {
|
|
5458
|
-
textFontFamily: settings.textFontFamily ?? 'Arial',
|
|
5459
|
-
textFontSettings: settings.textFontSettings ?? {
|
|
5460
|
-
fontWeight: 400,
|
|
5461
|
-
fontStyle: 'normal',
|
|
5462
|
-
},
|
|
5463
|
-
textFontSize: settings.textFontSize,
|
|
5464
|
-
textLineHeight: settings.textLineHeight,
|
|
5465
|
-
textLetterSpacing: settings.textLetterSpacing ?? 0,
|
|
5466
|
-
textWordSpacing: settings.textWordSpacing ?? 0,
|
|
5467
|
-
textTextAppearance: settings.textTextAppearance,
|
|
5468
|
-
textColor: settings.textColor,
|
|
5469
|
-
};
|
|
5470
|
-
}
|
|
5471
|
-
|
|
5472
5771
|
function resolveListColumnTextFields(
|
|
5473
5772
|
settings: ListSettings,
|
|
5474
|
-
textPrefix:
|
|
5773
|
+
textPrefix: ListTextStylePrefix,
|
|
5475
5774
|
): ResolvedListTextFields {
|
|
5476
5775
|
const read = <K extends ListGlobalTextStyleKey>(globalKey: K) => {
|
|
5477
5776
|
const columnKey = getListColumnTextSettingKey(textPrefix, globalKey);
|
|
5478
|
-
|
|
5479
|
-
if (columnValue !== undefined) {
|
|
5480
|
-
return columnValue as ListTextStyleFields[K];
|
|
5481
|
-
}
|
|
5482
|
-
return settings[globalKey];
|
|
5777
|
+
return settings[columnKey as keyof ListSettings] as ListTextStyleFields[K] | undefined;
|
|
5483
5778
|
};
|
|
5484
5779
|
|
|
5485
5780
|
return {
|
|
@@ -5492,6 +5787,8 @@ function resolveListColumnTextFields(
|
|
|
5492
5787
|
textLineHeight: read('textLineHeight') as number | undefined,
|
|
5493
5788
|
textLetterSpacing: (read('textLetterSpacing') as number | undefined) ?? 0,
|
|
5494
5789
|
textWordSpacing: (read('textWordSpacing') as number | undefined) ?? 0,
|
|
5790
|
+
textTextAlign: (read('textTextAlign') as ListTextStyleFields['textTextAlign'])
|
|
5791
|
+
?? (textPrefix === CUT_LABEL_TEXT_PREFIX ? 'center' : 'left'),
|
|
5495
5792
|
textTextAppearance: read('textTextAppearance') as ListTextStyleFields['textTextAppearance'],
|
|
5496
5793
|
textColor: settings.textColor,
|
|
5497
5794
|
};
|
|
@@ -5511,6 +5808,7 @@ function listColumnTextFieldsToCss(
|
|
|
5511
5808
|
lineHeight: fields.textLineHeight,
|
|
5512
5809
|
letterSpacing: fields.textLetterSpacing,
|
|
5513
5810
|
wordSpacing: fields.textWordSpacing,
|
|
5811
|
+
textAlign: fields.textTextAlign,
|
|
5514
5812
|
textAppearance: fields.textTextAppearance,
|
|
5515
5813
|
color: fields.textColor ?? '#767676',
|
|
5516
5814
|
};
|
|
@@ -5518,30 +5816,39 @@ function listColumnTextFieldsToCss(
|
|
|
5518
5816
|
return omitTextColors(textStylesToCss(resolvedTextStyle, isEditor));
|
|
5519
5817
|
}
|
|
5520
5818
|
|
|
5521
|
-
function
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5819
|
+
function getListColumnTitleClassName(
|
|
5820
|
+
settings: ListSettings,
|
|
5821
|
+
prefix: ListTextStylePrefix,
|
|
5822
|
+
baseClassName: string,
|
|
5823
|
+
tightLeadingClassName: string,
|
|
5824
|
+
): string {
|
|
5825
|
+
const fields = resolveListColumnTextFields(settings, prefix);
|
|
5826
|
+
const fontSize = fields.textFontSize ?? 0.01;
|
|
5827
|
+
const lineHeight = fields.textLineHeight;
|
|
5828
|
+
const needsTightLeading = lineHeight !== undefined && lineHeight < fontSize;
|
|
5527
5829
|
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
if (nextSettings[globalKey] === undefined) {
|
|
5533
|
-
continue;
|
|
5534
|
-
}
|
|
5830
|
+
return needsTightLeading
|
|
5831
|
+
? \`\${baseClassName} \${tightLeadingClassName}\`
|
|
5832
|
+
: baseClassName;
|
|
5833
|
+
}
|
|
5535
5834
|
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5835
|
+
function getListColumnTitleVars(
|
|
5836
|
+
settings: ListSettings,
|
|
5837
|
+
prefix: ListTextStylePrefix,
|
|
5838
|
+
titleVarPrefix: string,
|
|
5839
|
+
isEditor?: boolean,
|
|
5840
|
+
): React.CSSProperties {
|
|
5841
|
+
const fields = resolveListColumnTextFields(settings, prefix);
|
|
5842
|
+
const fontSize = fields.textFontSize ?? 0.01;
|
|
5843
|
+
const lineHeight = fields.textLineHeight;
|
|
5844
|
+
|
|
5845
|
+
if (lineHeight === undefined || lineHeight >= fontSize) {
|
|
5846
|
+
return {};
|
|
5542
5847
|
}
|
|
5543
5848
|
|
|
5544
|
-
return
|
|
5849
|
+
return {
|
|
5850
|
+
[\`--\${titleVarPrefix}-title-leading-gap\`]: scalingValue((fontSize - lineHeight) / 2, isEditor),
|
|
5851
|
+
} as React.CSSProperties;
|
|
5545
5852
|
}
|
|
5546
5853
|
|
|
5547
5854
|
const COLUMN_WIDTH_KEYS = [
|
|
@@ -5636,6 +5943,8 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
5636
5943
|
|
|
5637
5944
|
const COL_RESIZE_HANDLE_WIDTH = 0.004;
|
|
5638
5945
|
const COL_PADDING_HANDLE_WIDTH = 0.004;
|
|
5946
|
+
const ROW_PADDING_HANDLE_HEIGHT = COL_PADDING_HANDLE_WIDTH;
|
|
5947
|
+
const PADDING_CONTROL_HIT_SIZE = 12;
|
|
5639
5948
|
const MIN_COLUMN_WIDTH_PX = 50;
|
|
5640
5949
|
const ARTICLE_DESIGN_WIDTH = 1440;
|
|
5641
5950
|
const MIN_COLUMN_WIDTH = MIN_COLUMN_WIDTH_PX / ARTICLE_DESIGN_WIDTH;
|
|
@@ -5648,6 +5957,60 @@ export function getListMinColumnWidth(designWidthPx?: number): number {
|
|
|
5648
5957
|
return MIN_COLUMN_WIDTH_PX / designWidth;
|
|
5649
5958
|
}
|
|
5650
5959
|
|
|
5960
|
+
type ListPaddingControlHitPlacement = 'left-y' | 'center-x' | 'center';
|
|
5961
|
+
|
|
5962
|
+
function getListPaddingControlHitStyle(
|
|
5963
|
+
P: string,
|
|
5964
|
+
placement: ListPaddingControlHitPlacement,
|
|
5965
|
+
): CSSProperties {
|
|
5966
|
+
const base: CSSProperties = {
|
|
5967
|
+
position: 'absolute',
|
|
5968
|
+
width: PADDING_CONTROL_HIT_SIZE,
|
|
5969
|
+
height: PADDING_CONTROL_HIT_SIZE,
|
|
5970
|
+
pointerEvents: 'auto',
|
|
5971
|
+
};
|
|
5972
|
+
|
|
5973
|
+
if (placement === 'left-y') {
|
|
5974
|
+
return { ...base, left: 20, top: '50%', transform: 'translateY(-50%)' };
|
|
5975
|
+
}
|
|
5976
|
+
|
|
5977
|
+
if (placement === 'center-x') {
|
|
5978
|
+
return {
|
|
5979
|
+
...base,
|
|
5980
|
+
left: '50%',
|
|
5981
|
+
top: \`var(--\${P}-first-entry-handle-top, 50%)\`,
|
|
5982
|
+
transform: 'translate(-50%, -50%)',
|
|
5983
|
+
};
|
|
5984
|
+
}
|
|
5985
|
+
|
|
5986
|
+
return { ...base, left: '50%', top: '50%', transform: 'translate(-50%, -50%)' };
|
|
5987
|
+
}
|
|
5988
|
+
|
|
5989
|
+
type ListPaddingControlProps = {
|
|
5990
|
+
P: string;
|
|
5991
|
+
className: string;
|
|
5992
|
+
areaStyle: CSSProperties;
|
|
5993
|
+
hitPlacement: ListPaddingControlHitPlacement;
|
|
5994
|
+
} & ComponentPropsWithoutRef<'div'>;
|
|
5995
|
+
|
|
5996
|
+
function ListPaddingControl({
|
|
5997
|
+
P,
|
|
5998
|
+
className,
|
|
5999
|
+
areaStyle,
|
|
6000
|
+
hitPlacement,
|
|
6001
|
+
...rest
|
|
6002
|
+
}: ListPaddingControlProps) {
|
|
6003
|
+
return (
|
|
6004
|
+
<div
|
|
6005
|
+
className={className}
|
|
6006
|
+
style={{ ...areaStyle, pointerEvents: 'none' }}
|
|
6007
|
+
{...rest}
|
|
6008
|
+
>
|
|
6009
|
+
<div style={getListPaddingControlHitStyle(P, hitPlacement)} />
|
|
6010
|
+
</div>
|
|
6011
|
+
);
|
|
6012
|
+
}
|
|
6013
|
+
|
|
5651
6014
|
function getEditorDesignWidth(element: HTMLElement | null | undefined): number {
|
|
5652
6015
|
let el = element ?? null;
|
|
5653
6016
|
|
|
@@ -5942,11 +6305,6 @@ export function applyListSettingsChange(
|
|
|
5942
6305
|
prevSettings: ListSettings,
|
|
5943
6306
|
options?: { designWidth?: number },
|
|
5944
6307
|
): ListSettings {
|
|
5945
|
-
const textSyncUpdates = getListGlobalTextSyncUpdates(nextSettings, prevSettings);
|
|
5946
|
-
if (textSyncUpdates) {
|
|
5947
|
-
nextSettings = { ...nextSettings, ...textSyncUpdates };
|
|
5948
|
-
}
|
|
5949
|
-
|
|
5950
6308
|
const valignSanitizeUpdates = getListColumnVerticalAlignSanitizeUpdates(nextSettings);
|
|
5951
6309
|
if (valignSanitizeUpdates) {
|
|
5952
6310
|
nextSettings = { ...nextSettings, ...valignSanitizeUpdates };
|
|
@@ -6150,9 +6508,9 @@ function buildListColumns(
|
|
|
6150
6508
|
});
|
|
6151
6509
|
}
|
|
6152
6510
|
|
|
6153
|
-
export function List({ settings, content, isEditor, isPreviewMode, activeEvent, layoutId, onUpdateSettings }: ListProps) {
|
|
6511
|
+
export function List({ settings, content, isEditor, isPreviewMode, isEditMode, activeEvent, layoutId, onUpdateSettings }: ListProps) {
|
|
6154
6512
|
const { prefix: P } = useScopedStyles();
|
|
6155
|
-
const showControls = Boolean(
|
|
6513
|
+
const showControls = Boolean(isEditMode);
|
|
6156
6514
|
const {
|
|
6157
6515
|
columns,
|
|
6158
6516
|
type,
|
|
@@ -6174,13 +6532,6 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6174
6532
|
columnsOrder,
|
|
6175
6533
|
textPaddingLR,
|
|
6176
6534
|
textColor,
|
|
6177
|
-
textFontFamily,
|
|
6178
|
-
textFontSettings,
|
|
6179
|
-
textFontSize,
|
|
6180
|
-
textLineHeight,
|
|
6181
|
-
textLetterSpacing,
|
|
6182
|
-
textWordSpacing,
|
|
6183
|
-
textTextAppearance,
|
|
6184
6535
|
backgroundColor,
|
|
6185
6536
|
dividerColor,
|
|
6186
6537
|
textHoverColor,
|
|
@@ -6190,10 +6541,12 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6190
6541
|
|
|
6191
6542
|
const [visibleRowCount, setVisibleRowCount] = useState<number | undefined>(undefined);
|
|
6192
6543
|
const [hoverImage, setHoverImage] = useState<HoverImageState | null>(null);
|
|
6193
|
-
const showHoverImage = imageOnHover === 'On';
|
|
6544
|
+
const showHoverImage = imageOnHover === 'On' && (!isEditor || isPreviewMode);
|
|
6194
6545
|
const cutEnabled = (cut ?? 0) > 0;
|
|
6195
6546
|
const isVerticalLayout = type === 'B';
|
|
6196
6547
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
6548
|
+
const firstEntryRef = useRef<HTMLElement | null>(null);
|
|
6549
|
+
const [firstEntryHeightPx, setFirstEntryHeightPx] = useState<number | null>(null);
|
|
6197
6550
|
const [designWidth, setDesignWidth] = useState(ARTICLE_DESIGN_WIDTH);
|
|
6198
6551
|
const minColumnWidth = getListMinColumnWidth(designWidth);
|
|
6199
6552
|
|
|
@@ -6237,29 +6590,6 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6237
6590
|
setVisibleRowCount(undefined);
|
|
6238
6591
|
}, [cut, showCut, content, entriesCount]);
|
|
6239
6592
|
|
|
6240
|
-
const textFieldCss = listColumnTextFieldsToCss(resolveListGlobalTextFields(settings), isEditor);
|
|
6241
|
-
|
|
6242
|
-
const columnTextCssByPrefix = useMemo(
|
|
6243
|
-
() => Object.fromEntries(
|
|
6244
|
-
COLUMN_TEXT_PREFIXES.map((prefix) => [
|
|
6245
|
-
prefix,
|
|
6246
|
-
listColumnTextFieldsToCss(resolveListColumnTextFields(settings, prefix), isEditor),
|
|
6247
|
-
]),
|
|
6248
|
-
),
|
|
6249
|
-
[
|
|
6250
|
-
settings,
|
|
6251
|
-
textFontFamily,
|
|
6252
|
-
textFontSettings,
|
|
6253
|
-
textFontSize,
|
|
6254
|
-
textLineHeight,
|
|
6255
|
-
textLetterSpacing,
|
|
6256
|
-
textWordSpacing,
|
|
6257
|
-
textTextAppearance,
|
|
6258
|
-
textColor,
|
|
6259
|
-
isEditor,
|
|
6260
|
-
],
|
|
6261
|
-
);
|
|
6262
|
-
|
|
6263
6593
|
const colorVars = buildColorVars(P, {
|
|
6264
6594
|
textColor,
|
|
6265
6595
|
backgroundColor,
|
|
@@ -6297,6 +6627,12 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6297
6627
|
}
|
|
6298
6628
|
|
|
6299
6629
|
const prevSettings = prevSettingsRef.current;
|
|
6630
|
+
const settingsChanged = prevSettings !== settings;
|
|
6631
|
+
|
|
6632
|
+
if (!settingsChanged) {
|
|
6633
|
+
return;
|
|
6634
|
+
}
|
|
6635
|
+
|
|
6300
6636
|
const updatedSettings = applyListSettingsChange(
|
|
6301
6637
|
settings,
|
|
6302
6638
|
prevSettings,
|
|
@@ -6451,6 +6787,11 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6451
6787
|
: (rowPaddingTop ?? 0);
|
|
6452
6788
|
const resolvedRowPaddingBottom = rowPaddingBottom ?? 0;
|
|
6453
6789
|
const resolvedCellMinHeight = cellMinHeight ?? 0;
|
|
6790
|
+
const firstEntryCenterTop = (resolvedRowPaddingTop + resolvedCellMinHeight + resolvedRowPaddingBottom) / 2;
|
|
6791
|
+
const rowPaddingBottomControlHeight = Math.max(resolvedRowPaddingBottom, ROW_PADDING_HANDLE_HEIGHT);
|
|
6792
|
+
const firstEntryHandleTop = firstEntryHeightPx != null
|
|
6793
|
+
? \`\${firstEntryHeightPx / 2}px\`
|
|
6794
|
+
: scaled(firstEntryCenterTop);
|
|
6454
6795
|
const rowPaddingTopControlKey = isVerticalLayout ? 'rowPaddingTopB' : 'rowPaddingTop';
|
|
6455
6796
|
const firstColumn = listColumns[0];
|
|
6456
6797
|
const lastColumn = listColumns[listColumns.length - 1];
|
|
@@ -6464,7 +6805,20 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6464
6805
|
: 0;
|
|
6465
6806
|
const columnsRightEdge = resolvedContentWidth;
|
|
6466
6807
|
|
|
6467
|
-
const
|
|
6808
|
+
const getHoverImagePosition = (event: React.MouseEvent) => {
|
|
6809
|
+
const container = containerRef.current;
|
|
6810
|
+
if (!container) {
|
|
6811
|
+
return { x: 0, y: 0 };
|
|
6812
|
+
}
|
|
6813
|
+
|
|
6814
|
+
const rect = container.getBoundingClientRect();
|
|
6815
|
+
return {
|
|
6816
|
+
x: event.clientX - rect.left + HOVER_IMAGE_CURSOR_OFFSET,
|
|
6817
|
+
y: event.clientY - rect.top + HOVER_IMAGE_CURSOR_OFFSET,
|
|
6818
|
+
};
|
|
6819
|
+
};
|
|
6820
|
+
|
|
6821
|
+
const handleRowMouseEnter = (row: ListItemRow, event: React.MouseEvent) => {
|
|
6468
6822
|
if (!showHoverImage) return;
|
|
6469
6823
|
|
|
6470
6824
|
const image = row.image;
|
|
@@ -6473,17 +6827,31 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6473
6827
|
return;
|
|
6474
6828
|
}
|
|
6475
6829
|
|
|
6476
|
-
|
|
6477
|
-
return;
|
|
6478
|
-
}
|
|
6479
|
-
|
|
6830
|
+
const { x, y } = getHoverImagePosition(event);
|
|
6480
6831
|
const minWidth = imageSize?.min ?? 80;
|
|
6481
6832
|
const maxWidth = imageSize?.max ?? 320;
|
|
6833
|
+
const widthPx = hoverImage?.rowId === row.id
|
|
6834
|
+
? hoverImage.widthPx
|
|
6835
|
+
: randomBetween(minWidth, maxWidth);
|
|
6836
|
+
|
|
6482
6837
|
setHoverImage({
|
|
6483
6838
|
rowId: row.id,
|
|
6484
6839
|
url: image.url,
|
|
6485
6840
|
objectFit: image.objectFit ?? 'cover',
|
|
6486
|
-
widthPx
|
|
6841
|
+
widthPx,
|
|
6842
|
+
x,
|
|
6843
|
+
y,
|
|
6844
|
+
});
|
|
6845
|
+
};
|
|
6846
|
+
|
|
6847
|
+
const handleWrapperMouseMove = (event: React.MouseEvent) => {
|
|
6848
|
+
if (!showHoverImage || !hoverImage) return;
|
|
6849
|
+
|
|
6850
|
+
const { x, y } = getHoverImagePosition(event);
|
|
6851
|
+
setHoverImage((prev) => {
|
|
6852
|
+
if (!prev) return prev;
|
|
6853
|
+
if (prev.x === x && prev.y === y) return prev;
|
|
6854
|
+
return { ...prev, x, y };
|
|
6487
6855
|
});
|
|
6488
6856
|
};
|
|
6489
6857
|
|
|
@@ -6491,6 +6859,46 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6491
6859
|
setHoverImage(null);
|
|
6492
6860
|
};
|
|
6493
6861
|
|
|
6862
|
+
const handleCutItemMouseEnter = () => {
|
|
6863
|
+
if (!showHoverImage) return;
|
|
6864
|
+
setHoverImage(null);
|
|
6865
|
+
};
|
|
6866
|
+
|
|
6867
|
+
useLayoutEffect(() => {
|
|
6868
|
+
if (!showControls || isVerticalLayout) {
|
|
6869
|
+
setFirstEntryHeightPx(null);
|
|
6870
|
+
return;
|
|
6871
|
+
}
|
|
6872
|
+
|
|
6873
|
+
const el = firstEntryRef.current;
|
|
6874
|
+
if (!el) {
|
|
6875
|
+
setFirstEntryHeightPx(null);
|
|
6876
|
+
return;
|
|
6877
|
+
}
|
|
6878
|
+
|
|
6879
|
+
const update = () => {
|
|
6880
|
+
setFirstEntryHeightPx(el.getBoundingClientRect().height);
|
|
6881
|
+
};
|
|
6882
|
+
|
|
6883
|
+
update();
|
|
6884
|
+
const observer = new ResizeObserver(update);
|
|
6885
|
+
observer.observe(el);
|
|
6886
|
+
|
|
6887
|
+
return () => observer.disconnect();
|
|
6888
|
+
}, [
|
|
6889
|
+
showControls,
|
|
6890
|
+
isVerticalLayout,
|
|
6891
|
+
visibleRows,
|
|
6892
|
+
resolvedRowPaddingTop,
|
|
6893
|
+
resolvedRowPaddingBottom,
|
|
6894
|
+
resolvedCellMinHeight,
|
|
6895
|
+
content,
|
|
6896
|
+
settings,
|
|
6897
|
+
listColumns,
|
|
6898
|
+
effectiveColumnWidths,
|
|
6899
|
+
designWidth,
|
|
6900
|
+
]);
|
|
6901
|
+
|
|
6494
6902
|
const hasBaselineColumn = useMemo(
|
|
6495
6903
|
() =>
|
|
6496
6904
|
!isVerticalLayout &&
|
|
@@ -6517,10 +6925,14 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6517
6925
|
const clearBaselineStyles = () => {
|
|
6518
6926
|
container.querySelectorAll<HTMLElement>('[data-list-col]').forEach((el) => {
|
|
6519
6927
|
el.style.transform = '';
|
|
6928
|
+
const listCol = el.querySelector<HTMLElement>(\`.\${P}-list-col\`);
|
|
6929
|
+
if (listCol) {
|
|
6930
|
+
listCol.style.minHeight = '';
|
|
6931
|
+
listCol.style.height = '';
|
|
6932
|
+
}
|
|
6520
6933
|
const title = el.querySelector<HTMLElement>(\`.\${P}-list-col-title\`);
|
|
6521
6934
|
if (title) {
|
|
6522
|
-
title.style.
|
|
6523
|
-
title.style.marginTop = '';
|
|
6935
|
+
title.style.transform = '';
|
|
6524
6936
|
}
|
|
6525
6937
|
});
|
|
6526
6938
|
};
|
|
@@ -6535,13 +6947,21 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6535
6947
|
const cols = Array.from(rowEl.querySelectorAll<HTMLElement>('[data-list-col]'));
|
|
6536
6948
|
cols.forEach((el) => {
|
|
6537
6949
|
el.style.transform = '';
|
|
6950
|
+
const listCol = el.querySelector<HTMLElement>(\`.\${P}-list-col\`);
|
|
6951
|
+
if (listCol) {
|
|
6952
|
+
listCol.style.minHeight = '';
|
|
6953
|
+
listCol.style.height = '';
|
|
6954
|
+
}
|
|
6538
6955
|
const title = el.querySelector<HTMLElement>(\`.\${P}-list-col-title\`);
|
|
6539
6956
|
if (title) {
|
|
6540
|
-
title.style.
|
|
6541
|
-
title.style.marginTop = '';
|
|
6957
|
+
title.style.transform = '';
|
|
6542
6958
|
}
|
|
6543
6959
|
});
|
|
6544
6960
|
|
|
6961
|
+
syncRowListColHeights(rowEl, cols, \`\${P}-list-col\`);
|
|
6962
|
+
void rowEl.offsetHeight;
|
|
6963
|
+
const rowTop = rowEl.getBoundingClientRect().top;
|
|
6964
|
+
|
|
6545
6965
|
type ColInfo = {
|
|
6546
6966
|
el: HTMLElement;
|
|
6547
6967
|
titleEl: HTMLElement | null;
|
|
@@ -6572,7 +6992,12 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6572
6992
|
|
|
6573
6993
|
const anchor = info.anchor ? byLetter.get(info.anchor) : undefined;
|
|
6574
6994
|
if (info.kind !== 'baseline' || !anchor || stack.has(info.letter)) {
|
|
6575
|
-
const baseline =
|
|
6995
|
+
const baseline = measureColumnFirstLineBaselineOffset(
|
|
6996
|
+
info,
|
|
6997
|
+
rowTop,
|
|
6998
|
+
\`\${P}-list-col\`,
|
|
6999
|
+
probeClassName,
|
|
7000
|
+
);
|
|
6576
7001
|
finalBaseline.set(info.letter, baseline);
|
|
6577
7002
|
return baseline;
|
|
6578
7003
|
}
|
|
@@ -6581,11 +7006,21 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6581
7006
|
const anchorBaseline = resolve(anchor, stack);
|
|
6582
7007
|
stack.delete(info.letter);
|
|
6583
7008
|
|
|
6584
|
-
const followerNatural =
|
|
7009
|
+
const followerNatural = measureColumnFirstLineBaselineOffset(
|
|
7010
|
+
info,
|
|
7011
|
+
rowTop,
|
|
7012
|
+
\`\${P}-list-col\`,
|
|
7013
|
+
probeClassName,
|
|
7014
|
+
);
|
|
6585
7015
|
const shift = anchorBaseline - followerNatural;
|
|
6586
7016
|
applyBaselineTitleShift(info.titleEl, shift);
|
|
6587
7017
|
|
|
6588
|
-
const result =
|
|
7018
|
+
const result = measureColumnFirstLineBaselineOffset(
|
|
7019
|
+
info,
|
|
7020
|
+
rowTop,
|
|
7021
|
+
\`\${P}-list-col\`,
|
|
7022
|
+
probeClassName,
|
|
7023
|
+
);
|
|
6589
7024
|
finalBaseline.set(info.letter, result);
|
|
6590
7025
|
return result;
|
|
6591
7026
|
};
|
|
@@ -6619,7 +7054,6 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6619
7054
|
designWidth,
|
|
6620
7055
|
visibleRows,
|
|
6621
7056
|
effectiveColumnWidths,
|
|
6622
|
-
columnTextCssByPrefix,
|
|
6623
7057
|
]);
|
|
6624
7058
|
|
|
6625
7059
|
return (
|
|
@@ -6631,7 +7065,11 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6631
7065
|
className={\`\${P}-wrapper \${wrapperStateClasses}\${dividerClassNames ? \` \${dividerClassNames}\` : ''}\${isVerticalLayout ? \` \${P}-type-b\` : ''}\`.trim()}
|
|
6632
7066
|
style={{
|
|
6633
7067
|
width: scalingValue(wrapperWidth ?? 0, isEditor),
|
|
7068
|
+
...(!isVerticalLayout && showControls
|
|
7069
|
+
? { [\`--\${P}-first-entry-handle-top\`]: firstEntryHandleTop }
|
|
7070
|
+
: {}),
|
|
6634
7071
|
}}
|
|
7072
|
+
onMouseMove={showHoverImage ? handleWrapperMouseMove : undefined}
|
|
6635
7073
|
onMouseLeave={showHoverImage ? handleWrapperMouseLeave : undefined}
|
|
6636
7074
|
>
|
|
6637
7075
|
<div style={{ width: '100%' }}>
|
|
@@ -6651,24 +7089,20 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6651
7089
|
return (
|
|
6652
7090
|
<RowElement
|
|
6653
7091
|
key={row.id}
|
|
6654
|
-
|
|
7092
|
+
ref={rowIdx === 0 ? (el: HTMLElement | null) => { firstEntryRef.current = el; } : undefined}
|
|
7093
|
+
className={\`\${P}-list-item\${hasLink ? \` \${P}-list-item-has-link\` : ''}\`}
|
|
6655
7094
|
{...(hasLink ? { href: row.link, target: '_blank' } : {})}
|
|
6656
7095
|
style={rowStyle}
|
|
6657
|
-
onMouseEnter={showHoverImage ? () => handleRowMouseEnter(row) : undefined}
|
|
7096
|
+
onMouseEnter={showHoverImage ? (event) => handleRowMouseEnter(row, event) : undefined}
|
|
6658
7097
|
>
|
|
6659
|
-
{
|
|
7098
|
+
{resolvedRowPaddingTop > 0 && (
|
|
6660
7099
|
<div
|
|
6661
|
-
{...(showControls ? {
|
|
6662
|
-
'data-controls': rowPaddingTopControlKey,
|
|
6663
|
-
'data-controls-axis': 'y',
|
|
6664
|
-
'data-controls-min': '0',
|
|
6665
|
-
} : {})}
|
|
6666
7100
|
className={\`\${P}-row-padding-handle\`}
|
|
6667
7101
|
style={{ height: scaled(resolvedRowPaddingTop) }}
|
|
6668
7102
|
/>
|
|
6669
7103
|
)}
|
|
6670
7104
|
<div
|
|
6671
|
-
className={\`\${P}-list-cols-row\${isVerticalLayout ? '' : \` \${P}-list-cols-row-h\`}\`}
|
|
7105
|
+
className={\`\${P}-list-cols-row\${isVerticalLayout ? '' : \` \${P}-list-cols-row-h\`}\${showControls && rowIdx === 0 && isVerticalLayout ? \` \${P}-list-cols-row-controls\` : ''}\`}
|
|
6672
7106
|
{...(isVerticalLayout ? {} : { 'data-list-row': '' })}
|
|
6673
7107
|
style={isVerticalLayout ? undefined : { minHeight: scaled(resolvedCellMinHeight) }}
|
|
6674
7108
|
>
|
|
@@ -6679,10 +7113,10 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6679
7113
|
const hasColumnText = hasListColumnText(row.cells[col.key]);
|
|
6680
7114
|
const showColumnPaddingBottom = isVerticalLayout
|
|
6681
7115
|
&& hasColumnText
|
|
6682
|
-
&&
|
|
7116
|
+
&& columnPaddingBottom > 0;
|
|
6683
7117
|
const columnSizeStyle = isVerticalLayout
|
|
6684
7118
|
? { minHeight: scaled(resolvedCellMinHeight) }
|
|
6685
|
-
:
|
|
7119
|
+
: { width: scaled(effectiveColumnWidths[colIndex]) };
|
|
6686
7120
|
const columnPaddingStyle = isVerticalLayout
|
|
6687
7121
|
? {
|
|
6688
7122
|
paddingLeft: scaled(effectiveTextPaddingLR),
|
|
@@ -6694,16 +7128,24 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6694
7128
|
};
|
|
6695
7129
|
const columnLetter = col.textPrefix.charAt(0);
|
|
6696
7130
|
const vAlign = isVerticalLayout
|
|
6697
|
-
?
|
|
7131
|
+
? resolveBasicColumnVerticalAlign(
|
|
7132
|
+
settings[\`\${col.textPrefix}VerticalAlign\` as ListColumnVerticalAlignKey],
|
|
7133
|
+
)
|
|
6698
7134
|
: resolveColumnVerticalAlign(
|
|
6699
7135
|
settings[\`\${col.textPrefix}VerticalAlign\` as ListColumnVerticalAlignKey],
|
|
6700
7136
|
settings,
|
|
6701
7137
|
columnLetter,
|
|
6702
7138
|
);
|
|
6703
7139
|
|
|
7140
|
+
const columnPaddingBottomOverlay = isVerticalLayout
|
|
7141
|
+
&& hasColumnText
|
|
7142
|
+
&& showControls
|
|
7143
|
+
&& rowIdx === 0;
|
|
7144
|
+
|
|
6704
7145
|
return (
|
|
6705
7146
|
<div
|
|
6706
7147
|
key={col.key}
|
|
7148
|
+
className={isVerticalLayout ? \`\${P}-list-col-wrap\` : undefined}
|
|
6707
7149
|
{...(isVerticalLayout
|
|
6708
7150
|
? {}
|
|
6709
7151
|
: {
|
|
@@ -6720,50 +7162,138 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6720
7162
|
style={{
|
|
6721
7163
|
...columnPaddingStyle,
|
|
6722
7164
|
...columnSizeStyle,
|
|
6723
|
-
...(
|
|
6724
|
-
? { justifyContent:
|
|
7165
|
+
...(isVerticalLayout
|
|
7166
|
+
? { justifyContent: cutVerticalAlignKindToFlexAlign(vAlign.kind) }
|
|
6725
7167
|
: {}),
|
|
6726
7168
|
}}
|
|
6727
7169
|
data-test={col.width}
|
|
6728
7170
|
>
|
|
6729
7171
|
<span
|
|
6730
|
-
className={
|
|
6731
|
-
|
|
7172
|
+
className={getListColumnTitleClassName(
|
|
7173
|
+
settings,
|
|
7174
|
+
col.textPrefix,
|
|
7175
|
+
\`\${P}-list-col-title\`,
|
|
7176
|
+
\`\${P}-text-tight-leading\`,
|
|
7177
|
+
)}
|
|
7178
|
+
style={{
|
|
7179
|
+
...listColumnTextFieldsToCss(resolveListColumnTextFields(settings, col.textPrefix), isEditor),
|
|
7180
|
+
...getListColumnTitleVars(settings, col.textPrefix, P, isEditor),
|
|
7181
|
+
...(!isVerticalLayout ? vAlignToTitleStyle(vAlign.kind) : {}),
|
|
7182
|
+
}}
|
|
6732
7183
|
>
|
|
6733
7184
|
{row.cells[col.key] ?? null}
|
|
6734
7185
|
</span>
|
|
6735
7186
|
</div>
|
|
6736
7187
|
{showColumnPaddingBottom && (
|
|
6737
7188
|
<div
|
|
6738
|
-
{...(showControls ? {
|
|
6739
|
-
'data-controls': col.paddingBottomKey,
|
|
6740
|
-
'data-controls-axis': 'y',
|
|
6741
|
-
'data-controls-min': '0',
|
|
6742
|
-
} : {})}
|
|
6743
7189
|
className={\`\${P}-row-padding-handle\`}
|
|
6744
7190
|
style={{ height: scaled(columnPaddingBottom) }}
|
|
6745
7191
|
/>
|
|
6746
7192
|
)}
|
|
7193
|
+
{columnPaddingBottomOverlay && (
|
|
7194
|
+
<ListPaddingControl
|
|
7195
|
+
P={P}
|
|
7196
|
+
data-controls={col.paddingBottomKey}
|
|
7197
|
+
data-controls-static-handle=""
|
|
7198
|
+
data-controls-handle-left="20"
|
|
7199
|
+
data-controls-axis="y"
|
|
7200
|
+
data-controls-variant="column-padding"
|
|
7201
|
+
data-controls-min="0"
|
|
7202
|
+
className={\`\${P}-padding-control-handle\`}
|
|
7203
|
+
hitPlacement="left-y"
|
|
7204
|
+
areaStyle={{
|
|
7205
|
+
position: 'absolute',
|
|
7206
|
+
bottom: 0,
|
|
7207
|
+
left: 0,
|
|
7208
|
+
width: '100%',
|
|
7209
|
+
height: scaled(Math.max(columnPaddingBottom, ROW_PADDING_HANDLE_HEIGHT)),
|
|
7210
|
+
}}
|
|
7211
|
+
/>
|
|
7212
|
+
)}
|
|
6747
7213
|
</div>
|
|
6748
7214
|
);
|
|
6749
7215
|
})}
|
|
7216
|
+
{showControls && rowIdx === 0 && isVerticalLayout && (
|
|
7217
|
+
<>
|
|
7218
|
+
<ListPaddingControl
|
|
7219
|
+
P={P}
|
|
7220
|
+
data-controls="textPaddingLR"
|
|
7221
|
+
data-controls-static-handle=""
|
|
7222
|
+
data-controls-paired=""
|
|
7223
|
+
data-controls-axis="x"
|
|
7224
|
+
data-controls-variant="column-padding"
|
|
7225
|
+
data-controls-min="0"
|
|
7226
|
+
data-controls-max-fraction={String(textPaddingLRMaxFraction)}
|
|
7227
|
+
className={\`\${P}-text-padding-lr-handle\`}
|
|
7228
|
+
hitPlacement="center"
|
|
7229
|
+
areaStyle={{
|
|
7230
|
+
position: 'absolute',
|
|
7231
|
+
top: 0,
|
|
7232
|
+
left: 0,
|
|
7233
|
+
width: scaled(textPaddingLRHandleWidth),
|
|
7234
|
+
height: '100%',
|
|
7235
|
+
}}
|
|
7236
|
+
/>
|
|
7237
|
+
<ListPaddingControl
|
|
7238
|
+
P={P}
|
|
7239
|
+
data-controls="textPaddingLR"
|
|
7240
|
+
data-controls-static-handle=""
|
|
7241
|
+
data-controls-paired=""
|
|
7242
|
+
data-controls-axis="x"
|
|
7243
|
+
data-controls-variant="column-padding"
|
|
7244
|
+
data-controls-reverse=""
|
|
7245
|
+
data-controls-min="0"
|
|
7246
|
+
data-controls-max-fraction={String(textPaddingLRMaxFraction)}
|
|
7247
|
+
className={\`\${P}-text-padding-lr-handle\`}
|
|
7248
|
+
hitPlacement="center"
|
|
7249
|
+
areaStyle={{
|
|
7250
|
+
position: 'absolute',
|
|
7251
|
+
top: 0,
|
|
7252
|
+
left: scaled(Math.max(textPaddingLRHandleWidth, resolvedContentWidth - textPaddingLRHandleWidth)),
|
|
7253
|
+
width: scaled(textPaddingLRHandleWidth),
|
|
7254
|
+
height: '100%',
|
|
7255
|
+
}}
|
|
7256
|
+
/>
|
|
7257
|
+
</>
|
|
7258
|
+
)}
|
|
6750
7259
|
</div>
|
|
6751
|
-
{!isVerticalLayout &&
|
|
7260
|
+
{!isVerticalLayout && resolvedRowPaddingBottom > 0 && (
|
|
6752
7261
|
<div
|
|
6753
|
-
{...(showControls ? {
|
|
6754
|
-
'data-controls': 'rowPaddingBottom',
|
|
6755
|
-
'data-controls-axis': 'y',
|
|
6756
|
-
'data-controls-min': '0',
|
|
6757
|
-
} : {})}
|
|
6758
7262
|
className={\`\${P}-row-padding-handle\`}
|
|
6759
7263
|
style={{ height: scaled(resolvedRowPaddingBottom) }}
|
|
6760
7264
|
/>
|
|
6761
7265
|
)}
|
|
7266
|
+
{showControls && rowIdx === 0 && !isVerticalLayout && (
|
|
7267
|
+
<ListPaddingControl
|
|
7268
|
+
P={P}
|
|
7269
|
+
data-controls="rowPaddingBottom"
|
|
7270
|
+
data-controls-static-handle=""
|
|
7271
|
+
data-controls-handle-left="20"
|
|
7272
|
+
data-controls-axis="y"
|
|
7273
|
+
data-controls-variant="row-padding"
|
|
7274
|
+
data-controls-min="0"
|
|
7275
|
+
className={\`\${P}-padding-control-handle\`}
|
|
7276
|
+
hitPlacement="left-y"
|
|
7277
|
+
areaStyle={{
|
|
7278
|
+
position: 'absolute',
|
|
7279
|
+
bottom: 0,
|
|
7280
|
+
left: 0,
|
|
7281
|
+
width: '100%',
|
|
7282
|
+
height: scaled(rowPaddingBottomControlHeight),
|
|
7283
|
+
}}
|
|
7284
|
+
/>
|
|
7285
|
+
)}
|
|
6762
7286
|
</RowElement>
|
|
6763
7287
|
);
|
|
6764
7288
|
})}
|
|
6765
|
-
{showCutLabel && (
|
|
6766
|
-
|
|
7289
|
+
{showCutLabel && (() => {
|
|
7290
|
+
const cutLabelFields = resolveListColumnTextFields(settings, CUT_LABEL_TEXT_PREFIX);
|
|
7291
|
+
const cutLabelVerticalAlignKind = resolveCutLabelVerticalAlignKind(settings.cutLabelVerticalAlign);
|
|
7292
|
+
const cutLabelUsesFullWidth = cutLabelFields.textTextAlign === 'justify' || isVerticalLayout;
|
|
7293
|
+
|
|
7294
|
+
return (
|
|
7295
|
+
<button
|
|
7296
|
+
type="button"
|
|
6767
7297
|
className={\`\${P}-cut-item\`}
|
|
6768
7298
|
style={{
|
|
6769
7299
|
minHeight: scaled(cutCellMinHeight ?? 0),
|
|
@@ -6773,54 +7303,90 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6773
7303
|
isEditor ?? false,
|
|
6774
7304
|
),
|
|
6775
7305
|
}}
|
|
7306
|
+
onClick={handleShowMore}
|
|
7307
|
+
onMouseEnter={showHoverImage ? handleCutItemMouseEnter : undefined}
|
|
6776
7308
|
>
|
|
6777
7309
|
<div
|
|
6778
7310
|
className={\`\${P}-list-cols-row\`}
|
|
6779
|
-
style={
|
|
6780
|
-
isVerticalLayout
|
|
7311
|
+
style={{
|
|
7312
|
+
...(isVerticalLayout
|
|
6781
7313
|
? {
|
|
6782
7314
|
paddingLeft: scaled(effectiveTextPaddingLR),
|
|
6783
7315
|
paddingRight: scaled(effectiveTextPaddingLR),
|
|
6784
7316
|
}
|
|
6785
|
-
: {
|
|
6786
|
-
|
|
7317
|
+
: {}),
|
|
7318
|
+
justifyContent: textAlignToJustifyContent(cutLabelFields.textTextAlign),
|
|
7319
|
+
alignItems: cutVerticalAlignKindToFlexAlign(cutLabelVerticalAlignKind),
|
|
7320
|
+
}}
|
|
6787
7321
|
>
|
|
6788
|
-
<
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
7322
|
+
<span
|
|
7323
|
+
className={getListColumnTitleClassName(
|
|
7324
|
+
settings,
|
|
7325
|
+
CUT_LABEL_TEXT_PREFIX,
|
|
7326
|
+
\`\${P}-cut-label\`,
|
|
7327
|
+
\`\${P}-text-tight-leading\`,
|
|
7328
|
+
)}
|
|
7329
|
+
style={{
|
|
7330
|
+
...listColumnTextFieldsToCss(cutLabelFields, isEditor),
|
|
7331
|
+
...getListColumnTitleVars(settings, CUT_LABEL_TEXT_PREFIX, P, isEditor),
|
|
7332
|
+
...(cutLabelUsesFullWidth ? { width: '100%' } : {}),
|
|
7333
|
+
}}
|
|
6793
7334
|
>
|
|
6794
7335
|
{cutLabel}
|
|
6795
|
-
</
|
|
7336
|
+
</span>
|
|
6796
7337
|
</div>
|
|
6797
|
-
</
|
|
6798
|
-
|
|
7338
|
+
</button>
|
|
7339
|
+
);
|
|
7340
|
+
})()}
|
|
6799
7341
|
</div>
|
|
7342
|
+
{showControls && (
|
|
7343
|
+
<div key="row-padding-handles" style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
|
|
7344
|
+
<ListPaddingControl
|
|
7345
|
+
P={P}
|
|
7346
|
+
data-controls={rowPaddingTopControlKey}
|
|
7347
|
+
data-controls-static-handle=""
|
|
7348
|
+
data-controls-handle-left="20"
|
|
7349
|
+
data-controls-axis="y"
|
|
7350
|
+
data-controls-variant="row-padding"
|
|
7351
|
+
data-controls-min="0"
|
|
7352
|
+
className={\`\${P}-padding-control-handle\`}
|
|
7353
|
+
hitPlacement="left-y"
|
|
7354
|
+
areaStyle={{
|
|
7355
|
+
position: 'absolute',
|
|
7356
|
+
top: 0,
|
|
7357
|
+
left: 0,
|
|
7358
|
+
width: '100%',
|
|
7359
|
+
height: scaled(Math.max(resolvedRowPaddingTop, ROW_PADDING_HANDLE_HEIGHT)),
|
|
7360
|
+
}}
|
|
7361
|
+
/>
|
|
7362
|
+
</div>
|
|
7363
|
+
)}
|
|
6800
7364
|
{showControls && !isVerticalLayout && firstColumn && lastColumn && (
|
|
6801
7365
|
<div key="column-edge-padding-handles" style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
|
|
6802
|
-
<
|
|
7366
|
+
<ListPaddingControl
|
|
7367
|
+
P={P}
|
|
6803
7368
|
data-controls={firstColumn.paddingLeftKey}
|
|
7369
|
+
data-controls-static-handle=""
|
|
6804
7370
|
data-controls-axis="x"
|
|
6805
7371
|
data-controls-variant="column-padding"
|
|
6806
7372
|
data-controls-min="0"
|
|
6807
7373
|
data-controls-max-fraction={String(
|
|
6808
7374
|
effectiveColumnWidths[0] - (firstColumnEffectivePadding?.paddingRight ?? 0),
|
|
6809
7375
|
)}
|
|
6810
|
-
data-controls-static-handle=""
|
|
6811
7376
|
className={\`\${P}-padding-control-handle\`}
|
|
6812
|
-
|
|
7377
|
+
hitPlacement="center-x"
|
|
7378
|
+
areaStyle={{
|
|
6813
7379
|
position: 'absolute',
|
|
6814
7380
|
top: 0,
|
|
6815
7381
|
left: 0,
|
|
6816
7382
|
width: scaled(firstColumnPaddingLeftWidth),
|
|
6817
7383
|
height: '100%',
|
|
6818
|
-
pointerEvents: 'auto',
|
|
6819
|
-
zIndex: 2,
|
|
6820
7384
|
}}
|
|
6821
7385
|
/>
|
|
6822
|
-
<
|
|
7386
|
+
<ListPaddingControl
|
|
7387
|
+
P={P}
|
|
6823
7388
|
data-controls={lastColumn.paddingRightKey}
|
|
7389
|
+
data-controls-static-handle=""
|
|
6824
7390
|
data-controls-axis="x"
|
|
6825
7391
|
data-controls-variant="column-padding"
|
|
6826
7392
|
data-controls-reverse=""
|
|
@@ -6829,28 +7395,20 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6829
7395
|
effectiveColumnWidths[listColumns.length - 1]
|
|
6830
7396
|
- (lastColumnEffectivePadding?.paddingLeft ?? 0),
|
|
6831
7397
|
)}
|
|
6832
|
-
data-controls-static-handle=""
|
|
6833
7398
|
className={\`\${P}-padding-control-handle\`}
|
|
6834
|
-
|
|
7399
|
+
hitPlacement="center-x"
|
|
7400
|
+
areaStyle={{
|
|
6835
7401
|
position: 'absolute',
|
|
6836
7402
|
top: 0,
|
|
6837
7403
|
left: scaled(columnsRightEdge - lastColumnPaddingRightWidth),
|
|
6838
7404
|
width: scaled(lastColumnPaddingRightWidth),
|
|
6839
7405
|
height: '100%',
|
|
6840
|
-
pointerEvents: 'auto',
|
|
6841
|
-
zIndex: 2,
|
|
6842
7406
|
}}
|
|
6843
7407
|
/>
|
|
6844
7408
|
</div>
|
|
6845
7409
|
)}
|
|
6846
7410
|
{showControls && !isVerticalLayout && listColumns.slice(0, -1).map((col, colIndex) => {
|
|
6847
7411
|
const nextCol = listColumns[colIndex + 1];
|
|
6848
|
-
const maxColumnWidth = getColumnMaxWidth(
|
|
6849
|
-
colIndex,
|
|
6850
|
-
resolvedColumnWidths,
|
|
6851
|
-
storedColumnWidths,
|
|
6852
|
-
resolvedContentWidth,
|
|
6853
|
-
);
|
|
6854
7412
|
const boundaryOffset = resolvedColumnWidths.slice(0, colIndex + 1).reduce((sum, width) => sum + width, 0);
|
|
6855
7413
|
const colEffectivePadding = effectiveColumnPaddings[colIndex];
|
|
6856
7414
|
const nextColEffectivePadding = effectiveColumnPaddings[colIndex + 1];
|
|
@@ -6862,12 +7420,13 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6862
7420
|
nextColEffectivePadding.paddingLeft,
|
|
6863
7421
|
COL_PADDING_HANDLE_WIDTH,
|
|
6864
7422
|
);
|
|
6865
|
-
const columnWidthHandleOffset = boundaryOffset - COL_RESIZE_HANDLE_WIDTH / 2;
|
|
6866
7423
|
|
|
6867
7424
|
return (
|
|
6868
|
-
<div key={\`\${col.
|
|
6869
|
-
<
|
|
7425
|
+
<div key={\`\${col.paddingRightKey}-padding\`} style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
|
|
7426
|
+
<ListPaddingControl
|
|
7427
|
+
P={P}
|
|
6870
7428
|
data-controls={col.paddingRightKey}
|
|
7429
|
+
data-controls-static-handle=""
|
|
6871
7430
|
data-controls-axis="x"
|
|
6872
7431
|
data-controls-variant="column-padding"
|
|
6873
7432
|
data-controls-reverse=""
|
|
@@ -6875,99 +7434,71 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6875
7434
|
data-controls-max-fraction={String(
|
|
6876
7435
|
effectiveColumnWidths[colIndex] - colEffectivePadding.paddingLeft,
|
|
6877
7436
|
)}
|
|
6878
|
-
data-controls-static-handle=""
|
|
6879
7437
|
className={\`\${P}-padding-control-handle\`}
|
|
6880
|
-
|
|
7438
|
+
hitPlacement="center-x"
|
|
7439
|
+
areaStyle={{
|
|
6881
7440
|
position: 'absolute',
|
|
6882
7441
|
top: 0,
|
|
6883
7442
|
left: scaled(boundaryOffset - paddingRightWidth),
|
|
6884
7443
|
width: scaled(paddingRightWidth),
|
|
6885
7444
|
height: '100%',
|
|
6886
|
-
pointerEvents: 'auto',
|
|
6887
|
-
zIndex: 2,
|
|
6888
|
-
}}
|
|
6889
|
-
/>
|
|
6890
|
-
<div
|
|
6891
|
-
data-controls={col.widthKey}
|
|
6892
|
-
data-controls-axis="x"
|
|
6893
|
-
data-controls-min={String(MIN_COLUMN_WIDTH_PX)}
|
|
6894
|
-
data-controls-max-fraction={String(maxColumnWidth)}
|
|
6895
|
-
data-controls-variant="column-width"
|
|
6896
|
-
className={\`\${P}-col-resize-handle\`}
|
|
6897
|
-
style={{
|
|
6898
|
-
position: 'absolute',
|
|
6899
|
-
top: '0px',
|
|
6900
|
-
left: scaled(columnWidthHandleOffset),
|
|
6901
|
-
width: scaled(COL_RESIZE_HANDLE_WIDTH),
|
|
6902
|
-
height: 'calc(100%)',
|
|
6903
|
-
pointerEvents: 'auto',
|
|
6904
|
-
zIndex: 4,
|
|
6905
7445
|
}}
|
|
6906
7446
|
/>
|
|
6907
|
-
<
|
|
7447
|
+
<ListPaddingControl
|
|
7448
|
+
P={P}
|
|
6908
7449
|
data-controls={nextCol.paddingLeftKey}
|
|
7450
|
+
data-controls-static-handle=""
|
|
6909
7451
|
data-controls-axis="x"
|
|
6910
7452
|
data-controls-variant="column-padding"
|
|
6911
7453
|
data-controls-min="0"
|
|
6912
7454
|
data-controls-max-fraction={String(
|
|
6913
7455
|
effectiveColumnWidths[colIndex + 1] - nextColEffectivePadding.paddingRight,
|
|
6914
7456
|
)}
|
|
6915
|
-
data-controls-static-handle=""
|
|
6916
7457
|
className={\`\${P}-padding-control-handle\`}
|
|
6917
|
-
|
|
7458
|
+
hitPlacement="center-x"
|
|
7459
|
+
areaStyle={{
|
|
6918
7460
|
position: 'absolute',
|
|
6919
7461
|
top: 0,
|
|
6920
7462
|
left: scaled(boundaryOffset),
|
|
6921
7463
|
width: scaled(paddingLeftWidth),
|
|
6922
7464
|
height: '100%',
|
|
7465
|
+
}}
|
|
7466
|
+
/>
|
|
7467
|
+
</div>
|
|
7468
|
+
);
|
|
7469
|
+
})}
|
|
7470
|
+
{showControls && !isVerticalLayout && listColumns.slice(0, -1).map((col, colIndex) => {
|
|
7471
|
+
const maxColumnWidth = getColumnMaxWidth(
|
|
7472
|
+
colIndex,
|
|
7473
|
+
resolvedColumnWidths,
|
|
7474
|
+
storedColumnWidths,
|
|
7475
|
+
resolvedContentWidth,
|
|
7476
|
+
);
|
|
7477
|
+
const boundaryOffset = resolvedColumnWidths.slice(0, colIndex + 1).reduce((sum, width) => sum + width, 0);
|
|
7478
|
+
const columnWidthHandleOffset = boundaryOffset - COL_RESIZE_HANDLE_WIDTH / 2;
|
|
7479
|
+
|
|
7480
|
+
return (
|
|
7481
|
+
<div key={\`\${col.widthKey}-junction\`} style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
|
|
7482
|
+
<div
|
|
7483
|
+
data-controls={col.widthKey}
|
|
7484
|
+
data-controls-static-handle=""
|
|
7485
|
+
data-controls-axis="x"
|
|
7486
|
+
data-controls-min={String(MIN_COLUMN_WIDTH_PX)}
|
|
7487
|
+
data-controls-max-fraction={String(maxColumnWidth)}
|
|
7488
|
+
data-controls-variant="column-width"
|
|
7489
|
+
className={\`\${P}-col-resize-handle\`}
|
|
7490
|
+
style={{
|
|
7491
|
+
position: 'absolute',
|
|
7492
|
+
top: '0px',
|
|
7493
|
+
left: scaled(columnWidthHandleOffset),
|
|
7494
|
+
width: scaled(COL_RESIZE_HANDLE_WIDTH),
|
|
7495
|
+
height: 'calc(100%)',
|
|
6923
7496
|
pointerEvents: 'auto',
|
|
6924
|
-
zIndex: 2,
|
|
6925
7497
|
}}
|
|
6926
7498
|
/>
|
|
6927
7499
|
</div>
|
|
6928
7500
|
);
|
|
6929
7501
|
})}
|
|
6930
|
-
{showControls && isVerticalLayout && (
|
|
6931
|
-
<div key="text-padding-lr-handles" style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>
|
|
6932
|
-
<div
|
|
6933
|
-
data-controls="textPaddingLR"
|
|
6934
|
-
data-controls-paired=""
|
|
6935
|
-
data-controls-axis="x"
|
|
6936
|
-
data-controls-min="0"
|
|
6937
|
-
data-controls-max-fraction={String(textPaddingLRMaxFraction)}
|
|
6938
|
-
data-controls-static-handle=""
|
|
6939
|
-
className={\`\${P}-text-padding-lr-handle\`}
|
|
6940
|
-
style={{
|
|
6941
|
-
position: 'absolute',
|
|
6942
|
-
top: 0,
|
|
6943
|
-
left: 0,
|
|
6944
|
-
width: scaled(textPaddingLRHandleWidth),
|
|
6945
|
-
height: '100%',
|
|
6946
|
-
pointerEvents: 'auto',
|
|
6947
|
-
zIndex: 2,
|
|
6948
|
-
}}
|
|
6949
|
-
/>
|
|
6950
|
-
<div
|
|
6951
|
-
data-controls="textPaddingLR"
|
|
6952
|
-
data-controls-paired=""
|
|
6953
|
-
data-controls-axis="x"
|
|
6954
|
-
data-controls-reverse=""
|
|
6955
|
-
data-controls-min="0"
|
|
6956
|
-
data-controls-max-fraction={String(textPaddingLRMaxFraction)}
|
|
6957
|
-
data-controls-static-handle=""
|
|
6958
|
-
className={\`\${P}-text-padding-lr-handle\`}
|
|
6959
|
-
style={{
|
|
6960
|
-
position: 'absolute',
|
|
6961
|
-
top: 0,
|
|
6962
|
-
left: scaled(Math.max(textPaddingLRHandleWidth, resolvedContentWidth - textPaddingLRHandleWidth)),
|
|
6963
|
-
width: scaled(textPaddingLRHandleWidth),
|
|
6964
|
-
height: '100%',
|
|
6965
|
-
pointerEvents: 'auto',
|
|
6966
|
-
zIndex: 2,
|
|
6967
|
-
}}
|
|
6968
|
-
/>
|
|
6969
|
-
</div>
|
|
6970
|
-
)}
|
|
6971
7502
|
{showHoverImage && hoverImage && (
|
|
6972
7503
|
<img
|
|
6973
7504
|
className={\`\${P}-hover-image\`}
|
|
@@ -6976,6 +7507,8 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6976
7507
|
style={{
|
|
6977
7508
|
width: sv(hoverImage.widthPx),
|
|
6978
7509
|
objectFit: hoverImage.objectFit,
|
|
7510
|
+
left: hoverImage.x,
|
|
7511
|
+
top: hoverImage.y,
|
|
6979
7512
|
}}
|
|
6980
7513
|
/>
|
|
6981
7514
|
)}
|
|
@@ -6984,4 +7517,4 @@ export function List({ settings, content, isEditor, isPreviewMode, activeEvent,
|
|
|
6984
7517
|
</>
|
|
6985
7518
|
);
|
|
6986
7519
|
}
|
|
6987
|
-
`,Et=["A","B","C","D","E"],Ni=[...zc,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],vd={FontFamily:"textFontFamily",FontSettings:"textFontSettings",FontSize:"textFontSize",LineHeight:"textLineHeight",LetterSpacing:"textLetterSpacing",WordSpacing:"textWordSpacing",TextAppearance:"textTextAppearance"};function Re(e,t){return ti(e,vd[t])}const Mt={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"}},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 bd(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Nn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function xd(){return Object.fromEntries(Et.map((e,t)=>{const n=Jt[t],o=`${e} column`;return[n,bd(o)]}))}function Cd(){const e={};for(const t of Et)e[`${t}ColumnWidth`]=Nn(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Nn(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Nn(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Nn(`${t} column padding bottom`);return e}function Oi(e={}){const t={columns:5,wrapperWidth:1,columnsOrder:[...Jt]};for(const n of Et)t[`${n}ColumnWidth`]=.2,t[`${n}ColumnPaddingLeft`]=0,t[`${n}ColumnPaddingRight`]=0,t[`${n}ColumnPaddingBottom`]=0;return{...t,...e}}function Sd(e){const t=e.charAt(0);return{[`${e}VerticalAlign`]:{type:"string",scope:"layout",title:"Vertical align",display:{type:"drop-down",enum:[...Ni],filterBaselineByTopAnchor:!0,columnLetter:t},enum:[...Ni]},[Re(e,"FontFamily")]:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},[Re(e,"FontSettings")]:{...Mt.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},[Re(e,"FontSize")]:{...Mt.fontSize,scope:"layout",title:"Font Size",display:{type:"font-size"}},[Re(e,"LineHeight")]:{...Mt.lineHeight,scope:"layout",title:"Line Height",display:{type:"line-height-input"}},[Re(e,"LetterSpacing")]:{...Mt.letterSpacing,scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},[Re(e,"WordSpacing")]:{...Mt.wordSpacing,scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},[Re(e,"TextAppearance")]:{...Mt.textAppearance,scope:"layout",title:"Text Appearance",display:{type:"text-appearance"}}}}const wd=Bt.reduce((e,t)=>({...e,...Sd(t)}),{}),$d=Bt.reduce((e,t)=>({...e,[`${t}VerticalAlign`]:"Top",[Re(t,"FontFamily")]:"Arial",[Re(t,"FontSettings")]:{fontWeight:400,fontStyle:"normal"},[Re(t,"LetterSpacing")]:0,[Re(t,"WordSpacing")]:0,[Re(t,"TextAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Hi(e){const{textFontSize:t,textLineHeight:n}=e;return Bt.reduce((o,i)=>(t!==void 0&&(o[`${i}TextFontSize`]=t),n!==void 0&&(o[`${i}TextLineHeight`]=n),o),{})}const Td=Et.map(e=>`${e} column`),Ld=Bt.map((e,t)=>({type:"group",title:Td[t],items:[Re(e,"FontFamily"),Re(e,"FontSettings"),{type:"row",items:[Re(e,"FontSize"),Re(e,"LineHeight"),Re(e,"LetterSpacing"),Re(e,"WordSpacing")]},Re(e,"TextAppearance"),`${e}VerticalAlign`]})),Ed=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"],_d=["cutLabel","cutCellMinHeight","showCut"],Pd=[...Et.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"];function Co(e,t){const n=e?` ${e}`:"";return{AColumn:`AColumn${n}`,BColumnWidth:`BColumnWidth${n}`,CColumnWidth:`CColumnWidth${n}`,DColumnWidth:`DColumnWidth${n}`,EColumnWidth:`EColumnWidth${n}`,image:t,link:""}}const Ad=[Co("",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQK9211QXBE9W284ZNKB8.png",name:"Slider-1.png"}),Co("2",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQMFT72JD18WKP0Q2DVAT.png",name:"Slider-2.png"}),Co("3",{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01K7ERQNEVRXPSRX5K1YTMJQY9.png",name:"Slider-3.png"})],Wd=[...Et.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Fd={type:"object",version:1,properties:{content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{...xd(),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:Ad}},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:"Entry Hover Effect",display:{type:"toggle-cycle",enum:["None","Default","Blinds"]}},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"}},...Cd(),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"}},textFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},textFontSettings:{...Mt.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},...wd,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:"Off",entryHoverEffect:"None",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#767676",textHoverColor:"#767676",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...$d,backgroundColor:"#FFFFFF00",dividerColor:"#767676",backgroundHoverColor:"#FFFFFF00",dividerHoverColor:"#767676"},layoutDefaults:{m:Oi({type:"B",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.002,cut:0,showCut:0,cutCellMinHeight:.043,rowPaddingTop:.01,rowPaddingBottom:.01,rowPaddingTopB:.01,textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},textFontSize:.043,textLineHeight:.043,...Hi({textFontSize:.043,textLineHeight:.043})}),d:Oi({type:"A",textPaddingLR:.01,entriesCount:0,cellMinHeight:.03,imageSize:{min:80,max:320},dividerWidth:6e-4,cut:0,showCut:0,cutCellMinHeight:.03,rowPaddingTop:.01,rowPaddingBottom:.01,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},textFontSize:.01,textLineHeight:.01,...Hi({textFontSize:.01,textLineHeight:.01})})},displayRules:[..._d.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}},...Pd.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}},...Et.map(e=>({if:{name:"type",value:"A"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}})),...Et.map(e=>({if:{name:"type",value:"B"},then:{name:`properties.${e}ColumnVerticalAlign.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Wd]},panels:[{id:"general",icon:"cursor",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:"",items:["entryHoverEffect"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]},{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["columnsOrder"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"All text",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]},...Ld]}],paletteBookmark:{items:[...Ed],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Id={element:fd,id:"list",name:"Default List",category:"lists",layoutMode:"structured",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:Fd,sourceCode:yd},Rd=[Us,Qs,Vl,Xl,ac,fc,Cc,Ec,Oc,Id];exports.components=Rd;exports.isSchemaV1=Nr;
|
|
7520
|
+
`,un=["A","B","C","D","E"],Xi=[...Oo,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Ot={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Md(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function qn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Nd(){return Object.fromEntries(un.map((e,t)=>{const n=Wt[t],o=`${e} column`;return[n,Md(o)]}))}function Hd(){const e={};for(const t of un)e[`${t}ColumnWidth`]=qn(`${t} column width`),e[`${t}ColumnPaddingLeft`]=qn(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=qn(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=qn(`${t} column padding bottom`);return e}function Zi(e={}){const t={columns:5,wrapperWidth:1,columnsOrder:[...Wt]};for(const n of un)t[`${n}ColumnWidth`]=.2,t[`${n}ColumnPaddingLeft`]=0,t[`${n}ColumnPaddingRight`]=0,t[`${n}ColumnPaddingBottom`]=0;return{...t,...e}}function Bd(e){const t={};if(e===St)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Oo],useTabDesign:!0},enum:[...Oo]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Xi],filterBaselineByTopAnchor:!0,columnLetter:n,useTabDesign:!0},enum:[...Xi]}}return t[Le(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Le(e,"textFontSettings")]={...Ot.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Le(e,"textFontSize")]={...Ot.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Le(e,"textLineHeight")]={...Ot.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Le(e,"textLetterSpacing")]={...Ot.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Le(e,"textWordSpacing")]={...Ot.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Le(e,"textTextAlign")]={...Ot.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Le(e,"textTextAppearance")]={...Ot.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Od=bo.reduce((e,t)=>({...e,...Bd(t)}),{}),Vd=bo.reduce((e,t)=>({...e,[`${t}VerticalAlign`]:t===St?"Center":"Top",[Le(t,"textFontFamily")]:"Arial",[Le(t,"textFontSettings")]:{fontWeight:400,fontStyle:"normal"},[Le(t,"textLetterSpacing")]:0,[Le(t,"textWordSpacing")]:0,[Le(t,"textTextAlign")]:t===St?"center":"left",[Le(t,"textTextAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ji(e){const{textFontSize:t,textLineHeight:n,textTextAlign:o}=e;return bo.reduce((r,a)=>(t!==void 0&&(r[`${a}TextFontSize`]=t),n!==void 0&&(r[`${a}TextLineHeight`]=n),o!==void 0&&(r[Le(a,"textTextAlign")]=o),r),{})}const Dd=yd();function jr(e){return[Le(e,"textFontFamily"),Le(e,"textFontSettings"),Le(e,"textFontSize"),Le(e,"textLineHeight"),Le(e,"textLetterSpacing"),Le(e,"textWordSpacing"),Le(e,"textTextAlign"),Le(e,"textTextAppearance"),`${e}VerticalAlign`]}function jd(){const e=[];return ci.forEach((t,n)=>{const o=Wt[n],r=jr(t);for(let a=1;a<Wt.length;a+=1){const i=[{name:"columns",value:a},...Array.from({length:a},(c,s)=>({name:`columnsOrder.${s}`,value:o,isNotEqual:!0}))];r.forEach(c=>{e.push({if:i,then:{name:`properties.${c}.display.visible`,value:!1}})})}}),e}const zd=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"],Kd=["cutLabel","cutCellMinHeight","showCut"],qd=jr(St),Ud=[...Kd,...qd],Gd=[...un.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],Vt=[{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KV88Q6MDBHFMF0NKJMYCGGRA.jpeg",name:"List-1.png"},{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KV88Q6MD194E6Z49QD9GG03N.jpeg",name:"List-2.png"},{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KV88Q6MDNZRY59Q8JJVYY92K.jpeg",name:"List-3.png"},{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KV88Q6MDRXD5QWHB5YF8H3XM.jpeg",name:"List-4.png"},{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KV88Q6MD3C6H5Q9QX0SX8PSP.jpeg",name:"List-5.png"},{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KV88Q6MDM6VHTFVXVD58V0D6.jpeg",name:"List-6.png"},{objectFit:"cover",url:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KV88Q6MD3QT4RPG3VMM2NK5K.jpeg",name:"List-7.png"}],Yd=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:Vt[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:Vt[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper Constellations",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:Vt[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:Vt[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:Vt[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:Vt[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:Vt[6],link:""}],Xd=[...un.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Zd={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:{...Nd(),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:Yd},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:"Entry Hover Effect",display:{type:"toggle-cycle",enum:["None","Default","Blinds"]}},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"}},...Hd(),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"}},...Od,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:"Off",entryHoverEffect:"None",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#767676",textHoverColor:"#767676",...Vd,backgroundColor:"#FFFFFF00",dividerColor:"#767676",backgroundHoverColor:"#FFFFFF00",dividerHoverColor:"#767676"},layoutDefaults:{m:Zi({type:"B",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.002,cut:0,showCut:0,cutCellMinHeight:.043,rowPaddingTop:.01,rowPaddingBottom:.01,rowPaddingTopB:.01,textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...Ji({textFontSize:.043,textLineHeight:.043,textTextAlign:"center"})}),d:Zi({type:"A",textPaddingLR:.01,entriesCount:0,cellMinHeight:.03,imageSize:{min:80,max:320},dividerWidth:6e-4,cut:0,showCut:0,cutCellMinHeight:.03,rowPaddingTop:.01,rowPaddingBottom:.01,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...Ji({textFontSize:.01,textLineHeight:.01})})},displayRules:[...jd(),...Ud.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}},...Gd.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}},...un.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","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...Xd]},panels:[{id:"general",icon:"cursor",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:"",items:["entryHoverEffect"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]},{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["columnsOrder"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Dd]}],paletteBookmark:{items:[...zd],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Jd={element:kd,id:"list",name:"Default List",category:"lists",layoutMode:"structured",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:Zd,sourceCode:Fd},Qd=[al,ml,tc,dc,xc,Rc,Mc,Dc,Jc,Jd];exports.components=Qd;exports.isSchemaV1=Zr;
|