@cntrl-site/components 1.0.56-alpha.3 → 1.0.56-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/Mercury/Mercury.d.ts +2 -1
- package/dist/index.js +562 -188
- package/dist/index.mjs +7784 -7172
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),dt=require("classnames"),x=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Yn=require("react-dom");function Hc(e){return e.type==="object"&&e.version===1}const Oc="ControlSlider-module__wrapper___sHEkd",Dc="ControlSlider-module__hoverArrow___A-dOH",jc="ControlSlider-module__sliderItem___QQSkR",zc="ControlSlider-module__sliderImage___9hRl-",Bc="ControlSlider-module__arrow___05ghY",Vc="ControlSlider-module__arrowVertical___tBfVN",Gc="ControlSlider-module__nextArrow___-30Yc",qc="ControlSlider-module__arrowInner___aEra3",Uc="ControlSlider-module__arrowIcon___S4ztF",Kc="ControlSlider-module__arrowImg___2dwJW",Xc="ControlSlider-module__mirror___brd6U",Yc="ControlSlider-module__pagination___bicLF",Zc="ControlSlider-module__paginationInner___bT-P-",Jc="ControlSlider-module__paginationVertical___zYqKw",Qc="ControlSlider-module__paginationItem___nTRbk",ed="ControlSlider-module__dot___p1Qun",td="ControlSlider-module__activeDot___LHFaj",nd="ControlSlider-module__paginationInsideBottom___R3FWn",id="ControlSlider-module__paginationInsideTop___V-qb-",od="ControlSlider-module__paginationOutsideBottom___14w8D",rd="ControlSlider-module__paginationOutsideTop___SCLqB",ad="ControlSlider-module__paginationInsideLeft___yOBRZ",sd="ControlSlider-module__paginationInsideRight___Rtt3o",ld="ControlSlider-module__paginationOutsideLeft___lahaw",cd="ControlSlider-module__paginationOutsideRight___EtuQa",dd="ControlSlider-module__imgWrapper___UjEgB",ud="ControlSlider-module__captionBlock___dJ6-j",pd="ControlSlider-module__captionTextWrapper___HFlpf",md="ControlSlider-module__captionText___uGBVc",gd="ControlSlider-module__active___WZK4G",hd="ControlSlider-module__withPointerEvents___t-18M",fd="ControlSlider-module__topLeftAlignment___zjnGM",yd="ControlSlider-module__topCenterAlignment___gD1xW",vd="ControlSlider-module__topRightAlignment___NMapS",xd="ControlSlider-module__middleLeftAlignment___OnUrY",bd="ControlSlider-module__middleCenterAlignment___Tdkl0",wd="ControlSlider-module__middleRightAlignment___wEbfX",Sd="ControlSlider-module__bottomLeftAlignment___cTP2-",$d="ControlSlider-module__bottomCenterAlignment___c54fB",Cd="ControlSlider-module__bottomRightAlignment___kEwrz",Td="ControlSlider-module__clickOverlay___DZA28",Ld="ControlSlider-module__contain___pLyq7",Id="ControlSlider-module__cover___KdDat",ot={wrapper:Oc,hoverArrow:Dc,sliderItem:jc,sliderImage:zc,arrow:Bc,arrowVertical:Vc,nextArrow:Gc,arrowInner:qc,arrowIcon:Uc,arrowImg:Kc,mirror:Xc,pagination:Yc,paginationInner:Zc,paginationVertical:Jc,paginationItem:Qc,dot:ed,activeDot:td,paginationInsideBottom:nd,paginationInsideTop:id,paginationOutsideBottom:od,paginationOutsideTop:rd,paginationInsideLeft:ad,paginationInsideRight:sd,paginationOutsideLeft:ld,paginationOutsideRight:cd,imgWrapper:dd,captionBlock:ud,captionTextWrapper:pd,captionText:md,active:gd,withPointerEvents:hd,topLeftAlignment:fd,topCenterAlignment:yd,topRightAlignment:vd,middleLeftAlignment:xd,middleCenterAlignment:bd,middleRightAlignment:wd,bottomLeftAlignment:Sd,bottomCenterAlignment:$d,bottomRightAlignment:Cd,clickOverlay:Td,contain:Ld,cover:Id};function Rd(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ed(e,t,n){return t&&Rd(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var as="(prefers-reduced-motion: reduce)",Li=1,Md=2,Pi=3,Gi=4,So=5,Jo=6,rr=7,kd={CREATED:Li,MOUNTED:Md,IDLE:Pi,MOVING:Gi,SCROLLING:So,DRAGGING:Jo,DESTROYED:rr};function Wn(e){e.length=0}function Zn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Nt(e){return e.bind.apply(e,[null].concat(Zn(arguments,1)))}var $l=setTimeout,da=function(){};function ss(e){return requestAnimationFrame(e)}function hr(e,t){return typeof t===e}function co(e){return!Ia(e)&&hr("object",e)}var La=Array.isArray,Cl=Nt(hr,"function"),qn=Nt(hr,"string"),$o=Nt(hr,"undefined");function Ia(e){return e===null}function Tl(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Co(e){return La(e)?e:[e]}function yn(e,t){Co(e).forEach(t)}function Ra(e,t){return e.indexOf(t)>-1}function Qo(e,t){return e.push.apply(e,Co(t)),e}function Mn(e,t,n){e&&yn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){Mn(e,qn(t)?t.split(" "):t,!0)}function To(e,t){yn(t,e.appendChild.bind(e))}function Ea(e,t){yn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function uo(e,t){return Tl(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Ll(e,t){var n=e?Zn(e.children):[];return t?n.filter(function(i){return uo(i,t)}):n}function Lo(e,t){return t?Ll(e,t)[0]:e.firstElementChild}var po=Object.keys;function pi(e,t,n){return e&&(n?po(e).reverse():po(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function mo(e){return Zn(arguments,1).forEach(function(t){pi(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Zn(arguments,1).forEach(function(t){pi(t,function(n,i){La(n)?e[i]=n.slice():co(n)?e[i]=zn({},co(e[i])?e[i]:{},n):e[i]=n})}),e}function ls(e,t){yn(t||po(e),function(n){delete e[n]})}function Ln(e,t){yn(e,function(n){yn(t,function(i){n&&n.removeAttribute(i)})})}function yt(e,t,n){co(t)?pi(t,function(i,o){yt(e,o,i)}):yn(e,function(i){Ia(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function Ii(e,t,n){var i=document.createElement(e);return t&&(qn(t)?Tn(i,t):yt(i,t)),n&&To(n,i),i}function vn(e,t,n){if($o(n))return getComputedStyle(e)[t];Ia(n)||(e.style[t]=""+n)}function go(e,t){vn(e,"display",t)}function Il(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function xn(e,t){return e.getAttribute(t)}function cs(e,t){return e&&e.classList.contains(t)}function mn(e){return e.getBoundingClientRect()}function mi(e){yn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Rl(e){return Lo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function El(e,t){return e&&e.querySelector(t)}function Ma(e,t){return t?Zn(e.querySelectorAll(t)):[]}function kn(e,t){Mn(e,t,!1)}function ua(e){return e.timeStamp}function ii(e){return qn(e)?e:e?e+"px":""}var Io="splide",ka="data-"+Io;function oo(e,t){if(!e)throw new Error("["+Io+"] "+(t||""))}var Un=Math.min,ar=Math.max,sr=Math.floor,ho=Math.ceil,sn=Math.abs;function Ml(e,t,n){return sn(e-t)<n}function er(e,t,n,i){var o=Un(t,n),s=ar(t,n);return i?o<e&&e<s:o<=e&&e<=s}function $i(e,t,n){var i=Un(t,n),o=ar(t,n);return Un(ar(i,e),o)}function pa(e){return+(e>0)-+(e<0)}function ma(e,t){return yn(t,function(n){e=e.replace("%s",""+n)}),e}function Pa(e){return e<10?"0"+e:""+e}var ds={};function Pd(e){return""+e+Pa(ds[e]=(ds[e]||0)+1)}function kl(){var e=[];function t(l,d,c,u){o(l,d,function(p,w,v){var T="addEventListener"in p,g=T?p.removeEventListener.bind(p,w,c,u):p.removeListener.bind(p,c);T?p.addEventListener(w,c,u):p.addListener(c),e.push([p,w,v,c,g])})}function n(l,d,c){o(l,d,function(u,p,w){e=e.filter(function(v){return v[0]===u&&v[1]===p&&v[2]===w&&(!c||v[3]===c)?(v[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){yn(l,function(u){u&&yn(d,function(p){p.split(" ").forEach(function(w){var v=w.split(".");c(u,v[0],v[1])})})})}function s(){e.forEach(function(l){l[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var Jn="mounted",ga="ready",_n="move",qi="moved",Aa="click",Pl="active",Al="inactive",Fl="visible",Wl="hidden",Qt="refresh",rn="updated",Ai="resize",fr="resized",_l="drag",Nl="dragging",Hl="dragged",yr="scroll",fi="scrolled",Ad="overflow",Fa="destroy",Ol="arrows:mounted",Dl="arrows:updated",jl="pagination:mounted",zl="pagination:updated",Wa="navigation:mounted",_a="autoplay:play",Bl="autoplay:playing",Na="autoplay:pause",Ha="lazyload:loaded",Vl="sk",Gl="sh",lr="ei";function Bt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=kl();function i(s,l){n.bind(t,Co(s).join(" "),function(d){l.apply(l,La(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,Zn(arguments,1))}return e&&e.event.on(Fa,n.destroy),mo(n,{bus:t,on:i,off:Nt(n.unbind,t),emit:o})}function vr(e,t,n,i){var o=Date.now,s,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?Un((o()-s)/e,1):1,n&&n(l),l>=1&&(t(),s=o(),i&&++u>=i))return v();d=ss(p)}}function w(R){R||g(),s=o()-(R?l*e:0),c=!1,d=ss(p)}function v(){c=!0}function T(){s=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function $(R){e=R}function f(){return c}return{start:w,rewind:T,pause:v,cancel:g,set:$,isPaused:f}}function Fd(e){var t=e;function n(o){t=o}function i(o){return Ra(Co(o),t)}return{set:n,is:i}}function Wd(e,t){var n=vr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function _d(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=kl(),d=[];function c(){var g=n.mediaQuery==="min";po(o).sort(function($,f){return g?+$-+f:+f-+$}).forEach(function($){p(o[$],"("+(g?"min":"max")+"-width:"+$+"px)")}),p(s,as),w()}function u(g){g&&l.destroy()}function p(g,$){var f=matchMedia($);l.bind(f,"change",w),d.push([g,f])}function w(){var g=i.is(rr),$=n.direction,f=d.reduce(function(R,L){return zn(R,L[1].matches?L[0]:{})},{});ls(n),T(f),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):$!==n.direction&&e.refresh()}function v(g){matchMedia(as).matches&&(g?zn(n,s):ls(n,po(s)))}function T(g,$,f){zn(n,g),$&&zn(Object.getPrototypeOf(n),g),(f||!i.is(Li))&&e.emit(rn,n)}return{setup:c,destroy:u,reduce:v,set:T}}var xr="Arrow",br=xr+"Left",wr=xr+"Right",ql=xr+"Up",Ul=xr+"Down",us="rtl",Sr="ttb",_r={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[ql,wr],ArrowRight:[Ul,br]};function Nd(e,t,n){function i(s,l,d){d=d||n.direction;var c=d===us&&!l?1:d===Sr?0:-1;return _r[s]&&_r[s][c]||s.replace(/width|left|right/i,function(u,p){var w=_r[u.toLowerCase()][c]||u;return p>0?w.charAt(0).toUpperCase()+w.slice(1):w})}function o(s){return s*(n.direction===us?1:-1)}return{resolve:i,orient:o}}var Pn="role",Ri="tabindex",Hd="disabled",bn="aria-",Ro=bn+"controls",Kl=bn+"current",ps=bn+"selected",hn=bn+"label",Oa=bn+"labelledby",Xl=bn+"hidden",Da=bn+"orientation",fo=bn+"roledescription",ms=bn+"live",gs=bn+"busy",hs=bn+"atomic",ja=[Pn,Ri,Hd,Ro,Kl,hn,Oa,Xl,Da,fo],In=Io+"__",Qn="is-",Nr=Io,fs=In+"track",Od=In+"list",$r=In+"slide",Yl=$r+"--clone",Dd=$r+"__container",za=In+"arrows",Cr=In+"arrow",Zl=Cr+"--prev",Jl=Cr+"--next",Tr=In+"pagination",Ql=Tr+"__page",jd=In+"progress",zd=jd+"__bar",Bd=In+"toggle",Vd=In+"spinner",Gd=In+"sr",qd=Qn+"initialized",gi=Qn+"active",ec=Qn+"prev",tc=Qn+"next",ha=Qn+"visible",fa=Qn+"loading",nc=Qn+"focus-in",ic=Qn+"overflow",Ud=[gi,ha,ec,tc,fa,nc,ic],Kd={slide:$r,clone:Yl,arrows:za,arrow:Cr,prev:Zl,next:Jl,pagination:Tr,page:Ql,spinner:Vd};function Xd(e,t){if(Cl(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!uo(n,t);)n=n.parentElement;return n}var Yd=5,ys=200,oc="touchstart mousedown",Hr="touchmove mousemove",Or="touchend touchcancel mouseup click";function Zd(e,t,n){var i=Bt(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],w=[],v,T,g;function $(){I(),Y(),L()}function f(){o(Qt,R),o(Qt,$),o(rn,L),s(document,oc+" keydown",function(M){g=M.type==="keydown"},{capture:!0}),s(l,"focusin",function(){Mn(l,nc,!!g)})}function R(M){var C=ja.concat("style");Wn(u),kn(l,p),kn(v,w),Ln([v,T],C),Ln(l,M?C:["style",fo])}function L(){kn(l,p),kn(v,w),p=V(Nr),w=V(fs),Tn(l,p),Tn(v,w),yt(l,hn,n.label),yt(l,Oa,n.labelledby)}function I(){v=P("."+fs),T=Lo(v,"."+Od),oo(v&&T,"A track/list element is missing."),Qo(u,Ll(T,"."+$r+":not(."+Yl+")")),pi({arrows:za,pagination:Tr,prev:Zl,next:Jl,bar:zd,toggle:Bd},function(M,C){c[C]=P("."+M)}),mo(c,{root:l,track:v,list:T,slides:u})}function Y(){var M=l.id||Pd(Io),C=n.role;l.id=M,v.id=v.id||M+"-track",T.id=T.id||M+"-list",!xn(l,Pn)&&l.tagName!=="SECTION"&&C&&yt(l,Pn,C),yt(l,fo,d.carousel),yt(T,Pn,"presentation")}function P(M){var C=El(l,M);return C&&Xd(C,"."+Nr)===l?C:void 0}function V(M){return[M+"--"+n.type,M+"--"+n.direction,n.drag&&M+"--draggable",n.isNavigation&&M+"--nav",M===Nr&&gi]}return mo(c,{setup:$,mount:f,destroy:R})}var Fi="slide",Ui="loop",Eo="fade";function Jd(e,t,n,i){var o=Bt(e),s=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,w=p.isNavigation,v=p.updateOnMove,T=p.i18n,g=p.pagination,$=p.slideFocus,f=c.Direction.resolve,R=xn(i,"style"),L=xn(i,hn),I=n>-1,Y=Lo(i,"."+Dd),P;function V(){I||(i.id=u.id+"-slide"+Pa(t+1),yt(i,Pn,g?"tabpanel":"group"),yt(i,fo,T.slide),yt(i,hn,L||ma(T.slideLabel,[t+1,e.length]))),M()}function M(){d(i,"click",Nt(l,Aa,j)),d(i,"keydown",Nt(l,Vl,j)),s([qi,Gl,fi],S),s(Wa,A),v&&s(_n,y)}function C(){P=!0,o.destroy(),kn(i,Ud),Ln(i,ja),yt(i,"style",R),yt(i,hn,L||"")}function A(){var O=e.splides.map(function(E){var K=E.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");yt(i,hn,ma(T.slideX,(I?n:t)+1)),yt(i,Ro,O),yt(i,Pn,$?"button":""),$&&Ln(i,fo)}function y(){P||S()}function S(){if(!P){var O=e.index;F(),W(),Mn(i,ec,t===O-1),Mn(i,tc,t===O+1)}}function F(){var O=G();O!==cs(i,gi)&&(Mn(i,gi,O),yt(i,Kl,w&&O||""),l(O?Pl:Al,j))}function W(){var O=J(),E=!O&&(!G()||I);if(e.state.is([Gi,So])||yt(i,Xl,E||""),yt(Ma(i,p.focusableNodes||""),Ri,E?-1:""),$&&yt(i,Ri,E?-1:0),O!==cs(i,ha)&&(Mn(i,ha,O),l(O?Fl:Wl,j)),!O&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&Il(K.slide)}}function U(O,E,K){vn(K&&Y||i,O,E)}function G(){var O=e.index;return O===t||p.cloneStatus&&O===n}function J(){if(e.is(Eo))return G();var O=mn(c.Elements.track),E=mn(i),K=f("left",!0),Z=f("right",!0);return sr(O[K])<=ho(E[K])&&sr(E[Z])<=ho(O[Z])}function D(O,E){var K=sn(O-t);return!I&&(p.rewind||e.is(Ui))&&(K=Un(K,e.length-K)),K<=E}var j={index:t,slideIndex:n,slide:i,container:Y,isClone:I,mount:V,destroy:C,update:S,style:U,isWithin:D};return j}function Qd(e,t,n){var i=Bt(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function w(){v(),o(Qt,T),o(Qt,v)}function v(){c.forEach(function(S,F){$(S,F,-1)})}function T(){P(function(S){S.destroy()}),Wn(p)}function g(){P(function(S){S.update()})}function $(S,F,W){var U=Jd(e,F,W,S);U.mount(),p.push(U),p.sort(function(G,J){return G.index-J.index})}function f(S){return S?V(function(F){return!F.isClone}):p}function R(S){var F=t.Controller,W=F.toIndex(S),U=F.hasFocus()?1:n.perPage;return V(function(G){return er(G.index,W,W+U-1)})}function L(S){return V(S)[0]}function I(S,F){yn(S,function(W){if(qn(W)&&(W=Rl(W)),Tl(W)){var U=c[F];U?Ea(W,U):To(u,W),Tn(W,n.classes.slide),C(W,Nt(s,Ai))}}),s(Qt)}function Y(S){mi(V(S).map(function(F){return F.slide})),s(Qt)}function P(S,F){f(F).forEach(S)}function V(S){return p.filter(Cl(S)?S:function(F){return qn(S)?uo(F.slide,S):Ra(Co(S),F.index)})}function M(S,F,W){P(function(U){U.style(S,F,W)})}function C(S,F){var W=Ma(S,"img"),U=W.length;U?W.forEach(function(G){l(G,"load error",function(){--U||F()})}):F()}function A(S){return S?c.length:p.length}function y(){return p.length>n.perPage}return{mount:w,destroy:T,update:g,register:$,get:f,getIn:R,getAt:L,add:I,remove:Y,forEach:P,filter:V,style:M,getLength:A,isEnough:y}}function eu(e,t,n){var i=Bt(e),o=i.on,s=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,w=u.track,v=u.list,T=d.getAt,g=d.style,$,f,R;function L(){I(),s(window,"resize load",Wd(Nt(l,Ai))),o([rn,Qt],I),o(Ai,Y)}function I(){$=n.direction===Sr,vn(p,"maxWidth",ii(n.width)),vn(w,c("paddingLeft"),P(!1)),vn(w,c("paddingRight"),P(!0)),Y(!0)}function Y(j){var O=mn(p);(j||f.width!==O.width||f.height!==O.height)&&(vn(w,"height",V()),g(c("marginRight"),ii(n.gap)),g("width",C()),g("height",A(),!0),f=O,l(fr),R!==(R=D())&&(Mn(p,ic,R),l(Ad,R)))}function P(j){var O=n.padding,E=c(j?"right":"left");return O&&ii(O[E]||(co(O)?0:O))||"0px"}function V(){var j="";return $&&(j=M(),oo(j,"height or heightRatio is missing."),j="calc("+j+" - "+P(!1)+" - "+P(!0)+")"),j}function M(){return ii(n.height||mn(v).width*n.heightRatio)}function C(){return n.autoWidth?null:ii(n.fixedWidth)||($?"":y())}function A(){return ii(n.fixedHeight)||($?n.autoHeight?null:y():M())}function y(){var j=ii(n.gap);return"calc((100%"+(j&&" + "+j)+")/"+(n.perPage||1)+(j&&" - "+j)+")"}function S(){return mn(v)[c("width")]}function F(j,O){var E=T(j||0);return E?mn(E.slide)[c("width")]+(O?0:G()):0}function W(j,O){var E=T(j);if(E){var K=mn(E.slide)[c("right")],Z=mn(v)[c("left")];return sn(K-Z)+(O?0:G())}return 0}function U(j){return W(e.length-1)-W(0)+F(0,j)}function G(){var j=T(0);return j&&parseFloat(vn(j.slide,c("marginRight")))||0}function J(j){return parseFloat(vn(w,c("padding"+(j?"Right":"Left"))))||0}function D(){return e.is(Eo)||U(!0)>S()}return{mount:L,resize:Y,listSize:S,slideSize:F,sliderSize:U,totalSize:W,getPadding:J,isOverflow:D}}var tu=2;function nu(e,t,n){var i=Bt(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,w),o([rn,Ai],T),(u=f())&&(g(u),t.Layout.resize(!0))}function w(){v(),p()}function v(){mi(c),Wn(c),i.destroy()}function T(){var R=f();u!==R&&(u<R||!R)&&i.emit(Qt)}function g(R){var L=l.get().slice(),I=L.length;if(I){for(;L.length<R;)Qo(L,L);Qo(L.slice(-R),L.slice(0,R)).forEach(function(Y,P){var V=P<R,M=$(Y.slide,P);V?Ea(M,L[0].slide):To(s.list,M),Qo(c,M),l.register(M,P-R+(V?0:I),Y.index)})}}function $(R,L){var I=R.cloneNode(!0);return Tn(I,n.classes.clone),I.id=e.root.id+"-clone"+Pa(L+1),I}function f(){var R=n.clones;if(!e.is(Ui))R=0;else if($o(R)){var L=n[d("fixedWidth")]&&t.Layout.slideSize(0),I=L&&ho(mn(s.track)[d("width")]/L);R=I||n[d("autoWidth")]&&e.length||n.perPage*tu}return R}return{mount:p,destroy:v}}function iu(e,t,n){var i=Bt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,w=d.listSize,v=d.sliderSize,T=t.Direction,g=T.resolve,$=T.orient,f=t.Elements,R=f.list,L=f.track,I;function Y(){I=t.Transition,o([Jn,fr,rn,Qt],P)}function P(){t.Controller.isBusy()||(t.Scroll.cancel(),M(e.index),t.Slides.update())}function V(E,K,Z,ce){E!==K&&j(E>Z)&&(S(),C(y(U(),E>Z),!0)),l(Gi),s(_n,K,Z,E),I.start(K,function(){l(Pi),s(qi,K,Z,E),ce&&ce()})}function M(E){C(W(E,!0))}function C(E,K){if(!e.is(Eo)){var Z=K?E:A(E);vn(R,"transform","translate"+g("X")+"("+Z+"px)"),E!==Z&&s(Gl)}}function A(E){if(e.is(Ui)){var K=F(E),Z=K>t.Controller.getEnd(),ce=K<0;(ce||Z)&&(E=y(E,Z))}return E}function y(E,K){var Z=E-D(K),ce=v();return E-=$(ce*(ho(sn(Z)/ce)||1))*(K?1:-1),E}function S(){C(U(),!0),I.cancel()}function F(E){for(var K=t.Slides.get(),Z=0,ce=1/0,N=0;N<K.length;N++){var pe=K[N].index,b=sn(W(pe,!0)-E);if(b<=ce)ce=b,Z=pe;else break}return Z}function W(E,K){var Z=$(p(E-1)-J(E));return K?G(Z):Z}function U(){var E=g("left");return mn(R)[E]-mn(L)[E]+$(u(!1))}function G(E){return n.trimSpace&&e.is(Fi)&&(E=$i(E,0,$(v(!0)-w()))),E}function J(E){var K=n.focus;return K==="center"?(w()-c(E,!0))/2:+K*c(E)||0}function D(E){return W(E?t.Controller.getEnd():0,!!n.trimSpace)}function j(E){var K=$(y(U(),E));return E?K>=0:K<=R[g("scrollWidth")]-mn(L)[g("width")]}function O(E,K){K=$o(K)?U():K;var Z=E!==!0&&$(K)<$(D(!1)),ce=E!==!1&&$(K)>$(D(!0));return Z||ce}return{mount:Y,move:V,jump:M,translate:C,shift:y,cancel:S,toIndex:F,toPosition:W,getPosition:U,getLimit:D,exceededLimit:O,reposition:P}}function ou(e,t,n){var i=Bt(e),o=i.on,s=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,w=p.isEnough,v=p.getLength,T=n.omitEnd,g=e.is(Ui),$=e.is(Fi),f=Nt(U,!1),R=Nt(U,!0),L=n.start||0,I,Y=L,P,V,M;function C(){A(),o([rn,Qt,lr],A),o(fr,y)}function A(){P=v(!0),V=n.perMove,M=n.perPage,I=j();var b=$i(L,0,T?I:P-1);b!==L&&(L=b,l.reposition())}function y(){I!==j()&&s(lr)}function S(b,he,Q){if(!pe()){var we=W(b),Te=D(we);Te>-1&&(he||Te!==L)&&(Z(Te),l.move(we,Te,Y,Q))}}function F(b,he,Q,we){t.Scroll.scroll(b,he,Q,function(){var Te=D(l.toIndex(d()));Z(T?Un(Te,I):Te),we&&we()})}function W(b){var he=L;if(qn(b)){var Q=b.match(/([+\-<>])(\d+)?/)||[],we=Q[1],Te=Q[2];we==="+"||we==="-"?he=G(L+ +(""+we+(+Te||1)),L):we===">"?he=Te?O(+Te):f(!0):we==="<"&&(he=R(!0))}else he=g?b:$i(b,0,I);return he}function U(b,he){var Q=V||(N()?1:M),we=G(L+Q*(b?-1:1),L,!(V||N()));return we===-1&&$&&!Ml(d(),c(!b),1)?b?0:I:he?we:D(we)}function G(b,he,Q){if(w()||N()){var we=J(b);we!==b&&(he=b,b=we,Q=!1),b<0||b>I?!V&&(er(0,b,he,!0)||er(I,he,b,!0))?b=O(E(b)):g?b=Q?b<0?-(P%M||M):P:b:n.rewind?b=b<0?I:0:b=-1:Q&&b!==he&&(b=O(E(he)+(b<he?-1:1)))}else b=-1;return b}function J(b){if($&&n.trimSpace==="move"&&b!==L)for(var he=d();he===u(b,!0)&&er(b,0,e.length-1,!n.rewind);)b<L?--b:++b;return b}function D(b){return g?(b+P)%P||0:b}function j(){for(var b=P-(N()||g&&V?1:M);T&&b-- >0;)if(u(P-1,!0)!==u(b,!0)){b++;break}return $i(b,0,P-1)}function O(b){return $i(N()?b:M*b,0,I)}function E(b){return N()?Un(b,I):sr((b>=I?P-1:b)/M)}function K(b){var he=l.toIndex(b);return $?$i(he,0,I):he}function Z(b){b!==L&&(Y=L,L=b)}function ce(b){return b?Y:L}function N(){return!$o(n.focus)||n.isNavigation}function pe(){return e.state.is([Gi,So])&&!!n.waitForTransition}return{mount:C,go:S,scroll:F,getNext:f,getPrev:R,getAdjacent:U,getEnd:j,setIndex:Z,getIndex:ce,toIndex:O,toPage:E,toDest:K,hasFocus:N,isBusy:pe}}var ru="http://www.w3.org/2000/svg",au="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",Wo=40;function su(e,t,n){var i=Bt(e),o=i.on,s=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,w=u.arrows,v=u.track,T=w,g=u.prev,$=u.next,f,R,L={};function I(){P(),o(rn,Y)}function Y(){V(),I()}function P(){var F=n.arrows;F&&!(g&&$)&&A(),g&&$&&(mo(L,{prev:g,next:$}),go(T,F?"":"none"),Tn(T,R=za+"--"+n.direction),F&&(M(),S(),yt([g,$],Ro,v.id),l(Ol,g,$)))}function V(){i.destroy(),kn(T,R),f?(mi(w?[g,$]:T),g=$=null):Ln([g,$],ja)}function M(){o([Jn,qi,Qt,fi,lr],S),s($,"click",Nt(C,">")),s(g,"click",Nt(C,"<"))}function C(F){p.go(F,!0)}function A(){T=w||Ii("div",d.arrows),g=y(!0),$=y(!1),f=!0,To(T,[g,$]),!w&&Ea(T,v)}function y(F){var W='<button class="'+d.arrow+" "+(F?d.prev:d.next)+'" type="button"><svg xmlns="'+ru+'" viewBox="0 0 '+Wo+" "+Wo+'" width="'+Wo+'" height="'+Wo+'" focusable="false"><path d="'+(n.arrowPath||au)+'" />';return Rl(W)}function S(){if(g&&$){var F=e.index,W=p.getPrev(),U=p.getNext(),G=W>-1&&F<W?c.last:c.prev,J=U>-1&&F>U?c.first:c.next;g.disabled=W<0,$.disabled=U<0,yt(g,hn,G),yt($,hn,J),l(Dl,g,$,W,U)}}return{arrows:L,mount:I,destroy:V,update:S}}var lu=ka+"-interval";function cu(e,t,n){var i=Bt(e),o=i.on,s=i.bind,l=i.emit,d=vr(n.interval,e.go.bind(e,">"),M),c=d.isPaused,u=t.Elements,p=t.Elements,w=p.root,v=p.toggle,T=n.autoplay,g,$,f=T==="pause";function R(){T&&(L(),v&&yt(v,Ro,u.track.id),f||I(),V())}function L(){n.pauseOnHover&&s(w,"mouseenter mouseleave",function(A){g=A.type==="mouseenter",P()}),n.pauseOnFocus&&s(w,"focusin focusout",function(A){$=A.type==="focusin",P()}),v&&s(v,"click",function(){f?I():Y(!0)}),o([_n,yr,Qt],d.rewind),o(_n,C)}function I(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),$=g=f=!1,V(),l(_a))}function Y(A){A===void 0&&(A=!0),f=!!A,V(),c()||(d.pause(),l(Na))}function P(){f||(g||$?Y(!1):I())}function V(){v&&(Mn(v,gi,!f),yt(v,hn,n.i18n[f?"play":"pause"]))}function M(A){var y=u.bar;y&&vn(y,"width",A*100+"%"),l(Bl,A)}function C(A){var y=t.Slides.getAt(A);d.set(y&&+xn(y.slide,lu)||n.interval)}return{mount:R,destroy:d.cancel,play:I,pause:Y,isPaused:c}}function du(e,t,n){var i=Bt(e),o=i.on;function s(){n.cover&&(o(Ha,Nt(d,!0)),o([Jn,rn,Qt],Nt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Lo(u.container||u.slide,"img");p&&p.src&&d(c,p,u)})}function d(c,u,p){p.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),go(u,c?"none":"")}return{mount:s,destroy:Nt(l,!1)}}var uu=10,pu=600,mu=.6,gu=1.5,hu=800;function fu(e,t,n){var i=Bt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,w=d.translate,v=e.is(Fi),T,g,$=1;function f(){o(_n,Y),o([rn,Qt],P)}function R(M,C,A,y,S){var F=c();if(Y(),A&&(!v||!p())){var W=t.Layout.sliderSize(),U=pa(M)*W*sr(sn(M)/W)||0;M=d.toPosition(t.Controller.toDest(M%W))+U}var G=Ml(F,M,1);$=1,C=G?0:C||ar(sn(M-F)/gu,hu),g=y,T=vr(C,L,Nt(I,F,M,S),1),l(So),s(yr),T.start()}function L(){l(Pi),g&&g(),s(fi)}function I(M,C,A,y){var S=c(),F=M+(C-M)*V(y),W=(F-S)*$;w(S+W),v&&!A&&p()&&($*=mu,sn(W)<uu&&R(u(p(!0)),pu,!1,g,!0))}function Y(){T&&T.cancel()}function P(){T&&!T.isPaused()&&(Y(),L())}function V(M){var C=n.easingFunc;return C?C(M):1-Math.pow(1-M,4)}return{mount:f,destroy:Y,scroll:R,cancel:P}}var Ci={passive:!1,capture:!0};function yu(e,t,n){var i=Bt(e),o=i.on,s=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,w=t.Controller,v=t.Elements.track,T=t.Media.reduce,g=t.Direction,$=g.resolve,f=g.orient,R=u.getPosition,L=u.exceededLimit,I,Y,P,V,M,C=!1,A,y,S;function F(){l(v,Hr,da,Ci),l(v,Or,da,Ci),l(v,oc,U,Ci),l(v,"click",D,{capture:!0}),l(v,"dragstart",En),o([Jn,rn],W)}function W(){var q=n.drag;oe(!q),V=q==="free"}function U(q){if(A=!1,!y){var de=Te(q);we(q.target)&&(de||!q.button)&&(w.isBusy()?En(q,!0):(S=de?v:window,M=c.is([Gi,So]),P=null,l(S,Hr,G,Ci),l(S,Or,J,Ci),u.cancel(),p.cancel(),j(q)))}}function G(q){if(c.is(Jo)||(c.set(Jo),s(_l)),q.cancelable)if(M){u.translate(I+Q(N(q)));var de=pe(q)>ys,ge=C!==(C=L());(de||ge)&&j(q),A=!0,s(Nl),En(q)}else K(q)&&(M=E(q),En(q))}function J(q){c.is(Jo)&&(c.set(Pi),s(Hl)),M&&(O(q),En(q)),d(S,Hr,G),d(S,Or,J),M=!1}function D(q){!y&&A&&En(q,!0)}function j(q){P=Y,Y=q,I=R()}function O(q){var de=Z(q),ge=ce(de),_e=n.rewind&&n.rewindByDrag;T(!1),V?w.scroll(ge,0,n.snap):e.is(Eo)?w.go(f(pa(de))<0?_e?"<":"-":_e?">":"+"):e.is(Fi)&&C&&_e?w.go(L(!0)?">":"<"):w.go(w.toDest(ge),!0),T(!0)}function E(q){var de=n.dragMinThreshold,ge=co(de),_e=ge&&de.mouse||0,Ce=(ge?de.touch:+de)||10;return sn(N(q))>(Te(q)?Ce:_e)}function K(q){return sn(N(q))>sn(N(q,!0))}function Z(q){if(e.is(Ui)||!C){var de=pe(q);if(de&&de<ys)return N(q)/de}return 0}function ce(q){return R()+pa(q)*Un(sn(q)*(n.flickPower||600),V?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function N(q,de){return he(q,de)-he(b(q),de)}function pe(q){return ua(q)-ua(b(q))}function b(q){return Y===q&&P||Y}function he(q,de){return(Te(q)?q.changedTouches[0]:q)["page"+$(de?"Y":"X")]}function Q(q){return q/(C&&e.is(Fi)?Yd:1)}function we(q){var de=n.noDrag;return!uo(q,"."+Ql+", ."+Cr)&&(!de||!uo(q,de))}function Te(q){return typeof TouchEvent<"u"&&q instanceof TouchEvent}function se(){return M}function oe(q){y=q}return{mount:F,disable:oe,isDragging:se}}var vu={Spacebar:" ",Right:wr,Left:br,Up:ql,Down:Ul};function Ba(e){return e=qn(e)?e:e.key,vu[e]||e}var vs="keydown";function xu(e,t,n){var i=Bt(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function w(){v(),o(rn,T),o(rn,v),o(_n,$)}function v(){var R=n.keyboard;R&&(u=R==="global"?window:d,s(u,vs,f))}function T(){l(u,vs)}function g(R){p=R}function $(){var R=p;p=!0,$l(function(){p=R})}function f(R){if(!p){var L=Ba(R);L===c(br)?e.go("<"):L===c(wr)&&e.go(">")}}return{mount:w,destroy:T,disable:g}}var ro=ka+"-lazy",tr=ro+"-srcset",bu="["+ro+"], ["+tr+"]";function wu(e,t,n){var i=Bt(e),o=i.on,s=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[qi,fi],p=[];function w(){n.lazyLoad&&(v(),o(Qt,v))}function v(){Wn(p),T(),c?R():(s(u),o(u,g),g())}function T(){t.Slides.forEach(function(L){Ma(L.slide,bu).forEach(function(I){var Y=xn(I,ro),P=xn(I,tr);if(Y!==I.src||P!==I.srcset){var V=n.classes.spinner,M=I.parentElement,C=Lo(M,"."+V)||Ii("span",V,M);p.push([I,L,C]),I.src||go(I,"none")}})})}function g(){p=p.filter(function(L){var I=n.perPage*((n.preloadPages||1)+1)-1;return L[1].isWithin(e.index,I)?$(L):!0}),p.length||s(u)}function $(L){var I=L[0];Tn(L[1].slide,fa),l(I,"load error",Nt(f,L)),yt(I,"src",xn(I,ro)),yt(I,"srcset",xn(I,tr)),Ln(I,ro),Ln(I,tr)}function f(L,I){var Y=L[0],P=L[1];kn(P.slide,fa),I.type!=="error"&&(mi(L[2]),go(Y,""),d(Ha,Y,P),d(Ai)),c&&R()}function R(){p.length&&$(p.shift())}return{mount:w,destroy:Nt(Wn,p),check:g}}function Su(e,t,n){var i=Bt(e),o=i.on,s=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,w=u.getIndex,v=u.go,T=t.Direction.resolve,g=c.pagination,$=[],f,R;function L(){I(),o([rn,Qt,lr],L);var y=n.pagination;g&&go(g,y?"":"none"),y&&(o([_n,yr,fi],A),Y(),A(),s(jl,{list:f,items:$},C(e.index)))}function I(){f&&(mi(g?Zn(f.children):f),kn(f,R),Wn($),f=null),i.destroy()}function Y(){var y=e.length,S=n.classes,F=n.i18n,W=n.perPage,U=p()?u.getEnd()+1:ho(y/W);f=g||Ii("ul",S.pagination,c.track.parentElement),Tn(f,R=Tr+"--"+M()),yt(f,Pn,"tablist"),yt(f,hn,F.select),yt(f,Da,M()===Sr?"vertical":"");for(var G=0;G<U;G++){var J=Ii("li",null,f),D=Ii("button",{class:S.page,type:"button"},J),j=d.getIn(G).map(function(E){return E.slide.id}),O=!p()&&W>1?F.pageX:F.slideX;l(D,"click",Nt(P,G)),n.paginationKeyboard&&l(D,"keydown",Nt(V,G)),yt(J,Pn,"presentation"),yt(D,Pn,"tab"),yt(D,Ro,j.join(" ")),yt(D,hn,ma(O,G+1)),yt(D,Ri,-1),$.push({li:J,button:D,page:G})}}function P(y){v(">"+y,!0)}function V(y,S){var F=$.length,W=Ba(S),U=M(),G=-1;W===T(wr,!1,U)?G=++y%F:W===T(br,!1,U)?G=(--y+F)%F:W==="Home"?G=0:W==="End"&&(G=F-1);var J=$[G];J&&(Il(J.button),v(">"+G),En(S,!0))}function M(){return n.paginationDirection||n.direction}function C(y){return $[u.toPage(y)]}function A(){var y=C(w(!0)),S=C(w());if(y){var F=y.button;kn(F,gi),Ln(F,ps),yt(F,Ri,-1)}if(S){var W=S.button;Tn(W,gi),yt(W,ps,!0),yt(W,Ri,"")}s(zl,{list:f,items:$},y,S)}return{items:$,mount:L,destroy:I,getAt:C,update:A}}var $u=[" ","Enter"];function Cu(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function d(){s.forEach(function(g){g.destroy()}),Wn(s)}function c(){d(),l()}function u(g,$){var f=Bt(g);f.on(_n,function(R,L,I){$.go($.is(Ui)?I:R)}),s.push(f)}function p(){var g=Bt(e),$=g.on;$(Aa,v),$(Vl,T),$([Jn,rn],w),s.push(g),g.emit(Wa,e.splides)}function w(){yt(t.Elements.list,Da,n.direction===Sr?"vertical":"")}function v(g){e.go(g.index)}function T(g,$){Ra($u,Ba($))&&(v(g),En($))}return{setup:Nt(t.Media.set,{slideFocus:$o(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Tu(e,t,n){var i=Bt(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Ci)}function d(u){if(u.cancelable){var p=u.deltaY,w=p<0,v=ua(u),T=n.wheelMinThreshold||0,g=n.wheelSleep||0;sn(p)>T&&v-s>g&&(e.go(w?"<":">"),s=v),c(w)&&En(u)}}function c(u){return!n.releaseWheel||e.state.is(Gi)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Lu=90;function Iu(e,t,n){var i=Bt(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=Ii("span",Gd),c=vr(Lu,Nt(p,!1));function u(){l&&(v(!t.Autoplay.isPaused()),yt(s,hs,!0),d.textContent="…",o(_a,Nt(v,!0)),o(Na,Nt(v,!1)),o([qi,fi],Nt(p,!0)))}function p(T){yt(s,gs,T),T?(To(s,d),c.start()):(mi(d),c.cancel())}function w(){Ln(s,[ms,hs,gs]),mi(d)}function v(T){l&&yt(s,ms,T?"off":"polite")}return{mount:u,disable:v,destroy:w}}var Ru=Object.freeze({__proto__:null,Media:_d,Direction:Nd,Elements:Zd,Slides:Qd,Layout:eu,Clones:nu,Move:iu,Controller:ou,Arrows:su,Autoplay:cu,Cover:du,Scroll:fu,Drag:yu,Keyboard:xu,LazyLoad:wu,Pagination:Su,Sync:Cu,Wheel:Tu,Live:Iu}),Eu={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"},Mu={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:Kd,i18n:Eu,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ku(e,t,n){var i=t.Slides;function o(){Bt(e).on([Jn,Qt],s)}function s(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),$l(c)}return{mount:o,start:l,cancel:da}}function Pu(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=Nt(vn,l,"transition"),c;function u(){Bt(e).bind(l,"transitionend",function(T){T.target===l&&c&&(w(),c())})}function p(T,g){var $=i.toPosition(T,!0),f=i.getPosition(),R=v(T);sn($-f)>=1&&R>=1?n.useScroll?s.scroll($,R,!1,g):(d("transform "+R+"ms "+n.easing),i.translate($,!0),c=g):(i.jump(T),g())}function w(){d(""),s.cancel()}function v(T){var g=n.rewindSpeed;if(e.is(Fi)&&g){var $=o.getIndex(!0),f=o.getEnd();if($===0&&T>=f||$>=f&&T===0)return g}return n.speed}return{mount:u,start:p,cancel:w}}var Au=(function(){function e(n,i){this.event=Bt(),this.Components={},this.state=Fd(Li),this.splides=[],this._o={},this._E={};var o=qn(n)?El(document,n):n;oo(o,o+" is invalid."),this.root=o,i=zn({label:xn(o,hn)||"",labelledby:xn(o,Oa)||""},Mu,e.defaults,i||{});try{zn(i,JSON.parse(xn(o,ka)))}catch{oo(!1,"Invalid JSON")}this._o=Object.create(zn({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,l=this.state,d=this.Components;oo(l.is([Li,rr]),"Already mounted!"),l.set(Li),this._C=d,this._T=o||this._T||(this.is(Eo)?ku:Pu),this._E=i||this._E;var c=mo({},Ru,this._E,{Transition:this._T});return pi(c,function(u,p){var w=u(s,d,s._o);d[p]=w,w.setup&&w.setup()}),pi(d,function(u){u.mount&&u.mount()}),this.emit(Jn),Tn(this.root,qd),l.set(Pi),this.emit(ga),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Pi)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(Zn(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(Qt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,s=this.state;return s.is(Li)?Bt(this).on(ga,this.destroy.bind(this,i)):(pi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Fa),o.destroy(),i&&Wn(this.splides),s.set(rr)),this},Ed(e,[{key:"options",get:function(){return this._o},set:function(i){this._C.Media.set(i,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Va=Au;Va.defaults={};Va.STATES=kd;var xs=[[Jn,"onMounted"],[ga,"onReady"],[_n,"onMove"],[qi,"onMoved"],[Aa,"onClick"],[Pl,"onActive"],[Al,"onInactive"],[Fl,"onVisible"],[Wl,"onHidden"],[Qt,"onRefresh"],[rn,"onUpdated"],[Ai,"onResize"],[fr,"onResized"],[_l,"onDrag"],[Nl,"onDragging"],[Hl,"onDragged"],[yr,"onScroll"],[fi,"onScrolled"],[Fa,"onDestroy"],[Ol,"onArrowsMounted"],[Dl,"onArrowsUpdated"],[jl,"onPaginationMounted"],[zl,"onPaginationUpdated"],[Wa,"onNavigationMounted"],[_a,"onAutoplayPlay"],[Bl,"onAutoplayPlaying"],[Na,"onAutoplayPause"],[Ha,"onLazyLoadLoaded"]];function Ga(...e){return e.filter(Boolean).join(" ")}function cr(e){return e!==null&&typeof e=="object"}function ya(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!ya(n,t[i]));if(cr(e)&&cr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!ya(e[o],t[o]))}return e===t}function Fu(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Wu(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function va(e,t){const n=e;return Wu(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():cr(i)?n[o]=va(cr(n[o])?n[o]:{},i):n[o]=i}),n}var _u=({children:e,className:t,...n})=>a.createElement("div",{className:Ga("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),qa=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Va(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=va({},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&&!ya(this.options,e)&&(this.splide.options=e,this.options=va({},e));const t=this.getSlides();Fu(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){xs.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return a.createElement(t,{className:Ga("splide",e),ref:this.splideRef,...this.omit(o,["options",...xs.map(s=>s[1])])},n?a.createElement(_u,null,i):i)}},Ua=({children:e,className:t,...n})=>a.createElement("li",{className:Ga("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),ct=require("classnames"),w=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Yn=require("react-dom");function zc(e){return e.type==="object"&&e.version===1}const Bc="ControlSlider-module__wrapper___sHEkd",Vc="ControlSlider-module__hoverArrow___A-dOH",Gc="ControlSlider-module__sliderItem___QQSkR",qc="ControlSlider-module__sliderImage___9hRl-",Uc="ControlSlider-module__arrow___05ghY",Kc="ControlSlider-module__arrowVertical___tBfVN",Xc="ControlSlider-module__nextArrow___-30Yc",Yc="ControlSlider-module__arrowInner___aEra3",Zc="ControlSlider-module__arrowIcon___S4ztF",Jc="ControlSlider-module__arrowImg___2dwJW",Qc="ControlSlider-module__mirror___brd6U",ed="ControlSlider-module__pagination___bicLF",td="ControlSlider-module__paginationInner___bT-P-",nd="ControlSlider-module__paginationVertical___zYqKw",id="ControlSlider-module__paginationItem___nTRbk",od="ControlSlider-module__dot___p1Qun",rd="ControlSlider-module__activeDot___LHFaj",ad="ControlSlider-module__paginationInsideBottom___R3FWn",ld="ControlSlider-module__paginationInsideTop___V-qb-",sd="ControlSlider-module__paginationOutsideBottom___14w8D",cd="ControlSlider-module__paginationOutsideTop___SCLqB",dd="ControlSlider-module__paginationInsideLeft___yOBRZ",ud="ControlSlider-module__paginationInsideRight___Rtt3o",pd="ControlSlider-module__paginationOutsideLeft___lahaw",md="ControlSlider-module__paginationOutsideRight___EtuQa",gd="ControlSlider-module__imgWrapper___UjEgB",hd="ControlSlider-module__captionBlock___dJ6-j",fd="ControlSlider-module__captionTextWrapper___HFlpf",yd="ControlSlider-module__captionText___uGBVc",vd="ControlSlider-module__active___WZK4G",xd="ControlSlider-module__withPointerEvents___t-18M",bd="ControlSlider-module__topLeftAlignment___zjnGM",wd="ControlSlider-module__topCenterAlignment___gD1xW",Sd="ControlSlider-module__topRightAlignment___NMapS",$d="ControlSlider-module__middleLeftAlignment___OnUrY",Cd="ControlSlider-module__middleCenterAlignment___Tdkl0",Td="ControlSlider-module__middleRightAlignment___wEbfX",Ld="ControlSlider-module__bottomLeftAlignment___cTP2-",Id="ControlSlider-module__bottomCenterAlignment___c54fB",Rd="ControlSlider-module__bottomRightAlignment___kEwrz",Md="ControlSlider-module__clickOverlay___DZA28",Ed="ControlSlider-module__contain___pLyq7",Pd="ControlSlider-module__cover___KdDat",rt={wrapper:Bc,hoverArrow:Vc,sliderItem:Gc,sliderImage:qc,arrow:Uc,arrowVertical:Kc,nextArrow:Xc,arrowInner:Yc,arrowIcon:Zc,arrowImg:Jc,mirror:Qc,pagination:ed,paginationInner:td,paginationVertical:nd,paginationItem:id,dot:od,activeDot:rd,paginationInsideBottom:ad,paginationInsideTop:ld,paginationOutsideBottom:sd,paginationOutsideTop:cd,paginationInsideLeft:dd,paginationInsideRight:ud,paginationOutsideLeft:pd,paginationOutsideRight:md,imgWrapper:gd,captionBlock:hd,captionTextWrapper:fd,captionText:yd,active:vd,withPointerEvents:xd,topLeftAlignment:bd,topCenterAlignment:wd,topRightAlignment:Sd,middleLeftAlignment:$d,middleCenterAlignment:Cd,middleRightAlignment:Td,bottomLeftAlignment:Ld,bottomCenterAlignment:Id,bottomRightAlignment:Rd,clickOverlay:Md,contain:Ed,cover:Pd};function kd(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ad(e,t,n){return t&&kd(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var al="(prefers-reduced-motion: reduce)",Ei=1,Fd=2,Wi=3,Ki=4,Co=5,Qo=6,ar=7,Wd={CREATED:Ei,MOUNTED:Fd,IDLE:Wi,MOVING:Ki,SCROLLING:Co,DRAGGING:Qo,DESTROYED:ar};function Wn(e){e.length=0}function Zn(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ht(e){return e.bind.apply(e,[null].concat(Zn(arguments,1)))}var Ls=setTimeout,ua=function(){};function ll(e){return requestAnimationFrame(e)}function fr(e,t){return typeof t===e}function po(e){return!Ia(e)&&fr("object",e)}var La=Array.isArray,Is=Ht(fr,"function"),qn=Ht(fr,"string"),To=Ht(fr,"undefined");function Ia(e){return e===null}function Rs(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Lo(e){return La(e)?e:[e]}function yn(e,t){Lo(e).forEach(t)}function Ra(e,t){return e.indexOf(t)>-1}function er(e,t){return e.push.apply(e,Lo(t)),e}function En(e,t,n){e&&yn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){En(e,qn(t)?t.split(" "):t,!0)}function Io(e,t){yn(t,e.appendChild.bind(e))}function Ma(e,t){yn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function mo(e,t){return Rs(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Ms(e,t){var n=e?Zn(e.children):[];return t?n.filter(function(i){return mo(i,t)}):n}function Ro(e,t){return t?Ms(e,t)[0]:e.firstElementChild}var go=Object.keys;function mi(e,t,n){return e&&(n?go(e).reverse():go(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function ho(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){La(n)?e[i]=n.slice():po(n)?e[i]=zn({},po(e[i])?e[i]:{},n):e[i]=n})}),e}function sl(e,t){yn(t||go(e),function(n){delete e[n]})}function Ln(e,t){yn(e,function(n){yn(t,function(i){n&&n.removeAttribute(i)})})}function bt(e,t,n){po(t)?mi(t,function(i,o){bt(e,o,i)}):yn(e,function(i){Ia(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function Pi(e,t,n){var i=document.createElement(e);return t&&(qn(t)?Tn(i,t):bt(i,t)),n&&Io(n,i),i}function xn(e,t,n){if(To(n))return getComputedStyle(e)[t];Ia(n)||(e.style[t]=""+n)}function fo(e,t){xn(e,"display",t)}function Es(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function bn(e,t){return e.getAttribute(t)}function cl(e,t){return e&&e.classList.contains(t)}function mn(e){return e.getBoundingClientRect()}function hi(e){yn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Ps(e){return Ro(new DOMParser().parseFromString(e,"text/html").body)}function Mn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function ks(e,t){return e&&e.querySelector(t)}function Ea(e,t){return t?Zn(e.querySelectorAll(t)):[]}function Pn(e,t){En(e,t,!1)}function pa(e){return e.timeStamp}function ii(e){return qn(e)?e:e?e+"px":""}var Mo="splide",Pa="data-"+Mo;function ao(e,t){if(!e)throw new Error("["+Mo+"] "+(t||""))}var Un=Math.min,lr=Math.max,sr=Math.floor,yo=Math.ceil,sn=Math.abs;function As(e,t,n){return sn(e-t)<n}function tr(e,t,n,i){var o=Un(t,n),l=lr(t,n);return i?o<e&&e<l:o<=e&&e<=l}function Li(e,t,n){var i=Un(t,n),o=lr(t,n);return Un(lr(i,e),o)}function ma(e){return+(e>0)-+(e<0)}function ga(e,t){return yn(t,function(n){e=e.replace("%s",""+n)}),e}function ka(e){return e<10?"0"+e:""+e}var dl={};function _d(e){return""+e+ka(dl[e]=(dl[e]||0)+1)}function Fs(){var e=[];function t(s,d,c,u){o(s,d,function(p,b,S){var L="addEventListener"in p,f=L?p.removeEventListener.bind(p,b,c,u):p.removeListener.bind(p,c);L?p.addEventListener(b,c,u):p.addListener(c),e.push([p,b,S,c,f])})}function n(s,d,c){o(s,d,function(u,p,b){e=e.filter(function(S){return S[0]===u&&S[1]===p&&S[2]===b&&(!c||S[3]===c)?(S[4](),!1):!0})})}function i(s,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),s.dispatchEvent(u),u}function o(s,d,c){yn(s,function(u){u&&yn(d,function(p){p.split(" ").forEach(function(b){var S=b.split(".");c(u,S[0],S[1])})})})}function l(){e.forEach(function(s){s[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:l}}var Jn="mounted",ha="ready",_n="move",Xi="moved",Aa="click",Ws="active",_s="inactive",Ns="visible",Hs="hidden",Qt="refresh",an="updated",_i="resize",yr="resized",Os="drag",js="dragging",Ds="dragged",vr="scroll",vi="scrolled",Nd="overflow",Fa="destroy",zs="arrows:mounted",Bs="arrows:updated",Vs="pagination:mounted",Gs="pagination:updated",Wa="navigation:mounted",_a="autoplay:play",qs="autoplay:playing",Na="autoplay:pause",Ha="lazyload:loaded",Us="sk",Ks="sh",cr="ei";function Gt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Fs();function i(l,s){n.bind(t,Lo(l).join(" "),function(d){s.apply(s,La(d.detail)?d.detail:[])})}function o(l){n.dispatch(t,l,Zn(arguments,1))}return e&&e.event.on(Fa,n.destroy),ho(n,{bus:t,on:i,off:Ht(n.unbind,t),emit:o})}function xr(e,t,n,i){var o=Date.now,l,s=0,d,c=!0,u=0;function p(){if(!c){if(s=e?Un((o()-l)/e,1):1,n&&n(s),s>=1&&(t(),l=o(),i&&++u>=i))return S();d=ll(p)}}function b(E){E||f(),l=o()-(E?s*e:0),c=!1,d=ll(p)}function S(){c=!0}function L(){l=o(),s=0,n&&n(s)}function f(){d&&cancelAnimationFrame(d),s=0,d=0,c=!0}function h(E){e=E}function y(){return c}return{start:b,rewind:L,pause:S,cancel:f,set:h,isPaused:y}}function Hd(e){var t=e;function n(o){t=o}function i(o){return Ra(Lo(o),t)}return{set:n,is:i}}function Od(e,t){var n=xr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function jd(e,t,n){var i=e.state,o=n.breakpoints||{},l=n.reducedMotion||{},s=Fs(),d=[];function c(){var f=n.mediaQuery==="min";go(o).sort(function(h,y){return f?+h-+y:+y-+h}).forEach(function(h){p(o[h],"("+(f?"min":"max")+"-width:"+h+"px)")}),p(l,al),b()}function u(f){f&&s.destroy()}function p(f,h){var y=matchMedia(h);s.bind(y,"change",b),d.push([f,y])}function b(){var f=i.is(ar),h=n.direction,y=d.reduce(function(E,I){return zn(E,I[1].matches?I[0]:{})},{});sl(n),L(y),n.destroy?e.destroy(n.destroy==="completely"):f?(u(!0),e.mount()):h!==n.direction&&e.refresh()}function S(f){matchMedia(al).matches&&(f?zn(n,l):sl(n,go(l)))}function L(f,h,y){zn(n,f),h&&zn(Object.getPrototypeOf(n),f),(y||!i.is(Ei))&&e.emit(an,n)}return{setup:c,destroy:u,reduce:S,set:L}}var br="Arrow",wr=br+"Left",Sr=br+"Right",Xs=br+"Up",Ys=br+"Down",ul="rtl",$r="ttb",Nr={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Xs,Sr],ArrowRight:[Ys,wr]};function Dd(e,t,n){function i(l,s,d){d=d||n.direction;var c=d===ul&&!s?1:d===$r?0:-1;return Nr[l]&&Nr[l][c]||l.replace(/width|left|right/i,function(u,p){var b=Nr[u.toLowerCase()][c]||u;return p>0?b.charAt(0).toUpperCase()+b.slice(1):b})}function o(l){return l*(n.direction===ul?1:-1)}return{resolve:i,orient:o}}var kn="role",ki="tabindex",zd="disabled",wn="aria-",Eo=wn+"controls",Zs=wn+"current",pl=wn+"selected",hn=wn+"label",Oa=wn+"labelledby",Js=wn+"hidden",ja=wn+"orientation",vo=wn+"roledescription",ml=wn+"live",gl=wn+"busy",hl=wn+"atomic",Da=[kn,ki,zd,Eo,Zs,hn,Oa,Js,ja,vo],In=Mo+"__",Qn="is-",Hr=Mo,fl=In+"track",Bd=In+"list",Cr=In+"slide",Qs=Cr+"--clone",Vd=Cr+"__container",za=In+"arrows",Tr=In+"arrow",ec=Tr+"--prev",tc=Tr+"--next",Lr=In+"pagination",nc=Lr+"__page",Gd=In+"progress",qd=Gd+"__bar",Ud=In+"toggle",Kd=In+"spinner",Xd=In+"sr",Yd=Qn+"initialized",fi=Qn+"active",ic=Qn+"prev",oc=Qn+"next",fa=Qn+"visible",ya=Qn+"loading",rc=Qn+"focus-in",ac=Qn+"overflow",Zd=[fi,fa,ic,oc,ya,rc,ac],Jd={slide:Cr,clone:Qs,arrows:za,arrow:Tr,prev:ec,next:tc,pagination:Lr,page:nc,spinner:Kd};function Qd(e,t){if(Is(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!mo(n,t);)n=n.parentElement;return n}var eu=5,yl=200,lc="touchstart mousedown",Or="touchmove mousemove",jr="touchend touchcancel mouseup click";function tu(e,t,n){var i=Gt(e),o=i.on,l=i.bind,s=e.root,d=n.i18n,c={},u=[],p=[],b=[],S,L,f;function h(){T(),X(),I()}function y(){o(Qt,E),o(Qt,h),o(an,I),l(document,lc+" keydown",function(P){f=P.type==="keydown"},{capture:!0}),l(s,"focusin",function(){En(s,rc,!!f)})}function E(P){var C=Da.concat("style");Wn(u),Pn(s,p),Pn(S,b),Ln([S,L],C),Ln(s,P?C:["style",vo])}function I(){Pn(s,p),Pn(S,b),p=B(Hr),b=B(fl),Tn(s,p),Tn(S,b),bt(s,hn,n.label),bt(s,Oa,n.labelledby)}function T(){S=k("."+fl),L=Ro(S,"."+Bd),ao(S&&L,"A track/list element is missing."),er(u,Ms(L,"."+Cr+":not(."+Qs+")")),mi({arrows:za,pagination:Lr,prev:ec,next:tc,bar:qd,toggle:Ud},function(P,C){c[C]=k("."+P)}),ho(c,{root:s,track:S,list:L,slides:u})}function X(){var P=s.id||_d(Mo),C=n.role;s.id=P,S.id=S.id||P+"-track",L.id=L.id||P+"-list",!bn(s,kn)&&s.tagName!=="SECTION"&&C&&bt(s,kn,C),bt(s,vo,d.carousel),bt(L,kn,"presentation")}function k(P){var C=ks(s,P);return C&&Qd(C,"."+Hr)===s?C:void 0}function B(P){return[P+"--"+n.type,P+"--"+n.direction,n.drag&&P+"--draggable",n.isNavigation&&P+"--nav",P===Hr&&fi]}return ho(c,{setup:h,mount:y,destroy:E})}var Ni="slide",Yi="loop",Po="fade";function nu(e,t,n,i){var o=Gt(e),l=o.on,s=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,b=p.isNavigation,S=p.updateOnMove,L=p.i18n,f=p.pagination,h=p.slideFocus,y=c.Direction.resolve,E=bn(i,"style"),I=bn(i,hn),T=n>-1,X=Ro(i,"."+Vd),k;function B(){T||(i.id=u.id+"-slide"+ka(t+1),bt(i,kn,f?"tabpanel":"group"),bt(i,vo,L.slide),bt(i,hn,I||ga(L.slideLabel,[t+1,e.length]))),P()}function P(){d(i,"click",Ht(s,Aa,ne)),d(i,"keydown",Ht(s,Us,ne)),l([Xi,Ks,vi],_),l(Wa,z),S&&l(_n,v)}function C(){k=!0,o.destroy(),Pn(i,Zd),Ln(i,Da),bt(i,"style",E),bt(i,hn,I||"")}function z(){var $=e.splides.map(function(M){var N=M.splide.Components.Slides.getAt(t);return N?N.slide.id:""}).join(" ");bt(i,hn,ga(L.slideX,(T?n:t)+1)),bt(i,Eo,$),bt(i,kn,h?"button":""),h&&Ln(i,vo)}function v(){k||_()}function _(){if(!k){var $=e.index;R(),Z(),En(i,ic,t===$-1),En(i,oc,t===$+1)}}function R(){var $=U();$!==cl(i,fi)&&(En(i,fi,$),bt(i,Zs,b&&$||""),s($?Ws:_s,ne))}function Z(){var $=V(),M=!$&&(!U()||T);if(e.state.is([Ki,Co])||bt(i,Js,M||""),bt(Ea(i,p.focusableNodes||""),ki,M?-1:""),h&&bt(i,ki,M?-1:0),$!==cl(i,fa)&&(En(i,fa,$),s($?Ns:Hs,ne)),!$&&document.activeElement===i){var N=c.Slides.getAt(e.index);N&&Es(N.slide)}}function A($,M,N){xn(N&&X||i,$,M)}function U(){var $=e.index;return $===t||p.cloneStatus&&$===n}function V(){if(e.is(Po))return U();var $=mn(c.Elements.track),M=mn(i),N=y("left",!0),Q=y("right",!0);return sr($[N])<=yo(M[N])&&sr(M[Q])<=yo($[Q])}function G($,M){var N=sn($-t);return!T&&(p.rewind||e.is(Yi))&&(N=Un(N,e.length-N)),N<=M}var ne={index:t,slideIndex:n,slide:i,container:X,isClone:T,mount:B,destroy:C,update:_,style:A,isWithin:G};return ne}function iu(e,t,n){var i=Gt(e),o=i.on,l=i.emit,s=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function b(){S(),o(Qt,L),o(Qt,S)}function S(){c.forEach(function(_,R){h(_,R,-1)})}function L(){k(function(_){_.destroy()}),Wn(p)}function f(){k(function(_){_.update()})}function h(_,R,Z){var A=nu(e,R,Z,_);A.mount(),p.push(A),p.sort(function(U,V){return U.index-V.index})}function y(_){return _?B(function(R){return!R.isClone}):p}function E(_){var R=t.Controller,Z=R.toIndex(_),A=R.hasFocus()?1:n.perPage;return B(function(U){return tr(U.index,Z,Z+A-1)})}function I(_){return B(_)[0]}function T(_,R){yn(_,function(Z){if(qn(Z)&&(Z=Ps(Z)),Rs(Z)){var A=c[R];A?Ma(Z,A):Io(u,Z),Tn(Z,n.classes.slide),C(Z,Ht(l,_i))}}),l(Qt)}function X(_){hi(B(_).map(function(R){return R.slide})),l(Qt)}function k(_,R){y(R).forEach(_)}function B(_){return p.filter(Is(_)?_:function(R){return qn(_)?mo(R.slide,_):Ra(Lo(_),R.index)})}function P(_,R,Z){k(function(A){A.style(_,R,Z)})}function C(_,R){var Z=Ea(_,"img"),A=Z.length;A?Z.forEach(function(U){s(U,"load error",function(){--A||R()})}):R()}function z(_){return _?c.length:p.length}function v(){return p.length>n.perPage}return{mount:b,destroy:L,update:f,register:h,get:y,getIn:E,getAt:I,add:T,remove:X,forEach:k,filter:B,style:P,getLength:z,isEnough:v}}function ou(e,t,n){var i=Gt(e),o=i.on,l=i.bind,s=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,b=u.track,S=u.list,L=d.getAt,f=d.style,h,y,E;function I(){T(),l(window,"resize load",Od(Ht(s,_i))),o([an,Qt],T),o(_i,X)}function T(){h=n.direction===$r,xn(p,"maxWidth",ii(n.width)),xn(b,c("paddingLeft"),k(!1)),xn(b,c("paddingRight"),k(!0)),X(!0)}function X(ne){var $=mn(p);(ne||y.width!==$.width||y.height!==$.height)&&(xn(b,"height",B()),f(c("marginRight"),ii(n.gap)),f("width",C()),f("height",z(),!0),y=$,s(yr),E!==(E=G())&&(En(p,ac,E),s(Nd,E)))}function k(ne){var $=n.padding,M=c(ne?"right":"left");return $&&ii($[M]||(po($)?0:$))||"0px"}function B(){var ne="";return h&&(ne=P(),ao(ne,"height or heightRatio is missing."),ne="calc("+ne+" - "+k(!1)+" - "+k(!0)+")"),ne}function P(){return ii(n.height||mn(S).width*n.heightRatio)}function C(){return n.autoWidth?null:ii(n.fixedWidth)||(h?"":v())}function z(){return ii(n.fixedHeight)||(h?n.autoHeight?null:v():P())}function v(){var ne=ii(n.gap);return"calc((100%"+(ne&&" + "+ne)+")/"+(n.perPage||1)+(ne&&" - "+ne)+")"}function _(){return mn(S)[c("width")]}function R(ne,$){var M=L(ne||0);return M?mn(M.slide)[c("width")]+($?0:U()):0}function Z(ne,$){var M=L(ne);if(M){var N=mn(M.slide)[c("right")],Q=mn(S)[c("left")];return sn(N-Q)+($?0:U())}return 0}function A(ne){return Z(e.length-1)-Z(0)+R(0,ne)}function U(){var ne=L(0);return ne&&parseFloat(xn(ne.slide,c("marginRight")))||0}function V(ne){return parseFloat(xn(b,c("padding"+(ne?"Right":"Left"))))||0}function G(){return e.is(Po)||A(!0)>_()}return{mount:I,resize:X,listSize:_,slideSize:R,sliderSize:A,totalSize:Z,getPadding:V,isOverflow:G}}var ru=2;function au(e,t,n){var i=Gt(e),o=i.on,l=t.Elements,s=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,b),o([an,_i],L),(u=y())&&(f(u),t.Layout.resize(!0))}function b(){S(),p()}function S(){hi(c),Wn(c),i.destroy()}function L(){var E=y();u!==E&&(u<E||!E)&&i.emit(Qt)}function f(E){var I=s.get().slice(),T=I.length;if(T){for(;I.length<E;)er(I,I);er(I.slice(-E),I.slice(0,E)).forEach(function(X,k){var B=k<E,P=h(X.slide,k);B?Ma(P,I[0].slide):Io(l.list,P),er(c,P),s.register(P,k-E+(B?0:T),X.index)})}}function h(E,I){var T=E.cloneNode(!0);return Tn(T,n.classes.clone),T.id=e.root.id+"-clone"+ka(I+1),T}function y(){var E=n.clones;if(!e.is(Yi))E=0;else if(To(E)){var I=n[d("fixedWidth")]&&t.Layout.slideSize(0),T=I&&yo(mn(l.track)[d("width")]/I);E=T||n[d("autoWidth")]&&e.length||n.perPage*ru}return E}return{mount:p,destroy:S}}function lu(e,t,n){var i=Gt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,b=d.listSize,S=d.sliderSize,L=t.Direction,f=L.resolve,h=L.orient,y=t.Elements,E=y.list,I=y.track,T;function X(){T=t.Transition,o([Jn,yr,an,Qt],k)}function k(){t.Controller.isBusy()||(t.Scroll.cancel(),P(e.index),t.Slides.update())}function B(M,N,Q,ie){M!==N&&ne(M>Q)&&(_(),C(v(A(),M>Q),!0)),s(Ki),l(_n,N,Q,M),T.start(N,function(){s(Wi),l(Xi,N,Q,M),ie&&ie()})}function P(M){C(Z(M,!0))}function C(M,N){if(!e.is(Po)){var Q=N?M:z(M);xn(E,"transform","translate"+f("X")+"("+Q+"px)"),M!==Q&&l(Ks)}}function z(M){if(e.is(Yi)){var N=R(M),Q=N>t.Controller.getEnd(),ie=N<0;(ie||Q)&&(M=v(M,Q))}return M}function v(M,N){var Q=M-G(N),ie=S();return M-=h(ie*(yo(sn(Q)/ie)||1))*(N?1:-1),M}function _(){C(A(),!0),T.cancel()}function R(M){for(var N=t.Slides.get(),Q=0,ie=1/0,F=0;F<N.length;F++){var pe=N[F].index,x=sn(Z(pe,!0)-M);if(x<=ie)ie=x,Q=pe;else break}return Q}function Z(M,N){var Q=h(p(M-1)-V(M));return N?U(Q):Q}function A(){var M=f("left");return mn(E)[M]-mn(I)[M]+h(u(!1))}function U(M){return n.trimSpace&&e.is(Ni)&&(M=Li(M,0,h(S(!0)-b()))),M}function V(M){var N=n.focus;return N==="center"?(b()-c(M,!0))/2:+N*c(M)||0}function G(M){return Z(M?t.Controller.getEnd():0,!!n.trimSpace)}function ne(M){var N=h(v(A(),M));return M?N>=0:N<=E[f("scrollWidth")]-mn(I)[f("width")]}function $(M,N){N=To(N)?A():N;var Q=M!==!0&&h(N)<h(G(!1)),ie=M!==!1&&h(N)>h(G(!0));return Q||ie}return{mount:X,move:B,jump:P,translate:C,shift:v,cancel:_,toIndex:R,toPosition:Z,getPosition:A,getLimit:G,exceededLimit:$,reposition:k}}function su(e,t,n){var i=Gt(e),o=i.on,l=i.emit,s=t.Move,d=s.getPosition,c=s.getLimit,u=s.toPosition,p=t.Slides,b=p.isEnough,S=p.getLength,L=n.omitEnd,f=e.is(Yi),h=e.is(Ni),y=Ht(A,!1),E=Ht(A,!0),I=n.start||0,T,X=I,k,B,P;function C(){z(),o([an,Qt,cr],z),o(yr,v)}function z(){k=S(!0),B=n.perMove,P=n.perPage,T=ne();var x=Li(I,0,L?T:k-1);x!==I&&(I=x,s.reposition())}function v(){T!==ne()&&l(cr)}function _(x,se,J){if(!pe()){var ye=Z(x),Me=G(ye);Me>-1&&(se||Me!==I)&&(Q(Me),s.move(ye,Me,X,J))}}function R(x,se,J,ye){t.Scroll.scroll(x,se,J,function(){var Me=G(s.toIndex(d()));Q(L?Un(Me,T):Me),ye&&ye()})}function Z(x){var se=I;if(qn(x)){var J=x.match(/([+\-<>])(\d+)?/)||[],ye=J[1],Me=J[2];ye==="+"||ye==="-"?se=U(I+ +(""+ye+(+Me||1)),I):ye===">"?se=Me?$(+Me):y(!0):ye==="<"&&(se=E(!0))}else se=f?x:Li(x,0,T);return se}function A(x,se){var J=B||(F()?1:P),ye=U(I+J*(x?-1:1),I,!(B||F()));return ye===-1&&h&&!As(d(),c(!x),1)?x?0:T:se?ye:G(ye)}function U(x,se,J){if(b()||F()){var ye=V(x);ye!==x&&(se=x,x=ye,J=!1),x<0||x>T?!B&&(tr(0,x,se,!0)||tr(T,se,x,!0))?x=$(M(x)):f?x=J?x<0?-(k%P||P):k:x:n.rewind?x=x<0?T:0:x=-1:J&&x!==se&&(x=$(M(se)+(x<se?-1:1)))}else x=-1;return x}function V(x){if(h&&n.trimSpace==="move"&&x!==I)for(var se=d();se===u(x,!0)&&tr(x,0,e.length-1,!n.rewind);)x<I?--x:++x;return x}function G(x){return f?(x+k)%k||0:x}function ne(){for(var x=k-(F()||f&&B?1:P);L&&x-- >0;)if(u(k-1,!0)!==u(x,!0)){x++;break}return Li(x,0,k-1)}function $(x){return Li(F()?x:P*x,0,T)}function M(x){return F()?Un(x,T):sr((x>=T?k-1:x)/P)}function N(x){var se=s.toIndex(x);return h?Li(se,0,T):se}function Q(x){x!==I&&(X=I,I=x)}function ie(x){return x?X:I}function F(){return!To(n.focus)||n.isNavigation}function pe(){return e.state.is([Ki,Co])&&!!n.waitForTransition}return{mount:C,go:_,scroll:R,getNext:y,getPrev:E,getAdjacent:A,getEnd:ne,setIndex:Q,getIndex:ie,toIndex:$,toPage:M,toDest:N,hasFocus:F,isBusy:pe}}var cu="http://www.w3.org/2000/svg",du="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",No=40;function uu(e,t,n){var i=Gt(e),o=i.on,l=i.bind,s=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,b=u.arrows,S=u.track,L=b,f=u.prev,h=u.next,y,E,I={};function T(){k(),o(an,X)}function X(){B(),T()}function k(){var R=n.arrows;R&&!(f&&h)&&z(),f&&h&&(ho(I,{prev:f,next:h}),fo(L,R?"":"none"),Tn(L,E=za+"--"+n.direction),R&&(P(),_(),bt([f,h],Eo,S.id),s(zs,f,h)))}function B(){i.destroy(),Pn(L,E),y?(hi(b?[f,h]:L),f=h=null):Ln([f,h],Da)}function P(){o([Jn,Xi,Qt,vi,cr],_),l(h,"click",Ht(C,">")),l(f,"click",Ht(C,"<"))}function C(R){p.go(R,!0)}function z(){L=b||Pi("div",d.arrows),f=v(!0),h=v(!1),y=!0,Io(L,[f,h]),!b&&Ma(L,S)}function v(R){var Z='<button class="'+d.arrow+" "+(R?d.prev:d.next)+'" type="button"><svg xmlns="'+cu+'" viewBox="0 0 '+No+" "+No+'" width="'+No+'" height="'+No+'" focusable="false"><path d="'+(n.arrowPath||du)+'" />';return Ps(Z)}function _(){if(f&&h){var R=e.index,Z=p.getPrev(),A=p.getNext(),U=Z>-1&&R<Z?c.last:c.prev,V=A>-1&&R>A?c.first:c.next;f.disabled=Z<0,h.disabled=A<0,bt(f,hn,U),bt(h,hn,V),s(Bs,f,h,Z,A)}}return{arrows:I,mount:T,destroy:B,update:_}}var pu=Pa+"-interval";function mu(e,t,n){var i=Gt(e),o=i.on,l=i.bind,s=i.emit,d=xr(n.interval,e.go.bind(e,">"),P),c=d.isPaused,u=t.Elements,p=t.Elements,b=p.root,S=p.toggle,L=n.autoplay,f,h,y=L==="pause";function E(){L&&(I(),S&&bt(S,Eo,u.track.id),y||T(),B())}function I(){n.pauseOnHover&&l(b,"mouseenter mouseleave",function(z){f=z.type==="mouseenter",k()}),n.pauseOnFocus&&l(b,"focusin focusout",function(z){h=z.type==="focusin",k()}),S&&l(S,"click",function(){y?T():X(!0)}),o([_n,vr,Qt],d.rewind),o(_n,C)}function T(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),h=f=y=!1,B(),s(_a))}function X(z){z===void 0&&(z=!0),y=!!z,B(),c()||(d.pause(),s(Na))}function k(){y||(f||h?X(!1):T())}function B(){S&&(En(S,fi,!y),bt(S,hn,n.i18n[y?"play":"pause"]))}function P(z){var v=u.bar;v&&xn(v,"width",z*100+"%"),s(qs,z)}function C(z){var v=t.Slides.getAt(z);d.set(v&&+bn(v.slide,pu)||n.interval)}return{mount:E,destroy:d.cancel,play:T,pause:X,isPaused:c}}function gu(e,t,n){var i=Gt(e),o=i.on;function l(){n.cover&&(o(Ha,Ht(d,!0)),o([Jn,an,Qt],Ht(s,!0)))}function s(c){t.Slides.forEach(function(u){var p=Ro(u.container||u.slide,"img");p&&p.src&&d(c,p,u)})}function d(c,u,p){p.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),fo(u,c?"none":"")}return{mount:l,destroy:Ht(s,!1)}}var hu=10,fu=600,yu=.6,vu=1.5,xu=800;function bu(e,t,n){var i=Gt(e),o=i.on,l=i.emit,s=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,b=d.translate,S=e.is(Ni),L,f,h=1;function y(){o(_n,X),o([an,Qt],k)}function E(P,C,z,v,_){var R=c();if(X(),z&&(!S||!p())){var Z=t.Layout.sliderSize(),A=ma(P)*Z*sr(sn(P)/Z)||0;P=d.toPosition(t.Controller.toDest(P%Z))+A}var U=As(R,P,1);h=1,C=U?0:C||lr(sn(P-R)/vu,xu),f=v,L=xr(C,I,Ht(T,R,P,_),1),s(Co),l(vr),L.start()}function I(){s(Wi),f&&f(),l(vi)}function T(P,C,z,v){var _=c(),R=P+(C-P)*B(v),Z=(R-_)*h;b(_+Z),S&&!z&&p()&&(h*=yu,sn(Z)<hu&&E(u(p(!0)),fu,!1,f,!0))}function X(){L&&L.cancel()}function k(){L&&!L.isPaused()&&(X(),I())}function B(P){var C=n.easingFunc;return C?C(P):1-Math.pow(1-P,4)}return{mount:y,destroy:X,scroll:E,cancel:k}}var Ii={passive:!1,capture:!0};function wu(e,t,n){var i=Gt(e),o=i.on,l=i.emit,s=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,b=t.Controller,S=t.Elements.track,L=t.Media.reduce,f=t.Direction,h=f.resolve,y=f.orient,E=u.getPosition,I=u.exceededLimit,T,X,k,B,P,C=!1,z,v,_;function R(){s(S,Or,ua,Ii),s(S,jr,ua,Ii),s(S,lc,A,Ii),s(S,"click",G,{capture:!0}),s(S,"dragstart",Mn),o([Jn,an],Z)}function Z(){var q=n.drag;ce(!q),B=q==="free"}function A(q){if(z=!1,!v){var ee=Me(q);ye(q.target)&&(ee||!q.button)&&(b.isBusy()?Mn(q,!0):(_=ee?S:window,P=c.is([Ki,Co]),k=null,s(_,Or,U,Ii),s(_,jr,V,Ii),u.cancel(),p.cancel(),ne(q)))}}function U(q){if(c.is(Qo)||(c.set(Qo),l(Os)),q.cancelable)if(P){u.translate(T+J(F(q)));var ee=pe(q)>yl,me=C!==(C=I());(ee||me)&&ne(q),z=!0,l(js),Mn(q)}else N(q)&&(P=M(q),Mn(q))}function V(q){c.is(Qo)&&(c.set(Wi),l(Ds)),P&&($(q),Mn(q)),d(_,Or,U),d(_,jr,V),P=!1}function G(q){!v&&z&&Mn(q,!0)}function ne(q){k=X,X=q,T=E()}function $(q){var ee=Q(q),me=ie(ee),Fe=n.rewind&&n.rewindByDrag;L(!1),B?b.scroll(me,0,n.snap):e.is(Po)?b.go(y(ma(ee))<0?Fe?"<":"-":Fe?">":"+"):e.is(Ni)&&C&&Fe?b.go(I(!0)?">":"<"):b.go(b.toDest(me),!0),L(!0)}function M(q){var ee=n.dragMinThreshold,me=po(ee),Fe=me&&ee.mouse||0,Ce=(me?ee.touch:+ee)||10;return sn(F(q))>(Me(q)?Ce:Fe)}function N(q){return sn(F(q))>sn(F(q,!0))}function Q(q){if(e.is(Yi)||!C){var ee=pe(q);if(ee&&ee<yl)return F(q)/ee}return 0}function ie(q){return E()+ma(q)*Un(sn(q)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function F(q,ee){return se(q,ee)-se(x(q),ee)}function pe(q){return pa(q)-pa(x(q))}function x(q){return X===q&&k||X}function se(q,ee){return(Me(q)?q.changedTouches[0]:q)["page"+h(ee?"Y":"X")]}function J(q){return q/(C&&e.is(Ni)?eu:1)}function ye(q){var ee=n.noDrag;return!mo(q,"."+nc+", ."+Tr)&&(!ee||!mo(q,ee))}function Me(q){return typeof TouchEvent<"u"&&q instanceof TouchEvent}function de(){return P}function ce(q){v=q}return{mount:R,disable:ce,isDragging:de}}var Su={Spacebar:" ",Right:Sr,Left:wr,Up:Xs,Down:Ys};function Ba(e){return e=qn(e)?e:e.key,Su[e]||e}var vl="keydown";function $u(e,t,n){var i=Gt(e),o=i.on,l=i.bind,s=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function b(){S(),o(an,L),o(an,S),o(_n,h)}function S(){var E=n.keyboard;E&&(u=E==="global"?window:d,l(u,vl,y))}function L(){s(u,vl)}function f(E){p=E}function h(){var E=p;p=!0,Ls(function(){p=E})}function y(E){if(!p){var I=Ba(E);I===c(wr)?e.go("<"):I===c(Sr)&&e.go(">")}}return{mount:b,destroy:L,disable:f}}var lo=Pa+"-lazy",nr=lo+"-srcset",Cu="["+lo+"], ["+nr+"]";function Tu(e,t,n){var i=Gt(e),o=i.on,l=i.off,s=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Xi,vi],p=[];function b(){n.lazyLoad&&(S(),o(Qt,S))}function S(){Wn(p),L(),c?E():(l(u),o(u,f),f())}function L(){t.Slides.forEach(function(I){Ea(I.slide,Cu).forEach(function(T){var X=bn(T,lo),k=bn(T,nr);if(X!==T.src||k!==T.srcset){var B=n.classes.spinner,P=T.parentElement,C=Ro(P,"."+B)||Pi("span",B,P);p.push([T,I,C]),T.src||fo(T,"none")}})})}function f(){p=p.filter(function(I){var T=n.perPage*((n.preloadPages||1)+1)-1;return I[1].isWithin(e.index,T)?h(I):!0}),p.length||l(u)}function h(I){var T=I[0];Tn(I[1].slide,ya),s(T,"load error",Ht(y,I)),bt(T,"src",bn(T,lo)),bt(T,"srcset",bn(T,nr)),Ln(T,lo),Ln(T,nr)}function y(I,T){var X=I[0],k=I[1];Pn(k.slide,ya),T.type!=="error"&&(hi(I[2]),fo(X,""),d(Ha,X,k),d(_i)),c&&E()}function E(){p.length&&h(p.shift())}return{mount:b,destroy:Ht(Wn,p),check:f}}function Lu(e,t,n){var i=Gt(e),o=i.on,l=i.emit,s=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,b=u.getIndex,S=u.go,L=t.Direction.resolve,f=c.pagination,h=[],y,E;function I(){T(),o([an,Qt,cr],I);var v=n.pagination;f&&fo(f,v?"":"none"),v&&(o([_n,vr,vi],z),X(),z(),l(Vs,{list:y,items:h},C(e.index)))}function T(){y&&(hi(f?Zn(y.children):y),Pn(y,E),Wn(h),y=null),i.destroy()}function X(){var v=e.length,_=n.classes,R=n.i18n,Z=n.perPage,A=p()?u.getEnd()+1:yo(v/Z);y=f||Pi("ul",_.pagination,c.track.parentElement),Tn(y,E=Lr+"--"+P()),bt(y,kn,"tablist"),bt(y,hn,R.select),bt(y,ja,P()===$r?"vertical":"");for(var U=0;U<A;U++){var V=Pi("li",null,y),G=Pi("button",{class:_.page,type:"button"},V),ne=d.getIn(U).map(function(M){return M.slide.id}),$=!p()&&Z>1?R.pageX:R.slideX;s(G,"click",Ht(k,U)),n.paginationKeyboard&&s(G,"keydown",Ht(B,U)),bt(V,kn,"presentation"),bt(G,kn,"tab"),bt(G,Eo,ne.join(" ")),bt(G,hn,ga($,U+1)),bt(G,ki,-1),h.push({li:V,button:G,page:U})}}function k(v){S(">"+v,!0)}function B(v,_){var R=h.length,Z=Ba(_),A=P(),U=-1;Z===L(Sr,!1,A)?U=++v%R:Z===L(wr,!1,A)?U=(--v+R)%R:Z==="Home"?U=0:Z==="End"&&(U=R-1);var V=h[U];V&&(Es(V.button),S(">"+U),Mn(_,!0))}function P(){return n.paginationDirection||n.direction}function C(v){return h[u.toPage(v)]}function z(){var v=C(b(!0)),_=C(b());if(v){var R=v.button;Pn(R,fi),Ln(R,pl),bt(R,ki,-1)}if(_){var Z=_.button;Tn(Z,fi),bt(Z,pl,!0),bt(Z,ki,"")}l(Gs,{list:y,items:h},v,_)}return{items:h,mount:I,destroy:T,getAt:C,update:z}}var Iu=[" ","Enter"];function Ru(e,t,n){var i=n.isNavigation,o=n.slideFocus,l=[];function s(){e.splides.forEach(function(f){f.isParent||(u(e,f.splide),u(f.splide,e))}),i&&p()}function d(){l.forEach(function(f){f.destroy()}),Wn(l)}function c(){d(),s()}function u(f,h){var y=Gt(f);y.on(_n,function(E,I,T){h.go(h.is(Yi)?T:E)}),l.push(y)}function p(){var f=Gt(e),h=f.on;h(Aa,S),h(Us,L),h([Jn,an],b),l.push(f),f.emit(Wa,e.splides)}function b(){bt(t.Elements.list,ja,n.direction===$r?"vertical":"")}function S(f){e.go(f.index)}function L(f,h){Ra(Iu,Ba(h))&&(S(f),Mn(h))}return{setup:Ht(t.Media.set,{slideFocus:To(o)?i:o},!0),mount:s,destroy:d,remount:c}}function Mu(e,t,n){var i=Gt(e),o=i.bind,l=0;function s(){n.wheel&&o(t.Elements.track,"wheel",d,Ii)}function d(u){if(u.cancelable){var p=u.deltaY,b=p<0,S=pa(u),L=n.wheelMinThreshold||0,f=n.wheelSleep||0;sn(p)>L&&S-l>f&&(e.go(b?"<":">"),l=S),c(b)&&Mn(u)}}function c(u){return!n.releaseWheel||e.state.is(Ki)||t.Controller.getAdjacent(u)!==-1}return{mount:s}}var Eu=90;function Pu(e,t,n){var i=Gt(e),o=i.on,l=t.Elements.track,s=n.live&&!n.isNavigation,d=Pi("span",Xd),c=xr(Eu,Ht(p,!1));function u(){s&&(S(!t.Autoplay.isPaused()),bt(l,hl,!0),d.textContent="…",o(_a,Ht(S,!0)),o(Na,Ht(S,!1)),o([Xi,vi],Ht(p,!0)))}function p(L){bt(l,gl,L),L?(Io(l,d),c.start()):(hi(d),c.cancel())}function b(){Ln(l,[ml,hl,gl]),hi(d)}function S(L){s&&bt(l,ml,L?"off":"polite")}return{mount:u,disable:S,destroy:b}}var ku=Object.freeze({__proto__:null,Media:jd,Direction:Dd,Elements:tu,Slides:iu,Layout:ou,Clones:au,Move:lu,Controller:su,Arrows:uu,Autoplay:mu,Cover:gu,Scroll:bu,Drag:wu,Keyboard:$u,LazyLoad:Tu,Pagination:Lu,Sync:Ru,Wheel:Mu,Live:Pu}),Au={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"},Fu={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:Jd,i18n:Au,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Wu(e,t,n){var i=t.Slides;function o(){Gt(e).on([Jn,Qt],l)}function l(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function s(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Ls(c)}return{mount:o,start:s,cancel:ua}}function _u(e,t,n){var i=t.Move,o=t.Controller,l=t.Scroll,s=t.Elements.list,d=Ht(xn,s,"transition"),c;function u(){Gt(e).bind(s,"transitionend",function(L){L.target===s&&c&&(b(),c())})}function p(L,f){var h=i.toPosition(L,!0),y=i.getPosition(),E=S(L);sn(h-y)>=1&&E>=1?n.useScroll?l.scroll(h,E,!1,f):(d("transform "+E+"ms "+n.easing),i.translate(h,!0),c=f):(i.jump(L),f())}function b(){d(""),l.cancel()}function S(L){var f=n.rewindSpeed;if(e.is(Ni)&&f){var h=o.getIndex(!0),y=o.getEnd();if(h===0&&L>=y||h>=y&&L===0)return f}return n.speed}return{mount:u,start:p,cancel:b}}var Nu=(function(){function e(n,i){this.event=Gt(),this.Components={},this.state=Hd(Ei),this.splides=[],this._o={},this._E={};var o=qn(n)?ks(document,n):n;ao(o,o+" is invalid."),this.root=o,i=zn({label:bn(o,hn)||"",labelledby:bn(o,Oa)||""},Fu,e.defaults,i||{});try{zn(i,JSON.parse(bn(o,Pa)))}catch{ao(!1,"Invalid JSON")}this._o=Object.create(zn({},i))}var t=e.prototype;return t.mount=function(i,o){var l=this,s=this.state,d=this.Components;ao(s.is([Ei,ar]),"Already mounted!"),s.set(Ei),this._C=d,this._T=o||this._T||(this.is(Po)?Wu:_u),this._E=i||this._E;var c=ho({},ku,this._E,{Transition:this._T});return mi(c,function(u,p){var b=u(l,d,l._o);d[p]=b,b.setup&&b.setup()}),mi(d,function(u){u.mount&&u.mount()}),this.emit(Jn),Tn(this.root,Yd),s.set(Wi),this.emit(ha),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Wi)&&(this._C.Sync.remount(),i.Components.Sync.remount()),this},t.go=function(i){return this._C.Controller.go(i),this},t.on=function(i,o){return this.event.on(i,o),this},t.off=function(i){return this.event.off(i),this},t.emit=function(i){var o;return(o=this.event).emit.apply(o,[i].concat(Zn(arguments,1))),this},t.add=function(i,o){return this._C.Slides.add(i,o),this},t.remove=function(i){return this._C.Slides.remove(i),this},t.is=function(i){return this._o.type===i},t.refresh=function(){return this.emit(Qt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,l=this.state;return l.is(Ei)?Gt(this).on(ha,this.destroy.bind(this,i)):(mi(this._C,function(s){s.destroy&&s.destroy(i)},!0),o.emit(Fa),o.destroy(),i&&Wn(this.splides),l.set(ar)),this},Ad(e,[{key:"options",get:function(){return this._o},set:function(i){this._C.Media.set(i,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e})(),Va=Nu;Va.defaults={};Va.STATES=Wd;var xl=[[Jn,"onMounted"],[ha,"onReady"],[_n,"onMove"],[Xi,"onMoved"],[Aa,"onClick"],[Ws,"onActive"],[_s,"onInactive"],[Ns,"onVisible"],[Hs,"onHidden"],[Qt,"onRefresh"],[an,"onUpdated"],[_i,"onResize"],[yr,"onResized"],[Os,"onDrag"],[js,"onDragging"],[Ds,"onDragged"],[vr,"onScroll"],[vi,"onScrolled"],[Fa,"onDestroy"],[zs,"onArrowsMounted"],[Bs,"onArrowsUpdated"],[Vs,"onPaginationMounted"],[Gs,"onPaginationUpdated"],[Wa,"onNavigationMounted"],[_a,"onAutoplayPlay"],[qs,"onAutoplayPlaying"],[Na,"onAutoplayPause"],[Ha,"onLazyLoadLoaded"]];function Ga(...e){return e.filter(Boolean).join(" ")}function dr(e){return e!==null&&typeof e=="object"}function va(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!va(n,t[i]));if(dr(e)&&dr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!va(e[o],t[o]))}return e===t}function Hu(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Ou(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function xa(e,t){const n=e;return Ou(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():dr(i)?n[o]=xa(dr(n[o])?n[o]:{},i):n[o]=i}),n}var ju=({children:e,className:t,...n})=>a.createElement("div",{className:Ga("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),qa=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Va(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=xa({},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&&!va(this.options,e)&&(this.splide.options=e,this.options=xa({},e));const t=this.getSlides();Hu(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){xl.forEach(([t,n])=>{const i=this.props[n];typeof i=="function"&&e.on(t,(...o)=>{i(e,...o)})})}omit(e,t){return t.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&delete e[n]}),e}render(){const{className:e,tag:t="div",hasTrack:n=!0,children:i,...o}=this.props;return a.createElement(t,{className:Ga("splide",e),ref:this.splideRef,...this.omit(o,["options",...xl.map(l=>l[1])])},n?a.createElement(ju,null,i):i)}},Ua=({children:e,className:t,...n})=>a.createElement("li",{className:Ga("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 Nu="RichTextRenderer-module__link___BWeZ2",Hu={link:Nu},Ou=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(i=>/^\d/.test(i))},Lr=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Ou(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function nn(e){const{color:t,...n}=e;return n}function zt(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Lr(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:x.scalingValue(e.letterSpacing,t),wordSpacing:x.scalingValue(e.wordSpacing,t),fontSize:x.scalingValue(n,t),lineHeight:i!==void 0?x.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const hi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Hu.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Du(i),children:i.text},o));return r.jsx(r.Fragment,{children:e.map((n,i)=>{const o=n.children;return r.jsx("div",{children:t(o)},i)})})};function Du(e){return{...e.fontFamily&&{fontFamily:Lr(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 ju="SvgImage-module__svg___q3xE-",zu="SvgImage-module__img___VsTm-",bs={svg:ju,img:zu},Bu=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Vu=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,on=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,l]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!Bu(e)||!s?r.jsx("img",{src:e,alt:"",className:dt(bs.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:dt(bs.svg,i),style:{"--svg":Vu(e),"--fill":t,"--hover-fill":n,...o??{}}})},Gu={"top-left":ot.topLeftAlignment,"top-center":ot.topCenterAlignment,"top-right":ot.topRightAlignment,"middle-left":ot.middleLeftAlignment,"middle-center":ot.middleCenterAlignment,"middle-right":ot.middleRightAlignment,"bottom-left":ot.bottomLeftAlignment,"bottom-center":ot.bottomCenterAlignment,"bottom-right":ot.bottomRightAlignment};function qu({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=a.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:w,textAppearance:v,color:T}=n.imageCaption??{},[g,$]=a.useState(void 0),[f,R]=a.useState(null),[L,I]=a.useState(0),[Y,P]=a.useState(0),{direction:V,transition:M,controls:C,pagination:A,imageCaption:y,triggers:S}=e,F=a.useRef(M.type),{x:W,y:U}=e.controls.offset,G=J=>{o&&o.go(J)};return a.useEffect(()=>{if(!f)return;const J=new ResizeObserver(D=>{if(!o)return;const[j]=D;$({width:Math.round(j.contentRect.width),height:Math.round(j.contentRect.height)})});return J.observe(f),()=>J.unobserve(f)},[f]),a.useEffect(()=>{!o||F.current===M.type||(P(J=>J+1),F.current=M.type)},[M.type]),r.jsx("div",{className:dt(ot.wrapper,{[ot.editor]:i}),ref:R,children:r.jsxs("div",{className:ot.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:M.backgroundColor&&M.type==="fade in"?M.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:dt(ot.captionBlock),children:r.jsx("div",{className:ot.captionTextWrapper,children:t.map((J,D)=>r.jsx("div",{className:dt(ot.captionText,Gu[y.alignment],{[ot.withPointerEvents]:D===L&&i,[ot.active]:D===L}),style:{fontFamily:Lr(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":x.scalingValue(l.width,i),letterSpacing:x.scalingValue(c,i),wordSpacing:x.scalingValue(p,i),textAlign:u,fontSize:x.scalingValue(w.fontSize,i),lineHeight:x.scalingValue(w.lineHeight,i),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:T,transitionDuration:M.duration?`${Math.round(parseInt(M.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:ot.captionTextInner,style:{"--link-hover-color":y.linkHoverColor,"--link-color":y.linkColor,position:"relative",top:x.scalingValue(y.offset.y,i),left:x.scalingValue(y.offset.x,i)},children:r.jsx(hi,{content:J.imageCaption})})},D))})}),r.jsx(qa,{onMove:J=>{I(J.index)},ref:s,options:{arrows:!1,speed:M.duration?parseInt(M.duration):500,autoplay:S.autoPlay!==null,...S.autoPlay!==null&&{interval:parseInt(S.autoPlay)*1e3},direction:V==="horiz"||M.type==="fade in"?"ltr":"ttb",pagination:!1,drag:S.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:M.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((J,D)=>r.jsx(Ua,{children:r.jsx("div",{className:ot.sliderItem,children:r.jsx("div",{className:ot.imgWrapper,children:r.jsx("img",{className:dt(ot.sliderImage,{[ot.contain]:J.image.objectFit==="contain",[ot.cover]:J.image.objectFit==="cover"}),src:J.image.url,alt:J.image.name??""})})})},D))},Y),C.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:dt(ot.arrow,{[ot.arrowVertical]:V==="vert",[ot.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{onClick:()=>{G("-1")},className:ot.arrowInner,style:{transform:`translate(${x.scalingValue(W,i)}, ${x.scalingValue(U*(V==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(on,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:dt(ot.arrowImg,ot.mirror)}),!C.arrowsImgUrl&&r.jsx(ws,{color:C.color,className:dt(ot.arrowIcon,ot.arrowImg,ot.mirror)})]})}),r.jsx("div",{className:dt(ot.arrow,ot.nextArrow,{[ot.arrowVertical]:V==="vert",[ot.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{className:ot.arrowInner,onClick:()=>G("+1"),style:{transform:`translate(${x.scalingValue(W*(V==="horiz"?-1:1),i)}, ${x.scalingValue(U,i)}) scale(${e.controls.scale/100}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(on,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:ot.arrowImg}),!C.arrowsImgUrl&&r.jsx(ws,{color:C.color,className:dt(ot.arrowIcon,ot.arrowImg)})]})})]}),S.triggersList.click&&r.jsx("div",{className:ot.clickOverlay,onClick:()=>{o&&o.go("+1")}}),A.isActive&&r.jsx("div",{className:dt(ot.pagination,{[ot.paginationInsideBottom]:A.position==="inside-1"&&V==="horiz",[ot.paginationInsideTop]:A.position==="inside-2"&&V==="horiz",[ot.paginationOutsideBottom]:A.position==="outside-1"&&V==="horiz",[ot.paginationOutsideTop]:A.position==="outside-2"&&V==="horiz",[ot.paginationInsideLeft]:A.position==="inside-1"&&V==="vert",[ot.paginationInsideRight]:A.position==="inside-2"&&V==="vert",[ot.paginationOutsideLeft]:A.position==="outside-1"&&V==="vert",[ot.paginationOutsideRight]:A.position==="outside-2"&&V==="vert",[ot.paginationVertical]:V==="vert"}),children:r.jsx("div",{className:ot.paginationInner,style:{backgroundColor:A.colors[2],transform:`scale(${A.scale/100}) translate(${x.scalingValue(A.offset.x,i)}, ${x.scalingValue(A.offset.y,i)}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:t.map((J,D)=>r.jsx("button",{onClick:()=>{o&&o.go(D)},className:dt(ot.paginationItem),children:r.jsx("div",{className:dt(ot.dot,{[ot.activeDot]:D===L}),style:{backgroundColor:D===L?A.colors[0]:A.colors[1],"--pagination-hover-color":A.hover}})},D))})})]})})}function ws({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Uu={element:qu,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"]}},Ku="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Xu="ImageRevealSlider-module__image___Qjt-e",Yu="ImageRevealSlider-module__link___N-iLG",Zu="ImageRevealSlider-module__cursor___2U03d",xi={imageRevealSlider:Ku,image:Xu,link:Yu,cursor:Zu};function Ss(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const s=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*s,d=s/2,c=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function Dr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Ju(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await Dr(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Dr(e);s=l.height/l.width*o}else{const l=await Dr(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function Qu({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[s,l]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[p,w]=a.useState({x:0,y:0}),[v,T]=a.useState(1),[g,$]=a.useState("none"),f=a.useRef({x:0,y:0}),[R,L]=a.useState(!1),{sizeType:I,imageWidth:Y,randomRangeImageWidth:P}=e.imageSize,{revealPosition:V,visible:M}=e.position,{cursorType:C,target:A,defaultCursorScale:y,defaultCursor:S,hoverCursorScale:F,hoverCursor:W}=e.cursor;a.useEffect(()=>{if(!i)return;const J=(O,E)=>{const K=i.getBoundingClientRect(),Z=O-K.left,ce=E-K.top;if(w({x:Z,y:ce}),C==="system"){$("none"),T(1);return}const N=Z,pe=ce,b=document.elementFromPoint(K.left+N,K.top+pe);if(b&&b.closest("a")){$("none"),T(1);return}const he=Ss(N,pe,s)||A==="area"?{img:W??"none",scale:F}:{img:S??"none",scale:y};$(he.img),T(he.scale)},D=O=>{O.stopPropagation(),f.current={x:O.clientX,y:O.clientY},J(O.clientX,O.clientY)},j=()=>{R&&J(f.current.x,f.current.y)};return i.addEventListener("mousemove",D),window.addEventListener("scroll",j,!0),()=>{i.removeEventListener("mousemove",D),window.removeEventListener("scroll",j,!0)}},[i,R,p,C,A,W,S,F,y,s]),a.useEffect(()=>{R||($("none"),T(0))},[R]);const U=async(J,D,j,O={})=>{const{width:E,height:K,finalWidth:Z}=await Ju(J.image.url,I,Y,P);let ce=0,N=0;V==="same"?(ce=D/2,N=j/2):(ce=O.x??Math.random()*D,N=O.y??Math.random()*j);const pe=Math.min(Math.max(ce,E/2),D-E/2),b=Math.min(Math.max(N,K/2),j-K/2);return{id:u.current++,url:J.image.url,link:J.link,name:J.image.name,x:pe,y:b,width:Z}};a.useEffect(()=>{if(!i||t.length===0)return;const J=i.getBoundingClientRect(),D=J.width,j=J.height,O=[];(async()=>{const K=t[0],Z=await U(K,D,j);O.push(Z),l(O),c(1)})()},[I,Y,P,V,i]),a.useEffect(()=>{M==="last One"&&l(J=>J.length>0?[J[J.length-1]]:[])},[M]);const G=async J=>{if(!i)return;const D=i.getBoundingClientRect(),j=J.clientX-D.left,O=J.clientY-D.top;if(A==="image"&&!Ss(j,O,s))return;let E=0,K=0;V==="on Click"?(E=j,K=O):V==="same"?(E=D.width/2,K=D.height/2):(E=Math.random()*D.width,K=Math.random()*D.height);const Z=t[d],ce=await U(Z,D.width,D.height,{x:E,y:K});l(N=>M==="all"?[...N,ce]:[ce]),c(N=>N>=t.length-1?0:N+1)};return r.jsxs("div",{ref:o,onClick:G,onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),className:xi.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[s.map(J=>r.jsx("div",{className:xi.wrapper,style:{top:`${J.y}px`,left:`${J.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:J.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:A==="area"&&J.link?r.jsx("a",{href:J.link,target:"_blank",className:xi.link,children:r.jsx("img",{src:J.url,alt:J.name,className:xi.image},J.id)}):r.jsx("img",{src:J.url,alt:J.name,className:xi.image},J.id)},J.id)),R&&r.jsx("div",{className:xi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const ep={element:Qu,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:""}]}}}},tp="LightBox-module__hidden___9s-9x",np="LightBox-module__heroImage___sTxNF",ip="LightBox-module__background___rm9ml",op="LightBox-module__editor___4ACaY",rp="LightBox-module__contentStyle___Bgnsq",ap="LightBox-module__imageStyle___tLIlB",sp="LightBox-module__imgWrapper___LuFUp",lp="LightBox-module__contain___8-yaS",cp="LightBox-module__cover___hNvOG",dp="LightBox-module__caption___b6L2I",up="LightBox-module__captionTextInner___rCGNH",pp="LightBox-module__lightboxSplide___XFuWC",mp="LightBox-module__arrow___iz38X",gp="LightBox-module__arrowVertical___Zfz81",hp="LightBox-module__nextArrow___zkAQN",fp="LightBox-module__arrowInner___p48sW",yp="LightBox-module__arrowIcon___3VaFf",vp="LightBox-module__arrowImg___pNV88",xp="LightBox-module__mirror___pjeXc",bp="LightBox-module__thumbsWrapper___GB-nU",wp="LightBox-module__thumbsContainerVertical___wttk5",Sp="LightBox-module__thumbsContainer___osSma",$p="LightBox-module__thumbsAlignStart___MO6tY",Cp="LightBox-module__thumbsAlignCenter___Q4sUx",Tp="LightBox-module__thumbsAlignEnd___p4y9R",Lp="LightBox-module__thumbItem___HvnF3",Ip="LightBox-module__closeButton___g2khP",Rp="LightBox-module__fadeIn___0m5GW",Ep="LightBox-module__slideInLeft___gPYwC",Mp="LightBox-module__slideInRight___S-pPp",kp="LightBox-module__slideInTop___DFdAj",Pp="LightBox-module__slideInBottom___m27kZ",Ap="LightBox-module__fadeOut___55qBR",Fp="LightBox-module__slideOutLeft___NvU7P",Wp="LightBox-module__slideOutRight___SK7eC",_p="LightBox-module__slideOutTop___Vgg0z",Np="LightBox-module__slideOutBottom___nJ0Ef",Hp="LightBox-module__scaleSlide___vZriG",ze={hidden:tp,heroImage:np,background:ip,editor:op,contentStyle:rp,imageStyle:ap,imgWrapper:sp,contain:lp,cover:cp,caption:dp,captionTextInner:up,lightboxSplide:pp,arrow:mp,arrowVertical:gp,nextArrow:hp,arrowInner:fp,arrowIcon:yp,arrowImg:vp,mirror:xp,thumbsWrapper:bp,thumbsContainerVertical:wp,thumbsContainer:Sp,thumbsAlignStart:$p,thumbsAlignCenter:Cp,thumbsAlignEnd:Tp,thumbItem:Lp,closeButton:Ip,fadeIn:Rp,slideInLeft:Ep,slideInRight:Mp,slideInTop:kp,slideInBottom:Pp,fadeOut:Ap,slideOutLeft:Fp,slideOutRight:Wp,slideOutTop:_p,slideOutBottom:Np,scaleSlide:Hp},_o=(e,t,n)=>{const i={},[o,s]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),s==="left"?(i.left="0",i.right="auto"):s==="center"?(i.left="50%",i.right="auto"):s==="right"&&(i.left="auto",i.right="0"),o==="middle"&&s==="center"?i.transform=`translate(calc(-50% + ${x.scalingValue(t.x,n)}), calc(-50% + ${x.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${x.scalingValue(t.x,n)}, calc(-50% + ${x.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${x.scalingValue(t.x,n)}), ${x.scalingValue(t.y,n)})`:i.transform=`translate(${x.scalingValue(t.x,n)}, ${x.scalingValue(t.y,n)})`,i};function rc(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 Op(e){const t=e.trim().split(/\s+/),n=i=>{if(i.endsWith("%"))return parseFloat(i)/100;switch(i){case"left":case"top":return 0;case"right":case"bottom":return 1;case"center":return .5;default:return .5}};if(t.length===1){const i=t[0];return i==="center"?{x:.5,y:.5}:i==="top"||i==="bottom"?{x:.5,y:n(i)}:i==="left"||i==="right"?{x:n(i),y:.5}:{x:n(i),y:.5}}return{x:n(t[0]),y:n(t[1])}}function ac(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=e;return{renderedW:d,renderedH:d/s}}const l=t;return{renderedW:l*s,renderedH:l}}function Dp(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=t;return{renderedW:d*s,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/s}}function sc(e,t,n,i,o){const{x:s,y:l}=Op(o);return{offsetX:s*(e-n),offsetY:l*(t-i)}}function jp(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height;if(!n||!i)return"center center";const o=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,s=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?Dp:ac,{renderedW:u,renderedH:p}=c(n,i,o,s),{offsetX:w,offsetY:v}=sc(n,i,u,p,d),T=(w+u/2)/n*100,g=(v+p/2)/i*100;return`${T}% ${g}%`}function zp(e){return jp(e)}function dr(e){const t=e.getBoundingClientRect(),n=rc(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=ac(i,o,s,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:w}=sc(i,o,d,c,u),v=t.left+n.left,T=t.top+n.top;return{x:p+v,y:w+T,width:d,height:c}}function $s(e){const t=e.getBoundingClientRect(),n=rc(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Cs(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Bp(e,t){const n=(()=>{if(e==="fade in")return ze.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return ze.slideInLeft;case"right":return ze.slideInRight;case"top":return ze.slideInTop;case"bottom":return ze.slideInBottom;default:return ze.slideInRight}return ze.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return ze.fadeIn;if(e==="slide in")switch(t){case"left":return ze.slideInLeft;case"right":return ze.slideInRight;case"top":return ze.slideInTop;case"bottom":return ze.slideInBottom;default:return ze.slideInRight}return ze.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return ze.fadeOut;if(e==="slide in")switch(t){case"left":return ze.slideOutLeft;case"right":return ze.slideOutRight;case"top":return ze.slideOutTop;case"bottom":return ze.slideOutBottom;default:return ze.slideOutRight}return ze.fadeOut})(),s=(()=>{if(e==="fade in")return ze.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return ze.slideOutLeft;case"right":return ze.slideOutRight;case"top":return ze.slideOutTop;case"bottom":return ze.slideOutBottom;default:return ze.slideOutRight}return ze.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const Vp=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:l})=>{const[d,c]=a.useState(!1),{url:u}=e.thumbnailBlock.cover;return a.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:ze.heroImage,onClick:()=>c(!0)}),r.jsx(Gp,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},Gp=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var Se;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:w,wordSpacing:v,fontSizeLineHeight:T,textAppearance:g,color:$}=i.imageCaption??{},[f,R]=a.useState(0),[L,I]=a.useState(0),[Y,P]=a.useState(!1),[V,M]=a.useState(!1),[C,A]=a.useState({}),y=a.useRef(null),S=a.useRef(null),F=a.useRef(null),W=a.useRef(!1),U=a.useRef(null),G=a.useRef(null),J=a.useRef(null),D=a.useRef(null),j=a.useRef(!1),O=a.useRef(null),[E,K]=a.useState(!1),{appear:Z,triggers:ce,slider:N,thumbnail:pe,controls:b,area:he,caption:Q,layout:we}=o.lightboxBlock,{appearClass:Te,backdropAppearClass:se,backdropDisappearClass:oe,disappearClass:q}=Bp(Z.type,Z.direction),de=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const B=()=>{setTimeout(()=>{var ve,me;(me=(ve=y.current)==null?void 0:ve.splide)==null||me.refresh()},16)},ue=()=>{I(ve=>ve+1)};return window.addEventListener("ArticleEditor.Layout:change",B),window.addEventListener("ArticleEditor.ComponentContent:change",ue),()=>{window.removeEventListener("ArticleEditor.Layout:change",B),window.removeEventListener("ArticleEditor.ComponentContent:change",ue)}},[]),a.useEffect(()=>{if(!e||!pe.isActive){K(!1);return}const B=O.current;if(!B)return;const ue=()=>{N.direction==="horiz"?K(B.scrollWidth>B.clientWidth):K(B.scrollHeight>B.clientHeight)};ue();const ve=new ResizeObserver(ue);return ve.observe(B),()=>ve.disconnect()},[e,pe.isActive,n.length,C,N.direction]);const ge=a.useCallback(()=>{const B=window.matchMedia("(max-width: 768px)").matches,ue=Cs(he.color);B&&!l&&ue>.9&&(document.body.style.backgroundColor=""),P(!0),W.current=!0;const ve=me=>{me.target===U.current&&me.animationName&&(U.current&&G.current&&U.current.removeEventListener("animationend",G.current),G.current=null,W.current&&(W.current=!1,t()),P(!1))};U.current&&(G.current=ve,U.current.addEventListener("animationend",ve))},[t,he.color,l]),_e=(B,ue,ve)=>{var me,Ee;if(B){if(ce.type==="click"&&ce.switch==="image")ce.repeat==="close"&&f===n.length-1?ge():(me=y.current)==null||me.go("+1");else if(ce.type==="click"&&ce.switch==="50/50"){const be=B.getBoundingClientRect(),k=ue-be.left,re=ve-be.top,te=be.width,z=be.height;let le;N.direction==="horiz"?le=k<te/2?"-1":"+1":le=re<z/2?"-1":"+1",(Ee=y.current)==null||Ee.go(le)}}},Ce=B=>{if(j.current){j.current=!1;return}const ue=n[f],ve=(ue==null?void 0:ue.image.objectFit)==="cover";let me,Ee;if("changedTouches"in B&&B.changedTouches.length>0)me=B.changedTouches[0].clientX,Ee=B.changedTouches[0].clientY;else if("clientX"in B)me=B.clientX,Ee=B.clientY;else return;let be;if(ve&&F.current){const k=$s(F.current);be=me>=k.left&&me<=k.right&&Ee>=k.top&&Ee<=k.bottom}else{const k=F.current?dr(F.current):null;if(!k){B.target===B.currentTarget&&ge();return}be=me>=k.x&&me<=k.x+k.width&&Ee>=k.y&&Ee<=k.y+k.height}be?_e(F.current,me,Ee):ge()},Me=B=>{const ue=B.target;(ue.classList.contains(ze.thumbsWrapper)||ue.classList.contains(ze.thumbsContainer))&&Ce(B)};a.useEffect(()=>{if(!e)return;const B=ue=>{var ve,me;if(ue.key==="Escape"){ge();return}if(ue.key==="ArrowRight"){R(Ee=>(Ee+1)%Math.max(n.length,1)),(ve=y.current)==null||ve.go("+1");return}ue.key==="ArrowLeft"&&(R(Ee=>(Ee-1+Math.max(n.length,1))%Math.max(n.length,1)),(me=y.current)==null||me.go("-1"))};return window.addEventListener("keydown",B),()=>{window.removeEventListener("keydown",B)}},[e,ge,n.length]),a.useEffect(()=>{if(e){if(R(0),I(ue=>ue+1),W.current=!1,P(!1),M(!1),A({}),!de)return;const B=new CustomEvent("page-overlay",{detail:{itemId:de}});window.dispatchEvent(B)}return()=>{U.current&&G.current&&(U.current.removeEventListener("animationend",G.current),G.current=null),M(!1)}},[e,de]),a.useEffect(()=>{S.current!==null&&S.current!==N.type&&I(B=>B+1),S.current=N.type},[N.type]),a.useEffect(()=>{if(!e)return;const B=document.body.style.overflow,ue=window.matchMedia("(max-width: 768px)").matches,ve=Cs(he.color);document.body.style.overflow="hidden",M(!1);const me=be=>{be.target===U.current&&!W.current&&be.animationName&&(ue&&!l&&ve>.9&&(document.body.style.backgroundColor=he.color),M(!0),U.current&&J.current&&U.current.removeEventListener("animationend",J.current),J.current=null)};U.current&&(J.current=me,U.current.addEventListener("animationend",me));const Ee=be=>{const k=be.target;k&&(k.closest(`.${ze.thumbsWrapper}`)||k.closest(`.${ze.thumbsContainer}`))||N.type!=="slide"&&be.preventDefault()};return document.addEventListener("touchmove",Ee,{passive:!1}),()=>{document.body.style.overflow=B,document.removeEventListener("touchmove",Ee),U.current&&J.current&&(U.current.removeEventListener("animationend",J.current),J.current=null),M(!1)}},[e,l,he.color,N.type]),a.useEffect(()=>{if(!e)return;const B=ue=>{var me,Ee;if(W.current){ue.stopPropagation();return}if(j.current){j.current=!1;return}const ve=ue.target;if(!(ve&&(ve.closest(`.${ze.thumbsContainer}`)||ve.closest(`.${ze.thumbItem}`)||ve.closest(`.${ze.arrow}`)||ve.closest(`.${ze.closeButton}`)||ve.closest(`.${ze.caption}`)))){if(N.type==="slide"&&ce.type==="drag"&&((Ee=(me=y.current)==null?void 0:me.splide)!=null&&Ee.root)){const be=y.current.splide.root;if(ve&&(be.contains(ve)||be===ve))return}if(ue.touches.length===0&&ue.changedTouches.length>0){const be=n[f],k=(be==null?void 0:be.image.objectFit)==="cover",re=ue.changedTouches[0];let te;if(k&&F.current){const z=$s(F.current);te=re.clientX>=z.left&&re.clientX<=z.right&&re.clientY>=z.top&&re.clientY<=z.bottom}else{const z=F.current?dr(F.current):null;if(!z)return;te=re.clientX>=z.x&&re.clientX<=z.x+z.width&&re.clientY>=z.y&&re.clientY<=z.y+z.height}if(!te){ue.stopPropagation(),W.current=!0;const z=le=>{le.stopPropagation(),le.preventDefault(),document.removeEventListener("click",z,!0)};document.addEventListener("click",z,!0),ge()}}}};return document.addEventListener("touchend",B,{passive:!0}),()=>{document.removeEventListener("touchend",B)}},[e,ge,f,n]);const fe=(N.type==="scale"||N.type==="fade")&&N.direction==="vert"&&ce.type==="drag";a.useEffect(()=>{var le,Re;if(!e||!fe||!((Re=(le=y.current)==null?void 0:le.splide)!=null&&Re.root))return;const B=y.current.splide.root,ue=30,ve=(ae,_)=>{if(D.current){const Ne=Math.abs(ae-D.current.x),Fe=Math.abs(_-D.current.y);(Ne>0||Fe>0)&&(j.current=!0)}},me=ae=>{D.current&&(ae.preventDefault(),ve(ae.clientX,ae.clientY))},Ee=ae=>{D.current&&ae.touches.length>0&&(ae.preventDefault(),ve(ae.touches[0].clientX,ae.touches[0].clientY))},be=(ae,_)=>{if(!D.current||!y.current){D.current=null;return}const Ne=Math.abs(ae-D.current.x),Fe=Math.abs(_-D.current.y);Fe>ue&&Fe>Ne&&y.current.go(_<D.current.y?"+1":"-1"),D.current=null},k=ae=>{D.current&&be(ae.clientX,ae.clientY),document.removeEventListener("pointerup",k),document.removeEventListener("pointercancel",k),document.removeEventListener("pointermove",me)},re=ae=>{if(D.current){if(ae.changedTouches.length>0){const _=ae.changedTouches[0];be(_.clientX,_.clientY)}document.removeEventListener("touchend",re),document.removeEventListener("touchcancel",re),document.removeEventListener("touchmove",Ee)}},te=ae=>{D.current={x:ae.clientX,y:ae.clientY},j.current=!1,document.addEventListener("pointermove",me,{passive:!1}),document.addEventListener("pointerup",k),document.addEventListener("pointercancel",k)},z=ae=>{ae.touches.length>0&&(D.current={x:ae.touches[0].clientX,y:ae.touches[0].clientY},j.current=!1,document.addEventListener("touchmove",Ee,{passive:!1}),document.addEventListener("touchend",re),document.addEventListener("touchcancel",re))};return B.addEventListener("pointerdown",te),B.addEventListener("touchstart",z),()=>{B.removeEventListener("pointerdown",te),B.removeEventListener("touchstart",z),document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",k),document.removeEventListener("pointercancel",k),document.removeEventListener("touchmove",Ee),document.removeEventListener("touchend",re),document.removeEventListener("touchcancel",re),D.current=null,j.current=!1}},[e,fe,L]);const ye={backgroundColor:he.color,backdropFilter:`blur(${he.blur}px)`,animationDuration:`${parseInt(Z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:Yn.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:l?null:U,className:dt(ze.background,Y?oe:se,{[ze.editor]:l},{[ze.hidden]:!e}),style:{...ye,...V&&!l&&!Y?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?U:null,className:dt(ze.contentStyle,Y?q:Te,{[ze.editor]:l},{[ze.hidden]:!e}),style:{animationDuration:`${parseInt(Z.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(qa,{onMove:B=>R(B.index),ref:y,className:ze.lightboxSplide,options:{arrows:!1,speed:N.duration?parseInt(N.duration):500,direction:N.direction==="horiz"||N.type==="fade"||N.type==="scale"?"ltr":"ttb",pagination:!1,drag:ce.type==="drag"&&!fe,perPage:1,width:"100%",height:"100%",type:N.type==="fade"||N.type==="scale"?"fade":"loop",padding:0,rewind:ce.repeat!=="close",start:0},style:{"--splide-speed":N.duration},children:n.map((B,ue)=>{const ve=_o(we.position,we.offset,l),me=`${x.scalingValue(we.padding.top,l)} ${x.scalingValue(we.padding.right,l)} ${x.scalingValue(we.padding.bottom,l)} ${x.scalingValue(we.padding.left,l)}`,Ee=N.type==="scale"?(()=>{const{transform:be,...k}=ve;return{...k,position:"absolute",padding:me,boxSizing:"border-box","--position-transform":be||"none"}})():{...ve,position:"absolute",padding:me,boxSizing:"border-box"};return r.jsx(Ua,{children:r.jsx("div",{className:ze.imgWrapper,onClick:Ce,children:r.jsx("img",{ref:ue===f?F:null,className:dt(ze.imageStyle,{[ze.contain]:B.image.objectFit==="contain",[ze.cover]:B.image.objectFit==="cover",[ze.scaleSlide]:N.type==="scale"}),src:B.image.url,alt:B.image.name??"",style:{...Ee,pointerEvents:B.image.objectFit==="contain"?"none":"auto"}})})},ue)})},L),b.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:dt(ze.arrow,{[ze.arrowVertical]:N.direction==="vert"}),style:{color:b.color,"--arrow-hover-color":b.hover},children:r.jsxs("button",{className:ze.arrowInner,style:{transform:`translate(${x.scalingValue(b.offset.x,l)}, ${x.scalingValue(b.offset.y*(N.direction==="horiz"?1:-1),l)}) scale(${b.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var B;return(B=y.current)==null?void 0:B.go("-1")},"aria-label":"Previous",children:[b.arrowsImgUrl&&r.jsx(on,{url:b.arrowsImgUrl,fill:b.color,hoverFill:b.hover,className:dt(ze.arrowImg,ze.mirror)}),!b.arrowsImgUrl&&r.jsx(Ts,{color:b.color,className:dt(ze.arrowIcon,ze.arrowImg,ze.mirror)})]})}),r.jsx("div",{className:dt(ze.arrow,ze.nextArrow,{[ze.arrowVertical]:N.direction==="vert"}),style:{color:b.color,"--arrow-hover-color":b.hover},children:r.jsxs("button",{className:ze.arrowInner,style:{transform:`translate(${x.scalingValue(b.offset.x*(N.direction==="horiz"?-1:1),l)}, ${x.scalingValue(b.offset.y,l)}) scale(${b.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var B;return(B=y.current)==null?void 0:B.go("+1")},"aria-label":"Next",children:[b.arrowsImgUrl&&r.jsx(on,{url:b.arrowsImgUrl,fill:b.color,hoverFill:b.hover,className:ze.arrowImg}),!b.arrowsImgUrl&&r.jsx(Ts,{color:b.color,className:dt(ze.arrowIcon,ze.arrowImg)})]})})]}),he.closeIconUrl&&(()=>{const B=_o(he.closeIconAlign,he.closeIconOffset,l),ue=`scale(${he.closeIconScale})`,ve=B.transform?`${B.transform} ${ue}`:ue;return r.jsx("button",{className:ze.closeButton,style:{...B,transform:ve},onClick:ge,"aria-label":"Close lightbox",children:r.jsx(on,{url:he.closeIconUrl,fill:he.closeIconColor??"#000000",hoverFill:he.closeIconHover??"#cccccc"})})})(),Q&&Q.isActive&&i.imageCaption&&((Se=n[f])==null?void 0:Se.imageCaption)&&r.jsx("div",{className:ze.caption,style:{..._o(Q.alignment,Q.offset,l),fontFamily:Lr(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":x.scalingValue(c.width,l),letterSpacing:x.scalingValue(p,l),wordSpacing:x.scalingValue(v,l),textAlign:w,fontSize:x.scalingValue(T.fontSize,l),lineHeight:x.scalingValue(T.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:$},onClick:B=>B.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:ze.captionTextInner,style:{"--link-color":Q.linkColor,"--link-hover-color":Q.linkHoverColor},children:r.jsx(hi,{content:n[f].imageCaption})})}),pe.isActive&&(()=>{const[B,ue]=pe.position.split("-"),ve=N.direction==="horiz"?`${B}-left`:pe.position,me=_o(ve,pe.offset,l),Ee=()=>{if(N.direction==="horiz"){if(ue==="left")return"flex-start";if(ue==="center")return"center";if(ue==="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 r.jsx("div",{ref:O,className:ze.thumbsWrapper,onClick:be=>Me(be),style:{position:l?"absolute":"fixed",...me,...N.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:dt(ze.thumbsContainer,{[ze.thumbsContainerVertical]:N.direction==="vert",[ze.thumbsAlignStart]:pe.align==="start",[ze.thumbsAlignCenter]:pe.align==="center",[ze.thumbsAlignEnd]:pe.align==="end"}),style:{gap:x.scalingValue(pe.grid.gap,l),justifyContent:E?"flex-start":Ee()},children:n.map((be,k)=>{const re=k===f,te=C[k],le=pe.grid.size*(re?pe.activeState.scale:1),Re=()=>{if(pe.fit!=="fit")return{};if(!te)return N.direction==="horiz"?{height:x.scalingValue(le,l)}:{width:x.scalingValue(le,l)};const ae=te.width/te.height;if(N.direction==="horiz"){const _=le,Ne=_*ae;return{width:x.scalingValue(Ne,l),height:x.scalingValue(_,l)}}else{const _=le,Ne=_/ae;return{width:x.scalingValue(_,l),height:x.scalingValue(Ne,l)}}};return r.jsx("button",{className:ze.thumbItem,style:{...N.direction==="horiz"&&pe.fit!=="fit"?{height:x.scalingValue(le,l)}:{},...N.direction==="vert"&&pe.fit!=="fit"?{width:x.scalingValue(le,l)}:{},...pe.fit==="cover"?{width:x.scalingValue(le,l),height:x.scalingValue(le,l)}:{},...Re(),transition:re?"all 0.25s ease-out":"none",opacity:re?pe.activeState.opacity/100:pe.opacity/100,"--thumb-hover":pe.activeState.opacity/100},onClick:ae=>{var _;ae.stopPropagation(),R(k),(_=y.current)==null||_.go(k)},onMouseEnter:()=>{var ae;pe.triggers==="hov"&&((ae=y.current)==null||ae.go(k))},children:r.jsx("img",{src:be.image.url,alt:be.image.name??"",onLoad:ae=>{const _=ae.currentTarget;_.naturalWidth&&_.naturalHeight&&A(Ne=>({...Ne,[k]:{width:_.naturalWidth,height:_.naturalHeight}}))},style:{objectFit:pe.fit==="cover"?"cover":"contain",...pe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...pe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${be.image.name}-${k}`)})})})})()]})]}),document.getElementById(s))};function Ts({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const qp={element:Vp,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 No(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Up(e){return`
|
|
6
|
+
*/const Du="RichTextRenderer-module__link___BWeZ2",zu={link:Du},Bu=e=>{const t=e.trim();return!t||t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?!1:t.split(/\s+/g).filter(Boolean).some(i=>/^\d/.test(i))},Ir=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Bu(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function on(e){const{color:t,...n}=e;return n}function Vt(e,t){var o,l,s;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Ir(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:w.scalingValue(e.letterSpacing,t),wordSpacing:w.scalingValue(e.wordSpacing,t),fontSize:w.scalingValue(n,t),lineHeight:i!==void 0?w.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(l=e.textAppearance)==null?void 0:l.textDecoration,fontVariant:(s=e.textAppearance)==null?void 0:s.fontVariant,textAlign:e.textAlign,color:e.color}}const yi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:zu.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Vu(i),children:i.text},o));return r.jsx(r.Fragment,{children:e.map((n,i)=>{const o=n.children;return r.jsx("div",{children:t(o)},i)})})};function Vu(e){return{...e.fontFamily&&{fontFamily:Ir(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 Gu="SvgImage-module__svg___q3xE-",qu="SvgImage-module__img___VsTm-",bl={svg:Gu,img:qu},Uu=e=>{const t=e.trim();return t.startsWith("data:image/svg+xml")?!0:(t.split(/[?#]/)[0]??t).endsWith(".svg")},Ku=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,rn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[l,s]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');s(d)}},[]),!Uu(e)||!l?r.jsx("img",{src:e,alt:"",className:ct(bl.img,i),style:o}):r.jsx("span",{"data-supports-mask":l,className:ct(bl.svg,i),style:{"--svg":Ku(e),"--fill":t,"--hover-fill":n,...o??{}}})},Xu={"top-left":rt.topLeftAlignment,"top-center":rt.topCenterAlignment,"top-right":rt.topRightAlignment,"middle-left":rt.middleLeftAlignment,"middle-center":rt.middleCenterAlignment,"middle-right":rt.middleRightAlignment,"bottom-left":rt.bottomLeftAlignment,"bottom-center":rt.bottomCenterAlignment,"bottom-right":rt.bottomRightAlignment};function Yu({settings:e,content:t,styles:n,isEditor:i}){const[o,l]=a.useState(null),{widthSettings:s,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:b,textAppearance:S,color:L}=n.imageCaption??{},[f,h]=a.useState(void 0),[y,E]=a.useState(null),[I,T]=a.useState(0),[X,k]=a.useState(0),{direction:B,transition:P,controls:C,pagination:z,imageCaption:v,triggers:_}=e,R=a.useRef(P.type),{x:Z,y:A}=e.controls.offset,U=V=>{o&&o.go(V)};return a.useEffect(()=>{if(!y)return;const V=new ResizeObserver(G=>{if(!o)return;const[ne]=G;h({width:Math.round(ne.contentRect.width),height:Math.round(ne.contentRect.height)})});return V.observe(y),()=>V.unobserve(y)},[y]),a.useEffect(()=>{!o||R.current===P.type||(k(V=>V+1),R.current=P.type)},[P.type]),r.jsx("div",{className:ct(rt.wrapper,{[rt.editor]:i}),ref:E,children:r.jsxs("div",{className:rt.sliderInner,style:{width:f?f.width:"100%",height:f?f.height:"100%",backgroundColor:P.backgroundColor&&P.type==="fade in"?P.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:ct(rt.captionBlock),children:r.jsx("div",{className:rt.captionTextWrapper,children:t.map((V,G)=>r.jsx("div",{className:ct(rt.captionText,Xu[v.alignment],{[rt.withPointerEvents]:G===I&&i,[rt.active]:G===I}),style:{fontFamily:Ir(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:s.sizing==="auto"?"max-content":w.scalingValue(s.width,i),letterSpacing:w.scalingValue(c,i),wordSpacing:w.scalingValue(p,i),textAlign:u,fontSize:w.scalingValue(b.fontSize,i),lineHeight:w.scalingValue(b.lineHeight,i),textTransform:S.textTransform??"none",textDecoration:S.textDecoration??"none",fontVariant:S.fontVariant??"normal",color:L,transitionDuration:P.duration?`${Math.round(parseInt(P.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:rt.captionTextInner,style:{"--link-hover-color":v.linkHoverColor,"--link-color":v.linkColor,position:"relative",top:w.scalingValue(v.offset.y,i),left:w.scalingValue(v.offset.x,i)},children:r.jsx(yi,{content:V.imageCaption})})},G))})}),r.jsx(qa,{onMove:V=>{T(V.index)},ref:l,options:{arrows:!1,speed:P.duration?parseInt(P.duration):500,autoplay:_.autoPlay!==null,..._.autoPlay!==null&&{interval:parseInt(_.autoPlay)*1e3},direction:B==="horiz"||P.type==="fade in"?"ltr":"ttb",pagination:!1,drag:_.triggersList.drag,perPage:1,width:f?f.width:"100%",height:f?f.height:"100%",type:P.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((V,G)=>r.jsx(Ua,{children:r.jsx("div",{className:rt.sliderItem,children:r.jsx("div",{className:rt.imgWrapper,children:r.jsx("img",{className:ct(rt.sliderImage,{[rt.contain]:V.image.objectFit==="contain",[rt.cover]:V.image.objectFit==="cover"}),src:V.image.url,alt:V.image.name??""})})})},G))},X),C.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ct(rt.arrow,{[rt.arrowVertical]:B==="vert",[rt.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{onClick:()=>{U("-1")},className:rt.arrowInner,style:{transform:`translate(${w.scalingValue(Z,i)}, ${w.scalingValue(A*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(rn,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:ct(rt.arrowImg,rt.mirror)}),!C.arrowsImgUrl&&r.jsx(wl,{color:C.color,className:ct(rt.arrowIcon,rt.arrowImg,rt.mirror)})]})}),r.jsx("div",{className:ct(rt.arrow,rt.nextArrow,{[rt.arrowVertical]:B==="vert",[rt.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:r.jsxs("button",{className:rt.arrowInner,onClick:()=>U("+1"),style:{transform:`translate(${w.scalingValue(Z*(B==="horiz"?-1:1),i)}, ${w.scalingValue(A,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&r.jsx(rn,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:rt.arrowImg}),!C.arrowsImgUrl&&r.jsx(wl,{color:C.color,className:ct(rt.arrowIcon,rt.arrowImg)})]})})]}),_.triggersList.click&&r.jsx("div",{className:rt.clickOverlay,onClick:()=>{o&&o.go("+1")}}),z.isActive&&r.jsx("div",{className:ct(rt.pagination,{[rt.paginationInsideBottom]:z.position==="inside-1"&&B==="horiz",[rt.paginationInsideTop]:z.position==="inside-2"&&B==="horiz",[rt.paginationOutsideBottom]:z.position==="outside-1"&&B==="horiz",[rt.paginationOutsideTop]:z.position==="outside-2"&&B==="horiz",[rt.paginationInsideLeft]:z.position==="inside-1"&&B==="vert",[rt.paginationInsideRight]:z.position==="inside-2"&&B==="vert",[rt.paginationOutsideLeft]:z.position==="outside-1"&&B==="vert",[rt.paginationOutsideRight]:z.position==="outside-2"&&B==="vert",[rt.paginationVertical]:B==="vert"}),children:r.jsx("div",{className:rt.paginationInner,style:{backgroundColor:z.colors[2],transform:`scale(${z.scale/100}) translate(${w.scalingValue(z.offset.x,i)}, ${w.scalingValue(z.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((V,G)=>r.jsx("button",{onClick:()=>{o&&o.go(G)},className:ct(rt.paginationItem),children:r.jsx("div",{className:ct(rt.dot,{[rt.activeDot]:G===I}),style:{backgroundColor:G===I?z.colors[0]:z.colors[1],"--pagination-hover-color":z.hover}})},G))})})]})})}function wl({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Zu={element:Yu,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"]}},Ju="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Qu="ImageRevealSlider-module__image___Qjt-e",ep="ImageRevealSlider-module__link___N-iLG",tp="ImageRevealSlider-module__cursor___2U03d",wi={imageRevealSlider:Ju,image:Qu,link:ep,cursor:tp};function Sl(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const l=i.width?Number.parseFloat(i.width):o.naturalWidth,s=o.naturalHeight/o.naturalWidth*l,d=l/2,c=s/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function Dr(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function np(e,t,n,i){let o,l;if(t==="custom"){o=n;const s=await Dr(e);l=s.height/s.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const s=await Dr(e);l=s.height/s.width*o}else{const s=await Dr(e);o=s.width,l=s.height}return{width:o,height:l,finalWidth:`${o}px`}}function ip({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[l,s]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[p,b]=a.useState({x:0,y:0}),[S,L]=a.useState(1),[f,h]=a.useState("none"),y=a.useRef({x:0,y:0}),[E,I]=a.useState(!1),{sizeType:T,imageWidth:X,randomRangeImageWidth:k}=e.imageSize,{revealPosition:B,visible:P}=e.position,{cursorType:C,target:z,defaultCursorScale:v,defaultCursor:_,hoverCursorScale:R,hoverCursor:Z}=e.cursor;a.useEffect(()=>{if(!i)return;const V=($,M)=>{const N=i.getBoundingClientRect(),Q=$-N.left,ie=M-N.top;if(b({x:Q,y:ie}),C==="system"){h("none"),L(1);return}const F=Q,pe=ie,x=document.elementFromPoint(N.left+F,N.top+pe);if(x&&x.closest("a")){h("none"),L(1);return}const se=Sl(F,pe,l)||z==="area"?{img:Z??"none",scale:R}:{img:_??"none",scale:v};h(se.img),L(se.scale)},G=$=>{$.stopPropagation(),y.current={x:$.clientX,y:$.clientY},V($.clientX,$.clientY)},ne=()=>{E&&V(y.current.x,y.current.y)};return i.addEventListener("mousemove",G),window.addEventListener("scroll",ne,!0),()=>{i.removeEventListener("mousemove",G),window.removeEventListener("scroll",ne,!0)}},[i,E,p,C,z,Z,_,R,v,l]),a.useEffect(()=>{E||(h("none"),L(0))},[E]);const A=async(V,G,ne,$={})=>{const{width:M,height:N,finalWidth:Q}=await np(V.image.url,T,X,k);let ie=0,F=0;B==="same"?(ie=G/2,F=ne/2):(ie=$.x??Math.random()*G,F=$.y??Math.random()*ne);const pe=Math.min(Math.max(ie,M/2),G-M/2),x=Math.min(Math.max(F,N/2),ne-N/2);return{id:u.current++,url:V.image.url,link:V.link,name:V.image.name,x:pe,y:x,width:Q}};a.useEffect(()=>{if(!i||t.length===0)return;const V=i.getBoundingClientRect(),G=V.width,ne=V.height,$=[];(async()=>{const N=t[0],Q=await A(N,G,ne);$.push(Q),s($),c(1)})()},[T,X,k,B,i]),a.useEffect(()=>{P==="last One"&&s(V=>V.length>0?[V[V.length-1]]:[])},[P]);const U=async V=>{if(!i)return;const G=i.getBoundingClientRect(),ne=V.clientX-G.left,$=V.clientY-G.top;if(z==="image"&&!Sl(ne,$,l))return;let M=0,N=0;B==="on Click"?(M=ne,N=$):B==="same"?(M=G.width/2,N=G.height/2):(M=Math.random()*G.width,N=Math.random()*G.height);const Q=t[d],ie=await A(Q,G.width,G.height,{x:M,y:N});s(F=>P==="all"?[...F,ie]:[ie]),c(F=>F>=t.length-1?0:F+1)};return r.jsxs("div",{ref:o,onClick:U,onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),className:wi.imageRevealSlider,style:{cursor:f==="none"?"default":"none"},children:[l.map(V=>r.jsx("div",{className:wi.wrapper,style:{top:`${V.y}px`,left:`${V.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:V.width??"auto",height:"auto",cursor:f==="none"?"default":"none"},children:z==="area"&&V.link?r.jsx("a",{href:V.link,target:"_blank",className:wi.link,children:r.jsx("img",{src:V.url,alt:V.name,className:wi.image},V.id)}):r.jsx("img",{src:V.url,alt:V.name,className:wi.image},V.id)},V.id)),E&&r.jsx("div",{className:wi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${S})`,backgroundImage:`url('${f}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const op={element:ip,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:""}]}}}},rp="LightBox-module__hidden___9s-9x",ap="LightBox-module__heroImage___sTxNF",lp="LightBox-module__background___rm9ml",sp="LightBox-module__editor___4ACaY",cp="LightBox-module__contentStyle___Bgnsq",dp="LightBox-module__imageStyle___tLIlB",up="LightBox-module__imgWrapper___LuFUp",pp="LightBox-module__contain___8-yaS",mp="LightBox-module__cover___hNvOG",gp="LightBox-module__caption___b6L2I",hp="LightBox-module__captionTextInner___rCGNH",fp="LightBox-module__lightboxSplide___XFuWC",yp="LightBox-module__arrow___iz38X",vp="LightBox-module__arrowVertical___Zfz81",xp="LightBox-module__nextArrow___zkAQN",bp="LightBox-module__arrowInner___p48sW",wp="LightBox-module__arrowIcon___3VaFf",Sp="LightBox-module__arrowImg___pNV88",$p="LightBox-module__mirror___pjeXc",Cp="LightBox-module__thumbsWrapper___GB-nU",Tp="LightBox-module__thumbsContainerVertical___wttk5",Lp="LightBox-module__thumbsContainer___osSma",Ip="LightBox-module__thumbsAlignStart___MO6tY",Rp="LightBox-module__thumbsAlignCenter___Q4sUx",Mp="LightBox-module__thumbsAlignEnd___p4y9R",Ep="LightBox-module__thumbItem___HvnF3",Pp="LightBox-module__closeButton___g2khP",kp="LightBox-module__fadeIn___0m5GW",Ap="LightBox-module__slideInLeft___gPYwC",Fp="LightBox-module__slideInRight___S-pPp",Wp="LightBox-module__slideInTop___DFdAj",_p="LightBox-module__slideInBottom___m27kZ",Np="LightBox-module__fadeOut___55qBR",Hp="LightBox-module__slideOutLeft___NvU7P",Op="LightBox-module__slideOutRight___SK7eC",jp="LightBox-module__slideOutTop___Vgg0z",Dp="LightBox-module__slideOutBottom___nJ0Ef",zp="LightBox-module__scaleSlide___vZriG",ze={hidden:rp,heroImage:ap,background:lp,editor:sp,contentStyle:cp,imageStyle:dp,imgWrapper:up,contain:pp,cover:mp,caption:gp,captionTextInner:hp,lightboxSplide:fp,arrow:yp,arrowVertical:vp,nextArrow:xp,arrowInner:bp,arrowIcon:wp,arrowImg:Sp,mirror:$p,thumbsWrapper:Cp,thumbsContainerVertical:Tp,thumbsContainer:Lp,thumbsAlignStart:Ip,thumbsAlignCenter:Rp,thumbsAlignEnd:Mp,thumbItem:Ep,closeButton:Pp,fadeIn:kp,slideInLeft:Ap,slideInRight:Fp,slideInTop:Wp,slideInBottom:_p,fadeOut:Np,slideOutLeft:Hp,slideOutRight:Op,slideOutTop:jp,slideOutBottom:Dp,scaleSlide:zp},Ho=(e,t,n)=>{const i={},[o,l]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),l==="left"?(i.left="0",i.right="auto"):l==="center"?(i.left="50%",i.right="auto"):l==="right"&&(i.left="auto",i.right="0"),o==="middle"&&l==="center"?i.transform=`translate(calc(-50% + ${w.scalingValue(t.x,n)}), calc(-50% + ${w.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${w.scalingValue(t.x,n)}, calc(-50% + ${w.scalingValue(t.y,n)}))`:l==="center"?i.transform=`translate(calc(-50% + ${w.scalingValue(t.x,n)}), ${w.scalingValue(t.y,n)})`:i.transform=`translate(${w.scalingValue(t.x,n)}, ${w.scalingValue(t.y,n)})`,i};function sc(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 Bp(e){const t=e.trim().split(/\s+/),n=i=>{if(i.endsWith("%"))return parseFloat(i)/100;switch(i){case"left":case"top":return 0;case"right":case"bottom":return 1;case"center":return .5;default:return .5}};if(t.length===1){const i=t[0];return i==="center"?{x:.5,y:.5}:i==="top"||i==="bottom"?{x:.5,y:n(i)}:i==="left"||i==="right"?{x:n(i),y:.5}:{x:n(i),y:.5}}return{x:n(t[0]),y:n(t[1])}}function cc(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,l=n/i;if(l>o){const d=e;return{renderedW:d,renderedH:d/l}}const s=t;return{renderedW:s*l,renderedH:s}}function Vp(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,l=n/i;if(l>o){const d=t;return{renderedW:d*l,renderedH:d}}const s=e;return{renderedW:s,renderedH:s/l}}function dc(e,t,n,i,o){const{x:l,y:s}=Bp(o);return{offsetX:l*(e-n),offsetY:s*(t-i)}}function Gp(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height;if(!n||!i)return"center center";const o=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,l=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:s,objectPosition:d}=window.getComputedStyle(e),c=s==="cover"?Vp:cc,{renderedW:u,renderedH:p}=c(n,i,o,l),{offsetX:b,offsetY:S}=dc(n,i,u,p,d),L=(b+u/2)/n*100,f=(S+p/2)/i*100;return`${L}% ${f}%`}function qp(e){return Gp(e)}function ur(e){const t=e.getBoundingClientRect(),n=sc(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),l=e.naturalWidth,s=e.naturalHeight,{renderedW:d,renderedH:c}=cc(i,o,l,s),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:b}=dc(i,o,d,c,u),S=t.left+n.left,L=t.top+n.top;return{x:p+S,y:b+L,width:d,height:c}}function $l(e){const t=e.getBoundingClientRect(),n=sc(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Cl(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Up(e,t){const n=(()=>{if(e==="fade in")return ze.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return ze.slideInLeft;case"right":return ze.slideInRight;case"top":return ze.slideInTop;case"bottom":return ze.slideInBottom;default:return ze.slideInRight}return ze.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return ze.fadeIn;if(e==="slide in")switch(t){case"left":return ze.slideInLeft;case"right":return ze.slideInRight;case"top":return ze.slideInTop;case"bottom":return ze.slideInBottom;default:return ze.slideInRight}return ze.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return ze.fadeOut;if(e==="slide in")switch(t){case"left":return ze.slideOutLeft;case"right":return ze.slideOutRight;case"top":return ze.slideOutTop;case"bottom":return ze.slideOutBottom;default:return ze.slideOutRight}return ze.fadeOut})(),l=(()=>{if(e==="fade in")return ze.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return ze.slideOutLeft;case"right":return ze.slideOutRight;case"top":return ze.slideOutTop;case"bottom":return ze.slideOutBottom;default:return ze.slideOutRight}return ze.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:l}}const Kp=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:l,isPreviewMode:s})=>{const[d,c]=a.useState(!1),{url:u}=e.thumbnailBlock.cover;return a.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:ze.heroImage,onClick:()=>c(!0)}),r.jsx(Xp,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:l})]})},Xp=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:l,isEditor:s,metadata:d})=>{var Se;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:b,wordSpacing:S,fontSizeLineHeight:L,textAppearance:f,color:h}=i.imageCaption??{},[y,E]=a.useState(0),[I,T]=a.useState(0),[X,k]=a.useState(!1),[B,P]=a.useState(!1),[C,z]=a.useState({}),v=a.useRef(null),_=a.useRef(null),R=a.useRef(null),Z=a.useRef(!1),A=a.useRef(null),U=a.useRef(null),V=a.useRef(null),G=a.useRef(null),ne=a.useRef(!1),$=a.useRef(null),[M,N]=a.useState(!1),{appear:Q,triggers:ie,slider:F,thumbnail:pe,controls:x,area:se,caption:J,layout:ye}=o.lightboxBlock,{appearClass:Me,backdropAppearClass:de,backdropDisappearClass:ce,disappearClass:q}=Up(Q.type,Q.direction),ee=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const D=()=>{setTimeout(()=>{var he,be;(be=(he=v.current)==null?void 0:he.splide)==null||be.refresh()},16)},oe=()=>{T(he=>he+1)};return window.addEventListener("ArticleEditor.Layout:change",D),window.addEventListener("ArticleEditor.ComponentContent:change",oe),()=>{window.removeEventListener("ArticleEditor.Layout:change",D),window.removeEventListener("ArticleEditor.ComponentContent:change",oe)}},[]),a.useEffect(()=>{if(!e||!pe.isActive){N(!1);return}const D=$.current;if(!D)return;const oe=()=>{F.direction==="horiz"?N(D.scrollWidth>D.clientWidth):N(D.scrollHeight>D.clientHeight)};oe();const he=new ResizeObserver(oe);return he.observe(D),()=>he.disconnect()},[e,pe.isActive,n.length,C,F.direction]);const me=a.useCallback(()=>{const D=window.matchMedia("(max-width: 768px)").matches,oe=Cl(se.color);D&&!s&&oe>.9&&(document.body.style.backgroundColor=""),k(!0),Z.current=!0;const he=be=>{be.target===A.current&&be.animationName&&(A.current&&U.current&&A.current.removeEventListener("animationend",U.current),U.current=null,Z.current&&(Z.current=!1,t()),k(!1))};A.current&&(U.current=he,A.current.addEventListener("animationend",he))},[t,se.color,s]),Fe=(D,oe,he)=>{var be,Ie;if(D){if(ie.type==="click"&&ie.switch==="image")ie.repeat==="close"&&y===n.length-1?me():(be=v.current)==null||be.go("+1");else if(ie.type==="click"&&ie.switch==="50/50"){const xe=D.getBoundingClientRect(),W=oe-xe.left,ae=he-xe.top,te=xe.width,j=xe.height;let Y;F.direction==="horiz"?Y=W<te/2?"-1":"+1":Y=ae<j/2?"-1":"+1",(Ie=v.current)==null||Ie.go(Y)}}},Ce=D=>{if(ne.current){ne.current=!1;return}const oe=n[y],he=(oe==null?void 0:oe.image.objectFit)==="cover";let be,Ie;if("changedTouches"in D&&D.changedTouches.length>0)be=D.changedTouches[0].clientX,Ie=D.changedTouches[0].clientY;else if("clientX"in D)be=D.clientX,Ie=D.clientY;else return;let xe;if(he&&R.current){const W=$l(R.current);xe=be>=W.left&&be<=W.right&&Ie>=W.top&&Ie<=W.bottom}else{const W=R.current?ur(R.current):null;if(!W){D.target===D.currentTarget&&me();return}xe=be>=W.x&&be<=W.x+W.width&&Ie>=W.y&&Ie<=W.y+W.height}xe?Fe(R.current,be,Ie):me()},Ae=D=>{const oe=D.target;(oe.classList.contains(ze.thumbsWrapper)||oe.classList.contains(ze.thumbsContainer))&&Ce(D)};a.useEffect(()=>{if(!e)return;const D=oe=>{var he,be;if(oe.key==="Escape"){me();return}if(oe.key==="ArrowRight"){E(Ie=>(Ie+1)%Math.max(n.length,1)),(he=v.current)==null||he.go("+1");return}oe.key==="ArrowLeft"&&(E(Ie=>(Ie-1+Math.max(n.length,1))%Math.max(n.length,1)),(be=v.current)==null||be.go("-1"))};return window.addEventListener("keydown",D),()=>{window.removeEventListener("keydown",D)}},[e,me,n.length]),a.useEffect(()=>{if(e){if(E(0),T(oe=>oe+1),Z.current=!1,k(!1),P(!1),z({}),!ee)return;const D=new CustomEvent("page-overlay",{detail:{itemId:ee}});window.dispatchEvent(D)}return()=>{A.current&&U.current&&(A.current.removeEventListener("animationend",U.current),U.current=null),P(!1)}},[e,ee]),a.useEffect(()=>{_.current!==null&&_.current!==F.type&&T(D=>D+1),_.current=F.type},[F.type]),a.useEffect(()=>{if(!e)return;const D=document.body.style.overflow,oe=window.matchMedia("(max-width: 768px)").matches,he=Cl(se.color);document.body.style.overflow="hidden",P(!1);const be=xe=>{xe.target===A.current&&!Z.current&&xe.animationName&&(oe&&!s&&he>.9&&(document.body.style.backgroundColor=se.color),P(!0),A.current&&V.current&&A.current.removeEventListener("animationend",V.current),V.current=null)};A.current&&(V.current=be,A.current.addEventListener("animationend",be));const Ie=xe=>{const W=xe.target;W&&(W.closest(`.${ze.thumbsWrapper}`)||W.closest(`.${ze.thumbsContainer}`))||F.type!=="slide"&&xe.preventDefault()};return document.addEventListener("touchmove",Ie,{passive:!1}),()=>{document.body.style.overflow=D,document.removeEventListener("touchmove",Ie),A.current&&V.current&&(A.current.removeEventListener("animationend",V.current),V.current=null),P(!1)}},[e,s,se.color,F.type]),a.useEffect(()=>{if(!e)return;const D=oe=>{var be,Ie;if(Z.current){oe.stopPropagation();return}if(ne.current){ne.current=!1;return}const he=oe.target;if(!(he&&(he.closest(`.${ze.thumbsContainer}`)||he.closest(`.${ze.thumbItem}`)||he.closest(`.${ze.arrow}`)||he.closest(`.${ze.closeButton}`)||he.closest(`.${ze.caption}`)))){if(F.type==="slide"&&ie.type==="drag"&&((Ie=(be=v.current)==null?void 0:be.splide)!=null&&Ie.root)){const xe=v.current.splide.root;if(he&&(xe.contains(he)||xe===he))return}if(oe.touches.length===0&&oe.changedTouches.length>0){const xe=n[y],W=(xe==null?void 0:xe.image.objectFit)==="cover",ae=oe.changedTouches[0];let te;if(W&&R.current){const j=$l(R.current);te=ae.clientX>=j.left&&ae.clientX<=j.right&&ae.clientY>=j.top&&ae.clientY<=j.bottom}else{const j=R.current?ur(R.current):null;if(!j)return;te=ae.clientX>=j.x&&ae.clientX<=j.x+j.width&&ae.clientY>=j.y&&ae.clientY<=j.y+j.height}if(!te){oe.stopPropagation(),Z.current=!0;const j=Y=>{Y.stopPropagation(),Y.preventDefault(),document.removeEventListener("click",j,!0)};document.addEventListener("click",j,!0),me()}}}};return document.addEventListener("touchend",D,{passive:!0}),()=>{document.removeEventListener("touchend",D)}},[e,me,y,n]);const ue=(F.type==="scale"||F.type==="fade")&&F.direction==="vert"&&ie.type==="drag";a.useEffect(()=>{var Y,Re;if(!e||!ue||!((Re=(Y=v.current)==null?void 0:Y.splide)!=null&&Re.root))return;const D=v.current.splide.root,oe=30,he=(le,H)=>{if(G.current){const De=Math.abs(le-G.current.x),_e=Math.abs(H-G.current.y);(De>0||_e>0)&&(ne.current=!0)}},be=le=>{G.current&&(le.preventDefault(),he(le.clientX,le.clientY))},Ie=le=>{G.current&&le.touches.length>0&&(le.preventDefault(),he(le.touches[0].clientX,le.touches[0].clientY))},xe=(le,H)=>{if(!G.current||!v.current){G.current=null;return}const De=Math.abs(le-G.current.x),_e=Math.abs(H-G.current.y);_e>oe&&_e>De&&v.current.go(H<G.current.y?"+1":"-1"),G.current=null},W=le=>{G.current&&xe(le.clientX,le.clientY),document.removeEventListener("pointerup",W),document.removeEventListener("pointercancel",W),document.removeEventListener("pointermove",be)},ae=le=>{if(G.current){if(le.changedTouches.length>0){const H=le.changedTouches[0];xe(H.clientX,H.clientY)}document.removeEventListener("touchend",ae),document.removeEventListener("touchcancel",ae),document.removeEventListener("touchmove",Ie)}},te=le=>{G.current={x:le.clientX,y:le.clientY},ne.current=!1,document.addEventListener("pointermove",be,{passive:!1}),document.addEventListener("pointerup",W),document.addEventListener("pointercancel",W)},j=le=>{le.touches.length>0&&(G.current={x:le.touches[0].clientX,y:le.touches[0].clientY},ne.current=!1,document.addEventListener("touchmove",Ie,{passive:!1}),document.addEventListener("touchend",ae),document.addEventListener("touchcancel",ae))};return D.addEventListener("pointerdown",te),D.addEventListener("touchstart",j),()=>{D.removeEventListener("pointerdown",te),D.removeEventListener("touchstart",j),document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",W),document.removeEventListener("pointercancel",W),document.removeEventListener("touchmove",Ie),document.removeEventListener("touchend",ae),document.removeEventListener("touchcancel",ae),G.current=null,ne.current=!1}},[e,ue,I]);const fe={backgroundColor:se.color,backdropFilter:`blur(${se.blur}px)`,animationDuration:`${parseInt(Q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(l)?null:Yn.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:s?null:A,className:ct(ze.background,X?ce:de,{[ze.editor]:s},{[ze.hidden]:!e}),style:{...fe,...B&&!s&&!X?{position:"absolute"}:{}}}),r.jsxs("div",{ref:s?A:null,className:ct(ze.contentStyle,X?q:Me,{[ze.editor]:s},{[ze.hidden]:!e}),style:{animationDuration:`${parseInt(Q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(qa,{onMove:D=>E(D.index),ref:v,className:ze.lightboxSplide,options:{arrows:!1,speed:F.duration?parseInt(F.duration):500,direction:F.direction==="horiz"||F.type==="fade"||F.type==="scale"?"ltr":"ttb",pagination:!1,drag:ie.type==="drag"&&!ue,perPage:1,width:"100%",height:"100%",type:F.type==="fade"||F.type==="scale"?"fade":"loop",padding:0,rewind:ie.repeat!=="close",start:0},style:{"--splide-speed":F.duration},children:n.map((D,oe)=>{const he=Ho(ye.position,ye.offset,s),be=`${w.scalingValue(ye.padding.top,s)} ${w.scalingValue(ye.padding.right,s)} ${w.scalingValue(ye.padding.bottom,s)} ${w.scalingValue(ye.padding.left,s)}`,Ie=F.type==="scale"?(()=>{const{transform:xe,...W}=he;return{...W,position:"absolute",padding:be,boxSizing:"border-box","--position-transform":xe||"none"}})():{...he,position:"absolute",padding:be,boxSizing:"border-box"};return r.jsx(Ua,{children:r.jsx("div",{className:ze.imgWrapper,onClick:Ce,children:r.jsx("img",{ref:oe===y?R:null,className:ct(ze.imageStyle,{[ze.contain]:D.image.objectFit==="contain",[ze.cover]:D.image.objectFit==="cover",[ze.scaleSlide]:F.type==="scale"}),src:D.image.url,alt:D.image.name??"",style:{...Ie,pointerEvents:D.image.objectFit==="contain"?"none":"auto"}})})},oe)})},I),x.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ct(ze.arrow,{[ze.arrowVertical]:F.direction==="vert"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:r.jsxs("button",{className:ze.arrowInner,style:{transform:`translate(${w.scalingValue(x.offset.x,s)}, ${w.scalingValue(x.offset.y*(F.direction==="horiz"?1:-1),s)}) scale(${x.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var D;return(D=v.current)==null?void 0:D.go("-1")},"aria-label":"Previous",children:[x.arrowsImgUrl&&r.jsx(rn,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:ct(ze.arrowImg,ze.mirror)}),!x.arrowsImgUrl&&r.jsx(Tl,{color:x.color,className:ct(ze.arrowIcon,ze.arrowImg,ze.mirror)})]})}),r.jsx("div",{className:ct(ze.arrow,ze.nextArrow,{[ze.arrowVertical]:F.direction==="vert"}),style:{color:x.color,"--arrow-hover-color":x.hover},children:r.jsxs("button",{className:ze.arrowInner,style:{transform:`translate(${w.scalingValue(x.offset.x*(F.direction==="horiz"?-1:1),s)}, ${w.scalingValue(x.offset.y,s)}) scale(${x.scale}) rotate(${F.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var D;return(D=v.current)==null?void 0:D.go("+1")},"aria-label":"Next",children:[x.arrowsImgUrl&&r.jsx(rn,{url:x.arrowsImgUrl,fill:x.color,hoverFill:x.hover,className:ze.arrowImg}),!x.arrowsImgUrl&&r.jsx(Tl,{color:x.color,className:ct(ze.arrowIcon,ze.arrowImg)})]})})]}),se.closeIconUrl&&(()=>{const D=Ho(se.closeIconAlign,se.closeIconOffset,s),oe=`scale(${se.closeIconScale})`,he=D.transform?`${D.transform} ${oe}`:oe;return r.jsx("button",{className:ze.closeButton,style:{...D,transform:he},onClick:me,"aria-label":"Close lightbox",children:r.jsx(rn,{url:se.closeIconUrl,fill:se.closeIconColor??"#000000",hoverFill:se.closeIconHover??"#cccccc"})})})(),J&&J.isActive&&i.imageCaption&&((Se=n[y])==null?void 0:Se.imageCaption)&&r.jsx("div",{className:ze.caption,style:{...Ho(J.alignment,J.offset,s),fontFamily:Ir(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":w.scalingValue(c.width,s),letterSpacing:w.scalingValue(p,s),wordSpacing:w.scalingValue(S,s),textAlign:b,fontSize:w.scalingValue(L.fontSize,s),lineHeight:w.scalingValue(L.lineHeight,s),textTransform:f.textTransform??"none",textDecoration:f.textDecoration??"none",fontVariant:f.fontVariant??"normal",color:h},onClick:D=>D.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:ze.captionTextInner,style:{"--link-color":J.linkColor,"--link-hover-color":J.linkHoverColor},children:r.jsx(yi,{content:n[y].imageCaption})})}),pe.isActive&&(()=>{const[D,oe]=pe.position.split("-"),he=F.direction==="horiz"?`${D}-left`:pe.position,be=Ho(he,pe.offset,s),Ie=()=>{if(F.direction==="horiz"){if(oe==="left")return"flex-start";if(oe==="center")return"center";if(oe==="right")return"flex-end"}else{if(D==="top")return"flex-start";if(D==="middle")return"center";if(D==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:$,className:ze.thumbsWrapper,onClick:xe=>Ae(xe),style:{position:s?"absolute":"fixed",...be,...F.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:ct(ze.thumbsContainer,{[ze.thumbsContainerVertical]:F.direction==="vert",[ze.thumbsAlignStart]:pe.align==="start",[ze.thumbsAlignCenter]:pe.align==="center",[ze.thumbsAlignEnd]:pe.align==="end"}),style:{gap:w.scalingValue(pe.grid.gap,s),justifyContent:M?"flex-start":Ie()},children:n.map((xe,W)=>{const ae=W===y,te=C[W],Y=pe.grid.size*(ae?pe.activeState.scale:1),Re=()=>{if(pe.fit!=="fit")return{};if(!te)return F.direction==="horiz"?{height:w.scalingValue(Y,s)}:{width:w.scalingValue(Y,s)};const le=te.width/te.height;if(F.direction==="horiz"){const H=Y,De=H*le;return{width:w.scalingValue(De,s),height:w.scalingValue(H,s)}}else{const H=Y,De=H/le;return{width:w.scalingValue(H,s),height:w.scalingValue(De,s)}}};return r.jsx("button",{className:ze.thumbItem,style:{...F.direction==="horiz"&&pe.fit!=="fit"?{height:w.scalingValue(Y,s)}:{},...F.direction==="vert"&&pe.fit!=="fit"?{width:w.scalingValue(Y,s)}:{},...pe.fit==="cover"?{width:w.scalingValue(Y,s),height:w.scalingValue(Y,s)}:{},...Re(),transition:ae?"all 0.25s ease-out":"none",opacity:ae?pe.activeState.opacity/100:pe.opacity/100,"--thumb-hover":pe.activeState.opacity/100},onClick:le=>{var H;le.stopPropagation(),E(W),(H=v.current)==null||H.go(W)},onMouseEnter:()=>{var le;pe.triggers==="hov"&&((le=v.current)==null||le.go(W))},children:r.jsx("img",{src:xe.image.url,alt:xe.image.name??"",onLoad:le=>{const H=le.currentTarget;H.naturalWidth&&H.naturalHeight&&z(De=>({...De,[W]:{width:H.naturalWidth,height:H.naturalHeight}}))},style:{objectFit:pe.fit==="cover"?"cover":"contain",...pe.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...pe.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${xe.image.name}-${W}`)})})})})()]})]}),document.getElementById(l))};function Tl({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Yp={element:Kp,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 Oo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Zp(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: ${Oo(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: ${Oo(4)};
|
|
36
36
|
}
|
|
37
37
|
.${e}-field-label {
|
|
38
38
|
white-space: nowrap;
|
|
@@ -128,11 +128,11 @@
|
|
|
128
128
|
outline: none;
|
|
129
129
|
}
|
|
130
130
|
.${e}-success {
|
|
131
|
-
margin-top: ${
|
|
131
|
+
margin-top: ${Oo(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: ${Oo(8)};
|
|
136
136
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
137
137
|
}
|
|
138
138
|
.${e}-overlay-anchor {
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
pointer-events: auto;
|
|
156
156
|
z-index: 10;
|
|
157
157
|
}
|
|
158
|
-
`}function
|
|
158
|
+
`}function Jp({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:l}){const s=!!n,d=i&&t||!t,{prefix:c}=w.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:b=[],buttonLabel:S,gap:L,fieldsGap:f,buttonCorners:h,buttonStroke:y,buttonPadding:E,isButtonFullWidth:I,inputCorners:T,inputStroke:X,inputPadding:k,inputColor:B,inputTextColor:P,inputBorderColor:C,placeholderColor:z,buttonColor:v,buttonTextColor:_,buttonBorderColor:R,labelTextColor:Z,successColor:A,errorColor:U,fontFamily:V,inputFontSettings:G,inputFontSize:ne,inputLineHeight:$,inputLetterSpacing:M,inputWordSpacing:N,inputTextAppearance:Q,buttonFontSettings:ie,buttonFontSize:F,buttonLineHeight:pe,buttonLetterSpacing:x,buttonWordSpacing:se,buttonTextAppearance:J,labelFontSettings:ye,labelFontSize:Me,labelLineHeight:de,labelLetterSpacing:ce,labelWordSpacing:q,labelTextAppearance:ee,statusFontSettings:me,statusFontSize:Fe,statusLineHeight:Ce,statusLetterSpacing:Ae,statusWordSpacing:ue,statusTextAppearance:fe,successMessage:Se,errorMessage:D,stateOverrides:oe}=e,he=u==="B",be=b.slice(0,Math.min(p,b.length)),Ie={fontSettings:{fontFamily:V,fontWeight:(G==null?void 0:G.fontWeight)??400,fontStyle:(G==null?void 0:G.fontStyle)??"normal"},fontSize:ne??.01,lineHeight:$,letterSpacing:M??0,wordSpacing:N??0,textAppearance:Q,color:P},xe=on(Vt(Ie,t)),W=w.scalingValue(X??0,t),ae=w.scalingValue(($??ne??.01)+((k==null?void 0:k.top)??0)+((k==null?void 0:k.bottom)??0)+(u==="C"?X??0:(X??0)*2),t),te={...xe,borderStyle:"solid",borderRadius:u==="C"?0:w.scalingValue(T??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:W,borderLeftWidth:0}:{borderWidth:W},paddingTop:w.scalingValue((k==null?void 0:k.top)??0,t),paddingRight:w.scalingValue((k==null?void 0:k.right)??0,t),paddingBottom:w.scalingValue((k==null?void 0:k.bottom)??0,t),paddingLeft:w.scalingValue((k==null?void 0:k.left)??0,t),height:ae,minHeight:ae},j={fontSettings:{fontFamily:V,fontWeight:(ie==null?void 0:ie.fontWeight)??400,fontStyle:(ie==null?void 0:ie.fontStyle)??"normal"},fontSize:F??.01,lineHeight:pe,letterSpacing:x??0,wordSpacing:se??0,textAppearance:J,color:_},Y=on(Vt(j,t)),Re=w.scalingValue(y??0,t),le={fontSettings:{fontFamily:V,fontWeight:(ye==null?void 0:ye.fontWeight)??400,fontStyle:(ye==null?void 0:ye.fontStyle)??"normal"},fontSize:Me??.01,lineHeight:de,letterSpacing:ce??0,wordSpacing:q??0,textAppearance:ee,color:Z},H=Vt(le,t),De={fontSettings:{fontFamily:V,fontWeight:(me==null?void 0:me.fontWeight)??400,fontStyle:(me==null?void 0:me.fontStyle)??"normal"},fontSize:Fe??.01,lineHeight:Ce,letterSpacing:Ae??0,wordSpacing:ue??0,textAppearance:fe,color:A},_e=on(Vt(De,t)),tt=w.buildColorVars(c,{inputColor:B,inputTextColor:P,inputBorderColor:C,placeholderColor:z!=null&&z.trim()?z:"#cccccc",buttonColor:v,buttonTextColor:_,buttonBorderColor:R,labelTextColor:Z,successColor:A,errorColor:U},Qp,em,oe),[Qe,at]=a.useState(()=>Object.fromEntries(be.map(Ue=>[Ue.name,""]))),[$e,ge]=a.useState("idle"),[je,vt]=a.useState(null),Ye=l==="success"?"success":l==="error"?"error":$e,Oe=l==="error"?D:je,Le=l==="filled",He=a.useMemo(()=>{if(!Le)return Qe;let Ue=null;for(const Ke of be)(Qe[Ke.name]??"").trim().length>0||(Ue=Ue??{...Qe},Ue[Ke.name]="Filled");return Ue??Qe},[Qe,Le,be]),Xe=Ye==="error"?w.getFormFieldValidationError(be,He):null,xt=`${l&&l!=="default"?`${c}-state-${l}`:""}`.trim(),it=o==null?void 0:o.submitUrl,wt=(Ue,Ke)=>{at(Ne=>({...Ne,[Ue]:Ke}))},lt=async Ue=>{if(Ue.preventDefault(),!d)return;const Ke=Object.fromEntries(be.map(pt=>{var mt;return[pt.name,((mt=Qe[pt.name])==null?void 0:mt.trim())??""]}).filter(([,pt])=>pt));if(!it){ge("error"),vt("No integrations were found for this form.");return}if(Object.keys(Ke).length===0)return;const Ne=w.getFormFieldValidationError(be,Qe);if(Ne){ge("error"),vt(Ne);return}ge("submitting"),vt(null);try{const pt=await fetch(it,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ke)});if(!pt.ok){const mt=await pt.text();throw new Error(mt||`Request failed: ${pt.status}`)}ge("success"),at(Object.fromEntries(be.map(mt=>[mt.name,""])))}catch(pt){ge("error"),vt(pt instanceof Error?pt.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${xt}`.trim(),style:tt,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Zp(c)}}),r.jsxs("form",{onSubmit:lt,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:be.map((Ue,Ke)=>r.jsxs(a.Fragment,{children:[Ke>0&&r.jsx("div",{"data-controls":s?"fieldsGap":void 0,className:s?`${c}-control`:void 0,style:{height:w.scalingValue(f??0,t)}}),r.jsxs("div",{className:`${c}-field-group${he?` ${c}-labeled`:""}`,children:[he&&r.jsx("span",{className:`${c}-field-label`,style:H?{...H,lineHeight:H.fontSize}:void 0,children:Ue.label||Ue.name}),Ue.type==="textarea"?r.jsx("textarea",{name:Ue.name,autoComplete:"off",value:He[Ue.name]??"",onChange:Ne=>wt(Ue.name,Ne.target.value),placeholder:Ue.placeholder,className:`${c}-input`,style:te,rows:1,"data-filled":Le||(He[Ue.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:Ue.type==="phone"?"tel":Ue.type==="email"?"email":"text",name:Ue.name,autoComplete:"off",value:He[Ue.name]??"",onChange:Ne=>wt(Ue.name,Ne.target.value),placeholder:Ue.placeholder,required:Ue.isRequired??Ue.type==="email",className:`${c}-input`,style:te,"data-filled":Le||(He[Ue.name]??"").trim().length>0})]})]},Ke))}),r.jsx("div",{"data-controls":s?"gap":void 0,className:s?`${c}-control`:void 0,style:{height:w.scalingValue(L??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:w.scalingValue(h??0,t),borderWidth:Re,paddingTop:w.scalingValue((E==null?void 0:E.top)??0,t),paddingRight:w.scalingValue((E==null?void 0:E.right)??0,t),paddingBottom:w.scalingValue((E==null?void 0:E.bottom)??0,t),paddingLeft:w.scalingValue((E==null?void 0:E.left)??0,t),pointerEvents:d?"auto":void 0,...Y,...I?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:I?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:$e==="submitting"?"...":S})})})]}),Ye==="success"&&r.jsx("p",{className:`${c}-success`,style:{..._e},children:Se}),Ye==="error"&&r.jsx("p",{className:`${c}-error`,style:{..._e},role:"alert",children:Xe??Oe??D})]})}const Qp={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"},em=["hover","focus","filled","success","error"],tm=`import React, { useMemo, useState } from 'react';
|
|
159
159
|
import { CommonComponentProps } from '../props';
|
|
160
160
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
161
161
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -789,7 +789,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
789
789
|
};
|
|
790
790
|
|
|
791
791
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
792
|
-
`,Jp=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],Ho={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Qp=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],em={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...Ho.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:{...Ho.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:{...Ho.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:{...Ho.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:Jp,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#A7A7A7",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:!0,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:.0426,buttonLineHeight:.0426,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{gap:.02604,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.039,buttonPadding:{top:.0195,right:.02604,bottom:.0195,left:.0195},inputPadding:{top:.0195,right:.0195,bottom:.0195,left:.0195},inputFontSize:.02083,inputLineHeight:.02604,buttonFontSize:.02083,buttonLineHeight:.02604,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...Qp],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"]},tm={element:Kp,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300},t:{width:300},m:{width:340}},schema:em,sourceCode:Zp,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Oo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function nm(e){return`
|
|
792
|
+
`,nm=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],jo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},im=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],om={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...jo.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:{...jo.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:{...jo.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:{...jo.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:nm,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#A7A7A7",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:!0,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:.0426,buttonLineHeight:.0426,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{gap:.02604,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.039,buttonPadding:{top:.0195,right:.02604,bottom:.0195,left:.0195},inputPadding:{top:.0195,right:.0195,bottom:.0195,left:.0195},inputFontSize:.02083,inputLineHeight:.02604,buttonFontSize:.02083,buttonLineHeight:.02604,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...im],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"]},rm={element:Jp,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300},t:{width:300},m:{width:340}},schema:om,sourceCode:tm,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Do(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function am(e){return`
|
|
793
793
|
.${e}-wrapper {
|
|
794
794
|
display: flex;
|
|
795
795
|
flex-direction: column;
|
|
@@ -971,16 +971,16 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
971
971
|
align-items: center;
|
|
972
972
|
}
|
|
973
973
|
.${e}-success {
|
|
974
|
-
margin-top: ${
|
|
975
|
-
font-size: ${
|
|
974
|
+
margin-top: ${Do(8)};
|
|
975
|
+
font-size: ${Do(14)};
|
|
976
976
|
color: var(--${e}-success-success-color, var(--${e}-success-color));
|
|
977
977
|
}
|
|
978
978
|
.${e}-error {
|
|
979
|
-
margin-top: ${
|
|
980
|
-
font-size: ${
|
|
979
|
+
margin-top: ${Do(8)};
|
|
980
|
+
font-size: ${Do(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const
|
|
983
|
+
`}const lm=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:l}=w.useScopedStyles(),s=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:b,inputFontSettings:S,inputFontSize:L,inputLineHeight:f,inputLetterSpacing:h,inputWordSpacing:y,inputTextAppearance:E,buttonFontSettings:I,buttonFontSize:T,buttonLineHeight:X,buttonLetterSpacing:k,buttonWordSpacing:B,buttonTextAppearance:P,statusFontSettings:C,statusFontSize:z,statusLineHeight:v,statusLetterSpacing:_,statusWordSpacing:R,statusTextAppearance:Z,iconMaxWidth:A,minHeight:U,corners:V,stroke:G,stateOverrides:ne,inputPadding:$,buttonPadding:M,successMessage:N="Thanks for subscribing!",errorMessage:Q="Please, fill all required fields."}=e,ie=d.slice(0,Math.min(p,d.length)),[F,pe]=a.useState(()=>Object.fromEntries(ie.map(le=>[le.name,""]))),[x,se]=a.useState("idle"),[J,ye]=a.useState(null),Me=o==="success"?"success":o==="error"?"error":x,de=o==="error"?Q:J,ce=o==="filled",q=a.useMemo(()=>{if(!ce)return F;let le=null;for(const H of ie)(F[H.name]??"").trim().length>0||(le=le??{...F},le[H.name]="Filled");return le??F},[ce,F,ie]),ee=Me==="error"?w.getFormFieldValidationError(ie,q):null,me=o&&o!=="default"?`${l}-state-${o}`:"",Fe=ie.some(le=>(q[le.name]??"").trim().length>0),Ce=me!==`${l}-state-filled`&&Fe?`${l}-state-filled`:"",Ae=`${me} ${Ce}`.trim(),ue=i==null?void 0:i.submitUrl,fe=u??"",Se=(c==null?void 0:c.icon)??"",D=(c==null?void 0:c.mode)==="On",oe=fe||"Submit",he={fontSettings:{fontFamily:b,fontWeight:(S==null?void 0:S.fontWeight)??400,fontStyle:(S==null?void 0:S.fontStyle)??"normal"},fontSize:L??.01,lineHeight:f,letterSpacing:h??0,wordSpacing:y??0,textAppearance:E,color:e.inputTextColor??"#111111"},be={fontSettings:{fontFamily:b,fontWeight:(I==null?void 0:I.fontWeight)??400,fontStyle:(I==null?void 0:I.fontStyle)??"normal"},fontSize:T??.01,lineHeight:X,letterSpacing:k??0,wordSpacing:B??0,textAppearance:P,color:e.buttonTextColor??"#ffffff"},Ie={fontSettings:{fontFamily:b,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:z??.01,lineHeight:v,letterSpacing:_??0,wordSpacing:R??0,textAppearance:Z,color:e.successColor??"#22c55e"},xe=on(Vt(he,t)),W=on(Vt(be,t)),ae=on(Vt(Ie,t)),te=w.buildColorVars(l,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(he==null?void 0:he.color)??"#111111",buttonTextColor:e.buttonTextColor??(be==null?void 0:be.color)??"#ffffff"},sm,cm,ne),j={borderRadius:w.scalingValue(V,t),borderWidth:w.scalingValue(G,t),borderStyle:"solid"},Y={borderLeftWidth:w.scalingValue(G,t)},Re=async le=>{if(le.preventDefault(),!s)return;const H=Object.fromEntries(ie.map(_e=>{var tt;return[_e.name,((tt=F[_e.name])==null?void 0:tt.trim())??""]}).filter(([,_e])=>_e));if(!ue){se("error"),ye("No integrations were found for this form.");return}if(Object.keys(H).length===0)return;const De=w.getFormFieldValidationError(ie,F);if(De){se("error"),ye(De);return}se("submitting"),ye(null);try{const _e=await fetch(ue,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)});if(!_e.ok){const tt=await _e.text();throw new Error(tt||`Request failed: ${_e.status}`)}se("success"),pe(Object.fromEntries(ie.map(tt=>[tt.name,""])))}catch(_e){se("error"),ye(_e instanceof Error?_e.message:"Something went wrong")}};return r.jsxs("div",{className:`${l}-wrapper ${Ae}`.trim(),style:te,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:am(l)}}),r.jsxs("form",{onSubmit:Re,className:`${l}-form`,style:{...j,height:w.scalingValue(U,t),minHeight:w.scalingValue(U,t)},children:[r.jsx("div",{className:`${l}-inputWrap ${l}-overlayAnchor`,style:{flex:1,minWidth:0},children:ie.map(le=>r.jsx("input",{type:le.type==="email"?"email":le.type==="phone"?"tel":"text",name:le.name,autoComplete:"off",value:q[le.name]??"",onChange:H=>pe(De=>({...De,[le.name]:H.target.value})),placeholder:le.placeholder,required:le.isRequired??le.type==="email",className:`${l}-input`,style:{...xe,paddingRight:w.scalingValue($.right,t),paddingLeft:w.scalingValue($.left,t),paddingTop:w.scalingValue($.top,t),paddingBottom:w.scalingValue($.bottom,t)}},le.name))}),r.jsx("div",{className:`${l}-overlayAnchor`,children:r.jsx("button",{type:s?"submit":"button",className:`${l}-submitBtn`,"aria-label":oe,style:{...W,...Y,paddingRight:w.scalingValue(M.right,t),paddingLeft:w.scalingValue(M.left,t),paddingTop:w.scalingValue(M.top,t),paddingBottom:w.scalingValue(M.bottom,t),pointerEvents:s?"auto":void 0},children:x==="submitting"?"...":D?Se&&r.jsx(rn,{url:Se,className:`${l}-submitBtnIcon`,style:{maxWidth:w.scalingValue(A??0,t)},fill:`var(--${l}-button-text-color)`,hoverFill:`var(--${l}-button-text-color)`}):fe})})]}),Me==="success"&&r.jsx("p",{className:`${l}-success`,style:{...ae},children:N}),Me==="error"&&r.jsx("p",{className:`${l}-error`,style:{...ae},role:"alert",children:ee??de??Q})]})},sm={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"},cm=["hover","focus","filled","success","error"],dm=`import React, { useMemo, useState } from 'react';
|
|
984
984
|
import { CommonComponentProps } from '../props';
|
|
985
985
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
986
986
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1557,7 +1557,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1557
1557
|
};
|
|
1558
1558
|
|
|
1559
1559
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1560
|
-
`,sm="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>'),lm=[{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."}],jr={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},cm=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],dm={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...jr.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:{...jr.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:{...jr.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:lm,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:sm},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:.0053,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},t:{minHeight:.0651,iconMaxWidth:.1,stroke:.001,corners:.0026,buttonPadding:{top:.02604,right:.02604,bottom:.02604,left:.02604},inputPadding:{top:.02604,right:.02604,bottom:.02604,left:.0182},inputFontSize:.0208,inputLineHeight:.02604,buttonFontSize:.0208,buttonLineHeight:.02604,statusFontSize:.0208,statusLineHeight:.02604},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:.0027,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...cm],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"]},um={element:im,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},t:{width:500},m:{width:340}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:dm,sourceCode:am};function pm(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1560
|
+
`,um="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>'),pm=[{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."}],zr={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},mm=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],gm={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...zr.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:{...zr.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:{...zr.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:pm,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:um},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:.0053,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},t:{minHeight:.0651,iconMaxWidth:.1,stroke:.001,corners:.0026,buttonPadding:{top:.02604,right:.02604,bottom:.02604,left:.02604},inputPadding:{top:.02604,right:.02604,bottom:.02604,left:.0182},inputFontSize:.0208,inputLineHeight:.02604,buttonFontSize:.0208,buttonLineHeight:.02604,statusFontSize:.0208,statusLineHeight:.02604},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:.0027,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...mm],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"]},hm={element:lm,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},t:{width:500},m:{width:340}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:gm,sourceCode:dm};function fm(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1561
1561
|
.${e}-marquee-wrapper {
|
|
1562
1562
|
overflow: hidden;
|
|
1563
1563
|
width: 100%;
|
|
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1689
1689
|
.${e}-image-hover-grayscale:hover video {
|
|
1690
1690
|
filter: grayscale(100%);
|
|
1691
1691
|
}
|
|
1692
|
-
`}const
|
|
1692
|
+
`}const ym=30,vm=20,Br=3,xm=12,bm=32,wm=3,Sm=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},$m=(e,t)=>Array.from({length:t},()=>e).flat(),Cm=e=>typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"16:9",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"16:9",reversed:(e==null?void 0:e.reversed)??!1},uc=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Ll=(e,t)=>{if(t<=0||e.children.length<t)return 0;const n=e.children[0],i=e.children[t-1];if(!n||!i)return 0;const o=getComputedStyle(e),l=Number.parseFloat(o.columnGap||o.gap||"0")||0,s=i.getBoundingClientRect().right-n.getBoundingClientRect().left;if(s>0)return s;const d=Array.from({length:t},(u,p)=>e.children[p]),c=uc(d);return c<=0?0:c+l*Math.max(0,t-1)},Tm=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=uc(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),l=Number.parseFloat(o.columnGap||o.gap||"0")||0,s=Number.parseFloat(o.paddingRight)||0;return i+l*Math.max(0,e.children.length-1)+s},Lm=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Im=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Lm(i,e))},Rm=e=>{if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url??"")},Mm=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Em=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:l,imageHoverClass:s,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var R,Z,A,U;const p=a.useRef(null),b=!!((R=e.image)!=null&&R.url&&Rm(e.image));a.useLayoutEffect(()=>{d&&Mm(p.current)&&(u==null||u())},[d,(Z=e.image)==null?void 0:Z.url,u]);const S=n.display==="cover",L=n.ratioValue??"1:1",f=n.reversed??!1,[h,y]=L.split(":").map(Number),T=(f?y:h)/(f?h:y),X=i/T,k=X>o?o:X,B=X>o?o*T:i,P=c(B),C=c(k),z={borderRadius:c(l)},v=S?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...z}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...z},_=((A=e.image)==null?void 0:A.url)&&(b?r.jsx("video",{ref:V=>{p.current=V},src:e.image.url,style:v,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):r.jsx("img",{ref:V=>{p.current=V},src:e.image.url,alt:((U=e.image)==null?void 0:U.name)??"",style:v,onLoad:d?u:void 0,onError:d?u:void 0}));return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...S?{width:P}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:r.jsx("div",{className:s,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...S?{width:P,height:C,overflow:"hidden",...z}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:_&&e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:ct(`${t}-marquee-link`,!S&&`${t}-marquee-link-contain`),children:_}):_})})},Pm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=w.useScopedStyles(),[s,d]=a.useState(0),c=s>0?Math.round(s):0,u=a.useMemo(()=>fm(l,c),[l,c]),{speed:p,direction:b,pauseOnHover:S,gap:L,imageMaxWidth:f,imageMaxHeight:h,hoverEffect:y,cornerRadius:E=0}=e,I=a.useMemo(()=>Cm(e.imageFit),[e.imageFit]),T=(t==null?void 0:t.length)??0,X=!!o,k=!n||!!i,B=k&&y!=="off"&&y!=="randomize"?`${l}-image-hover-${y}`:void 0,P=n?!!i:!0,z=((t==null?void 0:t.length)??0)>0&&(P||!!n),v=Math.max(0,p)*ym,_=Ce=>w.scalingValue(Ce,n??!1),R=a.useRef(null),Z=a.useRef(null),A=a.useRef(null),[U,V]=a.useState(0),G=P&&S==="on",[ne,$]=a.useState(!1),[M,N]=a.useState({}),Q=a.useRef(M);Q.current=M;const ie=a.useRef(null),F=a.useRef(0),pe=a.useRef(null),x=a.useMemo(()=>(t??[]).map(Ce=>{var Ae;return((Ae=Ce.image)==null?void 0:Ae.url)??""}).join("\0"),[t]),[se,J]=a.useState(Br),ye=a.useMemo(()=>{const Ce=t??[];return Ce.length===0||!(P||!!n)?Ce:$m(Ce,se)},[t,P,se,n]),Me=a.useMemo(()=>(t??[]).filter(Ce=>{var Ae;return!!((Ae=Ce.image)!=null&&Ae.url)}).length,[t]),de=z?wm:1;a.useLayoutEffect(()=>{F.current=0,N({}),ie.current=null,J(Br),d(0)},[x]),a.useEffect(()=>{if(!k||y!=="randomize")return;const Ce=R.current;if(!Ce)return;const Ae=D=>{N(oe=>{const he=Array.from(D).filter(Ie=>Ie in oe&&!Im(Ce,Ie));if(he.length===0)return oe;const be={...oe};return he.forEach(Ie=>{delete be[Ie]}),be})},ue=new IntersectionObserver(D=>{const oe=new Set;for(const he of D){const be=he.target.dataset.marqueeItemIndex,Ie=be!==void 0?Number(be):NaN;Number.isNaN(Ie)||oe.add(Ie)}oe.size>0&&Ae(oe)},{root:Ce,threshold:0});Object.keys(M).forEach(D=>{const oe=Number(D);Ce.querySelectorAll(`[data-marquee-item-index="${oe}"]`).forEach(he=>ue.observe(he))});const fe={current:0},Se=()=>{const D=Object.keys(Q.current);D.length!==0&&(Ae(D.map(Number)),fe.current=requestAnimationFrame(Se))};return Object.keys(Q.current).length>0&&(fe.current=requestAnimationFrame(Se)),()=>{cancelAnimationFrame(fe.current),ue.disconnect()}},[y,M,k]),a.useLayoutEffect(()=>{if(!z)return;const Ce=R.current,Ae=A.current;if(!Ce||!Ae)return;const ue={current:0},fe=()=>{const oe=Ce.getBoundingClientRect().width||Ce.offsetWidth,he=Tm(Ae),be=ie.current,Ie=typeof be=="number"&&Math.abs(be-he)<=.25;ie.current=he;let xe=se,W=0;if((P||n)&&T>0&&oe>0){const j=Ll(Ae,T);if(j>=bm){W=j;const Y=Math.min(xm,Math.max(Br,Math.ceil(oe/j)+1));xe=Y,Y!==se&&J(Y)}}const te=xe!==se&&W>0?W*xe:he>0?he:W>0?W*xe:(()=>{const j=Ll(Ae,T);return j>0?j*xe:0})();te>0?d(j=>j<=0?te:!Ie||Math.round(j)===Math.round(te)?j:te):!Ie&&s<=0&&(cancelAnimationFrame(ue.current),ue.current=requestAnimationFrame(fe))},Se=()=>{cancelAnimationFrame(ue.current),ue.current=requestAnimationFrame(fe)};pe.current=Se,Se();const D=new ResizeObserver(Se);return D.observe(Ce),D.observe(Ae),()=>{pe.current=null,cancelAnimationFrame(ue.current),D.disconnect()}},[P,z,s,x,se,T,n]),a.useLayoutEffect(()=>{if(!z||c<=0)return;const Ce=Z.current;Ce&&Sm(Ce)},[z,c,b,v]),a.useLayoutEffect(()=>{if(!z||s<=0){V(0);return}const Ce=Z.current,Ae=A.current;if(!Ce||!Ae)return;const ue=()=>{const Se=Ce.offsetHeight||Ce.getBoundingClientRect().height,D=Array.from(Ae.children).reduce((he,be)=>Math.max(he,be.offsetHeight||be.getBoundingClientRect().height),0),oe=Se>0?Se:D;V(oe>0?oe:0)};ue();const fe=new ResizeObserver(ue);return fe.observe(Ce),fe.observe(Ae),()=>fe.disconnect()},[z,de,ye,n,L,f,h,s,I,M]),a.useLayoutEffect(()=>{if(!n||!X||!z||typeof window>"u")return;const Ce=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(Ce)},[n,X,z,b,s,U,L,ye]);const ce=()=>{G&&$(!0)},q=()=>{G&&$(!1)},ee=a.useCallback(()=>{var Ce;F.current=Math.min(Me,F.current+1),(Ce=pe.current)==null||Ce.call(pe)},[Me]),me=a.useCallback((Ce,Ae)=>{N(ue=>{const fe=ue[Ce]??Ae,Se=(t??[]).filter(oe=>oe!==fe);if(Se.length===0)return ue;const D=Se[Math.floor(Math.random()*Se.length)];return{...ue,[Ce]:D}})},[t]),Fe=(Ce,Ae,ue,fe)=>{const Se=k&&y==="randomize"&&I.display==="cover"?M[ue]??Ce:Ce,D=`max(${_(L)}, ${vm}px)`,oe=`calc(-0.5 * (${D} + ${_(L)}))`;return r.jsxs("div",{className:`${l}-marquee-card`,"data-marquee-item-index":ue,onMouseEnter:k&&y==="randomize"&&I.display==="cover"?()=>me(ue,Ce):void 0,children:[r.jsx(Em,{item:Se,prefix:l,imageFit:I,imageMaxWidth:f,imageMaxHeight:h,cornerRadius:E,imageHoverClass:B,isEditor:n,isFirstSet:fe,scaled:_,onFirstSetImageDone:ee}),X&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${l}-gap-control`,style:{position:"absolute",top:0,right:oe,width:D,height:"100%"}})]},`${Ae}-${ue}`)};if(z){const Ce=P?G&&ne?"paused":"running":"paused",Ae=c>0&&v>0?c/v*1e3:0,ue=`${Math.max(0,Ae)/1e3}s`;return r.jsxs("div",{ref:R,className:ct(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Marquee",style:U>0?{height:U}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{ref:Z,className:`${l}-marquee-track`,"data-direction":b,onMouseEnter:ce,onMouseLeave:q,style:{WebkitAnimationDuration:ue,animationDuration:ue,WebkitAnimationPlayState:Ce,animationPlayState:Ce},children:Array.from({length:de},(fe,Se)=>r.jsx("div",{ref:Se===0?A:void 0,className:ct(`${l}-marquee-row`,`${l}-marquee-set`),style:{gap:_(L),paddingRight:_(L)},"aria-hidden":Se>0,children:ye.map((D,oe)=>Fe(D,Se,oe,Se===0&&oe<T))},`set-${Se}`))})]})}return r.jsxs("div",{ref:R,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{className:ct(`${l}-marquee-row`,`${l}-marquee-static`),style:{gap:_(L),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Ce,Ae)=>Fe(Ce,0,Ae))},"marquee-static")]})},km=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
1693
1693
|
import cn from 'classnames';
|
|
1694
1694
|
import { CommonComponentProps } from '../props';
|
|
1695
1695
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2472,7 +2472,7 @@ type MarqueeProps = {
|
|
|
2472
2472
|
isPreviewMode?: boolean;
|
|
2473
2473
|
isEditMode?: boolean;
|
|
2474
2474
|
} & CommonComponentProps;
|
|
2475
|
-
`,
|
|
2475
|
+
`,Am={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,display:{type:"numeric-input"}},imageFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.8,cornerRadius:0},t:{speed:1.64,gap:.02,imageMaxWidth:.5208,imageMaxHeight:.5208,cornerRadius:0},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278,cornerRadius:0}},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","cornerRadius"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["cornerRadius"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""},link:""}]}},Fm={element:Pm,id:"marquee",name:"Simple Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple-Marquee.mp4"},schema:Am,sourceCode:km,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function Wm(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
2476
2476
|
.${e}-marquee-wrapper {
|
|
2477
2477
|
overflow: hidden;
|
|
2478
2478
|
width: 100%;
|
|
@@ -2561,7 +2561,7 @@ type MarqueeProps = {
|
|
|
2561
2561
|
pointer-events: auto;
|
|
2562
2562
|
z-index: 10;
|
|
2563
2563
|
}
|
|
2564
|
-
`}const
|
|
2564
|
+
`}const _m=30,Il=2,Nm=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},Hm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=w.useScopedStyles(),{align:s,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:b,corners:S,stroke:L,strokeColor:f,bgColor:h,padding:y,logoMarginTop:E,logoWidth:I,logoHeight:T,captionMarginTop:X}=e,k=!!o,B=((t==null?void 0:t.length)??0)>0,P=d>0&&(!n||i),C=B&&(P||n),z=Math.max(0,d)*_m,v=W=>w.scalingValue(W,n??!1),_=a.useRef(null),R=a.useRef(null),Z=a.useRef(null),[A,U]=a.useState(0),[V,G]=a.useState(0),ne=V>0?V:0,$=a.useMemo(()=>Wm(l,ne),[l,ne]),[M,N]=a.useState(0),Q=P&&u==="on",[ie,F]=a.useState(!1),pe=a.useRef(null),[x,se]=a.useState(0),[J,ye]=a.useState(0),Me=a.useRef(null),de=W=>{var te,j,Y,Re,le;return{fontSettings:{fontFamily:(e==null?void 0:e[`${W}FontFamily`])??"Arial",fontWeight:((te=e==null?void 0:e[`${W}FontSettings`])==null?void 0:te.fontWeight)??400,fontStyle:((j=e==null?void 0:e[`${W}FontSettings`])==null?void 0:j.fontStyle)??"normal"},textAppearance:{textTransform:((Y=e==null?void 0:e[`${W}TextAppearance`])==null?void 0:Y.textTransform)??"none",textDecoration:((Re=e==null?void 0:e[`${W}TextAppearance`])==null?void 0:Re.textDecoration)??"none",fontVariant:((le=e==null?void 0:e[`${W}TextAppearance`])==null?void 0:le.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${W}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${W}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${W}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${W}LineHeight`])??.01,color:(e==null?void 0:e[`${W}Color`])??"#000000"}},ce=de("text"),q=de("caption"),ee=a.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(W=>{var ae,te;return(((ae=W.text)==null?void 0:ae.length)??0)>0||(((te=W.caption)==null?void 0:te.length)??0)>0}),[t]),me=a.useMemo(()=>!C||(t==null?void 0:t.length)===0?1:V<=0||A<=0?Il:Math.max(Il,Math.ceil(A/V)+1),[C,t==null?void 0:t.length,V,A]);a.useLayoutEffect(()=>{if(!C)return;const W=_.current,ae=Z.current;if(!W||!ae)return;let te=0;const j=()=>{const le=W.getBoundingClientRect().width,H=ae.getBoundingClientRect().width,De=Me.current,_e=typeof De=="number"&&Math.abs(De-H)<=.25;if(Me.current=H,U(le),typeof H=="number"&&H>0&&V<=0){G(H);return}_e&&H!==V?G(H):!_e&&V<=0&&(cancelAnimationFrame(te),te=requestAnimationFrame(j))},Y=()=>{cancelAnimationFrame(te),te=requestAnimationFrame(j)};Y();const Re=new ResizeObserver(Y);return Re.observe(W),Re.observe(ae),()=>{cancelAnimationFrame(te),Re.disconnect()}},[P,C,V]);const Fe=ne>0&&z>0?ne/z*1e3:0,Ce=`${Math.max(0,Fe)/1e3}s`;a.useLayoutEffect(()=>{if(!C||ne<=0)return;const W=R.current;W&&Nm(W)},[C,ne,c]),a.useLayoutEffect(()=>{if(!C){N(0);return}const W=Z.current,ae=R.current;if(!W||!ae)return;const te=()=>{let Y=0;for(let Re=0;Re<W.children.length;Re++){const H=W.children[Re].firstElementChild;H&&(Y=Math.max(Y,H.offsetHeight))}Y<=0&&(Y=ae.offsetHeight),N(Y>0?Y:0)};te();const j=new ResizeObserver(te);return j.observe(W),j.observe(ae),()=>{j.disconnect()}},[C,me,t,n,p,b,y,L,S,I,T,x,J]);const Ae=()=>{Q&&F(!0)},ue=()=>{Q&&F(!1)},fe=a.useMemo(()=>{switch(s){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[s]),Se=a.useMemo(()=>{switch(s){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[s]),D=a.useCallback((W,ae,te,j)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:fe,width:"100%"},children:[r.jsx("div",{"data-controls":k?j==null?void 0:j.controlsName:void 0,"data-controls-axis":k?"y":void 0,className:k?`${l}-control`:void 0,style:{height:v((j==null?void 0:j.marginTop)??0)}}),r.jsx("div",{...j!=null&&j.dataMeasureKind?{"data-testimonial-measure":j.dataMeasureKind}:{},style:{...Vt(W,n),textAlign:Se,pointerEvents:"auto",...typeof(j==null?void 0:j.minHeightPx)=="number"&&j.minHeightPx>0?{minHeight:j.minHeightPx}:{}},children:r.jsx(yi,{content:ae})})]},te),[fe,Se,n,k,l,v]),oe=a.useCallback((W,ae,te)=>{var j,Y,Re;return r.jsxs("div",{style:{padding:`${v(y.top)} ${v(y.right)} ${v(y.bottom)} ${v(y.left)}`,width:v(b+L*2),height:"100%",borderRadius:v(S),border:`${v(L)} solid ${f}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${l}-cover`,style:{background:h}}),r.jsxs("div",{className:`${l}-elements-overlay`,style:{alignItems:fe,textAlign:Se},children:[W.text&&D(ce,W.text,"text",te!=null&&te.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(te==null?void 0:te.textMinHeightPx)=="number"&&te.textMinHeightPx>0?{minHeightPx:te.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:fe,width:"100%"},children:[r.jsx("div",{"data-controls":k&&!(te!=null&&te.dataMeasureAttrs)?"logoMarginTop":void 0,className:k&&!(te!=null&&te.dataMeasureAttrs)?`${l}-control`:void 0,style:{height:v(E)}}),r.jsx("div",{style:{width:v(I),height:v(T)},children:((j=W.logo)==null?void 0:j.url)&&r.jsx("img",{src:W.logo.url,alt:((Y=W.logo)==null?void 0:Y.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Re=W.logo)==null?void 0:Re.objectFit)||"contain"}})})]}),W.caption&&D(q,W.caption,"caption",{...te!=null&&te.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:X,...te!=null&&te.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(te==null?void 0:te.captionMinHeightPx)=="number"&&te.captionMinHeightPx>0?{minHeightPx:te.captionMinHeightPx}:{}})]})]},ae)},[h,X,q,b,S,T,E,I,fe,Se,y.bottom,y.left,y.right,y.top,D,L,f,ce,n,k,l]),he=a.useCallback(W=>{se(W.maxTextPx),ye(W.maxCaptionPx)},[]);a.useLayoutEffect(()=>{if(!ee){he({maxTextPx:0,maxCaptionPx:0});return}const W=pe.current;if(!W)return;const ae=()=>{w.readTestimonialTextMeasure(W,he)};ae();const te=new ResizeObserver(ae);return te.observe(W),()=>{te.disconnect()}},[ee,he,t,oe]);const be=ee?{textMinHeightPx:x,captionMinHeightPx:J}:void 0,Ie=ee?r.jsx("div",{ref:pe,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((W,ae)=>oe(W,`measure-${ae}`,{dataMeasureAttrs:!0}))}):null,xe=(W,ae)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[oe(W,`card-${ae}`,be),k&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${v(p)})`,width:v(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},ae);if(C){const W=P?Q&&ie?"paused":"running":"paused";return r.jsxs("div",{ref:_,className:ct(`${l}-wrapper`,`${l}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...M>0?{height:M}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),Ie,r.jsx("div",{ref:R,className:`${l}-marquee-track`,"data-direction":c,onMouseEnter:Ae,onMouseLeave:ue,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",animationDuration:Ce,WebkitAnimationDuration:Ce,animationPlayState:W,WebkitAnimationPlayState:W},children:Array.from({length:me},(ae,te)=>r.jsx("div",{ref:te===0?Z:void 0,className:`${l}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:v(p),paddingRight:v(p)},"aria-hidden":te>0,children:t==null?void 0:t.map((j,Y)=>xe(j,`${te}-${Y}`))},`set-${te}`))})]})}return r.jsxs("div",{className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),Ie,r.jsx("div",{style:{gap:v(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((W,ae)=>xe(W,ae))})]})},Om=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2565
2565
|
import cn from 'classnames';
|
|
2566
2566
|
import { CommonComponentProps } from '../props';
|
|
2567
2567
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3192,7 +3192,7 @@ type TestimonialsSettings = {
|
|
|
3192
3192
|
logoHeight: number;
|
|
3193
3193
|
captionMarginTop: number;
|
|
3194
3194
|
};
|
|
3195
|
-
`,
|
|
3195
|
+
`,Rl={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},jm={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Caption Default",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:{...Rl.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:{...Rl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}}},defaults:{direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.069,textLineHeight:.093,captionFontSize:.053,captionLineHeight:.069},t:{speed:1.64,gap:.02,cardWidth:.44,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.065,left:.01},logoMarginTop:.1,logoWidth:.052,logoHeight:.052,captionMarginTop:.005,textFontSize:.035,textLineHeight:.04,captionFontSize:.023,captionLineHeight:.029},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["align","direction"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners"]},{type:"group",title:"",items:["stroke","padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{logo:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Dm={element:Hm,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:jm,sourceCode:Om,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function zm(e){return`
|
|
3196
3196
|
.${e}-container {
|
|
3197
3197
|
position: relative;
|
|
3198
3198
|
overflow-x: clip;
|
|
@@ -3316,7 +3316,7 @@ type TestimonialsSettings = {
|
|
|
3316
3316
|
width: 100%;
|
|
3317
3317
|
height: 100%;
|
|
3318
3318
|
}
|
|
3319
|
-
`}const
|
|
3319
|
+
`}const Bm=3e3,Vm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:l}=w.useScopedStyles(),s=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:b,captionMarginTop:S,imageWidth:L,imageHeight:f,controlsWidth:h,controlsColor:y,controlsHoverColor:E}=e,I=d>0&&(!n||!!i),[T,X]=a.useState(0),[k,B]=a.useState(null),[P,C]=a.useState(!1),z=a.useRef(null),v=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),_=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);a.useEffect(()=>{X(0),B(null),C(!1)},[s.length]);const R=s[T],Z=k===null?null:s[k],A=de=>{var q,ee,me,Fe,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${de}FontFamily`])??"Arial",fontWeight:((q=e==null?void 0:e[`${de}FontSettings`])==null?void 0:q.fontWeight)??400,fontStyle:((ee=e==null?void 0:e[`${de}FontSettings`])==null?void 0:ee.fontStyle)??"normal"},textAppearance:{textTransform:((me=e==null?void 0:e[`${de}TextAppearance`])==null?void 0:me.textTransform)??"none",textDecoration:((Fe=e==null?void 0:e[`${de}TextAppearance`])==null?void 0:Fe.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${de}TextAppearance`])==null?void 0:Ce.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${de}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${de}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${de}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${de}WordSpacing`])??0,color:(e==null?void 0:e[`${de}Color`])??"#000000"}},U=A("text"),V=A("caption"),G=s.length>1&&s.some(de=>{var ce,q;return(((ce=de.text)==null?void 0:ce.length)??0)>0||(((q=de.caption)==null?void 0:q.length)??0)>0}),ne=a.useRef(null),[$,M]=a.useState(0),[N,Q]=a.useState(0),ie=e.controls??{mode:"Off",icon:null},F=s.length>1,pe=a.useCallback((de,ce)=>!F||ce===de?de:(z.current&&window.clearTimeout(z.current),B(de),C(!0),z.current=window.setTimeout(()=>{B(null),C(!1),z.current=null},300),ce),[F]),x=a.useCallback(()=>{F&&X(de=>pe(de,(de-1+s.length)%s.length))},[F,pe,s.length]),se=a.useCallback(()=>{F&&X(de=>pe(de,(de+1)%s.length))},[F,pe,s.length]);a.useEffect(()=>{if(!I||!F)return;const de=Math.max(300,Bm/d),ce=window.setInterval(()=>{X(q=>pe(q,(q+1)%s.length))},de);return()=>{window.clearInterval(ce)}},[I,F,pe,s.length,d]),a.useEffect(()=>()=>{z.current&&window.clearTimeout(z.current)},[]);const J=(de,ce)=>{var Ce,Ae,ue,fe;const q=ce==null?void 0:ce.textMinHeightPx,ee=ce==null?void 0:ce.captionMinHeightPx,me=ce==null?void 0:ce.dataMeasureAttrs,Fe=o&&!(ce!=null&&ce.dataMeasureAttrs)&&!(ce!=null&&ce.hideControls);return r.jsxs(r.Fragment,{children:[de.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:v,width:"100%"},children:[r.jsx("div",{"data-controls":Fe?"textMarginTop":void 0,className:Fe?`${l}-control`:void 0,style:{height:w.scalingValue(b??0,n??!1)}}),r.jsx("div",{...me&&{"data-testimonial-measure":"text"},style:{...Vt(U,n),...q&&q>0?{minHeight:q}:{},textAlign:_,pointerEvents:"auto"},children:r.jsx(yi,{content:de.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:v,width:"100%"},children:[r.jsx("div",{"data-controls":Fe?"imageMarginTop":void 0,className:Fe?`${l}-control`:void 0,style:{height:w.scalingValue(p??0,n??!1)}}),r.jsx("div",{style:{width:w.scalingValue(L??0,n??!1),height:w.scalingValue(f??0,n??!1)},children:((Ce=de.image)==null?void 0:Ce.url)&&r.jsx("img",{src:(Ae=de.image)==null?void 0:Ae.url,alt:((ue=de.image)==null?void 0:ue.name)??"",className:`${l}-icon`,style:{objectFit:((fe=de.image)==null?void 0:fe.objectFit)||"contain"}})})]}),de.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:v,width:"100%"},children:[r.jsx("div",{"data-controls":Fe?"captionMarginTop":void 0,className:Fe?`${l}-control`:void 0,style:{height:w.scalingValue(S??0,n??!1)}}),r.jsx("div",{...me?{"data-testimonial-measure":"caption"}:{},style:{...Vt(V,n),...ee&&ee>0?{minHeight:ee}:{},textAlign:_,pointerEvents:"auto"},children:r.jsx(yi,{content:de.caption})})]})]})},ye=a.useCallback(de=>{M(de.maxTextPx),Q(de.maxCaptionPx)},[]);if(a.useLayoutEffect(()=>{if(!G){ye({maxTextPx:0,maxCaptionPx:0});return}const de=ne.current;if(!de)return;const ce=()=>{w.readTestimonialTextMeasure(de,ye)};ce();const q=new ResizeObserver(ce);return q.observe(de),()=>{q.disconnect()}},[G,ye,t]),!R)return r.jsx(r.Fragment,{});const Me=G?{textMinHeightPx:$,captionMinHeightPx:N}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${l}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:zm(l)}}),r.jsxs("div",{className:`${l}-wrapper`,style:{width:w.scalingValue(u??0,n??!1),alignItems:v},children:[G&&r.jsx("div",{ref:ne,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:s.map((de,ce)=>r.jsx("div",{style:{width:"100%"},children:J(de,{dataMeasureAttrs:!0})},ce))}),r.jsxs("div",{className:`${l}-fade-stack`,children:[Z&&P&&r.jsx("div",{className:ct(`${l}-fade-item-prev`,`${l}-fade-out`),children:J(Z,{...Me,hideControls:!0})}),r.jsx("div",{className:ct(`${l}-fade-item-current`,P?`${l}-fade-in`:void 0),children:J(R,Me)})]})]}),ie.mode==="On"&&r.jsxs("div",{className:`${l}-controls`,children:[r.jsx("div",{className:`${l}-arrow`,style:{width:w.scalingValue(h??.02,n??!1),height:w.scalingValue(h??.02,n??!1),"--arrow-hover-color":E},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:x,disabled:!F,"aria-label":"Previous testimonial",children:ie.icon&&r.jsx(rn,{url:ie.icon,fill:y,hoverFill:E,className:ct(`${l}-arrow-img`,`${l}-mirror`)})})}),r.jsx("div",{className:ct(`${l}-arrow`,`${l}-next-arrow`),style:{width:w.scalingValue(h??.02,n??!1),height:w.scalingValue(h??.02,n??!1),"--arrow-hover-color":E},children:r.jsx("button",{type:"button",className:`${l}-arrow-inner`,onClick:se,disabled:!F,"aria-label":"Next testimonial",children:ie.icon&&r.jsx(rn,{url:ie.icon,fill:y,hoverFill:E,className:`${l}-arrow-img`})})})]})]})})},Gm=`import cn from 'classnames';
|
|
3320
3320
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3321
3321
|
import { CommonComponentProps } from '../props';
|
|
3322
3322
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -3812,12 +3812,12 @@ type TestimonialsSettings = {
|
|
|
3812
3812
|
icon?: string | null;
|
|
3813
3813
|
};
|
|
3814
3814
|
};
|
|
3815
|
-
`,
|
|
3815
|
+
`,qm="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>'),Ml={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Um={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",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:{...Ml.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:"Caption Default"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Ml.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:"Text Default"}},defaults:{controls:{mode:"On",icon:qm},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{speed:1,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},t:{speed:1,width:.65,imageMarginTop:.026,captionMarginTop:.01,textMarginTop:0,textFontSize:.035,captionFontSize:.023,textLineHeight:.04,captionLineHeight:.029,imageWidth:.05,imageHeight:.05,controlsWidth:.026},d:{speed:1,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},layout:["__componentName__","speed","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","speed"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},Km={element:Vm,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},t:{width:700},m:{width:334}},schema:Um,sourceCode:Gm,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Xm(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function El(e){return((e==null?void 0:e.trim().length)??0)>0}function Vr(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Gr(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:w.scalingValue((o-t)/2,i)}}function Ym(e){return`
|
|
3816
3816
|
.${e}-wrapper {
|
|
3817
3817
|
display: grid;
|
|
3818
3818
|
align-items: start;
|
|
3819
3819
|
justify-content: center;
|
|
3820
|
-
min-height: ${
|
|
3820
|
+
min-height: ${Xm(48)};
|
|
3821
3821
|
}
|
|
3822
3822
|
.${e}-item {
|
|
3823
3823
|
display: flex;
|
|
@@ -4155,7 +4155,7 @@ type TestimonialsSettings = {
|
|
|
4155
4155
|
z-index: 2;
|
|
4156
4156
|
width: 100%;
|
|
4157
4157
|
}
|
|
4158
|
-
`}const Sn=500,Um=750,Nn="cubic-bezier(0.22, 1, 0.36, 1)",Km=72,Xm=50;function Ym(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function Zm(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Jm(e){const[t]=e.media;return t!=null&&t.url?t:null}function Qm(e){return!Array.isArray(e)||e.length===0?[]:Ym(e)?e.flatMap(t=>{const n=Zm(t);if(!n)return[];const i=Jm(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ei(e){return e.type==="video"}function eg(e){e.pause(),e.removeAttribute("src"),e.load()}function ks({media:e,className:t,style:n,onMediaClick:i}){return Ei(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Ps(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function tg(e,t){if(!t||!t.width||!t.height||!e.width||!e.height)return e;const n=t.width/t.height,i=e.width/e.height;if(n>i){const s=e.width/n;return{width:e.width,height:s,left:e.left,top:e.top+(e.height-s)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function ng({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l}){return a.useEffect(()=>{const d=n.current;if(d)return()=>{eg(d)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,style:i})}function ig({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",w=a.useRef(null),v=a.useRef(null),T=a.useRef(null),g=a.useRef(null),$=a.useRef(0),f=a.useRef(0),R=a.useRef("none"),L=a.useRef(!1),I=a.useRef(!1),Y=a.useRef(null),P=a.useRef(0),V=a.useRef(null),M=a.useRef(!1),C=a.useRef(null),[A,y]=a.useState(null),[S,F]=a.useState(null),[W,U]=a.useState("opening"),[G,J]=a.useState(0),[D,j]=a.useState(0),[O,E]=a.useState(null),[K,Z]=a.useState(!1),[ce,N]=a.useState(!1),[pe,b]=a.useState(!1),[he,Q]=a.useState(null),we=a.useRef(n),Te=t[n],se=Te?Ei(Te):!1,oe=O!==null,q=a.useCallback(Ie=>{const ee=Ie.currentTarget,ne=ee instanceof HTMLVideoElement?{width:ee.videoWidth,height:ee.videoHeight}:{width:ee.naturalWidth,height:ee.naturalHeight};!ne.width||!ne.height||Q(ne)},[]);a.useEffect(()=>{Y.current=S},[S]),a.useEffect(()=>{const Ie=w.current;if(!Ie)return;const ee=()=>F(Ps(Ie));ee();const ne=new ResizeObserver(ee);return ne.observe(Ie),()=>ne.disconnect()},[]);const de=a.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),ge=a.useCallback(()=>{de(),P.current=0,V.current=null,M.current=!1,j(0),E(null),Z(!1)},[de]),_e=a.useCallback(Ie=>{ge(),Ie===1?d():l()},[d,l,ge]),Ce=a.useCallback((Ie,ee)=>{var st;const ne=((st=Y.current)==null?void 0:st.width)??0;de(),V.current=Ie,E(Ie),M.current=!0,Z(!0);const He=ee?-Ie*ne:0;P.current=He,j(He),C.current=window.setTimeout(()=>{C.current=null,ee?_e(Ie):ge()},Sn+32)},[de,_e,ge]),Me=a.useCallback(Ie=>{M.current||t.length<=1||(V.current=Ie,E(Ie),M.current=!1,Z(!1),P.current=0,j(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(Ie,!0)})}))},[t.length,Ce]),fe=a.useCallback(()=>{const Ie=v.current;if(!Ie)return;const ee=Ps(Ie);!ee.width||!ee.height||y(ee)},[]);a.useEffect(()=>{fe();const Ie=v.current;if(!Ie)return;const ee=new ResizeObserver(()=>fe());return ee.observe(Ie),()=>ee.disconnect()},[fe]),a.useEffect(()=>{W==="opening"&&A&&U("open")},[W,A]),a.useEffect(()=>{if(W!=="closing")return;const Ie=setTimeout(()=>s(),Sn);return()=>clearTimeout(Ie)},[W,s]),a.useEffect(()=>()=>{de()},[de]),a.useLayoutEffect(()=>{we.current!==n&&(ge(),J(0),b(!1),N(!1),Q(null),$.current=0,f.current=0,R.current="none",L.current=!1,g.current=null,I.current=!1,we.current=n)},[n,ge]),a.useEffect(()=>{if(W!=="open")return;let Ie=null;const ee=()=>{Ie&&(document.removeEventListener("click",Ie,!0),Ie=null)},ne=()=>{ee(),Ie=je=>{je.stopPropagation(),je.preventDefault(),ee()},document.addEventListener("click",Ie,!0)},He=je=>{const qe=je<0?1:-1;if(Math.abs(je)>Xm&&t.length>1){Ce(qe,!0);return}Ce(qe,!1)},st=je=>{if(je.touches.length!==1||M.current)return;const qe=je.touches[0];I.current=!0,g.current={x:qe.clientX,y:qe.clientY},R.current="none",f.current=0,L.current=!1},Be=je=>{if(!g.current||je.touches.length!==1||M.current)return;const qe=je.touches[0],tt=qe.clientX-g.current.x,mt=qe.clientY-g.current.y;if(R.current==="none"){if(Math.abs(tt)<10&&Math.abs(mt)<10)return;if(Math.abs(tt)>Math.abs(mt)){if(t.length<=1)return;R.current="horizontal"}else if(mt>0)R.current="vertical";else return}if(R.current==="horizontal"){L.current=!0,N(!0),f.current=tt;const St=tt<0?1:-1;V.current!==St&&(V.current=St,E(St)),P.current=tt,j(tt),je.preventDefault();return}R.current==="vertical"&&(L.current=!0,N(!0),$.current=mt,J(mt),je.preventDefault())},Oe=()=>{if(!g.current)return;const je=R.current,qe=L.current;if(qe&&je==="horizontal")He(f.current),ne();else if(qe&&je==="vertical")if($.current>Km){const mt=window.innerHeight;$.current=mt,b(!0),J(mt),U("closing")}else $.current=0,J(0),ne();else je==="horizontal"&&Math.abs(f.current)>0&&(He(f.current),ne());g.current=null,R.current="none",f.current=0,L.current=!1,N(!1)};return document.addEventListener("touchstart",st,{passive:!0}),document.addEventListener("touchmove",Be,{passive:!1}),document.addEventListener("touchend",Oe),document.addEventListener("touchcancel",Oe),()=>{document.removeEventListener("touchstart",st),document.removeEventListener("touchmove",Be),document.removeEventListener("touchend",Oe),document.removeEventListener("touchcancel",Oe),ee()}},[W,t.length,Ce]),a.useEffect(()=>{const Ie=ee=>{ee.key==="Escape"&&(ee.preventDefault(),ee.stopPropagation(),W!=="closing"&&U("closing"))};return window.addEventListener("keydown",Ie,!0),()=>window.removeEventListener("keydown",Ie,!0)},[W]);const ye=()=>{W!=="closing"&&U("closing")},Se=W==="open",B=W==="closing",ue=G>0?Math.max(0,1-G/500):1,ve=G>0?Math.max(.35,1-G/500):1,me=A?p?A:tg(A,he):null,Ee=Ie=>{if(Ie.stopPropagation(),I.current){I.current=!1;return}if(t.length<=1)return;const ee=me??Ie.currentTarget.getBoundingClientRect(),ne=Ie.clientY-ee.top,He=Math.min(52,ee.height*.2);if(!(ne>ee.height-He)){if(Ie.clientX-ee.left<ee.width/2){Me(-1);return}Me(1)}},be=Ie=>{if(t.length<=1)return;const ee=me??Ie.currentTarget.getBoundingClientRect(),ne=Ie.clientX-ee.left,He=Ie.clientY-ee.top,st=Math.min(52,ee.height*.2);if(He>ee.height-st){Ie.currentTarget.style.cursor="default";return}Ie.currentTarget.style.cursor=ne<ee.width/2?"w-resize":"e-resize"},k={position:"fixed",top:S==null?void 0:S.top,left:S==null?void 0:S.left,width:S==null?void 0:S.width,height:S==null?void 0:S.height,zIndex:9998},re=p?"cover":"contain",te=D!==0||G>0?`translate(${D}px, ${G}px)`:void 0,z=ce&&!K?"none":K?`transform ${Sn}ms ${Nn}`:pe?`transform ${Sn}ms ${Nn}, opacity ${Sn}ms ${Nn}`:W==="opening"||B?`opacity ${Sn}ms ${Nn}`:"none",le={...k,transform:te,opacity:G>0?ve:W==="opening"||B?0:1,transition:z,pointerEvents:"none"},Re={position:"absolute",top:((me==null?void 0:me.top)??0)-((S==null?void 0:S.top)??0),left:((me==null?void 0:me.left)??0)-((S==null?void 0:S.left)??0),width:me==null?void 0:me.width,height:me==null?void 0:me.height,objectFit:re,pointerEvents:se&&Se&&!oe?"auto":"none",touchAction:se&&Se?"none":void 0},ae=(S==null?void 0:S.width)??0,_=oe?(n+O+t.length)%t.length:null,Ne=_!==null?t[_]:null,Fe={...k,transform:oe?`translateX(${O*ae+D}px)`:void 0,opacity:1,transition:K?`transform ${Sn}ms ${Nn}`:"none",pointerEvents:"none"},et={position:"absolute",top:((A==null?void 0:A.top)??0)-((S==null?void 0:S.top)??0),left:((A==null?void 0:A.left)??0)-((S==null?void 0:S.left)??0),width:A==null?void 0:A.width,height:A==null?void 0:A.height,objectFit:re,pointerEvents:"none"},Ke=me?{position:"fixed",top:me.top,height:me.height,width:me.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:w,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:W==="open"?"none":void 0},onClick:ye,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:Se?ue:0,transition:ce?"none":`opacity ${Sn}ms ${Nn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:v,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Se?1:0,transition:`opacity ${Sn}ms ${Nn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:v,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Se?1:0,transition:`opacity ${Sn}ms ${Nn}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),A&&S&&Ne&&r.jsx("div",{style:Fe,children:Ei(Ne)?r.jsx("video",{src:Ne.url,muted:!0,playsInline:!0,preload:"auto",style:et},`neighbor-${_}-${Ne.url}`):r.jsx("img",{src:Ne.url,alt:Ne.name,style:et},`neighbor-${_}-${Ne.url}`)}),A&&S&&Te&&r.jsx("div",{style:le,children:se?r.jsx(ng,{src:Te.url,phase:W,mediaRef:T,mediaStyle:Re,onLoadedMetadata:q,onClick:Ee,onMouseMove:be},`${n}-${Te.url}`):r.jsx("img",{ref:T,src:Te.url,alt:Te.name,onLoad:q,style:Re},`${n}-${Te.url}`)}),Se&&Ke&&t.length>1&&!se&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Ke,left:me.left,cursor:"w-resize",pointerEvents:oe?"none":"auto"},onClick:Ie=>{if(I.current){I.current=!1;return}Ie.stopPropagation(),Me(-1)}}),r.jsx("div",{style:{...Ke,left:me.left+me.width/2,cursor:"e-resize",pointerEvents:oe?"none":"auto"},onClick:Ie=>{if(I.current){I.current=!1;return}Ie.stopPropagation(),Me(1)}})]})]})}function og(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function rg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=x.useScopedStyles(),{type:p="a",gridLayout:w,textBoxWidth:v=100,verticalGap:T,entriesCount:g,lightbox:$,imageDisplay:f,imageCorners:R,lightboxImageDisplay:L,slider:I,sliderTiming:Y,direction:P,transition:V,titleMarginTop:M,subtitleMarginTop:C,titleColor:A,subtitleColor:y,lightboxCounterColor:S,titleFontFamily:F,titleFontSettings:W,titleFontSize:U,titleLineHeight:G,titleLetterSpacing:J,titleWordSpacing:D,titleTextAppearance:j,subtitleFontFamily:O,subtitleFontSettings:E,subtitleFontSize:K,subtitleLineHeight:Z,subtitleLetterSpacing:ce,subtitleWordSpacing:N,subtitleTextAppearance:pe,lightboxCounterFontFamily:b,lightboxCounterFontSettings:he,lightboxCounterFontSize:Q,lightboxCounterLineHeight:we,lightboxCounterLetterSpacing:Te,lightboxCounterWordSpacing:se,lightboxCounterTextAppearance:oe,showText:q="always",alignEntries:de="off",align:ge="top"}=e,_e={fontSettings:{fontFamily:F,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:U??.01,lineHeight:G,letterSpacing:J??0,wordSpacing:D??0,textAppearance:j,color:A},Me={...nn(zt(_e,n))},fe={fontSettings:{fontFamily:O,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:K??.01,lineHeight:Z,letterSpacing:ce??0,wordSpacing:N??0,textAppearance:pe,color:y},Se={...nn(zt(fe,n))},B={fontSettings:{fontFamily:b,fontWeight:(he==null?void 0:he.fontWeight)??400,fontStyle:(he==null?void 0:he.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:we,letterSpacing:Te??0,wordSpacing:se??0,textAppearance:oe,color:S},ve={...nn(zt(B,n)),...Vr(Q,we,u,n)},me=Br(U,G,`${u}-item-title`,`${u}-text-tight-leading`),Ee=Br(K,Z,`${u}-item-subtitle`,`${u}-text-tight-leading`),be=Vr(U,G,u,n),k=Vr(K,Z,u,n),re=Br(Q,we,`${u}-lightbox-counter`,`${u}-text-tight-leading`),te=x.buildColorVars(u,{titleColor:A,subtitleColor:y,lightboxCounterColor:S},ag,sg),Re=`${l&&l!=="default"?`${u}-state-${l}`:""}${q==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ae=g===0?1/0:g,_=(t??[]).slice(0,ae),Ne=w.entryWidth??.2,Fe=(f==null?void 0:f.display)==="cover",et=(f==null?void 0:f.ratioValue)??"1:1",Ke=(f==null?void 0:f.reversed)??!1,[Ie,ee]=et.split(":").map(Number),st=`${Ke?ee:Ie} / ${Ke?Ie:ee}`,Be=w.columnsCount,Oe=x.scalingValue(Ne??0,n),je=Oe,qe=!Fe&&I!=="off",tt=_.length%Be||Be,mt=tt<Be&&_.length>0,St=_.length-tt,lt=mt?Math.floor((Be-tt)/2)+1:1,pt=R?x.scalingValue(R,n):void 0,Mt={width:je,...Fe?{aspectRatio:st,height:"auto",overflow:"hidden"}:{height:"auto"},...pt?{borderRadius:pt,overflow:"hidden"}:{}},nt=`${u}-item-image-wrapper${qe?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Ve=p==="d"||p==="e"||p==="f",De=de==="on",vt=`calc(${x.scalingValue(Ne??0,n)} * (${v} / 100))`,bt=x.scalingValue(Ne*v/100,n),Pt=Fe?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...pt?{borderRadius:pt}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...pt?{borderRadius:pt}:{}},[Dt,tn]=a.useState("ltr"),[ln,Tt]=a.useState(0),kt=a.useRef(null);a.useEffect(()=>{const Ze=kt.current;if(!Ze)return;const Je=new ResizeObserver(rt=>{Tt(Math.round(rt[0].contentRect.width))});return Je.observe(Ze),()=>Je.disconnect()},[]);const Yt=(()=>{const Ze={...te},Je=kt.current?getComputedStyle(kt.current).getPropertyValue("--cntrl-article-width").trim():"";return Je&&(Ze["--cntrl-article-width"]=Je),Ze})(),[qt,Le]=a.useState(!1),[Ue,Xe]=a.useState([]),[ct,Rt]=a.useState(0),ut=$==="on"&&(!n||i),it=(Ze,Je)=>{n&&!i||$!=="off"&&(Xe(Ze),Rt(Je),Le(!0))};a.useEffect(()=>{if(!qt||$!=="on"||typeof document>"u")return;const Ze=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ze}},[qt,$]),a.useEffect(()=>{!n||i||Le(!1)},[n,i]);const Ut=a.useMemo(()=>qm(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ut}}),r.jsx("div",{style:te,children:r.jsx("div",{ref:kt,className:`${u}-wrapper ${u}-type-${p}${De?` ${u}-align-entries`:""} ${u}-image-align-${ge} ${Re}`.trim(),style:{gridTemplateColumns:`repeat(${Be}, ${Oe})`,rowGap:De?0:x.scalingValue(T??0,n),columnGap:x.scalingValue(w.horizontalGap??0,n),width:x.scalingValue(w.wrapperWidth??0,n),...De?{[`--${u}-align-entries-row-gap`]:x.scalingValue(T??0,n)}:{}},children:_.map((Ze,Je)=>{var jt;const rt=Ms(Ze.title),Lt=Ms(Ze.subtitle),It=(((jt=Ze.link)==null?void 0:jt.length)??0)>0&&$==="off"?Ze.link:void 0,ft=Math.floor(Je/Be)===Math.ceil(_.length/Be)-1,Ft=mt&&Je>=St?`${lt+(Je-St)}`:void 0,Ot=Ve?r.jsxs("div",{className:`${u}-item-text-block`,children:[rt&&r.jsx("p",{className:me,style:{width:vt,...Me,...be},children:Ze.title}),rt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:x.scalingValue(M??0,n),width:bt}}),Lt&&r.jsx("p",{className:Ee,style:{width:vt,...Se,...k},children:Ze.subtitle}),Lt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:x.scalingValue(C??0,n),width:bt}})]}):null,Ht=De?r.jsxs("div",{className:`${u}-item-title-row`,children:[!Ve&&r.jsx("div",{"data-controls":o&&rt?"titleMarginTop":void 0,className:o&&rt?`${u}-control`:void 0,style:{height:rt?x.scalingValue(M??0,n):0,width:bt}}),rt&&r.jsx("p",{className:me,style:{width:vt,...Me,...be},children:Ze.title}),Ve&&rt&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:x.scalingValue(M??0,n),width:bt}})]}):null,Vt=De?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Ve&&r.jsx("div",{"data-controls":o&&Lt?"subtitleMarginTop":void 0,className:o&&Lt?`${u}-control`:void 0,style:{height:Lt?x.scalingValue(C??0,n):0,width:bt}}),Lt&&r.jsx("p",{className:Ee,style:{width:vt,...Se,...k},children:Ze.subtitle}),Ve&&Lt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:x.scalingValue(C??0,n),width:bt}})]}):null,xt=It?r.jsxs("a",{href:It,target:"_blank",className:`${u}-item-text-link`,children:[Ht,Vt]}):r.jsxs(r.Fragment,{children:[Ht,Vt]}),Gt=Qm(Ze.gallery),Kt=Gt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),Xt=r.jsx("div",{className:nt,style:Mt,children:Gt.length===0?null:I==="off"?(()=>{const{displayMedia:wt,lightboxMedia:h}=Gt[0],xe=h?Kt.findIndex(Pe=>Pe.url===h.url):-1;return r.jsx(ks,{media:wt,className:`${u}-item-${Ei(wt)?"video":"image"}`.trim(),style:Pt,onMediaClick:ut&&xe>=0?()=>it(Kt,xe):void 0})})():r.jsxs(r.Fragment,{children:[qe&&De&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Gt.map(({displayMedia:wt})=>Ei(wt)?r.jsx("video",{src:wt.url,muted:!0,playsInline:!0},`sizer-${wt.url}`):r.jsx("img",{src:wt.url,alt:""},`sizer-${wt.url}`))}),r.jsx(qa,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:Y*1e3,width:"100%",height:"100%",speed:Um,type:V==="fade"?"fade":"loop",rewind:V==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:V==="fade"?"ltr":P!=="random"?P==="horizontal"?"ltr":"ttb":Dt},onMoved:wt=>{if(P!=="random"||V==="fade")return;const h=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";tn(h),setTimeout(()=>{wt.refresh()},0)},children:Gt.map(({displayMedia:wt,lightboxMedia:h},xe)=>{const Pe=h?Kt.findIndex(Ae=>Ae.url===h.url):-1;return r.jsx(Ua,{children:r.jsx(ks,{media:wt,className:`${u}-item-${Ei(wt)?"video":"image"}`.trim(),style:Pt,onMediaClick:ut&&Pe>=0?()=>it(Kt,Pe):void 0})},xe)})},`${V}-${Ne}-${P}-${Y}-${ln}-${d}`)]})}),Zt=Ve?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&rt?"titleMarginTop":void 0,className:o&&rt?`${u}-control`:void 0,style:{height:rt?x.scalingValue(M??0,n):0,width:bt}}),r.jsx("p",{className:me,style:{width:vt,...Me,...be},children:Ze.title}),r.jsx("div",{"data-controls":o&&Lt?"subtitleMarginTop":void 0,className:o&&Lt?`${u}-control`:void 0,style:{height:Lt?x.scalingValue(C??0,n):0,width:bt}}),r.jsx("p",{className:Ee,style:{width:vt,...Se,...k},children:Ze.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Ft&&!De?{gridColumn:Ft}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${De&&ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(v??0)>100?`calc(${Oe} * (${v} / 100))`:Oe,...Ft&&De?{gridColumn:Ft}:{}},children:De?r.jsx(r.Fragment,{children:Ve?r.jsxs(r.Fragment,{children:[xt,r.jsx("a",{href:It,target:"_blank",className:`${u}-item-image-link`,children:Xt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:It,target:"_blank",className:`${u}-item-image-link`,children:Xt}),xt]})}):It?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:It,target:"_blank",className:`${u}-item-image-link`,children:[Ot,Xt]}),!Ve&&r.jsx("a",{href:It,target:"_blank",className:`${u}-item-text-link`,children:Zt})]}):r.jsxs(r.Fragment,{children:[Ot,Xt,Zt]})})},Je)})})}),(!n||i)&&qt&&typeof document<"u"&&$==="on"&&(()=>{const Ze=(c?document.getElementById(c):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Yt,"data-selection":"none",children:r.jsx(ig,{prefix:u,items:Ue,index:ct,imageDisplay:og(L),isEditor:n,onClose:()=>Le(!1),onPrev:()=>Rt(Je=>(Je-1+Ue.length)%Ue.length),onNext:()=>Rt(Je=>(Je+1)%Ue.length),counterClassName:re,counterStyle:ve})}),Ze)})()]})}const ag={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},sg=["hover","focus","filled","success","error"],lg=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
4158
|
+
`}const vn=500,Zm=750,Nn="cubic-bezier(0.22, 1, 0.36, 1)",Jm=72,Qm=50;function eg(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function tg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function ng(e){const[t]=e.media;return t!=null&&t.url?t:null}function pc(e){return!Array.isArray(e)||e.length===0?[]:eg(e)?e.flatMap(t=>{const n=tg(t);if(!n)return[];const i=ng(t);return[{displayMedia:n,lightboxMedia:i!=null&&i.url?i:null}]}):e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function gi(e){return e.type==="video"}function ig(e){const t=new Set,n=[];for(const i of e){const o=pc(i.gallery);for(const l of o){const s=l.lightboxMedia;s!=null&&s.url&&!t.has(s.url)&&(t.add(s.url),n.push(s))}}return n}function og({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>gi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function rg(e){e.pause(),e.removeAttribute("src"),e.load()}function Pl({media:e,className:t,style:n,onMediaClick:i}){return gi(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function kl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function ag(e,t){if(!t||!t.width||!t.height||!e.width||!e.height)return e;const n=t.width/t.height,i=e.width/e.height;if(n>i){const l=e.width/n;return{width:e.width,height:l,left:e.left,top:e.top+(e.height-l)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function lg({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:l,onMouseMove:s}){return a.useEffect(()=>{const d=n.current;if(d)return()=>{rg(d)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:l,onMouseMove:s,style:i})}function sg({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:l,onPrev:s,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",b=a.useRef(null),S=a.useRef(null),L=a.useRef(null),f=a.useRef(null),h=a.useRef(0),y=a.useRef(0),E=a.useRef("none"),I=a.useRef(!1),T=a.useRef(!1),X=a.useRef(null),k=a.useRef(0),B=a.useRef(null),P=a.useRef(!1),C=a.useRef(null),z=a.useRef(null),v=a.useRef(null),_=a.useRef(()=>{}),[R,Z]=a.useState(null),[A,U]=a.useState(null),[V,G]=a.useState("opening"),[ne,$]=a.useState(0),[M,N]=a.useState(0),[Q,ie]=a.useState(null),[F,pe]=a.useState(!1),[x,se]=a.useState(!1),[J,ye]=a.useState(!1),[Me,de]=a.useState(null),ce=a.useRef(n),q=a.useRef(void 0),ee=t[n],me=ee?gi(ee):!1,Fe=M!==0||F,Ce=Q!==null,Ae=a.useCallback(Le=>{const He=Le.currentTarget,Xe=He instanceof HTMLVideoElement?{width:He.videoWidth,height:He.videoHeight}:{width:He.naturalWidth,height:He.naturalHeight};!Xe.width||!Xe.height||de(Xe)},[]);a.useEffect(()=>{X.current=A},[A]),a.useEffect(()=>{const Le=b.current;if(!Le)return;const He=()=>U(kl(Le));He();const Xe=new ResizeObserver(He);return Xe.observe(Le),()=>Xe.disconnect()},[]);const ue=a.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),fe=a.useCallback(()=>{const Le=z.current;z.current=null,ue(),B.current=null,P.current=!1,ie(null),pe(!1),N(0),k.current=0,se(!1),I.current=!1,y.current=0,E.current="none",Le===1?d():Le===-1&&s()},[ue,d,s]),Se=a.useCallback(()=>{ue(),z.current=null,B.current=null,P.current=!1,ie(null),pe(!1),N(0),k.current=0},[ue]),D=a.useCallback(()=>{ue(),C.current=window.setTimeout(()=>{z.current!==null&&fe()},vn+32)},[ue,fe]),oe=a.useCallback((Le,He)=>{var ut;const Xe=((ut=X.current)==null?void 0:ut.width)??0;if(ue(),B.current=Le,ie(Le),P.current=!0,pe(!0),He){z.current=Le;const xt=-Le*Xe;k.current=xt,N(xt),D();return}k.current=0,N(0),C.current=window.setTimeout(()=>{C.current=null,Se()},vn+32)},[ue,Se,D]),he=a.useCallback(Le=>{if(!(t.length<=1)){if(P.current){if(z.current===Le){v.current=Le,fe();return}Se()}ue(),B.current=Le,ie(Le),P.current=!1,pe(!1),k.current=0,N(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{oe(Le,!0)})})}},[t.length,oe,fe,Se,ue]);_.current=he;const be=a.useCallback(Le=>{Le.propertyName!=="transform"||!P.current||z.current!==null&&fe()},[fe]),Ie=a.useCallback(()=>{const Le=S.current;if(!Le)return;const He=kl(Le);!He.width||!He.height||Z(He)},[]);a.useEffect(()=>{Ie();const Le=S.current;if(!Le)return;const He=new ResizeObserver(()=>Ie());return He.observe(Le),()=>He.disconnect()},[Ie]),a.useEffect(()=>{V==="opening"&&R&&G("open")},[V,R]),a.useEffect(()=>{if(V!=="closing")return;const Le=setTimeout(()=>l(),vn);return()=>clearTimeout(Le)},[V,l]),a.useEffect(()=>()=>{ue()},[ue]),a.useLayoutEffect(()=>{ce.current===n&&q.current===(ee==null?void 0:ee.url)||(ue(),z.current=null,ie(null),$(0),N(0),pe(!1),ye(!1),se(!1),de(null),h.current=0,y.current=0,E.current="none",I.current=!1,P.current=!1,k.current=0,B.current=null,f.current=null,T.current=!1,ce.current=n,q.current=ee==null?void 0:ee.url)},[n,ee==null?void 0:ee.url,ue]),a.useLayoutEffect(()=>{const Le=v.current;Le!==null&&(v.current=null,requestAnimationFrame(()=>{_.current(Le)}))},[n,ee==null?void 0:ee.url]),a.useEffect(()=>{if(V!=="open")return;let Le=null;const He=()=>{Le&&(document.removeEventListener("click",Le,!0),Le=null)},Xe=()=>{He(),Le=lt=>{lt.stopPropagation(),lt.preventDefault(),He()},document.addEventListener("click",Le,!0)},ut=lt=>{const Ue=lt<0?1:-1;if(Math.abs(lt)>Qm&&t.length>1){oe(Ue,!0);return}oe(Ue,!1)},xt=lt=>{if(lt.touches.length!==1||P.current)return;const Ue=lt.touches[0];T.current=!0,f.current={x:Ue.clientX,y:Ue.clientY},E.current="none",y.current=0,I.current=!1},it=lt=>{if(!f.current||lt.touches.length!==1||P.current)return;const Ue=lt.touches[0],Ke=Ue.clientX-f.current.x,Ne=Ue.clientY-f.current.y;if(E.current==="none"){if(Math.abs(Ke)<10&&Math.abs(Ne)<10)return;if(Math.abs(Ke)>Math.abs(Ne)){if(t.length<=1)return;E.current="horizontal"}else if(Ne>0)E.current="vertical";else return}if(E.current==="horizontal"){I.current=!0,se(!0),y.current=Ke;const pt=Ke<0?1:-1;B.current!==pt&&(B.current=pt,ie(pt)),k.current=Ke,N(Ke),lt.preventDefault();return}E.current==="vertical"&&(I.current=!0,se(!0),h.current=Ne,$(Ne),lt.preventDefault())},wt=()=>{if(!f.current)return;const lt=E.current,Ue=I.current;if(Ue&<==="horizontal")ut(y.current),Xe();else if(Ue&<==="vertical")if(h.current>Jm){const Ne=window.innerHeight;h.current=Ne,ye(!0),$(Ne),G("closing")}else h.current=0,$(0),Xe();else lt==="horizontal"&&Math.abs(y.current)>0&&(ut(y.current),Xe());f.current=null,E.current="none",y.current=0,I.current=!1,se(!1)};return document.addEventListener("touchstart",xt,{passive:!0}),document.addEventListener("touchmove",it,{passive:!1}),document.addEventListener("touchend",wt),document.addEventListener("touchcancel",wt),()=>{document.removeEventListener("touchstart",xt),document.removeEventListener("touchmove",it),document.removeEventListener("touchend",wt),document.removeEventListener("touchcancel",wt),He()}},[V,t.length,oe]),a.useEffect(()=>{const Le=He=>{He.key==="Escape"&&(He.preventDefault(),He.stopPropagation(),V!=="closing"&&G("closing"))};return window.addEventListener("keydown",Le,!0),()=>window.removeEventListener("keydown",Le,!0)},[V]);const xe=()=>{V!=="closing"&&G("closing")},W=V==="open",ae=V==="closing",te=ne>0?Math.max(0,1-ne/500):1,j=ne>0?Math.max(.35,1-ne/500):1,Y=R?p?R:ag(R,Me):null,Re=Le=>{if(Le.stopPropagation(),T.current){T.current=!1;return}if(t.length<=1)return;const He=Y??Le.currentTarget.getBoundingClientRect(),Xe=Le.clientY-He.top,ut=Math.min(52,He.height*.2);if(!(Xe>He.height-ut)){if(Le.clientX-He.left<He.width/2){he(-1);return}he(1)}},le=Le=>{if(t.length<=1)return;const He=Y??Le.currentTarget.getBoundingClientRect(),Xe=Le.clientX-He.left,ut=Le.clientY-He.top,xt=Math.min(52,He.height*.2);if(ut>He.height-xt){Le.currentTarget.style.cursor="default";return}Le.currentTarget.style.cursor=Xe<He.width/2?"w-resize":"e-resize"},H={position:"fixed",top:A==null?void 0:A.top,left:A==null?void 0:A.left,width:A==null?void 0:A.width,height:A==null?void 0:A.height,zIndex:9998},De=p?"cover":"contain",_e=M!==0||ne>0?`translate(${M}px, ${ne}px)`:void 0,tt=x&&!F?"none":F?`transform ${vn}ms ${Nn}`:J?`transform ${vn}ms ${Nn}, opacity ${vn}ms ${Nn}`:V==="opening"||ae?`opacity ${vn}ms ${Nn}`:"none",Qe={...H,transform:_e,opacity:ne>0?j:V==="opening"||ae?0:1,transition:tt,pointerEvents:"none"},at={position:"absolute",top:((Y==null?void 0:Y.top)??0)-((A==null?void 0:A.top)??0),left:((Y==null?void 0:Y.left)??0)-((A==null?void 0:A.left)??0),width:Y==null?void 0:Y.width,height:Y==null?void 0:Y.height,objectFit:De,pointerEvents:me&&W&&!Fe?"auto":"none",touchAction:me&&W?"none":void 0},$e=(A==null?void 0:A.width)??0,ge=Ce?(n+Q+t.length)%t.length:null,je=ge!==null?t[ge]:null,vt={...H,transform:Ce?`translateX(${Q*$e+M}px)`:void 0,opacity:1,transition:F?`transform ${vn}ms ${Nn}`:"none",pointerEvents:"none"},Ye={position:"absolute",top:((R==null?void 0:R.top)??0)-((A==null?void 0:A.top)??0),left:((R==null?void 0:R.left)??0)-((A==null?void 0:A.left)??0),width:R==null?void 0:R.width,height:R==null?void 0:R.height,objectFit:De,pointerEvents:"none"},Oe=Y?{position:"fixed",top:Y.top,height:Y.height,width:Y.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:b,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:xe,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:W?te:0,transition:x?"none":`opacity ${vn}ms ${Nn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:S,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:W?1:0,transition:`opacity ${vn}ms ${Nn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:S,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:W?1:0,transition:`opacity ${vn}ms ${Nn}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),R&&A&&je&&r.jsx("div",{style:vt,onTransitionEnd:be,children:gi(je)?r.jsx("video",{src:je.url,muted:!0,playsInline:!0,preload:"auto",style:Ye},`neighbor-${ge}-${je.url}`):r.jsx("img",{src:je.url,alt:je.name,style:Ye},`neighbor-${ge}-${je.url}`)}),R&&A&&ee&&r.jsx("div",{style:Qe,onTransitionEnd:be,children:me?r.jsx(lg,{src:ee.url,phase:V,mediaRef:L,mediaStyle:at,onLoadedMetadata:Ae,onClick:Re,onMouseMove:le},`${n}-${ee.url}`):r.jsx("img",{ref:L,src:ee.url,alt:ee.name,onLoad:Ae,style:at},`${n}-${ee.url}`)}),W&&Oe&&t.length>1&&!me&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Oe,left:Y.left,cursor:"w-resize",pointerEvents:x?"none":"auto"},onClick:Le=>{if(T.current){T.current=!1;return}Le.stopPropagation(),he(-1)}}),r.jsx("div",{style:{...Oe,left:Y.left+Y.width/2,cursor:"e-resize",pointerEvents:x?"none":"auto"},onClick:Le=>{if(T.current){T.current=!1;return}Le.stopPropagation(),he(1)}})]})]})}function cg(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function dg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:l,activeEvent:s,layoutId:d,portalId:c}){const{prefix:u}=w.useScopedStyles(),{type:p="a",gridLayout:b,textBoxWidth:S=100,verticalGap:L,entriesCount:f,lightbox:h,imageDisplay:y,imageCorners:E,lightboxImageDisplay:I,slider:T,sliderTiming:X,direction:k,transition:B,titleMarginTop:P,subtitleMarginTop:C,titleColor:z,subtitleColor:v,lightboxCounterColor:_,titleFontFamily:R,titleFontSettings:Z,titleFontSize:A,titleLineHeight:U,titleLetterSpacing:V,titleWordSpacing:G,titleTextAppearance:ne,subtitleFontFamily:$,subtitleFontSettings:M,subtitleFontSize:N,subtitleLineHeight:Q,subtitleLetterSpacing:ie,subtitleWordSpacing:F,subtitleTextAppearance:pe,lightboxCounterFontFamily:x,lightboxCounterFontSettings:se,lightboxCounterFontSize:J,lightboxCounterLineHeight:ye,lightboxCounterLetterSpacing:Me,lightboxCounterWordSpacing:de,lightboxCounterTextAppearance:ce,showText:q="always",alignEntries:ee="off",align:me="top"}=e,Fe={fontSettings:{fontFamily:R,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:A??.01,lineHeight:U,letterSpacing:V??0,wordSpacing:G??0,textAppearance:ne,color:z},Ae={...on(Vt(Fe,n))},ue={fontSettings:{fontFamily:$,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:N??.01,lineHeight:Q,letterSpacing:ie??0,wordSpacing:F??0,textAppearance:pe,color:v},Se={...on(Vt(ue,n))},D={fontSettings:{fontFamily:x,fontWeight:(se==null?void 0:se.fontWeight)??400,fontStyle:(se==null?void 0:se.fontStyle)??"normal"},fontSize:J??.01,lineHeight:ye,letterSpacing:Me??0,wordSpacing:de??0,textAppearance:ce,color:_},he={...on(Vt(D,n)),...Gr(J,ye,u,n)},be=Vr(A,U,`${u}-item-title`,`${u}-text-tight-leading`),Ie=Vr(N,Q,`${u}-item-subtitle`,`${u}-text-tight-leading`),xe=Gr(A,U,u,n),W=Gr(N,Q,u,n),ae=Vr(J,ye,`${u}-lightbox-counter`,`${u}-text-tight-leading`),te=w.buildColorVars(u,{titleColor:z,subtitleColor:v,lightboxCounterColor:_},ug,pg),Re=`${s&&s!=="default"?`${u}-state-${s}`:""}${q==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),le=f===0?1/0:f,H=(t??[]).slice(0,le),De=a.useMemo(()=>h==="on"?ig(H):[],[H,h]),_e=b.entryWidth??.2,tt=(y==null?void 0:y.display)==="cover",Qe=(y==null?void 0:y.ratioValue)??"1:1",at=(y==null?void 0:y.reversed)??!1,[$e,ge]=Qe.split(":").map(Number),Ye=`${at?ge:$e} / ${at?$e:ge}`,Oe=b.columnsCount,Le=w.scalingValue(_e??0,n),He=Le,Xe=!tt&&T!=="off",ut=H.length%Oe||Oe,xt=ut<Oe&&H.length>0,it=H.length-ut,wt=xt?Math.floor((Oe-ut)/2)+1:1,lt=E?w.scalingValue(E,n):void 0,Ue={width:He,...tt?{aspectRatio:Ye,height:"auto",overflow:"hidden"}:{height:"auto"},...lt?{borderRadius:lt,overflow:"hidden"}:{}},Ke=`${u}-item-image-wrapper${Xe?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Ne=p==="d"||p==="e"||p==="f",pt=ee==="on",mt=`calc(${w.scalingValue(_e??0,n)} * (${S} / 100))`,gt=w.scalingValue(_e*S/100,n),Pt=tt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...lt?{borderRadius:lt}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...lt?{borderRadius:lt}:{}},[Zt,tn]=a.useState("ltr"),[Tt,Ct]=a.useState(0),Ft=a.useRef(null);a.useEffect(()=>{const Ve=Ft.current;if(!Ve)return;const et=new ResizeObserver(It=>{Ct(Math.round(It[0].contentRect.width))});return et.observe(Ve),()=>et.disconnect()},[]);const Ot=(()=>{const Ve={...te},et=Ft.current?getComputedStyle(Ft.current).getPropertyValue("--cntrl-article-width").trim():"";return et&&(Ve["--cntrl-article-width"]=et),Ve})(),[Te,Be]=a.useState(!1),[qe,st]=a.useState([]),[kt,dt]=a.useState(0),nt=h==="on"&&(!n||i),qt=(Ve,et)=>{n&&!i||h!=="off"&&(st(Ve),dt(et),Be(!0))};a.useEffect(()=>{if(!Te||h!=="on"||typeof document>"u")return;const Ve=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ve}},[Te,h]),a.useEffect(()=>{!n||i||Be(!1)},[n,i]);const St=a.useMemo(()=>Ym(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:St}}),h==="on"&&r.jsx(og,{mediaList:De}),r.jsx("div",{style:te,children:r.jsx("div",{ref:Ft,className:`${u}-wrapper ${u}-type-${p}${pt?` ${u}-align-entries`:""} ${u}-image-align-${me} ${Re}`.trim(),style:{gridTemplateColumns:`repeat(${Oe}, ${Le})`,rowGap:pt?0:w.scalingValue(L??0,n),columnGap:w.scalingValue(b.horizontalGap??0,n),width:w.scalingValue(b.wrapperWidth??0,n),...pt?{[`--${u}-align-entries-row-gap`]:w.scalingValue(L??0,n)}:{}},children:H.map((Ve,et)=>{var Bt;const It=El(Ve.title),Lt=El(Ve.subtitle),ht=(((Bt=Ve.link)==null?void 0:Bt.length)??0)>0&&h==="off"?Ve.link:void 0,Dt=Math.floor(et/Oe)===Math.ceil(H.length/Oe)-1,_t=xt&&et>=it?`${wt+(et-it)}`:void 0,jt=Ne?r.jsxs("div",{className:`${u}-item-text-block`,children:[It&&r.jsx("p",{className:be,style:{width:mt,...Ae,...xe},children:Ve.title}),It&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:w.scalingValue(P??0,n),width:gt}}),Lt&&r.jsx("p",{className:Ie,style:{width:mt,...Se,...W},children:Ve.subtitle}),Lt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:w.scalingValue(C??0,n),width:gt}})]}):null,Ut=pt?r.jsxs("div",{className:`${u}-item-title-row`,children:[!Ne&&r.jsx("div",{"data-controls":o&&It?"titleMarginTop":void 0,className:o&&It?`${u}-control`:void 0,style:{height:It?w.scalingValue(P??0,n):0,width:gt}}),It&&r.jsx("p",{className:be,style:{width:mt,...Ae,...xe},children:Ve.title}),Ne&&It&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:w.scalingValue(P??0,n),width:gt}})]}):null,$t=pt?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Ne&&r.jsx("div",{"data-controls":o&&Lt?"subtitleMarginTop":void 0,className:o&&Lt?`${u}-control`:void 0,style:{height:Lt?w.scalingValue(C??0,n):0,width:gt}}),Lt&&r.jsx("p",{className:Ie,style:{width:mt,...Se,...W},children:Ve.subtitle}),Ne&&Lt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:w.scalingValue(C??0,n),width:gt}})]}):null,en=ht?r.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:[Ut,$t]}):r.jsxs(r.Fragment,{children:[Ut,$t]}),Kt=pc(Ve.gallery),Yt=Kt.filter(g=>g.lightboxMedia).map(g=>g.lightboxMedia),Xt=r.jsx("div",{className:Ke,style:Ue,children:Kt.length===0?null:T==="off"?(()=>{const{displayMedia:g,lightboxMedia:ve}=Kt[0],ke=ve?Yt.findIndex(Ee=>Ee.url===ve.url):-1;return r.jsx(Pl,{media:g,className:`${u}-item-${gi(g)?"video":"image"}`.trim(),style:Pt,onMediaClick:nt&&ke>=0?()=>qt(Yt,ke):void 0})})():r.jsxs(r.Fragment,{children:[Xe&&pt&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Kt.map(({displayMedia:g})=>gi(g)?r.jsx("video",{src:g.url,muted:!0,playsInline:!0},`sizer-${g.url}`):r.jsx("img",{src:g.url,alt:""},`sizer-${g.url}`))}),r.jsx(qa,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:X*1e3,width:"100%",height:"100%",speed:Zm,type:B==="fade"?"fade":"loop",rewind:B==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:B==="fade"?"ltr":k!=="random"?k==="horizontal"?"ltr":"ttb":Zt},onMoved:g=>{if(k!=="random"||B==="fade")return;const ve=Math.random()>.5?Math.random()>.5?"rtl":"ltr":"ttb";tn(ve),setTimeout(()=>{g.refresh()},0)},children:Kt.map(({displayMedia:g,lightboxMedia:ve},ke)=>{const Ee=ve?Yt.findIndex(ot=>ot.url===ve.url):-1;return r.jsx(Ua,{children:r.jsx(Pl,{media:g,className:`${u}-item-${gi(g)?"video":"image"}`.trim(),style:Pt,onMediaClick:nt&&Ee>=0?()=>qt(Yt,Ee):void 0})},ke)})},`${B}-${_e}-${k}-${X}-${Tt}-${d}`)]})}),zt=Ne?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&It?"titleMarginTop":void 0,className:o&&It?`${u}-control`:void 0,style:{height:It?w.scalingValue(P??0,n):0,width:gt}}),r.jsx("p",{className:be,style:{width:mt,...Ae,...xe},children:Ve.title}),r.jsx("div",{"data-controls":o&&Lt?"subtitleMarginTop":void 0,className:o&&Lt?`${u}-control`:void 0,style:{height:Lt?w.scalingValue(C??0,n):0,width:gt}}),r.jsx("p",{className:Ie,style:{width:mt,...Se,...W},children:Ve.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:_t&&!pt?{gridColumn:_t}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${pt&&Dt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(S??0)>100?`calc(${Le} * (${S} / 100))`:Le,..._t&&pt?{gridColumn:_t}:{}},children:pt?r.jsx(r.Fragment,{children:Ne?r.jsxs(r.Fragment,{children:[en,r.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Xt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Xt}),en]})}):ht?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:[jt,Xt]}),!Ne&&r.jsx("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:zt})]}):r.jsxs(r.Fragment,{children:[jt,Xt,zt]})})},et)})})}),(!n||i)&&Te&&typeof document<"u"&&h==="on"&&(()=>{const Ve=(c?document.getElementById(c):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Ot,"data-selection":"none",children:r.jsx(sg,{prefix:u,items:qe,index:kt,imageDisplay:cg(I),isEditor:n,onClose:()=>Be(!1),onPrev:()=>dt(et=>(et-1+qe.length)%qe.length),onNext:()=>dt(et=>(et+1)%qe.length),counterClassName:ae,counterStyle:he})}),Ve)})()]})}const ug={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},pg=["hover","focus","filled","success","error"],mg=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
4159
4159
|
import '@splidejs/react-splide/css/core';
|
|
4160
4160
|
import { CommonComponentProps } from '../props';
|
|
4161
4161
|
import {
|
|
@@ -4652,6 +4652,60 @@ function isVideoMedia(media: GridMedia): boolean {
|
|
|
4652
4652
|
return false;
|
|
4653
4653
|
}
|
|
4654
4654
|
|
|
4655
|
+
function collectGridLightboxMedia(content: any[]): GridMedia[] {
|
|
4656
|
+
const seen = new Set<string>();
|
|
4657
|
+
const result: GridMedia[] = [];
|
|
4658
|
+
|
|
4659
|
+
for (const item of content) {
|
|
4660
|
+
const displayItems = getGridDisplayItems(item.gallery);
|
|
4661
|
+
for (const entry of displayItems) {
|
|
4662
|
+
const media = entry.lightboxMedia;
|
|
4663
|
+
if (media?.url && !seen.has(media.url)) {
|
|
4664
|
+
seen.add(media.url);
|
|
4665
|
+
result.push(media);
|
|
4666
|
+
}
|
|
4667
|
+
}
|
|
4668
|
+
}
|
|
4669
|
+
|
|
4670
|
+
return result;
|
|
4671
|
+
}
|
|
4672
|
+
|
|
4673
|
+
function LightboxMediaPreloadPool({ mediaList }: { mediaList: GridMedia[] }) {
|
|
4674
|
+
if (mediaList.length === 0) return null;
|
|
4675
|
+
|
|
4676
|
+
return (
|
|
4677
|
+
<div
|
|
4678
|
+
aria-hidden
|
|
4679
|
+
style={{
|
|
4680
|
+
position: 'absolute',
|
|
4681
|
+
width: 0,
|
|
4682
|
+
height: 0,
|
|
4683
|
+
overflow: 'hidden',
|
|
4684
|
+
opacity: 0,
|
|
4685
|
+
pointerEvents: 'none',
|
|
4686
|
+
}}
|
|
4687
|
+
>
|
|
4688
|
+
{mediaList.map((media) => (
|
|
4689
|
+
isVideoMedia(media) ? (
|
|
4690
|
+
<video
|
|
4691
|
+
key={media.url}
|
|
4692
|
+
src={media.url}
|
|
4693
|
+
preload='auto'
|
|
4694
|
+
muted
|
|
4695
|
+
playsInline
|
|
4696
|
+
/>
|
|
4697
|
+
) : (
|
|
4698
|
+
<img
|
|
4699
|
+
key={media.url}
|
|
4700
|
+
src={media.url}
|
|
4701
|
+
alt=''
|
|
4702
|
+
/>
|
|
4703
|
+
)
|
|
4704
|
+
))}
|
|
4705
|
+
</div>
|
|
4706
|
+
);
|
|
4707
|
+
}
|
|
4708
|
+
|
|
4655
4709
|
function unloadVideoElement(video: HTMLVideoElement) {
|
|
4656
4710
|
video.pause();
|
|
4657
4711
|
video.removeAttribute('src');
|
|
@@ -4775,6 +4829,9 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4775
4829
|
const slideDirRef = useRef<1 | -1 | null>(null);
|
|
4776
4830
|
const slideAnimatingRef = useRef(false);
|
|
4777
4831
|
const slideCommitTimerRef = useRef<number | null>(null);
|
|
4832
|
+
const slideCommitDirectionRef = useRef<1 | -1 | null>(null);
|
|
4833
|
+
const rapidNavDirectionRef = useRef<1 | -1 | null>(null);
|
|
4834
|
+
const startProgrammaticSlideRef = useRef<(dir: 1 | -1) => void>(() => {});
|
|
4778
4835
|
const [finalRect, setFinalRect] = useState<AnimRect | null>(null);
|
|
4779
4836
|
const [viewportRect, setViewportRect] = useState<AnimRect | null>(null);
|
|
4780
4837
|
const [phase, setPhase] = useState<'opening' | 'open' | 'closing'>('opening');
|
|
@@ -4786,8 +4843,10 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4786
4843
|
const [swipeDismiss, setSwipeDismiss] = useState(false);
|
|
4787
4844
|
const [mediaNaturalSize, setMediaNaturalSize] = useState<{ width: number; height: number } | null>(null);
|
|
4788
4845
|
const prevIndexRef = useRef(index);
|
|
4846
|
+
const prevItemUrlRef = useRef<string | undefined>(undefined);
|
|
4789
4847
|
const currentItem = items[index];
|
|
4790
4848
|
const isCurrentVideo = currentItem ? isVideoMedia(currentItem) : false;
|
|
4849
|
+
const isHorizontalNavActive = slideOffset !== 0 || slideAnimating;
|
|
4791
4850
|
const isSliding = slideDir !== null;
|
|
4792
4851
|
|
|
4793
4852
|
const handleMediaLoad = useCallback((e: React.SyntheticEvent<HTMLImageElement | HTMLVideoElement>) => {
|
|
@@ -4820,21 +4879,43 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4820
4879
|
}
|
|
4821
4880
|
}, []);
|
|
4822
4881
|
|
|
4823
|
-
const
|
|
4882
|
+
const commitSlideNavigation = useCallback(() => {
|
|
4883
|
+
const dir = slideCommitDirectionRef.current;
|
|
4884
|
+
slideCommitDirectionRef.current = null;
|
|
4824
4885
|
clearSlideCommitTimer();
|
|
4825
|
-
slideOffsetRef.current = 0;
|
|
4826
4886
|
slideDirRef.current = null;
|
|
4827
4887
|
slideAnimatingRef.current = false;
|
|
4888
|
+
setSlideDir(null);
|
|
4889
|
+
setSlideAnimating(false);
|
|
4828
4890
|
setSlideOffset(0);
|
|
4891
|
+
slideOffsetRef.current = 0;
|
|
4892
|
+
setIsSwiping(false);
|
|
4893
|
+
isSwipingRef.current = false;
|
|
4894
|
+
swipeDeltaXRef.current = 0;
|
|
4895
|
+
swipeAxisRef.current = 'none';
|
|
4896
|
+
|
|
4897
|
+
if (dir === 1) onNext();
|
|
4898
|
+
else if (dir === -1) onPrev();
|
|
4899
|
+
}, [clearSlideCommitTimer, onNext, onPrev]);
|
|
4900
|
+
|
|
4901
|
+
const cancelSlideAnimation = useCallback(() => {
|
|
4902
|
+
clearSlideCommitTimer();
|
|
4903
|
+
slideCommitDirectionRef.current = null;
|
|
4904
|
+
slideDirRef.current = null;
|
|
4905
|
+
slideAnimatingRef.current = false;
|
|
4829
4906
|
setSlideDir(null);
|
|
4830
4907
|
setSlideAnimating(false);
|
|
4908
|
+
setSlideOffset(0);
|
|
4909
|
+
slideOffsetRef.current = 0;
|
|
4831
4910
|
}, [clearSlideCommitTimer]);
|
|
4832
4911
|
|
|
4833
|
-
const
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4912
|
+
const scheduleSlideCommit = useCallback(() => {
|
|
4913
|
+
clearSlideCommitTimer();
|
|
4914
|
+
slideCommitTimerRef.current = window.setTimeout(() => {
|
|
4915
|
+
if (slideCommitDirectionRef.current === null) return;
|
|
4916
|
+
commitSlideNavigation();
|
|
4917
|
+
}, LIGHTBOX_ANIM_MS + 32);
|
|
4918
|
+
}, [clearSlideCommitTimer, commitSlideNavigation]);
|
|
4838
4919
|
|
|
4839
4920
|
const finishSlide = useCallback((dir: 1 | -1, commit: boolean) => {
|
|
4840
4921
|
const width = viewportRectRef.current?.width ?? 0;
|
|
@@ -4843,18 +4924,38 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4843
4924
|
setSlideDir(dir);
|
|
4844
4925
|
slideAnimatingRef.current = true;
|
|
4845
4926
|
setSlideAnimating(true);
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4927
|
+
|
|
4928
|
+
if (commit) {
|
|
4929
|
+
slideCommitDirectionRef.current = dir;
|
|
4930
|
+
const target = -dir * width;
|
|
4931
|
+
slideOffsetRef.current = target;
|
|
4932
|
+
setSlideOffset(target);
|
|
4933
|
+
scheduleSlideCommit();
|
|
4934
|
+
return;
|
|
4935
|
+
}
|
|
4936
|
+
|
|
4937
|
+
slideOffsetRef.current = 0;
|
|
4938
|
+
setSlideOffset(0);
|
|
4849
4939
|
slideCommitTimerRef.current = window.setTimeout(() => {
|
|
4850
4940
|
slideCommitTimerRef.current = null;
|
|
4851
|
-
|
|
4852
|
-
else resetSlideState();
|
|
4941
|
+
cancelSlideAnimation();
|
|
4853
4942
|
}, LIGHTBOX_ANIM_MS + 32);
|
|
4854
|
-
}, [clearSlideCommitTimer,
|
|
4943
|
+
}, [clearSlideCommitTimer, cancelSlideAnimation, scheduleSlideCommit]);
|
|
4855
4944
|
|
|
4856
4945
|
const startProgrammaticSlide = useCallback((dir: 1 | -1) => {
|
|
4857
|
-
if (
|
|
4946
|
+
if (items.length <= 1) return;
|
|
4947
|
+
|
|
4948
|
+
if (slideAnimatingRef.current) {
|
|
4949
|
+
if (slideCommitDirectionRef.current === dir) {
|
|
4950
|
+
rapidNavDirectionRef.current = dir;
|
|
4951
|
+
commitSlideNavigation();
|
|
4952
|
+
return;
|
|
4953
|
+
}
|
|
4954
|
+
|
|
4955
|
+
cancelSlideAnimation();
|
|
4956
|
+
}
|
|
4957
|
+
|
|
4958
|
+
clearSlideCommitTimer();
|
|
4858
4959
|
slideDirRef.current = dir;
|
|
4859
4960
|
setSlideDir(dir);
|
|
4860
4961
|
slideAnimatingRef.current = false;
|
|
@@ -4866,7 +4967,15 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4866
4967
|
finishSlide(dir, true);
|
|
4867
4968
|
});
|
|
4868
4969
|
});
|
|
4869
|
-
}, [items.length, finishSlide]);
|
|
4970
|
+
}, [items.length, finishSlide, commitSlideNavigation, cancelSlideAnimation, clearSlideCommitTimer]);
|
|
4971
|
+
|
|
4972
|
+
startProgrammaticSlideRef.current = startProgrammaticSlide;
|
|
4973
|
+
|
|
4974
|
+
const handleSlideTransitionEnd = useCallback((e: React.TransitionEvent<HTMLElement>) => {
|
|
4975
|
+
if (e.propertyName !== 'transform' || !slideAnimatingRef.current) return;
|
|
4976
|
+
if (slideCommitDirectionRef.current === null) return;
|
|
4977
|
+
commitSlideNavigation();
|
|
4978
|
+
}, [commitSlideNavigation]);
|
|
4870
4979
|
|
|
4871
4980
|
const computeFinalRect = useCallback(() => {
|
|
4872
4981
|
const ghost = ghostRef.current;
|
|
@@ -4902,10 +5011,14 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4902
5011
|
}, [clearSlideCommitTimer]);
|
|
4903
5012
|
|
|
4904
5013
|
useLayoutEffect(() => {
|
|
4905
|
-
if (prevIndexRef.current === index) return;
|
|
5014
|
+
if (prevIndexRef.current === index && prevItemUrlRef.current === currentItem?.url) return;
|
|
4906
5015
|
|
|
4907
|
-
|
|
5016
|
+
clearSlideCommitTimer();
|
|
5017
|
+
slideCommitDirectionRef.current = null;
|
|
5018
|
+
setSlideDir(null);
|
|
4908
5019
|
setSwipeOffset(0);
|
|
5020
|
+
setSlideOffset(0);
|
|
5021
|
+
setSlideAnimating(false);
|
|
4909
5022
|
setSwipeDismiss(false);
|
|
4910
5023
|
setIsSwiping(false);
|
|
4911
5024
|
setMediaNaturalSize(null);
|
|
@@ -4913,11 +5026,25 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
4913
5026
|
swipeDeltaXRef.current = 0;
|
|
4914
5027
|
swipeAxisRef.current = 'none';
|
|
4915
5028
|
isSwipingRef.current = false;
|
|
5029
|
+
slideAnimatingRef.current = false;
|
|
5030
|
+
slideOffsetRef.current = 0;
|
|
5031
|
+
slideDirRef.current = null;
|
|
4916
5032
|
touchStartRef.current = null;
|
|
4917
5033
|
touchInteractionRef.current = false;
|
|
4918
5034
|
|
|
4919
5035
|
prevIndexRef.current = index;
|
|
4920
|
-
|
|
5036
|
+
prevItemUrlRef.current = currentItem?.url;
|
|
5037
|
+
}, [index, currentItem?.url, clearSlideCommitTimer]);
|
|
5038
|
+
|
|
5039
|
+
useLayoutEffect(() => {
|
|
5040
|
+
const rapidDirection = rapidNavDirectionRef.current;
|
|
5041
|
+
if (rapidDirection === null) return;
|
|
5042
|
+
|
|
5043
|
+
rapidNavDirectionRef.current = null;
|
|
5044
|
+
requestAnimationFrame(() => {
|
|
5045
|
+
startProgrammaticSlideRef.current(rapidDirection);
|
|
5046
|
+
});
|
|
5047
|
+
}, [index, currentItem?.url]);
|
|
4921
5048
|
|
|
4922
5049
|
useEffect(() => {
|
|
4923
5050
|
if (phase !== 'open') return;
|
|
@@ -5161,7 +5288,7 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
5161
5288
|
width: contentRect?.width,
|
|
5162
5289
|
height: contentRect?.height,
|
|
5163
5290
|
objectFit: objectFitStyle,
|
|
5164
|
-
pointerEvents: isCurrentVideo && isOpen && !
|
|
5291
|
+
pointerEvents: isCurrentVideo && isOpen && !isHorizontalNavActive ? 'auto' : 'none',
|
|
5165
5292
|
touchAction: isCurrentVideo && isOpen ? 'none' : undefined,
|
|
5166
5293
|
};
|
|
5167
5294
|
|
|
@@ -5288,7 +5415,7 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
5288
5415
|
</div>
|
|
5289
5416
|
|
|
5290
5417
|
{finalRect && viewportRect && neighborItem && (
|
|
5291
|
-
<div style={neighborBackingStyle}>
|
|
5418
|
+
<div style={neighborBackingStyle} onTransitionEnd={handleSlideTransitionEnd}>
|
|
5292
5419
|
{isVideoMedia(neighborItem) ? (
|
|
5293
5420
|
<video
|
|
5294
5421
|
key={\`neighbor-\${neighborIndex}-\${neighborItem.url}\`}
|
|
@@ -5310,7 +5437,7 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
5310
5437
|
)}
|
|
5311
5438
|
|
|
5312
5439
|
{finalRect && viewportRect && currentItem && (
|
|
5313
|
-
<div style={currentBackingStyle}>
|
|
5440
|
+
<div style={currentBackingStyle} onTransitionEnd={handleSlideTransitionEnd}>
|
|
5314
5441
|
{isCurrentVideo ? (
|
|
5315
5442
|
<LightboxVideo
|
|
5316
5443
|
key={\`\${index}-\${currentItem.url}\`}
|
|
@@ -5342,7 +5469,7 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
5342
5469
|
...navOverlayBaseStyle,
|
|
5343
5470
|
left: contentRect!.left,
|
|
5344
5471
|
cursor: 'w-resize',
|
|
5345
|
-
pointerEvents:
|
|
5472
|
+
pointerEvents: isSwiping ? 'none' : 'auto',
|
|
5346
5473
|
}}
|
|
5347
5474
|
onClick={(e) => {
|
|
5348
5475
|
if (touchInteractionRef.current) {
|
|
@@ -5358,7 +5485,7 @@ function Lightbox({ prefix: P, items, index, imageDisplay, isEditor, onClose, on
|
|
|
5358
5485
|
...navOverlayBaseStyle,
|
|
5359
5486
|
left: contentRect!.left + contentRect!.width / 2,
|
|
5360
5487
|
cursor: 'e-resize',
|
|
5361
|
-
pointerEvents:
|
|
5488
|
+
pointerEvents: isSwiping ? 'none' : 'auto',
|
|
5362
5489
|
}}
|
|
5363
5490
|
onClick={(e) => {
|
|
5364
5491
|
if (touchInteractionRef.current) {
|
|
@@ -5520,6 +5647,10 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
5520
5647
|
const resEntriesCount = entriesCount === 0 ? Infinity : entriesCount;
|
|
5521
5648
|
|
|
5522
5649
|
const cropContent = (content ?? []).slice(0, resEntriesCount);
|
|
5650
|
+
const lightboxMediaToPreload = useMemo(
|
|
5651
|
+
() => (lightbox === 'on' ? collectGridLightboxMedia(cropContent) : []),
|
|
5652
|
+
[cropContent, lightbox],
|
|
5653
|
+
);
|
|
5523
5654
|
|
|
5524
5655
|
const size = gridLayout.entryWidth ?? 0.2;
|
|
5525
5656
|
|
|
@@ -5635,6 +5766,7 @@ export function Grid({ settings, content, isEditor, isPreviewMode, isEditMode, m
|
|
|
5635
5766
|
return (
|
|
5636
5767
|
<>
|
|
5637
5768
|
<style dangerouslySetInnerHTML={{ __html: scopedCss }} />
|
|
5769
|
+
{lightbox === 'on' && <LightboxMediaPreloadPool mediaList={lightboxMediaToPreload} />}
|
|
5638
5770
|
<div style={colorVars}>
|
|
5639
5771
|
<div
|
|
5640
5772
|
ref={containerRef}
|
|
@@ -6047,12 +6179,12 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
6047
6179
|
};
|
|
6048
6180
|
|
|
6049
6181
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
6050
|
-
`,Gr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},cg=["titleColor","subtitleColor","lightboxCounterColor"],dg={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},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:"Gutter",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Gr.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:{...Gr.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:{...Gr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"b",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,imageCorners:0,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","imageCorners","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay","imageCorners"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...cg],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},ug={element:rg,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:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:dg,sourceCode:lg},pg=50,As=10,Ka="cntrl-lightbox-journal",Ir=Ka,xa=`${Ka}-`,Rr=e=>`${Ka}-${e}`,Xa=e=>e===Ir||e.startsWith(xa),Fs=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Ws=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Fs(t.get(Rr(e)));if(i)return i}const n=Fs(t.get(Ir));if(n)return n;for(const[i]of t){if(!i.startsWith(xa))continue;const o=i.slice(xa.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},_s=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},cc=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Xa(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Rr(t),String(e)):i.searchParams.set(Ir,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},mg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Rr(e)||i===Ir:Xa(i));if(n.forEach(i=>t.searchParams.delete(i)),n.length>0){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},dc=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Rr(e)):[...t.keys()].some(n=>Xa(n))},gg=(e,t)=>{if(dc(t)){if(e){window.history.back();return}mg(t)}},hg=20,fg=2,qr=e=>`max(${e}, ${hg}px)`,Wi=e=>((e==null?void 0:e.image)??[]).slice(0,fg),uc=e=>e.reduce((t,n)=>t+Wi(n).length,0),yg=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+Wi(s).length,1),i=Wi(e[t]).length;return{start:n,end:n+i-1}},vg=(e,t)=>{const n=uc(e),{start:i,end:o}=yg(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},nr=(e,t)=>t==="B"?e.flatMap((n,i)=>Wi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Wi(n)})),xg=(e,t,n,i)=>{var s;if(n==="B")return`${t+1} / ${e.length}`;const o=((s=e[t])==null?void 0:s.entryIndex)??0;return vg(i,o)},Ns=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",bg=(e,t,n)=>e==="B"?t.length>1:uc(n)>1,gn=.004,Bn=.004,Mi={title1Width:.13,title2Width:.13,title3Width:.14},Vn=(e,t,n,i,o)=>{const s=[];return t.title1&&s.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&s.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&s.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),s},_i=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},yo=(e,t)=>_i(e,t),an=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Gn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:_i(e.length,n),effective:yo(e.length,n)}},pc=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),mc=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),Kn=["title1","title2","title3","count"],Ye=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Ya={title1:"1",title2:"2",title3:"3",count:"Count"},Za=e=>[Ye(e,"fontFamily"),Ye(e,"fontSettings"),{type:"row",items:[Ye(e,"fontSize"),Ye(e,"lineHeight"),Ye(e,"letterSpacing"),Ye(e,"wordSpacing")]},Ye(e,"textAlign"),Ye(e,"textAppearance")],wg=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[Ya[e],Za(e)]))}),Sg={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},$g={title1:.02,title2:.02,title3:.02,count:.017},di=(e,t)=>{const n=i=>{const o=Ye(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Sg[t]]}},ui=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??$g[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return zt(i,n)};function gc({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:w=0,title3MarginLeft:v=0,titleRowMarginBottom:T=0,titleHeaderLayout:g="desktop",contentMarginTop:$=0,iconMarginRight:f=0,closeIcon:R=null,closeIconMaxWidth:L=0,closeIconColor:I="#000000",closeIconHoverColor:Y="#cccccc"}=n,P=x.scalingValue($,i),V=x.scalingValue(f,i),M=x.scalingValue(T,i),C=g==="mobile",A=ui("title1",di(n,"title1"),i),y=ui("title2",di(n,"title2"),i),S=ui("title3",di(n,"title3"),i),F=a.useMemo(()=>({title1Width:d??Mi.title1Width,title2Width:c??Mi.title2Width,title3Width:u??Mi.title3Width}),[d,c,u]),W=a.useMemo(()=>({title2MarginLeft:w,title3MarginLeft:v}),[w,v]),U=a.useMemo(()=>Vn(e,t,A,y,S),[e,t,A,y,S]),G=a.useMemo(()=>U.map(z=>F[z.widthKey]),[U,F]),J=a.useMemo(()=>_i(U.length,G),[U.length,G]),D=a.useMemo(()=>yo(U.length,G),[U.length,G]),j=a.useMemo(()=>U.filter(z=>z.prefix==="title1"),[U]),O=a.useMemo(()=>U.filter(z=>z.prefix==="title2"||z.prefix==="title3"),[U]),E=a.useMemo(()=>Gn(j,F),[j,F]),K=a.useMemo(()=>Gn(O,F),[O,F]),Z=!!(t.title1||t.title2||t.title3),ce=R!==null;if(!(Z||ce))return null;const pe=(p??0)>0||o,b=(z,le)=>{const Re=U.findIndex(_=>_.prefix===z.prefix);if(!C||le==="single-row")return{effectiveWidth:D[Re]??0,resolvedWidth:J[Re]??0,maxWidth:an(Re,J)};if(le==="two-row-top"){const _=j.findIndex(Ne=>Ne.prefix===z.prefix);return{effectiveWidth:E.effective[_]??0,resolvedWidth:E.resolved[_]??0,maxWidth:an(_,E.resolved)}}const ae=O.findIndex(_=>_.prefix===z.prefix);return{effectiveWidth:K.effective[ae]??0,resolvedWidth:K.resolved[ae]??0,maxWidth:an(ae,K.resolved)}},he=(z,le,Re)=>{if(!C||Re==="single-row"){const et=z.findIndex(ne=>ne.prefix===le.prefix),Ke=z.map(ne=>F[ne.widthKey]),Ie=_i(z.length,Ke);return{effectiveWidth:yo(z.length,Ke)[et]??0,resolvedWidth:Ie[et]??0,maxWidth:an(et,Ie)}}if(Re==="two-row-top"){const et=z.filter(ne=>ne.prefix==="title1"),Ke=et.findIndex(ne=>ne.prefix===le.prefix),{resolved:Ie,effective:ee}=Gn(et,F);return{effectiveWidth:ee[Ke]??0,resolvedWidth:Ie[Ke]??0,maxWidth:an(Ke,Ie)}}const ae=z.filter(et=>et.prefix==="title2"||et.prefix==="title3"),_=ae.findIndex(et=>et.prefix===le.prefix),{resolved:Ne,effective:Fe}=Gn(ae,F);return{effectiveWidth:Fe[_]??0,resolvedWidth:Ne[_]??0,maxWidth:an(_,Ne)}},Q=z=>mc(U,J,W,z)+(C?0:p??0),we=()=>C?0:p??0,Te=z=>O.slice(0,z).reduce((le,Re,ae)=>le+(Re.marginLeftKey?W[Re.marginLeftKey]??0:0)+(K.resolved[ae]??0),0),se=z=>{const le=O[z];return Te(z)+(le.marginLeftKey?W[le.marginLeftKey]??0:0)+(K.resolved[z]??0)},oe=(z,le,Re)=>{const ae=z.marginLeftKey?W[z.marginLeftKey]??0:0,{effectiveWidth:_,resolvedWidth:Ne,maxWidth:Fe}=Re??b(z,le),et=Math.max(ae,Bn),Ke=o&&le==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":z.prefix,style:{width:x.scalingValue(_,i),...ae>0?{marginLeft:x.scalingValue(ae,i)}:{}},children:[r.jsx("p",{className:z.className,style:z.style,children:z.text}),Ke&&z.marginLeftKey?r.jsx("div",{"data-controls":z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:x.scalingValue(-ae,i),width:x.scalingValue(et,i),height:"100%",pointerEvents:"auto"}}):null,Ke?r.jsx("div",{"data-controls":z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:x.scalingValue(-gn/2,i),width:x.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}}):null]},z.className)},q=(z="two-row")=>{const le=U.findIndex(_=>_.prefix==="title1"),Re=le>=0?J[le]:F.title1Width,ae=z==="two-row"&&o;return r.jsx("div",{...ae?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Re)}:{},style:{width:x.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...ae?{pointerEvents:"auto"}:{}}})},de=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:A,"aria-hidden":"true",children:" "}),ge=z=>{const le=Vn(e,z,A,y,S);return r.jsx(r.Fragment,{children:le.map(Re=>oe(Re,"single-row",he(le,Re,"single-row")))})},_e=z=>{const le=Vn(e,z,A,y,S),Re=le.find(ae=>ae.prefix==="title1");return Re?oe(Re,"two-row-top",he(le,Re,"two-row-top")):null},Ce=(z,le=!1)=>{const Re=Vn(e,z,A,y,S),ae=Re.filter(Fe=>Fe.prefix==="title2"||Fe.prefix==="title3"),_=o&≤return ae.length>0||_||(T??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ae.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:ae.map(Fe=>oe(Fe,"two-row-bottom",he(Re,Fe,"two-row-bottom")))}),le&&o?r.jsxs(r.Fragment,{children:[me(),Ee()]}):null]}):null,(T??0)>0||_?r.jsx("div",{"data-controls":_?"titleRowMarginBottom":void 0,"data-controls-axis":_?"y":void 0,"data-controls-reverse":_?"":void 0,className:_?`${e}-control`:void 0,style:{height:M,width:"100%",flexShrink:0,pointerEvents:_?"auto":"none"}}):null]}):null},Me=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:x.scalingValue(L??0,i),height:x.scalingValue(L??0,i),marginRight:V,"--close-icon-hover-color":Y},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:z=>{z.stopPropagation(),l==null||l()},"aria-label":"Close",children:r.jsx(on,{url:R??"",fill:I,hoverFill:i&&!s?I:Y,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:V,height:"100%",pointerEvents:"auto"}})]}),fe=()=>ce?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:Me()}):null,ye=z=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:z})}),Se=z=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[ce||Z?de():null,pe?q("two-row"):null,ye(z),fe()]}),B=(z,le=!1)=>r.jsxs(r.Fragment,{children:[Se(_e(z)),Ce(z,le)]}),ue=()=>{const z=C?-1:U.findIndex(ae=>ae.prefix==="title1"),le=!C&&(o||(p??0)>0)?(()=>{const ae=p??0,_=z>=0?J[z]:F.title1Width,Ne=Math.max(ae,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(_),style:{position:"absolute",top:0,left:0,width:x.scalingValue(Ne,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Re=U.flatMap((ae,_)=>{if(!ae.marginLeftKey)return[];const Ne=W[ae.marginLeftKey]??0,Fe=pc(U,J,W,_)+we(),et=Math.max(Ne,Bn);return r.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(J[_]),style:{position:"absolute",top:0,left:x.scalingValue(Fe,i),width:x.scalingValue(et,i),height:"100%",pointerEvents:"auto"}},ae.marginLeftKey)});return le?[le,...Re]:Re},ve=()=>U.map((z,le)=>{const Re=an(le,J),_=Q(le)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Re),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:x.scalingValue(_,i),width:x.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${z.widthKey}-junction`)}),me=()=>O.flatMap((z,le)=>{if(!z.marginLeftKey)return[];const Re=W[z.marginLeftKey]??0,ae=Te(le),_=Math.max(Re,Bn),{resolvedWidth:Ne}=b(z,"two-row-bottom");return r.jsx("div",{"data-controls":z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ne),style:{position:"absolute",top:0,left:x.scalingValue(ae,i),width:x.scalingValue(_,i),height:"100%",pointerEvents:"auto"}},z.marginLeftKey)}),Ee=()=>O.map((z,le)=>{const{maxWidth:Re}=b(z,"two-row-bottom"),_=se(le)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Re),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:x.scalingValue(_,i),width:x.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${z.widthKey}-junction`)}),be=()=>!o||C?null:r.jsxs(r.Fragment,{children:[ue(),ve()]}),k=!!(t.title2||t.title3||(T??0)>0||o),re=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ce||Z?de():null,pe?q("single-row"):null,Z?ye(ge(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),fe(),be()]}),te=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...k?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:k?void 0:{flex:"0 0 auto",height:"auto"},children:B(t,!0)}),be()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:P,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...C?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${C?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${C?` ${e}-text-bar-cell-stacked`:""}`,style:C?void 0:{flex:1,minWidth:0,width:"100%"},children:C?te():re()})})})]})}function Cg(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Tg(e){return`
|
|
6182
|
+
`,qr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},gg=["titleColor","subtitleColor","lightboxCounterColor"],hg={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["gallery"]},default:[{title:"Earth-orbital mission",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Salton Sea from Above",subtitle:"Hasselblad 500 EL / Zeiss Sonnar 250 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module Pilot",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Lunar Module 3 porch",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Command Module",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"CSM and Lunar Module LM",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"David R. Scott during EVA",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Fourth day of the mission",subtitle:"Hasselblad 500 EL / Zeiss Planar 80 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""},{title:"Landing of the Spider1",subtitle:"Hasselblad SWC/ Zeiss Biogon 38 mm / SO-368 Ektachrome",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}],link:""}]},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c","d","e","f"]},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:"Gutter",min:0}}}},textBoxWidth:{type:"number",scope:"layout",title:"Text Width (%)",display:{type:"percentage-input"},min:0},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},showText:{type:"boolean",scope:"common",title:"Show text",display:{type:"toggle-cycle",enum:["always","on hover"]}},alignEntries:{type:"boolean",scope:"layout",title:"Align entries",display:{type:"toggle-cycle",enum:["on","off"]}},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},imageCorners:{type:"number",scope:"layout",title:"Round corners",min:0,display:{type:"numeric-input"}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},slider:{type:"boolean",scope:"common",title:"Slider",display:{type:"toggle-cycle",enum:["on","off"]}},sliderTiming:{type:"number",scope:"common",title:"Timing (Sec)",display:{type:"common-numeric-input"},min:1,max:10},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical","random"],enabled:!0}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","slide"]}},titleMarginTop:{type:"number",scope:"layout",title:"Title margin top",min:0,max:100,display:{type:"range-control"}},subtitleMarginTop:{type:"number",scope:"layout",title:"Subtitle margin top",min:0,max:100,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Entry",display:{type:"palette-color-picker"}},subtitleColor:{type:"string",scope:"common",title:"Subtitle Entry",display:{type:"palette-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...qr.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:{...qr.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:{...qr.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"b",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,imageCorners:0,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","imageCorners","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay","imageCorners"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...gg],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},fg={element:dg,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:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"subtitleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",subtitleFontSettings:"subtitleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"},schema:hg,sourceCode:mg},yg=50,Al=10,Ka="cntrl-lightbox-journal",Rr=Ka,ba=`${Ka}-`,Mr=e=>`${Ka}-${e}`,Xa=e=>e===Rr||e.startsWith(ba),Fl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Wl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Fl(t.get(Mr(e)));if(i)return i}const n=Fl(t.get(Rr));if(n)return n;for(const[i]of t){if(!i.startsWith(ba))continue;const o=i.slice(ba.length);if(!/^\d+$/.test(o))continue;const l=Number.parseInt(o,10);if(Number.isFinite(l)&&l>=1)return l}return null},_l=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},mc=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(s=>{Xa(s)&&i.searchParams.delete(s)}),t?i.searchParams.set(Mr(t),String(e)):i.searchParams.set(Rr,String(e));const o=n?"replaceState":"pushState",l=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",l)},vg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Mr(e)||i===Rr:Xa(i));if(n.forEach(i=>t.searchParams.delete(i)),n.length>0){const i=`${t.pathname}${t.search}${t.hash}`;window.history.replaceState(window.history.state,"",i)}},gc=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Mr(e)):[...t.keys()].some(n=>Xa(n))},xg=(e,t)=>{if(gc(t)){if(e){window.history.back();return}vg(t)}},bg=20,wg=2,Ur=e=>`max(${e}, ${bg}px)`,Hi=e=>((e==null?void 0:e.image)??[]).slice(0,wg),hc=e=>e.reduce((t,n)=>t+Hi(n).length,0),Sg=(e,t)=>{const n=e.slice(0,t).reduce((o,l)=>o+Hi(l).length,1),i=Hi(e[t]).length;return{start:n,end:n+i-1}},$g=(e,t)=>{const n=hc(e),{start:i,end:o}=Sg(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},ir=(e,t)=>t==="B"?e.flatMap((n,i)=>Hi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Hi(n)})),Cg=(e,t,n,i)=>{var l;if(n==="B")return`${t+1} / ${e.length}`;const o=((l=e[t])==null?void 0:l.entryIndex)??0;return $g(i,o)},Nl=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Tg=(e,t,n)=>e==="B"?t.length>1:hc(n)>1,gn=.004,Bn=.004,Ai={title1Width:.13,title2Width:.13,title3Width:.14},Vn=(e,t,n,i,o)=>{const l=[];return t.title1&&l.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&l.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&l.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),l},Oi=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const c=Math.min(l,d);return{overflow:l-c,widths:[d-c,...s]}},{overflow:i-1,widths:[]});return o},xo=(e,t)=>Oi(e,t),ln=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Gn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Oi(e.length,n),effective:xo(e.length,n)}},fc=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),yc=(e,t,n,i)=>e.slice(0,i+1).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),Kn=["title1","title2","title3","count"],Ze=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Ya={title1:"1",title2:"2",title3:"3",count:"Count"},Za=e=>[Ze(e,"fontFamily"),Ze(e,"fontSettings"),{type:"row",items:[Ze(e,"fontSize"),Ze(e,"lineHeight"),Ze(e,"letterSpacing"),Ze(e,"wordSpacing")]},Ze(e,"textAlign"),Ze(e,"textAppearance")],Lg=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[Ya[e],Za(e)]))}),Ig={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Rg={title1:.02,title2:.02,title3:.02,count:.017},ui=(e,t)=>{const n=i=>{const o=Ze(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Ig[t]]}},pi=(e,t,n)=>{var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??Rg[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Vt(i,n)};function vc({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:b=0,title3MarginLeft:S=0,titleRowMarginBottom:L=0,titleHeaderLayout:f="desktop",contentMarginTop:h=0,iconMarginRight:y=0,closeIcon:E=null,closeIconMaxWidth:I=0,closeIconColor:T="#000000",closeIconHoverColor:X="#cccccc"}=n,k=w.scalingValue(h,i),B=w.scalingValue(y,i),P=w.scalingValue(L,i),C=f==="mobile",z=pi("title1",ui(n,"title1"),i),v=pi("title2",ui(n,"title2"),i),_=pi("title3",ui(n,"title3"),i),R=a.useMemo(()=>({title1Width:d??Ai.title1Width,title2Width:c??Ai.title2Width,title3Width:u??Ai.title3Width}),[d,c,u]),Z=a.useMemo(()=>({title2MarginLeft:b,title3MarginLeft:S}),[b,S]),A=a.useMemo(()=>Vn(e,t,z,v,_),[e,t,z,v,_]),U=a.useMemo(()=>A.map(j=>R[j.widthKey]),[A,R]),V=a.useMemo(()=>Oi(A.length,U),[A.length,U]),G=a.useMemo(()=>xo(A.length,U),[A.length,U]),ne=a.useMemo(()=>A.filter(j=>j.prefix==="title1"),[A]),$=a.useMemo(()=>A.filter(j=>j.prefix==="title2"||j.prefix==="title3"),[A]),M=a.useMemo(()=>Gn(ne,R),[ne,R]),N=a.useMemo(()=>Gn($,R),[$,R]),Q=!!(t.title1||t.title2||t.title3),ie=E!==null;if(!(Q||ie))return null;const pe=(p??0)>0||o,x=(j,Y)=>{const Re=A.findIndex(H=>H.prefix===j.prefix);if(!C||Y==="single-row")return{effectiveWidth:G[Re]??0,resolvedWidth:V[Re]??0,maxWidth:ln(Re,V)};if(Y==="two-row-top"){const H=ne.findIndex(De=>De.prefix===j.prefix);return{effectiveWidth:M.effective[H]??0,resolvedWidth:M.resolved[H]??0,maxWidth:ln(H,M.resolved)}}const le=$.findIndex(H=>H.prefix===j.prefix);return{effectiveWidth:N.effective[le]??0,resolvedWidth:N.resolved[le]??0,maxWidth:ln(le,N.resolved)}},se=(j,Y,Re)=>{if(!C||Re==="single-row"){const tt=j.findIndex(ge=>ge.prefix===Y.prefix),Qe=j.map(ge=>R[ge.widthKey]),at=Oi(j.length,Qe);return{effectiveWidth:xo(j.length,Qe)[tt]??0,resolvedWidth:at[tt]??0,maxWidth:ln(tt,at)}}if(Re==="two-row-top"){const tt=j.filter(ge=>ge.prefix==="title1"),Qe=tt.findIndex(ge=>ge.prefix===Y.prefix),{resolved:at,effective:$e}=Gn(tt,R);return{effectiveWidth:$e[Qe]??0,resolvedWidth:at[Qe]??0,maxWidth:ln(Qe,at)}}const le=j.filter(tt=>tt.prefix==="title2"||tt.prefix==="title3"),H=le.findIndex(tt=>tt.prefix===Y.prefix),{resolved:De,effective:_e}=Gn(le,R);return{effectiveWidth:_e[H]??0,resolvedWidth:De[H]??0,maxWidth:ln(H,De)}},J=j=>yc(A,V,Z,j)+(C?0:p??0),ye=()=>C?0:p??0,Me=j=>$.slice(0,j).reduce((Y,Re,le)=>Y+(Re.marginLeftKey?Z[Re.marginLeftKey]??0:0)+(N.resolved[le]??0),0),de=j=>{const Y=$[j];return Me(j)+(Y.marginLeftKey?Z[Y.marginLeftKey]??0:0)+(N.resolved[j]??0)},ce=(j,Y,Re)=>{const le=j.marginLeftKey?Z[j.marginLeftKey]??0:0,{effectiveWidth:H,resolvedWidth:De,maxWidth:_e}=Re??x(j,Y),tt=Math.max(le,Bn),Qe=o&&Y==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":j.prefix,style:{width:w.scalingValue(H,i),...le>0?{marginLeft:w.scalingValue(le,i)}:{}},children:[r.jsx("p",{className:j.className,style:j.style,children:j.text}),Qe&&j.marginLeftKey?r.jsx("div",{"data-controls":j.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(De),style:{position:"absolute",top:0,left:w.scalingValue(-le,i),width:w.scalingValue(tt,i),height:"100%",pointerEvents:"auto"}}):null,Qe?r.jsx("div",{"data-controls":j.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(_e),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:w.scalingValue(-gn/2,i),width:w.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}}):null]},j.className)},q=(j="two-row")=>{const Y=A.findIndex(H=>H.prefix==="title1"),Re=Y>=0?V[Y]:R.title1Width,le=j==="two-row"&&o;return r.jsx("div",{...le?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Re)}:{},style:{width:w.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...le?{pointerEvents:"auto"}:{}}})},ee=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:z,"aria-hidden":"true",children:" "}),me=j=>{const Y=Vn(e,j,z,v,_);return r.jsx(r.Fragment,{children:Y.map(Re=>ce(Re,"single-row",se(Y,Re,"single-row")))})},Fe=j=>{const Y=Vn(e,j,z,v,_),Re=Y.find(le=>le.prefix==="title1");return Re?ce(Re,"two-row-top",se(Y,Re,"two-row-top")):null},Ce=(j,Y=!1)=>{const Re=Vn(e,j,z,v,_),le=Re.filter(_e=>_e.prefix==="title2"||_e.prefix==="title3"),H=o&&Y;return le.length>0||H||(L??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[le.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:le.map(_e=>ce(_e,"two-row-bottom",se(Re,_e,"two-row-bottom")))}),Y&&o?r.jsxs(r.Fragment,{children:[be(),Ie()]}):null]}):null,(L??0)>0||H?r.jsx("div",{"data-controls":H?"titleRowMarginBottom":void 0,"data-controls-axis":H?"y":void 0,"data-controls-reverse":H?"":void 0,className:H?`${e}-control`:void 0,style:{height:P,width:"100%",flexShrink:0,pointerEvents:H?"auto":"none"}}):null]}):null},Ae=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:w.scalingValue(I??0,i),height:w.scalingValue(I??0,i),marginRight:B,"--close-icon-hover-color":X},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:j=>{j.stopPropagation(),s==null||s()},"aria-label":"Close",children:r.jsx(rn,{url:E??"",fill:T,hoverFill:i&&!l?T:X,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:B,height:"100%",pointerEvents:"auto"}})]}),ue=()=>ie?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:Ae()}):null,fe=j=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:j})}),Se=j=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[ie||Q?ee():null,pe?q("two-row"):null,fe(j),ue()]}),D=(j,Y=!1)=>r.jsxs(r.Fragment,{children:[Se(Fe(j)),Ce(j,Y)]}),oe=()=>{const j=C?-1:A.findIndex(le=>le.prefix==="title1"),Y=!C&&(o||(p??0)>0)?(()=>{const le=p??0,H=j>=0?V[j]:R.title1Width,De=Math.max(le,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(H),style:{position:"absolute",top:0,left:0,width:w.scalingValue(De,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Re=A.flatMap((le,H)=>{if(!le.marginLeftKey)return[];const De=Z[le.marginLeftKey]??0,_e=fc(A,V,Z,H)+ye(),tt=Math.max(De,Bn);return r.jsx("div",{"data-controls":le.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(V[H]),style:{position:"absolute",top:0,left:w.scalingValue(_e,i),width:w.scalingValue(tt,i),height:"100%",pointerEvents:"auto"}},le.marginLeftKey)});return Y?[Y,...Re]:Re},he=()=>A.map((j,Y)=>{const Re=ln(Y,V),H=J(Y)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":j.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Re),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:w.scalingValue(H,i),width:w.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${j.widthKey}-junction`)}),be=()=>$.flatMap((j,Y)=>{if(!j.marginLeftKey)return[];const Re=Z[j.marginLeftKey]??0,le=Me(Y),H=Math.max(Re,Bn),{resolvedWidth:De}=x(j,"two-row-bottom");return r.jsx("div",{"data-controls":j.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(De),style:{position:"absolute",top:0,left:w.scalingValue(le,i),width:w.scalingValue(H,i),height:"100%",pointerEvents:"auto"}},j.marginLeftKey)}),Ie=()=>$.map((j,Y)=>{const{maxWidth:Re}=x(j,"two-row-bottom"),H=de(Y)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":j.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Re),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:w.scalingValue(H,i),width:w.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${j.widthKey}-junction`)}),xe=()=>!o||C?null:r.jsxs(r.Fragment,{children:[oe(),he()]}),W=!!(t.title2||t.title3||(L??0)>0||o),ae=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ie||Q?ee():null,pe?q("single-row"):null,Q?fe(me(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ue(),xe()]}),te=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...W?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:W?void 0:{flex:"0 0 auto",height:"auto"},children:D(t,!0)}),xe()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:k,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...C?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${C?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${C?` ${e}-text-bar-cell-stacked`:""}`,style:C?void 0:{flex:1,minWidth:0,width:"100%"},children:C?te():ae()})})})]})}function Mg(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Eg(e){return`
|
|
6051
6183
|
.${e}-wrapper {
|
|
6052
6184
|
display: grid;
|
|
6053
6185
|
align-items: start;
|
|
6054
6186
|
justify-content: center;
|
|
6055
|
-
min-height: ${
|
|
6187
|
+
min-height: ${Mg(48)};
|
|
6056
6188
|
}
|
|
6057
6189
|
.${e}-item {
|
|
6058
6190
|
display: flex;
|
|
@@ -6367,7 +6499,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
6367
6499
|
pointer-events: auto;
|
|
6368
6500
|
flex-shrink: 0;
|
|
6369
6501
|
}
|
|
6370
|
-
`}const Hs={url:"",name:"",objectFit:"cover"},$n=500,Zi=650,un="cubic-bezier(0.22, 1, 0.36, 1)",Lg=72,Ig=50,Rg=1e4,Eg=650,Mg=500;function kg(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function hc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=dr(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function Pg(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?hc(i,n):null}function Ag(e){return e.reduce((t,n,i)=>{const o=Ja(n.gallery),l=Qa(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function to(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function Os(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return to(e,i,n)}const Fg=.03;function fc(e){return e.width*Fg}const Ur={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Do(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Ds(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Wg(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ba(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function _g(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ba(e,t.width,t.height)}function Ng(e,t){if(Ki(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function Hg(e){const t=new Set,n=[];for(const i of e){const o=Ja(i.gallery),s=Qa(o);for(const l of s)for(const d of[l.displayMedia,l.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function Og({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Ki(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Ni(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=fc(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function ur(e,t,n){const i=Ni(e,t,n);return{...i,left:2*i.left-e.left}}function Dg(e,t,n){const{left:i,width:o}=n,s=fc(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function yc(e,t,n,i){const o=Ni(e,"left",i),s=Ni(e,"right",i),l=ur(e,"left",i),d=ur(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function jg(e,t,n,i){const{start:o,end:s}=yc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function zg(e,t,n){const i=Ni(e,t,n),o=ur(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function vc(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function Ja(e){if(!e)return;if(vc(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.url?t:void 0,o=n!=null&&n.url?n:void 0;if(!(!i&&!o))return[{media:[o??i??Hs,i??o??Hs]}]}function Bg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Vg(e){const[t]=e.media;return t!=null&&t.url?t:null}function Qa(e){if(!Array.isArray(e)||e.length===0)return[];if(vc(e)){const t=[];for(const n of e){const i=Bg(n);if(!i)continue;const o=Vg(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ki(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Gg({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Ki(e)?r.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):r.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function qg({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function jo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Ki(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function Ug({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:w,sourceRect:v,resolveCloseSourceRect:T,onClose:g,onPrev:$,onNext:f}){const R=a.useRef(null),L=a.useRef(null),I=a.useRef(null),Y=a.useRef(new Map),[P,V]=a.useState(0),M=a.useRef(null),C=a.useRef(0),A=a.useRef(0),y=a.useRef("none"),S=a.useRef(!1),F=a.useRef(!1),W=a.useRef(!1),U=a.useRef(null),G=a.useRef(null),J=a.useRef(null),D=a.useRef(()=>{}),j=a.useRef(null),O=a.useRef(null),E=a.useRef(null),K=a.useRef(!1),[Z,ce]=a.useState(null),[N,pe]=a.useState(Ur),[b,he]=a.useState(0),[Q,we]=a.useState("opening"),[Te,se]=a.useState(0),[oe,q]=a.useState(0),[de,ge]=a.useState(!1),[_e,Ce]=a.useState(null),[Me,fe]=a.useState(null),[ye,Se]=a.useState(null),[B,ue]=a.useState(!1),[ve,me]=a.useState(null),[Ee,be]=a.useState(!1),k=a.useRef(!1),[re,te]=a.useState(!1),[z,le]=a.useState(!1),Re=a.useRef(n),ae=a.useRef(void 0),_=t[n],Ne=_?Ki(_):!1,Fe=oe!==0||de,et=!l&&(!s||!!d),Ke=c&&!l,Ie=u.length>1,ee=a.useCallback((h,xe)=>t.length<=1?null:t[(h+xe+t.length)%t.length]??null,[t]),ne=Ie?to(u,p,-1):ee(n,-1),He=Ie?to(u,p,1):ee(n,1),st=_e===-1&&Fe?Ie&&Me!==null?to(u,Me,-1):ye!==null?ee(ye,-1):null:null,Be=_e===1&&Fe?Ie&&Me!==null?to(u,Me,1):ye!==null?ee(ye,1):null:null,Oe=st&&st.url!==(ne==null?void 0:ne.url)?st:null,je=Be&&Be.url!==(He==null?void 0:He.url)?Be:null,qe=ne&&Ke?(()=>{const h=Ie?Os(u,p,-1):t.length>2?ee((n-1+t.length)%t.length,-1):null;return h&&h.url!==ne.url?h:null})():null,tt=He&&Ke?(()=>{const h=Ie?Os(u,p,1):t.length>2?ee((n+1)%t.length,1):null;return h&&h.url!==He.url?h:null})():null,mt=Oe??qe,St=je??tt,lt=a.useCallback((h,xe,Pe)=>{if(!h||!xe||!Pe)return;const Ae=Y.current,at=Ae.get(h);(at==null?void 0:at.width)===xe&&(at==null?void 0:at.height)===Pe||(Ae.set(h,{width:xe,height:Pe}),V(At=>At+1))},[]),pt=a.useCallback(h=>{if(!(h!=null&&h.url))return null;const xe=Y.current.get(h.url);return _g(L.current,xe)},[P,b]),Mt=a.useCallback(()=>{if(!_)return;const h=pt(_);if(h){ce(h);return}const xe=L.current;xe&&ce(Ds(xe))},[_,pt]),nt=a.useCallback(h=>{if(Ie){const xe=u.length;fe((p+h+xe)%xe),Se(null);return}t.length>1&&(Se((n+h+t.length)%t.length),fe(null))},[Ie,u.length,p,t.length,n]),Ve=a.useCallback(h=>{W.current=h,ge(h)},[]),De=a.useCallback(()=>{U.current!==null&&(window.clearTimeout(U.current),U.current=null)},[]),vt=a.useCallback(()=>{De(),U.current=window.setTimeout(()=>{De(),Ve(!1)},Zi+32)},[De,Ve]),bt=a.useCallback(()=>{const h=R.current;if(!h){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ur.width,height:typeof window<"u"?window.innerHeight:Ur.height});return}const xe=h.getBoundingClientRect();pe({left:xe.left,top:xe.top,width:xe.width,height:xe.height})},[]),Pt=a.useCallback((h,xe)=>{if(Fe){if(re&&!de)return`translate(${oe}px, 0px)`;if(de&&_e!==null){const Pe=pt(h);if(!Pe)return;const{x:Ae,y:at}=jg(Pe,xe,_e,N);return`translate(${Ae}px, ${at}px)`}if(de)return"translate(0px, 0px)"}},[Fe,re,de,oe,_e,N,pt]),Dt=a.useCallback(()=>{const h=G.current;G.current=null,De(),Ve(!1),Ce(null),fe(null),Se(null),q(0),te(!1),S.current=!1,A.current=0,y.current="none",h===-1?$():h===1&&f()},[De,Ve,$,f]),tn=a.useCallback(()=>{De(),U.current=window.setTimeout(()=>{G.current!==null&&Dt()},Zi+32)},[De,Dt]),ln=a.useCallback(()=>{De(),G.current=null,Ve(!1),Ce(null),fe(null),Se(null),q(0),te(!1),S.current=!1,A.current=0,y.current="none"},[De,Ve]),Tt=a.useCallback(h=>{if(!(!Ke||!Z)){if(W.current){if(G.current===h){J.current=h,Dt();return}ln()}De(),nt(h),G.current=h,Ce(h),Ve(!0),tn()}},[Ke,Z,Dt,ln,De,nt,Ve,tn]);D.current=Tt;const kt=a.useCallback(()=>{j.current=null,K.current=!1,O.current!==null&&(window.clearInterval(O.current),O.current=null),E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),Yt=a.useCallback(h=>{O.current!==null&&window.clearInterval(O.current);const xe=K.current?Mg:Eg;O.current=window.setInterval(()=>{D.current(h)},xe)},[]),qt=a.useCallback(h=>{j.current!==h&&(kt(),j.current=h,K.current=!1,D.current(h),Yt(h),E.current=window.setTimeout(()=>{E.current=null,j.current===h&&(K.current=!0,Yt(h))},Rg))},[kt,Yt]),Le=a.useCallback(()=>{const h=L.current;if(!h)return;const xe=_==null?void 0:_.url,Pe=xe?Y.current.get(xe):void 0;if(Pe!=null&&Pe.width&&(Pe!=null&&Pe.height)){ce(ba(h,Pe.width,Pe.height));return}const Ae=I.current;if(Ae&&xe&&(Ae.src===xe||Ae.currentSrc===xe)){const{width:At,height:Qe}=Wg(Ae);if(At&&Qe){lt(xe,At,Qe),ce(ba(h,At,Qe));return}}const at=Ds(h);!at.width||!at.height||ce(at)},[_==null?void 0:_.url,lt]),Ue=a.useCallback(h=>{if(I.current=h,!!h){if(h instanceof HTMLVideoElement){h.readyState>=1&&h.videoWidth>0&&Le();return}h.complete&&h.naturalWidth>0&&Le()}},[Le]),Xe=a.useCallback(()=>{bt(),Le(),he(h=>h+1)},[bt,Le]);a.useEffect(()=>{Xe();const h=L.current,xe=R.current,Pe=new ResizeObserver(()=>Xe());return h&&Pe.observe(h),xe&&Pe.observe(xe),window.addEventListener("resize",Xe),()=>{Pe.disconnect(),window.removeEventListener("resize",Xe)}},[Xe,n,w]),a.useLayoutEffect(()=>{if(!_)return;const h=I.current;if(h){if(h instanceof HTMLImageElement&&h.complete&&h.naturalWidth>0){Le();return}h instanceof HTMLVideoElement&&h.readyState>=1&&h.videoWidth>0&&Le()}},[_==null?void 0:_.url,n,Le]),a.useEffect(()=>{Mt()},[Mt,P]),a.useEffect(()=>{const h=new Set,xe=[],Pe=Ae=>{!(Ae!=null&&Ae.url)||h.has(Ae.url)||(h.add(Ae.url),xe.push(Ae))};t.forEach(Pe),u.forEach(Ae=>Ae.items.forEach(Pe)),xe.forEach(Ae=>{Y.current.has(Ae.url)||Ng(Ae,lt)})},[t,u,lt]),a.useEffect(()=>{if(Q!=="opening"||!Z)return;if(!v){we("open");return}ue(!1);const h=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ue(!0),we("open")})});return()=>cancelAnimationFrame(h)},[Q,Z,v]),a.useEffect(()=>{if(Q!=="closing")return;const h=setTimeout(()=>g(),$n);return()=>clearTimeout(h)},[Q,g]),a.useEffect(()=>()=>{De()},[De]),a.useLayoutEffect(()=>{Re.current===n&&ae.current===(_==null?void 0:_.url)||(De(),G.current=null,Ce(null),fe(null),Se(null),se(0),q(0),Ve(!1),le(!1),te(!1),C.current=0,A.current=0,y.current="none",S.current=!1,M.current=null,F.current=!1,I.current=null,Mt(),Re.current=n,ae.current=_==null?void 0:_.url)},[n,_==null?void 0:_.url,Ve,De,Mt]),a.useLayoutEffect(()=>{const h=J.current;h!==null&&(J.current=null,requestAnimationFrame(()=>{D.current(h)}))},[n,p,_==null?void 0:_.url]),a.useLayoutEffect(()=>{if(Q==="opening"){k.current=!1,be(!1);return}if(Q!=="open"||k.current)return;if(!ne&&!He){k.current=!0;return}be(!1);const h=requestAnimationFrame(()=>{requestAnimationFrame(()=>{be(!0),k.current=!0})});return()=>cancelAnimationFrame(h)},[Q,ne==null?void 0:ne.url,He==null?void 0:He.url]),a.useEffect(()=>{if(Q!=="open")return;const h=()=>{const Qe=gt=>{gt.stopPropagation(),gt.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},xe=Qe=>{const gt=Qe<0?1:-1;De(),nt(gt),G.current=gt,Ce(gt),Ve(!0),tn()},Pe=Qe=>{if(Math.abs(Qe)>Ig&&Ke){xe(Qe);return}G.current=null,Ce(null),fe(null),Se(null),Ve(!0),q(0),vt()},Ae=Qe=>{if(Qe.touches.length!==1||W.current)return;const gt=Qe.touches[0];F.current=!0,M.current={x:gt.clientX,y:gt.clientY},y.current="none",A.current=0,S.current=!1},at=Qe=>{if(!M.current||Qe.touches.length!==1||W.current)return;const gt=Qe.touches[0],_t=gt.clientX-M.current.x,Et=gt.clientY-M.current.y;if(y.current==="none"){if(Math.abs(_t)<10&&Math.abs(Et)<10)return;if(Math.abs(_t)>Math.abs(Et)){if(!Ke)return;y.current="horizontal"}else if(Et>0){if(!et)return;y.current="vertical"}else return}if(y.current==="horizontal"){S.current=!0,te(!0),A.current=_t,q(_t),Qe.preventDefault();return}y.current==="vertical"&&(S.current=!0,te(!0),C.current=Et,se(Et),Qe.preventDefault())},At=()=>{if(!M.current)return;const Qe=y.current,gt=S.current;if(gt&&Qe==="horizontal")Pe(A.current),h();else if(gt&&Qe==="vertical"){const _t=C.current;if(et&&_t>Lg){const Et=window.innerHeight;C.current=Et,le(!0),se(Et),we("closing")}else C.current=0,se(0);h()}else Qe==="horizontal"&&Math.abs(A.current)>0&&(Pe(A.current),h());M.current=null,y.current="none",A.current=0,S.current=!1,te(!1)};return document.addEventListener("touchstart",Ae,{passive:!0}),document.addEventListener("touchmove",at,{passive:!1}),document.addEventListener("touchend",At),document.addEventListener("touchcancel",At),()=>{document.removeEventListener("touchstart",Ae),document.removeEventListener("touchmove",at),document.removeEventListener("touchend",At),document.removeEventListener("touchcancel",At)}},[Q,Ke,Ve,vt,De,et,tn,nt]);const ct=a.useCallback(()=>{const h=(T==null?void 0:T())??v??null;h&&Z&&(me(h),ue(!0)),we("closing")},[T,v,Z]);a.useEffect(()=>{const h=Ae=>{if(Ae.key==="Escape"){if(s&&d||Q==="closing")return;kt(),ct();return}if(Ae.key!=="ArrowLeft"&&Ae.key!=="ArrowRight"||Q!=="open"||!Ke)return;Ae.preventDefault();const at=Ae.key==="ArrowLeft"?-1:1;Ae.repeat&&j.current===at||qt(at)},xe=Ae=>{if(Ae.key!=="ArrowLeft"&&Ae.key!=="ArrowRight")return;const at=Ae.key==="ArrowLeft"?-1:1;j.current===at&&kt()},Pe=()=>{kt()};return window.addEventListener("keydown",h),window.addEventListener("keyup",xe),window.addEventListener("blur",Pe),()=>{window.removeEventListener("keydown",h),window.removeEventListener("keyup",xe),window.removeEventListener("blur",Pe),kt()}},[Q,s,d,ct,Ke,qt,kt]),a.useEffect(()=>{Q!=="open"&&kt()},[Q,kt]);const Rt=()=>{Q==="closing"||l||ct()},ut=Q==="open",it=Q==="closing",Ut=Te>0?Math.max(0,1-Te/500):1,Ze=Te>0?Math.max(.35,1-Te/500):1,Je=a.useCallback(h=>{if(!(h.propertyName!=="transform"||!W.current)){if(G.current!==null){Dt();return}De(),Ve(!1)}},[De,Ve,Dt]),rt=Q==="closing"?ve??v:v,Lt=rt&&Z&&(Q==="opening"||it)?kg(rt,Z):void 0,It=Fe&&_?Pt(_,"center"):Te>0?`translateY(${Te}px)`:Lt,ft=Z?Do(Z,N):null,Ft=!!(rt&&Z),Ot=Ft&&(Q==="closing"||Q==="open"&&B),Ht={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:It,opacity:Te>0?Ze:Ft?1:Q==="opening"||it?0:1,transition:re&&!de?"none":de?`transform ${Zi}ms ${un}`:z?`transform ${$n}ms ${un}, opacity ${$n}ms ${un}`:Ot?`transform ${$n}ms ${un}`:Q==="opening"||it?`opacity ${$n}ms ${un}`:"none",pointerEvents:Ne&&ut&&!Fe?"auto":"none",touchAction:Ne&&ut?"none":void 0,zIndex:1,overflow:Ne?"hidden":void 0},Vt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:ut&&!Fe?"auto":"none"},xt=(h,xe,Pe="adjacent")=>{const Ae=pt(h);if(!Ae)return{display:"none"};const at=Pe==="far"?xe==="left"?"far-left":"far-right":xe==="left"?"left-adjacent":"right-adjacent",{start:At}=_e!==null?yc(Ae,at,_e,N):{start:Pe==="far"?ur(Ae,xe,N):Ni(Ae,xe,N)},Qe=Do(At,N),gt=Pt(h,at),_t=!Fe&&Pe==="adjacent"&&ut&&!Ee?zg(Ae,xe,N):null,Et=Pe==="far"&&Fe&&_e===(xe==="left"?-1:1),cn=re&&!de?!1:de,dn=Pe==="adjacent"&&ut&&Ee&&!Fe;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:gt??(_t?`translate(${_t.x}px, ${_t.y}px)`:void 0),opacity:Pe==="far"?ut&&Et?1:0:ut?1:0,transition:cn?Pe==="far"?`transform ${Zi}ms ${un}`:`transform ${Zi}ms ${un}, opacity ${$n}ms ${un}`:dn?`transform ${$n}ms ${un}`:Q==="opening"||it?`opacity ${$n}ms ${un}`:"none",pointerEvents:"none",zIndex:1}},Gt=(h,xe)=>{const Pe=pt(h);return Pe?Dg(Ni(Pe,xe,N),xe,N):null},Kt=h=>xe=>{if(!l){if(F.current){F.current=!1;return}xe.stopPropagation(),Tt(h)}},Xt=ne?Gt(ne,"left"):null,Zt=He?Gt(He,"right"):null,jt=Xt?Do(Xt,N):null,wt=Zt?Do(Zt,N):null;return r.jsxs("div",{ref:R,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:Rt,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:ut?Ut:0,transition:re?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:L,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:ut?1:0,transition:re?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"},children:r.jsx(gc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:Rt})})]}),ut&&mt&&r.jsx(jo,{media:mt,style:xt(mt,"left","far"),onMeasure:lt,onTransitionEnd:Je},`far-prev-${mt.url}`),ut&&ne&&r.jsxs(r.Fragment,{children:[r.jsx(jo,{media:ne,style:xt(ne,"left"),onMeasure:lt,onTransitionEnd:Je},`prev-${ne.url}`),jt&&r.jsx("div",{style:{position:"absolute",top:jt.top,left:jt.left,width:jt.width,height:jt.height,cursor:l||re?"default":"pointer",pointerEvents:l||re?"none":"auto",zIndex:3},onClick:Kt(-1)})]}),ut&&He&&r.jsxs(r.Fragment,{children:[r.jsx(jo,{media:He,style:xt(He,"right"),onMeasure:lt,onTransitionEnd:Je},`next-${He.url}`),wt&&r.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||re?"default":"pointer",pointerEvents:l||re?"none":"auto",zIndex:3},onClick:Kt(1)})]}),ut&&St&&r.jsx(jo,{media:St,style:xt(St,"right","far"),onMeasure:lt,onTransitionEnd:Je},`far-next-${St.url}`),Z&&_&&(Ne?r.jsx(qg,{src:_.url,phase:Q,onMediaElement:Ue,wrapperStyle:Ht,videoStyle:Vt,onLoadedMetadata:Le,onTransitionEnd:Je},`${n}-${_.url}`):r.jsx("img",{ref:Ue,src:_.url,alt:_.name,onLoad:Le,onTransitionEnd:Je,style:Ht},`${n}-${_.url}`))]})}function Kg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=x.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:w}=e,v=(w==null?void 0:w.display)==="cover",T=(w==null?void 0:w.ratioValue)??"1:1",g=(w==null?void 0:w.reversed)??!1,[$,f]=T.split(":").map(Number),I=`${g?f:$} / ${g?$:f}`,Y=c.entryWidth??.2,P=c.columnsCount,V=x.scalingValue(Y,n),M=x.scalingValue(c.horizontalGap??0,n),C=V,A=V,y={width:C,...v?{aspectRatio:I,height:"auto",overflow:"hidden"}:{height:"auto"}},S=v?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},F=a.useRef(null),[W,U]=a.useState(!1),[G,J]=a.useState([]),[D,j]=a.useState(0),[O,E]=a.useState(0),[K,Z]=a.useState(null),[ce,N]=a.useState({title1:"",title2:"",title3:""}),pe=(()=>{const ye={},Se=F.current?getComputedStyle(F.current).getPropertyValue("--cntrl-article-width").trim():"";return Se&&(ye["--cntrl-article-width"]=Se),ye})(),b=!n||i||o,he=a.useMemo(()=>Tg(d),[d]),Q=t??[],we=Q.length%P||P,Te=we<P&&Q.length>0,se=Q.length-we,oe=Te?Math.floor((P-we)/2)+1:1,q=a.useMemo(()=>Ag(Q),[Q]),de=a.useMemo(()=>Hg(Q),[Q]),ge=(ye,Se,B)=>{if(n&&!o&&!i)return;const ue=q.findIndex(me=>me.gridIndex===ye);if(ue<0)return;const ve=q[ue];E(ue),J(ve.items),j(Se),N(ve.entry),Z(B??null),U(!0)},_e=a.useCallback(()=>{U(!1),Z(null)},[]),Ce=a.useCallback(()=>{const ye=q[O];return!ye||!F.current?K:Pg(F.current,ye.gridIndex,v?"cover":"contain")??K},[q,O,K,v]),Me=a.useCallback(ye=>{if(q.length>1){const Se=q.length,B=(O+ye+Se)%Se,ue=q[B],ve=Math.min(D,ue.items.length-1);E(B),J(ue.items),j(ve),N(ue.entry);return}j(Se=>(Se+ye+G.length)%G.length)},[q,O,D,G.length]),fe=q.length>1||G.length>1;return a.useEffect(()=>{if(!W||typeof document>"u")return;const ye=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ye}},[W]),a.useEffect(()=>{!n||o||i||U(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:he}}),r.jsx(Og,{mediaList:de}),r.jsx("div",{ref:F,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${P}, ${V})`,rowGap:0,columnGap:M,width:x.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:x.scalingValue(u??0,n)},children:Q.map((ye,Se)=>{const B=Ja(ye.gallery),ue=Qa(B),ve=ue.filter(te=>te.lightboxMedia).map(te=>te.lightboxMedia),me=Math.floor(Se/P)===Math.ceil(Q.length/P)-1,Ee=Te&&Se>=se?`${oe+(Se-se)}`:void 0,be=ue[0],k=be!=null&&be.lightboxMedia?ve.findIndex(te=>te.url===be.lightboxMedia.url):-1,re=r.jsx("div",{className:`${d}-item-image-wrapper`,style:y,children:ue.length>0&&r.jsx(Gg,{media:be.displayMedia,gridIndex:Se,className:`${d}-item-${Ki(be.displayMedia)?"video":"image"}`.trim(),style:S,onMediaClick:b&&k>=0?te=>ge(Se,k,hc(te.currentTarget,v?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,me?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:V,...Ee?{gridColumn:Ee}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:A}})}),r.jsx("a",{className:`${d}-item-image-link`,children:re}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:A}})})]})},Se)})}),W&&typeof document<"u"&&(()=>{const ye=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:pe,"data-selection":"none",children:r.jsx(Ug,{prefix:d,items:G,index:D,entry:ce,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:fe,lightboxEntries:q,entryIdx:O,layoutId:s,sourceRect:K,resolveCloseSourceRect:Ce,onClose:_e,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),ye)})()]})}const Xg=`import { CommonComponentProps } from '../props';
|
|
6502
|
+
`}const Hl={url:"",name:"",objectFit:"cover"},$n=500,eo=650,un="cubic-bezier(0.22, 1, 0.36, 1)",Pg=72,kg=50,Ag=1e4,Fg=650,Wg=500;function _g(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,l=e.top-t.top;return`translate(${o}px, ${l}px) scale(${n}, ${i})`}function xc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=ur(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function Ng(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?xc(i,n):null}function Hg(e){return e.reduce((t,n,i)=>{const o=Ja(n.gallery),s=Qa(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return s.length===0||t.push({gridIndex:i,items:s,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function oo(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function Ol(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return oo(e,i,n)}const Og=.03;function bc(e){return e.width*Og}const Kr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function zo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function jl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function jg(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function wa(e,t,n){const i=e.getBoundingClientRect(),o=i.width,l=i.height,s=t/n,d=o/l;if(s>d){const u=o/s;return{width:o,height:u,left:i.left,top:i.top+(l-u)/2}}const c=l*s;return{width:c,height:l,left:i.left+(o-c)/2,top:i.top}}function Dg(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:wa(e,t.width,t.height)}function zg(e,t){if(Zi(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function Bg(e){const t=new Set,n=[];for(const i of e){const o=Ja(i.gallery),l=Qa(o);for(const s of l)for(const d of[s.displayMedia,s.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function Vg({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Zi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function ji(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:d}=n,c=bc(n);return t==="left"?{left:s+c-i,top:l,width:i,height:o}:{left:s+d-c,top:l,width:i,height:o}}function pr(e,t,n){const i=ji(e,t,n);return{...i,left:2*i.left-e.left}}function Gg(e,t,n){const{left:i,width:o}=n,l=bc(n);return t==="left"?{left:i,top:e.top,width:l,height:e.height}:{left:i+o-l,top:e.top,width:l,height:e.height}}function wc(e,t,n,i){const o=ji(e,"left",i),l=ji(e,"right",i),s=pr(e,"left",i),d=pr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:l,end:e};case"left-adjacent":return{start:o,end:s};case"far-right":return{start:d,end:l};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:l};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:l,end:d};case"far-left":return{start:s,end:o};default:return{start:e,end:e}}}function qg(e,t,n,i){const{start:o,end:l}=wc(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function Ug(e,t,n){const i=ji(e,t,n),o=pr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Sc(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function Ja(e){if(!e)return;if(Sc(e))return e;if(!Array.isArray(e))return;const[t,n]=e,i=t!=null&&t.url?t:void 0,o=n!=null&&n.url?n:void 0;if(!(!i&&!o))return[{media:[o??i??Hl,i??o??Hl]}]}function Kg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Xg(e){const[t]=e.media;return t!=null&&t.url?t:null}function Qa(e){if(!Array.isArray(e)||e.length===0)return[];if(Sc(e)){const t=[];for(const n of e){const i=Kg(n);if(!i)continue;const o=Xg(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Zi(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Yg({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Zi(e)?r.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):r.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Zg({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:l,onTransitionEnd:s}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:s,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:c=>c.stopPropagation(),style:o},e)})}function Bo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Zi(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const l=o.currentTarget;l.videoWidth>0&&l.videoHeight>0&&(i==null||i(e.url,l.videoWidth,l.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const l=o.currentTarget;l.naturalWidth>0&&l.naturalHeight>0&&(i==null||i(e.url,l.naturalWidth,l.naturalHeight))},onTransitionEnd:n})}function Jg({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:S,resolveCloseSourceRect:L,onClose:f,onPrev:h,onNext:y}){const E=a.useRef(null),I=a.useRef(null),T=a.useRef(null),X=a.useRef(new Map),[k,B]=a.useState(0),P=a.useRef(null),C=a.useRef(0),z=a.useRef(0),v=a.useRef("none"),_=a.useRef(!1),R=a.useRef(!1),Z=a.useRef(!1),A=a.useRef(null),U=a.useRef(null),V=a.useRef(null),G=a.useRef(()=>{}),ne=a.useRef(null),$=a.useRef(null),M=a.useRef(null),N=a.useRef(!1),[Q,ie]=a.useState(null),[F,pe]=a.useState(Kr),[x,se]=a.useState(0),[J,ye]=a.useState("opening"),[Me,de]=a.useState(0),[ce,q]=a.useState(0),[ee,me]=a.useState(!1),[Fe,Ce]=a.useState(null),[Ae,ue]=a.useState(null),[fe,Se]=a.useState(null),[D,oe]=a.useState(!1),[he,be]=a.useState(null),[Ie,xe]=a.useState(!1),W=a.useRef(!1),[ae,te]=a.useState(!1),[j,Y]=a.useState(!1),Re=a.useRef(n),le=a.useRef(void 0),H=t[n],De=H?Zi(H):!1,_e=ce!==0||ee,tt=!s&&(!l||!!d),Qe=c&&!s,at=u.length>1,$e=a.useCallback((g,ve)=>t.length<=1?null:t[(g+ve+t.length)%t.length]??null,[t]),ge=at?oo(u,p,-1):$e(n,-1),je=at?oo(u,p,1):$e(n,1),vt=Fe===-1&&_e?at&&Ae!==null?oo(u,Ae,-1):fe!==null?$e(fe,-1):null:null,Ye=Fe===1&&_e?at&&Ae!==null?oo(u,Ae,1):fe!==null?$e(fe,1):null:null,Oe=vt&&vt.url!==(ge==null?void 0:ge.url)?vt:null,Le=Ye&&Ye.url!==(je==null?void 0:je.url)?Ye:null,He=ge&&Qe?(()=>{const g=at?Ol(u,p,-1):t.length>2?$e((n-1+t.length)%t.length,-1):null;return g&&g.url!==ge.url?g:null})():null,Xe=je&&Qe?(()=>{const g=at?Ol(u,p,1):t.length>2?$e((n+1)%t.length,1):null;return g&&g.url!==je.url?g:null})():null,ut=Oe??He,xt=Le??Xe,it=a.useCallback((g,ve,ke)=>{if(!g||!ve||!ke)return;const Ee=X.current,ot=Ee.get(g);(ot==null?void 0:ot.width)===ve&&(ot==null?void 0:ot.height)===ke||(Ee.set(g,{width:ve,height:ke}),B(At=>At+1))},[]),wt=a.useCallback(g=>{if(!(g!=null&&g.url))return null;const ve=X.current.get(g.url);return Dg(I.current,ve)},[k,x]),lt=a.useCallback(()=>{if(!H)return;const g=wt(H);if(g){ie(g);return}const ve=I.current;ve&&ie(jl(ve))},[H,wt]),Ue=a.useCallback(g=>{if(at){const ve=u.length;ue((p+g+ve)%ve),Se(null);return}t.length>1&&(Se((n+g+t.length)%t.length),ue(null))},[at,u.length,p,t.length,n]),Ke=a.useCallback(g=>{Z.current=g,me(g)},[]),Ne=a.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),pt=a.useCallback(()=>{Ne(),A.current=window.setTimeout(()=>{Ne(),Ke(!1)},eo+32)},[Ne,Ke]),mt=a.useCallback(()=>{const g=E.current;if(!g){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:Kr.width,height:typeof window<"u"?window.innerHeight:Kr.height});return}const ve=g.getBoundingClientRect();pe({left:ve.left,top:ve.top,width:ve.width,height:ve.height})},[]),gt=a.useCallback((g,ve)=>{if(_e){if(ae&&!ee)return`translate(${ce}px, 0px)`;if(ee&&Fe!==null){const ke=wt(g);if(!ke)return;const{x:Ee,y:ot}=qg(ke,ve,Fe,F);return`translate(${Ee}px, ${ot}px)`}if(ee)return"translate(0px, 0px)"}},[_e,ae,ee,ce,Fe,F,wt]),Pt=a.useCallback(()=>{const g=U.current;U.current=null,Ne(),Ke(!1),Ce(null),ue(null),Se(null),q(0),te(!1),_.current=!1,z.current=0,v.current="none",g===-1?h():g===1&&y()},[Ne,Ke,h,y]),Zt=a.useCallback(()=>{Ne(),A.current=window.setTimeout(()=>{U.current!==null&&Pt()},eo+32)},[Ne,Pt]),tn=a.useCallback(()=>{Ne(),U.current=null,Ke(!1),Ce(null),ue(null),Se(null),q(0),te(!1),_.current=!1,z.current=0,v.current="none"},[Ne,Ke]),Tt=a.useCallback(g=>{if(!(!Qe||!Q)){if(Z.current){if(U.current===g){V.current=g,Pt();return}tn()}Ne(),Ue(g),U.current=g,Ce(g),Ke(!0),Zt()}},[Qe,Q,Pt,tn,Ne,Ue,Ke,Zt]);G.current=Tt;const Ct=a.useCallback(()=>{ne.current=null,N.current=!1,$.current!==null&&(window.clearInterval($.current),$.current=null),M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),Ft=a.useCallback(g=>{$.current!==null&&window.clearInterval($.current);const ve=N.current?Wg:Fg;$.current=window.setInterval(()=>{G.current(g)},ve)},[]),Ot=a.useCallback(g=>{ne.current!==g&&(Ct(),ne.current=g,N.current=!1,G.current(g),Ft(g),M.current=window.setTimeout(()=>{M.current=null,ne.current===g&&(N.current=!0,Ft(g))},Ag))},[Ct,Ft]),Te=a.useCallback(()=>{const g=I.current;if(!g)return;const ve=H==null?void 0:H.url,ke=ve?X.current.get(ve):void 0;if(ke!=null&&ke.width&&(ke!=null&&ke.height)){ie(wa(g,ke.width,ke.height));return}const Ee=T.current;if(Ee&&ve&&(Ee.src===ve||Ee.currentSrc===ve)){const{width:At,height:Je}=jg(Ee);if(At&&Je){it(ve,At,Je),ie(wa(g,At,Je));return}}const ot=jl(g);!ot.width||!ot.height||ie(ot)},[H==null?void 0:H.url,it]),Be=a.useCallback(g=>{if(T.current=g,!!g){if(g instanceof HTMLVideoElement){g.readyState>=1&&g.videoWidth>0&&Te();return}g.complete&&g.naturalWidth>0&&Te()}},[Te]),qe=a.useCallback(()=>{mt(),Te(),se(g=>g+1)},[mt,Te]);a.useEffect(()=>{qe();const g=I.current,ve=E.current,ke=new ResizeObserver(()=>qe());return g&&ke.observe(g),ve&&ke.observe(ve),window.addEventListener("resize",qe),()=>{ke.disconnect(),window.removeEventListener("resize",qe)}},[qe,n,b]),a.useLayoutEffect(()=>{if(!H)return;const g=T.current;if(g){if(g instanceof HTMLImageElement&&g.complete&&g.naturalWidth>0){Te();return}g instanceof HTMLVideoElement&&g.readyState>=1&&g.videoWidth>0&&Te()}},[H==null?void 0:H.url,n,Te]),a.useEffect(()=>{lt()},[lt,k]),a.useEffect(()=>{const g=new Set,ve=[],ke=Ee=>{!(Ee!=null&&Ee.url)||g.has(Ee.url)||(g.add(Ee.url),ve.push(Ee))};t.forEach(ke),u.forEach(Ee=>Ee.items.forEach(ke)),ve.forEach(Ee=>{X.current.has(Ee.url)||zg(Ee,it)})},[t,u,it]),a.useEffect(()=>{if(J!=="opening"||!Q)return;if(!S){ye("open");return}oe(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{oe(!0),ye("open")})});return()=>cancelAnimationFrame(g)},[J,Q,S]),a.useEffect(()=>{if(J!=="closing")return;const g=setTimeout(()=>f(),$n);return()=>clearTimeout(g)},[J,f]),a.useEffect(()=>()=>{Ne()},[Ne]),a.useLayoutEffect(()=>{Re.current===n&&le.current===(H==null?void 0:H.url)||(Ne(),U.current=null,Ce(null),ue(null),Se(null),de(0),q(0),Ke(!1),Y(!1),te(!1),C.current=0,z.current=0,v.current="none",_.current=!1,P.current=null,R.current=!1,T.current=null,lt(),Re.current=n,le.current=H==null?void 0:H.url)},[n,H==null?void 0:H.url,Ke,Ne,lt]),a.useLayoutEffect(()=>{const g=V.current;g!==null&&(V.current=null,requestAnimationFrame(()=>{G.current(g)}))},[n,p,H==null?void 0:H.url]),a.useLayoutEffect(()=>{if(J==="opening"){W.current=!1,xe(!1);return}if(J!=="open"||W.current)return;if(!ge&&!je){W.current=!0;return}xe(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{xe(!0),W.current=!0})});return()=>cancelAnimationFrame(g)},[J,ge==null?void 0:ge.url,je==null?void 0:je.url]),a.useEffect(()=>{if(J!=="open")return;const g=()=>{const Je=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Je,!0)};document.addEventListener("click",Je,!0)},ve=Je=>{const ft=Je<0?1:-1;Ne(),Ue(ft),U.current=ft,Ce(ft),Ke(!0),Zt()},ke=Je=>{if(Math.abs(Je)>kg&&Qe){ve(Je);return}U.current=null,Ce(null),ue(null),Se(null),Ke(!0),q(0),pt()},Ee=Je=>{if(Je.touches.length!==1||Z.current)return;const ft=Je.touches[0];R.current=!0,P.current={x:ft.clientX,y:ft.clientY},v.current="none",z.current=0,_.current=!1},ot=Je=>{if(!P.current||Je.touches.length!==1||Z.current)return;const ft=Je.touches[0],Nt=ft.clientX-P.current.x,Et=ft.clientY-P.current.y;if(v.current==="none"){if(Math.abs(Nt)<10&&Math.abs(Et)<10)return;if(Math.abs(Nt)>Math.abs(Et)){if(!Qe)return;v.current="horizontal"}else if(Et>0){if(!tt)return;v.current="vertical"}else return}if(v.current==="horizontal"){_.current=!0,te(!0),z.current=Nt,q(Nt),Je.preventDefault();return}v.current==="vertical"&&(_.current=!0,te(!0),C.current=Et,de(Et),Je.preventDefault())},At=()=>{if(!P.current)return;const Je=v.current,ft=_.current;if(ft&&Je==="horizontal")ke(z.current),g();else if(ft&&Je==="vertical"){const Nt=C.current;if(tt&&Nt>Pg){const Et=window.innerHeight;C.current=Et,Y(!0),de(Et),ye("closing")}else C.current=0,de(0);g()}else Je==="horizontal"&&Math.abs(z.current)>0&&(ke(z.current),g());P.current=null,v.current="none",z.current=0,_.current=!1,te(!1)};return document.addEventListener("touchstart",Ee,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",At),document.addEventListener("touchcancel",At),()=>{document.removeEventListener("touchstart",Ee),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",At),document.removeEventListener("touchcancel",At)}},[J,Qe,Ke,pt,Ne,tt,Zt,Ue]);const st=a.useCallback(()=>{const g=(L==null?void 0:L())??S??null;g&&Q&&(be(g),oe(!0)),ye("closing")},[L,S,Q]);a.useEffect(()=>{const g=Ee=>{if(Ee.key==="Escape"){if(l&&d||J==="closing")return;Ct(),st();return}if(Ee.key!=="ArrowLeft"&&Ee.key!=="ArrowRight"||J!=="open"||!Qe)return;Ee.preventDefault();const ot=Ee.key==="ArrowLeft"?-1:1;Ee.repeat&&ne.current===ot||Ot(ot)},ve=Ee=>{if(Ee.key!=="ArrowLeft"&&Ee.key!=="ArrowRight")return;const ot=Ee.key==="ArrowLeft"?-1:1;ne.current===ot&&Ct()},ke=()=>{Ct()};return window.addEventListener("keydown",g),window.addEventListener("keyup",ve),window.addEventListener("blur",ke),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",ve),window.removeEventListener("blur",ke),Ct()}},[J,l,d,st,Qe,Ot,Ct]),a.useEffect(()=>{J!=="open"&&Ct()},[J,Ct]);const kt=()=>{J==="closing"||s||st()},dt=J==="open",nt=J==="closing",qt=Me>0?Math.max(0,1-Me/500):1,St=Me>0?Math.max(.35,1-Me/500):1,Ve=a.useCallback(g=>{if(!(g.propertyName!=="transform"||!Z.current)){if(U.current!==null){Pt();return}Ne(),Ke(!1)}},[Ne,Ke,Pt]),et=J==="closing"?he??S:S,It=et&&Q&&(J==="opening"||nt)?_g(et,Q):void 0,Lt=_e&&H?gt(H,"center"):Me>0?`translateY(${Me}px)`:It,ht=Q?zo(Q,F):null,Dt=!!(et&&Q),_t=Dt&&(J==="closing"||J==="open"&&D),jt={position:"absolute",top:ht==null?void 0:ht.top,left:ht==null?void 0:ht.left,width:ht==null?void 0:ht.width,height:ht==null?void 0:ht.height,objectFit:"contain",transformOrigin:"top left",transform:Lt,opacity:Me>0?St:Dt?1:J==="opening"||nt?0:1,transition:ae&&!ee?"none":ee?`transform ${eo}ms ${un}`:j?`transform ${$n}ms ${un}, opacity ${$n}ms ${un}`:_t?`transform ${$n}ms ${un}`:J==="opening"||nt?`opacity ${$n}ms ${un}`:"none",pointerEvents:De&&dt&&!_e?"auto":"none",touchAction:De&&dt?"none":void 0,zIndex:1,overflow:De?"hidden":void 0},Ut={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:dt&&!_e?"auto":"none"},$t=(g,ve,ke="adjacent")=>{const Ee=wt(g);if(!Ee)return{display:"none"};const ot=ke==="far"?ve==="left"?"far-left":"far-right":ve==="left"?"left-adjacent":"right-adjacent",{start:At}=Fe!==null?wc(Ee,ot,Fe,F):{start:ke==="far"?pr(Ee,ve,F):ji(Ee,ve,F)},Je=zo(At,F),ft=gt(g,ot),Nt=!_e&&ke==="adjacent"&&dt&&!Ie?Ug(Ee,ve,F):null,Et=ke==="far"&&_e&&Fe===(ve==="left"?-1:1),cn=ae&&!ee?!1:ee,dn=ke==="adjacent"&&dt&&Ie&&!_e;return{position:"absolute",top:Je.top,left:Je.left,width:Je.width,height:Je.height,objectFit:"contain",transform:ft??(Nt?`translate(${Nt.x}px, ${Nt.y}px)`:void 0),opacity:ke==="far"?dt&&Et?1:0:dt?1:0,transition:cn?ke==="far"?`transform ${eo}ms ${un}`:`transform ${eo}ms ${un}, opacity ${$n}ms ${un}`:dn?`transform ${$n}ms ${un}`:J==="opening"||nt?`opacity ${$n}ms ${un}`:"none",pointerEvents:"none",zIndex:1}},en=(g,ve)=>{const ke=wt(g);return ke?Gg(ji(ke,ve,F),ve,F):null},Kt=g=>ve=>{if(!s){if(R.current){R.current=!1;return}ve.stopPropagation(),Tt(g)}},Yt=ge?en(ge,"left"):null,Xt=je?en(je,"right"):null,zt=Yt?zo(Yt,F):null,Bt=Xt?zo(Xt,F):null;return r.jsxs("div",{ref:E,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:kt,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:dt?qt:0,transition:ae?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:I,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:dt?1:0,transition:ae?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"},children:r.jsx(vc,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,onClose:kt})})]}),dt&&ut&&r.jsx(Bo,{media:ut,style:$t(ut,"left","far"),onMeasure:it,onTransitionEnd:Ve},`far-prev-${ut.url}`),dt&&ge&&r.jsxs(r.Fragment,{children:[r.jsx(Bo,{media:ge,style:$t(ge,"left"),onMeasure:it,onTransitionEnd:Ve},`prev-${ge.url}`),zt&&r.jsx("div",{style:{position:"absolute",top:zt.top,left:zt.left,width:zt.width,height:zt.height,cursor:s||ae?"default":"pointer",pointerEvents:s||ae?"none":"auto",zIndex:3},onClick:Kt(-1)})]}),dt&&je&&r.jsxs(r.Fragment,{children:[r.jsx(Bo,{media:je,style:$t(je,"right"),onMeasure:it,onTransitionEnd:Ve},`next-${je.url}`),Bt&&r.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:s||ae?"default":"pointer",pointerEvents:s||ae?"none":"auto",zIndex:3},onClick:Kt(1)})]}),dt&&xt&&r.jsx(Bo,{media:xt,style:$t(xt,"right","far"),onMeasure:it,onTransitionEnd:Ve},`far-next-${xt.url}`),Q&&H&&(De?r.jsx(Zg,{src:H.url,phase:J,onMediaElement:Be,wrapperStyle:jt,videoStyle:Ut,onLoadedMetadata:Te,onTransitionEnd:Ve},`${n}-${H.url}`):r.jsx("img",{ref:Be,src:H.url,alt:H.name,onLoad:Te,onTransitionEnd:Ve,style:jt},`${n}-${H.url}`))]})}function Qg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:d}=w.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:b}=e,S=(b==null?void 0:b.display)==="cover",L=(b==null?void 0:b.ratioValue)??"1:1",f=(b==null?void 0:b.reversed)??!1,[h,y]=L.split(":").map(Number),T=`${f?y:h} / ${f?h:y}`,X=c.entryWidth??.2,k=c.columnsCount,B=w.scalingValue(X,n),P=w.scalingValue(c.horizontalGap??0,n),C=B,z=B,v={width:C,...S?{aspectRatio:T,height:"auto",overflow:"hidden"}:{height:"auto"}},_=S?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},R=a.useRef(null),[Z,A]=a.useState(!1),[U,V]=a.useState([]),[G,ne]=a.useState(0),[$,M]=a.useState(0),[N,Q]=a.useState(null),[ie,F]=a.useState({title1:"",title2:"",title3:""}),pe=(()=>{const fe={},Se=R.current?getComputedStyle(R.current).getPropertyValue("--cntrl-article-width").trim():"";return Se&&(fe["--cntrl-article-width"]=Se),fe})(),x=!n||i||o,se=a.useMemo(()=>Eg(d),[d]),J=t??[],ye=J.length%k||k,Me=ye<k&&J.length>0,de=J.length-ye,ce=Me?Math.floor((k-ye)/2)+1:1,q=a.useMemo(()=>Hg(J),[J]),ee=a.useMemo(()=>Bg(J),[J]),me=(fe,Se,D)=>{if(n&&!o&&!i)return;const oe=q.findIndex(be=>be.gridIndex===fe);if(oe<0)return;const he=q[oe];M(oe),V(he.items),ne(Se),F(he.entry),Q(D??null),A(!0)},Fe=a.useCallback(()=>{A(!1),Q(null)},[]),Ce=a.useCallback(()=>{const fe=q[$];return!fe||!R.current?N:Ng(R.current,fe.gridIndex,S?"cover":"contain")??N},[q,$,N,S]),Ae=a.useCallback(fe=>{if(q.length>1){const Se=q.length,D=($+fe+Se)%Se,oe=q[D],he=Math.min(G,oe.items.length-1);M(D),V(oe.items),ne(he),F(oe.entry);return}ne(Se=>(Se+fe+U.length)%U.length)},[q,$,G,U.length]),ue=q.length>1||U.length>1;return a.useEffect(()=>{if(!Z||typeof document>"u")return;const fe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=fe}},[Z]),a.useEffect(()=>{!n||o||i||A(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:se}}),r.jsx(Vg,{mediaList:ee}),r.jsx("div",{ref:R,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${k}, ${B})`,rowGap:0,columnGap:P,width:w.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:w.scalingValue(u??0,n)},children:J.map((fe,Se)=>{const D=Ja(fe.gallery),oe=Qa(D),he=oe.filter(te=>te.lightboxMedia).map(te=>te.lightboxMedia),be=Math.floor(Se/k)===Math.ceil(J.length/k)-1,Ie=Me&&Se>=de?`${ce+(Se-de)}`:void 0,xe=oe[0],W=xe!=null&&xe.lightboxMedia?he.findIndex(te=>te.url===xe.lightboxMedia.url):-1,ae=r.jsx("div",{className:`${d}-item-image-wrapper`,style:v,children:oe.length>0&&r.jsx(Yg,{media:xe.displayMedia,gridIndex:Se,className:`${d}-item-${Zi(xe.displayMedia)?"video":"image"}`.trim(),style:_,onMediaClick:x&&W>=0?te=>me(Se,W,xc(te.currentTarget,S?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,be?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:B,...Ie?{gridColumn:Ie}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:z}})}),r.jsx("a",{className:`${d}-item-image-link`,children:ae}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:z}})})]})},Se)})}),Z&&typeof document<"u"&&(()=>{const fe=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx("div",{style:pe,"data-selection":"none",children:r.jsx(Jg,{prefix:d,items:U,index:G,entry:ie,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ue,lightboxEntries:q,entryIdx:$,layoutId:l,sourceRect:N,resolveCloseSourceRect:Ce,onClose:Fe,onPrev:()=>Ae(-1),onNext:()=>Ae(1)})}),fe)})()]})}const eh=`import { CommonComponentProps } from '../props';
|
|
6371
6503
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
6372
6504
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6373
6505
|
import { createPortal } from 'react-dom';
|
|
@@ -8710,11 +8842,11 @@ export function Hive({
|
|
|
8710
8842
|
</>
|
|
8711
8843
|
);
|
|
8712
8844
|
}
|
|
8713
|
-
`,Yg="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),oi={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 Zg(e){const t={};return t[Ye(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSettings")]={...oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSize")]={...oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ye(e,"lineHeight")]={...oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ye(e,"letterSpacing")]={...oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ye(e,"wordSpacing")]={...oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ye(e,"textAlign")]={...oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ye(e,"textAppearance")]={...oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Hi=Kn.filter(e=>e!=="count"),Jg=Hi.reduce((e,t)=>({...e,...Zg(t)}),{}),Qg=Hi.reduce((e,t)=>({...e,[Ye(t,"fontFamily")]:"Arial",[Ye(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ye(t,"letterSpacing")]:0,[Ye(t,"wordSpacing")]:0,[Ye(t,"textAlign")]:"left",[Ye(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Kr(e){return Hi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ye(n,"fontSize")]=i),o!==void 0&&(t[Ye(n,"lineHeight")]=o),t},{})}const eh={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Hi.map(e=>[Ya[e],Za(e)]))},th={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},nh=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...th,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),ih={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",max:1,display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}}},required:["gallery"]},default:nh},settings:{sizing:"auto auto",properties:{gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:9999,display:{type:"numeric-input"}},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},...Jg},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Yg,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Qg},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...Kr({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...Kr({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...Kr({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})}},displayRules:[{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","gridLayout","verticalGap","align","imageDisplay","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"",items:["imageDisplay","align"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[eh]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},oh={element:Kg,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Hi.map(e=>({path:`${Ye(e,"fontFamily")}`}))]},fontRelations:{...Hi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ye(t,"fontFamily")}`}),{})},schema:ih,sourceCode:Xg};function rh(e){if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function ah({media:e,className:t,style:n}){const i=a.useRef(null);return a.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const s=o.play();s&&s.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Xr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function sh(e){return String(e??"").trim().length>0}function js(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function zs(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Bs(e,t,n,i,o,s,l){const d=x.scalingValue(s,l),c=x.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function lh(e,t,n){const i=x.scalingValue(t,n),o=x.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Vs=10;function ch(e){return`
|
|
8845
|
+
`,th="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),oi={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 nh(e){const t={};return t[Ze(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSettings")]={...oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSize")]={...oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ze(e,"lineHeight")]={...oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ze(e,"letterSpacing")]={...oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ze(e,"wordSpacing")]={...oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ze(e,"textAlign")]={...oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ze(e,"textAppearance")]={...oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Di=Kn.filter(e=>e!=="count"),ih=Di.reduce((e,t)=>({...e,...nh(t)}),{}),oh=Di.reduce((e,t)=>({...e,[Ze(t,"fontFamily")]:"Arial",[Ze(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ze(t,"letterSpacing")]:0,[Ze(t,"wordSpacing")]:0,[Ze(t,"textAlign")]:"left",[Ze(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Xr(e){return Di.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ze(n,"fontSize")]=i),o!==void 0&&(t[Ze(n,"lineHeight")]=o),t},{})}const rh={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Di.map(e=>[Ya[e],Za(e)]))},ah={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},lh=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...ah,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),sh={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",max:1,display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}}},required:["gallery"]},default:lh},settings:{sizing:"auto auto",properties:{gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:9999,display:{type:"numeric-input"}},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},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"}}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},...ih},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:th,closeIconColor:"#000000",closeIconHoverColor:"#999999",...oh},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...Xr({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...Xr({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...Xr({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})}},displayRules:[{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","gridLayout","verticalGap","align","imageDisplay","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"",items:["imageDisplay","align"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[rh]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},ch={element:Qg,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Di.map(e=>({path:`${Ze(e,"fontFamily")}`}))]},fontRelations:{...Di.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ze(t,"fontFamily")}`}),{})},schema:sh,sourceCode:eh};function dh(e){if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function uh({media:e,className:t,style:n}){const i=a.useRef(null);return a.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const l=o.play();l&&l.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Yr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ph(e){return String(e??"").trim().length>0}function Dl(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function zl(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Bl(e,t,n,i,o,l,s){const d=w.scalingValue(l,s),c=w.scalingValue(0,s),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function mh(e,t,n){const i=w.scalingValue(t,n),o=w.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Vl=10;function gh(e){return`
|
|
8714
8846
|
.${e}-wrapper {
|
|
8715
8847
|
display: grid;
|
|
8716
8848
|
align-items: start;
|
|
8717
|
-
min-height: ${
|
|
8849
|
+
min-height: ${Yr(48)};
|
|
8718
8850
|
position: relative;
|
|
8719
8851
|
overflow: visible;
|
|
8720
8852
|
box-sizing: border-box;
|
|
@@ -8836,7 +8968,7 @@ a.${e}-list-item {
|
|
|
8836
8968
|
flex-shrink: 0;
|
|
8837
8969
|
overflow: visible;
|
|
8838
8970
|
box-sizing: border-box;
|
|
8839
|
-
min-width: ${
|
|
8971
|
+
min-width: ${Yr(50)};
|
|
8840
8972
|
position: relative;
|
|
8841
8973
|
display: flex;
|
|
8842
8974
|
align-items: flex-start;
|
|
@@ -8844,7 +8976,7 @@ a.${e}-list-item {
|
|
|
8844
8976
|
|
|
8845
8977
|
.${e}-list-col-last {
|
|
8846
8978
|
flex: 1 1 auto;
|
|
8847
|
-
min-width: ${
|
|
8979
|
+
min-width: ${Yr(50)};
|
|
8848
8980
|
}
|
|
8849
8981
|
|
|
8850
8982
|
.${e}-list-col-title {
|
|
@@ -9079,7 +9211,7 @@ a.${e}-list-item {
|
|
|
9079
9211
|
overflow-wrap: anywhere;
|
|
9080
9212
|
word-break: break-word;
|
|
9081
9213
|
}
|
|
9082
|
-
`}const Xn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],es=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",vo=[...es,An],Er=["A","B","C","D","E"];function xc(e){return`${e}ColumnVerticalAlign`}const wa=["Top","Center","Bottom"];function ts(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Er.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function dh(e){const t=ts(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function uh(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Er.includes(n)?n:null}function bc(e,t,n){const i=uh(e);return i?i===t?!1:dh(n[xc(i)]):!0}function xo(e){const t=ts(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Er.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function ph(e,t,n){if(wc(e,t,n))return xo(e);const i=xo(e);return i.kind==="baseline"?{kind:"top"}:i}function mh(e){const t=xo(e);return t.kind==="baseline"?{kind:"top"}:t}function wc(e,t,n){return bc(e,n,t)?xo(e).kind==="baseline":!1}function gh(e){const t={};let n=!1;for(const i of Er){const o=xc(i),s=e[o];if(e.type==="b"){const l=String(s??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}bc(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function hh(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function fh(e){const t=xo(e).kind;return t==="baseline"?"center":t}function yh(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Gs(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function vh(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),s=o-i;return n.remove(),s}function Yr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=vh(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=s.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+l}function xh(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const s=o.querySelector(`.${n}`);s&&(s.style.minHeight=`${i}px`,s.style.height=`${i}px`)}),i)}function bh(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const wh={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Ct(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Sh={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function $h(e){return[Ct(e,"textFontFamily"),Ct(e,"textFontSettings"),{type:"row",items:[Ct(e,"textFontSize"),Ct(e,"textLineHeight"),Ct(e,"textLetterSpacing"),Ct(e,"textWordSpacing")]},Ct(e,"textTextAlign"),Ct(e,"textTextAppearance"),`${e}VerticalAlign`]}function Ch(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(vo.map(e=>[Sh[e],$h(e)]))}}function pr(e,t){const n=i=>{const o=Ct(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===An?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function qs(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return nn(zt(n,t))}function Us(e,t,n,i){const o=pr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function Ks(e,t,n,i){const o=pr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:x.scalingValue((s-l)/2,i)}}const fn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Oi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Di=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],ji=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Th={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Lh=["hover","focus","filled","success","error"],Xs=.004,Ti=.004,Zr=Ti,ns=50,bo=1440,wo=ns/bo;function Sc(e){const t=typeof e=="number"&&e>0?e:bo;return ns/t}function Ih(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const o=parseFloat(n);if(Number.isFinite(o)&&o>0)return o}const i=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(i){const o=parseFloat(i);if(Number.isFinite(o)&&o>0)return o}t=t.parentElement}return bo}const $c={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function ao(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Rh(e,t=1){const n=t/e;return Object.fromEntries(fn.map(i=>[i,n]))}function Eh(){return Object.fromEntries([...Oi.map(e=>[e,0]),...Di.map(e=>[e,0])])}function Mh(){return Object.fromEntries(ji.map(e=>[e,0]))}function zo(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:$c[t]]))}function Cc(e,t,n){const i=e-wo,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const s=i/o;return{paddingLeft:t*s,paddingRight:n*s}}function ir(e,t,n){const i=is(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,l)=>s+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function kh(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=Oi[o],l=Di[o],d=typeof n[s]=="number"?n[s]:0,c=typeof n[l]=="number"?n[l]:0,u=Cc(t[o]??0,d,c);u.paddingLeft!==d&&(i[s]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function is(e,t,n){if(e<=0)return[];const i=fn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),l=o.reduce((u,p)=>u+p,0)+wo;if(t>=l)return i;const d=[...o];let c=l-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const p=d[u]-wo;if(p<=0)continue;const w=Math.min(c,p);d[u]-=w,c-=w}return[...d,i[e-1]]}function Ph(e,t,n){if(e<=1)return{};const i=is(e,t,n),o={};for(let s=0;s<e-1;s+=1){const l=fn[s];i[s]!==n[l]&&(o[l]=i[s])}return o}function Ys(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Xn]}function Ah(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Fh(e,t,n,i){const o=Math.min(i,e.length,fn.length),s={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=fn[c],p=Oi[c],w=Di[c],v=ji[c],T=fn[l],g=Oi[l],$=Di[l],f=ji[l],R=n[u],L=n[p],I=n[w],Y=n[v];typeof R=="number"&&(s[T]=R),typeof L=="number"&&(s[g]=L),typeof I=="number"&&(s[$]=I),typeof Y=="number"&&(s[f]=Y)}return s}function Tc(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of n)if(e[i]!==t[i])return!0;return!1}function Wh(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=ao(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Rh(n,o),...Eh()};if(s)for(const d of ji)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,Mh());return Tc(e,l)?l:e}function _h(e,t,n){const i=gh(e);i&&(e={...e,...i});const o=Sc(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=ao(e),c=ao(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof l=="number"?l:Xn.length,w=I=>{if(u)return I;const Y=zo({...t,...I}),P=ao(I),V=ir(p,P,Y),M=kh(p,V,{...t,...I});return Object.keys(M).length===0?I:{...I,...M}};if(typeof s=="number"&&s!==l)return e;const v=Ys(e),T=Ys(t);if(!Ah(v,T))return w({...e,...Fh(v,T,t,p)});if(d<c&&typeof p=="number"&&!u){const I=zo({...t,...e});return w({...e,...Ph(p,d,I)})}if(u){const I=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,Y=Math.max(0,(d-o)/2);return I>Y?{...e,textPaddingLR:Y}:e}const g=zo({...t,...e}),$=ir(p,c,zo(t)),R=ir(p,d,g).some((I,Y)=>I<($[Y]??I)),L=fn.some(I=>{const Y=e[I],P=t[I];return typeof Y=="number"&&typeof P=="number"&&Y!==P});return R||L?w(e):e}function Nh(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),s=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(wo,i-o-s-wo)}function Hh(e,t){return Math.random()*(t-e)+e}function Oh(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:$c[t]]))}function Jr(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Dh(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const c=Oi[d],u=Di[d],p=ji[d];return{key:l,textPrefix:wh[l],widthKey:fn[d],width:n[fn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:s[p]}})}function jh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:c}=x.useScopedStyles(),u=!!o,{columns:p,type:w,wrapperWidth:v,entriesCount:T,cellMinHeight:g,dividerWidth:$,showVisibility:f,cut:R,showCut:L,cutCellMinHeight:I,cutLabel:Y,imageSize:P,imageOnHover:V,entryHoverEffect:M,entryHoverShowOption:C,rowPaddingTop:A,rowPaddingBottom:y,rowPaddingTopB:S,columnsOrder:F,textPaddingLR:W,textColor:U,backgroundColor:G,dividerColor:J,textHoverColor:D,backgroundHoverColor:j,dividerHoverColor:O}=e,[E,K]=a.useState(void 0),[Z,ce]=a.useState(null),N=V==="on"&&(!n||i),pe=(R??0)>0,b=w==="b",he=a.useRef(null),Q=a.useRef(null),[we,Te]=a.useState(null),[se,oe]=a.useState(bo),q=Sc(se),de=Math.max(0,((v??0)-q)/2),ge=Math.min(W??0,de),_e=Math.max(ge,Ti),Ce=((v??0)+q)/2;a.useLayoutEffect(()=>{if(!n){oe(bo);return}const Le=()=>{oe(Ih(he.current))};Le();const Ue=he.current;if(!Ue)return;const Xe=new ResizeObserver(Le);Xe.observe(Ue);let ct=Ue;for(;ct&&!ct.style.getPropertyValue("--cntrl-article-width");)ct=ct.parentElement;return ct&&Xe.observe(ct),()=>Xe.disconnect()},[n,l]),a.useEffect(()=>{K(void 0)},[R,L,t,T]),a.useEffect(()=>{n&&!i&&K(void 0)},[n,i]);const Me=x.buildColorVars(c,{textColor:U,backgroundColor:G,dividerColor:J,textHoverColor:D,backgroundHoverColor:j,dividerHoverColor:O},Th,Lh),fe=s&&s!=="default"?`${c}-state-${s}`:"",Se=`${!n||i?M==="default"?`${c}-entry-hover-default`:M==="blinds"?`${c}-entry-hover-blinds`:M==="reveal"?`${c}-entry-hover-reveal`:"":""} ${fe}`.trim(),B=M==="reveal"&&(!n||i),ue=(f==null?void 0:f[0])??!1,ve=(f==null?void 0:f[1])??!1,me=a.useRef(e),Ee=a.useRef(l);a.useEffect(()=>{if(!d||!n){me.current=e,Ee.current=l;return}if(Ee.current!==l){me.current=e,Ee.current=l;return}const Le=me.current;if(!(Le!==e))return;if(typeof Le.columns=="number"&&typeof e.columns=="number"&&Le.columns!==e.columns){me.current=e;return}const Xe=_h(e,Le,{designWidth:se});me.current=e,Tc(e,Xe)&&d(Xe)},[e,d,n,l,se]);const be=a.useMemo(()=>Oh(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),k=a.useMemo(()=>Jr(e,Oi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),re=a.useMemo(()=>Jr(e,Di),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),te=a.useMemo(()=>Jr(e,ji),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),z=a.useMemo(()=>Array.isArray(F)&&F.length>0?F:[...Xn],[F]),le=a.useMemo(()=>Dh(z,p,be,k,re,te),[z,p,be,k,re,te]),Re=ao(e),ae=a.useMemo(()=>fn.slice(0,p).map(Le=>be[Le]),[p,be]),_=a.useMemo(()=>is(p,Re,be),[p,Re,be]),Ne=a.useMemo(()=>ir(p,Re,be),[p,Re,be]),Fe=a.useMemo(()=>le.map((Le,Ue)=>Cc(Ne[Ue]??0,Le.paddingLeft,Le.paddingRight)),[le,Ne]),et=a.useMemo(()=>{const Le=T===0?1/0:T;return(t??[]).slice(0,Le).map((Xe,ct)=>({id:ct,cells:Object.fromEntries(Xn.map(Rt=>[Rt,Xe[Rt]??""])),image:Xe.image,link:Xe.link}))},[t,T]),Ke=pe?E??R:et.length,Ie=a.useMemo(()=>pe?et.slice(0,Ke):et,[et,pe,Ke]),ee=pe&&Ke<et.length,ne=Ie.length>1||ee,He=[ue?`${c}-divider-top`:"",ve||ne?`${c}-divider-bottom`:""].filter(Boolean).join(" "),st=!n||i,Be=()=>{if(!st)return;const Le=E??R;if(!L){K(et.length);return}K(Math.min(Le+L,et.length))},Oe=Le=>x.scalingValue(Le,n??!1),je=b?S??0:A??0,qe=y??0,tt=g??0,mt=Math.max(qe,Zr),St=Bs(0,Ie.length,ue,ve,ee,$??0,n??!1).borderTopWidth,lt=b?"rowPaddingTopB":"rowPaddingTop",pt=le[0],Mt=le[le.length-1],nt=Fe[0],Ve=Fe[Fe.length-1],De=pt&&nt?Math.max(nt.paddingLeft,Ti):0,vt=Mt&&Ve?Math.max(Ve.paddingRight,Ti):0,bt=Re,Pt=Le=>{const Ue=he.current;if(!Ue)return{x:0,y:0};const Xe=Ue.getBoundingClientRect();return{x:Le.clientX-Xe.left+Vs,y:Le.clientY-Xe.top+Vs}},Dt=(Le,Ue)=>{if(!N)return;const Xe=Le.image;if(!(Xe!=null&&Xe.url)){ce(null);return}const{x:ct,y:Rt}=Pt(Ue),ut=(P==null?void 0:P.min)??80,it=(P==null?void 0:P.max)??320,Ut=(Z==null?void 0:Z.rowId)===Le.id?Z.widthPx:Hh(ut,it);ce({rowId:Le.id,url:Xe.url,objectFit:"contain",isVideo:rh(Xe),widthPx:Ut,x:ct,y:Rt})},tn=Le=>{if(!N||!Z)return;const{x:Ue,y:Xe}=Pt(Le);ce(ct=>!ct||ct.x===Ue&&ct.y===Xe?ct:{...ct,x:Ue,y:Xe})},ln=()=>{ce(null)},Tt=Le=>{B&&js(Le,c),N&&ce(null)},kt=Le=>{B&&zs(Le,c)};a.useLayoutEffect(()=>{if(!u||b){Te(null);return}const Le=Q.current,Ue=Le==null?void 0:Le.parentElement;if(!Le||!Ue){Te(null);return}const Xe=()=>{const Rt=Le.querySelector("[data-list-row]");if(!Rt){Te(null);return}const ut=Ue.getBoundingClientRect(),it=Rt.getBoundingClientRect();Te(it.top-ut.top+it.height/2)};Xe();const ct=new ResizeObserver(Xe);return ct.observe(Le),ct.observe(Ue),()=>ct.disconnect()},[u,b,Ie,je,qe,tt,t,e,le,Ne,se,$,ue,ve,ee]);const Yt=a.useMemo(()=>!b&&es.some(Le=>{const Ue=Le.charAt(0),Xe=e[`${Le}VerticalAlign`];return wc(Xe,e,Ue)}),[b,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Ut;const Le=he.current;if(!Le)return;const Ue=()=>{Le.querySelectorAll("[data-list-col]").forEach(Ze=>{Ze.style.transform="";const Je=Ze.querySelector(`.${c}-list-col`);Je&&(Je.style.minHeight="",Je.style.height="");const rt=Ze.querySelector(`.${c}-list-col-title`);rt&&(rt.style.transform="")})};if(b||!Yt){Ue();return}const Xe=()=>{const Ze=Array.from(Le.querySelectorAll("[data-list-row]")),Je=`${c}-list-col`,rt=`${c}-baseline-probe`;Ze.forEach(Lt=>{Lt.querySelectorAll("[data-list-col]").forEach(It=>{It.style.transform="";const ft=It.querySelector(`.${Je}`);ft&&(ft.style.minHeight="",ft.style.height="");const Ft=It.querySelector(`.${c}-list-col-title`);Ft&&(Ft.style.transform="")})}),Ze.forEach(Lt=>{const It=Array.from(Lt.querySelectorAll("[data-list-col]"));xh(Lt,It,Je)}),Le.offsetHeight,Ze.forEach(Lt=>{const It=Array.from(Lt.querySelectorAll("[data-list-col]")),ft=Lt.getBoundingClientRect().top,Ft=new Map,Ot=It.map(xt=>{const Gt=xt.querySelector(`.${c}-list-col-title`),Kt={el:xt,titleEl:Gt,letter:xt.getAttribute("data-col-letter")??"",kind:xt.getAttribute("data-valign")??"top",anchor:xt.getAttribute("data-valign-anchor")};return Ft.set(Kt.letter,Kt),Kt}),Ht=new Map,Vt=(xt,Gt)=>{const Kt=Ht.get(xt.letter);if(Kt!==void 0)return Kt;const Xt=xt.anchor?Ft.get(xt.anchor):void 0;if(xt.kind!=="baseline"||!Xt||Gt.has(xt.letter)){const xe=Yr(xt,ft,Je,rt);return Ht.set(xt.letter,xe),xe}Gt.add(xt.letter);const Zt=Vt(Xt,Gt);Gt.delete(xt.letter);const jt=Yr(xt,ft,Je,rt),wt=Zt-jt;bh(xt.titleEl,wt);const h=Yr(xt,ft,Je,rt);return Ht.set(xt.letter,h),h};Ot.forEach(xt=>Vt(xt,new Set))})};let ct=null;const Rt=()=>{ct===null&&(ct=requestAnimationFrame(()=>{ct=null,Xe()}))};Xe();const ut=new ResizeObserver(()=>Rt());ut.observe(Le);let it=!1;return typeof document<"u"&&((Ut=document.fonts)!=null&&Ut.ready)&&document.fonts.ready.then(()=>{it||Rt()}),()=>{it=!0,ct!==null&&(cancelAnimationFrame(ct),ct=null),ut.disconnect(),Ue()}},[Yt,b,e,t,se,Ie,Ne]);const qt=a.useMemo(()=>ch(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:qt}}),r.jsx("div",{style:Me,children:r.jsxs("div",{ref:he,className:`${c}-wrapper ${Se}${He?` ${He}`:""}${b?` ${c}-type-b`:""}`.trim(),style:{width:x.scalingValue(v??0,n)},onMouseMove:N?tn:void 0,onMouseLeave:N?ln:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ie.map((Le,Ue)=>{var ut;const Xe=(((ut=Le.link)==null?void 0:ut.length)??0)>0,ct=Xe&&(!n||i)?"a":"div",Rt=Bs(Ue,Ie.length,ue,ve,ee,$??0,n??!1);return r.jsxs(ct,{ref:Ue===0?it=>{Q.current=it}:void 0,className:`${c}-list-item${Xe||C==="always"?` ${c}-list-item-has-link`:""}${ee&&Ue===Ie.length-1?` ${c}-list-item-before-cut`:""}`,...Xe?{href:Le.link,target:"_blank"}:{},style:Rt,onMouseEnter:it=>{B&&(Xe||C==="always")&&js(it,c),N&&Dt(Le,it)},onMouseLeave:it=>{B&&(Xe||C==="always")&&zs(it,c)},children:[je>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(je)}}),r.jsxs("div",{className:`${c}-list-cols-row${b?"":` ${c}-list-cols-row-h`}${u&&Ue===0&&b?` ${c}-list-cols-row-controls`:""}`,...b?{}:{"data-list-row":""},style:b?void 0:{minHeight:Oe(tt)},children:[le.map((it,Ut)=>{const Ze=Ut===le.length-1,Je=Fe[Ut],rt=it.paddingBottom,Lt=sh(Le.cells[it.key]),It=b&&Lt&&rt>0,ft=b?{minHeight:Oe(tt)}:{width:Oe(Ne[Ut])},Ft=b?{paddingLeft:Oe(ge),paddingRight:Oe(ge)}:{paddingLeft:Oe(Je.paddingLeft),paddingRight:Oe(Je.paddingRight)},Ot=it.textPrefix.charAt(0),Ht=b?mh(e[`${it.textPrefix}VerticalAlign`]):ph(e[`${it.textPrefix}VerticalAlign`],e,Ot),Vt=b&&Lt&&u&&Ue===0;return b&&!Lt?null:r.jsxs("div",{className:b?`${c}-list-col-wrap`:void 0,...b?{}:{"data-list-col":"","data-col-letter":Ot,"data-valign":Ht.kind,...Ht.kind==="baseline"?{"data-valign-anchor":Ht.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${Ze?` ${c}-list-col-last`:""}`,style:{...Ft,...ft,...b?{justifyContent:Gs(Ht.kind)}:{}},"data-test":it.width,children:r.jsx("span",{className:Us(e,it.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...qs(pr(e,it.textPrefix),n),...Ks(e,it.textPrefix,c,n),...b?{}:hh(Ht.kind)},children:Le.cells[it.key]??null})}),It&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(rt)}}),Vt&&r.jsx("div",{"data-controls":it.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Oe(Math.max(rt,Zr))}})]},it.key)}),u&&Ue===0&&b&&r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Oe(_e),height:"100%"}}),r.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Oe(Math.max(_e,Re-_e)),width:Oe(_e),height:"100%"}})]})]}),!b&&qe>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(qe)}}),u&&Ue===0&&!b&&r.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Oe(mt)}})]},Le.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":lt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":b?"center":"left-y",className:`${c}-control-anchor`,style:{top:St,left:0,width:"100%",height:Oe(Math.max(je,Zr))}})},"row-padding-handles"),u&&!b&&pt&&Mt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":pt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[0]-((nt==null?void 0:nt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":we??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Oe(De),height:"100%"}}),r.jsx("div",{"data-controls":Mt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[le.length-1]-((Ve==null?void 0:Ve.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":we??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(bt-vt),width:Oe(vt),height:"100%"}})]},"column-edge-padding-handles"),u&&!b&&le.slice(0,-1).map((Le,Ue)=>{const Xe=le[Ue+1],ct=_.slice(0,Ue+1).reduce((Ze,Je)=>Ze+Je,0),Rt=Fe[Ue],ut=Fe[Ue+1],it=Math.max(Rt.paddingRight,Ti),Ut=Math.max(ut.paddingLeft,Ti);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Le.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ne[Ue]-Rt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":we??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(ct-it),width:Oe(it),height:"100%"}}),r.jsx("div",{"data-controls":Xe.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ne[Ue+1]-ut.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":we??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(ct),width:Oe(Ut),height:"100%"}})]},`${Le.paddingRightKey}-padding`)}),u&&!b&&le.slice(0,-1).map((Le,Ue)=>{const Xe=Nh(Ue,_,ae,Re),Rt=_.slice(0,Ue+1).reduce((ut,it)=>ut+it,0)-Xs/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Le.widthKey,"data-controls-axis":"x","data-controls-min":String(ns),"data-controls-max-fraction":String(Xe),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Oe(Rt),width:Oe(Xs),height:"calc(100%)",pointerEvents:"auto"}})},`${Le.widthKey}-junction`)})]}),ee&&(()=>{const Le=pr(e,An),Ue=fh(e.cutLabelVerticalAlign),Xe=Le.textTextAlign==="justify"||b;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Oe(I??0),cursor:st?"pointer":"default",...lh(ve,$??0,n??!1)},onClick:st?Be:void 0,onMouseEnter:B||N?Tt:void 0,onMouseLeave:B?kt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...b?{paddingLeft:Oe(ge),paddingRight:Oe(ge)}:{},justifyContent:yh(Le.textTextAlign),alignItems:Gs(Ue)},children:r.jsx("span",{className:Us(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...qs(Le,n),...Ks(e,An,c,n),...Xe?{width:"100%"}:{}},children:Y})})})})(),N&&Z&&(()=>{const Le=`${Z.widthPx}px`,Ue={width:Le,height:"auto",maxHeight:Le,objectFit:"contain",left:Z.x,top:Z.y,position:"absolute"};return r.jsx(ah,{media:Z,className:Z.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Ue},`${Z.rowId}-${Z.url}`)})()]})})]})}const zh=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
9214
|
+
`}const Xn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],el=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",bo=[...el,An],Er=["A","B","C","D","E"];function $c(e){return`${e}ColumnVerticalAlign`}const Sa=["Top","Center","Bottom"];function tl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Er.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function hh(e){const t=tl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function fh(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Er.includes(n)?n:null}function Cc(e,t,n){const i=fh(e);return i?i===t?!1:hh(n[$c(i)]):!0}function wo(e){const t=tl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Er.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function yh(e,t,n){if(Tc(e,t,n))return wo(e);const i=wo(e);return i.kind==="baseline"?{kind:"top"}:i}function vh(e){const t=wo(e);return t.kind==="baseline"?{kind:"top"}:t}function Tc(e,t,n){return Cc(e,n,t)?wo(e).kind==="baseline":!1}function xh(e){const t={};let n=!1;for(const i of Er){const o=$c(i),l=e[o];if(e.type==="b"){const s=String(l??"Top").trim();s!=="Top"&&s!=="Center"&&s!=="Bottom"&&(t[o]="Top",n=!0);continue}Cc(l,i,e)||(t[o]="Top",n=!0)}return n?t:null}function bh(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function wh(e){const t=wo(e).kind;return t==="baseline"?"center":t}function Sh(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Gl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function $h(e,t){const n=document.createElement("i");n.className=t,n.setAttribute("aria-hidden","true"),e.prepend(n);const{top:i}=e.getBoundingClientRect(),{bottom:o}=n.getBoundingClientRect(),l=o-i;return n.remove(),l}function Zr(e,t,n,i){const o=e.titleEl;if(!o)return 0;const l=o.closest(`.${n}`);if(!l)return 0;const s=$h(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+s;const d=l.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+s}function Ch(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const l=o.querySelector(`.${n}`);l&&(l.style.minHeight=`${i}px`,l.style.height=`${i}px`)}),i)}function Th(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Lh={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Mt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Ih={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Rh(e){return[Mt(e,"textFontFamily"),Mt(e,"textFontSettings"),{type:"row",items:[Mt(e,"textFontSize"),Mt(e,"textLineHeight"),Mt(e,"textLetterSpacing"),Mt(e,"textWordSpacing")]},Mt(e,"textTextAlign"),Mt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Mh(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(bo.map(e=>[Ih[e],Rh(e)]))}}function mr(e,t){const n=i=>{const o=Mt(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===An?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function ql(e,t){var i,o;const n={fontSettings:{fontFamily:e.textFontFamily,fontWeight:((i=e.textFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e.textFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:e.textFontSize??.01,lineHeight:e.textLineHeight,letterSpacing:e.textLetterSpacing,wordSpacing:e.textWordSpacing,textAlign:e.textTextAlign,textAppearance:e.textTextAppearance,color:e.textColor??"#767676"};return on(Vt(n,t))}function Ul(e,t,n,i){const o=mr(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s!==void 0&&s<l?`${n} ${i}`:n}function Kl(e,t,n,i){const o=mr(e,t),l=o.textFontSize??.01,s=o.textLineHeight;return s===void 0||s>=l?{}:{[`--${n}-title-leading-gap`]:w.scalingValue((l-s)/2,i)}}const fn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],zi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Bi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Vi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Eh={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Ph=["hover","focus","filled","success","error"],Xl=.004,Ri=.004,Jr=Ri,nl=50,So=1440,$o=nl/So;function Lc(e){const t=typeof e=="number"&&e>0?e:So;return nl/t}function kh(e){let t=e??null;for(;t;){const n=t.style.getPropertyValue("--cntrl-article-width").trim();if(n){const o=parseFloat(n);if(Number.isFinite(o)&&o>0)return o}const i=getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim();if(i){const o=parseFloat(i);if(Number.isFinite(o)&&o>0)return o}t=t.parentElement}return So}const Ic={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function so(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Ah(e,t=1){const n=t/e;return Object.fromEntries(fn.map(i=>[i,n]))}function Fh(){return Object.fromEntries([...zi.map(e=>[e,0]),...Bi.map(e=>[e,0])])}function Wh(){return Object.fromEntries(Vi.map(e=>[e,0]))}function Vo(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Ic[t]]))}function Rc(e,t,n){const i=e-$o,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const l=i/o;return{paddingLeft:t*l,paddingRight:n*l}}function or(e,t,n){const i=il(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((l,s)=>l+s,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function _h(e,t,n){const i={};for(let o=0;o<e;o+=1){const l=zi[o],s=Bi[o],d=typeof n[l]=="number"?n[l]:0,c=typeof n[s]=="number"?n[s]:0,u=Rc(t[o]??0,d,c);u.paddingLeft!==d&&(i[l]=u.paddingLeft),u.paddingRight!==c&&(i[s]=u.paddingRight)}return i}function il(e,t,n){if(e<=0)return[];const i=fn.slice(0,e).map(u=>n[u]);if(e===1)return i;const o=i.slice(0,e-1),s=o.reduce((u,p)=>u+p,0)+$o;if(t>=s)return i;const d=[...o];let c=s-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const p=d[u]-$o;if(p<=0)continue;const b=Math.min(c,p);d[u]-=b,c-=b}return[...d,i[e-1]]}function Nh(e,t,n){if(e<=1)return{};const i=il(e,t,n),o={};for(let l=0;l<e-1;l+=1){const s=fn[l];i[l]!==n[s]&&(o[s]=i[l])}return o}function Yl(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Xn]}function Hh(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Oh(e,t,n,i){const o=Math.min(i,e.length,fn.length),l={};for(let s=0;s<o;s+=1){const d=e[s],c=t.indexOf(d);if(c===-1)continue;const u=fn[c],p=zi[c],b=Bi[c],S=Vi[c],L=fn[s],f=zi[s],h=Bi[s],y=Vi[s],E=n[u],I=n[p],T=n[b],X=n[S];typeof E=="number"&&(l[L]=E),typeof I=="number"&&(l[f]=I),typeof T=="number"&&(l[h]=T),typeof X=="number"&&(l[y]=X)}return l}function Mc(e,t){const n=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of n)if(e[i]!==t[i])return!0;return!1}function jh(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=so(e),l=e.type==="b"||e.type===void 0&&t.type==="b",s={...e,...Ah(n,o),...Fh()};if(l)for(const d of Vi)typeof t[d]=="number"&&(s[d]=t[d]);else Object.assign(s,Wh());return Mc(e,s)?s:e}function Dh(e,t,n){const i=xh(e);i&&(e={...e,...i});const o=Lc(n==null?void 0:n.designWidth),l=e.columns,s=t.columns,d=so(e),c=so(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof l=="number"?l:typeof s=="number"?s:Xn.length,b=T=>{if(u)return T;const X=Vo({...t,...T}),k=so(T),B=or(p,k,X),P=_h(p,B,{...t,...T});return Object.keys(P).length===0?T:{...T,...P}};if(typeof l=="number"&&l!==s)return e;const S=Yl(e),L=Yl(t);if(!Hh(S,L))return b({...e,...Oh(S,L,t,p)});if(d<c&&typeof p=="number"&&!u){const T=Vo({...t,...e});return b({...e,...Nh(p,d,T)})}if(u){const T=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,X=Math.max(0,(d-o)/2);return T>X?{...e,textPaddingLR:X}:e}const f=Vo({...t,...e}),h=or(p,c,Vo(t)),E=or(p,d,f).some((T,X)=>T<(h[X]??T)),I=fn.some(T=>{const X=e[T],k=t[T];return typeof X=="number"&&typeof k=="number"&&X!==k});return E||I?b(e):e}function zh(e,t,n,i){const o=t.slice(0,e).reduce((s,d)=>s+d,0),l=n.slice(e+1,t.length-1).reduce((s,d)=>s+d,0);return Math.max($o,i-o-l-$o)}function Bh(e,t){return Math.random()*(t-e)+e}function Vh(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Ic[t]]))}function Qr(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Gh(e,t,n,i,o,l){return e.slice(0,t).map((s,d)=>{const c=zi[d],u=Bi[d],p=Vi[d];return{key:s,textPrefix:Lh[s],widthKey:fn[d],width:n[fn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:l[p]}})}function qh({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l,layoutId:s,onUpdateSettings:d}){const{prefix:c}=w.useScopedStyles(),u=!!o,{columns:p,type:b,wrapperWidth:S,entriesCount:L,cellMinHeight:f,dividerWidth:h,showVisibility:y,cut:E,showCut:I,cutCellMinHeight:T,cutLabel:X,imageSize:k,imageOnHover:B,entryHoverEffect:P,entryHoverShowOption:C,rowPaddingTop:z,rowPaddingBottom:v,rowPaddingTopB:_,columnsOrder:R,textPaddingLR:Z,textColor:A,backgroundColor:U,dividerColor:V,textHoverColor:G,backgroundHoverColor:ne,dividerHoverColor:$}=e,[M,N]=a.useState(void 0),[Q,ie]=a.useState(null),F=B==="on"&&(!n||i),pe=(E??0)>0,x=b==="b",se=a.useRef(null),J=a.useRef(null),[ye,Me]=a.useState(null),[de,ce]=a.useState(So),q=Lc(de),ee=Math.max(0,((S??0)-q)/2),me=Math.min(Z??0,ee),Fe=Math.max(me,Ri),Ce=((S??0)+q)/2;a.useLayoutEffect(()=>{if(!n){ce(So);return}const Te=()=>{ce(kh(se.current))};Te();const Be=se.current;if(!Be)return;const qe=new ResizeObserver(Te);qe.observe(Be);let st=Be;for(;st&&!st.style.getPropertyValue("--cntrl-article-width");)st=st.parentElement;return st&&qe.observe(st),()=>qe.disconnect()},[n,s]),a.useEffect(()=>{N(void 0)},[E,I,t,L]),a.useEffect(()=>{n&&!i&&N(void 0)},[n,i]);const Ae=w.buildColorVars(c,{textColor:A,backgroundColor:U,dividerColor:V,textHoverColor:G,backgroundHoverColor:ne,dividerHoverColor:$},Eh,Ph),ue=l&&l!=="default"?`${c}-state-${l}`:"",Se=`${!n||i?P==="default"?`${c}-entry-hover-default`:P==="blinds"?`${c}-entry-hover-blinds`:P==="reveal"?`${c}-entry-hover-reveal`:"":""} ${ue}`.trim(),D=P==="reveal"&&(!n||i),oe=(y==null?void 0:y[0])??!1,he=(y==null?void 0:y[1])??!1,be=a.useRef(e),Ie=a.useRef(s);a.useEffect(()=>{if(!d||!n){be.current=e,Ie.current=s;return}if(Ie.current!==s){be.current=e,Ie.current=s;return}const Te=be.current;if(!(Te!==e))return;if(typeof Te.columns=="number"&&typeof e.columns=="number"&&Te.columns!==e.columns){be.current=e;return}const qe=Dh(e,Te,{designWidth:de});be.current=e,Mc(e,qe)&&d(qe)},[e,d,n,s,de]);const xe=a.useMemo(()=>Vh(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),W=a.useMemo(()=>Qr(e,zi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),ae=a.useMemo(()=>Qr(e,Bi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),te=a.useMemo(()=>Qr(e,Vi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),j=a.useMemo(()=>Array.isArray(R)&&R.length>0?R:[...Xn],[R]),Y=a.useMemo(()=>Gh(j,p,xe,W,ae,te),[j,p,xe,W,ae,te]),Re=so(e),le=a.useMemo(()=>fn.slice(0,p).map(Te=>xe[Te]),[p,xe]),H=a.useMemo(()=>il(p,Re,xe),[p,Re,xe]),De=a.useMemo(()=>or(p,Re,xe),[p,Re,xe]),_e=a.useMemo(()=>Y.map((Te,Be)=>Rc(De[Be]??0,Te.paddingLeft,Te.paddingRight)),[Y,De]),tt=a.useMemo(()=>{const Te=L===0?1/0:L;return(t??[]).slice(0,Te).map((qe,st)=>({id:st,cells:Object.fromEntries(Xn.map(kt=>[kt,qe[kt]??""])),image:qe.image,link:qe.link}))},[t,L]),Qe=pe?M??E:tt.length,at=a.useMemo(()=>pe?tt.slice(0,Qe):tt,[tt,pe,Qe]),$e=pe&&Qe<tt.length,ge=at.length>1||$e,je=[oe?`${c}-divider-top`:"",he||ge?`${c}-divider-bottom`:""].filter(Boolean).join(" "),vt=!n||i,Ye=()=>{if(!vt)return;const Te=M??E;if(!I){N(tt.length);return}N(Math.min(Te+I,tt.length))},Oe=Te=>w.scalingValue(Te,n??!1),Le=x?_??0:z??0,He=v??0,Xe=f??0,ut=Math.max(He,Jr),xt=Bl(0,at.length,oe,he,$e,h??0,n??!1).borderTopWidth,it=x?"rowPaddingTopB":"rowPaddingTop",wt=Y[0],lt=Y[Y.length-1],Ue=_e[0],Ke=_e[_e.length-1],Ne=wt&&Ue?Math.max(Ue.paddingLeft,Ri):0,pt=lt&&Ke?Math.max(Ke.paddingRight,Ri):0,mt=Re,gt=Te=>{const Be=se.current;if(!Be)return{x:0,y:0};const qe=Be.getBoundingClientRect();return{x:Te.clientX-qe.left+Vl,y:Te.clientY-qe.top+Vl}},Pt=(Te,Be)=>{if(!F)return;const qe=Te.image;if(!(qe!=null&&qe.url)){ie(null);return}const{x:st,y:kt}=gt(Be),dt=(k==null?void 0:k.min)??80,nt=(k==null?void 0:k.max)??320,qt=(Q==null?void 0:Q.rowId)===Te.id?Q.widthPx:Bh(dt,nt);ie({rowId:Te.id,url:qe.url,objectFit:"contain",isVideo:dh(qe),widthPx:qt,x:st,y:kt})},Zt=Te=>{if(!F||!Q)return;const{x:Be,y:qe}=gt(Te);ie(st=>!st||st.x===Be&&st.y===qe?st:{...st,x:Be,y:qe})},tn=()=>{ie(null)},Tt=Te=>{D&&Dl(Te,c),F&&ie(null)},Ct=Te=>{D&&zl(Te,c)};a.useLayoutEffect(()=>{if(!u||x){Me(null);return}const Te=J.current,Be=Te==null?void 0:Te.parentElement;if(!Te||!Be){Me(null);return}const qe=()=>{const kt=Te.querySelector("[data-list-row]");if(!kt){Me(null);return}const dt=Be.getBoundingClientRect(),nt=kt.getBoundingClientRect();Me(nt.top-dt.top+nt.height/2)};qe();const st=new ResizeObserver(qe);return st.observe(Te),st.observe(Be),()=>st.disconnect()},[u,x,at,Le,He,Xe,t,e,Y,De,de,h,oe,he,$e]);const Ft=a.useMemo(()=>!x&&el.some(Te=>{const Be=Te.charAt(0),qe=e[`${Te}VerticalAlign`];return Tc(qe,e,Be)}),[x,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var qt;const Te=se.current;if(!Te)return;const Be=()=>{Te.querySelectorAll("[data-list-col]").forEach(St=>{St.style.transform="";const Ve=St.querySelector(`.${c}-list-col`);Ve&&(Ve.style.minHeight="",Ve.style.height="");const et=St.querySelector(`.${c}-list-col-title`);et&&(et.style.transform="")})};if(x||!Ft){Be();return}const qe=()=>{const St=Array.from(Te.querySelectorAll("[data-list-row]")),Ve=`${c}-list-col`,et=`${c}-baseline-probe`;St.forEach(It=>{It.querySelectorAll("[data-list-col]").forEach(Lt=>{Lt.style.transform="";const ht=Lt.querySelector(`.${Ve}`);ht&&(ht.style.minHeight="",ht.style.height="");const Dt=Lt.querySelector(`.${c}-list-col-title`);Dt&&(Dt.style.transform="")})}),St.forEach(It=>{const Lt=Array.from(It.querySelectorAll("[data-list-col]"));Ch(It,Lt,Ve)}),Te.offsetHeight,St.forEach(It=>{const Lt=Array.from(It.querySelectorAll("[data-list-col]")),ht=It.getBoundingClientRect().top,Dt=new Map,_t=Lt.map($t=>{const en=$t.querySelector(`.${c}-list-col-title`),Kt={el:$t,titleEl:en,letter:$t.getAttribute("data-col-letter")??"",kind:$t.getAttribute("data-valign")??"top",anchor:$t.getAttribute("data-valign-anchor")};return Dt.set(Kt.letter,Kt),Kt}),jt=new Map,Ut=($t,en)=>{const Kt=jt.get($t.letter);if(Kt!==void 0)return Kt;const Yt=$t.anchor?Dt.get($t.anchor):void 0;if($t.kind!=="baseline"||!Yt||en.has($t.letter)){const ve=Zr($t,ht,Ve,et);return jt.set($t.letter,ve),ve}en.add($t.letter);const Xt=Ut(Yt,en);en.delete($t.letter);const zt=Zr($t,ht,Ve,et),Bt=Xt-zt;Th($t.titleEl,Bt);const g=Zr($t,ht,Ve,et);return jt.set($t.letter,g),g};_t.forEach($t=>Ut($t,new Set))})};let st=null;const kt=()=>{st===null&&(st=requestAnimationFrame(()=>{st=null,qe()}))};qe();const dt=new ResizeObserver(()=>kt());dt.observe(Te);let nt=!1;return typeof document<"u"&&((qt=document.fonts)!=null&&qt.ready)&&document.fonts.ready.then(()=>{nt||kt()}),()=>{nt=!0,st!==null&&(cancelAnimationFrame(st),st=null),dt.disconnect(),Be()}},[Ft,x,e,t,de,at,De]);const Ot=a.useMemo(()=>gh(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Ot}}),r.jsx("div",{style:Ae,children:r.jsxs("div",{ref:se,className:`${c}-wrapper ${Se}${je?` ${je}`:""}${x?` ${c}-type-b`:""}`.trim(),style:{width:w.scalingValue(S??0,n)},onMouseMove:F?Zt:void 0,onMouseLeave:F?tn:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[at.map((Te,Be)=>{var dt;const qe=(((dt=Te.link)==null?void 0:dt.length)??0)>0,st=qe&&(!n||i)?"a":"div",kt=Bl(Be,at.length,oe,he,$e,h??0,n??!1);return r.jsxs(st,{ref:Be===0?nt=>{J.current=nt}:void 0,className:`${c}-list-item${qe||C==="always"?` ${c}-list-item-has-link`:""}${$e&&Be===at.length-1?` ${c}-list-item-before-cut`:""}`,...qe?{href:Te.link,target:"_blank"}:{},style:kt,onMouseEnter:nt=>{D&&(qe||C==="always")&&Dl(nt,c),F&&Pt(Te,nt)},onMouseLeave:nt=>{D&&(qe||C==="always")&&zl(nt,c)},children:[Le>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(Le)}}),r.jsxs("div",{className:`${c}-list-cols-row${x?"":` ${c}-list-cols-row-h`}${u&&Be===0&&x?` ${c}-list-cols-row-controls`:""}`,...x?{}:{"data-list-row":""},style:x?void 0:{minHeight:Oe(Xe)},children:[Y.map((nt,qt)=>{const St=qt===Y.length-1,Ve=_e[qt],et=nt.paddingBottom,It=ph(Te.cells[nt.key]),Lt=x&&It&&et>0,ht=x?{minHeight:Oe(Xe)}:{width:Oe(De[qt])},Dt=x?{paddingLeft:Oe(me),paddingRight:Oe(me)}:{paddingLeft:Oe(Ve.paddingLeft),paddingRight:Oe(Ve.paddingRight)},_t=nt.textPrefix.charAt(0),jt=x?vh(e[`${nt.textPrefix}VerticalAlign`]):yh(e[`${nt.textPrefix}VerticalAlign`],e,_t),Ut=x&&It&&u&&Be===0;return x&&!It?null:r.jsxs("div",{className:x?`${c}-list-col-wrap`:void 0,...x?{}:{"data-list-col":"","data-col-letter":_t,"data-valign":jt.kind,...jt.kind==="baseline"?{"data-valign-anchor":jt.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${St?` ${c}-list-col-last`:""}`,style:{...Dt,...ht,...x?{justifyContent:Gl(jt.kind)}:{}},"data-test":nt.width,children:r.jsx("span",{className:Ul(e,nt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...ql(mr(e,nt.textPrefix),n),...Kl(e,nt.textPrefix,c,n),...x?{}:bh(jt.kind)},children:Te.cells[nt.key]??null})}),Lt&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(et)}}),Ut&&r.jsx("div",{"data-controls":nt.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Oe(Math.max(et,Jr))}})]},nt.key)}),u&&Be===0&&x&&r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Oe(Fe),height:"100%"}}),r.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Oe(Math.max(Fe,Re-Fe)),width:Oe(Fe),height:"100%"}})]})]}),!x&&He>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(He)}}),u&&Be===0&&!x&&r.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Oe(ut)}})]},Te.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":it,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":x?"center":"left-y",className:`${c}-control-anchor`,style:{top:xt,left:0,width:"100%",height:Oe(Math.max(Le,Jr))}})},"row-padding-handles"),u&&!x&&wt&<&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":wt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[0]-((Ue==null?void 0:Ue.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ye??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Oe(Ne),height:"100%"}}),r.jsx("div",{"data-controls":lt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[Y.length-1]-((Ke==null?void 0:Ke.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ye??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(mt-pt),width:Oe(pt),height:"100%"}})]},"column-edge-padding-handles"),u&&!x&&Y.slice(0,-1).map((Te,Be)=>{const qe=Y[Be+1],st=H.slice(0,Be+1).reduce((St,Ve)=>St+Ve,0),kt=_e[Be],dt=_e[Be+1],nt=Math.max(kt.paddingRight,Ri),qt=Math.max(dt.paddingLeft,Ri);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Te.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[Be]-kt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ye??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(st-nt),width:Oe(nt),height:"100%"}}),r.jsx("div",{"data-controls":qe.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[Be+1]-dt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ye??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(st),width:Oe(qt),height:"100%"}})]},`${Te.paddingRightKey}-padding`)}),u&&!x&&Y.slice(0,-1).map((Te,Be)=>{const qe=zh(Be,H,le,Re),kt=H.slice(0,Be+1).reduce((dt,nt)=>dt+nt,0)-Xl/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Te.widthKey,"data-controls-axis":"x","data-controls-min":String(nl),"data-controls-max-fraction":String(qe),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Oe(kt),width:Oe(Xl),height:"calc(100%)",pointerEvents:"auto"}})},`${Te.widthKey}-junction`)})]}),$e&&(()=>{const Te=mr(e,An),Be=wh(e.cutLabelVerticalAlign),qe=Te.textTextAlign==="justify"||x;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Oe(T??0),cursor:vt?"pointer":"default",...mh(he,h??0,n??!1)},onClick:vt?Ye:void 0,onMouseEnter:D||F?Tt:void 0,onMouseLeave:D?Ct:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...x?{paddingLeft:Oe(me),paddingRight:Oe(me)}:{},justifyContent:Sh(Te.textTextAlign),alignItems:Gl(Be)},children:r.jsx("span",{className:Ul(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...ql(Te,n),...Kl(e,An,c,n),...qe?{width:"100%"}:{}},children:X})})})})(),F&&Q&&(()=>{const Te=`${Q.widthPx}px`,Be={width:Te,height:"auto",maxHeight:Te,objectFit:"contain",left:Q.x,top:Q.y,position:"absolute"};return r.jsx(uh,{media:Q,className:Q.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Be},`${Q.rowId}-${Q.url}`)})()]})})]})}const Uh=`import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
9083
9215
|
import { CommonComponentProps } from '../props';
|
|
9084
9216
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
9085
9217
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -11953,7 +12085,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
11953
12085
|
</>
|
|
11954
12086
|
);
|
|
11955
12087
|
}
|
|
11956
|
-
`,Xi=["A","B","C","D","E"],Zs=[...wa,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],ri={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Bh(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Bo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Vh(){return Object.fromEntries(Xi.map((e,t)=>{const n=Xn[t],i=`${e} column`;return[n,Bh(i)]}))}function Gh(){const e={};for(const t of Xi)e[`${t}ColumnWidth`]=Bo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Bo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Bo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Bo(`${t} column padding bottom`);return e}function Js(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Xn]};for(const s of Xi)i[`${s}ColumnWidth`]=s==="A"?.0798:.32,i[`${s}ColumnPaddingLeft`]=0,i[`${s}ColumnPaddingRight`]=0,i[`${s}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function qh(e){const t={};if(e===An)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...wa]},enum:[...wa]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Zs],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Zs]}}return t[Ct(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Ct(e,"textFontSettings")]={...ri.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Ct(e,"textFontSize")]={...ri.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ct(e,"textLineHeight")]={...ri.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ct(e,"textLetterSpacing")]={...ri.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ct(e,"textWordSpacing")]={...ri.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ct(e,"textTextAlign")]={...ri.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ct(e,"textTextAppearance")]={...ri.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Uh=vo.reduce((e,t)=>({...e,...qh(t)}),{});function Kh(e){return{verticalAlign:e===An?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===An?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Xh(e,t={}){var n;return{...Kh(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Qs=new Set(["textFontFamily","textFontSettings"]);function Yh(e,t,n){const i=s=>n===void 0?!0:n==="common"?Qs.has(s):!Qs.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=ts(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Ct(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Ct(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Ct(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Ct(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Ct(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Ct(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Ct(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Ct(e,"textTextAppearance")]=t.textTextAppearance),o}function or(e={},t){return vo.reduce((n,i)=>({...n,...Yh(i,Xh(i,e),t)}),{})}const Zh=or(),Jh=Ch();function Lc(e){return[Ct(e,"textFontFamily"),Ct(e,"textFontSettings"),Ct(e,"textFontSize"),Ct(e,"textLineHeight"),Ct(e,"textLetterSpacing"),Ct(e,"textWordSpacing"),Ct(e,"textTextAlign"),Ct(e,"textTextAppearance"),`${e}VerticalAlign`]}function Qh(){const e=[];return es.forEach((t,n)=>{const i=Xn[n],o=Lc(t);for(let s=1;s<Xn.length;s+=1){const l=[{name:"columns",value:s},...Array.from({length:s},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const ef=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Lc(An);const tf=[...Xi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ai=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],nf=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ai[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ai[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ai[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ai[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ai[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ai[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ai[6],link:""}],of=[...Xi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],rf={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...Vh(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:nf},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:"Amount",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...Gh(),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"}},...Uh,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...Zh,...or({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Js({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...or({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Js({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...or({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Qh(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...tf.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}},...Xi.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...of]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"Entries",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",Jh]}],paletteBookmark:{items:[...ef],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},af={element:jh,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Wh(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...vo.map(e=>({path:`${Ct(e,"textFontFamily")}`}))]},fontRelations:{...vo.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Ct(t,"textFontFamily")}`}),{})},schema:rf,sourceCode:zh},el=300,Hn=.004,sf={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},lf=["hover","focus","filled","success","error"];function cf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function tl(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function nl(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:x.scalingValue((o-t)/2,i)}}function df(e){return`
|
|
12088
|
+
`,Ji=["A","B","C","D","E"],Zl=[...Sa,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],ri={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Kh(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Go(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Xh(){return Object.fromEntries(Ji.map((e,t)=>{const n=Xn[t],i=`${e} column`;return[n,Kh(i)]}))}function Yh(){const e={};for(const t of Ji)e[`${t}ColumnWidth`]=Go(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Go(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Go(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Go(`${t} column padding bottom`);return e}function Jl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Xn]};for(const l of Ji)i[`${l}ColumnWidth`]=l==="A"?.0798:.32,i[`${l}ColumnPaddingLeft`]=0,i[`${l}ColumnPaddingRight`]=0,i[`${l}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Zh(e){const t={};if(e===An)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Sa]},enum:[...Sa]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Zl],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Zl]}}return t[Mt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Mt(e,"textFontSettings")]={...ri.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Mt(e,"textFontSize")]={...ri.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Mt(e,"textLineHeight")]={...ri.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Mt(e,"textLetterSpacing")]={...ri.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Mt(e,"textWordSpacing")]={...ri.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Mt(e,"textTextAlign")]={...ri.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Mt(e,"textTextAppearance")]={...ri.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Jh=bo.reduce((e,t)=>({...e,...Zh(t)}),{});function Qh(e){return{verticalAlign:e===An?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===An?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function ef(e,t={}){var n;return{...Qh(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Ql=new Set(["textFontFamily","textFontSettings"]);function tf(e,t,n){const i=l=>n===void 0?!0:n==="common"?Ql.has(l):!Ql.has(l),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=tl(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Mt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Mt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Mt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Mt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Mt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Mt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Mt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Mt(e,"textTextAppearance")]=t.textTextAppearance),o}function rr(e={},t){return bo.reduce((n,i)=>({...n,...tf(i,ef(i,e),t)}),{})}const nf=rr(),of=Mh();function Ec(e){return[Mt(e,"textFontFamily"),Mt(e,"textFontSettings"),Mt(e,"textFontSize"),Mt(e,"textLineHeight"),Mt(e,"textLetterSpacing"),Mt(e,"textWordSpacing"),Mt(e,"textTextAlign"),Mt(e,"textTextAppearance"),`${e}VerticalAlign`]}function rf(){const e=[];return el.forEach((t,n)=>{const i=Xn[n],o=Ec(t);for(let l=1;l<Xn.length;l+=1){const s=[{name:"columns",value:l},...Array.from({length:l},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:s,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const af=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Ec(An);const lf=[...Ji.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ai=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],sf=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ai[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ai[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ai[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ai[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ai[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ai[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ai[6],link:""}],cf=[...Ji.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],df={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...Xh(),image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}},required:["image"]},default:sf},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:"Amount",display:{type:"toggle-numeric-input",enum:["auto","fixed"]},min:1},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},imageOnHover:{type:"boolean",scope:"common",title:"Image On Hover",display:{type:"toggle-cycle",enum:["on","off"]}},imageSize:{type:"object",scope:"layout",title:"Image size",display:{type:"min-max-input"},min:1,max:1440,properties:{min:{type:"number"},max:{type:"number"}}},dividerWidth:{type:"number",scope:"layout",title:"Divider width",display:{type:"numeric-input"},min:0,max:9999},showVisibility:{type:"array",scope:"common",title:"Show",display:{type:"double-toggle",enum:["top","bottom"]},items:{type:"boolean"},default:[!0,!1]},cut:{type:"number",scope:"layout",title:"Display",display:{type:"toggle-numeric-input",enum:["off","on"]},min:1},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default","blinds","reveal"]}},entryHoverShowOption:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","link only"]}},cutCellMinHeight:{type:"number",scope:"layout",title:"Cell min height",display:{type:"numeric-input"},min:0,max:9999},cutLabel:{type:"string",scope:"common",title:"Cut Label",display:{type:"label-input"}},showCut:{type:"number",scope:"layout",title:"Show",display:{type:"toggle-numeric-input",enum:["all","custom"]},min:1},rowPaddingTop:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},rowPaddingBottom:{type:"number",scope:"layout",title:"Row Padding Bottom",min:0,max:100,display:{type:"range-control"}},rowPaddingTopB:{type:"number",scope:"layout",title:"Row Padding Top",min:0,max:100,display:{type:"range-control"}},...Yh(),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"}},...Jh,backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},backgroundHoverColor:{type:"string",scope:"common",title:"BG Hover",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}}},defaults:{imageOnHover:"on",entryHoverEffect:"default",entryHoverShowOption:"always",cutLabel:"SEE ALL",showVisibility:[!0,!0],textColor:"#000000",textHoverColor:"#FFFFFF",...nf,...rr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:Jl({columns:3,type:"b",textPaddingLR:.0373,entriesCount:0,cellMinHeight:.02,imageSize:{min:80,max:320},dividerWidth:.004,cut:0,showCut:0,cutCellMinHeight:.02,rowPaddingTop:.01,rowPaddingBottom:.01,typeBDefaults:{rowPaddingTopB:.0461,AColumnPaddingBottom:.041,BColumnPaddingBottom:.041,CColumnPaddingBottom:.0615,DColumnPaddingBottom:0,EColumnPaddingBottom:0},textStroke:.003,textCorners:.192,textPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},...rr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:Jl({columns:4,type:"a",textPaddingLR:.01,entriesCount:0,cellMinHeight:.0555,imageSize:{min:200,max:200},dividerWidth:.002083,cut:0,showCut:0,cutCellMinHeight:.0555,rowPaddingTop:0,rowPaddingBottom:0,rowPaddingTopB:.01,textStroke:.001,textCorners:.05,textPadding:{top:.01,right:.01,bottom:.01,left:.01},...rr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...rf(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...lf.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}},...Ji.map(e=>({if:{name:"type",value:"a"},then:{name:`properties.${e}ColumnPaddingBottom.display.visible`,value:!1}}))],layout:["__componentName__","name","type","columns","wrapperWidth","textPaddingLR","entriesCount","cellMinHeight","imageOnHover","imageSize","dividerWidth","showVisibility","cut","showCut","cutCellMinHeight","entryHoverEffect","entryHoverShowOption","cutLabel","rowPaddingTop","rowPaddingBottom","rowPaddingTopB",...cf]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"Entries",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",of]}],paletteBookmark:{items:[...af],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},uf={element:qh,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>jh(e,t),preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Programme-list-default.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...bo.map(e=>({path:`${Mt(e,"textFontFamily")}`}))]},fontRelations:{...bo.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Mt(t,"textFontFamily")}`}),{})},schema:df,sourceCode:Uh},es=300,Hn=.004,pf={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},mf=["hover","focus","filled","success","error"];function gf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ts(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ns(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:w.scalingValue((o-t)/2,i)}}function hf(e){return`
|
|
11957
12089
|
.${e}-wrapper {
|
|
11958
12090
|
box-sizing: border-box;
|
|
11959
12091
|
display: flex;
|
|
@@ -12015,7 +12147,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
12015
12147
|
display: flex;
|
|
12016
12148
|
align-items: center;
|
|
12017
12149
|
justify-content: space-between;
|
|
12018
|
-
gap: ${
|
|
12150
|
+
gap: ${gf(20)};
|
|
12019
12151
|
width: 100%;
|
|
12020
12152
|
min-width: 0;
|
|
12021
12153
|
min-height: var(--${e}-question-min-height, unset);
|
|
@@ -12043,7 +12175,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
12043
12175
|
width: var(--${e}-icon-max-width);
|
|
12044
12176
|
height: var(--${e}-icon-max-width);
|
|
12045
12177
|
position: relative;
|
|
12046
|
-
transition: transform ${
|
|
12178
|
+
transition: transform ${es}ms ease;
|
|
12047
12179
|
}
|
|
12048
12180
|
.${e}-icon-custom {
|
|
12049
12181
|
display: flex;
|
|
@@ -12078,7 +12210,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
12078
12210
|
.${e}-panel {
|
|
12079
12211
|
display: grid;
|
|
12080
12212
|
grid-template-rows: 0fr;
|
|
12081
|
-
transition: grid-template-rows ${
|
|
12213
|
+
transition: grid-template-rows ${es}ms ease;
|
|
12082
12214
|
}
|
|
12083
12215
|
.${e}-item-open .${e}-panel {
|
|
12084
12216
|
grid-template-rows: 1fr;
|
|
@@ -12116,7 +12248,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
12116
12248
|
pointer-events: none;
|
|
12117
12249
|
z-index: 2;
|
|
12118
12250
|
}
|
|
12119
|
-
`}function
|
|
12251
|
+
`}function is(e,t,n,i,o,l,s,d){return{fontSettings:{fontFamily:e,fontWeight:(t==null?void 0:t.fontWeight)??400,fontStyle:(t==null?void 0:t.fontStyle)??"normal"},fontSize:n??.01,lineHeight:i,letterSpacing:o??0,wordSpacing:l??0,textAppearance:s,color:d??"#000000"}}function ff({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:l}){const{prefix:s}=w.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:b="solid",entryHoverEffect:S="default",autoclose:L="off",icon:f,iconMaxWidth:h=.00833,iconPaddingRight:y=0,iconAnimation:E="rotate 45",questionColor:I="#000000",answerColor:T="#000000",dividerColor:X="#0000001F",iconColor:k="#000000",questionHoverColor:B="#666666",iconHoverColor:P="#666666",iconActiveColor:C="#000000",dividerHoverColor:z="#000000",questionFontFamily:v,questionFontSettings:_,questionFontSize:R,questionLineHeight:Z,questionLetterSpacing:A,questionWordSpacing:U,questionTextAppearance:V,answerFontFamily:G,answerFontSettings:ne,answerFontSize:$,answerLineHeight:M,answerLetterSpacing:N,answerWordSpacing:Q,answerTextAppearance:ie,questionPaddingLeft:F=0,questionPaddingTop:pe=0,questionPaddingBottom:x=0,answerPaddingLeft:se=0,answerPaddingRight:J=0,answerPaddingTop:ye=0,answerPaddingBottom:Me=0}=e,de=t??[],[ce,q]=a.useState(()=>new Set),ee=!n||i;a.useEffect(()=>{q(new Set)},[L]),a.useEffect(()=>{n&&!o&&!i&&q(new Set)},[n,o,i]);const me=Oe=>w.scalingValue(Oe,n??!1),Fe=Math.max(F,Hn),Ce=Math.max(pe,Hn),Ae=Math.max(x,Hn),ue=Math.max(se,Hn),fe=Math.max(J,Hn),Se=Math.max(ye,Hn),D=Math.max(Me,Hn),oe=Math.max(0,(c??1)-y-h),he=Math.max(0,(c??1)-J),be=Math.max(0,(c??1)-se),Ie=Math.max(y,Hn),xe=Math.max(0,(c??1)-F-h),W=a.useMemo(()=>ce.size===0?0:Math.min(...ce),[ce]),ae=a.useCallback(Oe=>ce.has(Oe),[ce]),te=ee&&S==="default"?`${s}-entry-hover-default`:"",j=f??"",Y=j!=="",Re=E.replace(/^rotate /,""),le=`${s}-icon-anim-${Re}`,H=on(Vt(is(v,_,R,Z,A,U,V,I),n)),De=on(Vt(is(G,ne,$,M,N,Q,ie,T),n)),_e=ts(R,Z,`${s}-question`,`${s}-text-tight-leading`),tt=ts($,M,`${s}-answer-text`,`${s}-text-tight-leading`),Qe=ns(R,Z,s,n),at=ns($,M,s,n),$e=w.buildColorVars(s,{questionColor:I,answerColor:T,dividerColor:X,iconColor:k,questionHoverColor:B,iconHoverColor:P,iconActiveColor:C,dividerHoverColor:z},pf,mf),ge=l&&l!=="default"?`${s}-state-${l}`:"",je=a.useCallback(Oe=>{ee&&q(Le=>{if(Le.has(Oe)){const Xe=new Set(Le);return Xe.delete(Oe),Xe}if(L==="on")return new Set([Oe]);const He=new Set(Le);return He.add(Oe),He})},[ee,L]),vt=a.useMemo(()=>hf(s),[s]),Ye={[`--${s}-divider-width`]:w.scalingValue(p,n??!1),[`--${s}-divider-style`]:b,[`--${s}-icon-max-width`]:w.scalingValue(h,n??!1),...u>0?{[`--${s}-question-min-height`]:w.scalingValue(u,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:vt}}),r.jsx("div",{style:$e,children:r.jsx("div",{className:ct(`${s}-wrapper`,n&&!i&&`${s}-editor`,te,ge),style:{width:w.scalingValue(c,n??!1),maxWidth:"100%",...Ye},children:de.map((Oe,Le)=>{var wt;const He=ae(Le),Xe=((wt=Oe.question)==null?void 0:wt.trim())??"",ut=Oe.answer,xt=((ut==null?void 0:ut.length)??0)>0,it=d&&Le===W;return r.jsxs("div",{className:ct(`${s}-item`,He&&`${s}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${s}-question-controls`,children:[it&&r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":"questionPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${s}-control-anchor`,style:{top:0,left:0,width:"100%",height:me(Ce)}}),r.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(oe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${s}-control-anchor`,style:{top:0,left:0,width:me(Fe),height:"100%"}}),r.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(xe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${s}-control-anchor`,style:{top:0,right:0,width:me(Ie),height:"100%"}})]}),r.jsxs("button",{type:"button",className:`${s}-question-button`,"aria-expanded":He,style:{...H,...Qe,paddingLeft:me(F),paddingRight:me(y)},onClick:()=>je(Le),children:[pe>0&&r.jsx("span",{className:`${s}-padding-handle`,style:{height:me(pe)},"aria-hidden":"true"}),r.jsxs("span",{className:`${s}-question-row`,children:[r.jsx("span",{className:_e,children:Xe}),xt&&(Y?r.jsx("span",{className:`${s}-icon ${s}-icon-custom ${le}`,"aria-hidden":"true",children:r.jsx(rn,{url:j,fill:k,hoverFill:P,className:`${s}-icon-image`})}):r.jsx("span",{className:`${s}-icon ${s}-icon-default ${le}`,"aria-hidden":"true"}))]}),x>0&&r.jsx("span",{className:`${s}-padding-handle`,style:{height:me(x)},"aria-hidden":"true"})]}),it&&r.jsx("div",{"data-controls":"questionPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${s}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:me(Ae)}})]}),xt&&ut&&r.jsx("div",{className:`${s}-panel`,"aria-hidden":!He,children:r.jsx("div",{className:`${s}-panel-inner`,children:r.jsxs("div",{className:`${s}-answer-controls`,children:[it&&He&&r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":"answerPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${s}-control-anchor`,style:{top:0,left:0,width:"100%",height:me(Se)}}),r.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(he),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${s}-control-anchor`,style:{top:0,left:0,width:me(ue),height:"100%"}}),r.jsx("div",{"data-controls":"answerPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(be),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${s}-control-anchor`,style:{top:0,right:0,width:me(fe),height:"100%"}})]}),ye>0&&r.jsx("div",{className:`${s}-padding-handle`,style:{height:me(ye)}}),r.jsx("div",{className:`${s}-answer`,style:{...De,...at,paddingLeft:me(se),paddingRight:me(J)},children:r.jsx("div",{className:tt,children:r.jsx(yi,{content:ut})})}),Me>0&&r.jsx("div",{className:`${s}-padding-handle`,style:{height:me(Me)}}),it&&He&&r.jsx("div",{"data-controls":"answerPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${s}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:me(D)}})]})})})]},Le)})})})]})}const yf=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
12120
12252
|
import cn from 'classnames';
|
|
12121
12253
|
import { CommonComponentProps } from '../props';
|
|
12122
12254
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -12862,7 +12994,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
12862
12994
|
</>
|
|
12863
12995
|
);
|
|
12864
12996
|
}
|
|
12865
|
-
`;function On(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ol={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},mf=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],gf={type:"object",version:1,content:{type:"array",display:{type:"array"},items:{type:"object",properties:{question:{type:"string",label:"Question",placeholder:"Add question...",display:{type:"text-input"}},answer:{label:"Answer",placeholder:"Add answer...",display:{type:"rich-text"}}}},default:[{question:"What are the three main parts of The Divine Comedy?",answer:[{type:"paragraph",children:[{text:"The poem is divided into Inferno, Purgatorio, and Paradiso. These three sections follow Dante’s journey through Hell, Purgatory, and Heaven."}]}]},{question:"Who guides Dante through Hell and most of Purgatory?",answer:[{type:"paragraph",children:[{text:"Dante is guided by Virgil, the ancient Roman poet. Virgil represents human reason and wisdom, but because he lived before Christianity, he cannot guide Dante all the way into Heaven."}]}]},{question:"What does the dark wood at the beginning of the poem symbolize?",answer:[{type:"paragraph",children:[{text:"The dark wood symbolizes Dante’s spiritual confusion and moral crisis. It shows that he has lost the “straight way” in life and needs guidance to return to truth and salvation."}]}]},{question:"What is “contrapasso” in Inferno?",answer:[{type:"paragraph",children:[{text:"“Contrapasso” is the principle that punishments in Hell reflect the sins committed during life. For example, people who caused division are themselves physically divided, showing how their punishment mirrors their wrongdoing."}]}]},{question:"Who guides Dante through Heaven?",answer:[{type:"paragraph",children:[{text:"Beatrice guides Dante through Paradiso. She represents divine love, grace, and spiritual understanding, helping Dante move beyond human reason toward a vision of God."}]}]},{question:"Why is The Divine Comedy important in literary history?",answer:[{type:"paragraph",children:[{text:"The Divine Comedy is important because it is one of the greatest works of world literature and helped shape the Italian language. Dante wrote it in the Tuscan dialect rather than Latin, making serious literature more accessible to ordinary readers."}]}]},{question:"What is the overall journey of The Divine Comedy about?",answer:[{type:"paragraph",children:[{text:"The poem is about Dante’s spiritual journey from sin and despair toward repentance, wisdom, and union with God. On a deeper level, it represents the soul’s path from confusion to divine truth."}]}]}]},settings:{sizing:"auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},dividerWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},dividerStyle:{type:"string",scope:"common",title:"Style",display:{type:"toggle-cycle",enum:["solid","dashed","dotted"]}},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default"]}},autoclose:{type:"string",scope:"common",title:"Autoclose",display:{type:"toggle-cycle",enum:["on","off"]}},icon:{type:["string","null"],scope:"common",display:{type:"settings-image-input"}},iconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},iconPaddingRight:On("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...ol.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...ol.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:On("Question Padding Left"),questionPaddingTop:On("Question Padding Top"),questionPaddingBottom:On("Question Padding Bottom"),answerPaddingLeft:On("Answer Padding Left"),answerPaddingRight:On("Answer Padding Right"),answerPaddingTop:On("Answer Padding Top"),answerPaddingBottom:On("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/component-assets/PlusIcon.svg",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[...mf],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},hf={element:uf,id:"faq",name:"FAQ",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/FAQ_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"questionFontFamily"},{path:"answerFontFamily"}]},fontRelations:{questionFontSettings:"questionFontFamily",answerFontSettings:"answerFontFamily"},schema:gf,sourceCode:pf},Fn=e=>e.display==="cover",Mr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},rl=100,ff=.2,al=8,Ic=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=a.useState(0),[l,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const p=a.useMemo(()=>typeof window>"u"?rl:Math.max(rl,window.innerHeight*ff),[]),w=a.useCallback(y=>Math.max(0,1-y/(p*1.5)),[p]),v=a.useCallback(y=>Math.max(0,1-y/(p*.45)),[p]),T=a.useCallback(y=>{const S=typeof window<"u"?window.innerHeight:800,F=Math.max(.88,1-y/S*.12);return`translateY(${y}px) scale(${F})`},[]),g=a.useCallback(()=>{c.current=null},[]),$=a.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),f=a.useCallback(()=>{const y=typeof window<"u"?window.innerHeight:800;d(!0),s(y),window.setTimeout(()=>{t(),g(),d(!1)},Math.min(n,200))},[n,t,g]),R=a.useCallback(y=>{!e||l||y.pointerType==="touch"&&(i!=null&&i(y.target)||(c.current={startX:y.clientX,startY:y.clientY,isLocked:null,pointerId:y.pointerId}))},[e,l,i]),L=a.useCallback(y=>{const S=c.current;if(!e||!S||y.pointerType!=="touch"||S.pointerId!==y.pointerId)return;const F=y.clientX-S.startX,W=y.clientY-S.startY;if(S.isLocked===null){if(Math.abs(F)<al&&Math.abs(W)<al)return;if(W>0&&W>Math.abs(F))S.isLocked=!0,y.currentTarget.setPointerCapture(y.pointerId);else{S.isLocked=!1,g();return}}if(!S.isLocked)return;y.preventDefault();const U=Math.max(0,W);u.current=U,s(U)},[e,g]),I=a.useCallback(y=>{const S=c.current;if(!e||!S||y.pointerType!=="touch"||S.pointerId!==y.pointerId)return;const F=S.isLocked===!0;if(y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),!F){g();return}y.clientY-S.startY>=p?f():$()},[p,f,e,g,$]),Y=a.useCallback(y=>{I(y)},[I]),P=a.useCallback(y=>{I(y)},[I]),V=o>0,M=l?`transform ${n}ms ease`:"none",C=l?`opacity ${n}ms ease`:"none",A=o>0||l;return{isSwipeDragging:V,backdropStyle:{opacity:w(o),transition:C},mediaAreaStyle:{transform:T(o),transition:M,touchAction:V?"none":void 0,willChange:V?"transform":void 0},overlayContentStyle:A?{opacity:v(o),transition:C}:void 0,swipeHandlers:e?{onPointerDown:R,onPointerMove:L,onPointerUp:Y,onPointerCancel:P}:{},dismissAreaStyle:e?{touchAction:V?"none":"pan-x"}:void 0}},yf="[data-lightbox-scrollable]",Rc=()=>{a.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,s=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const l=d=>{const c=d.target;c instanceof Element&&c.closest(yf)||d.preventDefault()};return document.addEventListener("touchmove",l,{passive:!1}),()=>{document.removeEventListener("touchmove",l),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=s,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},vf=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},xf=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},bf=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},wf=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(g,$)=>{xf(t),e.scrollLeft=g,$&&(s==null||s())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,w=0;const v=()=>{t.removeEventListener("transitionend",T),clearTimeout(w)},T=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,v(),u(n,!0))};return t.addEventListener("transitionend",T),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,w=window.setTimeout(()=>{p||(p=!0,v(),u(n,!0))},i+64),()=>{p||(p=!0,v(),u(l-bf(t),!1))}},so=300,Sf=900,$f=1500,Cf="cubic-bezier(0.16, 1, 0.3, 1)",Tf=3e3,Lf=2,If=16,Rf=.05,Ef=1,Vo=.3,Mf=50,kf=20,bi=.004,zi=["title1","title2","title3"],Pf={title1:"1",title2:"2",title3:"3"},Af={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Ff={title1:.02,title2:.02,title3:.02},Go=e=>`max(${e}, ${kf}px)`,Wf=e=>{if(!Array.isArray(e)||e.length===0)return{};const t=e.find(o=>(o==null?void 0:o.type)==="paragraph")??e[0],n=t==null?void 0:t.children;if(!Array.isArray(n))return{};const i=n.map(o=>typeof(o==null?void 0:o.text)=="string"?o.text.trim():"").filter(Boolean);return{title1:i[0],title2:i[1],title3:i[2]}},_f=e=>{if(!e)return{title1:"",title2:"",title3:""};if(e.title1||e.title2||e.title3)return{title1:e.title1??"",title2:e.title2??"",title3:e.title3??""};const t=Wf(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Wt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Nf=e=>[Wt(e,"fontFamily"),Wt(e,"fontSettings"),{type:"row",items:[Wt(e,"fontSize"),Wt(e,"lineHeight"),Wt(e,"letterSpacing"),Wt(e,"wordSpacing")]},Wt(e,"textAlign"),Wt(e,"textAppearance")],Hf=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(zi.map(e=>[Pf[e],Nf(e)]))}),os=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Ec=(e,t)=>os(e,t),qo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},sl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:os(e.length,n),effective:Ec(e.length,n)}},Of=(e,t,n,i,o,s,l)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:s,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},Qr=(e,t)=>{const n=i=>{const o=Wt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Af[t]]}},Df=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),ea=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??Ff[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return zt(i,n)},jf=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:w,closeIcon:v,closeIconMaxWidth:T,closeIconColor:g,closeIconHoverColor:$,thumbnailTrigger:f,thumbnailVisibility:R,thumbnailObjectFit:L,thumbnailActive:I,thumbnailActiveColor:Y,title1Width:P,title2Width:V,title3Width:M,title1MarginLeft:C=0,title2MarginLeft:A=0,title3MarginLeft:y=0,titleRowMarginBottom:S=0,titleHeaderLayout:F="desktop",contentMarginTop:W,iconMarginLeft:U}=n,G=m=>x.scalingValue(m,i??!1),J=c??n.thumnailSize??.03,D=G(J),j=G(u),O=G(p??.02),E=G(w??0),K=G(W??0),Z=Go(K),ce=G(U??0),[N,pe]=a.useState(0),b=a.useRef(N);b.current=N;const he=t[N],{title1:Q,title2:we,title3:Te}=_f(he),se=ea("title1",Qr(n,"title1"),i),oe=ea("title2",Qr(n,"title2"),i),q=ea("title3",Qr(n,"title3"),i),de=F==="mobile",ge=!o&&(!i||s),_e=ge,Ce=ge,Me=ge,fe=Fn(L),ye=fe?{"--image-aspect-ratio":Mr(L)}:void 0,Se=!!(Q||we||Te),B=a.useMemo(()=>Of(e,Q,we,Te,se,oe,q),[e,N,Q,we,Te,se,oe,q]),ue=a.useMemo(()=>({title1Width:P,title2Width:V,title3Width:M}),[P,V,M]),ve=a.useMemo(()=>B.map(m=>ue[m.widthKey]),[B,ue]),me=a.useMemo(()=>os(B.length,ve),[B.length,ve]),Ee=a.useMemo(()=>Ec(B.length,ve),[B.length,ve]),be=a.useMemo(()=>B.filter(m=>m.prefix==="title1"),[B]),k=a.useMemo(()=>B.filter(m=>m.prefix==="title2"||m.prefix==="title3"),[B]),re=a.useMemo(()=>sl(be,ue),[be,ue]),te=a.useMemo(()=>sl(k,ue),[k,ue]),z=a.useCallback((m,H)=>{const X=B.indexOf(m);if(!de||H==="single-row")return{effectiveWidth:Ee[X]??0,resolvedWidth:me[X]??0,maxWidth:qo(X,me)};if(H==="two-row-top"){const ke=be.indexOf(m);return{effectiveWidth:re.effective[ke]??0,resolvedWidth:re.resolved[ke]??0,maxWidth:qo(ke,re.resolved)}}const $e=k.indexOf(m);return{effectiveWidth:te.effective[$e]??0,resolvedWidth:te.resolved[$e]??0,maxWidth:qo($e,te.resolved)}},[k,te,Ee,me,B,be,re,de]),le=a.useCallback(m=>x.scalingValue(m,i??!1),[i]),Re=le(S??0),ae=a.useMemo(()=>({title1MarginLeft:C,title2MarginLeft:A,title3MarginLeft:y}),[C,A,y]),_=a.useCallback(m=>B.slice(0,m+1).reduce((H,X,$e)=>H+(X!=null&&X.marginLeftKey?ae[X.marginLeftKey]??0:0)+(me[$e]??0),0)+(de?0:C??0),[B,ae,me,de,C]),Ne=a.useCallback(()=>de?0:C??0,[de,C]),Fe=a.useCallback(m=>k.slice(0,m).reduce((H,X,$e)=>H+(X.marginLeftKey?ae[X.marginLeftKey]??0:0)+(te.resolved[$e]??0),0),[k,te.resolved,ae]),et=a.useCallback(m=>{const H=k[m];return Fe(m)+(H.marginLeftKey?ae[H.marginLeftKey]??0:0)+(te.resolved[m]??0)},[k,te.resolved,Fe,ae]),Ke=(m,H)=>{const X=m.marginLeftKey?ae[m.marginLeftKey]??0:0,{effectiveWidth:$e,resolvedWidth:ke,maxWidth:Ge}=z(m,H),ht=o&&H==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":m.prefix,style:{...H==="single-row"?{gridArea:m.prefix}:{},width:le($e),...X>0?{marginLeft:le(X)}:{}},children:[r.jsx("p",{className:m.className,style:m.style,children:m.text}),ht&&m.marginLeftKey&&r.jsx("div",{"data-controls":m.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:le(-X),width:`max(${le(X)}, 10px)`,height:"100%",pointerEvents:"auto"}}),ht&&r.jsx("div",{"data-controls":m.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:le(-bi/2),width:le(bi),height:"100%",pointerEvents:"auto"}})]},m.className)},Ie=()=>{const m=de?-1:B.findIndex($e=>$e.prefix==="title1"),H=!de&&(o||(C??0)>0)?(()=>{const $e=C??0,ke=m>=0?me[m]:P??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:0,width:`max(${le($e)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,X=B.flatMap(($e,ke)=>{if(!$e.marginLeftKey)return[];const Ge=ae[$e.marginLeftKey]??0,ht=Df(B,me,ae,ke)+Ne();return r.jsx("div",{"data-controls":$e.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(me[ke]),style:{position:"absolute",top:0,left:le(ht),width:`max(${le(Ge)}, 10px)`,height:"100%",pointerEvents:"auto"}},$e.marginLeftKey)});return H?[H,...X]:X},ee=()=>B.map((m,H)=>{const X=qo(H,me),ke=_(H)-bi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":m.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(X),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(ke),width:le(bi),height:"100%",pointerEvents:"auto"}})},`${m.widthKey}-junction`)}),ne=()=>k.flatMap((m,H)=>{if(!m.marginLeftKey)return[];const X=ae[m.marginLeftKey]??0,$e=Fe(H),{resolvedWidth:ke}=z(m,"two-row-bottom");return r.jsx("div",{"data-controls":m.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:le($e),width:`max(${le(X)}, 10px)`,height:"100%",pointerEvents:"auto"}},m.marginLeftKey)}),He=()=>k.map((m,H)=>{const{maxWidth:X}=z(m,"two-row-bottom"),ke=et(H)-bi/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":m.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(X),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(ke),width:le(bi),height:"100%",pointerEvents:"auto"}})},`${m.widthKey}-junction`)}),st=a.useRef(null),Be=a.useRef(null),Oe=a.useRef(null),je=a.useRef(null),qe=a.useRef([]),tt=a.useRef([]),mt=a.useRef(0),St=a.useRef(null),lt=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),pt=a.useRef(null),Mt=a.useRef(null),nt=a.useRef(0),Ve=a.useRef("forward"),De=a.useRef(0),vt=a.useRef(null),bt=a.useRef(!1),Pt=t.length>1&&(!o||!!s),Dt=Pt?3:1,tn=a.useMemo(()=>Array.from({length:Dt},()=>t).flat(),[t,Dt]),[ln,Tt]=a.useState(!1),[kt,Yt]=a.useState(!1),[qt,Le]=a.useState(!0),Ue=a.useRef(null),Xe=a.useRef(null),ct=a.useRef(!1),Rt=a.useRef(!1),ut=a.useRef(null),it=a.useRef(null),Ut=_e&&!qt,Ze=a.useCallback(()=>{_e&&(Le(!0),it.current&&clearTimeout(it.current),it.current=setTimeout(()=>{lt.current.isActive||Le(!1)},Tf))},[_e]),Je=a.useCallback(()=>{o||Rt.current||(Rt.current=!0,Yt(!1),ut.current=setTimeout(()=>{l()},so))},[o,l]),rt=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":Ut?"true":"false",style:{width:x.scalingValue(T??0,i),height:x.scalingValue(T??0,i),marginRight:ce,"--close-icon-hover-color":$},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Je,"aria-label":"Close",children:r.jsx(on,{url:v,fill:g,hoverFill:i&&!s?g:$,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ce,height:"100%",pointerEvents:"auto"}})]}),Lt=(m="two-row")=>r.jsx("div",{...m==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:le(C??0),flexShrink:0,...m==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...m==="two-row"&&o?{pointerEvents:"auto"}:{}}}),It=()=>{const m=B.find($e=>$e.prefix==="title1"),H=B.filter($e=>$e.prefix==="title2"||$e.prefix==="title3"),X=H.length>0||o||(S??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(C??0)>0||o?Lt():null,m&&Ke(m,"two-row-top"),v&&rt()]}),X?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[H.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[H.map($e=>Ke($e,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[ne(),He()]})]}):null,r.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:Re,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ft=()=>r.jsxs(r.Fragment,{children:[(C??0)>0||o?Lt("single-row"):null,B.map(m=>Ke(m,"single-row")),o?r.jsxs(r.Fragment,{children:[Ie(),ee()]}):null,v?rt():null]}),Ft=a.useCallback(m=>!!(m.closest("[data-controls]")||m.closest(`.${e}-thumbnails`)||m.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ot,backdropStyle:Ht,mediaAreaStyle:Vt,overlayContentStyle:xt,swipeHandlers:Gt,dismissAreaStyle:Kt}=Ic({enabled:ge??!1,onClose:Je,animMs:so,isBlockedTarget:Ft}),Xt=()=>{if(!Pt||t.length===0)return mt.current=0,0;const m=tt.current[0],H=tt.current[t.length];if(!m||!H)return mt.current;const X=H.offsetLeft-m.offsetLeft;return X>0&&(mt.current=X),mt.current},Zt=(m=!1)=>{if(!Pt)return;const H=Be.current,X=Xt();!H||X<=0||X<H.clientWidth*.25||(H.scrollLeft<=0?(H.scrollLeft+=X,m&&(lt.current.scrollLeft+=X),bt.current&&(De.current+=X)):H.scrollLeft>=X*2&&(H.scrollLeft-=X,m&&(lt.current.scrollLeft-=X),bt.current&&(De.current-=X)))},jt=(m,H=(X=>(X=Be.current)==null?void 0:X.scrollLeft)()??0)=>{if(!Pt)return m;let $e=t.length+m,ke=1/0;for(let Ge=0;Ge<Dt;Ge++){const ht=Ge*t.length+m,$t=tt.current[ht];if(!$t)continue;const en=Math.abs($t.offsetLeft-H);en<ke&&(ke=en,$e=ht)}return $e},wt=m=>{const H=Be.current;return!m||!H?!1:m.offsetWidth>H.clientWidth+1},h=m=>{const H=Be.current;if(!m||!H||!wt(m))return!1;const X=m.offsetLeft,$e=X+m.offsetWidth;return H.scrollLeft>=X-1&&H.scrollLeft+H.clientWidth<=$e+1},xe=(m=(H=>(H=Be.current)==null?void 0:H.scrollLeft)()??0)=>{for(let $e=0;$e<tt.current.length;$e+=1){const ke=tt.current[$e];if(ke&&h(ke))return $e}let X={flatIndex:0,distance:1/0};return tt.current.forEach(($e,ke)=>{if(!$e)return;const Ge=Math.abs($e.offsetLeft-m);Ge<X.distance&&(X={flatIndex:ke,distance:Ge})}),X.flatIndex},Pe=m=>{Be.current&&tt.current.forEach(H=>{H&&(H.style.scrollSnapAlign=wt(H)&&m==="backward"?"end":"start")})},Ae=(m,H,X)=>{const $e=m-H,ke=xe(H),Ge=tt.current[ke];if(h(Ge))return xe(m)%t.length;const ht=tt.current[ke+1],$t=Ge?ht?ht.offsetLeft-Ge.offsetLeft:Ge.offsetWidth:0,en=$t>0?$e>$t*Vo?1:$e<-$t*Vo?-1:0:0;return en===0?X:Pt?(X+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,X+en))},at=a.useCallback((m=!1)=>{if(R!=="on"||o)return;const H=je.current,X=b.current,$e=qe.current[X];if(!H||!$e||H.scrollWidth<=H.clientWidth)return;const ke=H.scrollLeft,Ge=ke+H.clientWidth,ht=$e.offsetLeft,$t=ht+$e.offsetWidth;if(ht>=ke&&$t<=Ge)return;const en=H.scrollWidth-H.clientWidth;let Jt=ke;if(!m&&Ue.current===null){const vi=qe.current[X-1],Yi=qe.current[X+1],Fo=vi?$e.offsetLeft-vi.offsetLeft:Yi?Yi.offsetLeft-$e.offsetLeft:$e.offsetWidth;$t>Ge?Jt+=Fo:ht<ke&&(Jt-=Fo)}else $t>Ge?Jt=$t-H.clientWidth:Jt=ht;H.scrollLeft=Math.max(0,Math.min(en,Jt))},[o,R]),At=a.useCallback((m=!1)=>{m&&(ct.current=!0),Xe.current===null&&(Xe.current=requestAnimationFrame(()=>{Xe.current=null;const H=ct.current;ct.current=!1,at(H)}))},[at]),Qe=a.useCallback(m=>{if(m===b.current)return;const H=b.current;b.current=m;const X=Math.abs(m-H)>1,$e=Pt&&t.length>1&&(H===t.length-1&&m===0||H===0&&m===t.length-1);pe(m),At(X||$e)},[t.length,Pt,At]),gt=()=>{if(!Be.current||t.length===0||Ue.current!==null||lt.current.isActive&<.current.hasMoved)return;const m=Be.current.scrollLeft,H=xe(m)%t.length;H!==b.current&&Qe(H)},_t=()=>{Ue.current=null},Et=m=>{const H=Be.current;H&&(H.style.scrollSnapType=m?"":"none")},cn=()=>{var m;(m=Mt.current)==null||m.call(Mt),Mt.current=null},dn=()=>{vt.current!==null&&(cancelAnimationFrame(vt.current),vt.current=null),bt.current=!1},ei=()=>{const m=Be.current;if(!m){vt.current=null,bt.current=!1;return}const H=De.current-m.scrollLeft;if(Math.abs(H)<.5){m.scrollLeft=De.current,Zt(),gt(),vt.current=null,bt.current=!1;return}m.scrollLeft+=H*Rf,Zt(),gt(),Ze(),vt.current=requestAnimationFrame(ei)},ti=()=>{const m=Oe.current;m&&(m.style.transition="",m.style.transform="",m.style.willChange="")},Mo=(m,H,X,$e)=>{ti(),m.scrollLeft=H,nt.current=m.scrollLeft,Zt(),X!==void 0?(b.current=X,pe(X)):gt(),Et(!0),$e==null||$e()},ko=(m,{behavior:H="smooth",activeIndex:X,onComplete:$e}={})=>{const ke=Be.current,Ge=Oe.current;if(!ke||!Ge)return;if(dn(),cn(),Et(!1),H==="auto"){Mo(ke,m,X,$e);return}const ht=Math.abs(m-ke.scrollLeft),$t=vf(ht,Sf,$f,ke.clientWidth*.55);Mt.current=wf(ke,Ge,m,{duration:$t,easing:Cf,onComplete:()=>{Mt.current=null,Mo(ke,m,X,$e)}})},Pr=(m="smooth")=>{const H=Be.current;if(!H||t.length===0)return;const X=xe()%t.length,$e=jt(X,H.scrollLeft),ke=tt.current[$e];ke&&ko(ke.offsetLeft,{behavior:m,activeIndex:X})},Ar=(m,H="smooth",X,$e)=>{const ke=Be.current;if(!ke||t.length===0)return;const Ge=($e??ke.scrollLeft)-m,ht=xe(m),$t=tt.current[ht];if(h($t)){Et(!0),gt();return}const en=tt.current[ht+1],Jt=$t?en?en.offsetLeft-$t.offsetLeft:$t.offsetWidth:0;if((Jt>0?Ge>Jt*Vo?1:Ge<-Jt*Vo?-1:0:0)!==0){const _c=X??ht%t.length,Nc=Ae($e??ke.scrollLeft,m,_c);wn(Nc,H);return}const Yi=$e??ke.scrollLeft,Fo=xe(Yi),rs=tt.current[Fo];if(rs&&Math.abs(rs.offsetLeft-Yi)<1){Et(!0),gt();return}Pr("auto")},wn=(m,H="smooth")=>{const X=Be.current;if(!X||t.length===0)return;const $e=jt(m,X.scrollLeft),ke=tt.current[$e];ke&&(H==="smooth"?Ue.current=m:Ue.current=null,b.current=m,pe(m),At(!0),ko(ke.offsetLeft,{behavior:H,activeIndex:m,onComplete:H==="smooth"?_t:void 0}))},yi=()=>{pt.current&&(window.removeEventListener("pointerup",pt.current),window.removeEventListener("pointercancel",pt.current),pt.current=null)},Po=(m,H,X,$e,ke)=>{const Ge=X-m,ht=$e-H,$t=Math.abs(Ge),en=Math.abs(ht);if($t<Mf||$t<=en)return!1;const Jt=Ge<0?1:-1,vi=Pt?(ke+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,ke+Jt));return vi===ke?!1:(wn(vi),!0)},ni=m=>{if(!lt.current.isActive)return;yi();const H=Be.current;if(!H)return;const{scrollLeft:X,startActiveIndex:$e,hasMoved:ke}=lt.current,Ge=H.scrollLeft;Zt(!0),lt.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},Tt(!1),m!==void 0&&H.hasPointerCapture(m)&&H.releasePointerCapture(m),ke?Ar(X,"smooth",$e,Ge):(Et(!0),gt()),Ze()},Ao=(m,H)=>{const X=St.current;St.current=null,X&&(Po(X.startX,X.startY,m,H,X.startActiveIndex),Ze())},Fr=m=>{if(!Ce)return;if(m.pointerType==="touch"){if(dn(),Et(!0),Ft(m.target))return;St.current={startX:m.clientX,startY:m.clientY,startActiveIndex:b.current};return}if(m.pointerType!=="mouse"||m.button!==0||Ft(m.target))return;const H=Be.current;if(!H)return;dn(),cn(),ti(),Ue.current=null,lt.current={isActive:!0,startX:m.clientX,scrollLeft:H.scrollLeft,startActiveIndex:b.current,hasMoved:!1},Et(!1),Ze(),H.setPointerCapture(m.pointerId),yi();const X=$e=>{$e.pointerType==="mouse"&&ni($e.pointerId)};pt.current=X,window.addEventListener("pointerup",X),window.addEventListener("pointercancel",X)},Wr=m=>{if(!Ce||m.pointerType!=="mouse")return;const H=Be.current;if(!H||!lt.current.isActive)return;if(m.buttons===0){ni(m.pointerId);return}const X=m.clientX-lt.current.startX;Math.abs(X)>Ef&&(lt.current.hasMoved=!0,Tt(!0)),lt.current.hasMoved&&(m.preventDefault(),H.scrollLeft=lt.current.scrollLeft-X,Zt(!0),gt(),Ze())},ie=m=>{if(Ce){if(m.pointerType==="touch"){m.type==="pointerup"?Ao(m.clientX,m.clientY):St.current=null;return}m.pointerType==="mouse"&&ni(m.pointerId)}},We=m=>{!Ce||m.pointerType!=="mouse"||ni(m.pointerId)};return Rc(),a.useEffect(()=>{const m=requestAnimationFrame(()=>Yt(!0));return()=>{cancelAnimationFrame(m),cn(),yi(),Xe.current!==null&&(cancelAnimationFrame(Xe.current),Xe.current=null),ut.current&&clearTimeout(ut.current),it.current&&clearTimeout(it.current)}},[]),a.useEffect(()=>{if(!_e){Le(!0);return}Ze();const m=st.current;if(!m)return;const H=()=>Ze();return m.addEventListener("pointermove",H),m.addEventListener("pointerdown",H),()=>{m.removeEventListener("pointermove",H),m.removeEventListener("pointerdown",H),it.current&&clearTimeout(it.current)}},[_e,Ze]),a.useEffect(()=>{const m=H=>{H.key==="Escape"&&Je()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[Je]),a.useLayoutEffect(()=>{Xt()},[E,t.length,Pt]),a.useLayoutEffect(()=>{o||wn(b.current,"auto")},[E,o]),a.useLayoutEffect(()=>{wn(0,"auto")},[t.length,Pt]),a.useEffect(()=>{const m=Be.current;if(!m||o||!ge)return;const H=X=>{if(X.preventDefault(),Math.abs(X.deltaY)<=Math.abs(X.deltaX))return;const $e=X.deltaMode===1?If:X.deltaMode===2?m.clientHeight:1,ke=X.deltaY*$e*Lf;if(ke!==0){if(cn(),bt.current||(bt.current=!0,De.current=m.scrollLeft,Ue.current=null,Et(!1)),De.current+=ke,!Pt){const Ge=m.scrollWidth-m.clientWidth;De.current=Math.max(0,Math.min(Ge,De.current))}Ze(),vt.current===null&&(vt.current=requestAnimationFrame(ei))}};return m.addEventListener("wheel",H,{passive:!1}),()=>{m.removeEventListener("wheel",H),dn()}},[o,ge,Pt]),a.useEffect(()=>{const m=Be.current;if(!m)return;const H=()=>{Zt(lt.current.isActive);const $e=m.scrollLeft,ke=$e-nt.current;nt.current=$e;const Ge=mt.current>0?mt.current*.5:1/0;if(ke!==0&&Math.abs(ke)<Ge){const ht=ke>0?"forward":"backward";ht!==Ve.current&&(Ve.current=ht,Pe(ht))}lt.current.isActive&<.current.hasMoved||gt()};m.addEventListener("scroll",H,{passive:!0});const X=new ResizeObserver(()=>{Xt(),Zt(lt.current.isActive),Pe(Ve.current),gt()});return X.observe(m),()=>{cn(),m.removeEventListener("scroll",H),X.disconnect()}},[t.length,Pt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ot||Je()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:kt?1:0,transition:`opacity ${so}ms ease`,pointerEvents:kt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Ht}}),r.jsxs("div",{ref:st,className:`${e}-lightbox-dismiss-area`,style:Kt,...Gt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Vt,onClick:m=>m.stopPropagation(),children:r.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Ce&&t.length>0?"true":"false","data-mouse-dragging":ln?"true":"false",onPointerDown:Fr,onPointerMove:Wr,onPointerUp:ie,onPointerCancel:ie,onLostPointerCapture:We,children:r.jsx("div",{ref:Oe,className:`${e}-lightbox-strip-track`,style:{gap:E},children:tn.map((m,H)=>{const X=m.image.objectFit??"contain",$e=H%t.length,ke=Math.floor(H/t.length),Ge=Go(E),ht=`calc(-0.5 * (${Ge} + ${E}))`;return r.jsxs("div",{ref:$t=>tt.current[H]=$t,className:`${e}-strip-item`,style:{height:F==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:m.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:X}}),o&&$e<t.length-1&&ke===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ht,width:Ge,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ke}-${m.image.url}-${$e}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":Ut?"true":"false",style:xt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:K,flexShrink:0,pointerEvents:"none"},children:o&&r.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:Z,pointerEvents:"auto",zIndex:3}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:r.jsx("div",{className:`${e}-lightbox-content-area${de?` ${e}-lightbox-content-area-stacked`:""}`,children:(Se||v)&&r.jsx("div",{className:`${e}-header ${de?`${e}-header-two-row`:`${e}-header-single-row`}`,children:de?It():Se||v?ft():null})})})]}),t.length>1&&R==="on"&&(()=>{const m=Go(O),H=`calc(-0.5 * (${O} + ${m}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:O},children:r.jsx("div",{ref:je,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:X=>X.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":I,style:{gap:j,"--thumbnail-active-color":Y},children:[t.map((X,$e)=>{const ke=Go(j),Ge=`calc(-0.5 * (${ke} + ${j}))`;return r.jsxs("div",{ref:ht=>{qe.current[$e]=ht},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":N===$e?"true":"false",onClick:()=>ge&&f==="click"&&wn($e),onMouseEnter:()=>Me&&f==="hover"&&wn($e),"aria-label":X.image.name?`View ${X.image.name}`:`View image ${$e+1}`,"aria-current":N===$e?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${fe?` ${e}-thumb-image-cover`:""}`,src:X.image.url,alt:"",draggable:!1,style:{...ye,maxWidth:D,maxHeight:D,width:L.display==="cover"?"auto":"100%",height:"auto",objectFit:L.display==="cover"?"cover":"contain"}})}),o&&$e<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ge,width:ke,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${X.image.url}-${$e}`)}),o&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:H,height:m,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function zf(e){return`
|
|
12997
|
+
`;function On(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const os={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},vf=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],xf={type:"object",version:1,content:{type:"array",display:{type:"array"},items:{type:"object",properties:{question:{type:"string",label:"Question",placeholder:"Add question...",display:{type:"text-input"}},answer:{label:"Answer",placeholder:"Add answer...",display:{type:"rich-text"}}}},default:[{question:"What are the three main parts of The Divine Comedy?",answer:[{type:"paragraph",children:[{text:"The poem is divided into Inferno, Purgatorio, and Paradiso. These three sections follow Dante’s journey through Hell, Purgatory, and Heaven."}]}]},{question:"Who guides Dante through Hell and most of Purgatory?",answer:[{type:"paragraph",children:[{text:"Dante is guided by Virgil, the ancient Roman poet. Virgil represents human reason and wisdom, but because he lived before Christianity, he cannot guide Dante all the way into Heaven."}]}]},{question:"What does the dark wood at the beginning of the poem symbolize?",answer:[{type:"paragraph",children:[{text:"The dark wood symbolizes Dante’s spiritual confusion and moral crisis. It shows that he has lost the “straight way” in life and needs guidance to return to truth and salvation."}]}]},{question:"What is “contrapasso” in Inferno?",answer:[{type:"paragraph",children:[{text:"“Contrapasso” is the principle that punishments in Hell reflect the sins committed during life. For example, people who caused division are themselves physically divided, showing how their punishment mirrors their wrongdoing."}]}]},{question:"Who guides Dante through Heaven?",answer:[{type:"paragraph",children:[{text:"Beatrice guides Dante through Paradiso. She represents divine love, grace, and spiritual understanding, helping Dante move beyond human reason toward a vision of God."}]}]},{question:"Why is The Divine Comedy important in literary history?",answer:[{type:"paragraph",children:[{text:"The Divine Comedy is important because it is one of the greatest works of world literature and helped shape the Italian language. Dante wrote it in the Tuscan dialect rather than Latin, making serious literature more accessible to ordinary readers."}]}]},{question:"What is the overall journey of The Divine Comedy about?",answer:[{type:"paragraph",children:[{text:"The poem is about Dante’s spiritual journey from sin and despair toward repentance, wisdom, and union with God. On a deeper level, it represents the soul’s path from confusion to divine truth."}]}]}]},settings:{sizing:"auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},cellMinHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},dividerWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},dividerStyle:{type:"string",scope:"common",title:"Style",display:{type:"toggle-cycle",enum:["solid","dashed","dotted"]}},entryHoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["none","default"]}},autoclose:{type:"string",scope:"common",title:"Autoclose",display:{type:"toggle-cycle",enum:["on","off"]}},icon:{type:["string","null"],scope:"common",display:{type:"settings-image-input"}},iconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},iconPaddingRight:On("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...os.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...os.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:On("Question Padding Left"),questionPaddingTop:On("Question Padding Top"),questionPaddingBottom:On("Question Padding Bottom"),answerPaddingLeft:On("Answer Padding Left"),answerPaddingRight:On("Answer Padding Right"),answerPaddingTop:On("Answer Padding Top"),answerPaddingBottom:On("Answer Padding Bottom")},defaults:{dividerStyle:"dotted",entryHoverEffect:"default",autoclose:"off",icon:"https://cdn.cntrl.site/component-assets/PlusIcon.svg",iconAnimation:"rotate 45",questionColor:"#000000",answerColor:"#000000",dividerColor:"#000000",iconColor:"#000000",questionHoverColor:"#A60239",iconHoverColor:"#A60239",iconActiveColor:"#000000",dividerHoverColor:"#A60239",questionFontFamily:"Goudy Bookletter 1911",questionFontSettings:{fontWeight:400,fontStyle:"normal"},questionLetterSpacing:0,questionWordSpacing:0,questionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},answerFontFamily:"Goudy Bookletter 1911",answerFontSettings:{fontWeight:400,fontStyle:"normal"},answerLetterSpacing:0,answerWordSpacing:0,answerTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{wrapperWidth:1,cellMinHeight:0,dividerWidth:.008,iconMaxWidth:.0533,iconPaddingRight:.08,questionFontSize:.09066,questionLineHeight:.10133,questionLetterSpacing:-.00266,answerFontSize:.0533,answerLineHeight:.064,questionPaddingLeft:.0533,questionPaddingTop:.0533,questionPaddingBottom:.0533,answerPaddingLeft:.0533,answerPaddingRight:.16,answerPaddingTop:.0533,answerPaddingBottom:.0533},t:{wrapperWidth:.651041,cellMinHeight:0,dividerWidth:.00390625,iconMaxWidth:.02604166,iconPaddingRight:.0130208,questionFontSize:.0390625,questionLineHeight:.04427,questionLetterSpacing:-.00091145833,answerFontSize:.0234375,answerLineHeight:.026041,questionPaddingLeft:0,questionPaddingTop:.01302,questionPaddingBottom:.01302,answerPaddingLeft:.065104,answerPaddingRight:.09765625,answerPaddingTop:.026041,answerPaddingBottom:.026041},d:{wrapperWidth:.6388,cellMinHeight:0,dividerWidth:.002083,iconMaxWidth:.01388,iconPaddingRight:.01388,questionFontSize:.0333,questionLineHeight:.0333,questionLetterSpacing:-9e-4,answerFontSize:.01111,answerLineHeight:.01388,questionPaddingLeft:0,questionPaddingTop:.01111,questionPaddingBottom:.01111,answerPaddingLeft:.0625,answerPaddingRight:.1625,answerPaddingTop:0,answerPaddingBottom:.01111}},layout:["__componentName__","wrapperWidth","cellMinHeight","dividerWidth","dividerStyle","entryHoverEffect","autoclose","icon","iconMaxWidth","iconAnimation"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["wrapperWidth","cellMinHeight"]},{type:"row",title:"",items:["entryHoverEffect","autoclose"]},{type:"row",title:"Divider",items:["dividerWidth","dividerStyle"]},{type:"row",title:"Icon",items:["icon","iconMaxWidth"]},{type:"row",title:"",items:["iconAnimation"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Question",items:["questionFontFamily","questionFontSettings",{type:"row",items:["questionFontSize","questionLineHeight","questionLetterSpacing","questionWordSpacing"]},"questionTextAppearance"]},{type:"group",title:"Answer",items:["answerFontFamily","answerFontSettings",{type:"row",items:["answerFontSize","answerLineHeight","answerLetterSpacing","answerWordSpacing"]},"answerTextAppearance"]}]}],paletteBookmark:{items:[...vf],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},bf={element:ff,id:"faq",name:"FAQ",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/FAQ_List.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"questionFontFamily"},{path:"answerFontFamily"}]},fontRelations:{questionFontSettings:"questionFontFamily",answerFontSettings:"answerFontFamily"},schema:xf,sourceCode:yf},Fn=e=>e.display==="cover",Pr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},rs=100,wf=.2,as=8,Pc=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,l]=a.useState(0),[s,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const p=a.useMemo(()=>typeof window>"u"?rs:Math.max(rs,window.innerHeight*wf),[]),b=a.useCallback(v=>Math.max(0,1-v/(p*1.5)),[p]),S=a.useCallback(v=>Math.max(0,1-v/(p*.45)),[p]),L=a.useCallback(v=>{const _=typeof window<"u"?window.innerHeight:800,R=Math.max(.88,1-v/_*.12);return`translateY(${v}px) scale(${R})`},[]),f=a.useCallback(()=>{c.current=null},[]),h=a.useCallback(()=>{d(!0),l(0),window.setTimeout(()=>d(!1),n),f()},[n,f]),y=a.useCallback(()=>{const v=typeof window<"u"?window.innerHeight:800;d(!0),l(v),window.setTimeout(()=>{t(),f(),d(!1)},Math.min(n,200))},[n,t,f]),E=a.useCallback(v=>{!e||s||v.pointerType==="touch"&&(i!=null&&i(v.target)||(c.current={startX:v.clientX,startY:v.clientY,isLocked:null,pointerId:v.pointerId}))},[e,s,i]),I=a.useCallback(v=>{const _=c.current;if(!e||!_||v.pointerType!=="touch"||_.pointerId!==v.pointerId)return;const R=v.clientX-_.startX,Z=v.clientY-_.startY;if(_.isLocked===null){if(Math.abs(R)<as&&Math.abs(Z)<as)return;if(Z>0&&Z>Math.abs(R))_.isLocked=!0,v.currentTarget.setPointerCapture(v.pointerId);else{_.isLocked=!1,f();return}}if(!_.isLocked)return;v.preventDefault();const A=Math.max(0,Z);u.current=A,l(A)},[e,f]),T=a.useCallback(v=>{const _=c.current;if(!e||!_||v.pointerType!=="touch"||_.pointerId!==v.pointerId)return;const R=_.isLocked===!0;if(v.currentTarget.hasPointerCapture(v.pointerId)&&v.currentTarget.releasePointerCapture(v.pointerId),!R){f();return}v.clientY-_.startY>=p?y():h()},[p,y,e,f,h]),X=a.useCallback(v=>{T(v)},[T]),k=a.useCallback(v=>{T(v)},[T]),B=o>0,P=s?`transform ${n}ms ease`:"none",C=s?`opacity ${n}ms ease`:"none",z=o>0||s;return{isSwipeDragging:B,backdropStyle:{opacity:b(o),transition:C},mediaAreaStyle:{transform:L(o),transition:P,touchAction:B?"none":void 0,willChange:B?"transform":void 0},overlayContentStyle:z?{opacity:S(o),transition:C}:void 0,swipeHandlers:e?{onPointerDown:E,onPointerMove:I,onPointerUp:X,onPointerCancel:k}:{},dismissAreaStyle:e?{touchAction:B?"none":"pan-x"}:void 0}},Sf="[data-lightbox-scrollable]",kc=()=>{a.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,l=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const s=d=>{const c=d.target;c instanceof Element&&c.closest(Sf)||d.preventDefault()};return document.addEventListener("touchmove",s,{passive:!1}),()=>{document.removeEventListener("touchmove",s),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=l,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},$f=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Cf=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Tf=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Lf=(e,t,n,{duration:i,easing:o,onComplete:l})=>{const s=e.scrollLeft,d=n-s,c=s-n,u=(f,h)=>{Cf(t),e.scrollLeft=f,h&&(l==null||l())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,b=0;const S=()=>{t.removeEventListener("transitionend",L),clearTimeout(b)},L=f=>{f.target!==t||f.propertyName!=="transform"||p||(p=!0,S(),u(n,!0))};return t.addEventListener("transitionend",L),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,b=window.setTimeout(()=>{p||(p=!0,S(),u(n,!0))},i+64),()=>{p||(p=!0,S(),u(s-Tf(t),!1))}},co=300,If=900,Rf=1500,Mf="cubic-bezier(0.16, 1, 0.3, 1)",Ef=3e3,Pf=2,kf=16,Af=.05,Ff=1,qo=.3,Wf=50,_f=20,Si=.004,Gi=["title1","title2","title3"],Nf={title1:"1",title2:"2",title3:"3"},Hf={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Of={title1:.02,title2:.02,title3:.02},Uo=e=>`max(${e}, ${_f}px)`,jf=e=>{if(!Array.isArray(e)||e.length===0)return{};const t=e.find(o=>(o==null?void 0:o.type)==="paragraph")??e[0],n=t==null?void 0:t.children;if(!Array.isArray(n))return{};const i=n.map(o=>typeof(o==null?void 0:o.text)=="string"?o.text.trim():"").filter(Boolean);return{title1:i[0],title2:i[1],title3:i[2]}},Df=e=>{if(!e)return{title1:"",title2:"",title3:""};if(e.title1||e.title2||e.title3)return{title1:e.title1??"",title2:e.title2??"",title3:e.title3??""};const t=jf(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Wt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,zf=e=>[Wt(e,"fontFamily"),Wt(e,"fontSettings"),{type:"row",items:[Wt(e,"fontSize"),Wt(e,"lineHeight"),Wt(e,"letterSpacing"),Wt(e,"wordSpacing")]},Wt(e,"textAlign"),Wt(e,"textAppearance")],Bf=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Gi.map(e=>[Nf[e],zf(e)]))}),ol=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((l,s)=>l+s,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:l,widths:s},d)=>{if(l<=0||d<=0)return{overflow:l,widths:[d,...s]};const c=Math.min(l,d);return{overflow:l-c,widths:[d-c,...s]}},{overflow:i-1,widths:[]});return o},Ac=(e,t)=>ol(e,t),Ko=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ls=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:ol(e.length,n),effective:Ac(e.length,n)}},Vf=(e,t,n,i,o,l,s)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:l,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:s,text:i}),d},ea=(e,t)=>{const n=i=>{const o=Wt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[Hf[t]]}},Gf=(e,t,n,i)=>e.slice(0,i).reduce((o,l,s)=>o+(l!=null&&l.marginLeftKey?n[l.marginLeftKey]??0:0)+(t[s]??0),0),ta=(e,t,n)=>{var o,l;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((l=t.fontSettings)==null?void 0:l.fontStyle)??"normal"},fontSize:t.fontSize??Of[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Vt(i,n)},qf=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,onClose:s})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:b,closeIcon:S,closeIconMaxWidth:L,closeIconColor:f,closeIconHoverColor:h,thumbnailTrigger:y,thumbnailVisibility:E,thumbnailObjectFit:I,thumbnailActive:T,thumbnailActiveColor:X,title1Width:k,title2Width:B,title3Width:P,title1MarginLeft:C=0,title2MarginLeft:z=0,title3MarginLeft:v=0,titleRowMarginBottom:_=0,titleHeaderLayout:R="desktop",contentMarginTop:Z,iconMarginLeft:A}=n,U=m=>w.scalingValue(m,i??!1),V=c??n.thumnailSize??.03,G=U(V),ne=U(u),$=U(p??.02),M=U(b??0),N=U(Z??0),Q=Uo(N),ie=U(A??0),[F,pe]=a.useState(0),x=a.useRef(F);x.current=F;const se=t[F],{title1:J,title2:ye,title3:Me}=Df(se),de=ta("title1",ea(n,"title1"),i),ce=ta("title2",ea(n,"title2"),i),q=ta("title3",ea(n,"title3"),i),ee=R==="mobile",me=!o&&(!i||l),Fe=me,Ce=me,Ae=me,ue=Fn(I),fe=ue?{"--image-aspect-ratio":Pr(I)}:void 0,Se=!!(J||ye||Me),D=a.useMemo(()=>Vf(e,J,ye,Me,de,ce,q),[e,F,J,ye,Me,de,ce,q]),oe=a.useMemo(()=>({title1Width:k,title2Width:B,title3Width:P}),[k,B,P]),he=a.useMemo(()=>D.map(m=>oe[m.widthKey]),[D,oe]),be=a.useMemo(()=>ol(D.length,he),[D.length,he]),Ie=a.useMemo(()=>Ac(D.length,he),[D.length,he]),xe=a.useMemo(()=>D.filter(m=>m.prefix==="title1"),[D]),W=a.useMemo(()=>D.filter(m=>m.prefix==="title2"||m.prefix==="title3"),[D]),ae=a.useMemo(()=>ls(xe,oe),[xe,oe]),te=a.useMemo(()=>ls(W,oe),[W,oe]),j=a.useCallback((m,O)=>{const K=D.indexOf(m);if(!ee||O==="single-row")return{effectiveWidth:Ie[K]??0,resolvedWidth:be[K]??0,maxWidth:Ko(K,be)};if(O==="two-row-top"){const Pe=xe.indexOf(m);return{effectiveWidth:ae.effective[Pe]??0,resolvedWidth:ae.resolved[Pe]??0,maxWidth:Ko(Pe,ae.resolved)}}const we=W.indexOf(m);return{effectiveWidth:te.effective[we]??0,resolvedWidth:te.resolved[we]??0,maxWidth:Ko(we,te.resolved)}},[W,te,Ie,be,D,xe,ae,ee]),Y=a.useCallback(m=>w.scalingValue(m,i??!1),[i]),Re=Y(_??0),le=a.useMemo(()=>({title1MarginLeft:C,title2MarginLeft:z,title3MarginLeft:v}),[C,z,v]),H=a.useCallback(m=>D.slice(0,m+1).reduce((O,K,we)=>O+(K!=null&&K.marginLeftKey?le[K.marginLeftKey]??0:0)+(be[we]??0),0)+(ee?0:C??0),[D,le,be,ee,C]),De=a.useCallback(()=>ee?0:C??0,[ee,C]),_e=a.useCallback(m=>W.slice(0,m).reduce((O,K,we)=>O+(K.marginLeftKey?le[K.marginLeftKey]??0:0)+(te.resolved[we]??0),0),[W,te.resolved,le]),tt=a.useCallback(m=>{const O=W[m];return _e(m)+(O.marginLeftKey?le[O.marginLeftKey]??0:0)+(te.resolved[m]??0)},[W,te.resolved,_e,le]),Qe=(m,O)=>{const K=m.marginLeftKey?le[m.marginLeftKey]??0:0,{effectiveWidth:we,resolvedWidth:Pe,maxWidth:Ge}=j(m,O),yt=o&&O==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":m.prefix,style:{...O==="single-row"?{gridArea:m.prefix}:{},width:Y(we),...K>0?{marginLeft:Y(K)}:{}},children:[r.jsx("p",{className:m.className,style:m.style,children:m.text}),yt&&m.marginLeftKey&&r.jsx("div",{"data-controls":m.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Pe),style:{position:"absolute",top:0,left:Y(-K),width:`max(${Y(K)}, 10px)`,height:"100%",pointerEvents:"auto"}}),yt&&r.jsx("div",{"data-controls":m.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ge),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:Y(-Si/2),width:Y(Si),height:"100%",pointerEvents:"auto"}})]},m.className)},at=()=>{const m=ee?-1:D.findIndex(we=>we.prefix==="title1"),O=!ee&&(o||(C??0)>0)?(()=>{const we=C??0,Pe=m>=0?be[m]:k??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Pe),style:{position:"absolute",top:0,left:0,width:`max(${Y(we)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,K=D.flatMap((we,Pe)=>{if(!we.marginLeftKey)return[];const Ge=le[we.marginLeftKey]??0,yt=Gf(D,be,le,Pe)+De();return r.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(be[Pe]),style:{position:"absolute",top:0,left:Y(yt),width:`max(${Y(Ge)}, 10px)`,height:"100%",pointerEvents:"auto"}},we.marginLeftKey)});return O?[O,...K]:K},$e=()=>D.map((m,O)=>{const K=Ko(O,be),Pe=H(O)-Si/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":m.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(K),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:Y(Pe),width:Y(Si),height:"100%",pointerEvents:"auto"}})},`${m.widthKey}-junction`)}),ge=()=>W.flatMap((m,O)=>{if(!m.marginLeftKey)return[];const K=le[m.marginLeftKey]??0,we=_e(O),{resolvedWidth:Pe}=j(m,"two-row-bottom");return r.jsx("div",{"data-controls":m.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Pe),style:{position:"absolute",top:0,left:Y(we),width:`max(${Y(K)}, 10px)`,height:"100%",pointerEvents:"auto"}},m.marginLeftKey)}),je=()=>W.map((m,O)=>{const{maxWidth:K}=j(m,"two-row-bottom"),Pe=tt(O)-Si/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":m.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(K),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:Y(Pe),width:Y(Si),height:"100%",pointerEvents:"auto"}})},`${m.widthKey}-junction`)}),vt=a.useRef(null),Ye=a.useRef(null),Oe=a.useRef(null),Le=a.useRef(null),He=a.useRef([]),Xe=a.useRef([]),ut=a.useRef(0),xt=a.useRef(null),it=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),wt=a.useRef(null),lt=a.useRef(null),Ue=a.useRef(0),Ke=a.useRef("forward"),Ne=a.useRef(0),pt=a.useRef(null),mt=a.useRef(!1),gt=t.length>1&&(!o||!!l),Pt=gt?3:1,Zt=a.useMemo(()=>Array.from({length:Pt},()=>t).flat(),[t,Pt]),[tn,Tt]=a.useState(!1),[Ct,Ft]=a.useState(!1),[Ot,Te]=a.useState(!0),Be=a.useRef(null),qe=a.useRef(null),st=a.useRef(!1),kt=a.useRef(!1),dt=a.useRef(null),nt=a.useRef(null),qt=Fe&&!Ot,St=a.useCallback(()=>{Fe&&(Te(!0),nt.current&&clearTimeout(nt.current),nt.current=setTimeout(()=>{it.current.isActive||Te(!1)},Ef))},[Fe]),Ve=a.useCallback(()=>{o||kt.current||(kt.current=!0,Ft(!1),dt.current=setTimeout(()=>{s()},co))},[o,s]),et=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":qt?"true":"false",style:{width:w.scalingValue(L??0,i),height:w.scalingValue(L??0,i),marginRight:ie,"--close-icon-hover-color":h},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Ve,"aria-label":"Close",children:r.jsx(rn,{url:S,fill:f,hoverFill:i&&!l?f:h,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ie,height:"100%",pointerEvents:"auto"}})]}),It=(m="two-row")=>r.jsx("div",{...m==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:Y(C??0),flexShrink:0,...m==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...m==="two-row"&&o?{pointerEvents:"auto"}:{}}}),Lt=()=>{const m=D.find(we=>we.prefix==="title1"),O=D.filter(we=>we.prefix==="title2"||we.prefix==="title3"),K=O.length>0||o||(_??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(C??0)>0||o?It():null,m&&Qe(m,"two-row-top"),S&&et()]}),K?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[O.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[O.map(we=>Qe(we,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[ge(),je()]})]}):null,r.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:Re,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ht=()=>r.jsxs(r.Fragment,{children:[(C??0)>0||o?It("single-row"):null,D.map(m=>Qe(m,"single-row")),o?r.jsxs(r.Fragment,{children:[at(),$e()]}):null,S?et():null]}),Dt=a.useCallback(m=>!!(m.closest("[data-controls]")||m.closest(`.${e}-thumbnails`)||m.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:_t,backdropStyle:jt,mediaAreaStyle:Ut,overlayContentStyle:$t,swipeHandlers:en,dismissAreaStyle:Kt}=Pc({enabled:me??!1,onClose:Ve,animMs:co,isBlockedTarget:Dt}),Yt=()=>{if(!gt||t.length===0)return ut.current=0,0;const m=Xe.current[0],O=Xe.current[t.length];if(!m||!O)return ut.current;const K=O.offsetLeft-m.offsetLeft;return K>0&&(ut.current=K),ut.current},Xt=(m=!1)=>{if(!gt)return;const O=Ye.current,K=Yt();!O||K<=0||K<O.clientWidth*.25||(O.scrollLeft<=0?(O.scrollLeft+=K,m&&(it.current.scrollLeft+=K),mt.current&&(Ne.current+=K)):O.scrollLeft>=K*2&&(O.scrollLeft-=K,m&&(it.current.scrollLeft-=K),mt.current&&(Ne.current-=K)))},zt=(m,O=(K=>(K=Ye.current)==null?void 0:K.scrollLeft)()??0)=>{if(!gt)return m;let we=t.length+m,Pe=1/0;for(let Ge=0;Ge<Pt;Ge++){const yt=Ge*t.length+m,Rt=Xe.current[yt];if(!Rt)continue;const nn=Math.abs(Rt.offsetLeft-O);nn<Pe&&(Pe=nn,we=yt)}return we},Bt=m=>{const O=Ye.current;return!m||!O?!1:m.offsetWidth>O.clientWidth+1},g=m=>{const O=Ye.current;if(!m||!O||!Bt(m))return!1;const K=m.offsetLeft,we=K+m.offsetWidth;return O.scrollLeft>=K-1&&O.scrollLeft+O.clientWidth<=we+1},ve=(m=(O=>(O=Ye.current)==null?void 0:O.scrollLeft)()??0)=>{for(let we=0;we<Xe.current.length;we+=1){const Pe=Xe.current[we];if(Pe&&g(Pe))return we}let K={flatIndex:0,distance:1/0};return Xe.current.forEach((we,Pe)=>{if(!we)return;const Ge=Math.abs(we.offsetLeft-m);Ge<K.distance&&(K={flatIndex:Pe,distance:Ge})}),K.flatIndex},ke=m=>{Ye.current&&Xe.current.forEach(O=>{O&&(O.style.scrollSnapAlign=Bt(O)&&m==="backward"?"end":"start")})},Ee=(m,O,K)=>{const we=m-O,Pe=ve(O),Ge=Xe.current[Pe];if(g(Ge))return ve(m)%t.length;const yt=Xe.current[Pe+1],Rt=Ge?yt?yt.offsetLeft-Ge.offsetLeft:Ge.offsetWidth:0,nn=Rt>0?we>Rt*qo?1:we<-Rt*qo?-1:0:0;return nn===0?K:gt?(K+nn+t.length)%t.length:Math.max(0,Math.min(t.length-1,K+nn))},ot=a.useCallback((m=!1)=>{if(E!=="on"||o)return;const O=Le.current,K=x.current,we=He.current[K];if(!O||!we||O.scrollWidth<=O.clientWidth)return;const Pe=O.scrollLeft,Ge=Pe+O.clientWidth,yt=we.offsetLeft,Rt=yt+we.offsetWidth;if(yt>=Pe&&Rt<=Ge)return;const nn=O.scrollWidth-O.clientWidth;let Jt=Pe;if(!m&&Be.current===null){const bi=He.current[K-1],Qi=He.current[K+1],_o=bi?we.offsetLeft-bi.offsetLeft:Qi?Qi.offsetLeft-we.offsetLeft:we.offsetWidth;Rt>Ge?Jt+=_o:yt<Pe&&(Jt-=_o)}else Rt>Ge?Jt=Rt-O.clientWidth:Jt=yt;O.scrollLeft=Math.max(0,Math.min(nn,Jt))},[o,E]),At=a.useCallback((m=!1)=>{m&&(st.current=!0),qe.current===null&&(qe.current=requestAnimationFrame(()=>{qe.current=null;const O=st.current;st.current=!1,ot(O)}))},[ot]),Je=a.useCallback(m=>{if(m===x.current)return;const O=x.current;x.current=m;const K=Math.abs(m-O)>1,we=gt&&t.length>1&&(O===t.length-1&&m===0||O===0&&m===t.length-1);pe(m),At(K||we)},[t.length,gt,At]),ft=()=>{if(!Ye.current||t.length===0||Be.current!==null||it.current.isActive&&it.current.hasMoved)return;const m=Ye.current.scrollLeft,O=ve(m)%t.length;O!==x.current&&Je(O)},Nt=()=>{Be.current=null},Et=m=>{const O=Ye.current;O&&(O.style.scrollSnapType=m?"":"none")},cn=()=>{var m;(m=lt.current)==null||m.call(lt),lt.current=null},dn=()=>{pt.current!==null&&(cancelAnimationFrame(pt.current),pt.current=null),mt.current=!1},ei=()=>{const m=Ye.current;if(!m){pt.current=null,mt.current=!1;return}const O=Ne.current-m.scrollLeft;if(Math.abs(O)<.5){m.scrollLeft=Ne.current,Xt(),ft(),pt.current=null,mt.current=!1;return}m.scrollLeft+=O*Af,Xt(),ft(),St(),pt.current=requestAnimationFrame(ei)},ti=()=>{const m=Oe.current;m&&(m.style.transition="",m.style.transform="",m.style.willChange="")},ko=(m,O,K,we)=>{ti(),m.scrollLeft=O,Ue.current=m.scrollLeft,Xt(),K!==void 0?(x.current=K,pe(K)):ft(),Et(!0),we==null||we()},Ao=(m,{behavior:O="smooth",activeIndex:K,onComplete:we}={})=>{const Pe=Ye.current,Ge=Oe.current;if(!Pe||!Ge)return;if(dn(),cn(),Et(!1),O==="auto"){ko(Pe,m,K,we);return}const yt=Math.abs(m-Pe.scrollLeft),Rt=$f(yt,If,Rf,Pe.clientWidth*.55);lt.current=Lf(Pe,Ge,m,{duration:Rt,easing:Mf,onComplete:()=>{lt.current=null,ko(Pe,m,K,we)}})},Ar=(m="smooth")=>{const O=Ye.current;if(!O||t.length===0)return;const K=ve()%t.length,we=zt(K,O.scrollLeft),Pe=Xe.current[we];Pe&&Ao(Pe.offsetLeft,{behavior:m,activeIndex:K})},Fr=(m,O="smooth",K,we)=>{const Pe=Ye.current;if(!Pe||t.length===0)return;const Ge=(we??Pe.scrollLeft)-m,yt=ve(m),Rt=Xe.current[yt];if(g(Rt)){Et(!0),ft();return}const nn=Xe.current[yt+1],Jt=Rt?nn?nn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Jt>0?Ge>Jt*qo?1:Ge<-Jt*qo?-1:0:0)!==0){const jc=K??yt%t.length,Dc=Ee(we??Pe.scrollLeft,m,jc);Sn(Dc,O);return}const Qi=we??Pe.scrollLeft,_o=ve(Qi),rl=Xe.current[_o];if(rl&&Math.abs(rl.offsetLeft-Qi)<1){Et(!0),ft();return}Ar("auto")},Sn=(m,O="smooth")=>{const K=Ye.current;if(!K||t.length===0)return;const we=zt(m,K.scrollLeft),Pe=Xe.current[we];Pe&&(O==="smooth"?Be.current=m:Be.current=null,x.current=m,pe(m),At(!0),Ao(Pe.offsetLeft,{behavior:O,activeIndex:m,onComplete:O==="smooth"?Nt:void 0}))},xi=()=>{wt.current&&(window.removeEventListener("pointerup",wt.current),window.removeEventListener("pointercancel",wt.current),wt.current=null)},Fo=(m,O,K,we,Pe)=>{const Ge=K-m,yt=we-O,Rt=Math.abs(Ge),nn=Math.abs(yt);if(Rt<Wf||Rt<=nn)return!1;const Jt=Ge<0?1:-1,bi=gt?(Pe+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Pe+Jt));return bi===Pe?!1:(Sn(bi),!0)},ni=m=>{if(!it.current.isActive)return;xi();const O=Ye.current;if(!O)return;const{scrollLeft:K,startActiveIndex:we,hasMoved:Pe}=it.current,Ge=O.scrollLeft;Xt(!0),it.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},Tt(!1),m!==void 0&&O.hasPointerCapture(m)&&O.releasePointerCapture(m),Pe?Fr(K,"smooth",we,Ge):(Et(!0),ft()),St()},Wo=(m,O)=>{const K=xt.current;xt.current=null,K&&(Fo(K.startX,K.startY,m,O,K.startActiveIndex),St())},Wr=m=>{if(!Ce)return;if(m.pointerType==="touch"){if(dn(),Et(!0),Dt(m.target))return;xt.current={startX:m.clientX,startY:m.clientY,startActiveIndex:x.current};return}if(m.pointerType!=="mouse"||m.button!==0||Dt(m.target))return;const O=Ye.current;if(!O)return;dn(),cn(),ti(),Be.current=null,it.current={isActive:!0,startX:m.clientX,scrollLeft:O.scrollLeft,startActiveIndex:x.current,hasMoved:!1},Et(!1),St(),O.setPointerCapture(m.pointerId),xi();const K=we=>{we.pointerType==="mouse"&&ni(we.pointerId)};wt.current=K,window.addEventListener("pointerup",K),window.addEventListener("pointercancel",K)},_r=m=>{if(!Ce||m.pointerType!=="mouse")return;const O=Ye.current;if(!O||!it.current.isActive)return;if(m.buttons===0){ni(m.pointerId);return}const K=m.clientX-it.current.startX;Math.abs(K)>Ff&&(it.current.hasMoved=!0,Tt(!0)),it.current.hasMoved&&(m.preventDefault(),O.scrollLeft=it.current.scrollLeft-K,Xt(!0),ft(),St())},re=m=>{if(Ce){if(m.pointerType==="touch"){m.type==="pointerup"?Wo(m.clientX,m.clientY):xt.current=null;return}m.pointerType==="mouse"&&ni(m.pointerId)}},We=m=>{!Ce||m.pointerType!=="mouse"||ni(m.pointerId)};return kc(),a.useEffect(()=>{const m=requestAnimationFrame(()=>Ft(!0));return()=>{cancelAnimationFrame(m),cn(),xi(),qe.current!==null&&(cancelAnimationFrame(qe.current),qe.current=null),dt.current&&clearTimeout(dt.current),nt.current&&clearTimeout(nt.current)}},[]),a.useEffect(()=>{if(!Fe){Te(!0);return}St();const m=vt.current;if(!m)return;const O=()=>St();return m.addEventListener("pointermove",O),m.addEventListener("pointerdown",O),()=>{m.removeEventListener("pointermove",O),m.removeEventListener("pointerdown",O),nt.current&&clearTimeout(nt.current)}},[Fe,St]),a.useEffect(()=>{const m=O=>{O.key==="Escape"&&Ve()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[Ve]),a.useLayoutEffect(()=>{Yt()},[M,t.length,gt]),a.useLayoutEffect(()=>{o||Sn(x.current,"auto")},[M,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,gt]),a.useEffect(()=>{const m=Ye.current;if(!m||o||!me)return;const O=K=>{if(K.preventDefault(),Math.abs(K.deltaY)<=Math.abs(K.deltaX))return;const we=K.deltaMode===1?kf:K.deltaMode===2?m.clientHeight:1,Pe=K.deltaY*we*Pf;if(Pe!==0){if(cn(),mt.current||(mt.current=!0,Ne.current=m.scrollLeft,Be.current=null,Et(!1)),Ne.current+=Pe,!gt){const Ge=m.scrollWidth-m.clientWidth;Ne.current=Math.max(0,Math.min(Ge,Ne.current))}St(),pt.current===null&&(pt.current=requestAnimationFrame(ei))}};return m.addEventListener("wheel",O,{passive:!1}),()=>{m.removeEventListener("wheel",O),dn()}},[o,me,gt]),a.useEffect(()=>{const m=Ye.current;if(!m)return;const O=()=>{Xt(it.current.isActive);const we=m.scrollLeft,Pe=we-Ue.current;Ue.current=we;const Ge=ut.current>0?ut.current*.5:1/0;if(Pe!==0&&Math.abs(Pe)<Ge){const yt=Pe>0?"forward":"backward";yt!==Ke.current&&(Ke.current=yt,ke(yt))}it.current.isActive&&it.current.hasMoved||ft()};m.addEventListener("scroll",O,{passive:!0});const K=new ResizeObserver(()=>{Yt(),Xt(it.current.isActive),ke(Ke.current),ft()});return K.observe(m),()=>{cn(),m.removeEventListener("scroll",O),K.disconnect()}},[t.length,gt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{_t||Ve()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:Ct?1:0,transition:`opacity ${co}ms ease`,pointerEvents:Ct?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...jt}}),r.jsxs("div",{ref:vt,className:`${e}-lightbox-dismiss-area`,style:Kt,...en,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:Ut,onClick:m=>m.stopPropagation(),children:r.jsx("div",{ref:Ye,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Ce&&t.length>0?"true":"false","data-mouse-dragging":tn?"true":"false",onPointerDown:Wr,onPointerMove:_r,onPointerUp:re,onPointerCancel:re,onLostPointerCapture:We,children:r.jsx("div",{ref:Oe,className:`${e}-lightbox-strip-track`,style:{gap:M},children:Zt.map((m,O)=>{const K=m.image.objectFit??"contain",we=O%t.length,Pe=Math.floor(O/t.length),Ge=Uo(M),yt=`calc(-0.5 * (${Ge} + ${M}))`;return r.jsxs("div",{ref:Rt=>Xe.current[O]=Rt,className:`${e}-strip-item`,style:{height:R==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:m.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:K}}),o&&we<t.length-1&&Pe===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:yt,width:Ge,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Pe}-${m.image.url}-${we}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":qt?"true":"false",style:$t,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:N,flexShrink:0,pointerEvents:"none"},children:o&&r.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:Q,pointerEvents:"auto",zIndex:3}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:r.jsx("div",{className:`${e}-lightbox-content-area${ee?` ${e}-lightbox-content-area-stacked`:""}`,children:(Se||S)&&r.jsx("div",{className:`${e}-header ${ee?`${e}-header-two-row`:`${e}-header-single-row`}`,children:ee?Lt():Se||S?ht():null})})})]}),t.length>1&&E==="on"&&(()=>{const m=Uo($),O=`calc(-0.5 * (${$} + ${m}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:$},children:r.jsx("div",{ref:Le,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:K=>K.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":T,style:{gap:ne,"--thumbnail-active-color":X},children:[t.map((K,we)=>{const Pe=Uo(ne),Ge=`calc(-0.5 * (${Pe} + ${ne}))`;return r.jsxs("div",{ref:yt=>{He.current[we]=yt},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":F===we?"true":"false",onClick:()=>me&&y==="click"&&Sn(we),onMouseEnter:()=>Ae&&y==="hover"&&Sn(we),"aria-label":K.image.name?`View ${K.image.name}`:`View image ${we+1}`,"aria-current":F===we?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${ue?` ${e}-thumb-image-cover`:""}`,src:K.image.url,alt:"",draggable:!1,style:{...fe,maxWidth:G,maxHeight:G,width:I.display==="cover"?"auto":"100%",height:"auto",objectFit:I.display==="cover"?"cover":"contain"}})}),o&&we<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ge,width:Pe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${K.image.url}-${we}`)}),o&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:O,height:m,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function Uf(e){return`
|
|
12866
12998
|
.${e}-wrapper {
|
|
12867
12999
|
position: relative;
|
|
12868
13000
|
width: 100%;
|
|
@@ -13093,7 +13225,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
13093
13225
|
background-color: transparent;
|
|
13094
13226
|
padding: 0;
|
|
13095
13227
|
opacity: 1;
|
|
13096
|
-
transition: opacity ${
|
|
13228
|
+
transition: opacity ${co}ms ease;
|
|
13097
13229
|
}
|
|
13098
13230
|
|
|
13099
13231
|
.${e}-close-icon[data-overlay-content-hidden="true"] {
|
|
@@ -13206,7 +13338,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
13206
13338
|
display: flex;
|
|
13207
13339
|
flex-direction: column;
|
|
13208
13340
|
opacity: 1;
|
|
13209
|
-
transition: opacity ${
|
|
13341
|
+
transition: opacity ${co}ms ease;
|
|
13210
13342
|
}
|
|
13211
13343
|
|
|
13212
13344
|
.${e}-lightbox-content-inner[data-overlay-content-hidden="true"] {
|
|
@@ -13247,7 +13379,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
13247
13379
|
pointer-events: auto;
|
|
13248
13380
|
z-index: 10;
|
|
13249
13381
|
}
|
|
13250
|
-
`}const
|
|
13382
|
+
`}const Kf=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l})=>{const{prefix:s}=w.useScopedStyles(),{cover:d,coverFit:c}=e,u=a.useRef(null),[p,b]=a.useState(!1),S=t??[],L=p&&S.length>0,f=()=>{S.length!==0&&b(!0)};return a.useEffect(()=>{!n||i||o||b(!1)},[n,i,o]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:u,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Uf(s)}}),d&&r.jsx("div",{className:`${s}-cover ${Fn(c)?`${s}-ratio-wrapper-cover`:`${s}-ratio-wrapper-fit`}`,onClick:()=>f(),style:{...Fn(c)?{"--image-aspect-ratio":Pr(c)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${s}-cover-image ${Fn(c)?`${s}-cover-image-cover`:`${s}-cover-image-fit`}`,src:d,alt:"cover"})})]}),L&&typeof document<"u"&&(()=>{const h=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx(qf,{prefix:s,images:S,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>b(!1)}),h)})()]})},Xf=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
13251
13383
|
import { createPortal } from 'react-dom';
|
|
13252
13384
|
import { CommonComponentProps } from '../props';
|
|
13253
13385
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -13793,7 +13925,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
13793
13925
|
</>
|
|
13794
13926
|
);
|
|
13795
13927
|
};
|
|
13796
|
-
`,Gf="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),si={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 qf(e){const t={};return t[Wt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Wt(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Wt(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Wt(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Wt(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Wt(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Wt(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Wt(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Uf=zi.reduce((e,t)=>({...e,...qf(t)}),{}),Kf=zi.reduce((e,t)=>({...e,[Wt(t,"fontFamily")]:"Goudy Bookletter 1911",[Wt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Wt(t,"letterSpacing")]:0,[Wt(t,"wordSpacing")]:0,[Wt(t,"textAlign")]:"left",[Wt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ta(e){return zi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Wt(n,"fontSize")]=i),o!==void 0&&(t[Wt(n,"lineHeight")]=o),t},{})}const Xf=Hf(),Yf={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailSize:{type:"number",scope:"layout",title:"Thumbnail Size",min:0,display:{type:"range-control"}},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"layout",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"layout",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up","none"]}},thumbnailActiveColor:{type:"string",scope:"layout",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"layout",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"layout",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"layout",title:"Caption Default",display:{type:"palette-color-picker"}},...Uf,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:Gf,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Kf},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...ta({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...ta({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...ta({title1FontSize:.011,title1LineHeight:.02,title2FontSize:.011,title2LineHeight:.02,title3FontSize:.011,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Xf]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},Zf={element:Bf,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:Yf,sourceCode:Vf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...zi.map(e=>({path:`${Wt(e,"fontFamily")}`}))]},fontRelations:{...zi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Wt(t,"fontFamily")}`}),{})}},Jf=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:w,coverFit:v,backgroundColor:T,imageGap:g,maxWidth:$,maxHeight:f,textTransition:R,title1Width:L,title2Width:I,title3Width:Y,title1MarginLeft:P=0,title2MarginLeft:V=0,title3MarginLeft:M=0,titleRowMarginBottom:C=0,titleHeaderLayout:A="single-row",countCloseGap:y=0,closeIcon:S,closeIconMaxWidth:F,closeIconColor:W,closeIconHoverColor:U,contentMarginTop:G=0,iconMarginRight:J=0}=n,D=a.useCallback(ie=>x.scalingValue(ie,i??!1),[i]),j=D(g??0),O=`${$}%`,E=`${f}%`,K=D(y),Z=D(G),ce=D(J),N=ui("title1",di(n,"title1"),i),pe=ui("title2",di(n,"title2"),i),b=ui("title3",di(n,"title3"),i),he=ui("count",di(n,"count"),i),Q=A==="mobile",we=!i||!!s,Te=!o&&(!i||!!s),se=a.useMemo(()=>nr(t,w),[t,w]),[oe,q]=a.useState(l),de=se[oe],ge=de==null?void 0:de.entry,[_e,Ce]=a.useState(!1),[Me,fe]=a.useState(null),[ye,Se]=a.useState(!1),[B,ue]=a.useState(null),[ve,me]=a.useState(!1),[Ee,be]=a.useState(0),[k,re]=a.useState(),[te,z]=a.useState(),[le,Re]=a.useState(null),ae=a.useRef(null),_=a.useRef(0),Ne=a.useRef(0),Fe=a.useRef(0),et=a.useRef(!1),Ke=a.useRef(null),Ie=a.useRef(null),ee=a.useRef(null),ne=a.useRef(null),He=a.useRef(null),st=a.useRef(null),Be=a.useRef(null),Oe=a.useCallback(()=>{const ie=Ie.current;if(!ie)return;const We=ie.closest(`.${e}-lightbox-content-area`);if(!We)return ie.getBoundingClientRect().width;const m=Array.from(We.children).reduce((H,X)=>!(X instanceof HTMLElement)||X.contains(ie)?H:H+X.getBoundingClientRect().width,0);return We.getBoundingClientRect().width-m},[e]),je=a.useCallback(()=>{ae.current&&(clearTimeout(ae.current),ae.current=null)},[]),qe=a.useCallback(ie=>{ie===_.current&&(ue(null),me(!1))},[]),tt=a.useCallback(()=>{o||et.current||(et.current=!0,u==null||u(),Ce(!1),Ke.current=setTimeout(()=>{p()},300))},[o,u,p]),mt=a.useCallback(ie=>!!(ie.closest("[data-controls]")||ie.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:St,backdropStyle:lt,mediaAreaStyle:pt,overlayContentStyle:Mt,swipeHandlers:nt,dismissAreaStyle:Ve}=Ic({enabled:Te,onClose:tt,animMs:300,isBlockedTarget:mt}),De=a.useCallback(ie=>{d&&cc(ie+1,c,!0)},[d,c]),vt=a.useCallback(ie=>{if(ie)return ie.getBoundingClientRect().height},[]),bt=a.useCallback(ie=>{if(se.length===0)return;const We=(ie%se.length+se.length)%se.length;if(We===oe)return;const m=se[oe],H=se[We];_.current+=1;const X=_.current,$e=R==="fade"&&Ns(m==null?void 0:m.entry)!==Ns(H==null?void 0:H.entry),ke=vt(ee.current),Ge=$e?(()=>{const $t=Oe();Yn.flushSync(()=>{Re(H.entry)}),ee.current&&$t&&(ee.current.style.width=`${$t}px`);const en=vt(ee.current);return ee.current&&(ee.current.style.width=""),{measuredIncomingTitlesHeight:en,incomingTitlesMeasureWidth:$t}})():void 0,ht=Math.max(ke??0,(Ge==null?void 0:Ge.measuredIncomingTitlesHeight)??0)||void 0;be(X),ue(oe),me(!0),q(We),De(We),Fe.current=We,$e?(je(),ht&&re(ht),Ge!=null&&Ge.incomingTitlesMeasureWidth&&z(Ge.incomingTitlesMeasureWidth),fe((m==null?void 0:m.entryIndex)??null),Se(!0),Ne.current=H.entryIndex,ae.current=setTimeout(()=>{fe(null),Se(!1),re(void 0),z(void 0),Re(null),ae.current=null},400)):(je(),fe(null),Se(!1),re(void 0),z(void 0),Re(null),Ne.current=H.entryIndex)},[oe,je,Oe,vt,se,De,R]),Pt=a.useCallback(()=>{Be.current=null},[]),Dt=a.useCallback(ie=>{!we||se.length<=1||ie.pointerType==="mouse"&&ie.button!==0||ie.target.closest("[data-controls]")||(Be.current={startX:ie.clientX,startY:ie.clientY,pointerId:ie.pointerId})},[we,se.length]),tn=a.useCallback(ie=>{var $t;if(!we||se.length<=1||ie.pointerType==="mouse"&&ie.button!==0)return;if(St){Pt();return}const We=Be.current;if(!We||We.pointerId!==ie.pointerId||(Pt(),ie.target.closest("[data-controls]")))return;const H=ie.clientX-We.startX,X=ie.clientY-We.startY,$e=Math.abs(H),ke=Math.abs(X);if($e>=pg&&$e>ke){bt(H>0?oe-1:oe+1);return}if($e>As||ke>As)return;const Ge=($t=ne.current)==null?void 0:$t.getBoundingClientRect(),ht=Ge?Ge.left+Ge.width/2:window.innerWidth/2;bt(ie.clientX<ht?oe-1:oe+1)},[oe,we,bt,St,Pt,se.length]),ln=a.useCallback(ie=>{const We=Be.current;(We==null?void 0:We.pointerId)===ie.pointerId&&Pt()},[Pt]);Rc(),a.useEffect(()=>{st.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const ie=requestAnimationFrame(()=>{Ce(!0),requestAnimationFrame(()=>{He.current?He.current.focus():ne.current&&ne.current.focus()})});return()=>{cancelAnimationFrame(ie),Ke.current&&clearTimeout(Ke.current),ae.current&&clearTimeout(ae.current);const We=st.current;We&&document.contains(We)&&We.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var ie;R!=="fade"&&(Ne.current=((ie=se[oe])==null?void 0:ie.entryIndex)??0,je(),fe(null),Se(!1),re(void 0),z(void 0))},[oe,je,se,R]),a.useEffect(()=>{const ie=We=>{if(We.key==="Escape"){tt();return}if(We.key==="ArrowLeft"&&se.length>1){bt(oe-1);return}if(We.key==="ArrowRight"&&se.length>1){bt(oe+1);return}if(We.key==="Tab"&&ne.current){const m=ne.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),H=Array.from(m).filter(Ge=>!Ge.closest('[aria-hidden="true"]'));if(H.length===0)return;const X=H[0],$e=H[H.length-1],ke=document.activeElement;We.shiftKey?(ke===X||!ne.current.contains(ke))&&(We.preventDefault(),$e.focus()):(ke===$e||!ne.current.contains(ke))&&(We.preventDefault(),X.focus())}};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[bt,tt,oe,se.length]),a.useLayoutEffect(()=>{je(),_.current=0,be(0),ue(null),me(!1),fe(null),Se(!1),re(void 0),z(void 0),Re(null),q(ie=>{const We=Math.max(0,se.length-1);return Math.min(ie,We)})},[je,t.length,w,se.length]),a.useLayoutEffect(()=>{var m;const ie=Math.max(0,se.length-1),We=Math.min(Math.max(0,l),ie);Fe.current=We,Ne.current=((m=se[We])==null?void 0:m.entryIndex)??0,q(We)},[l]);const Tt=Me!==null?t[Me]:null,kt=B!==null?se[B]:null,Yt=(ge==null?void 0:ge.title1)||(ge==null?void 0:ge.title2)||(ge==null?void 0:ge.title3)||(Tt==null?void 0:Tt.title1)||(Tt==null?void 0:Tt.title2)||(Tt==null?void 0:Tt.title3),qt=bg(w,se,t),Le=S!==null,Ue=Yt||qt||Le,Xe=qt&&Le?{gap:K}:void 0,ct=`${e}-titles-stack${Q?` ${e}-titles-stack-stacked`:""}`,Rt=`${e}-titles-layer-out${Q?` ${e}-titles-layer-out-stacked`:""}`,ut=`${e}-titles-layer-out`,it=(P??0)>0||o,Ut=D(C),Ze=a.useMemo(()=>({title1Width:L??Mi.title1Width,title2Width:I??Mi.title2Width,title3Width:Y??Mi.title3Width}),[L,I,Y]),Je=a.useMemo(()=>({title2MarginLeft:V,title3MarginLeft:M}),[V,M]),rt=a.useMemo(()=>ge?Vn(e,ge,N,pe,b):[],[e,ge,N,pe,b]),Lt=a.useMemo(()=>rt.map(ie=>Ze[ie.widthKey]),[rt,Ze]),It=a.useMemo(()=>_i(rt.length,Lt),[rt.length,Lt]),ft=a.useMemo(()=>yo(rt.length,Lt),[rt.length,Lt]),Ft=a.useMemo(()=>rt.filter(ie=>ie.prefix==="title1"),[rt]),Ot=a.useMemo(()=>rt.filter(ie=>ie.prefix==="title2"||ie.prefix==="title3"),[rt]),Ht=a.useMemo(()=>Gn(Ft,Ze),[Ft,Ze]),Vt=a.useMemo(()=>Gn(Ot,Ze),[Ot,Ze]),xt=a.useCallback((ie,We)=>{const m=rt.findIndex(X=>X.prefix===ie.prefix);if(!Q||We==="single-row")return{effectiveWidth:ft[m]??0,resolvedWidth:It[m]??0,maxWidth:an(m,It)};if(We==="two-row-top"){const X=Ft.findIndex($e=>$e.prefix===ie.prefix);return{effectiveWidth:Ht.effective[X]??0,resolvedWidth:Ht.resolved[X]??0,maxWidth:an(X,Ht.resolved)}}const H=Ot.findIndex(X=>X.prefix===ie.prefix);return{effectiveWidth:Vt.effective[H]??0,resolvedWidth:Vt.resolved[H]??0,maxWidth:an(H,Vt.resolved)}},[rt,Ot,Vt,ft,It,Ft,Ht,Q]),Gt=a.useCallback(ie=>mc(rt,It,Je,ie)+(Q?0:P??0),[rt,It,Je,Q,P]),Kt=a.useCallback(()=>Q?0:P??0,[Q,P]),Xt=a.useCallback(ie=>Ot.slice(0,ie).reduce((We,m,H)=>We+(m.marginLeftKey?Je[m.marginLeftKey]??0:0)+(Vt.resolved[H]??0),0),[Ot,Vt.resolved,Je]),Zt=a.useCallback(ie=>{const We=Ot[ie];return Xt(ie)+(We.marginLeftKey?Je[We.marginLeftKey]??0:0)+(Vt.resolved[ie]??0)},[Ot,Vt.resolved,Xt,Je]),jt=a.useCallback((ie,We,m)=>{if(!Q||m==="single-row"){const Ge=ie.findIndex(Jt=>Jt.prefix===We.prefix),ht=ie.map(Jt=>Ze[Jt.widthKey]),$t=_i(ie.length,ht);return{effectiveWidth:yo(ie.length,ht)[Ge]??0,resolvedWidth:$t[Ge]??0,maxWidth:an(Ge,$t)}}if(m==="two-row-top"){const Ge=ie.filter(Jt=>Jt.prefix==="title1"),ht=Ge.findIndex(Jt=>Jt.prefix===We.prefix),{resolved:$t,effective:en}=Gn(Ge,Ze);return{effectiveWidth:en[ht]??0,resolvedWidth:$t[ht]??0,maxWidth:an(ht,$t)}}const H=ie.filter(Ge=>Ge.prefix==="title2"||Ge.prefix==="title3"),X=H.findIndex(Ge=>Ge.prefix===We.prefix),{resolved:$e,effective:ke}=Gn(H,Ze);return{effectiveWidth:ke[X]??0,resolvedWidth:$e[X]??0,maxWidth:an(X,$e)}},[Ze,Q]),wt=(ie,We,m)=>{const H=ie.marginLeftKey?Je[ie.marginLeftKey]??0:0,{effectiveWidth:X,resolvedWidth:$e,maxWidth:ke}=m??xt(ie,We),Ge=Math.max(H,Bn),ht=o&&We==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":ie.prefix,style:{width:D(X),...H>0?{marginLeft:D(H)}:{}},children:[r.jsx("p",{className:ie.className,style:ie.style,children:ie.text}),ht&&ie.marginLeftKey?r.jsx("div",{"data-controls":ie.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String($e),style:{position:"absolute",top:0,left:D(-H),width:D(Ge),height:"100%",pointerEvents:"auto"}}):null,ht?r.jsx("div",{"data-controls":ie.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D(-gn/2),width:D(gn),height:"100%",pointerEvents:"auto"}}):null]},ie.className)},h=(ie="two-row")=>{const We=rt.findIndex(X=>X.prefix==="title1"),m=We>=0?It[We]:Ze.title1Width,H=ie==="two-row"&&o;return r.jsx("div",{...H?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(m)}:{},style:{width:D(P??0),flexShrink:0,alignSelf:"stretch",...H?{pointerEvents:"auto"}:{}}})},xe=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:N,"aria-hidden":"true",children:" "}),Pe=()=>r.jsx("span",{className:`${e}-entry-counter`,style:he,"aria-live":"polite","aria-atomic":"true",children:xg(se,oe,w,t)}),Ae=()=>qt?o&&Le?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Pe(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${qr(K)} + ${K}))`,width:qr(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Pe():null,at=()=>!qt&&!Le?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Xe,children:[Ae(),Le?gt():null]}),At=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[qt||Yt?xe():null,it?h("single-row"):null,Et(ge),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),at(),wn()]}),Qe=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[qt||Yt?xe():null,it?h("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:ye&&k?{minHeight:k}:void 0,children:[r.jsx("div",{ref:ee,className:ct,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ti(le||ge)}),r.jsxs("div",{ref:Ie,className:ct,style:{position:ye?"absolute":"relative",inset:ye?0:void 0,width:"100%",...ye&&te?{width:te,maxWidth:"100%"}:void 0},children:[Tt&&ye?r.jsx("div",{className:`${Rt} ${e}-titles-fade-out`,children:ti(Tt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ye?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ti(ge)})]})]}),at(),wn()]}),gt=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:x.scalingValue(F??0,i),height:x.scalingValue(F??0,i),marginRight:ce,"--close-icon-hover-color":U},children:[r.jsx("button",{ref:He,type:"button",className:`${e}-close-icon-inner`,onClick:tt,"aria-label":"Close",children:r.jsx(on,{url:S??"",fill:W,hoverFill:i&&!s?W:U,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ce,height:"100%",pointerEvents:"auto"}})]}),_t=(ie,We)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[qt||Yt?xe():null,it?h("two-row"):null,We!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:We},children:ie}):r.jsxs(r.Fragment,{children:[ie,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),at()]}),Et=ie=>{if(!ie)return null;const We=Vn(e,ie,N,pe,b);return r.jsx(r.Fragment,{children:We.map(m=>wt(m,"single-row",jt(We,m,"single-row")))})},cn=ie=>{if(!ie)return null;const We=Vn(e,ie,N,pe,b),m=We.find(H=>H.prefix==="title1");return m?wt(m,"two-row-top",jt(We,m,"two-row-top")):null},dn=(ie,We=!1)=>{const m=ie?Vn(e,ie,N,pe,b):[],H=m.filter(ke=>ke.prefix==="title2"||ke.prefix==="title3"),X=o&&We;return H.length>0||X||(C??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[H.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[H.map(ke=>wt(ke,"two-row-bottom",jt(m,ke,"two-row-bottom"))),We&&o?r.jsxs(r.Fragment,{children:[Pr(),Ar()]}):null]}):null,(C??0)>0||X?r.jsx("div",{"data-controls":X?"titleRowMarginBottom":void 0,"data-controls-axis":X?"y":void 0,"data-controls-reverse":X?"":void 0,className:X?`${e}-control`:void 0,style:{height:Ut,width:"100%",flexShrink:0,pointerEvents:X?"auto":"none"}}):null]}):null},ei=(ie,We=!1)=>r.jsxs(r.Fragment,{children:[_t(cn(ie)),dn(ie,We)]}),ti=ie=>Q?r.jsx("div",{className:`${e}-titles-row-two-row`,children:ei(ie)}):ie?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Et(ie)}):null,Mo=()=>{const ie=Q?-1:rt.findIndex(H=>H.prefix==="title1"),We=!Q&&(o||(P??0)>0)?(()=>{const H=P??0,X=ie>=0?It[ie]:Ze.title1Width,$e=Math.max(H,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(X),style:{position:"absolute",top:0,left:0,width:D($e),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,m=rt.flatMap((H,X)=>{if(!H.marginLeftKey)return[];const $e=Je[H.marginLeftKey]??0,ke=pc(rt,It,Je,X)+Kt(),Ge=Math.max($e,Bn);return r.jsx("div",{"data-controls":H.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(It[X]),style:{position:"absolute",top:0,left:D(ke),width:D(Ge),height:"100%",pointerEvents:"auto"}},H.marginLeftKey)});return We?[We,...m]:m},ko=()=>rt.map((ie,We)=>{const m=an(We,It),X=Gt(We)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ie.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(m),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(X),width:D(gn),height:"100%",pointerEvents:"auto"}})},`${ie.widthKey}-junction`)}),Pr=()=>Ot.flatMap((ie,We)=>{if(!ie.marginLeftKey)return[];const m=Je[ie.marginLeftKey]??0,H=Xt(We),X=Math.max(m,Bn),{resolvedWidth:$e}=xt(ie,"two-row-bottom");return r.jsx("div",{"data-controls":ie.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String($e),style:{position:"absolute",top:0,left:D(H),width:D(X),height:"100%",pointerEvents:"auto"}},ie.marginLeftKey)}),Ar=()=>Ot.map((ie,We)=>{const{maxWidth:m}=xt(ie,"two-row-bottom"),X=Zt(We)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ie.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(m),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D(X),width:D(gn),height:"100%",pointerEvents:"auto"}})},`${ie.widthKey}-junction`)}),wn=()=>!o||Q?null:r.jsxs(r.Fragment,{children:[Mo(),ko()]}),yi=ie=>{const We=!ie.objectFit&&Fn(v);return{className:`${e}-slide-image-cell${We?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:O,maxHeight:E,...We?{"--image-aspect-ratio":Mr(v)}:{}}}},Po=ie=>ie.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":ie.objectFit}}:Fn(v)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ni=ie=>{if(ie.length===0)return null;const We=ie.length>1,m=qr(j),H=`calc(-0.5 * (${m} + ${j}))`;if(ie.length===1){const X=ie[0];return r.jsx("div",{...yi(X),children:r.jsx("img",{...Po(X),src:X.url,alt:X.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:We?{gap:j}:void 0,children:ie.map((X,$e)=>r.jsxs("div",{...yi(X),children:[r.jsx("img",{...Po(X),src:X.url,alt:X.name??"",draggable:!1}),o&&We&&$e<ie.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:H,width:m,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${X.url}-${$e}`))})},Ao=!!(ge!=null&&ge.title2||ge!=null&&ge.title3||Tt!=null&&Tt.title2||Tt!=null&&Tt.title3||(C??0)>0||o),Fr=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:ee,className:ct,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ei(le||ge)}),r.jsxs("div",{ref:Ie,className:`${e}-titles-row-two-row`,style:{...ye&&k?{minHeight:k}:void 0,...ye&&te?{width:te,maxWidth:"100%"}:void 0},children:[_t(r.jsxs("div",{className:ct,style:{position:ye?"absolute":"relative",inset:ye?0:void 0,width:"100%"},children:[Tt&&ye?r.jsx("div",{className:`${ut} ${e}-titles-fade-out`,children:cn(Tt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ye?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:cn(ge)})]}),ye&&k?k:void 0),Ao?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Tt&&ye?r.jsx("div",{className:`${Rt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:dn(Tt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ye?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${Q?` ${e}-titles-layer-in-stacked`:""}`,children:dn(ge,!0)})]}):null]})]}),Wr=()=>{const ie=Ao;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ie?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:ie?void 0:{flex:"0 0 auto",height:"auto"},children:ei(ge,!0)}),wn()]})};return r.jsxs("div",{ref:ne,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{St||tt()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:Le?void 0:-1,style:{opacity:_e?1:0,transition:"opacity 300ms ease",pointerEvents:_e?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:T,...lt}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ve,...nt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:pt,onClick:ie=>ie.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":we&&se.length>1?"true":"false",onPointerDown:we?Dt:void 0,onPointerUp:we?tn:void 0,onPointerCancel:we?ln:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[kt&&ve?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:ie=>{ie.target===ie.currentTarget&&qe(Ee)},children:r.jsx("div",{className:`${e}-slide-area`,children:ni(kt.images)})},`slide-out-${Ee}`):null,r.jsx("div",{className:`${e}-slide-layer-in${ve?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:de?ni(de.images):null})},`slide-in-${Ee}-${oe}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Mt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:Z,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...Q?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:Ue&&r.jsx("div",{className:`${e}-text-bar-cell${Q?` ${e}-text-bar-cell-stacked`:""}`,style:Q?void 0:{flex:1,minWidth:0,width:"100%"},children:Q?R==="fade"?Fr():Wr():R==="fade"?Qe():At()})})})]})]})]})};function Qf(e){return`
|
|
13928
|
+
`,Yf="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),li={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 Zf(e){const t={};return t[Wt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Wt(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Wt(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Wt(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Wt(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Wt(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Wt(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Wt(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Jf=Gi.reduce((e,t)=>({...e,...Zf(t)}),{}),Qf=Gi.reduce((e,t)=>({...e,[Wt(t,"fontFamily")]:"Goudy Bookletter 1911",[Wt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Wt(t,"letterSpacing")]:0,[Wt(t,"wordSpacing")]:0,[Wt(t,"textAlign")]:"left",[Wt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function na(e){return Gi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Wt(n,"fontSize")]=i),o!==void 0&&(t[Wt(n,"lineHeight")]=o),t},{})}const ey=Bf(),ty={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailSize:{type:"number",scope:"layout",title:"Thumbnail Size",min:0,display:{type:"range-control"}},thumbnailGap:{type:"number",scope:"layout",title:"Thumbnail Gap",min:0,display:{type:"range-control"}},thumbnailMarginBottom:{type:"number",scope:"layout",title:"Thumbnail Margin Bottom",min:0,display:{type:"range-control"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"layout",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"layout",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"layout",title:"Icon Hover",display:{type:"settings-color-picker"}},thumbnailVisibility:{type:"boolean",scope:"layout",title:"Visibility",display:{type:"toggle-cycle",enum:["on","off"]}},thumbnailObjectFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},thumbnailTrigger:{type:"string",scope:"common",title:"Trigger",display:{type:"toggle-cycle",enum:["click","hover"]}},thumbnailActive:{type:"boolean",scope:"common",title:"Active",display:{type:"toggle-cycle",enum:["outline","color","scale-up","none"]}},thumbnailActiveColor:{type:"string",scope:"layout",title:"Outline Active",display:{type:"palette-color-picker",visible:!1}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1Color:{type:"string",scope:"layout",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"layout",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"layout",title:"Caption Default",display:{type:"palette-color-picker"}},...Jf,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},iconMarginLeft:{type:"number",scope:"layout",title:"Icon margin left",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:Yf,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Qf},layoutDefaults:{m:{thumbnailSize:.1,thumbnailVisibility:"off",titleHeaderLayout:"mobile",thumbnailGap:.04,thumbnailMarginBottom:.04,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",title1Width:.25,title2Width:.6,title3Width:.25,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.04,titleRowMarginBottom:.08,closeIconMaxWidth:.04,contentMarginTop:.08,iconMarginLeft:.02,...na({title1FontSize:.042,title1LineHeight:.042,title2FontSize:.042,title2LineHeight:.042,title3FontSize:.042,title3LineHeight:.042})},t:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.039,contentMarginTop:.015,iconMarginLeft:.02,...na({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208})},d:{thumbnailSize:.03,thumbnailVisibility:"on",titleHeaderLayout:"desktop",thumbnailGap:.02,thumbnailMarginBottom:.007,imageGap:.005,backgroundColor:"#FFFFFF",closeIconColor:"#FFFFFF",closeIconHoverColor:"#cccccc",thumbnailActiveColor:"#ffffff",title1Color:"#FFFFFF",title2Color:"#FFFFFF",title3Color:"#FFFFFF",title1Width:.29,title2Width:.13,title3Width:.14,title1MarginLeft:.015,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,closeIconMaxWidth:.02,contentMarginTop:.015,iconMarginLeft:.02,...na({title1FontSize:.011,title1LineHeight:.02,title2FontSize:.011,title2LineHeight:.02,title3FontSize:.011,title3LineHeight:.02})}},displayRules:[{if:{name:"thumbnailActive",value:"outline"},then:{name:"properties.thumbnailActiveColor.display.visible",value:!0}}],layout:["__componentName__","thumbnailGap","thumbnailMarginBottom","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","contentMarginTop","title1MarginLeft","iconMarginLeft"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",title:"Thumbnails",items:["thumbnailVisibility","thumbnailObjectFit"]},{type:"row",items:["thumbnailTrigger","thumbnailActive"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[ey]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor","thumbnailActiveColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"contain",type:"media-input"}},title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"},title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage"}]}},ny={element:Kf,id:"lightbox-strip",name:"Strip",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Strip.mp4"},schema:ty,sourceCode:Xf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Gi.map(e=>({path:`${Wt(e,"fontFamily")}`}))]},fontRelations:{...Gi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Wt(t,"fontFamily")}`}),{})}},iy=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:l,initialSlideIndex:s=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:b,coverFit:S,backgroundColor:L,imageGap:f,maxWidth:h,maxHeight:y,textTransition:E,title1Width:I,title2Width:T,title3Width:X,title1MarginLeft:k=0,title2MarginLeft:B=0,title3MarginLeft:P=0,titleRowMarginBottom:C=0,titleHeaderLayout:z="single-row",countCloseGap:v=0,closeIcon:_,closeIconMaxWidth:R,closeIconColor:Z,closeIconHoverColor:A,contentMarginTop:U=0,iconMarginRight:V=0}=n,G=a.useCallback(re=>w.scalingValue(re,i??!1),[i]),ne=G(f??0),$=`${h}%`,M=`${y}%`,N=G(v),Q=G(U),ie=G(V),F=pi("title1",ui(n,"title1"),i),pe=pi("title2",ui(n,"title2"),i),x=pi("title3",ui(n,"title3"),i),se=pi("count",ui(n,"count"),i),J=z==="mobile",ye=!i||!!l,Me=!o&&(!i||!!l),de=a.useMemo(()=>ir(t,b),[t,b]),[ce,q]=a.useState(s),ee=de[ce],me=ee==null?void 0:ee.entry,[Fe,Ce]=a.useState(!1),[Ae,ue]=a.useState(null),[fe,Se]=a.useState(!1),[D,oe]=a.useState(null),[he,be]=a.useState(!1),[Ie,xe]=a.useState(0),[W,ae]=a.useState(),[te,j]=a.useState(),[Y,Re]=a.useState(null),le=a.useRef(null),H=a.useRef(0),De=a.useRef(0),_e=a.useRef(0),tt=a.useRef(!1),Qe=a.useRef(null),at=a.useRef(null),$e=a.useRef(null),ge=a.useRef(null),je=a.useRef(null),vt=a.useRef(null),Ye=a.useRef(null),Oe=a.useCallback(()=>{const re=at.current;if(!re)return;const We=re.closest(`.${e}-lightbox-content-area`);if(!We)return re.getBoundingClientRect().width;const m=Array.from(We.children).reduce((O,K)=>!(K instanceof HTMLElement)||K.contains(re)?O:O+K.getBoundingClientRect().width,0);return We.getBoundingClientRect().width-m},[e]),Le=a.useCallback(()=>{le.current&&(clearTimeout(le.current),le.current=null)},[]),He=a.useCallback(re=>{re===H.current&&(oe(null),be(!1))},[]),Xe=a.useCallback(()=>{o||tt.current||(tt.current=!0,u==null||u(),Ce(!1),Qe.current=setTimeout(()=>{p()},300))},[o,u,p]),ut=a.useCallback(re=>!!(re.closest("[data-controls]")||re.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:xt,backdropStyle:it,mediaAreaStyle:wt,overlayContentStyle:lt,swipeHandlers:Ue,dismissAreaStyle:Ke}=Pc({enabled:Me,onClose:Xe,animMs:300,isBlockedTarget:ut}),Ne=a.useCallback(re=>{d&&mc(re+1,c,!0)},[d,c]),pt=a.useCallback(re=>{if(re)return re.getBoundingClientRect().height},[]),mt=a.useCallback(re=>{if(de.length===0)return;const We=(re%de.length+de.length)%de.length;if(We===ce)return;const m=de[ce],O=de[We];H.current+=1;const K=H.current,we=E==="fade"&&Nl(m==null?void 0:m.entry)!==Nl(O==null?void 0:O.entry),Pe=pt($e.current),Ge=we?(()=>{const Rt=Oe();Yn.flushSync(()=>{Re(O.entry)}),$e.current&&Rt&&($e.current.style.width=`${Rt}px`);const nn=pt($e.current);return $e.current&&($e.current.style.width=""),{measuredIncomingTitlesHeight:nn,incomingTitlesMeasureWidth:Rt}})():void 0,yt=Math.max(Pe??0,(Ge==null?void 0:Ge.measuredIncomingTitlesHeight)??0)||void 0;xe(K),oe(ce),be(!0),q(We),Ne(We),_e.current=We,we?(Le(),yt&&ae(yt),Ge!=null&&Ge.incomingTitlesMeasureWidth&&j(Ge.incomingTitlesMeasureWidth),ue((m==null?void 0:m.entryIndex)??null),Se(!0),De.current=O.entryIndex,le.current=setTimeout(()=>{ue(null),Se(!1),ae(void 0),j(void 0),Re(null),le.current=null},400)):(Le(),ue(null),Se(!1),ae(void 0),j(void 0),Re(null),De.current=O.entryIndex)},[ce,Le,Oe,pt,de,Ne,E]),gt=a.useCallback(()=>{Ye.current=null},[]),Pt=a.useCallback(re=>{!ye||de.length<=1||re.pointerType==="mouse"&&re.button!==0||re.target.closest("[data-controls]")||(Ye.current={startX:re.clientX,startY:re.clientY,pointerId:re.pointerId})},[ye,de.length]),Zt=a.useCallback(re=>{var Rt;if(!ye||de.length<=1||re.pointerType==="mouse"&&re.button!==0)return;if(xt){gt();return}const We=Ye.current;if(!We||We.pointerId!==re.pointerId||(gt(),re.target.closest("[data-controls]")))return;const O=re.clientX-We.startX,K=re.clientY-We.startY,we=Math.abs(O),Pe=Math.abs(K);if(we>=yg&&we>Pe){mt(O>0?ce-1:ce+1);return}if(we>Al||Pe>Al)return;const Ge=(Rt=ge.current)==null?void 0:Rt.getBoundingClientRect(),yt=Ge?Ge.left+Ge.width/2:window.innerWidth/2;mt(re.clientX<yt?ce-1:ce+1)},[ce,ye,mt,xt,gt,de.length]),tn=a.useCallback(re=>{const We=Ye.current;(We==null?void 0:We.pointerId)===re.pointerId&>()},[gt]);kc(),a.useEffect(()=>{vt.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const re=requestAnimationFrame(()=>{Ce(!0),requestAnimationFrame(()=>{je.current?je.current.focus():ge.current&&ge.current.focus()})});return()=>{cancelAnimationFrame(re),Qe.current&&clearTimeout(Qe.current),le.current&&clearTimeout(le.current);const We=vt.current;We&&document.contains(We)&&We.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var re;E!=="fade"&&(De.current=((re=de[ce])==null?void 0:re.entryIndex)??0,Le(),ue(null),Se(!1),ae(void 0),j(void 0))},[ce,Le,de,E]),a.useEffect(()=>{const re=We=>{if(We.key==="Escape"){Xe();return}if(We.key==="ArrowLeft"&&de.length>1){mt(ce-1);return}if(We.key==="ArrowRight"&&de.length>1){mt(ce+1);return}if(We.key==="Tab"&&ge.current){const m=ge.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),O=Array.from(m).filter(Ge=>!Ge.closest('[aria-hidden="true"]'));if(O.length===0)return;const K=O[0],we=O[O.length-1],Pe=document.activeElement;We.shiftKey?(Pe===K||!ge.current.contains(Pe))&&(We.preventDefault(),we.focus()):(Pe===we||!ge.current.contains(Pe))&&(We.preventDefault(),K.focus())}};return window.addEventListener("keydown",re),()=>window.removeEventListener("keydown",re)},[mt,Xe,ce,de.length]),a.useLayoutEffect(()=>{Le(),H.current=0,xe(0),oe(null),be(!1),ue(null),Se(!1),ae(void 0),j(void 0),Re(null),q(re=>{const We=Math.max(0,de.length-1);return Math.min(re,We)})},[Le,t.length,b,de.length]),a.useLayoutEffect(()=>{var m;const re=Math.max(0,de.length-1),We=Math.min(Math.max(0,s),re);_e.current=We,De.current=((m=de[We])==null?void 0:m.entryIndex)??0,q(We)},[s]);const Tt=Ae!==null?t[Ae]:null,Ct=D!==null?de[D]:null,Ft=(me==null?void 0:me.title1)||(me==null?void 0:me.title2)||(me==null?void 0:me.title3)||(Tt==null?void 0:Tt.title1)||(Tt==null?void 0:Tt.title2)||(Tt==null?void 0:Tt.title3),Ot=Tg(b,de,t),Te=_!==null,Be=Ft||Ot||Te,qe=Ot&&Te?{gap:N}:void 0,st=`${e}-titles-stack${J?` ${e}-titles-stack-stacked`:""}`,kt=`${e}-titles-layer-out${J?` ${e}-titles-layer-out-stacked`:""}`,dt=`${e}-titles-layer-out`,nt=(k??0)>0||o,qt=G(C),St=a.useMemo(()=>({title1Width:I??Ai.title1Width,title2Width:T??Ai.title2Width,title3Width:X??Ai.title3Width}),[I,T,X]),Ve=a.useMemo(()=>({title2MarginLeft:B,title3MarginLeft:P}),[B,P]),et=a.useMemo(()=>me?Vn(e,me,F,pe,x):[],[e,me,F,pe,x]),It=a.useMemo(()=>et.map(re=>St[re.widthKey]),[et,St]),Lt=a.useMemo(()=>Oi(et.length,It),[et.length,It]),ht=a.useMemo(()=>xo(et.length,It),[et.length,It]),Dt=a.useMemo(()=>et.filter(re=>re.prefix==="title1"),[et]),_t=a.useMemo(()=>et.filter(re=>re.prefix==="title2"||re.prefix==="title3"),[et]),jt=a.useMemo(()=>Gn(Dt,St),[Dt,St]),Ut=a.useMemo(()=>Gn(_t,St),[_t,St]),$t=a.useCallback((re,We)=>{const m=et.findIndex(K=>K.prefix===re.prefix);if(!J||We==="single-row")return{effectiveWidth:ht[m]??0,resolvedWidth:Lt[m]??0,maxWidth:ln(m,Lt)};if(We==="two-row-top"){const K=Dt.findIndex(we=>we.prefix===re.prefix);return{effectiveWidth:jt.effective[K]??0,resolvedWidth:jt.resolved[K]??0,maxWidth:ln(K,jt.resolved)}}const O=_t.findIndex(K=>K.prefix===re.prefix);return{effectiveWidth:Ut.effective[O]??0,resolvedWidth:Ut.resolved[O]??0,maxWidth:ln(O,Ut.resolved)}},[et,_t,Ut,ht,Lt,Dt,jt,J]),en=a.useCallback(re=>yc(et,Lt,Ve,re)+(J?0:k??0),[et,Lt,Ve,J,k]),Kt=a.useCallback(()=>J?0:k??0,[J,k]),Yt=a.useCallback(re=>_t.slice(0,re).reduce((We,m,O)=>We+(m.marginLeftKey?Ve[m.marginLeftKey]??0:0)+(Ut.resolved[O]??0),0),[_t,Ut.resolved,Ve]),Xt=a.useCallback(re=>{const We=_t[re];return Yt(re)+(We.marginLeftKey?Ve[We.marginLeftKey]??0:0)+(Ut.resolved[re]??0)},[_t,Ut.resolved,Yt,Ve]),zt=a.useCallback((re,We,m)=>{if(!J||m==="single-row"){const Ge=re.findIndex(Jt=>Jt.prefix===We.prefix),yt=re.map(Jt=>St[Jt.widthKey]),Rt=Oi(re.length,yt);return{effectiveWidth:xo(re.length,yt)[Ge]??0,resolvedWidth:Rt[Ge]??0,maxWidth:ln(Ge,Rt)}}if(m==="two-row-top"){const Ge=re.filter(Jt=>Jt.prefix==="title1"),yt=Ge.findIndex(Jt=>Jt.prefix===We.prefix),{resolved:Rt,effective:nn}=Gn(Ge,St);return{effectiveWidth:nn[yt]??0,resolvedWidth:Rt[yt]??0,maxWidth:ln(yt,Rt)}}const O=re.filter(Ge=>Ge.prefix==="title2"||Ge.prefix==="title3"),K=O.findIndex(Ge=>Ge.prefix===We.prefix),{resolved:we,effective:Pe}=Gn(O,St);return{effectiveWidth:Pe[K]??0,resolvedWidth:we[K]??0,maxWidth:ln(K,we)}},[St,J]),Bt=(re,We,m)=>{const O=re.marginLeftKey?Ve[re.marginLeftKey]??0:0,{effectiveWidth:K,resolvedWidth:we,maxWidth:Pe}=m??$t(re,We),Ge=Math.max(O,Bn),yt=o&&We==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":re.prefix,style:{width:G(K),...O>0?{marginLeft:G(O)}:{}},children:[r.jsx("p",{className:re.className,style:re.style,children:re.text}),yt&&re.marginLeftKey?r.jsx("div",{"data-controls":re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we),style:{position:"absolute",top:0,left:G(-O),width:G(Ge),height:"100%",pointerEvents:"auto"}}):null,yt?r.jsx("div",{"data-controls":re.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Pe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:G(-gn/2),width:G(gn),height:"100%",pointerEvents:"auto"}}):null]},re.className)},g=(re="two-row")=>{const We=et.findIndex(K=>K.prefix==="title1"),m=We>=0?Lt[We]:St.title1Width,O=re==="two-row"&&o;return r.jsx("div",{...O?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(m)}:{},style:{width:G(k??0),flexShrink:0,alignSelf:"stretch",...O?{pointerEvents:"auto"}:{}}})},ve=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:F,"aria-hidden":"true",children:" "}),ke=()=>r.jsx("span",{className:`${e}-entry-counter`,style:se,"aria-live":"polite","aria-atomic":"true",children:Cg(de,ce,b,t)}),Ee=()=>Ot?o&&Te?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[ke(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Ur(N)} + ${N}))`,width:Ur(N),height:"100%",pointerEvents:"auto",zIndex:3}})]}):ke():null,ot=()=>!Ot&&!Te?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:qe,children:[Ee(),Te?ft():null]}),At=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ot||Ft?ve():null,nt?g("single-row"):null,Et(me),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),ot(),Sn()]}),Je=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ot||Ft?ve():null,nt?g("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:fe&&W?{minHeight:W}:void 0,children:[r.jsx("div",{ref:$e,className:st,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ti(Y||me)}),r.jsxs("div",{ref:at,className:st,style:{position:fe?"absolute":"relative",inset:fe?0:void 0,width:"100%",...fe&&te?{width:te,maxWidth:"100%"}:void 0},children:[Tt&&fe?r.jsx("div",{className:`${kt} ${e}-titles-fade-out`,children:ti(Tt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${fe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ti(me)})]})]}),ot(),Sn()]}),ft=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:w.scalingValue(R??0,i),height:w.scalingValue(R??0,i),marginRight:ie,"--close-icon-hover-color":A},children:[r.jsx("button",{ref:je,type:"button",className:`${e}-close-icon-inner`,onClick:Xe,"aria-label":"Close",children:r.jsx(rn,{url:_??"",fill:Z,hoverFill:i&&!l?Z:A,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ie,height:"100%",pointerEvents:"auto"}})]}),Nt=(re,We)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[Ot||Ft?ve():null,nt?g("two-row"):null,We!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:We},children:re}):r.jsxs(r.Fragment,{children:[re,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),ot()]}),Et=re=>{if(!re)return null;const We=Vn(e,re,F,pe,x);return r.jsx(r.Fragment,{children:We.map(m=>Bt(m,"single-row",zt(We,m,"single-row")))})},cn=re=>{if(!re)return null;const We=Vn(e,re,F,pe,x),m=We.find(O=>O.prefix==="title1");return m?Bt(m,"two-row-top",zt(We,m,"two-row-top")):null},dn=(re,We=!1)=>{const m=re?Vn(e,re,F,pe,x):[],O=m.filter(Pe=>Pe.prefix==="title2"||Pe.prefix==="title3"),K=o&&We;return O.length>0||K||(C??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[O.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[O.map(Pe=>Bt(Pe,"two-row-bottom",zt(m,Pe,"two-row-bottom"))),We&&o?r.jsxs(r.Fragment,{children:[Ar(),Fr()]}):null]}):null,(C??0)>0||K?r.jsx("div",{"data-controls":K?"titleRowMarginBottom":void 0,"data-controls-axis":K?"y":void 0,"data-controls-reverse":K?"":void 0,className:K?`${e}-control`:void 0,style:{height:qt,width:"100%",flexShrink:0,pointerEvents:K?"auto":"none"}}):null]}):null},ei=(re,We=!1)=>r.jsxs(r.Fragment,{children:[Nt(cn(re)),dn(re,We)]}),ti=re=>J?r.jsx("div",{className:`${e}-titles-row-two-row`,children:ei(re)}):re?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Et(re)}):null,ko=()=>{const re=J?-1:et.findIndex(O=>O.prefix==="title1"),We=!J&&(o||(k??0)>0)?(()=>{const O=k??0,K=re>=0?Lt[re]:St.title1Width,we=Math.max(O,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(K),style:{position:"absolute",top:0,left:0,width:G(we),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,m=et.flatMap((O,K)=>{if(!O.marginLeftKey)return[];const we=Ve[O.marginLeftKey]??0,Pe=fc(et,Lt,Ve,K)+Kt(),Ge=Math.max(we,Bn);return r.jsx("div",{"data-controls":O.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Lt[K]),style:{position:"absolute",top:0,left:G(Pe),width:G(Ge),height:"100%",pointerEvents:"auto"}},O.marginLeftKey)});return We?[We,...m]:m},Ao=()=>et.map((re,We)=>{const m=ln(We,Lt),K=en(We)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":re.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(m),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:G(K),width:G(gn),height:"100%",pointerEvents:"auto"}})},`${re.widthKey}-junction`)}),Ar=()=>_t.flatMap((re,We)=>{if(!re.marginLeftKey)return[];const m=Ve[re.marginLeftKey]??0,O=Yt(We),K=Math.max(m,Bn),{resolvedWidth:we}=$t(re,"two-row-bottom");return r.jsx("div",{"data-controls":re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we),style:{position:"absolute",top:0,left:G(O),width:G(K),height:"100%",pointerEvents:"auto"}},re.marginLeftKey)}),Fr=()=>_t.map((re,We)=>{const{maxWidth:m}=$t(re,"two-row-bottom"),K=Xt(We)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":re.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(m),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:G(K),width:G(gn),height:"100%",pointerEvents:"auto"}})},`${re.widthKey}-junction`)}),Sn=()=>!o||J?null:r.jsxs(r.Fragment,{children:[ko(),Ao()]}),xi=re=>{const We=!re.objectFit&&Fn(S);return{className:`${e}-slide-image-cell${We?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:$,maxHeight:M,...We?{"--image-aspect-ratio":Pr(S)}:{}}}},Fo=re=>re.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":re.objectFit}}:Fn(S)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ni=re=>{if(re.length===0)return null;const We=re.length>1,m=Ur(ne),O=`calc(-0.5 * (${m} + ${ne}))`;if(re.length===1){const K=re[0];return r.jsx("div",{...xi(K),children:r.jsx("img",{...Fo(K),src:K.url,alt:K.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:We?{gap:ne}:void 0,children:re.map((K,we)=>r.jsxs("div",{...xi(K),children:[r.jsx("img",{...Fo(K),src:K.url,alt:K.name??"",draggable:!1}),o&&We&&we<re.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:O,width:m,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${K.url}-${we}`))})},Wo=!!(me!=null&&me.title2||me!=null&&me.title3||Tt!=null&&Tt.title2||Tt!=null&&Tt.title3||(C??0)>0||o),Wr=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:$e,className:st,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ei(Y||me)}),r.jsxs("div",{ref:at,className:`${e}-titles-row-two-row`,style:{...fe&&W?{minHeight:W}:void 0,...fe&&te?{width:te,maxWidth:"100%"}:void 0},children:[Nt(r.jsxs("div",{className:st,style:{position:fe?"absolute":"relative",inset:fe?0:void 0,width:"100%"},children:[Tt&&fe?r.jsx("div",{className:`${dt} ${e}-titles-fade-out`,children:cn(Tt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${fe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:cn(me)})]}),fe&&W?W:void 0),Wo?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Tt&&fe?r.jsx("div",{className:`${kt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:dn(Tt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${fe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${J?` ${e}-titles-layer-in-stacked`:""}`,children:dn(me,!0)})]}):null]})]}),_r=()=>{const re=Wo;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...re?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:re?void 0:{flex:"0 0 auto",height:"auto"},children:ei(me,!0)}),Sn()]})};return r.jsxs("div",{ref:ge,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{xt||Xe()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:Te?void 0:-1,style:{opacity:Fe?1:0,transition:"opacity 300ms ease",pointerEvents:Fe?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:L,...it}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ke,...Ue,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:wt,onClick:re=>re.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ye&&de.length>1?"true":"false",onPointerDown:ye?Pt:void 0,onPointerUp:ye?Zt:void 0,onPointerCancel:ye?tn:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[Ct&&he?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:re=>{re.target===re.currentTarget&&He(Ie)},children:r.jsx("div",{className:`${e}-slide-area`,children:ni(Ct.images)})},`slide-out-${Ie}`):null,r.jsx("div",{className:`${e}-slide-layer-in${he?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:ee?ni(ee.images):null})},`slide-in-${Ie}-${ce}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:lt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:Q,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...J?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${J?` ${e}-lightbox-content-area-stacked`:""}`,children:Be&&r.jsx("div",{className:`${e}-text-bar-cell${J?` ${e}-text-bar-cell-stacked`:""}`,style:J?void 0:{flex:1,minWidth:0,width:"100%"},children:J?E==="fade"?Wr():_r():E==="fade"?Je():At()})})})]})]})]})};function oy(e){return`
|
|
13797
13929
|
.${e}-wrapper {
|
|
13798
13930
|
position: relative;
|
|
13799
13931
|
width: 100%;
|
|
@@ -14315,7 +14447,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
14315
14447
|
pointer-events: auto;
|
|
14316
14448
|
z-index: 10;
|
|
14317
14449
|
}
|
|
14318
|
-
`}const
|
|
14450
|
+
`}const ry=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:l,metadata:s})=>{const{prefix:d}=w.useScopedStyles(),c=(s==null?void 0:s.itemId)??null,{cover:u,coverFit:p,type:b}=e,S=a.useRef(null),[L,f]=a.useState(!1),[h,y]=a.useState(0),E=a.useRef(!1),I=a.useRef(!1),T=a.useRef(!1),X=a.useMemo(()=>(t??[]).filter(v=>Hi(v).length>0),[t]),k=L&&X.length>0,B=!n,P=a.useCallback(()=>{B&&(T.current=!0,xg(I.current,c),I.current=!1)},[B,c]),C=(v=0)=>{if(X.length===0||n&&!i&&!o)return;const _=ir(X,b),R=Math.max(0,Math.min(v,_.length-1));if(y(R),B){const Z=gc();mc(R+1,c,Z),I.current=!Z}f(!0)},z=a.useCallback(()=>{f(!1),T.current=!1},[]);return a.useEffect(()=>{!n||i||o||f(!1)},[n,i,o]),a.useEffect(()=>{if(!B||E.current)return;E.current=!0;const v=Wl(c);if(!v)return;const _=_l(v,ir(X,b).length);_<0||(y(_),f(!0))},[X,c,B,b]),a.useEffect(()=>{if(!B)return;const v=()=>{if(T.current){T.current=!1,f(!1);return}const _=Wl(c);if(!_){f(!1);return}const R=_l(_,ir(X,b).length);if(R<0){f(!1);return}I.current=!1,y(R),f(!0)};return window.addEventListener("popstate",v),()=>window.removeEventListener("popstate",v)},[X,c,B,b]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:S,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:oy(d)}}),u?r.jsx("button",{type:"button",className:`${d}-cover ${Fn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>C(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Fn(p)?{"--image-aspect-ratio":Pr(p)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Fn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),k&&typeof document<"u"&&(()=>{const v=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx(iy,{prefix:d,entries:X,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:h,enableUrlSync:B,journalItemId:c,onBeforeClose:P,onClose:z}),v)})()]})},ay=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
14319
14451
|
import { createPortal } from 'react-dom';
|
|
14320
14452
|
import { CommonComponentProps } from '../props';
|
|
14321
14453
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -15071,7 +15203,7 @@ export type LightboxJournalSettings = {
|
|
|
15071
15203
|
closeIconColor: string;
|
|
15072
15204
|
closeIconHoverColor: string;
|
|
15073
15205
|
};
|
|
15074
|
-
`,ny="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),li={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 iy(e){const t={};return t[Ye(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ye(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ye(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ye(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ye(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ye(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const oy=Kn.reduce((e,t)=>({...e,...iy(t)}),{}),ry=Kn.reduce((e,t)=>({...e,[Ye(t,"fontFamily")]:"Goudy Bookletter 1911",[Ye(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ye(t,"letterSpacing")]:0,[Ye(t,"wordSpacing")]:0,[Ye(t,"textAlign")]:"left",[Ye(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function na(e){return Kn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ye(n,"fontSize")]=i),o!==void 0&&(t[Ye(n,"lineHeight")]=o),t},{})}const ay=wg(),sy={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...oy,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:ny,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...ry,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...na({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},t:{type:"A",imageGap:.05,maxHeight:80,maxWidth:40,closeIconMaxWidth:.03,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.16,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.03,...na({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208,countFontSize:.0208,countLineHeight:.0208})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...na({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[ay]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"}]}]}},ly={element:ey,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:sy,sourceCode:ty,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Kn.map(e=>({path:`${Ye(e,"fontFamily")}`}))]},fontRelations:{...Kn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ye(t,"fontFamily")}`}),{})}},cy={sizeType:"custom",value:700,min:400,max:700};function mr(e,t){return{widthPx:e,heightPx:e*t}}function Sa(e,t,n,i,o,s){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,s/2),i-s/2)}}function ll(e,t,n,i){const{heightPx:o}=mr(n,i);return Sa(e/2,t/2,e,t,n,o)}function Mc(e,t,n){for(const i of n){const{heightPx:o}=mr(i.widthPx,i.aspectRatio),s=i.widthPx/2,l=o/2;if(e>=i.x-s&&e<=i.x+s&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function dy(e,t,n,i,o,s,l,d){if(o==="system")return"none";const c=i.getBoundingClientRect(),u=document.elementFromPoint(c.left+e,c.top+t);return u&&u.closest("a")?"none":Mc(e,t,n)||s==="area"?l??"none":d??"none"}function cl(e,t,n){var d;const{sizeType:i,value:o,min:s,max:l}=t;return i==="custom"?o:i==="as is"?((d=n.get(e))==null?void 0:d.naturalWidth)??o:Math.round(Math.random()*(l-s)+s)}function uy(e){return`
|
|
15206
|
+
`,ly="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),si={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 sy(e){const t={};return t[Ze(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ze(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ze(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ze(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ze(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ze(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const cy=Kn.reduce((e,t)=>({...e,...sy(t)}),{}),dy=Kn.reduce((e,t)=>({...e,[Ze(t,"fontFamily")]:"Goudy Bookletter 1911",[Ze(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ze(t,"letterSpacing")]:0,[Ze(t,"wordSpacing")]:0,[Ze(t,"textAlign")]:"left",[Ze(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ia(e){return Kn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ze(n,"fontSize")]=i),o!==void 0&&(t[Ze(n,"lineHeight")]=o),t},{})}const uy=Lg(),py={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...cy,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:ly,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...dy,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...ia({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},t:{type:"A",imageGap:.05,maxHeight:80,maxWidth:40,closeIconMaxWidth:.03,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.16,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.03,...ia({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208,countFontSize:.0208,countLineHeight:.0208})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...ia({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[uy]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"}]}]}},my={element:ry,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:py,sourceCode:ay,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Kn.map(e=>({path:`${Ze(e,"fontFamily")}`}))]},fontRelations:{...Kn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ze(t,"fontFamily")}`}),{})}},gy={sizeType:"custom",value:700,min:400,max:700};function gr(e,t){return{widthPx:e,heightPx:e*t}}function $a(e,t,n,i,o,l){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,l/2),i-l/2)}}function ss(e,t,n,i){const{heightPx:o}=gr(n,i);return $a(e/2,t/2,e,t,n,o)}function Fc(e,t,n){for(const i of n){const{heightPx:o}=gr(i.widthPx,i.aspectRatio),l=i.widthPx/2,s=o/2;if(e>=i.x-l&&e<=i.x+l&&t>=i.y-s&&t<=i.y+s)return!0}return!1}function hy(e,t,n,i,o,l,s,d){if(o==="system")return"none";const c=i.getBoundingClientRect(),u=document.elementFromPoint(c.left+e,c.top+t);return u&&u.closest("a")?"none":Fc(e,t,n)||l==="area"?s??"none":d??"none"}function cs(e,t,n){var d;const{sizeType:i,value:o,min:l,max:s}=t;return i==="custom"?o:i==="as is"?((d=n.get(e))==null?void 0:d.naturalWidth)??o:Math.round(Math.random()*(s-l)+l)}function fy(e){return`
|
|
15075
15207
|
.${e}-root {
|
|
15076
15208
|
position: absolute;
|
|
15077
15209
|
top: 0;
|
|
@@ -15106,7 +15238,7 @@ export type LightboxJournalSettings = {
|
|
|
15106
15238
|
width: 32px;
|
|
15107
15239
|
height: 32px;
|
|
15108
15240
|
}
|
|
15109
|
-
`}function
|
|
15241
|
+
`}function yy(e){return new Promise(t=>{const n=new Image;n.onload=()=>{t({aspectRatio:n.naturalHeight/n.naturalWidth,naturalWidth:n.naturalWidth})},n.onerror=()=>{t({aspectRatio:1,naturalWidth:700})},n.src=e})}async function vy(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await yy(i)]));return new Map(n)}function xy({settings:e,content:t=[],isEditor:n}){const{prefix:i}=w.useScopedStyles(),[o,l]=a.useState(null),[s,d]=a.useState([]),[c,u]=a.useState(0),p=a.useRef(0),[b,S]=a.useState({x:0,y:0}),[L,f]=a.useState("none"),h=a.useRef({x:0,y:0}),[y,E]=a.useState(!1),[I,T]=a.useState(!1),X=a.useRef(new Map),{imageSize:k=gy,cursor:B="system",target:P="area",position:C="random",visible:z="all",defaultCursor:v=null,hoverCursor:_=null}=e,R=t.filter($=>{var M;return!!((M=$==null?void 0:$.image)!=null&&M.url)}),Z=a.useMemo(()=>fy(i),[i]),A=a.useCallback(($,M,N=s)=>{if(!o)return;const Q=o.getBoundingClientRect(),ie=$-Q.left,F=M-Q.top;S({x:ie,y:F}),f(hy(ie,F,N,o,B,P,_,v))},[o,s,B,P,_,v]);a.useEffect(()=>{const $=[...R.map(N=>N.image.url),v,_].filter(N=>!!N);if($.length===0){X.current=new Map,T(!0);return}let M=!1;return T(!1),vy($).then(N=>{M||(X.current=N,T(!0))}),()=>{M=!0}},[t,v,_]),a.useEffect(()=>{if(!o)return;const $=N=>{N.stopPropagation(),h.current={x:N.clientX,y:N.clientY},A(N.clientX,N.clientY)},M=()=>{y&&A(h.current.x,h.current.y)};return o.addEventListener("mousemove",$),window.addEventListener("scroll",M,!0),()=>{o.removeEventListener("mousemove",$),window.removeEventListener("scroll",M,!0)}},[o,y,A]),a.useEffect(()=>{!o||!y||A(h.current.x,h.current.y)},[s,o,y,A]),a.useEffect(()=>{y||f("none")},[y]);const U=($,M,N,Q={})=>{var J,ye;if(!((J=$==null?void 0:$.image)!=null&&J.url))return null;const ie=((ye=X.current.get($.image.url))==null?void 0:ye.aspectRatio)??1,F=cs($.image.url,k,X.current),{heightPx:pe}=gr(F,ie);let x=0,se=0;return C==="same"?{x,y:se}=ss(M,N,F,ie):(x=Q.x??Math.random()*M,se=Q.y??Math.random()*N,{x,y:se}=$a(x,se,M,N,F,pe)),{id:p.current++,url:$.image.url,link:$.link,name:$.image.name,x,y:se,xRatio:x/M,yRatio:se/N,aspectRatio:ie,widthPx:F}},V=()=>{if(!o)return;const $=o.getBoundingClientRect(),M=$.width,N=$.height;M===0||N===0||d(Q=>Q.length===0?Q:Q.map(ie=>{const F=k.sizeType==="random"?ie.widthPx:cs(ie.url,k,X.current),{heightPx:pe}=gr(F,ie.aspectRatio);if(C==="same"){const{x:J,y:ye}=ss(M,N,F,ie.aspectRatio);return{...ie,x:J,y:ye,widthPx:F}}const{x,y:se}=$a(ie.xRatio*M,ie.yRatio*N,M,N,F,pe);return{...ie,x,y:se,widthPx:F}}))};a.useEffect(()=>{if(!o||R.length===0||!I)return;const $=o.getBoundingClientRect(),M=$.width,N=$.height,Q=U(R[0],M,N);Q&&(d([Q]),u(R.length>1?1:0))},[k,C,o,t,I]),a.useEffect(()=>{if(!o)return;V();const $=new ResizeObserver(V);return $.observe(o),window.addEventListener("resize",V),()=>{$.disconnect(),window.removeEventListener("resize",V)}},[o,C,k,s.length]),a.useEffect(()=>{z==="last One"&&d($=>$.length>0?[$[$.length-1]]:[])},[z]);const G=$=>{if(!o||R.length===0||!I)return;const M=o.getBoundingClientRect(),N=$.clientX-M.left,Q=$.clientY-M.top;if(P==="image"&&!Fc(N,Q,s))return;let ie=0,F=0;C==="on Click"?(ie=N,F=Q):C==="same"?(ie=M.width/2,F=M.height/2):(ie=Math.random()*M.width,F=Math.random()*M.height);const pe=R[c%R.length],x=U(pe,M.width,M.height,{x:ie,y:F});if(!x)return;const se=z==="all"?[...s,x]:[x];d(se),u(J=>(J+1)%R.length),A($.clientX,$.clientY,se)},ne=B==="custom"&&L!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Z}}),r.jsxs("div",{ref:l,onClick:G,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),className:`${i}-root`,style:{cursor:ne?"none":"default"},children:[s.map($=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${$.y}px`,left:`${$.x}px`,width:`${$.widthPx}px`,cursor:ne?"none":"default"},children:P==="area"&&$.link?r.jsx("a",{href:$.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:$.url,alt:$.name,className:`${i}-image`})}):r.jsx("img",{src:$.url,alt:$.name,className:`${i}-image`})},$.id)),y&&ne&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${b.x}px`,top:`${b.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${L}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const by=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
15110
15242
|
import { CommonComponentProps } from '../props';
|
|
15111
15243
|
import { useScopedStyles } from '../utils/index';
|
|
15112
15244
|
|
|
@@ -15362,6 +15494,10 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15362
15494
|
hoverCursor = null,
|
|
15363
15495
|
} = settings;
|
|
15364
15496
|
|
|
15497
|
+
const validContent = content.filter(
|
|
15498
|
+
(item): item is ClickGallerieItem => Boolean(item?.image?.url),
|
|
15499
|
+
);
|
|
15500
|
+
|
|
15365
15501
|
const scopedCss = useMemo(() => getCSS(P), [P]);
|
|
15366
15502
|
|
|
15367
15503
|
const updateCursorFromMousePosition = useCallback((
|
|
@@ -15383,7 +15519,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15383
15519
|
|
|
15384
15520
|
useEffect(() => {
|
|
15385
15521
|
const urls = [
|
|
15386
|
-
...
|
|
15522
|
+
...validContent.map((item) => item.image.url),
|
|
15387
15523
|
defaultCursor,
|
|
15388
15524
|
hoverCursor,
|
|
15389
15525
|
].filter((url): url is string => Boolean(url));
|
|
@@ -15443,11 +15579,13 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15443
15579
|
}, [isInside]);
|
|
15444
15580
|
|
|
15445
15581
|
const createNewImage = (
|
|
15446
|
-
imgData: ClickGallerieItem,
|
|
15582
|
+
imgData: ClickGallerieItem | undefined,
|
|
15447
15583
|
containerWidth: number,
|
|
15448
15584
|
containerHeight: number,
|
|
15449
15585
|
clickPosition: { x?: number; y?: number } = {},
|
|
15450
|
-
): PlacedImage => {
|
|
15586
|
+
): PlacedImage | null => {
|
|
15587
|
+
if (!imgData?.image?.url) return null;
|
|
15588
|
+
|
|
15451
15589
|
const aspectRatio = imageMetaByUrlRef.current.get(imgData.image.url)?.aspectRatio ?? 1;
|
|
15452
15590
|
const widthPx = resolveImageWidthPx(imgData.image.url, imageSize, imageMetaByUrlRef.current);
|
|
15453
15591
|
const { heightPx } = getImageDimensions(widthPx, aspectRatio);
|
|
@@ -15513,16 +15651,17 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15513
15651
|
};
|
|
15514
15652
|
|
|
15515
15653
|
useEffect(() => {
|
|
15516
|
-
if (!divRef ||
|
|
15654
|
+
if (!divRef || validContent.length === 0 || !imagesReady) return;
|
|
15517
15655
|
|
|
15518
15656
|
const rect = divRef.getBoundingClientRect();
|
|
15519
15657
|
const containerWidth = rect.width;
|
|
15520
15658
|
const containerHeight = rect.height;
|
|
15521
15659
|
|
|
15522
|
-
const newImg = createNewImage(
|
|
15660
|
+
const newImg = createNewImage(validContent[0], containerWidth, containerHeight);
|
|
15661
|
+
if (!newImg) return;
|
|
15523
15662
|
|
|
15524
15663
|
setPlacedImages([newImg]);
|
|
15525
|
-
setCounter(1);
|
|
15664
|
+
setCounter(validContent.length > 1 ? 1 : 0);
|
|
15526
15665
|
}, [imageSize, position, divRef, content, imagesReady]);
|
|
15527
15666
|
|
|
15528
15667
|
useEffect(() => {
|
|
@@ -15547,7 +15686,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15547
15686
|
}, [visible]);
|
|
15548
15687
|
|
|
15549
15688
|
const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
15550
|
-
if (!divRef ||
|
|
15689
|
+
if (!divRef || validContent.length === 0 || !imagesReady) return;
|
|
15551
15690
|
|
|
15552
15691
|
const rect = divRef.getBoundingClientRect();
|
|
15553
15692
|
const clickX = e.clientX - rect.left;
|
|
@@ -15568,12 +15707,14 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15568
15707
|
y = Math.random() * rect.height;
|
|
15569
15708
|
}
|
|
15570
15709
|
|
|
15571
|
-
const imgData =
|
|
15710
|
+
const imgData = validContent[counter % validContent.length];
|
|
15572
15711
|
const newImage = createNewImage(imgData, rect.width, rect.height, { x, y });
|
|
15712
|
+
if (!newImage) return;
|
|
15713
|
+
|
|
15573
15714
|
const nextPlacedImages = visible === 'all' ? [...placedImages, newImage] : [newImage];
|
|
15574
15715
|
|
|
15575
15716
|
setPlacedImages(nextPlacedImages);
|
|
15576
|
-
setCounter((prev) => (prev
|
|
15717
|
+
setCounter((prev) => (prev + 1) % validContent.length);
|
|
15577
15718
|
updateCursorFromMousePosition(e.clientX, e.clientY, nextPlacedImages);
|
|
15578
15719
|
};
|
|
15579
15720
|
|
|
@@ -15627,7 +15768,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15627
15768
|
</>
|
|
15628
15769
|
);
|
|
15629
15770
|
}
|
|
15630
|
-
`,
|
|
15771
|
+
`,wy={type:"object",version:1,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"}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"Slider-4.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"Slider-5.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"Slider-6.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"Slider-7.png"},link:""}]},settings:{sizing:"manual",properties:{imageSize:{type:"object",scope:"layout",title:"Img Size",display:{type:"toggle-cycle-numeric-input",enum:["custom","as is","random"],inputs:{custom:"single","as is":"none",random:"range"},defaultValue:700,defaultMin:400,defaultMax:700},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},cursor:{type:"string",scope:"common",title:"Cursor",display:{type:"toggle-cycle",enum:["system","custom"]}},target:{type:"string",scope:"common",title:"Target",display:{type:"toggle-cycle",enum:["area","image"]}},position:{type:"string",scope:"common",title:"Position",display:{type:"toggle-cycle",enum:["random","same","on Click"]}},visible:{type:"string",scope:"common",title:"Visible",display:{type:"toggle-cycle",enum:["all","last One"]}},defaultCursor:{type:["string","null"],scope:"common",title:"Default",display:{type:"settings-image-input",visible:!1}},hoverCursor:{type:["string","null"],scope:"common",title:"Hover",display:{type:"settings-image-input",visible:!1}}},defaults:{imageSize:{sizeType:"custom",value:700,min:400,max:700},cursor:"system",target:"area",position:"random",visible:"all",defaultCursor:null,hoverCursor:null},layoutDefaults:{m:{imageSize:{sizeType:"custom",value:500,min:400,max:700}},t:{imageSize:{sizeType:"custom",value:600,min:400,max:700}},d:{imageSize:{sizeType:"custom",value:700,min:400,max:700}}},displayRules:[{if:{name:"cursor",value:"custom"},then:{name:"properties.defaultCursor.display.visible",value:!0}},{if:{name:"cursor",value:"custom"},then:{name:"properties.hoverCursor.display.visible",value:!0}}],layout:["__componentName__","imageSize","cursor","target","position","visible","defaultCursor","hoverCursor"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["imageSize"]},{type:"row",title:"",items:["cursor","target"]},{type:"row",title:"",items:["position","visible"]},{type:"row",title:"Custom Cursor",items:["defaultCursor","hoverCursor"]}]}]},Sy={element:xy,id:"click-gallerie",name:"Click",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},schema:wy,sourceCode:by,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},$y=100,Cy=70,jn="cubic-bezier(0.86, 0, 0.07, 1)";function Ty(e){return`
|
|
15631
15772
|
.${e}-wrapper {
|
|
15632
15773
|
position: relative;
|
|
15633
15774
|
width: 100%;
|
|
@@ -15662,34 +15803,34 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15662
15803
|
}
|
|
15663
15804
|
.${e}-incoming-next {
|
|
15664
15805
|
z-index: 4;
|
|
15665
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
15806
|
+
transition: transform var(--${e}-transition-ms) ${jn};
|
|
15666
15807
|
}
|
|
15667
15808
|
.${e}-incoming-prev {
|
|
15668
15809
|
z-index: 4;
|
|
15669
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
15810
|
+
transition: transform var(--${e}-transition-ms) ${jn};
|
|
15670
15811
|
}
|
|
15671
15812
|
.${e}-outgoing {
|
|
15672
15813
|
will-change: transform;
|
|
15673
15814
|
}
|
|
15674
15815
|
.${e}-outgoing-next {
|
|
15675
15816
|
z-index: 3;
|
|
15676
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
15817
|
+
transition: transform var(--${e}-transition-ms) ${jn};
|
|
15677
15818
|
}
|
|
15678
15819
|
.${e}-outgoing-prev {
|
|
15679
15820
|
z-index: 3;
|
|
15680
|
-
transition: transform var(--${e}-transition-ms) ${
|
|
15821
|
+
transition: transform var(--${e}-transition-ms) ${jn};
|
|
15681
15822
|
}
|
|
15682
15823
|
.${e}-outgoing-next .${e}-effect-image {
|
|
15683
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
15824
|
+
transition: filter var(--${e}-transition-ms) ${jn};
|
|
15684
15825
|
}
|
|
15685
15826
|
.${e}-outgoing-prev .${e}-effect-image {
|
|
15686
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
15827
|
+
transition: filter var(--${e}-transition-ms) ${jn};
|
|
15687
15828
|
}
|
|
15688
15829
|
.${e}-incoming .${e}-effect-image {
|
|
15689
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
15830
|
+
transition: filter var(--${e}-transition-ms) ${jn};
|
|
15690
15831
|
}
|
|
15691
15832
|
.${e}-background .${e}-effect-image {
|
|
15692
|
-
transition: filter var(--${e}-transition-ms) ${
|
|
15833
|
+
transition: filter var(--${e}-transition-ms) ${jn};
|
|
15693
15834
|
}
|
|
15694
15835
|
.${e}-snap .${e}-incoming,
|
|
15695
15836
|
.${e}-snap .${e}-outgoing,
|
|
@@ -15737,7 +15878,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
15737
15878
|
display: block;
|
|
15738
15879
|
pointer-events: none;
|
|
15739
15880
|
}
|
|
15740
|
-
`}function
|
|
15881
|
+
`}function Ly(e){return e==="blur"?Cy:e==="greyscale"?$y:0}function to(e,t=1,n=1){const i=Ly(e)*Math.max(0,Math.min(1,t));if(e==="greyscale")return`grayscale(${i}%)`;if(e==="blur"){const o=i/4;return o<=0?"none":`blur(${o/Math.max(n,1)}px)`}return"none"}function ds(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Iy(e,t){return t<=1?0:(e-1+t)%t}function Ry(e,t=1){return!e||e.height===0?t:e.width/e.height}function My(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const l=e*i/100,s=t*o/100;let d=l,c=d/n;return c>s&&(c=s,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function us(e,t,n){if(e<=0||t<=0)return 1;const i=e*n.widthPercent/100,o=t*n.heightPercent/100;return i<=0||o<=0?1:Math.max(e/i,t/o)}function Wc(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function ps(e,t,n){return{...Wc(e),[`--${n}-stage-scale`]:t}}function Ey(e,t){[...new Set(e.filter(Boolean))].forEach(i=>{const o=new Image;o.onload=()=>{o.naturalWidth>0&&o.naturalHeight>0&&t(i,{width:o.naturalWidth,height:o.naturalHeight})},o.src=i})}function Py({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Se,D,oe,he,be,Ie,xe;const{prefix:o}=w.useScopedStyles(),l=a.useMemo(()=>Ty(o),[o]),{imageSize:s,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,b=t??[],S=ds(b.length),[L,f]=a.useState(S.activeIndex),[h,y]=a.useState(S.backgroundIndex),[E,I]=a.useState(!1),[T,X]=a.useState(!1),[k,B]=a.useState(null),[P,C]=a.useState(null),[z,v]=a.useState(0),[_,R]=a.useState(1),[Z,A]=a.useState("none"),[U,V]=a.useState("next"),[G,ne]=a.useState({}),[$,M]=a.useState({width:0,height:0}),N=a.useRef(null),Q=a.useRef(null),ie=!n||!!i,F=s??60,pe=Math.max(10,Math.min(100,d??F)),x=Math.max(10,Math.min(100,c??F)),se=Math.max(100,u),J=to(p),ye=a.useCallback(W=>{const ae=Ry(W?G[W]:void 0);return My($.width,$.height,ae,pe,x)},[$.height,$.width,G,x,pe]);a.useEffect(()=>{const W=Q.current;if(!W)return;const ae=new ResizeObserver(([te])=>{const{width:j,height:Y}=te.contentRect;M({width:j,height:Y})});return ae.observe(W),()=>ae.disconnect()},[]),a.useEffect(()=>{const W=(t??[]).map(ae=>{var te;return(te=ae.image)==null?void 0:te.url}).filter(ae=>!!ae);Ey(W,(ae,te)=>{ne(j=>{var Y,Re;return((Y=j[ae])==null?void 0:Y.width)===te.width&&((Re=j[ae])==null?void 0:Re.height)===te.height?j:{...j,[ae]:te}})})},[t]),a.useEffect(()=>{const{backgroundIndex:W,activeIndex:ae}=ds(b.length);f(ae),y(W),I(!1),X(!1),B(null),C(null),v(0),R(1),A("none"),V("next")},[b.length,t]),a.useEffect(()=>()=>{N.current&&clearTimeout(N.current)},[]);const Me=a.useCallback(W=>{var le,H,De,_e;if(!ie||E||b.length<=1)return;const ae=W==="next"?(L+1)%b.length:(L-1+b.length)%b.length,te=ye((H=(le=b[L])==null?void 0:le.image)==null?void 0:H.url),j=ye((_e=(De=b[ae])==null?void 0:De.image)==null?void 0:_e.url),Y=us($.width,$.height,te),Re=us($.width,$.height,j);N.current&&clearTimeout(N.current),V(W),X(!0),I(!0),W==="next"?(B(L),C(ae),v(0),R(1),A(to(p,0,1))):(y(Iy(ae,b.length)),B(ae),C(L),v(1),R(Re),A(to(p,1,Re))),requestAnimationFrame(()=>{X(!1),requestAnimationFrame(()=>{W==="next"?(v(1),R(Y),A(to(p,1,Y))):(v(0),R(1),A(to(p,0,1)))})}),N.current=setTimeout(()=>{W==="next"&&y(L),f(ae),B(null),C(null),I(!1)},se)},[L,p,$.height,$.width,ye,E,ie,b,se]),de=b[L],ce=h!==null?b[h]:null,q=k!==null?b[k]:null,ee=P!==null?b[P]:null,me=b.length<=1?0:(L-1+b.length)%b.length,Fe=b.length<=1?0:(L+1)%b.length,Ce=ye((Se=de==null?void 0:de.image)==null?void 0:Se.url),Ae=ye((D=q==null?void 0:q.image)==null?void 0:D.url),ue=ye((oe=ee==null?void 0:ee.image)==null?void 0:oe.url),fe={[`--${o}-transition-ms`]:`${se}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsxs("div",{ref:Q,className:ct(`${o}-wrapper`,T&&`${o}-snap`,n&&!i&&`${o}-editor`),style:fe,"aria-label":"Zoom gallery",children:[((he=ce==null?void 0:ce.image)==null?void 0:he.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:ce.image.url,alt:"",style:{filter:J}})}),E&&((be=q==null?void 0:q.image)==null?void 0:be.url)&&r.jsx("div",{className:ct(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${U}`),style:ps(Ae,_,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:q.image.url,alt:"",style:{filter:Z}})}),E&&((Ie=ee==null?void 0:ee.image)==null?void 0:Ie.url)&&r.jsx("div",{className:ct(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${U}`),style:ps(ue,z,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:ee.image.url,alt:""})}),!E&&((xe=de==null?void 0:de.image)==null?void 0:xe.url)&&r.jsx("div",{className:ct(`${o}-stage`,`${o}-foreground`),style:Wc(Ce),children:r.jsx("img",{className:`${o}-image`,src:de.image.url,alt:de.image.name??""})}),ie&&b.length>1&&!E&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:ct(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Me("prev"),"aria-label":`Show previous image (${me+1} of ${b.length})`}),r.jsx("button",{type:"button",className:ct(`${o}-nav`,`${o}-nav-next`),onClick:()=>Me("next"),"aria-label":`Show next image (${Fe+1} of ${b.length})`})]})]})]})}const ky=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
15741
15882
|
import cn from 'classnames';
|
|
15742
15883
|
import { CommonComponentProps } from '../props';
|
|
15743
15884
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16256,7 +16397,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
16256
16397
|
</>
|
|
16257
16398
|
);
|
|
16258
16399
|
}
|
|
16259
|
-
`,
|
|
16400
|
+
`,Ay={type:"object",version:1,settings:{sizing:"manual",properties:{maxWidth:{type:"number",scope:"common",title:"Max width (%)",display:{type:"percentage-input"},min:10,max:100},maxHeight:{type:"number",scope:"common",title:"Max height (%)",display:{type:"percentage-input"},min:10,max:100},transition:{type:"number",scope:"common",title:"Transition (ms)",display:{type:"common-numeric-input"},min:100,max:9999},bgImage:{type:"string",scope:"common",title:"BG image",display:{type:"toggle-cycle",enum:["greyscale","blur","as is"]}}},defaults:{maxWidth:60,maxHeight:60,transition:700,bgImage:"greyscale"},layout:["__componentName__","maxWidth","maxHeight","transition","bgImage"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["maxWidth","maxHeight"]},{type:"row",title:"",items:["transition","bgImage"]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",isObjectFitEditable:!1}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""}}]}},Fy={element:Py,id:"scale",name:"Scale",category:"galleries",version:1,defaultSize:{d:{width:920,height:540},m:{width:"100%",height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Scale.mp4"},schema:Ay,sourceCode:ky,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Wy={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},_y=["hover","active"],oa={left:"flex-start",center:"center",right:"flex-end"};function Ny(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Hy(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Oy(e){const t=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-box-shadow-color, transparent)`,n=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-inner-box-shadow-color, transparent)`,i=`${t}, ${n}`,o=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-hover-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,l=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-hover-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,s=`${o}, ${l}`,d=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-active-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,c=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-active-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,u=`${d}, ${c}`,p=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`,b=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,S=`.${e}-button:hover, ${b}`,L=f=>`.${e}-hover-effect-${f}:hover, .${e}-hover-effect-${f}:focus-visible, a:focus-visible .${e}-hover-effect-${f}`;return`
|
|
16260
16401
|
.${e}-root {
|
|
16261
16402
|
line-height: 0;
|
|
16262
16403
|
}
|
|
@@ -16286,11 +16427,11 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
16286
16427
|
.${e}-wrapper.${e}-editing .${e}-button {
|
|
16287
16428
|
transition: color 250ms, background-color 250ms, border-color 250ms, transform 250ms;
|
|
16288
16429
|
}
|
|
16289
|
-
${
|
|
16430
|
+
${L("scale-up")},
|
|
16290
16431
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-scale-up {
|
|
16291
16432
|
transform: scale(1.05);
|
|
16292
16433
|
}
|
|
16293
|
-
${
|
|
16434
|
+
${L("lift")},
|
|
16294
16435
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-lift {
|
|
16295
16436
|
transform: translateY(-2px);
|
|
16296
16437
|
box-shadow: ${p};
|
|
@@ -16352,9 +16493,9 @@ a:focus-visible .${e}-hover-effect-swipe::before,
|
|
|
16352
16493
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-swipe::before {
|
|
16353
16494
|
transform: translateX(0);
|
|
16354
16495
|
}
|
|
16355
|
-
${
|
|
16496
|
+
${L("reveal")},
|
|
16356
16497
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-reveal,
|
|
16357
|
-
${
|
|
16498
|
+
${L("swipe")},
|
|
16358
16499
|
.${e}-wrapper.${e}-state-hover .${e}-hover-effect-swipe {
|
|
16359
16500
|
background-color: var(--${e}-background-color);
|
|
16360
16501
|
}
|
|
@@ -16417,17 +16558,17 @@ a:focus-visible .${e}-hover-effect-content-roll .${e}-content-roll-layer-hover,
|
|
|
16417
16558
|
transform: translateY(-50%);
|
|
16418
16559
|
opacity: 1;
|
|
16419
16560
|
}
|
|
16420
|
-
${
|
|
16561
|
+
${S} {
|
|
16421
16562
|
background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
|
|
16422
16563
|
color: var(--${e}-hover-text-color, var(--${e}-text-color));
|
|
16423
16564
|
border-color: var(--${e}-hover-border-color, var(--${e}-border-color));
|
|
16424
|
-
box-shadow: ${
|
|
16565
|
+
box-shadow: ${s};
|
|
16425
16566
|
}
|
|
16426
16567
|
.${e}-wrapper.${e}-state-hover .${e}-button {
|
|
16427
16568
|
background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
|
|
16428
16569
|
color: var(--${e}-hover-text-color, var(--${e}-text-color));
|
|
16429
16570
|
border-color: var(--${e}-hover-border-color, var(--${e}-border-color));
|
|
16430
|
-
box-shadow: ${
|
|
16571
|
+
box-shadow: ${s};
|
|
16431
16572
|
}
|
|
16432
16573
|
.${e}-button:focus,
|
|
16433
16574
|
.${e}-button:focus-visible,
|
|
@@ -16496,7 +16637,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
16496
16637
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
16497
16638
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
16498
16639
|
}
|
|
16499
|
-
`}function
|
|
16640
|
+
`}function ra(e,t,n="",i,o){const l=t();return r.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[r.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:l}),r.jsxs("span",{className:`${e}-content-roll-viewport`,children:[r.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),r.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function ms(e,t,n="fill",i=100,o=0,l){if(!t)return null;const s=r.jsx(rn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return r.jsx("span",{className:`${e}-icon ${e}-icon-inline`,style:{[`--${e}-icon-scale`]:i/100},"aria-hidden":"true",children:s});if(n==="fixed"&&o>0){const d=w.scalingValue(o,l);return r.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:s})}return r.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:s})}function jy({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:l}=w.useScopedStyles(),s=a.useMemo(()=>Oy(l),[l]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:b,order:S="text-icon",gap:L=0,iconSize:f=0,iconWidthC:h=0,dimensions:y=!1,padding:E={top:0,right:0,bottom:0,left:0},cornerRadius:I=0,boxShadow:T={top:0,left:0,right:0,bottom:0},boxShadowColor:X="rgba(0, 0, 0, 0)",innerBoxShadow:k={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:B="rgba(0, 0, 0, 0)",stroke:P=0,backgroundColor:C="#000000",textColor:z="#ffffff",borderColor:v="#ffffff",iconColor:_="#ffffff",hoverEffect:R="none",fontFamily:Z,fontSettings:A,fontSize:U,lineHeight:V,letterSpacing:G=0,wordSpacing:ne=0,textAppearance:$,stateOverrides:M,minWidth:N=0,minHeight:Q=0,width:ie=0,height:F=0}=e,pe=w.buildColorVars(l,{backgroundColor:C,textColor:z,borderColor:v,iconColor:_,boxShadowColor:X,innerBoxShadowColor:B},Wy,_y,M),x=i&&i!=="default"?`${l}-state-${i}`:"",se=t&&!n?`${l}-editing`:"",J=R!=="none"&&(!t||n||i==="hover")?`${l}-hover-effect-${R}`:"",ye=R==="reveal"||R==="swipe",Me=R==="content-roll",de=R==="reveal"&&(!t||n),ce=y===!0,ee=d==="a"?b??p:p,me=d==="c",Fe=d!=="b",Ce={fontSettings:{fontFamily:Z,fontWeight:(A==null?void 0:A.fontWeight)??400,fontStyle:(A==null?void 0:A.fontStyle)??"normal"},fontSize:U??.01,lineHeight:V,letterSpacing:G,wordSpacing:ne,textAppearance:$,color:z},ue={...Fe?on(Vt(Ce,t)):{},[`--${l}-box-shadow-x`]:w.scalingValue(T.left,t),[`--${l}-box-shadow-y`]:w.scalingValue(T.top,t),[`--${l}-box-shadow-blur`]:w.scalingValue(T.right,t),[`--${l}-box-shadow-spread`]:w.scalingValue(T.bottom,t),[`--${l}-inner-box-shadow-x`]:w.scalingValue(k.left,t),[`--${l}-inner-box-shadow-y`]:w.scalingValue(k.top,t),[`--${l}-inner-box-shadow-blur`]:w.scalingValue(k.right,t),[`--${l}-inner-box-shadow-spread`]:w.scalingValue(k.bottom,t),paddingTop:w.scalingValue(E.top,t),paddingRight:w.scalingValue(E.right,t),paddingBottom:w.scalingValue(E.bottom,t),paddingLeft:w.scalingValue(E.left,t),borderRadius:w.scalingValue(I,t),borderWidth:w.scalingValue(P,t),...me?{}:{justifyContent:oa[ee],textAlign:ee},...me&&!Me?{gap:w.scalingValue(L,t)}:{},...ce?{width:w.scalingValue(ie,t),height:w.scalingValue(F,t)}:{minWidth:w.scalingValue(N,t),minHeight:w.scalingValue(Q,t),...me?{width:"100%"}:{}}};let fe;const Se={display:"inline-flex",alignItems:"center",justifyContent:me?oa[ee]:oa[d==="a"?ee:"center"],gap:me?w.scalingValue(L,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:ee}:{}};if(d==="b"){const he=()=>ms(l,u,f>0?"fixed":"fill",100,f,t);fe=Me?ra(l,he,`${l}-icon-roll`,void 0,Se):he()}else if(d==="c"){const he=()=>{const be=r.jsx("span",{className:`${l}-text`,style:{textAlign:ee},children:c}),Ie=ms(l,u,h>0?"fixed":"fill",100,h,t);return S==="icon-text"?r.jsxs(r.Fragment,{children:[Ie,be]}):r.jsxs(r.Fragment,{children:[be,Ie]})};fe=Me?ra(l,he,`${l}-icon-text-roll`,void 0,Se):he()}else fe=Me?ra(l,()=>c,`${l}-label-roll`,void 0,Se):ye?r.jsx("span",{className:`${l}-button-inner`,children:c}):c;const D=de?he=>Ny(he,l):void 0,oe=de?he=>Hy(he,l):void 0;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsx("div",{className:`${l}-root`,style:pe,children:r.jsx("div",{className:`${l}-wrapper ${x} ${se}`.trim(),children:r.jsx("div",{className:`${l}-button ${J}`.trim(),style:ue,onMouseEnter:D,onMouseLeave:oe,role:"button",tabIndex:o||t&&!n?void 0:0,children:fe})})})]})}const Dy=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
16500
16641
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
16501
16642
|
import { CommonComponentProps } from '../props';
|
|
16502
16643
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -17123,7 +17264,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
17123
17264
|
</>
|
|
17124
17265
|
);
|
|
17125
17266
|
}
|
|
17126
|
-
`,Ny={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Hy=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],Oy={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"Background Default",titleByState:{default:"Background Default",hover:"Background Hover",active:"Background Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...Ny.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...Hy],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},Dy={element:Wy,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:Oy,sourceCode:_y,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function jy(e){return`
|
|
17267
|
+
`,zy={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},By=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],Vy={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},backgroundColor:{type:"string",scope:"common",title:"Background Default",titleByState:{default:"Background Default",hover:"Background Hover",active:"Background Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...zy.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...By],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},Gy={element:jy,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:Vy,sourceCode:Dy,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function qy(e){return`
|
|
17127
17268
|
.${e}-titles-row {
|
|
17128
17269
|
position: relative;
|
|
17129
17270
|
flex: 0 1 auto;
|
|
@@ -17321,7 +17462,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
17321
17462
|
pointer-events: auto;
|
|
17322
17463
|
flex-shrink: 0;
|
|
17323
17464
|
}
|
|
17324
|
-
`}const Cn=500,Qi=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",zy=72,By=50,Vy=1e4,Gy=650,qy=500;function Uy(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Pc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=dr(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function Ky(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Pc(i,n):null}function Xy(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.url&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function no(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function gl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return no(e,i,n)}const Yy=.03;function Ac(e){return e.width*Yy}const ra={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Uo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function hl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Zy(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function $a(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function Jy(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:$a(e,t.width,t.height)}function Qy(e,t){if(kr(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function ev(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.url)||t.has(o.url)||(t.add(o.url),n.push(o))}return n}function tv({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>kr(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Bi(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Ac(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function gr(e,t,n){const i=Bi(e,t,n);return{...i,left:2*i.left-e.left}}function nv(e,t,n){const{left:i,width:o}=n,s=Ac(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function Fc(e,t,n,i){const o=Bi(e,"left",i),s=Bi(e,"right",i),l=gr(e,"left",i),d=gr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function iv(e,t,n,i){const{start:o,end:s}=Fc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function ov(e,t,n){const i=Bi(e,t,n),o=gr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function kr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function rv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Ko({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return kr(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function av({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:w,sourceRect:v,resolveCloseSourceRect:T,onClose:g,onPrev:$,onNext:f}){const R=a.useRef(null),L=a.useRef(null),I=a.useRef(null),Y=a.useRef(new Map),[P,V]=a.useState(0),M=a.useRef(null),C=a.useRef(0),A=a.useRef(0),y=a.useRef("none"),S=a.useRef(!1),F=a.useRef(!1),W=a.useRef(!1),U=a.useRef(null),G=a.useRef(null),J=a.useRef(null),D=a.useRef(()=>{}),j=a.useRef(null),O=a.useRef(null),E=a.useRef(null),K=a.useRef(!1),[Z,ce]=a.useState(null),[N,pe]=a.useState(ra),[b,he]=a.useState(0),[Q,we]=a.useState("opening"),[Te,se]=a.useState(0),[oe,q]=a.useState(0),[de,ge]=a.useState(!1),[_e,Ce]=a.useState(null),[Me,fe]=a.useState(null),[ye,Se]=a.useState(null),[B,ue]=a.useState(!1),[ve,me]=a.useState(null),[Ee,be]=a.useState(!1),k=a.useRef(!1),[re,te]=a.useState(!1),[z,le]=a.useState(!1),Re=a.useRef(n),ae=a.useRef(void 0),_=t[n],Ne=_?kr(_):!1,Fe=oe!==0||de,et=!l&&(!s||!!d),Ke=c&&!l,Ie=u.length>1,ee=a.useCallback((h,xe)=>t.length<=1?null:t[(h+xe+t.length)%t.length]??null,[t]),ne=Ie?no(u,p,-1):ee(n,-1),He=Ie?no(u,p,1):ee(n,1),st=_e===-1&&Fe?Ie&&Me!==null?no(u,Me,-1):ye!==null?ee(ye,-1):null:null,Be=_e===1&&Fe?Ie&&Me!==null?no(u,Me,1):ye!==null?ee(ye,1):null:null,Oe=st&&st.url!==(ne==null?void 0:ne.url)?st:null,je=Be&&Be.url!==(He==null?void 0:He.url)?Be:null,qe=ne&&Ke?(()=>{const h=Ie?gl(u,p,-1):t.length>2?ee((n-1+t.length)%t.length,-1):null;return h&&h.url!==ne.url?h:null})():null,tt=He&&Ke?(()=>{const h=Ie?gl(u,p,1):t.length>2?ee((n+1)%t.length,1):null;return h&&h.url!==He.url?h:null})():null,mt=Oe??qe,St=je??tt,lt=a.useCallback((h,xe,Pe)=>{if(!h||!xe||!Pe)return;const Ae=Y.current,at=Ae.get(h);(at==null?void 0:at.width)===xe&&(at==null?void 0:at.height)===Pe||(Ae.set(h,{width:xe,height:Pe}),V(At=>At+1))},[]),pt=a.useCallback(h=>{if(!(h!=null&&h.url))return null;const xe=Y.current.get(h.url);return Jy(L.current,xe)},[P,b]),Mt=a.useCallback(()=>{if(!_)return;const h=pt(_);if(h){ce(h);return}const xe=L.current;xe&&ce(hl(xe))},[_,pt]),nt=a.useCallback(h=>{if(Ie){const xe=u.length;fe((p+h+xe)%xe),Se(null);return}t.length>1&&(Se((n+h+t.length)%t.length),fe(null))},[Ie,u.length,p,t.length,n]),Ve=a.useCallback(h=>{W.current=h,ge(h)},[]),De=a.useCallback(()=>{U.current!==null&&(window.clearTimeout(U.current),U.current=null)},[]),vt=a.useCallback(()=>{De(),U.current=window.setTimeout(()=>{De(),Ve(!1)},Qi+32)},[De,Ve]),bt=a.useCallback(()=>{const h=R.current;if(!h){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:ra.width,height:typeof window<"u"?window.innerHeight:ra.height});return}const xe=h.getBoundingClientRect();pe({left:xe.left,top:xe.top,width:xe.width,height:xe.height})},[]),Pt=a.useCallback((h,xe)=>{if(Fe){if(re&&!de)return`translate(${oe}px, 0px)`;if(de&&_e!==null){const Pe=pt(h);if(!Pe)return;const{x:Ae,y:at}=iv(Pe,xe,_e,N);return`translate(${Ae}px, ${at}px)`}if(de)return"translate(0px, 0px)"}},[Fe,re,de,oe,_e,N,pt]),Dt=a.useCallback(()=>{const h=G.current;G.current=null,De(),Ve(!1),Ce(null),fe(null),Se(null),q(0),te(!1),S.current=!1,A.current=0,y.current="none",h===-1?$():h===1&&f()},[De,Ve,$,f]),tn=a.useCallback(()=>{De(),U.current=window.setTimeout(()=>{G.current!==null&&Dt()},Qi+32)},[De,Dt]),ln=a.useCallback(()=>{De(),G.current=null,Ve(!1),Ce(null),fe(null),Se(null),q(0),te(!1),S.current=!1,A.current=0,y.current="none"},[De,Ve]),Tt=a.useCallback(h=>{if(!(!Ke||!Z)){if(W.current){if(G.current===h){J.current=h,Dt();return}ln()}De(),nt(h),G.current=h,Ce(h),Ve(!0),tn()}},[Ke,Z,Dt,ln,De,nt,Ve,tn]);D.current=Tt;const kt=a.useCallback(()=>{j.current=null,K.current=!1,O.current!==null&&(window.clearInterval(O.current),O.current=null),E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),Yt=a.useCallback(h=>{O.current!==null&&window.clearInterval(O.current);const xe=K.current?qy:Gy;O.current=window.setInterval(()=>{D.current(h)},xe)},[]),qt=a.useCallback(h=>{j.current!==h&&(kt(),j.current=h,K.current=!1,D.current(h),Yt(h),E.current=window.setTimeout(()=>{E.current=null,j.current===h&&(K.current=!0,Yt(h))},Vy))},[kt,Yt]),Le=a.useCallback(()=>{const h=L.current;if(!h)return;const xe=_==null?void 0:_.url,Pe=xe?Y.current.get(xe):void 0;if(Pe!=null&&Pe.width&&(Pe!=null&&Pe.height)){ce($a(h,Pe.width,Pe.height));return}const Ae=I.current;if(Ae&&xe&&(Ae.src===xe||Ae.currentSrc===xe)){const{width:At,height:Qe}=Zy(Ae);if(At&&Qe){lt(xe,At,Qe),ce($a(h,At,Qe));return}}const at=hl(h);!at.width||!at.height||ce(at)},[_==null?void 0:_.url,lt]),Ue=a.useCallback(h=>{if(I.current=h,!!h){if(h instanceof HTMLVideoElement){h.readyState>=1&&h.videoWidth>0&&Le();return}h.complete&&h.naturalWidth>0&&Le()}},[Le]),Xe=a.useCallback(()=>{bt(),Le(),he(h=>h+1)},[bt,Le]);a.useEffect(()=>{Xe();const h=L.current,xe=R.current,Pe=new ResizeObserver(()=>Xe());return h&&Pe.observe(h),xe&&Pe.observe(xe),window.addEventListener("resize",Xe),()=>{Pe.disconnect(),window.removeEventListener("resize",Xe)}},[Xe,n,w]),a.useLayoutEffect(()=>{if(!_)return;const h=I.current;if(h){if(h instanceof HTMLImageElement&&h.complete&&h.naturalWidth>0){Le();return}h instanceof HTMLVideoElement&&h.readyState>=1&&h.videoWidth>0&&Le()}},[_==null?void 0:_.url,n,Le]),a.useEffect(()=>{Mt()},[Mt,P]),a.useEffect(()=>{const h=new Set,xe=[],Pe=Ae=>{!(Ae!=null&&Ae.url)||h.has(Ae.url)||(h.add(Ae.url),xe.push(Ae))};t.forEach(Pe),u.forEach(Ae=>Ae.items.forEach(Pe)),xe.forEach(Ae=>{Y.current.has(Ae.url)||Qy(Ae,lt)})},[t,u,lt]),a.useEffect(()=>{if(Q!=="opening"||!Z)return;if(!v){we("open");return}ue(!1);const h=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ue(!0),we("open")})});return()=>cancelAnimationFrame(h)},[Q,Z,v]),a.useEffect(()=>{if(Q!=="closing")return;const h=setTimeout(()=>g(),Cn);return()=>clearTimeout(h)},[Q,g]),a.useEffect(()=>()=>{De()},[De]),a.useLayoutEffect(()=>{Re.current===n&&ae.current===(_==null?void 0:_.url)||(De(),G.current=null,Ce(null),fe(null),Se(null),se(0),q(0),Ve(!1),le(!1),te(!1),C.current=0,A.current=0,y.current="none",S.current=!1,M.current=null,F.current=!1,I.current=null,Mt(),Re.current=n,ae.current=_==null?void 0:_.url)},[n,_==null?void 0:_.url,Ve,De,Mt]),a.useLayoutEffect(()=>{const h=J.current;h!==null&&(J.current=null,requestAnimationFrame(()=>{D.current(h)}))},[n,p,_==null?void 0:_.url]),a.useLayoutEffect(()=>{if(Q==="opening"){k.current=!1,be(!1);return}if(Q!=="open"||k.current)return;if(!ne&&!He){k.current=!0;return}be(!1);const h=requestAnimationFrame(()=>{requestAnimationFrame(()=>{be(!0),k.current=!0})});return()=>cancelAnimationFrame(h)},[Q,ne==null?void 0:ne.url,He==null?void 0:He.url]),a.useEffect(()=>{if(Q!=="open")return;const h=()=>{const Qe=gt=>{gt.stopPropagation(),gt.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},xe=Qe=>{const gt=Qe<0?1:-1;De(),nt(gt),G.current=gt,Ce(gt),Ve(!0),tn()},Pe=Qe=>{if(Math.abs(Qe)>By&&Ke){xe(Qe);return}G.current=null,Ce(null),fe(null),Se(null),Ve(!0),q(0),vt()},Ae=Qe=>{if(Qe.touches.length!==1||W.current)return;const gt=Qe.touches[0];F.current=!0,M.current={x:gt.clientX,y:gt.clientY},y.current="none",A.current=0,S.current=!1},at=Qe=>{if(!M.current||Qe.touches.length!==1||W.current)return;const gt=Qe.touches[0],_t=gt.clientX-M.current.x,Et=gt.clientY-M.current.y;if(y.current==="none"){if(Math.abs(_t)<10&&Math.abs(Et)<10)return;if(Math.abs(_t)>Math.abs(Et)){if(!Ke)return;y.current="horizontal"}else if(Et>0){if(!et)return;y.current="vertical"}else return}if(y.current==="horizontal"){S.current=!0,te(!0),A.current=_t,q(_t),Qe.preventDefault();return}y.current==="vertical"&&(S.current=!0,te(!0),C.current=Et,se(Et),Qe.preventDefault())},At=()=>{if(!M.current)return;const Qe=y.current,gt=S.current;if(gt&&Qe==="horizontal")Pe(A.current),h();else if(gt&&Qe==="vertical"){const _t=C.current;if(et&&_t>zy){const Et=window.innerHeight;C.current=Et,le(!0),se(Et),we("closing")}else C.current=0,se(0);h()}else Qe==="horizontal"&&Math.abs(A.current)>0&&(Pe(A.current),h());M.current=null,y.current="none",A.current=0,S.current=!1,te(!1)};return document.addEventListener("touchstart",Ae,{passive:!0}),document.addEventListener("touchmove",at,{passive:!1}),document.addEventListener("touchend",At),document.addEventListener("touchcancel",At),()=>{document.removeEventListener("touchstart",Ae),document.removeEventListener("touchmove",at),document.removeEventListener("touchend",At),document.removeEventListener("touchcancel",At)}},[Q,Ke,Ve,vt,De,et,tn,nt]);const ct=a.useCallback(()=>{const h=(T==null?void 0:T())??v??null;h&&Z&&(me(h),ue(!0)),we("closing")},[T,v,Z]);a.useEffect(()=>{const h=Ae=>{if(Ae.key==="Escape"){if(s&&d||Q==="closing")return;kt(),ct();return}if(Ae.key!=="ArrowLeft"&&Ae.key!=="ArrowRight"||Q!=="open"||!Ke)return;Ae.preventDefault();const at=Ae.key==="ArrowLeft"?-1:1;Ae.repeat&&j.current===at||qt(at)},xe=Ae=>{if(Ae.key!=="ArrowLeft"&&Ae.key!=="ArrowRight")return;const at=Ae.key==="ArrowLeft"?-1:1;j.current===at&&kt()},Pe=()=>{kt()};return window.addEventListener("keydown",h),window.addEventListener("keyup",xe),window.addEventListener("blur",Pe),()=>{window.removeEventListener("keydown",h),window.removeEventListener("keyup",xe),window.removeEventListener("blur",Pe),kt()}},[Q,s,d,ct,Ke,qt,kt]),a.useEffect(()=>{Q!=="open"&&kt()},[Q,kt]);const Rt=()=>{Q==="closing"||l||ct()},ut=Q==="open",it=Q==="closing",Ut=Te>0?Math.max(0,1-Te/500):1,Ze=Te>0?Math.max(.35,1-Te/500):1,Je=a.useCallback(h=>{if(!(h.propertyName!=="transform"||!W.current)){if(G.current!==null){Dt();return}De(),Ve(!1)}},[De,Ve,Dt]),rt=Q==="closing"?ve??v:v,Lt=rt&&Z&&(Q==="opening"||it)?Uy(rt,Z):void 0,It=Fe&&_?Pt(_,"center"):Te>0?`translateY(${Te}px)`:Lt,ft=Z?Uo(Z,N):null,Ft=!!(rt&&Z),Ot=Ft&&(Q==="closing"||Q==="open"&&B),Ht={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:It,opacity:Te>0?Ze:Ft?1:Q==="opening"||it?0:1,transition:re&&!de?"none":de?`transform ${Qi}ms ${pn}`:z?`transform ${Cn}ms ${pn}, opacity ${Cn}ms ${pn}`:Ot?`transform ${Cn}ms ${pn}`:Q==="opening"||it?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:Ne&&ut&&!Fe?"auto":"none",touchAction:Ne&&ut?"none":void 0,zIndex:1,overflow:Ne?"hidden":void 0},Vt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:ut&&!Fe?"auto":"none"},xt=(h,xe,Pe="adjacent")=>{const Ae=pt(h);if(!Ae)return{display:"none"};const at=Pe==="far"?xe==="left"?"far-left":"far-right":xe==="left"?"left-adjacent":"right-adjacent",{start:At}=_e!==null?Fc(Ae,at,_e,N):{start:Pe==="far"?gr(Ae,xe,N):Bi(Ae,xe,N)},Qe=Uo(At,N),gt=Pt(h,at),_t=!Fe&&Pe==="adjacent"&&ut&&!Ee?ov(Ae,xe,N):null,Et=Pe==="far"&&Fe&&_e===(xe==="left"?-1:1),cn=re&&!de?!1:de,dn=Pe==="adjacent"&&ut&&Ee&&!Fe;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:gt??(_t?`translate(${_t.x}px, ${_t.y}px)`:void 0),opacity:Pe==="far"?ut&&Et?1:0:ut?1:0,transition:cn?Pe==="far"?`transform ${Qi}ms ${pn}`:`transform ${Qi}ms ${pn}, opacity ${Cn}ms ${pn}`:dn?`transform ${Cn}ms ${pn}`:Q==="opening"||it?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Gt=(h,xe)=>{const Pe=pt(h);return Pe?nv(Bi(Pe,xe,N),xe,N):null},Kt=h=>xe=>{if(!l){if(F.current){F.current=!1;return}xe.stopPropagation(),Tt(h)}},Xt=ne?Gt(ne,"left"):null,Zt=He?Gt(He,"right"):null,jt=Xt?Uo(Xt,N):null,wt=Zt?Uo(Zt,N):null;return r.jsxs("div",{ref:R,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:Rt,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:ut?Ut:0,transition:re?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:L,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:ut?1:0,transition:re?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"},children:r.jsx(gc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:Rt})})]}),ut&&mt&&r.jsx(Ko,{media:mt,style:xt(mt,"left","far"),onMeasure:lt,onTransitionEnd:Je},`far-prev-${mt.url}`),ut&&ne&&r.jsxs(r.Fragment,{children:[r.jsx(Ko,{media:ne,style:xt(ne,"left"),onMeasure:lt,onTransitionEnd:Je},`prev-${ne.url}`),jt&&r.jsx("div",{style:{position:"absolute",top:jt.top,left:jt.left,width:jt.width,height:jt.height,cursor:l||re?"default":"pointer",pointerEvents:l||re?"none":"auto",zIndex:3},onClick:Kt(-1)})]}),ut&&He&&r.jsxs(r.Fragment,{children:[r.jsx(Ko,{media:He,style:xt(He,"right"),onMeasure:lt,onTransitionEnd:Je},`next-${He.url}`),wt&&r.jsx("div",{style:{position:"absolute",top:wt.top,left:wt.left,width:wt.width,height:wt.height,cursor:l||re?"default":"pointer",pointerEvents:l||re?"none":"auto",zIndex:3},onClick:Kt(1)})]}),ut&&St&&r.jsx(Ko,{media:St,style:xt(St,"right","far"),onMeasure:lt,onTransitionEnd:Je},`far-next-${St.url}`),Z&&_&&(Ne?r.jsx(rv,{src:_.url,phase:Q,onMediaElement:Ue,wrapperStyle:Ht,videoStyle:Vt,onLoadedMetadata:Le,onTransitionEnd:Je},`${n}-${_.url}`):r.jsx("img",{ref:Ue,src:_.url,alt:_.name,onLoad:Le,onTransitionEnd:Je,style:Ht},`${n}-${_.url}`))]})}const sv=20,lv=.18;function cv(e){return`
|
|
17465
|
+
`}const Cn=500,no=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Uy=72,Ky=50,Xy=1e4,Yy=650,Zy=500;function Jy(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,l=e.top-t.top;return`translate(${o}px, ${l}px) scale(${n}, ${i})`}function _c(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=ur(e);return{left:i.x,top:i.y,width:i.width,height:i.height}}const n=e.getBoundingClientRect();return{left:n.left,top:n.top,width:n.width,height:n.height}}function Qy(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?_c(i,n):null}function ev(e){return e.reduce((t,n,i)=>{var o;return(o=n.image)!=null&&o.url&&t.push({gridIndex:i,items:[n.image],entry:{title1:n.title??"",title2:n.subtitle??"",title3:n.caption??""}}),t},[])}function ro(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function gs(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ro(e,i,n)}const tv=.03;function Nc(e){return e.width*tv}const aa={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Xo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function hs(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function nv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ca(e,t,n){const i=e.getBoundingClientRect(),o=i.width,l=i.height,s=t/n,d=o/l;if(s>d){const u=o/s;return{width:o,height:u,left:i.left,top:i.top+(l-u)/2}}const c=l*s;return{width:c,height:l,left:i.left+(o-c)/2,top:i.top}}function iv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ca(e,t.width,t.height)}function ov(e,t){if(kr(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function rv(e){const t=new Set,n=[];for(const i of e){const o=i.image;!(o!=null&&o.url)||t.has(o.url)||(t.add(o.url),n.push(o))}return n}function av({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>kr(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function qi(e,t,n){const{width:i,height:o,top:l}=e,{left:s,width:d}=n,c=Nc(n);return t==="left"?{left:s+c-i,top:l,width:i,height:o}:{left:s+d-c,top:l,width:i,height:o}}function hr(e,t,n){const i=qi(e,t,n);return{...i,left:2*i.left-e.left}}function lv(e,t,n){const{left:i,width:o}=n,l=Nc(n);return t==="left"?{left:i,top:e.top,width:l,height:e.height}:{left:i+o-l,top:e.top,width:l,height:e.height}}function Hc(e,t,n,i){const o=qi(e,"left",i),l=qi(e,"right",i),s=hr(e,"left",i),d=hr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:l,end:e};case"left-adjacent":return{start:o,end:s};case"far-right":return{start:d,end:l};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:l};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:l,end:d};case"far-left":return{start:s,end:o};default:return{start:e,end:e}}}function sv(e,t,n,i){const{start:o,end:l}=Hc(e,t,n,i);return{x:l.left-o.left,y:l.top-o.top}}function cv(e,t,n){const i=qi(e,t,n),o=hr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function kr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function dv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:l,onTransitionEnd:s}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:s,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:l,onClick:c=>c.stopPropagation(),style:o},e)})}function Yo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return kr(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const l=o.currentTarget;l.videoWidth>0&&l.videoHeight>0&&(i==null||i(e.url,l.videoWidth,l.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const l=o.currentTarget;l.naturalWidth>0&&l.naturalHeight>0&&(i==null||i(e.url,l.naturalWidth,l.naturalHeight))},onTransitionEnd:n})}function uv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:S,resolveCloseSourceRect:L,onClose:f,onPrev:h,onNext:y}){const E=a.useRef(null),I=a.useRef(null),T=a.useRef(null),X=a.useRef(new Map),[k,B]=a.useState(0),P=a.useRef(null),C=a.useRef(0),z=a.useRef(0),v=a.useRef("none"),_=a.useRef(!1),R=a.useRef(!1),Z=a.useRef(!1),A=a.useRef(null),U=a.useRef(null),V=a.useRef(null),G=a.useRef(()=>{}),ne=a.useRef(null),$=a.useRef(null),M=a.useRef(null),N=a.useRef(!1),[Q,ie]=a.useState(null),[F,pe]=a.useState(aa),[x,se]=a.useState(0),[J,ye]=a.useState("opening"),[Me,de]=a.useState(0),[ce,q]=a.useState(0),[ee,me]=a.useState(!1),[Fe,Ce]=a.useState(null),[Ae,ue]=a.useState(null),[fe,Se]=a.useState(null),[D,oe]=a.useState(!1),[he,be]=a.useState(null),[Ie,xe]=a.useState(!1),W=a.useRef(!1),[ae,te]=a.useState(!1),[j,Y]=a.useState(!1),Re=a.useRef(n),le=a.useRef(void 0),H=t[n],De=H?kr(H):!1,_e=ce!==0||ee,tt=!s&&(!l||!!d),Qe=c&&!s,at=u.length>1,$e=a.useCallback((g,ve)=>t.length<=1?null:t[(g+ve+t.length)%t.length]??null,[t]),ge=at?ro(u,p,-1):$e(n,-1),je=at?ro(u,p,1):$e(n,1),vt=Fe===-1&&_e?at&&Ae!==null?ro(u,Ae,-1):fe!==null?$e(fe,-1):null:null,Ye=Fe===1&&_e?at&&Ae!==null?ro(u,Ae,1):fe!==null?$e(fe,1):null:null,Oe=vt&&vt.url!==(ge==null?void 0:ge.url)?vt:null,Le=Ye&&Ye.url!==(je==null?void 0:je.url)?Ye:null,He=ge&&Qe?(()=>{const g=at?gs(u,p,-1):t.length>2?$e((n-1+t.length)%t.length,-1):null;return g&&g.url!==ge.url?g:null})():null,Xe=je&&Qe?(()=>{const g=at?gs(u,p,1):t.length>2?$e((n+1)%t.length,1):null;return g&&g.url!==je.url?g:null})():null,ut=Oe??He,xt=Le??Xe,it=a.useCallback((g,ve,ke)=>{if(!g||!ve||!ke)return;const Ee=X.current,ot=Ee.get(g);(ot==null?void 0:ot.width)===ve&&(ot==null?void 0:ot.height)===ke||(Ee.set(g,{width:ve,height:ke}),B(At=>At+1))},[]),wt=a.useCallback(g=>{if(!(g!=null&&g.url))return null;const ve=X.current.get(g.url);return iv(I.current,ve)},[k,x]),lt=a.useCallback(()=>{if(!H)return;const g=wt(H);if(g){ie(g);return}const ve=I.current;ve&&ie(hs(ve))},[H,wt]),Ue=a.useCallback(g=>{if(at){const ve=u.length;ue((p+g+ve)%ve),Se(null);return}t.length>1&&(Se((n+g+t.length)%t.length),ue(null))},[at,u.length,p,t.length,n]),Ke=a.useCallback(g=>{Z.current=g,me(g)},[]),Ne=a.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[]),pt=a.useCallback(()=>{Ne(),A.current=window.setTimeout(()=>{Ne(),Ke(!1)},no+32)},[Ne,Ke]),mt=a.useCallback(()=>{const g=E.current;if(!g){pe({left:0,top:0,width:typeof window<"u"?window.innerWidth:aa.width,height:typeof window<"u"?window.innerHeight:aa.height});return}const ve=g.getBoundingClientRect();pe({left:ve.left,top:ve.top,width:ve.width,height:ve.height})},[]),gt=a.useCallback((g,ve)=>{if(_e){if(ae&&!ee)return`translate(${ce}px, 0px)`;if(ee&&Fe!==null){const ke=wt(g);if(!ke)return;const{x:Ee,y:ot}=sv(ke,ve,Fe,F);return`translate(${Ee}px, ${ot}px)`}if(ee)return"translate(0px, 0px)"}},[_e,ae,ee,ce,Fe,F,wt]),Pt=a.useCallback(()=>{const g=U.current;U.current=null,Ne(),Ke(!1),Ce(null),ue(null),Se(null),q(0),te(!1),_.current=!1,z.current=0,v.current="none",g===-1?h():g===1&&y()},[Ne,Ke,h,y]),Zt=a.useCallback(()=>{Ne(),A.current=window.setTimeout(()=>{U.current!==null&&Pt()},no+32)},[Ne,Pt]),tn=a.useCallback(()=>{Ne(),U.current=null,Ke(!1),Ce(null),ue(null),Se(null),q(0),te(!1),_.current=!1,z.current=0,v.current="none"},[Ne,Ke]),Tt=a.useCallback(g=>{if(!(!Qe||!Q)){if(Z.current){if(U.current===g){V.current=g,Pt();return}tn()}Ne(),Ue(g),U.current=g,Ce(g),Ke(!0),Zt()}},[Qe,Q,Pt,tn,Ne,Ue,Ke,Zt]);G.current=Tt;const Ct=a.useCallback(()=>{ne.current=null,N.current=!1,$.current!==null&&(window.clearInterval($.current),$.current=null),M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),Ft=a.useCallback(g=>{$.current!==null&&window.clearInterval($.current);const ve=N.current?Zy:Yy;$.current=window.setInterval(()=>{G.current(g)},ve)},[]),Ot=a.useCallback(g=>{ne.current!==g&&(Ct(),ne.current=g,N.current=!1,G.current(g),Ft(g),M.current=window.setTimeout(()=>{M.current=null,ne.current===g&&(N.current=!0,Ft(g))},Xy))},[Ct,Ft]),Te=a.useCallback(()=>{const g=I.current;if(!g)return;const ve=H==null?void 0:H.url,ke=ve?X.current.get(ve):void 0;if(ke!=null&&ke.width&&(ke!=null&&ke.height)){ie(Ca(g,ke.width,ke.height));return}const Ee=T.current;if(Ee&&ve&&(Ee.src===ve||Ee.currentSrc===ve)){const{width:At,height:Je}=nv(Ee);if(At&&Je){it(ve,At,Je),ie(Ca(g,At,Je));return}}const ot=hs(g);!ot.width||!ot.height||ie(ot)},[H==null?void 0:H.url,it]),Be=a.useCallback(g=>{if(T.current=g,!!g){if(g instanceof HTMLVideoElement){g.readyState>=1&&g.videoWidth>0&&Te();return}g.complete&&g.naturalWidth>0&&Te()}},[Te]),qe=a.useCallback(()=>{mt(),Te(),se(g=>g+1)},[mt,Te]);a.useEffect(()=>{qe();const g=I.current,ve=E.current,ke=new ResizeObserver(()=>qe());return g&&ke.observe(g),ve&&ke.observe(ve),window.addEventListener("resize",qe),()=>{ke.disconnect(),window.removeEventListener("resize",qe)}},[qe,n,b]),a.useLayoutEffect(()=>{if(!H)return;const g=T.current;if(g){if(g instanceof HTMLImageElement&&g.complete&&g.naturalWidth>0){Te();return}g instanceof HTMLVideoElement&&g.readyState>=1&&g.videoWidth>0&&Te()}},[H==null?void 0:H.url,n,Te]),a.useEffect(()=>{lt()},[lt,k]),a.useEffect(()=>{const g=new Set,ve=[],ke=Ee=>{!(Ee!=null&&Ee.url)||g.has(Ee.url)||(g.add(Ee.url),ve.push(Ee))};t.forEach(ke),u.forEach(Ee=>Ee.items.forEach(ke)),ve.forEach(Ee=>{X.current.has(Ee.url)||ov(Ee,it)})},[t,u,it]),a.useEffect(()=>{if(J!=="opening"||!Q)return;if(!S){ye("open");return}oe(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{oe(!0),ye("open")})});return()=>cancelAnimationFrame(g)},[J,Q,S]),a.useEffect(()=>{if(J!=="closing")return;const g=setTimeout(()=>f(),Cn);return()=>clearTimeout(g)},[J,f]),a.useEffect(()=>()=>{Ne()},[Ne]),a.useLayoutEffect(()=>{Re.current===n&&le.current===(H==null?void 0:H.url)||(Ne(),U.current=null,Ce(null),ue(null),Se(null),de(0),q(0),Ke(!1),Y(!1),te(!1),C.current=0,z.current=0,v.current="none",_.current=!1,P.current=null,R.current=!1,T.current=null,lt(),Re.current=n,le.current=H==null?void 0:H.url)},[n,H==null?void 0:H.url,Ke,Ne,lt]),a.useLayoutEffect(()=>{const g=V.current;g!==null&&(V.current=null,requestAnimationFrame(()=>{G.current(g)}))},[n,p,H==null?void 0:H.url]),a.useLayoutEffect(()=>{if(J==="opening"){W.current=!1,xe(!1);return}if(J!=="open"||W.current)return;if(!ge&&!je){W.current=!0;return}xe(!1);const g=requestAnimationFrame(()=>{requestAnimationFrame(()=>{xe(!0),W.current=!0})});return()=>cancelAnimationFrame(g)},[J,ge==null?void 0:ge.url,je==null?void 0:je.url]),a.useEffect(()=>{if(J!=="open")return;const g=()=>{const Je=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Je,!0)};document.addEventListener("click",Je,!0)},ve=Je=>{const ft=Je<0?1:-1;Ne(),Ue(ft),U.current=ft,Ce(ft),Ke(!0),Zt()},ke=Je=>{if(Math.abs(Je)>Ky&&Qe){ve(Je);return}U.current=null,Ce(null),ue(null),Se(null),Ke(!0),q(0),pt()},Ee=Je=>{if(Je.touches.length!==1||Z.current)return;const ft=Je.touches[0];R.current=!0,P.current={x:ft.clientX,y:ft.clientY},v.current="none",z.current=0,_.current=!1},ot=Je=>{if(!P.current||Je.touches.length!==1||Z.current)return;const ft=Je.touches[0],Nt=ft.clientX-P.current.x,Et=ft.clientY-P.current.y;if(v.current==="none"){if(Math.abs(Nt)<10&&Math.abs(Et)<10)return;if(Math.abs(Nt)>Math.abs(Et)){if(!Qe)return;v.current="horizontal"}else if(Et>0){if(!tt)return;v.current="vertical"}else return}if(v.current==="horizontal"){_.current=!0,te(!0),z.current=Nt,q(Nt),Je.preventDefault();return}v.current==="vertical"&&(_.current=!0,te(!0),C.current=Et,de(Et),Je.preventDefault())},At=()=>{if(!P.current)return;const Je=v.current,ft=_.current;if(ft&&Je==="horizontal")ke(z.current),g();else if(ft&&Je==="vertical"){const Nt=C.current;if(tt&&Nt>Uy){const Et=window.innerHeight;C.current=Et,Y(!0),de(Et),ye("closing")}else C.current=0,de(0);g()}else Je==="horizontal"&&Math.abs(z.current)>0&&(ke(z.current),g());P.current=null,v.current="none",z.current=0,_.current=!1,te(!1)};return document.addEventListener("touchstart",Ee,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",At),document.addEventListener("touchcancel",At),()=>{document.removeEventListener("touchstart",Ee),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",At),document.removeEventListener("touchcancel",At)}},[J,Qe,Ke,pt,Ne,tt,Zt,Ue]);const st=a.useCallback(()=>{const g=(L==null?void 0:L())??S??null;g&&Q&&(be(g),oe(!0)),ye("closing")},[L,S,Q]);a.useEffect(()=>{const g=Ee=>{if(Ee.key==="Escape"){if(l&&d||J==="closing")return;Ct(),st();return}if(Ee.key!=="ArrowLeft"&&Ee.key!=="ArrowRight"||J!=="open"||!Qe)return;Ee.preventDefault();const ot=Ee.key==="ArrowLeft"?-1:1;Ee.repeat&&ne.current===ot||Ot(ot)},ve=Ee=>{if(Ee.key!=="ArrowLeft"&&Ee.key!=="ArrowRight")return;const ot=Ee.key==="ArrowLeft"?-1:1;ne.current===ot&&Ct()},ke=()=>{Ct()};return window.addEventListener("keydown",g),window.addEventListener("keyup",ve),window.addEventListener("blur",ke),()=>{window.removeEventListener("keydown",g),window.removeEventListener("keyup",ve),window.removeEventListener("blur",ke),Ct()}},[J,l,d,st,Qe,Ot,Ct]),a.useEffect(()=>{J!=="open"&&Ct()},[J,Ct]);const kt=()=>{J==="closing"||s||st()},dt=J==="open",nt=J==="closing",qt=Me>0?Math.max(0,1-Me/500):1,St=Me>0?Math.max(.35,1-Me/500):1,Ve=a.useCallback(g=>{if(!(g.propertyName!=="transform"||!Z.current)){if(U.current!==null){Pt();return}Ne(),Ke(!1)}},[Ne,Ke,Pt]),et=J==="closing"?he??S:S,It=et&&Q&&(J==="opening"||nt)?Jy(et,Q):void 0,Lt=_e&&H?gt(H,"center"):Me>0?`translateY(${Me}px)`:It,ht=Q?Xo(Q,F):null,Dt=!!(et&&Q),_t=Dt&&(J==="closing"||J==="open"&&D),jt={position:"absolute",top:ht==null?void 0:ht.top,left:ht==null?void 0:ht.left,width:ht==null?void 0:ht.width,height:ht==null?void 0:ht.height,objectFit:"contain",transformOrigin:"top left",transform:Lt,opacity:Me>0?St:Dt?1:J==="opening"||nt?0:1,transition:ae&&!ee?"none":ee?`transform ${no}ms ${pn}`:j?`transform ${Cn}ms ${pn}, opacity ${Cn}ms ${pn}`:_t?`transform ${Cn}ms ${pn}`:J==="opening"||nt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:De&&dt&&!_e?"auto":"none",touchAction:De&&dt?"none":void 0,zIndex:1,overflow:De?"hidden":void 0},Ut={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:dt&&!_e?"auto":"none"},$t=(g,ve,ke="adjacent")=>{const Ee=wt(g);if(!Ee)return{display:"none"};const ot=ke==="far"?ve==="left"?"far-left":"far-right":ve==="left"?"left-adjacent":"right-adjacent",{start:At}=Fe!==null?Hc(Ee,ot,Fe,F):{start:ke==="far"?hr(Ee,ve,F):qi(Ee,ve,F)},Je=Xo(At,F),ft=gt(g,ot),Nt=!_e&&ke==="adjacent"&&dt&&!Ie?cv(Ee,ve,F):null,Et=ke==="far"&&_e&&Fe===(ve==="left"?-1:1),cn=ae&&!ee?!1:ee,dn=ke==="adjacent"&&dt&&Ie&&!_e;return{position:"absolute",top:Je.top,left:Je.left,width:Je.width,height:Je.height,objectFit:"contain",transform:ft??(Nt?`translate(${Nt.x}px, ${Nt.y}px)`:void 0),opacity:ke==="far"?dt&&Et?1:0:dt?1:0,transition:cn?ke==="far"?`transform ${no}ms ${pn}`:`transform ${no}ms ${pn}, opacity ${Cn}ms ${pn}`:dn?`transform ${Cn}ms ${pn}`:J==="opening"||nt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},en=(g,ve)=>{const ke=wt(g);return ke?lv(qi(ke,ve,F),ve,F):null},Kt=g=>ve=>{if(!s){if(R.current){R.current=!1;return}ve.stopPropagation(),Tt(g)}},Yt=ge?en(ge,"left"):null,Xt=je?en(je,"right"):null,zt=Yt?Xo(Yt,F):null,Bt=Xt?Xo(Xt,F):null;return r.jsxs("div",{ref:E,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:"",s?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:J==="open"?"none":void 0},onClick:kt,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:dt?qt:0,transition:ae?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:I,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:dt?1:0,transition:ae?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"},children:r.jsx(vc,{prefix:e,entry:i,settings:o,isEditor:l,isEditMode:s,isPreviewMode:d,onClose:kt})})]}),dt&&ut&&r.jsx(Yo,{media:ut,style:$t(ut,"left","far"),onMeasure:it,onTransitionEnd:Ve},`far-prev-${ut.url}`),dt&&ge&&r.jsxs(r.Fragment,{children:[r.jsx(Yo,{media:ge,style:$t(ge,"left"),onMeasure:it,onTransitionEnd:Ve},`prev-${ge.url}`),zt&&r.jsx("div",{style:{position:"absolute",top:zt.top,left:zt.left,width:zt.width,height:zt.height,cursor:s||ae?"default":"pointer",pointerEvents:s||ae?"none":"auto",zIndex:3},onClick:Kt(-1)})]}),dt&&je&&r.jsxs(r.Fragment,{children:[r.jsx(Yo,{media:je,style:$t(je,"right"),onMeasure:it,onTransitionEnd:Ve},`next-${je.url}`),Bt&&r.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:s||ae?"default":"pointer",pointerEvents:s||ae?"none":"auto",zIndex:3},onClick:Kt(1)})]}),dt&&xt&&r.jsx(Yo,{media:xt,style:$t(xt,"right","far"),onMeasure:it,onTransitionEnd:Ve},`far-next-${xt.url}`),Q&&H&&(De?r.jsx(dv,{src:H.url,phase:J,onMediaElement:Be,wrapperStyle:jt,videoStyle:Ut,onLoadedMetadata:Te,onTransitionEnd:Ve},`${n}-${H.url}`):r.jsx("img",{ref:Be,src:H.url,alt:H.name,onLoad:Te,onTransitionEnd:Ve,style:jt},`${n}-${H.url}`))]})}const pv=20,mv=.18;function gv(e){return`
|
|
17325
17466
|
.${e}-wrapper {
|
|
17326
17467
|
box-sizing: border-box;
|
|
17327
17468
|
max-width: 100%;
|
|
@@ -17408,8 +17549,8 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
17408
17549
|
z-index: 2;
|
|
17409
17550
|
pointer-events: auto;
|
|
17410
17551
|
}
|
|
17411
|
-
${
|
|
17412
|
-
`}function
|
|
17552
|
+
${qy(e)}
|
|
17553
|
+
`}function hv(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,l]=n.split(":").map(Number),s=i?l:o,d=i?o:l;return d>0?s/d:1}function fv(e){const t=e instanceof HTMLVideoElement?e.videoWidth:e.naturalWidth,n=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight;return!t||!n?null:t/n}function yv(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:w.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:w.scalingValue(i*mv,n??!1),[`--${t}-image-aspect`]:hv(e)}}function vv(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.07,lineHeight:e==null?void 0:e.titleLineHeight,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,color:(e==null?void 0:e.titleColor)??"#000000"};return Vt(n,t)}function xv(e){var o;const t=((o=e==null?void 0:e.imageDisplay)==null?void 0:o.display)==="cover",n=((e==null?void 0:e.lightbox)??"on")==="on",i={objectFit:t?"cover":"contain",pointerEvents:"auto",...n?{cursor:"pointer"}:null};return{objectFitMode:t?"cover":"contain",imageStyle:i}}function bv(e,t,n,i,o,l){if(!(!e||!t))return s=>{var c;const d=((c=s.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(s.currentTarget instanceof HTMLImageElement||s.currentTarget instanceof HTMLVideoElement?s.currentTarget:null);l(n,d?_c(d,o):void 0)}}function wv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:l,portalId:s}){const{prefix:d}=w.useScopedStyles(),c=a.useMemo(()=>gv(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",b=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,S=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,L=w.scalingValue(S,n??!1),f=`max(${L}, ${pv}px)`,{objectFitMode:h,imageStyle:y}=xv(e),E=vv(e,n),I=a.useRef(null),[T,X]=a.useState(!1),[k,B]=a.useState([]),[P,C]=a.useState(0),[z,v]=a.useState(0),[_,R]=a.useState(null),[Z,A]=a.useState({title1:"",title2:"",title3:""}),U=(!n||i)&&!T,V=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},G=V.sizeType??"none",ne=U&&G!=="none"?`${d}-item-image-hover-${G}`:void 0,$=(V.value??120)/100,M=a.useCallback(ce=>{!ce||G!=="scale"||(ce.style.transformOrigin=qp(ce))},[G]),N=a.useCallback(ce=>{if(ce){if(h==="contain"){const q=fv(ce);if(q){const ee=ce.closest(`.${d}-item-image`);ee instanceof HTMLElement&&ee.style.setProperty(`--${d}-item-media-aspect`,String(q))}}M(ce)}},[d,M,h]),Q={width:w.scalingValue(b,n??!1),...E,...yv(e,d,n),[`--${d}-image-hover-scale`]:String($)},ie=(()=>{const ce={},q=I.current?getComputedStyle(I.current).getPropertyValue("--cntrl-article-width").trim():"";return q&&(ce["--cntrl-article-width"]=q),ce})(),F=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),pe=a.useMemo(()=>ev(u),[u]),x=a.useMemo(()=>rv(u),[u]),se=(ce,q)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const ee=pe.findIndex(Fe=>Fe.gridIndex===ce);if(ee<0)return;const me=pe[ee];v(ee),B(me.items),C(0),A(me.entry),R(q??null),X(!0)},J=a.useCallback(()=>{X(!1),R(null)},[]),ye=a.useCallback(()=>{const ce=pe[z];return!ce||!I.current?_:Qy(I.current,ce.gridIndex,h)??_},[pe,z,_,h]),Me=a.useCallback(ce=>{if(pe.length>1){const q=pe.length,ee=(z+ce+q)%q,me=pe[ee];v(ee),B(me.items),C(0),A(me.entry);return}C(q=>(q+ce+k.length)%k.length)},[pe,z,k.length]),de=pe.length>1||k.length>1;return a.useEffect(()=>{if(!T||typeof document>"u")return;const ce=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ce}},[T]),a.useEffect(()=>{!n||o||i||X(!1)},[n,o,i]),a.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&X(!1)},[e==null?void 0:e.lightbox]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),r.jsx(av,{mediaList:x}),r.jsx("div",{ref:I,className:`${d}-wrapper ${d}-type-${p}`,style:Q,children:u.map((ce,q)=>{var Fe,Ce;const ee=!!((Fe=ce.image)!=null&&Fe.url),me=bv(!!F,ee,q,d,h,se);return r.jsxs("div",{className:`${d}-item`,children:[ce.title?r.jsx("span",{className:`${d}-item-title`,onClick:me,style:me?{cursor:"pointer"}:void 0,children:ce.title}):null,(Ce=ce.image)!=null&&Ce.url?r.jsx("span",{className:[`${d}-item-image`,h==="contain"?`${d}-item-image-fit`:void 0,ne].filter(Boolean).join(" "),children:ce.image.type==="video"?r.jsx("video",{ref:N,src:ce.image.url,"data-waterfall-index":q,style:y,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:me,onLoadedData:Ae=>N(Ae.currentTarget)}):r.jsx("img",{ref:N,src:ce.image.url,alt:ce.image.name??"","data-waterfall-index":q,style:y,onClick:me,onLoad:Ae=>N(Ae.currentTarget)})}):null,q<u.length-1&&r.jsx("div",{className:`${d}-item-gap-host`,style:{width:L},children:o&&!T&&r.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${d}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:f,height:"100%"}})})]},q)})}),T&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const ce=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx("div",{style:ie,"data-selection":"none",children:r.jsx(uv,{prefix:d,items:k,index:P,entry:Z,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:de,lightboxEntries:pe,entryIdx:z,layoutId:l,sourceRect:_,resolveCloseSourceRect:ye,onClose:J,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),ce)})()]})}const Sv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17413
17554
|
import type React from 'react';
|
|
17414
17555
|
import { createPortal } from 'react-dom';
|
|
17415
17556
|
import { CommonComponentProps } from '../props';
|
|
@@ -17923,7 +18064,7 @@ export function Waterfall({
|
|
|
17923
18064
|
</>
|
|
17924
18065
|
);
|
|
17925
18066
|
}
|
|
17926
|
-
`,vv="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),jn={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 xv(e){const t={};return t[Ye(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSettings")]={...jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ye(e,"fontSize")]={...jn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ye(e,"lineHeight")]={...jn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ye(e,"letterSpacing")]={...jn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ye(e,"wordSpacing")]={...jn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ye(e,"textAlign")]={...jn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ye(e,"textAppearance")]={...jn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Vi=Kn.filter(e=>e!=="count"),bv=Vi.reduce((e,t)=>({...e,...xv(t)}),{}),wv=Vi.reduce((e,t)=>({...e,[Ye(t,"fontFamily")]:"Arial",[Ye(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ye(t,"letterSpacing")]:0,[Ye(t,"wordSpacing")]:0,[Ye(t,"textAlign")]:"left",[Ye(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function aa(e){return Vi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ye(n,"fontSize")]=i),o!==void 0&&(t[Ye(n,"lineHeight")]=o),t},{})}const Sv={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Vi.map(e=>[Ya[e],Za(e)]))},Xo={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},$v=[{title:"Salton Sea from Above",...Xo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Xo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Xo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Xo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],Cv={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}},required:["image"]},default:$v},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageHoverEffect:{type:"object",scope:"common",title:"Hover",display:{type:"toggle-cycle-numeric-input",enum:["none","scale","saturate"],inputs:{none:"none",scale:"single",saturate:"none"},defaultValue:120,showDash:!1},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},horizontalGap:{type:"number",scope:"layout",title:"Gutter",min:0,display:{type:"range-control"}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title1Color:{type:"string",scope:"common",title:"Title Lightbox",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Lightbox",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Lightbox",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},...bv},defaults:{type:"a",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightbox:"on",imageHoverEffect:{sizeType:"none",value:120,min:100,max:200},titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:vv,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...wv},layoutDefaults:{d:{wrapperWidth:1,horizontalGap:.006944,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,titleFontSize:.0625,titleLineHeight:.05555,titleLetterSpacing:-34722e-8,...aa({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},m:{wrapperWidth:1,horizontalGap:.026666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,titleFontSize:.16,titleLineHeight:.13333,...aa({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{wrapperWidth:1,horizontalGap:.01302,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.03906,iconMarginRight:.026,titleFontSize:.07,titleLineHeight:.07,...aa({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","type","wrapperWidth","imageDisplay","lightbox","imageHoverEffect","horizontalGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["wrapperWidth","lightbox"]},{type:"row",title:"Image",items:["imageDisplay","imageHoverEffect"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{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:"Lightbox",items:[Sv]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},Tv={element:fv,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},...Vi.map(e=>({path:`${Ye(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...Vi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ye(t,"fontFamily")}`}),{})},schema:Cv,sourceCode:yv},ki=500,Wc="cubic-bezier(0.25, 1, 0.5, 1)",Lv=300,Iv=5,Rv=.15,Ev=.4,Mv=100,wi=100,fl={color:"#000000",hover:"#cccccc"},eo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},kv={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},sa={offset:{x:0,y:0},linkColor:"#cccccc"},yl={sizeType:"drag",value:3},Pv="left";function Av(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:Pv,color:(e==null?void 0:e.titleColor)??"#000000"};return zt(n,t)}function Si(e,t,n){return`${e}: ${x.scalingValue(t/1440,n)};`}function lo(e,t){return t<=0?0:(e%t+t)%t}function Fv(e,t,n,i){if(!i)return{position:lo(e+t,n),skipTransition:!1};const o=e+t;return o>=0&&o<=n+1?{position:o,skipTransition:!1}:{position:lo(e-1+t,n)+1,skipTransition:!0}}function Wv(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function _v(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,w)=>{n.style.transform=`translate(${p}px, ${w}px)`;const v=n.getBoundingClientRect();return{x:v.left,y:v.top}},o=i(0,0),s=i(wi,0),l=i(0,wi);e.removeChild(n);const d={x:(s.x-o.x)/wi,y:(s.y-o.y)/wi},c={x:(l.x-o.x)/wi,y:(l.y-o.y)/wi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function Nv(e,t,n){const{ex:i,ey:o,det:s}=e;return{x:(t*o.y-n*o.x)/s,y:(i.x*n-i.y*t)/s}}function Hv(e,t){return`
|
|
18067
|
+
`,$v="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),Dn={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",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 Cv(e){const t={};return t[Ze(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSettings")]={...Dn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ze(e,"fontSize")]={...Dn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ze(e,"lineHeight")]={...Dn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ze(e,"letterSpacing")]={...Dn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ze(e,"wordSpacing")]={...Dn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ze(e,"textAlign")]={...Dn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ze(e,"textAppearance")]={...Dn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ui=Kn.filter(e=>e!=="count"),Tv=Ui.reduce((e,t)=>({...e,...Cv(t)}),{}),Lv=Ui.reduce((e,t)=>({...e,[Ze(t,"fontFamily")]:"Arial",[Ze(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ze(t,"letterSpacing")]:0,[Ze(t,"wordSpacing")]:0,[Ze(t,"textAlign")]:"left",[Ze(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function la(e){return Ui.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ze(n,"fontSize")]=i),o!==void 0&&(t[Ze(n,"lineHeight")]=o),t},{})}const Iv={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ui.map(e=>[Ya[e],Za(e)]))},Zo={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},Rv=[{title:"Salton Sea from Above",...Zo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Zo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Zo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Zo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],Mv={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},subtitle:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},caption:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,defaultObjectFit:"cover",type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}},required:["image"]},default:Rv},settings:{sizing:"auto auto",properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},imageHoverEffect:{type:"object",scope:"common",title:"Hover",display:{type:"toggle-cycle-numeric-input",enum:["none","scale","saturate"],inputs:{none:"none",scale:"single",saturate:"none"},defaultValue:120,showDash:!1},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},horizontalGap:{type:"number",scope:"layout",title:"Gutter",min:0,display:{type:"range-control"}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},titleColor:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title1Color:{type:"string",scope:"common",title:"Title Lightbox",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Lightbox",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Lightbox",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Dn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},...Tv},defaults:{type:"a",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightbox:"on",imageHoverEffect:{sizeType:"none",value:120,min:100,max:200},titleColor:"#000000",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:$v,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...Lv},layoutDefaults:{d:{wrapperWidth:1,horizontalGap:.006944,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,titleFontSize:.0625,titleLineHeight:.05555,titleLetterSpacing:-34722e-8,...la({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})},m:{wrapperWidth:1,horizontalGap:.026666,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,titleFontSize:.16,titleLineHeight:.13333,...la({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{wrapperWidth:1,horizontalGap:.01302,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.03906,iconMarginRight:.026,titleFontSize:.07,titleLineHeight:.07,...la({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})}},layout:["__componentName__","type","wrapperWidth","imageDisplay","lightbox","imageHoverEffect","horizontalGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["wrapperWidth","lightbox"]},{type:"row",title:"Image",items:["imageDisplay","imageHoverEffect"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{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:"Lightbox",items:[Iv]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},Ev={element:wv,id:"waterfall",name:"Waterfall",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/waterfall.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},...Ui.map(e=>({path:`${Ze(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...Ui.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ze(t,"fontFamily")}`}),{})},schema:Mv,sourceCode:Sv},Fi=500,Oc="cubic-bezier(0.25, 1, 0.5, 1)",Pv=300,kv=5,Av=.15,Fv=.4,Wv=100,$i=100,fs={color:"#000000",hover:"#cccccc"},io={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},_v={s:{paddingY:5,paddingActive:5,borderRadius:9,dot:4,activeDot:8,gapInactive:9,inset:5},m:{paddingY:7,paddingActive:7,borderRadius:17,dot:8,activeDot:20,gapInactive:22,inset:7},l:{paddingY:10,paddingActive:10,borderRadius:29,dot:20,activeDot:38,gapInactive:26,inset:10}},sa={offset:{x:0,y:0},linkColor:"#cccccc"},ys={sizeType:"drag",value:3},Nv="left";function Hv(e,t){var i,o;const n={fontSettings:{fontFamily:(e==null?void 0:e.titleFontFamily)??"Arial",fontWeight:((i=e==null?void 0:e.titleFontSettings)==null?void 0:i.fontWeight)??400,fontStyle:((o=e==null?void 0:e.titleFontSettings)==null?void 0:o.fontStyle)??"normal"},fontSize:(e==null?void 0:e.titleFontSize)??.02,lineHeight:(e==null?void 0:e.titleLineHeight)??.02,letterSpacing:(e==null?void 0:e.titleLetterSpacing)??0,wordSpacing:(e==null?void 0:e.titleWordSpacing)??0,textAppearance:e==null?void 0:e.titleTextAppearance,textAlign:Nv,color:(e==null?void 0:e.titleColor)??"#000000"};return Vt(n,t)}function Ci(e,t,n){return`${e}: ${w.scalingValue(t/1440,n)};`}function uo(e,t){return t<=0?0:(e%t+t)%t}function Ov(e,t,n,i){if(!i)return{position:uo(e+t,n),skipTransition:!1};const o=e+t;return o>=0&&o<=n+1?{position:o,skipTransition:!1}:{position:uo(e-1+t,n)+1,skipTransition:!0}}function jv(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function Dv(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,b)=>{n.style.transform=`translate(${p}px, ${b}px)`;const S=n.getBoundingClientRect();return{x:S.left,y:S.top}},o=i(0,0),l=i($i,0),s=i(0,$i);e.removeChild(n);const d={x:(l.x-o.x)/$i,y:(l.y-o.y)/$i},c={x:(s.x-o.x)/$i,y:(s.y-o.y)/$i},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function zv(e,t,n){const{ex:i,ey:o,det:l}=e;return{x:(t*o.y-n*o.x)/l,y:(i.x*n-i.y*t)/l}}function Bv(e,t){return`
|
|
17927
18068
|
.${e}-wrapper {
|
|
17928
18069
|
position: relative;
|
|
17929
18070
|
width: 100%;
|
|
@@ -17995,7 +18136,7 @@ export function Waterfall({
|
|
|
17995
18136
|
top: 0;
|
|
17996
18137
|
left: 0;
|
|
17997
18138
|
opacity: 0;
|
|
17998
|
-
transition: opacity ${
|
|
18139
|
+
transition: opacity ${Fi}ms ${Oc};
|
|
17999
18140
|
}
|
|
18000
18141
|
.${e}-list-fade .${e}-slide.${e}-is-active {
|
|
18001
18142
|
opacity: 1;
|
|
@@ -18022,29 +18163,29 @@ export function Waterfall({
|
|
|
18022
18163
|
top: 50%;
|
|
18023
18164
|
z-index: 1;
|
|
18024
18165
|
padding: 0;
|
|
18025
|
-
${
|
|
18026
|
-
${
|
|
18166
|
+
${Ci("width",30,t)}
|
|
18167
|
+
${Ci("height",30,t)}
|
|
18027
18168
|
transition: opacity 0.15s ease-in-out;
|
|
18028
18169
|
}
|
|
18029
18170
|
.${e}-arrow-prev {
|
|
18030
|
-
${
|
|
18171
|
+
${Ci("left",-20,t)}
|
|
18031
18172
|
transform: translate3d(-50%, -50%, 0);
|
|
18032
18173
|
}
|
|
18033
18174
|
.${e}-arrow-next {
|
|
18034
18175
|
left: unset;
|
|
18035
|
-
${
|
|
18176
|
+
${Ci("right",-20,t)}
|
|
18036
18177
|
transform: translate3d(50%, -50%, 0);
|
|
18037
18178
|
}
|
|
18038
18179
|
.${e}-arrow-prev-vertical {
|
|
18039
18180
|
left: 50%;
|
|
18040
|
-
${
|
|
18181
|
+
${Ci("top",-20,t)}
|
|
18041
18182
|
transform: translate3d(-50%, -50%, 0);
|
|
18042
18183
|
}
|
|
18043
18184
|
.${e}-arrow-next-vertical {
|
|
18044
18185
|
left: 50%;
|
|
18045
18186
|
right: unset;
|
|
18046
18187
|
top: unset;
|
|
18047
|
-
${
|
|
18188
|
+
${Ci("bottom",-20,t)}
|
|
18048
18189
|
transform: translate3d(-50%, 50%, 0);
|
|
18049
18190
|
}
|
|
18050
18191
|
.${e}-arrow-hidden {
|
|
@@ -18180,10 +18321,10 @@ export function Waterfall({
|
|
|
18180
18321
|
object-fit: cover;
|
|
18181
18322
|
}
|
|
18182
18323
|
.${e}-transition-reveal .${e}-slide.${e}-is-active .${e}-slider-image {
|
|
18183
|
-
animation: ${e}-reveal-horizontal ${
|
|
18324
|
+
animation: ${e}-reveal-horizontal ${Fi}ms ease;
|
|
18184
18325
|
}
|
|
18185
18326
|
.${e}-transition-reveal-vertical .${e}-slide.${e}-is-active .${e}-slider-image {
|
|
18186
|
-
animation: ${e}-reveal-vertical ${
|
|
18327
|
+
animation: ${e}-reveal-vertical ${Fi}ms ease;
|
|
18187
18328
|
}
|
|
18188
18329
|
@keyframes ${e}-reveal-horizontal {
|
|
18189
18330
|
from { clip-path: inset(0 100% 0 0); }
|
|
@@ -18193,7 +18334,7 @@ export function Waterfall({
|
|
|
18193
18334
|
from { clip-path: inset(100% 0 0 0); }
|
|
18194
18335
|
to { clip-path: inset(0 0 0 0); }
|
|
18195
18336
|
}
|
|
18196
|
-
`}function Ov({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:s}=x.useScopedStyles(),l=Av(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??yl,p=u.sizeType??"drag",w=u.value??yl.value,v=(e==null?void 0:e.direction)??"horizontal",T=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",$=(e==null?void 0:e.navSize)??"m",f=kv[$],R=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,L=ee=>x.scalingValue(ee*R,n),I=(e==null?void 0:e.show)??"always",Y=(e==null?void 0:e.controls)??null,P=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,V=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,M=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,C=(e==null?void 0:e.controlsColor)??fl.color,A=(e==null?void 0:e.controlsHoverColor)??fl.hover,y=(e==null?void 0:e.navColor)??eo.colors.inactive,S=(e==null?void 0:e.navPaginationColor)??eo.colors.pagination,F=(e==null?void 0:e.navBackgroundColor)??eo.colors.background,W=(e==null?void 0:e.linkColor)??sa.linkColor,U=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,G=v==="horizontal",J=p==="click",D=p==="drag",j=p==="auto"&&(!n||!!i),O=!n,E=T==="slide",K=g==="classic",Z=I!=="never",ce=I==="on hover",N=x.scalingValue(P,n),pe={width:N,height:N,maxWidth:N},b=E&&c>1,[he,Q]=a.useState(0),[we,Te]=a.useState(b?1:0),[se,oe]=a.useState(!1),[q,de]=a.useState(!1),[ge,_e]=a.useState(!1),[Ce,Me]=a.useState(0),[fe,ye]=a.useState(!1),[Se,B]=a.useState(!1),ue=a.useRef(!1),ve=a.useRef(we);ve.current=we;const me=a.useRef(null),Ee=a.useRef(null),be=a.useRef(null),k=a.useRef(null),re=a.useCallback(ee=>{ue.current=ee,oe(ee)},[]),te=a.useCallback(ee=>{if(c<2||ee===0)return;const ne=ee>0?1:-1,He=Math.abs(ee);if(ye(!0),re(!0),Q(Oe=>lo(Oe+ee,c)),!E)return;let st=ve.current,Be=!1;for(let Oe=0;Oe<He;Oe++){const je=Fv(st,ne,c,b);st=je.position,Be||(Be=je.skipTransition)}ve.current=st,Be&&de(!0),Te(st)},[c,b,E,re]),z=a.useCallback(ee=>{te(ee)},[te]),le=a.useCallback(ee=>{if(c<2)return;const ne=lo(ee,c);if(!(ne===he&&!ue.current)&&(ye(!0),re(!0),Q(ne),E)){const He=ne+(b?1:0);ve.current=He,Te(He)}},[he,c,b,E,re]);a.useEffect(()=>{if(!se)return;const ee=window.setTimeout(()=>{if(b&&(we===0||we===c+1)){de(!0),Te(he+1);return}re(!1)},ki);return()=>window.clearTimeout(ee)},[he,c,b,se,re,we]),a.useEffect(()=>{if(!q)return;let ee=0;const ne=requestAnimationFrame(()=>{ee=requestAnimationFrame(()=>{de(!1),re(!1)})});return()=>{cancelAnimationFrame(ne),cancelAnimationFrame(ee)}},[re,q]);const Re=`${b}:${c}`,ae=a.useRef(Re);a.useEffect(()=>{if(ae.current===Re)return;ae.current=Re;const ee=c>0?Math.min(he,c-1):0;be.current=null,k.current=null,_e(!1),Me(0),Q(ee),de(!0),Te(ee+(b?1:0))},[he,c,b,Re]),a.useEffect(()=>{if(!fe)return;const ee=window.setTimeout(()=>ye(!1),Lv);return()=>window.clearTimeout(ee)},[fe,he]),a.useEffect(()=>{if(!j||c<2)return;const ee=Math.max(w,.1)*1e3,ne=window.setInterval(()=>{O&&Se||z(1)},ee);return()=>window.clearInterval(ne)},[w,c,z,j,Se,O]);const _=a.useCallback(ee=>{const ne=be.current;if(!ne||ne.pointerId!==ee.pointerId)return;be.current=null,k.current=null;const He=me.current;if(He!=null&&He.hasPointerCapture(ee.pointerId)&&He.releasePointerCapture(ee.pointerId),!ne.isActive){E&&Me(0);return}_e(!1),Me(0);const Be=!(ee.timeStamp-ne.lastTime>Mv)&&Math.abs(ne.velocity)>Ev,Oe=ne.size>0&&Math.abs(ne.offset-ne.baseOffset)>ne.size*Rv;if(!Be&&!Oe)return;const je=Oe?ne.offset-ne.baseOffset:ne.velocity;let qe=1;Oe&&ne.size>0&&(qe=Math.max(1,Math.round(Math.abs(je)/ne.size))),te(je<0?qe:-qe)},[te,E]);a.useEffect(()=>{const ee=ne=>{k.current===null||ne.pointerId!==k.current||_(ne)};return window.addEventListener("pointerup",ee),window.addEventListener("pointercancel",ee),()=>{window.removeEventListener("pointerup",ee),window.removeEventListener("pointercancel",ee)}},[_]);const Ne=ee=>{const ne=me.current;if(!D||c<2||!ne||ee.pointerType==="mouse"&&ee.button!==0)return;ue.current&&re(!1);let He=0;const st=Ee.current;if(E&&st){const Be=G?st.offsetWidth:st.offsetHeight;Be>0&&(He=Wv(st,G)+ve.current*Be,Me(He))}ne.setPointerCapture(ee.pointerId),k.current=ee.pointerId,be.current={pointerId:ee.pointerId,startClientX:ee.clientX,startClientY:ee.clientY,axes:_v(ne,`${s}-axis-probe`),size:G?ne.offsetWidth:ne.offsetHeight,isActive:!1,baseOffset:He,offset:He,lastTime:ee.timeStamp,velocity:0}},Fe=ee=>{const ne=be.current;if(!ne||ne.pointerId!==ee.pointerId)return;if(ee.pointerType==="mouse"&&ee.buttons===0){_(ee);return}const He=ee.clientX-ne.startClientX,st=ee.clientY-ne.startClientY,Be=ne.axes?Nv(ne.axes,He,st):{x:He,y:st},Oe=G?Be.x:Be.y,je=G?Be.y:Be.x,qe=ne.baseOffset+Oe;if(!ne.isActive){if(Math.max(Math.abs(Oe),Math.abs(je))<Iv)return;if(Math.abs(je)>Math.abs(Oe)){const mt=me.current;mt!=null&&mt.hasPointerCapture(ne.pointerId)&&mt.releasePointerCapture(ne.pointerId),be.current=null,k.current=null,E&&Me(0);return}ne.isActive=!0,_e(!0)}const tt=ee.timeStamp-ne.lastTime;tt>0&&(ne.velocity=(qe-ne.offset)/tt,ne.lastTime=ee.timeStamp),ne.offset=qe,E&&Me(qe)},et=ee=>{_(ee)},Ke=G?`translate3d(calc(${-we*100}% + ${Ce}px), 0, 0)`:`translate3d(0, calc(${-we*100}% + ${Ce}px), 0)`,Ie=b?[d[c-1],...d,d[0]]:d;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Hv(s,n)}}),r.jsxs("div",{className:dt(`${s}-wrapper`,{[`${s}-transition-reveal`]:T==="reveal",[`${s}-transition-reveal-vertical`]:T==="reveal"&&!G}),onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1),children:[r.jsxs("div",{className:`${s}-slider-inner`,style:{backgroundColor:"transparent"},children:[r.jsx("div",{ref:me,className:dt(`${s}-track`,{[`${s}-track-draggable`]:D,[`${s}-track-draggable-vertical`]:D&&!G}),onPointerDown:Ne,onPointerMove:Fe,onPointerUp:et,onPointerCancel:et,onLostPointerCapture:ee=>{k.current===ee.pointerId&&_(ee)},children:r.jsx("div",{ref:Ee,className:dt(`${s}-list`,{[`${s}-list-slide`]:E,[`${s}-list-slide-vertical`]:E&&!G,[`${s}-list-fade`]:!E}),style:E?{transform:Ke,transition:ge||q?"none":`transform ${ki}ms ${Wc}`}:void 0,children:Ie.map((ee,ne)=>{const He=b?lo(ne-1,c):ne,Be=b&&(ne===0||ne===c+1)?`clone-${ne===0?"start":"end"}`:`slide-${He}`;return r.jsx("div",{className:dt(`${s}-slide`,{[`${s}-is-active`]:!E&&He===he}),children:r.jsx("div",{className:`${s}-slider-item`,children:r.jsx("div",{className:`${s}-img-wrapper`,children:r.jsx("img",{className:dt(`${s}-slider-image`,{[`${s}-contain`]:ee.image.objectFit==="contain",[`${s}-cover`]:ee.image.objectFit==="cover"}),src:ee.image.url,alt:ee.image.name??"",draggable:!1})})})},Be)})})}),Z&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:dt(`${s}-arrow`,{[`${s}-arrow-prev`]:G,[`${s}-arrow-prev-vertical`]:!G,[`${s}-hover-arrow`]:ce}),style:{color:C,"--arrow-hover-color":A,...pe},children:r.jsxs("button",{onClick:ee=>{ee.stopPropagation(),z(-1)},className:`${s}-arrow-inner`,style:{transform:`translate(${x.scalingValue(V,n)}, ${x.scalingValue(M*(G?1:-1),n)}) rotate(${G?"0deg":"90deg"})`},children:[Y&&r.jsx(on,{url:Y,fill:C,hoverFill:A,className:dt(`${s}-arrow-img`,`${s}-mirror`),style:pe}),!Y&&r.jsx(vl,{color:C,className:dt(`${s}-arrow-icon`,`${s}-arrow-img`,`${s}-mirror`)})]})}),r.jsx("div",{className:dt(`${s}-arrow`,{[`${s}-arrow-next`]:G,[`${s}-arrow-next-vertical`]:!G,[`${s}-hover-arrow`]:ce}),style:{color:C,"--arrow-hover-color":A,...pe},children:r.jsxs("button",{className:`${s}-arrow-inner`,onClick:ee=>{ee.stopPropagation(),z(1)},style:{transform:`translate(${x.scalingValue(V*(G?-1:1),n)}, ${x.scalingValue(M,n)}) rotate(${G?"0deg":"90deg"})`},children:[Y&&r.jsx(on,{url:Y,fill:C,hoverFill:A,className:`${s}-arrow-img`,style:pe}),!Y&&r.jsx(vl,{color:C,className:dt(`${s}-arrow-icon`,`${s}-arrow-img`)})]})})]}),J&&r.jsx("div",{className:`${s}-click-overlay`,onClick:()=>z(1)}),K&&r.jsx("div",{className:dt(`${s}-pagination`,{[`${s}-pagination-inside-bottom`]:G,[`${s}-pagination-inside-left`]:!G}),style:G?{bottom:L(f.inset)}:{left:L(f.inset)},children:r.jsx("div",{className:dt(`${s}-pagination-inner`,{[`${s}-pagination-vertical`]:!G,[`${s}-animate-dots`]:fe}),style:{backgroundColor:F,gap:L(f.gapInactive-f.activeDot+f.dot),...G?{height:L(f.activeDot+f.paddingY*2),paddingTop:L(f.paddingY),paddingBottom:L(f.paddingY),paddingLeft:L(f.paddingActive),paddingRight:L(f.paddingActive)}:{width:L(f.activeDot+f.paddingY*2),paddingLeft:L(f.paddingY),paddingRight:L(f.paddingY),paddingTop:L(f.paddingActive),paddingBottom:L(f.paddingActive)},borderRadius:L(f.borderRadius),transform:`translate(${x.scalingValue(eo.offset.x,n)}, ${x.scalingValue(eo.offset.y,n)})`},children:d.map((ee,ne)=>{const He=ne===he,st=He?f.activeDot:f.dot;return r.jsx("button",{onClick:()=>le(ne),className:`${s}-pagination-item`,style:{width:L(f.activeDot)},children:r.jsx("div",{className:`${s}-dot`,style:{backgroundColor:He?S:y,width:L(st)}})},ne)})},`${$}-${v}`)})]}),r.jsxs("div",{className:`${s}-caption-block`,children:[r.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:x.scalingValue(U,n)}}),r.jsx("div",{className:`${s}-caption-text-wrapper`,children:d.map((ee,ne)=>r.jsx("div",{className:dt(`${s}-caption-text`,{[`${s}-with-pointer-events`]:ne===he&&n,[`${s}-active`]:ne===he}),style:{...l,width:"max-content",transitionDuration:`${Math.round(ki/2)}ms`},children:r.jsx("div",{className:`${s}-caption-text-inner`,style:{"--link-color":W,"--link-hover-color":W,position:"relative",top:x.scalingValue(sa.offset.y,n),left:x.scalingValue(sa.offset.x,n)},children:r.jsx(hi,{content:ee.imageCaption})})},ne))})]})]})]})}function vl({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Dv=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
18337
|
+
`}function Vv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:l}=w.useScopedStyles(),s=Hv(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??ys,p=u.sizeType??"drag",b=u.value??ys.value,S=(e==null?void 0:e.direction)??"horizontal",L=(e==null?void 0:e.transition)??"slide",f=(e==null?void 0:e.nav)??"classic",h=(e==null?void 0:e.navSize)??"m",y=_v[h],E=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,I=$e=>w.scalingValue($e*E,n),T=(e==null?void 0:e.show)??"always",X=(e==null?void 0:e.controls)??null,k=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,B=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,P=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,C=(e==null?void 0:e.controlsColor)??fs.color,z=(e==null?void 0:e.controlsHoverColor)??fs.hover,v=(e==null?void 0:e.navColor)??io.colors.inactive,_=(e==null?void 0:e.navPaginationColor)??io.colors.pagination,R=(e==null?void 0:e.navBackgroundColor)??io.colors.background,Z=(e==null?void 0:e.linkColor)??sa.linkColor,A=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,U=S==="horizontal",V=p==="click",G=p==="drag",ne=p==="auto"&&(!n||!!i),$=!n,M=L==="slide",N=f==="classic",Q=T!=="never",ie=T==="on hover",F=w.scalingValue(k,n),pe={width:F,height:F,maxWidth:F},x=M&&c>1,[se,J]=a.useState(0),[ye,Me]=a.useState(x?1:0),[de,ce]=a.useState(!1),[q,ee]=a.useState(!1),[me,Fe]=a.useState(!1),[Ce,Ae]=a.useState(0),[ue,fe]=a.useState(!1),[Se,D]=a.useState(!1),oe=a.useRef(!1),he=a.useRef(ye);he.current=ye;const be=a.useRef(null),Ie=a.useRef(null),xe=a.useRef(null),W=a.useRef(null),ae=a.useCallback($e=>{oe.current=$e,ce($e)},[]),te=a.useCallback($e=>{if(c<2||$e===0)return;const ge=$e>0?1:-1,je=Math.abs($e);if(fe(!0),ae(!0),J(Oe=>uo(Oe+$e,c)),!M)return;let vt=he.current,Ye=!1;for(let Oe=0;Oe<je;Oe++){const Le=Ov(vt,ge,c,x);vt=Le.position,Ye||(Ye=Le.skipTransition)}he.current=vt,Ye&&ee(!0),Me(vt)},[c,x,M,ae]),j=a.useCallback($e=>{te($e)},[te]),Y=a.useCallback($e=>{if(c<2)return;const ge=uo($e,c);if(!(ge===se&&!oe.current)&&(fe(!0),ae(!0),J(ge),M)){const je=ge+(x?1:0);he.current=je,Me(je)}},[se,c,x,M,ae]);a.useEffect(()=>{if(!de)return;const $e=window.setTimeout(()=>{if(x&&(ye===0||ye===c+1)){ee(!0),Me(se+1);return}ae(!1)},Fi);return()=>window.clearTimeout($e)},[se,c,x,de,ae,ye]),a.useEffect(()=>{if(!q)return;let $e=0;const ge=requestAnimationFrame(()=>{$e=requestAnimationFrame(()=>{ee(!1),ae(!1)})});return()=>{cancelAnimationFrame(ge),cancelAnimationFrame($e)}},[ae,q]);const Re=`${x}:${c}`,le=a.useRef(Re);a.useEffect(()=>{if(le.current===Re)return;le.current=Re;const $e=c>0?Math.min(se,c-1):0;xe.current=null,W.current=null,Fe(!1),Ae(0),J($e),ee(!0),Me($e+(x?1:0))},[se,c,x,Re]),a.useEffect(()=>{if(!ue)return;const $e=window.setTimeout(()=>fe(!1),Pv);return()=>window.clearTimeout($e)},[ue,se]),a.useEffect(()=>{if(!ne||c<2)return;const $e=Math.max(b,.1)*1e3,ge=window.setInterval(()=>{$&&Se||j(1)},$e);return()=>window.clearInterval(ge)},[b,c,j,ne,Se,$]);const H=a.useCallback($e=>{const ge=xe.current;if(!ge||ge.pointerId!==$e.pointerId)return;xe.current=null,W.current=null;const je=be.current;if(je!=null&&je.hasPointerCapture($e.pointerId)&&je.releasePointerCapture($e.pointerId),!ge.isActive){M&&Ae(0);return}Fe(!1),Ae(0);const Ye=!($e.timeStamp-ge.lastTime>Wv)&&Math.abs(ge.velocity)>Fv,Oe=ge.size>0&&Math.abs(ge.offset-ge.baseOffset)>ge.size*Av;if(!Ye&&!Oe)return;const Le=Oe?ge.offset-ge.baseOffset:ge.velocity;let He=1;Oe&&ge.size>0&&(He=Math.max(1,Math.round(Math.abs(Le)/ge.size))),te(Le<0?He:-He)},[te,M]);a.useEffect(()=>{const $e=ge=>{W.current===null||ge.pointerId!==W.current||H(ge)};return window.addEventListener("pointerup",$e),window.addEventListener("pointercancel",$e),()=>{window.removeEventListener("pointerup",$e),window.removeEventListener("pointercancel",$e)}},[H]);const De=$e=>{const ge=be.current;if(!G||c<2||!ge||$e.pointerType==="mouse"&&$e.button!==0)return;oe.current&&ae(!1);let je=0;const vt=Ie.current;if(M&&vt){const Ye=U?vt.offsetWidth:vt.offsetHeight;Ye>0&&(je=jv(vt,U)+he.current*Ye,Ae(je))}ge.setPointerCapture($e.pointerId),W.current=$e.pointerId,xe.current={pointerId:$e.pointerId,startClientX:$e.clientX,startClientY:$e.clientY,axes:Dv(ge,`${l}-axis-probe`),size:U?ge.offsetWidth:ge.offsetHeight,isActive:!1,baseOffset:je,offset:je,lastTime:$e.timeStamp,velocity:0}},_e=$e=>{const ge=xe.current;if(!ge||ge.pointerId!==$e.pointerId)return;if($e.pointerType==="mouse"&&$e.buttons===0){H($e);return}const je=$e.clientX-ge.startClientX,vt=$e.clientY-ge.startClientY,Ye=ge.axes?zv(ge.axes,je,vt):{x:je,y:vt},Oe=U?Ye.x:Ye.y,Le=U?Ye.y:Ye.x,He=ge.baseOffset+Oe;if(!ge.isActive){if(Math.max(Math.abs(Oe),Math.abs(Le))<kv)return;if(Math.abs(Le)>Math.abs(Oe)){const ut=be.current;ut!=null&&ut.hasPointerCapture(ge.pointerId)&&ut.releasePointerCapture(ge.pointerId),xe.current=null,W.current=null,M&&Ae(0);return}ge.isActive=!0,Fe(!0)}const Xe=$e.timeStamp-ge.lastTime;Xe>0&&(ge.velocity=(He-ge.offset)/Xe,ge.lastTime=$e.timeStamp),ge.offset=He,M&&Ae(He)},tt=$e=>{H($e)},Qe=U?`translate3d(calc(${-ye*100}% + ${Ce}px), 0, 0)`:`translate3d(0, calc(${-ye*100}% + ${Ce}px), 0)`,at=x?[d[c-1],...d,d[0]]:d;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Bv(l,n)}}),r.jsxs("div",{className:ct(`${l}-wrapper`,{[`${l}-transition-reveal`]:L==="reveal",[`${l}-transition-reveal-vertical`]:L==="reveal"&&!U}),onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),children:[r.jsxs("div",{className:`${l}-slider-inner`,style:{backgroundColor:"transparent"},children:[r.jsx("div",{ref:be,className:ct(`${l}-track`,{[`${l}-track-draggable`]:G,[`${l}-track-draggable-vertical`]:G&&!U}),onPointerDown:De,onPointerMove:_e,onPointerUp:tt,onPointerCancel:tt,onLostPointerCapture:$e=>{W.current===$e.pointerId&&H($e)},children:r.jsx("div",{ref:Ie,className:ct(`${l}-list`,{[`${l}-list-slide`]:M,[`${l}-list-slide-vertical`]:M&&!U,[`${l}-list-fade`]:!M}),style:M?{transform:Qe,transition:me||q?"none":`transform ${Fi}ms ${Oc}`}:void 0,children:at.map(($e,ge)=>{const je=x?uo(ge-1,c):ge,Ye=x&&(ge===0||ge===c+1)?`clone-${ge===0?"start":"end"}`:`slide-${je}`;return r.jsx("div",{className:ct(`${l}-slide`,{[`${l}-is-active`]:!M&&je===se}),children:r.jsx("div",{className:`${l}-slider-item`,children:r.jsx("div",{className:`${l}-img-wrapper`,children:r.jsx("img",{className:ct(`${l}-slider-image`,{[`${l}-contain`]:$e.image.objectFit==="contain",[`${l}-cover`]:$e.image.objectFit==="cover"}),src:$e.image.url,alt:$e.image.name??"",draggable:!1})})})},Ye)})})}),Q&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:ct(`${l}-arrow`,{[`${l}-arrow-prev`]:U,[`${l}-arrow-prev-vertical`]:!U,[`${l}-hover-arrow`]:ie}),style:{color:C,"--arrow-hover-color":z,...pe},children:r.jsxs("button",{onClick:$e=>{$e.stopPropagation(),j(-1)},className:`${l}-arrow-inner`,style:{transform:`translate(${w.scalingValue(B,n)}, ${w.scalingValue(P*(U?1:-1),n)}) rotate(${U?"0deg":"90deg"})`},children:[X&&r.jsx(rn,{url:X,fill:C,hoverFill:z,className:ct(`${l}-arrow-img`,`${l}-mirror`),style:pe}),!X&&r.jsx(vs,{color:C,className:ct(`${l}-arrow-icon`,`${l}-arrow-img`,`${l}-mirror`)})]})}),r.jsx("div",{className:ct(`${l}-arrow`,{[`${l}-arrow-next`]:U,[`${l}-arrow-next-vertical`]:!U,[`${l}-hover-arrow`]:ie}),style:{color:C,"--arrow-hover-color":z,...pe},children:r.jsxs("button",{className:`${l}-arrow-inner`,onClick:$e=>{$e.stopPropagation(),j(1)},style:{transform:`translate(${w.scalingValue(B*(U?-1:1),n)}, ${w.scalingValue(P,n)}) rotate(${U?"0deg":"90deg"})`},children:[X&&r.jsx(rn,{url:X,fill:C,hoverFill:z,className:`${l}-arrow-img`,style:pe}),!X&&r.jsx(vs,{color:C,className:ct(`${l}-arrow-icon`,`${l}-arrow-img`)})]})})]}),V&&r.jsx("div",{className:`${l}-click-overlay`,onClick:()=>j(1)}),N&&r.jsx("div",{className:ct(`${l}-pagination`,{[`${l}-pagination-inside-bottom`]:U,[`${l}-pagination-inside-left`]:!U}),style:U?{bottom:I(y.inset)}:{left:I(y.inset)},children:r.jsx("div",{className:ct(`${l}-pagination-inner`,{[`${l}-pagination-vertical`]:!U,[`${l}-animate-dots`]:ue}),style:{backgroundColor:R,gap:I(y.gapInactive-y.activeDot+y.dot),...U?{height:I(y.activeDot+y.paddingY*2),paddingTop:I(y.paddingY),paddingBottom:I(y.paddingY),paddingLeft:I(y.paddingActive),paddingRight:I(y.paddingActive)}:{width:I(y.activeDot+y.paddingY*2),paddingLeft:I(y.paddingY),paddingRight:I(y.paddingY),paddingTop:I(y.paddingActive),paddingBottom:I(y.paddingActive)},borderRadius:I(y.borderRadius),transform:`translate(${w.scalingValue(io.offset.x,n)}, ${w.scalingValue(io.offset.y,n)})`},children:d.map(($e,ge)=>{const je=ge===se,vt=je?y.activeDot:y.dot;return r.jsx("button",{onClick:()=>Y(ge),className:`${l}-pagination-item`,style:{width:I(y.activeDot)},children:r.jsx("div",{className:`${l}-dot`,style:{backgroundColor:je?_:v,width:I(vt)}})},ge)})},`${h}-${S}`)})]}),r.jsxs("div",{className:`${l}-caption-block`,children:[r.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${l}-control`:void 0,style:{height:w.scalingValue(A,n)}}),r.jsx("div",{className:`${l}-caption-text-wrapper`,children:d.map(($e,ge)=>r.jsx("div",{className:ct(`${l}-caption-text`,{[`${l}-with-pointer-events`]:ge===se&&n,[`${l}-active`]:ge===se}),style:{...s,width:"max-content",transitionDuration:`${Math.round(Fi/2)}ms`},children:r.jsx("div",{className:`${l}-caption-text-inner`,style:{"--link-color":Z,"--link-hover-color":Z,position:"relative",top:w.scalingValue(sa.offset.y,n),left:w.scalingValue(sa.offset.x,n)},children:r.jsx(yi,{content:$e.imageCaption})})},ge))})]})]})]})}function vs({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Gv=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
18197
18338
|
import cn from 'classnames';
|
|
18198
18339
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
18199
18340
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -19304,20 +19445,23 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
19304
19445
|
</svg>
|
|
19305
19446
|
);
|
|
19306
19447
|
}
|
|
19307
|
-
`,
|
|
19448
|
+
`,qv={type:"object",version:1,settings:{sizing:"manual",properties:{trigger:{type:"object",scope:"common",title:"Trigger",display:{type:"toggle-cycle-numeric-input",enum:["click","drag","auto"],inputs:{click:"none",drag:"none",auto:"single"},defaultValue:3,showDash:!1},min:1,max:5,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical"]}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["slide","fade in","reveal"]}},nav:{type:"string",scope:"common",title:"Nav",display:{type:"toggle-cycle",enum:["classic","no"]}},navSize:{type:"string",scope:"layout",title:"Nav Size",display:{type:"toggle-cycle",enum:["s","m","l"]}},navUnit:{type:"number",scope:"layout",title:"",display:{type:"numeric-input",visible:!1},min:0,max:1},controls:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},controlsMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},show:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","on hover","never"]}},paddingX:{type:"number",scope:"layout",title:"Padding X",display:{type:"numeric-input"},min:-9999,max:9999},paddingY:{type:"number",scope:"layout",title:"Padding Y",display:{type:"numeric-input"},min:-9999,max:9999},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"palette-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"palette-color-picker"}},navColor:{type:"string",scope:"common",title:"Dot Nav",display:{type:"palette-color-picker"}},navPaginationColor:{type:"string",scope:"common",title:"Active Nav",display:{type:"palette-color-picker"}},navBackgroundColor:{type:"string",scope:"common",title:"BG Nav",display:{type:"palette-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"palette-color-picker"}},titleColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{type:"object",scope:"common",title:"",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",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"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},defaults:{trigger:{sizeType:"drag",value:3,min:1,max:5},direction:"horizontal",transition:"slide",nav:"classic",controls:null,show:"always",controlsColor:"#000000",controlsHoverColor:"#3F3F3F",navColor:"#A4A4A4",navPaginationColor:"#FFFFFF",navBackgroundColor:"#000000",linkColor:"#2E12F0",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{controlsMaxWidth:30/1440,paddingX:0,paddingY:0,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,titleFontSize:16/375,titleLineHeight:16/375,navSize:"m",navUnit:1/375}},displayRules:[{if:{name:"show",value:"never"},then:{name:"properties.controlsColor.display.visible",value:!1}},{if:{name:"show",value:"never"},then:{name:"properties.controlsHoverColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navPaginationColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navBackgroundColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navSize.display.visible",value:!1}}],layout:["__componentName__","trigger","direction","transition","nav","navSize","controls","controlsMaxWidth","show","paddingX","paddingY","captionMarginTop","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["trigger","direction"]},{type:"row",title:"",items:["transition","nav"]},{type:"row",title:"",items:["navSize"]},{type:"group",title:"Controls",items:[{type:"row",title:"",items:["controls","controlsMaxWidth"]},{type:"row",title:"",items:["paddingX","paddingY"]},{type:"row",title:"",items:["show"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]}]}],paletteBookmark:{items:["controlsColor","controlsHoverColor","navPaginationColor","navColor","navBackgroundColor","titleColor","linkColor"],panelIds:["general","typeStyle"]},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/Component-default-1.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Earth-orbital mission"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Salton Sea from Above"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module Pilot"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module 3 porch"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Command Module"}]}]}]}},Uv={element:Vv,id:"slider-2-0",name:"Slider 2.0",category:"galleries",version:1,defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},schema:qv,sourceCode:Gv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},Mi=300/1440,Kv=8/1440,di=.004;function Xv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function xs(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function bs(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:w.scalingValue((o-t)/2,i)}}function Yv(e){return`
|
|
19308
19449
|
.${e}-wrapper {
|
|
19309
19450
|
box-sizing: border-box;
|
|
19310
19451
|
display: flex;
|
|
19311
19452
|
flex-direction: column;
|
|
19312
19453
|
position: relative;
|
|
19313
19454
|
width: 100%;
|
|
19314
|
-
min-height: ${
|
|
19455
|
+
min-height: ${Xv(48)};
|
|
19315
19456
|
}
|
|
19316
19457
|
.${e}-single-title-layer {
|
|
19317
19458
|
position: absolute;
|
|
19318
19459
|
inset: 0;
|
|
19319
19460
|
z-index: 2;
|
|
19320
19461
|
pointer-events: none;
|
|
19462
|
+
display: flex;
|
|
19463
|
+
flex-direction: column;
|
|
19464
|
+
justify-content: flex-start;
|
|
19321
19465
|
}
|
|
19322
19466
|
.${e}-single-title {
|
|
19323
19467
|
pointer-events: none;
|
|
@@ -19332,10 +19476,10 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
19332
19476
|
flex-direction: row;
|
|
19333
19477
|
}
|
|
19334
19478
|
.${e}-item-b {
|
|
19335
|
-
flex-direction:
|
|
19479
|
+
flex-direction: column;
|
|
19336
19480
|
}
|
|
19337
19481
|
.${e}-item-c {
|
|
19338
|
-
flex-direction:
|
|
19482
|
+
flex-direction: row-reverse;
|
|
19339
19483
|
}
|
|
19340
19484
|
.${e}-title {
|
|
19341
19485
|
align-self: flex-start;
|
|
@@ -19344,13 +19488,13 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
19344
19488
|
min-width: 0;
|
|
19345
19489
|
box-sizing: border-box;
|
|
19346
19490
|
position: sticky;
|
|
19347
|
-
z-index:
|
|
19491
|
+
z-index: 2;
|
|
19492
|
+
overflow: visible;
|
|
19348
19493
|
color: var(--${e}-title-color);
|
|
19349
19494
|
}
|
|
19350
19495
|
.${e}-title-text {
|
|
19351
19496
|
display: block;
|
|
19352
19497
|
width: 100%;
|
|
19353
|
-
max-width: 100%;
|
|
19354
19498
|
white-space: pre-wrap;
|
|
19355
19499
|
overflow-wrap: anywhere;
|
|
19356
19500
|
word-break: break-word;
|
|
@@ -19358,41 +19502,76 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
19358
19502
|
.${e}-title-text-inner {
|
|
19359
19503
|
display: flex;
|
|
19360
19504
|
flex-direction: column;
|
|
19505
|
+
flex-shrink: 0;
|
|
19361
19506
|
box-sizing: border-box;
|
|
19362
|
-
min-width: 0;
|
|
19363
19507
|
outline: 1px solid #FF5C02;
|
|
19364
19508
|
}
|
|
19365
19509
|
.${e}-title-text-inner-hidden {
|
|
19366
19510
|
display: flex;
|
|
19367
19511
|
flex-direction: column;
|
|
19512
|
+
flex-shrink: 0;
|
|
19368
19513
|
box-sizing: border-box;
|
|
19514
|
+
}
|
|
19515
|
+
.${e}-title-text-stack {
|
|
19516
|
+
display: flex;
|
|
19517
|
+
flex-direction: column;
|
|
19518
|
+
flex-shrink: 0;
|
|
19369
19519
|
min-width: 0;
|
|
19520
|
+
position: relative;
|
|
19521
|
+
box-sizing: border-box;
|
|
19522
|
+
}
|
|
19523
|
+
.${e}-item-a .${e}-title-position-top .${e}-title-text-stack,
|
|
19524
|
+
.${e}-item-b .${e}-title-position-top .${e}-title-text-stack,
|
|
19525
|
+
.${e}-item-c .${e}-title-position-top .${e}-title-text-stack,
|
|
19526
|
+
.${e}-single-title-layer .${e}-title-position-top .${e}-title-text-stack {
|
|
19527
|
+
padding-top: var(--${e}-title-top-padding, 0);
|
|
19370
19528
|
}
|
|
19371
19529
|
.${e}-title-position-left,
|
|
19372
19530
|
.${e}-title-position-center,
|
|
19373
19531
|
.${e}-title-position-right {
|
|
19374
|
-
top: calc(
|
|
19532
|
+
top: calc(var(--cntrl-article-top, 0px) + var(--cntrl-viewport-height, 100vh) / 2 - (var(--${e}-title-height, 0px) / 2));
|
|
19533
|
+
align-items: center;
|
|
19375
19534
|
}
|
|
19376
19535
|
.${e}-title-position-top {
|
|
19377
|
-
top: var(
|
|
19536
|
+
top: var(--cntrl-article-top, 0px);
|
|
19378
19537
|
bottom: auto;
|
|
19379
19538
|
justify-content: flex-start;
|
|
19539
|
+
align-self: flex-start;
|
|
19380
19540
|
}
|
|
19381
19541
|
.${e}-title-position-left {
|
|
19382
19542
|
justify-content: flex-start;
|
|
19383
19543
|
}
|
|
19544
|
+
.${e}-item-a .${e}-title-position-top,
|
|
19545
|
+
.${e}-item-a .${e}-title-position-left,
|
|
19546
|
+
.${e}-item-b .${e}-title-position-top,
|
|
19547
|
+
.${e}-item-b .${e}-title-position-left,
|
|
19548
|
+
.${e}-item-c .${e}-title-position-top,
|
|
19549
|
+
.${e}-item-c .${e}-title-position-left,
|
|
19550
|
+
.${e}-single-title-layer .${e}-title-position-top,
|
|
19551
|
+
.${e}-single-title-layer .${e}-title-position-left {
|
|
19552
|
+
padding-left: var(--${e}-title-left-padding, 0);
|
|
19553
|
+
}
|
|
19384
19554
|
.${e}-title-position-center {
|
|
19385
19555
|
justify-content: center;
|
|
19386
19556
|
}
|
|
19387
19557
|
.${e}-title-position-right {
|
|
19388
19558
|
justify-content: flex-end;
|
|
19389
19559
|
}
|
|
19560
|
+
.${e}-item-a .${e}-title-position-right,
|
|
19561
|
+
.${e}-item-b .${e}-title-position-right,
|
|
19562
|
+
.${e}-item-c .${e}-title-position-right,
|
|
19563
|
+
.${e}-single-title-layer .${e}-title-position-right {
|
|
19564
|
+
padding-right: var(--${e}-title-right-padding, 0);
|
|
19565
|
+
}
|
|
19390
19566
|
.${e}-item-a .${e}-title,
|
|
19391
|
-
.${e}-item-
|
|
19567
|
+
.${e}-item-c .${e}-title {
|
|
19392
19568
|
flex: 1;
|
|
19393
19569
|
width: auto;
|
|
19570
|
+
min-width: 0;
|
|
19571
|
+
overflow: visible;
|
|
19394
19572
|
}
|
|
19395
|
-
.${e}-item-
|
|
19573
|
+
.${e}-item-b .${e}-title,
|
|
19574
|
+
.${e}-single-title-layer .${e}-title {
|
|
19396
19575
|
width: 100%;
|
|
19397
19576
|
pointer-events: none;
|
|
19398
19577
|
}
|
|
@@ -19403,11 +19582,11 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
19403
19582
|
flex-shrink: 0;
|
|
19404
19583
|
box-sizing: border-box;
|
|
19405
19584
|
}
|
|
19406
|
-
.${e}-item-
|
|
19585
|
+
.${e}-item-b .${e}-gallery {
|
|
19407
19586
|
display: grid;
|
|
19408
19587
|
width: 100%;
|
|
19409
19588
|
}
|
|
19410
|
-
.${e}-item-
|
|
19589
|
+
.${e}-item-b .${e}-gallery-media {
|
|
19411
19590
|
grid-area: 1 / 1;
|
|
19412
19591
|
display: flex;
|
|
19413
19592
|
flex-direction: column;
|
|
@@ -19415,13 +19594,17 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
19415
19594
|
width: 100%;
|
|
19416
19595
|
min-width: 0;
|
|
19417
19596
|
}
|
|
19418
|
-
.${e}-item-
|
|
19597
|
+
.${e}-item-b .${e}-title-layer {
|
|
19419
19598
|
grid-area: 1 / 1;
|
|
19420
19599
|
align-self: stretch;
|
|
19421
19600
|
width: 100%;
|
|
19422
19601
|
min-width: 0;
|
|
19423
|
-
z-index:
|
|
19602
|
+
z-index: 2;
|
|
19603
|
+
overflow: visible;
|
|
19424
19604
|
pointer-events: none;
|
|
19605
|
+
display: flex;
|
|
19606
|
+
flex-direction: column;
|
|
19607
|
+
justify-content: flex-start;
|
|
19425
19608
|
}
|
|
19426
19609
|
.${e}-gallery-item {
|
|
19427
19610
|
position: relative;
|
|
@@ -19436,16 +19619,12 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
19436
19619
|
max-width: 100%;
|
|
19437
19620
|
height: auto;
|
|
19438
19621
|
}
|
|
19439
|
-
.${e}-gallery-caption {
|
|
19440
|
-
width: 100%;
|
|
19441
|
-
box-sizing: border-box;
|
|
19442
|
-
text-align: center;
|
|
19443
|
-
}
|
|
19444
19622
|
.${e}-gallery-controls {
|
|
19445
19623
|
position: relative;
|
|
19446
19624
|
display: flex;
|
|
19447
19625
|
flex-shrink: 0;
|
|
19448
19626
|
box-sizing: border-box;
|
|
19627
|
+
z-index: 1;
|
|
19449
19628
|
}
|
|
19450
19629
|
.${e}-gallery-edge-spacer {
|
|
19451
19630
|
flex-shrink: 0;
|
|
@@ -19483,7 +19662,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
19483
19662
|
width: var(--cntrl-article-width, 100vw) !important;
|
|
19484
19663
|
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
19485
19664
|
}
|
|
19486
|
-
`}const qv="rgba(28,31,34,0.9)",Rn=500,ci="cubic-bezier(0.22, 1, 0.36, 1)",Uv=72,Kv=50,Xv={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},Yv=[];function Zv(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function Jv(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Qv(e){const[t]=e.media;return t!=null&&t.url?t:null}function e0(e){if(!Array.isArray(e)||e.length===0)return[];if(Zv(e)){const t=[];for(const n of e){const i=Jv(n);if(!i)continue;const o=Qv(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ta(e){return e.type==="video"}function t0(e){e.pause(),e.removeAttribute("src"),e.load()}function Yo(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function n0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const i0=1140/1440;function o0(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function r0(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function a0(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function s0({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{t0(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d,style:i})}function l0({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const w=i==="cover",v=a.useRef(null),T=a.useRef(null),g=a.useRef(null),$=a.useRef(0),f=a.useRef(0),R=a.useRef("none"),L=a.useRef(!1),I=a.useRef(!1),Y=a.useRef(!1),P=a.useRef(null),[V,M]=a.useState(null),[C,A]=a.useState("opening"),[y,S]=a.useState(0),[F,W]=a.useState(0),[U,G]=a.useState(!1),[J,D]=a.useState(!1),[j,O]=a.useState(!1),E=a.useRef(n),K=t[n],Z=K?Ta(K):!1,ce=F!==0||U,N=a.useCallback(fe=>{Y.current=fe,G(fe)},[]),pe=a.useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),b=a.useCallback(()=>{pe(),P.current=window.setTimeout(()=>{pe(),N(!1)},Rn+32)},[pe,N]),he=a.useCallback(()=>{const fe=v.current,ye=T.current;if(!fe)return;const Se=fe.getBoundingClientRect(),B=Se.width,ue=Se.height;if(!B||!ue)return;if(i==="cover"){M({width:B,height:ue,left:Se.left,top:Se.top});return}if(!ye){M(Yo(fe));return}const{width:ve,height:me}=n0(ye);if(!ve||!me){M(Yo(fe));return}const Ee=ve/me,be=B/ue;if(Ee>be){const k=B/Ee;M({width:B,height:k,left:Se.left,top:Se.top+(ue-k)/2})}else{const k=ue*Ee;M({width:k,height:ue,left:Se.left+(B-k)/2,top:Se.top})}},[i]);a.useEffect(()=>{he();const fe=v.current;if(!fe)return;const ye=new ResizeObserver(()=>he());return ye.observe(fe),()=>ye.disconnect()},[he,n]),a.useEffect(()=>{C==="opening"&&V&&A("open")},[C,V]),a.useEffect(()=>{if(C!=="closing")return;const fe=setTimeout(()=>s(),Rn);return()=>clearTimeout(fe)},[C,s]),a.useEffect(()=>()=>{pe()},[pe]),a.useLayoutEffect(()=>{if(E.current===n)return;pe(),S(0),W(0),N(!1),O(!1),D(!1),$.current=0,f.current=0,R.current="none",L.current=!1,g.current=null,I.current=!1;const fe=v.current;fe&&M(Yo(fe)),E.current=n},[n,N,pe]),a.useEffect(()=>{if(C!=="open")return;let fe=null;const ye=()=>{fe&&(document.removeEventListener("click",fe,!0),fe=null)},Se=()=>{ye(),fe=be=>{be.stopPropagation(),be.preventDefault(),ye()},document.addEventListener("click",fe,!0)},B=be=>{pe(),Y.current=!1,G(!1),W(0),D(!1),L.current=!1,f.current=0,R.current="none";const k=v.current;k&&M(Yo(k)),be<0?d():l()},ue=be=>{if(Math.abs(be)>Kv&&t.length>1){B(be);return}N(!0),W(0),b()},ve=be=>{if(be.touches.length!==1||Y.current)return;const k=be.touches[0];I.current=!0,g.current={x:k.clientX,y:k.clientY},R.current="none",f.current=0,L.current=!1},me=be=>{if(!g.current||be.touches.length!==1||Y.current)return;const k=be.touches[0],re=k.clientX-g.current.x,te=k.clientY-g.current.y;if(R.current==="none"){if(Math.abs(re)<10&&Math.abs(te)<10)return;if(Math.abs(re)>Math.abs(te)){if(t.length<=1)return;R.current="horizontal"}else if(te>0)R.current="vertical";else return}if(R.current==="horizontal"){L.current=!0,D(!0),f.current=re,W(re),be.preventDefault();return}R.current==="vertical"&&(L.current=!0,D(!0),$.current=te,S(te),be.preventDefault())},Ee=()=>{if(!g.current)return;const be=R.current,k=L.current;if(k&&be==="horizontal")ue(f.current),Se();else if(k&&be==="vertical")if($.current>Uv){const te=window.innerHeight;$.current=te,O(!0),S(te),A("closing")}else $.current=0,S(0),Se();else be==="horizontal"&&Math.abs(f.current)>0&&(ue(f.current),Se());g.current=null,R.current="none",f.current=0,L.current=!1,D(!1)};return document.addEventListener("touchstart",ve,{passive:!0}),document.addEventListener("touchmove",me,{passive:!1}),document.addEventListener("touchend",Ee),document.addEventListener("touchcancel",Ee),()=>{document.removeEventListener("touchstart",ve),document.removeEventListener("touchmove",me),document.removeEventListener("touchend",Ee),document.removeEventListener("touchcancel",Ee),ye()}},[C,t.length,d,l,N,b,pe]),a.useEffect(()=>{const fe=ye=>{ye.key==="Escape"&&(ye.preventDefault(),ye.stopPropagation(),C!=="closing"&&A("closing"))};return window.addEventListener("keydown",fe,!0),()=>window.removeEventListener("keydown",fe,!0)},[C]);const Q=()=>{C!=="closing"&&A("closing")},we=C==="open",Te=C==="closing",se=y>0?Math.max(0,1-y/500):1,oe=y>0?Math.max(.35,1-y/500):1,q=fe=>{if(fe.stopPropagation(),I.current){I.current=!1;return}if(t.length<=1)return;const ye=fe.currentTarget.getBoundingClientRect(),Se=fe.clientY-ye.top,B=Math.min(52,ye.height*.2);if(!(Se>ye.height-B)){if(fe.clientX-ye.left<ye.width/2){l();return}d()}},de=fe=>{if(t.length<=1)return;const ye=fe.currentTarget.getBoundingClientRect(),Se=fe.clientX-ye.left,B=fe.clientY-ye.top,ue=Math.min(52,ye.height*.2);if(B>ye.height-ue){fe.currentTarget.style.cursor="default";return}fe.currentTarget.style.cursor=Se<ye.width/2?"w-resize":"e-resize"},ge=a.useCallback(fe=>{fe.propertyName!=="transform"||!Y.current||(pe(),N(!1))},[pe,N]),_e=ce?`translateX(${F}px)`:y>0?`translateY(${y}px)`:void 0,Ce={position:"fixed",top:V==null?void 0:V.top,left:V==null?void 0:V.left,width:V==null?void 0:V.width,height:V==null?void 0:V.height,objectFit:i==="cover"?"cover":"contain",transform:_e,opacity:y>0?oe:C==="opening"||Te?0:1,transition:J&&!U?"none":U?`transform ${Rn}ms ${ci}`:j?`transform ${Rn}ms ${ci}, opacity ${Rn}ms ${ci}`:C==="opening"||Te?`opacity ${Rn}ms ${ci}`:"none",pointerEvents:Z&&we&&!ce?"auto":"none",touchAction:Z&&we?"none":void 0,zIndex:9998},Me=V?{position:"fixed",top:V.top,height:V.height,width:V.width/2,zIndex:9999}:null;return r.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:C==="open"?"none":void 0},onClick:Q,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:we?se:0,transition:J?"none":`opacity ${Rn}ms ${ci}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:w?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:v,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:we?1:0,transition:`opacity ${Rn}ms ${ci}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:v,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:we?1:0,transition:`opacity ${Rn}ms ${ci}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),V&&K&&(Z?r.jsx(s0,{src:K.url,phase:C,mediaRef:T,mediaStyle:Ce,onLoadedMetadata:he,onClick:q,onMouseMove:de,onTransitionEnd:ge},`${n}-${K.url}`):r.jsx("img",{ref:T,src:K.url,alt:K.name,onLoad:he,onTransitionEnd:ge,style:Ce},`${n}-${K.url}`)),we&&Me&&t.length>1&&!Z&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Me,left:V.left,cursor:"w-resize",pointerEvents:ce?"none":"auto"},onClick:fe=>{if(I.current){I.current=!1;return}fe.stopPropagation(),l()}}),r.jsx("div",{style:{...Me,left:V.left+V.width/2,cursor:"e-resize",pointerEvents:ce?"none":"auto"},onClick:fe=>{if(I.current){I.current=!1;return}fe.stopPropagation(),d()}})]})]})}function wl({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:s,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const w=`${e}-gallery-${Ta(t)?"video":"image"}`,v=s.display==="cover",T=r0(s),g=C=>x.scalingValue(C,l??!1),$=n??Ca,f=o?{width:"100%",maxWidth:"100%"}:{width:g($),maxWidth:"100%"},R=i?{borderRadius:g(i)}:{},L={...f,...v?{aspectRatio:T,height:"auto",overflow:"hidden"}:{},...R},I={...v?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g($)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...v?{}:R},P={className:w,style:I,onClick:p?C=>{C.stopPropagation(),p()}:void 0},V=Math.max(d,io),M=Ta(t)?r.jsx("video",{...P,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):r.jsx("img",{...P,src:t.url,alt:t.name??""});return r.jsxs("div",{className:`${e}-gallery-item`,children:[v?r.jsx("div",{style:L,children:M}):M,c&&d>0&&r.jsx("div",{className:`${e}-padding-handle`,style:{height:g(d)},"aria-hidden":"true"}),u&&c&&r.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:g(V)}})]})}function c0({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:s,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const w=t==="a"?i:t==="b"?o:0,v=w>0||c;return r.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="b"&&v&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(w)},"aria-hidden":"true"}),c&&t==="b"&&r.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),r.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&v&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(w)},"aria-hidden":"true"}),c&&t==="a"&&r.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(s),height:"100%"}})]})}function d0(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function la({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:s,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1}){const u=a.useRef(null),[p,w]=a.useState(0),v=t??"";return a.useLayoutEffect(()=>{const T=u.current;if(!T||typeof ResizeObserver>"u")return;const g=()=>w(T.offsetHeight);g();const $=new ResizeObserver(g);return $.observe(T),()=>$.disconnect()},[v]),r.jsx("div",{ref:T=>{u.current=T,i(T)},className:[o,`${e}-title-position-${n}`].join(" "),style:{[`--${e}-title-height`]:`${p}px`,...s},children:r.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:l,children:r.jsx("span",{className:`${e}-title-text`,style:d,children:v})})})}const Sl=45;function u0(e,t,n){if(t==="top"){const o=n&&parseFloat(getComputedStyle(n).top)||0;return Math.abs(e.top-o)}const i=e.top+e.height/2;return Math.abs(i-window.innerHeight/2)}function p0(e,t,n){const i=Array.from({length:t},(l,d)=>{const c=e.current[d];if(!c)return 0;const u=c.getBoundingClientRect(),p=u0(u,n,c);return Math.exp(-(p*p)/(2*Sl*Sl))});let o=0,s=-1;return i.forEach((l,d)=>{l>s&&(s=l,o=d)}),{opacities:i,dominantIndex:o}}function m0(e,t,n){const i=a.useRef([]),[{opacities:o,dominantIndex:s},l]=a.useState(()=>({opacities:Array.from({length:e},(c,u)=>u===0?1:0),dominantIndex:0}));return a.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let c=0;const u=()=>{l(p0(i,e,n))},p=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:c=>u=>{i.current[c]=u},opacities:o,dominantIndex:s}}function g0(e,t){const[n,i]=a.useState(e),o=a.useRef(e);return a.useEffect(()=>{if(!t){o.current=e,i(e);return}const s=Array.from(o.current),l=Array.from(e),d=Math.max(s.length,l.length);if(d===0||o.current===e)return;let c=0;const u=window.setInterval(()=>{c+=1;const p=[...l.slice(0,c),...s.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function h0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:s}){var Oe;const{prefix:l}=x.useScopedStyles(),d=a.useMemo(()=>Gv(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",w=(e==null?void 0:e.imgWidth)??Ca,v=(e==null?void 0:e.titleWidth)??i0,T=o0(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??Bv,$=(e==null?void 0:e.position)??"center",f=(e==null?void 0:e.titleTopPadding)??0,R=d0(e==null?void 0:e.transition),L=(e==null?void 0:e.lightbox)??"on",I=p==="c",Y=R==="fade"||R==="retype",{setTitleRef:P,dominantIndex:V}=m0(c.length,Y,$),M=((Oe=c[V])==null?void 0:Oe.title)??"",C=g0(M,R==="retype"),A=R==="fade"||R==="retype",y=R==="retype"?C:M,S=I?void 0:{width:x.scalingValue(w,n??!1)},F=L==="on"&&(!n||i||o),W=o??!1,U=(e==null?void 0:e.galleryPaddingRight)??0,G=(e==null?void 0:e.galleryPaddingLeft)??0,J=(e==null?void 0:e.galleryPaddingBetween)??0,D=je=>x.scalingValue(je,n??!1),O={width:D(v),maxWidth:"100%"},E=p==="a"?U:G,K=I?{}:{width:`calc(100% - ${D(w)} - ${D(E)})`,...p==="b"?{marginLeft:"auto"}:{}},Z=Math.max(U,io),ce=Math.max(G,io),N=Math.max(J,io),pe=Math.max(f,io),b=Math.max(0,(u??1)-(w??Ca)),he=I?{left:0,width:"100%"}:p==="a"?{right:D(U),width:D(w)}:{left:D(G),width:D(w)},{titleColor:Q,titleFontFamily:we,titleFontSettings:Te,titleFontSize:se,titleLineHeight:oe,titleLetterSpacing:q,titleWordSpacing:de,titleAlign:ge,titleTextAppearance:_e,lightboxCounterColor:Ce,lightboxCounterFontFamily:Me,lightboxCounterFontSettings:fe,lightboxCounterFontSize:ye,lightboxCounterLineHeight:Se,lightboxCounterLetterSpacing:B,lightboxCounterWordSpacing:ue,lightboxCounterTextAppearance:ve}=e??{},me={fontSettings:{fontFamily:we,fontWeight:(Te==null?void 0:Te.fontWeight)??400,fontStyle:(Te==null?void 0:Te.fontStyle)??"normal"},fontSize:se??.01,lineHeight:oe,letterSpacing:q??0,wordSpacing:de??0,textAlign:ge??"left",textAppearance:_e,color:Q??"#000000"},be=nn(zt(me,n)),k=O,re=bl(se,oe,l,n),te=xl(se,oe,`${l}-title`,`${l}-text-tight-leading`),z={fontSettings:{fontFamily:Me,fontWeight:(fe==null?void 0:fe.fontWeight)??400,fontStyle:(fe==null?void 0:fe.fontStyle)??"normal"},fontSize:ye??.01,lineHeight:Se,letterSpacing:B??0,wordSpacing:ue??0,textAppearance:ve,color:Ce??"#DEDDDD"},Re={...nn(zt(z,n)),...bl(ye,Se,l,n)},ae=xl(ye,Se,`${l}-lightbox-counter`,`${l}-text-tight-leading`),_=x.buildColorVars(l,{titleColor:Q??"#000000",lightboxCounterColor:Ce??"#DEDDDD"},Xv,Yv),Ne=a.useRef(null),[Fe,et]=a.useState(!1),[Ke,Ie]=a.useState([]),[ee,ne]=a.useState(0),He=a.useCallback((je,qe)=>{F&&(Ie(je),ne(qe),et(!0))},[F]),st=a.useCallback(()=>{et(!1)},[]),Be=a.useMemo(()=>{const je={..._},qe=Ne.current?getComputedStyle(Ne.current).getPropertyValue("--cntrl-article-width").trim():"";return qe&&(je["--cntrl-article-width"]=qe),je},[_,Fe]);return a.useEffect(()=>{if(!Fe||L!=="on"||typeof document>"u")return;const je=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=je}},[Fe,L]),a.useEffect(()=>{!n||o||i||et(!1)},[n,o,i]),a.useEffect(()=>{L==="off"&&et(!1)},[L]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),r.jsx("div",{style:_,children:r.jsxs("div",{ref:Ne,className:`${l}-wrapper`,style:{width:x.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:$==="top"?D(f):void 0},children:[W&&$==="top"&&r.jsx("div",{"data-controls":"titleTopPadding","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:D(pe)}}),A&&r.jsx("div",{className:`${l}-single-title-layer`,children:r.jsx(la,{P:l,title:y,position:$,titleRef:()=>{},titleClassName:`${te} ${l}-single-title`,titleContainerStyle:{...re,...K},titleTextBoxStyle:k,titleStyle:be,showTextBoxOutline:W})}),c.map((je,qe)=>{const tt=e0(je.gallery),mt=qe<c.length-1,St=tt.filter(pt=>pt.lightboxMedia).map(pt=>pt.lightboxMedia),lt={P:l,position:$,titleRef:P(qe),titleClassName:te,titleContainerStyle:re,titleTextBoxStyle:A?{maxWidth:"100%"}:k,titleStyle:be,showTextBoxOutline:W&&!A};return r.jsxs("div",{"data-item-index":qe,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:mt?D(J):void 0},children:[W&&mt&&r.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-control-anchor`,style:{bottom:0,height:D(N),...he}}),I?r.jsxs("div",{className:`${l}-gallery`,children:[r.jsx("div",{className:`${l}-gallery-media`,children:tt.map(({displayMedia:pt,lightboxMedia:Mt},nt)=>{const Ve=Mt?St.findIndex(De=>De.url===Mt.url):-1;return r.jsx(wl,{P:l,media:pt,imgWidth:w||void 0,cornerRadius:g||void 0,imageDisplay:T,isEditor:n,galleryPaddingBetween:J,showPaddingAfter:nt<tt.length-1,showControls:W,onMediaClick:F&&Ve>=0?()=>He(St,Ve):void 0},`${pt.url}-${nt}`)})}),r.jsx("div",{className:`${l}-title-layer`,children:r.jsx(la,{...lt,title:A?"":je.title})})]}):r.jsxs(r.Fragment,{children:[r.jsx(la,{...lt,title:A?"":je.title}),tt.length>0&&r.jsx(c0,{P:l,layoutType:p,galleryWidthStyle:S,galleryPaddingRight:U,galleryPaddingLeft:G,galleryPaddingRightWidth:Z,galleryPaddingLeftWidth:ce,galleryPaddingMaxFraction:b,showControls:W,scaled:D,children:tt.map(({displayMedia:pt,lightboxMedia:Mt},nt)=>{const Ve=Mt?St.findIndex(De=>De.url===Mt.url):-1;return r.jsx(wl,{P:l,media:pt,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:T,isEditor:n,galleryPaddingBetween:J,showPaddingAfter:nt<tt.length-1,showControls:W,onMediaClick:F&&Ve>=0?()=>He(St,Ve):void 0},`${pt.url}-${nt}`)})})]})]},qe)})]})}),Fe&&L==="on"&&typeof document<"u"&&e&&(()=>{const je=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Be,"data-selection":"none",children:r.jsx(l0,{prefix:l,items:Ke,index:ee,imageDisplay:a0(e.lightboxImageDisplay),isEditor:n,onClose:st,onPrev:()=>ne(qe=>(qe-1+Ke.length)%Ke.length),onNext:()=>ne(qe=>(qe+1)%Ke.length),counterClassName:ae,counterStyle:Re,backgroundColor:e.backgroundColor??qv})}),je)})()]})}const f0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
19665
|
+
`}const Zv="rgba(28,31,34,0.9)",Rn=500,ci="cubic-bezier(0.22, 1, 0.36, 1)",Jv=72,Qv=50,e0={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},t0=[];function n0(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function i0(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function o0(e){const[t]=e.media;return t!=null&&t.url?t:null}function r0(e){if(!Array.isArray(e)||e.length===0)return[];if(n0(e)){const t=[];for(const n of e){const i=i0(n);if(!i)continue;const o=o0(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function Ta(e){return e.type==="video"}function a0(e){e.pause(),e.removeAttribute("src"),e.load()}function Jo(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function l0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const s0=1140/1440;function c0(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function d0(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function u0(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function p0({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:l,onMouseMove:s,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{a0(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:l,onMouseMove:s,onTransitionEnd:d,style:i})}function m0({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:l,onPrev:s,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const b=i==="cover",S=a.useRef(null),L=a.useRef(null),f=a.useRef(null),h=a.useRef(0),y=a.useRef(0),E=a.useRef("none"),I=a.useRef(!1),T=a.useRef(!1),X=a.useRef(!1),k=a.useRef(null),[B,P]=a.useState(null),[C,z]=a.useState("opening"),[v,_]=a.useState(0),[R,Z]=a.useState(0),[A,U]=a.useState(!1),[V,G]=a.useState(!1),[ne,$]=a.useState(!1),M=a.useRef(n),N=t[n],Q=N?Ta(N):!1,ie=R!==0||A,F=a.useCallback(ue=>{X.current=ue,U(ue)},[]),pe=a.useCallback(()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)},[]),x=a.useCallback(()=>{pe(),k.current=window.setTimeout(()=>{pe(),F(!1)},Rn+32)},[pe,F]),se=a.useCallback(()=>{const ue=S.current,fe=L.current;if(!ue)return;const Se=ue.getBoundingClientRect(),D=Se.width,oe=Se.height;if(!D||!oe)return;if(i==="cover"){P({width:D,height:oe,left:Se.left,top:Se.top});return}if(!fe){P(Jo(ue));return}const{width:he,height:be}=l0(fe);if(!he||!be){P(Jo(ue));return}const Ie=he/be,xe=D/oe;if(Ie>xe){const W=D/Ie;P({width:D,height:W,left:Se.left,top:Se.top+(oe-W)/2})}else{const W=oe*Ie;P({width:W,height:oe,left:Se.left+(D-W)/2,top:Se.top})}},[i]);a.useEffect(()=>{se();const ue=S.current;if(!ue)return;const fe=new ResizeObserver(()=>se());return fe.observe(ue),()=>fe.disconnect()},[se,n]),a.useEffect(()=>{C==="opening"&&B&&z("open")},[C,B]),a.useEffect(()=>{if(C!=="closing")return;const ue=setTimeout(()=>l(),Rn);return()=>clearTimeout(ue)},[C,l]),a.useEffect(()=>()=>{pe()},[pe]),a.useLayoutEffect(()=>{if(M.current===n)return;pe(),_(0),Z(0),F(!1),$(!1),G(!1),h.current=0,y.current=0,E.current="none",I.current=!1,f.current=null,T.current=!1;const ue=S.current;ue&&P(Jo(ue)),M.current=n},[n,F,pe]),a.useEffect(()=>{if(C!=="open")return;let ue=null;const fe=()=>{ue&&(document.removeEventListener("click",ue,!0),ue=null)},Se=()=>{fe(),ue=xe=>{xe.stopPropagation(),xe.preventDefault(),fe()},document.addEventListener("click",ue,!0)},D=xe=>{pe(),X.current=!1,U(!1),Z(0),G(!1),I.current=!1,y.current=0,E.current="none";const W=S.current;W&&P(Jo(W)),xe<0?d():s()},oe=xe=>{if(Math.abs(xe)>Qv&&t.length>1){D(xe);return}F(!0),Z(0),x()},he=xe=>{if(xe.touches.length!==1||X.current)return;const W=xe.touches[0];T.current=!0,f.current={x:W.clientX,y:W.clientY},E.current="none",y.current=0,I.current=!1},be=xe=>{if(!f.current||xe.touches.length!==1||X.current)return;const W=xe.touches[0],ae=W.clientX-f.current.x,te=W.clientY-f.current.y;if(E.current==="none"){if(Math.abs(ae)<10&&Math.abs(te)<10)return;if(Math.abs(ae)>Math.abs(te)){if(t.length<=1)return;E.current="horizontal"}else if(te>0)E.current="vertical";else return}if(E.current==="horizontal"){I.current=!0,G(!0),y.current=ae,Z(ae),xe.preventDefault();return}E.current==="vertical"&&(I.current=!0,G(!0),h.current=te,_(te),xe.preventDefault())},Ie=()=>{if(!f.current)return;const xe=E.current,W=I.current;if(W&&xe==="horizontal")oe(y.current),Se();else if(W&&xe==="vertical")if(h.current>Jv){const te=window.innerHeight;h.current=te,$(!0),_(te),z("closing")}else h.current=0,_(0),Se();else xe==="horizontal"&&Math.abs(y.current)>0&&(oe(y.current),Se());f.current=null,E.current="none",y.current=0,I.current=!1,G(!1)};return document.addEventListener("touchstart",he,{passive:!0}),document.addEventListener("touchmove",be,{passive:!1}),document.addEventListener("touchend",Ie),document.addEventListener("touchcancel",Ie),()=>{document.removeEventListener("touchstart",he),document.removeEventListener("touchmove",be),document.removeEventListener("touchend",Ie),document.removeEventListener("touchcancel",Ie),fe()}},[C,t.length,d,s,F,x,pe]),a.useEffect(()=>{const ue=fe=>{fe.key==="Escape"&&(fe.preventDefault(),fe.stopPropagation(),C!=="closing"&&z("closing"))};return window.addEventListener("keydown",ue,!0),()=>window.removeEventListener("keydown",ue,!0)},[C]);const J=()=>{C!=="closing"&&z("closing")},ye=C==="open",Me=C==="closing",de=v>0?Math.max(0,1-v/500):1,ce=v>0?Math.max(.35,1-v/500):1,q=ue=>{if(ue.stopPropagation(),T.current){T.current=!1;return}if(t.length<=1)return;const fe=ue.currentTarget.getBoundingClientRect(),Se=ue.clientY-fe.top,D=Math.min(52,fe.height*.2);if(!(Se>fe.height-D)){if(ue.clientX-fe.left<fe.width/2){s();return}d()}},ee=ue=>{if(t.length<=1)return;const fe=ue.currentTarget.getBoundingClientRect(),Se=ue.clientX-fe.left,D=ue.clientY-fe.top,oe=Math.min(52,fe.height*.2);if(D>fe.height-oe){ue.currentTarget.style.cursor="default";return}ue.currentTarget.style.cursor=Se<fe.width/2?"w-resize":"e-resize"},me=a.useCallback(ue=>{ue.propertyName!=="transform"||!X.current||(pe(),F(!1))},[pe,F]),Fe=ie?`translateX(${R}px)`:v>0?`translateY(${v}px)`:void 0,Ce={position:"fixed",top:B==null?void 0:B.top,left:B==null?void 0:B.left,width:B==null?void 0:B.width,height:B==null?void 0:B.height,objectFit:i==="cover"?"cover":"contain",transform:Fe,opacity:v>0?ce:C==="opening"||Me?0:1,transition:V&&!A?"none":A?`transform ${Rn}ms ${ci}`:ne?`transform ${Rn}ms ${ci}, opacity ${Rn}ms ${ci}`:C==="opening"||Me?`opacity ${Rn}ms ${ci}`:"none",pointerEvents:Q&&ye&&!ie?"auto":"none",touchAction:Q&&ye?"none":void 0,zIndex:9998},Ae=B?{position:"fixed",top:B.top,height:B.height,width:B.width/2,zIndex:9999}:null;return r.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:C==="open"?"none":void 0},onClick:J,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:ye?de:0,transition:V?"none":`opacity ${Rn}ms ${ci}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:b?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:S,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${Rn}ms ${ci}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:S,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ye?1:0,transition:`opacity ${Rn}ms ${ci}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),B&&N&&(Q?r.jsx(p0,{src:N.url,phase:C,mediaRef:L,mediaStyle:Ce,onLoadedMetadata:se,onClick:q,onMouseMove:ee,onTransitionEnd:me},`${n}-${N.url}`):r.jsx("img",{ref:L,src:N.url,alt:N.name,onLoad:se,onTransitionEnd:me,style:Ce},`${n}-${N.url}`)),ye&&Ae&&t.length>1&&!Q&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...Ae,left:B.left,cursor:"w-resize",pointerEvents:ie?"none":"auto"},onClick:ue=>{if(T.current){T.current=!1;return}ue.stopPropagation(),s()}}),r.jsx("div",{style:{...Ae,left:B.left+B.width/2,cursor:"e-resize",pointerEvents:ie?"none":"auto"},onClick:ue=>{if(T.current){T.current=!1;return}ue.stopPropagation(),d()}})]})]})}function ws({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:l,isEditor:s,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const b=`${e}-gallery-${Ta(t)?"video":"image"}`,S=l.display==="cover",L=d0(l),f=C=>w.scalingValue(C,s??!1),h=n??Mi,y=o?{width:"100%",maxWidth:"100%"}:{width:f(h),maxWidth:"100%"},E=i?{borderRadius:f(i)}:{},I={...y,...S?{aspectRatio:L,height:"auto",overflow:"hidden"}:{},...E},T={...S?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":f(h)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...S?{}:E},k={className:b,style:T,onClick:p?C=>{C.stopPropagation(),p()}:void 0},B=Math.max(d,di),P=Ta(t)?r.jsx("video",{...k,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):r.jsx("img",{...k,src:t.url,alt:t.name??""});return r.jsxs("div",{className:`${e}-gallery-item`,children:[S?r.jsx("div",{style:I,children:P}):P,c&&d>0&&r.jsx("div",{className:`${e}-padding-handle`,style:{height:f(d)},"aria-hidden":"true"}),u&&c&&r.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:f(B)}})]})}function g0({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:l,galleryPaddingLeftWidth:s,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const b=t==="a"?i:t==="c"?o:0,S=b>0||c;return r.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&S&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&t==="c"&&r.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(s),height:"100%"}}),r.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&S&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&t==="a"&&r.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(l),height:"100%"}})]})}function h0(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Ss({P:e,scaled:t,height:n,paired:i}){return r.jsx("div",{"data-controls":"titleTopPadding",...i?{"data-controls-paired":""}:{},"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{top:0,left:0,width:"100%",height:t(n)}})}function $s({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:l,paired:s,anchorStyle:d}){return r.jsx("div",{"data-controls":t,...s?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...l==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...l==="left"?{left:0}:{right:0},width:n(i),height:"100%",...d}})}function ca({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:l,titleTextBoxStyle:s,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=a.useRef(null),[b,S]=a.useState(0),L=t??"",f=n==="left"||n==="center"||n==="right";return a.useLayoutEffect(()=>{if(!f)return;const h=p.current;if(!h||typeof ResizeObserver>"u")return;const y=()=>S(h.offsetHeight);y();const E=new ResizeObserver(y);return E.observe(h),()=>E.disconnect()},[L,f]),r.jsx("div",{ref:h=>{p.current=h,i(h)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...f?{[`--${e}-title-height`]:`${b}px`}:{},...l},children:r.jsxs("div",{className:`${e}-title-text-stack`,style:s,children:[u,r.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:r.jsx("span",{className:`${e}-title-text`,style:d,children:L})})]})})}const Cs=45;function Ts(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const l=parseFloat(o);if(!Number.isNaN(l))return l}i=i.parentElement}return n}function f0(e){const t=Ts(e,"--cntrl-viewport-height",window.innerHeight),n=Ts(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function y0(e,t,n){const{top:i,centerY:o}=f0(n);if(t==="top"){const s=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-s)}const l=e.top+e.height/2;return Math.abs(l-o)}function v0(e,t,n){const i=Array.from({length:t},(s,d)=>{const c=e.current[d];if(!c)return 0;const u=c.getBoundingClientRect(),p=y0(u,n,c);return Math.exp(-(p*p)/(2*Cs*Cs))});let o=0,l=-1;return i.forEach((s,d)=>{s>l&&(l=s,o=d)}),{opacities:i,dominantIndex:o}}function x0(e,t,n){const i=a.useRef([]),[{opacities:o,dominantIndex:l},s]=a.useState(()=>({opacities:Array.from({length:e},(c,u)=>u===0?1:0),dominantIndex:0}));return a.useLayoutEffect(()=>{if(!t||e===0){s({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let c=0;const u=()=>{s(v0(i,e,n))},p=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:c=>u=>{i.current[c]=u},opacities:o,dominantIndex:l}}function b0(e,t){const[n,i]=a.useState(e),o=a.useRef(e);return a.useEffect(()=>{if(!t){o.current=e,i(e);return}const l=Array.from(o.current),s=Array.from(e),d=Math.max(l.length,s.length);if(d===0||o.current===e)return;let c=0;const u=window.setInterval(()=>{c+=1;const p=[...s.slice(0,c),...l.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function w0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:l}){var pt;const{prefix:s}=w.useScopedStyles(),d=a.useMemo(()=>Yv(s),[s]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",b=(e==null?void 0:e.imgWidth)??Mi,S=(e==null?void 0:e.titleWidth)??s0,L=c0(e==null?void 0:e.imageDisplay),f=(e==null?void 0:e.cornerRadius)??Kv,h=(e==null?void 0:e.position)??"center",y=(e==null?void 0:e.titleTopPadding)??0,E=(e==null?void 0:e.titleLeftPadding)??0,I=(e==null?void 0:e.titleRightPadding)??0,T=h0(e==null?void 0:e.transition),X=(e==null?void 0:e.lightbox)??"on",k=p==="b",B=T==="fade"||T==="retype",{setTitleRef:P,dominantIndex:C}=x0(c.length,B,h),z=((pt=c[C])==null?void 0:pt.title)??"",v=b0(z,T==="retype"),_=T==="fade"||T==="retype",R=T==="retype"?v:z,Z=k?void 0:{width:w.scalingValue(b,n??!1)},A=X==="on"&&(!n||i||o),U=o??!1,V=(e==null?void 0:e.galleryPaddingRight)??0,G=(e==null?void 0:e.galleryPaddingLeft)??0,ne=(e==null?void 0:e.galleryPaddingBetween)??0,$=mt=>w.scalingValue(mt,n??!1),N={width:$(S)},Q=p==="a"?V:G,ie=k?{width:"100%"}:{width:`calc(100% - ${$(b)} - ${$(Q)})`,...p==="c"?{marginLeft:"auto"}:{}},F=Math.max(V,di),pe=Math.max(G,di),x=Math.max(ne,di),se=Math.max(y,di),J=Math.max(E,di),ye=Math.max(I,di),Me=Math.max(0,(u??1)-(b??Mi)),de=p==="a"?Math.max(0,(u??1)-(b??Mi)-V):p==="c"?Math.max(0,(u??1)-(b??Mi)-G):p==="b"?u??1:1,ce=U&&(p==="a"||p==="b"||p==="c")&&h==="top",q=U&&((p==="a"||p==="b")&&(h==="left"||h==="top")||p==="c"&&(h==="left"||h==="top")),ee=U&&((p==="c"||p==="b")&&h==="right"||p==="a"&&h==="right"),me=c.length>1,Fe=k?void 0:$((p==="c"?G:V)+(b??Mi)),Ce=p==="c"&&Fe?{left:Fe}:void 0,Ae=p==="a"&&Fe?{right:Fe}:void 0,ue=k?{left:0,width:"100%"}:p==="a"?{right:$(V),width:$(b)}:{left:$(G),width:$(b)},{titleColor:fe,titleFontFamily:Se,titleFontSettings:D,titleFontSize:oe,titleLineHeight:he,titleLetterSpacing:be,titleWordSpacing:Ie,titleAlign:xe,titleTextAppearance:W,lightboxCounterColor:ae,lightboxCounterFontFamily:te,lightboxCounterFontSettings:j,lightboxCounterFontSize:Y,lightboxCounterLineHeight:Re,lightboxCounterLetterSpacing:le,lightboxCounterWordSpacing:H,lightboxCounterTextAppearance:De}=e??{},_e={fontSettings:{fontFamily:Se,fontWeight:(D==null?void 0:D.fontWeight)??400,fontStyle:(D==null?void 0:D.fontStyle)??"normal"},fontSize:oe??.01,lineHeight:he,letterSpacing:be??0,wordSpacing:Ie??0,textAlign:xe??"left",textAppearance:W,color:fe??"#000000"},Qe=on(Vt(_e,n)),at=N,$e=bs(oe,he,s,n),ge=xs(oe,he,`${s}-title`,`${s}-text-tight-leading`),je={fontSettings:{fontFamily:te,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:Y??.01,lineHeight:Re,letterSpacing:le??0,wordSpacing:H??0,textAppearance:De,color:ae??"#DEDDDD"},Ye={...on(Vt(je,n)),...bs(Y,Re,s,n)},Oe=xs(Y,Re,`${s}-lightbox-counter`,`${s}-text-tight-leading`),Le=w.buildColorVars(s,{titleColor:fe??"#000000",lightboxCounterColor:ae??"#DEDDDD"},e0,t0),He=a.useRef(null),[Xe,ut]=a.useState(!1),[xt,it]=a.useState([]),[wt,lt]=a.useState(0),Ue=a.useCallback((mt,gt)=>{A&&(it(mt),lt(gt),ut(!0))},[A]),Ke=a.useCallback(()=>{ut(!1)},[]),Ne=a.useMemo(()=>{const mt={...Le},gt=He.current?getComputedStyle(He.current).getPropertyValue("--cntrl-article-width").trim():"";return gt&&(mt["--cntrl-article-width"]=gt),mt},[Le,Xe]);return a.useEffect(()=>{if(!Xe||X!=="on"||typeof document>"u")return;const mt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=mt}},[Xe,X]),a.useEffect(()=>{!n||o||i||ut(!1)},[n,o,i]),a.useEffect(()=>{X==="off"&&ut(!1)},[X]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),r.jsx("div",{style:Le,children:r.jsxs("div",{ref:He,className:`${s}-wrapper`,style:{width:w.scalingValue(u,n??!1),[`--${s}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&h==="top"?$(y):void 0,[`--${s}-title-left-padding`]:(p==="a"||p==="b")&&(h==="left"||h==="top")||p==="c"&&(h==="left"||h==="top")?$(E):void 0,[`--${s}-title-right-padding`]:(p==="c"||p==="b")&&h==="right"||p==="a"&&h==="right"?$(I):void 0},children:[_&&r.jsx("div",{className:`${s}-single-title-layer`,children:r.jsx(ca,{P:s,title:R,position:h,titleRef:()=>{},titleClassName:`${ge} ${s}-single-title`,titleContainerStyle:{...$e,...ie},titleTextBoxStyle:at,titleStyle:Qe,showTextBoxOutline:U,topPaddingControl:ce?Ss({P:s,scaled:$,height:se,paired:!1}):void 0})}),c.map((mt,gt)=>{const Pt=r0(mt.gallery),Zt=gt<c.length-1,tn=Pt.filter(Ct=>Ct.lightboxMedia).map(Ct=>Ct.lightboxMedia),Tt={P:s,position:h,titleRef:P(gt),titleClassName:ge,titleContainerStyle:$e,titleTextBoxStyle:_?{maxWidth:"100%"}:at,titleStyle:Qe,showTextBoxOutline:U&&!_,topPaddingControl:ce&&!_?Ss({P:s,scaled:$,height:se,paired:me}):void 0};return r.jsxs("div",{"data-item-index":gt,className:`${s}-item ${s}-item-${p}`,style:{paddingBottom:Zt?$(ne):void 0},children:[q&&$s({P:s,controlKey:"titleLeftPadding",scaled:$,width:J,maxFraction:de,side:"left",paired:me,anchorStyle:Ce}),ee&&$s({P:s,controlKey:"titleRightPadding",scaled:$,width:ye,maxFraction:de,side:"right",paired:me,anchorStyle:Ae}),U&&Zt&&r.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${s}-control-anchor`,style:{bottom:0,height:$(x),...ue}}),k?r.jsxs("div",{className:`${s}-gallery`,children:[r.jsx("div",{className:`${s}-gallery-media`,children:Pt.map(({displayMedia:Ct,lightboxMedia:Ft},Ot)=>{const Te=Ft?tn.findIndex(Be=>Be.url===Ft.url):-1;return r.jsx(ws,{P:s,media:Ct,imgWidth:b||void 0,cornerRadius:f||void 0,imageDisplay:L,isEditor:n,galleryPaddingBetween:ne,showPaddingAfter:Ot<Pt.length-1,showControls:U,onMediaClick:A&&Te>=0?()=>Ue(tn,Te):void 0},`${Ct.url}-${Ot}`)})}),r.jsx("div",{className:`${s}-title-layer`,children:r.jsx(ca,{...Tt,title:_?"":mt.title})})]}):r.jsxs(r.Fragment,{children:[r.jsx(ca,{...Tt,title:_?"":mt.title}),Pt.length>0&&r.jsx(g0,{P:s,layoutType:p,galleryWidthStyle:Z,galleryPaddingRight:V,galleryPaddingLeft:G,galleryPaddingRightWidth:F,galleryPaddingLeftWidth:pe,galleryPaddingMaxFraction:Me,showControls:U,scaled:$,children:Pt.map(({displayMedia:Ct,lightboxMedia:Ft},Ot)=>{const Te=Ft?tn.findIndex(Be=>Be.url===Ft.url):-1;return r.jsx(ws,{P:s,media:Ct,cornerRadius:f||void 0,fillGalleryWidth:!0,imageDisplay:L,isEditor:n,galleryPaddingBetween:ne,showPaddingAfter:Ot<Pt.length-1,showControls:U,onMediaClick:A&&Te>=0?()=>Ue(tn,Te):void 0},`${Ct.url}-${Ot}`)})})]})]},gt)})]})}),Xe&&X==="on"&&typeof document<"u"&&e&&(()=>{const mt=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Ne,"data-selection":"none",children:r.jsx(m0,{prefix:s,items:xt,index:wt,imageDisplay:u0(e.lightboxImageDisplay),isEditor:n,onClose:Ke,onPrev:()=>lt(gt=>(gt-1+xt.length)%xt.length),onNext:()=>lt(gt=>(gt+1)%xt.length),counterClassName:Oe,counterStyle:Ye,backgroundColor:e.backgroundColor??Zv})}),mt)})()]})}const S0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
19487
19666
|
import { createPortal } from 'react-dom';
|
|
19488
19667
|
import type React from 'react';
|
|
19489
19668
|
import { CommonComponentProps } from '../props';
|
|
@@ -19548,6 +19727,9 @@ function getCSS(P: string): string {
|
|
|
19548
19727
|
inset: 0;
|
|
19549
19728
|
z-index: 2;
|
|
19550
19729
|
pointer-events: none;
|
|
19730
|
+
display: flex;
|
|
19731
|
+
flex-direction: column;
|
|
19732
|
+
justify-content: flex-start;
|
|
19551
19733
|
}
|
|
19552
19734
|
.\${P}-single-title {
|
|
19553
19735
|
pointer-events: none;
|
|
@@ -19562,10 +19744,10 @@ function getCSS(P: string): string {
|
|
|
19562
19744
|
flex-direction: row;
|
|
19563
19745
|
}
|
|
19564
19746
|
.\${P}-item-b {
|
|
19565
|
-
flex-direction:
|
|
19747
|
+
flex-direction: column;
|
|
19566
19748
|
}
|
|
19567
19749
|
.\${P}-item-c {
|
|
19568
|
-
flex-direction:
|
|
19750
|
+
flex-direction: row-reverse;
|
|
19569
19751
|
}
|
|
19570
19752
|
.\${P}-title {
|
|
19571
19753
|
align-self: flex-start;
|
|
@@ -19574,13 +19756,13 @@ function getCSS(P: string): string {
|
|
|
19574
19756
|
min-width: 0;
|
|
19575
19757
|
box-sizing: border-box;
|
|
19576
19758
|
position: sticky;
|
|
19577
|
-
z-index:
|
|
19759
|
+
z-index: 2;
|
|
19760
|
+
overflow: visible;
|
|
19578
19761
|
color: var(--\${P}-title-color);
|
|
19579
19762
|
}
|
|
19580
19763
|
.\${P}-title-text {
|
|
19581
19764
|
display: block;
|
|
19582
19765
|
width: 100%;
|
|
19583
|
-
max-width: 100%;
|
|
19584
19766
|
white-space: pre-wrap;
|
|
19585
19767
|
overflow-wrap: anywhere;
|
|
19586
19768
|
word-break: break-word;
|
|
@@ -19588,41 +19770,76 @@ function getCSS(P: string): string {
|
|
|
19588
19770
|
.\${P}-title-text-inner {
|
|
19589
19771
|
display: flex;
|
|
19590
19772
|
flex-direction: column;
|
|
19773
|
+
flex-shrink: 0;
|
|
19591
19774
|
box-sizing: border-box;
|
|
19592
|
-
min-width: 0;
|
|
19593
19775
|
outline: 1px solid #FF5C02;
|
|
19594
19776
|
}
|
|
19595
19777
|
.\${P}-title-text-inner-hidden {
|
|
19596
19778
|
display: flex;
|
|
19597
19779
|
flex-direction: column;
|
|
19780
|
+
flex-shrink: 0;
|
|
19598
19781
|
box-sizing: border-box;
|
|
19782
|
+
}
|
|
19783
|
+
.\${P}-title-text-stack {
|
|
19784
|
+
display: flex;
|
|
19785
|
+
flex-direction: column;
|
|
19786
|
+
flex-shrink: 0;
|
|
19599
19787
|
min-width: 0;
|
|
19788
|
+
position: relative;
|
|
19789
|
+
box-sizing: border-box;
|
|
19790
|
+
}
|
|
19791
|
+
.\${P}-item-a .\${P}-title-position-top .\${P}-title-text-stack,
|
|
19792
|
+
.\${P}-item-b .\${P}-title-position-top .\${P}-title-text-stack,
|
|
19793
|
+
.\${P}-item-c .\${P}-title-position-top .\${P}-title-text-stack,
|
|
19794
|
+
.\${P}-single-title-layer .\${P}-title-position-top .\${P}-title-text-stack {
|
|
19795
|
+
padding-top: var(--\${P}-title-top-padding, 0);
|
|
19600
19796
|
}
|
|
19601
19797
|
.\${P}-title-position-left,
|
|
19602
19798
|
.\${P}-title-position-center,
|
|
19603
19799
|
.\${P}-title-position-right {
|
|
19604
|
-
top: calc(
|
|
19800
|
+
top: calc(var(--cntrl-article-top, 0px) + var(--cntrl-viewport-height, 100vh) / 2 - (var(--\${P}-title-height, 0px) / 2));
|
|
19801
|
+
align-items: center;
|
|
19605
19802
|
}
|
|
19606
19803
|
.\${P}-title-position-top {
|
|
19607
|
-
top: var(
|
|
19804
|
+
top: var(--cntrl-article-top, 0px);
|
|
19608
19805
|
bottom: auto;
|
|
19609
19806
|
justify-content: flex-start;
|
|
19807
|
+
align-self: flex-start;
|
|
19610
19808
|
}
|
|
19611
19809
|
.\${P}-title-position-left {
|
|
19612
19810
|
justify-content: flex-start;
|
|
19613
19811
|
}
|
|
19812
|
+
.\${P}-item-a .\${P}-title-position-top,
|
|
19813
|
+
.\${P}-item-a .\${P}-title-position-left,
|
|
19814
|
+
.\${P}-item-b .\${P}-title-position-top,
|
|
19815
|
+
.\${P}-item-b .\${P}-title-position-left,
|
|
19816
|
+
.\${P}-item-c .\${P}-title-position-top,
|
|
19817
|
+
.\${P}-item-c .\${P}-title-position-left,
|
|
19818
|
+
.\${P}-single-title-layer .\${P}-title-position-top,
|
|
19819
|
+
.\${P}-single-title-layer .\${P}-title-position-left {
|
|
19820
|
+
padding-left: var(--\${P}-title-left-padding, 0);
|
|
19821
|
+
}
|
|
19614
19822
|
.\${P}-title-position-center {
|
|
19615
19823
|
justify-content: center;
|
|
19616
19824
|
}
|
|
19617
19825
|
.\${P}-title-position-right {
|
|
19618
19826
|
justify-content: flex-end;
|
|
19619
19827
|
}
|
|
19828
|
+
.\${P}-item-a .\${P}-title-position-right,
|
|
19829
|
+
.\${P}-item-b .\${P}-title-position-right,
|
|
19830
|
+
.\${P}-item-c .\${P}-title-position-right,
|
|
19831
|
+
.\${P}-single-title-layer .\${P}-title-position-right {
|
|
19832
|
+
padding-right: var(--\${P}-title-right-padding, 0);
|
|
19833
|
+
}
|
|
19620
19834
|
.\${P}-item-a .\${P}-title,
|
|
19621
|
-
.\${P}-item-
|
|
19835
|
+
.\${P}-item-c .\${P}-title {
|
|
19622
19836
|
flex: 1;
|
|
19623
19837
|
width: auto;
|
|
19838
|
+
min-width: 0;
|
|
19839
|
+
overflow: visible;
|
|
19624
19840
|
}
|
|
19625
|
-
.\${P}-item-
|
|
19841
|
+
.\${P}-item-b .\${P}-title,
|
|
19842
|
+
.\${P}-single-title-layer .\${P}-title {
|
|
19626
19843
|
width: 100%;
|
|
19627
19844
|
pointer-events: none;
|
|
19628
19845
|
}
|
|
@@ -19633,11 +19850,11 @@ function getCSS(P: string): string {
|
|
|
19633
19850
|
flex-shrink: 0;
|
|
19634
19851
|
box-sizing: border-box;
|
|
19635
19852
|
}
|
|
19636
|
-
.\${P}-item-
|
|
19853
|
+
.\${P}-item-b .\${P}-gallery {
|
|
19637
19854
|
display: grid;
|
|
19638
19855
|
width: 100%;
|
|
19639
19856
|
}
|
|
19640
|
-
.\${P}-item-
|
|
19857
|
+
.\${P}-item-b .\${P}-gallery-media {
|
|
19641
19858
|
grid-area: 1 / 1;
|
|
19642
19859
|
display: flex;
|
|
19643
19860
|
flex-direction: column;
|
|
@@ -19645,13 +19862,17 @@ function getCSS(P: string): string {
|
|
|
19645
19862
|
width: 100%;
|
|
19646
19863
|
min-width: 0;
|
|
19647
19864
|
}
|
|
19648
|
-
.\${P}-item-
|
|
19865
|
+
.\${P}-item-b .\${P}-title-layer {
|
|
19649
19866
|
grid-area: 1 / 1;
|
|
19650
19867
|
align-self: stretch;
|
|
19651
19868
|
width: 100%;
|
|
19652
19869
|
min-width: 0;
|
|
19653
|
-
z-index:
|
|
19870
|
+
z-index: 2;
|
|
19871
|
+
overflow: visible;
|
|
19654
19872
|
pointer-events: none;
|
|
19873
|
+
display: flex;
|
|
19874
|
+
flex-direction: column;
|
|
19875
|
+
justify-content: flex-start;
|
|
19655
19876
|
}
|
|
19656
19877
|
.\${P}-gallery-item {
|
|
19657
19878
|
position: relative;
|
|
@@ -19666,16 +19887,12 @@ function getCSS(P: string): string {
|
|
|
19666
19887
|
max-width: 100%;
|
|
19667
19888
|
height: auto;
|
|
19668
19889
|
}
|
|
19669
|
-
.\${P}-gallery-caption {
|
|
19670
|
-
width: 100%;
|
|
19671
|
-
box-sizing: border-box;
|
|
19672
|
-
text-align: center;
|
|
19673
|
-
}
|
|
19674
19890
|
.\${P}-gallery-controls {
|
|
19675
19891
|
position: relative;
|
|
19676
19892
|
display: flex;
|
|
19677
19893
|
flex-shrink: 0;
|
|
19678
19894
|
box-sizing: border-box;
|
|
19895
|
+
z-index: 1;
|
|
19679
19896
|
}
|
|
19680
19897
|
.\${P}-gallery-edge-spacer {
|
|
19681
19898
|
flex-shrink: 0;
|
|
@@ -19751,9 +19968,10 @@ export type MercurySettings = {
|
|
|
19751
19968
|
galleryPaddingLeft?: number;
|
|
19752
19969
|
galleryPaddingBetween?: number;
|
|
19753
19970
|
cornerRadius?: number;
|
|
19754
|
-
imgCaption?: 'on' | 'off';
|
|
19755
19971
|
position?: 'left' | 'center' | 'right' | 'top';
|
|
19756
19972
|
titleTopPadding?: number;
|
|
19973
|
+
titleLeftPadding?: number;
|
|
19974
|
+
titleRightPadding?: number;
|
|
19757
19975
|
transition?: 'fade' | 'retype' | 'scroll';
|
|
19758
19976
|
titleColor?: string;
|
|
19759
19977
|
titleFontFamily?: string;
|
|
@@ -20682,26 +20900,26 @@ function GalleryWithEdgePadding({
|
|
|
20682
20900
|
}) {
|
|
20683
20901
|
const edgePadding = layoutType === 'a'
|
|
20684
20902
|
? galleryPaddingRight
|
|
20685
|
-
: layoutType === '
|
|
20903
|
+
: layoutType === 'c'
|
|
20686
20904
|
? galleryPaddingLeft
|
|
20687
20905
|
: 0;
|
|
20688
20906
|
const edgePaddingWidth = layoutType === 'a'
|
|
20689
20907
|
? galleryPaddingRightWidth
|
|
20690
|
-
: layoutType === '
|
|
20908
|
+
: layoutType === 'c'
|
|
20691
20909
|
? galleryPaddingLeftWidth
|
|
20692
20910
|
: 0;
|
|
20693
20911
|
const showEdgeSpacer = edgePadding > 0 || showControls;
|
|
20694
20912
|
|
|
20695
20913
|
return (
|
|
20696
20914
|
<div className={\`\${P}-gallery-controls\`}>
|
|
20697
|
-
{layoutType === '
|
|
20915
|
+
{layoutType === 'c' && showEdgeSpacer && (
|
|
20698
20916
|
<div
|
|
20699
20917
|
className={\`\${P}-gallery-edge-spacer\`}
|
|
20700
20918
|
style={{ width: scaled(edgePadding) }}
|
|
20701
20919
|
aria-hidden="true"
|
|
20702
20920
|
/>
|
|
20703
20921
|
)}
|
|
20704
|
-
{showControls && layoutType === '
|
|
20922
|
+
{showControls && layoutType === 'c' && (
|
|
20705
20923
|
<div
|
|
20706
20924
|
data-controls="galleryPaddingLeft"
|
|
20707
20925
|
data-controls-axis="x"
|
|
@@ -20765,6 +20983,75 @@ function resolveTransition(value?: string): MercuryTransition {
|
|
|
20765
20983
|
}
|
|
20766
20984
|
}
|
|
20767
20985
|
|
|
20986
|
+
function renderTitleTopPaddingControl({
|
|
20987
|
+
P,
|
|
20988
|
+
scaled,
|
|
20989
|
+
height,
|
|
20990
|
+
paired,
|
|
20991
|
+
}: {
|
|
20992
|
+
P: string;
|
|
20993
|
+
scaled: (value: number) => string;
|
|
20994
|
+
height: number;
|
|
20995
|
+
paired: boolean;
|
|
20996
|
+
}) {
|
|
20997
|
+
return (
|
|
20998
|
+
<div
|
|
20999
|
+
data-controls="titleTopPadding"
|
|
21000
|
+
{...(paired ? { 'data-controls-paired': '' } : {})}
|
|
21001
|
+
data-controls-axis="y"
|
|
21002
|
+
data-controls-variant="row-padding"
|
|
21003
|
+
data-controls-min="0"
|
|
21004
|
+
className={\`\${P}-control-anchor\`}
|
|
21005
|
+
style={{
|
|
21006
|
+
top: 0,
|
|
21007
|
+
left: 0,
|
|
21008
|
+
width: '100%',
|
|
21009
|
+
height: scaled(height),
|
|
21010
|
+
}}
|
|
21011
|
+
/>
|
|
21012
|
+
);
|
|
21013
|
+
}
|
|
21014
|
+
|
|
21015
|
+
function renderTitleColumnPaddingControl({
|
|
21016
|
+
P,
|
|
21017
|
+
controlKey,
|
|
21018
|
+
scaled,
|
|
21019
|
+
width,
|
|
21020
|
+
maxFraction,
|
|
21021
|
+
side,
|
|
21022
|
+
paired,
|
|
21023
|
+
anchorStyle,
|
|
21024
|
+
}: {
|
|
21025
|
+
P: string;
|
|
21026
|
+
controlKey: 'titleLeftPadding' | 'titleRightPadding';
|
|
21027
|
+
scaled: (value: number) => string;
|
|
21028
|
+
width: number;
|
|
21029
|
+
maxFraction: number;
|
|
21030
|
+
side: 'left' | 'right';
|
|
21031
|
+
paired: boolean;
|
|
21032
|
+
anchorStyle?: React.CSSProperties;
|
|
21033
|
+
}) {
|
|
21034
|
+
return (
|
|
21035
|
+
<div
|
|
21036
|
+
data-controls={controlKey}
|
|
21037
|
+
{...(paired ? { 'data-controls-paired': '' } : {})}
|
|
21038
|
+
data-controls-axis="x"
|
|
21039
|
+
data-controls-variant="column-padding"
|
|
21040
|
+
{...(side === 'right' ? { 'data-controls-reverse': '' } : {})}
|
|
21041
|
+
data-controls-min="0"
|
|
21042
|
+
data-controls-max-fraction={String(maxFraction)}
|
|
21043
|
+
className={\`\${P}-control-anchor\`}
|
|
21044
|
+
style={{
|
|
21045
|
+
top: 0,
|
|
21046
|
+
...(side === 'left' ? { left: 0 } : { right: 0 }),
|
|
21047
|
+
width: scaled(width),
|
|
21048
|
+
height: '100%',
|
|
21049
|
+
...anchorStyle,
|
|
21050
|
+
}}
|
|
21051
|
+
/>
|
|
21052
|
+
);
|
|
21053
|
+
}
|
|
21054
|
+
|
|
20768
21055
|
function StickyTitle({
|
|
20769
21056
|
P,
|
|
20770
21057
|
title,
|
|
@@ -20775,6 +21062,7 @@ function StickyTitle({
|
|
|
20775
21062
|
titleTextBoxStyle,
|
|
20776
21063
|
titleStyle,
|
|
20777
21064
|
showTextBoxOutline = false,
|
|
21065
|
+
topPaddingControl,
|
|
20778
21066
|
}: {
|
|
20779
21067
|
P: string;
|
|
20780
21068
|
title?: string;
|
|
@@ -20785,12 +21073,16 @@ function StickyTitle({
|
|
|
20785
21073
|
titleTextBoxStyle: React.CSSProperties;
|
|
20786
21074
|
titleStyle: React.CSSProperties;
|
|
20787
21075
|
showTextBoxOutline?: boolean;
|
|
21076
|
+
topPaddingControl?: React.ReactNode;
|
|
20788
21077
|
}) {
|
|
20789
21078
|
const ref = useRef<HTMLDivElement | null>(null);
|
|
20790
21079
|
const [height, setHeight] = useState(0);
|
|
20791
21080
|
const displayedTitle = title ?? '';
|
|
21081
|
+
const usesViewportCenterSticky = position === 'left' || position === 'center' || position === 'right';
|
|
20792
21082
|
|
|
20793
21083
|
useLayoutEffect(() => {
|
|
21084
|
+
if (!usesViewportCenterSticky) return;
|
|
21085
|
+
|
|
20794
21086
|
const el = ref.current;
|
|
20795
21087
|
if (!el || typeof ResizeObserver === 'undefined') return;
|
|
20796
21088
|
|
|
@@ -20800,7 +21092,7 @@ function StickyTitle({
|
|
|
20800
21092
|
const observer = new ResizeObserver(updateHeight);
|
|
20801
21093
|
observer.observe(el);
|
|
20802
21094
|
return () => observer.disconnect();
|
|
20803
|
-
}, [displayedTitle]);
|
|
21095
|
+
}, [displayedTitle, usesViewportCenterSticky]);
|
|
20804
21096
|
|
|
20805
21097
|
return (
|
|
20806
21098
|
<div
|
|
@@ -20813,17 +21105,23 @@ function StickyTitle({
|
|
|
20813
21105
|
\`\${P}-title-position-\${position}\`,
|
|
20814
21106
|
].join(' ')}
|
|
20815
21107
|
style={{
|
|
20816
|
-
[\`--\${P}-title-height\`]: \`\${height}px
|
|
21108
|
+
...(usesViewportCenterSticky ? { [\`--\${P}-title-height\`]: \`\${height}px\` } : {}),
|
|
20817
21109
|
...titleContainerStyle,
|
|
20818
21110
|
} as React.CSSProperties}
|
|
20819
21111
|
>
|
|
20820
21112
|
<div
|
|
20821
|
-
className={
|
|
21113
|
+
className={\`\${P}-title-text-stack\`}
|
|
20822
21114
|
style={titleTextBoxStyle}
|
|
20823
21115
|
>
|
|
20824
|
-
|
|
20825
|
-
|
|
20826
|
-
|
|
21116
|
+
{topPaddingControl}
|
|
21117
|
+
<div
|
|
21118
|
+
className={showTextBoxOutline ? \`\${P}-title-text-inner\` : \`\${P}-title-text-inner-hidden\`}
|
|
21119
|
+
style={{ width: '100%' }}
|
|
21120
|
+
>
|
|
21121
|
+
<span className={\`\${P}-title-text\`} style={titleStyle}>
|
|
21122
|
+
{displayedTitle}
|
|
21123
|
+
</span>
|
|
21124
|
+
</div>
|
|
20827
21125
|
</div>
|
|
20828
21126
|
</div>
|
|
20829
21127
|
);
|
|
@@ -20831,15 +21129,35 @@ function StickyTitle({
|
|
|
20831
21129
|
|
|
20832
21130
|
const TITLE_CROSSFADE_SIGMA = 45;
|
|
20833
21131
|
|
|
21132
|
+
function readCssVarPx(element: HTMLElement | null | undefined, varName: string, fallback: number): number {
|
|
21133
|
+
let el: HTMLElement | null | undefined = element;
|
|
21134
|
+
while (el) {
|
|
21135
|
+
const raw = getComputedStyle(el).getPropertyValue(varName).trim();
|
|
21136
|
+
if (raw) {
|
|
21137
|
+
const parsed = parseFloat(raw);
|
|
21138
|
+
if (!Number.isNaN(parsed)) return parsed;
|
|
21139
|
+
}
|
|
21140
|
+
el = el.parentElement;
|
|
21141
|
+
}
|
|
21142
|
+
return fallback;
|
|
21143
|
+
}
|
|
21144
|
+
|
|
21145
|
+
function getPreviewViewportMetrics(element?: HTMLElement | null): { top: number; centerY: number } {
|
|
21146
|
+
const height = readCssVarPx(element, '--cntrl-viewport-height', window.innerHeight);
|
|
21147
|
+
const top = readCssVarPx(element, '--cntrl-article-top', 0);
|
|
21148
|
+
return { top, centerY: top + height / 2 };
|
|
21149
|
+
}
|
|
21150
|
+
|
|
20834
21151
|
function getTitleStickyDistance(rect: DOMRect, position: TitlePosition, element?: HTMLElement | null): number {
|
|
21152
|
+
const { top: viewportTop, centerY } = getPreviewViewportMetrics(element);
|
|
20835
21153
|
if (position === 'top') {
|
|
20836
21154
|
const stickyTop = element
|
|
20837
|
-
? parseFloat(getComputedStyle(element).top) ||
|
|
20838
|
-
:
|
|
21155
|
+
? parseFloat(getComputedStyle(element).top) || viewportTop
|
|
21156
|
+
: viewportTop;
|
|
20839
21157
|
return Math.abs(rect.top - stickyTop);
|
|
20840
21158
|
}
|
|
20841
21159
|
const titleCenter = rect.top + rect.height / 2;
|
|
20842
|
-
return Math.abs(titleCenter -
|
|
21160
|
+
return Math.abs(titleCenter - centerY);
|
|
20843
21161
|
}
|
|
20844
21162
|
|
|
20845
21163
|
function computeTitleTransitionState(
|
|
@@ -20978,9 +21296,11 @@ export function Mercury({
|
|
|
20978
21296
|
const cornerRadius = settings?.cornerRadius ?? DEFAULT_CORNER_RADIUS;
|
|
20979
21297
|
const position = settings?.position ?? 'center';
|
|
20980
21298
|
const titleTopPadding = settings?.titleTopPadding ?? 0;
|
|
21299
|
+
const titleLeftPadding = settings?.titleLeftPadding ?? 0;
|
|
21300
|
+
const titleRightPadding = settings?.titleRightPadding ?? 0;
|
|
20981
21301
|
const transition = resolveTransition(settings?.transition);
|
|
20982
21302
|
const lightbox = settings?.lightbox ?? 'on';
|
|
20983
|
-
const isOverlayLayout = layoutType === '
|
|
21303
|
+
const isOverlayLayout = layoutType === 'b';
|
|
20984
21304
|
const animateTransitions = transition === 'fade' || transition === 'retype';
|
|
20985
21305
|
const { setTitleRef, dominantIndex } = useTitleTransitionState(items.length, animateTransitions, position);
|
|
20986
21306
|
const activeTitle = items[dominantIndex]?.title ?? '';
|
|
@@ -20999,20 +21319,47 @@ export function Mercury({
|
|
|
20999
21319
|
const titleWidthStyle = scaled(titleWidth);
|
|
21000
21320
|
const titleTextWidthStyle: React.CSSProperties = {
|
|
21001
21321
|
width: titleWidthStyle,
|
|
21002
|
-
maxWidth: '100%',
|
|
21003
21322
|
};
|
|
21004
21323
|
const singleTitleGalleryEdgePadding = layoutType === 'a' ? galleryPaddingRight : galleryPaddingLeft;
|
|
21005
|
-
const singleTitleLayoutStyle: React.CSSProperties =
|
|
21006
|
-
? {
|
|
21324
|
+
const singleTitleLayoutStyle: React.CSSProperties = isOverlayLayout
|
|
21325
|
+
? { width: '100%' }
|
|
21326
|
+
: {
|
|
21007
21327
|
width: \`calc(100% - \${scaled(imgWidth)} - \${scaled(singleTitleGalleryEdgePadding)})\`,
|
|
21008
|
-
...(layoutType === '
|
|
21009
|
-
}
|
|
21010
|
-
: {};
|
|
21328
|
+
...(layoutType === 'c' ? { marginLeft: 'auto' } : {}),
|
|
21329
|
+
};
|
|
21011
21330
|
const galleryPaddingRightWidth = Math.max(galleryPaddingRight, PADDING_HANDLE_SIZE);
|
|
21012
21331
|
const galleryPaddingLeftWidth = Math.max(galleryPaddingLeft, PADDING_HANDLE_SIZE);
|
|
21013
21332
|
const galleryPaddingBetweenHeight = Math.max(galleryPaddingBetween, PADDING_HANDLE_SIZE);
|
|
21014
21333
|
const titleTopPaddingHeight = Math.max(titleTopPadding, PADDING_HANDLE_SIZE);
|
|
21334
|
+
const titleLeftPaddingWidth = Math.max(titleLeftPadding, PADDING_HANDLE_SIZE);
|
|
21335
|
+
const titleRightPaddingWidth = Math.max(titleRightPadding, PADDING_HANDLE_SIZE);
|
|
21015
21336
|
const galleryPaddingMaxFraction = Math.max(0, (wrapperWidth ?? 1) - (imgWidth ?? DEFAULT_IMG_WIDTH));
|
|
21337
|
+
const titleColumnMaxFraction = layoutType === 'a'
|
|
21338
|
+
? Math.max(0, (wrapperWidth ?? 1) - (imgWidth ?? DEFAULT_IMG_WIDTH) - galleryPaddingRight)
|
|
21339
|
+
: layoutType === 'c'
|
|
21340
|
+
? Math.max(0, (wrapperWidth ?? 1) - (imgWidth ?? DEFAULT_IMG_WIDTH) - galleryPaddingLeft)
|
|
21341
|
+
: layoutType === 'b'
|
|
21342
|
+
? (wrapperWidth ?? 1)
|
|
21343
|
+
: 1;
|
|
21344
|
+
const showTitleTopPaddingControl = showControls && (layoutType === 'a' || layoutType === 'b' || layoutType === 'c') && position === 'top';
|
|
21345
|
+
const showTitleLeftPaddingControl = showControls && (
|
|
21346
|
+
((layoutType === 'a' || layoutType === 'b') && (position === 'left' || position === 'top'))
|
|
21347
|
+
|| (layoutType === 'c' && (position === 'left' || position === 'top'))
|
|
21348
|
+
);
|
|
21349
|
+
const showTitleRightPaddingControl = showControls && (
|
|
21350
|
+
((layoutType === 'c' || layoutType === 'b') && position === 'right')
|
|
21351
|
+
|| (layoutType === 'a' && position === 'right')
|
|
21352
|
+
);
|
|
21353
|
+
const hasMultipleItems = items.length > 1;
|
|
21354
|
+
const titleGalleryInset = !isOverlayLayout
|
|
21355
|
+
? scaled((layoutType === 'c' ? galleryPaddingLeft : galleryPaddingRight) + (imgWidth ?? DEFAULT_IMG_WIDTH))
|
|
21356
|
+
: undefined;
|
|
21357
|
+
const titleLeftPaddingControlStyle: React.CSSProperties | undefined = layoutType === 'c' && titleGalleryInset
|
|
21358
|
+
? { left: titleGalleryInset }
|
|
21359
|
+
: undefined;
|
|
21360
|
+
const titleRightPaddingControlStyle: React.CSSProperties | undefined = layoutType === 'a' && titleGalleryInset
|
|
21361
|
+
? { right: titleGalleryInset }
|
|
21362
|
+
: undefined;
|
|
21016
21363
|
const entryPaddingControlStyle: React.CSSProperties = isOverlayLayout
|
|
21017
21364
|
? { left: 0, width: '100%' }
|
|
21018
21365
|
: layoutType === 'a'
|
|
@@ -21151,26 +21498,17 @@ export function Mercury({
|
|
|
21151
21498
|
className={\`\${P}-wrapper\`}
|
|
21152
21499
|
style={{
|
|
21153
21500
|
width: scalingValue(wrapperWidth, isEditor ?? false),
|
|
21154
|
-
[\`--\${P}-title-top-padding\`]: position === 'top' ? scaled(titleTopPadding) : undefined,
|
|
21501
|
+
[\`--\${P}-title-top-padding\`]: (layoutType === 'a' || layoutType === 'b' || layoutType === 'c') && position === 'top' ? scaled(titleTopPadding) : undefined,
|
|
21502
|
+
[\`--\${P}-title-left-padding\`]: (
|
|
21503
|
+
((layoutType === 'a' || layoutType === 'b') && (position === 'left' || position === 'top'))
|
|
21504
|
+
|| (layoutType === 'c' && (position === 'left' || position === 'top'))
|
|
21505
|
+
) ? scaled(titleLeftPadding) : undefined,
|
|
21506
|
+
[\`--\${P}-title-right-padding\`]: (
|
|
21507
|
+
((layoutType === 'c' || layoutType === 'b') && position === 'right')
|
|
21508
|
+
|| (layoutType === 'a' && position === 'right')
|
|
21509
|
+
) ? scaled(titleRightPadding) : undefined,
|
|
21155
21510
|
} as React.CSSProperties}
|
|
21156
21511
|
>
|
|
21157
|
-
{showControls && position === 'top' && (
|
|
21158
|
-
<div
|
|
21159
|
-
data-controls="titleTopPadding"
|
|
21160
|
-
data-controls-axis="y"
|
|
21161
|
-
data-controls-variant="row-padding"
|
|
21162
|
-
data-controls-min="0"
|
|
21163
|
-
data-controls-center-only-drag=""
|
|
21164
|
-
data-controls-hit-placement="left-y"
|
|
21165
|
-
className={\`\${P}-control-anchor\`}
|
|
21166
|
-
style={{
|
|
21167
|
-
top: 0,
|
|
21168
|
-
left: 0,
|
|
21169
|
-
width: '100%',
|
|
21170
|
-
height: scaled(titleTopPaddingHeight),
|
|
21171
|
-
}}
|
|
21172
|
-
/>
|
|
21173
|
-
)}
|
|
21174
21512
|
{usesSingleTitle && (
|
|
21175
21513
|
<div className={\`\${P}-single-title-layer\`}>
|
|
21176
21514
|
<StickyTitle
|
|
@@ -21186,6 +21524,14 @@ export function Mercury({
|
|
|
21186
21524
|
titleTextBoxStyle={titleTextBoxStyle}
|
|
21187
21525
|
titleStyle={titleStyle}
|
|
21188
21526
|
showTextBoxOutline={showControls}
|
|
21527
|
+
topPaddingControl={showTitleTopPaddingControl
|
|
21528
|
+
? renderTitleTopPaddingControl({
|
|
21529
|
+
P,
|
|
21530
|
+
scaled,
|
|
21531
|
+
height: titleTopPaddingHeight,
|
|
21532
|
+
paired: false,
|
|
21533
|
+
})
|
|
21534
|
+
: undefined}
|
|
21189
21535
|
/>
|
|
21190
21536
|
</div>
|
|
21191
21537
|
)}
|
|
@@ -21204,6 +21550,14 @@ export function Mercury({
|
|
|
21204
21550
|
titleTextBoxStyle: usesSingleTitle ? { maxWidth: '100%' } : titleTextBoxStyle,
|
|
21205
21551
|
titleStyle,
|
|
21206
21552
|
showTextBoxOutline: showControls && !usesSingleTitle,
|
|
21553
|
+
topPaddingControl: showTitleTopPaddingControl && !usesSingleTitle
|
|
21554
|
+
? renderTitleTopPaddingControl({
|
|
21555
|
+
P,
|
|
21556
|
+
scaled,
|
|
21557
|
+
height: titleTopPaddingHeight,
|
|
21558
|
+
paired: hasMultipleItems,
|
|
21559
|
+
})
|
|
21560
|
+
: undefined,
|
|
21207
21561
|
};
|
|
21208
21562
|
|
|
21209
21563
|
return (
|
|
@@ -21217,6 +21571,26 @@ export function Mercury({
|
|
|
21217
21571
|
: undefined,
|
|
21218
21572
|
}}
|
|
21219
21573
|
>
|
|
21574
|
+
{showTitleLeftPaddingControl && renderTitleColumnPaddingControl({
|
|
21575
|
+
P,
|
|
21576
|
+
controlKey: 'titleLeftPadding',
|
|
21577
|
+
scaled,
|
|
21578
|
+
width: titleLeftPaddingWidth,
|
|
21579
|
+
maxFraction: titleColumnMaxFraction,
|
|
21580
|
+
side: 'left',
|
|
21581
|
+
paired: hasMultipleItems,
|
|
21582
|
+
anchorStyle: titleLeftPaddingControlStyle,
|
|
21583
|
+
})}
|
|
21584
|
+
{showTitleRightPaddingControl && renderTitleColumnPaddingControl({
|
|
21585
|
+
P,
|
|
21586
|
+
controlKey: 'titleRightPadding',
|
|
21587
|
+
scaled,
|
|
21588
|
+
width: titleRightPaddingWidth,
|
|
21589
|
+
maxFraction: titleColumnMaxFraction,
|
|
21590
|
+
side: 'right',
|
|
21591
|
+
paired: hasMultipleItems,
|
|
21592
|
+
anchorStyle: titleRightPaddingControlStyle,
|
|
21593
|
+
})}
|
|
21220
21594
|
{showControls && showEntryPaddingAfter && (
|
|
21221
21595
|
<div
|
|
21222
21596
|
data-controls="galleryPaddingBetween"
|
|
@@ -21338,4 +21712,4 @@ export function Mercury({
|
|
|
21338
21712
|
</>
|
|
21339
21713
|
);
|
|
21340
21714
|
}
|
|
21341
|
-
`;function Zo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ca={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},y0={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}}},required:["gallery"]},default:[{title:"Earth-orbital mission",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Salton Sea from Above",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Lunar Module Pilot",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Command Module",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]}]},settings:{sizing:"auto auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},imgWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},titleWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},galleryPaddingRight:Zo("Gallery Padding Right"),galleryPaddingLeft:Zo("Gallery Padding Left"),galleryPaddingBetween:Zo("Gallery Padding Between"),cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},imgCaption:{type:"boolean",scope:"common",title:"Img caption",display:{type:"toggle-cycle",enum:["on","off"]}},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right","top"]}},titleTopPadding:Zo("Title Top Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...ca.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"}},titleAlign:{...ca.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...ca.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:{type:"a",imgCaption:"on",position:"center",transition:"scroll",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"left",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{wrapperWidth:1,imgWidth:300/1440,titleWidth:400/1440,galleryPaddingRight:0,galleryPaddingLeft:0,galleryPaddingBetween:0,titleTopPadding:0,cornerRadius:8/1440,titleFontSize:.027,titleLineHeight:.0222,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{wrapperWidth:1,imgWidth:120/375,titleWidth:220/375,galleryPaddingRight:0,galleryPaddingLeft:0,galleryPaddingBetween:0,titleTopPadding:0,cornerRadius:8/375,titleFontSize:.1066,titleLineHeight:.0853,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{wrapperWidth:1,imgWidth:300/768,titleWidth:260/768,galleryPaddingRight:0,galleryPaddingLeft:0,galleryPaddingBetween:0,titleTopPadding:0,cornerRadius:8/768,titleFontSize:.03255,titleLineHeight:.03255,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","imgCaption","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imgCaption"]},{type:"row",items:["imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{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"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},v0={element:h0,id:"mercury",name:"Mercury",category:"lists",layoutMode:"structured",version:1,defaultSize:{d:{width:720,height:540}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Mercury.mp4"},schema:y0,sourceCode:f0,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},x0=[Uu,ep,yy,qp,tm,um,Mm,Nm,Vm,ug,oh,af,hf,Zf,ly,Ey,Tv,Dy,zv,v0];exports.components=x0;exports.isSchemaV1=Hc;
|
|
21715
|
+
`;function Ti(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const da={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},$0={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}}},required:["gallery"]},default:[{title:"AX-2 Space Suit",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Earth-orbital mission",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Salton Sea from Above",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-12.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]}]},settings:{sizing:"auto auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},imgWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},titleWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},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"}}},galleryPaddingRight:Ti("Gallery Padding Right"),galleryPaddingLeft:Ti("Gallery Padding Left"),galleryPaddingBetween:Ti("Gallery Padding Between"),cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right","top"]}},titleTopPadding:Ti("Title Top Padding"),titleLeftPadding:Ti("Title Left Padding"),titleRightPadding:Ti("Title Right Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...da.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"}},titleAlign:{...da.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...da.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:{type:"a",position:"left",transition:"scroll",titleColor:"#000000",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"center",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{wrapperWidth:1,imgWidth:600/1440,titleWidth:400/1440,galleryPaddingRight:30/1440,galleryPaddingLeft:30/1440,galleryPaddingBetween:30/1440,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:4/1440,titleFontSize:73/1440,titleLineHeight:66/1440,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{wrapperWidth:1,imgWidth:200/375,titleWidth:210/375,galleryPaddingRight:10/375,galleryPaddingLeft:10/375,galleryPaddingBetween:10/375,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:8/375,titleFontSize:30/375,titleLineHeight:25/375,lightboxCounterFontSize:14/375,lightboxCounterLineHeight:14/375},t:{wrapperWidth:1,imgWidth:300/768,titleWidth:320/768,galleryPaddingRight:20/768,galleryPaddingLeft:20/768,galleryPaddingBetween:20/768,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:8/768,position:"center",titleFontSize:58/768,titleLineHeight:48/768,lightboxCounterFontSize:8/768,lightboxCounterLineHeight:8/768}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{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"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},C0={element:w0,id:"mercury",name:"Mercury",category:"lists",layoutMode:"structured",version:1,defaultSize:{d:{width:720,height:540}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Mercury.mp4"},schema:$0,sourceCode:S0,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},T0=[Zu,op,Sy,Yp,rm,hm,Fm,Dm,Km,fg,ch,uf,bf,ny,my,Fy,Ev,Gy,Uv,C0];exports.components=T0;exports.isSchemaV1=zc;
|